diff --git a/CHANGELOG.md b/CHANGELOG.md index d7c4e20..47874e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +### 2.0.2 - UNRELEASED + +* Updated Cesium engine to 1.34 and leveraged the new [`basepath`](https://github.com/AnalyticalGraphicsInc/cesium/issues/5320) option in `Cesium.Model.fromGltf`. +* Updated Babylon.js engine to get a [tangent fix](https://github.com/BabylonJS/Babylon.js/pull/2222). +* Babylon (like Cesium) now defaults to previewing the content in the tab as opposed to the content saved in the file. + ### 2.0.1 - 2017-06-01 * Update Babylon engine to fix glTF 1.0 support. diff --git a/README.md b/README.md index b8d6be4..57df347 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ This works for arrays as well, for example the list of enabled render states. H Press ALT + G on your glTF file, or look for the command `Preview 3D Model` in VSCode's list of commands (CTRL + SHIFT + P) and use that. -The Babylon.js and Three.js engines will preview the saved model as opposed to -the current content in your open VS Code tab. The Cesium engine will first try +The Three.js engines will preview the saved model as opposed to +the current content in your open VS Code tab. The Babylon and Cesium engines will first try to preview what is currently in your tab, and only if that fails will it fall back on displaying the version of the model saved on disk. diff --git a/engines/Cesium/Cesium.js b/engines/Cesium/Cesium.js index 8314b9f..730c9d7 100644 --- a/engines/Cesium/Cesium.js +++ b/engines/Cesium/Cesium.js @@ -25,21 +25,6 @@ * Released under MIT license, http://github.com/requirejs/almond/LICENSE */ -/** - @license - when.js - https://github.com/cujojs/when - - MIT License (c) copyright B Cavalier & J Hann - - * A lightweight CommonJS Promises/A and when() implementation - * when is part of the cujo.js family of libraries (http://cujojs.com/) - * - * Licensed under the MIT License at: - * http://www.opensource.org/licenses/mit-license.php - * - * @version 1.7.1 - */ - /** @license mersenne-twister.js - https://gist.github.com/banksean/300494 @@ -75,6 +60,46 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/** + * @license + * + * Grauw URI utilities + * + * See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js + * + * @author Laurens Holst (http://www.grauw.nl/) + * + * Copyright 2012 Laurens Holst + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +/** + @license + when.js - https://github.com/cujojs/when + + MIT License (c) copyright B Cavalier & J Hann + + * A lightweight CommonJS Promises/A and when() implementation + * when is part of the cujo.js family of libraries (http://cujojs.com/) + * + * Licensed under the MIT License at: + * http://www.opensource.org/licenses/mit-license.php + * + * @version 1.7.1 + */ + /** @license sprintf.js from the php.js project - https://github.com/kvz/phpjs @@ -202,31 +227,6 @@ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/** - * @license - * - * Grauw URI utilities - * - * See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js - * - * @author Laurens Holst (http://www.grauw.nl/) - * - * Copyright 2012 Laurens Holst - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - // Copyright 2012 Google Inc., Apache 2.0 license. /** @@ -256,6 +256,19 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/*! + * protobuf.js v6.7.0 (c) 2016, Daniel Wirtz + * Compiled Wed, 22 Mar 2017 17:30:26 UTC + * Licensed under the BSD-3-Clause License + * see: https://github.com/dcodeIO/protobuf.js for details + */ + +/** + * Dictionary of provider id to copyright strings. + * @type {Object} + * @default {} + */ + /** @license fontmetrics.js - https://github.com/Pomax/fontmetrics.js @@ -354,17 +367,63 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /** * @license - * Copyright (c) 2011 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. * - * TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED - * *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS - * OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT,IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA - * OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT, OR - * CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS - * OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY - * OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, - * EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of NVIDIA CORPORATION nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @license + * Copyright (c) 2000-2005, Sean O'Neil (s_p_oneil@hotmail.com) + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the project nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Modifications made by Analytical Graphics, Inc. */ /** @@ -454,70 +513,81 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * MIT license **/ -!function(){var requirejs,require,define;!function(e){function t(e,t){return v.call(e,t)}function i(e,t){var i,r,n,o,a,s,l,u,c,d,h,p,f=t&&t.split("/"),m=_.map,g=m&&m["*"]||{};if(e){for(e=e.split("/"),a=e.length-1,_.nodeIdCompat&&C.test(e[a])&&(e[a]=e[a].replace(C,"")),"."===e[0].charAt(0)&&f&&(p=f.slice(0,f.length-1),e=p.concat(e)),c=0;c0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((f||g)&&m){for(i=e.split("/"),c=i.length;c>0;c-=1){if(r=i.slice(0,c).join("/"),f)for(d=f.length;d>0;d-=1)if(n=m[f.slice(0,d).join("/")],n&&(n=n[r])){o=n,s=c;break}if(o)break;!l&&g&&g[r]&&(l=g[r],u=c)}!o&&l&&(o=l,s=u),o&&(i.splice(0,s,o),e=i.join("/"))}return e}function r(t,i){return function(){var r=y.call(arguments,0);return"string"!=typeof r[0]&&1===r.length&&r.push(null),d.apply(e,r.concat([t,i]))}}function n(e){return function(t){return i(t,e)}}function o(e){return function(t){f[e]=t}}function a(i){if(t(m,i)){var r=m[i];delete m[i],g[i]=!0,c.apply(e,r)}if(!t(f,i)&&!t(g,i))throw new Error("No "+i);return f[i]}function s(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function l(e){return e?s(e):[]}function u(e){return function(){return _&&_.config&&_.config[e]||{}}}var c,d,h,p,f={},m={},_={},g={},v=Object.prototype.hasOwnProperty,y=[].slice,C=/\.js$/;h=function(e,t){var r,o=s(e),l=o[0],u=t[1];return e=o[1],l&&(l=i(l,u),r=a(l)),l?e=r&&r.normalize?r.normalize(e,n(u)):i(e,u):(e=i(e,u),o=s(e),l=o[0],e=o[1],l&&(r=a(l))),{f:l?l+"!"+e:e,n:e,pr:l,p:r}},p={require:function(e){return r(e)},exports:function(e){var t=f[e];return"undefined"!=typeof t?t:f[e]={}},module:function(e){return{id:e,uri:"",exports:f[e],config:u(e)}}},c=function(i,n,s,u){var c,d,_,v,y,C,w,S=[],E=typeof s;if(u=u||i,C=l(u),"undefined"===E||"function"===E){for(n=!n.length&&s.length?["require","exports","module"]:n,y=0;y>>0,u=Math.max(0,Math.min(i,v)),d=[],c=v-u+1,h=[],p=a(),u)for(_=p.progress,m=function(e){h.push(e),--c||(f=m=g,p.reject(h))},f=function(e){d.push(e),--u||(f=m=g,p.resolve(d))},y=0;y>>0,r=[],u=a(),o)for(s=function(t,n){e(t,i).then(function(e){r[n]=e,--o||u.resolve(r)},u.reject)},l=0;l2;return e(t,function(e){return e=n?r:e,i.resolve(e),e},function(e){return i.reject(e),o(e)},i.progress)}function m(e,t){for(var i,r=0;i=e[r++];)i(t)}function _(e,t){for(var i,r=t.length;r>e;)if(i=t[--r],null!=i&&"function"!=typeof i)throw new Error("arg "+r+" must be a function")}function g(){}function v(e){return e}var y,C,w;return e.defer=a,e.resolve=t,e.reject=i,e.join=d,e.all=c,e.map=h,e.reduce=p,e.any=u,e.some=l,e.chain=f,e.isPromise=s,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(w,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(w,t)})})}},C=[].slice,y=[].reduce||function(e){var t,i,r,n,o;if(o=0,t=Object(this),n=t.length>>>0,i=arguments,i.length<=1)for(;;){if(o in t){r=t[o++];break}if(++o>=n)throw new TypeError}else r=i[1];for(;o=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+i)},n.typeOf.number.lessThanOrEquals=function(e,i,r){if(n.typeOf.number(e,i),i>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+i)},n.typeOf.number.greaterThan=function(e,i,r){if(n.typeOf.number(e,i),i<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+i)},n.typeOf.number.greaterThanOrEquals=function(e,i,r){if(n.typeOf.number(e,i),i>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:e<0?-1:0},n.signNotZero=function(e){return e<0?-1:1},n.toSNorm=function(e,i){return i=t(i,255),Math.round((.5*n.clamp(e,-1,1)+.5)*i)},n.fromSNorm=function(e,i){return i=t(i,255),n.clamp(e,0,i)/i*2-1},n.sinh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t-i)},n.cosh=function(e){var t=Math.pow(Math.E,e),i=Math.pow(Math.E,-1*e);return.5*(t+i)},n.lerp=function(e,t,i){return(1-i)*e+i*t},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=3*Math.PI*.5,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,i=e-Math.floor(e/t)*t;return i<-Math.PI?i+t:i>=Math.PI?i-t:i},n.clampToLatitudeRange=function(e){return n.clamp(e,-1*n.PI_OVER_TWO,n.PI_OVER_TWO)},n.negativePiToPi=function(e){return n.zeroToTwoPi(e+n.PI)-n.PI},n.zeroToTwoPi=function(e){var t=n.mod(e,n.TWO_PI);return Math.abs(t)n.EPSILON14?n.TWO_PI:t},n.mod=function(e,t){return(e%t+t)%t},n.equalsEpsilon=function(e,i,r,n){n=t(n,r);var o=Math.abs(e-i);return o<=n||o<=r*Math.max(Math.abs(e),Math.abs(i))};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var i=o[t-1],r=t;r<=e;r++)o.push(i*r);return o[e]},n.incrementWrap=function(e,i,r){return r=t(r,0),++e,e>i&&(e=r),e},n.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,i){return ei?i:e};var a=new e;return n.setRandomNumberSeed=function(t){a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.acosClamped=function(e){return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){return Math.asin(n.clamp(e,-1,1))},n.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},n.logBase=function(e,t){return Math.log(e)/Math.log(t)},n.fog=function(e,t){var i=e*t;return 1-Math.exp(-(i*i))},n}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i,r){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0)}a.fromSpherical=function(e,r){i(r)||(r=new a);var n=e.clock,o=e.cone,s=t(e.magnitude,1),l=s*Math.sin(o);return r.x=l*Math.cos(n),r.y=l*Math.sin(n),r.z=s*Math.cos(o),r},a.fromElements=function(e,t,r,n){return i(n)?(n.x=e,n.y=t,n.z=r,n):new a(e,t,r)},a.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new a(e.x,e.y,e.z)},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r]=e.z,i},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n.x=e[r++],n.y=e[r++],n.z=e[r],n},a.packArray=function(e,t){var r=e.length;i(t)?t.length=3*r:t=new Array(3*r);for(var n=0;nr.EPSILON12);return t(u)?(u.x=c*P,u.y=d*M,u.z=h*D,u):new e(c*P,d*M,h*D)}var o=new e,a=new e;return n}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a){"use strict";function s(e,i,r){this.longitude=t(e,0),this.latitude=t(i,0),this.height=t(r,0)}s.fromRadians=function(e,r,n,o){return n=t(n,0),i(o)?(o.longitude=e,o.latitude=r,o.height=n,o):new s(e,r,n)},s.fromDegrees=function(e,t,i,r){return e=o.toRadians(e),t=o.toRadians(t),s.fromRadians(e,t,i,r)};var l=new e,u=new e,c=new e,d=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),p=o.EPSILON1;return s.fromCartesian=function(t,r,n){var f=i(r)?r.oneOverRadii:d,m=i(r)?r.oneOverRadiiSquared:h,_=i(r)?r._centerToleranceSquared:p,g=a(t,f,m,_,u);if(i(g)){var v=e.multiplyComponents(g,m,l);v=e.normalize(v,v);var y=e.subtract(t,g,c),C=Math.atan2(v.y,v.x),w=Math.asin(v.z),S=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=C,n.latitude=w,n.height=S,n):new s(C,w,S)}},s.clone=function(e,t){if(i(e))return i(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height)},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},s.ZERO=n(new s(0,0,0)),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},s}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,r,n,o){r=i(r,0),n=i(n,0),o=i(o,0),t._radii=new e(r,n,o),t._radiiSquared=new e(r*r,n*n,o*o),t._radiiToTheFourth=new e(r*r*r*r,n*n*n*n,o*o*o*o),t._oneOverRadii=new e(0===r?0:1/r,0===n?0:1/n,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===n?0:1/(n*n),0===o?0:1/(o*o)),t._minimumRadius=Math.min(r,n,o),t._maximumRadius=Math.max(r,n,o),t._centerToleranceSquared=s.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(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._sqauredXOverSquaredZ=void 0,u(this,e,t,i)}n(c.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}}}),c.clone=function(t,i){if(r(t)){var n=t._radii;return r(i)?(e.clone(n,i._radii),e.clone(t._radiiSquared,i._radiiSquared),e.clone(t._radiiToTheFourth,i._radiiToTheFourth),e.clone(t._oneOverRadii,i._oneOverRadii),e.clone(t._oneOverRadiiSquared,i._oneOverRadiiSquared),i._minimumRadius=t._minimumRadius,i._maximumRadius=t._maximumRadius,i._centerToleranceSquared=t._centerToleranceSquared,i):new c(n.x,n.y,n.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(u(t,e.x,e.y,e.z),t):t},c.WGS84=a(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=a(new c(1,1,1)),c.MOON=a(new c(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,n){return n=i(n,0),e.pack(t._radii,r,n),r},c.unpack=function(t,r,n){r=i(r,0);var o=e.unpack(t,r);return c.fromCartesian3(o,n)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,i){var n=t.longitude,o=t.latitude,a=Math.cos(o),s=a*Math.cos(n),l=a*Math.sin(n),u=Math.sin(o);return r(i)||(i=new e),i.x=s,i.y=l,i.z=u,e.normalize(i,i)},c.prototype.geodeticSurfaceNormal=function(t,i){return r(i)||(i=new e),i=e.multiplyComponents(t,this._oneOverRadiiSquared,i),e.normalize(i,i)};var d=new e,h=new e;c.prototype.cartographicToCartesian=function(t,i){var n=d,o=h;this.geodeticSurfaceNormalCartographic(t,n),e.multiplyComponents(this._radiiSquared,n,o);var a=Math.sqrt(e.dot(n,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(n,t.height,n),r(i)||(i=new e),e.add(o,n,i)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var i=e.length;r(t)?t.length=i:t=new Array(i);for(var n=0;n=this._radii.z-n))return o},c}),define("Core/Event",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}return t(r.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),r.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var i=this;return function(){i.removeEventListener(e,t)}},r.prototype.removeEventListener=function(e,t){for(var i=this._listeners,r=this._scopes,n=-1,o=0;o=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,f),a=Math.max(a,f)}return n-i>a-o&&(i=o,n=a,n>s.PI&&(n-=s.TWO_PI),i>s.PI&&(i-=s.TWO_PI)),r(t)?(t.west=i,t.south=u,t.east=n,t.north=c,t):new l(i,u,n,c)},l.fromCartesianArray=function(e,t,i){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=0,p=e.length;h=0?f.longitude:f.longitude+s.TWO_PI;a=Math.min(a,m),u=Math.max(u,m)}return o-n>u-a&&(n=a,o=u,o>s.PI&&(o-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),r(i)?(i.west=n,i.south=c,i.east=o,i.north=d,i):new l(n,c,o,d)},l.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new l(e.west,e.south,e.east,e.north)},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},l.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},l.validate=function(e){},l.southwest=function(t,i){return r(i)?(i.longitude=t.west,i.latitude=t.south,i.height=0,i):new e(t.west,t.south)},l.northwest=function(t,i){return r(i)?(i.longitude=t.west,i.latitude=t.north,i.height=0,i):new e(t.west,t.north)},l.northeast=function(t,i){return r(i)?(i.longitude=t.east,i.latitude=t.north,i.height=0,i):new e(t.east,t.north)},l.southeast=function(t,i){return r(i)?(i.longitude=t.east,i.latitude=t.south,i.height=0,i):new e(t.east,t.south)},l.center=function(t,i){var n=t.east,o=t.west;n0?n+=s.TWO_PI:a0&&(a+=s.TWO_PI),n=p))return r(i)?(i.west=c,i.south=h,i.east=d,i.north=p,i):new l(c,h,d,p)}},l.simpleIntersection=function(e,t,i){var n=Math.max(e.west,t.west),o=Math.max(e.south,t.south),a=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||n>=a))return r(i)?(i.west=n,i.south=o,i.east=a,i.north=s,i):new l(n,o,a,s)},l.union=function(e,t,i){r(i)||(i=new l);var n=e.east,o=e.west,a=t.east,u=t.west;n0?n+=s.TWO_PI:a0&&(a+=s.TWO_PI),nn||s.equalsEpsilon(i,n,s.EPSILON14))&&(i=e.south&&r<=e.north};var u=new e;return l.subsample=function(e,t,n,a){t=i(t,o.WGS84),n=i(n,0),r(a)||(a=[]);var c=0,d=e.north,h=e.south,p=e.east,f=e.west,m=u;m.height=n,m.longitude=f,m.latitude=d,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=p,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.latitude=h,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=f,a[c]=t.cartographicToCartesian(m,a[c]),c++,d<0?m.latitude=d:h>0?m.latitude=h:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*s.PI_OVER_TWO,l.contains(e,m)&&(a[c]=t.cartographicToCartesian(m,a[c]),c++);return 0===m.latitude&&(m.longitude=f,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=p,a[c]=t.cartographicToCartesian(m,a[c]),c++),a.length=c,a},l.MAX_VALUE=a(new l(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),l}),define("Core/GeographicTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e){e=t(e,{}),this._ellipsoid=t(e.ellipsoid,o.WGS84),this._rectangle=t(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=t(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=t(e.numberOfLevelZeroTilesY,1)}return r(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<=a&&(p=a-1);var f=(o.north-t.latitude)/d|0;return f>=u&&(f=u-1),i(n)?(n.x=p,n.y=f,n):new e(p,f)}},u}),define("Core/getImagePixels",["./defined"],function(e){"use strict";function t(t,r,n){e(r)||(r=t.width),e(n)||(n=t.height);var o=i[r];e(o)||(o={},i[r]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=r,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(t,0,0,r,n),a.getImageData(0,0,r,n).data}var i={};return t}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,i,r,n){"use strict";function o(r,n,o){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(n,e.ZERO)),i(o)?o=e.clone(o):(o=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(o,.5,o)),this.center=o}o.fromPoints=function(t,r){if(i(r)||(r=new o),!i(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var n=t[0].x,a=t[0].y,s=t[0].z,l=t[0].x,u=t[0].y,c=t[0].z,d=t.length,h=1;h0?n.INSIDE:l+s<0?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersectPlane=function(e){return o.intersectPlane(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,i){this.start=e(t,0),this.stop=e(i,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,r,n,o,a,s,l,u){this[0]=i(e,0),this[1]=i(n,0),this[2]=i(s,0),this[3]=i(t,0),this[4]=i(o,0),this[5]=i(l,0),this[6]=i(r,0),this[7]=i(a,0),this[8]=i(u,0)}function u(e){for(var t=0,i=0;i<9;++i){var r=e[i];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,i=0;i<3;++i){var r=e[l.getElementIndex(m[i],f[i])];t+=2*r*r}return Math.sqrt(t)}function d(e,t){for(var i=s.EPSILON15,r=0,n=1,o=0;o<3;++o){var a=Math.abs(e[l.getElementIndex(m[o],f[o])]);a>r&&(n=o,r=a)}var u=1,c=0,d=f[n],h=m[n];if(Math.abs(e[l.getElementIndex(h,d)])>i){var p,_=e[l.getElementIndex(h,h)],g=e[l.getElementIndex(d,d)],v=e[l.getElementIndex(h,d)],y=(_-g)/2/v;p=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),u=1/Math.sqrt(1+p*p),c=p*u}return t=l.clone(l.IDENTITY,t),t[l.getElementIndex(d,d)]=t[l.getElementIndex(h,h)]=u,t[l.getElementIndex(h,d)]=c,t[l.getElementIndex(d,h)]=-c,t}l.packedLength=9,l.pack=function(e,t,r){return r=i(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},l.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n},l.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new l(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},l.fromArray=function(e,t,n){return t=i(t,0),r(n)||(n=new l),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n},l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},l.fromQuaternion=function(e,t){var i=e.x*e.x,n=e.x*e.y,o=e.x*e.z,a=e.x*e.w,s=e.y*e.y,u=e.y*e.z,c=e.y*e.w,d=e.z*e.z,h=e.z*e.w,p=e.w*e.w,f=i-s-d+p,m=2*(n-h),_=2*(o+c),g=2*(n+h),v=-i+s-d+p,y=2*(u-a),C=2*(o-c),w=2*(u+a),S=-i-s+d+p;return r(t)?(t[0]=f,t[1]=g,t[2]=C,t[3]=m,t[4]=v,t[5]=w,t[6]=_,t[7]=y,t[8]=S,t):new l(f,m,_,g,v,y,C,w,S)},l.fromHeadingPitchRoll=function(e,t){var i=Math.cos(-e.pitch),n=Math.cos(-e.heading),o=Math.cos(e.roll),a=Math.sin(-e.pitch),s=Math.sin(-e.heading),u=Math.sin(e.roll),c=i*n,d=-o*s+u*a*n,h=u*s+o*a*n,p=i*s,f=o*n+u*a*s,m=-a*o+o*a*s,_=-a,g=u*i,v=o*i;return r(t)?(t[0]=c,t[1]=p,t[2]=_,t[3]=d,t[4]=f,t[5]=g,t[6]=h,t[7]=m,t[8]=v,t):new l(c,d,h,p,f,m,_,g,v)},l.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new l(e.x,0,0,0,e.y,0,0,0,e.z)},l.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new l(e,0,0,0,e,0,0,0,e)},l.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new l(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},l.fromRotationX=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=i,t[5]=n,t[6]=0,t[7]=-n,t[8]=i,t):new l(1,0,0,0,i,-n,0,n,i)},l.fromRotationY=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=i,t):new l(i,0,n,0,1,0,-n,0,i)},l.fromRotationZ=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=n,t[2]=0,t[3]=-n,t[4]=i,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new l(i,-n,0,n,i,0,0,0,1)},l.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},l.getElementIndex=function(e,t){return 3*e+t},l.getColumn=function(e,t,i){var r=3*t,n=e[r],o=e[r+1],a=e[r+2];return i.x=n,i.y=o,i.z=a,i},l.setColumn=function(e,t,i,r){r=l.clone(e,r);var n=3*t;return r[n]=i.x,r[n+1]=i.y,r[n+2]=i.z,r},l.getRow=function(e,t,i){var r=e[t],n=e[t+3],o=e[t+6];return i.x=r,i.y=n,i.z=o,i},l.setRow=function(e,t,i,r){return r=l.clone(e,r),r[t]=i.x,r[t+3]=i.y,r[t+6]=i.z,r};var h=new e;l.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),i.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),i.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),i};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,i){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return i[0]=r,i[1]=n,i[2]=o,i[3]=a,i[4]=s,i[5]=l,i[6]=u,i[7]=c,i[8]=d,i},l.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i[4]=e[4]+t[4],i[5]=e[5]+t[5],i[6]=e[6]+t[6],i[7]=e[7]+t[7],i[8]=e[8]+t[8],i},l.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i[4]=e[4]-t[4],i[5]=e[5]-t[5],i[6]=e[6]-t[6],i[7]=e[7]-t[7],i[8]=e[8]-t[8],i},l.multiplyByVector=function(e,t,i){var r=t.x,n=t.y,o=t.z,a=e[0]*r+e[3]*n+e[6]*o,s=e[1]*r+e[4]*n+e[7]*o,l=e[2]*r+e[5]*n+e[8]*o;return i.x=a,i.y=s,i.z=l,i},l.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i[4]=e[4]*t,i[5]=e[5]*t,i[6]=e[6]*t,i[7]=e[7]*t,i[8]=e[8]*t,i},l.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.x,i[3]=e[3]*t.y,i[4]=e[4]*t.y,i[5]=e[5]*t.y,i[6]=e[6]*t.z,i[7]=e[7]*t.z,i[8]=e[8]*t.z,i},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},l.transpose=function(e,t){var i=e[0],r=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],u=e[5],c=e[8];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var f=[1,0,0],m=[2,2,1],_=new l,g=new l;return l.computeEigenDecomposition=function(e,t){var i=s.EPSILON20,n=10,o=0,a=0;r(t)||(t={});for(var h=t.unitary=l.clone(l.IDENTITY,t.unitary),p=t.diagonal=l.clone(e,t.diagonal),f=i*u(p);af;)d(p,_),l.transpose(_,g),l.multiply(p,_,p),l.multiply(g,p,p),l.multiply(h,_,h),++o>2&&(++a,o=0);return t},l.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},l.determinant=function(e){var t=e[0],i=e[3],r=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*r-i*u)+s*(i*a-o*r)},l.inverse=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],d=e[8],h=l.determinant(e);t[0]=a*d-c*s,t[1]=c*n-r*d,t[2]=r*s-a*n,t[3]=u*s-o*d,t[4]=i*d-u*n,t[5]=o*n-i*s,t[6]=o*c-u*a,t[7]=u*r-i*c,t[8]=i*a-o*r;var p=1/h;return l.multiplyByScalar(t,p,t)},l.equals=function(e,t){return e===t||r(e)&&r(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]},l.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(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},l.IDENTITY=a(new l(1,0,0,0,1,0,0,0,1)),l.ZERO=a(new l(0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN1ROW0=3,l.COLUMN1ROW1=4,l.COLUMN1ROW2=5,l.COLUMN2ROW0=6,l.COLUMN2ROW1=7,l.COLUMN2ROW2=8,n(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.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]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},l}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,i,r,n){this.x=t(e,0),this.y=t(i,0),this.z=t(r,0),this.w=t(n,0)}a.fromElements=function(e,t,r,n,o){return i(o)?(o.x=e,o.y=t,o.z=r,o.w=n,o):new a(e,t,r,n)},a.fromColor=function(e,t){return i(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(e,i,r){return r=t(r,0),i[r++]=e.x,i[r++]=e.y,i[r++]=e.z,i[r]=e.w,i},a.unpack=function(e,r,n){return r=t(r,0),i(n)||(n=new a),n.x=e[r++],n.y=e[r++],n.z=e[r++],n.w=e[r],n},a.packArray=function(e,t){var r=e.length;i(t)?t.length=4*r:t=new Array(4*r);for(var n=0;nl.x&&e.clone(r,l),Au.y&&e.clone(r,u),Pc.z&&e.clone(r,c)}var M=e.magnitudeSquared(e.subtract(l,o,C)),D=e.magnitudeSquared(e.subtract(u,a,C)),I=e.magnitudeSquared(e.subtract(c,s,C)),R=o,O=l,N=M;D>N&&(N=D,R=a,O=u),I>N&&(N=I,R=s,O=c);var L=w;L.x=.5*(R.x+O.x),L.y=.5*(R.y+O.y),L.z=.5*(R.z+O.z);var B=e.magnitudeSquared(e.subtract(O,L,C)),F=Math.sqrt(B),k=S;k.x=o.x,k.y=a.y,k.z=s.z;var V=E;V.x=l.x,V.y=u.y,V.z=c.z;var z=e.multiplyByScalar(e.add(k,V,C),.5,b),U=0;for(T=0;TU&&(U=G);var H=e.magnitudeSquared(e.subtract(r,L,C));if(H>B){var W=Math.sqrt(H);F=.5*(F+W),B=F*F;var q=W-F;L.x=(F*L.x+q*r.x)/W,L.y=(F*L.y+q*r.y)/W,L.z=(F*L.z+q*r.z)/W}}return Fd.x&&e.clone(s,d),DT.y&&e.clone(s,T),Ix.z&&e.clone(s,x)}var R=e.magnitudeSquared(e.subtract(d,l,C)),O=e.magnitudeSquared(e.subtract(T,u,C)),N=e.magnitudeSquared(e.subtract(x,c,C)),L=l,B=d,F=R;O>F&&(F=O,L=u,B=T),N>F&&(F=N,L=c,B=x);var k=w;k.x=.5*(L.x+B.x),k.y=.5*(L.y+B.y),k.z=.5*(L.z+B.z);var V=e.magnitudeSquared(e.subtract(B,k,C)),z=Math.sqrt(V),U=S;U.x=l.x,U.y=u.y,U.z=c.z;var G=E;G.x=d.x,G.y=T.y,G.z=x.z;var H=e.multiplyByScalar(e.add(U,G,C),.5,b),W=0;for(P=0;PW&&(W=q);var j=e.magnitudeSquared(e.subtract(s,k,C));if(j>V){var Y=Math.sqrt(j);z=.5*(z+Y),V=z*z;var X=Y-z;k.x=(z*k.x+X*s.x)/Y,k.y=(z*k.y+X*s.y)/Y,k.z=(z*k.z+X*s.z)/Y}}return zu.x&&e.clone(o,u),Pc.y&&e.clone(o,c),Md.z&&e.clone(o,d)}var D=e.magnitudeSquared(e.subtract(u,a,C)),I=e.magnitudeSquared(e.subtract(c,s,C)),R=e.magnitudeSquared(e.subtract(d,l,C)),O=a,N=u,L=D;I>L&&(L=I,O=s,N=c),R>L&&(L=R,O=l,N=d);var B=w;B.x=.5*(O.x+N.x),B.y=.5*(O.y+N.y),B.z=.5*(O.z+N.z);var F=e.magnitudeSquared(e.subtract(N,B,C)),k=Math.sqrt(F),V=S;V.x=a.x,V.y=s.y,V.z=l.z;var z=E;z.x=u.x,z.y=c.y,z.z=d.z;var U=e.multiplyByScalar(e.add(V,z,C),.5,b),G=0;for(x=0;xG&&(G=H);var W=e.magnitudeSquared(e.subtract(o,B,C));if(W>F){var q=Math.sqrt(W);k=.5*(k+q),F=k*k;var j=q-k;B.x=(k*B.x+j*o.x)/q,B.y=(k*B.y+j*o.y)/q,B.z=(k*B.z+j*o.z)/q}}return k=c+l)return t.clone(r),r;if(l>=c+a)return i.clone(r),r;var d=.5*(a+c+l),p=e.multiplyByScalar(u,(-a+d)/c,B);return e.add(p,o,p),e.clone(p,r.center),r.radius=d,r};var F=new e;h.expand=function(t,i,r){r=h.clone(t,r);var n=e.magnitude(e.subtract(i,r.center,F));return n>r.radius&&(r.radius=n),r},h.intersectPlane=function(t,i){var r=t.center,n=t.radius,o=i.normal,a=e.dot(o,r)+i.distance;return a<-n?s.OUTSIDE:a0:o>r&&o*o/t.magnitudeSquared(n)>r;return!a},s.prototype.computeHorizonCullingPoint=function(e,i,n){r(n)||(n=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,d=0,h=i.length;ds&&s/a0?[h/e,n/h]:[n/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function i(e,t,i,r){var n,o,a=e,s=t/3,l=i/3,u=r,c=a*l,d=s*u,h=s*s,p=l*l,f=a*l-h,m=a*u-s*l,_=s*u-p,g=4*f*_-m*m;if(g<0){var v,y,C;h*d>=c*p?(v=a,y=f,C=-2*s*f+a*m):(v=u,y=_,C=-u*m+2*l*_);var w=C<0?-1:1,S=-w*Math.abs(v)*Math.sqrt(-g);o=-C+S;var E=o/2,b=E<0?-Math.pow(-E,1/3):Math.pow(E,1/3),T=o===S?-b:-y/b;return n=y<=0?b+T:-C/(b*b+T*T+y),h*d>=c*p?[(n-s)/a]:[-u/(n+l)]}var x=f,A=-2*s*f+a*m,P=_,M=-u*m+2*l*_,D=Math.sqrt(g),I=Math.sqrt(3)/2,R=Math.abs(Math.atan2(a*D,-A)/3);n=2*Math.sqrt(-x);var O=Math.cos(R);o=n*O;var N=n*(-O/2-I*Math.sin(R)),L=o+N>2*s?o-s:N-s,B=a,F=L/B;R=Math.abs(Math.atan2(u*D,-M)/3),n=2*Math.sqrt(-P),O=Math.cos(R),o=n*O,N=n*(-O/2-I*Math.sin(R));var k=-u,V=o+N<2*l?o+l:N+l,z=k/V,U=B*V,G=-L*V-B*k,H=L*k,W=(l*G-s*H)/(-s*G+l*U);return F<=W?F<=z?W<=z?[F,W,z]:[F,z,W]:[z,F,W]:F<=z?[W,F,z]:W<=z?[W,z,F]:[z,W,F]}var r={};return r.computeDiscriminant=function(e,t,i,r){var n=e*e,o=t*t,a=i*i,s=r*r,l=18*e*t*i*r+o*a-27*n*s-4*(e*a*i+o*t*r);return l},r.computeRealRoots=function(e,r,n,o){var a,s;if(0===e)return t.computeRealRoots(r,n,o);if(0===r){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[l,l,l]}return 0===o?(a=t.computeRealRoots(e,0,n),0===a.Length?[0]:[a[0],0,a[1]]):i(e,0,n,o)}return 0===n?0===o?(s=-r/e,s<0?[s,0,0]:[0,0,s]):i(e,r,0,o):0===o?(a=t.computeRealRoots(e,r,n),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):i(e,r,n,o)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,i,r){"use strict";function n(t,n,o,a){var s=t*t,l=n-3*s/8,u=o-n*t/2+s*t/8,c=a-o*t/4+n*s/16-3*s*s/256,d=e.computeRealRoots(1,2*l,l*l-4*c,-u*u);if(d.length>0){var h=-t/4,p=d[d.length-1];if(Math.abs(p)=0&&g>=0){var v=Math.sqrt(_),y=Math.sqrt(g);return[h-y,h-v,h+v,h+y]}if(_>=0&&g<0)return m=Math.sqrt(_),[h-m,h+m];if(_<0&&g>=0)return m=Math.sqrt(g),[h-m,h+m]}return[]}if(p>0){var C=Math.sqrt(p),w=(l+p-u/C)/2,S=(l+p+u/C)/2,E=r.computeRealRoots(1,C,w),b=r.computeRealRoots(1,-C,S);return 0!==E.length?(E[0]+=h,E[1]+=h,0!==b.length?(b[0]+=h,b[1]+=h,E[1]<=b[0]?[E[0],E[1],b[0],b[1]]:b[1]<=E[0]?[b[0],b[1],E[0],E[1]]:E[0]>=b[0]&&E[1]<=b[1]?[b[0],E[0],E[1],b[1]]:b[0]>=E[0]&&b[1]<=E[1]?[E[0],b[0],b[1],E[1]]:E[0]>b[0]&&E[0]0){var f,m,_=p[0],g=n-_,v=g*g,y=t/2,C=g/2,w=v-4*a,S=v+4*Math.abs(a),E=u-4*_,b=u+4*Math.abs(_);if(_<0||w*b=R[0]&&I[1]<=R[1]?[R[0],I[0],I[1],R[1]]:R[0]>=I[0]&&R[1]<=I[1]?[I[0],R[0],R[1],I[1]]:I[0]>R[0]&&I[0]0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return s0?y.push(new e(n,o*B,o*-V)):0!==V?(y.push(new e(n,o*B,o*-V)),y.push(new e(n,o*B,o*V)),++N):y.push(new e(n,o*B,o*V))}return y}var m={};m.rayPlane=function(t,i,n){r(n)||(n=new e);var o=t.origin,s=t.direction,l=i.normal,u=e.dot(l,s);if(!(Math.abs(u)E)return;if(u=e.cross(l,m,C),d=e.dot(f,u),d<0||c+d>E)return;h=e.dot(w,u)/E}else{if(Math.abs(E)1)return;if(u=e.cross(l,m,C),d=e.dot(f,u)*b,d<0||c+d>1)return;h=e.dot(w,u)*b}return h},m.rayTriangle=function(t,i,n,o,a,s){var l=m.rayTriangleParametric(t,i,n,o,a);if(r(l)&&!(l<0))return r(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s)};var w=new c;m.lineSegmentTriangle=function(t,i,n,o,a,s,l){var u=w;e.clone(t,u.origin),e.subtract(i,t,u.direction),e.normalize(u.direction,u.direction);var c=m.rayTriangleParametric(u,n,o,a,s);if(!(!r(c)||c<0||c>e.distance(t,i)))return r(l)||(l=new e),e.multiplyByScalar(u.direction,c,l),e.add(u.origin,l,l)};var S={root0:0,root1:0};m.raySphere=function(e,t,i){if(i=h(e,t,i),r(i)&&!(i.stop<0))return i.start=Math.max(i.start,0),i};var E=new c;m.lineSegmentSphere=function(t,i,n,o){var a=E;e.clone(t,a.origin);var s=e.subtract(i,t,a.direction),l=e.magnitude(s);if(e.normalize(s,s),o=h(a,n,o),!(!r(o)||o.stop<0||o.start>l))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o};var b=new e,T=new e;m.rayEllipsoid=function(t,i){var r,n,a,s,l,u=i.oneOverRadii,c=e.multiplyComponents(u,t.origin,b),d=e.multiplyComponents(u,t.direction,T),h=e.magnitudeSquared(c),p=e.dot(c,d);if(h>1){if(p>=0)return;var f=p*p;if(r=h-1,n=e.magnitudeSquared(d),a=n*r,fa){s=p*p-a,l=-p+Math.sqrt(s);var m=l/n,_=r/l;return m<_?new o(m,_):{start:_,stop:m}}var g=Math.sqrt(r/n);return new o(g,g)}return h<1?(r=h-1,n=e.magnitudeSquared(d),a=n*r,s=p*p-a,l=-p+Math.sqrt(s),new o(0,l/n)):p<0?(n=e.magnitudeSquared(d),new o(0,-p/n)):void 0};var x=new e,A=new e,P=new e,M=new e,D=new e,I=new s,R=new s,O=new s,N=new s,L=new s,B=new s,F=new s,k=new e,V=new e,z=new t;m.grazingAltitudeLocation=function(t,i){var n=t.origin,o=t.direction;if(!e.equals(n,e.ZERO)){var l=i.geodeticSurfaceNormal(n,x);if(e.dot(o,l)>=0)return n}var u=r(this.rayEllipsoid(t,i)),c=i.transformPositionToScaledSpace(o,x),d=e.normalize(c,c),h=e.mostOrthogonalAxis(c,M),p=e.normalize(e.cross(h,d,A),A),m=e.normalize(e.cross(d,p,P),P),_=I;_[0]=d.x,_[1]=d.y,_[2]=d.z,_[3]=p.x,_[4]=p.y,_[5]=p.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var g=s.transpose(_,R),v=s.fromScale(i.radii,O),y=s.fromScale(i.oneOverRadii,N),C=L;C[0]=0,C[1]=-o.z,C[2]=o.y,C[3]=o.z,C[4]=0,C[5]=-o.x,C[6]=-o.y,C[7]=o.x,C[8]=0;var w,S,E=s.multiply(s.multiply(g,y,B),C,B),b=s.multiply(s.multiply(E,v,F),_,F),T=s.multiplyByVector(E,n,D),U=f(b,e.negate(T,x),0,0,1),G=U.length;if(G>0){for(var H=e.clone(e.ZERO,V),W=Number.NEGATIVE_INFINITY,q=0;qW&&(W=Y,H=e.clone(w,H))}var X=i.cartesianToCartographic(H,z);return W=a.clamp(W,0,1),S=e.magnitude(e.subtract(H,n,M))*Math.sqrt(1-W*W),S=u?-S:S,X.height=S,i.cartographicToCartesian(X,new e)}};var U=new e;return m.lineSegmentPlane=function(t,i,n,o){r(o)||(o=new e);var s=e.subtract(i,t,U),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)1))return e.multiplyByScalar(s,d,o),e.add(t,o,o),o}},m.trianglePlaneIntersection=function(t,i,r,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,i)+a<0,u=e.dot(o,r)+a<0,c=0;c+=s?1:0,c+=l?1:0,c+=u?1:0;var d,h;if(1!==c&&2!==c||(d=new e,h=new e),1===c){if(s)return m.lineSegmentPlane(t,i,n,d),m.lineSegmentPlane(t,r,n,h),{positions:[t,i,r,d,h],indices:[0,3,4,1,2,4,1,4,3]};if(l)return m.lineSegmentPlane(i,r,n,d),m.lineSegmentPlane(i,t,n,h),{positions:[t,i,r,d,h],indices:[1,3,4,2,0,4,2,4,3]};if(u)return m.lineSegmentPlane(r,t,n,d),m.lineSegmentPlane(r,i,n,h),{positions:[t,i,r,d,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return m.lineSegmentPlane(i,t,n,d),m.lineSegmentPlane(r,t,n,h),{positions:[t,i,r,d,h],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return m.lineSegmentPlane(r,i,n,d),m.lineSegmentPlane(t,i,n,h),{positions:[t,i,r,d,h],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return m.lineSegmentPlane(t,r,n,d),m.lineSegmentPlane(i,r,n,h),{positions:[t,i,r,d,h],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t,i){this.normal=e.clone(t),this.distance=i}n.fromPointNormal=function(i,r,o){var a=-e.dot(r,i);return t(o)?(e.clone(r,o.normal),o.distance=a,o):new n(r,a)};var o=new e;return n.fromCartesian4=function(i,r){var a=e.fromCartesian4(i,o),s=i.w;return t(r)?(e.clone(a,r.normal),r.distance=s,r):new n(a,s)},n.getPointDistance=function(t,i){return e.dot(t.normal,i)+t.distance},n.ORIGIN_XY_PLANE=r(new n(e.UNIT_Z,0)),n.ORIGIN_YZ_PLANE=r(new n(e.UNIT_X,0)),n.ORIGIN_ZX_PLANE=r(new n(e.UNIT_Y,0)),n}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i){for(var r,n,o=0,a=e.length-1;o<=a;)if(r=~~((o+a)/2),n=i(e[r],t),n<0)o=r+1;else{if(!(n>0))return r;a=r-1}return~(a+1)}return i}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,i,r,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=i,this.yPoleOffset=r,this.ut1MinusUtc=n}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,i=0,r=t[i++],n=function(e,t,i,r){i||(i=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(i);return r?e+n:n+e},o=function(e,t,i,r,o,a){var s=r-e.length;return s>0&&(e=i||!o?n(e,r,a,i):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,i,r,a,s,l){var u=e>>>0;return i=i&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=i+n(u.toString(t),s||0,"0",!1),o(e,i,r,a,l)},s=function(e,t,i,r,n,a){return null!=r&&(e=e.slice(0,r)),o(e,"",t,i,n,a)},l=function(e,r,l,u,c,d,h){var p,f,m,_,g;if("%%"==e)return"%";for(var v=!1,y="",C=!1,w=!1,S=" ",E=l.length,b=0;l&&b-1?6:"d"==h?0:void 0,g=r?t[r.slice(0,-1)]:t[i++],h){case"s":return s(String(g),v,u,d,C,S);case"c":return s(String.fromCharCode(+g),v,u,d,C);case"b":return a(g,2,w,v,u,d,C);case"o":return a(g,8,w,v,u,d,C);case"x":return a(g,16,w,v,u,d,C);case"X":return a(g,16,w,v,u,d,C).toUpperCase();case"u":return a(g,10,w,v,u,d,C);case"i":case"d":return p=+g||0,p=Math.round(p-p%1),f=p<0?"-":y,g=f+n(String(Math.abs(p)),d,"0",!1),o(g,f,v,u,C);case"e":case"E":case"f":case"F":case"g":case"G":return p=+g,f=p<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],g=f+Math.abs(p)[m](d),o(g,f,v,u,C)[_]();default:return e}};return r.replace(e,l)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,i,r,n,o,a,s){this.year=e,this.month=t,this.day=i,this.hour=r,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,t){return m.compare(e.julianDate,t.julianDate)}function d(e){y.julianDate=e;var i=m.leapSeconds,r=t(i,y,c);r<0&&(r=~r),r>=i.length&&(r=i.length-1);var n=i[r].offset;if(r>0){var o=m.secondsDifference(i[r].julianDate,e);o>n&&(r--,n=i[r].offset)}m.addSeconds(e,n,e)}function h(e,i){y.julianDate=e;var r=m.leapSeconds,n=t(r,y,c);if(n<0&&(n=~n),0===n)return m.addSeconds(e,-r[0].offset,i);if(n>=r.length)return m.addSeconds(e,-r[n-1].offset,i);var o=m.secondsDifference(r[n].julianDate,e);return 0===o?m.addSeconds(e,-r[n].offset,i):o<=1?void 0:m.addSeconds(e,-r[--n].offset,i)}function p(e,t,i){var r=t/l.SECONDS_PER_DAY|0;return e+=r,t-=l.SECONDS_PER_DAY*r,t<0&&(e--,t+=l.SECONDS_PER_DAY),i.dayNumber=e,i.secondsOfDay=t,i}function f(e,t,i,r,n,o,a){var s=(t-14)/12|0,u=e+4800+s,c=(1461*u/4|0)+(367*(t-2-12*s)/12|0)-(3*((u+100)/100|0)/4|0)+i-32075;r-=12,r<0&&(r+=24);var d=o+(r*l.SECONDS_PER_HOUR+n*l.SECONDS_PER_MINUTE+a*l.SECONDS_PER_MILLISECOND);return d>=43200&&(c-=1),[c,d]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=i(e,0),t=i(t,0),r=i(r,u.UTC);var n=0|e;t+=(e-n)*l.SECONDS_PER_DAY,p(n,t,this),r===u.UTC&&d(this)}var _=new o,g=[31,28,31,30,31,30,31,31,30,31,30,31],v=29,y=new s,C=/^(\d{4})$/,w=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,E=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,b=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+T.source,A=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,P=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source;m.fromDate=function(e,t){var i=f(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(p(i[0],i[1],t),d(t), -t):new m(i[0],i[1],u.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var i,n,o,s=e.split("T"),l=1,c=1,h=0,_=0,y=0,T=0,M=s[0],D=s[1];if(s=M.match(b),null!==s)i=+s[1],l=+s[2],c=+s[3];else if(s=M.match(w),null!==s)i=+s[1],l=+s[2];else if(s=M.match(C),null!==s)i=+s[1];else{var I;if(s=M.match(S),null!==s)i=+s[1],I=+s[2],o=a(i);else if(s=M.match(E),null!==s){i=+s[1];var R=+s[2],O=+s[3]||0,N=new Date(Date.UTC(i,0,4));I=7*R+O-N.getUTCDay()-3}n=new Date(Date.UTC(i,0,1)),n.setUTCDate(I),l=n.getUTCMonth()+1,c=n.getUTCDate()}o=a(i);var L;if(r(D)){s=D.match(P),null!==s?(h=+s[1],_=+s[2],y=+s[3],T=1e3*+(s[4]||0),L=5):(s=D.match(A),null!==s?(h=+s[1],_=+s[2],y=60*+(s[3]||0),L=4):(s=D.match(x),null!==s&&(h=+s[1],_=60*+(s[2]||0),L=3)));var B=s[L],F=+s[L+1],k=+(s[L+2]||0);switch(B){case"+":h-=F,_-=k;break;case"-":h+=F,_+=k;break;case"Z":break;default:_+=new Date(Date.UTC(i,l-1,c,h,_)).getTimezoneOffset()}}else _+=new Date(i,l-1,c).getTimezoneOffset();var V=60===y;for(V&&y--;_>=60;)_-=60,h++;for(;h>=24;)h-=24,c++;for(n=o&&2===l?v:g[l-1];c>n;)c-=n,l++,l>12&&(l-=12,i++),n=o&&2===l?v:g[l-1];for(;_<0;)_+=60,h--;for(;h<0;)h+=24,c--;for(;c<1;)l--,l<1&&(l+=12,i--),n=o&&2===l?v:g[l-1],c+=n;var z=f(i,l,c,h,_,y,T);return r(t)?(p(z[0],z[1],t),d(t)):t=new m(z[0],z[1],u.UTC),V&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var M=new m(0,0,u.TAI);return m.toGregorianDate=function(e,t){var i=!1,n=h(e,M);r(n)||(m.addSeconds(e,-1,M),n=h(M,M),i=!0);var a=n.dayNumber,s=n.secondsOfDay;s>=43200&&(a+=1);var u=a+68569|0,c=4*u/146097|0;u=u-((146097*c+3)/4|0)|0;var d=4e3*(u+1)/1461001|0;u=u-(1461*d/4|0)+31|0;var p=80*u/2447|0,f=u-(2447*p/80|0)|0;u=p/11|0;var _=p+2-12*u|0,g=100*(c-49)+d+u|0,v=s/l.SECONDS_PER_HOUR|0,y=s-v*l.SECONDS_PER_HOUR,C=y/l.SECONDS_PER_MINUTE|0;y-=C*l.SECONDS_PER_MINUTE;var w=0|y,S=(y-w)/l.SECONDS_PER_MILLISECOND;return v+=12,v>23&&(v-=24),i&&(w+=1),r(t)?(t.year=g,t.month=_,t.day=f,t.hour=v,t.minute=C,t.second=w,t.millisecond=S,t.isLeapSecond=i,t):new o(g,_,f,v,C,w,S,i)},m.toDate=function(e){var t=m.toGregorianDate(e,_),i=t.second;return t.isLeapSecond&&(i-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,i,t.millisecond))},m.toIso8601=function(t,i){var n,o=m.toGregorianDate(t,o);return r(i)||0===o.millisecond?r(i)&&0!==i?(n=(.01*o.millisecond).toFixed(i).replace(".","").slice(0,i),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",o.year,o.month,o.day,o.hour,o.minute,o.second):(n=(.01*o.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,u.TAI)},m.compare=function(e,t){var i=e.dayNumber-t.dayNumber;return 0!==i?i:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=i},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var i=(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY;return i+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var i=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY;return i+r},m.computeTaiMinusUtc=function(e){y.julianDate=e;var i=m.leapSeconds,r=t(i,y,c);return r<0&&(r=~r,--r,r<0&&(r=0)),i[r].offset},m.addSeconds=function(e,t,i){return p(e.dayNumber,e.secondsOfDay+t,i)},m.addMinutes=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return p(e.dayNumber,r,i)},m.addHours=function(e,t,i){var r=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return p(e.dayNumber,r,i)},m.addDays=function(e,t,i){var r=e.dayNumber+t;return p(r,e.secondsOfDay,i)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new s(new m(2441317,43210,u.TAI),10),new s(new m(2441499,43211,u.TAI),11),new s(new m(2441683,43212,u.TAI),12),new s(new m(2442048,43213,u.TAI),13),new s(new m(2442413,43214,u.TAI),14),new s(new m(2442778,43215,u.TAI),15),new s(new m(2443144,43216,u.TAI),16),new s(new m(2443509,43217,u.TAI),17),new s(new m(2443874,43218,u.TAI),18),new s(new m(2444239,43219,u.TAI),19),new s(new m(2444786,43220,u.TAI),20),new s(new m(2445151,43221,u.TAI),21),new s(new m(2445516,43222,u.TAI),22),new s(new m(2446247,43223,u.TAI),23),new s(new m(2447161,43224,u.TAI),24),new s(new m(2447892,43225,u.TAI),25),new s(new m(2448257,43226,u.TAI),26),new s(new m(2448804,43227,u.TAI),27),new s(new m(2449169,43228,u.TAI),28),new s(new m(2449534,43229,u.TAI),29),new s(new m(2450083,43230,u.TAI),30),new s(new m(2450630,43231,u.TAI),31),new s(new m(2451179,43232,u.TAI),32),new s(new m(2453736,43233,u.TAI),33),new s(new m(2454832,43234,u.TAI),34),new s(new m(2456109,43235,u.TAI),35),new s(new m(2457204,43236,u.TAI),36),new s(new m(2457754,43237,u.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(i,r){if(null===i||"object"!=typeof i)return i;r=e(r,!1);var n=new i.constructor;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];r&&(a=t(a,r)),n[o]=a}return n}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var i=e.split("\r\n"),r=0;r0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function i(e,i,r){this.statusCode=e,this.response=i,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return i.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},i}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var i=r.exec(t);this.scheme=i[1],this.authority=i[2],this.path=i[3],this.query=i[4],this.fragment=i[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function i(e,t,i,r){return(t||"")+i.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(a,i).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var i=new e;return this.scheme?(i.scheme=this.scheme,i.authority=this.authority,i.path=this.path,i.query=this.query):(i.scheme=t.scheme,this.authority?(i.authority=this.authority,i.path=this.path,i.query=this.query):(i.authority=t.authority,""==this.path?(i.path=t.path,i.query=this.query||t.query):("/"==this.path.charAt(0)?(i.path=this.path,i.removeDotSegments()):(t.authority&&""==t.path?i.path="/"+this.path:i.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,i.removeDotSegments()),i.query=this.query))),i.fragment=this.fragment,i},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),i=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?i.pop():"."!=e&&i.push(e);"."!=e&&".."!=e||i.push(""),r&&i.unshift(""),this.path=i.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(i){var r=new e(i);r.normalize();var n=r.getAuthority();if(t(n)){if(n.indexOf("@")!==-1){var o=n.split("@");n=o[1]}if(n.indexOf(":")===-1){var a=r.getScheme();if(t(a)||(a=window.location.protocol,a=a.substring(0,a.length-1)),"http"===a)n+=":80";else{if("https"!==a)return;n+=":443"}}return n}}var n={},o={};return n.add=function(e,i){var r=e.toLowerCase()+":"+i;t(o[r])||(o[r]=!0)},n.remove=function(e,i){var r=e.toLowerCase()+":"+i;t(o[r])&&delete o[r]},n.contains=function(e){var i=r(e);return!(!t(i)||!t(o[i]))},n.clear=function(){o={}},n}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=t(i,t.EMPTY_OBJECT);var r=i.responseType,n=t(i.method,"GET"),o=i.data,a=i.headers,l=i.overrideMimeType;return e(i.url,function(t){var i=e.defer();return s.load(t,r,n,o,a,i,l),i.promise})}function l(e,t){var i=decodeURIComponent(t);return e?atob(i):i}function u(e,t){for(var i=l(e,t),r=new ArrayBuffer(i.length),n=new Uint8Array(r),o=0;o=300)return void u.reject(new n(f.status,f.response,f.getAllResponseHeaders()));var e=f.response,r=f.responseType;if(!i(e)||i(t)&&r!==t)if("json"===t&&"string"==typeof e)try{u.resolve(JSON.parse(e))}catch(e){u.reject(e)}else(""===r||"document"===r)&&i(f.responseXML)&&f.responseXML.hasChildNodes()?u.resolve(f.responseXML):""!==r&&"text"!==r||!i(f.responseText)?u.reject(new o("Invalid XMLHttpRequest response type.")):u.resolve(f.responseText);else u.resolve(e)},f.onerror=function(e){u.reject(new n)},f.send(s)},s.defaultLoad=s.load,s}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,headers:i})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,i,r){"use strict";function n(i,n){return t(n)?t(n.Accept)||(n=e(n),n.Accept=o.Accept):n=o,r(i,n).then(function(e){return JSON.parse(e)})}var o={Accept:"application/json,*/*;q=0.01"};return n}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(t){if(t=i(t,i.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=i(t.addNewLeapSeconds,!0),r(t.data))f(this,t.data);else if(r(t.url)){var n=this;this._downloadPromise=e(l(t.url),function(e){f(n,e)},function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else f(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function p(e,t){return a.compare(e.julianDate,t)}function f(e,i){if(!r(i.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(i.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var n=i.columnNames.indexOf("modifiedJulianDateUtc"),o=i.columnNames.indexOf("xPoleWanderRadians"),l=i.columnNames.indexOf("yPoleWanderRadians"),u=i.columnNames.indexOf("ut1MinusUtcSeconds"),h=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),f=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=i.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||l<0||u<0||h<0||f<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=i.samples,g=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=f,e._taiMinusUtcSecondsColumn=m,e._columnCount=i.columnNames.length,e._lastIndex=void 0;for(var v,y=e._addNewLeapSeconds,C=0,w=_.length;Ct.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[n],c=t[o];if(u.equals(c)||r.equals(u))return m(e,i,n,l,s),s;if(r.equals(c))return m(e,i,o,l,s),s;var d=a.secondsDifference(r,u)/a.secondsDifference(c,u),h=n*l,p=o*l,f=i[h+e._ut1MinusUtcSecondsColumn],g=i[p+e._ut1MinusUtcSecondsColumn],v=g-f;if(v>.5||v<-.5){var y=i[h+e._taiMinusUtcSecondsColumn],C=i[p+e._taiMinusUtcSecondsColumn];y!==C&&(c.equals(r)?f=g:g-=C-y)}return s.xPoleWander=_(d,i[h+e._xPoleWanderRadiansColumn],i[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=_(d,i[h+e._yPoleWanderRadiansColumn],i[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=_(d,i[h+e._xCelestialPoleOffsetRadiansColumn],i[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=_(d,i[h+e._yCelestialPoleOffsetRadiansColumn],i[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=_(d,f,g),s}return h.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new n(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,i){if(r(this._samples)){if(r(i)||(i=new n(0,0,0,0,0)),0===this._samples.length)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;var o=this._dates,s=this._lastIndex,l=0,c=0;if(r(s)){var d=o[s],h=o[s+1],p=a.lessThanOrEquals(d,e),f=!r(h),m=f||a.greaterThanOrEquals(h,e);if(p&&m)return l=s,!f&&h.equals(e)&&++l,c=l+1,g(this,o,this._samples,e,l,c,i),i}var _=t(o,e,a.compare,this._dateColumn);return _>=0?(_=this._totalSamples&&(l=this._totalSamples-1);for(var d=s/this._samplesPerXysFile|0,h=l/this._samplesPerXysFile|0,p=[],f=d;f<=h;++f)p.push(c(this,f));return e.all(p)},l.prototype.computeXysRadians=function(e,t,i){var o=u(this,e,t);if(!(o<0)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var s=this._interpolationOrder,l=a-(s/2|0);l<0&&(l=0);var d=l+s;d>=this._totalSamples&&(d=this._totalSamples-1,l=d-s,l<0&&(l=0));var h=!1,p=this._samples;if(r(p[3*l])||(c(this,l/this._samplesPerXysFile|0),h=!0),r(p[3*d])||(c(this,d/this._samplesPerXysFile|0),h=!0),!h){r(i)?(i.x=0,i.y=0,i.s=0):i=new n(0,0,0);var f,m,_=o-l*this._stepSizeDays,g=this._work,v=this._denominators,y=this._coef,C=this._xTable;for(f=0;f<=s;++f)g[f]=_-C[f];for(f=0;f<=s;++f){for(y[f]=1,m=0;m<=s;++m)m!==f&&(y[f]*=g[m]);y[f]*=v[f];var w=3*(l+f);i.x+=y[f]*p[w++],i.y+=y[f]*p[w++],i.s+=y[f]*p[w]}return i}}}},l}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var i,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},n={};return t(n,{element:{get:function(){if(n.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(n.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(n.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(n.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(n.supportsFullscreen())return null!==n.element}}}),n.supportsFullscreen=function(){if(e(i))return i;i=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",i=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;a0)i=Math.sqrt(m+1),s=.5*i,i=.5/i,n=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*i,o=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*i,a=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*i;else{var _=h,g=0;d>l&&(g=1),f>l&&f>d&&(g=2);var v=_[g],y=_[v];i=Math.sqrt(e[u.getElementIndex(g,g)]-e[u.getElementIndex(v,v)]-e[u.getElementIndex(y,y)]+1);var C=p;C[g]=.5*i,i=.5/i,s=(e[u.getElementIndex(y,v)]-e[u.getElementIndex(v,y)])*i,C[v]=(e[u.getElementIndex(v,g)]+e[u.getElementIndex(g,v)])*i,C[y]=(e[u.getElementIndex(y,g)]+e[u.getElementIndex(g,y)])*i,n=-C[0],o=-C[1],a=-C[2]}return r(t)?(t.x=n,t.y=o,t.z=a,t.w=s,t):new c(n,o,a,s)};var f=new c,m=new c,_=new c,g=new c;c.fromHeadingPitchRoll=function(t,i,r,o){var a;return t instanceof s?(a=t,o=i):(n("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),a=new s(t,i,r)),g=c.fromAxisAngle(e.UNIT_X,a.roll,f),_=c.fromAxisAngle(e.UNIT_Y,-a.pitch,o),o=c.multiply(_,g,_),m=c.fromAxisAngle(e.UNIT_Z,-a.heading,f),c.multiply(m,o,o)};var v=new e,y=new e,C=new c,w=new c,S=new c;c.packedLength=4,c.pack=function(e,t,r){return r=i(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new c),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,i,r){c.unpack(e,4*i,S),c.conjugate(S,S);for(var n=0,o=i-t+1;n=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-i,l=i*i,u=s*s,d=7;d>=0;--d)L[d]=(O[d]*l-N[d])*a,B[d]=(O[d]*u-N[d])*a;var h=n*i*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),p=s*(1+B[0]*(1+B[1]*(1+B[2]*(1+B[3]*(1+B[4]*(1+B[5]*(1+B[6]*(1+B[7])))))))),f=c.multiplyByScalar(e,p,I);return c.multiplyByScalar(t,h,r),c.add(f,r,r)},c.fastSquad=function(e,t,i,r,n,o){var a=c.fastSlerp(e,t,n,M),s=c.fastSlerp(i,r,n,D);return c.fastSlerp(a,s,2*n*(1-n),o)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},c.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=i&&Math.abs(e.y-t.y)<=i&&Math.abs(e.z-t.z)<=i&&Math.abs(e.w-t.w)<=i},c.ZERO=a(new c(0,0,0,0)),c.IDENTITY=a(new c(0,0,0,1)),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C){"use strict";var w={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},E={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},b={},T={east:new i,north:new i,up:new i,west:new i,south:new i,down:new i},x=new i,A=new i,P=new i;w.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new u("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,n=S[e][t],o=e+t;return s(b[o])?r=b[o]:(r=function(r,o,l){if(s(l)||(l=new v),_.equalsEpsilon(r.x,0,_.EPSILON14)&&_.equalsEpsilon(r.y,0,_.EPSILON14)){var u=_.sign(r.z);i.unpack(E[e],0,x),"east"!==e&&"west"!==e&&i.multiplyByScalar(x,u,x),i.unpack(E[t],0,A),"east"!==t&&"west"!==t&&i.multiplyByScalar(A,u,A),i.unpack(E[n],0,P),"east"!==n&&"west"!==n&&i.multiplyByScalar(P,u,P)}else{o=a(o,h.WGS84),o.geodeticSurfaceNormal(r,T.up);var c=T.up,d=T.east;d.x=-r.y,d.y=r.x,d.z=0,i.normalize(d,T.east),i.cross(c,d,T.north),i.multiplyByScalar(T.up,-1,T.down),i.multiplyByScalar(T.east,-1,T.west),i.multiplyByScalar(T.north,-1,T.south),x=T[e],A=T[t],P=T[n]}return l[0]=x.x,l[1]=x.y,l[2]=x.z,l[3]=0,l[4]=A.x,l[5]=A.y,l[6]=A.z,l[7]=0,l[8]=P.x,l[9]=P.y,l[10]=P.z,l[11]=0,l[12]=r.x,l[13]=r.y,l[14]=r.z,l[15]=1,l},b[o]=r),r},w.eastNorthUpToFixedFrame=w.localFrameToFixedFrameGenerator("east","north"),w.northEastDownToFixedFrame=w.localFrameToFixedFrameGenerator("north","east"),w.northUpEastToFixedFrame=w.localFrameToFixedFrameGenerator("north","up"),w.northWestUpToFixedFrame=w.localFrameToFixedFrameGenerator("north","west");var M=new y,D=new i(1,1,1),I=new v;w.headingPitchRollToFixedFrame=function(e,t,r,n,o){n instanceof v&&(o=n,n=void 0,l("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),n=a(n,w.eastNorthUpToFixedFrame);var s=y.fromHeadingPitchRoll(t,M),u=v.fromTranslationQuaternionRotationScale(i.ZERO,s,D,I);return o=n(e,r,o),v.multiply(o,u,o)};var R=new v,O=new g;w.headingPitchRollQuaternion=function(e,t,i,r,n){r instanceof y&&(n=r,r=void 0,l("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var o=w.headingPitchRollToFixedFrame(e,t,i,r,R),a=v.getRotation(o,O);return y.fromRotationMatrix(a,n)};var N=24110.54841,L=8640184.812866,B=.093104,F=-62e-7,k=1.1772758384668e-19,V=72921158553e-15,z=_.TWO_PI/86400,U=new m;w.computeTemeToPseudoFixedMatrix=function(e,t){U=m.addSeconds(e,-m.computeTaiMinusUtc(e),U);var i,r=U.dayNumber,n=U.secondsOfDay,o=r-2451545;i=n>=43200?(o+.5)/C.DAYS_PER_JULIAN_CENTURY:(o-.5)/C.DAYS_PER_JULIAN_CENTURY;var a=N+i*(L+i*(B+i*F)),l=a*z%_.TWO_PI,u=V+k*(r-2451545.5),c=(n+.5*C.SECONDS_PER_DAY)%C.SECONDS_PER_DAY,d=l+u*c,h=Math.cos(d),p=Math.sin(d);return s(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new g(h,p,0,-p,h,0,0,0,1)},w.iau2006XysData=new p,w.earthOrientationParameters=c.NONE;var G=32.184,H=2451545;w.preloadIcrfFixed=function(t){var i=t.start.dayNumber,r=t.start.secondsOfDay+G,n=t.stop.dayNumber,o=t.stop.secondsOfDay+G,a=w.iau2006XysData.preload(i,r,n,o),s=w.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},w.computeIcrfToFixedMatrix=function(e,t){s(t)||(t=new g);var i=w.computeFixedToIcrfMatrix(e,t);if(s(i))return g.transpose(i,t)};var W=new f(0,0,0),q=new d(0,0,0,0,0,0),j=new g,Y=new g;w.computeFixedToIcrfMatrix=function(e,t){s(t)||(t=new g);var i=w.earthOrientationParameters.compute(e,q);if(s(i)){var r=e.dayNumber,n=e.secondsOfDay+G,o=w.iau2006XysData.computeXysRadians(r,n,W);if(s(o)){var a=o.x+i.xPoleOffset,l=o.y+i.yPoleOffset,u=1/(1+Math.sqrt(1-a*a-l*l)),c=j;c[0]=1-u*a*a,c[3]=-u*a*l,c[6]=a,c[1]=-u*a*l,c[4]=1-u*l*l,c[7]=l,c[2]=-a,c[5]=-l,c[8]=1-u*(a*a+l*l);var d=g.fromRotationZ(-o.s,Y),h=g.multiply(c,d,j),p=e.dayNumber,f=e.secondsOfDay-m.computeTaiMinusUtc(e)+i.ut1MinusUtc,v=p-2451545,y=f/C.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(v+y);S=S%1*_.TWO_PI;var E=g.fromRotationZ(S,Y),b=g.multiply(h,E,j),T=Math.cos(i.xPoleWander),x=Math.cos(i.yPoleWander),A=Math.sin(i.xPoleWander),P=Math.sin(i.yPoleWander),M=r-H+n/C.SECONDS_PER_DAY;M/=36525;var D=-47e-6*M*_.RADIANS_PER_DEGREE/3600,I=Math.cos(D),R=Math.sin(D),O=Y;return O[0]=T*I,O[1]=T*R,O[2]=A,O[3]=-x*R+P*A*I,O[4]=x*I+P*A*R,O[5]=-P*T,O[6]=-P*R-x*A*I,O[7]=P*I-x*A*R,O[8]=x*T,g.multiply(b,O,t)}}};var X=new r;w.pointToWindowCoordinates=function(e,t,i,r){return r=w.pointToGLWindowCoordinates(e,t,i,r),r.y=2*t[5]-r.y,r},w.pointToGLWindowCoordinates=function(e,i,n,o){s(o)||(o=new t);var a=X;return v.multiplyByVector(e,r.fromElements(n.x,n.y,n.z,1,a),a),r.multiplyByScalar(a,1/a.w,a),v.multiplyByVector(i,a,a),t.fromCartesian4(a,o)};var Z=new i,K=new i,Q=new i;w.rotationMatrixFromPositionVelocity=function(e,t,r,n){var o=a(r,h.WGS84).geodeticSurfaceNormal(e,Z),l=i.cross(t,o,K);i.equalsEpsilon(l,i.ZERO,_.EPSILON6)&&(l=i.clone(i.UNIT_X,l));var u=i.cross(l,t,Q);return i.cross(t,u,l),i.negate(l,l),s(n)||(n=new g),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=l.x,n[4]=l.y,n[5]=l.z,n[6]=u.x,n[7]=u.y,n[8]=u.z,n};var J=new n,$=new i,ee=new i,te=new r,ie=new r,re=new r,ne=new r,oe=new r,ae=new v,se=new v;w.basisTo2D=function(e,t,n){var o=e.ellipsoid,a=v.getColumn(t,3,te),s=o.cartesianToCartographic(a,J),l=w.eastNorthUpToFixedFrame(a,o,ae),u=v.inverseTransformation(l,se),c=e.project(s,$),d=ie;d.x=c.z,d.y=c.x,d.z=c.y,d.w=1;var h=v.getColumn(t,0,ee),p=i.magnitude(h),f=v.multiplyByVector(u,h,re);r.fromElements(f.z,f.x,f.y,0,f);var m=v.getColumn(t,1,ee),_=i.magnitude(m),g=v.multiplyByVector(u,m,ne);r.fromElements(g.z,g.x,g.y,0,g);var y=v.getColumn(t,2,ee),C=i.magnitude(y),S=oe;return i.cross(f,g,S),i.normalize(S,S),i.cross(g,S,f),i.normalize(f,f),i.cross(S,f,g),i.normalize(g,g),i.multiplyByScalar(f,p,f),i.multiplyByScalar(g,_,g),i.multiplyByScalar(S,C,S),v.setColumn(n,0,f,n),v.setColumn(n,1,g,n),v.setColumn(n,2,S,n),v.setColumn(n,3,d,n),n};var le=new v(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return w.wgs84To2DModelMatrix=function(e,t,i){var r=e.ellipsoid,n=w.eastNorthUpToFixedFrame(t,r,ae),o=v.inverseTransformation(n,se),a=r.cartesianToCartographic(t,J),s=e.project(a,$),l=ie;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=v.fromTranslation(l,ae);return v.multiply(le,o,i),v.multiply(u,i,i),i},w}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var r=p.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=i.fromCartesian4(c.getColumn(r,0,m)),this._yAxis=i.fromCartesian4(c.getColumn(r,1,m));var o=i.fromCartesian4(c.getColumn(r,2,m));this._plane=d.fromPointNormal(e,o)}var m=new r;a(f.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;f.fromPoints=function(t,i){var r=e.fromPoints(t,_);return new f(r.center,i)};var g=new h,v=new i;f.prototype.projectPointOntoPlane=function(e,r){var n=g;n.origin=e,i.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,v);if(o(a)||(i.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,v)),o(a)){var s=i.subtract(a,this._origin,a),l=i.dot(this._xAxis,s),c=i.dot(this._yAxis,s);return o(r)?(r.x=l,r.y=c,r):new t(l,c)}},f.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var i=0,r=e.length,n=0;n0?0:a.latitude;w.latitude=C.latitude=y.latitude=e.south,S.latitude=v.latitude=b,h.latitude=m.latitude=g.latitude=e.north,w.longitude=S.longitude=h.longitude=e.west,C.longitude=m.longitude=E,y.longitude=v.longitude=g.longitude=e.east,g.height=m.height=h.height=S.height=w.height=C.height=y.height=v.height=i,r.cartographicArrayToCartesianArray(M,D),c.projectPointsToNearestOnPlane(D,I);var T=Math.min(I[6].x,I[7].x,I[0].x),x=Math.max(I[2].x,I[3].x,I[4].x),R=Math.min(I[4].y,I[5].y,I[6].y),O=Math.max(I[0].y,I[1].y,I[2].y);g.height=h.height=y.height=w.height=t,r.cartographicArrayToCartesianArray(M,D);var N=Math.min(p.getPointDistance(d,D[0]),p.getPointDistance(d,D[2]),p.getPointDistance(d,D[4]),p.getPointDistance(d,D[6])),L=i;return _(c,T,x,R,O,N,L,o)},m.clone=function(e,t){if(o(e))return o(t)?(i.clone(e.center,t.center),h.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,n=t.normal,o=e.halfAxes,a=n.x,s=n.y,l=n.z,c=Math.abs(a*o[h.COLUMN0ROW0]+s*o[h.COLUMN0ROW1]+l*o[h.COLUMN0ROW2])+Math.abs(a*o[h.COLUMN1ROW0]+s*o[h.COLUMN1ROW1]+l*o[h.COLUMN1ROW2])+Math.abs(a*o[h.COLUMN2ROW0]+s*o[h.COLUMN2ROW1]+l*o[h.COLUMN2ROW2]),d=i.dot(n,r)+t.distance;return d<=-c?u.OUTSIDE:d>=c?u.INSIDE:u.INTERSECTING};var R=new i,O=new i,N=new i,L=new i;m.distanceSquaredTo=function(e,t){var r=i.subtract(t,e.center,T),n=e.halfAxes,o=h.getColumn(n,0,R),a=h.getColumn(n,1,O),s=h.getColumn(n,2,N),l=i.magnitude(o),u=i.magnitude(a),c=i.magnitude(s);i.normalize(o,o),i.normalize(a,a),i.normalize(s,s);var d=L;d.x=i.dot(r,o),d.y=i.dot(r,a),d.z=i.dot(r,s);var p,f=0;return d.x<-l?(p=d.x+l,f+=p*p):d.x>l&&(p=d.x-l,f+=p*p),d.y<-u?(p=d.y+u,f+=p*p):d.y>u&&(p=d.y-u,f+=p*p),d.z<-c?(p=d.z+c,f+=p*p):d.z>c&&(p=d.z-c,f+=p*p),f};var B=new i,F=new i;m.computePlaneDistances=function(e,t,r,n){o(n)||(n=new c);var a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=e.center,u=e.halfAxes,d=h.getColumn(u,0,R),p=h.getColumn(u,1,O),f=h.getColumn(u,2,N),m=i.add(d,p,B);i.add(m,f,m),i.add(m,l,m);var _=i.subtract(m,t,F),g=i.dot(r,_);return a=Math.min(g,a),s=Math.max(g,s),i.add(l,d,m),i.add(m,p,m),i.subtract(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.add(l,d,m),i.subtract(m,p,m),i.add(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.add(l,d,m),i.subtract(m,p,m),i.subtract(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,d,m),i.add(m,p,m),i.add(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,d,m),i.add(m,p,m),i.subtract(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,d,m),i.subtract(m,p,m),i.add(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),i.subtract(l,d,m),i.subtract(m,p,m),i.subtract(m,f,m),i.subtract(m,t,_),g=i.dot(r,_),a=Math.min(g,a),s=Math.max(g,s),n.start=a,n.stop=s,n};var k=new e;return m.isOccluded=function(t,i){var r=e.fromOrientedBoundingBox(t,k);return!i.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,i){return m.computePlaneDistances(this,e,t,i)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||o(e)&&o(t)&&i.equals(e.center,t.center)&&h.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,i,r,n){"use strict";var o={};o.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,o=i.y;i.x=(1-Math.abs(o))*n.signNotZero(r),i.y=(1-Math.abs(r))*n.signNotZero(o)}return i.x=n.toSNorm(i.x,t),i.y=n.toSNorm(i.y,t),i},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,i,r,o){if(o.x=n.fromSNorm(e,r),o.y=n.fromSNorm(i,r),o.z=1-(Math.abs(o.x)+Math.abs(o.y)),o.z<0){var a=o.x;o.x=(1-Math.abs(o.y))*n.signNotZero(a),o.y=(1-Math.abs(a))*n.signNotZero(o.y)}return t.normalize(o,o)},o.octDecode=function(e,t,i){return o.octDecodeInRange(e,t,255,i)},o.octPackFloat=function(e){return 256*e.x+e.y};var a=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,a),o.octPackFloat(a)},o.octDecodeFloat=function(e,t){var i=e/256,r=Math.floor(i),n=256*(i-r);return o.octDecode(r,n,t)},o.octPack=function(e,t,i,r){var n=o.octEncodeFloat(e),s=o.octEncodeFloat(t),l=o.octEncode(i,a);return r.x=65536*l.x+n,r.y=65536*l.y+s,r},o.octUnpack=function(e,t,i,r){var n=e.x/65536,a=Math.floor(n),s=65536*(n-a);n=e.y/65536;var l=Math.floor(n),u=65536*(n-l);o.octDecodeFloat(s,t),o.octDecodeFloat(u,i),o.octDecode(a,l,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,i=4095*e.y|0;return 4096*t+i},o.decompressTextureCoordinates=function(e,t){var i=e/4096,r=Math.floor(i);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,i,r,n,o){"use strict";if(!r.supportsTypedArrays())return{};var a={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.INT:return Int32Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Int32Array?a.INT:e instanceof Uint32Array?a.UNSIGNED_INT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.INT||e===a.UNSIGNED_INT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.INT:return new Int32Array(t);case a.UNSIGNED_INT:return new Uint32Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t)}},a.createArrayBufferView=function(t,i,r,n){switch(r=e(r,0),n=e(n,(i.byteLength-r)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(i,r,n);case a.UNSIGNED_BYTE:return new Uint8Array(i,r,n);case a.SHORT:return new Int16Array(i,r,n);case a.UNSIGNED_SHORT:return new Uint16Array(i,r,n);case a.INT:return new Int32Array(i,r,n);case a.UNSIGNED_INT:return new Uint32Array(i,r,n);case a.FLOAT:return new Float32Array(i,r,n);case a.DOUBLE:return new Float64Array(i,r,n)}},a.fromName=function(e){switch(e){case"BYTE":return a.BYTE;case"UNSIGNED_BYTE":return a.UNSIGNED_BYTE;case"SHORT":return a.SHORT;case"UNSIGNED_SHORT":return a.UNSIGNED_SHORT;case"INT":return a.INT;case"UNSIGNED_INT":return a.UNSIGNED_INT;case"FLOAT":return a.FLOAT;case"DOUBLE":return a.DOUBLE}},n(a)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(e,t,r,a,u,h){var _,g,v,y;if(o(e)&&o(t)&&o(r)&&o(a)){var C=e.minimum,w=e.maximum,S=i.subtract(w,C,d),E=r-t,b=Math.max(i.maximumComponent(S),E);_=bl.MaximumLatitude?e=l.MaximumLatitude:e<-l.MaximumLatitude&&(e=-l.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},l.MaximumLatitude=l.mercatorAngleToGeodeticLatitude(Math.PI),l.prototype.project=function(t,i){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return r(i)?(i.x=o,i.y=a,i.z=s,i):new e(o,a,s)},l.prototype.unproject=function(e,i){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return r(i)?(i.longitude=o,i.latitude=a,i.height=s,i):new t(o,a,s)},l}),define("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";var g={};g.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var v=new r,y=new d,C=new r,w=new r;return g.computeVertices=function(a){var u,S,E,b,T=Math.cos,x=Math.sin,A=Math.sqrt,P=Math.atan,M=Math.exp,D=c.PI_OVER_TWO,I=c.toRadians,R=a.heightmap,O=a.width,N=a.height,L=a.skirtHeight,B=n(a.isGeographic,!0),F=n(a.ellipsoid,s.WGS84),k=1/F.maximumRadius,V=a.nativeRectangle,z=a.rectangle;o(z)?(u=z.west,S=z.south,E=z.east,b=z.north):B?(u=I(V.west),S=I(V.south),E=I(V.east),b=I(V.north)):(u=V.west*k,S=D-2*P(M(-V.south*k)),E=V.east*k,b=D-2*P(M(-V.north*k)));var U=a.relativeToCenter,G=o(U);U=G?U:r.ZERO;var H,W,q=n(a.exaggeration,1),j=n(a.includeWebMercatorT,!1),Y=n(a.structure,g.DEFAULT_STRUCTURE),X=n(Y.heightScale,g.DEFAULT_STRUCTURE.heightScale),Z=n(Y.heightOffset,g.DEFAULT_STRUCTURE.heightOffset),K=n(Y.elementsPerHeight,g.DEFAULT_STRUCTURE.elementsPerHeight),Q=n(Y.stride,g.DEFAULT_STRUCTURE.stride),J=n(Y.elementMultiplier,g.DEFAULT_STRUCTURE.elementMultiplier),$=n(Y.isBigEndian,g.DEFAULT_STRUCTURE.isBigEndian),ee=p.computeWidth(V)/(O-1),te=p.computeHeight(V)/(N-1),ie=F.radiiSquared,re=ie.x,ne=ie.y,oe=ie.z,ae=65536,se=-65536,le=m.eastNorthUpToFixedFrame(U,F),ue=d.inverseTransformation(le,y);j&&(H=_.geodeticLatitudeToMercatorAngle(S),W=1/(_.geodeticLatitudeToMercatorAngle(b)-H));var ce=C;ce.x=Number.POSITIVE_INFINITY,ce.y=Number.POSITIVE_INFINITY,ce.z=Number.POSITIVE_INFINITY;var de=w;de.x=Number.NEGATIVE_INFINITY,de.y=Number.NEGATIVE_INFINITY,de.z=Number.NEGATIVE_INFINITY;var he=Number.POSITIVE_INFINITY,pe=O+(L>0?2:0),fe=N+(L>0?2:0),me=pe*fe,_e=new Array(me),ge=new Array(me),ve=new Array(me),ye=j?new Array(me):[],Ce=0,we=N,Se=0,Ee=O;L>0&&(--Ce,++we,--Se,++Ee);for(var be=0,Te=Ce;Te=N&&(xe=N-1);var Ae=V.north-te*xe;Ae=B?I(Ae):D-2*P(M(-Ae*k));var Pe=T(Ae),Me=x(Ae),De=oe*Me,Ie=(Ae-S)/(b-S);Ie=c.clamp(Ie,0,1);var Re;j&&(Re=(_.geodeticLatitudeToMercatorAngle(Ae)-H)*W);for(var Oe=Se;Oe=O&&(Ne=O-1);var Le=V.west+ee*Ne;B?Le=I(Le):Le*=k;var Be,Fe=xe*(O*Q)+Ne*Q;if(1===K)Be=R[Fe];else{Be=0;var ke;if($)for(ke=0;ke=0;--ke)Be=Be*J+R[Fe+ke]}Be=(Be*X+Z)*q,se=Math.max(se,Be),ae=Math.min(ae,Be),Oe===Ne&&Te===xe||(Be-=L);var Ve=Pe*T(Le),ze=Pe*x(Le),Ue=re*Ve,Ge=ne*ze,He=A(Ue*Ve+Ge*ze+De*Me),We=1/He,qe=Ue*We,je=Ge*We,Ye=De*We,Xe=new r;Xe.x=qe+Ve*Be,Xe.y=je+ze*Be,Xe.z=Ye+Me*Be,_e[be]=Xe,ge[be]=Be;var Ze=(Le-u)/(E-u);Ze=c.clamp(Ze,0,1),ve[be]=new i(Ze,Ie),j&&(ye[be]=Re),be++,d.multiplyByPoint(ue,Xe,v),r.minimumByComponent(v,ce,ce),r.maximumByComponent(v,de,de),he=Math.min(he,Be)}}var Ke,Qe=t.fromPoints(_e);o(z)&&z.width=this._maximumActiveTasks)){++this._activeTasks;var n=this;return e(c(),function(o){r(i)?o||(i.length=0):i=g;var a=n._nextID++,s=e.defer();return n._deferreds[a]=s,n._worker.postMessage({id:a,parameters:t,canTransferArrayBuffer:o},i),s.promise})}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return r(this._worker)&&this._worker.terminate(),n(this)},m._defaultWorkerModulePrefix="Workers/",m._workerModulePrefix=m._defaultWorkerModulePrefix,m._loaderConfig=void 0,m._canTransferArrayBuffer=void 0,m}),define("Core/TerrainMesh",["./defaultValue"],function(e){"use strict";function t(t,i,r,n,o,a,s,l,u,c,d){this.center=t,this.vertices=i,this.stride=e(l,6),this.indices=r,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s,this.orientedBoundingBox=u,this.encoding=c,this.exaggeration=d}return t}),define("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError","./Math"],function(e,t,i,r){"use strict";function n(){i.throwInstantiationError()}t(n.prototype,{errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},hasWaterMask:{get:i.throwInstantiationError},hasVertexNormals:{get:i.throwInstantiationError},availability:{get:i.throwInstantiationError}});var o=[];return n.getRegularGridIndices=function(t,i){var r=o[t];e(r)||(o[t]=r=[]);var n=r[i];if(!e(n)){n=r[i]=new Uint16Array((t-1)*(i-1)*6);for(var a=0,s=0,l=0;l=a&&(p=a-1,h=a-2);var f=0|d,m=f+1;m>=s&&(m=s-1,f=s-2);var v=c-h,y=d-f;f=s-1-f,m=s-1-m;var C=g(e,t,i,r,n,f*a+h),w=g(e,t,i,r,n,f*a+p),S=g(e,t,i,r,n,m*a+h),E=g(e,t,i,r,n,m*a+p);return _(v,y,C,w,S,E)}function m(e,t,i,r,n,o,a,s,l,u,c){var d=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south);n>0&&(d+=1,h+=1,a+=2,s+=2);var p=n>0?a-1:a,f=0|d,m=f+1;m>=p&&(m=a-1,f=a-2);var g=n>0?s-1:s,v=0|h,y=v+1;y>=g&&(y=s-1,v=s-2);var C=d-f,w=h-v;v=s-1-v,y=s-1-y;var S=(t.decodeHeight(e,v*a+f)/c-i)/r,E=(t.decodeHeight(e,v*a+m)/c-i)/r,b=(t.decodeHeight(e,y*a+f)/c-i)/r,T=(t.decodeHeight(e,y*a+m)/c-i)/r;return _(C,w,S,E,b,T)}function _(e,t,i,r,n,o){return t=0;--a)s=s*i+e[o+a];return s}function v(e,t,i,r,n,o,a,s){a*=n;var l;if(o)for(l=0;l0;--l)e[a+l]=s/r|0,s-=e[a+l]*r,r/=i;e[a+l]=s}r(p.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=new u("createVerticesFromHeightmap");return p.prototype.createMesh=function(r,n,a,s,u){var p=r.ellipsoid,f=r.tileXYToNativeRectangle(n,a,s),m=r.tileXYToRectangle(n,a,s);u=t(u,1);var _=p.cartographicToCartesian(l.center(m)),g=this._structure,v=h.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,r.getNumberOfXTilesAtLevel(0)),C=v/(1<d.highestEncodedHeight?d.highestEncodedHeight:N,v(_,x,A,M,f,P,D*u+R,N)}return new p({buffer:_,width:u,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},p.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.maximumRequestsPerServer))return o[s]=l+1,t(a(e),function(e){return o[s]--,e}).otherwise(function(e){return o[s]--,t.reject(e)})}var o={},a="undefined"!=typeof document?new e(document.location.href):new e;return n.maximumRequestsPerServer=6,n}),define("Core/ArcGisImageServerTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./deprecationWarning","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./Math","./TerrainProvider","./throttleRequestByServer"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(n){o("ArcGisImageServerTerrainProvider","ArcGisImageServerTerrainProvider was deprecated in Cesium 1.31. It will be removed in 1.32."),this._url=n.url,this._token=n.token,this._tilingScheme=n.tilingScheme,r(this._tilingScheme)||(this._tilingScheme=new u({ellipsoid:i(n.ellipsoid,s.WGS84)})),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=f.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._proxy=n.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215},this._errorEvent=new l;var a=n.credit;"string"==typeof a&&(a=new t(a)),this._credit=a,this._readyPromise=e.resolve(!0)}return n(_.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},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}}}),_.prototype.requestTileGeometry=function(t,i,n){var o=this._tilingScheme.tileXYToRectangle(t,i,n),a=(o.east-o.west)/(this._heightmapWidth-1),s=(o.north-o.south)/(this._heightmapWidth-1);o.west-=.5*a,o.east+=.5*a,o.south-=.5*s,o.north+=.5*s;var l=p.toDegrees(o.west)+"%2C"+p.toDegrees(o.south)+"%2C"+p.toDegrees(o.east)+"%2C"+p.toDegrees(o.north),u=this._url+"/exportImage?interpolation=RSP_BilinearInterpolation&format=tiff&f=image&size="+this._heightmapWidth+"%2C"+this._heightmapWidth+"&bboxSR=4326&imageSR=4326&bbox="+l;this._token&&(u+="&token="+this._token);var f=this._proxy;r(f)&&(u=f.getURL(u));var _=m(u,h);if(r(_)){var g=this;return e(_,function(e){return new d({buffer:c(e),width:g._heightmapWidth,height:g._heightmapWidth,childTileMask:15,structure:g._terrainDataStructure})})}},_.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<1&&r(c[0],c[c.length-1],o)&&c.shift(),c}}var o=r.EPSILON10;return n}),define("Core/AssociativeArray",["./defined","./defineProperties","./DeveloperError"],function(e,t,i){"use strict";function r(){this._array=[],this._hash={}}return t(r.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),r.prototype.contains=function(t){return e(this._hash[t])},r.prototype.set=function(e,t){var i=this._hash[e];t!==i&&(this.remove(e),this._hash[e]=t,this._array.push(t))},r.prototype.get=function(e){return this._hash[e]},r.prototype.remove=function(t){var i=this._hash[t],r=e(i);if(r){var n=this._array;n.splice(n.indexOf(i),1),delete this._hash[t]}return r},r.prototype.removeAll=function(){var e=this._array;e.length>0&&(this._hash={},e.length=0)},r}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,i,r){"use strict";function n(r,n,l,u,c){i(c)||(c=new t);var d,h,p,f,m,_,g,v;i(n.z)?(d=t.subtract(l,n,o),h=t.subtract(u,n,a),p=t.subtract(r,n,s),f=t.dot(d,d),m=t.dot(d,h),_=t.dot(d,p),g=t.dot(h,h),v=t.dot(h,p)):(d=e.subtract(l,n,o),h=e.subtract(u,n,a),p=e.subtract(r,n,s),f=e.dot(d,d),m=e.dot(d,h),_=e.dot(d,p),g=e.dot(h,h),v=e.dot(h,p));var y=1/(f*g-m*m);return c.y=(g*_-m*v)*y,c.z=(f*v-m*_)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),define("Core/BingMapsApi",["./Credit","./defined"],function(e,t){"use strict";var i={};i.defaultKey=void 0;var r,n=!1,o="This application is using Cesium's default Bing Maps key. Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API.";return i.getKey=function(e){return t(e)?e:t(i.defaultKey)?i.defaultKey:(n||(console.log(o),n=!0),"AudaMP3YocqmIOQrFAValZ9d_tFqS4JWwiSEnvt2jwP5lizGzV_mJxLaKaI0fWRT")},i.getErrorCredit=function(n){if(!t(n)&&!t(i.defaultKey))return t(r)||(r=new e(o)),r},i}),define("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";function i(r,n,o){o=e(o,!1);var a,s,l,u={},c=t(r),d=t(n);if(c)for(a in r)r.hasOwnProperty(a)&&(s=r[a],d&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],"object"==typeof l?u[a]=i(s,l,o):u[a]=s):u[a]=s);if(d)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u}return i}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/objectToQuery",["./defined","./DeveloperError","./isArray"],function(e,t,i){"use strict";function r(e){var t="";for(var r in e)if(e.hasOwnProperty(r)){var n=e[r],o=encodeURIComponent(r)+"=";if(i(n))for(var a=0,s=n.length;ai.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},l.intersect=function(e,t){var i=e.x,r=e.y,n=t.x,o=t.y;return i>n+t.width||i+e.widtho+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height; -},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersect=function(e){return l.intersect(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===i.POINTS||e===i.LINES||e===i.LINE_LOOP||e===i.LINE_STRIP||e===i.TRIANGLES||e===i.TRIANGLE_STRIP||e===i.TRIANGLE_FAN}};return e(i)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,i,r,n){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,n.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return o.computeNumberOfVertices=function(e){var i=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var n=e.attributes[r],o=n.values.length/n.componentsPerAttribute;i=o}return i},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,i,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return n.POSITION_ONLY=r(new n({position:!0})),n.POSITION_AND_NORMAL=r(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=r(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=r(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=r(new n({position:!0,color:!0})),n.ALL=r(new n({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n.packedLength=6,n.pack=function(t,i,r){return r=e(r,0),i[r++]=t.position?1:0,i[r++]=t.normal?1:0,i[r++]=t.st?1:0,i[r++]=t.tangent?1:0,i[r++]=t.bitangent?1:0,i[r++]=t.color?1:0,i},n.unpack=function(i,r,o){return r=e(r,0),t(o)||(o=new n),o.position=1===i[r++],o.normal=1===i[r++],o.st=1===i[r++],o.tangent=1===i[r++],o.bitangent=1===i[r++],o.color=1===i[r++],o},n.clone=function(e,i){if(t(e))return t(i)||(i=new n),i.position=e.position,i.normal=e.normal,i.st=e.st,i.tangent=e.tangent,i.bitangent=e.bitangent,i.color=e.color,i},n}),define("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum,o=r(e.vertexFormat,c.DEFAULT);this._minimum=t.clone(i),this._maximum=t.clone(n),this._vertexFormat=o,this._workerName="createBoxGeometry"}var h=new t;d.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new d({minimum:t.negate(n,new t),maximum:n,vertexFormat:e.vertexFormat})},d.fromAxisAlignedBoundingBox=function(e){return new d({minimum:e.minimum,maximum:e.maximum})},d.packedLength=2*t.packedLength+c.packedLength,d.pack=function(e,i,n){return n=r(n,0),t.pack(e._minimum,i,n),t.pack(e._maximum,i,n+t.packedLength),c.pack(e._vertexFormat,i,n+2*t.packedLength),i};var p=new t,f=new t,m=new c,_={minimum:p,maximum:f,vertexFormat:m};return d.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,p),s=t.unpack(e,i+t.packedLength,f),l=c.unpack(e,i+2*t.packedLength,m);return n(o)?(o._minimum=t.clone(a,o._minimum),o._maximum=t.clone(s,o._maximum),o._vertexFormat=c.clone(l,o._vertexFormat),o):new d(_)},d.createGeometry=function(r){var n=r._minimum,o=r._maximum,c=r._vertexFormat;if(!t.equals(n,o)){var d,p,f=new l;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&(p=new Float64Array(72),p[0]=n.x,p[1]=n.y,p[2]=o.z,p[3]=o.x,p[4]=n.y,p[5]=o.z,p[6]=o.x,p[7]=o.y,p[8]=o.z,p[9]=n.x,p[10]=o.y,p[11]=o.z,p[12]=n.x,p[13]=n.y,p[14]=n.z,p[15]=o.x,p[16]=n.y,p[17]=n.z,p[18]=o.x,p[19]=o.y,p[20]=n.z,p[21]=n.x,p[22]=o.y,p[23]=n.z,p[24]=o.x,p[25]=n.y,p[26]=n.z,p[27]=o.x,p[28]=o.y,p[29]=n.z,p[30]=o.x,p[31]=o.y,p[32]=o.z,p[33]=o.x,p[34]=n.y,p[35]=o.z,p[36]=n.x,p[37]=n.y,p[38]=n.z,p[39]=n.x,p[40]=o.y,p[41]=n.z,p[42]=n.x,p[43]=o.y,p[44]=o.z,p[45]=n.x,p[46]=n.y,p[47]=o.z,p[48]=n.x,p[49]=o.y,p[50]=n.z,p[51]=o.x,p[52]=o.y,p[53]=n.z,p[54]=o.x,p[55]=o.y,p[56]=o.z,p[57]=n.x,p[58]=o.y,p[59]=o.z,p[60]=n.x,p[61]=n.y,p[62]=n.z,p[63]=o.x,p[64]=n.y,p[65]=n.z,p[66]=o.x,p[67]=n.y,p[68]=o.z,p[69]=n.x,p[70]=n.y,p[71]=o.z,f.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p})),c.normal){var m=new Float32Array(72);m[0]=0,m[1]=0,m[2]=1,m[3]=0,m[4]=0,m[5]=1,m[6]=0,m[7]=0,m[8]=1,m[9]=0,m[10]=0,m[11]=1,m[12]=0,m[13]=0,m[14]=-1,m[15]=0,m[16]=0,m[17]=-1,m[18]=0,m[19]=0,m[20]=-1,m[21]=0,m[22]=0,m[23]=-1,m[24]=1,m[25]=0,m[26]=0,m[27]=1,m[28]=0,m[29]=0,m[30]=1,m[31]=0,m[32]=0,m[33]=1,m[34]=0,m[35]=0,m[36]=-1,m[37]=0,m[38]=0,m[39]=-1,m[40]=0,m[41]=0,m[42]=-1,m[43]=0,m[44]=0,m[45]=-1,m[46]=0,m[47]=0,m[48]=0,m[49]=1,m[50]=0,m[51]=0,m[52]=1,m[53]=0,m[54]=0,m[55]=1,m[56]=0,m[57]=0,m[58]=1,m[59]=0,m[60]=0,m[61]=-1,m[62]=0,m[63]=0,m[64]=-1,m[65]=0,m[66]=0,m[67]=-1,m[68]=0,m[69]=0,m[70]=-1,m[71]=0,f.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:m})}if(c.st){var _=new Float32Array(48);_[0]=0,_[1]=0,_[2]=1,_[3]=0,_[4]=1,_[5]=1,_[6]=0,_[7]=1,_[8]=1,_[9]=0,_[10]=0,_[11]=0,_[12]=0,_[13]=1,_[14]=1,_[15]=1,_[16]=0,_[17]=0,_[18]=1,_[19]=0,_[20]=1,_[21]=1,_[22]=0,_[23]=1,_[24]=1,_[25]=0,_[26]=0,_[27]=0,_[28]=0,_[29]=1,_[30]=1,_[31]=1,_[32]=1,_[33]=0,_[34]=0,_[35]=0,_[36]=0,_[37]=1,_[38]=1,_[39]=1,_[40]=0,_[41]=0,_[42]=1,_[43]=0,_[44]=1,_[45]=1,_[46]=0,_[47]=1,f.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:_})}if(c.tangent){var g=new Float32Array(72);g[0]=1,g[1]=0,g[2]=0,g[3]=1,g[4]=0,g[5]=0,g[6]=1,g[7]=0,g[8]=0,g[9]=1,g[10]=0,g[11]=0,g[12]=-1,g[13]=0,g[14]=0,g[15]=-1,g[16]=0,g[17]=0,g[18]=-1,g[19]=0,g[20]=0,g[21]=-1,g[22]=0,g[23]=0,g[24]=0,g[25]=1,g[26]=0,g[27]=0,g[28]=1,g[29]=0,g[30]=0,g[31]=1,g[32]=0,g[33]=0,g[34]=1,g[35]=0,g[36]=0,g[37]=-1,g[38]=0,g[39]=0,g[40]=-1,g[41]=0,g[42]=0,g[43]=-1,g[44]=0,g[45]=0,g[46]=-1,g[47]=0,g[48]=-1,g[49]=0,g[50]=0,g[51]=-1,g[52]=0,g[53]=0,g[54]=-1,g[55]=0,g[56]=0,g[57]=-1,g[58]=0,g[59]=0,g[60]=1,g[61]=0,g[62]=0,g[63]=1,g[64]=0,g[65]=0,g[66]=1,g[67]=0,g[68]=0,g[69]=1,g[70]=0,g[71]=0,f.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:g})}if(c.bitangent){var v=new Float32Array(72);v[0]=0,v[1]=1,v[2]=0,v[3]=0,v[4]=1,v[5]=0,v[6]=0,v[7]=1,v[8]=0,v[9]=0,v[10]=1,v[11]=0,v[12]=0,v[13]=1,v[14]=0,v[15]=0,v[16]=1,v[17]=0,v[18]=0,v[19]=1,v[20]=0,v[21]=0,v[22]=1,v[23]=0,v[24]=0,v[25]=0,v[26]=1,v[27]=0,v[28]=0,v[29]=1,v[30]=0,v[31]=0,v[32]=1,v[33]=0,v[34]=0,v[35]=1,v[36]=0,v[37]=0,v[38]=1,v[39]=0,v[40]=0,v[41]=1,v[42]=0,v[43]=0,v[44]=1,v[45]=0,v[46]=0,v[47]=1,v[48]=0,v[49]=0,v[50]=1,v[51]=0,v[52]=0,v[53]=1,v[54]=0,v[55]=0,v[56]=1,v[57]=0,v[58]=0,v[59]=1,v[60]=0,v[61]=0,v[62]=1,v[63]=0,v[64]=0,v[65]=1,v[66]=0,v[67]=0,v[68]=1,v[69]=0,v[70]=0,v[71]=1,f.bitangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:v})}d=new Uint16Array(36),d[0]=0,d[1]=1,d[2]=2,d[3]=0,d[4]=2,d[5]=3,d[6]=6,d[7]=5,d[8]=4,d[9]=7,d[10]=6,d[11]=4,d[12]=8,d[13]=9,d[14]=10,d[15]=8,d[16]=10,d[17]=11,d[18]=14,d[19]=13,d[20]=12,d[21]=15,d[22]=14,d[23]=12,d[24]=18,d[25]=17,d[26]=16,d[27]=19,d[28]=18,d[29]=16,d[30]=20,d[31]=21,d[32]=22,d[33]=20,d[34]=22,d[35]=23}else p=new Float64Array(24),p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,f.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),d=new Uint16Array(36),d[0]=4,d[1]=5,d[2]=6,d[3]=4,d[4]=6,d[5]=7,d[6]=1,d[7]=0,d[8]=3,d[9]=1,d[10]=3,d[11]=2,d[12]=1,d[13]=6,d[14]=5,d[15]=1,d[16]=2,d[17]=6,d[18]=2,d[19]=3,d[20]=7,d[21]=2,d[22]=7,d[23]=6,d[24]=3,d[25]=0,d[26]=4,d[27]=3,d[28]=4,d[29]=7,d[30]=0,d[31]=1,d[32]=5,d[33]=0,d[34]=5,d[35]=4;var y=t.subtract(o,n,h),C=.5*t.magnitude(y);return new a({attributes:f,indices:d,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,C)})}},d}),define("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT);var i=e.minimum,n=e.maximum;this._min=t.clone(i),this._max=t.clone(n),this._workerName="createBoxOutlineGeometry"}var d=new t;c.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var i=e.dimensions,n=t.multiplyByScalar(i,.5,new t);return new c({minimum:t.negate(n,new t),maximum:n})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,i,n){return n=r(n,0),t.pack(e._min,i,n),t.pack(e._max,i,n+t.packedLength),i};var h=new t,p=new t,f={minimum:h,maximum:p};return c.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,h),s=t.unpack(e,i+t.packedLength,p);return n(o)?(o._min=t.clone(a,o._min),o._max=t.clone(s,o._max),o):new c(f)},c.createGeometry=function(r){var n=r._min,o=r._max;if(!t.equals(n,o)){var c=new l,h=new Uint16Array(24),p=new Float64Array(24);p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,c.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),h[0]=4,h[1]=5,h[2]=5,h[3]=6,h[4]=6,h[5]=7,h[6]=7,h[7]=4,h[8]=0,h[9]=1,h[10]=1,h[11]=2,h[12]=2,h[13]=3,h[14]=3,h[15]=0,h[16]=0,h[17]=4,h[18]=1,h[19]=5,h[20]=2,h[21]=6,h[22]=3,h[23]=7;var f=t.subtract(o,n,d),m=.5*t.magnitude(f);return new a({attributes:c,indices:h,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,m)})}},c}),define("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";function t(e){i(e)}if("undefined"!=typeof window){var i=window.cancelAnimationFrame;return function(){if(!e(i))for(var t=["webkit","moz","ms","o"],r=0,n=t.length;r=r[i]){if(i+1=0&&t>=r[i-1])return i-1;var o;if(t>r[i])for(o=i;o=r[o]&&t=0&&!(t>=r[o]&&t=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},r}),define("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,i,n){var o=p,a=m,s=f,l=_;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var d=l[0];for(r(d)||(d=l[0]=new e),e.clone(i,d),c=1;c2&&(r(a)||(a=f,e.multiplyByScalar(n[1],2,a),e.subtract(a,n[2],a),e.subtract(a,n[0],a),e.multiplyByScalar(a,.5,a)),!r(s))){var l=n.length-1;s=m,e.multiplyByScalar(n[l-1],2,s),e.subtract(n[l],s,s),e.add(s,n[l-2],s),e.multiplyByScalar(s,.5,s)}this._times=o,this._points=n,this._firstTangent=e.clone(a),this._lastTangent=e.clone(s),this._evaluateFunction=u(this),this._lastTimeIndex=0}var d=new t,h=new e,p=new e,f=new e,m=new e;return n(c.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}}}),c.catmullRomCoefficientMatrix=new s(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),c.prototype.findTimeInterval=l.prototype.findTimeInterval,c.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},c}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,i,r,n){"use strict";var o={UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,UNSIGNED_INT:n.UNSIGNED_INT};return o.getSizeInBytes=function(e){switch(e){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(t){return e(t)&&(t===o.UNSIGNED_BYTE||t===o.UNSIGNED_SHORT||t===o.UNSIGNED_INT)},o.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,i,n){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,i,n):new Uint16Array(t,i,n)},i(o)}),define("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"arraybuffer",headers:i})}return t}),define("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,i,r,n,o,a){t(a)?a.length=0:a=[];var s,l,u;i?(s=re,l=n>e,u=o>e);var c,d,h,p,f,m,_=s+l+u;return 1===_?s?(c=(e-r)/(n-r),d=(e-r)/(o-r),a.push(1),a.push(2),1!==d&&(a.push(-1),a.push(0),a.push(2),a.push(d)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(h=(e-n)/(o-n),p=(e-n)/(r-n),a.push(2),a.push(0),1!==p&&(a.push(-1),a.push(1),a.push(0),a.push(p)),1!==h&&(a.push(-1),a.push(1),a.push(2),a.push(h))):u&&(f=(e-o)/(r-o),m=(e-o)/(n-o),a.push(0),a.push(1),1!==m&&(a.push(-1),a.push(2),a.push(1),a.push(m)),1!==f&&(a.push(-1),a.push(2),a.push(0),a.push(f))):2===_?s||r===e?l||n===e?u||o===e||(d=(e-r)/(o-r),h=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(d),a.push(-1),a.push(1),a.push(2),a.push(h)):(m=(e-o)/(n-o),c=(e-r)/(n-r),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(m),a.push(-1),a.push(0),a.push(1),a.push(c)):(p=(e-n)/(r-n),f=(e-o)/(r-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(p),a.push(-1),a.push(2),a.push(0),a.push(f)):3!==_&&(a.push(0),a.push(1),a.push(2)),a},r.computeBarycentricCoordinates=function(i,r,n,o,a,s,l,u,c){var d=n-l,h=l-a,p=s-u,f=o-u,m=1/(p*d+h*f),_=r-u,g=i-l,v=(p*g+h*_)*m,y=(-f*g+d*_)*m,C=1-v-y;return t(c)?(c.x=v,c.y=y,c.z=C,c):new e(v,y,C)},r}),define("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){function t(e,t){return a[e]-a[t]}function i(e,t){return o[e]-o[t]}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;var r=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,r),a=this._vValues=this._quantizedVertices.subarray(r,2*r);this._heightValues=this._quantizedVertices.subarray(2*r,3*r),this._westIndices=_(e.westIndices,t,r),this._southIndices=_(e.southIndices,i,r),this._eastIndices=_(e.eastIndices,t,r),this._northIndices=_(e.northIndices,i,r),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=n(e.childTileMask,15),this._createdByUpsampling=n(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}function _(e,t,i){y.length=e.length;for(var r=!1,n=0,o=e.length;n0&&t(e[n-1],e[n])>0;return r?(y.sort(t),l.createTypedArray(i,y)):e}function g(e,t,i){for(var r=e._mesh,n=r.vertices,o=r.encoding,a=r.indices,s=0,l=a.length;s=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){var g=o.decodeHeight(n,c),v=o.decodeHeight(n,d),y=o.decodeHeight(n,h);return _.x*g+_.y*v+_.z*y}}}function v(e,t,i){for(var r=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;s=-1e-15&&C.y>=-1e-15&&C.z>=-1e-15){var w=C.x*o[d]+C.y*o[h]+C.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,w/S)}}}a(m.prototype,{waterMask:{get:function(){return this._waterMask}}});var y=[],C=new h("createVerticesFromQuantizedTerrainMesh");m.prototype.createMesh=function(t,i,r,a,s){var u=t.ellipsoid,c=t.tileXYToRectangle(i,r,a);s=n(s,1);var d=C.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:c,relativeToCenter:this._boundingSphere.center,ellipsoid:u,exaggeration:s});if(o(d)){var h=this;return e(d,function(e){var t=h._quantizedVertices.length/3;t+=h._westIndices.length+h._southIndices.length+h._eastIndices.length+h._northIndices.length;var i=l.createTypedArray(t,e.indices),r=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,u=e.maximumHeight,c=n(e.boundingSphere,h._boundingSphere),d=n(e.orientedBoundingBox,h._orientedBoundingBox),m=h._horizonOcclusionPoint,_=e.vertexStride,g=p.clone(e.encoding);return h._skirtIndex=e.skirtIndex,h._vertexCountWithoutSkirts=h._quantizedVertices.length/3,h._mesh=new f(o,r,i,a,u,c,m,_,d,g,s),h._quantizedVertices=void 0,h._encodedNormals=void 0,h._indices=void 0,h._uValues=void 0,h._vValues=void 0,h._heightValues=void 0,h._westIndices=void 0,h._southIndices=void 0,h._eastIndices=void 0,h._northIndices=void 0,h._mesh})}};var w=new h("upsampleQuantizedTerrainMesh");m.prototype.upsample=function(i,n,a,s,u,c,h){var p=this._mesh;if(o(this._mesh)){var f=2*n!==u,_=2*a===c,g=i.ellipsoid,v=i.tileXYToRectangle(u,c,h),y=w.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:f,isNorthChild:_,childRectangle:v,ellipsoid:g,exaggeration:p.exaggeration});if(o(y)){var C=Math.min(this._westSkirtHeight,this._eastSkirtHeight);C=Math.min(C,this._southSkirtHeight),C=Math.min(C,this._northSkirtHeight);var S=f?.5*C:this._westSkirtHeight,E=_?.5*C:this._southSkirtHeight,b=f?this._eastSkirtHeight:.5*C,T=_?this._northSkirtHeight:.5*C;return e(y,function(e){var i,n=new Uint16Array(e.vertices),a=l.createTypedArray(n.length/3,e.indices);return o(e.encodedNormals)&&(i=new Uint8Array(e.encodedNormals)),new m({quantizedVertices:n,indices:a,encodedNormals:i,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),orientedBoundingBox:d.clone(e.orientedBoundingBox),horizonOcclusionPoint:r.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:S,southSkirtHeight:E,eastSkirtHeight:b,northSkirtHeight:T,childTileMask:0,createdByUpsampling:!0})})}}};var S=32767,E=new r;m.prototype.interpolateHeight=function(e,t,i){var r=c.clamp((t-e.west)/e.width,0,1);r*=S;var n=c.clamp((i-e.south)/e.height,0,1);return n*=S,o(this._mesh)?void g(this,r,n):v(this,r,n)};var b=new i,T=new i,x=new i;return m.prototype.isChildAvailable=function(e,t,i,r){var n=2;return i!==2*e&&++n,r!==2*t&&(n-=2),0!==(this._childTileMask&1<=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function p(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function f(e,t,i){for(var r=0;;){var n=t._nw&&p(t._nw.extent,i),o=t._ne&&p(t._ne.extent,i),a=t._sw&&p(t._sw.extent,i),s=t._se&&p(t._se.extent,i);if(n+o+a+s>1){n&&(r=Math.max(r,f(t,t._nw,i))),o&&(r=Math.max(r,f(t,t._ne,i))),a&&(r=Math.max(r,f(t,t._sw,i))),s&&(r=Math.max(r,f(t,t._se,i)));break}if(n)t=t._nw;else if(o)t=t._ne;else if(a)t=t._sw;else{if(!s)break;t=t._se}}for(;t!==e;){for(var l=t.rectangles,u=l.length-1;u>=0&&l[u].level>r;--u){var c=l[u];p(c,i)&&(r=c.level)}t=t.parent}return r}function m(e,t,i){if(t){var r,n=!1;for(r=0;rt.east&&i.push(new o(t.east,n.south,n.east,n.north)),n.southt.north&&i.push(new o(Math.max(t.west,n.west),t.north,Math.min(t.east,n.east),n.north))):i.push(n)}return i}var g=new o;a.prototype.addAvailableTileRange=function(e,t,i,r,n){var o=this._tilingScheme;o.tileXYToRectangle(t,i,e,g);var a=g.west,s=g.north;o.tileXYToRectangle(r,n,e,g);for(var d=g.east,h=g.south,p=new l(e,a,h,d,s),f=0;f=0;--n)if(i(r[n])&&0===r[n].length)return n;return 0};var S=new t;return a.prototype.isTileAvailable=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(t,i,e,g);return o.center(r,S),this.computeMaximumLevelAtPosition(S)>=e},a.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},r(s.prototype,{nw:{get:function(){return this._nw||(this._nw=new s(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new s(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new s(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new s(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),a}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var i,r=t.name,n=t.message;i=e(r)&&e(n)?r+": "+n:t.toString();var o=t.stack;return e(o)&&(i+="\n"+o),i}return t}),define("Core/TileProviderError",["./defaultValue","./defined","./formatError"],function(e,t,i){"use strict";function r(t,i,r,n,o,a,s){this.provider=t,this.message=i,this.x=r,this.y=n,this.level=o,this.timesRetried=e(a,0),this.retry=!1,this.error=s}return r.handleError=function(e,n,o,a,s,l,u,c,d){var h=e;return t(e)?(h.provider=n,h.message=a,h.x=s,h.y=l,h.level=u,h.retry=!1,h.error=d,++h.timesRetried):h=new r(n,a,s,l,u,0,d),o.numberOfListeners>0?o.raiseEvent(h):console.log('An error occurred in "'+n.constructor.name+'": '+i(a)), -h.retry&&t(c)&&c(),h},r.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},r}),define("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./joinUrls","./loadArrayBuffer","./loadJson","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./TerrainProvider","./throttleRequestByServer","./TileAvailability","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S){"use strict";function E(i){function r(t){var i;if(!t.format)return i="The tile format is not specified in the layer.json file.",void(f=S.handleError(f,_,_._errorEvent,i,void 0,void 0,void 0,l));if(!t.tiles||0===t.tiles.length)return i="The layer.json file does not specify any tile URL templates.",void(f=S.handleError(f,_,_._errorEvent,i,void 0,void 0,void 0,l));if("heightmap-1.0"===t.format)_._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535},_._hasWaterMask=!0,_._requestWaterMask=!0;else if(0!==t.format.indexOf("quantized-mesh-1."))return i='The tile format "'+t.format+'" is invalid or not supported.',void(f=S.handleError(f,_,_._errorEvent,i,void 0,void 0,void 0,l));_._tileUrlTemplates=t.tiles;for(var r=0;r<_._tileUrlTemplates.length;++r){var o=new e(_._tileUrlTemplates[r]),s=new e(_._url);o.authority&&!s.authority&&(s.authority=o.authority,s.scheme=o.scheme),_._tileUrlTemplates[r]=p(s,o).toString().replace("{version}",t.version)}var u=t.available;if(a(u)){_._availability=new w(_._tilingScheme,u.length);for(var c=0;c>1^-(1&e)}var u=0,c=3,d=c+1,p=Float64Array.BYTES_PER_ELEMENT*c,f=Float64Array.BYTES_PER_ELEMENT*d,m=3,y=Uint16Array.BYTES_PER_ELEMENT*m,C=3,w=Uint16Array.BYTES_PER_ELEMENT,S=w*C,E=new DataView(t),b=new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=p;var T=E.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var x=E.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var P=new i(new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0)),E.getFloat64(u+p,!0));u+=f;var M=new r(E.getFloat64(u,!0),E.getFloat64(u+8,!0),E.getFloat64(u+16,!0));u+=p;var D=E.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var I=new Uint16Array(t,u,3*D);u+=D*y,D>65536&&(w=Uint32Array.BYTES_PER_ELEMENT,S=w*C);var R,O=I.subarray(0,D),N=I.subarray(D,2*D),L=I.subarray(2*D,3*D),B=0,F=0,k=0;for(R=0;R1;--A){if(x=t.PI_OVER_TWO-(A-1)*T,L=n(-x,l,E,S,g,y,v,C,w,L),B=n(x+Math.PI,l,E,S,g,y,v,C,w,B),r){for(O[N++]=L.x,O[N++]=L.y,O[N++]=L.z,M=2*(A-1)+2,P=1;P=0?(r=65536*Math.floor(e/65536),i.high=r,i.low=e-r):(r=65536*Math.floor(-e/65536),i.high=-r,i.low=e+r),i};var n={high:0,low:0};r.fromCartesian=function(e,i){t(i)||(i=new r);var o=i.high,a=i.low;return r.encode(e.x,n),o.x=n.high,a.x=n.low,r.encode(e.y,n),o.y=n.high,a.y=n.low,r.encode(e.z,n),o.z=n.high,a.z=n.low,i};var o=new r;return r.writeElements=function(e,t,i){r.fromCartesian(e,o);var n=o.high,a=o.low;t[i]=n.x,t[i+1]=n.y,t[i+2]=n.z,t[i+3]=a.x,t[i+4]=a.y,t[i+5]=a.z},r}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";var r={};return r.calculateACMR=function(i){i=e(i,e.EMPTY_OBJECT);var r=i.indices,n=i.maximumIndex,o=e(i.cacheSize,24),a=r.length;if(!t(n)){n=0;for(var s=0,l=r[s];sn&&(n=l),++s,l=r[s]}for(var u=[],c=0;co&&(u[r[h]]=d,++d);return(d-o+1)/(a/3)},r.tipsify=function(i){function r(e,t,i,r){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;o0)return++o,o-1;++o}return-1}function n(e,t,i,n,o,a,s){for(var l,u=-1,c=-1,d=0;dc||c===-1)&&(c=l,u=h)),++d}return u===-1?r(n,a,e,s):u}i=e(i,e.EMPTY_OBJECT);var o,a=i.indices,s=i.maximumIndex,l=e(i.cacheSize,24),u=a.length,c=0,d=0,h=a[d],p=u;if(t(s))c=s+1;else{for(;dc&&(c=h),++d,h=a[d];if(c===-1)return 0;++c}for(var f=[],m=0;ml&&(y.timeStamp=v,++v),++d}g=n(a,l,w,f,v,S,c)}return b},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b){"use strict";function T(e,t,i,r,n){e[t++]=i,e[t++]=r,e[t++]=r,e[t++]=n,e[t++]=n,e[t]=i}function x(e){for(var t=e.length,i=t/3*6,r=_.createTypedArray(t,i),n=0,o=0;o=3){var i=6*(t-2),r=_.createTypedArray(t,i);T(r,0,e[0],e[1],e[2]);for(var n=6,o=3;o0){for(var t=e.length-1,i=6*(t-1),r=_.createTypedArray(t,i),n=e[0],o=0,a=1;aM&&(M=D)}return new p({attributes:g,indices:v,primitiveType:m,boundingSphere:u(P)?new i(P,M):void 0})}function L(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),i=_.createTypedArray(t,t),r=0;r3&&(i[3]=0,i[4]=2,i[5]=3);for(var r=6,n=3;no?n>a?y.sign(e.y):y.sign(i.y):o>a?y.sign(t.y):y.sign(i.y);var s=r<0;G(e,s),G(t,s),G(i,s)}function W(e,t,i,r){n.add(e,n.multiplyByScalar(n.subtract(t,e,we),e.y/(e.y-t.y),we),i),n.clone(i,r),G(i,!0),G(r,!1)}function q(e,t,i){if(!(e.x>=0||t.x>=0||i.x>=0)){H(e,t,i);var r=e.y<0,n=t.y<0,o=i.y<0,a=0;a+=r?1:0,a+=n?1:0,a+=o?1:0;var s=xe.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,r?(W(e,t,Se,be),W(e,i,Ee,Te),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(W(t,i,Se,be),W(t,e,Ee,Te),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(W(i,e,Se,be),W(i,t,Ee,Te),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,r?n?o||(W(i,e,Se,be),W(i,t,Ee,Te),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(W(t,i,Se,be),W(t,e,Ee,Te),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(W(e,t,Se,be),W(e,i,Ee,Te),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=xe.positions;return l[0]=e,l[1]=t,l[2]=i,l.length=3,1!==a&&2!==a||(l[3]=Se,l[4]=Ee,l[5]=be,l[6]=Te,l.length=7),xe}}function j(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var n in r)if(r.hasOwnProperty(n)&&u(r[n])&&u(r[n].values)){var o=r[n];o.values=s.createTypedArray(o.componentDatatype,o.values)}var a=p.computeNumberOfVertices(e);return e.indices=_.createTypedArray(a,e.indices),t&&(e.boundingSphere=i.fromVertices(r.position.values)),e}}function Y(e){var t=e.attributes,i={};for(var r in t)if(t.hasOwnProperty(r)&&u(t[r])&&u(t[r].values)){var n=t[r];i[r]=new f({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new p({attributes:i,indices:[],primitiveType:e.primitiveType})}function X(e,t,i){var r=u(e.geometry.boundingSphere);t=j(t,r),i=j(i,r),u(i)&&!u(t)?e.geometry=i:!u(i)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=i,e.geometry=void 0)}function Z(e,i,o,a,s,l,c,d,h,p,f,m){if(u(l)||u(c)||u(d)||u(h)||u(p)){var _=n.fromArray(s,3*e,Ae),g=n.fromArray(s,3*i,Pe),v=n.fromArray(s,3*o,Me),y=t(a,_,g,v,De);if(u(l)){var C=n.fromArray(l,3*e,Ae),w=n.fromArray(l,3*i,Pe),S=n.fromArray(l,3*o,Me);n.multiplyByScalar(C,y.x,C),n.multiplyByScalar(w,y.y,w),n.multiplyByScalar(S,y.z,S);var E=n.add(C,w,C);n.add(E,S,E),n.normalize(E,E),n.pack(E,f.normal.values,3*m)}if(u(p)){var b=n.fromArray(p,3*e,Ae),T=n.fromArray(p,3*i,Pe),x=n.fromArray(p,3*o,Me);n.multiplyByScalar(b,y.x,b),n.multiplyByScalar(T,y.y,T),n.multiplyByScalar(x,y.z,x);var A;n.equals(b,n.ZERO)&&n.equals(T,n.ZERO)&&n.equals(x,n.ZERO)?(A=Ae,A.x=0,A.y=0,A.z=0):(A=n.add(b,T,b),n.add(A,x,A),n.normalize(A,A)),n.pack(A,f.extrudeDirection.values,3*m)}if(u(c)){var P=n.fromArray(c,3*e,Ae),M=n.fromArray(c,3*i,Pe),D=n.fromArray(c,3*o,Me);n.multiplyByScalar(P,y.x,P),n.multiplyByScalar(M,y.y,M),n.multiplyByScalar(D,y.z,D);var I=n.add(P,M,P);n.add(I,D,I),n.normalize(I,I),n.pack(I,f.tangent.values,3*m)}if(u(d)){var R=n.fromArray(d,3*e,Ae),O=n.fromArray(d,3*i,Pe),N=n.fromArray(d,3*o,Me);n.multiplyByScalar(R,y.x,R),n.multiplyByScalar(O,y.y,O),n.multiplyByScalar(N,y.z,N);var L=n.add(R,O,R);n.add(L,N,L),n.normalize(L,L),n.pack(L,f.bitangent.values,3*m)}if(u(h)){var B=r.fromArray(h,2*e,Ie),F=r.fromArray(h,2*i,Re),k=r.fromArray(h,2*o,Oe);r.multiplyByScalar(B,y.x,B),r.multiplyByScalar(F,y.y,F),r.multiplyByScalar(k,y.z,k);var V=r.add(B,F,B);r.add(V,k,V),r.pack(V,f.st.values,2*m)}}}function K(e,t,i,r,n,o){var a=e.position.values.length/3;if(n!==-1){var s=r[n],l=i[s];return l===-1?(i[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}function Q(e){var t,i,r,o,a,s=e.geometry,l=s.attributes,c=l.position.values,d=u(l.normal)?l.normal.values:void 0,h=u(l.bitangent)?l.bitangent.values:void 0,p=u(l.tangent)?l.tangent.values:void 0,f=u(l.st)?l.st.values:void 0,m=u(l.extrudeDirection)?l.extrudeDirection.values:void 0,_=s.indices,g=Y(s),v=Y(s),y=[];y.length=c.length/3;var C=[];for(C.length=c.length/3,a=0;a3)for(var M=P.positions,D=P.indices,I=D.length,R=0;R0)){var u=n.unpack(r,s,ze);(l.y<0&&u.y>0||l.y>0&&u.y<0)&&(s-3>0?(r[s]=i[s-3],r[s+1]=i[s-2],r[s+2]=i[s-1]):n.pack(l,r,s));var c=n.unpack(o,s,Ue);(l.y<0&&c.y>0||l.y>0&&c.y<0)&&(s+3n&&(n=i[o]);e.indices=b.tipsify({indices:i,maximumIndex:n,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],i=p.computeNumberOfVertices(e);if(u(e.indices)&&i>=y.SIXTY_FOUR_KILOBYTES){var r,n=[],o=[],a=0,s=M(e.attributes),l=e.indices,c=l.length;e.primitiveType===E.TRIANGLES?r=3:e.primitiveType===E.LINES?r=2:e.primitiveType===E.POINTS&&(r=1);for(var d=0;d=y.SIXTY_FOUR_KILOBYTES&&(t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],o=[],a=0,s=M(e.attributes))}0!==o.length&&t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ie=new n,re=new a;te.projectTo2D=function(e,t,i,r,o){var a=e.attributes[t];o=u(o)?o:new h;for(var l=o.ellipsoid,c=a.values,d=new Float64Array(c.length),p=0,m=0;m0&&a.push(N(t,"geometry")),i.length>0&&(a.push(N(i,"westHemisphereGeometry")),a.push(N(i,"eastHemisphereGeometry"))),a};var ue=new n,ce=new n,de=new n,he=new n;te.computeNormal=function(e){for(var t=e.indices,i=e.attributes,r=i.position.values,o=i.position.values.length/3,a=t.length,l=new Array(o),u=new Array(a/3),c=new Array(a),d=0;d0){for(h=0;h0||i.intersectPlane(r,S.ORIGIN_ZX_PLANE)!==g.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:Q(e);break;case m.LINES:J(e)}else U(t),t.primitiveType===E.TRIANGLES?Q(e):t.primitiveType===E.LINES&&J(e);return e},te}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e,r,o){var a=r.vertexFormat,s=r.center,l=r.semiMajorAxis,c=r.semiMinorAxis,h=r.ellipsoid,m=r.stRotation,_=o?e.length/3*2:e.length/3,g=r.shadowVolume,v=a.st?new Float32Array(2*_):void 0,C=a.normal?new Float32Array(3*_):void 0,w=a.tangent?new Float32Array(3*_):void 0,E=a.bitangent?new Float32Array(3*_):void 0,b=g?new Float32Array(3*_):void 0,T=0,x=U,A=G,P=H,M=new d(h),D=M.project(h.cartesianToCartographic(s,W),q),I=h.scaleToGeodeticSurface(s,N);h.geodeticSurfaceNormal(I,I);for(var R=S.fromAxisAngle(I,m,z),O=y.fromQuaternion(R,V),F=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,j),X=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),Z=e.length,K=o?Z:0,Q=K/3*2,J=0;J1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=r,i=2*n,o=0;o1,p=o(e.vertexFormat,T.DEFAULT);this._center=i.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=c.clone(r),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=u,this._granularity=l,this._vertexFormat=T.clone(p),this._extrudedHeight=o(d,u),this._extrude=h,this._shadowVolume=o(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._rectangle=R(this._center,this._ellipsoid,n,s,this._rotation)}var N=new i,L=new i,B=new i,F=new i,k=new t,V=new y,z=new S,U=new i,G=new i,H=new i,W=new r,q=new i,j=new t,Y=new t,X=new i,Z=new e,K=new e,Q=new C,J=new C,$=new y,ee=[new i,new i,new i,new i],te=[new r,new r,new r,new r];O.packedLength=i.packedLength+c.packedLength+T.packedLength+E.packedLength+9,O.pack=function(e,t,r){return r=o(r,0),i.pack(e._center,t,r),r+=i.packedLength,c.pack(e._ellipsoid,t,r),r+=c.packedLength,T.pack(e._vertexFormat,t,r),r+=T.packedLength,E.pack(e._rectangle,t,r),r+=E.packedLength,t[r++]=e._semiMajorAxis,t[r++]=e._semiMinorAxis,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._height,t[r++]=e._granularity,t[r++]=e._extrudedHeight,t[r++]=e._extrude?1:0,t[r]=e._shadowVolume?1:0,t};var ie=new i,re=new c,ne=new T,oe=new E,ae={center:ie,ellipsoid:re,vertexFormat:ne,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0};return O.unpack=function(e,t,r){t=o(t,0);var n=i.unpack(e,t,ie);t+=i.packedLength;var s=c.unpack(e,t,re);t+=c.packedLength;var l=T.unpack(e,t,ne);t+=T.packedLength;var u=E.unpack(e,t,oe);t+=E.packedLength;var d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=e[t++],_=e[t++],g=e[t++],v=1===e[t++],y=1===e[t];return a(r)?(r._center=i.clone(n,r._center),r._ellipsoid=c.clone(s,r._ellipsoid),r._vertexFormat=T.clone(l,r._vertexFormat),r._semiMajorAxis=d,r._semiMinorAxis=h,r._rotation=p,r._stRotation=f,r._height=m,r._granularity=_,r._extrudedHeight=g,r._extrude=v,r._shadowVolume=y,r._rectangle=E.clone(u),r):(ae.height=m,ae.extrudedHeight=g,ae.granularity=_,ae.stRotation=f,ae.rotation=p,ae.semiMajorAxis=d,ae.semiMinorAxis=h,ae.shadowVolume=y,new O(ae))},O.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),i.shadowVolume=e._shadowVolume,t=I(i)):t=P(i),new h({attributes:t.attributes,indices:t.indices,primitiveType:w.TRIANGLES,boundingSphere:t.boundingSphere})}},O.createShadowVolume=function(e,t,i){var r=e._granularity,n=e._ellipsoid,o=t(r,n),a=i(r,n);return new O({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:T.POSITION_ONLY,shadowVolume:!0})},s(O.prototype,{rectangle:{get:function(){return this._rectangle}}}),O}),define("Core/CircleGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT);var t=e.radius,r={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 o(r),this._workerName="createCircleGeometry"}l.packedLength=o.packedLength,l.pack=function(e,t,i){return o.pack(e._ellipseGeometry,t,i)};var u=new o({center:new e,semiMajorAxis:1,semiMinorAxis:1}),c={center:new e,radius:void 0,ellipsoid:a.clone(a.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new s,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return l.unpack=function(t,i,n){var d=o.unpack(t,i,u);return c.center=e.clone(d._center,c.center),c.ellipsoid=a.clone(d._ellipsoid,c.ellipsoid),c.height=d._height,c.extrudedHeight=d._extrudedHeight,c.granularity=d._granularity,c.vertexFormat=s.clone(d._vertexFormat,c.vertexFormat),c.stRotation=d._stRotation,c.shadowVolume=d._shadowVolume,r(n)?(c.semiMajorAxis=d._semiMajorAxis,c.semiMinorAxis=d._semiMinorAxis,n._ellipseGeometry=new o(c),n):(c.radius=d._semiMajorAxis,new l(c))},l.createGeometry=function(e){return o.createGeometry(e._ellipseGeometry)},l.createShadowVolume=function(e,t,i){var r=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,o=t(r,n),a=i(r,n);return new l({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:r,extrudedHeight:o,height:a,vertexFormat:s.POSITION_ONLY,shadowVolume:!0})},n(l.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),l}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(r){var n=r.center;v=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(n,v),r.height,v),v=t.add(n,v,v);for(var o=new e(v,r.semiMajorAxis),s=a.computeEllipsePositions(r,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,r,!1)})}),h=s.length/3,p=d.createTypedArray(h,2*h),f=0,m=0;m0){var x=Math.min(w,v);T=Math.round(v/x);var A=Math.min(T*w,v);for(E=0;E1;this._center=t.clone(i),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=r(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=d,this._extrude=p,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var g=new t,v=new t,y=new e,C=new e;_.packedLength=t.packedLength+s.packedLength+9,_.pack=function(e,i,o){return o=r(o,0),t.pack(e._center,i,o),o+=t.packedLength,s.pack(e._ellipsoid,i,o),o+=s.packedLength,i[o++]=e._semiMajorAxis,i[o++]=e._semiMinorAxis,i[o++]=e._rotation,i[o++]=e._height,i[o++]=e._granularity,i[o++]=n(e._extrudedHeight)?1:0,i[o++]=r(e._extrudedHeight,0),i[o++]=e._extrude?1:0,i[o]=e._numberOfVerticalLines,i};var w=new t,S=new s,E={center:w,ellipsoid:S,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return _.unpack=function(e,i,o){i=r(i,0);var a=t.unpack(e,i,w);i+=t.packedLength;var l=s.unpack(e,i,S);i+=s.packedLength;var u=e[i++],c=e[i++],d=e[i++],h=e[i++],p=e[i++],f=e[i++],m=e[i++],g=1===e[i++],v=e[i];return n(o)?(o._center=t.clone(a,o._center),o._ellipsoid=s.clone(l,o._ellipsoid),o._semiMajorAxis=u,o._semiMinorAxis=c,o._rotation=d,o._height=h,o._granularity=p,o._extrudedHeight=f?m:void 0,o._extrude=g,o._numberOfVerticalLines=v,o):(E.height=h,E.extrudedHeight=f?m:void 0,E.granularity=p,E.rotation=d,E.semiMajorAxis=u,E.semiMinorAxis=c,E.numberOfVerticalLines=v,new _(E))},_.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,i={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(i.extrudedHeight=Math.min(e._extrudedHeight,e._height),i.height=Math.max(e._extrudedHeight,e._height),t=m(i)):t=f(i),new l({attributes:t.attributes,indices:t.indices,primitiveType:p.LINES,boundingSphere:t.boundingSphere})}},_}),define("Core/CircleOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,i,r,n,o){"use strict";function a(e){e=i(e,i.EMPTY_OBJECT);var t=e.radius,r={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 n(r),this._workerName="createCircleOutlineGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){return n.pack(e._ellipseGeometry,t,i)};var s=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return a.unpack=function(t,i,u){var c=n.unpack(t,i,s);return l.center=e.clone(c._center,l.center),l.ellipsoid=o.clone(c._ellipsoid,l.ellipsoid),l.height=c._height,l.extrudedHeight=c._extrudedHeight,l.granularity=c._granularity,l.numberOfVerticalLines=c._numberOfVerticalLines,r(u)?(l.semiMajorAxis=c._semiMajorAxis,l.semiMinorAxis=c._semiMinorAxis,u._ellipseGeometry=new n(l),u):(l.radius=c._semiMajorAxis,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},a}),define("Core/ClockRange",["./freezeObject"],function(e){"use strict";var t={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};return e(t)}),define("Core/ClockStep",["./freezeObject"],function(e){"use strict";var t={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};return e(t)}),define("Core/getTimestamp",["./defined"],function(e){"use strict";var t;return t="undefined"!=typeof performance&&e(performance.now)?function(){return performance.now()}:function(){return Date.now()}}),define("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){n=i(n,i.EMPTY_OBJECT);var o=n.currentTime,u=n.startTime,c=n.stopTime;o=r(o)?l.clone(o):r(u)?l.clone(u):r(c)?l.addDays(c,-1,new l):l.now(),u=r(u)?l.clone(u):l.clone(o),c=r(c)?l.clone(c):l.addDays(u,1,new l),this.startTime=u,this.stopTime=c,this.clockRange=i(n.clockRange,e.UNBOUNDED),this.canAnimate=i(n.canAnimate,!0),this.onTick=new a,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=s(),this.currentTime=o,this.multiplier=i(n.multiplier,1),this.clockStep=i(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.shouldAnimate=i(n.shouldAnimate,!0)}return n(u.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){l.equals(this._currentTime,e)||(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===t.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=l.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),u.prototype.tick=function(){var i=s(),r=l.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){var n=this._clockStep;if(n===t.SYSTEM_CLOCK)r=l.now(r);else{var o=this._multiplier;if(n===t.TICK_DEPENDENT)r=l.addSeconds(r,o,r);else{var a=i-this._lastSystemTime;r=l.addSeconds(r,o*(a/1e3),r)}var u=this.clockRange,c=this.startTime,d=this.stopTime;if(u===e.CLAMPED)l.lessThan(r,c)?r=l.clone(c,r):l.greaterThan(r,d)&&(r=l.clone(d,r));else if(u===e.LOOP_STOP)for(l.lessThan(r,c)&&(r=l.clone(c,r));l.greaterThan(r,d);)r=l.addSeconds(c,l.secondsDifference(r,d),r)}}return this._currentTime=r,this._lastSystemTime=i,this.onTick.raiseEvent(this),r},u}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,i,r,n,o){"use strict";function a(e,t,i){return i<0&&(i+=1),i>1&&(i-=1),6*i<1?e+6*(t-e)*i:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function s(t,i,r,n){this.red=e(t,1),this.green=e(i,1),this.blue=e(r,1),this.alpha=e(n,1)}s.fromCartesian4=function(e,i){return t(i)?(i.red=e.x,i.green=e.y,i.blue=e.z,i.alpha=e.w,i):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(i,r,n,o,a){return i=s.byteToFloat(e(i,255)),r=s.byteToFloat(e(r,255)),n=s.byteToFloat(e(n,255)),o=s.byteToFloat(e(o,255)),t(a)?(a.red=i,a.green=r,a.blue=n,a.alpha=o,a):new s(i,r,n,o)},s.fromAlpha=function(e,i,r){return t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=i,r):new s(e.red,e.green,e.blue,i)};var l,u,c;r.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e,t){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3],t)},s.fromHsl=function(i,r,n,o,l){i=e(i,0)%1,r=e(r,0),n=e(n,0),o=e(o,1);var u=n,c=n,d=n;if(0!==r){var h;h=n<.5?n*(1+r):n+r-n*r;var p=2*n-h;u=a(p,h,i+1/3),c=a(p,h,i),d=a(p,h,i-1/3)}return t(l)?(l.red=u,l.green=c,l.blue=d,l.alpha=o,l):new s(u,c,d,o)},s.fromRandom=function(i,r){i=e(i,e.EMPTY_OBJECT);var n=i.red;if(!t(n)){var a=e(i.minimumRed,0),l=e(i.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=i.green;if(!t(u)){var c=e(i.minimumGreen,0),d=e(i.maximumGreen,1);u=c+o.nextRandomNumber()*(d-c)}var h=i.blue;if(!t(h)){var p=e(i.minimumBlue,0),f=e(i.maximumBlue,1);h=p+o.nextRandomNumber()*(f-p)}var m=i.alpha;if(!t(m)){var _=e(i.minimumAlpha,0),g=e(i.maximumAlpha,1);m=_+o.nextRandomNumber()*(g-_)}return t(r)?(r.red=n,r.green=u,r.blue=h,r.alpha=m,r):new s(n,u,h,m)};var d=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,h=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,p=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,f=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(i,r){t(r)||(r=new s);var n=s[i.toUpperCase()];if(t(n))return s.clone(n,r),r;var o=d.exec(i);return null!==o?(r.red=parseInt(o[1],16)/15,r.green=parseInt(o[2],16)/15,r.blue=parseInt(o[3],16)/15,r.alpha=1,r):(o=h.exec(i),null!==o?(r.red=parseInt(o[1],16)/255,r.green=parseInt(o[2],16)/255,r.blue=parseInt(o[3],16)/255,r.alpha=1,r):(o=p.exec(i),null!==o?(r.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),r.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),r.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),r.alpha=parseFloat(e(o[4],"1.0")),r):(o=f.exec(i),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0")),r):r=void 0)))},s.packedLength=4,s.pack=function(t,i,r){return r=e(r,0),i[r++]=t.red,i[r++]=t.green,i[r++]=t.blue,i[r]=t.alpha,i},s.unpack=function(i,r,n){return r=e(r,0),t(n)||(n=new s),n.red=i[r++],n.green=i[r++],n.blue=i[r++],n.alpha=i[r],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,i){if(t(e))return t(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=e.alpha,i):new s(e.red,e.green,e.blue,e.alpha)},s.equals=function(e,i){return e===i||t(e)&&t(i)&&e.red===i.red&&e.green===i.green&&e.blue===i.blue&&e.alpha===i.alpha},s.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]},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,i){return this===e||t(e)&&Math.abs(this.red-e.red)<=i&&Math.abs(this.green-e.green)<=i&&Math.abs(this.blue-e.blue)<=i&&Math.abs(this.alpha-e.alpha)<=i},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),i=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+i+")":"rgba("+e+","+t+","+i+","+this.alpha+")"},s.prototype.toBytes=function(e){var i=s.floatToByte(this.red),r=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=i,e[1]=r,e[2]=n,e[3]=o,e):[i,r,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.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},s.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},s.prototype.withAlpha=function(e,t){return s.fromAlpha(this,e,t)},s.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},s.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},s.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},s.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},s.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},s.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},s.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},s.ALICEBLUE=n(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=n(s.fromCssColorString("#FAEBD7")),s.AQUA=n(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=n(s.fromCssColorString("#7FFFD4")),s.AZURE=n(s.fromCssColorString("#F0FFFF")),s.BEIGE=n(s.fromCssColorString("#F5F5DC")),s.BISQUE=n(s.fromCssColorString("#FFE4C4")),s.BLACK=n(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=n(s.fromCssColorString("#FFEBCD")),s.BLUE=n(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=n(s.fromCssColorString("#8A2BE2")),s.BROWN=n(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=n(s.fromCssColorString("#DEB887")),s.CADETBLUE=n(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=n(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=n(s.fromCssColorString("#D2691E")),s.CORAL=n(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=n(s.fromCssColorString("#6495ED")),s.CORNSILK=n(s.fromCssColorString("#FFF8DC")),s.CRIMSON=n(s.fromCssColorString("#DC143C")),s.CYAN=n(s.fromCssColorString("#00FFFF")),s.DARKBLUE=n(s.fromCssColorString("#00008B")),s.DARKCYAN=n(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=n(s.fromCssColorString("#B8860B")),s.DARKGRAY=n(s.fromCssColorString("#A9A9A9")), -s.DARKGREEN=n(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=n(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=n(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=n(s.fromCssColorString("#556B2F")),s.DARKORANGE=n(s.fromCssColorString("#FF8C00")),s.DARKORCHID=n(s.fromCssColorString("#9932CC")),s.DARKRED=n(s.fromCssColorString("#8B0000")),s.DARKSALMON=n(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=n(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=n(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=n(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=n(s.fromCssColorString("#00CED1")),s.DARKVIOLET=n(s.fromCssColorString("#9400D3")),s.DEEPPINK=n(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=n(s.fromCssColorString("#00BFFF")),s.DIMGRAY=n(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=n(s.fromCssColorString("#1E90FF")),s.FIREBRICK=n(s.fromCssColorString("#B22222")),s.FLORALWHITE=n(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=n(s.fromCssColorString("#228B22")),s.FUCHSIA=n(s.fromCssColorString("#FF00FF")),s.GAINSBORO=n(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=n(s.fromCssColorString("#F8F8FF")),s.GOLD=n(s.fromCssColorString("#FFD700")),s.GOLDENROD=n(s.fromCssColorString("#DAA520")),s.GRAY=n(s.fromCssColorString("#808080")),s.GREEN=n(s.fromCssColorString("#008000")),s.GREENYELLOW=n(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=n(s.fromCssColorString("#F0FFF0")),s.HOTPINK=n(s.fromCssColorString("#FF69B4")),s.INDIANRED=n(s.fromCssColorString("#CD5C5C")),s.INDIGO=n(s.fromCssColorString("#4B0082")),s.IVORY=n(s.fromCssColorString("#FFFFF0")),s.KHAKI=n(s.fromCssColorString("#F0E68C")),s.LAVENDER=n(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=n(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=n(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=n(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=n(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=n(s.fromCssColorString("#F08080")),s.LIGHTCYAN=n(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=n(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=n(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=n(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=n(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=n(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=n(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=n(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=n(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=n(s.fromCssColorString("#FFFFE0")),s.LIME=n(s.fromCssColorString("#00FF00")),s.LIMEGREEN=n(s.fromCssColorString("#32CD32")),s.LINEN=n(s.fromCssColorString("#FAF0E6")),s.MAGENTA=n(s.fromCssColorString("#FF00FF")),s.MAROON=n(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=n(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=n(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=n(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=n(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=n(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=n(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=n(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=n(s.fromCssColorString("#48D1CC")),s.MEDIUMVIOLETRED=n(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=n(s.fromCssColorString("#191970")),s.MINTCREAM=n(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=n(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=n(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=n(s.fromCssColorString("#FFDEAD")),s.NAVY=n(s.fromCssColorString("#000080")),s.OLDLACE=n(s.fromCssColorString("#FDF5E6")),s.OLIVE=n(s.fromCssColorString("#808000")),s.OLIVEDRAB=n(s.fromCssColorString("#6B8E23")),s.ORANGE=n(s.fromCssColorString("#FFA500")),s.ORANGERED=n(s.fromCssColorString("#FF4500")),s.ORCHID=n(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=n(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=n(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=n(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=n(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=n(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=n(s.fromCssColorString("#FFDAB9")),s.PERU=n(s.fromCssColorString("#CD853F")),s.PINK=n(s.fromCssColorString("#FFC0CB")),s.PLUM=n(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=n(s.fromCssColorString("#B0E0E6")),s.PURPLE=n(s.fromCssColorString("#800080")),s.RED=n(s.fromCssColorString("#FF0000")),s.ROSYBROWN=n(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=n(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=n(s.fromCssColorString("#8B4513")),s.SALMON=n(s.fromCssColorString("#FA8072")),s.SANDYBROWN=n(s.fromCssColorString("#F4A460")),s.SEAGREEN=n(s.fromCssColorString("#2E8B57")),s.SEASHELL=n(s.fromCssColorString("#FFF5EE")),s.SIENNA=n(s.fromCssColorString("#A0522D")),s.SILVER=n(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=n(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=n(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=n(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=n(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=n(s.fromCssColorString("#00FF7F")),s.STEELBLUE=n(s.fromCssColorString("#4682B4")),s.TAN=n(s.fromCssColorString("#D2B48C")),s.TEAL=n(s.fromCssColorString("#008080")),s.THISTLE=n(s.fromCssColorString("#D8BFD8")),s.TOMATO=n(s.fromCssColorString("#FF6347")),s.TURQUOISE=n(s.fromCssColorString("#40E0D0")),s.VIOLET=n(s.fromCssColorString("#EE82EE")),s.WHEAT=n(s.fromCssColorString("#F5DEB3")),s.WHITE=n(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=n(s.fromCssColorString("#F5F5F5")),s.YELLOW=n(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=n(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=n(new s(0,0,0,0)),s}),define("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(t,r,n,o){t=i(t,1),r=i(r,1),n=i(n,1),o=i(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(r),e.floatToByte(n),e.floatToByte(o)])}return n(a.prototype,{componentDatatype:{get:function(){return t.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),a.fromColor=function(e){return new a(e.red,e.green,e.blue,e.alpha)},a.toValue=function(e,t){return r(t)?e.toBytes(t):new Uint8Array(e.toBytes())},a.equals=function(e,t){return e===t||r(e)&&r(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]},a}),define("Core/CompressedTextureBuffer",["./defined","./defineProperties"],function(e,t){"use strict";function i(e,t,i,r){this._format=e,this._width=t,this._height=i,this._buffer=r}return t(i.prototype,{internalFormat:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}}),i.clone=function(t){if(e(t))return new i(t._format,t._width,t._height,t._buffer)},i.prototype.clone=function(){return i.clone(this)},i}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=e._uSquared,i=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,n=(i-r)/i,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),d=l*a,h=d*d,p=1-h,f=Math.sqrt(p),m=t/4,_=m*m,g=_*m,v=_*_,y=1+m-3*_/4+5*g/4-175*v/64,C=1-m+15*_/8-35*g/8,w=1-3*m+35*_/4,S=1-5*m,E=y*c-C*Math.sin(2*c)*m/2-w*Math.sin(4*c)*_/16-S*Math.sin(6*c)*g/48-5*Math.sin(8*c)*v/512,b=e._constants;b.a=i,b.b=r,b.f=n,b.cosineHeading=o,b.sineHeading=a,b.tanU=s,b.cosineU=l,b.sineU=u,b.sigma=c,b.sineAlpha=d,b.sineSquaredAlpha=h,b.cosineSquaredAlpha=p,b.cosineAlpha=f,b.u2Over4=m,b.u4Over16=_,b.u6Over64=g,b.u8Over256=v,b.a0=y,b.a1=C,b.a2=w,b.a3=S,b.distanceRatio=E}function u(e,t){return e*t*(4+e*(4-3*t))/16}function c(e,t,i,r,n,o,a){var s=u(e,i);return(1-s)*e*t*(r+s*n*(a+s*o*(2*a*a-1)))}function d(e,t,i,r,n,o,a){var l,u,d,h,p,f=(t-i)/t,m=o-r,_=Math.atan((1-f)*Math.tan(n)),g=Math.atan((1-f)*Math.tan(a)),v=Math.cos(_),y=Math.sin(_),C=Math.cos(g),w=Math.sin(g),S=v*C,E=v*w,b=y*w,T=y*C,x=m,A=s.TWO_PI,P=Math.cos(x),M=Math.sin(x);do{P=Math.cos(x),M=Math.sin(x);var D=E-T*P;d=Math.sqrt(C*C*M*M+D*D),u=b+S*P,l=Math.atan2(d,u);var I;0===d?(I=0,h=1):(I=S*M/d,h=1-I*I),A=x,p=u-2*b/h,isNaN(p)&&(p=0),x=m+c(f,I,h,l,d,u,p)}while(Math.abs(x-A)>s.EPSILON12);var R=h*(t*t-i*i)/(i*i),O=1+R*(4096+R*(R*(320-175*R)-768))/16384,N=R*(256+R*(R*(74-47*R)-128))/1024,L=p*p,B=N*d*(p+N*(u*(2*L-1)-N*p*(4*d*d-3)*(4*L-3)/6)/4),F=i*O*(l-B),k=Math.atan2(C*M,E-T*P),V=Math.atan2(v*M,E*P-T);e._distance=F,e._startHeading=k,e._endHeading=V,e._uSquared=R}function h(i,r,n,o){e.normalize(o.cartographicToCartesian(r,m),f),e.normalize(o.cartographicToCartesian(n,m),m);d(i,o.maximumRadius,o.minimumRadius,r.longitude,r.latitude,n.longitude,n.latitude),i._start=t.clone(r,i._start),i._end=t.clone(n,i._end),i._start.height=0,i._end.height=0,l(i)}function p(e,n,o){var s=i(o,a.WGS84);this._ellipsoid=s,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(n)&&h(this,e,n,s)}var f=new e,m=new e;return n(p.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}}}),p.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,i){var n=this._constants,o=n.distanceRatio+e/n.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),u=Math.sin(2*o),d=Math.sin(4*o),h=Math.sin(6*o),p=Math.sin(8*o),f=o*o,m=o*f,_=n.u8Over256,g=n.u2Over4,v=n.u6Over64,y=n.u4Over16,C=2*m*_*a/3+o*(1-g+7*y/4-15*v/4+579*_/64-(y-15*v/4+187*_/16)*a-(5*v/4-115*_/16)*s-29*_*l/16)+(g/2-y+71*v/32-85*_/16)*u+(5*y/16-5*v/4+383*_/96)*d-f*((v-11*_/2)*u+5*_*d/2)+(29*v/96-29*_/16)*h+539*_*p/1536,w=Math.asin(Math.sin(C)*n.cosineAlpha),S=Math.atan(n.a/n.b*Math.tan(w));C-=n.sigma;var E=Math.cos(2*n.sigma+C),b=Math.sin(C),T=Math.cos(C),x=n.cosineU*T,A=n.sineU*b,P=Math.atan2(b*n.sineHeading,x-A*n.cosineHeading),M=P-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,b,T,E);return r(i)?(i.longitude=this._start.longitude+M,i.latitude=S,i.height=0,i):new t(this._start.longitude+M,S,0)},p}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(e,t,i){var r=b;r.length=e;var n;if(t===i){for(n=0;n0){n=i(n,c.IDENTITY);var l=c.inverseTransformation(n,_),u=c.multiplyByPoint(l,e.ZERO,g),h=c.multiplyByPointAsVector(l,e.UNIT_Y,v),p=d.fromPointNormal(u,h,y),f=c.multiplyByPointAsVector(l,e.UNIT_X,C),m=d.fromPointNormal(u,f,w),b=1;o.push(e.clone(t[0]));for(var T=o[0],x=t.length,A=1;A=0?-c:c}function m(e,i,r,n,o,a,u,c){var h=V,p=z;L=d.eastNorthUpToFixedFrame(e,o,L),h=l.multiplyByPointAsVector(L,N,h),h=t.normalize(h,h);var m=f(h,i,e,o);F=s.fromRotationZ(m,F),U.z=a,L=l.multiplyTransformation(L,l.fromRotationTranslation(F,U,B),L);var _=k;_[0]=u;for(var g=0;g0)for(var w=f?2:1,S=0;S=0};var X=new t,Z=new t;return R.computePositions=function(e,i,r,o,s){var l=o._ellipsoid,c=h(e,l),d=o._granularity,f=o._cornerType,I=s?g(i,r):v(i,r),O=s?v(i,r):void 0,N=r.height/2,L=r.width/2,B=e.length,F=[],k=s?[]:void 0,V=w,z=S,U=E,G=b,H=T,W=x,q=A,j=P,Y=M,K=e[0],Q=e[1];G=l.geodeticSurfaceNormal(K,G),V=t.subtract(Q,K,V),V=t.normalize(V,V),j=t.cross(G,V,j),j=t.normalize(j,j);var J=c[0],$=c[1];s&&(k=m(K,j,O,k,l,J+N,1,1)),Y=t.clone(K,Y),K=Q,z=t.negate(V,z);for(var ee,te,ie=1;ie80*n){c=h=e[0],d=p=e[1];for(var g=n;gh&&(h=f),m>p&&(p=m);_=Math.max(h-c,p-d)}return r(s,u,n,c,d,_),u}function t(e,t,i,r,n){var o,a;if(n===P(e,t,i,r)>0)for(o=t;o=t;o-=r)a=T(o,e[o],e[o+1],a);return a&&y(a,a.next)&&(x(a),a=a.next),a}function i(e,t){if(!e)return e;t||(t=e);var i,r=e;do if(i=!1,r.steiner||!y(r,r.next)&&0!==v(r.prev,r,r.next))r=r.next;else{if(x(r),r=t=r.prev,r===r.next)return null;i=!0}while(i||r!==t);return t}function r(e,t,l,u,c,d,p){if(e){!p&&d&&h(e,u,c,d);for(var f,m,_=e;e.prev!==e.next;)if(f=e.prev,m=e.next,d?o(e,u,c,d):n(e))t.push(f.i/l),t.push(e.i/l),t.push(m.i/l),x(e),e=m.next,_=m.next;else if(e=m,e===_){p?1===p?(e=a(e,t,l),r(e,t,l,u,c,d,2)):2===p&&s(e,t,l,u,c,d):r(i(e),t,l,u,c,d,1);break}}}function n(e){var t=e.prev,i=e,r=e.next;if(v(t,i,r)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(_(t.x,t.y,i.x,i.y,r.x,r.y,n.x,n.y)&&v(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(e,t,i,r){var n=e.prev,o=e,a=e.next;if(v(n,o,a)>=0)return!1;for(var s=n.xo.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,d=f(s,l,t,i,r),h=f(u,c,t,i,r),p=e.nextZ;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&_(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function a(e,t,i){var r=e;do{var n=r.prev,o=r.next.next;!y(n,o)&&C(n,r,r.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/i),t.push(r.i/i),t.push(o.i/i),x(r),x(r.next),r=e=o),r=r.next}while(r!==e);return r}function s(e,t,n,o,a,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&g(l,u)){var c=b(l,u);return l=i(l,l.next),c=i(c,c.next),r(l,t,n,o,a,s),void r(c,t,n,o,a,s)}u=u.next}l=l.next}while(l!==e)}function l(e,r,n,o){var a,s,l,d,h,p=[];for(a=0,s=r.length;a=r.next.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=n&&s>a){if(a=s,s===n){if(o===r.y)return r;if(o===r.next.y)return r.next}i=r.x=r.x&&r.x>=c&&_(oi.x)&&S(r,e)&&(i=r,h=l)),r=r.next;return i}function h(e,t,i,r){var n=e;do null===n.z&&(n.z=f(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,p(n)}function p(e){var t,i,r,n,o,a,s,l,u=1;do{for(i=e,e=null,o=null,a=0;i;){for(a++,r=i,s=0,t=0;t0||l>0&&r;)0===s?(n=r,r=r.nextZ,l--):0!==l&&r?i.z<=r.z?(n=i,i=i.nextZ,s--):(n=r,r=r.nextZ,l--):(n=i,i=i.nextZ,s--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;i=r}o.nextZ=null,u*=2}while(a>1);return e}function f(e,t,i,r,n){return e=32767*(e-i)/n,t=32767*(t-r)/n,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,i=e;do t.x=0&&(e-a)*(r-s)-(i-a)*(t-s)>=0&&(i-a)*(o-s)-(n-a)*(r-s)>=0}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!w(e,t)&&S(e,t)&&S(t,e)&&E(e,t)}function v(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function C(e,t,i,r){return!!(y(e,t)&&y(i,r)||y(e,r)&&y(i,t))||v(e,t,i)>0!=v(e,t,r)>0&&v(i,r,e)>0!=v(i,r,t)>0}function w(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&&C(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1}function S(e,t){return v(e.prev,e,e.next)<0?v(e,t,e.next)>=0&&v(e,e.prev,t)>=0:v(e,t,e.prev)<0||v(e,e.next,t)<0}function E(e,t){var i=e,r=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do i.y>o!=i.next.y>o&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next;while(i!==e);return r}function b(e,t){var i=new A(e.i,e.x,e.y),r=new A(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function T(e,t,i,r){var n=new A(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function x(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 A(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 P(e,t,i,r){for(var n=0,o=t,a=i-r;o0&&(r+=e[n-1].length,i.holes.push(r))}return i},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var i={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===i.CLOCKWISE||e===i.COUNTER_CLOCKWISE}};return e(i)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";var p=new i,f=new i,m={};m.computeArea2D=function(e){for(var t=e.length,i=0,r=t-1,n=0;n0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},m.triangulate=function(i,r){var n=t.packArray(i);return e(n,r,2)};var _=new i,g=new i,v=new i,y=new i,C=new i,w=new i,S=new i;return m.computeSubdivision=function(e,t,a,s){s=n(s,c.RADIANS_PER_DEGREE);var h,p=a.slice(0),f=t.length,m=new Array(3*f),E=0;for(h=0;h0;){var D,I,R=p.pop(),O=p.pop(),N=p.pop(),L=i.fromArray(m,3*N,_),B=i.fromArray(m,3*O,g),F=i.fromArray(m,3*R,v),k=i.multiplyByScalar(i.normalize(L,y),A,y),V=i.multiplyByScalar(i.normalize(B,C),A,C),z=i.multiplyByScalar(i.normalize(F,w),A,w),U=i.magnitudeSquared(i.subtract(k,V,S)),G=i.magnitudeSquared(i.subtract(V,z,S)),H=i.magnitudeSquared(i.subtract(z,k,S)),W=Math.max(U,G,H);W>M?U===W?(D=Math.min(N,O)+" "+Math.max(N,O),h=x[D],o(h)||(I=i.add(L,B,S),i.multiplyByScalar(I,.5,I),m.push(I.x,I.y,I.z),h=m.length/3-1,x[D]=h),p.push(N,h,R),p.push(h,O,R)):G===W?(D=Math.min(O,R)+" "+Math.max(O,R),h=x[D],o(h)||(I=i.add(B,F,S),i.multiplyByScalar(I,.5,I),m.push(I.x,I.y,I.z),h=m.length/3-1,x[D]=h),p.push(O,h,N),p.push(h,R,N)):H===W&&(D=Math.min(R,N)+" "+Math.max(R,N),h=x[D],o(h)||(I=i.add(F,L,S),i.multiplyByScalar(I,.5,I),m.push(I.x,I.y,I.z),h=m.length/3-1,x[D]=h),p.push(R,h,O),p.push(h,N,O)):(T.push(N),T.push(O),T.push(R))}return new l({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m})},indices:T,primitiveType:d.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,r,a){r=n(r,s.WGS84);var l=p,u=f;if(t=n(t,0),a=n(a,!0),o(e))for(var c=e.length,d=0;dwe;s--)Ce=_.PI_OVER_TWO-s*ye,ge[ve++]=1-me*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=we;s>0;s--)Ce=_.PI_OVER_TWO-ye*s,ge[ve++]=1-_e*(1+Math.cos(Ce)),ge[ve++]=.5*(1+Math.sin(Ce));for(s=C-T;s>0;s--)ge[ve++]=s*_e,ge[ve++]=1;for(s=1;s0;s--)ge[ve++]=(s-1)*_e,ge[ve++]=1}y.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:ge})}return t.normal&&(y.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.normals})),t.tangent&&(y.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.tangents})),t.bitangent&&(y.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:q.bitangents})),{attributes:y,indices:Q}}function E(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var r,n,o=e.position.values;(t.normal||t.bitangent)&&(r=e.normal.values,n=e.bitangent.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,d=2*u;if(t.normal||t.bitangent||t.tangent){var h=t.normal?new Float32Array(6*u):void 0,p=t.tangent?new Float32Array(6*u):void 0,f=t.bitangent?new Float32Array(6*u):void 0,m=M,_=D,g=I,v=R,y=O,C=N,w=d;for(s=0;s0){var w=Math.min(_,m);g=Math.round(m/w),C+=w}for(var S=d.createTypedArray(v,2*C),E=0,b=0;b0)for(b=0;b1?1:u;var C=p(u);for(t in n){var w=r[t]||0,S=n[t];S instanceof Array?i[t]=f(S,C):("string"==typeof S&&(S=w+parseFloat(S,10)),"number"==typeof S&&(i[t]=w+(S-w)*C))}if(null!==v&&v.call(i,C),1==u){if(s>0){isFinite(s)&&s--;for(t in o){if("string"==typeof n[t]&&(o[t]=o[t]+parseFloat(n[t],10)),l){var E=o[t];o[t]=n[t],n[t]=E}r[t]=o[t]}return l&&(c=!c),h=e+d,!0}null!==y&&y.call(i);for(var b=0,T=m.length;b1?a(t[r],t[r-1],r-n):a(t[o],t[o+1>r?r:o+1],n-o)},Bezier:function(t,i){var r,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(r=0;r<=o;r++)n+=a(1-i,o-r)*a(i,r)*t[r]*s(o,r);return n},CatmullRom:function(t,i){var r=t.length-1,n=r*i,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[r]?(i<0&&(o=Math.floor(n=r*(1+i))),a(t[(o-1+r)%r],t[o],t[(o+1)%r],t[(o+2)%r],n-o)):i<0?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):i>1?t[r]-(a(t[r],t[r],t[r-1],t[r-1],n-r)-t[r]):a(t[o?o-1:0],t[o],t[r1;i--)r*=i;return e[t]=r}}(),CatmullRom:function(e,t,i,r,n){var o=.5*(i-e),a=.5*(r-t),s=n*n,l=n*s;return(2*t-2*i+o+a)*l+(-3*t+3*i-2*o-a)*s+o*n+t}}},e}),define("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";var i={LINEAR_NONE:e.Easing.Linear.None,QUADRACTIC_IN:e.Easing.Quadratic.In,QUADRACTIC_OUT:e.Easing.Quadratic.Out,QUADRACTIC_IN_OUT:e.Easing.Quadratic.InOut,CUBIC_IN:e.Easing.Cubic.In,CUBIC_OUT:e.Easing.Cubic.Out,CUBIC_IN_OUT:e.Easing.Cubic.InOut,QUARTIC_IN:e.Easing.Quartic.In,QUARTIC_OUT:e.Easing.Quartic.Out,QUARTIC_IN_OUT:e.Easing.Quartic.InOut,QUINTIC_IN:e.Easing.Quintic.In,QUINTIC_OUT:e.Easing.Quintic.Out,QUINTIC_IN_OUT:e.Easing.Quintic.InOut,SINUSOIDAL_IN:e.Easing.Sinusoidal.In,SINUSOIDAL_OUT:e.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:e.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:e.Easing.Exponential.In,EXPONENTIAL_OUT:e.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:e.Easing.Exponential.InOut,CIRCULAR_IN:e.Easing.Circular.In,CIRCULAR_OUT:e.Easing.Circular.Out,CIRCULAR_IN_OUT:e.Easing.Circular.InOut,ELASTIC_IN:e.Easing.Elastic.In,ELASTIC_OUT:e.Easing.Elastic.Out,ELASTIC_IN_OUT:e.Easing.Elastic.InOut,BACK_IN:e.Easing.Back.In,BACK_OUT:e.Easing.Back.Out,BACK_IN_OUT:e.Easing.Back.InOut,BOUNCE_IN:e.Easing.Bounce.In,BOUNCE_OUT:e.Easing.Bounce.Out,BOUNCE_IN_OUT:e.Easing.Bounce.InOut};return t(i)}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,w),r=n(e.stackPartitions,64),o=n(e.slicePartitions,64),a=n(e.vertexFormat,f.DEFAULT);this._radii=i.clone(t),this._stackPartitions=r,this._slicePartitions=o,this._vertexFormat=f.clone(a),this._workerName="createEllipsoidGeometry"}var _=new i,g=new i,v=new i,y=new i,C=new i,w=new i(1,1,1),S=Math.cos,E=Math.sin;m.packedLength=i.packedLength+f.packedLength+2,m.pack=function(e,t,r){return r=n(r,0),i.pack(e._radii,t,r),r+=i.packedLength,f.pack(e._vertexFormat,t,r),r+=f.packedLength,t[r++]=e._stackPartitions,t[r]=e._slicePartitions,t};var b=new i,T=new f,x={radii:b,vertexFormat:T,stackPartitions:void 0,slicePartitions:void 0};return m.unpack=function(e,t,r){t=n(t,0);var a=i.unpack(e,t,b);t+=i.packedLength;var s=f.unpack(e,t,T);t+=f.packedLength;var l=e[t++],u=e[t]; -return o(r)?(r._radii=i.clone(a,r._radii),r._vertexFormat=f.clone(s,r._vertexFormat),r._stackPartitions=l,r._slicePartitions=u,r):(x.stackPartitions=l,x.slicePartitions=u,new m(x))},m.createGeometry=function(n){var o=n._radii;if(!(o.x<=0||o.y<=0||o.z<=0)){var a,f,m=s.fromCartesian3(o),w=n._vertexFormat,b=n._slicePartitions+1,T=n._stackPartitions+1,x=T*b,A=new Float64Array(3*x),P=6*(b-1)*(T-2),M=d.createTypedArray(x,P),D=w.normal?new Float32Array(3*x):void 0,I=w.tangent?new Float32Array(3*x):void 0,R=w.bitangent?new Float32Array(3*x):void 0,O=w.st?new Float32Array(2*x):void 0,N=new Array(b),L=new Array(b),B=0;for(a=0;aA.length&&(B=3*(a-b*Math.floor(.5*T))),i.fromArray(A,B,K),m.geodeticSurfaceNormal(K,K),t.negate(K,K)),O[W++]=Math.atan2(K.y,K.x)/h.TWO_PI+.5,O[W++]=Math.asin(Z.z)/Math.PI+.5}if(w.normal&&(D[q++]=Z.x,D[q++]=Z.y,D[q++]=Z.z),w.tangent||w.bitangent){var Q=v;if(ax-b-1?(i.cross(i.UNIT_X,Z,Q),i.normalize(Q,Q)):(i.cross(i.UNIT_Z,Z,Q),i.normalize(Q,Q)),w.tangent&&(I[j++]=Q.x,I[j++]=Q.y,I[j++]=Q.z),w.bitangent){var J=i.cross(Z,Q,y);i.normalize(J,J),R[Y++]=J.x,R[Y++]=J.y,R[Y++]=J.z}}}w.st&&(H.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:O})),w.normal&&(H.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:D})),w.tangent&&(H.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:I})),w.bitangent&&(H.bitangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R}))}for(B=0,f=0;fN-w-1;--o)x[A++]=N,x[A++]=o;var L=new u({position:new l({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:T})});return new s({attributes:L,indices:x,primitiveType:h.LINES,boundingSphere:e.fromEllipsoid(y)})}},p}),define("Core/EllipsoidTerrainProvider",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,{}),this._tilingScheme=r.tilingScheme,i(this._tilingScheme)||(this._tilingScheme=new a({ellipsoid:t(r.ellipsoid,n.WGS84)})),this._levelZeroMaximumGeometricError=l.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new o,this._readyPromise=e.resolve(!0)}return r(u.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}}}),u.prototype.requestTileGeometry=function(e,t,i,r){var n=16,o=16;return new s({buffer:new Uint8Array(n*o),width:n,height:o})},u.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<0){for(l=0;l1){var P=o.compressedTextureSize(g,y,C);A=A.slice(0,P)}return new t(g,y,C,A)}var u=[171,75,84,88,32,49,49,187,13,10,26,10],c=67305985,d=4;return s}),define("Core/loadXML",["./loadWithXhr"],function(e){"use strict";function t(t,i){return e({url:t,responseType:"document",headers:i,overrideMimeType:"text/xml"})}return t}),define("Core/MapboxApi",["./defined","./Credit"],function(e,t){"use strict";var i={};i.defaultAccessToken=void 0;var r,n=!1,o="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 https://www.mapbox.com/account/apps/, 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.";return i.getAccessToken=function(t){return e(t)?t:e(i.defaultAccessToken)?i.defaultAccessToken:(n||(console.log(o),n=!0),"pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6ImNpd204Zm4wejAwNzYyeW5uNjYyZmFwdWEifQ.7i-VIZZWX8pd1bTfxIVj9g")},i.getErrorCredit=function(n){if(!e(n)&&!e(i.defaultAccessToken))return e(r)||(r=new t(o)),r},i}),define("Core/MapProjection",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return e(i.prototype,{ellipsoid:{get:t.throwInstantiationError}}),i.prototype.project=t.throwInstantiationError,i.prototype.unproject=t.throwInstantiationError,i}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./freezeObject"],function(e,t,i,r,n,o){"use strict";function a(e,t,r,n){this[0]=i(e,0),this[1]=i(r,0),this[2]=i(t,0),this[3]=i(n,0)}a.packedLength=4,a.pack=function(e,t,r){return r=i(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t},a.unpack=function(e,t,n){return t=i(t,0),r(n)||(n=new a),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n},a.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new a(e[0],e[2],e[1],e[3])},a.fromArray=function(e,t,n){return t=i(t,0),r(n)||(n=new a),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n},a.fromColumnMajorArray=function(e,t){return a.clone(e,t)},a.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new a(e[0],e[1],e[2],e[3])},a.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new a(e.x,0,0,e.y)},a.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new a(e,0,0,e)},a.fromRotation=function(e,t){var i=Math.cos(e),n=Math.sin(e);return r(t)?(t[0]=i,t[1]=n,t[2]=-n,t[3]=i,t):new a(i,-n,n,i)},a.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},a.getElementIndex=function(e,t){return 2*e+t},a.getColumn=function(e,t,i){var r=2*t,n=e[r],o=e[r+1];return i.x=n,i.y=o,i},a.setColumn=function(e,t,i,r){r=a.clone(e,r);var n=2*t;return r[n]=i.x,r[n+1]=i.y,r},a.getRow=function(e,t,i){var r=e[t],n=e[t+2];return i.x=r,i.y=n,i},a.setRow=function(e,t,i,r){return r=a.clone(e,r),r[t]=i.x,r[t+2]=i.y,r};var s=new e;a.getScale=function(t,i){return i.x=e.magnitude(e.fromElements(t[0],t[1],s)),i.y=e.magnitude(e.fromElements(t[2],t[3],s)),i};var l=new e;return a.getMaximumScale=function(t){return a.getScale(t,l),e.maximumComponent(l)},a.multiply=function(e,t,i){var r=e[0]*t[0]+e[2]*t[1],n=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return i[0]=r,i[1]=o,i[2]=n,i[3]=a,i},a.add=function(e,t,i){return i[0]=e[0]+t[0],i[1]=e[1]+t[1],i[2]=e[2]+t[2],i[3]=e[3]+t[3],i},a.subtract=function(e,t,i){return i[0]=e[0]-t[0],i[1]=e[1]-t[1],i[2]=e[2]-t[2],i[3]=e[3]-t[3],i},a.multiplyByVector=function(e,t,i){var r=e[0]*t.x+e[2]*t.y,n=e[1]*t.x+e[3]*t.y;return i.x=r,i.y=n,i},a.multiplyByScalar=function(e,t,i){return i[0]=e[0]*t,i[1]=e[1]*t,i[2]=e[2]*t,i[3]=e[3]*t,i},a.multiplyByScale=function(e,t,i){return i[0]=e[0]*t.x,i[1]=e[1]*t.x,i[2]=e[2]*t.y,i[3]=e[3]*t.y,i},a.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},a.transpose=function(e,t){var i=e[0],r=e[2],n=e[1],o=e[3];return t[0]=i,t[1]=r,t[2]=n,t[3]=o,t},a.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},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},a.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]},a.equalsEpsilon=function(e,t,i){return e===t||r(e)&&r(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},a.IDENTITY=o(new a(1,0,0,1)),a.ZERO=o(new a(0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN1ROW0=2,a.COLUMN1ROW1=3,n(a.prototype,{length:{get:function(){return a.packedLength}}}),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},a}),define("Core/mergeSort",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t,i,r,n,s){var l,u,c=n-r+1,d=s-n,h=o,p=a;for(l=0;l=d||t(m,_,i)<=0)?(e[f]=m,++l):u=a)){var s=Math.floor(.5*(o+a));r(e,t,n,o,s),r(e,t,n,s+1,a),i(e,t,n,o,s,a)}}function n(e,t,i){var n=e.length,s=Math.ceil(.5*n);o.length=s,a.length=s,r(e,t,i,0,n-1),o.length=0,a.length=0}var o=[],a=[];return n}),define("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,i){"use strict";function r(t,i,r,n){this.near=e(t,0),this.nearValue=e(i,0),this.far=e(r,1),this.farValue=e(n,0)}return r.clone=function(e,i){if(t(e))return t(i)?(i.near=e.near,i.nearValue=e.nearValue,i.far=e.far,i.farValue=e.farValue,i):new r(e.near,e.nearValue,e.far,e.farValue)},r.packedLength=4,r.pack=function(t,i,r){return r=e(r,0),i[r++]=t.near,i[r++]=t.nearValue,i[r++]=t.far,i[r]=t.farValue,i},r.unpack=function(i,n,o){return n=e(n,0),t(o)||(o=new r),o.near=i[n++],o.nearValue=i[n++],o.far=i[n++],o.farValue=i[n],o},r.equals=function(e,i){return e===i||t(e)&&t(i)&&e.near===i.near&&e.nearValue===i.nearValue&&e.far===i.far&&e.farValue===i.farValue},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equals=function(e){return r.equals(this,e)},r}),define("Core/Visibility",["./freezeObject"],function(e){"use strict";var t={NONE:-1,PARTIAL:0,FULL:1};return e(t)}),define("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){this._occluderPosition=t.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=i}var d=new t;n(c.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=t.clone(e,this._cameraPosition);var i,r,n,o=t.subtract(this._occluderPosition,e,d),a=t.magnitudeSquared(o),s=this._occluderRadius*this._occluderRadius;if(a>s){i=Math.sqrt(a-s),a=1/Math.sqrt(a),r=t.multiplyByScalar(o,a,d);var l=i*i*a;n=t.add(e,t.multiplyByScalar(r,l,d),d)}else i=Number.MAX_VALUE;this._horizonDistance=i,this._horizonPlaneNormal=r,this._horizonPlanePosition=n,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,i,n){return r(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=i,n):new c(e,i)};var h=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var i=t.subtract(e,this._occluderPosition,h),r=this._occluderRadius;if(r=t.magnitudeSquared(i)-r*r,r>0)return r=Math.sqrt(r)+this._horizonDistance,i=t.subtract(e,this._cameraPosition,i),r*r>t.magnitudeSquared(i)}return!1};var p=new t;c.prototype.isBoundingSphereVisible=function(e){var i=t.clone(e.center,p),r=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,h),o=this._occluderRadius-r;if(o=t.magnitudeSquared(n)-o*o,r0&&(o=Math.sqrt(o)+this._horizonDistance, -n=t.subtract(i,this._cameraPosition,n),o*o+r*r>t.magnitudeSquared(n));if(o>0){n=t.subtract(i,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=r*r;return(this._horizonDistance*this._horizonDistance+s)*l>a*s||(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1};var f=new t;c.prototype.computeVisibility=function(e){var i=t.clone(e.center),r=e.radius;if(r>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(i,this._occluderPosition,f),o=this._occluderRadius-r,a=t.magnitudeSquared(n);if(o=a-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(i,this._cameraPosition,n);var s=t.magnitudeSquared(n);return o*o+r*r0?(o=Math.sqrt(o)+this._horizonDistance,s-r?u.PARTIAL:u.FULL))}}return u.NONE};var m=new t;c.computeOccludeePoint=function(e,i,r){var n=t.clone(i),o=t.clone(e.center),a=e.radius,s=r.length,l=t.normalize(t.subtract(n,o,m),m),u=-t.dot(l,o),d=c._anyRotationVector(o,l,u),h=c._horizonToPlaneNormalDotProduct(e,l,u,d,r[0]);if(h){for(var p,f=1;fn.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a,s=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var l=(t.dot(i,n)+r)/-t.dot(i,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var v=new t;c._rotationVector=function(e,i,r,n,o){var a=t.subtract(n,e,v);if(a=t.normalize(a,a),t.dot(i,a)<.9999999847691291){var l=t.cross(i,a,a),u=t.magnitude(l);if(u>s.EPSILON13)return t.normalize(l,new t)}return o};var y=new t,C=new t,w=new t,S=new t;return c._horizonToPlaneNormalDotProduct=function(e,i,r,n,o){var a=t.clone(o,y),s=t.clone(e.center,C),l=e.radius,u=t.subtract(s,a,w),c=t.magnitudeSquared(u),d=l*l;if(c"+i,document.body.appendChild(d),o.leading=1.2*s;var h=e(d,"height");if(h=h.replace("px",""),h>=2*s&&(o.leading=h/2|0),document.body.removeChild(d),c)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var p=document.createElement("canvas"),f=100;p.width=o.width+f,p.height=3*s,p.style.opacity=1,p.style.fontFamily=a,p.style.fontSize=s,p.style.fontStyle=l,p.style.fontWeight=u;var m=p.getContext("2d");m.font=l+" "+u+" "+s+"px "+a;var _=p.width,g=p.height,v=g/2;m.fillStyle="white",m.fillRect(-1,-1,_+2,g+2),r&&(m.strokeStyle="black",m.lineWidth=t.lineWidth,m.strokeText(i,f/2,v)),n&&(m.fillStyle="black",m.fillText(i,f/2,v));for(var y=m.getImageData(0,0,_,g).data,C=0,w=4*_,S=y.length;++C0&&255===y[C];);var b=C/w|0;for(C=0;C=S&&(C=C-S+4);var T=C%w/4|0,x=1;for(C=S-3;C>=0&&255===y[C];)C-=w,C<0&&(C=S-3-4*x++);var A=C%w/4+1|0;o.ascent=v-E,o.descent=b-v,o.bounds={minx:T-f/2,maxx:A-f/2,miny:0,maxy:b-E},o.height=1+(b-E)}return o};return t}),define("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,i,r,n){"use strict";function o(n,o){if(""!==n){o=i(o,i.EMPTY_OBJECT);var s=i(o.font,"10px sans-serif"),l=i(o.stroke,!1),u=i(o.fill,!0),c=i(o.strokeWidth,1),d=i(o.backgroundColor,t.TRANSPARENT),h=i(o.padding,0),p=2*h,f=document.createElement("canvas");f.width=1,f.height=1,f.style.font=s;var m=f.getContext("2d");r(a)||(r(m.imageSmoothingEnabled)?a="imageSmoothingEnabled":r(m.mozImageSmoothingEnabled)?a="mozImageSmoothingEnabled":r(m.webkitImageSmoothingEnabled)?a="webkitImageSmoothingEnabled":r(m.msImageSmoothingEnabled)&&(a="msImageSmoothingEnabled")),m.font=s,m.lineJoin="round",m.lineWidth=c,m[a]=!1,m.textBaseline=i(o.textBaseline,"bottom"),f.style.visibility="hidden",document.body.appendChild(f);var _=e(m,n,l,u);f.dimensions=_,document.body.removeChild(f),f.style.visibility="";var g=-_.bounds.minx,v=Math.ceil(_.width)+g+p,y=_.height+p,C=y-_.ascent+p,w=y-C+p;if(f.width=v,f.height=y,m.font=s,m.lineJoin="round",m.lineWidth=c,m[a]=!1,d!==t.TRANSPARENT&&(m.fillStyle=d.toCssColorString(),m.fillRect(0,0,f.width,f.height)),l){var S=i(o.strokeColor,t.BLACK);m.strokeStyle=S.toCssColorString(),m.strokeText(n,g+h,w)}if(u){var E=i(o.fillColor,t.WHITE);m.fillStyle=E.toCssColorString(),m.fillText(n,g+h,w)}return f}}var a;return o}),define("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./loadImage","./writeTextToCanvas"],function(e,t,i,r,n,o){"use strict";function a(){this._cache={}}function s(e,t,i){e.save(),e.scale(i/24,i/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,c).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 l(e,i,r){var n=r/2.5,o=n,a=n;i.width>i.height?a=n*(i.height/i.width):i.width0&&r.y>0&&r.z>0}var r=new t;return i}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,i=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,i}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e,i,r,n){return t.subtract(i,e,v),t.multiplyByScalar(v,r/n,v),t.add(e,v,v),[v.x,v.y,v.z]}var g={};g.computeHierarchyPackedLength=function(e){for(var i=0,r=[e];r.length>0;){var o=r.pop();if(n(o)){i+=2;var a=o.positions,s=o.holes;if(n(a)&&(i+=a.length*t.packedLength),n(s))for(var l=s.length,u=0;u0;){var a=o.pop();if(n(a)){var s=a.positions,l=a.holes;if(i[r++]=n(s)?s.length:0,i[r++]=n(l)?l.length:0,n(s))for(var u=s.length,c=0;c0?new Array(n):void 0,s=0;s0?new Array(u):void 0;for(s=0;sw?(d=o.TWO_PI-S+w,n=Math.ceil(d/h)+1,a=Math.ceil(T/h)+1,u=d/(n-1),c=T/(a-1)):(d=w-S,n=Math.ceil(d/h)+1,a=Math.ceil(T/h)+1,u=d/(n-1),c=T/(a-1)),i=s.northwest(t,i);var x=s.center(t,m);0===v&&0===y||(x.longitude1||v>1))for(var w=0;w0;t-=d)j=3*t,Z=M(Z,J,j,C,T),J+=6,n.st&&(Q=D(Q,$,2*t,x),$+=4),r&&(ee+=3,K[ee++]=I[j],K[ee++]=I[j+1],K[ee++]=I[j+2]);for(t=d-1;t>=0;t--)j=3*t,Z=M(Z,J,j,C,T),J+=6,n.st&&(Q=D(Q,$,2*t,x),$+=4),r&&(ee+=3,K[ee++]=I[j],K[ee++]=I[j+1],K[ee++]=I[j+2]);var ie=A(Z,n,p);n.st&&(ie.attributes.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:Q})),r&&(ie.attributes.extrudeDirection=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:K}));var re,ne,oe,ae,se=_.createTypedArray(X,6*Y);w=Z.length/3;var le=0;for(t=0;t=0;t--)_.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=0,h=n-2;h>0;h--)_.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(var m=a.length/3*2,g=d.createTypedArray(a.length/3,m),v=0,y=0;yI.mouseEmulationIgnoreMilliseconds}function v(e,i){if(g(e)){var n=i.button;e._buttonDown=n;var o;if(n===R.LEFT)o=u.LEFT_DOWN;else if(n===R.MIDDLE)o=u.MIDDLE_DOWN;else{if(n!==R.RIGHT)return;o=u.RIGHT_DOWN}var a=c(e,i,e._primaryPosition);t.clone(a,e._primaryStartPosition),t.clone(a,e._primaryPreviousPosition);var s=h(i),l=e.getInputAction(o,s);r(l)&&(t.clone(a,O.position),l(O),i.preventDefault())}}function y(e,i){if(g(e)){var n=i.button;e._buttonDown=void 0;var o,a;if(n===R.LEFT)o=u.LEFT_UP,a=u.LEFT_CLICK;else if(n===R.MIDDLE)o=u.MIDDLE_UP,a=u.MIDDLE_CLICK;else{if(n!==R.RIGHT)return;o=u.RIGHT_UP,a=u.RIGHT_CLICK}var s=h(i),l=e.getInputAction(o,s),d=e.getInputAction(a,s);if(r(l)||r(d)){var p=c(e,i,e._primaryPosition);if(r(l)&&(t.clone(p,N.position),l(N)),r(d)){var f=e._primaryStartPosition,m=f.x-p.x,_=f.y-p.y,v=Math.sqrt(m*m+_*_);v0?t.detail*-120:t.wheelDelta;if(r(i)){var o=h(t),a=e.getInputAction(u.WHEEL,o);r(a)&&(a(i),t.preventDefault())}}function E(e,i){_(e);var r,n,o,a=i.changedTouches,s=a.length,l=e._positions;for(r=0;rM;++r){a=o;var s=a-t*Math.sin(a)-e,l=1-t*Math.cos(a);o=a-s/l}return a=o+i*n.TWO_PI}function f(e,t){var i=Math.floor(e/n.TWO_PI);e-=i*n.TWO_PI;var r=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),a=Math.atan2(o,r);return a=n.zeroToTwoPi(a),e<0&&(a-=n.TWO_PI),a+=i*n.TWO_PI}function m(e,i,r,n){var a=Math.cos(e),s=Math.sin(e),l=Math.cos(i),u=Math.sin(i),c=Math.cos(r),d=Math.sin(r);return t(n)?(n[0]=c*a-d*s*l,n[1]=d*a+c*s*l,n[2]=s*u,n[3]=-c*s-d*a*l,n[4]=-d*s+c*a*l,n[5]=a*u,n[6]=d*u,n[7]=-c*u,n[8]=l):n=new o(c*a-d*s*l,-c*s-d*a*l,d*u,d*a+c*s*l,-d*s+c*a*l,-c*u,s*u,a*u,l),n}function _(e,t){u(e,Ae);var i=Ae.dayNumber-S.dayNumber+(Ae.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*r,o=D+U*Math.cos(O*n)+Z*Math.sin(O*n)+G*Math.cos(N*n)+K*Math.sin(N*n)+H*Math.cos(L*n)+Q*Math.sin(L*n)+W*Math.cos(B*n)+J*Math.sin(B*n)+q*Math.cos(F*n)+$*Math.sin(F*n)+j*Math.cos(k*n)+ee*Math.sin(k*n)+Y*Math.cos(V*n)+te*Math.sin(V*n)+X*Math.cos(z*n)+ie*Math.sin(z*n),s=I+R*r+de*Math.cos(re*n)+ye*Math.sin(re*n)+he*Math.cos(ne*n)+Ce*Math.sin(ne*n)+pe*Math.cos(oe*n)+we*Math.sin(oe*n)+fe*Math.cos(ae*n)+Se*Math.sin(ae*n)+me*Math.cos(se*n)+Ee*Math.sin(se*n)+_e*Math.cos(le*n)+be*Math.sin(le*n)+ge*Math.cos(ue*n)+Te*Math.sin(ue*n)+ve*Math.cos(ce*n)+xe*Math.sin(ce*n),l=.0167086342-.0004203654*r,d=102.93734808*b+11612.3529*T*r,h=469.97289*T*r,p=174.87317577*b-8679.27034*T*r;return c(o,l,h,d,p,s,t)}function g(e,t){u(e,Ae);var i=Ae.dayNumber-S.dayNumber+(Ae.secondsOfDay-S.secondsOfDay)/a.SECONDS_PER_DAY,r=i/a.DAYS_PER_JULIAN_CENTURY,n=r*r,o=n*r,s=o*r,l=383397.7725+.004*r,d=.055545526-1.6e-8*r,h=5.15668983*b,p=-8e-5*r+.02966*n-42e-6*o-1.3e-7*s,f=83.35324312*b,m=14643420.2669*r-38.2702*n-.045047*o+21301e-8*s,_=125.04455501*b,g=-6967919.3631*r+6.3602*n+.007625*o-3586e-8*s,v=218.31664563*b,y=1732559343.4847*r-6.391*n+.006588*o-3169e-8*s,C=297.85019547*b+T*(1602961601.209*r-6.3706*n+.006593*o-3169e-8*s),w=93.27209062*b+T*(1739527262.8478*r-12.7512*n-.001037*o+417e-8*s),x=134.96340251*b+T*(1717915923.2178*r+31.8792*n+.051635*o-2447e-7*s),A=357.52910918*b+T*(129596581.0481*r-.5532*n+136e-6*o-1149e-8*s),P=310.17137918*b-T*(6967051.436*r+6.2068*n+.007618*o-3219e-8*s),M=2*C,D=4*C,I=6*C,R=2*x,O=3*x,N=4*x,L=2*w;l+=3400.4*Math.cos(M)-635.6*Math.cos(M-x)-235.6*Math.cos(x)+218.1*Math.cos(M-A)+181*Math.cos(M+x),d+=.014216*Math.cos(M-x)+.008551*Math.cos(M-R)-.001383*Math.cos(x)+.001356*Math.cos(M+x)-.001147*Math.cos(D-O)-914e-6*Math.cos(D-R)+869e-6*Math.cos(M-A-x)-627e-6*Math.cos(M)-394e-6*Math.cos(D-N)+282e-6*Math.cos(M-A-R)-279e-6*Math.cos(C-x)-236e-6*Math.cos(R)+231e-6*Math.cos(D)+229e-6*Math.cos(I-N)-201e-6*Math.cos(R-L),p+=486.26*Math.cos(M-L)-40.13*Math.cos(M)+37.51*Math.cos(L)+25.73*Math.cos(R-L)+19.97*Math.cos(M-A-L),m+=-55609*Math.sin(M-x)-34711*Math.sin(M-R)-9792*Math.sin(x)+9385*Math.sin(D-O)+7505*Math.sin(D-R)+5318*Math.sin(M+x)+3484*Math.sin(D-N)-3417*Math.sin(M-A-x)-2530*Math.sin(I-N)-2376*Math.sin(M)-2075*Math.sin(M-O)-1883*Math.sin(R)-1736*Math.sin(I-5*x)+1626*Math.sin(A)-1370*Math.sin(I-O),g+=-5392*Math.sin(M-L)-540*Math.sin(A)-441*Math.sin(M)+423*Math.sin(L)-288*Math.sin(R-L),y+=-3332.9*Math.sin(M)+1197.4*Math.sin(M-x)-662.5*Math.sin(A)+396.3*Math.sin(x)-218*Math.sin(M-A);var B=2*P,F=3*P;p+=46.997*Math.cos(P)*r-.614*Math.cos(M-L+P)*r+.614*Math.cos(M-L-P)*r-.0297*Math.cos(B)*n-.0335*Math.cos(P)*n+.0012*Math.cos(M-L+B)*n-16e-5*Math.cos(P)*o+4e-5*Math.cos(F)*o+4e-5*Math.cos(B)*o;var k=2.116*Math.sin(P)*r-.111*Math.sin(M-L-P)*r-.0015*Math.sin(P)*n;m+=k,y+=k,g+=-520.77*Math.sin(P)*r+13.66*Math.sin(M-L+P)*r+1.12*Math.sin(M-P)*r-1.06*Math.sin(L-P)*r+.66*Math.sin(B)*n+.371*Math.sin(P)*n-.035*Math.sin(M-L+B)*n-.015*Math.sin(M-L+P)*n+.0014*Math.sin(P)*o-.0011*Math.sin(F)*o-9e-4*Math.sin(B)*o,l*=E;var V=h+p*T,z=f+m*T,U=v+y*T,G=_+g*T;return c(l,d,V,z,G,U,t)}function v(t,i){return i=g(t,i),e.multiplyByScalar(i,Me,i)}var y={},C=32.184,w=2451545,S=new r(2451545,0,s.TAI),E=1e3,b=n.RADIANS_PER_DEGREE,T=n.RADIANS_PER_ARCSECOND,x=14959787e4,A=new o,P=50,M=n.EPSILON8,D=1.0000010178*x,I=100.46645683*b,R=1295977422.83429*T,O=16002,N=21863,L=32004,B=10931,F=14529,k=16368,V=15318,z=32794,U=64e-7*x,G=-152e-7*x,H=62e-7*x,W=-8e-7*x,q=32e-7*x,j=-41e-7*x,Y=19e-7*x,X=-11e-7*x,Z=1e-7*-150*x,K=-46e-7*x,Q=68*1e-7*x,J=54e-7*x,$=14e-7*x,ee=24e-7*x,te=-28e-7*x,ie=22e-7*x,re=10,ne=16002,oe=21863,ae=10931,se=1473,le=32004,ue=4387,ce=73,de=-325e-7,he=-322e-7,pe=1e-7*-79,fe=232*1e-7,me=1e-7*-52,_e=97e-7,ge=55e-7,ve=-41e-7,ye=-105e-7,Ce=-137e-7,we=258e-7,Se=35e-7,Ee=1e-7*-116,be=-88e-7,Te=-112e-7,xe=-8e-6,Ae=new r(0,0,s.TAI),Pe=.012300034,Me=Pe/(Pe+1)*-1,De=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Ie=new e;return y.computeSunPositionInEarthInertialFrame=function(i,n){return t(i)||(i=r.now()),t(n)||(n=new e),Ie=_(i,Ie),n=e.negate(Ie,n),v(i,Ie),e.subtract(n,Ie,n),o.multiplyByVector(De,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,i){return t(e)||(e=r.now()),i=g(e,i),o.multiplyByVector(De,i,i),i},y}),define("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e,t,r,n,o,a,s){var l,u=p.numberOfPoints(e,t,o),c=r.red,d=r.green,h=r.blue,f=r.alpha,m=n.red,_=n.green,g=n.blue,v=n.alpha;if(i.equals(r,n)){for(l=0;l0?new Array(u):void 0;for(l=0;l0&&(t.pack(j,s,W),W+=3,w=E[a-1],C[q++]=i.floatToByte(w.red),C[q++]=i.floatToByte(w.green),C[q++]=i.floatToByte(w.blue),C[q++]=i.floatToByte(w.alpha)),M&&a===D-1)break;t.pack(j,s,W),W+=3,o(E)&&(w=E[a],C[q++]=i.floatToByte(w.red),C[q++]=i.floatToByte(w.green),C[q++]=i.floatToByte(w.blue),C[q++]=i.floatToByte(w.alpha))}}var Y=new c;Y.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:s}),o(E)&&(Y.color=new u({componentDatatype:r.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0})),_=s.length/3;var X=2*(_-1),Z=d.createTypedArray(_,X),K=0;for(a=0;a<_-1;++a)Z[K++]=a,Z[K++]=a+1;return new l({attributes:Y,indices:Z,primitiveType:f.LINES,boundingSphere:e.fromPoints(S)})},_}),define("Core/SphereGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidGeometry","./VertexFormat"],function(e,t,i,r,n,o){"use strict";function a(t){var r=i(t.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,vertexFormat:t.vertexFormat};this._ellipsoidGeometry=new n(a),this._workerName="createSphereGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,i){return n.pack(e._ellipsoidGeometry,t,i)};var s=new n,l={radius:void 0,radii:new e,vertexFormat:new o,stackPartitions:void 0,slicePartitions:void 0};return a.unpack=function(t,i,u){var c=n.unpack(t,i,s);return l.vertexFormat=o.clone(c._vertexFormat,l.vertexFormat),l.stackPartitions=c._stackPartitions,l.slicePartitions=c._slicePartitions,r(u)?(e.clone(c._radii,l.radii),u._ellipsoidGeometry=new n(l),u):(l.radius=c._radii.x,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},a}),define("Core/SphereOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidOutlineGeometry"],function(e,t,i,r,n){"use strict";function o(t){var r=i(t.radius,1),o=new e(r,r,r),a={radii:o,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,subdivisions:t.subdivisions};this._ellipsoidGeometry=new n(a),this._workerName="createSphereOutlineGeometry"}o.packedLength=n.packedLength,o.pack=function(e,t,i){return n.pack(e._ellipsoidGeometry,t,i)};var a=new n,s={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return o.unpack=function(t,i,l){var u=n.unpack(t,i,a);return s.stackPartitions=u._stackPartitions,s.slicePartitions=u._slicePartitions,s.subdivisions=u._subdivisions,r(l)?(e.clone(u._radii,s.radii),l._ellipsoidGeometry=new n(s),l):(s.radius=u._radii.x,new o(s))},o.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},o}),define("Core/Spherical",["./Check","./defaultValue","./defined"],function(e,t,i){"use strict";function r(e,i,r){this.clock=t(e,0),this.cone=t(i,0),this.magnitude=t(r,1)}return r.fromCartesian3=function(e,t){var n=e.x,o=e.y,a=e.z,s=n*n+o*o;return i(t)||(t=new r),t.clock=Math.atan2(o,n),t.cone=Math.atan2(Math.sqrt(s),a),t.magnitude=Math.sqrt(s+a*a),t},r.clone=function(e,t){if(i(e))return i(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new r(e.clock,e.cone,e.magnitude)},r.normalize=function(e,t){return i(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new r(e.clock,e.cone,1)},r.equals=function(e,t){return e===t||i(e)&&i(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},r.equalsEpsilon=function(e,r,n){return n=t(n,0),e===r||i(e)&&i(r)&&Math.abs(e.clock-r.clock)<=n&&Math.abs(e.cone-r.cone)<=n&&Math.abs(e.magnitude-r.magnitude)<=n},r.prototype.equals=function(e){return r.equals(this,e)},r.prototype.clone=function(e){return r.clone(this,e)},r.prototype.equalsEpsilon=function(e,t){return r.equalsEpsilon(this,e,t)},r.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"},r}),define("Core/subdivideArray",["./defined","./DeveloperError"],function(e,t){"use strict";function i(e,t){for(var i=[],r=e.length,n=0;n0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},u.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},u.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},u.prototype.contains=function(e){return this.indexOf(e)>=0};var c=new s;return u.prototype.indexOf=function(t){var i=this._intervals;c.start=t,c.stop=t;var r=e(i,c,l);return r>=0?i[r].isStartIncluded?r:r>0&&i[r-1].stop.equals(t)&&i[r-1].isStopIncluded?r-1:~r:(r=~r,r>0&&r-10&&t.isStartIncluded&&u[o-1].isStartIncluded&&u[o-1].start.equals(t.start)?--o:o0&&(n=a.compare(u[o-1].stop,t.start),(n>0||0===n&&(u[o-1].isStopIncluded||t.isStartIncluded))&&((i(r)?r(u[o-1].data,t.data):u[o-1].data===t.data)?(t=new s(a.greaterThan(t.stop,u[o-1].stop)?{start:u[o-1].start,stop:t.stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}:{start:u[o-1].start,stop:u[o-1].stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:u[o-1].isStopIncluded||t.stop.equals(u[o-1].stop)&&t.isStopIncluded,data:t.data}),u.splice(o-1,1),--o):(n=a.compare(u[o-1].stop,t.stop),n>0||0===n&&u[o-1].isStopIncluded&&!t.isStopIncluded?u.splice(o-1,1,new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}),new s({start:t.stop,stop:u[o-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o-1].isStopIncluded,data:u[o-1].data})):u[o-1]=new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}))));o0||0===n&&(t.isStopIncluded||u[o].isStartIncluded));)if(i(r)?r(u[o].data,t.data):u[o].data===t.data)t=new s({start:t.start,stop:a.greaterThan(u[o].stop,t.stop)?u[o].stop:t.stop,isStartIncluded:t.isStartIncluded,isStopIncluded:a.greaterThan(u[o].stop,t.stop)?u[o].isStopIncluded:t.isStopIncluded,data:t.data}),u.splice(o,1);else{if(u[o]=new s({start:t.stop,stop:u[o].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o].isStopIncluded,data:u[o].data}),!u[o].isEmpty)break;u.splice(o,1)}u.splice(o,0,t),this._changedEvent.raiseEvent(this)}},u.prototype.removeInterval=function(t){if(t.isEmpty)return!1;var i=!1,r=this._intervals,n=e(r,t,l);n<0&&(n=~n);var o=t.start,u=t.stop,c=t.isStartIncluded,d=t.isStopIncluded;if(n>0){var h=r[n-1],p=h.stop;(a.greaterThan(p,o)||s.equals(p,o)&&h.isStopIncluded&&c)&&(i=!0,(a.greaterThan(p,u)||h.isStopIncluded&&!d&&s.equals(p,u))&&r.splice(n,0,new s({start:u,stop:p,isStartIncluded:!d,isStopIncluded:h.isStopIncluded,data:h.data})),r[n-1]=new s({start:h.start,stop:o,isStartIncluded:h.isStartIncluded,isStopIncluded:!c,data:h.data}))}var f=r[n];for(nh?h:d<0?0:d;var f=s?e(this.tolerance,1):.001;Math.abs(l-p)>f&&(this._seeking=!0,r.currentTime=l)}},a}),define("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./loadXML","./Math","./Rectangle","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g){"use strict";function v(e,t){this.rectangle=e,this.maxLevel=t}function y(r){function n(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void o("SRS "+t+" is not supported.");_._tilingScheme=new l({ellipsoid:y});var i=e.getElementsByTagName("TileFormat")[0];_._heightmapWidth=parseInt(i.getAttribute("width"),10),_._heightmapHeight=parseInt(i.getAttribute("height"),10),_._levelZeroMaximumGeometricError=m.getEstimatedLevelZeroGeometricErrorForAHeightmap(y,Math.min(_._heightmapWidth,_._heightmapHeight),_._tilingScheme.getNumberOfXTilesAtLevel(0));for(var r=e.getElementsByTagName("DataExtent"),n=0;n0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new s,this._ready=!1,this._readyPromise=e.defer(),this._proxy=r.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var c=r.credit;"string"==typeof c&&(c=new t(c)),this._credit=c,this._tilingScheme=void 0,this._rectangles=[];var d,_=this,y=i(r.ellipsoid,a.WGS84);u()}function C(e,t,i,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,i,n),l=0,u=0;u=3){var g=i.fromPoints(s,e),v=g.projectPointsOntoPlane(s);n.computeWindingOrder2D(v)===a.CLOCKWISE&&(s.reverse(),u.reverse(),c.reverse())}var y,C,w=s.length,S=w-2,E=r.chordLength(d,e.maximumRadius),b=f;if(b.minDistance=E,b.ellipsoid=e,m){var T,x=0;for(T=0;T0)for(c=new Array(l),s=0;s0)for(d=new Array(l),s=0;s0)for(c=new Array(l),s=0;s0)for(d=new Array(l),s=0;s=s&&(g=s-1);var v=_/h|0;return v>=l&&(v=l-1),i(n)?(n.x=g,n.y=v,n):new e(g,v)}},s}),define("Core/wrapFunction",["./DeveloperError"],function(e){"use strict";function t(e,t,i){return function(){i.apply(e,arguments),t.apply(e,arguments)}}return t}),define("DataSources/ConstantProperty",["../Core/defined","../Core/defineProperties","../Core/Event"],function(e,t,i){"use strict";function r(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new i,this.setValue(e)}return t(r.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),r.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},r.prototype.setValue=function(t){var i=this._value;if(i!==t){var r=e(t),n=r&&"function"==typeof t.clone,o=r&&"function"==typeof t.equals;this._hasClone=n,this._hasEquals=o;var a=!o||!t.equals(i);a&&(this._value=n?t.clone():t,this._definitionChanged.raiseEvent(this))}},r.prototype.equals=function(e){return this===e||e instanceof r&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},r}),define("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined","./ConstantProperty"],function(e,t,i){"use strict";function r(e,i,r,n,o){return{configurable:n,get:function(){return this[i]},set:function(n){var a=this[i],s=this[r];t(s)&&(s(),this[r]=void 0);var l=t(n);l&&!t(n.getValue)&&t(o)&&(n=o(n)),a!==n&&(this[i]=n,this._definitionChanged.raiseEvent(this,e,n,a)),t(n)&&t(n.definitionChanged)&&(this[r]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function n(e){return new i(e)}function o(t,i,o){return r(t,"_"+t.toString(),"_"+t.toString()+"Subscription",e(i,!1),e(o,n))}return o}),define("DataSources/BillboardGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,i,r,n,o){"use strict";function a(t){this._image=void 0,this._imageSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return i(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),imageSubRegion:o("imageSubRegion"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),sizeInMeters:o("sizeInMeters"),distanceDisplayCondition:o("distanceDisplayCondition")}),a.prototype.clone=function(e){return t(e)?(e.color=this._color,e.eyeOffset=this._eyeOffset,e.heightReference=this._heightReference,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.imageSubRegion=this._imageSubRegion,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.sizeInMeters=this._sizeInMeters,e.distanceDisplayCondition=this._distanceDisplayCondition,e):new a(this)},a.prototype.merge=function(t){this.color=e(this._color,t.color),this.eyeOffset=e(this._eyeOffset,t.eyeOffset),this.heightReference=e(this._heightReference,t.heightReference),this.horizontalOrigin=e(this._horizontalOrigin,t.horizontalOrigin),this.image=e(this._image,t.image),this.imageSubRegion=e(this._imageSubRegion,t.imageSubRegion),this.pixelOffset=e(this._pixelOffset,t.pixelOffset),this.scale=e(this._scale,t.scale),this.rotation=e(this._rotation,t.rotation),this.alignedAxis=e(this._alignedAxis,t.alignedAxis),this.show=e(this._show,t.show),this.verticalOrigin=e(this._verticalOrigin,t.verticalOrigin),this.width=e(this._width,t.width),this.height=e(this._height,t.height),this.scaleByDistance=e(this._scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.sizeInMeters=e(this._sizeInMeters,t.sizeInMeters),this.distanceDisplayCondition=e(this._distanceDisplayCondition,t.distanceDisplayCondition)},a}),define("Scene/HeightReference",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2};return e(t)}),define("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,LEFT:1,RIGHT:-1};return e(t)}),define("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};return e(t)}),define("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";var t={DONE:0,PENDING:1,FAILED:2};return e(t)}),define("DataSources/Property",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,i,r){"use strict";function n(){r.throwInstantiationError()}return i(n.prototype,{isConstant:{get:r.throwInstantiationError},definitionChanged:{get:r.throwInstantiationError}}),n.prototype.getValue=r.throwInstantiationError,n.prototype.equals=r.throwInstantiationError,n.equals=function(e,i){return e===i||t(e)&&e.equals(i)},n.arrayEquals=function(e,i){if(e===i)return!0;if(!t(e)||!t(i)||e.length!==i.length)return!1;for(var r=e.length,o=0;o-1;n--)a=t[n],o(a._billboard)&&o(a._position)&&s.set(a.id,new m(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._billboard)&&o(a._position)?s.contains(a.id)||s.set(a.id,new m(a)):(g(s.get(a.id),a,l),s.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],g(s.get(a.id),a,l),s.remove(a.id)},_}),define("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"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);\n#endif\n}\n"}),define("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"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"}),define("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"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);\n#endif\n}\n"}),define("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"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"}),define("Shaders/Appearances/TexturedMaterialAppearanceFS",[],function(){"use strict";return"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);\n#endif\n}\n"}),define("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"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"}),define("Scene/BlendEquation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ADD:t.FUNC_ADD,SUBTRACT:t.FUNC_SUBTRACT,REVERSE_SUBTRACT:t.FUNC_REVERSE_SUBTRACT};return e(i)}),define("Scene/BlendFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={ZERO:t.ZERO,ONE:t.ONE,SOURCE_COLOR:t.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:t.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:t.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:t.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:t.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:t.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:t.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:t.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:t.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:t.ONE_MINUS_CONSTANT_ALPHA,CONSTANT_ALPHA:t.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:t.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:t.SRC_ALPHA_SATURATE};return e(i)}),define("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,i){"use strict";var r={DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.ONE,functionSourceAlpha:i.ONE,functionDestinationRgb:i.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:i.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:i.SOURCE_ALPHA,functionSourceAlpha:i.SOURCE_ALPHA,functionDestinationRgb:i.ONE,functionDestinationAlpha:i.ONE})};return e(r)}),define("Scene/CullFace",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={FRONT:t.FRONT,BACK:t.BACK,FRONT_AND_BACK:t.FRONT_AND_BACK};return e(i)}),define("Scene/Appearance",["../Core/clone","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=i(e,i.EMPTY_OBJECT),this.material=e.material,this.translucent=i(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=i(e.closed,!1)}return n(s.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}}}),s.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),r(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},s.prototype.isTranslucent=function(){return r(this.material)&&this.material.isTranslucent()||!r(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),i=e(this.renderState,!1);return t?(i.depthMask=!1,i.blending=o.ALPHA_BLEND):i.depthMask=!0,i},s.getDefaultRenderState=function(e,i,n){var s={depthTest:{enabled:!0}};return e&&(s.depthMask=!1,s.blending=o.ALPHA_BLEND),i&&(s.cull={enabled:!0,face:a.BACK}),r(n)&&(s=t(n,s,!0)),s},s}),define("Renderer/ContextLimits",["../Core/defineProperties"],function(e){"use strict";var t={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1};return e(t,{maximumCombinedTextureImageUnits:{get:function(){return t._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return t._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return t._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return t._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return t._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return t._maximumTextureSize}},maximumVaryingVectors:{get:function(){return t._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return t._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return t._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return t._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return t._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return t._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return t._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return t._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return t._maximumViewportWidth}},maximumViewportHeight:{get:function(){return t._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return t._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return t._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return t._maximumColorAttachments}},highpFloatSupported:{get:function(){return t._highpFloatSupported}},highpIntSupported:{get:function(){return t._highpIntSupported}}}),t}),define("Renderer/PixelDatatype",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.UNSIGNED_INT,FLOAT:t.FLOAT,UNSIGNED_INT_24_8:t.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:t.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:t.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:t.UNSIGNED_SHORT_5_6_5,validate:function(e){return e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT||e===i.FLOAT||e===i.UNSIGNED_INT_24_8||e===i.UNSIGNED_SHORT_4_4_4_4||e===i.UNSIGNED_SHORT_5_5_5_1||e===i.UNSIGNED_SHORT_5_6_5}};return e(i)}),define("Renderer/CubeMapFace",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t,i,r){"use strict";function n(e,t,i,r,n,o,a,s,l){ -this._gl=e,this._texture=t,this._textureTarget=i,this._targetFace=r,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l}return t(n.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),n.prototype.copyFrom=function(t,i,r){i=e(i,0),r=e(r,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),t.arrayBufferView?n.texSubImage2D(this._targetFace,0,i,r,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):n.texSubImage2D(this._targetFace,0,i,r,this._pixelFormat,this._pixelDatatype,t),n.bindTexture(o,null)},n.prototype.copyFromFramebuffer=function(t,i,r,n,o,a){t=e(t,0),i=e(i,0),r=e(r,0),n=e(n,0),o=e(o,this._size),a=e(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,t,i,r,n,o,a),s.bindTexture(l,null)},n}),define("Renderer/MipmapHint",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={DONT_CARE:t.DONT_CARE,FASTEST:t.FASTEST,NICEST:t.NICEST,validate:function(e){return e===i.DONT_CARE||e===i.FASTEST||e===i.NICEST}};return e(i)}),define("Renderer/TextureMagnificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR}};return e(i)}),define("Renderer/TextureMinificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={NEAREST:t.NEAREST,LINEAR:t.LINEAR,NEAREST_MIPMAP_NEAREST:t.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:t.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:t.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:t.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===i.NEAREST||e===i.LINEAR||e===i.NEAREST_MIPMAP_NEAREST||e===i.LINEAR_MIPMAP_NEAREST||e===i.NEAREST_MIPMAP_LINEAR||e===i.LINEAR_MIPMAP_LINEAR}};return e(i)}),define("Renderer/TextureWrap",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={CLAMP_TO_EDGE:t.CLAMP_TO_EDGE,REPEAT:t.REPEAT,MIRRORED_REPEAT:t.MIRRORED_REPEAT,validate:function(e){return e===i.CLAMP_TO_EDGE||e===i.REPEAT||e===i.MIRRORED_REPEAT}};return e(i)}),define("Renderer/Sampler",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.wrapS,a.CLAMP_TO_EDGE),s=e(i.wrapT,a.CLAMP_TO_EDGE),l=e(i.minificationFilter,o.LINEAR),u=e(i.magnificationFilter,n.LINEAR),c=t(i.maximumAnisotropy)?i.maximumAnisotropy:1;this._wrapS=r,this._wrapT=s,this._minificationFilter=l,this._magnificationFilter=u,this._maximumAnisotropy=c}return i(s.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),s}),define("Renderer/CubeMap",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./CubeMapFace","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(i){function r(e,t){t.arrayBufferView?v.texImage2D(e,0,f,p,p,0,f,m,t.arrayBufferView):v.texImage2D(e,0,f,f,m,t)}i=e(i,e.EMPTY_OBJECT);var n,o,s=i.context,u=i.source;if(t(u)){var h=[u.positiveX,u.negativeX,u.positiveY,u.negativeY,u.positiveZ,u.negativeZ];n=h[0].width,o=h[0].height}else n=i.width,o=i.height;var p=n,f=e(i.pixelFormat,a.RGBA),m=e(i.pixelDatatype,c.UNSIGNED_BYTE),_=i.preMultiplyAlpha||f===a.RGB||f===a.LUMINANCE,g=e(i.flipY,!0),v=s._gl,y=v.TEXTURE_CUBE_MAP,C=v.createTexture();v.activeTexture(v.TEXTURE0),v.bindTexture(y,C),t(u)?(v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),v.pixelStorei(v.UNPACK_FLIP_Y_WEBGL,g),r(v.TEXTURE_CUBE_MAP_POSITIVE_X,u.positiveX),r(v.TEXTURE_CUBE_MAP_NEGATIVE_X,u.negativeX),r(v.TEXTURE_CUBE_MAP_POSITIVE_Y,u.positiveY),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,u.negativeY),r(v.TEXTURE_CUBE_MAP_POSITIVE_Z,u.positiveZ),r(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,u.negativeZ)):(v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_X,0,f,p,p,0,f,m,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_X,0,f,p,p,0,f,m,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Y,0,f,p,p,0,f,m,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,f,p,p,0,f,m,null),v.texImage2D(v.TEXTURE_CUBE_MAP_POSITIVE_Z,0,f,p,p,0,f,m,null),v.texImage2D(v.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,f,p,p,0,f,m,null)),v.bindTexture(y,null),this._gl=v,this._textureFilterAnisotropic=s._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=f,this._pixelDatatype=m,this._size=p,this._preMultiplyAlpha=_,this._flipY=g,this._sampler=void 0,this._positiveX=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_X,f,m,p,_,g),this._negativeX=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_X,f,m,p,_,g),this._positiveY=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Y,f,m,p,_,g),this._negativeY=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Y,f,m,p,_,g),this._positiveZ=new l(v,C,y,v.TEXTURE_CUBE_MAP_POSITIVE_Z,f,m,p,_,g),this._negativeZ=new l(v,C,y,v.TEXTURE_CUBE_MAP_NEGATIVE_Z,f,m,p,_,g),this.sampler=t(i.sampler)?i.sampler:new d}return i(f.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){var i=e.minificationFilter,r=e.magnificationFilter,n=i===p.NEAREST_MIPMAP_NEAREST||i===p.NEAREST_MIPMAP_LINEAR||i===p.LINEAR_MIPMAP_NEAREST||i===p.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===c.FLOAT&&(i=n?p.NEAREST_MIPMAP_NEAREST:p.NEAREST,r=h.NEAREST);var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,i),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),t(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),f.prototype.generateMipmap=function(t){t=e(t,u.DONT_CARE);var i=this._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,t),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=r(this._positiveX),this._negativeX=r(this._negativeX),this._positiveY=r(this._positiveY),this._negativeY=r(this._negativeY),this._positiveZ=r(this._positiveZ),this._negativeZ=r(this._negativeZ),r(this)},f}),define("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/WebGLConstants","./ContextLimits","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(r){r=t(r,t.EMPTY_OBJECT);var n=r.context,o=r.width,a=r.height,u=r.source;i(u)&&(i(o)||(o=t(u.videoWidth,u.width)),i(a)||(a=t(u.videoHeight,u.height)));var c=t(r.pixelFormat,s.RGBA),p=t(r.pixelDatatype,d.UNSIGNED_BYTE),f=c,m=s.isCompressedFormat(f);n.webgl2&&(c===s.DEPTH_STENCIL?f=l.DEPTH24_STENCIL8:c===s.DEPTH_COMPONENT&&(p===d.UNSIGNED_SHORT?f=l.DEPTH_COMPONENT16:p===d.UNSIGNED_INT&&(f=l.DEPTH_COMPONENT24)));var _=r.preMultiplyAlpha||c===s.RGB||c===s.LUMINANCE,g=t(r.flipY,!0),v=n._gl,y=v.TEXTURE_2D,C=v.createTexture();v.activeTexture(v.TEXTURE0),v.bindTexture(y,C),i(u)?(v.pixelStorei(v.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),v.pixelStorei(v.UNPACK_FLIP_Y_WEBGL,g),i(u.arrayBufferView)?m?v.compressedTexImage2D(y,0,f,o,a,0,u.arrayBufferView):v.texImage2D(y,0,f,o,a,0,c,p,u.arrayBufferView):i(u.framebuffer)?(u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._bind(),v.copyTexImage2D(y,0,f,u.xOffset,u.yOffset,o,a,0),u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._unBind()):v.texImage2D(y,0,f,c,p,u)):v.texImage2D(y,0,f,o,a,0,c,p,null),v.bindTexture(y,null),this._context=n,this._textureFilterAnisotropic=n._textureFilterAnisotropic,this._textureTarget=y,this._texture=C,this._pixelFormat=c,this._pixelDatatype=p,this._width=o,this._height=a,this._dimensions=new e(o,a),this._preMultiplyAlpha=_,this._flipY=g,this._sampler=void 0,this.sampler=i(r.sampler)?r.sampler:new h}return m.fromFramebuffer=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.context,n=r._gl,o=t(e.pixelFormat,s.RGB),a=t(e.framebufferXOffset,0),l=t(e.framebufferYOffset,0),u=t(e.width,n.drawingBufferWidth),c=t(e.height,n.drawingBufferHeight),d=e.framebuffer,h=new m({context:r,width:u,height:c,pixelFormat:o,source:{framebuffer:i(d)?d:r.defaultFramebuffer,xOffset:a,yOffset:l,width:u,height:c}});return h},r(m.prototype,{sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,r=e.magnificationFilter,n=t===f.NEAREST_MIPMAP_NEAREST||t===f.NEAREST_MIPMAP_LINEAR||t===f.LINEAR_MIPMAP_NEAREST||t===f.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===d.FLOAT&&(t=n?f.NEAREST_MIPMAP_NEAREST:f.NEAREST,r=p.NEAREST);var o=this._context._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,t),o.texParameteri(a,o.TEXTURE_MAG_FILTER,r),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),i(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},_target:{get:function(){return this._textureTarget}}}),m.prototype.copyFrom=function(e,i,r){i=t(i,0),r=t(r,0);var n=this._context._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),e.arrayBufferView?n.texSubImage2D(o,0,i,r,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,i,r,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},m.prototype.copyFromFramebuffer=function(e,i,r,n,o,a){e=t(e,0),i=t(i,0),r=t(r,0),n=t(n,0),o=t(o,this._width),a=t(a,this._height);var s=this._context._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(l,0,e,i,r,n,o,a),s.bindTexture(l,null)},m.prototype.generateMipmap=function(e){e=t(e,c.DONT_CARE);var i=this._context._gl,r=this._textureTarget;i.hint(i.GENERATE_MIPMAP_HINT,e),i.activeTexture(i.TEXTURE0),i.bindTexture(r,this._texture),i.generateMipmap(r),i.bindTexture(r,null)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},m}),define("Shaders/Materials/BumpMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n"}),define("Shaders/Materials/CheckerboardMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/DotMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/FadeMaterial",[],function(){"use strict";return"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/GridMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = (lineThickness * czm_resolutionScale) - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n"}),define("Shaders/Materials/NormalMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\n#ifdef GL_OES_standard_derivatives\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\n#else\nfloat base = 0.99;\n#endif\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineOutlineMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),define("Shaders/Materials/RimLightingMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n"}),define("Shaders/Materials/StripeMaterial",[],function(){"use strict";return"uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\nvec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/Water",[],function(){"use strict";return"uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n"}),define("Scene/Material",["../Core/Cartesian2","../Core/clone","../Core/Color","../Core/combine","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/isArray","../Core/loadCRN","../Core/loadImage","../Core/loadKTX","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/CubeMap","../Renderer/Texture","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,M,D,I){"use strict";function R(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,O(e,this),s(this,{type:{value:this.type,writable:!1}}),a(R._uniformList[this.type])||(R._uniformList[this.type]=Object.keys(this._uniforms))}function O(e,i){e=o(e,o.EMPTY_OBJECT),i._strict=o(e.strict,!1),i._count=o(e.count,0),i._template=t(o(e.fabric,o.EMPTY_OBJECT)),i._template.uniforms=t(o(i._template.uniforms,o.EMPTY_OBJECT)),i._template.materials=t(o(i._template.materials,o.EMPTY_OBJECT)),i.type=a(i._template.type)?i._template.type:n(),i.shaderSource="",i.materials={},i.uniforms={},i._uniforms={},i._translucentFunctions=[];var s,l=R._materialCache.getMaterial(i.type);if(a(l)){var u=t(l.fabric,!0);i._template=r(i._template,u,!0),s=l.translucent}F(i),a(l)||R._materialCache.addMaterial(i.type,i),k(i),U(i),W(i);var c=0===i._translucentFunctions.length||void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var d=function(){return s(i)};i._translucentFunctions.push(d)}else i._translucentFunctions.push(s)}function N(e,t,i,r){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=t.indexOf(n)!==-1;(r&&!o||!r&&o)&&i(n,t)}}function L(e,t){}function B(e,t){}function F(e){var t=e._template,i=t.uniforms,r=t.materials,n=t.components;N(t,Y,L,!0),N(n,X,L,!0);var o=[];for(var a in r)r.hasOwnProperty(a)&&o.push(a);N(i,o,B,!1)}function k(e){var t=e._template.components,i=e._template.source;if(a(i))e.shaderSource+=i+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",a(t))for(var r in t)t.hasOwnProperty(r)&&(e.shaderSource+="material."+r+" = "+t[r]+";\n");e.shaderSource+="return material;\n}\n"}}function V(e){var t;return function(i,r){var n=i.uniforms,o=n[e],s=t!==o;t=o;var l,u,c=i._textures[e];if(o instanceof HTMLVideoElement)if(o.readyState>=2){if(s&&a(c)&&(c!==r.defaultTexture&&c.destroy(),c=void 0),!a(c)||c===r.defaultTexture)return c=new v({context:r,source:o}),void(i._textures[e]=c);c.copyFrom(o)}else a(c)||(i._textures[e]=r.defaultTexture);else{if(o instanceof v&&o!==c){i._texturePaths[e]=void 0;var f=i._textures[e];return f!==i._defaultTexture&&f.destroy(),i._textures[e]=o,l=e+"Dimensions",void(n.hasOwnProperty(l)&&(u=n[l],u.x=o._width,u.y=o._height))}if(a(c)||(i._texturePaths[e]=void 0,a(i._defaultTexture)||(i._defaultTexture=r.defaultTexture),c=i._textures[e]=i._defaultTexture,l=e+"Dimensions",n.hasOwnProperty(l)&&(u=n[l],u.x=c._width,u.y=c._height)),o!==R.DefaultImageId&&o!==i._texturePaths[e]){if("string"==typeof o){var m;m=K.test(o)?p(o):Q.test(o)?d(o):h(o),I(m,function(t){i._loadedImages.push({id:e,image:t})})}else o instanceof HTMLCanvasElement&&i._loadedImages.push({id:e,image:o});i._texturePaths[e]=o}}}}function z(e){return function(t,i){var r=t.uniforms[e];if(r instanceof g){var n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=r)}if(a(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=i.defaultCubeMap),r!==R.DefaultCubeMapId){var o=r.positiveX+r.negativeX+r.positiveY+r.negativeY+r.positiveZ+r.negativeZ;if(o!==t._texturePaths[e]){var s=[h(r.positiveX),h(r.negativeX),h(r.positiveY),h(r.negativeY),h(r.positiveZ),h(r.negativeZ)];I.all(s).then(function(i){t._loadedCubeMaps.push({id:e,images:i})}),t._texturePaths[e]=o}}}}function U(e){var t=e._template.uniforms;for(var i in t)t.hasOwnProperty(i)&&G(e,i)}function G(e,t){var i,r=(e._strict,e._template.uniforms),n=r[t],o=H(n);if("channels"===o)i=q(e,t,n,!1);else{if("sampler2D"===o){var a=t+"Dimensions";j(e,a)>0&&(r[a]={type:"ivec3",x:1,y:1},G(e,a))}var s=new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;");if(!s.test(e.shaderSource)){var l="uniform "+o+" "+t+";";e.shaderSource=l+e.shaderSource}var u=t+"_"+e._count++;if(i=q(e,t,u),e.uniforms[t]=n,"sampler2D"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if("samplerCube"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(z(t));else if(o.indexOf("mat")!==-1){var c=new Z[o];e._uniforms[u]=function(){return Z[o].fromColumnMajorArray(e.uniforms[t],c)}}else e._uniforms[u]=function(){return e.uniforms[t]}}}function H(e){var t=e.type;if(!a(t)){var i=typeof e;if("number"===i)t="float";else if("boolean"===i)t="bool";else if("string"===i||e instanceof HTMLCanvasElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===R.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===i)if(c(e))4!==e.length&&9!==e.length&&16!==e.length||(t="mat"+Math.sqrt(e.length));else{var r=0;for(var n in e)e.hasOwnProperty(n)&&(r+=1);r>=2&&r<=4?t="vec"+r:6===r&&(t="samplerCube")}}return t}function W(e){var t=e._strict,i=e._template.materials;for(var n in i)if(i.hasOwnProperty(n)){var o=new R({strict:t,fabric:i[n],count:e._count});e._count=o._count,e._uniforms=r(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var a="czm_getMaterial",s=a+"_"+e._count++;q(o,a,s),e.shaderSource=o.shaderSource+e.shaderSource;var l=s+"(materialInput)";q(e,n,l)}}function q(e,t,i,r){r=o(r,!0);var n=0,a="([\\w])?",s="([\\w"+(r?".":"")+"])?",l=new RegExp(s+t+a,"g");return e.shaderSource=e.shaderSource.replace(l,function(e,t,r){return t||r?e:(n+=1,i)}),n}function j(e,t,i){return q(e,t,t,i)}R._uniformList={},R.fromType=function(e,t){var i=new R({fabric:{type:e}});if(a(t))for(var r in t)t.hasOwnProperty(r)&&(i.uniforms[r]=t[r]);return i},R.prototype.isTranslucent=function(){if(a(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,i=t.length,r=0;r0&&console.log(C+"Vertex shader compile log: "+d)),m&&(d=e.getShaderInfoLog(s),t(d)&&d.length>0&&console.log(C+"Fragment shader compile log: "+d)),m&&(d=e.getProgramInfoLog(l),t(d)&&d.length>0&&console.log(C+"Shader program link log: "+d)),l}function f(e,t,i){for(var r={},n=0;n=0){if(m=r[h.slice(0,y)],!t(m))continue;_=m._locations,_.length<=1&&(g=m.value,v=e.getUniformLocation(i,h),null!==v&&(_.push(v),g.push(e.getUniform(i,v))))}else{_=[];for(var C=0;C czm_piOverTwo)\n{\nif (angle < 0.0)\n{\nreturn -cordic(angle + czm_pi);\n}\nelse\n{\nreturn -cordic(angle - czm_pi);\n}\n}\nelse\n{\nreturn cordic(angle);\n}\n}\n"}),define("Shaders/Builtin/Functions/decompressTextureCoordinates",[],function(){"use strict";return"vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat xZeroTo4095 = floor(temp);\nfloat stx = xZeroTo4095 / 4095.0;\nfloat sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\nreturn vec2(stx, sty);\n}\n"}),define("Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates",[],function(){"use strict";return"mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n"}),define("Shaders/Builtin/Functions/ellipsoidContainsPoint",[],function(){"use strict";return"bool czm_ellipsoidContainsPoint(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n"}),define("Shaders/Builtin/Functions/ellipsoidNew",[],function(){"use strict";return"czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),define("Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates",[],function(){"use strict";return"vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n"}),define("Shaders/Builtin/Functions/equalsEpsilon",[],function(){"use strict";return"bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n"}),define("Shaders/Builtin/Functions/eyeOffset",[],function(){"use strict";return"vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n"}),define("Shaders/Builtin/Functions/eyeToWindowCoordinates",[],function(){"use strict";return"vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),define("Shaders/Builtin/Functions/fog",[],function(){"use strict";return"vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-(scalar * scalar));\nreturn mix(color, fogColor, fog);\n}\n"}),define("Shaders/Builtin/Functions/geodeticSurfaceNormal",[],function(){"use strict";return"vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n"}),define("Shaders/Builtin/Functions/getDefaultMaterial",[],function(){"use strict";return"czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n"}),define("Shaders/Builtin/Functions/getLambertDiffuse",[],function(){"use strict";return"float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n"; -}),define("Shaders/Builtin/Functions/getSpecular",[],function(){"use strict";return"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, max(shininess, czm_epsilon2));\n}\n"}),define("Shaders/Builtin/Functions/getWaterNoise",[],function(){"use strict";return"vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n"}),define("Shaders/Builtin/Functions/getWgs84EllipsoidEC",[],function(){"use strict";return"czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6356752.314245);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),define("Shaders/Builtin/Functions/hue",[],function(){"use strict";return"vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n"}),define("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),define("Shaders/Builtin/Functions/isFull",[],function(){"use strict";return"bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n"}),define("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n"}),define("Shaders/Builtin/Functions/luminance",[],function(){"use strict";return"float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n"}),define("Shaders/Builtin/Functions/metersPerPixel",[],function(){"use strict";return"float czm_metersPerPixel(vec4 positionEC)\n{\nfloat width = czm_viewport.z;\nfloat height = czm_viewport.w;\nfloat pixelWidth;\nfloat pixelHeight;\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nfloat frustumWidth = right - left;\nfloat frustumHeight = top - bottom;\npixelWidth = frustumWidth / width;\npixelHeight = frustumHeight / height;\n}\nelse\n{\nfloat distanceToPixel = -positionEC.z;\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\nfloat tanTheta = top * inverseNear;\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\ntanTheta = right * inverseNear;\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n}\nreturn max(pixelWidth, pixelHeight);\n}\n"}),define("Shaders/Builtin/Functions/modelToWindowCoordinates",[],function(){"use strict";return"vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),define("Shaders/Builtin/Functions/multiplyWithColorBalance",[],function(){"use strict";return"vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n"}),define("Shaders/Builtin/Functions/nearFarScalar",[],function(){"use strict";return"float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(clamp(t, 0.0, 1.0), 0.2);\nreturn mix(valueAtMin, valueAtMax, t);\n}\n"}),define("Shaders/Builtin/Functions/octDecode",[],function(){"use strict";return"vec3 czm_octDecode(vec2 encoded, float range)\n{\nif (encoded.x == 0.0 && encoded.y == 0.0) {\nreturn vec3(0.0, 0.0, 0.0);\n}\nencoded = encoded / range * 2.0 - 1.0;\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\nif (v.z < 0.0)\n{\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n}\nreturn normalize(v);\n}\nvec3 czm_octDecode(vec2 encoded)\n{\nreturn czm_octDecode(encoded, 255.0);\n}\nvec3 czm_octDecode(float encoded)\n{\nfloat temp = encoded / 256.0;\nfloat x = floor(temp);\nfloat y = (temp - x) * 256.0;\nreturn czm_octDecode(vec2(x, y));\n}\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n{\nfloat temp = encoded.x / 65536.0;\nfloat x = floor(temp);\nfloat encodedFloat1 = (temp - x) * 65536.0;\ntemp = encoded.y / 65536.0;\nfloat y = floor(temp);\nfloat encodedFloat2 = (temp - y) * 65536.0;\nvector1 = czm_octDecode(encodedFloat1);\nvector2 = czm_octDecode(encodedFloat2);\nvector3 = czm_octDecode(vec2(x, y));\n}\n"}),define("Shaders/Builtin/Functions/packDepth",[],function(){"use strict";return"vec4 czm_packDepth(float depth)\n{\nvec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\nenc = fract(enc);\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\nreturn enc;\n}\n"}),define("Shaders/Builtin/Functions/phong",[],function(){"use strict";return"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n}\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(czm_sunDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),define("Shaders/Builtin/Functions/pointAlongRay",[],function(){"use strict";return"vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n"}),define("Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval",[],function(){"use strict";return"czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, czm_ellipsoid ellipsoid)\n{\nvec3 q = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ellipsoid.center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n"}),define("Shaders/Builtin/Functions/RGBToXYZ",[],function(){"use strict";return"vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n"}),define("Shaders/Builtin/Functions/saturation",[],function(){"use strict";return"vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n"}),define("Shaders/Builtin/Functions/shadowDepthCompare",[],function(){"use strict";return"float czm_sampleShadowMap(samplerCube shadowMap, vec3 d)\n{\nreturn czm_unpackDepth(textureCube(shadowMap, d));\n}\nfloat czm_sampleShadowMap(sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\nreturn texture2D(shadowMap, uv).r;\n#else\nreturn czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n"}),define("Shaders/Builtin/Functions/shadowVisibility",[],function(){"use strict";return"float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\nfloat strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\nfloat strength = step(0.0, nDotL);\n#endif\nvisibility *= strength;\n#endif\nvisibility = max(visibility, darkness);\nreturn visibility;\n}\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec3 uvw = shadowParameters.texCoords;\ndepth -= depthBias;\nfloat visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec2 uv = shadowParameters.texCoords;\ndepth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\nvec2 texelStepSize = shadowParameters.texelStepSize;\nfloat radius = 1.0;\nfloat dx0 = -texelStepSize.x * radius;\nfloat dy0 = -texelStepSize.y * radius;\nfloat dx1 = texelStepSize.x * radius;\nfloat dy1 = texelStepSize.y * radius;\nfloat visibility = (\nczm_shadowDepthCompare(shadowMap, uv, depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n) * (1.0 / 9.0);\n#else\nfloat visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n"}),define("Shaders/Builtin/Functions/signNotZero",[],function(){"use strict";return"float czm_signNotZero(float value)\n{\nreturn value >= 0.0 ? 1.0 : -1.0;\n}\nvec2 czm_signNotZero(vec2 value)\n{\nreturn vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\nvec3 czm_signNotZero(vec3 value)\n{\nreturn vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\nvec4 czm_signNotZero(vec4 value)\n{\nreturn vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n"}),define("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 bitangent = normalize(bitangentEC);\nreturn mat3(tangent.x , tangent.y , tangent.z,\nbitangent.x, bitangent.y, bitangent.z,\nnormal.x , normal.y , normal.z);\n}\n"}),define("Shaders/Builtin/Functions/translateRelativeToEye",[],function(){"use strict";return"vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n"}),define("Shaders/Builtin/Functions/translucentPhong",[],function(){"use strict";return"vec4 czm_translucentPhong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n}\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(czm_sunDirectionEC, toEye, material.normal, material.shininess);\nspecular += czm_getSpecular(czm_moonDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),define("Shaders/Builtin/Functions/transpose",[],function(){"use strict";return"mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n"}),define("Shaders/Builtin/Functions/unpackDepth",[],function(){"use strict";return"float czm_unpackDepth(vec4 packedDepth)\n{\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\n"}),define("Shaders/Builtin/Functions/windowToEyeCoordinates",[],function(){"use strict";return"vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nq = czm_inverseProjection * q;\nreturn q;\n}\n"}),define("Shaders/Builtin/Functions/XYZToRGB",[],function(){"use strict";return"vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n"}),define("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/depthRange","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/passCompute","./Constants/passEnvironment","./Constants/passGlobe","./Constants/passGround","./Constants/passOpaque","./Constants/passOverlay","./Constants/passTranslucent","./Constants/pi","./Constants/piOverFour","./Constants/piOverSix","./Constants/piOverThree","./Constants/piOverTwo","./Constants/radiansPerDegree","./Constants/sceneMode2D","./Constants/sceneMode3D","./Constants/sceneModeColumbusView","./Constants/sceneModeMorphing","./Constants/solarRadius","./Constants/threePiOver2","./Constants/twoPi","./Constants/webMercatorMaxLatitude","./Structs/depthRangeStruct","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Structs/shadowParameters","./Functions/alphaWeight","./Functions/antialias","./Functions/cascadeColor","./Functions/cascadeDistance","./Functions/cascadeMatrix","./Functions/cascadeWeights","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/cosineAndSine","./Functions/decompressTextureCoordinates","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/fog","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/metersPerPixel","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/nearFarScalar","./Functions/octDecode","./Functions/packDepth","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/RGBToXYZ","./Functions/saturation","./Functions/shadowDepthCompare","./Functions/shadowVisibility","./Functions/signNotZero","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/unpackDepth","./Functions/windowToEyeCoordinates","./Functions/XYZToRGB"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,M,D,I,R,O,N,L,B,F,k,V,z,U,G,H,W,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,Me,De,Ie,Re,Oe,Ne,Le){"use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:i,czm_epsilon2:r,czm_epsilon3:n,czm_epsilon4:o,czm_epsilon5:a,czm_epsilon6:s,czm_epsilon7:l,czm_infinity:u,czm_oneOverPi:c,czm_oneOverTwoPi:d,czm_passCompute:h,czm_passEnvironment:p,czm_passGlobe:f,czm_passGround:m,czm_passOpaque:_,czm_passOverlay:g,czm_passTranslucent:v,czm_pi:y,czm_piOverFour:C,czm_piOverSix:w,czm_piOverThree:S,czm_piOverTwo:E,czm_radiansPerDegree:b,czm_sceneMode2D:T,czm_sceneMode3D:x,czm_sceneModeColumbusView:A,czm_sceneModeMorphing:P,czm_solarRadius:M,czm_threePiOver2:D,czm_twoPi:I,czm_webMercatorMaxLatitude:R,czm_depthRangeStruct:O,czm_ellipsoid:N,czm_material:L,czm_materialInput:B,czm_ray:F,czm_raySegment:k,czm_shadowParameters:V,czm_alphaWeight:z,czm_antialias:U,czm_cascadeColor:G,czm_cascadeDistance:H,czm_cascadeMatrix:W,czm_cascadeWeights:q,czm_columbusViewMorph:j,czm_computePosition:Y,czm_cosineAndSine:X,czm_decompressTextureCoordinates:Z,czm_eastNorthUpToEyeCoordinates:K,czm_ellipsoidContainsPoint:Q,czm_ellipsoidNew:J,czm_ellipsoidWgs84TextureCoordinates:$,czm_equalsEpsilon:ee,czm_eyeOffset:te,czm_eyeToWindowCoordinates:ie,czm_fog:re,czm_geodeticSurfaceNormal:ne,czm_getDefaultMaterial:oe,czm_getLambertDiffuse:ae,czm_getSpecular:se,czm_getWaterNoise:le,czm_getWgs84EllipsoidEC:ue,czm_hue:ce,czm_isEmpty:de,czm_isFull:he,czm_latitudeToWebMercatorFraction:pe,czm_luminance:fe,czm_metersPerPixel:me,czm_modelToWindowCoordinates:_e,czm_multiplyWithColorBalance:ge,czm_nearFarScalar:ve,czm_octDecode:ye,czm_packDepth:Ce,czm_phong:we,czm_pointAlongRay:Se,czm_rayEllipsoidIntersectionInterval:Ee,czm_RGBToXYZ:be,czm_saturation:Te,czm_shadowDepthCompare:xe,czm_shadowVisibility:Ae,czm_signNotZero:Pe,czm_tangentToEyeSpaceMatrix:Me,czm_translateRelativeToEye:De,czm_translucentPhong:Ie,czm_transpose:Re,czm_unpackDepth:Oe,czm_windowToEyeCoordinates:Ne,czm_XYZToRGB:Le}}),define("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,i,r,n){"use strict";function o(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,i="",r=0;r0;){var r=e.pop();i.push(r),0===r.requiredBy.length&&t.push(r)}for(;t.length>0;){var n=t.shift();e.push(n);for(var o=0;o=0;--n)r=r+t[n].glslSource+"\n";return r.replace(i.glslSource,"")}function c(e,i){var r,n,a="",s=e.sources;if(t(s))for(r=0,n=s.length;r0&&(a.glVertexAttribDivisor(t,this.instanceDivisor),a._vertexAttribDivisors[t]=this.instanceDivisor,a._previousDrawInstanced=!0)},c.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&a.glVertexAttribDivisor(o,0)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}c.disableVertexAttribArray=function(e){}}r.push(c)}function f(e,t,r){for(var n=0;n0&&(d=!0),i(u[n].value)&&(h=!0);var v;o.vertexArrayObject&&(v=o.glCreateVertexArray(),o.glBindVertexArray(v),f(a,u,l),o.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=d,this._hasConstantAttributes=h,this._context=o,this._gl=a,this._vao=v,this._attributes=u,this._indexBuffer=l}function _(e){return e.values.length/e.componentsPerAttribute}function g(t){return e.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}function v(t){var r,n,o,a=[];for(n in t)t.hasOwnProperty(n)&&i(t[n])&&i(t[n].values)&&(a.push(n),t[n].componentDatatype===e.DOUBLE&&(t[n].componentDatatype=e.FLOAT,t[n].values=e.createTypedArray(e.FLOAT,t[n].values)));var s,l=a.length;if(l>0)for(s=_(t[a[0]]),r=1;r0){var p=e.getSizeInBytes(t[a[0]].componentDatatype),f=d%p;0!==f&&(d+=p-f);var m=s*d,v=new ArrayBuffer(m),y={};for(r=0;r0&&(t.glVertexAttribDivisor(r,0),n[r]=0)}}function C(e,t){for(var r=e._attributes,n=r.length,o=0;o=l.SIXTY_FOUR_KILOBYTES&&h.elementIndexUint?c.createIndexBuffer({context:h,typedArray:new Uint32Array(A),usage:f,indexDatatype:s.UNSIGNED_INT}):c.createIndexBuffer({context:h,typedArray:new Uint16Array(A),usage:f,indexDatatype:s.UNSIGNED_SHORT})),new m({context:h,attributes:C,indexBuffer:x})},r(m.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),m.prototype.getAttribute=function(e){return this._attributes[e]},m.prototype._bind=function(){i(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&y(this),this._hasConstantAttributes&&C(this,this._gl)):f(this._gl,this._attributes,this._indexBuffer)},m.prototype._unBind=function(){if(i(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,r=0;r=U)return r<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var n=r*e.x*k;return n+=r*e.y*V,n+=r*e.z*z,n*Math.pow(10,i)}function b(e,t,r){var n=i.unpack(e,t,N),o=E(n);n=i.unpack(e,t+4,N);var a=E(n);n=i.unpack(e,t+8,N);var s=E(n);n=i.unpack(e,t+12,N);var l=E(n);return i.fromElements(o,a,s,l,r)}function T(e,t){if(G[0]=e,e=G[0],0===e)return i.clone(i.ZERO,t);var r,n=e<0?1:0;isFinite(e)?(e=Math.abs(e),r=Math.floor(c.logBase(e,10))+1,e/=Math.pow(10,r)):(e=.1,r=U);var o=e*L;return t.x=Math.floor(o),o=(o-t.x)*L,t.y=Math.floor(o),o=(o-t.y)*L,t.z=Math.floor(o),t.w=2*(r+U)+n,t}function x(e,t,r){var n=T(e.x,N);i.pack(n,t,r),n=T(e.y,n),i.pack(n,t,r+4),n=T(e.z,n),i.pack(n,t,r+8),n=T(e.w,n),i.pack(n,t,r+12)}function A(e,t){var i=e._textureDimensions;e._texture=new m({context:t,pixelFormat:d.RGBA,pixelDatatype:e._pixelDatatype,width:i.x,height:i.y,sampler:new f({minificationFilter:g.NEAREST,magnificationFilter:_.NEAREST})})}function P(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function M(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), 1.0 - (centerY + (yId * stepY))); \n} \n"}function D(e){return e._packFloats?"float unpackFloat(vec4 value) \n{ \n value *= 255.0; \n float temp = value.w / 2.0; \n float exponent = floor(temp); \n float sign = (temp - exponent) * 2.0; \n exponent = exponent - float("+U+"); \n sign = sign * 2.0 - 1.0; \n sign = -sign; \n float unpacked = sign * value.x * float("+k+"); \n unpacked += sign * value.y * float("+V+"); \n unpacked += sign * value.z * float("+z+"); \n return unpacked * pow(10.0, exponent); \n} \n":""}function I(e){return 1===e?"float":"vec"+e}function R(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function O(e,t){var i=e._attributes,r=i[t],o=r.componentsPerAttribute,a=r.functionName,s=I(o),l=R(o),u=e._offsets[t],c=s+" "+a+"(float batchId) \n{ \n vec2 st = computeSt(batchId); \n st.x += batchTextureStep.x * float("+u+"); \n";return c+=e._packFloats&&r.componentDatatype!==p.UNSIGNED_BYTE?"vec4 textureValue; \ntextureValue.x = unpackFloat(texture2D(batchTexture, st)); \ntextureValue.y = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n":" vec4 textureValue = texture2D(batchTexture, st); \n",c+=" "+s+" value = textureValue"+l+"; \n",e._pixelDatatype!==p.UNSIGNED_BYTE||r.componentDatatype!==n.UNSIGNED_BYTE||r.normalize?e._pixelDatatype===p.FLOAT&&r.componentDatatype===n.UNSIGNED_BYTE&&r.normalize&&(c+="value /= 255.0; \n"):c+="value *= 255.0; \n",c+=" return value; \n} \n"}a(v.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});var N=new i,L=256,B=65536,F=16777216,k=1/L,V=1/B,z=1/F,U=38;if(u.supportsTypedArrays()){var G=new Float32Array(1),H=new i;v.prototype.getBatchedAttribute=function(e,t,r){var n,a=this._attributes,s=this._offsets[t],l=this._stride,u=4*l*e+4*s;n=this._packFloats&&a[t].componentDatatype!==p.UNSIGNED_BYTE?b(this._batchValues,u,H):i.unpack(this._batchValues,u,H);var c=C(a,t);return o(c.fromCartesian4)?c.fromCartesian4(n,r):o(c.clone)?c.clone(n,r):n.x};var W=[void 0,void 0,new e,new t,new i],q=new i;return v.prototype.setBatchedAttribute=function(e,t,r){var n=this._attributes,a=W[n[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,a),l=C(this._attributes,t),u=o(l.equals)?l.equals(s,r):s===r;if(!u){var c=q;c.x=o(r.x)?r.x:r,c.y=o(r.y)?r.y:0,c.z=o(r.z)?r.z:0,c.w=o(r.w)?r.w:0;var d=this._offsets[t],h=this._stride,f=4*h*e+4*d;this._packFloats&&n[t].componentDatatype!==p.UNSIGNED_BYTE?x(c,this._batchValues,f):i.pack(c,this._batchValues,f),this._batchValuesDirty=!0}},v.prototype.update=function(e){o(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,o(this._texture)||A(this,e.context),P(this))},v.prototype.getUniformMapCallback=function(){var e=this;return function(t){if(0===e._attributes.length)return t;var i={batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}};return r(t,i)}},v.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var t="uniform sampler2D batchTexture; \n";t+=M(this)+"\n",t+=D(this)+"\n";for(var i=e.length,r=0;r1){var s=e[0].modelMatrix;for(n=1;n=0){var u=n[l];o=u.offset+u.count,s=u.index,a=r[s].indices.length}else o=0,s=0,a=r[s].indices.length;for(var c=e.length,d=0;da&&(o=0,a=r[++s].indices.length),n.push({index:s,offset:o,count:f}),o+=f}}}function y(e,t){var i=[];return v(e,"geometry",t,i),v(e,"westHemisphereGeometry",t,i),v(e,"eastHemisphereGeometry",t,i),i}function C(e,t){var r=e.attributes;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o)&&i(o.values)&&t.push(o.values.buffer)}i(e.indices)&&t.push(e.indices.buffer)}function w(e,t){for(var i=e.length,r=0;r0&&(r=g(t),r.length>0&&(n=c.createAttributeLocations(r[0])));var s;t.createPickOffsets&&r.length>0&&(s=y(o,r));for(var l=new Array(a),u=new Array(a),d=0;d0&&(n.set(c.indices,l),l+=C)}}return r.push(n.buffer),{stringTable:o,packedData:n}},A.unpackCreateGeometryResults=function(i){for(var r,n=i.stringTable,o=i.packedData,a=new Array(o[0]),c=0,h=1;h0){var D=w.length/S;for(M=d.createTypedArray(D,C),r=0;r1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",d="";if(r){c+="vec2 st;\n";var h=a>1?l+".x":l;d+=" st = czm_decompressTextureCoordinates("+h+");\n"}i&&n&&o?(c+="vec3 normal;\nvec3 tangent;\nvec3 bitangent;\n",d+=" czm_octDecode("+l+"."+(r?"yz":"xy")+", normal, tangent, bitangent);\n"):(i&&(c+="vec3 normal;\n",d+=" normal = czm_octDecode("+l+(a>1?"."+(r?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",d+=" tangent = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"),o&&(c+="vec3 bitangent;\n",d+=" bitangent = czm_octDecode("+l+"."+(r&&i?"z":"y")+");\n"));var p=t;p=p.replace(/attribute\s+vec3\s+normal;/g,""),p=p.replace(/attribute\s+vec2\s+st;/g,""),p=p.replace(/attribute\s+vec3\s+tangent;/g,""),p=p.replace(/attribute\s+vec3\s+bitangent;/g,""),p=D.replaceMain(p,"czm_non_compressed_main");var f="void main() \n{ \n"+d+" czm_non_compressed_main(); \n}";return[u,c,p,f].join("\n")}function Y(e,t){e.vertexAttributes}function X(e,t){return function(){return e[t]}}function Z(e,t){var i,r,n,o,a=e._instanceIds;if(e._state===B.READY){i=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var s=e._numberOfInstances=i.length,l=[],d=[];for(n=0;n0){var g=new Float64Array(p);for(_=[g.buffer],o=0;o0?e._state=B.COMBINED:se(e,t,B.FAILED,void 0)}).otherwise(function(i){se(e,t,B.FAILED,i)})}}function K(e,t){var i,r,n=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),s=e._instanceIds,l=0;for(r=0;r0?e._state=B.COMBINED:se(e,t,B.FAILED,void 0)}function Q(t,i){var r=c(t._batchTableAttributeIndices.distanceDisplayCondition);if(r||!t._batchTableBoundingSpheresUpdated){for(var n=t._batchTableBoundingSphereAttributeIndices,o=n.center3DHigh,a=n.center3DLow,s=n.center2DHigh,l=n.center2DLow,u=n.radius,d=i.mapProjection,h=d.ellipsoid,p=t._batchTable,m=t._instanceBoundingSpheres,_=m.length,g=0;g<_;++g){var v=m[g];if(c(v)){var y=t.modelMatrix;if(c(y)&&(v=e.transform(v,y,v)),r){var C=v.center,w=v.radius,S=f.fromCartesian(C,me);p.setBatchedAttribute(g,o,S.high),p.setBatchedAttribute(g,a,S.low);var E=h.cartesianToCartographic(C,_e),b=d.project(E,ge);S=f.fromCartesian(b,me),p.setBatchedAttribute(g,s,S.high),p.setBatchedAttribute(g,l,S.low),p.setBatchedAttribute(g,u,w)}}}t._batchTableBoundingSpheresUpdated=!0}}function J(t,i){for(var r=t._attributeLocations,n=t._geometries,o=i.scene3DOnly,a=i.context,s=[],l=n.length,u=0;u0){if(0===T.maximumVertexTextureImageUnits)throw new w("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!==B.COMPLETE&&this._state!==B.COMBINED&&(this.asynchronous?Z(this,e):K(this,e)),this._state===B.COMBINED&&(Q(this,e),J(this,e)),this.show&&this._state===B.COMPLETE){var i=this.appearance,r=i.material,n=!1,o=!1;this._appearance!==i?(this._appearance=i,this._material=r,n=!0,o=!0):this._material!==r&&(this._material=r,o=!0);var a=this._appearance.isTranslucent();this._translucent!==a&&(this._translucent=a,n=!0),c(this._material)&&this._material.update(t);var s=i.closed&&a;if(n){var l=u(this._createRenderStatesFunction,$);l(this,t,i,s)}if(o){var d=u(this._createShaderProgramFunction,ee);d(this,e,i)}if(n||o){var h=u(this._createCommandsFunction,te);h(this,i,r,a,s,this._colorCommands,this._pickCommands,e)}var p=u(this._updateAndQueueCommandsFunction,re);p(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,s)}}}},V.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,n=r.length,o=0;o-1;c--)r=n[c],u(e,w,p,r);for(i=_-1;i>=0;i--)for(h=m[i],h.collectionChanged.addEventListener(d.prototype._onCollectionChanged,e),n=h.values,p=h.id,c=n.length-1;c>-1;c--){r=n[c],l(e,w,p,r);var S=C.getById(r.id);t(S)||(S=y.getById(r.id),t(S)?s(S):(f.id=r.id,S=new o(f)),C.add(S)),S.merge(r)}e._collectionsCopy=m.slice(0),y.suspendEvents(),y.removeAll();var E=C.values;for(i=0;i=0;h--)p=n[h].getById(C),t(p)&&(t(m)||(m=c.getById(C),s(m)),m.merge(p));t(m)||c.removeById(C),m=void 0}var w=i.length;for(d=0;d=0;h--)p=n[h].getById(E),t(p)&&(t(m)||(m=c.getById(E),t(m)?s(m):(f.id=E,m=new o(f),c.add(m))),m.merge(p));m=void 0}c.resumeEvents()},d.prototype._onDefinitionChanged=function(e,i,r,n){for(var o=this._collections,a=this._composite,s=o.length,l=e.id,u=a.getById(l),c=u[i],d=!t(c),h=!0,p=s-1;p>=0;p--){var f=o[p].getById(e.id);if(t(f)){var m=f[i];if(t(m)){if(h){if(h=!1,!t(m.merge)||!t(m.clone)){c=m;break}c=m.clone(c)}c.merge(m)}}}d&&u.propertyNames.indexOf(i)===-1&&u.addProperty(i),u[i]=c},d}),define("DataSources/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(t,i,r,n){function o(){r.raiseEvent(t)}var a=[];i.removeAll();for(var s=n.length,l=0;l1&&(t=Q),this._primitiveOptions={geometryInstances:void 0,appearance:i,vertexCacheOptimize:a(e.vertexCacheOptimize,!1),interleave:a(e.interleave,!1),releaseGeometryInstances:a(e.releaseGeometryInstances,!0),allowPicking:a(e.allowPicking,!0),asynchronous:a(e.asynchronous,!0),compressVertices:a(e.compressVertices,!0),_readOnlyInstanceAttributes:t,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_createPickOffsets:!0}}function N(e){return function(t,i){var r=i.maximumRadius,n=r/Math.cos(.5*t)-r;return e._maxHeight+n}}function L(e){return function(t,i){return e._minHeight}}function B(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:I.ALWAYS,frontOperation:{fail:R.KEEP,zFail:R.DECREMENT_WRAP,zPass:R.DECREMENT_WRAP},backFunction:I.ALWAYS,backOperation:{fail:R.KEEP,zFail:R.INCREMENT_WRAP,zPass:R.INCREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1}}function F(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:I.ALWAYS,frontOperation:{fail:R.KEEP,zFail:R.KEEP,zPass:R.INCREMENT_WRAP},backFunction:I.ALWAYS,backOperation:{fail:R.KEEP,zFail:R.KEEP,zPass:R.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!0,func:A.LESS_OR_EQUAL},depthMask:!1}}function k(e){return{stencilTest:{enabled:e,frontFunction:I.NOT_EQUAL,frontOperation:{fail:R.KEEP,zFail:R.KEEP,zPass:R.DECREMENT_WRAP},backFunction:I.NOT_EQUAL,backOperation:{fail:R.KEEP,zFail:R.KEEP,zPass:R.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1,blending:x.ALPHA_BLEND}}function V(e,t){var i=e.mapProjection.ellipsoid;{if(s(t.attributes)&&s(t.attributes.position3DHigh)){for(var n=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,a=n.length,l=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY,h=0;ha?a:s-1}}function U(e,t,i){var n=z(t),o=O._defaultMinTerrainHeight,a=O._defaultMaxTerrainHeight;if(s(n)){var l=n.level+"-"+n.x+"-"+n.y,u=O._terrainHeights[l];s(u)&&(o=u[0],a=u[1]),i.cartographicToCartesian(g.northeast(t,ue),se),i.cartographicToCartesian(g.southwest(t,ue),le),r.subtract(le,se,ce),r.add(se,r.multiplyByScalar(ce,.5,ce),ce);var c=i.scaleToGeodeticSurface(ce,de);if(s(c)){var d=r.distance(ce,c);o=Math.min(o,-d)}else o=O._defaultMinTerrainHeight}e._minTerrainHeight=Math.max(O._defaultMinTerrainHeight,o),e._maxTerrainHeight=a}function G(t,i){var r=z(t),n=O._defaultMaxTerrainHeight;if(s(r)){var o=r.level+"-"+r.x+"-"+r.y,a=O._terrainHeights[o];s(a)&&(n=a[1])}var l=e.fromRectangle3D(t,i,0);return e.fromRectangle3D(t,i,n,he),e.union(l,he,l)}function H(t,i,n){var o=i.mapProjection.ellipsoid,a=V(i,n);if(a.width=E.clientWidth)x=!0;else{if(B.x>.5*E.clientWidth){b.width=B.x,T.frustum.right=M.x-N,f=d(y,n,T,f),h.clipToGLWindowCoordinates(b,f,_),b.x+=B.x,T.position.x=-T.position.x;var F=T.frustum.right;T.frustum.right=-T.frustum.left,T.frustum.left=-F,f=d(y,n,T,f),h.clipToGLWindowCoordinates(b,f,g)}else{b.x+=B.x,b.width-=B.x,T.frustum.left=-M.x-N,f=d(y,n,T,f),h.clipToGLWindowCoordinates(b,f,_),b.x=b.x-b.width,T.position.x=-T.position.x;var k=T.frustum.left;T.frustum.left=-T.frustum.right,T.frustum.right=-k,f=d(y,n,T,f),h.clipToGLWindowCoordinates(b,f,g)}i.clone(D,T.position),T.frustum=I.clone(),a=t.clone(_,a),(a.x<0||a.x>E.clientWidth)&&(a.x=g.x)}}if(v.mode!==c.SCENE2D||x){if(f=d(y,n,T,f),f.z<0&&v.mode!==c.SCENE2D)return;a=h.clipToGLWindowCoordinates(b,f,a)}return a.y=E.clientHeight-a.y,a}},h.wgs84ToDrawingBufferCoordinates=function(e,t,i){if(i=h.wgs84ToWindowCoordinates(e,t,i),o(i))return h.transformWindowToDrawingBuffer(e,i,i)};var E=new i,b=new n;h.computeActualWgs84Position=function(e,t,r){var n=e.mode;if(n===c.SCENE3D)return i.clone(t,r);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,b);if(o(l)){if(a.project(l,E),n===c.COLUMBUS_VIEW)return i.fromElements(E.z,E.x,E.y,r);if(n===c.SCENE2D)return i.fromElements(0,E.x,E.y,r);var u=e.morphTime;return i.fromElements(s.lerp(E.z,t.x,u),s.lerp(E.x,t.y,u),s.lerp(E.y,t.z,u),r)}};var T=new i,x=new i,A=new l;h.clipToGLWindowCoordinates=function(e,r,n){return i.divideByScalar(r,r.w,T),l.computeViewportTransformation(e,0,1,A),l.multiplyByPoint(A,T,x),t.fromCartesian3(x,n)},h.clipToDrawingBufferCoordinates=function(e,r,n){return i.divideByScalar(r,r.w,T),l.computeViewportTransformation(e,0,1,A),l.multiplyByPoint(A,T,x),t.fromCartesian3(x,n)},h.transformWindowToDrawingBuffer=function(e,i,r){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(i.x*o,i.y*a,r)};var P=new r,M=new r;return h.drawingBufferToWgs84Coordinates=function(e,t,n,a){var s=e.context,u=s.uniformState,c=e._passState.viewport,d=r.clone(r.UNIT_W,P);d.x=(t.x-c.x)/c.width*2-1,d.y=(t.y-c.y)/c.height*2-1,d.z=2*n-1,d.w=1;var h,p=e.camera.frustum;if(o(p.fovy)){h=l.multiplyByVector(u.inverseViewProjection,d,M);var f=1/h.w;i.multiplyByScalar(h,f,h)}else{var m=u.currentFrustum;h=M,h.x=.5*(d.x*(p.right-p.left)+p.left+p.right),h.y=.5*(d.y*(p.top-p.bottom)+p.bottom+p.top),h.z=.5*(d.z*(m.x-m.y)-m.x-m.y),h.w=1,h=l.multiplyByVector(u.inverseView,h,h)}return i.fromCartesian4(h,a)},h}),define("Scene/Billboard",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./HeightReference","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v){"use strict";function y(e,r){e=s(e,s.EMPTY_OBJECT),this._show=s(e.show,!0),this._position=i.clone(s(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._pixelOffset=t.clone(s(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=i.clone(s(e.eyeOffset,i.ZERO)),this._heightReference=s(e.heightReference,f.NONE),this._verticalOrigin=s(e.verticalOrigin,v.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,m.CENTER),this._scale=s(e.scale,1),this._color=o.clone(s(e.color,o.WHITE)),this._rotation=s(e.rotation,0),this._alignedAxis=i.clone(s(e.alignedAxis,i.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._sizeInMeters=s(e.sizeInMeters,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._id=e.id,this._collection=s(e.collection,r),this._pickId=void 0,this._pickPrimitive=s(e._pickPrimitive,this),this._billboardCollection=r,this._dirty=!1,this._index=-1,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;var n=e.image,u=e.imageId;l(n)&&(l(u)||(u="string"==typeof n?n:l(n.src)?n.src:a()),this._imageId=u,this._image=n),l(e.imageSubRegion)&&(this._imageId=u,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=_.SCENE3D,this._clusterShow=!0,this._updateClamping()}function C(e,t){var i=e._billboardCollection;l(i)&&(i._updateBillboard(e,t),e._dirty=!0)}var w=y.SHOW_INDEX=0,S=y.POSITION_INDEX=1,E=y.PIXEL_OFFSET_INDEX=2,b=y.EYE_OFFSET_INDEX=3,T=y.HORIZONTAL_ORIGIN_INDEX=4,x=y.VERTICAL_ORIGIN_INDEX=5,A=y.SCALE_INDEX=6,P=y.IMAGE_INDEX_INDEX=7,M=y.COLOR_INDEX=8,D=y.ROTATION_INDEX=9,I=y.ALIGNED_AXIS_INDEX=10,R=y.SCALE_BY_DISTANCE_INDEX=11,O=y.TRANSLUCENCY_BY_DISTANCE_INDEX=12,N=y.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,L=y.DISTANCE_DISPLAY_CONDITION=14;y.NUMBER_OF_PROPERTIES=15,u(y.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,C(this,w))}},position:{get:function(){return this._position},set:function(e){var t=this._position;i.equals(t,e)||(i.clone(e,t),i.clone(e,this._actualPosition),this._updateClamping(),C(this,S))}},heightReference:{get:function(){return this._heightReference},set:function(e){var t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),C(this,S))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var i=this._pixelOffset;t.equals(i,e)||(t.clone(e,i),C(this,E))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;p.equals(t,e)||(this._scaleByDistance=p.clone(e,t),C(this,R))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;p.equals(t,e)||(this._translucencyByDistance=p.clone(e,t),C(this,O))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;p.equals(t,e)||(this._pixelOffsetScaleByDistance=p.clone(e,t),C(this,N))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;i.equals(t,e)||(i.clone(e,t),C(this,b))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,C(this,T))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,C(this,x))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,C(this,A))}},color:{get:function(){return this._color},set:function(e){var t=this._color;o.equals(t,e)||(o.clone(e,t),C(this,M))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,C(this,D))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;i.equals(t,e)||(i.clone(e,t),C(this,I))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,C(this,P))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,C(this,P))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,C(this,M))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){d.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=d.clone(e,this._distanceDisplayCondition),C(this,L))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},image:{get:function(){return this._imageId},set:function(e){l(e)?"string"==typeof e?this.setImage(e,e):l(e.src)?this.setImage(e.src,e):this.setImage(a(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,C(this,P))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=i.clone(e,this._actualClampedPosition),C(this,S)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,C(this,w))}}}),y.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},y.prototype._updateClamping=function(){y._updateClamping(this._billboardCollection,this)};var B=new n,F=new i;y._updateClamping=function(e,t){function r(e){if(t._heightReference===f.RELATIVE_TO_GROUND)if(t._mode===_.SCENE3D){var r=s.cartesianToCartographic(e,B);r.height+=h.height,s.cartographicToCartesian(r,e)}else e.x+=h.height;t._clampedPosition=i.clone(e,t._clampedPosition)}var o=e._scene;if(l(o)){var a=o.globe,s=a.ellipsoid,u=a._surface,c=o.frameState.mode,d=c!==t._mode;if(t._mode=c,(t._heightReference===f.NONE||d)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==f.NONE&&l(t._position)){var h=s.cartesianToCartographic(t._position);if(l(h)){l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(h,r),n.clone(h,B);var p=a.getHeight(h);l(p)&&(B.height=p),s.cartographicToCartesian(B,F),r(F)}}}},y.prototype._loadImage=function(){var t,i=this._billboardCollection._textureAtlas,r=this._imageId,n=this._image,o=this._imageSubRegion;if(l(n)&&(t=i.addImage(r,n)),l(o)&&(t=i.addSubRegion(r,o)),this._imageIndexPromise=t,l(t)){var a=this;t.then(function(t){if(a._imageId===r&&a._image===n&&e.equals(a._imageSubRegion,o)){var s=i.textureCoordinates[t];a._imageWidth=i.texture.width*s.width,a._imageHeight=i.texture.height*s.height,a._imageIndex=t,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,C(a,P)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},y.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype.setImageSubRegion=function(t,i){this._imageId===t&&e.equals(this._imageSubRegion,i)||(this._imageIndex=-1,this._imageId=t,this._imageSubRegion=e.clone(i),l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype._setTranslate=function(e){var i=this._translate;t.equals(i,e)||(t.clone(e,i),C(this,E))},y.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},y.prototype._setActualPosition=function(e){l(this._clampedPosition)||i.clone(e,this._actualPosition),C(this,S)};var k=new r;y._computeActualPosition=function(e,t,i,r){return l(e._clampedPosition)?(i.mode!==e._mode&&e._updateClamping(),e._clampedPosition):i.mode===_.SCENE3D?t:(h.multiplyByPoint(r,t,k),g.computeActualWgs84Position(i,k))};var V=new i;y._computeScreenSpacePosition=function(e,i,r,n,o,a){var s=h.multiplyByPoint(e,i,V),u=g.wgs84WithEyeOffsetToWindowCoordinates(o,s,r,a);if(l(u))return t.add(u,n,u),u};var z=new t(0,0);return y.prototype.computeScreenSpacePosition=function(e,i){var r=this._billboardCollection;l(i)||(i=new t),t.clone(this._pixelOffset,z),t.add(z,this._translate,z);var n=r.modelMatrix,o=this._getActualPosition(),a=y._computeScreenSpacePosition(n,o,this._eyeOffset,z,e,i);return a},y.getScreenSpaceBoundingBox=function(t,i,r){var n=t.width,o=t.height,a=t.scale;n*=a,o*=a;var s=i.x;t.horizontalOrigin===m.RIGHT?s-=n:t.horizontalOrigin===m.CENTER&&(s-=.5*n);var u=i.y;return t.verticalOrigin===v.BOTTOM||t.verticalOrigin===v.BASELINE?u-=o:t.verticalOrigin===v.CENTER&&(u-=.5*o),l(r)||(r=new e),r.x=s,r.y=u,r.width=n,r.height=o,r},y.prototype.equals=function(r){return this===r||l(r)&&this._id===r._id&&i.equals(this._position,r._position)&&this._imageId===r._imageId&&this._show===r._show&&this._scale===r._scale&&this._verticalOrigin===r._verticalOrigin&&this._horizontalOrigin===r._horizontalOrigin&&this._heightReference===r._heightReference&&e.equals(this._imageSubRegion,r._imageSubRegion)&&o.equals(this._color,r._color)&&t.equals(this._pixelOffset,r._pixelOffset)&&t.equals(this._translate,r._translate)&&i.equals(this._eyeOffset,r._eyeOffset)&&p.equals(this._scaleByDistance,r._scaleByDistance)&&p.equals(this._translucencyByDistance,r._translucencyByDistance)&&p.equals(this._pixelOffsetScaleByDistance,r._pixelOffsetScaleByDistance)&&d.equals(this._distanceDisplayCondition,r._distanceDisplayCondition)},y.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},y}),define("Renderer/VertexArrayFacade",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./Buffer","./BufferUsage","./VertexArray"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r,n,o,a){function s(t,i){return e.getSizeInBytes(i.componentDatatype)-e.getSizeInBytes(t.componentDatatype)}var l=u._verifyAttributes(n);o=t(o,0);for(var c,d,h=[],p={},f=l.length,m=0;m0){t.needsCommit=!1;var r=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=i(r);if(!o||r.sizeInBytes0){var r=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*i;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,r,n),r)}}function h(e){var t=e.va;if(i(t)){for(var r=t.length,n=0;n0?e.getSizeInBytes(t[0].componentDatatype):0,s=a>0?i%a:0,l=0===s?0:a-s;return i+=l},u._createArrayViews=function(t,i){for(var r=[],n=0,o=t.length,a=0;a0){var n=new ArrayBuffer(r*t.vertexSizeInBytes);if(i(t.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(t.arrayBuffer),s=a.length,l=0;l= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),define("Shaders/BillboardCollectionVS",[],function(){"use strict";return"#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 compressedAttribute2;\nattribute vec4 eyeOffset;\nattribute vec4 scaleByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\nattribute vec2 distanceDisplayCondition;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nconst float UPPER_BOUND = 32768.0;\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nvec4 computePositionWindowCoordinates(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters)\n{\nvec2 halfSize = imageSize * scale * czm_resolutionScale * 0.5;\nhalfSize *= ((direction * 2.0) - 1.0);\nvec2 originTranslate = origin * abs(halfSize);\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (validAlignedAxis || rotation != 0.0)\n{\nfloat angle = rotation;\nif (validAlignedAxis)\n{\nvec3 pos = positionEC.xyz + czm_encodedCameraPositionMCHigh + czm_encodedCameraPositionMCLow;\nvec3 normal = normalize(cross(alignedAxis, pos));\nvec4 tangent = vec4(normalize(cross(pos, normal)), 0.0);\ntangent = czm_modelViewProjection * tangent;\nangle += sign(-tangent.x) * acos(tangent.y / length(tangent.xy));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\nif (sizeInMeters)\n{\npositionEC.xy += halfSize;\n}\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nif (sizeInMeters)\n{\noriginTranslate += originTranslate / czm_metersPerPixel(positionEC);\n}\npositionWC.xy += originTranslate;\nif (!sizeInMeters)\n{\npositionWC.xy += halfSize;\n}\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_resolutionScale);\nreturn positionWC;\n}\nvoid main()\n{\nvec3 positionHigh = positionHighAndScale.xyz;\nvec3 positionLow = positionLowAndRotation.xyz;\nfloat scale = positionHighAndScale.w;\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nfloat rotation = positionLowAndRotation.w;\n#else\nfloat rotation = 0.0;\n#endif\nfloat compressed = compressedAttribute0.x;\nvec2 pixelOffset;\npixelOffset.x = floor(compressed * SHIFT_RIGHT7);\ncompressed -= pixelOffset.x * SHIFT_LEFT7;\npixelOffset.x -= UPPER_BOUND;\nvec2 origin;\norigin.x = floor(compressed * SHIFT_RIGHT5);\ncompressed -= origin.x * SHIFT_LEFT5;\norigin.y = floor(compressed * SHIFT_RIGHT3);\ncompressed -= origin.y * SHIFT_LEFT3;\norigin -= vec2(1.0);\nfloat show = floor(compressed * SHIFT_RIGHT2);\ncompressed -= show * SHIFT_LEFT2;\n#ifdef INSTANCED\nvec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\nvec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\nvec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#else\nvec2 direction;\ndirection.x = floor(compressed * SHIFT_RIGHT1);\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\nfloat temp = compressedAttribute0.y * SHIFT_RIGHT8;\npixelOffset.y = -(floor(temp) - UPPER_BOUND);\nvec2 translate;\ntranslate.y = (temp - floor(temp)) * SHIFT_LEFT16;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\ntranslate.x = floor(temp) - UPPER_BOUND;\ntranslate.y += (temp - floor(temp)) * SHIFT_LEFT8;\ntranslate.y -= UPPER_BOUND;\ntemp = compressedAttribute1.x * SHIFT_RIGHT8;\nvec2 imageSize = vec2(floor(temp), compressedAttribute2.w);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n#ifdef ALIGNED_AXIS\nvec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\ntemp = compressedAttribute2.z * SHIFT_RIGHT5;\nbool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\n#else\nvec3 alignedAxis = vec3(0.0);\nbool validAlignedAxis = false;\n#endif\n#ifdef RENDER_FOR_PICK\ntemp = compressedAttribute2.y;\n#else\ntemp = compressedAttribute2.x;\n#endif\nvec4 color;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\ncolor.a = (temp - floor(temp)) * SHIFT_LEFT8;\nvec4 pickColor = color / 255.0;\n#else\ncolor.a = floor(temp);\ncolor /= 255.0;\n#endif\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nfloat distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);\nscale *= distanceScale;\ntranslate *= distanceScale;\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"}),define("Scene/BlendOption",["../Core/freezeObject"],function(e){"use strict";var t={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};return e(t)}),define("Renderer/Framebuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","./ContextLimits"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){var r=e._gl;r.framebufferTexture2D(r.FRAMEBUFFER,t,i._target,i._texture,0)}function l(e,t,i){var r=e._gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,t,r.RENDERBUFFER,i._getRenderbuffer())}function u(i){i=e(i,e.EMPTY_OBJECT);var r=i.context._gl;a.maximumColorAttachments;this._gl=r,this._framebuffer=r.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e(i.destroyAttachments,!0);t(i.depthTexture)||t(i.depthRenderbuffer),t(i.depthStencilTexture)||t(i.depthStencilRenderbuffer);this._bind();var n,o,u,c,d;if(t(i.colorTextures)){var h=i.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=h.length,u=0;u0){for(var l=e._texture.width,u=e._texture.height,c=a*(l+i.width+s),p=a*(u+i.height+s),m=l/c,_=u/p,g=new f(new t(l+s,s),new t(c,u)),v=new f(new t,new t(c,u),e._root,g),y=new f(new t(s,u+s),new t(c,p)),C=new f(new t,new t(c,p),v,y),w=0;wl){i.childNode1=new f(new t(i.bottomLeft.x,i.bottomLeft.y),new t(i.bottomLeft.x+r.width,i.topRight.y));var u=i.bottomLeft.x+r.width+e._borderWidthInPixels;u0){this._vaf=z(n,r,this._buffersUsage,this._instanced),_=this._vaf.writers;for(var M=0;M0){var O=Oe;O.length=0,(d[te]||d[ue]||d[ae])&&O.push(U),(d[se]||d[ie]||d[ne]||d[oe]||d[ee])&&(O.push(G),this._instanced&&O.push(q)),(d[se]||d[ce]||d[he])&&(O.push(H),O.push(W)),(d[se]||d[le])&&O.push(W),d[re]&&O.push(q),d[de]&&O.push(j),d[pe]&&O.push(Y),d[fe]&&O.push(X);var N=O.length;if(_=this._vaf.writers,c/r>.1){for(var L=0;L1.5*r&&(u.length=r),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var Se,Ee=f.IDENTITY;e.mode===I.SCENE3D?(Ee=this.modelMatrix,Se=t.clone(this._baseVolumeWC,this._boundingVolume)):Se=t.clone(this._baseVolume2D,this._boundingVolume),J(this,e,Se);var be=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,be&&(this._blendOption===P.OPAQUE||this._blendOption===P.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=C.fromCache({depthTest:{enabled:!0,func:m.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===P.TRANSLUCENT||this._blendOption===P.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=C.fromCache({depthTest:{enabled:!0,func:m.LEQUAL},depthMask:this._blendOption===P.TRANSLUCENT,blending:A.ALPHA_BLEND}):this._rsTranslucent=void 0),(be||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition)&&(Pe=new S({sources:[T]}),this._instanced&&Pe.defines.push("INSTANCED"),this._shaderRotation&&Pe.defines.push("ROTATION"),this._shaderAlignedAxis&&Pe.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Pe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Pe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Pe.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Pe.defines.push("DISTANCE_DISPLAY_CONDITION"),this._blendOption===P.OPAQUE_AND_TRANSLUCENT&&(Me=new S({defines:["OPAQUE"],sources:[b]}),this._sp=w.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:Pe,fragmentShaderSource:Me,attributeLocations:$}),Me=new S({defines:["TRANSLUCENT"],sources:[b]}),this._spTranslucent=w.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:Pe,fragmentShaderSource:Me,attributeLocations:$})),this._blendOption===P.OPAQUE&&(Me=new S({sources:[b]}),this._sp=w.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:Pe,fragmentShaderSource:Me,attributeLocations:$})),this._blendOption===P.TRANSLUCENT&&(Me=new S({sources:[b]}),this._spTranslucent=w.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:Pe,fragmentShaderSource:Me,attributeLocations:$})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition),s(this._spPick)&&this._shaderRotation===this._compiledShaderRotationPick&&this._shaderAlignedAxis===this._compiledShaderAlignedAxisPick&&this._shaderScaleByDistance===this._compiledShaderScaleByDistancePick&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistancePick&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistancePick&&this._shaderDistanceDisplayCondition===this._compiledShaderDistanceDisplayConditionPick||(Pe=new S({defines:["RENDER_FOR_PICK"],sources:[T]}),this._instanced&&Pe.defines.push("INSTANCED"),this._shaderRotation&&Pe.defines.push("ROTATION"),this._shaderAlignedAxis&&Pe.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Pe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Pe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Pe.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Pe.defines.push("DISTANCE_DISPLAY_CONDITION"),Me=new S({defines:["RENDER_FOR_PICK"],sources:[b]}),this._spPick=w.replaceCache({context:n,shaderProgram:this._spPick,vertexShaderSource:Pe,fragmentShaderSource:Me,attributeLocations:$}),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderAlignedAxisPick=this._shaderAlignedAxis,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition);var Te,xe,Ae,Pe,Me,De,Ie=e.commandList;if(g.render){var Re=this._colorCommands,Ne=this._blendOption===P.OPAQUE,Le=this._blendOption===P.OPAQUE_AND_TRANSLUCENT;Te=this._vaf.va,xe=Te.length,Re.length=xe;var Be=Le?2*xe:xe;for(De=0;De0,h=t._backgroundBillboard,p=e._backgroundBillboardCollection;c?(r(h)||(h=p.add({collection:e,image:P,imageSubRegion:D}),t._backgroundBillboard=h),h.color=t._backgroundColor,h.show=t._show,h.position=t._position,h.eyeOffset=t._eyeOffset,h.pixelOffset=t._pixelOffset,h.horizontalOrigin=d.LEFT,h.verticalOrigin=t._verticalOrigin,h.heightReference=t._heightReference,h.scale=t._scale,h.pickPrimitive=t,h.id=t._id,h.translucencyByDistance=t._translucencyByDistance,h.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,h.scaleByDistance=t._scaleByDistance,h.distanceDisplayCondition=t._distanceDisplayCondition):r(h)&&(p.remove(h),t._backgroundBillboard=h=void 0);var f=e._glyphTextureCache;for(o=0;o0&&I.height>0&&w(e._textureAtlas,A,I,M)}if(i=l[o],r(i)?M.index===-1?C(e,i):r(i.textureInfo)&&(i.textureInfo=void 0):(i=new _,l[o]=i),i.textureInfo=M,i.dimensions=M.dimensions,M.index!==-1){var R=i.billboard,O=e._spareBillboards;r(R)||(R=O.length>0?O.pop():e._billboardCollection.add({collection:e}),i.billboard=R),R.show=t._show,R.position=t._position,R.eyeOffset=t._eyeOffset,R.pixelOffset=t._pixelOffset,R.horizontalOrigin=d.LEFT,R.verticalOrigin=t._verticalOrigin,R.heightReference=t._heightReference,R.scale=t._scale,R.pickPrimitive=t,R.id=t._id,R.image=A,R.translucencyByDistance=t._translucencyByDistance,R.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,R.scaleByDistance=t._scaleByDistance,R.distanceDisplayCondition=t._distanceDisplayCondition}}t._repositionAllGlyphs=!0}function E(e,t,i){return t===d.CENTER?-e/2:t===d.RIGHT?-(e+i.x):i.x}function b(e,i){var n,o,a=e._glyphs,s=e._text,l=0,u=0,c=[],h=Number.NEGATIVE_INFINITY,p=0,f=1,_=0,g=a.length,v=e._backgroundBillboard,y=O;for(t.clone(r(v)?e._backgroundPadding:t.ZERO,y),_=0;_0&&(P=S===d.CENTER?-u/2-y.x:S===d.RIGHT?-(u+2*y.x):0,R.x=P*w*i,b===m.TOP?R.y=C-p-h:b===m.CENTER?R.y=(C-p)/2-h:b===m.BASELINE?R.y=-y.y-h:R.y=0,R.y=R.y*w*i,v.width=u+2*y.x,v.height=C+D+2*y.y,v._setTranslate(R))}function T(e,t){for(var i=t._glyphs,n=0,a=i.length;n0?c.TRANSLUCENT:this.blendOption;t.blendOption=_,i.blendOption=_,this._labelsToUpdate.length=0,i.update(e),t.update(e)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),o(this)},x}),define("Scene/PointPrimitive",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t){e=o(e,o.EMPTY_OBJECT),this._show=o(e.show,!0),this._position=i.clone(o(e.position,i.ZERO)),this._actualPosition=i.clone(this._position),this._color=n.clone(o(e.color,n.WHITE)),this._outlineColor=n.clone(o(e.outlineColor,n.TRANSPARENT)),this._outlineWidth=o(e.outlineWidth,0),this._pixelSize=o(e.pixelSize,10),this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._distanceDisplayCondition=e.distanceDisplayCondition,this._id=e.id,this._collection=o(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}function m(e,t){var i=e._pointPrimitiveCollection;a(i)&&(i._updatePointPrimitive(e,t),e._dirty=!0)}var _=f.SHOW_INDEX=0,g=f.POSITION_INDEX=1,v=f.COLOR_INDEX=2,y=f.OUTLINE_COLOR_INDEX=3,C=f.OUTLINE_WIDTH_INDEX=4,w=f.PIXEL_SIZE_INDEX=5,S=f.SCALE_BY_DISTANCE_INDEX=6,E=f.TRANSLUCENCY_BY_DISTANCE_INDEX=7,b=f.DISTANCE_DISPLAY_CONDITION=8;f.NUMBER_OF_PROPERTIES=9,s(f.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,m(this,_))}},position:{get:function(){return this._position},set:function(e){var t=this._position;i.equals(t,e)||(i.clone(e,t),i.clone(e,this._actualPosition),m(this,g))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;d.equals(t,e)||(this._scaleByDistance=d.clone(e,t),m(this,S))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;d.equals(t,e)||(this._translucencyByDistance=d.clone(e,t),m(this,E))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,m(this,w))}},color:{get:function(){return this._color},set:function(e){var t=this._color;n.equals(t,e)||(n.clone(e,t),m(this,v))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;n.equals(t,e)||(n.clone(e,t),m(this,y))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,m(this,C))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){u.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=u.clone(e,this._distanceDisplayCondition),m(this,b))}},id:{get:function(){return this._id},set:function(e){this._id=e,a(this._pickId)&&(this._pickId.object.id=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,m(this,_))}}}),f.prototype.getPickId=function(e){return a(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},f.prototype._getActualPosition=function(){return this._actualPosition},f.prototype._setActualPosition=function(e){i.clone(e,this._actualPosition),m(this,g)};var T=new r;f._computeActualPosition=function(e,t,i){return t.mode===h.SCENE3D?e:(c.multiplyByPoint(i,e,T),p.computeActualWgs84Position(t,T))};var x=new r;return f._computeScreenSpacePosition=function(e,t,i,n){var o=c.multiplyByVector(e,r.fromElements(t.x,t.y,t.z,1,x),x),a=p.wgs84ToWindowCoordinates(i,o,n);return a},f.prototype.computeScreenSpacePosition=function(e,i){var r=this._pointPrimitiveCollection;a(i)||(i=new t);var n=r.modelMatrix,o=f._computeScreenSpacePosition(n,this._actualPosition,e,i);if(a(o))return o.y=e.canvas.clientHeight-o.y,o},f.getScreenSpaceBoundingBox=function(t,i,r){var n=t.pixelSize,o=.5*n,s=i.x-o,l=i.y-o,u=n,c=n;return a(r)||(r=new e),r.x=s,r.y=l,r.width=u,r.height=c,r},f.prototype.equals=function(e){return this===e||a(e)&&this._id===e._id&&i.equals(this._position,e._position)&&n.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&n.equals(this._outlineColor,e._outlineColor)&&d.equals(this._scaleByDistance,e._scaleByDistance)&&d.equals(this._translucencyByDistance,e._translucencyByDistance)&&u.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)},f.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0},f}),define("Shaders/PointPrimitiveCollectionFS",[],function(){"use strict";return"varying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nvoid main()\n{\nfloat distanceToCenter = length(gl_PointCoord - vec2(0.5));\nfloat maxDistance = max(0.0, 0.5 - v_pixelDistance);\nfloat wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\nfloat innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\nvec4 color = mix(v_outlineColor, v_color, innerAlpha);\ncolor.a *= wholeAlpha;\n#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),define("Shaders/PointPrimitiveCollectionVS",[],function(){"use strict";return"uniform float u_maxTotalPointSize;\nattribute vec4 positionHighAndSize;\nattribute vec4 positionLowAndOutline;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 scaleByDistance;\nattribute vec2 distanceDisplayCondition;\nvarying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nvoid main()\n{\nvec3 positionHigh = positionHighAndSize.xyz;\nvec3 positionLow = positionLowAndOutline.xyz;\nfloat outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\nfloat totalSize = positionHighAndSize.w + outlineWidthBothSides;\nfloat outlinePercent = outlineWidthBothSides / totalSize;\ntotalSize *= czm_resolutionScale;\ntotalSize += 3.0;\nfloat temp = compressedAttribute1.x * SHIFT_RIGHT8;\nfloat show = floor(temp);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\nvec4 color;\nvec4 outlineColor;\n#ifdef RENDER_FOR_PICK\ncolor = vec4(0.0);\noutlineColor = vec4(0.0);\nvec4 pickColor;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor.r = floor(temp);\n#else\ntemp = compressedAttribute0.x * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute0.y * SHIFT_RIGHT8;\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.r = floor(temp);\n#endif\ntemp = compressedAttribute0.w * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor = pickColor / 255.0;\n#endif\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\ntotalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\n#endif\ntotalSize = min(totalSize, u_maxTotalPointSize);\nif (totalSize < 1.0)\n{\npositionEC.xyz = vec3(0.0);\ntotalSize = 1.0;\n}\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency < 0.004)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;\nfloat farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;\nif (lengthSq < nearSq || lengthSq > farSq) {\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_color = color;\nv_color.a *= translucency;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency;\nv_innerPercent = 1.0 - outlinePercent;\nv_pixelDistance = 2.0 / totalSize;\ngl_PointSize = totalSize;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#endif\n}\n"; -}),define("Scene/PointPrimitiveCollection",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/WebGLConstants","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/PointPrimitiveCollectionFS","../Shaders/PointPrimitiveCollectionVS","./BlendingState","./BlendOption","./PointPrimitive","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(t){t=r(t,r.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._spPick=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._propertiesChanged=new Uint32Array(Z),this._maxPixelSize=1,this._baseVolume=new e,this._baseVolumeWC=new e,this._baseVolume2D=new e,this._boundingVolume=new e,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=c.clone(r(t.modelMatrix,c.IDENTITY)),this._modelMatrix=c.clone(c.IDENTITY),this.debugShowBoundingVolume=r(t.debugShowBoundingVolume,!1),this.blendOption=r(t.blendOption,b.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=x.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW];var i=this;this._uniforms={u_maxTotalPointSize:function(){return i._maxTotalPointSize}}}function P(e){for(var t=e.length,i=0;i0){this._vaf=D(p,o,this._buffersUsage),i=this._vaf.writers;for(var P=0;P0){var Q=ee;Q.length=0,(l[U]||l[W]||l[q])&&Q.push(I),(l[G]||l[H])&&Q.push(R),(l[z]||l[Y])&&Q.push(O),l[j]&&Q.push(N),l[X]&&Q.push(L);var J=Q.length;if(i=this._vaf.writers,s/o>.1){for(var $=0;$1.5*o&&(a.length=o),n(this._vaf)&&n(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var ae,se=c.IDENTITY;t.mode===x.SCENE3D?(se=this.modelMatrix,ae=e.clone(this._baseVolumeWC,this._boundingVolume)):ae=e.clone(this._baseVolume2D,this._boundingVolume),V(this,t,ae);var le=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,le&&(this._blendOption===b.OPAQUE||this._blendOption===b.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=g.fromCache({depthTest:{enabled:!0,func:h.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===b.TRANSLUCENT||this._blendOption===b.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=g.fromCache({depthTest:{enabled:!0,func:h.LEQUAL},depthMask:!1,blending:E.ALPHA_BLEND}):this._rsTranslucent=void 0),(le||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition)&&(pe=new y({sources:[S]}),this._shaderScaleByDistance&&pe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&pe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&pe.defines.push("DISTANCE_DISPLAY_CONDITION"),this._blendOption===b.OPAQUE_AND_TRANSLUCENT&&(fe=new y({defines:["OPAQUE"],sources:[w]}),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:pe,fragmentShaderSource:fe,attributeLocations:K}),fe=new y({defines:["TRANSLUCENT"],sources:[w]}),this._spTranslucent=v.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:pe,fragmentShaderSource:fe,attributeLocations:K})),this._blendOption===b.OPAQUE&&(fe=new y({sources:[w]}),this._sp=v.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:pe,fragmentShaderSource:fe,attributeLocations:K})),this._blendOption===b.TRANSLUCENT&&(fe=new y({sources:[w]}),this._spTranslucent=v.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:pe,fragmentShaderSource:fe,attributeLocations:K})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition),(!n(this._spPick)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayConditionPick)&&(pe=new y({defines:["RENDER_FOR_PICK"],sources:[S]}),this._shaderScaleByDistance&&pe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&pe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&pe.defines.push("DISTANCE_DISPLAY_CONDITION"),fe=new y({defines:["RENDER_FOR_PICK"],sources:[w]}),this._spPick=v.replaceCache({context:p,shaderProgram:this._spPick,vertexShaderSource:pe,fragmentShaderSource:fe,attributeLocations:K}),this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition);var ue,ce,de,he,pe,fe,me=t.commandList;if(C.render){var _e=this._colorCommands,ge=this._blendOption===b.OPAQUE,ve=this._blendOption===b.OPAQUE_AND_TRANSLUCENT;ue=this._vaf.va,ce=ue.length,_e.length=ce;var ye=ve?2*ce:ce;for(he=0;he=i&&s<=n&&l>=r&&l<=o&&c.push(e[f]);else{var m=Math.floor((p+h)/2);s=t[2*m],l=t[2*m+1],s>=i&&s<=n&&l>=r&&l<=o&&c.push(e[m]);var _=(d+1)%2;(0===d?i<=s:r<=l)&&(u.push(p),u.push(m-1),u.push(_)),(0===d?n>=s:o>=l)&&(u.push(m+1),u.push(h),u.push(_))}}return c}function o(e,t,i,r,n,s){if(!(n-r<=i)){var l=Math.floor((r+n)/2);a(e,t,l,r,n,s%2),o(e,t,i,r,l-1,s+1),o(e,t,i,l+1,n,s+1)}}function a(e,t,i,r,n,o){for(;n>r;){if(n-r>600){var l=n-r+1,u=i-r+1,c=Math.log(l),d=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*d*(l-d)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(i-u*d/l+h)),f=Math.min(n,Math.floor(i+(l-u)*d/l+h));a(e,t,i,p,f,o)}var m=t[2*i+o],_=r,g=n;for(s(e,t,r,i),t[2*n+o]>m&&s(e,t,r,n);_m;)g--}t[2*r+o]===m?s(e,t,r,g):(g++,s(e,t,g,n)),g<=i&&(r=g+1),i<=g&&(n=g-1)}}function s(e,t,i,r){l(e,i,r),l(t,2*i,2*r),l(t,2*i+1,2*r+1)}function l(e,t,i){var r=e[t];e[t]=e[i],e[i]=r}function u(e,t,i,r,n,o){for(var a=[0,e.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),d=a.pop(),h=a.pop();if(d-h<=o)for(var p=h;p<=d;p++)c(t[2*p],t[2*p+1],i,r)<=l&&s.push(e[p]);else{var f=Math.floor((h+d)/2),m=t[2*f],_=t[2*f+1];c(m,_,i,r)<=l&&s.push(e[f]);var g=(u+1)%2;(0===u?i-n<=m:r-n<=_)&&(a.push(h),a.push(f-1),a.push(g)),(0===u?i+n>=m:r+n>=_)&&(a.push(f+1),a.push(d),a.push(g))}}return s}function c(e,t,i,r){var n=e-i,o=t-r;return n*n+o*o}return t.prototype={range:function(e,t,i,r){return n(this.ids,this.coords,e,t,i,r,this.nodeSize)},within:function(e,t,i){return u(this.ids,this.coords,e,t,i,this.nodeSize)}},e}),define("DataSources/EntityCluster",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/EllipsoidalOccluder","../Core/Event","../Core/Matrix4","../Scene/Billboard","../Scene/BillboardCollection","../Scene/Label","../Scene/LabelCollection","../Scene/PointPrimitive","../Scene/PointPrimitiveCollection","../ThirdParty/kdbush"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){e=r(e,r.EMPTY_OBJECT),this._enabled=r(e.enabled,!1),this._pixelRange=r(e.pixelRange,80),this._minimumClusterSize=r(e.minimumClusterSize,2),this._clusterBillboards=r(e.clusterBillboards,!0),this._clusterLabels=r(e.clusterLabels,!0),this._clusterPoints=r(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 s}function g(e){return e.coord.x}function v(e){return e.coord.y}function y(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}function C(t,i,r,o,a){if(n(t._labelCollection)&&o._clusterLabels?a=d.getScreenSpaceBoundingBox(t,i,a):n(t._billboardCollection)&&o._clusterBillboards?a=u.getScreenSpaceBoundingBox(t,i,a):n(t._pointPrimitiveCollection)&&o._clusterPoints&&(a=p.getScreenSpaceBoundingBox(t,i,a)),y(a,r),o._clusterLabels&&!n(t._labelCollection)&&n(t.id)&&E(o,t.id)&&n(t.id._label)){var s=o._collectionIndicesByEntity[t.id],l=o._labelCollection.get(s),c=d.getScreenSpaceBoundingBox(l,i,D);y(c,r),a=e.union(a,c,a)}return a}function w(e,t){if(e.clusterShow=!0,!n(e._labelCollection)&&n(e.id)&&E(t,e.id)&&n(e.id._label)){var i=t._collectionIndicesByEntity[e.id],r=t._labelCollection.get(i);r.clusterShow=!0}}function S(e,t,i,r){var n={billboard:r._clusterBillboardCollection.add(),label:r._clusterLabelCollection.add(),point:r._clusterPointCollection.add()};n.billboard.show=!1,n.point.show=!1,n.label.show=!0,n.label.text=t.toLocaleString(),n.billboard.position=n.label.position=n.point.position=e,r._clusterEvent.raiseEvent(i,n)}function E(e,t){return n(e)&&n(e._collectionIndicesByEntity[t])&&n(e._collectionIndicesByEntity[t].labelIndex)}function b(e,t,i,r,o){if(n(e))for(var a=e.length,s=0;s=A)for(S(J.position,X,Y,r),M.push(J),z=0;z=A){var pe=i.multiplyByScalar(ce,1/X,ce);for(S(pe,X,Y,r),M.push({position:pe,width:ue.width,height:ue.height,minimumWidth:G.width,minimumHeight:G.height}),z=0;z0?(l=c.pop(),u=a.get(l)):(u=a.add(),l=a.length-1),s[r]=l,this._clusterDirty=!0,u}}function A(e,t){var i=e._collectionIndicesByEntity[t];n(i.billboardIndex)||n(i.labelIndex)||n(i.pointIndex)||delete e._collectionIndicesByEntity[t]}function P(e){if(n(e))for(var t=e.length,i=0;i0&&0===this._labelCollection.get(0)._glyphs.length){var t=e.commandList;e.commandList=[],this._labelCollection.update(e),e.commandList=t}this._enabledDirty&&(this._enabledDirty=!1,M(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),n(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),n(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),n(this._clusterPointCollection)&&this._clusterPointCollection.update(e),n(this._labelCollection)&&this._labelCollection.update(e),n(this._billboardCollection)&&this._billboardCollection.update(e),n(this._pointCollection)&&this._pointCollection.update(e)},_.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),n(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 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=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1},_}),define("DataSources/CustomDataSource",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./DataSource","./EntityCluster","./EntityCollection"],function(e,t,i,r,n,o,a){"use strict";function s(e){this._name=e,this._clock=void 0,this._changed=new r,this._error=new r,this._isLoading=!1,this._loading=new r,this._entityCollection=new a(this),this._entityCluster=new o}return t(s.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},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){n.setLoading(this,e)}},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}}}),s}),define("DataSources/CylinderGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E){"use strict";function b(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}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),M=new C(!0),D=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new u),N=new e;return a(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:m}}),a(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&E.isConstant(this._showProperty)&&E.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,a,s=this._entity,l=s.isAvailable(r),u=new f(l&&s.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=this._distanceDisplayConditionProperty.getValue(r),m=c.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var _=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(_=this._materialProperty.color.getValue(r)),a=t.fromColor(_),n={show:u,distanceDisplayCondition:m,color:a}}else n={show:u,distanceDisplayCondition:m};return new h({id:s,geometry:new i(this._options),modelMatrix:s._getModelMatrix(p.MINIMUM_VALUE),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var n=this._entity,o=n.isAvailable(i),a=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),s=this._distanceDisplayConditionProperty.getValue(i);return new h({id:n,geometry:new r(this._options),modelMatrix:n._getModelMatrix(p.MINIMUM_VALUE),attributes:{show:new f(o&&n.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),s(this)},T.prototype._onEntityPropertyChanged=function(e,t,i,r){if("availability"===t||"position"===t||"orientation"===t||"cylinder"===t){var a=e.cylinder;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this))); -var d=e.position,h=a.length,f=a.topRadius,g=a.bottomRadius,v=a.show;if(o(v)&&v.isConstant&&!v.getValue(p.MINIMUM_VALUE)||!o(d)||!o(h)||!o(f)||!o(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var C=n(a.material,A),w=C instanceof y;this._materialProperty=C,this._fillProperty=n(s,M),this._showProperty=n(v,P),this._showOutlineProperty=n(a.outline,D),this._outlineColorProperty=c?n(a.outlineColor,I):void 0,this._shadowsProperty=n(a.shadows,R),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,O);var S=a.slices,b=a.outlineWidth,T=a.numberOfVerticalLines;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&E.isConstant(e.orientation)&&h.isConstant&&f.isConstant&&g.isConstant&&E.isConstant(S)&&E.isConstant(b)&&E.isConstant(T)){var x=this._options;x.vertexFormat=w?_.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,x.length=h.getValue(p.MINIMUM_VALUE),x.topRadius=f.getValue(p.MINIMUM_VALUE),x.bottomRadius=g.getValue(p.MINIMUM_VALUE),x.slices=o(S)?S.getValue(p.MINIMUM_VALUE):void 0,x.numberOfVerticalLines=o(T)?T.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(b)?b.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.cylinder;if(l.isShowing&&l.isAvailable(n)&&E.getValueOrDefault(u.show,n,!0)){var d=this._options,p=l._getModelMatrix(n),f=E.getValueOrUndefined(u.length,n),v=E.getValueOrUndefined(u.topRadius,n),y=E.getValueOrUndefined(u.bottomRadius,n);if(o(p)&&o(f)&&o(v)&&o(y)){d.length=f,d.topRadius=v,d.bottomRadius=y,d.slices=E.getValueOrUndefined(u.slices,n),d.numberOfVerticalLines=E.getValueOrUndefined(u.numberOfVerticalLines,n);var C=this._geometryUpdater.shadowsProperty.getValue(n),w=this._geometryUpdater.distanceDisplayConditionProperty,b=w.getValue(n),T=c.fromDistanceDisplayCondition(b);if(E.getValueOrDefault(u.fill,n,!0)){var x=S.getValue(n,s.fillMaterialProperty,this._material);this._material=x;var A=new m({material:x,translucent:x.isTranslucent(),closed:!0});d.vertexFormat=A.vertexFormat,this._primitive=a.add(new g({geometryInstances:new h({id:l,geometry:new i(d),modelMatrix:p,attributes:{distanceDisplayCondition:T}}),appearance:A,asynchronous:!1,shadows:C}))}if(E.getValueOrDefault(u.outline,n,!1)){d.vertexFormat=_.VERTEX_FORMAT;var P=E.getValueOrClonedDefault(u.outlineColor,n,e.BLACK,N),M=E.getValueOrDefault(u.outlineWidth,n,1),D=1!==P.alpha;this._outlinePrimitive=a.add(new g({geometryInstances:new h({id:l,geometry:new r(d),modelMatrix:p,attributes:{color:t.fromColor(P),distanceDisplayCondition:T}}),appearance:new _({flat:!0,translucent:D,renderState:{lineWidth:s._scene.clampLineWidth(M)}}),asynchronous:!1,shadows:C}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},T}),define("Scene/ColorBlendMode",["../Core/freezeObject","../Core/Math"],function(e,t){"use strict";var i={HIGHLIGHT:0,REPLACE:1,MIX:2};return i.getColorBlend=function(e,r){return e===i.HIGHLIGHT?0:e===i.REPLACE?1:e===i.MIX?t.clamp(r,t.EPSILON4,1):void 0},e(i)}),define("DataSources/DataSourceClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createRawPropertyDescriptor"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._definitionChanged=new o}return r(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:s("startTime"),stopTime:s("stopTime"),currentTime:s("currentTime"),clockRange:s("clockRange"),clockStep:s("clockStep"),multiplier:s("multiplier")}),l.prototype.clone=function(e){return i(e)||(e=new l),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},l.prototype.equals=function(e){return this===e||i(e)&&a.equals(this.startTime,e.startTime)&&a.equals(this.stopTime,e.stopTime)&&a.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},l.prototype.merge=function(e){this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},l.prototype.getValue=function(r){return i(r)||(r=new e),r.startTime=t(this.startTime,r.startTime),r.stopTime=t(this.stopTime,r.stopTime),r.currentTime=t(this.currentTime,r.currentTime),r.clockRange=t(this.clockRange,r.clockRange),r.multiplier=t(this.multiplier,r.multiplier),r.clockStep=t(this.clockStep,r.clockStep),r},l}),define("DataSources/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new o,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}var u=t.WHITE,c=.1,d=new e(8,8),h=new e(0,0),p=new e(1,1);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)&&s.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color"),cellAlpha:a("cellAlpha"),lineCount:a("lineCount"),lineThickness:a("lineThickness"),lineOffset:a("lineOffset")}),l.prototype.getType=function(e){return"Grid"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=s.getValueOrClonedDefault(this._color,e,u,t.color),t.cellAlpha=s.getValueOrDefault(this._cellAlpha,e,c),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,d,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,p,t.lineThickness),t.lineOffset=s.getValueOrClonedDefault(this._lineOffset,e,h,t.lineOffset),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)&&s.equals(this._cellAlpha,e._cellAlpha)&&s.equals(this._lineCount,e._lineCount)&&s.equals(this._lineThickness,e._lineThickness)&&s.equals(this._lineOffset,e._lineOffset)},l}),define("DataSources/PolylineArrowMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o){"use strict";function a(e){this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e}return i(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"PolylineArrow"},a.prototype.getValue=function(i,r){return t(r)||(r={}),r.color=o.getValueOrClonedDefault(this._color,i,e.WHITE,r.color),r},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),define("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower}var l=e.WHITE,u=.25;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),glowPower:o("glowPower")}),s.prototype.getType=function(e){return"PolylineGlow"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.glowPower=a.getValueOrDefault(this._glowPower,e,u,t.glowPower),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._glowPower,e._glowPower)},s}),define("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,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}var l=e.WHITE,u=e.BLACK,c=1;return r(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._outlineColor)&&a.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth")}),s.prototype.getType=function(e){return"PolylineOutline"},s.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.outlineColor=a.getValueOrClonedDefault(this._outlineColor,e,u,t.outlineColor),t.outlineWidth=a.getValueOrDefault(this._outlineWidth,e,c),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},s}),define("DataSources/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(i,a.FIXED),this.setValue(t)}return i(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var i=e.length,r=0;r=t;r--)e[r]=e[s--]}for(r=0;r=0||i(g)&&s.compare(_,g)>=0));){for(f[y++]=_,v+=1,l=0;l0&&(m.length=C,u(n,p,m),f.length=y,u(r,h,f))}else{for(l=0;ll)return;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,r)}if(d>=o){d=o-1;var p=n[d];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(t,p)>l)return;if(this._forwardExtrapolationType===a.HOLD)return d=o-1,u.unpack(c,d*u.packedLength,r)}var f=this._xTable,m=this._yTable,_=this._interpolationAlgorithm,g=this._packedInterpolationLength,v=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(_.getRequiredDataPoints(this._interpolationDegree,v),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,f.length=y,m.length=y*g)}var C=this._numberOfPoints-1;if(C<1)return;var w=0,S=o-1,E=S-w+1;if(E>=C+1){var b=d-(C/2|0)-1;bS&&(T=S,b=T-C,b0){n=new Array(r);for(var s=0;sd);var g="function"==typeof e.unpack&&e!==we;if(!h&&!_)return void(m?t[i]=De(a,r.reference):g?t[i]=new Z(e.unpack(p,0)):t[i]=new Z(p));var v,y=t[i],S=r.epoch;if(c(S)&&(v=w.fromIso8601(S)),h&&!_)return y instanceof Ee||(y=new Ee(e),t[i]=y),y.addSamplesPackedArray(p,v),void Ge(r,y);var E;if(!h&&_)return s=s.clone(),m?s.data=De(a,r.reference):g?s.data=e.unpack(p,0):s.data=p,c(y)||(y=m?new Y:new Ae,t[i]=y),void(!m&&y instanceof Ae?y.intervals.addInterval(s):y instanceof Y?(s.data=m?s.data:new Z(s.data),y.intervals.addInterval(s)):(E=C.MAXIMUM_INTERVAL.clone(),E.data=y,y=new Y,t[i]=y,y.intervals.addInterval(E),s.data=m?s.data:new Z(s.data),y.intervals.addInterval(s)));c(y)||(y=new Y,t[i]=y),y instanceof Y||(E=C.MAXIMUM_INTERVAL.clone(),E.data=y,y=new Y,t[i]=y,y.intervals.addInterval(E));var b=y.intervals;E=b.findInterval(s),c(E)&&E.data instanceof Ee||(E=s.clone(),E.data=new Ee(e),b.addInterval(E)),E.data.addSamplesPackedArray(p,v),Ge(r,E.data)}function We(e,t,i,r,n,o,a){if(c(r))if(y(r))for(var s=0,l=r.length;s_),!f&&!v)return void(g?e[t]=De(a,r.reference):e[t]=new X(i.unpack(h),d));var y,S=e[t],E=r.epoch;if(c(E)&&(y=w.fromIso8601(E)),f&&!v)return S instanceof Se&&(!c(d)||S.referenceFrame===d)||(S=new Se(d,m),e[t]=S),S.addSamplesPackedArray(h,y),void Ge(r,S);var b;if(!f&&v)return s=s.clone(),g?s.data=De(a,r.reference):s.data=i.unpack(h),c(S)||(S=g?new j(d):new xe(d),e[t]=S),void(!g&&S instanceof xe&&c(d)&&S.referenceFrame===d?S.intervals.addInterval(s):S instanceof j?(s.data=g?s.data:new X(s.data,d),S.intervals.addInterval(s)):(b=C.MAXIMUM_INTERVAL.clone(),b.data=S,S=new j(S.referenceFrame),e[t]=S,S.intervals.addInterval(b),s.data=g?s.data:new X(s.data,d),S.intervals.addInterval(s)));c(S)?S instanceof j||(b=C.MAXIMUM_INTERVAL.clone(),b.data=S,S=new j(S.referenceFrame),e[t]=S,S.intervals.addInterval(b)):(S=new j(d),e[t]=S);var T=S.intervals;b=T.findInterval(s),c(b)&&b.data instanceof Se&&(!c(d)||b.data.referenceFrame===d)||(b=s.clone(),b.data=new Se(d,m),T.addInterval(b)),b.data.addSamplesPackedArray(h,y),Ge(r,b.data)}function je(e,t,i,r,n,o){if(c(i))if(y(i))for(var a=0,s=i.length;a. version format.");var n=t._documentPacket;c(e.name)&&(n.name=e.name);var o=e.clock;if(c(o)){var a=n.clock;c(a)?(a.interval=u(o.interval,a.interval),a.currentTime=u(o.currentTime,a.currentTime),a.range=u(o.range,a.range),a.step=u(o.step,a.step),a.multiplier=u(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function dt(e,t,i,r){var n=t.ellipse;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.ellipse;c(l)||(e.ellipse=l=new ee),We(Boolean,l,"show",n.show,o,r,i),We(Number,l,"semiMajorAxis",n.semiMajorAxis,o,r,i),We(Number,l,"semiMinorAxis",n.semiMinorAxis,o,r,i),We(Number,l,"height",n.height,o,r,i),We(Number,l,"extrudedHeight",n.extrudedHeight,o,r,i),We(we,l,"rotation",n.rotation,o,r,i),We(we,l,"stRotation",n.stRotation,o,r,i),We(Number,l,"granularity",n.granularity,o,r,i),We(Boolean,l,"fill",n.fill,o,r,i),Xe(l,"material",n.material,o,r,i),We(Boolean,l,"outline",n.outline,o,r,i),We(a,l,"outlineColor",n.outlineColor,o,r,i),We(Number,l,"outlineWidth",n.outlineWidth,o,r,i),We(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,r,i),We(k,l,"shadows",n.shadows,o,r,i)}}function ht(e,t,r,n){var o=t.ellipsoid;if(c(o)){var s,l=o.interval;c(l)&&(Nt.iso8601=l,s=R.fromIso8601(Nt));var u=e.ellipsoid;c(u)||(e.ellipsoid=u=new te),We(Boolean,u,"show",o.show,s,n,r),We(i,u,"radii",o.radii,s,n,r),We(Boolean,u,"fill",o.fill,s,n,r),Xe(u,"material",o.material,s,n,r),We(Boolean,u,"outline",o.outline,s,n,r),We(a,u,"outlineColor",o.outlineColor,s,n,r),We(Number,u,"outlineWidth",o.outlineWidth,s,n,r),We(Number,u,"stackPartitions",o.stackPartitions,s,n,r),We(Number,u,"slicePartitions",o.slicePartitions,s,n,r),We(Number,u,"subdivisions",o.subdivisions,s,n,r),We(k,u,"shadows",o.shadows,s,n,r)}}function pt(e,r,n,o){var s=r.label;if(c(s)){var l,u=s.interval;c(u)&&(Nt.iso8601=u,l=R.fromIso8601(Nt));var d=e.label;c(d)||(e.label=d=new ae),We(Boolean,d,"show",s.show,l,o,n),We(String,d,"text",s.text,l,o,n),We(String,d,"font",s.font,l,o,n),We(F,d,"style",s.style,l,o,n),We(Number,d,"scale",s.scale,l,o,n),We(Boolean,d,"showBackground",s.showBackground,l,o,n),We(a,d,"backgroundColor",s.backgroundColor,l,o,n),We(t,d,"backgroundPadding",s.backgroundPadding,l,o,n),We(t,d,"pixelOffset",s.pixelOffset,l,o,n),We(i,d,"eyeOffset",s.eyeOffset,l,o,n),We(B,d,"horizontalOrigin",s.horizontalOrigin,l,o,n),We(V,d,"verticalOrigin",s.verticalOrigin,l,o,n),We(L,d,"heightReference",s.heightReference,l,o,n),We(a,d,"fillColor",s.fillColor,l,o,n),We(a,d,"outlineColor",s.outlineColor,l,o,n),We(Number,d,"outlineWidth",s.outlineWidth,l,o,n),We(x,d,"translucencyByDistance",s.translucencyByDistance,l,o,n),We(x,d,"pixelOffsetScaleByDistance",s.pixelOffsetScaleByDistance,l,o,n)}}function ft(e,t,i,r){var n=t.model;if(c(n)){var o,s=n.interval;c(s)&&(Nt.iso8601=s,o=R.fromIso8601(Nt));var l=e.model;c(l)||(e.model=l=new se),We(Boolean,l,"show",n.show,o,r,i),We(z,l,"uri",n.gltf,o,r,i),We(Number,l,"scale",n.scale,o,r,i),We(Number,l,"minimumPixelSize",n.minimumPixelSize,o,r,i),We(Number,l,"maximumScale",n.maximumScale,o,r,i),We(Boolean,l,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,r,i),We(Boolean,l,"runAnimations",n.runAnimations,o,r,i),We(k,l,"shadows",n.shadows,o,r,i),We(L,l,"heightReference",n.heightReference,o,r,i),We(a,l,"silhouetteColor",n.silhouetteColor,o,r,i),We(Number,l,"silhouetteSize",n.silhouetteSize,o,r,i),We(a,l,"color",n.color,o,r,i),We(N,l,"colorBlendMode",n.colorBlendMode,o,r,i),We(Number,l,"colorBlendAmount",n.colorBlendAmount,o,r,i);var u=n.nodeTransformations;if(c(u))if(y(u))for(var d=0,h=u.length;d-1;u--)i[u](a,e,t,r)}Pt=void 0}function Et(e){var t,i=e._documentPacket.clock;if(!c(i)){if(!c(e._clock)){var r=e._entityCollection.computeAvailability();if(!r.start.equals(C.MINIMUM_VALUE)){var a=r.start,s=r.stop,l=w.secondsDifference(s,a),d=Math.round(l/120);return t=new $,t.startTime=w.clone(a),t.stopTime=w.clone(s),t.clockRange=n.LOOP_STOP,t.multiplier=d,t.currentTime=w.clone(a),t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(c(e._clock)?t=e._clock.clone():(t=new $,t.startTime=C.MINIMUM_VALUE.clone(),t.stopTime=C.MAXIMUM_VALUE.clone(),t.currentTime=C.MINIMUM_VALUE.clone(),t.clockRange=n.LOOP_STOP,t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),c(i.interval)){Nt.iso8601=i.interval;var h=R.fromIso8601(Nt);t.startTime=h.start,t.stopTime=h.stop}return c(i.currentTime)&&(t.currentTime=w.fromIso8601(i.currentTime)),c(i.range)&&(t.clockRange=u(n[i.range],n.LOOP_STOP)),c(i.step)&&(t.clockStep=u(o[i.step],o.SYSTEM_CLOCK_MULTIPLIER)),c(i.multiplier)&&(t.multiplier=i.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}function bt(e,t,i,r){i=u(i,u.EMPTY_OBJECT);var n=t,o=i.sourceUri;return"string"==typeof t&&(n=b(t),o=u(o,t)),J.setLoading(e,!0),U(n,function(t){return Tt(e,t,o,r)}).otherwise(function(t){return J.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),U.reject(t)})}function Tt(e,t,i,r){J.setLoading(e,!0);var n=e._entityCollection;r&&(e._version=void 0,e._documentPacket=new xt,n.removeAll()),At._processCzml(t,n,i,void 0,e);var o=Et(e),a=e._documentPacket;return c(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!c(e._name)&&c(i)&&(e._name=g(i),o=!0),J.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function xt(){this.name=void 0,this.clock=void 0}function At(e){this._name=e,this._changed=new f,this._error=new f,this._isLoading=!1,this._loading=new f,this._clock=void 0,this._documentPacket=new xt,this._version=void 0,this._entityCollection=new re(this),this._entityCluster=new ie}var Pt,Mt=new i,Dt=new I,It=new r,Rt=new R,Ot={HERMITE:v,LAGRANGE:S,LINEAR:E},Nt={iso8601:void 0};return At.load=function(e,t){return(new At).load(e,t)},d(At.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}}}),At.updaters=[at,st,lt,ut,dt,ht,pt,ft,Ze,Ke,_t,gt,vt,yt,Ct,Qe,Je,wt,$e,nt],At.prototype.process=function(e,t){return bt(this,e,t,!1)},At.prototype.load=function(e,t){return bt(this,e,t,!0)},At.processPacketData=We,At.processPositionPacketData=je,At.processMaterialPacketData=Xe,At._processCzml=function(e,t,i,r,n){if(r=c(r)?r:At.updaters,y(e))for(var o=0,a=e.length;o0){for(r(m)&&(r(this.oldPrimitive)?_.remove(m):this.oldPrimitive=m),c=0;c0)for(t=0;t0)for(t=0;t0||a>0)&&(r=this._solidBatch.update(e)&&r,r=this._translucentBatch.update(e)&&r),r},d.prototype.getBoundingSphere=function(e,t){return this._solidBatch.contains(e)?this._solidBatch.getBoundingSphere(e,t):this._translucentBatch.contains(e)?this._translucentBatch.getBoundingSphere(e,t):l.FAILED},d.prototype.removeAllPrimitives=function(){this._solidBatch.removeAllPrimitives(),this._translucentBatch.removeAllPrimitives()},d}),define("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o){this.primitives=t,this.appearanceType=i,this.materialProperty=r,this.closed=n,this.shadows=o,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=r.definitionChanged.addEventListener(u.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function c(e,t,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._closed=i,this._shadows=r}var d=new i;return u.prototype.onMaterialChanged=function(){this.invalidated=!0},u.prototype.isMaterial=function(e){var i=this.materialProperty,r=e.fillMaterialProperty;return r===i||!!t(i)&&i.equals(r)},u.prototype.add=function(e,t){var i=t.entity.id;if(this.updaters.set(i,t),this.geometry.set(i,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&l.isConstant(t.distanceDisplayConditionProperty)){var r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(e,i,n,o){"isShowing"===i&&r.showsUpdated.set(e.id,t)}))}else this.updatersWithAttributes.set(i,t);this.createPrimitive=!0},u.prototype.remove=function(e){var i=e.entity.id;if(this.createPrimitive=this.geometry.remove(i)||this.createPrimitive,this.updaters.remove(i)){this.updatersWithAttributes.remove(i);var r=this.subscriptions.get(i);t(r)&&(r(),this.subscriptions.remove(i))}return this.createPrimitive},u.prototype.update=function(e){var a,u,c=!0,h=this.primitive,p=this.primitives,f=this.geometry.values;if(this.createPrimitive){var m=f.length;if(m>0){for(t(h)&&(t(this.oldPrimitive)?p.remove(h):this.oldPrimitive=h),u=0;u=0;r--){var n=t[r];if(n.remove(e)){0===n.updaters.length&&(t.splice(r,1),n.destroy());break}}},c.prototype.update=function(e){var t,i=this._items,r=i.length;for(t=r-1;t>=0;t--){var n=i[t];if(n.invalidated){i.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;s0){for(i(m)&&(i(this.oldPrimitive)?_.remove(m):this.oldPrimitive=m),u=0;u0){for(r(_)&&(r(this.oldPrimitive)?g.remove(_):this.oldPrimitive=_),d=0;d0)for(d=!0,t=0;t0)for(d=!0,t=0;t-1;t--)i=c[t],r=i.id,n=this._updaters.get(r),n.entity===i?(p(this,n),f(this,e,n)):(l.push(i),a.push(i));for(t=l.length-1;t>-1;t--)i=l[t],r=i.id,n=this._updaters.get(r),p(this,n),n.destroy(),this._updaters.remove(r),this._subscriptions.get(r)(),this._subscriptions.remove(r);for(t=a.length-1;t>-1;t--)i=a[t],r=i.id,n=new this._type(i,this._scene),this._updaters.set(r,n),f(this,e,n),this._subscriptions.set(r,n.geometryChanged.addEventListener(m._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var d=!0,h=this._batches,_=h.length;for(t=0;t<_;t++)d=h[t].update(e)&&d;return d};var g=[],v=new t;return m.prototype.getBoundingSphere=function(e,i){for(var r=g,n=v,o=0,s=a.DONE,l=this._batches,u=l.length,c=0;c-1;r--)o=i[r],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(r=t.length-1;r>-1;r--)o=t[r],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},m}),define("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){this.entity=e,this.label=void 0,this.index=void 0}function g(t,i){i.collectionChanged.addEventListener(g.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function v(e,t,i){o(e)&&(e.label=void 0,i.removeLabel(t))}var y=1,C="30px sans-serif",w=h.FILL,S=r.WHITE,E=r.BLACK,b=1,T=!1,x=new r(.165,.165,.165,.8),A=new t(7,5),P=t.ZERO,M=i.ZERO,D=c.NONE,I=d.CENTER,R=p.CENTER,O=new i,N=new r,L=new r,B=new r,F=new t,k=new i,V=new t,z=new u,U=new u,G=new u,H=new l;return g.prototype.update=function(e){for(var t=this._items.values,i=this._cluster,r=0,n=t.length;r-1;n--)a=t[n],o(a._label)&&o(a._position)&&s.set(a.id,new _(a));for(n=r.length-1;n>-1;n--)a=r[n],o(a._label)&&o(a._position)?s.contains(a.id)||s.set(a.id,new _(a)):(v(s.get(a.id),a,l),s.remove(a.id));for(n=i.length-1;n>-1;n--)a=i[n],v(s.get(a.id),a,l),s.remove(a.id)},g}),define("ThirdParty/gltfDefaults",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/Quaternion","../Core/WebGLConstants"],function(e,t,i,r,n){"use strict";function o(e){i(e.accessors)||(e.accessors={});var r=e.accessors;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.byteStride=t(o.byteStride,0)}}function a(e){i(e.animations)||(e.animations={});var r=e.animations;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];i(o.channels)||(o.channels=[]),i(o.parameters)||(o.parameters={}),i(o.samplers)||(o.samplers={});var a=r.samplers;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];l.interpolation=t(l.interpolation,"LINEAR")}}}function s(e){i(e.asset)||(e.asset={});var r=e.asset;i(r.profile)&&"string"!=typeof r.profile||(r.profile={});var n=r.profile;r.premultipliedAlpha=t(r.premultipliedAlpha,!1),n.api=t(n.api,"WebGL"),n.version=t(n.version,"1.0.2"),i(e.version)&&(r.version=t(r.version,e.version),delete e.version),"number"==typeof r.version&&(r.version=r.version.toFixed(1).toString())}function l(e){i(e.buffers)||(e.buffers={});var r=e.buffers;for(var n in r)if(r.hasOwnProperty(n)){var o=r[n];o.type=t(o.type,"arraybuffer")}}function u(e){i(e.bufferViews)||(e.bufferViews={})}function c(e){i(e.cameras)||(e.cameras={})}function d(e){i(e.images)||(e.images={})}function h(e){i(e.extensions)||(e.extensions={});var r=e.extensions;i(r.KHR_materials_common)||(r.KHR_materials_common={});var n=r.KHR_materials_common;i(e.lights)?(n.lights=e.lights,delete e.lights):i(n.lights)||(n.lights={});var o=n.lights;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if("ambient"===s.type){i(s.ambient)||(s.ambient={});var l=s.ambient;i(l.color)||(l.color=[1,1,1])}else if("directional"===s.type){i(s.directional)||(s.directional={});var u=s.directional;i(u.color)||(u.color=[1,1,1])}else if("point"===s.type){i(s.point)||(s.point={});var c=s.point;i(c.color)||(c.color=[1,1,1]),c.constantAttenuation=t(c.constantAttenuation,1),c.linearAttenuation=t(c.linearAttenuation,0),c.quadraticAttenuation=t(c.quadraticAttenuation,0)}else if("spot"===s.type){i(s.spot)||(s.spot={});var d=s.spot;i(d.color)||(d.color=[1,1,1]),d.constantAttenuation=t(d.constantAttenuation,1),d.fallOffAngle=t(d.fallOffAngle,3.14159265),d.fallOffExponent=t(d.fallOffExponent,0),d.linearAttenuation=t(d.linearAttenuation,0),d.quadraticAttenuation=t(d.quadraticAttenuation,0)}}}function p(e){i(e.materials)||(e.materials={});var t=e.materials;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r],a=o.instanceTechnique;if(i(a)&&(o.technique=a.technique,o.values=a.values,delete o.instanceTechnique),!i(o.extensions))if(i(o.technique))i(o.values)||(o.values={});else{delete o.values,o.extensions={KHR_materials_common:{technique:"CONSTANT",transparent:!1,values:{emission:{type:n.FLOAT_VEC4,value:[.5,.5,.5,1]}}}},i(e.extensionsUsed)||(e.extensionsUsed=[]);var s=e.extensionsUsed;s.indexOf("KHR_materials_common")===-1&&s.push("KHR_materials_common")}}}function f(e){i(e.meshes)||(e.meshes={});var r=e.meshes;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i(a.primitives)||(a.primitives=[]);for(var s=a.primitives.length,l=s.length,u=0;u=0,E=_.loop===u.REPEAT||_.loop===u.MIRRORED_REPEAT,b=(S||E&&!i(_.startTime))&&(w<=1||E)&&(!i(C)||a.lessThanOrEquals(l,C));if(b){if(_._state===c.STOPPED&&(_._state=c.ANIMATING,_.start.numberOfListeners>0&&e.afterRender.push(_._raiseStartEvent)),_.loop===u.REPEAT)w-=Math.floor(w);else if(_.loop===u.MIRRORED_REPEAT){var T=Math.floor(w),x=w-T;w=T%2===1?1-x:x}_.reverse&&(w=1-w);var A=w*y*_.speedup;A=s.clamp(A,g.startTime,g.stopTime),h(g,A),_.update.numberOfListeners>0&&(_._updateEventTime=A,e.afterRender.push(_._raiseUpdateEvent)),o=!0}else S&&_._state===c.ANIMATING&&(_._state=c.STOPPED,_.stop.numberOfListeners>0&&e.afterRender.push(_._raiseStopEvent),_.removeOnStop&&f.push(_))}n=f.length;for(var P=0;P0,C=a.values,w="precision highp float;\n",S="precision highp float;\n",E=o(f,"technique",c),b=o(m,"vertexShader",d),T=o(m,"fragmentShader",h),x=o(_,"program",p),A="CONSTANT"!==g,P={modelViewMatrix:{semantic:"MODELVIEW",type:i.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:i.FLOAT_MAT4}};A&&(P.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:i.FLOAT_MAT3}),y&&(P.jointMatrix={count:v,semantic:"JOINTMATRIX",type:i.FLOAT_MAT4});var M,D=!1;for(var I in C)if(C.hasOwnProperty(I)&&"transparent"!==I&&"doubleSided"!==I){var R=s(I,C[I]);M=I.toLowerCase(),D||R!==i.SAMPLER_2D||(D=!0),P[M]={type:R}}if(t(l))for(var O in l)l.hasOwnProperty(O)&&(P[O]=l[O]);var N={};for(var L in P)if(P.hasOwnProperty(L)){var B=P[L];N["u_"+L]=L;var F=t(B.count)?"["+B.count+"]":"";B.type!==i.FLOAT_MAT3&&B.type!==i.FLOAT_MAT4||B.useInFragment?(S+="uniform "+r(B.type)+" u_"+L+F+";\n",delete B.useInFragment):w+="uniform "+r(B.type)+" u_"+L+F+";\n"}var k="";y&&(k+=" mat4 skinMat = a_weight.x * u_jointMatrix[int(a_joint.x)];\n",k+=" skinMat += a_weight.y * u_jointMatrix[int(a_joint.y)];\n",k+=" skinMat += a_weight.z * u_jointMatrix[int(a_joint.z)];\n",k+=" skinMat += a_weight.w * u_jointMatrix[int(a_joint.w)];\n");var V={a_position:"position"};P.position={semantic:"POSITION",type:i.FLOAT_VEC3},w+="attribute vec3 a_position;\n",w+="varying vec3 v_positionEC;\n",k+=y?" vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",k+=" v_positionEC = pos.xyz;\n",k+=" gl_Position = u_projectionMatrix * pos;\n",S+="varying vec3 v_positionEC;\n",A&&(V.a_normal="normal",P.normal={semantic:"NORMAL",type:i.FLOAT_VEC3},w+="attribute vec3 a_normal;\n",w+="varying vec3 v_normal;\n",k+=y?" v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",S+="varying vec3 v_normal;\n");var z;D&&(V.a_texcoord_0="texcoord_0",P.texcoord_0={semantic:"TEXCOORD_0",type:i.FLOAT_VEC2},z="v_texcoord_0",w+="attribute vec2 a_texcoord_0;\n",w+="varying vec2 "+z+";\n",k+=" "+z+" = a_texcoord_0;\n",S+="varying vec2 "+z+";\n"),y&&(V.a_joint="joint",P.joint={semantic:"JOINT",type:i.FLOAT_VEC4},V.a_weight="weight",P.weight={semantic:"WEIGHT",type:i.FLOAT_VEC4},w+="attribute vec4 a_joint;\n",w+="attribute vec4 a_weight;\n");var U=A&&("BLINN"===g||"PHONG"===g)&&t(P.specular)&&t(P.shininess),G=!1,H=!1,W="";for(var q in u)if(u.hasOwnProperty(q)){var j=u[q],Y=j.type.toLowerCase(),X=j.baseName;W+=" {\n";var Z,K,Q="u_"+X+"Color";"ambient"===Y?(H=!0,W+=" ambientLight += "+Q+";\n"):A&&(G=!0,Z="v_"+X+"Direction",K="v_"+X+"Position","point"!==Y&&(w+="varying vec3 "+Z+";\n",S+="varying vec3 "+Z+";\n",k+=" "+Z+" = mat3(u_"+X+"Transform) * vec3(0.,0.,1.);\n","directional"===Y&&(W+=" vec3 l = normalize("+Z+");\n")),"directional"!==Y?(w+="varying vec3 "+K+";\n",S+="varying vec3 "+K+";\n",k+=" "+K+" = u_"+X+"Transform[3].xyz;\n",W+=" vec3 VP = "+K+" - v_positionEC;\n",W+=" vec3 l = normalize(VP);\n",W+=" float range = length(VP);\n",W+=" float attenuation = 1.0 / (u_"+X+"Attenuation.x + ",W+="(u_"+X+"Attenuation.y * range) + ",W+="(u_"+X+"Attenuation.z * range * range));\n"):W+=" float attenuation = 1.0;\n","spot"===Y&&(W+=" float spotDot = dot(l, normalize("+Z+"));\n",W+=" if (spotDot < cos(u_"+X+"FallOff.x * 0.5))\n",W+=" {\n",W+=" attenuation = 0.0;\n", -W+=" }\n",W+=" else\n",W+=" {\n",W+=" attenuation *= max(0.0, pow(spotDot, u_"+X+"FallOff.y));\n",W+=" }\n"),W+=" diffuseLight += "+Q+"* max(dot(normal,l), 0.) * attenuation;\n",U&&("BLINN"===g?(W+=" vec3 h = normalize(l + viewDir);\n",W+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(W+=" vec3 reflectDir = reflect(-l, normal);\n",W+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),W+=" specularLight += "+Q+" * specularIntensity;\n")),W+=" }\n"}H||(W+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),G||"CONSTANT"===g||(W+=" vec3 l = normalize(czm_sunDirectionEC);\n",W+=" diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.);\n",U&&("BLINN"===g?(W+=" vec3 h = normalize(l + viewDir);\n",W+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(W+=" vec3 reflectDir = reflect(-l, normal);\n",W+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),W+=" specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")),w+="void main(void) {\n",w+=k,w+="}\n",S+="void main(void) {\n";var J=" vec3 color = vec3(0.0, 0.0, 0.0);\n";A&&(S+=" vec3 normal = normalize(v_normal);\n",a.doubleSided&&(S+=" if (gl_FrontFacing == false)\n",S+=" {\n",S+=" normal = -normal;\n",S+=" }\n"));var $;"CONSTANT"!==g?(t(P.diffuse)&&(S+=P.diffuse.type===i.SAMPLER_2D?" vec4 diffuse = texture2D(u_diffuse, "+z+");\n":" vec4 diffuse = u_diffuse;\n",S+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",J+=" color += diffuse.rgb * diffuseLight;\n"),U&&(S+=P.specular.type===i.SAMPLER_2D?" vec3 specular = texture2D(u_specular, "+z+").rgb;\n":" vec3 specular = u_specular.rgb;\n",S+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",J+=" color += specular * specularLight;\n"),$=t(P.transparency)?" gl_FragColor = vec4(color * diffuse.a, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):$=t(P.transparency)?" gl_FragColor = vec4(color, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",t(P.emission)&&(S+=P.emission.type===i.SAMPLER_2D?" vec3 emission = texture2D(u_emission, "+z+").rgb;\n":" vec3 emission = u_emission.rgb;\n",J+=" color += emission;\n"),(t(P.ambient)||"CONSTANT"!==g)&&(S+=t(P.ambient)?P.ambient.type===i.SAMPLER_2D?" vec3 ambient = texture2D(u_ambient, "+z+").rgb;\n":" vec3 ambient = u_ambient.rgb;\n":" vec3 ambient = diffuse.rgb;\n",J+=" color += ambient * ambientLight;\n"),S+=" vec3 viewDir = -normalize(v_positionEC);\n",S+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",S+=W,S+=J,S+=$,S+="}\n";var ee;ee=a.transparent?{enable:[i.DEPTH_TEST,i.BLEND],depthMask:!1,functions:{blendEquationSeparate:[i.FUNC_ADD,i.FUNC_ADD],blendFuncSeparate:[i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA]}}:a.doubleSided?{enable:[i.DEPTH_TEST]}:{enable:[i.CULL_FACE,i.DEPTH_TEST]},f[E]={attributes:V,parameters:P,program:x,states:ee,uniforms:N},m[b]={type:i.VERTEX_SHADER,uri:"",extras:{source:w}},m[T]={type:i.FRAGMENT_SHADER,uri:"",extras:{source:S}};var te=Object.keys(V);return _[x]={attributes:te,fragmentShader:T,vertexShader:b},E}function s(e,r){var n;switch(n=t(r.value)?r.value:r,e){case"ambient":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"diffuse":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"emission":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"specular":return n instanceof String||"string"==typeof n?i.SAMPLER_2D:i.FLOAT_VEC4;case"shininess":return i.FLOAT;case"transparency":return i.FLOAT;case"transparent":return i.BOOL;case"doubleSided":return i.BOOL}}function l(t){var i="";i+="technique:"+t.technique+";";for(var r=t.values,n=Object.keys(r).sort(),o=n.length,a=0;a0;){p=l.pop();var f=p._transformToRoot,m=p.meshes;if(u(m))for(var _=m.length,g=0;g<_;++g)for(var v=o[m[g]].primitives,y=v.length,C=0;C0;){var a=i.buffersToCreate.dequeue();r=n[a];var s=F.createVertexBuffer({context:t,typedArray:i.getBuffer(r),usage:k.STATIC_DRAW});s.vertexArrayDestroyable=!1,o[a]=s}var l=e.gltf.accessors;for(var c in l)if(l.hasOwnProperty(c)){var d=l[c];if(r=n[d.bufferView],r.target===B.ELEMENT_ARRAY_BUFFER&&!u(o[d.bufferView])){var h=F.createIndexBuffer({context:t,typedArray:i.getBuffer(r),usage:k.STATIC_DRAW,indexDatatype:d.componentType});h.vertexArrayDestroyable=!1,o[d.bufferView]=h}}}}function ze(e,t){var i,r={},n=t.length;for(i=1;i2?"vec"+(y-1):"float",e=C+" "+v+";\n"+e;var w="";5===y?(e="uniform mat4 "+d+";\n"+e,e="uniform vec4 "+h+";\n"+e,w="\nvoid main() {\n "+v+" = "+d+" * "+m+" + "+h+";\n "+g+"();\n}\n",n[d]={mat:4},n[h]={vec:4}):(e="uniform mat"+y+" "+c+";\n"+e,w="\nvoid main() {\n "+v+" = "+C+"("+c+" * vec"+y+"("+m+",1.0));\n "+g+"();\n}\n",n[c]={mat:y}),e=W.replaceMain(e,g),e+=w}}}}return i._programPrimitives[t]=void 0,e}function Ye(e){var t=e.gltf;return!!u(t.asset)&&l(t.asset.premultipliedAlpha,!1)}function Xe(e,t){return e=W.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n gltf_blend_main(); \n",t&&(e+=" float alpha = 1.0 - ceil(gl_FragColor.a) + gl_FragColor.a; \n gl_FragColor.rgb /= alpha; \n"),e+=" 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 Ze(e,t,i){return u(i)&&(e=i(e,t)),e}function Ke(e,t,i){var r=t.gltf.programs,n=t._loadResources.shaders,o=r[e],a=ze(t,o.attributes),s=Ue(t,n[o.vertexShader]),l=Ue(t,n[o.fragmentShader]),c=o.attributes.length,d=t._precreatedAttributes;if(u(d))for(var h in d)d.hasOwnProperty(h)&&(a[h]=c++);ke(t,"WEB3D_quantized_attributes")&&(s=je(s,e,t,i));var p=Ye(t),f=Xe(l,p),m=Ze(s,e,t._vertexShaderLoaded),_=Ze(f,e,t._fragmentShaderLoaded);if(t._rendererResources.programs[e]=H.fromCache({context:i,vertexShaderSource:m,fragmentShaderSource:_,attributeLocations:a}),t.allowPicking){var g=Ze(s,e,t._pickVertexShaderLoaded),v=Ze(l,e,t._pickFragmentShaderLoaded);t._pickFragmentShaderLoaded||(v=W.createPickFragmentShaderSource(l,"uniform")),t._rendererResources.pickPrograms[e]=H.fromCache({context:i,vertexShaderSource:g,fragmentShaderSource:v,attributeLocations:a})}}function Qe(e,t){var i,r=e._loadResources;if(0===r.pendingShaderLoads&&0===r.pendingBufferLoads)if(e.asynchronous)r.programsToCreate.length>0&&(i=r.programsToCreate.dequeue(),Ke(i,e,t));else for(;r.programsToCreate.length>0;)i=r.programsToCreate.dequeue(),Ke(i,e,t)}function Je(e,t){return function(i){e.texturesToCreate.enqueue({id:t.id,image:i,bufferView:void 0}),--e.pendingBufferViewToImage}}function $e(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){var i=t.texturesToCreateFromBufferView.dequeue(),r=e.gltf,n=r.bufferViews[i.bufferView],o=be(e,"image","id: "+i.id+", bufferView: "+i.bufferView);if("image/ktx"===i.mimeType)b(t.getBuffer(n)).then(Ie(e,i.id)).otherwise(o),++e._loadResources.pendingTextureLoads;else if("image/crn"===i.mimeType)w(t.getBuffer(n)).then(Ie(e,i.id)).otherwise(o),++e._loadResources.pendingTextureLoads;else{var a=Je(t,i);E(t.getBuffer(n),i.mimeType).then(a).otherwise(o),++t.pendingBufferViewToImage}}}function et(e,t){var i=e._loadResources;if(i.createSamplers){i.createSamplers=!1;var r=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];r[o]=new G({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function tt(e,t,i){var r,n=t.gltf.textures,o=n[e.id],a=t._rendererResources.samplers,s=a[o.sampler],l=e.internalFormat,c=!(u(l)&&D.isCompressedFormat(l)||s.minificationFilter!==j.NEAREST_MIPMAP_NEAREST&&s.minificationFilter!==j.NEAREST_MIPMAP_LINEAR&&s.minificationFilter!==j.LINEAR_MIPMAP_NEAREST&&s.minificationFilter!==j.LINEAR_MIPMAP_LINEAR),d=c||s.wrapS===Y.REPEAT||s.wrapS===Y.MIRRORED_REPEAT||s.wrapT===Y.REPEAT||s.wrapT===Y.MIRRORED_REPEAT,h=e.image;if(u(l)&&o.target===B.TEXTURE_2D)r=new q({context:i,source:{arrayBufferView:e.bufferView},width:e.width,height:e.height,pixelFormat:l,sampler:s});else if(u(h)){var p=!x.isPowerOfTwo(h.width)||!x.isPowerOfTwo(h.height);if(d&&p){var f=document.createElement("canvas");f.width=x.nextPowerOfTwo(h.width),f.height=x.nextPowerOfTwo(h.height);var m=f.getContext("2d");m.drawImage(h,0,0,h.width,h.height,0,0,f.width,f.height),h=f}o.target===B.TEXTURE_2D&&(r=new q({context:i,source:h,pixelFormat:o.internalFormat,pixelDatatype:o.type,sampler:s,flipY:!1})),c&&r.generateMipmap()}t._rendererResources.textures[e.id]=r}function it(e,t){var i,r=e._loadResources;if(e.asynchronous)r.texturesToCreate.length>0&&(i=r.texturesToCreate.dequeue(),tt(i,e,t));else for(;r.texturesToCreate.length>0;)i=r.texturesToCreate.dequeue(),tt(i,e,t)}function rt(e,t){var i=e.gltf,r=i.techniques,n=i.materials,o={},a=r[n[t.material].technique],s=a.parameters,l=a.attributes,c=e._rendererResources.programs[a.program].vertexAttributes;for(var d in c)if(c.hasOwnProperty(d)){var h=l[d],p=c[d].index;if(u(h)){var f=s[h];o[f.semantic]=p}else o[d]=p}return o}function nt(e,t,i){for(var r=e.length,n=0;n0;){var a=o.pop(),s=i[a];if(s.jointName===t)return a;for(var l=s.children,u=l.length,c=0;c0;){var m=p.pop(),_=m.parentRuntimeNode,g=m.gltfNode,v=a[m.id];if(0===v.parents.length)if(u(g.matrix))v.matrix=M.fromColumnMajorArray(g.matrix);else{var y=g.rotation;v.translation=i.fromArray(g.translation),v.rotation=R.unpack(y),v.scale=i.fromArray(g.scale)}u(_)?(_.children.push(v),v.parents.push(_)):o.push(v),u(g.meshes)&&Ot(e,g,v,t,r);for(var C=g.children,w=C.length,S=0;S0;){v=h.pop();var y=v.transformToRoot,C=v.commands;if(v.dirtyNumber===s||n||o){var w=M.multiplyTransformation(p,y,v.computedMatrix),S=C.length;if(S>0)for(var E=0;E0;){o=r.pop();for(var a=o.computedShow,s=o.commands,l=s.length,u=0;u0&&r<1){var n=e._nodeCommands,o=n.length;if(!u(n[0].translucentCommand))for(var a=0;a0&&e.silhouetteColor.alpha>0&&u(e._normalAttributeName)}function Kt(e){for(var t=e._nodeCommands,i=t.length,r=0;r0&&e.color.alpha<1}function Jt(e){return 0===e.color.alpha}function $t(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}function ei(e,t){for(var i=++Ri%255,r=Kt(e)||Qt(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,a=t.scene3DOnly,l=e._nodeCommands,c=l.length,d=0;d=o&&r<=a}if(!f.supportsTypedArrays())return{};var hi=new i,pi={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},fi="model/vnd.gltf.binary,model/vnd.gltf+json,model/gltf.binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01";he.prototype.getBuffer=function(e){return ve(this.buffers[e.buffer],e.byteOffset,e.byteLength)},he.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},he.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.buffersToCreate.length},he.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},he.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},he.prototype.finishedEverythingButTextureCreation=function(){var e=0===this.pendingBufferLoads&&0===this.pendingShaderLoads,t=0===this.buffersToCreate.length&&0===this.programsToCreate.length&&0===this.pendingBufferViewToImage;return e&&t},he.prototype.finished=function(){return this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},c(fe.prototype,{gltf:{set:function(e){this._gltf=se(Z(e))},get:function(){return this._gltf}},bgltf:{get:function(){return this._bgltf}}}),fe.prototype.makeReady=function(e,t){this.gltf=e,this._bgltf=t;for(var i=this.modelsToLoad,r=i.length,n=0;nz||L.center.y-L.radiusz||L.center.y-L.radiusz||L.center.y-L.radius-1;r--)m(this,e[r],t,i);return n(this)},f.prototype.getBoundingSphere=function(e,i){var n=this._modelHash[e.id];if(!r(n))return h.FAILED;var o=n.modelPrimitive;if(!r(o)||!o.show)return h.FAILED;if(!o.ready)return h.PENDING;if(o.heightReference===l.NONE)t.transform(o.boundingSphere,o.modelMatrix,i);else{if(!r(o._clampedModelMatrix))return h.PENDING;t.transform(o.boundingSphere,o._clampedModelMatrix,i)}return h.DONE},f.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],r(a._model)&&r(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],r(a._model)&&r(a._position)?(_(a,l),s.set(a.id,a)):(m(this,a,l,u),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],m(this,a,l,u),s.remove(a.id)},f}),define("Shaders/PolylineCommon",[],function(){"use strict";return"void clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance = -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(previous.xyz - position.xyz, vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(next.xyz - position.xyz, vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_resolutionScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"}),define("Shaders/PolylineFS",[],function(){"use strict";return"varying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"; -}),define("Shaders/PolylineVS",[],function(){"use strict";return"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 czm_pickColor;\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}\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);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),define("Scene/Polyline",["../Core/arrayRemoveDuplicates","../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(a,s){a=n(a,n.EMPTY_OBJECT),this._show=n(a.show,!0),this._width=n(a.width,1),this._loop=n(a.loop,!1),this._distanceDisplayCondition=a.distanceDisplayCondition,this._material=a.material,o(this._material)||(this._material=d.fromType(d.ColorType,{color:new r(1,1,1,1)}));var l=a.positions;o(l)||(l=[]),this._positions=l,this._actualPositions=e(l,i.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=l.slice()),this._actualPositions.push(i.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=a.id;var h;o(s)&&(h=u.clone(s.modelMatrix)),this._modelMatrix=h,this._segments=c.wrapLongitude(this._actualPositions,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(C),this._polylineCollection=s,this._dirty=!1,this._pickId=void 0,this._boundingVolume=t.fromPoints(this._actualPositions),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new t}function p(e,t){++e._propertiesChanged[t];var i=e._polylineCollection;o(i)&&(i._updatePolyline(e,t),e._dirty=!0)}var f=h.POSITION_INDEX=0,m=h.SHOW_INDEX=1,_=h.WIDTH_INDEX=2,g=h.MATERIAL_INDEX=3,v=h.POSITION_SIZE_INDEX=4,y=h.DISTANCE_DISPLAY_CONDITION=5,C=h.NUMBER_OF_PROPERTIES=6;return a(h.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,p(this,m))}},positions:{get:function(){return this._positions},set:function(r){var n=e(r,i.equalsEpsilon);this._loop&&n.length>2&&(n===r&&(n=r.slice()),n.push(i.clone(n[0]))),this._actualPositions.length===n.length&&this._actualPositions.length===this._length||p(this,v),this._positions=r,this._actualPositions=n,this._length=n.length,this._boundingVolume=t.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),p(this,f),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,p(this,g))}},width:{get:function(){return this._width},set:function(e){var t=this._width;e!==t&&(this._width=e,p(this,_))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var t=this._actualPositions;e?t.length>2&&!i.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(i.clone(t[0]))):t.length>2&&i.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,p(this,v)}}},id:{get:function(){return this._id},set:function(e){this._id=e,o(this._pickId)&&(this._pickId.object.id=e)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){l.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition),p(this,y))}}}),h.prototype.update=function(){var e=u.IDENTITY;o(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var i=this._segments.positions.length,r=this._segments.lengths,n=this._propertiesChanged[f]>0||this._propertiesChanged[v]>0;if(u.equals(e,this._modelMatrix)&&!n||(this._segments=c.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=t.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=e,this._segments.positions.length!==i)p(this,v);else for(var a=r.length,s=0;s0){var F=T.isTranslucent();c>=u?(x=new S({owner:t}),r.push(x)):x=r[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=M,x.vertexArray=v.va,x.renderState=F?t._translucentRS:t._opaqueRS,x.pass=F?E.TRANSLUCENT:E.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=m(T._uniforms),x.count=R,x.offset=P,P+=R,R=0,d=!0,s.push(x)}T=N._material,T.update(a),b=B}for(var k=N._locatorBuckets,V=k.length,z=0;z0&&(c>=u?(x=new S({owner:t}),r.push(x)):x=r[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=M,x.vertexArray=v.va,x.renderState=T.isTranslucent()?t._translucentRS:t._opaqueRS,x.pass=T.isTranslucent()?E.TRANSLUCENT:E.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=m(T._uniforms),x.count=R,x.offset=P,d=!0,s.push(x)),b=void 0}r.length=c}function V(e){var t=!1,i=e._propertiesChanged,r=e._positionBufferUsage;return i[$]?r.bufferUsage!==C.STREAM_DRAW?(t=!0,r.bufferUsage=C.STREAM_DRAW,r.frameCount=100):r.frameCount=100:r.bufferUsage!==C.STATIC_DRAW&&(0===r.frameCount?(t=!0,r.bufferUsage=C.STATIC_DRAW):r.frameCount--),t}function z(e,t,i){e._createVertexArray=!1,q(e),j(e),G(e);var r,n,o=[[]],s=o[0],u=e._batchTable,c=[0],d=0,h=[[]],f=0,_=e._polylineBuckets;for(r in _)_.hasOwnProperty(r)&&(n=_[r],n.updateShader(t,u),f+=n.lengthOfPositions);if(f>0){var g,v=e._mode,w=new Float32Array(6*f*3),S=new Float32Array(4*f),E=0,b=0,T=0;for(r in _)if(_.hasOwnProperty(r)){n=_[r],n.write(w,S,E,b,T,u,t,i),v===L.MORPHING&&(l(g)||(g=new Float32Array(6*f*3)),n.writeForMorph(g,E));var x=n.lengthOfPositions;E+=6*x*3,b+=4*x,T+=4*x,d=n.updateIndices(o,c,h,d)}var P=e._positionBufferUsage.bufferUsage,M=C.STATIC_DRAW;e._positionBuffer=y.createVertexBuffer({context:t,typedArray:w,usage:P});var D;l(g)&&(D=y.createVertexBuffer({context:t,typedArray:g,usage:P})),e._texCoordExpandAndBatchIndexBuffer=y.createVertexBuffer({context:t,typedArray:S,usage:M});for(var I=3*Float32Array.BYTES_PER_ELEMENT,R=4*Float32Array.BYTES_PER_ELEMENT,O=0,N=o.length,B=0;B0){var F=new Uint16Array(s),k=y.createIndexBuffer({context:t,typedArray:F,usage:C.STATIC_DRAW,indexDatatype:p.UNSIGNED_SHORT});O+=c[B];var V,z,U,H,W=6*(B*(I*m.SIXTY_FOUR_KILOBYTES)-O*I),Y=I+W,X=I+Y,Z=I+X,K=I+Z,Q=I+K,J=B*(R*m.SIXTY_FOUR_KILOBYTES)-O*R,$=[{index:ne.position3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:W,strideInBytes:6*I},{index:ne.position3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*I},{index:ne.position2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:W,strideInBytes:6*I},{index:ne.position2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*I},{index:ne.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*I},{index:ne.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*I},{index:ne.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*I},{index:ne.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*I},{index:ne.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*I},{index:ne.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*I},{index:ne.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*I},{index:ne.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*I},{index:ne.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:a.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:J}];v===L.SCENE3D?(V=e._positionBuffer,z="vertexBuffer",U=ce,H="value"):v===L.SCENE2D||v===L.COLUMBUS_VIEW?(V=ce,z="value",U=e._positionBuffer,H="vertexBuffer"):(V=D,z="vertexBuffer",U=e._positionBuffer,H="vertexBuffer"),$[0][z]=V,$[1][z]=V,$[2][H]=U,$[3][H]=U,$[4][z]=V,$[5][z]=V,$[6][H]=U,$[7][H]=U,$[8][z]=V,$[9][z]=V,$[10][H]=U,$[11][H]=U;var ee=new A({context:t,attributes:$,indexBuffer:k});e._vertexArrays.push({va:ee,buckets:h[B]})}}}function U(e){var t=O._uniformList[e.type],i=t.length;de.length=2*i;for(var r=0,n=0;n1){s.update();var u=s.material,c=r[u.type];l(c)||(c=r[u.type]=new Z(u,t,i)),c.addPolyline(s)}}}function H(e,t){var i=t.mode;e._mode===i&&_.equals(e._modelMatrix,e.modelMatrix)||(e._mode=i,e._modelMatrix=_.clone(e.modelMatrix),e._createVertexArray=!0)}function W(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],i=e._polylines.length,r=0,n=0;r2){if(a[$]||a[te]){var C=e.mode===L.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,S=h.fromCartesian(C.center,oe),E=r.fromElements(S.low.x,S.low.y,S.low.z,C.radius,ae);this._batchTable.setBatchedAttribute(i._index,2,S.high),this._batchTable.setBatchedAttribute(i._index,3,E)}if(a[ie]){var T=se;T.x=0,T.y=Number.MAX_VALUE;var x=i.distanceDisplayCondition;l(x)&&(T.x=x.near,T.x=x.far),this._batchTable.setBatchedAttribute(i._index,4,T)}}i._clean()}s.length=0,this._polylinesUpdated=!1}a=this._propertiesChanged;for(var A=0;A0,E=C._index,b=this.getSegments(C,d),T=b.positions,x=b.lengths,A=T.length,P=C.getPickId(c).color,M=0,D=0,I=0;I0||he.x>0&&pe.x<0)&&i.clone(he,pe),(he.x<0&&fe.x>0||he.x>0&&fe.x<0)&&i.clone(he,fe));for(var B=O?2:0,F=N?2:4,k=B;k2&&(u.setBatchedAttribute(E,2,W),u.setBatchedAttribute(E,3,q),u.setBatchedAttribute(E,4,j))}};var ve=new i,ye=new i,Ce=new i,we=new i;Z.prototype.writeForMorph=function(e,t){for(var r=this.modelMatrix,n=this.polylines,o=n.length,a=0;a0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,d=0;d0))continue;p[0]=f}else p=h._segments.lengths;var _=p.length;if(_>0){for(var g=0,v=0;v<_;++v)for(var y=p[v]-1,C=0;C=m.SIXTY_FOUR_KILOBYTES-2&&(h._locatorBuckets.push({locator:o,count:g}),g=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,r=0,o=new X(0,0,this),i[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),g+=6,a+=6,r+=6,l+=4;h._locatorBuckets.push({locator:o,count:g}),l+4>=m.SIXTY_FOUR_KILOBYTES-2&&(t.push(0),s=[],e.push(s),l=0,o.count=a,r=0,a=0,o=new X(0,0,this),i[++n]=[o])}h._clean()}return o.count=a,r},Z.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,i=0,r=t.length,n=0;n0){t._boundingVolume2D=e.fromPoints(s,t._boundingVolume2D);var h=t._boundingVolume2D.center;t._boundingVolume2D.center=new i(h.z,h.x,h.y)}return Ee.positions=s,Ee.lengths=t._segments.lengths,Ee};var Ae;return Z.prototype.writeUpdate=function(e,t,r,n){var o=this.mode,a=n.ellipsoid.maximumRadius*m.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);var u=Ae,c=6*s*3;!l(u)||u.lengthc&&(u=new Float32Array(u.buffer,0,c));var d,p=this.getSegments(t,n),f=p.positions,_=p.lengths,g=0,v=0,y=0;s=f.length;for(var C=0;C0||he.x>0&&pe.x<0)&&i.clone(he,pe),(he.x<0&&fe.x>0||he.x>0&&fe.x<0)&&i.clone(he,fe));for(var b=S?2:0,T=E?2:4,x=b;x0&&!w){var S=n[g+1],E=o.secondsDifference(S,y);w=E>l,w&&(p=Math.ceil(E/l),f=0,m=E/Math.max(p,2),p=Math.max(p-1,1))}if(w&&f0){var b=S.pop();c=this._polylineCollection.get(b),t.index=b}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var T=_.getValueOrDefault(s._resolution,e,I);c.show=!0,c.positions=P(l,r,n,e,this._referenceFrame,T,c.positions.slice()),c.material=m.getValue(e,s._material,c.material),c.width=_.getValueOrDefault(s._width,e,R),c.distanceDisplayCondition=_.getValueOrUndefined(s._distanceDisplayCondition,e,c.distanceDisplayCondition)},M.prototype.removeObject=function(e){var t=e.polyline;i(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},M.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection), -r(this)},D.prototype.update=function(e){var t=this._updaters;for(var r in t)t.hasOwnProperty(r)&&t[r].update(e);for(var n=this._items.values,o=0,a=n.length;o-1;o--)a=t[o],i(a._path)&&i(a._position)&&l.set(a.id,new w(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._path)&&i(a._position)?l.contains(a.id)||l.set(a.id,new w(a)):(s=l.get(a.id),i(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=r.length-1;o>-1;o--)a=r[o],s=l.get(a.id),i(s)&&(i(s.updater)&&s.updater.removeObject(s),l.remove(a.id))},D._subSample=P,D}),define("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","./BoundingSphereState","./Property"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(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 h(t,i){i.collectionChanged.addEventListener(h.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=i,this._items=new e,this._onCollectionChanged(i,i.values,[],[])}function p(e,t,i){if(r(e)){var n=e.pointPrimitive;if(r(n))return e.pointPrimitive=void 0,void i.removePoint(t);var o=e.billboard;r(o)&&(e.billboard=void 0,i.removeBillboard(t))}}function f(e,t,i,r,n){return function(o){var a=document.createElement("canvas"),s=n+2*r;a.height=a.width=s;var l=a.getContext("2d");return l.clearRect(0,0,s,s),0!==r&&(l.beginPath(),l.arc(s/2,s/2,s/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=i,l.fill(),e<1&&(l.save(),l.globalCompositeOperation="destination-out",l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle="black",l.fill(),l.restore())),l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=t,l.fill(),a}}var m=i.WHITE,_=i.BLACK,g=0,v=1,y=new i,C=new t,w=new i,S=new s,E=new s,b=new a;return h.prototype.update=function(e){for(var t=this._items.values,n=this._cluster,o=0,a=t.length;o0?(T.scale=1,P=P||I!==s.outlineWidth||R!==s.pixelSize||!i.equals(M,s.color)||!i.equals(D,s.outlineColor)):(T.scale=R/50,R=50,P=P||I!==s.outlineWidth||!i.equals(M,s.color)||!i.equals(D,s.outlineColor)),P){s.color=i.clone(M,s.color),s.outlineColor=i.clone(D,s.outlineColor),s.pixelSize=R,s.outlineWidth=I;var O=M.alpha,N=M.toCssColorString(),L=D.toCssColorString(),B=JSON.stringify([N,R,L,I]);T.setImage(B,f(O,N,L,I,R))}}}else p(s,u,n)}return!0},h.prototype.getBoundingSphere=function(e,i){var n=this._items.get(e.id);if(!r(n)||!r(n.pointPrimitive)&&!r(n.billboard))return u.FAILED;if(r(n.pointPrimitive))i.center=t.clone(n.pointPrimitive.position,i.center);else{var o=n.billboard;if(!r(o._clampedPosition))return u.PENDING;i.center=t.clone(o._clampedPosition,i.center)}return i.radius=0,u.DONE},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(h.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t-1;o--)a=t[o],r(a._point)&&r(a._position)&&s.set(a.id,new d(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._point)&&r(a._position)?s.contains(a.id)||s.set(a.id,new d(a)):(p(s.get(a.id),a,l),s.remove(a.id));for(o=i.length-1;o>-1;o--)a=i[o],p(s.get(a.id),a,l),s.remove(a.id)},h}),define("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/oneTimeWarning","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(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}function M(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(M.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new P(e),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function D(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new P(i._entity)}var I=new E(e.WHITE),R=new b(!0),O=new b(!0),N=new b(!1),L=new b(e.BLACK),B=new b(S.DISABLED),F=new b(new s),k=new e;return n(M,{perInstanceColorAppearanceType:{value:C},materialAppearanceType:{value:y}}),n(M.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&A.isConstant(this._showProperty)&&A.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&A.isConstant(this._showProperty)&&A.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),M.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},M.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},M.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new g(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=this._distanceDisplayConditionProperty.getValue(i),h=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof E){var p=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(p=this._materialProperty.color.getValue(i)),o=t.fromColor(p),n={show:u,distanceDisplayCondition:h,color:o}}else n={show:u,distanceDisplayCondition:h};return new c({id:a,geometry:new f(this._options),attributes:n})},M.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=A.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new _(this._options),attributes:{show:new g(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){this._entitySubscription(),o(this)},M.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polygon"===t){var a=this._entity.polygon;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.perPositionHeight,c=r(u)&&(!u.isConstant||u.getValue(h.MINIMUM_VALUE)),f=a.outline,_=r(f);if(_&&f.isConstant&&(_=f.getValue(h.MINIMUM_VALUE)),!l&&!_)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=a.hierarchy,w=a.show;if(r(w)&&w.isConstant&&!w.getValue(h.MINIMUM_VALUE)||!r(g))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var S=i(a.material,I),b=S instanceof E;this._materialProperty=S,this._fillProperty=i(s,O),this._showProperty=i(w,R),this._showOutlineProperty=i(a.outline,N),this._outlineColorProperty=_?i(a.outlineColor,L):void 0,this._shadowsProperty=i(a.shadows,B),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,F);var T=a.height,x=a.extrudedHeight,P=a.granularity,M=a.stRotation,D=a.outlineWidth,k=l&&!r(T)&&!r(x)&&b&&!c&&v.isSupported(this._scene);_&&k&&(p(p.geometryOutlines),_=!1);var V=a.perPositionHeight,z=a.closeTop,U=a.closeBottom;if(this._fillEnabled=l,this._onTerrain=k,this._outlineEnabled=_,g.isConstant&&A.isConstant(T)&&A.isConstant(x)&&A.isConstant(P)&&A.isConstant(M)&&A.isConstant(D)&&A.isConstant(u)&&A.isConstant(V)&&A.isConstant(z)&&A.isConstant(U)&&(!k||A.isConstant(S))){var G=this._options;G.vertexFormat=b?C.VERTEX_FORMAT:y.MaterialSupport.TEXTURED.vertexFormat;var H=g.getValue(h.MINIMUM_VALUE);d(H)&&(H=new m(H));var W=A.getValueOrUndefined(T,h.MINIMUM_VALUE),q=A.getValueOrDefault(z,h.MINIMUM_VALUE,!0),j=A.getValueOrDefault(U,h.MINIMUM_VALUE,!0),Y=A.getValueOrUndefined(x,h.MINIMUM_VALUE);G.polygonHierarchy=H,G.height=W,G.extrudedHeight=Y,G.granularity=A.getValueOrUndefined(P,h.MINIMUM_VALUE),G.stRotation=A.getValueOrUndefined(M,h.MINIMUM_VALUE),G.perPositionHeight=A.getValueOrUndefined(V,h.MINIMUM_VALUE),G.closeTop=q,G.closeBottom=j,this._outlineWidth=A.getValueOrDefault(D,h.MINIMUM_VALUE,1),this._isClosed=r(Y)&&Y!==W&&q&&j,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},M.prototype.createDynamicUpdater=function(e,t){return new D(e,t,this)},D.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.polygon;if(l.isShowing&&l.isAvailable(i)&&A.getValueOrDefault(u.show,i,!0)){var h=this._options,p=A.getValueOrUndefined(u.hierarchy,i);if(r(p)){d(p)?h.polygonHierarchy=new m(p):h.polygonHierarchy=p;var g=A.getValueOrDefault(u.closeTop,i,!0),S=A.getValueOrDefault(u.closeBottom,i,!0);h.height=A.getValueOrUndefined(u.height,i),h.extrudedHeight=A.getValueOrUndefined(u.extrudedHeight,i),h.granularity=A.getValueOrUndefined(u.granularity,i),h.stRotation=A.getValueOrUndefined(u.stRotation,i),h.perPositionHeight=A.getValueOrUndefined(u.perPositionHeight,i),h.closeTop=g,h.closeBottom=S;var E=this._geometryUpdater.shadowsProperty.getValue(i);if(A.getValueOrDefault(u.fill,i,!0)){var b=n.fillMaterialProperty,T=x.getValue(i,b,this._material);if(this._material=T,o){var P=e.WHITE;r(b.color)&&(P=b.color.getValue(i)),this._primitive=s.add(new v({geometryInstances:new c({id:l,geometry:new f(h),attributes:{color:t.fromColor(P)}}),asynchronous:!1,shadows:E}))}else{var M=new y({material:T,translucent:T.isTranslucent(),closed:r(h.extrudedHeight)&&h.extrudedHeight!==h.height&&g&&S});h.vertexFormat=M.vertexFormat,this._primitive=a.add(new w({geometryInstances:new c({id:l,geometry:new f(h)}),appearance:M,asynchronous:!1,shadows:E}))}}if(!o&&A.getValueOrDefault(u.outline,i,!1)){h.vertexFormat=C.VERTEX_FORMAT;var D=A.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,k),I=A.getValueOrDefault(u.outlineWidth,i,1),R=1!==D.alpha;this._outlinePrimitive=a.add(new w({geometryInstances:new c({id:l,geometry:new _(h),attributes:{color:t.fromColor(D)}}),appearance:new C({flat:!0,translucent:R,renderState:{lineWidth:n._scene.clampLineWidth(I)}}),asynchronous:!1,shadows:E}))}}}},D.prototype.getBoundingSphere=function(e,t){return T(e,this._primitive,this._outlinePrimitive,t)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},M}),define("Shaders/Appearances/PolylineColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_color = color;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),define("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,i,r,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var i=e(t.translucent,!0),r=!1,n=s.VERTEX_FORMAT;this.material=void 0,this.translucent=i,this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=a.getDefaultRenderState(i,r,t.renderState),this._closed=r,this._vertexFormat=n}var l=o+"\n"+n,u=r;return t(s.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}}}),s.VERTEX_FORMAT=i.POSITION_ONLY,s.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,s.prototype.isTranslucent=a.prototype.isTranslucent,s.prototype.getRenderState=a.prototype.getRenderState,s}),define("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\nvarying float v_width;\nvarying vec2 v_st;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),define("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),n=!1,o=u.VERTEX_FORMAT;this.material=t(i.material)?i.material:l.fromType(l.ColorType),this.translucent=r,this._vertexShaderSource=e(i.vertexShaderSource,c),this._fragmentShaderSource=e(i.fragmentShaderSource,d),this._renderState=s.getDefaultRenderState(r,n,i.renderState),this._closed=n,this._vertexFormat=o}var c=o+"\n"+n,d=a;return i(u.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}}}),u.VERTEX_FORMAT=r.POSITION_AND_ST,u.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,u.prototype.isTranslucent=s.prototype.isTranslucent,u.prototype.getRenderState=s.prototype.getRenderState,u}),define("DataSources/PolylineGeometryUpdater",["../Core/BoundingSphere","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineCollection","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b){"use strict";function T(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.followSurface=void 0,this.granularity=void 0}function x(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new T(e),this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function A(e,t){var i=t._scene.id,r=P[i];!n(r)||r.isDestroyed()?(r=new _,P[i]=r,e.add(r)):e.contains(r)||e.add(r);var o=r.add();o.id=t._entity,this._line=o,this._primitives=e,this._geometryUpdater=t,this._positions=[],O.ellipsoid=t._scene.globe.ellipsoid}var P={},M=new w(t.WHITE),D=new S(!0),I=new S(y.DISABLED),R=new S(new l);o(x,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:v}}),o(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&b.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){return!1},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(e){var r,o,a=this._entity,s=a.isAvailable(e),l=new m(s&&a.isShowing&&this._showProperty.getValue(e)),c=this._distanceDisplayConditionProperty.getValue(e),h=u.fromDistanceDisplayCondition(c);if(this._materialProperty instanceof w){var f=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(e)),r=i.fromColor(f),o={show:l,distanceDisplayCondition:h,color:r}}else o={show:l,distanceDisplayCondition:h};return new d({id:a,geometry:new p(this._options),attributes:o})},x.prototype.createOutlineGeometryInstance=function(e){},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),a(this)},x.prototype._onEntityPropertyChanged=function(e,t,i,o){if("availability"===t||"polyline"===t){var a=this._entity.polyline;if(!n(a))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.positions,l=a.show;if(n(l)&&l.isConstant&&!l.getValue(h.MINIMUM_VALUE)||!n(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=r(a.material,M),c=u instanceof w;this._materialProperty=u,this._showProperty=r(l,D),this._shadowsProperty=r(a.shadows,I),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,R),this._fillEnabled=!0;var d=a.width,p=a.followSurface,f=a.granularity;if(s.isConstant&&b.isConstant(d)&&b.isConstant(p)&&b.isConstant(f)){var m=this._options,_=s.getValue(h.MINIMUM_VALUE,m.positions);if(!n(_)||_.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));m.vertexFormat=c?g.VERTEX_FORMAT:v.VERTEX_FORMAT,m.positions=_,m.width=n(d)?d.getValue(h.MINIMUM_VALUE):void 0,m.followSurface=n(p)?p.getValue(h.MINIMUM_VALUE):void 0,m.granularity=n(f)?f.getValue(h.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new A(e,this)};var O={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return A.prototype.update=function(e){var t=this._geometryUpdater,i=t._entity,r=i.polyline,o=this._line;if(!i.isShowing||!i.isAvailable(e)||!b.getValueOrDefault(r._show,e,!0))return void(o.show=!1);var a=r.positions,s=b.getValueOrUndefined(a,e,this._positions);if(!n(s)||s.length<2)return void(o.show=!1);var l=b.getValueOrDefault(r._followSurface,e,!0);l&&(O.positions=s,O.granularity=b.getValueOrUndefined(r._granularity,e),O.height=f.extractHeights(s,this._geometryUpdater._scene.globe.ellipsoid),s=f.generateCartesianArc(O)),o.show=!0,o.positions=s.slice(),o.material=E.getValue(e,t.fillMaterialProperty,o.material),o.width=b.getValueOrDefault(r._width,e,1),o.distanceDisplayCondition=b.getValueOrUndefined(r._distanceDisplayCondition,e,o.distanceDisplayCondition)},A.prototype.getBoundingSphere=function(t,i){var r=this._line;return r.show&&r.positions.length>0?(e.fromPoints(r.positions,i),C.DONE):C.FAILED},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,i=P[t];i.remove(this._line),0===i.length&&(this._primitives.removeAndDestroy(i),delete P[t]),a(this)},x}),define("DataSources/PolylineVolumeGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E){"use strict";function b(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 T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),M=new C(!0),D=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:m}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new f(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=this._distanceDisplayConditionProperty.getValue(i),p=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var m=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(i)),o=t.fromColor(m),n={show:u,distanceDisplayCondition:p,color:o}}else n={show:u,distanceDisplayCondition:p};return new c({id:a,geometry:new h(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new p(this._options),attributes:{show:new f(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polylineVolume"===t){var a=this._entity.polylineVolume;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=a.positions,p=a.shape,f=a.show;if(!r(h)||!r(p)||r(f)&&f.isConstant&&!f.getValue(d.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var g=i(a.material,A),v=g instanceof y;this._materialProperty=g,this._fillProperty=i(s,M),this._showProperty=i(f,P),this._showOutlineProperty=i(a.outline,D),this._outlineColorProperty=c?i(a.outlineColor,I):void 0,this._shadowsProperty=i(a.shadows,R),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O);var C=a.granularity,w=a.outlineWidth,S=a.cornerType;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&p.isConstant&&E.isConstant(C)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=v?_.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,b.polylinePositions=h.getValue(d.MINIMUM_VALUE,b.polylinePositions),b.shapePositions=p.getValue(d.MINIMUM_VALUE,b.shape),b.granularity=r(C)?C.getValue(d.MINIMUM_VALUE):void 0,b.cornerType=r(S)?S.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=r(w)?w.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.polylineVolume;if(a.isShowing&&a.isAvailable(i)&&E.getValueOrDefault(s.show,i,!0)){var l=this._options,u=E.getValueOrUndefined(s.positions,i,l.polylinePositions),d=E.getValueOrUndefined(s.shape,i); -if(r(u)&&r(d)){l.polylinePositions=u,l.shapePositions=d,l.granularity=E.getValueOrUndefined(s.granularity,i),l.cornerType=E.getValueOrUndefined(s.cornerType,i);var f=this._geometryUpdater.shadowsProperty.getValue(i);if(!r(s.fill)||s.fill.getValue(i)){var v=S.getValue(i,o.fillMaterialProperty,this._material);this._material=v;var y=new m({material:v,translucent:v.isTranslucent(),closed:!0});l.vertexFormat=y.vertexFormat,this._primitive=n.add(new g({geometryInstances:new c({id:a,geometry:new h(l)}),appearance:y,asynchronous:!1,shadows:f}))}if(r(s.outline)&&s.outline.getValue(i)){l.vertexFormat=_.VERTEX_FORMAT;var C=E.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,N),w=E.getValueOrDefault(s.outlineWidth,i,1),b=1!==C.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new c({id:a,geometry:new p(l),attributes:{color:t.fromColor(C)}}),appearance:new _({flat:!0,translucent:b,renderState:{lineWidth:o._scene.clampLineWidth(w)}}),asynchronous:!1,shadows:f}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),define("DataSources/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.closeBottom=void 0,this.closeTop=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0}function A(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function P(e,t,i){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=i,this._options=new x(i._entity)}var M=new w(e.WHITE),D=new S(!0),I=new S(!0),R=new S(!1),O=new S(e.BLACK),N=new S(C.DISABLED),L=new S(new s),B=new e;return n(A,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:g}}),n(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&T.isConstant(this._showProperty)&&T.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new m(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=this._distanceDisplayConditionProperty.getValue(i),h=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof w){var f=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(i)),o=t.fromColor(f),n={show:u,distanceDisplayCondition:h,color:o}}else n={show:u,distanceDisplayCondition:h};return new c({id:a,geometry:new p(this._options),attributes:n})},A.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=T.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new f(this._options),attributes:{show:new m(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),o(this)},A.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"rectangle"===t){var a=this._entity.rectangle;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var p=a.coordinates,f=a.show;if(r(f)&&f.isConstant&&!f.getValue(d.MINIMUM_VALUE)||!r(p))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=i(a.material,M),y=m instanceof w;this._materialProperty=m,this._fillProperty=i(s,I),this._showProperty=i(f,D),this._showOutlineProperty=i(a.outline,R),this._outlineColorProperty=c?i(a.outlineColor,O):void 0,this._shadowsProperty=i(a.shadows,N),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,L);var C=a.height,S=a.extrudedHeight,E=a.granularity,b=a.stRotation,x=a.rotation,A=a.outlineWidth,P=a.closeBottom,B=a.closeTop,F=l&&!r(C)&&!r(S)&&y&&_.isSupported(this._scene);if(c&&F&&(h(h.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=F,this._outlineEnabled=c,p.isConstant&&T.isConstant(C)&&T.isConstant(S)&&T.isConstant(E)&&T.isConstant(b)&&T.isConstant(x)&&T.isConstant(A)&&T.isConstant(P)&&T.isConstant(B)&&(!F||T.isConstant(m))){var k=this._options;k.vertexFormat=y?v.VERTEX_FORMAT:g.MaterialSupport.TEXTURED.vertexFormat,k.rectangle=p.getValue(d.MINIMUM_VALUE,k.rectangle),k.height=r(C)?C.getValue(d.MINIMUM_VALUE):void 0,k.extrudedHeight=r(S)?S.getValue(d.MINIMUM_VALUE):void 0,k.granularity=r(E)?E.getValue(d.MINIMUM_VALUE):void 0,k.stRotation=r(b)?b.getValue(d.MINIMUM_VALUE):void 0,k.rotation=r(x)?x.getValue(d.MINIMUM_VALUE):void 0,k.closeBottom=r(P)?P.getValue(d.MINIMUM_VALUE):void 0,k.closeTop=r(B)?B.getValue(d.MINIMUM_VALUE):void 0,this._isClosed=r(S)&&r(k.closeTop)&&r(k.closeBottom)&&k.closeTop&&k.closeBottom,this._outlineWidth=r(A)?A.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e,t){return new P(e,t,this)},P.prototype.update=function(i){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.rectangle;if(l.isShowing&&l.isAvailable(i)&&T.getValueOrDefault(u.show,i,!0)){var d=this._options,h=T.getValueOrUndefined(u.coordinates,i,d.rectangle);if(r(h)){d.rectangle=h,d.height=T.getValueOrUndefined(u.height,i),d.extrudedHeight=T.getValueOrUndefined(u.extrudedHeight,i),d.granularity=T.getValueOrUndefined(u.granularity,i),d.stRotation=T.getValueOrUndefined(u.stRotation,i),d.rotation=T.getValueOrUndefined(u.rotation,i),d.closeBottom=T.getValueOrUndefined(u.closeBottom,i),d.closeTop=T.getValueOrUndefined(u.closeTop,i);var m=this._geometryUpdater.shadowsProperty.getValue(i);if(T.getValueOrDefault(u.fill,i,!0)){var C=n.fillMaterialProperty,w=b.getValue(i,C,this._material);if(this._material=w,o){var S=e.WHITE;r(C.color)&&(S=C.color.getValue(i)),this._primitive=s.add(new _({geometryInstances:new c({id:l,geometry:new p(d),attributes:{color:t.fromColor(S)}}),asynchronous:!1,shadows:m}))}else{var E=new g({material:w,translucent:w.isTranslucent(),closed:r(d.extrudedHeight)});d.vertexFormat=E.vertexFormat,this._primitive=a.add(new y({geometryInstances:new c({id:l,geometry:new p(d)}),appearance:E,asynchronous:!1,shadows:m}))}}if(!o&&T.getValueOrDefault(u.outline,i,!1)){d.vertexFormat=v.VERTEX_FORMAT;var x=T.getValueOrClonedDefault(u.outlineColor,i,e.BLACK,B),A=T.getValueOrDefault(u.outlineWidth,i,1),P=1!==x.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new c({id:l,geometry:new f(d),attributes:{color:t.fromColor(x)}}),appearance:new v({flat:!0,translucent:P,renderState:{lineWidth:n._scene.clampLineWidth(A)}}),asynchronous:!1,shadows:m}))}}}},P.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},A}),define("DataSources/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E){"use strict";function b(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 T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new b(e),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new b(t._entity)}var A=new y(e.WHITE),P=new C(!0),M=new C(!0),D=new C(!1),I=new C(e.BLACK),R=new C(v.DISABLED),O=new C(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:m}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!r(this._entity.availability)&&E.isConstant(this._showProperty)&&E.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,o,a=this._entity,s=a.isAvailable(i),u=new h(s&&a.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=this._distanceDisplayConditionProperty.getValue(i),f=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var m=e.WHITE;r(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(i)),o=t.fromColor(m),n={show:u,distanceDisplayCondition:f,color:o}}else n={show:u,distanceDisplayCondition:f};return new c({id:a,geometry:new p(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(i){var r=this._entity,n=r.isAvailable(i),o=E.getValueOrDefault(this._outlineColorProperty,i,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(i);return new c({id:r,geometry:new f(this._options),attributes:{show:new h(n&&r.isShowing&&this._showProperty.getValue(i)&&this._showOutlineProperty.getValue(i)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"wall"===t){var a=this._entity.wall;if(!r(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!r(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.outline,c=r(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=a.positions,p=a.show;if(r(p)&&p.isConstant&&!p.getValue(d.MINIMUM_VALUE)||!r(h))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=i(a.material,A),g=f instanceof y;this._materialProperty=f,this._fillProperty=i(s,M),this._showProperty=i(p,P),this._showOutlineProperty=i(a.outline,D),this._outlineColorProperty=c?i(a.outlineColor,I):void 0,this._shadowsProperty=i(a.shadows,R),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O);var v=a.minimumHeights,C=a.maximumHeights,w=a.outlineWidth,S=a.granularity;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&E.isConstant(v)&&E.isConstant(C)&&E.isConstant(w)&&E.isConstant(S)){var b=this._options;b.vertexFormat=g?_.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,b.positions=h.getValue(d.MINIMUM_VALUE,b.positions),b.minimumHeights=r(v)?v.getValue(d.MINIMUM_VALUE,b.minimumHeights):void 0,b.maximumHeights=r(C)?C.getValue(d.MINIMUM_VALUE,b.maximumHeights):void 0,b.granularity=r(S)?S.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=r(w)?w.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(i){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.wall;if(a.isShowing&&a.isAvailable(i)&&E.getValueOrDefault(s.show,i,!0)){var l=this._options,u=E.getValueOrUndefined(s.positions,i,l.positions);if(r(u)){l.positions=u,l.minimumHeights=E.getValueOrUndefined(s.minimumHeights,i,l.minimumHeights),l.maximumHeights=E.getValueOrUndefined(s.maximumHeights,i,l.maximumHeights),l.granularity=E.getValueOrUndefined(s.granularity,i);var d=this._geometryUpdater.shadowsProperty.getValue(i);if(E.getValueOrDefault(s.fill,i,!0)){var h=S.getValue(i,o.fillMaterialProperty,this._material);this._material=h;var v=new m({material:h,translucent:h.isTranslucent(),closed:r(l.extrudedHeight)});l.vertexFormat=v.vertexFormat,this._primitive=n.add(new g({geometryInstances:new c({id:a,geometry:new p(l)}),appearance:v,asynchronous:!1,shadows:d}))}if(E.getValueOrDefault(s.outline,i,!1)){l.vertexFormat=_.VERTEX_FORMAT;var y=E.getValueOrClonedDefault(s.outlineColor,i,e.BLACK,N),C=E.getValueOrDefault(s.outlineWidth,i,1),w=1!==y.alpha;this._outlinePrimitive=n.add(new g({geometryInstances:new c({id:a,geometry:new f(l),attributes:{color:t.fromColor(y)}}),appearance:new _({flat:!0,translucent:w,renderState:{lineWidth:o._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:d}))}}}},x.prototype.getBoundingSphere=function(e,t){return w(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),define("DataSources/DataSourceDisplay",["../Core/BoundingSphere","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","../Scene/GroundPrimitive","./BillboardVisualizer","./BoundingSphereState","./BoxGeometryUpdater","./CorridorGeometryUpdater","./CustomDataSource","./CylinderGeometryUpdater","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater","./PolylineVolumeGeometryUpdater","./RectangleGeometryUpdater","./WallGeometryUpdater"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T){"use strict";function x(e){s.initializeTerrainHeights();var i=e.scene,r=e.dataSourceCollection;this._eventHelper=new a,this._eventHelper.add(r.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(r.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=r,this._scene=i,this._visualizersCallback=t(e.visualizersCallback,x.defaultVisualizersCallback);for(var n=0,o=r.length;nx*p.maximumRadius?(P=C,e.normalize(A,P),e.negate(P,P),D=e.clone(e.UNIT_Z,w),M=e.cross(D,P,y),e.magnitude(M)>l.EPSILON7&&(e.normalize(P,P),e.normalize(M,M),D=e.cross(P,M,w),e.normalize(D,D),I=!0)):e.equalsEpsilon(A,R,l.EPSILON7)||(D=C,e.normalize(B,D),e.normalize(F,F),M=e.cross(D,F,w),e.equalsEpsilon(M,e.ZERO,l.EPSILON7)||(P=e.cross(M,D,y),u.multiplyByVector(O,P,P),u.multiplyByVector(O,M,M),u.multiplyByVector(O,D,D),e.normalize(P,P),e.normalize(M,M),e.normalize(D,D),I=!0))}}i(t.boundingSphere)&&(A=t.boundingSphere.center);var U,G,H;o&&(U=e.clone(r.position,S),G=e.clone(r.direction,E),H=e.clone(r.up,b));var W=v;I?(W[0]=P.x,W[1]=P.y,W[2]=P.z,W[3]=0,W[4]=M.x,W[5]=M.y,W[6]=M.z,W[7]=0,W[8]=D.x,W[9]=D.y,W[10]=D.z,W[11]=0,W[12]=A.x,W[13]=A.y,W[14]=A.z,W[15]=0):d.eastNorthUpToFixedFrame(A,p,W),r._setTransform(W),o&&(e.clone(U,r.position),e.clone(G,r.direction),e.clone(H,r.up),e.cross(G,H,r.right))}if(n){var q=f===h.SCENE2D||e.equals(t._offset3D,e.ZERO)?void 0:t._offset3D;r.lookAtTransform(r.transform,q)}}function f(i,r,n){this.entity=i,this.scene=r,this.ellipsoid=t(n,o.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new e,this._defaultOffset3D=void 0,this._offset3D=new e}var m=new u,_=new u,g=new u,v=new c,y=new e,C=new e,w=new e,S=new e,E=new e,b=new e,T=new s,x=1.25;r(f,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(t){this._defaultOffset3D=e.clone(t,new e)}}}),f.defaultOffset3D=new e(-14e3,3500,3500);var A=new a,P=new e;return f.prototype.update=function(t,r){var n=this.scene,o=this.entity,a=this.ellipsoid,s=n.mode;if(s!==h.MORPHING){var u=o.position,c=o!==this._lastEntity,d=s!==this._mode,m=this._offset3D,_=n.camera,g=c||d,v=!0;if(c){var y=o.viewFrom,C=i(y);if(!C&&i(r)){var w=n.screenSpaceCameraController;w.minimumZoomDistance=Math.min(w.minimumZoomDistance,.5*r.radius),A.pitch=-l.PI_OVER_FOUR,A.range=0;var S=u.getValue(t,P);if(i(S)){var E=2-1/Math.max(1,e.magnitude(S)/a.maximumRadius);A.pitch*=E}_.viewBoundingSphere(r,A),this.boundingSphere=r,g=!1,v=!1}else C&&i(y.getValue(t,m))||e.clone(f._defaultOffset3D,m)}else d||n.mode===h.MORPHING||this._mode===h.SCENE2D||e.clone(_.position,m);this._lastEntity=o,this._mode=n.mode!==h.MORPHING?n.mode:this._mode,n.mode!==h.MORPHING&&p(this,_,g,v,u,t,a)}},f}),!function(){function e(e,t){function i(t){var i,r=e.arcs[t<0?~t:t],n=r[0];return e.transform?(i=[0,0],r.forEach(function(e){i[0]+=e[0],i[1]+=e[1]})):i=r[r.length-1],t<0?[i,n]:[n,i]}function r(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){n[e<0?~e:e]=1}),s.push(r)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(i,r){var n,o=e.arcs[i<0?~i:i];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=i,t[r]=n)}),t.forEach(function(e){var t,r,n=i(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e),t.end=l,r=o[l]){delete o[r.start];var u=r===t?t:t.concat(r);o[u.start=t.start]=a[u.end=r.end]=u}else o[t.start]=a[t.end]=t;else if(t=o[l])if(delete o[t.start],t.unshift(e),t.start=s,r=a[s]){delete a[r.end];var c=r===t?t:r.concat(t);o[c.start=r.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=l]=t}),r(a,o),r(o,a),t.forEach(function(e){n[e<0?~e:e]||s.push([e])}),s}function t(t,i,r){function n(e){var t=e<0?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function o(e){e.forEach(n)}function a(e){e.forEach(o)}function s(e){"GeometryCollection"===e.type?e.geometries.forEach(s):e.type in d&&(u=e,d[e.type](e.arcs))}var l=[];if(arguments.length>1){var u,c=[],d={LineString:o,MultiLineString:a,Polygon:a,MultiPolygon:function(e){e.forEach(a)}};s(i),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var h=0,p=t.arcs.length;h0}var s={},l=[],u=[];return i.forEach(function(e){"Polygon"===e.type?r(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(r)}),l.forEach(function(e){if(!e._){var t=[],i=[e];for(e._=1,u.push(t);e=i.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){s[e<0?~e:e].forEach(function(e){e._||(e._=1,i.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(i){var r=[];if(i.forEach(function(e){e.forEach(function(e){e.forEach(function(e){s[e<0?~e:e].length<2&&r.push(e)})})}),r=e(t,r),(n=r.length)>1)for(var a,l=o(i[0][0]),u=0;u>>1;e[n]0;){var i=(t+1>>1)-1,n=r[i];if(p(e,n)>=0)break;r[n._=t]=n,r[e._=t=i]=e}}function t(e,t){for(;;){var i=t+1<<1,o=i-1,a=t,s=r[a];if(o0&&(e=r[n],t(r[e._=0]=e,0)),i}},i.remove=function(i){var o,a=i._;if(r[a]===i)return a!==--n&&(o=r[n],(p(o,i)<0?e:t)(r[o._=a]=o,a)),a},i}function m(e){if(!e)return g;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0),e[0]=(t+=e[0])*r+o,e[1]=(i+=e[1])*n+a}}function _(e){if(!e)return g;var t,i,r=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=i=0);var l=(e[0]-o)/r|0,u=(e[1]-a)/n|0;e[0]=l-t,e[1]=u-i,t=l,i=u}}function g(){}var v={version:"1.6.18",mesh:function(e){return a(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return a(e,i.apply(this,arguments))},mergeArcs:i,feature:r,neighbors:u,presimplify:c};"function"==typeof define&&define.amd?define("ThirdParty/topojson",v):"object"==typeof module&&module.exports?module.exports=v:this.topojson=v}(),define("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/RuntimeError","../Scene/HeightReference","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./DataSource","./EntityCluster","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A){ -"use strict";function P(t){return e.fromDegrees(t[0],t[1],t[2])}function M(e,t){var i="";for(var r in e)if(e.hasOwnProperty(r)){if(r===t||ue.indexOf(r)!==-1)continue;var o=e[r];n(o)&&(i+="object"==typeof o?""+r+""+M(o)+"":""+r+""+o+"")}return i.length>0&&(i=''+i+"
"),i}function D(e,t,i){var r;return function(o,a){return n(r)||(r=e(t,i)),r}}function I(e,t){return new v(D(M,e,t),!0)}function R(e,t,r){var o=e.id;if(n(o)&&"Feature"===e.type){for(var a=2,s=o;n(t.getById(s));)s=o+"_"+a,a++;o=s}else o=i();var l=t.getOrCreateEntity(o),u=e.properties;if(n(u)){l.addProperty("properties"),l.properties=u;var c,d=u.title;if(n(d))l.name=d,c="title";else{var h=Number.MAX_VALUE;for(var p in u)if(u.hasOwnProperty(p)&&u[p]){var f=p.toLowerCase();if(h>1&&"title"===f){h=1,c=p;break}h>2&&"name"===f?(h=2,c=p):h>3&&/title/i.test(p)?(h=3,c=p):h>4&&/name/i.test(p)&&(h=4,c=p)}n(c)&&(l.name=u[c])}var m=u.description;null!==m&&(l.description=n(m)?new w(m):r(u,c))}return l}function O(e,t){for(var i=new Array(e.length),r=0;r2?v.perPositionHeight=new w(!0):a.clampToGround||(v.height=0);var T=R(i,e._entityCollection,a.describe);T.polygon=v}}function W(e,t,i,r,n){H(e,t,r,i.coordinates,n)}function q(e,t,i,r,n){for(var o=i.coordinates,a=0;at&&(i=null==i?"..":i,e=e.substring(0,t-i.length)+i),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var i=0,r=e.length;i",this.getInnerHtml(),""].join("")},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.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var i=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return i},createAttrs:function(e,t){var i={href:t},r=this.createCssClass(e);return r&&(i.class=r),this.newWindow&&(i.target="_blank"),i},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/!--([\s\S]+?)--/,t=/[0-9a-zA-Z][0-9a-zA-Z:]*/,i=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,r=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=i.source+"(?:\\s*=\\s*"+r.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",r.source+")",")*",">",")","|","(?:","<(/)?","(?:",e.source,"|","(?:","("+t.source+")","(?:","\\s+",n,")*","\\s*/?",")",")",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,i,r=this.htmlRegex,n=0,o=[];null!==(t=r.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(i=this.parseTextAndEntityNodes(c),o.push.apply(o,i)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(n>>8^n[255&(e^i[r])]},t.get=function(){return~e}}function n(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}function o(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 a(){}function s(e){function t(t,i){var o=new Blob([e],{type:z});r=new u(o),r.init(function(){n.size=r.size,t()},i)}function i(e,t,i,n){r.readUint8Array(e,t,i,n)}var r,n=this;n.size=0,n.init=t,n.readUint8Array=i}function l(e){function t(t){for(var i=e.length;"="==e.charAt(i-1);)i--;r=e.indexOf(",")+1,n.size=Math.floor(.75*(i-r)),t()}function i(t,i,n){var a,s=o(i),l=4*Math.floor(t/3),u=4*Math.ceil((t+i)/3),c=window.atob(e.substring(l+r,u+r)),d=t-3*Math.floor(l/4);for(a=d;a2?o+=window.btoa(n):a=n,t()}function r(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=i,n.getData=r}function p(e){function t(t){n=new Blob([],{type:e}),t()}function i(t,i){n=new Blob([n,P?t:t.buffer],{type:e}),i()}function r(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=i,o.getData=r}function f(e,t,i,r,n,o,a,s,l,u){function c(){e.removeEventListener(U,d,!1),s(f)}function d(e){var t=e.data,r=t.data;t.onappend&&(f+=r.length,i.writeUint8Array(r,function(){o(!1,r),h()},u)),t.onflush&&(r?(f+=r.length,i.writeUint8Array(r,function(){o(!1,r),c()},u)):c()),t.progress&&a&&a(p+t.current,n)}function h(){p=m*F,p127?n[i-128]:String.fromCharCode(i);return r}function C(e){return decodeURIComponent(escape(e))}function w(e){var t,i="";for(t=0;t>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){}}function E(e,t,i,r,n){return 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=S(e.lastModDateRaw),1===(1&e.bitFlag)?void n(D):((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?void n(I):(e.filenameLength=t.view.getUint16(i+22,!0),void(e.extraFieldLength=t.view.getUint16(i+24,!0))))}function b(e,t){function i(){}function r(i,n){e.readUint8Array(e.size-i,i,function(e){var t=o(e.length,e).view;1347093766!=t.getUint32(0)?r(i+1,n):n(t)},function(){t(R)})}return i.prototype.getData=function(i,r,n,a){function s(e,t){h&&h.terminate(),h=null,e&&e(t)}function l(e){var t=o(4);return t.view.setUint32(0,e),p.crc32==t.view.getUint32(0)}function u(e,t){a&&!l(t)?c():i.getData(function(e){s(r,e)})}function c(){s(t,L)}function d(){s(t,N)}var h,p=this;e.readUint8Array(p.offset,30,function(r){var s,l=o(r.length,r);return 1347093252!=l.view.getUint32(0)?void t(M):(E(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,void i.init(function(){0===p.compressionMethod?v(e,i,s,p.compressedSize,a,u,n,c,d):h=_(e,i,s,p.compressedSize,a,u,n,c,d)},d))},c)},{getEntries:function(n){return e.size<22?void t(M):void r(22,function(r){var a,s;a=r.getUint32(16,!0),s=r.getUint16(8,!0),e.readUint8Array(a,e.size-a,function(e){var r,a,l,u,c=0,d=[],h=o(e.length,e);for(r=0;r>>1^3988292384:i>>>=1;r[e]=i}return r}(),s.prototype=new a,s.prototype.constructor=s,l.prototype=new a,l.prototype.constructor=l,u.prototype=new a,u.prototype.constructor=u,c.prototype.getData=function(e){e(this.data)},d.prototype=new c,d.prototype.constructor=d,h.prototype=new c,h.prototype.constructor=h,p.prototype=new c,p.prototype.constructor=p,i.zip={Reader:a,Writer:c,BlobReader:u,Data64URIReader:l,TextReader:s,BlobWriter:p,Data64URIWriter:h,TextWriter:d,createReader:function(e,t,i){e.init(function(){t(b(e,i))},i)},createWriter:function(e,t,i,r){e.init(function(){t(A(e,i,r))},i)},useWebWorkers:!0};var G;t(i.zip,{workerScriptsPath:{get:function(){return"undefined"==typeof G&&(G=e("ThirdParty/Workers/")),G}}})}(i),i.zip}),define("DataSources/KmlDataSource",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getAbsoluteUri","../Core/getExtensionFromUri","../Core/getFilenameFromUri","../Core/Iso8601","../Core/joinUrls","../Core/JulianDate","../Core/loadBlob","../Core/loadXML","../Core/Math","../Core/NearFarScalar","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Rectangle","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/SceneMode","../ThirdParty/Autolinker","../ThirdParty/Uri","../ThirdParty/when","../ThirdParty/zip","./BillboardGraphics","./CompositePositionProperty","./CorridorGraphics","./DataSource","./DataSourceClock","./Entity","./EntityCluster","./EntityCollection","./LabelGraphics","./PathGraphics","./PolygonGraphics","./PolylineGraphics","./PositionPropertyArray","./RectangleGraphics","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,M,D,I,R,O,N,L,B,F,k,V,z,U,G,H,W,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re){"use strict";function ne(e){var t=e.slice(0,Math.min(4,e.size)),i=F.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 oe(e){var t=F.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 ae(e,t,i,r){t.getData(new k.TextWriter,function(e){i.kml=gt.parseFromString(e,"application/xml"),r.resolve()})}function se(e,t,i,r){var n=u(_t.detectFromFilename(t.filename),"application/octet-stream");t.getData(new k.Data64URIWriter(n),function(e){i[t.filename]=e,r.resolve()})}function le(e,t,i,r){for(var n=r.keys,o=new B("."),a=e.querySelectorAll(t),s=0;s0?Pt.maximumRed=o:Pt.red=0,n>0?Pt.maximumGreen=n:Pt.green=0,r>0?Pt.maximumBlue=r:Pt.blue=0,Pt.alpha=i,s.fromRandom(Pt)):new s(o,n,r,i)}}function be(e,t,i){var r=Ce(e,t,i);if(c(r))return Ee(r,"random"===Ce(e,"colorMode",i))}function Te(e){var t=_e(e,"TimeStamp",At.kmlgx),i=Ce(t,"when",At.kmlgx);if(c(t)&&c(i)&&0!==i.length){var r=C.fromIso8601(i),n=new D;return n.addInterval(new M({start:r,stop:v.MAXIMUM_VALUE})),n}}function xe(e){var t=_e(e,"TimeSpan",At.kmlgx);if(c(t)){var i,r=_e(t,"begin",At.kmlgx),n=c(r)?C.fromIso8601(r.textContent):void 0,o=_e(t,"end",At.kmlgx),a=c(o)?C.fromIso8601(o.textContent):void 0;if(c(n)&&c(a)){if(C.lessThan(a,n)){var s=n;n=a,a=s}i=new D,i.addInterval(new M({start:n,stop:a}))}else c(n)?(i=new D,i.addInterval(new M({start:n,stop:v.MAXIMUM_VALUE}))):c(a)&&(i=new D,i.addInterval(new M({start:v.MINIMUM_VALUE,stop:a})));return i}}function Ae(){var e=new V;return e.width=yt,e.height=yt,e.scaleByDistance=new b(Ct,wt,St,Et),e.pixelOffsetScaleByDistance=new b(Ct,wt,St,Et),e}function Pe(){var e=new Z;return e.outline=!0,e.outlineColor=s.WHITE,e}function Me(){var e=new Y;return e.translucencyByDistance=new b(3e6,1,5e6,0),e.pixelOffset=new i(17,0),e.horizontalOrigin=R.LEFT,e.font="16px sans-serif",e.style=O.FILL_AND_OUTLINE,e}function De(e,t,i,r,n){var o=Ce(e,"href",At.kml);if(c(o)&&0!==o.length){if(0===o.indexOf("root://icons/palette-")){var a=o.charAt(21),s=u(ye(e,"x",At.gx),0),l=u(ye(e,"y",At.gx),0);s=Math.min(s/32,7),l=7-Math.min(l/32,7);var d=8*l+s;o="https://maps.google.com/mapfiles/kml/pal"+a+"/icon"+d+".png"}if(o=Se(o,t._proxy,i,r),n){var h=Ce(e,"refreshMode",At.kml),p=Ce(e,"viewRefreshMode",At.kml);"onInterval"===h||"onExpire"===h?console.log("KML - Unsupported Icon refreshMode: "+h):"onStop"!==p&&"onRegion"!==p||console.log("KML - Unsupported Icon viewRefreshMode: "+p);var f=u(Ce(e,"viewBoundScale",At.kml),1),m="onStop"===p?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",_=u(Ce(e,"viewFormat",At.kml),m),g=Ce(e,"httpQuery",At.kml),v=ot(_,g),C=y(o,v,!1);return at(t._camera,t._canvas,C,f,t._lastCameraView.bbox)}return o}}function Ie(e,n,o,a,s){var l=ye(n,"scale",At.kml),d=ye(n,"heading",At.kml),h=be(n,"color",At.kml),p=_e(n,"Icon",At.kml),f=De(p,e,a,s,!1),m=ye(p,"x",At.gx),_=ye(p,"y",At.gx),g=ye(p,"w",At.gx),v=ye(p,"h",At.gx),y=_e(n,"hotSpot",At.kml),C=fe(y,"x"),w=fe(y,"y"),S=me(y,"xunits"),b=me(y,"yunits"),T=o.billboard;c(T)||(T=Ae(),o.billboard=T),T.image=f,T.scale=l,T.color=h,(c(m)||c(_)||c(g)||c(v))&&(T.imageSubRegion=new t(m,_,g,v)),c(d)&&0!==d&&(T.rotation=E.toRadians(-d),T.alignedAxis=r.UNIT_Z),l=u(l,1);var x,A;c(C)&&("pixels"===S?x=-C*l:"insetPixels"===S?x=(C-yt)*l:"fraction"===S&&(x=-C*yt*l),x+=.5*yt*l),c(w)&&("pixels"===b?A=w*l:"insetPixels"===b?A=(-w+yt)*l:"fraction"===b&&(A=w*yt*l),A-=.5*yt*l),(c(x)||c(A))&&(T.pixelOffset=new i(x,A))}function Re(e,t,i,r,n){for(var o=0,a=t.childNodes.length;o:clampToSeaFloor is currently not supported, using :clampToGround."),I.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(console.log("KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),I.RELATIVE_TO_GROUND):(c(e)?console.log("KML - Unknown :"+e+", using :CLAMP_TO_GROUND."):console.log("KML - Unknown :"+t+", using :CLAMP_TO_GROUND."),I.CLAMP_TO_GROUND)}function ke(e,t,i){return"relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t?e:((c(t)&&"clampToGround"!==t||c(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+u(t,i)),new te(e))}function Ve(e,t,i){if(c(e)){if("relativeToSeaFloor"===i||"absolute"===t||"relativeToGround"===t)return e;(c(t)&&"clampToGround"!==t||c(i)&&"clampToSeaFloor"!==i)&&console.log("KML - Unknown altitudeMode: "+u(t,i));for(var r=e.length,n=0;n0&&console.log("KML - gx:angles are not supported in gx:Tracks");for(var h=Math.min(s.length,u.length),p=[],f=[],m=0;m0&&r.availability.addInterval(new M({start:f[0],stop:f[f.length-1]})),d&&c&&Be(t,r,n),!0}function je(e,t,i,r,n,o,a,s,l){var u=e[0],c=e[e.length-1],d=new ee;d.addSamples(e,t),i.intervals.addInterval(new M({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:ke(d,a,s)})),r.addInterval(new M({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new M({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function Ye(e,t,i,r,n){for(var o,a,s,l=we(i,"interpolate",At.gx),u=ve(i,"Track",At.gx),d=!1,h=new ie,p=new D,f=new z,m=0,_=u.length;m<_;m++){var g=u[m],v=ve(g,"when",At.kml),y=ve(g,"coord",At.gx),w=Ce(g,"altitudeMode",At.kml),S=Ce(g,"altitudeMode",At.gx),E=de(w,S),b=we(g,"extrude",At.kml),T=Math.min(y.length,v.length),x=[];o=[];for(var A=0;A0)){for(_='',n=0;n";_+="
"+u(g.displayName,o)+""+u(g.value,"")+"
"}if(c(_)){_=vt.link(_),Mt.innerHTML=_;var S=Mt.querySelectorAll("a");for(n=0;n1&&(le(Mt,"a","href",r),le(Mt,"img","src",r));var E='
",Mt.innerHTML="",t.description=E}}function Je(e,t,i,r,n,o,a,s,l){function d(e){return!e||e.show&&d(e.parent)}var h=ce(i,r,l),p=h.kml,f=Oe(h,e,i,n,o,a),m=Ce(i,"name",At.kml);h.name=m,h.parent=t;var _=xe(i);c(_)||(_=Te(i)),h.availability=_,pt(h);var g=we(i,"visibility",At.kml);h.show=d(t)&&u(g,!0);var v=_e(i,"author",At.atom),y=p.author;y.name=Ce(v,"name",At.atom),y.uri=Ce(v,"uri",At.atom),y.email=Ce(v,"email",At.atom);var C=_e(i,"link",At.atom),w=p.link;return w.href=me(C,"href"),w.hreflang=me(C,"hreflang"),w.rel=me(C,"rel"),w.type=me(C,"type"),w.title=me(C,"title"),w.length=me(C,"length"),p.address=Ce(i,"address",At.kml),p.phoneNumber=Ce(i,"phoneNumber",At.kml),p.snippet=Ce(i,"Snippet",At.kml),Ke(i,h),Qe(i,h,f,a),c(_e(i,"Camera",At.kml))&&console.log("KML - Unsupported view: Camera"),c(_e(i,"LookAt",At.kml))&&console.log("KML - Unsupported view: LookAt"),c(_e(i,"Region",At.kml))&&console.log("KML - Placemark Regions are unsupported"),{entity:h,styleEntity:f}}function $e(e,t,i,r,n,o,a,s,l){for(var u=Object.keys(Bt),c=u.length,d=0;d0||c(t)&&t.length>0)&&(i+=y(nt(e),nt(t),!1)),i}function at(e,t,i,n,o){function a(e){return e<-E.PI_OVER_TWO?-E.PI_OVER_TWO:e>E.PI_OVER_TWO?E.PI_OVER_TWO:e}function s(e){return e>E.PI?e-E.TWO_PI:e<-E.PI?e+E.TWO_PI:e}if(c(e)&&e._mode!==N.MORPHING){var l,d,h=p.WGS84;if(o=u(o,Rt),c(t)&&(Nt.x=.5*t.clientWidth,Nt.y=.5*t.clientHeight,l=e.pickEllipsoid(Nt,h,Lt)),c(l)?d=h.cartesianToCartographic(l,Ot):(d=A.center(o,Ot),l=h.cartographicToCartesian(d)),c(n)&&!E.equalsEpsilon(n,1,E.EPSILON9)){var f=o.width*n*.5,m=o.height*n*.5;o=new A(s(d.longitude-f),a(d.latitude-m),s(d.longitude+f),a(d.latitude+m))}i=i.replace("[bboxWest]",E.toDegrees(o.west).toString()),i=i.replace("[bboxSouth]",E.toDegrees(o.south).toString()),i=i.replace("[bboxEast]",E.toDegrees(o.east).toString()),i=i.replace("[bboxNorth]",E.toDegrees(o.north).toString());var _=E.toDegrees(d.longitude).toString(),g=E.toDegrees(d.latitude).toString();i=i.replace("[lookatLon]",_),i=i.replace("[lookatLat]",g),i=i.replace("[lookatTilt]",E.toDegrees(e.pitch).toString()),i=i.replace("[lookatHeading]",E.toDegrees(e.heading).toString()),i=i.replace("[lookatRange]",r.distance(e.positionWC,l)),i=i.replace("[lookatTerrainLon]",_),i=i.replace("[lookatTerrainLat]",g),i=i.replace("[lookatTerrainAlt]",d.height.toString()),h.cartesianToCartographic(e.positionWC,Ot),i=i.replace("[cameraLon]",E.toDegrees(Ot.longitude).toString()),i=i.replace("[cameraLat]",E.toDegrees(Ot.latitude).toString()),i=i.replace("[cameraAlt]",E.toDegrees(Ot.height).toString());var v=e.frustum,y=v.aspectRatio,C="",w="";if(c(y)){var S=E.toDegrees(v.fov);y>1?(C=S,w=S/y):(w=S,C=S*y)}i=i.replace("[horizFov]",C.toString()),i=i.replace("[vertFov]",w.toString())}else i=i.replace("[bboxWest]","-180"),i=i.replace("[bboxSouth]","-90"),i=i.replace("[bboxEast]","180"),i=i.replace("[bboxNorth]","90"),i=i.replace("[lookatLon]",""),i=i.replace("[lookatLat]",""),i=i.replace("[lookatRange]",""),i=i.replace("[lookatTilt]",""),i=i.replace("[lookatHeading]",""),i=i.replace("[lookatTerrainLon]",""),i=i.replace("[lookatTerrainLat]",""),i=i.replace("[lookatTerrainAlt]",""),i=i.replace("[cameraLon]",""),i=i.replace("[cameraLat]",""),i=i.replace("[cameraAlt]",""),i=i.replace("[horizFov]",""),i=i.replace("[vertFov]","");return c(t)?(i=i.replace("[horizPixels]",t.clientWidth),i=i.replace("[vertPixels]",t.clientHeight)):(i=i.replace("[horizPixels]",""),i=i.replace("[vertPixels]","")),i=i.replace("[terrainEnabled]","1"),i=i.replace("[clientVersion]","1"),i=i.replace("[kmlVersion]","2.2"),i=i.replace("[clientName]","Cesium"),i=i.replace("[language]","English")}function st(e,t,i,r,n,o,a,s,d){var h=Je(e,t,i,r,n,o,a,s,d),p=h.entity,f=_e(i,"Link",At.kml);if(c(f)||(f=_e(i,"Url",At.kml)),c(f)){var _=Ce(f,"href",At.kml);if(c(_)){var g=_;_=Se(_,void 0,o,a);var v;if(/^data:/.test(_))v=_,/\.kmz/i.test(o)||(g=m(g,o));else{g=_;var w=Ce(f,"viewRefreshMode",At.kml),S=u(Ce(f,"viewBoundScale",At.kml),1),E="onStop"===w?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=u(Ce(f,"viewFormat",At.kml),E),T=Ce(f,"httpQuery",At.kml),x=ot(b,T);v=at(e._camera,e._canvas,y(_,x,!1),S,e._lastCameraView.bbox)}var A={sourceUri:g,uriResolver:a,context:p.id},P=new j,M=dt(e,P,v,A).then(function(t){var i=e._entityCollection,r=P.values;i.suspendEvents();for(var n=0;n0||"onExpire"===a||"onStop"===w){var d=_e(t,"NetworkLinkControl",At.kml),h=c(d),m=C.now(),g={id:l(),href:_,cookie:"",queryString:x,lastUpdated:m,updating:!1,entity:p,viewBoundScale:S,needsUpdate:!1,cameraUpdateTime:m},v=0;if(h&&(g.cookie=u(Ce(d,"cookie",At.kml),""),v=u(ye(d,"minRefreshPeriod",At.kml),0)),"onInterval"===a)h&&(s=Math.max(v,s)),g.refreshMode=It.INTERVAL,g.time=s;else if("onExpire"===a){var y;if(h&&(y=Ce(d,"expires",At.kml)),c(y))try{var E=C.fromIso8601(y),b=C.secondsDifference(E,m);b>0&&b0&&ge.time&&(r=!0):e.refreshMode===It.EXPIRE?C.greaterThan(o,e.time)&&(r=!0):e.refreshMode===It.STOP&&(s&&(e.needsUpdate=!0,e.cameraUpdateTime=o),e.needsUpdate&&C.secondsDifference(o,e.cameraUpdateTime)>=e.time&&(r=!0)),r){i(t),e.updating=!0;var n=new j,u=y(e.href,ot(e.cookie,e.queryString),!1);u=at(a._camera,a._canvas,u,e.viewBoundScale,l.bbox),dt(a,n,u,{context:t.id}).then(ft(a,e,n,d,u)).otherwise(function(t){var i="NetworkLink "+e.href+" refresh failed: "+t;console.log(i),a._error.raiseEvent(a,i)}),h=!0}}d.set(e.id,e)}}),h&&(this._networkLinks=d,this._changed.raiseEvent(this)),!0},ht}),define("DataSources/VelocityOrientationProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Ellipsoid","../Core/Event","../Core/Matrix3","../Core/Quaternion","../Core/Transforms","./Property","./VelocityVectorProperty"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e,i){this._velocityVectorProperty=new c(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new o,this.ellipsoid=t(i,n.WGS84);var r=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){r._definitionChanged.raiseEvent(r)})}r(d.prototype,{isConstant:{get:function(){return u.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){var t=this._ellipsoid;t!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var h=new e,p=new e,f=new a;return d.prototype.getValue=function(e,t){var r=this._velocityVectorProperty._getValue(e,p,h);if(i(r))return l.rotationMatrixFromPositionVelocity(h,r,this._ellipsoid,f),s.fromRotationMatrix(f,t)},d.prototype.equals=function(e){return this===e||e instanceof d&&u.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},d}),define("DataSources/Visualizer",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),define("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,i){"use strict";function r(e){e=t(e,t.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}return r.ALL=i(new r({color:new e(0,0,0,0),depth:1,stencil:0})),r.prototype.execute=function(e,t){e.clear(this,t)},r}),define("Renderer/ComputeCommand",["../Core/defaultValue","./Pass"],function(e,t){"use strict";function i(i){i=e(i,e.EMPTY_OBJECT),this.vertexArray=i.vertexArray,this.fragmentShaderSource=i.fragmentShaderSource,this.shaderProgram=i.shaderProgram,this.uniformMap=i.uniformMap,this.outputTexture=i.outputTexture,this.preExecute=i.preExecute,this.postExecute=i.postExecute,this.persists=e(i.persists,!1),this.pass=t.COMPUTE,this.owner=i.owner}return i.prototype.execute=function(e){e.execute(this)},i}),define("Shaders/ViewportQuadVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n"}),define("Renderer/ComputeEngine",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/PrimitiveType","../Shaders/ViewportQuadVS","./ClearCommand","./DrawCommand","./Framebuffer","./RenderState","./ShaderProgram"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(e){this._context=e}function p(e,t){return new u({context:e,colorTextures:[t],destroyAttachments:!1})}function f(e,t){return d.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function m(t,r){return i(_)&&_.viewport.width===t&&_.viewport.height===r||(_=c.fromCache({viewport:new e(0,0,t,r)})),_}var _,g=new l({primitiveType:o.TRIANGLES}),v=new s({color:new t(0,0,0,0)});return h.prototype.execute=function(e){i(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,r=t.width,n=t.height,o=this._context,a=i(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=i(e.shaderProgram)?e.shaderProgram:f(o,e.fragmentShaderSource),l=p(o,t),u=m(r,n),c=e.uniformMap,d=v;d.framebuffer=l,d.renderState=u,d.execute(o);var h=g;h.vertexArray=a,h.renderState=u,h.shaderProgram=s,h.uniformMap=c,h.framebuffer=l,h.execute(o),l.destroy(),e.persists||(s.destroy(),i(e.vertexArray)&&a.destroy()),i(e.postExecute)&&e.postExecute(t)},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return r(this)},h}),define("Renderer/PassState",[],function(){"use strict";function e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}return e}),define("Renderer/RenderbufferFormat",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var i={RGBA4:t.RGBA4,RGB5_A1:t.RGB5_A1,RGB565:t.RGB565,DEPTH_COMPONENT16:t.DEPTH_COMPONENT16,STENCIL_INDEX8:t.STENCIL_INDEX8,DEPTH_STENCIL:t.DEPTH_STENCIL,validate:function(e){return e===i.RGBA4||e===i.RGB5_A1||e===i.RGB565||e===i.DEPTH_COMPONENT16||e===i.STENCIL_INDEX8||e===i.DEPTH_STENCIL}};return e(i)}),define("Renderer/Renderbuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","./ContextLimits","./RenderbufferFormat"],function(e,t,i,r,n,o,a){"use strict";function s(i){i=e(i,e.EMPTY_OBJECT);var r=i.context,n=r._gl,s=(o.maximumRenderbufferSize,e(i.format,a.RGBA4)),l=t(i.width)?i.width:n.drawingBufferWidth,u=t(i.height)?i.height:n.drawingBufferHeight;this._gl=n,this._format=s,this._width=l,this._height=u,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),n.renderbufferStorage(n.RENDERBUFFER,s,l,u),n.bindRenderbuffer(n.RENDERBUFFER,null)}return i(s.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),s.prototype._getRenderbuffer=function(){return this._renderbuffer},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),r(this)},s}),define("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./Framebuffer","./PassState","./Renderbuffer","./RenderbufferFormat","./Texture"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t){var i=new a(t);i.blendingEnabled=!1,i.scissorTest={enabled:!0,rectangle:new e},i.viewport=new e,this._context=t,this._fb=void 0,this._passState=i,this._width=0,this._height=0}c.prototype.begin=function(t){var i=this._context,n=i.drawingBufferWidth,a=i.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),r(this._fb)&&this._width===n&&this._height===a||(this._width=n,this._height=a,this._fb=this._fb&&this._fb.destroy(),this._fb=new o({context:i,colorTextures:[new u({context:i,width:n,height:a})],depthStencilRenderbuffer:new s({context:i,format:l.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=n,this._passState.viewport.height=a,this._passState};var d=new t;return c.prototype.end=function(e){for(var n=i(e.width,1),o=i(e.height,1),a=this._context,s=a.readPixels({x:e.x,y:e.y,width:n,height:o,framebuffer:this._fb}),l=Math.max(n,o),u=l*l,c=Math.floor(.5*n),h=Math.floor(.5*o),p=0,f=0,m=0,_=-1,g=0;g0&&p===1-f){var C=m;m=-_,_=C}p+=m,f+=_}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},c}),define("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,i,r,n){"use strict";function o(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}function a(e,t){for(var i=t.derivedKeywords,r=i.length,n=0;no.width?2*Math.tan(.5*n)/o.height:2*Math.tan(.5*n)/o.width,this._geometricToleranceOverMeter=r*e.maximumScreenSpaceError};var q=new i,j=new i,Y=new i,X=new i,Z=new i,K=new n,Q=new i,J=new c;return f}),define("Renderer/Context",["../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/GeometryAttribute","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Core/WebGLConstants","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./ContextLimits","./CubeMap","./DrawCommand","./PassState","./PickFramebuffer","./RenderState","./ShaderCache","./ShaderProgram","./Texture","./UniformState","./VertexArray"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P){"use strict";function M(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 D(e,t,i,r){for(var n=M(e,r)+": "+t.name+"(",o=0;o=8}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return this._standardDerivatives}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture}},floatingPointTexture:{get:function(){return this._textureFloat}},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}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},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=O(this._originalGLContext,e?I:void 0)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new x({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])}})),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 y({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e}})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return G}}});var H;"undefined"!=typeof WebGLRenderingContext&&(H=[f.BACK]);var W=new g;L.prototype.clear=function(e,i){e=n(e,W),i=n(i,this._defaultPassState);var r=this._gl,a=0,s=e.color,l=e.depth,u=e.stencil;o(s)&&(t.equals(this._clearColor,s)||(t.clone(s,this._clearColor),r.clearColor(s.red,s.green,s.blue,s.alpha)),a|=r.COLOR_BUFFER_BIT),o(l)&&(l!==this._clearDepth&&(this._clearDepth=l,r.clearDepth(l)),a|=r.DEPTH_BUFFER_BIT),o(u)&&(u!==this._clearStencil&&(this._clearStencil=u,r.clearStencil(u)),a|=r.STENCIL_BUFFER_BIT);var c=n(e.renderState,this._defaultRenderState);F(this,c,i,!0);var d=n(e.framebuffer,i.framebuffer);k(this,d),r.clear(a)},L.prototype.draw=function(e,t){t=n(t,this._defaultPassState);var i=n(e._framebuffer,t.framebuffer);V(this,i,e,t),z(this,e)},L.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);var t=H;this.drawBuffers&&this.glDrawBuffers(t);var i=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var r=0;r0&&(o=!1)}o&&(n=void 0)}l._missingImagePixels=n,l._isReady=!0}function s(){l._missingImagePixels=void 0,l._isReady=!0}i=e(i,e.EMPTY_OBJECT),this._pixelsToCheck=i.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var l=this;o(n(i.missingImageUrl),a,s)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){var i=this._pixelsToCheck,n=this._missingImagePixels;if(!t(n))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var o=r(e),a=e.width,s=0,l=i.length;s1&&"name"===o?(r=1,i=n):r>2&&"title"===o?(r=2,i=n):r>3&&/name/i.test(n)?(r=3,i=n):r>4&&/title/i.test(n)&&(r=4,i=n)}e(i)&&(this.name=t[i])},t.prototype.configureDescriptionFromProperties=function(t){function i(t){var r='';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(r+="object"==typeof o?"":"")}return r+="
"+n+""+i(o)+"
"+n+""+o+"
"}this.description=i(t)},t}),define("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadCRN","../Core/loadImage","../Core/loadImageViaBlob","../Core/loadKTX","../Core/throttleRequestByServer"],function(e,t,i,r,n,o,a,s){"use strict";function l(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,i.throwInstantiationError()}t(l.prototype,{ready:{get:i.throwInstantiationError},readyPromise:{get:i.throwInstantiationError},rectangle:{get:i.throwInstantiationError},tileWidth:{get:i.throwInstantiationError},tileHeight:{get:i.throwInstantiationError},maximumLevel:{get:i.throwInstantiationError},minimumLevel:{get:i.throwInstantiationError},tilingScheme:{get:i.throwInstantiationError},tileDiscardPolicy:{get:i.throwInstantiationError},errorEvent:{get:i.throwInstantiationError},credit:{get:i.throwInstantiationError},proxy:{get:i.throwInstantiationError},hasAlphaChannel:{get:i.throwInstantiationError}}),l.prototype.getTileCredits=i.throwInstantiationError,l.prototype.requestImage=i.throwInstantiationError,l.prototype.pickFeatures=i.throwInstantiationError;var u=/\.ktx$/i,c=/\.crn$/i;return l.loadImage=function(t,i){return u.test(i)?s(i,a):c.test(i)?s(i,r):e(t.tileDiscardPolicy)?s(i,o):s(i,n)},l}),define("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w){"use strict";function S(i){function a(n){var a=n.tileInfo;if(o(a)){if(C._tileWidth=a.rows,C._tileHeight=a.cols,102100===a.spatialReference.wkid||102113===a.spatialReference.wkid)C._tilingScheme=new g({ellipsoid:i.ellipsoid});else{if(4326!==n.tileInfo.spatialReference.wkid){var s="Tile spatial reference WKID "+n.tileInfo.spatialReference.wkid+" is not supported.";return void(h=m.handleError(h,C,C._errorEvent,s,void 0,void 0,void 0,c))}C._tilingScheme=new u({ellipsoid:i.ellipsoid})}if(C._maximumLevel=n.tileInfo.lods.length-1,o(n.fullExtent)){if(o(n.fullExtent.spatialReference)&&o(n.fullExtent.spatialReference.wkid))if(102100===n.fullExtent.spatialReference.wkid||102113===n.fullExtent.spatialReference.wkid){var l=new _,d=n.fullExtent,f=l.unproject(new t(Math.max(d.xmin,-C._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(d.ymin,-C._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),v=l.unproject(new t(Math.min(d.xmax,C._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(d.ymax,C._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));C._rectangle=new p(f.longitude,f.latitude,v.longitude,v.latitude)}else{if(4326!==n.fullExtent.spatialReference.wkid){var w="fullExtent.spatialReference WKID "+n.fullExtent.spatialReference.wkid+" is not supported.";return void(h=m.handleError(h,C,C._errorEvent,w,void 0,void 0,void 0,c))}C._rectangle=p.fromDegrees(n.fullExtent.xmin,n.fullExtent.ymin,n.fullExtent.xmax,n.fullExtent.ymax)}}else C._rectangle=C._tilingScheme.rectangle;o(C._tileDiscardPolicy)||(C._tileDiscardPolicy=new y({missingImageUrl:E(C,0,0,C._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),C._useTiles=!0}else C._useTiles=!1;o(n.copyrightText)&&n.copyrightText.length>0&&(C._credit=new r(n.copyrightText)),C._ready=!0,C._readyPromise.resolve(!0),m.handleSuccess(h)}function s(e){var t="An error occurred while accessing "+C._url+".";h=m.handleError(h,C,C._errorEvent,t,void 0,void 0,void 0,c),C._readyPromise.reject(new f(t))}function c(){var e={f:"json"};o(C._token)&&(e.token=C._token);var t=d(C._url,{parameters:e,proxy:C._proxy});v(t,a,s)}i=n(i,{}),this._url=i.url,this._token=i.token,this._tileDiscardPolicy=i.tileDiscardPolicy,this._proxy=i.proxy,this._tileWidth=n(i.tileWidth,256),this._tileHeight=n(i.tileHeight,256),this._maximumLevel=i.maximumLevel,this._tilingScheme=n(i.tilingScheme,new u({ellipsoid:i.ellipsoid})),this._credit=void 0,this._useTiles=n(i.usePreCachedTilesIfAvailable,!0),this._rectangle=n(i.rectangle,this._tilingScheme.rectangle),this._layers=i.layers,this.enablePickFeatures=n(i.enablePickFeatures,!0),this._errorEvent=new l,this._ready=!1,this._readyPromise=v.defer();var h,C=this;this._useTiles?c():(this._ready=!0,this._readyPromise.resolve(!0))}function E(e,t,i,r){var n;if(e._useTiles)n=e._url+"/tile/"+r+"/"+i+"/"+t;else{var a=e._tilingScheme.tileXYToNativeRectangle(t,i,r),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;n=e._url+"/export?",n+="bbox="+s,n+=e._tilingScheme instanceof u?"&bboxSR=4326&imageSR=4326":"&bboxSR=3857&imageSR=3857",n+="&size="+e._tileWidth+"%2C"+e._tileHeight,n+="&format=png&transparent=true&f=image",e.layers&&(n+="&layers=show:"+e.layers)}var l=e._token;o(l)&&(n.indexOf("?")===-1&&(n+="?"),"?"!==n[n.length-1]&&(n+="&"),n+="token="+l);var c=e._proxy;return o(c)&&(n=c.getURL(n)),n}return a(S.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._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}}}),S.prototype.getTileCredits=function(e,t,i){},S.prototype.requestImage=function(e,t,i){var r=E(this,e,t,i);return w.loadImage(this,r)},S.prototype.pickFeatures=function(e,r,n,a,s){if(this.enablePickFeatures){var l,d,p,f=this._tilingScheme.tileXYToNativeRectangle(e,r,n);if(this._tilingScheme instanceof u)l=h.toDegrees(a),d=h.toDegrees(s),p="4326";else{var m=this._tilingScheme.projection.project(new i(a,s,0));l=m.x,d=m.y,p="3857"}var g=this._url+"/identify?f=json&tolerance=2&geometryType=esriGeometryPoint";return g+="&geometry="+l+","+d,g+="&mapExtent="+f.west+","+f.south+","+f.east+","+f.north,g+="&imageDisplay="+this._tileWidth+","+this._tileHeight+",96",g+="&sr="+p,g+="&layers=visible",o(this._layers)&&(g+=":"+this._layers),o(this._token)&&(g+="&token="+this._token),o(this._proxy)&&(g=this._proxy.getURL(g)),c(g).then(function(e){var r=[],n=e.results;if(!o(n))return r;for(var a=0;a=p.zoomMin&&t<=p.zoomMax){var f=c.intersection(i,p.bbox,S);n(f)&&(u=!0)}}u&&r.push(s.credit)}return r}o(v.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._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 w=new c;v.prototype.getTileCredits=function(e,t,i){var r=this._tilingScheme.tileXYToRectangle(e,t,i,w),o=C(this._attributionList,i,r);return n(this._keyErrorCredit)&&o.push(this._keyErrorCredit),o},v.prototype.requestImage=function(e,t,i){var r=y(this,e,t,i);return g.loadImage(this,r)},v.prototype.pickFeatures=function(e,t,i,r,n){},v._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAaCAYAAAAEy1RnAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gIDEgcPTMnXOQAAClZJREFUWMPdWGtsFNcV/u689uH1+sXaONhlWQzBENtxiUFBpBSLd60IpXHSNig4URtSYQUkRJNSi0igViVVVBJBaBsiAgKRQJSG8AgEHCCWU4iBCprY2MSgXfOI16y9D3s9Mzsztz9yB12WNU2i9Ecy0tHOzN4793zn3POdcy7BnRfJ8I7iB3SRDPeEExswLz8Y0DZIAYDIRGAgLQAm+7Xle31J3L3Anp1MZPY+BUBjorN332vgYhpgV1FRUd6TTz45ubq6OtDV1SXpuu5g//Oept9wNwlMyAi8IXDjyF245TsDTdivDMATCATGNDU1/WbhwoWPTZs2bWx1dXWhx+Oxrl+/PqTrus5t9W8KWEzjinTAYhro/xuBStwiIgBnJBLxKIoy1u/3V/r9/krDMMz3339/Z3t7e38ikUgCMDLEt8W+Q0cAI3McYTDDmZxh7DESG5Ni43jg9Gsa+X+OsxWxPSJTSj3JZFK5ZRVJErOzs8e6XC4fgGwALhbzDgAKU1hK28KEA6PMmTMn56233qpevnz5PQDcbJ7EzVUAuMrLy3MBeABkcWOEDELSyFe4y7iMoHkriZZlKYZh8ASHZDKpJJPJHAC5APIA5APIAeBlCjo5TwlpXnbOmTPHP3fu3KZVq1atZKBcDJQ9x7V48WJfc3Pzhp6enj+tXLnyR8w4MjdG4gyVDk7KICMClzKlLUrpbQMNw5AkScppbGz8cWdn57WjR4/2caw+DEBlYjO8wX1foZQWuN3uKZIklQD4G+fhlG0Yl8uVm5WVVW6app6dne0D0G8vnxbjJntHubCUOK/badZICyWanrJuAaeUknTQpmlKkUhEWbx48U8LCwtHhUKha+fPn+85fPhwV0tLyzUACSZx9jvMFhIByNFoVDEMw/qKB5HPvJfkUqBr9+7deklJyZ/j8bi5ffv2OAslieMLsG+m2DybT2QuzEQOsF5SUqJfvXo1yc2l6Xn6rgSRSCSEc+fOhVeuXLmwoqJixvTp0wcWLFgQ7unpudHR0dF97ty5z/fu3XseQJh5adjeerquy5ZlCalUivh8Pt8HH3ywzOPxyD09PZ81NjZ+2NnZaQEQx40b54vFYqaqquEVK1b4a2tr/WvWrDn18ssv144fP36SqqoD69ev371nz57rDLwAwHHkyJGfjRs3rtowDOv06dOnu7q6rs6bN2/s7Nmz9zIjDKenWoFZKg/AlMLCwl82Nzf/m3LX22+/fXb06NF/ALC8u7u7m6ZdkUhksL29/UpLS0vzunXrVgAoBzAaQBGAiY2NjUui0ei1RCLRFwwG/9PX19cVi8WCqqoOdHd3HysrK6sDMCccDl8IBoOtiqIsOnbs2D+i0eiV3t7ez8Ph8GeRSKRT07TB/v7+i1OnTp0HYBqABzs7O/+paVo0Fot1RyKRi/F4/Gp/f39XIpHoZnoUMn6wU+ZtRDaymwmxZFk2AWjvvvvuJ/F4PMn/n5+fn1VeXu6fOXNmbU1NzUOM4Bz8QqIoyg6HwxuLxfq3bdu2a+vWrW/09/dfKy0tffDVV199BEC20+n0ud3uQgBup9Pp83g8JYqieE+ePPnxxo0bt33xxRen8/Ly7n3hhRcWASh47bXX5pWVldWFw+GuXbt27XjzzTd3BoPBDq/XG1AUZRRHmAKPVfqaoKkgCCkA+oYNG84Eg0FHTU1N5ezZs8eWlJQ4CSF8/LvZYhJPQoQQpFKpwcrKyo1su9HBwUF99erVv588eXINgOOmacIwDEopdaZSKUIpxYkTJz6sr68/BMBav379RcMwZk2aNOl+AP+qq6t7xDTNVEVFxR+j0WgSAJk4ceKlTz/9tNzpdHpZvIvpjVW6pykhhBJCbkvwgiAQQogEQL558ybdtGlTsLm5OWJZdxZmlmWll5OUEEJN0zSGhob6GcOrALSzZ8/2apqWcLlc2axGACNRkRAimqaph0Kh68xIwwB0y7IMSZKcABz5+fkl8Xj8y2g0apOb5na7rYGBgS/JV54Q0qpAAoBKaS0jBWClg1ZVFeFw2AlgVF1dXeDpp5+eWVFRUVpcXOzgvQwAbrcbDJhdudlGpKZpGtx6JCcnRxIEQbQsS2PjbjM+AMvlchnMSBaXkr7ymCCIhmEYfMoVRVESBEHI0CaTTNubssUsQRBuubCtra33pZdeCk6YMCGwZs2aipqaGn9paWmuJEl3JP0bN258eeTIkRMABrm0YomiaImiKGVlZeWxLecAgBkzZvgdDkfWjRs3ggA0bpfpoiiahBCqKEqKAy2yULMA6MlkMp6Xl3cP1x2SWCwmFhQU+CmlFhfHNFOevpX4LcvSJUkyAeDQoUOh119//fpTTz01Zf78+UWBQCBHUZQ7yE/TNGPfvn0n33vvvSP79+//BECMeZsCMGRZNgRBgNPpHHXx4sVVDQ0Nf1+wYMGYJ554YikAevDgwUMA4oIgQJZlSggZdDqdBiGEZGdn6ww0tQlJURTT4/EMHz9+/MCjjz7622AwuHbZsmVbiouLvWvXrm1wOp3ZqVRqaKQTIInf1gAMl8ulU0q1CxcuBGOxmL5u3bryQCDgycrKEjORXGtra8eOHTsOHz169OyVK1cuA+hlRYrGlNRkWR7UNO2mYRiaz+cb3dLS8gYhhOi6Hj116tSOVatWHQNALcsaME0zLghClBDSZ9+zQsZ2SoJS2udwOKLPPffcvsrKyrJAIPDQ/v37txiGofX19V3r7e29UlBQMHqEVpjwnrYA6PF4PK6q6s2qqqqpZWVlitvtljOB7enpiWzbtu3wgQMHTre1tV0E0MeKkkGuIhMAqHv37u30er3Px+NxlyiKygMPPOAnhFiXLl0Kbd68uYPNsXbu3Lk6mUwaqqr2btmyZUdtbe3hd955pwvAEFNcO3jw4K/b2tqiqqpGIpGI4/HHH/9rQ0PDCa/XOyoSidDLly8PNTU1PcZ4QuNK1ju6NYHFRAGASXPnzv1Fa2vrxzTDpapqateuXR/Nnz+/SVGUhwFMBzCBFSLZLF75DsrJGpXRAH4EIABgPIBxAEoBFAPwARjFif1sNzZ25+VlOhaxufcCqAFQC+BhAPVLliz5XSqVUkOhUAuAKWnFyR3dlsw+fg+A+8eMGfPzTZs2bY9GozEb8JkzZ9qXLl36l+Li4l8B+AmAyQDGsGrOzfXNPGPawG2l85jksmcPm+vihH+2W1iF3bvZPN+sWbPuGx4eDrW3t+85fvz41o6OjmZN04Y0TYvV19cvYIbN5QqUjG2mwj5YAqDK4XDMe+aZZ55vbW09+sorr2yuqqpqYFatAuBn3uB7XzJCY297XeaUd2RoGzOJmHb6IjFj5D777LP3DQwMfDw8PBxSVbUvkUj0hEKhj1588cXH2O7zMSPdplumoxveMx5Zlj3jx4/39vb26gMDA4MsvgYZo+p8Pr7LqQX5Ds/U7d0jFxUVZS1atKg4Nzc317Isp67rZldXV6y5ufkmI78hFtcmrx8ZweMit6XsUs4+6kmlgbW+peLf9gyMZNCR374G0y/FxEzX8b/8+bkXEBxKFwAAAABJRU5ErkJggg==",v.tileXYToQuadKey=function(e,t,i){for(var r="",n=i;n>=0;--n){var o=1<=0;--n){var o=1<e+Math.PI?e+=s.TWO_PI:ts.PI&&(C.longitude+=s.TWO_PI);var S=h(d,n,_.height,C.height,u);return c}function _(i,r,n,o,a,l,u){function c(t){var i=t.time/r;d.setView({orientation:{heading:s.lerp(m,o,i)}}),e.lerp(f,n,i,d.position);var a=g(i),l=d.frustum,u=l.top/l.right,c=.5*(a-(l.right-l.left));l.right+=c,l.left-=c,l.top=u*l.right,l.bottom=-l.top}var d=i.camera,f=t.clone(d.position,S),m=p(d.heading,o),_=d.frustum.right-d.frustum.left,g=h(d,n,_,n.z,u);return c}function g(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function v(e,t){function i(){"function"==typeof t&&t(),e.enableInputs=!0}return i}var y={},C=new t,w=new t,S=new t,E=new i,b=new i,T=new i,x=new t;return y.createTween=function(i,o){o=r(o,r.EMPTY_OBJECT);var l=o.destination,u=i.mode;if(u===c.MORPHING)return g();var d=r(o.convert,!0),h=i.mapProjection,p=h.ellipsoid,y=o.maximumHeight,C=o.easingFunction;d&&u!==c.SCENE3D&&(p.cartesianToCartographic(l,T),l=h.project(T,x));var w=i.camera,S=o.endTransform;n(S)&&w._setTransform(S);var E=o.duration;n(E)||(E=Math.ceil(t.distance(w.position,l)/1e6)+2,E=Math.min(E,3));var b=r(o.heading,0),A=r(o.pitch,-s.PI_OVER_TWO),P=r(o.roll,0),M=i.screenSpaceCameraController;M.enableInputs=!1;var D=v(M,o.complete),I=v(M,o.cancel),R=w.frustum,O=i.mode===c.SCENE2D;if(O=O&&e.equalsEpsilon(w.position,l,s.EPSILON6),O=O&&s.equalsEpsilon(Math.max(R.right-R.left,R.top-R.bottom),l.z,s.EPSILON6),O=O||i.mode!==c.SCENE2D&&t.equalsEpsilon(l,w.position,s.EPSILON10),O=O&&s.equalsEpsilon(s.negativePiToPi(b),s.negativePiToPi(w.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(A),s.negativePiToPi(w.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(P),s.negativePiToPi(w.roll),s.EPSILON10))return g(D,I);var N=new Array(4);if(N[c.SCENE2D]=_,N[c.SCENE3D]=m,N[c.COLUMBUS_VIEW]=f,E<=0){var L=function(){var e=N[u](i,1,l,b,A,P,y);e({time:1}),"function"==typeof D&&D()};return g(L,I)}var B=N[u](i,E,l,b,A,P,y);if(!n(C)){var F=w.positionCartographic.height,k=u===c.SCENE3D?p.cartesianToCartographic(l).height:l.z;C=F>k&&F>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:E,easingFunction:C,startObject:{time:0},stopObject:{time:E},update:B,complete:D,cancel:I}},y}),define("Scene/MapMode2D",["../Core/freezeObject"],function(e){"use strict";var t={ROTATE:0,INFINITE_SCROLL:1};return e(t)}),define("Scene/Camera",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/EllipsoidGeodesic","../Core/Event","../Core/HeadingPitchRange","../Core/HeadingPitchRoll","../Core/Intersect","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./MapMode2D","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(e){this._scene=e,this._transform=y.clone(y.IDENTITY),this._invTransform=y.clone(y.IDENTITY),this._actualTransform=y.clone(y.IDENTITY),this._actualInvTransform=y.clone(y.IDENTITY),this._transformChanged=!1,this.position=new i,this._position=new i,this._positionWC=new i,this._positionCartographic=new n,this.direction=new i,this._direction=new i,this._directionWC=new i,this.up=new i,this._up=new i,this._upWC=new i,this.right=new i,this._right=new i,this._rightWC=new i,this.frustum=new x,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=g.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 h,this._moveEnd=new h,this._changed=new h,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._viewMatrix=new y,this._invViewMatrix=new y,M(this),this._mode=A.SCENE3D,this._modeChanged=!0;var t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new n(Math.PI,g.PI_OVER_TWO)),this._max2Dfrustum=void 0,this._suspendTerrainAdjustment=!1,Y(this,P.DEFAULT_VIEW_RECTANGLE,this.position,!0);var r=i.magnitude(this.position);r+=r*P.DEFAULT_VIEW_FACTOR,i.normalize(this.position,this.position),i.multiplyByScalar(this.position,r,this.position)}function M(e){y.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),y.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),y.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function D(e){E.basisTo2D(e._projection,e._transform,e._actualTransform)}function I(e){var t=e._projection,n=t.ellipsoid,o=y.getColumn(e._transform,3,pe),a=n.cartesianToCartographic(o,ce),s=t.project(a,de),l=fe;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=r.clone(r.UNIT_X,ge),c=r.add(y.getColumn(e._transform,0,he),o,he);n.cartesianToCartographic(c,a),t.project(a,s);var d=me;d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,i.subtract(d,l,d),d.x=0;var h=_e;if(i.magnitudeSquared(d)>g.EPSILON10)i.cross(u,d,h);else{var p=r.add(y.getColumn(e._transform,1,he),o,he);n.cartesianToCartographic(p,a),t.project(a,s),h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,i.subtract(h,l,h),h.x=0,i.magnitudeSquared(h)g.EPSILON2){var v=1/i.magnitudeSquared(u),C=i.dot(u,s)*v,w=i.multiplyByScalar(s,C,ve);u=i.normalize(i.subtract(u,w,e._up),e._up),i.clone(u,e.up),d=i.cross(s,u,e._right),i.clone(d,e.right)}}(l||p)&&(e._directionWC=y.multiplyByPointAsVector(f,s,e._directionWC)),(c||p)&&(e._upWC=y.multiplyByPointAsVector(f,u,e._upWC)),(h||p)&&(e._rightWC=y.multiplyByPointAsVector(f,d,e._rightWC)),(a||l||c||h||p)&&M(e)}function O(e,t){var i;return i=g.equalsEpsilon(Math.abs(e.z),1,g.EPSILON3)?Math.atan2(t.y,t.x)-g.PI_OVER_TWO:Math.atan2(e.y,e.x)-g.PI_OVER_TWO,g.TWO_PI-g.zeroToTwoPi(i)}function N(e){return g.PI_OVER_TWO-g.acosClamped(e.z)}function L(e,t,i){var r=0;return g.equalsEpsilon(Math.abs(e.z),1,g.EPSILON3)||(r=Math.atan2(-i.z,t.z),r=g.zeroToTwoPi(r+g.TWO_PI)),r}function B(e,t,r){var n=y.clone(e.transform,Te),o=E.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,xe);e._setTransform(o),i.clone(i.ZERO,e.position),r.heading=r.heading-g.PI_OVER_TWO;var a=C.fromHeadingPitchRoll(r,Ae),s=v.fromQuaternion(a,Pe);v.getColumn(s,0,e.direction),v.getColumn(s,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(n)}function F(e,t,r,n){var o=y.clone(e.transform,Te);if(e._setTransform(y.IDENTITY),!i.equals(t,e.positionWC)){if(n){var a=e._projection,s=a.ellipsoid.cartesianToCartographic(t,Me);t=a.project(s,be)}i.clone(t,e.position)}r.heading=r.heading-g.PI_OVER_TWO;var l=C.fromHeadingPitchRoll(r,Ae),u=v.fromQuaternion(l,Pe);v.getColumn(u,0,e.direction),v.getColumn(u,2,e.up),i.cross(e.direction,e.up,e.right),e._setTransform(o)}function k(e,r,n,o){var a=y.clone(e.transform,Te);if(e._setTransform(y.IDENTITY),!i.equals(r,e.positionWC)){if(o){var s=e._projection,l=s.ellipsoid.cartesianToCartographic(r,Me);r=s.project(l,be)}t.clone(r,e.position);var u=.5*-r.z,c=-u,d=e.frustum;if(c>u){var h=d.top/d.right;d.right=c,d.left=u,d.top=d.right*h,d.bottom=-d.top}}if(e._scene.mapMode2D===T.ROTATE){n.heading=n.heading-g.PI_OVER_TWO,n.pitch=-g.PI_OVER_TWO,n.roll=0;var p=C.fromHeadingPitchRoll(n,Ae),f=v.fromQuaternion(p,Pe);v.getColumn(f,2,e.up),i.cross(e.direction,e.up,e.right)}e._setTransform(a)}function V(e,t,r,n){var o=i.clone(r.direction,De),a=i.clone(r.up,Ie);if(e._scene.mode===A.SCENE3D){var s=e._projection.ellipsoid,l=E.eastNorthUpToFixedFrame(t,s,ye),u=y.inverseTransformation(l,Ce);y.multiplyByPointAsVector(u,o,o),y.multiplyByPointAsVector(u,a,a)}var c=i.cross(o,a,Re);return n.heading=O(o,a),n.pitch=N(o),n.roll=L(o,a,c),n}function z(e,t){var i,r,n=e._scene.mapMode2D===T.ROTATE,o=e._maxCoord.x,a=e._maxCoord.y;n?(r=o,i=-r):(r=t.x-2*o,i=t.x+2*o),t.x>o&&(t.x=r),t.x<-o&&(t.x=i),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}function U(e,t){var r=e.position,n=i.normalize(r,Ue);if(a(e.constrainedAxis)){var o=i.equalsEpsilon(n,e.constrainedAxis,g.EPSILON2),s=i.equalsEpsilon(n,i.negate(e.constrainedAxis,We),g.EPSILON2);if(o||s)(o&&t<0||s&&t>0)&&e.rotate(e.right,t);else{var l=i.normalize(e.constrainedAxis,Ge),u=i.dot(n,l),c=g.acosClamped(u);t>0&&t>c&&(t=c-g.EPSILON4),u=i.dot(n,i.negate(l,We)),c=g.acosClamped(u),t<0&&-t>c&&(t=-c+g.EPSILON4);var d=i.cross(l,n,He);e.rotate(d,t)}}else e.rotate(e.right,t)}function G(e,t){a(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function H(e,t){var i=e.frustum;t*=.5;var r=i.right-t,n=i.left+t,o=e._maxCoord.x;e._scene.mapMode2D===T.ROTATE&&(o*=e.maximumZoomFactor),r>o&&(r=o,n=-o),r<=n&&(r=1,n=-1);var a=i.top/i.right;i.right=r,i.left=n,i.top=i.right*a,i.bottom=-i.top}function W(e,t){e.move(e.direction,t)}function q(e,t,r){t=g.clamp(t,-g.PI_OVER_TWO,g.PI_OVER_TWO),e=g.zeroToTwoPi(e)-g.PI_OVER_TWO;var n=C.fromAxisAngle(i.UNIT_Y,-t,Ye),o=C.fromAxisAngle(i.UNIT_Z,-e,Xe),a=C.multiply(o,n,o),s=v.fromQuaternion(a,Ze),l=i.clone(i.UNIT_X,je);return v.multiplyByVector(s,l,l),i.negate(l,l),i.multiplyByScalar(l,r,l),l}function j(e,t,r,n){var o=Math.abs(i.dot(t,r));return o/n-i.dot(e,r)}function Y(e,t,r,n){var o=e._projection.ellipsoid,s=n?e:st,l=t.north,u=t.south,c=t.east,h=t.west;h>c&&(c+=g.TWO_PI);var p,f=.5*(h+c);if(u<-g.PI_OVER_TWO+g.RADIANS_PER_DEGREE&&l>g.PI_OVER_TWO-g.RADIANS_PER_DEGREE)p=0;else{var m=Qe;m.longitude=f,m.latitude=l,m.height=0;var _=Je;_.longitude=f,_.latitude=u,_.height=0;var v=Ke;a(v)&&v.ellipsoid===o||(Ke=v=new d(void 0,void 0,o)),v.setEndPoints(m,_),p=v.interpolateUsingFraction(.5,Qe).latitude}var y=Qe;y.longitude=f,y.latitude=p,y.height=0;var C=o.cartographicToCartesian(y,ot),w=Qe;w.longitude=c,w.latitude=l;var S=o.cartographicToCartesian(w,$e);w.longitude=h;var E=o.cartographicToCartesian(w,tt);w.longitude=f;var b=o.cartographicToCartesian(w,rt);w.latitude=u;var T=o.cartographicToCartesian(w,nt);w.longitude=c;var x=o.cartographicToCartesian(w,it);w.longitude=h;var A=o.cartographicToCartesian(w,et);i.subtract(E,C,E),i.subtract(x,C,x),i.subtract(S,C,S),i.subtract(A,C,A),i.subtract(b,C,b),i.subtract(T,C,T);var P=o.geodeticSurfaceNormal(C,s.direction);i.negate(P,P);var M=i.cross(P,i.UNIT_Z,s.right);i.normalize(M,M);var D=i.cross(M,P,s.up),I=Math.tan(.5*e.frustum.fovy),R=e.frustum.aspectRatio*I,O=Math.max(j(P,D,E,I),j(P,D,x,I),j(P,D,S,I),j(P,D,A,I),j(P,D,b,I),j(P,D,T,I),j(P,M,E,R),j(P,M,x,R),j(P,M,S,R),j(P,M,A,R),j(P,M,b,R),j(P,M,T,R));if(u<0&&l>0){var N=Qe;N.longitude=h,N.latitude=0,N.height=0;var L=o.cartographicToCartesian(N,at);i.subtract(L,C,L),O=Math.max(O,j(P,D,L,I),j(P,M,L,R)),N.longitude=c,L=o.cartographicToCartesian(N,at),i.subtract(L,C,L),O=Math.max(O,j(P,D,L,I),j(P,M,L,R))}return i.add(C,i.multiplyByScalar(P,-O,at),r)}function X(e,t,i){var r=e._projection;t.west>t.east&&(t=S.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,a=lt;a.longitude=t.east,a.latitude=t.north;var s=r.project(a,ut);y.multiplyByPoint(n,s,s),y.multiplyByPoint(o,s,s),a.longitude=t.west,a.latitude=t.south;var l=r.project(a,ct);y.multiplyByPoint(n,l,l),y.multiplyByPoint(o,l,l);var u=Math.tan(.5*e.frustum.fovy),c=e.frustum.aspectRatio*u;return i.x=.5*(s.x-l.x)+l.x,i.y=.5*(s.y-l.y)+l.y,i.z=.5*Math.max((s.x-l.x)/c,(s.y-l.y)/u),i}function Z(e,t,i){var r=e._projection;t.west>t.east&&(t=S.MAX_VALUE);var n=dt;n.longitude=t.east,n.latitude=t.north;var o=r.project(n,ht);n.longitude=t.west,n.latitude=t.south;var a,s,l=r.project(n,pt),u=.5*Math.abs(o.x-l.x),c=.5*Math.abs(o.y-l.y),d=e.frustum.right/e.frustum.top,h=c*d;return u>h?(a=u,s=a/d):(s=c,a=h),c=Math.max(2*a,2*s),i.x=.5*(o.x-l.x)+l.x,i.y=.5*(o.y-l.y)+l.y,n=r.unproject(i,n),n.height=c,i=r.project(n,i)}function K(e,t,i,r){i=o(i,c.WGS84);var n=e.getPickRay(t,ft),a=_.rayEllipsoid(n,i);if(a){var s=a.start>0?a.start:a.stop;return w.getPoint(n,s,r)}}function Q(e,t,i,r){var n=e.getPickRay(t,mt),o=n.origin;o.z=0;var a=i.unproject(o);if(!(a.latitude<-g.PI_OVER_TWO||a.latitude>g.PI_OVER_TWO))return i.ellipsoid.cartographicToCartesian(a,r)}function J(e,t,r,n){var o=e.getPickRay(t,_t),a=-o.origin.x/o.direction.x;w.getPoint(o,a,n);var s=r.unproject(new i(n.y,n.z,0));if(!(s.latitude<-g.PI_OVER_TWO||s.latitude>g.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return r.ellipsoid.cartographicToCartesian(s,n)}function $(e,t,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=e.frustum.near,c=2/o*t.x-1,d=2/a*(a-t.y)-1,h=e.positionWC;i.clone(h,r.origin);var p=i.multiplyByScalar(e.directionWC,u,gt);i.add(h,p,p);var f=i.multiplyByScalar(e.rightWC,c*u*l,vt),m=i.multiplyByScalar(e.upWC,d*u*s,yt),_=i.add(p,f,r.direction);return i.add(_,m,_),i.subtract(_,h,_),i.normalize(_,_),r}function ee(e,t,r){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=2/o*t.x-1;s*=.5*(e.frustum.right-e.frustum.left);var l=2/a*(a-t.y)-1;l*=.5*(e.frustum.top-e.frustum.bottom);var u=r.origin;return i.clone(e.position,u),i.multiplyByScalar(e.right,s,Ct),i.add(Ct,u,u),i.multiplyByScalar(e.up,l,Ct),i.add(Ct,u,u),i.clone(e.directionWC,r.direction),r}function te(e,t,r,n,o,a){function s(r){var n=i.lerp(t,l,r.time,new i);e.worldToCameraCoordinatesPoint(n,e.position)}var l=i.clone(t);return r.y>n?l.y-=r.y-n:r.y<-n&&(l.y+=-n-r.y),r.z>o?l.z-=r.z-o:r.z<-o&&(l.z+=-o-r.z),{easingFunction:u.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:s}}function ie(e,t){var r=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(i.UNIT_X,bt),a=-i.dot(o,r)/i.dot(o,n),s=i.add(r,i.multiplyByScalar(n,a,Tt),Tt);e.cameraToWorldCoordinatesPoint(s,s),r=e.cameraToWorldCoordinatesPoint(e.position,xt);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=i.magnitude(i.subtract(r,s,At)),d=u*c,h=l*c,p=e._maxCoord.x,f=e._maxCoord.y,m=Math.max(d-p,p),_=Math.max(h-f,f);if(r.z<-m||r.z>m||r.y<-_||r.y>_){var g=s.y<-m||s.y>m,v=s.z<-_||s.z>_;if(g||v)return te(e,r,s,m,_,t)}}function re(e,t){var i=e.frustum,r=Math.tan(.5*i.fovy),n=i.aspectRatio*r;return Math.max(t/n,t/r)}function ne(e,t){var i,r,n=e.frustum,o=n.right/n.top,a=t*o;return t>a?(i=t,r=i/o):(r=t,i=a),1.5*Math.max(i,r)}function oe(e,t,i){a(i)||(i=p.clone(Dt));var r=i.range;if(!a(r)||0===r){var n=t.radius;0===n?i.range=It:i.range=e._mode===A.SCENE2D?ne(e,n):re(e,n)}return i}function ae(e,t){var r,n,o=t.radii,a=e.positionWC,s=i.multiplyComponents(t.oneOverRadii,a,zt),l=i.magnitude(s),u=i.normalize(s,Ut);i.equalsEpsilon(u,i.UNIT_Z,g.EPSILON10)?(r=new i(0,1,0),n=new i(0,0,1)):(r=i.normalize(i.cross(i.UNIT_Z,u,Gt),Gt),n=i.normalize(i.cross(u,r,Ht),Ht));var c=Math.sqrt(i.magnitudeSquared(s)-1),d=i.multiplyByScalar(u,1/l,zt),h=c/l,p=i.multiplyByScalar(r,h,Ut),f=i.multiplyByScalar(n,h,Gt),m=i.add(d,f,Wt[0]);i.subtract(m,p,m),i.multiplyComponents(o,m,m);var _=i.subtract(d,f,Wt[1]);i.subtract(_,p,_),i.multiplyComponents(o,_,_);var v=i.subtract(d,f,Wt[2]);i.add(v,p,v),i.multiplyComponents(o,v,v);var y=i.add(d,f,Wt[3]);return i.add(y,p,y),i.multiplyComponents(o,y,y),Wt}function se(e,t,i,r,n,o){qt.x=e,qt.y=t;var s=r.pickEllipsoid(qt,n,jt);return a(s)?(Yt[i]=n.cartesianToCartographic(s,Yt[i]),1):(Yt[i]=n.cartesianToCartographic(o[i],Yt[i]),0)}P.TRANSFORM_2D=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),P.TRANSFORM_2D_INVERSE=y.inverseTransformation(P.TRANSFORM_2D,new y),P.DEFAULT_VIEW_RECTANGLE=S.fromDegrees(-95,-20,-70,90),P.DEFAULT_VIEW_FACTOR=.5,P.prototype._updateCameraChanged=function(){var e=this;if(0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode===A.SCENE2D){if(!a(e._changedFrustum))return e._changedPosition=i.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var r,n=e.position,o=e._changedPosition,s=e.frustum,l=e._changedFrustum,u=n.x+s.left,c=n.x+s.right,d=o.x+l.left,h=o.x+l.right,p=n.y+s.bottom,f=n.y+s.top,m=o.y+l.bottom,_=o.y+l.top,v=Math.max(u,d),y=Math.min(c,h),C=Math.max(p,m),w=Math.min(f,_);if(v>=y||C>=f)r=1;else{var S=l;uh&&p_&&(S=s),r=1-(y-v)*(w-C)/((S.right-S.left)*(S.top-S.bottom))}return void(r>t&&(e._changed.raiseEvent(r),e._changedPosition=i.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum)))}if(!a(e._changedDirection))return e._changedPosition=i.clone(e.positionWC,e._changedPosition),void(e._changedDirection=i.clone(e.directionWC,e._changedDirection));var E=g.acosClamped(i.dot(e.directionWC,e._changedDirection)),b=E/(.5*e.frustum.fovy),T=i.distance(e.positionWC,e._changedPosition),x=T/e.positionCartographic.height;(b>t||x>t)&&(e._changed.raiseEvent(Math.max(b,x)),e._changedPosition=i.clone(e.positionWC,e._changedPosition),e._changedDirection=i.clone(e.directionWC,e._changedDirection))}};var le=new y,ue=new n;P.prototype._adjustHeightForTerrain=function(){var e=this._scene,t=e.screenSpaceCameraController,r=t.enableCollisionDetection,n=t.minimumCollisionTerrainHeight,o=t.minimumZoomDistance;if(!this._suspendTerrainAdjustment&&r){var s=this._mode,l=e.globe;if(a(l)&&s!==A.SCENE2D&&s!==A.MORPHING){var u,c,d=l.ellipsoid,h=e.mapProjection;y.equals(this.transform,y.IDENTITY)||(u=y.clone(this.transform,le),c=i.magnitude(this.position),this._setTransform(y.IDENTITY));var p=ue;s===A.SCENE3D?d.cartesianToCartographic(this.position,p):h.unproject(this.position,p);var f=!1;if(p.heightg.PI?g.TWO_PI-C:C,_=y}return g.equalsEpsilon(Math.abs(f),g.TWO_PI,g.EPSILON9)&&(r.west=-g.PI,r.east=g.PI,Yt[0].latitude>=0?r.north=g.PI_OVER_TWO:r.south=-g.PI_OVER_TWO),r}},P.clone=function(e,t){return a(t)||(t=new P(e._scene)),i.clone(e.position,t.position),i.clone(e.direction,t.direction),i.clone(e.up,t.up),i.clone(e.right,t.right),y.clone(e._transform,t.transform),t._transformChanged=!0,t},P}),define("Scene/CameraEventType",["../Core/freezeObject"],function(e){"use strict";var t={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};return e(t)}),define("Scene/CameraEventAggregator",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/KeyboardEventModifier","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./CameraEventType"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e,i){var r=e;return t(i)&&(r+="+"+i),r}function d(t,i){e.clone(t.distance.startPosition,i.distance.startPosition),e.clone(t.distance.endPosition,i.distance.endPosition),e.clone(t.angleAndHeight.startPosition,i.angleAndHeight.startPosition),e.clone(t.angleAndHeight.endPosition,i.angleAndHeight.endPosition)}function h(i,r,n){var o=c(u.PINCH,r),a=i._update,s=i._isDown,h=i._eventStartPosition,p=i._pressTime,f=i._releaseTime;a[o]=!0,s[o]=!1,h[o]=new e;var m=i._movement[o];t(m)||(m=i._movement[o]={}),m.distance={startPosition:new e,endPosition:new e},m.angleAndHeight={startPosition:new e,endPosition:new e},m.prevAngle=0,i._eventHandler.setInputAction(function(t){i._buttonsDown++,s[o]=!0,p[o]=new Date,e.lerp(t.position1,t.position2,.5,h[o])},l.PINCH_START,r),i._eventHandler.setInputAction(function(){i._buttonsDown=Math.max(i._buttonsDown-1,0),s[o]=!1,f[o]=new Date},l.PINCH_END,r),i._eventHandler.setInputAction(function(t){if(s[o]){a[o]?(d(t,m),a[o]=!1,m.prevAngle=m.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,m.distance.endPosition),e.clone(t.angleAndHeight.endPosition,m.angleAndHeight.endPosition));for(var i=m.angleAndHeight.endPosition.x,r=m.prevAngle,l=2*Math.PI;i>=r+Math.PI;)i-=l;for(;i0||e}}}),g.prototype.isMoving=function(e,t){var i=c(e,t);return!this._update[i]},g.prototype.getMovement=function(e,t){var i=c(e,t),r=this._movement[i];return r},g.prototype.getLastMovement=function(e,t){var i=c(e,t),r=this._lastMovement[i];if(r.valid)return r},g.prototype.isButtonDown=function(e,t){var i=c(e,t);return this._isDown[i]},g.prototype.getStartMousePosition=function(e,t){if(e===u.WHEEL)return this._currentMousePosition;var i=c(e,t);return this._eventStartPosition[i]},g.prototype.getButtonPressTime=function(e,t){var i=c(e,t);return this._pressTime[i]},g.prototype.getButtonReleaseTime=function(e,t){var i=c(e,t);return this._releaseTime[i]},g.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),r(this)},g}),define("Scene/UrlTemplateImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/isArray","../Core/loadJson","../Core/loadText","../Core/loadWithXhr","../Core/loadXML","../Core/Math","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C){"use strict";function w(e){this._errorEvent=new u,this._url=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesUrl=void 0,this._proxy=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.enablePickFeatures=!0,this.reinitialize(e)}function S(e,t,i,r){return re=!1,oe=!1,b(e,e._urlParts,function(n){return n(e,t,i,r)})}function E(e,t,i,r,n,o,a){return re=!1,oe=!1,se=!1,ce=!1,b(e,e._pickFeaturesUrlParts,function(s){return s(e,t,i,r,n,o,a)})}function b(e,t,i){for(var r="",n=0;n=0&&u1&&(i=i.length>=n?i:new Array(n-i.toString().length+1).join("0")+i)}}return i}function A(e,t,i,r){return x(e,"{x}",t)}function P(e,t,i,r){var n=e.tilingScheme.getNumberOfXTilesAtLevel(r)-t-1;return x(e,"{reverseX}",n)}function M(e,t,i,r){return x(e,"{y}",i)}function D(e,t,i,r){var n=e.tilingScheme.getNumberOfYTilesAtLevel(r)-i-1;return x(e,"{reverseY}",n)}function I(e,t,i,r){var n=e.maximumLevel,o=a(n)&&r0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=o(e.tileWidth,256),t._tileHeight=o(e.tileHeight,256),t._minimumLevel=o(e.minimumLevel,0),t._maximumLevel=e.maximumLevel,t._tilingScheme=o(e.tilingScheme,new v({ellipsoid:e.ellipsoid})),t._rectangle=o(e.rectangle,t._tilingScheme.rectangle),t._rectangle=g.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=o(e.hasAlphaChannel,!0);var i=e.credit;return"string"==typeof i&&(i=new n(i)),t._credit=i,t._urlParts=T(t._url,pe),t._pickFeaturesUrlParts=T(t._pickFeaturesUrl,fe),!0})},w.prototype.getTileCredits=function(e,t,i){},w.prototype.requestImage=function(e,t,i){var r=S(this,e,t,i);return C.loadImage(this,r)},w.prototype.pickFeatures=function(e,t,i,r,n){function o(e,t){return e.callback(t)}function s(){if(l>=u._getFeatureInfoFormats.length)return y([]);var a=u._getFeatureInfoFormats[l],c=E(u,e,t,i,r,n,a.format);return++l,"json"===a.type?h(c).then(a.callback).otherwise(s):"xml"===a.type?m(c).then(a.callback).otherwise(s):"text"===a.type||"html"===a.type?p(c).then(a.callback).otherwise(s):f({url:c,responseType:a.format}).then(o.bind(void 0,a)).otherwise(s)}if(this.enablePickFeatures&&a(this._pickFeaturesUrl)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return s()}};var re=!1,ne=new g,oe=!1,ae=new g,se=!1,le=new e,ue=new g,ce=!1,de=new t,he=new i,pe={"{x}":A,"{y}":M,"{z}":R,"{s}":O,"{reverseX}":P,"{reverseY}":D,"{reverseZ}":I,"{westDegrees}":L,"{southDegrees}":B,"{eastDegrees}":F,"{northDegrees}":k,"{westProjected}":z,"{southProjected}":U,"{eastProjected}":G,"{northProjected}":H,"{width}":W,"{height}":q},fe=r(pe,{"{i}":j,"{j}":Y,"{reverseI}":X,"{reverseJ}":Z,"{longitudeDegrees}":Q,"{latitudeDegrees}":J,"{longitudeProjected}":$,"{latitudeProjected}":ee,"{format}":ie});return w}),define("Scene/createOpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/DeveloperError","../Core/Rectangle","../Core/WebMercatorTilingScheme","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,{});var a=t(i.url,"https://a.tile.openstreetmap.org/");s.test(a)||(a+="/");var u=t(i.fileExtension,"png"),c=new n({ellipsoid:i.ellipsoid}),d=256,h=256,p=t(i.minimumLevel,0),f=i.maximumLevel,m=t(i.rectangle,c.rectangle),_=c.positionToTileXY(r.southwest(m),p),g=c.positionToTileXY(r.northeast(m),p),v=((Math.abs(g.x-_.x)+1)*(Math.abs(g.y-_.y)+1),t(i.credit,l));"string"==typeof v&&(v=new e(v));var y=a+"{z}/{x}/{y}."+u;return new o({url:y,proxy:i.proxy,credit:v,tilingScheme:c,tileWidth:d,tileHeight:h,minimumLevel:p,maximumLevel:f,rectangle:m})}var s=/\/$/,l=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return a}),define("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var u=[],c=r.geometry;i(c.attributes)&&i(c.primitiveType)||(c=c.constructor.createGeometry(c));var d=c.attributes,h=a.clone(t(r.modelMatrix,a.IDENTITY)),p=t(r.length,1e4);if(i(d.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",p),attributes:{color:new e(1,0,0,1)},modelMatrix:h})),i(d.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",p),attributes:{color:new e(0,1,0,1)},modelMatrix:h})),i(d.bitangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"bitangent",p),attributes:{color:new e(0,0,1,1)},modelMatrix:h})),u.length>0)return new l({asynchronous:!1,geometryInstances:u,appearance:new s({flat:!0,translucent:!1})})}return u}),define("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(n){function f(s){for(var h,p,f,m,w=/tileformat/i,S=/tileset/i,E=/tilesets/i,b=/boundingbox/i,T=/srs/i,x=[],A=s.childNodes[0].childNodes,P=0;PF.rectangle.east&&(V.east=F.rectangle.east),V.southF.rectangle.north&&(V.north=F.rectangle.north);var Y=F.positionToTileXY(l.southwest(V),N),X=F.positionToTileXY(l.northeast(V),N),Z=(Math.abs(X.x-Y.x)+1)*(Math.abs(X.y-Y.y)+1);Z>4&&(N=0);var K=a(v,"{z}/{x}/{reverseY}."+I);y.resolve({url:K,tilingScheme:F,rectangle:V,tileWidth:R,tileHeight:O,minimumLevel:N,maximumLevel:L,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function m(e){var t=i(n.fileExtension,"png"),o=i(n.tileWidth,256),s=i(n.tileHeight,256),l=i(n.minimumLevel,0),u=n.maximumLevel,c=r(n.tilingScheme)?n.tilingScheme:new d({ellipsoid:n.ellipsoid}),h=i(n.rectangle,c.rectangle),p=a(v,"{z}/{x}/{reverseY}."+t);y.resolve({url:p,tilingScheme:c,rectangle:h,tileWidth:o,tileHeight:s,minimumLevel:l,maximumLevel:u,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function _(){var e=a(v,"tilemapresource.xml"),t=n.proxy;r(t)&&(e=t.getURL(e)),s(e).then(f).otherwise(m)}n=i(n,{});var g,v=n.url,y=h.defer(),C=new p(y.promise);return _(),C}return f}),define("Scene/CreditDisplay",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n){"use strict";function o(e,t,r){if(!i(e.element)){var n=e.text,o=e.link,a=document.createElement("span");if(e.hasLink()){var s=document.createElement("a");s.textContent=n,s.href=o,s.target="_blank",a.appendChild(s)}else a.textContent=n;a.className="cesium-credit-text",e.element=a}if(t.hasChildNodes()){var l=document.createElement("span");l.textContent=r,l.className="cesium-credit-delimiter",t.appendChild(l)}t.appendChild(e.element)}function a(e,t){if(!i(e.element)){var r=e.text,n=e.link,o=document.createElement("span"),a=document.createElement("img");if(a.src=e.imageUrl,a.style["vertical-align"]="bottom",i(r)&&(a.alt=r,a.title=r),e.hasLink()){var s=document.createElement("a");s.appendChild(a),s.href=n,s.target="_blank",o.appendChild(s)}else o.appendChild(a);o.className="cesium-credit-image",e.element=o}t.appendChild(e.element)}function s(t,i){for(var r=t.length,n=0;n= 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_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\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);\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}\n"}),define("Shaders/EllipsoidVS",[],function(){"use strict";return"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);\n}\n"}),define("Scene/EllipsoidPrimitive",["../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S){"use strict";function E(t){t=n(t,n.EMPTY_OBJECT),this.center=i.clone(n(t.center,i.ZERO)),this._center=new i,this.radii=i.clone(t.radii),this._radii=new i,this._oneOverEllipsoidRadiiSquared=new i,this._boundingSphere=new e,this.modelMatrix=l.clone(n(t.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this._computedModelMatrix=new l,this.show=n(t.show,!0),this.material=n(t.material,w.fromType(w.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=n(t.debugShowBoundingVolume,!1),this.onlySunLighting=n(t.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=n(t.depthTestEnabled,!0),this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new d({owner:n(t._owner,this)}),this._pickCommand=new d({owner:n(t._owner,this)});var r=this;this._uniforms={u_radii:function(){return r.radii},u_oneOverEllipsoidRadiiSquared:function(){return r._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return r._pickId.color}}}function b(e){var r=e.cache.ellipsoidPrimitive_vertexArray;if(o(r))return r;var n=t.createGeometry(t.fromDimensions({dimensions:new i(2,2,2),vertexFormat:u.POSITION_ONLY}));return r=_.fromGeometry({context:e,geometry:n,attributeLocations:T,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=r,r}var T={position:0};return E.prototype.update=function(t){if(this.show&&t.mode===S.SCENE3D&&o(this.center)&&o(this.radii)){var n=t.context,a=this.material.isTranslucent(),s=this._translucent!==a;o(this._rs)&&!s||(this._translucent=a,this._rs=p.fromCache({cull:{enabled:!0,face:C.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!a&&n.fragmentDepth,blending:a?y.ALPHA_BLEND:void 0})),o(this._va)||(this._va=b(n));var u=!1,c=this.radii;if(!i.equals(this._radii,c)){i.clone(c,this._radii);var d=this._oneOverEllipsoidRadiiSquared;d.x=1/(c.x*c.x),d.y=1/(c.y*c.y),d.z=1/(c.z*c.z),u=!0}l.equals(this.modelMatrix,this._modelMatrix)&&i.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),i.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),u=!0),u&&(i.clone(i.ZERO,this._boundingSphere.center),this._boundingSphere.radius=i.maximumComponent(c),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var _=this._material!==this.material;this._material=this.material,this._material.update(n);var w=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var E,x=this._colorCommand;(_||w||s)&&(E=new m({sources:[this.material.shaderSource,g]}),this.onlySunLighting&&E.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&E.defines.push("WRITE_DEPTH"),this._sp=f.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:T}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._sp,x.uniformMap=r(this._uniforms,this.material._uniforms),x.executeInClosestFrustum=a);var A=t.commandList,P=t.passes;if(P.render&&(x.boundingVolume=this._boundingSphere,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.modelMatrix=this._computedModelMatrix,x.pass=a?h.TRANSLUCENT:h.OPAQUE,A.push(x)),P.pick){var M=this._pickCommand;o(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=n.createPickId({primitive:this,id:this.id})),(_||w||!o(this._pickSP))&&(E=new m({sources:[this.material.shaderSource,g],pickColorQualifier:"uniform"}),this.onlySunLighting&&E.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&E.defines.push("WRITE_DEPTH"),this._pickSP=f.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:v,fragmentShaderSource:E,attributeLocations:T}),M.vertexArray=this._va,M.renderState=this._rs,M.shaderProgram=this._pickSP,M.uniformMap=r(r(this._uniforms,this._pickUniforms),this.material._uniforms),M.executeInClosestFrustum=a),M.boundingVolume=this._boundingSphere,M.modelMatrix=this._computedModelMatrix,M.pass=a?h.TRANSLUCENT:h.OPAQUE,A.push(M)}}},E.prototype.isDestroyed=function(){return!1},E.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(),a(this)},E}),define("Shaders/Appearances/EllipsoidSurfaceAppearanceFS",[],function(){"use strict";return"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);\n#endif\n}\n"}),define("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"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"}),define("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=e(i.translucent,!0),l=e(i.aboveGround,!1);this.material=t(i.material)?i.material:s.fromType(s.ColorType),this.translucent=e(i.translucent,!0),this._vertexShaderSource=e(i.vertexShaderSource,o),this._fragmentShaderSource=e(i.fragmentShaderSource,n),this._renderState=a.getDefaultRenderState(r,!l,i.renderState),this._closed=!1,this._flat=e(i.flat,!1),this._faceForward=e(i.faceForward,l),this._aboveGround=l}return i(l.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 l.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),l.VERTEX_FORMAT=r.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),define("Scene/Fog",["../Core/Cartesian3","../Core/defined","../Core/Math","./SceneMode"],function(e,t,i,r){"use strict";function n(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2}function o(e){var t=a,i=t.length;if(et[i-1])return h=i-2;if(e>=t[h]){if(h+1=0&&e>=t[h-1])return--h,h;var r;for(r=0;r=t[r]&&e8e5||n.mode!==r.SCENE3D)return void(n.fog.enabled=!1);var f=h.height,m=o(f),_=i.clamp((f-a[m])/(a[m+1]-a[m]),0,1),g=i.lerp(s[m],s[m+1],_),v=1e6*this.density,y=v/u*c;g=g*(v-y)*1e-6;var C=e.normalize(d.positionWC,p),w=i.clamp(e.dot(d.directionWC,C),0,1);g*=1-w,n.fog.density=g,n.fog.sse=this.screenSpaceErrorFactor}},n}),define("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/TimeConstants"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){function r(){c(n)}this._scene=i.scene,this.samplingWindow=e(i.samplingWindow,l.defaultSettings.samplingWindow),this.quietPeriod=e(i.quietPeriod,l.defaultSettings.quietPeriod),this.warmupPeriod=e(i.warmupPeriod,l.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(i.minimumFrameRateDuringWarmup,l.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(i.minimumFrameRateAfterWarmup,l.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new o,this._nominalFrameRate=new o,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var n=this;this._preRenderRemoveListener=this._scene.preRender.addEventListener(function(e,t){u(n,t)}),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 a=void 0!==document.hidden?"visibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0;this._visibilityChangeRemoveListener=void 0,t(a)&&(document.addEventListener(a,r,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(a,r,!1)})}function u(e,t){if(!(e._pauseCount>0)){var i=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=i+e.quietPeriod/s.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/s.SECONDS_PER_MILLISECOND;else if(i>=e._quietPeriodEndTime){e._frameTimes.push(i);var r=i-e.samplingWindow/s.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=r){for(;e._frameTimes.length>=2&&e._frameTimes[1]e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);n>o?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 c(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}return l.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},l.fromScene=function(e){return t(e._frameRateMonitor)&&!e._frameRateMonitor.isDestroyed()||(e._frameRateMonitor=new l({scene:e})),e._frameRateMonitor},i(l.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}}}),l.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},l.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._preRenderRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),r(this)},l}),define("Scene/FrameState",["./SceneMode"],function(e){"use strict";function t(t,i){this.context=t,this.commandList=[],this.shadowMaps=[],this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.time=void 0,this.mapProjection=void 0,this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.passes={render:!1,pick:!1,depth:!1},this.creditDisplay=i,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0},this.terrainExaggeration=1,this.shadowHints={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.imagerySplitPosition=0,this.frustumSplits=[]}return t}),define("Scene/FrustumCommands",["../Core/defaultValue","../Renderer/Pass"],function(e,t){"use strict";function i(i,r){this.near=e(i,0),this.far=e(r,0);for(var n=t.NUMBER_OF_PASSES,o=new Array(n),a=new Array(n),s=0;s= edgeVert;\nfloat lengthSign = horzSpan ? -rcpFrame.y : -rcpFrame.x;\nif(!horzSpan)\n{\nlumaN = lumaW;\nlumaS = lumaE;\n}\nfloat gradientN = abs(lumaN - lumaM);\nfloat gradientS = abs(lumaS - lumaM);\nlumaN = (lumaN + lumaM) * 0.5;\nlumaS = (lumaS + lumaM) * 0.5;\nif (gradientN < gradientS)\n{\nlumaN = lumaS;\nlumaN = lumaS;\ngradientN = gradientS;\nlengthSign *= -1.0;\n}\nvec2 posN;\nposN.x = pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);\nposN.y = pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);\ngradientN *= FXAA_SEARCH_THRESHOLD;\nvec2 posP = posN;\nvec2 offNP = horzSpan ? vec2(rcpFrame.x, 0.0) : vec2(0.0, rcpFrame.y);\nfloat lumaEndN = lumaN;\nfloat lumaEndP = lumaN;\nbool doneN = false;\nbool doneP = false;\nposN += offNP * vec2(-1.0, -1.0);\nposP += offNP * vec2( 1.0, 1.0);\nfor(int i = 0; i < FXAA_SEARCH_STEPS; i++) {\nif(!doneN)\n{\nlumaEndN = FxaaLuma(texture2D(tex, posN.xy).xyz);\n}\nif(!doneP)\n{\nlumaEndP = FxaaLuma(texture2D(tex, posP.xy).xyz);\n}\ndoneN = doneN || (abs(lumaEndN - lumaN) >= gradientN);\ndoneP = doneP || (abs(lumaEndP - lumaN) >= gradientN);\nif(doneN && doneP)\n{\nbreak;\n}\nif(!doneN)\n{\nposN -= offNP;\n}\nif(!doneP)\n{\nposP += offNP;\n}\n}\nfloat dstN = horzSpan ? pos.x - posN.x : pos.y - posN.y;\nfloat dstP = horzSpan ? posP.x - pos.x : posP.y - pos.y;\nbool directionN = dstN < dstP;\nlumaEndN = directionN ? lumaEndN : lumaEndP;\nif(((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))\n{\nlengthSign = 0.0;\n}\nfloat spanLength = (dstP + dstN);\ndstN = directionN ? dstN : dstP;\nfloat subPixelOffset = (0.5 + (dstN * (-1.0/spanLength))) * lengthSign;\nvec3 rgbF = texture2D(tex, vec2(\npos.x + (horzSpan ? 0.0 : subPixelOffset),\npos.y + (horzSpan ? subPixelOffset : 0.0))).xyz;\nreturn FxaaLerp3(rgbL, rgbF, blendL);\n}\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = vec4(FxaaPixelShader(v_textureCoordinates, u_texture, u_step), 1.0);\n}\n"}),define("Scene/FXAA",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/FXAA"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t){this._texture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=void 0,this._command=void 0,this._viewport=new e,this._rs=void 0;var r=new a({color:new i(0,0,0,0),depth:1,owner:this});this._clearCommand=r}function m(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,r(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(), -e._command=void 0)}return f.prototype.update=function(i){var n=i.drawingBufferWidth,a=i.drawingBufferHeight,f=this._texture,m=!r(f)||f.width!==n||f.height!==a;if(m&&(this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),this._texture=new h({context:i,width:n,height:a,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE}),i.depthTexture?this._depthStencilTexture=new h({context:i,width:n,height:a,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}):this._depthStencilRenderbuffer=new u({context:i,width:n,height:a,format:c.DEPTH_STENCIL})),r(this._fbo)&&!m||(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:i,colorTextures:[this._texture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})),r(this._command)||(this._command=i.createViewportQuadCommand(p,{owner:this})),this._viewport.width=n,this._viewport.height=a,r(this._rs)&&e.equals(this._rs.viewport,this._viewport)||(this._rs=d.fromCache({viewport:this._viewport})),this._command.renderState=this._rs,m){var _=this,g=new t(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return _._texture},u_step:function(){return g}}}},f.prototype.execute=function(e,t){this._command.execute(e,t)},f.prototype.clear=function(e,t,r){var n=t.framebuffer;t.framebuffer=this._fbo,i.clone(r,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=n},f.prototype.getColorFramebuffer=function(){return this._fbo},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return m(this),n(this)},f}),define("Scene/GetFeatureInfoFormat",["../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","./ImageryLayerFeatureInfo"],function(e,t,i,r,n){"use strict";function o(e,i,r){this.type=e,t(i)||("json"===e?i="application/json":"xml"===e?i="text/xml":"html"===e?i="text/html":"text"===e&&(i="text/plain")),this.format=i,t(r)||("json"===e?r=a:"xml"===e?r=s:"html"===e?r=m:"text"===e&&(r=m)),this.callback=r}function a(i){for(var r=[],o=i.features,a=0;a0)for(var o=0;o1&&(t=i[1]);var r=new n;return r.name=t,r.description=e,r.data=e,[r]}}var _="http://www.mapinfo.com/mxp",g="http://www.esri.com/wms",v="http://www.opengis.net/wfs",y="http://www.opengis.net/gml",C=/\s*<\/body>/im,w=//im,S=/([\s\S]*)<\/title>/im;return o}),define("Shaders/GlobeFS",[],function(){"use strict";return"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\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#ifdef ENABLE_DAYNIGHT_SHADING\nuniform vec2 u_lightingFadeDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D texture,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nfloat split)\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(texture, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\n#ifdef APPLY_SPLIT\nfloat splitPosition = czm_imagerySplitPosition * czm_viewport.z;\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\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue);\nvoid main()\n{\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)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\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);\n}\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\nfloat cameraDist = length(czm_view[3]);\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nfloat t = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, t);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef FOG\nconst float fExposure = 2.0;\nvec3 fogColor = v_mieColor + finalColor.rgb * v_rayleighColor;\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\ngl_FragColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#else\ngl_FragColor = finalColor;\n#endif\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)\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_sunDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\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_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular, imageryColor.a);\n}\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n"}),define("Shaders/GlobeVS",[],function(){"use strict";return"#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 FOG\nvarying float v_distance;\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\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(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\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)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nv_normalMC = czm_octDecode(encodedNormal);\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#ifdef FOG\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(position3DWC);\nv_mieColor = atmosColor.mie;\nv_rayleighColor = atmosColor.rayleigh;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n}\n"}),define("Shaders/GroundAtmosphere",[],function(){"use strict";return"const float fInnerRadius = 6378137.0;\nconst float fOuterRadius = 6378137.0 * 1.025;\nconst float fOuterRadius2 = fOuterRadius * fOuterRadius;\nconst 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 float fScale = 1.0 / (fOuterRadius - fInnerRadius);\nconst float fScaleDepth = 0.25;\nconst float fScaleOverScaleDepth = fScale / fScaleDepth;\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)\n{\nvec3 v3InvWavelength = vec3(1.0 / pow(0.650, 4.0), 1.0 / pow(0.570, 4.0), 1.0 / pow(0.475, 4.0));\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 = 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"}),define("Scene/GlobeSurfaceShaderSet",["../Core/defined","../Core/destroyObject","../Core/TerrainQuantization","../Renderer/ShaderProgram","../Scene/SceneMode"],function(e,t,i,r,n){"use strict";function o(e,t,i){this.numberOfDayTextures=e,this.flags=t,this.shaderProgram=i}function a(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this._pickShaderPrograms=[]}function s(e){var t,i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",r="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",o="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }";switch(e){case n.SCENE3D:t=i;break;case n.SCENE2D:case n.COLUMBUS_VIEW:t=r;break;case n.MORPHING:t=o}return t}function l(e){var t="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }",i="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }";return e?i:t}return a.prototype.getShaderProgram=function(t,n,a,u,c,d,h,p,f,m,_,g,v,y,C,w){var S=0,E="",b=n.pickTerrain.mesh.encoding,T=b.quantization;T===i.BITS12&&(S=1,E="QUANTIZATION_BITS12");var x=t.mode,A=x|u<<2|c<<3|d<<4|h<<5|p<<6|f<<7|_<<8|g<<9|v<<10|y<<11|C<<12|w<<13|S<<14|m<<15,P=n.surfaceShader;if(e(P)&&P.numberOfDayTextures===a&&P.flags===A)return P.shaderProgram;var M=this._shadersByTexturesFlags[a];if(e(M)||(M=this._shadersByTexturesFlags[a]=[]),P=M[A],!e(P)){var D=this.baseVertexShaderSource.clone(),I=this.baseFragmentShaderSource.clone();D.defines.push(E),I.defines.push("TEXTURE_UNITS "+a),u&&I.defines.push("APPLY_BRIGHTNESS"),c&&I.defines.push("APPLY_CONTRAST"),d&&I.defines.push("APPLY_HUE"),h&&I.defines.push("APPLY_SATURATION"),p&&I.defines.push("APPLY_GAMMA"),f&&I.defines.push("APPLY_ALPHA"),_&&(I.defines.push("SHOW_REFLECTIVE_OCEAN"),D.defines.push("SHOW_REFLECTIVE_OCEAN")),g&&I.defines.push("SHOW_OCEAN_WAVES"),v&&(y?(D.defines.push("ENABLE_VERTEX_LIGHTING"),I.defines.push("ENABLE_VERTEX_LIGHTING")):(D.defines.push("ENABLE_DAYNIGHT_SHADING"),I.defines.push("ENABLE_DAYNIGHT_SHADING"))),D.defines.push("INCLUDE_WEB_MERCATOR_Y"),I.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(D.defines.push("FOG"),I.defines.push("FOG")),m&&I.defines.push("APPLY_SPLIT");for(var R=" vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n {\n vec4 color = initialColor;\n",O=0;O<a;++O)R+=" color = sampleAndBlend(\n color,\n u_dayTextures["+O+"],\n u_dayTextureUseWebMercatorT["+O+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+O+"],\n u_dayTextureTranslationAndScale["+O+"],\n "+(f?"u_dayTextureAlpha["+O+"]":"1.0")+",\n "+(u?"u_dayTextureBrightness["+O+"]":"0.0")+",\n "+(c?"u_dayTextureContrast["+O+"]":"0.0")+",\n "+(d?"u_dayTextureHue["+O+"]":"0.0")+",\n "+(h?"u_dayTextureSaturation["+O+"]":"0.0")+",\n "+(p?"u_dayTextureOneOverGamma["+O+"]":"0.0")+",\n "+(m?"u_dayTextureSplit["+O+"]":"0.0")+"\n );\n";R+=" return color;\n }",I.sources.push(R),D.sources.push(s(x)),D.sources.push(l(C));var N=r.fromCache({context:t.context,vertexShaderSource:D,fragmentShaderSource:I,attributeLocations:b.getAttributeLocations()});P=M[A]=new o(a,A,N)}return n.surfaceShader=P,P.shaderProgram},a.prototype.getPickShaderProgram=function(t,n,o){var a=0,u="",c=n.pickTerrain.mesh.encoding,d=c.quantization;d===i.BITS12&&(a=1,u="QUANTIZATION_BITS12");var h=t.mode,p=h|o<<2|a<<3,f=this._pickShaderPrograms[p];if(!e(f)){var m=this.baseVertexShaderSource.clone();m.defines.push(u),m.sources.push(s(h)),m.sources.push(l(o));var _="void main()\n{\n gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n";f=this._pickShaderPrograms[p]=r.fromCache({context:t.context,vertexShaderSource:m,fragmentShaderSource:_,attributeLocations:c.getAttributeLocations()})}return f},a.prototype.destroy=function(){var i,r,n=this._shadersByTexturesFlags;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];if(!e(a))continue;for(i in a)a.hasOwnProperty(i)&&(r=a[i],e(r)&&r.shaderProgram.destroy())}var s=this._pickShaderPrograms;for(i in s)s.hasOwnProperty(i)&&(r=s[i],r.destroy());return t(this)},a}),define("Scene/ImageryState",["../Core/freezeObject"],function(e){"use strict";var t={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};return e(t)}),define("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,DONE:2,FAILED:3};return e(t)}),define("Scene/TerrainState",["../Core/freezeObject"],function(e){"use strict";var t={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};return e(t)}),define("Scene/TileBoundingBox",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/Rectangle","./SceneMode"],function(e,t,i,r,n,o,a,s){"use strict";function l(t,i,r){r.cartographicToCartesian(a.southwest(i),t.southwestCornerCartesian),r.cartographicToCartesian(a.northeast(i),t.northeastCornerCartesian),f.longitude=i.west,f.latitude=.5*(i.south+i.north),f.height=0;var n=r.cartographicToCartesian(f,h),o=e.cross(n,e.UNIT_Z,c);e.normalize(o,t.westNormal),f.longitude=i.east;var s=r.cartographicToCartesian(f,p),l=e.cross(e.UNIT_Z,s,c);e.normalize(l,t.eastNormal);var u=r.geodeticSurfaceNormalCartographic(a.southeast(i),d),m=e.subtract(n,s,c),_=e.cross(u,m,d);e.normalize(_,t.southNormal);var g=r.geodeticSurfaceNormalCartographic(a.northwest(i),d),v=e.cross(m,g,d);e.normalize(v,t.northNormal)}var u=function(t){t=i(t,i.EMPTY_OBJECT),this.rectangle=a.clone(t.rectangle),this.minimumHeight=i(t.minimumHeight,0),this.maximumHeight=i(t.maximumHeight,0),this.southwestCornerCartesian=new e,this.northeastCornerCartesian=new e,this.westNormal=new e,this.southNormal=new e,this.eastNormal=new e,this.northNormal=new e;var r=i(t.ellipsoid,o.WGS84);l(this,t.rectangle,r)},c=new e,d=new e,h=new e,p=new e,f=new t,m=new e,_=new e,g=new e(0,-1,0),v=new e(0,0,-1),y=new e;return u.prototype.distanceToCamera=function(t){var i=t.camera,r=i.positionWC,n=i.positionCartographic,o=0;if(!a.contains(this.rectangle,n)){var l=this.southwestCornerCartesian,u=this.northeastCornerCartesian,c=this.westNormal,d=this.southNormal,h=this.eastNormal,p=this.northNormal;t.mode!==s.SCENE3D&&(l=t.mapProjection.project(a.southwest(this.rectangle),m),l.z=l.y,l.y=l.x,l.x=0,u=t.mapProjection.project(a.northeast(this.rectangle),_),u.z=u.y,u.y=u.x,u.x=0,c=g,h=e.UNIT_Y,d=v,p=e.UNIT_Z);var f=e.subtract(r,l,y),C=e.dot(f,c),w=e.dot(f,d),S=e.subtract(r,u,y),E=e.dot(S,h),b=e.dot(S,p);C>0?o+=C*C:E>0&&(o+=E*E),w>0?o+=w*w:b>0&&(o+=b*b)}var T;T=t.mode===s.SCENE3D?n.height:r.x;var x=t.mode===s.SCENE3D?this.maximumHeight:0,A=T-x;return A>0&&(o+=A*A),Math.sqrt(o)},u}),define("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/OrientedBoundingBox","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/VertexArray","../ThirdParty/when","./TerrainState","./TileBoundingBox"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(e){this.state=d.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e}function f(e,t,r,n,o){function s(t){e.data=t,e.state=d.RECEIVED}function l(){e.state=d.FAILED;var i="Failed to obtain terrain tile X: "+r+" Y: "+n+" Level: "+o+".";t._requestError=a.handleError(t._requestError,t,t.errorEvent,i,r,n,o,u)}function u(){e.data=t.requestTileGeometry(r,n,o),i(e.data)?(e.state=d.RECEIVING,c(e.data,s,l)):e.state=d.UNLOADED}u()}function m(e,t,r,n,o,a){var s=r.tilingScheme,l=e.data,u=l.createMesh(s,n,o,a,t.terrainExaggeration);i(u)&&(e.state=d.TRANSFORMING,c(u,function(t){e.mesh=t,e.state=d.TRANSFORMED},function(){e.state=d.FAILED}))}function _(e,t,r,o,a,c){var h=e.mesh.vertices,p=s.createVertexBuffer({context:t,typedArray:h,usage:l.STATIC_DRAW}),f=e.mesh.encoding.getAttributes(p),m=e.mesh.indices.indexBuffers||{},_=m[t.id];if(!i(_)||_.isDestroyed()){var g=e.mesh.indices,v=2===g.BYTES_PER_ELEMENT?n.UNSIGNED_SHORT:n.UNSIGNED_INT;_=s.createIndexBuffer({context:t,typedArray:g,usage:l.STATIC_DRAW,indexDatatype:v}),_.vertexArrayDestroyable=!1,_.referenceCount=1,m[t.id]=_,e.mesh.indices.indexBuffers=m}else++_.referenceCount;e.vertexArray=new u({context:t,attributes:f,indexBuffer:_}),e.state=d.READY}return p.prototype.freeResources=function(){if(this.state=d.UNLOADED,this.data=void 0,this.mesh=void 0,i(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&i(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},p.prototype.publishToTile=function(i){var r=i.data,n=this.mesh;t.clone(n.center,r.center),r.minimumHeight=n.minimumHeight,r.maximumHeight=n.maximumHeight,r.boundingSphere3D=e.clone(n.boundingSphere3D,r.boundingSphere3D),r.orientedBoundingBox=o.clone(n.orientedBoundingBox,r.orientedBoundingBox), -r.tileBoundingBox=new h({rectangle:i.rectangle,minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,ellipsoid:i.tilingScheme.ellipsoid}),i.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,r.occludeePointInScaledSpace)},p.prototype.processLoadStateMachine=function(e,t,i,r,n){this.state===d.UNLOADED&&f(this,t,i,r,n),this.state===d.RECEIVED&&m(this,e,t,i,r,n),this.state===d.TRANSFORMED&&_(this,e.context,t,i,r,n)},p.prototype.processUpsampleStateMachine=function(e,t,r,n,o){if(this.state===d.UNLOADED){var a=this.upsampleDetails,s=a.data,l=a.x,u=a.y,h=a.level;if(this.data=s.upsample(t.tilingScheme,l,u,h,r,n,o),!i(this.data))return;this.state=d.RECEIVING;var p=this;c(this.data,function(e){p.data=e,p.state=d.RECEIVED},function(){p.state=d.FAILED})}this.state===d.RECEIVED&&m(this,e,t,r,n,o),this.state===d.TRANSFORMED&&_(this,e.context,t,r,n,o)},p}),define("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/IntersectionTests","../Core/PixelFormat","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileTerrain"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v){"use strict";function y(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new i(0,0,1,1),this.terrainData=void 0,this.center=new t,this.vertexArray=void 0,this.minimumHeight=0,this.maximumHeight=0,this.boundingSphere3D=new e,this.boundingSphere2D=new e,this.orientedBoundingBox=void 0,this.tileBoundingBox=void 0,this.occludeePointInScaledSpace=new t,this.loadedTerrain=void 0,this.upsampledTerrain=void 0,this.pickBoundingSphere=new e,this.pickTerrain=void 0,this.surfaceShader=void 0}function C(e,i,r,o,a,s){if(e.decodePosition(o,a,s),n(i)&&i!==_.SCENE3D){var l=r.ellipsoid,u=l.cartesianToCartographic(s);r.project(u,s),t.fromElements(s.z,s.x,s.y,s)}return s}function w(e,t,i){var r=e.data,o=E(e);n(o)&&(r.upsampledTerrain=new v(o)),P(e,t)&&(r.loadedTerrain=new v);for(var a=0,s=i.length;a<s;++a){var l=i.get(a);l.show&&l._createTileImagerySkeletons(e,t)}}function S(e,t,i,o){var a=e.data,s=a.loadedTerrain,l=a.upsampledTerrain,u=!1;n(s)&&(s.processLoadStateMachine(t,i,e.x,e.y,e.level),s.state>=g.RECEIVED&&(a.terrainData!==s.data&&(a.terrainData=s.data,D(t.context,a),x(e)),u=!0),s.state===g.READY?(s.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=s.vertexArray,s.vertexArray=void 0,a.pickTerrain=r(a.loadedTerrain,a.upsampledTerrain),a.loadedTerrain=void 0,a.upsampledTerrain=void 0):s.state===g.FAILED&&(a.loadedTerrain=void 0)),!u&&n(l)&&(l.processUpsampleStateMachine(t,i,e.x,e.y,e.level),l.state>=g.RECEIVED&&a.terrainData!==l.data&&(a.terrainData=l.data,i.hasWaterMask&&I(e),b(e)),l.state===g.READY?(l.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=l.vertexArray,l.vertexArray=void 0,a.pickTerrain=a.upsampledTerrain,a.upsampledTerrain=void 0):l.state===g.FAILED&&(a.upsampledTerrain=void 0))}function E(e){for(var t=e.parent;n(t)&&n(t.data)&&!n(t.data.terrainData);)t=t.parent;if(n(t)&&n(t.data))return{data:t.data.terrainData,x:t.x,y:t.y,level:t.level}}function b(e){T(e,e._southwestChild),T(e,e._southeastChild),T(e,e._northwestChild),T(e,e._northeastChild)}function T(e,t){if(n(t)&&t.state!==m.START){var i=t.data;if(n(i.terrainData)&&!i.terrainData.wasCreatedByUpsampling())return;n(i.upsampledTerrain)&&i.upsampledTerrain.freeResources(),i.upsampledTerrain=new v({data:e.data.terrainData,x:e.x,y:e.y,level:e.level}),t.state=m.LOADING}}function x(e){var t=e.data;A(e,t,e.southwestChild),A(e,t,e.southeastChild),A(e,t,e.northwestChild),A(e,t,e.northeastChild)}function A(e,t,i){if(i.state!==m.START){var r=i.data;if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())return;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new v({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,i.x,i.y)&&(n(r.loadedTerrain)||(r.loadedTerrain=new v)),i.state=m.LOADING}}function P(e,t){var i=t.getTileDataAvailable(e.x,e.y,e.level);if(n(i))return i;var r=e.parent;return!n(r)||!(!n(r.data)||!n(r.data.terrainData))&&r.data.terrainData.isChildAvailable(r.x,r.y,e.x,e.y)}function M(e){var t=e.cache.tile_waterMaskData;if(!n(t)){var i=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});i.referenceCount=1;var r=new u({wrapS:p.CLAMP_TO_EDGE,wrapT:p.CLAMP_TO_EDGE,minificationFilter:h.LINEAR,magnificationFilter:d.LINEAR});t={allWaterTexture:i,sampler:r,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function D(e,t){var r=t.waterMaskTexture;n(r)&&(--r.referenceCount,0===r.referenceCount&&r.destroy(),t.waterMaskTexture=void 0);var o=t.terrainData.waterMask;if(n(o)){var a,u=M(e),d=o.length;if(1===d){if(0===o[0])return;a=u.allWaterTexture}else{var h=Math.sqrt(d);a=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{width:h,height:h,arrayBufferView:o},sampler:u.sampler}),a.referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,i.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function I(e){for(var t=e.data,i=e.parent;n(i)&&!n(i.data.terrainData)||i.data.terrainData.wasCreatedByUpsampling();)i=i.parent;if(n(i)&&n(i.data.waterMaskTexture)){t.waterMaskTexture=i.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var r=i.rectangle,o=e.rectangle,a=o.width,s=o.height,l=a/r.width,u=s/r.height;t.waterMaskTranslationAndScale.x=l*(o.west-r.west)/a,t.waterMaskTranslationAndScale.y=u*(o.south-r.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}o(y.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=n(e)&&(e.state===g.RECEIVING||e.state===g.TRANSFORMING),i=this.upsampledTerrain,r=n(i)&&(i.state===g.RECEIVING||i.state===g.TRANSFORMING),o=!t&&!r,a=this.imagery,s=0,l=a.length;o&&s<l;++s){var u=a[s];o=!n(u.loadingImagery)||u.loadingImagery.state!==f.TRANSITIONING}return o}}});var R=new t,O=new t,N=new t,L=new t;return y.prototype.pick=function(e,i,r,o,s){var l=this.pickTerrain;if(n(l)){var u=l.mesh;if(n(u))for(var c=u.vertices,d=u.indices,h=u.encoding,p=d.length,f=0;f<p;f+=3){var m=d[f],_=d[f+1],g=d[f+2],v=C(h,i,r,c,m,R),y=C(h,i,r,c,_,O),w=C(h,i,r,c,g,N),S=a.rayTriangle(e,v,y,w,o,L);if(n(S))return t.clone(S,s)}}},y.prototype.freeResources=function(){n(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,n(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),n(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0),n(this.pickTerrain)&&(this.pickTerrain.freeResources(),this.pickTerrain=void 0);var e,t,i=this.imagery;for(e=0,t=i.length;e<t;++e)i[e].freeResources();this.imagery.length=0,this.freeVertexArray()},y.prototype.freeVertexArray=function(){var e;n(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray=this.vertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),n(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray=this.wireframeVertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy()))},y.processStateMachine=function(e,t,i,r,o){var a=e.data;n(a)||(a=e.data=new y),e.state===m.START&&(w(e,i,r),e.state=m.LOADING),e.state===m.LOADING&&S(e,t,i,o);for(var s=n(a.vertexArray),l=!n(a.loadedTerrain)&&!n(a.upsampledTerrain),u=n(a.terrainData)&&a.terrainData.wasCreatedByUpsampling(),c=a.imagery,d=0,h=c.length;d<h;++d){var p=c[d];if(n(p.loadingImagery)){if(p.loadingImagery.state===f.PLACEHOLDER){var _=p.loadingImagery.imageryLayer;if(_.imageryProvider.ready){p.freeResources(),c.splice(d,1),_._createTileImagerySkeletons(e,i,d),--d,h=c.length;continue}u=!1}var g=p.processStateMachine(e,t);l=l&&g,s=s&&(g||n(p.readyImagery)),u=u&&n(p.loadingImagery)&&(p.loadingImagery.state===f.FAILED||p.loadingImagery.state===f.INVALID)}else u=!1}e.upsampledFromParent=u,d===h&&(s&&(e.renderable=!0),l&&(e.state=m.DONE))},y}),define("Shaders/ReprojectWebMercatorFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),define("Shaders/ReprojectWebMercatorVS",[],function(){"use strict";return"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"}),define("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,i){"use strict";function r(t,r,n,o,a){if(this.imageryLayer=t,this.x=r,this.y=n,this.level=o,0!==o){var s=r/2|0,l=n/2|0,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=i.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!e(a)&&t.imageryProvider.ready){var c=t.imageryProvider.tilingScheme;a=c.tileXYToRectangle(r,n,o)}this.rectangle=a}return r.createPlaceholder=function(e){var t=new r(e,0,0,0);return t.addReference(),t.state=i.PLACEHOLDER,t},r.prototype.addReference=function(){++this.referenceCount},r.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),e(this.parent)&&this.parent.releaseReference(),e(this.image)&&e(this.image.destroy)&&this.image.destroy(),e(this.texture)&&this.texture.destroy(),e(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),t(this),0):this.referenceCount},r.prototype.processStateMachine=function(e,t){this.state===i.UNLOADED&&(this.state=i.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===i.RECEIVED&&(this.state=i.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));var r=this.state===i.READY&&t&&!this.texture;(this.state===i.TEXTURE_LOADED||r)&&(this.state=i.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))},r}),define("Scene/ImagerySplitDirection",["../Core/freezeObject"],function(e){"use strict";var t={LEFT:-1,NONE:0,RIGHT:1};return e(t)}),define("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";function i(e,t,i){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=i}return i.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},i.prototype.processStateMachine=function(i,r){var n=this.loadingImagery,o=n.imageryLayer;if(n.processStateMachine(r,!this.useWebMercatorT),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this),!0;for(var a,s=n.parent;e(s)&&(s.state!==t.READY||!this.useWebMercatorT&&!e(s.texture));)s.state!==t.FAILED&&s.state!==t.INVALID&&(a=a||s),s=s.parent;return this.readyImagery!==s&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=s,e(s)&&(s.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(i,this))),(n.state===t.FAILED||n.state===t.INVALID)&&(!e(a)||(a.processStateMachine(r,!this.useWebMercatorT),!1))},i}),define("Scene/ImageryLayer",["../Core/Cartesian2","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/Rectangle","../Core/TerrainProvider","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/ContextLimits","../Renderer/MipmapHint","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS","../ThirdParty/when","./Imagery","./ImagerySplitDirection","./ImageryState","./TileImagery"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,M,D,I,R,O,N,L){"use strict";function B(e,t){this._imageryProvider=e,t=i(t,{}),this.alpha=i(t.alpha,i(e.defaultAlpha,1)),this.brightness=i(t.brightness,i(e.defaultBrightness,B.DEFAULT_BRIGHTNESS)),this.contrast=i(t.contrast,i(e.defaultContrast,B.DEFAULT_CONTRAST)),this.hue=i(t.hue,i(e.defaultHue,B.DEFAULT_HUE)),this.saturation=i(t.saturation,i(e.defaultSaturation,B.DEFAULT_SATURATION)),this.gamma=i(t.gamma,i(e.defaultGamma,B.DEFAULT_GAMMA)),this.splitDirection=i(t.splitDirection,i(e.defaultSplit,B.DEFAULT_SPLIT)),this.show=i(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=i(t.rectangle,d.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new L(R.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[]}function F(e,t,n,o){if(!c.isCompressedFormat(o.pixelFormat)&&u.isPowerOfTwo(o.width)&&u.isPowerOfTwo(o.height)){var a=t.cache.imageryLayer_mipmapSampler;if(!r(a)){var s=y.maximumTextureFilterAnisotropy;a=t.cache.imageryLayer_mipmapSampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR_MIPMAP_LINEAR,magnificationFilter:T.LINEAR,maximumAnisotropy:Math.min(s,i(e._maximumAnisotropy,s))})}o.generateMipmap(C.NICEST),o.sampler=a}else{var l=t.cache.imageryLayer_nonMipmapSampler;r(l)||(l=t.cache.imageryLayer_nonMipmapSampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})),o.sampler=l}n.state=N.READY}function k(e,t,i){return JSON.stringify([e,t,i])}function V(e,t,i,n){var o=t.cache.imageryLayer_reproject;if(!r(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){r(this.framebuffer)&&this.framebuffer.destroy(),r(this.vertexArray)&&this.vertexArray.destroy(),r(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var a=new Float32Array(256),s=0,c=0;c<64;++c){var d=c/63;a[s++]=0,a[s++]=d,a[s++]=1,a[s++]=d}var p={position:0,webMercatorT:1},f=h.getRegularGridIndices(2,64),m=_.createIndexBuffer({context:t,typedArray:f,usage:g.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});o.vertexArray=new P({context:t,attributes:[{index:p.position,vertexBuffer:_.createVertexBuffer({context:t,typedArray:a,usage:g.STATIC_DRAW}),componentsPerAttribute:2},{index:p.webMercatorT,vertexBuffer:_.createVertexBuffer({context:t,sizeInBytes:512,usage:g.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:m});var v=new E({sources:[D]});o.shaderProgram=S.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:M,attributeLocations:p}),o.sampler=new w({wrapS:A.CLAMP_TO_EDGE,wrapT:A.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})}i.sampler=o.sampler;var y=i.width,I=i.height;q.textureDimensions.x=y,q.textureDimensions.y=I,q.texture=i;var R=Math.sin(n.south),O=.5*Math.log((1+R)/(1-R));R=Math.sin(n.north);var N=.5*Math.log((1+R)/(1-R)),L=1/(N-O),B=new b({context:t,width:y,height:I,pixelFormat:i.pixelFormat,pixelDatatype:i.pixelDatatype,preMultiplyAlpha:i.preMultiplyAlpha});u.isPowerOfTwo(y)&&u.isPowerOfTwo(I)&&B.generateMipmap(C.NICEST);for(var F=n.south,k=n.north,V=j,z=0,U=0;U<64;++U){var G=U/63,H=u.lerp(F,k,G);R=Math.sin(H);var W=.5*Math.log((1+R)/(1-R)),Y=(W-O)*L;V[z++]=Y,V[z++]=Y}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(V),e.shaderProgram=o.shaderProgram,e.outputTexture=B,e.uniformMap=q,e.vertexArray=o.vertexArray}function z(e,t,i){var r=e._imageryProvider,n=r.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof s?1:Math.cos(i),l=n.rectangle,u=o.maximumRadius*l.width*a/(r.tileWidth*n.getNumberOfXTilesAtLevel(0)),c=u/t,d=Math.log(c)/Math.log(2),h=Math.round(d);return 0|h}n(B.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),B.DEFAULT_BRIGHTNESS=1,B.DEFAULT_CONTRAST=1,B.DEFAULT_HUE=0,B.DEFAULT_SATURATION=1,B.DEFAULT_GAMMA=1,B.DEFAULT_SPLIT=O.NONE,B.prototype.isBaseLayer=function(){return this._isBaseLayer},B.prototype.isDestroyed=function(){return!1},B.prototype.destroy=function(){return o(this)};var U=new d,G=new d,H=new d,W=new d;B.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return d.intersection(e.rectangle,t)})},B.prototype._createTileImagerySkeletons=function(e,i,n){var o=e.data;if(r(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(r(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var a=this._imageryProvider;if(r(n)||(n=o.imagery.length),!a.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),o.imagery.splice(n,0,this._skeletonPlaceholder),!0;var s=a.tilingScheme instanceof m&&e.rectangle.north<f.MaximumLatitude&&e.rectangle.south>-f.MaximumLatitude,l=d.intersection(a.rectangle,this._rectangle,U),u=d.intersection(e.rectangle,l,G);if(!r(u)){if(!this.isBaseLayer())return!1;var c=l,h=e.rectangle;u=G,h.south>=c.north?u.north=u.south=c.north:h.north<=c.south?u.north=u.south=c.south:(u.south=Math.max(h.south,c.south),u.north=Math.min(h.north,c.north)),h.west>=c.east?u.west=u.east=c.east:h.east<=c.west?u.west=u.east=c.west:(u.west=Math.max(h.west,c.west),u.east=Math.min(h.east,c.east))}var p=0;u.south>0?p=u.south:u.north<0&&(p=u.north);var _=1,g=_*i.getLevelMaximumGeometricError(e.level),v=z(this,g,p);v=Math.max(0,v);var y=a.maximumLevel;if(v>y&&(v=y),r(a.minimumLevel)){var C=a.minimumLevel;v<C&&(v=C)}var w=a.tilingScheme,S=w.positionToTileXY(d.northwest(u),v),E=w.positionToTileXY(d.southeast(u),v),b=e.rectangle.width/512,T=e.rectangle.height/512,x=w.tileXYToRectangle(S.x,S.y,v);Math.abs(x.south-e.rectangle.north)<T&&S.y<E.y&&++S.y,Math.abs(x.east-e.rectangle.west)<b&&S.x<E.x&&++S.x;var A=w.tileXYToRectangle(E.x,E.y,v);Math.abs(A.north-e.rectangle.south)<T&&E.y>S.y&&--E.y,Math.abs(A.west-e.rectangle.east)<b&&E.x>S.x&&--E.x;var P,M=d.clone(e.rectangle,W),D=w.tileXYToRectangle(S.x,S.y,v),I=d.intersection(D,l,H);s?(w.rectangleToNativeRectangle(M,M),w.rectangleToNativeRectangle(D,D),w.rectangleToNativeRectangle(I,I),w.rectangleToNativeRectangle(l,l),P=w.tileXYToNativeRectangle.bind(w),b=M.width/512,T=M.height/512):P=w.tileXYToRectangle.bind(w);var R,O,N=0,B=1;!this.isBaseLayer()&&Math.abs(I.west-M.west)>=b&&(N=Math.min(1,(I.west-M.west)/M.width)),!this.isBaseLayer()&&Math.abs(I.north-M.north)>=T&&(B=Math.max(0,(I.north-M.south)/M.height));for(var F=B,k=S.x;k<=E.x;k++)if(R=N,D=P(k,S.y,v),I=d.simpleIntersection(D,l,H),r(I)){N=Math.min(1,(I.east-M.west)/M.width),k===E.x&&(this.isBaseLayer()||Math.abs(I.east-M.east)<b)&&(N=1),B=F;for(var V=S.y;V<=E.y;V++)if(O=B,D=P(k,V,v),I=d.simpleIntersection(D,l,H),r(I)){B=Math.max(0,(I.south-M.south)/M.height),V===E.y&&(this.isBaseLayer()||Math.abs(I.south-M.south)<T)&&(B=0);var q=new t(R,B,N,O),j=this.getImageryFromCache(k,V,v);o.imagery.splice(n,0,new L(j,q,s)),++n}}return!0},B.prototype._calculateTextureTranslationAndScale=function(e,i){var r=i.readyImagery.rectangle,n=e.rectangle;if(i.useWebMercatorT){var o=i.readyImagery.imageryLayer.imageryProvider.tilingScheme;r=o.rectangleToNativeRectangle(r,U),n=o.rectangleToNativeRectangle(n,W)}var a=n.width,s=n.height,l=a/r.width,u=s/r.height;return new t(l*(n.west-r.west)/a,u*(n.south-r.south)/s,l,u)},B.prototype._requestImagery=function(e){function t(t){return r(t)?(e.image=t,e.state=N.RECEIVED,void p.handleSuccess(a._requestImageError)):i()}function i(t){e.state=N.FAILED;var i="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";a._requestImageError=p.handleError(a._requestImageError,o,o.errorEvent,i,e.x,e.y,e.level,n,t)}function n(){e.state=N.TRANSITIONING;var n=o.requestImage(e.x,e.y,e.level);return r(n)?(r(o.getTileCredits)&&(e.credits=o.getTileCredits(e.x,e.y,e.level)),void I(n,t,i)):void(e.state=N.UNLOADED)}var o=this._imageryProvider,a=this;n()},B.prototype._createTexture=function(e,t){var i=this._imageryProvider,n=t.image;if(r(i.tileDiscardPolicy)){var o=i.tileDiscardPolicy;if(r(o)){if(!o.isReady())return void(t.state=N.RECEIVED);if(o.shouldDiscardImage(n))return void(t.state=N.INVALID)}}var a;a=new b(r(n.internalFormat)?{context:e,pixelFormat:n.internalFormat,width:n.width,height:n.height,source:{arrayBufferView:n.bufferView}}:{context:e,source:n,pixelFormat:i.hasAlphaChannel?c.RGBA:c.RGB}),i.tilingScheme instanceof m?t.textureWebMercator=a:t.texture=a,t.image=void 0,t.state=N.TEXTURE_LOADED},B.prototype._reprojectTexture=function(e,t,r){var n=t.textureWebMercator||t.texture,o=t.rectangle,a=e.context;if(r=i(r,!0),r&&!(this._imageryProvider.tilingScheme instanceof s)&&o.width/n.width>1e-5){var l=this;t.addReference();var u=new v({persists:!0,owner:this,preExecute:function(e){V(e,a,n,t.rectangle)},postExecute:function(e){t.texture=e,F(l,a,t,e),t.releaseReference()}});this._reprojectComputeCommands.push(u)}else r&&(t.texture=n),F(this,a,t,n)},B.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},B.prototype.cancelReprojections=function(){this._reprojectComputeCommands.length=0},B.prototype.getImageryFromCache=function(e,t,i,n){var o=k(e,t,i),a=this._imageryCache[o];return r(a)||(a=new R(this,e,t,i,n),this._imageryCache[o]=a),a.addReference(),a},B.prototype.removeImageryFromCache=function(e){var t=k(e.x,e.y,e.level);delete this._imageryCache[t]};var q={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new e,texture:void 0},j=a.supportsTypedArrays()?new Float32Array(128):void 0;return B}),define("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/PrimitiveType","../Core/Rectangle","../Core/SphereOutlineGeometry","../Core/TerrainQuantization","../Core/Visibility","../Core/WebMercatorProjection","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/VertexArray","../Scene/BlendingState","../Scene/DepthFunction","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./GlobeSurfaceTile","./ImageryLayer","./QuadtreeTileLoadState","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,M,D,I,R,O,N,L,B,F,k,V,z,U){"use strict";function G(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.shadows=U.RECEIVE_ONLY,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._pickRenderState=void 0,this._errorEvent=new h,this._imageryLayers.layerAdded.addEventListener(G.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(G.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(G.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(G.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._pickCommands=[],this._usedDrawCommands=0,this._usedPickCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new o(0,0,.5,1)}function H(e,t){var i=e.loadingImagery;l(i)||(i=e.readyImagery);var r=t.loadingImagery;return l(r)||(r=t.readyImagery),i.imageryLayer._layerIndex-r.imageryLayer._layerIndex}function W(e){var t=e.indexBuffer;e.destroy(),!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}function q(e){var t={u_initialColor:function(){return this.properties.initialColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var t=e.context.uniformState.view,i=v.multiplyByPoint(t,this.properties.rtc,te);return v.setTranslation(t,i,Q),Q},u_modifiedModelViewProjection:function(){var t=e.context.uniformState.view,i=e.context.uniformState.projection,r=v.multiplyByPoint(t,this.properties.rtc,te);return v.setTranslation(t,r,J),v.multiply(i,J,J),J},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},properties:{initialColor:new n(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new i(65e5,9e6),center3D:void 0,rtc:new r,modifiedModelView:new v,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayIntensity:0,southAndNorthLatitude:new i,southMercatorYAndOneOverHeight:new i,waterMask:void 0,waterMaskTranslationAndScale:new n,minMaxHeight:new i,scaleAndBias:new v}};return t}function j(e,t,i){var r=i.data;l(r.wireframeVertexArray)||l(r.terrainData)&&l(r.terrainData._mesh)&&(r.wireframeVertexArray=Y(e,r.vertexArray,r.terrainData._mesh))}function Y(e,t,i){var r={indices:i.indices,primitiveType:C.TRIANGLES};f.toWireframe(r);var n=r.indices,o=x.createIndexBuffer({context:e,typedArray:n,usage:A.STATIC_DRAW,indexDatatype:m.UNSIGNED_SHORT});return new R({context:e,attributes:t._attributes,indexBuffer:o})}function X(t,i,a){var s=i.data,u=P.maximumTextureImageUnits,c=s.waterMaskTexture,d=t.hasWaterMask&&l(c),h=t.oceanNormalMap,p=d&&l(h),f=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,m=a.fog.enabled,_=U.castShadows(t.shadows),S=U.receiveShadows(t.shadows);d&&--u,p&&--u;var b=s.center,x=s.pickTerrain.mesh.encoding,A=$,I=0,R=0,O=0,N=0,L=!1;if(a.mode!==z.SCENE3D){var B=a.mapProjection,F=B.project(w.southwest(i.rectangle),ie),V=B.project(w.northeast(i.rectangle),re);if(A.x=F.x,A.y=F.y,A.z=V.x,A.w=V.y,a.mode!==z.MORPHING&&(b=ee,b.x=0,b.y=.5*(A.z+A.x),b.z=.5*(A.w+A.y),A.x-=b.y,A.y-=b.z,A.z-=b.y,A.w-=b.z),a.mode===z.SCENE2D&&x.quantization===E.BITS12){var G=1/(Math.pow(2,12)-1)*.5,H=(A.z-A.x)*G,W=(A.w-A.y)*G;A.x-=H,A.y-=W,A.z+=H,A.w+=W}B instanceof T&&(I=i.rectangle.south,R=i.rectangle.north,O=T.geodeticLatitudeToMercatorAngle(I),N=1/(T.geodeticLatitudeToMercatorAngle(R)-O),L=!0)}var Y=s.imagery,X=0,Z=Y.length,K=t._renderState,Q=t._blendRenderState,J=K,te=t._firstPassInitialColor,le=a.context;l(t._debug.boundingSphereTile)||ae();do{var ue,ce,de=0;t._drawCommands.length<=t._usedDrawCommands?(ue=new M,ue.owner=i,ue.cull=!1,ue.boundingVolume=new e,ue.orientedBoundingBox=void 0,ce=q(a),t._drawCommands.push(ue),t._uniformMaps.push(ce)):(ue=t._drawCommands[t._usedDrawCommands],ce=t._uniformMaps[t._usedDrawCommands]),ue.owner=i,++t._usedDrawCommands,i===t._debug.boundingSphereTile&&(l(s.orientedBoundingBox)?ne(s.orientedBoundingBox,o.RED).update(a):l(s.boundingSphere3D)&&oe(s.boundingSphere3D,o.RED).update(a));var he=ce.properties;n.clone(te,he.initialColor),he.oceanNormalMap=h,he.lightingFadeDistance.x=t.lightingFadeOutDistance,he.lightingFadeDistance.y=t.lightingFadeInDistance,he.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,he.center3D=s.center,r.clone(b,he.rtc),n.clone(A,he.tileRectangle),he.southAndNorthLatitude.x=I,he.southAndNorthLatitude.y=R,he.southMercatorYAndOneOverHeight.x=O,he.southMercatorYAndOneOverHeight.y=N;for(var pe=m&&g.fog(i._distance,a.fog.density)>g.EPSILON3,fe=!1,me=!1,_e=!1,ge=!1,ve=!1,ye=!1,Ce=!1;de<u&&X<Z;){var we=Y[X],Se=we.readyImagery;if(++X,l(Se)&&0!==Se.imageryLayer.alpha){var Ee=we.useWebMercatorT?Se.textureWebMercator:Se.texture,be=Se.imageryLayer;if(l(we.textureTranslationAndScale)||(we.textureTranslationAndScale=be._calculateTextureTranslationAndScale(i,we)),he.dayTextures[de]=Ee,he.dayTextureTranslationAndScale[de]=we.textureTranslationAndScale,he.dayTextureTexCoordsRectangle[de]=we.textureCoordinateRectangle,he.dayTextureUseWebMercatorT[de]=we.useWebMercatorT,he.dayTextureAlpha[de]=be.alpha,ye=ye||1!==he.dayTextureAlpha[de],he.dayTextureBrightness[de]=be.brightness,fe=fe||he.dayTextureBrightness[de]!==k.DEFAULT_BRIGHTNESS,he.dayTextureContrast[de]=be.contrast,me=me||he.dayTextureContrast[de]!==k.DEFAULT_CONTRAST,he.dayTextureHue[de]=be.hue,_e=_e||he.dayTextureHue[de]!==k.DEFAULT_HUE,he.dayTextureSaturation[de]=be.saturation,ge=ge||he.dayTextureSaturation[de]!==k.DEFAULT_SATURATION,he.dayTextureOneOverGamma[de]=1/be.gamma,ve=ve||he.dayTextureOneOverGamma[de]!==1/k.DEFAULT_GAMMA,he.dayTextureSplit[de]=be.splitDirection,Ce=Ce||0!==he.dayTextureSplit[de],l(Se.credits))for(var Te=a.creditDisplay,xe=Se.credits,Ae=0,Pe=xe.length;Ae<Pe;++Ae)Te.addCredit(xe[Ae]);++de}}he.dayTextures.length=de,he.waterMask=c, -n.clone(s.waterMaskTranslationAndScale,he.waterMaskTranslationAndScale),he.minMaxHeight.x=x.minimumHeight,he.minMaxHeight.y=x.maximumHeight,v.clone(x.matrix,he.scaleAndBias),ue.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,s,de,fe,me,_e,ge,ve,ye,Ce,d,p,t.enableLighting,f,L,pe),ue.castShadows=_,ue.receiveShadows=S,ue.renderState=J,ue.primitiveType=C.TRIANGLES,ue.vertexArray=s.vertexArray,ue.uniformMap=ce,ue.pass=D.GLOBE,t._debug.wireframe&&(j(le,t,i),l(s.wireframeVertexArray)&&(ue.vertexArray=s.wireframeVertexArray,ue.primitiveType=C.LINES));var Me=ue.boundingVolume,De=ue.orientedBoundingBox;a.mode!==z.SCENE3D?(e.fromRectangleWithHeights2D(i.rectangle,a.mapProjection,s.minimumHeight,s.maximumHeight,Me),r.fromElements(Me.center.z,Me.center.x,Me.center.y,Me.center),a.mode===z.MORPHING&&(Me=e.union(s.boundingSphere3D,Me,Me))):(ue.boundingVolume=e.clone(s.boundingSphere3D,Me),ue.orientedBoundingBox=y.clone(s.orientedBoundingBox,De)),a.commandList.push(ue),J=Q,te=se}while(X<Z)}function Z(e,t,i){var r;e._pickCommands.length<=e._usedPickCommands?(r=new M,r.cull=!1,e._pickCommands.push(r)):r=e._pickCommands[e._usedPickCommands],++e._usedPickCommands;var n=t.owner.data,o=i.projection instanceof T;r.shaderProgram=e._surfaceShaderSet.getPickShaderProgram(i,n,o),r.renderState=e._pickRenderState,r.owner=t.owner,r.primitiveType=t.primitiveType,r.vertexArray=t.vertexArray,r.uniformMap=t.uniformMap,r.boundingVolume=t.boundingVolume,r.orientedBoundingBox=t.orientedBoundingBox,r.pass=t.pass,i.commandList.push(r)}u(G.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=n.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}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}}}),G.prototype.initialize=function(e){var t=this._imageryLayers;t._update(),t.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(H)}));var i=e.creditDisplay;this._terrainProvider.ready&&l(this._terrainProvider.credit)&&i.addCredit(this._terrainProvider.credit);for(var r=0,n=t.length;r<n;++r){var o=t.get(r).imageryProvider;o.ready&&l(o.credit)&&i.addCredit(o.credit)}for(var a=this._vertexArraysToDestroy,s=a.length,u=0;u<s;++u)W(a[u]);a.length=0},G.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];l(n)&&(n.length=0)}this._usedDrawCommands=0},G.prototype.endUpdate=function(e){l(this._renderState)||(this._renderState=I.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS}}),this._blendRenderState=I.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS_OR_EQUAL},blending:O.ALPHA_BLEND}));for(var t=this._tilesToRenderByTextureCount,i=0,r=t.length;i<r;++i){var n=t[i];if(l(n))for(var o=0,a=n.length;o<a;++o)X(this,n[o],e)}},G.prototype.updateForPick=function(e){l(this._pickRenderState)||(this._pickRenderState=I.fromCache({colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0}})),this._usedPickCommands=0;for(var t=this._drawCommands,i=0,r=this._usedDrawCommands;i<r;++i)Z(this,t[i],e)},G.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},G.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},G.prototype.loadTile=function(e,t){F.processStateMachine(t,e,this._terrainProvider,this._imageryLayers,this._vertexArraysToDestroy)};var K=new e;G.prototype.computeTileVisibility=function(t,i,n){var o=this.computeDistanceToTile(t,i);if(t._distance=o,i.fog.enabled&&g.fog(o,i.fog.density)>=1)return b.NONE;var a=t.data,u=i.cullingVolume,c=s(a.orientedBoundingBox,a.boundingSphere3D);i.mode!==z.SCENE3D&&(c=K,e.fromRectangleWithHeights2D(t.rectangle,i.mapProjection,a.minimumHeight,a.maximumHeight,c),r.fromElements(c.center.z,c.center.x,c.center.y,c.center),i.mode===z.MORPHING&&(c=e.union(a.boundingSphere3D,c,c)));var d=u.computeVisibility(c);if(d===_.OUTSIDE)return b.NONE;if(i.mode===z.SCENE3D){var h=a.occludeePointInScaledSpace;return l(h)?n.ellipsoid.isScaledSpacePointVisible(h)?d:b.NONE:d}return d};var Q=new v,J=new v,$=new n,ee=new r,te=new r,ie=new r,re=new r;G.prototype.showTileThisFrame=function(e,t){for(var i=0,r=e.data.imagery,n=0,o=r.length;n<o;++n){var a=r[n];l(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++i}var s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(e);var u=this._debug;++u.tilesRendered,u.texturesRendered+=i},G.prototype.computeDistanceToTile=function(e,t){var i=e.data,r=i.tileBoundingBox;return r.distanceToCamera(t)},G.prototype.isDestroyed=function(){return!1},G.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),c(this)},G.prototype._onLayerAdded=function(e,t){if(e.show){var i=this._terrainProvider;this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,i)&&(t.state=V.LOADING)}),this._layerOrderChanged=!0}},G.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(t){for(var i=t.data.imagery,r=-1,n=0,o=0,a=i.length;o<a;++o){var s=i[o],u=s.loadingImagery;if(l(u)||(u=s.readyImagery),u.imageryLayer===e)r===-1&&(r=o),s.freeResources(),++n;else if(r!==-1)break}r!==-1&&i.splice(r,n)})},G.prototype._onLayerMoved=function(e,t,i){this._layerOrderChanged=!0},G.prototype._onLayerShownOrHidden=function(e,t,i){i?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var ne,oe,ae;!function(){function e(e){return new B({geometryInstances:e,appearance:new L({translucent:!1,flat:!0}),asynchronous:!1})}var i,n,o=new p({geometry:t.fromDimensions({dimensions:new r(2,2,2)})}),s=new p({geometry:new S({radius:1})}),u=new v;ne=function(t,r){return t===i?n:(ae(),i=t,u=v.fromRotationTranslation(t.halfAxes,t.center,u),o.modelMatrix=u,o.attributes.color=a.fromColor(r),n=e(o))},oe=function(t,r){return t===i?n:(ae(),i=t,u=v.fromTranslation(t.center,u),u=v.multiplyByUniformScale(u,t.radius,u),s.modelMatrix=u,s.attributes.color=a.fromColor(r),n=e(s))},ae=function(){l(n)&&(n.destroy(),n=void 0,i=void 0)}}();var se=new n(0,0,0,0);return G}),define("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../ThirdParty/when","./ImageryLayer"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(){this._layers=[],this.layerAdded=new o,this.layerRemoved=new o,this.layerMoved=new o,this.layerShownOrHidden=new o}function d(e,t){var i=e.indexOf(t);return i}function h(e,t,i){var r=e._layers;if(t=a.clamp(t,0,r.length-1),i=a.clamp(i,0,r.length-1),t!==i){var n=r[t];r[t]=r[i],r[i]=n,e._update(),e.layerMoved.raiseEvent(n,i,t)}}i(c.prototype,{length:{get:function(){return this._layers.length}}}),c.prototype.add=function(e,i){var r=t(i);r?this._layers.splice(i,0,e):(i=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,i)},c.prototype.addImageryProvider=function(e,t){var i=new u(e);return this.add(i,t),i},c.prototype.remove=function(t,i){i=e(i,!0);var r=this._layers.indexOf(t);return r!==-1&&(this._layers.splice(r,1),this._update(),this.layerRemoved.raiseEvent(t,r),i&&t.destroy(),!0)},c.prototype.removeAll=function(t){t=e(t,!0);for(var i=this._layers,r=0,n=i.length;r<n;r++){var o=i[r];this.layerRemoved.raiseEvent(o,r),t&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return this.indexOf(e)!==-1},c.prototype.indexOf=function(e){return this._layers.indexOf(e)},c.prototype.get=function(e){return this._layers[e]},c.prototype.raise=function(e){var t=d(this._layers,e);h(this,t,t+1)},c.prototype.lower=function(e){var t=d(this._layers,e);h(this,t,t-1)},c.prototype.raiseToTop=function(e){var t=d(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))},c.prototype.lowerToBottom=function(e){var t=d(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 p=new s;return c.prototype.pickImageryLayerFeatures=function(e,i){var r=i.globe.pick(e,i);if(t(r)){for(var n,o=i.globe.ellipsoid.cartesianToCartographic(r),u=i.globe._surface._tilesToRender,c=0;!t(n)&&c<u.length;++c){var d=u[c];s.contains(d.rectangle,o)&&(n=d)}if(t(n)){for(var h=n.data.imagery,f=[],m=[],_=h.length-1;_>=0;--_){var g=h[_],v=g.readyImagery;if(t(v)){var y=v.imageryLayer.imageryProvider;if(t(y.pickFeatures)&&s.contains(v.rectangle,o)){var C=p,w=1/1024;if(C.west=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.x-w),C.east=a.lerp(n.rectangle.west,n.rectangle.east,g.textureCoordinateRectangle.z+w),C.south=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.y-w),C.north=a.lerp(n.rectangle.south,n.rectangle.north,g.textureCoordinateRectangle.w+w),s.contains(C,o)){var S=y.pickFeatures(v.x,v.y,v.level,o.longitude,o.latitude);t(S)&&(f.push(S),m.push(v.imageryLayer))}}}}if(0!==f.length)return l.all(f,function(e){for(var i=[],r=0;r<e.length;++r){var n=e[r],a=m[r];if(t(n)&&n.length>0)for(var s=0;s<n.length;++s){var l=n[s];l.imageryLayer=a,t(l.position)||(l.position=o),i.push(l)}}return i})}}},c.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,i=0,r=t.length;i<r;++i)t[i].queueReprojectionCommands(e)},c.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,i=e.length;t<i;++t)e[t].cancelReprojections()},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),r(this)},c.prototype._update=function(){for(var e,i,r=!0,n=this._layers,o=0,a=n.length;o<a;++o)i=n[o],i._layerIndex=o,i.show?(i._isBaseLayer=r,r=!1):i._isBaseLayer=!1,i.show!==i._show&&(t(i._show)&&(t(e)||(e=[]),e.push(i)),i._show=i.show);if(t(e))for(o=0,a=e.length;o<a;++o)i=e[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)},c}),define("Scene/QuadtreeOccluders",["../Core/Cartesian3","../Core/defineProperties","../Core/EllipsoidalOccluder"],function(e,t,i){"use strict";function r(t){this._ellipsoid=new i(t.ellipsoid,e.ZERO)}return t(r.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),r}),define("Scene/QuadtreeTile",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Rectangle","./QuadtreeTileLoadState"],function(e,t,i,r,n){"use strict";function o(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._customData=[],this._frameUpdated=void 0,this._frameRendered=void 0,this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function a(t){e(t)&&t.freeResources()}return o.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 s=0;s<t;++s)r[n++]=new o({tilingScheme:e,x:s,y:a,level:0});return r},o.prototype._updateCustomData=function(t,i,n){var o,a,s,l=this.customData;if(e(i)&&e(n)){for(l=l.filter(function(e){return n.indexOf(e)===-1}),this._customData=l,s=this._rectangle,o=0;o<i.length;++o)a=i[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=t}else{var u=this._parent;if(e(u)&&this._frameUpdated!==u._frameUpdated){l.length=0,s=this._rectangle;var c=u.customData;for(o=0;o<c.length;++o)a=c[o],r.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=u._frameUpdated}}},t(o.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 e(this._southwestChild)||(this._southwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return e(this._southeastChild)||(this._southeastChild=new o({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 e(this._northwestChild)||(this._northwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return e(this._northeastChild)||(this._northeastChild=new o({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<n.DONE}},eligibleForUnloading:{get:function(){var t=!0;return e(this.data)&&(t=this.data.eligibleForUnloading,e(t)||(t=!0)),t}}}),o.prototype.freeResources=function(){this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&this.data.freeResources(),a(this._southwestChild),this._southwestChild=void 0,a(this._southeastChild),this._southeastChild=void 0,a(this._northwestChild),this._northwestChild=void 0,a(this._northeastChild),this._northeastChild=void 0},o}),define("Scene/TileReplacementQueue",["../Core/defined"],function(e){"use strict";function t(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function i(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}return t.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},t.prototype.trimTiles=function(t){for(var r=this.tail,n=!0;n&&e(this._lastBeforeStartOfFrame)&&this.count>t&&e(r);){n=r!==this._lastBeforeStartOfFrame;var o=r.replacementPrevious;r.eligibleForUnloading&&(r.freeResources(),i(this,r)),r=o}},t.prototype.markTileRendered=function(t){var r=this.head;return r===t?void(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext)):(++this.count,e(r)?((e(t.replacementPrevious)||e(t.replacementNext))&&i(this,t),t.replacementPrevious=void 0,t.replacementNext=r,r.replacementPrevious=t,void(this.head=t)):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,void(this.tail=t)))},t}),define("Scene/QuadtreePrimitive",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/Math","../Core/Ray","../Core/Rectangle","../Core/Visibility","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};var t=this._tileProvider.tilingScheme,r=t.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new _,this._levelZeroTiles=void 0,this._levelZeroTilesReady=!1,this._loadQueueTimeSlice=5,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this.maximumScreenSpaceError=i(e.maximumScreenSpaceError,2),this.tileCacheSize=i(e.tileCacheSize,100),this._occluders=new h({ellipsoid:r}),this._tileLoadProgressEvent=new a,this._lastTileLoadQueueLength=0}function v(e,t){var i=c.center(e.rectangle,N),r=i.longitude-O.longitude,n=i.latitude-O.latitude;i=c.center(t.rectangle,N);var o=i.longitude-O.longitude,a=i.latitude-O.latitude;return r*r+n*n-(o*o+a*a)}function y(e,t){var i=e._debug;if(!i.suspendLodUpdate){var n,o,a=e._tilesToRender;if(a.length=0,!r(e._levelZeroTiles)){if(!e._tileProvider.ready)return;var s=e._tileProvider.tilingScheme;e._levelZeroTiles=p.createLevelZeroTiles(s)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var l,u=e._tileProvider,c=e._occluders,h=e._levelZeroTiles;O=t.camera.positionCartographic,h.sort(v);var f=e._addHeightCallbacks,m=e._removeHeightCallbacks,_=t.frameNumber;if(f.length>0||m.length>0){for(n=0,o=h.length;n<o;++n)l=h[n],l._updateCustomData(_,f,m);f.length=0,m.length=0}for(n=0,o=h.length;n<o;++n)l=h[n],e._tileReplacementQueue.markTileRendered(l),l.renderable?u.computeTileVisibility(l,t,c)!==d.NONE?C(e,t,l):(l.needsLoading&&e._tileLoadQueueLow.push(l),++i.tilesCulled):(l.needsLoading&&e._tileLoadQueueHigh.push(l),++i.tilesWaitingForChildren);T(e)}}function C(e,t,i){var r=e._debug;if(++r.tilesVisited,e._tileReplacementQueue.markTileRendered(i),i._updateCustomData(t.frameNumber),i.level>r.maxDepth&&(r.maxDepth=i.level),x(e,t,i)<e.maximumScreenSpaceError)return i.needsLoading&&e._tileLoadQueueMedium.push(i),void P(e,i);var n=i.southwestChild,o=i.southeastChild,a=i.northwestChild,s=i.northeastChild,l=n.renderable&&o.renderable&&a.renderable&&s.renderable,u=n.upsampledFromParent&&o.upsampledFromParent&&a.upsampledFromParent&&s.upsampledFromParent;l?u?(P(e,i),w(e,t.camera.positionCartographic,n,o,a,s),i.needsLoading&&e._tileLoadQueueMedium.push(i)):(E(e,n,o,a,s,t),i.needsLoading&&e._tileLoadQueueLow.push(i)):(w(e,t.camera.positionCartographic,n,o,a,s),P(e,i),i.needsLoading&&e._tileLoadQueueLow.push(i))}function w(e,t,i,r,n,o){t.longitude<i.east?t.latitude<i.north?(S(e,i),S(e,r),S(e,n),S(e,o)):(S(e,n),S(e,i),S(e,o),S(e,r)):t.latitude<i.north?(S(e,r),S(e,i),S(e,o),S(e,n)):(S(e,o),S(e,n),S(e,r),S(e,i))}function S(e,t){e._tileReplacementQueue.markTileRendered(t),t.needsLoading&&(t.renderable?e._tileLoadQueueLow.push(t):e._tileLoadQueueHigh.push(t))}function E(e,t,i,r,n,o){var a=o.camera.positionCartographic,s=e._tileProvider,l=e._occluders;a.longitude<t.rectangle.east?a.latitude<t.rectangle.north?(b(e,t,s,o,l),b(e,i,s,o,l),b(e,r,s,o,l),b(e,n,s,o,l)):(b(e,r,s,o,l),b(e,t,s,o,l),b(e,n,s,o,l),b(e,i,s,o,l)):a.latitude<t.rectangle.north?(b(e,i,s,o,l),b(e,t,s,o,l),b(e,n,s,o,l),b(e,r,s,o,l)):(b(e,n,s,o,l),b(e,r,s,o,l),b(e,i,s,o,l),b(e,t,s,o,l))}function b(e,t,i,r,n){i.computeTileVisibility(t,r,n)!==d.NONE?C(e,r,t):(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t))}function T(e){var t=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;t!==e._lastTileLoadQueueLength&&(e._tileLoadProgressEvent.raiseEvent(t),e._lastTileLoadQueueLength=t)}function x(e,t,i){if(t.mode===m.SCENE2D)return A(e,t,i);var r=e._tileProvider.getLevelMaximumGeometricError(i.level),n=i._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=r*o/(n*a);return t.fog.enabled&&(s-=l.fog(n,t.fog.density)*t.fog.sse),s}function A(e,t,i){var r=t.camera,n=r.frustum,o=t.context,a=o.drawingBufferWidth,s=o.drawingBufferHeight,l=e._tileProvider.getLevelMaximumGeometricError(i.level),u=Math.max(n.top-n.bottom,n.right-n.left)/Math.max(a,s);return l/u}function P(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function M(e,t){var i=e._tileLoadQueueHigh,r=e._tileLoadQueueMedium,n=e._tileLoadQueueLow,o=e._tileProvider;if(0!==i.length||0!==r.length||0!==n.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);var a=s()+e._loadQueueTimeSlice;D(e,t,o,a,i),D(e,t,o,a,r),D(e,t,o,a,n)}}function D(e,t,i,r,n){for(var o=0,a=n.length;o<a&&s()<r;++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),i.loadTile(t,l)}}function I(n,o){for(var a=n._tileToUpdateHeights,l=n._tileProvider.terrainProvider,u=s(),d=n._updateHeightsTimeSlice,h=u+d,p=o.mode,f=o.mapProjection,_=f.ellipsoid;a.length>0;){for(var g=a[0],v=g.customData,y=v.length,C=!1,w=n._lastTileIndex;w<y;++w){var S=v[w];if(g.level>S.level){if(r(S.positionOnEllipsoidSurface)||(S.positionOnEllipsoidSurface=e.fromRadians(S.positionCartographic.longitude,S.positionCartographic.latitude,0,_)),p===m.SCENE3D){var E=_.geodeticSurfaceNormal(S.positionOnEllipsoidSurface,L.direction),b=_.getSurfaceNormalIntersectionWithZAxis(S.positionOnEllipsoidSurface,11500,L.origin);if(!r(b)){var T=Math.min(i(g.data.minimumHeight,0),-11500),x=e.multiplyByScalar(E,Math.abs(T)+1,F);e.subtract(S.positionOnEllipsoidSurface,x,L.origin)}}else t.clone(S.positionCartographic,B),B.height=-11500,f.project(B,F),e.fromElements(F.z,F.x,F.y,F),e.clone(F,L.origin),e.clone(e.UNIT_X,L.direction);var A=g.data.pick(L,p,f,!1,F);r(A)&&S.callback(A),S.level=g.level}else if(g.level===S.level){for(var P,M=g.children,D=M.length,I=0;I<D&&(P=M[I],!c.contains(P.rectangle,S.positionCartographic));++I);var R=l.getTileDataAvailable(P.x,P.y,P.level),O=g.parent;(r(R)&&!R||r(O)&&r(O.data)&&r(O.data.terrainData)&&!O.data.terrainData.isChildAvailable(O.x,O.y,P.x,P.y))&&S.removeFunc()}if(s()>=h){C=!0;break}}if(C){n._lastTileIndex=w;break}n._lastTileIndex=0,a.shift()}}function R(e,t){for(var i=e._tileProvider,r=e._tilesToRender,n=e._tileToUpdateHeights,o=0,a=r.length;o<a;++o){var s=r[o];i.showTileThisFrame(s,t),s._frameRendered!==t.frameNumber-1&&n.push(s),s._frameRendered=t.frameNumber}}n(g.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}}}),g.prototype.invalidateAllTiles=function(){var e=this._tileReplacementQueue;e.head=void 0,e.tail=void 0,e.count=0;var t=this._levelZeroTiles;if(r(t))for(var i=0;i<t.length;++i){for(var n=t[i],o=n.customData,a=o.length,s=0;s<a;++s){var l=o[s];l.level=0,this._addHeightCallbacks.push(l)}t[i].freeResources()}this._levelZeroTiles=void 0,this._tileProvider.cancelReprojections()},g.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;r(t);)t.state!==f.START&&e(t),t=t.replacementNext},g.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,i=0,r=t.length;i<r;++i)e(t[i])},g.prototype.updateHeight=function(e,t){var i=this,r={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return r.removeFunc=function(){for(var e=i._addHeightCallbacks,t=e.length,n=0;n<t;++n)if(e[n]===r){e.splice(n,1);break}i._removeHeightCallbacks.push(r)},i._addHeightCallbacks.push(r),r.removeFunc},g.prototype.beginFrame=function(e){var t=e.passes;if(t.render){this._tileProvider.initialize(e);var i=this._debug;i.suspendLodUpdate||(i.maxDepth=0,i.tilesVisited=0,i.tilesCulled=0,i.tilesRendered=0,i.tilesWaitingForChildren=0,this._tileLoadQueueHigh.length=0,this._tileLoadQueueMedium.length=0,this._tileLoadQueueLow.length=0,this._tileReplacementQueue.markStartOfRenderFrame())}},g.prototype.update=function(e){var t=e.passes;t.render&&(this._tileProvider.beginUpdate(e),y(this,e),R(this,e),this._tileProvider.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&this._tileProvider.updateForPick(e)},g.prototype.endFrame=function(e){var t=e.passes;if(t.render&&e.mode!==m.MORPHING){M(this,e),I(this,e);var i=this._debug;i.suspendLodUpdate||i.enableDebugOutput&&(i.tilesVisited===i.lastTilesVisited&&i.tilesRendered===i.lastTilesRendered&&i.tilesCulled===i.lastTilesCulled&&i.maxDepth===i.lastMaxDepth&&i.tilesWaitingForChildren===i.lastTilesWaitingForChildren||(console.log("Visited "+i.tilesVisited+", Rendered: "+i.tilesRendered+", Culled: "+i.tilesCulled+", Max Depth: "+i.maxDepth+", Waiting for children: "+i.tilesWaitingForChildren),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren))}},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var O,N=new t,L=new u,B=new t,F=new e;return g}),define("Scene/Globe",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/EllipsoidTerrainProvider","../Core/Event","../Core/IntersectionTests","../Core/loadImage","../Core/Ray","../Core/Rectangle","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./QuadtreePrimitive","./SceneMode","./ShadowMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A){"use strict";function P(e){e=n(e,u.WGS84);var i=new c({ellipsoid:e}),r=new b;this._ellipsoid=e,this._imageryLayerCollection=r,this._surfaceShaderSet=new S,this._surfaceShaderSet.baseVertexShaderSource=new _({sources:[C,y]}),this._surfaceShaderSet.baseFragmentShaderSource=new _({sources:[v]}),this._surface=new T({tileProvider:new E({terrainProvider:i,imageryLayers:r,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=i,this._terrainProviderChanged=new d,this.show=!0,this.oceanNormalMapUrl=t("Assets/Textures/waterNormalsSmall.jpg"),this._oceanNormalMapUrl=void 0,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=A.RECEIVE_ONLY,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5}function M(t){return function(i,r){var n=e.distanceSquaredTo(i.pickBoundingSphere,t),o=e.distanceSquaredTo(r.pickBoundingSphere,t);return n-o}}function D(e,t){return m.contains(e.rectangle,t)?e:void 0}a(P.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}}});var I=[],R={start:0,stop:0};P.prototype.pick=function(t,r,n){var a=r.mode,s=r.mapProjection,l=I;l.length=0;var u,c,d=this._surface._tilesToRender,p=d.length;for(c=0;c<p;++c){u=d[c];var f=u.data;if(o(f)){var m=f.pickBoundingSphere;a!==x.SCENE3D?(e.fromRectangleWithHeights2D(u.rectangle,s,f.minimumHeight,f.maximumHeight,m),i.fromElements(m.center.z,m.center.x,m.center.y,m.center)):e.clone(f.boundingSphere3D,m);var _=h.raySphere(t,m,R);o(_)&&l.push(f)}}l.sort(M(t.origin));var g;for(p=l.length,c=0;c<p&&(g=l[c].pick(t,r.mode,r.mapProjection,!0,n),!o(g));++c);return g};var O=new i,N=new i,L=new r,B=new f;return P.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var r,a,s=t.length;for(a=0;a<s&&(r=t[a],!m.contains(r.rectangle,e));++a);if(o(r)&&m.contains(r.rectangle,e)){for(;r.renderable;)r=D(r.southwestChild,e)||D(r.southeastChild,e)||D(r.northwestChild,e)||r.northeastChild;for(;o(r)&&(!o(r.data)||!o(r.data.pickTerrain));)r=r.parent;if(o(r)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=i.fromRadians(e.longitude,e.latitude,0,l,O),c=B,d=l.geodeticSurfaceNormal(u,c.direction),h=l.getSurfaceNormalIntersectionWithZAxis(u,11500,c.origin);if(!o(h)){var p=Math.min(n(r.data.minimumHeight,0),-11500),f=i.multiplyByScalar(d,Math.abs(p)+1,N);i.subtract(u,f,c.origin)}var _=r.data.pick(c,void 0,void 0,!1,N);if(o(_))return l.cartesianToCartographic(_,L).height}}}},P.prototype.beginFrame=function(e){if(this.show){var t=this._surface,i=t.tileProvider,r=this.terrainProvider,n=this.showWaterEffect&&r.ready&&r.hasWaterMask;if(n&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var a=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=a,o(a)){var s=this;w(p(a),function(t){a===s.oceanNormalMapUrl&&(s._oceanNormalMap=s._oceanNormalMap&&s._oceanNormalMap.destroy(),s._oceanNormalMap=new g({context:e.context,source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var l=e.mode,u=e.passes;u.render&&(l===x.SCENE3D?this._zoomedOutOceanSpecularIntensity=.5:this._zoomedOutOceanSpecularIntensity=0,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,i.terrainProvider=this.terrainProvider,i.lightingFadeOutDistance=this.lightingFadeOutDistance,i.lightingFadeInDistance=this.lightingFadeInDistance,i.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,i.hasWaterMask=n,i.oceanNormalMap=this._oceanNormalMap,i.enableLighting=this.enableLighting,i.shadows=this.shadows,t.beginFrame(e))}},P.prototype.update=function(e){if(this.show){var t=this._surface,i=e.passes;i.render&&t.update(e),i.pick&&t.update(e)}},P.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},P.prototype.isDestroyed=function(){return!1},P.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(),s(this)},P}),define("Shaders/PostProcessFilters/PassThrough",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),define("Scene/GlobeDepth",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this.framebuffer=void 0,this._copyDepthFramebuffer=void 0,this._clearColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._viewport=new e,this._rs=void 0,this._debugGlobeDepthViewportCommand=void 0}function h(e,t,r){if(!i(e._debugGlobeDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\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_texture:function(){return e._globeDepthTexture}},owner:e})}e._debugGlobeDepthViewportCommand.execute(t,r)}function p(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(), -e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function f(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function m(e,t,i,r){e._colorTexture=new u({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE}),e._depthStencilTexture=new u({context:t,width:i,height:r,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}),e._globeDepthTexture=new u({context:t,width:i,height:r,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE})}function _(e,t,i,r){e.framebuffer=new a({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new a({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function g(e,t,r,n){var o=e._colorTexture,a=!i(o)||o.width!==r||o.height!==n;i(e.framebuffer)&&!a||(p(e),f(e),m(e,t,r,n),_(e,t,r,n))}function v(r,n,a,s){if(r._viewport.width=a,r._viewport.height=s,i(r._rs)&&e.equals(r._viewport,r._rs.viewport)||(r._rs=l.fromCache({viewport:r._viewport})),!i(r._copyDepthCommand)){var u="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";r._copyDepthCommand=n.createViewportQuadCommand(u,{uniformMap:{u_texture:function(){return r._depthStencilTexture}},owner:r})}r._copyDepthCommand.framebuffer=r._copyDepthFramebuffer,i(r._copyColorCommand)||(r._copyColorCommand=n.createViewportQuadCommand(c,{uniformMap:{u_texture:function(){return r._colorTexture}},owner:r})),r._copyDepthCommand.renderState=r._rs,r._copyColorCommand.renderState=r._rs,i(r._clearColorCommand)||(r._clearColorCommand=new o({color:new t(0,0,0,0),stencil:0,owner:r})),r._clearColorCommand.framebuffer=r.framebuffer}return d.prototype.executeDebugGlobeDepth=function(e,t){h(this,e,t)},d.prototype.update=function(e){var t=e.drawingBufferWidth,i=e.drawingBufferHeight;g(this,e,t,i),v(this,e,t,i),e.uniformState.globeDepthTexture=void 0},d.prototype.executeCopyDepth=function(e,t){i(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},d.prototype.executeCopyColor=function(e,t){i(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},d.prototype.clear=function(e,r,n){var o=this._clearColorCommand;i(o)&&(t.clone(n,o.color),o.execute(e,r))},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){p(this),f(this),i(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),i(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy());var e=this._debugGlobeDepthViewportCommand;return i(e)&&(e.shaderProgram=e.shaderProgram.destroy()),r(this)},d}),define("Scene/GoogleEarthImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadText","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(r){function n(e){var t;try{t=JSON.parse(e)}catch(i){t=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var n,o=0;o<t.layers.length;o++)if(t.layers[o].id===v._channel){n=t.layers[o];break}var s;if(!i(n))throw s="Could not find layer with channel (id) of "+v._channel+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,m),new u(s);if(!i(n.version))throw s="Could not find a version in channel (id) "+v._channel+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,m),new u(s);if(v._version=n.version,i(t.projection)&&"flat"===t.projection)v._tilingScheme=new a({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new l(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:r.ellipsoid});else{if(i(t.projection)&&"mercator"!==t.projection)throw s="Unsupported projection "+t.projection+".",_=c.handleError(_,v,v._errorEvent,s,void 0,void 0,void 0,m),new u(s);v._tilingScheme=new d({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:r.ellipsoid})}v._imageUrlTemplate=v._imageUrlTemplate.replace("{request}",v._requestType).replace("{channel}",v._channel).replace("{version}",v._version),v._ready=!0,v._readyPromise.resolve(!0),c.handleSuccess(_)}function p(e){var t="An error occurred while accessing "+g+".";_=c.handleError(_,v,v._errorEvent,t,void 0,void 0,void 0,m),v._readyPromise.reject(new u(t))}function m(){var e=i(v._proxy)?v._proxy.getURL(g):g,t=s(e);h(t,n,p)}r=t(r,{}),this._url=r.url,this._path=t(r.path,"/default_map"),this._tileDiscardPolicy=r.tileDiscardPolicy,this._proxy=r.proxy,this._channel=r.channel,this._requestType="ImageryMaps",this._credit=new e("Google Imagery",f._logoData,"http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=r.maximumLevel,this._imageUrlTemplate=this._url+this._path+"/query?request={request}&channel={channel}&version={version}&x={x}&y={y}&z={zoom}",this._errorEvent=new o,this._ready=!1,this._readyPromise=h.defer();var _,g=this._url+this._path+"/query?request=Json&vars=geeServerDefs&is2d=t",v=this;m()}function m(e,t,r,n){var o=e._imageUrlTemplate;o=o.replace("{x}",t),o=o.replace("{y}",r),o=o.replace("{zoom}",n+1);var a=e._proxy;return i(a)&&(o=a.getURL(o)),o}return r(f.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._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}}}),f.prototype.getTileCredits=function(e,t,i){},f.prototype.requestImage=function(e,t,i){var r=m(this,e,t,i);return p.loadImage(this,r)},f.prototype.pickFeatures=function(e,t,i,r,n){},f._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAnCAYAAACmP2LfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAHdElNRQfcDB4TJDr1mp5kAAAAGnRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xMDD0cqEAAB1zSURBVHhe7ZwHeFTFFsf/u+l9N70npOxuSAKEFFIhCSH0qhEQUHkgKCgWUFGBB6IoCAoo0ntooaRvEkIIBBBpoYSa3nvvfd+5u4sQUigPfMX8v2/Y3Tkzs3fv/d0z58zcgF69Ql1SY+MM1wQJem44ZeiJk8beEOqPwG6uC7ZqyElb9eo/JZEIkH2nRQkBIlNMauuPCS3uGN/kjkmNDghoskBAgzrZ2NLmf1+JwIKQpYsoxdmIV9+N07onCegzBPM9bOdmYKnazF6g/1N6UySPqSJzvCaaiLHtP8G/Phq+FRfgU5ogKWUXMLT6Mvzqr2BE40mMadqO8c3zMabBC6PqDDC8SlY60t9HByCLVTKu+ERmHr5TWI9wjVxEaOZivWo1pil8D1tZeWnLXv1l8iZ3PF2kjymiWRgvCoJv5U243IyAXcQq8A9Mg9W+4bDe6wv+kVGwCZkL+4Sf4ZR+BZ5VGQR3EkbWn8Hopm3wq54Lz2JD6ah/P21XGopQ9Qoc16jGSqVyTJWbQbUsibFXf42mihTwZpsvAtp3k0dOhFOSEH1+ngaDefrgjFCgFkxY8fCisCBvKgODzxRh9qslBFGfYmDGLbiV5mBwRRo8KtPhVBgPu8teMP7u73chD6kMRYRGBY5xqrFKqQwz5SdTbS/Qf5mmUYw8rf01CjHC4VP7AHZxO6E3qy9ZZCQNnio2rE/4o9/tkxiQUYp+KRXgx8XC5FsXcLz/hkCrDUU4pxLHuDVYpdwL9F+qqSJZKlPwenskfOoI5tN7YPCJGVme7wKYr5EBXzgYfW+mwTI0Gjrznaj2WW+I/y8dVPdDGLcKRzXrsEqlHO8oTKHaXqAZWe9hQXCi63NhHWYI3ilfWIW/YLjqL2JRiOFBJRz+LffhcPs09D+0J8vzn3zXdBnYnp8Mi6NboTWzH9X8fVc+DhDQodxqAroe36lU9AJNWr4cEAjNwI8OAC9cT1rbUfzwGeCfKiL7dGnNc+q1NiO80b4BY1oT4V6WDcsdc6j2xbyq4wMWrA9rQmeWFn36ey/jBaoPQ4hmLYI0G/AtAf22fC/QDols8ITrIYi/Bl6knbS2o3gRbxHQxQQ0k0S/gCa2v4OJovPwacqAQ1ICjL40klr+UrWoQbFBETo18jCpZsOoFODkvuCNJYoHW3QKXFEM7ETRcKfiQe8d6NVIFImXvg4skhY40mxnQYVRIIeA1qrHEc1GrFSpxFtP99AiFbDbNKDZpAzzGkVYVcvBuBJQEo/9/6C+dyjPitwLwak74D8V6Bfw0P5VShjXFoTR7TfhUZkL29M/wfATJan1lauWC3aDOgyaVDCuTgbf1bFkfmtkye1ogsK2asivLYfCglIoD8qCknI2NHuG4QSVGMgQyMbt0fioRYh9VYcRU7QX55uDcaHtFOJEsThMtmWtQgxsDodsWaC0c3ea3MzGBJEqxrfbYmzr6xjfPAeTmt5HQPO7eK1xDibUz8eY+k8xtHYJPCtXwvHOu7AXMrMTsF/TH8HajTis1YwVqpWY0TXQDKy1OpBr5EJA52Fukxx+bmKxtjWx2DuaWawNlZD5qhzyo9KhpHAbKpJO/6t65UCPbPHA2PYrGNacgkElabCJJDev/MpDhUKKnuq44LRoYEK1IiswkS1zYCfk5y+F0qjvoTwqBOof34dGeAnUL1ZCLboEnJ9zoe0QD/Nuj00UBVXRabzVLETM3S0ICfwA8yc7Y6C3ANYbZsA7aQ1W1xzEfZEQ6dT2BkG9pP4ouo7jGE1u42JS20QMrzkCr4xwuN4+AM+cYII3EaNar2J86zmMrP8DHulCON4NhU3YWuhOYy6SZENpH9cfx7WacFC7BSvUqjBDsRPQIiugURvazeqYVaqAw6dYrJ9WQy7gayj4nYDy3HtQOVQGpYRqKEWXQf2HdGha/AFdae9Xr4czz0ubISRA75ECbSut7agegO75OLxpahze8j5GtifBpzEDLiV30Dd2mNT6StWiCbVmLt5rUkBQCEt2zWzIMSA8HgrIBkLD+Sp0jhHISYXQ/KMYukfvQ3fQxq68XCTBHId/tMTg7LV1CFs4BszJ6hBarBgHlcRv8H7tbuSKQpFPYGe0BmND+nZ0npECaPKf0r4UIxsuoF/IMpitsAVnrA4s15uh3x8fwLXkLobUZGJIXTqcUzbDaJE5FAVq0t4S7dEcjqMEc6B2K5arVWN6Z6AbdOmm5mJelQKOHWSxF44Cy4CqxW0s6RwchCovFRohdGNfLgX3WiZ0N4aD++y7jfwYJUrAPCle/ZjKV+BFTSegrGAZIm3QjXhBytTWB3zhByzryMUU986jz16wD+96ijCNUIAgmkc3tS6G7GERjCbgR82B4OTbEESqIiCIcqsIYzoGGyrBEMSmgh8xBoIIAR2fAHZhj8Z9DOhl9FHeKkSDvn809fuc+iyCddRYaiOZBTvIt1YJfs0b4N+WDO+GHPLQN2Ab7S61vjJV60C9SRPvNSqzTpxlyQfS1dGUmjppK7gW16B/LhN6abnQu5cDwzO3YNhhqqK4WJY887sEdGzWFpxfOxmDpKZOOvgWFB8sx9L6nShvP4FyUQjKGg5gScpGKEqbUE7RxiGYv6QQ4zIG/r4D2m88sjEy/EIW/a6+TQ4gHe5VhXCvy4JL7gLYnesI2i6t4Tii04r92u1YKt767gB0ozrkGzmY26zEOh7Hkt+kAKhLTX9qOVVdg9aoNOjcToR+wUVKLYKgN0Zq7l7884wn9CKgr4AfWw/B6SwqKQRKOdXVghe9CpbherASSjtIpGpxRIHFjwygNreoXy0lb+lU7lHJBP9kPcGXQnBNghUB/Lh44fbUp5JA+5Hs71LbPPLCVRDEJZDNGIJgeQI6mG6KegKzldq1U7tGKjQmHR8vwl86kgRoAQN0xBw6ztn0nQ/ocxEdQ7L4d/BjG6g+m8aZTL/xsXPuW82Fb8t+DG1Ox5D6XAwqvQ67OA+p9ZWoUQPsei78mjSwNU9GLmEzVGZJTd3qFPTn3YZhXgYMMjNhlHsDxms/hNWfoUdrNPgEc2h7BG5d/Bo7Blt0BuNxXf4MVmXrkdRyEHWiY6hr2oc7mevRX2wc18gioEeI1+N9a+/CNnImVAZ0mhEoNOPAJT8MHjUF8KTiWhqHgbfMpVaJdhLQh3XasU9bJAZ6ekeg6zQwgEKuLSWysmd3QGmatLqD8qDNug3dCX/AIPk4jGr2wDB/JXTmkan70IvmZTY/rB9BdZlKLkG0lG0d5klAObKsw1+jzyFiWPnRawiaDrMYwTyMwMwh220WP2IWFVfqN4CKO8E3n0C6R/ZUej9Y2kUiMdDRFTRePH3nA3q/m7xpAEtAXl0QrkTwscnmS/3eptdzNEYevZLnZ5booqk8tuYs9tAny+n1LL1mghezlcULH0VtHamOZhvhIvoNOXQsd2EZIbluYnlWaMO75TCFG9kYXJ8H14o76H/10Z3yClSrCm6jGtbWK7LC7kIlYRfUmY2XHnUa+mbXYRSfCuNCptyE6b1jMBD/EPKwchQPLxGdxOWWI8iKXYBPqLozgI8pfA5YBWvxbfMeNLUfRmPTLjRnr8YKsdGvRQ5j2zZTSSRQ78H+7GhxfScFAINypsG9ukDspZ0LKKE+O0pqlGi71ggcIqD3dga6RhFKjSqYT+VEFkvu/E9Q+HNWKaE2VVDgVkPFqwAaay5CN3En9M59BM2vfKDs7AvljjPGE5LlharQdL+LoCmhOHU0rIUyD+NgVTOa+q2iVQiIcAKpHtbhXuJOjPqeVCRYThNE6VTvKNs3hM3cHGIxntxKyCbP7Erj1lHZJbVIJAG6iiCroZCAPGukvOyASJbvCgoaAoKoAQ1kHcGC7nmZDkmhBR2PfSQLtkcl4zCSAE2eO6qExYuYxrE4KqdvelBiM4+ncYQy1IY8d0wbhUSLJAZGbsUceNYdwJCGPAyuy4NbZToG3JoO1Qk9AvHvqF4ejo0KCKlisyl04Jw+AE1ma71HRUJP+QqM1t2HcVEyTEoSYVYQCuN3HenCt4XDhGA+KorAnYZ9KIj5ELOl3XpU/k/wrt+OmraDaG7cjpacbxFvYAAZDG5Vw/DWCxjRdp+ATsWAS6+D69H1+XDNsoVb1T06b0VwzCmBIOYdqUWibTojcFBH1CXQctBtUcA6Oh/RmVC4sBmKA5j6erC1qqE4sRpqG25A43QIOHuXgvOmP5R4ZH6m5UY2L9SSLjZ5sKjjsI/o8olH8ngjCZoSgmw9DMIl3t42Up0g+pq89/sEjLK47knZhSkSuDepJP4JOyNJyEFAR8VQKMOR1nbWM69yxNJYwh+VLE90ffPyxLE3EwL9Jq0huWQqwL1iA7zq8+FVl0+epgBO6T+gb2TH+OglqgastxtZrNNlkLt8E5oJx6HZdab7mFZBk3UZRjMewCT7HkzLfodZxREYr5sBjiIBPYiAPt8ehvSGPSg5vwjzpd16VNkmmDTswp22QDTXbkJrxhJkzHGDFoUQmvBpvo2hrZl0TnLhlLIYfUO7nt7dSg3hURcP1/JiDEgphuXBqVKLRFsfA3oJAf3mI6Cr2OjTwGYdqWGzzmZD6WoYVCfehdqsZKjuuwS1oB1Q+5piHac3oaxBzZ9vLZ4nHEeesoXg6niDPSYWP9yUgD5PHu48eKE64krHcErchHIEuRysTpAXjObQWIYEHiV4EQYEojp5aEoyY+IIpOQugKYYOnIdJXrdJ63PtWwXMQM6m6SVT4gfZkbHV0XHsVtaQ3K8yoJr0YfwoHDDq5ZiQSqDik/B4Q9taYtn18gyNia1qGJsmTrGlUjK2FJ1jCjRwOASDnkxDvN95ZD/og5yl0qgfCMJ2leDoeksHaFHXYOJVyrMkm/DrPwMzGr2wmjnLGipthyHL0W7t9pDkduwF2U3lmGFtvbTdyirt0OreT+iWwPRUrUBbSkLkT/fCUZwKVYikBMwpDlPXNzLwuAQ2rWX8KzUh2dDDJyLSmB7/S5Mf3WRWiR6CPSezkCXQs6qBnLCKsheyoXqnTCoL9oOFd9/Qtl9KJT6UJMX3/zhCz8iuCjhiviSYtMx3ZTJBN8lCE7eIRgF0p6krRRaRBDskTTGySBKws5SuUjJHYUiMQdpzCUE0Q3y5MnSDhJJQg5JUvjSgO5hHZofaioGmvc40IycMgbRtJktjgOZ5Ma9irzSg46xYHcaVEZevkgBHqUWGFK+FENKQ+BdGAq/wiMYWbwHI6h4FwTDOes0BMKFMHxPNg9qn1dANakYanfuQSs5FJoTpaP1qBswsSGgb9+EeUU0Af0LDH4dBhXlmv3wajuOpPYQFDcEojxtNQ6sn9ZzUsiofjfUWg/iYOt+tJatRtvN95DqZgxNuKTKwLV4Jdyqc8Wz1uCGTLjmDIVDQqewQ8anwpJi6GsYkF4Ey2O/QvsfXKlJIgboAwT07s5AZ0G1TylUIsuhdKMI6vcuQ3PVAqg+9UZ8JvGEywiuNoIwD4IzaV2X+HSa1otgE3+NwJImVkycG0kx8snfyUZJW+QFApeSu+hN9BpIn6n+ZBp9bqDv+C8Fum+8IpzzJNOmR3UhTaGFcC07iAHXmamuZw28C/S/aIt+CcthF7+ToN0EQdhqOFzcBu/Sm/ApvAGX3DzYXIiF9jtWTJf74L6ZC83UfGg8SId2xnloSZKxp+gWjC0J6KSrMK8KhmnlSugtInpkCzaBV78Hl5oPoaLpECrLt+Bi4jfgS7t1q+YDUGsPwj5KDFsLlqD97JuIpmpZmP+TftM1ezjlxsOllM4H3eReDWHwKrOBW84jqMeK5OBTv4Bu6HxxgqU1s/N3MkAHSoH+ioCe+gjoJHB0s8ENLID6/UJo3E+GVlwoNEwY278tXhR50RhmeexzgmM8JXjdF36MHwEoiXn70Csv6gxBm8PiRc6gJFD1HDzFpq1cP0omo5QJZAfqQzH0f6uHZjQgeR4cC/IJZCnUtSkYVPAWBiX2/CdU/S7Ql+9TgtFCTaiP0qAEXA2yRsqwuzECziWZcM4tgv2DSljF7ID+l+JNh9+hY38HuvcYmLOhk5EEnVPfQOmpW+33YGaXhj53E2BWuxvGebOh5cPUX/sWSgXrsa9mB2qaDqCK4C7I2IA3jn8u7tat2g6D034MIbWb0fZgHlr2DscXUhNNuYdkYRPrg/7JiXDMLYBrZS6GNEZgVJM/JjWY4I16G4xr/BCDq2nKjjoAvY+Zpwo7eXBskQK9Swr0lEdAn4a2wk3o/DMNWmn54KYUQIuZsebGQuXFQ42H4kfNk4QckSOkNZ1lGkGAUoInOKkAm2jJsVtH+om9Nj9ytZxNcNdhljXByo+JJXj/i4G2u2xM02YInPJLxFB7VudTPH0ZHkWu0hbPpwHpfnAszoFDVgVsb1fDMmoL9L8S7wTFQE/1AvR33oB+QSp0czKgl34B2iO9uwJCKib5SGaZjbqLPlkhMG1YDr1gQyioSs24vQTDitagsnIL6loCUVu9C2EJK9FjYtsWBNP2Q7hb9A155zdwY5mTeGexo0w32hEcy2F7JQaOqZfgk38KY6rDMKFBiGHNt+iGPgCNYd0/s/sbAb2fgN5JQC9Wq8bkR0AzioOOx3Xo30mGbnY+tNMKoJOQCm03qfnFxRf6E1yUFAqZJcyuZRWuQmB+TWHJcgJfkjPxImcSSIUsXviMx/O9DvqfALrPDjb6nhuBAWkZ5JFKKTYuIqhz4FUdAo9CGwzO7Ra2LjUg0w9OxdlwyKxAXzHQm8lDi4HeAT1WMPSHnYXR7aswKE6Gfl4K9PdfgZ6+uG8XSmMbKyXD/LsEmFduglH2NHA7rA3Hvg+Ve1/gYO4KNFRvQUPLQVRU7MG4yn1dJ4eiULAo3JhW9xsa77+Hml8GY8FQ425uAM5wRRivNoPlTjs4XhoH35oLGFZ/S/wglyDkbWmrrsUAvY+A3kHlSwJ6ihKzCvLnuQyElmIs9LdfhmHxA+jn5kI3jcrRFOjxU6DTbTx9DybsOBh0f034EeYEVyaFD0IYhnQ9y1pTIsiPvU5AnKYkUBL78yKmQhDLgDRPSWtPp/HFkFtHqFCfRBr73wX67qsD+qFsEubCnqKBAZllcCkkT12RjSHVMfApH0bJXfcH+aQGZg6FU1EWeeoK2NwgoMM3Q++zP/fq/Smf2g392ZEwzk2Acfl9GBHURmuSYPyn132oHBizH8B8wjX0SadQI2cWtOZZQbHTdEgRn8XN93EiczFayn5GU3Mg7lJMPab5SEeoCWZZ0TF4Ne/A/ZSPUbXdDz9Qdddrrk/KtcwR7jX34VXDzGCFGFT0GzyLu922x069kdiv145tOu34jlOHBWoz4arUAZQt0LYOhmFcHJ2H6zAsYnZDc2FwKhv60+m9UQrLUJ4hSYQAVhpM1O6jj30EDD33Q6frZyoY8cMVaWZZR560kuB5V9H6iVUas+Py5L1/IHsT2ZldR4nEkMdkUd8Y8tYd43mLIMhYhenDWvgjQSQiGFOkiEv0rEAzK2u8yG10M2WwBWFdb6q9NKDNd6rCOuYD9L2VI/57QMfcEniU5cCnJgG+lR9haAnz4MzT5ZjmA4e8HBqnGtYXamF+nK7bpx0uwHxoqGyE3sKD5HHjYVJ1C6Z5qTD5Ph2G1hnQEV/0LBhxU2E+4yYsbgTCJGsuNBfYQrnjA0CPxDo2CRYJ0xGesgD1ZWvQ3LQbKeSJ54uC0UcUDVVRGExFR/FB2y7cSf4C+Zv9sXSUeQ9P2z2pQdnmBHQsPKqKqFCyWJsM75o1GMw8O/iEhFZs/KK9CD9wRfhCTYTP1dqwnBOHrQYz8IuuH5ZxxI/MLQZH5kfoeu6D4cVQGNecgXHFbRgXZsD4Xg5MjqfDeE0KTBbRDLXsLiwOR8HkxCJoOs+Eavdr08ZBBGdYP7rYzAZILsH3LYUYtgSsAXlYRwLqW0r8Ksl2id4/Onaz47IE+kayUfwddYhsgwkqXRrLgOpHEuyhVF9B7ytoTAL//qNjeFagGfGEi5nvYPEifqOx/ek4p1J/8aKBWC8N6Icy2+oL6zOhECTmw46SuoHZpXBn/pK7/DK8K1bCp3Q0vAv7wqfIBD55OuS9teFVYASPfAFccseThw+E4Ho5LOMqYB6ZCeOdK6H1bleJH2sOOPZradqlC3otDqY5F2GafQmmCZdgFnMBZteEML2yCnprh0CZWVp66gbDuD5Q2uSLUacm43jSB0gq+h55JeuRX7wRqUUbkJL8DS4GTcPqCdZgduZ6XiZjgvcp9fIY3aAH/yY+3KvcMDBjLSXQBXDML4VbaQG8a9PgUxcOzyIneKY/Or6FHDO8q7INY+RiMFJaJijE4i2VeEylej/FDs99TAPH8Dvofv8bDK/vhVHxMRhX0W+vOgXTijiY5UXANGkNnYeRUGN2VrsPNx6XVaQNgRNM03sBgUjeOKJJ/Cr+LNzFsg61YB5/elyKtic0qM031CaZAG0gqJnVEuYBIoI49gy9D6DXrQR3GoU2j3YE+WE2FI9TGBG1FLywnhNbPt1Y/OhY+o5iGqsGNmdLaVxfqZUB+g0Iztwi2AOkNZ3FCzOm30bHeHK9tKYHKfPZMFhlAtM9c2EpjALv93zY3qlE/8xyOOUVUTiSBrfy83CvDIdbRZC4uJSGwzHzd0qgkmEVfRnGW/dC79vPobtkFLRmm0HDpVt43MnrzoOm/dfQeeOf0P3wB+guJogXrIDuhHfAsdOFbKdQ5GkaYQbNNYNht2c8/AOnYNKB6Ri//Q14zRwIuohdPC76pCbWKGFCkx9GNC7B0NZD8CiJh8Odi7A59zud7EuwvU4hVUYZBhUXwqsqA56V0RiUM1Dam36UoiyFuprQhc6fRZuKKhV5+rcLKD2hrPQ+NPsvgNb0j6C9eCG0v/kU2l9/BK0ZM8EdRJQ833noG8Qib6lDkA0lYD6i8GIJlffZ/IhhbJtQjW4TP164EiWWztTnH9T+a4L/MxpjAn02hWWYDAQnefSZzm7Io7zDOpiSzGh3grwPwd3zDccPZdH4phBEkXcWBrD4wlE07qObw5pmBUGsK43T/YPfgmAFWEe5U2EeCXhGcV5nQ3u2KrTf6w+jdTNhtud7mB/ZC4vg43QAwbAMDYLF0e3os+8HGP80D7oLx0F9dD+oj9AGZ4Y85K0Yj/Vs3kQiFgeybFPIySiDzdwAz9O3JzHjPNtYk8gjv948FOOatlGodR0Dk07Bau9n0F8wFBp+luBO1CXeuDD51Q3830PRP7UIzgUlcC0vhHPRSdic6eI53ecT3W0sKyjI2EFRxhzyz3sOO8voBkEUTclYhAyshCwr642PR79diwlbBOEs8vLMFjgbbuelhpeoz5rEDxsNNl/+9ON5RWJOLsXCysQdh5IhWWbzhUmoel6v/l/RxGpZTKgbh3EtEZQMp5AX2ASd2f3AVu7695ky/7nOuc2U/BZSCFIGp+I82F/rfprsVa/+Mk0sZ2F0tTvGNZ+gRO8B7C/HQ92beWine+/IDWDBbJUmbBN/hUNOGRyyStH34vfQeP3ZV4R61atXIu9Kefg1rIB/XRJciwso9nymLXmxbP+wxcCsVAxIKwfv1AZoDH96jN6rXr1SuVeowKsuFINrs+BSXATbc59JLU/XwCwdDMw7B/vUEpgHfQYZ7v9HCNar/2E55ynDpSwYrhXF4uKUeQiY0/Oy3kM555nCITcJgmvp0F30Yo8L9KpXL1X9E2XhkPoVBuYWwbmolKDOhmv+WHiXyGNkgbTRE1pOublXkRycCz+AfUoRzPdsgKJN1w/19KpXf7n6xlnCPikE/SkWdswrozDkNoZUfIWhFTYYWaPy4a6NkgSR2XAZXSOLIWUWcCv7FP1T7sH8wFZwp7ycxz971auXIm4AG+b77MFLEKLv7ULJMy0FefCsPAOv0t0YUrIMg0s+gVfxYrgVbIJLUSzsrl2F2ZZl4L7J/Pdp/956ca969UrEna0O41/HwSJ4F3in42Fz5Trsbt5Bv3u30e9uImyvnoV15GGY/LIA6kOZP1966pZ8r3r1n5eqhwZ0F/aB4ToHGK9zh/FPHjD60RE6H1tDaaA2cdy7mvFfI+BffksPNrEksu0AAAAASUVORK5CYII=",f}),define("Scene/GridImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._tilingScheme=i(e.tilingScheme)?e.tilingScheme:new o({ellipsoid:e.ellipsoid}),this._cells=t(e.cells,8),this._color=t(e.color,l),this._glowColor=t(e.glowColor,u),this._glowWidth=t(e.glowWidth,6),this._backgroundColor=t(e.backgroundColor,c),this._errorEvent=new n,this._tileWidth=t(e.tileWidth,256),this._tileHeight=t(e.tileHeight,256),this._canvasSize=t(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=a.resolve(!0)}var l=new e(1,1,1,.4),u=new e(0,1,0,.05),c=new e(0,.5,0,.2);return r(s.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}}}),s.prototype._drawGrid=function(e){for(var t=0,i=this._canvasSize,r=0;r<=this._cells;++r){var n=r/this._cells,o=1+n*(i-1);e.moveTo(o,t),e.lineTo(o,i),e.moveTo(t,o),e.lineTo(i,o)}e.stroke()},s.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=0,i=this._canvasSize,r=e.getContext("2d"),n=this._backgroundColor.toCssColorString();r.fillStyle=n,r.fillRect(t,t,i,i);var o=this._glowColor.toCssColorString();r.strokeStyle=o,r.lineWidth=this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r),r.lineWidth=.5*this._glowWidth,r.strokeRect(t,t,i,i),this._drawGrid(r);var a=this._color.toCssColorString();return r.strokeStyle=a,r.lineWidth=2,r.strokeRect(t,t,i,i),r.lineWidth=1,this._drawGrid(r),e},s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){return this._canvas},s.prototype.pickFeatures=function(e,t,i,r,n){},s}),define("Scene/MapboxImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/MapboxApi","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT);var n=r.mapId,s=t(r.url,"https://api.mapbox.com/v4/");this._url=s,this._mapId=n,this._accessToken=o.getAccessToken(r.accessToken),this._accessTokenErrorCredit=o.getErrorCredit(r.key);var d=t(r.format,"png");/\./.test(d)||(d="."+d),this._format=d;var h=s;if(l.test(s)||(h+="/"),h+=n+"/{z}/{x}/{y}"+this._format,i(this._accessToken)&&(h+="?access_token="+this._accessToken),i(r.credit)){var p=r.credit;"string"==typeof p&&(p=new e(p)),u=p,c.length=0}this._imageryProvider=new a({url:h,proxy:r.proxy,credit:u,ellipsoid:r.ellipsoid,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,rectangle:r.rectangle})}var l=/\/$/,u=new e("© Mapbox © OpenStreetMap",void 0,"https://www.mapbox.com/about/maps/"),c=[new e("Improve this map",void 0,"https://www.mapbox.com/map-feedback/")];return r(s.prototype,{url:{get:function(){return this._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}}}),s.prototype.getTileCredits=function(e,t,r){var n=c.slice();return i(this._accessTokenErrorCredit)&&n.push(this._accessTokenErrorCredit),n},s.prototype.requestImage=function(e,t,i){return this._imageryProvider.requestImage(e,t,i)},s.prototype.pickFeatures=function(e,t,i,r,n){return this._imageryProvider.pickFeatures(e,t,i,r,n)},s}),define("Scene/Moon",["../Core/buildModuleUrl","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IauOrientationAxes","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","./EllipsoidPrimitive","./Material"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t){t=i(t,i.EMPTY_OBJECT);var n=t.textureUrl;r(n)||(n=e("Assets/Textures/moonSmall.jpg")),this.show=i(t.show,!0),this.textureUrl=n,this._ellipsoid=i(t.ellipsoid,a.MOON),this.onlySunLighting=i(t.onlySunLighting,!0),this._ellipsoidPrimitive=new h({radii:this.ellipsoid.radii,material:p.fromType(p.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new s}n(f.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var m=new l,_=new l,g=new t,v=[];return f.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;r(d.computeIcrfToFixedMatrix(i,m))||d.computeTemeToPseudoFixedMatrix(i,m);var n=this._axes.evaluate(i,_);l.transpose(n,n),l.multiply(m,n,n);var o=c.computeMoonPositionInEarthInertialFrame(i,g);l.multiplyByVector(m,o,o),u.fromRotationTranslation(n,o,t.modelMatrix);var a=e.commandList;return e.commandList=v,v.length=0,t.update(e),e.commandList=a,1===v.length?v[0]:void 0}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},f});define("Scene/NeverTileDiscardPolicy",[],function(){"use strict";function e(e){}return e.prototype.isReady=function(){return!0},e.prototype.shouldDiscardImage=function(e){return!1},e});define("Shaders/AdjustTranslucentFS",[],function(){"use strict";return"#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"}),define("Shaders/CompositeOITFS",[],function(){"use strict";return"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;\n}\n"}),define("Scene/OIT",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_){"use strict";function g(i){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var r=i.floatingPointTexture&&i.depthTexture;this._translucentMRTSupport=i.drawBuffers&&r,this._translucentMultipassSupport=!this._translucentMRTSupport&&r,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 a({color:new t(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new a({color:new t(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._alphaClearCommand=new a({color:new t(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 e,this._rs=void 0}function v(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function y(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 C(e){v(e),y(e)}function w(e,t,i,r){v(e);var o=new Float32Array(i*r*4);e._accumulationTexture=new h({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r}}),e._revealageTexture=new h({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:i,height:r}})}function S(e,t){y(e);var i=o.FRAMEBUFFER_COMPLETE,r=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),e._translucentFBO.status===i&&e._adjustTranslucentFBO.status===i||(y(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new l({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new l({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===i,a=e._alphaFBO.status===i,s=e._adjustTranslucentFBO.status===i,u=e._adjustAlphaFBO.status===i;n&&a&&s&&u||(C(e),e._translucentMultipassSupport=!1,r=!1)}return r}function E(e,t,r,n){var o=r[n.id];if(!i(o)){var a=c.getState(n);a.depthMask=!1,a.blending=t,o=c.fromCache(a),r[n.id]=o}return o}function b(e,t,i){return E(t,O,e._translucentRenderStateCache,i)}function T(e,t,i){return E(t,N,e._translucentRenderStateCache,i)}function x(e,t,i){return E(t,L,e._alphaRenderStateCache,i)}function A(e,t,r,n){var o=e.shaderCache.getDerivedShaderProgram(t,r);if(!i(o)){var a=t._attributeLocations,s=t.fragmentShaderSource.clone();s.sources=s.sources.map(function(e){return e=d.replaceMain(e,"czm_translucent_main"),e=e.replace(/gl_FragColor/g,"czm_gl_FragColor"),e=e.replace(/\bdiscard\b/g,"czm_discard = true"),e=e.replace(/czm_phong/g,"czm_translucentPhong")}),s.sources.splice(0,0,(n.indexOf("gl_FragData")!==-1?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),s.sources.push("void main()\n{\n czm_translucent_main();\n if (czm_discard)\n {\n discard;\n }\n"+n+"}\n"),o=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:s,attributeLocations:a})}return o}function P(e,t){return A(e,t,"translucentMRT",B)}function M(e,t){return A(e,t,"translucentMultipass",F)}function D(e,t){return A(e,t,"alphaMultipass",k)}function I(e,t,i,r,n){var o,a,s,l=t.context,u=r.framebuffer,c=n.length,d=t.frameState.shadowHints.shadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(l,r),r.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(l,r);var h=e._opaqueFBO;for(r.framebuffer=e._translucentFBO,s=0;s<c;++s)o=n[s],a=d&&o.receiveShadows?o.derivedCommands.oit.shadows.translucentCommand:o.derivedCommands.oit.translucentCommand,i(a,t,l,r,h);for(r.framebuffer=e._alphaFBO,s=0;s<c;++s)o=n[s],a=d&&o.receiveShadows?o.derivedCommands.oit.shadows.alphaCommand:o.derivedCommands.oit.alphaCommand,i(a,t,l,r,h);r.framebuffer=u}function R(e,t,i,r,n){var o=t.context,a=r.framebuffer,s=n.length,l=t.frameState.shadowHints.shadowsEnabled;r.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(o,r);var u=e._opaqueFBO;r.framebuffer=e._translucentFBO;for(var c=0;c<s;++c){var d=n[c],h=l&&d.receiveShadows?d.derivedCommands.oit.shadows.translucentCommand:d.derivedCommands.oit.translucentCommand;i(h,t,o,r,u)}r.framebuffer=a}g.prototype.update=function(t,r){if(this.isSupported()){this._opaqueFBO=r,this._opaqueTexture=r.getColorTexture(0),this._depthStencilTexture=r.depthStencilTexture;var n=this._opaqueTexture.width,o=this._opaqueTexture.height,a=this._accumulationTexture,s=!i(a)||a.width!==n||a.height!==o;if(s&&w(this,t,n,o),i(this._translucentFBO)&&!s||S(this,t)){var l,u,h=this;i(this._compositeCommand)||(l=new d({sources:[f]}),this._translucentMRTSupport&&l.defines.push("MRT"),u={u_opaque:function(){return h._opaqueTexture},u_accumulation:function(){return h._accumulationTexture},u_revealage:function(){return h._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this})),i(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(l=new d({defines:["MRT"],sources:[p]}),u={u_bgColor:function(){return h._translucentMRTClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this})):this._translucentMultipassSupport&&(l=new d({sources:[p]}),u={u_bgColor:function(){return h._translucentMultipassClearCommand.color},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this}),u={u_bgColor:function(){return h._alphaClearCommand.color; -},u_depthTexture:function(){return h._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(l,{uniformMap:u,owner:this}))),this._viewport.width=n,this._viewport.height=o,i(this._rs)&&e.equals(this._viewport,this._rs.viewport)||(this._rs=c.fromCache({viewport:this._viewport})),i(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var O={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:_.ONE,functionDestinationRgb:_.ONE,functionSourceAlpha:_.ZERO,functionDestinationAlpha:_.ONE_MINUS_SOURCE_ALPHA},N={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:_.ONE,functionDestinationRgb:_.ONE,functionSourceAlpha:_.ONE,functionDestinationAlpha:_.ONE},L={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:_.ZERO,functionDestinationRgb:_.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:_.ZERO,functionDestinationAlpha:_.ONE_MINUS_SOURCE_ALPHA},B=" 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",F=" 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",k=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";return g.prototype.createDerivedCommands=function(e,t,r){if(i(r)||(r={}),this._translucentMRTSupport){var n,o;i(r.translucentCommand)&&(n=r.translucentCommand.shaderProgram,o=r.translucentCommand.renderState),r.translucentCommand=s.shallowClone(e,r.translucentCommand),i(n)&&r.shaderProgramId===e.shaderProgram.id?(r.translucentCommand.shaderProgram=n,r.translucentCommand.renderState=o):(r.translucentCommand.shaderProgram=P(t,e.shaderProgram),r.translucentCommand.renderState=b(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}else{var a,l,u,c;i(r.translucentCommand)&&(a=r.translucentCommand.shaderProgram,l=r.translucentCommand.renderState,u=r.alphaCommand.shaderProgram,c=r.alphaCommand.renderState),r.translucentCommand=s.shallowClone(e,r.translucentCommand),r.alphaCommand=s.shallowClone(e,r.alphaCommand),i(a)&&r.shaderProgramId===e.shaderProgram.id?(r.translucentCommand.shaderProgram=a,r.translucentCommand.renderState=l,r.alphaCommand.shaderProgram=u,r.alphaCommand.renderState=c):(r.translucentCommand.shaderProgram=M(t,e.shaderProgram),r.translucentCommand.renderState=T(this,t,e.renderState),r.alphaCommand.shaderProgram=D(t,e.shaderProgram),r.alphaCommand.renderState=x(this,t,e.renderState),r.shaderProgramId=e.shaderProgram.id)}return r},g.prototype.executeCommands=function(e,t,i,r){return this._translucentMRTSupport?void R(this,e,t,i,r):void I(this,e,t,i,r)},g.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},g.prototype.clear=function(e,i,r){var n=i.framebuffer;i.framebuffer=this._opaqueFBO,t.clone(r,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,i),i.framebuffer=this._translucentFBO;var o=this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand;o.execute(e,i),this._translucentMultipassSupport&&(i.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,i)),i.framebuffer=n},g.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){return C(this),i(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),i(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),i(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),r(this)},g}),define("Scene/OrthographicFrustum",["../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,i,r,n,o,a){"use strict";function s(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new a,this._orthographicMatrix=new o}function l(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=o.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}r(s.prototype,{projectionMatrix:{get:function(){return l(this),this._orthographicMatrix}}});var u=new e,c=new e,d=new e,h=new e;return s.prototype.computeCullingVolume=function(r,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,p=this.right,f=this.left,m=this.near,_=this.far,g=e.cross(n,o,u),v=c;e.multiplyByScalar(n,m,v),e.add(r,v,v);var y=d;e.multiplyByScalar(g,f,y),e.add(v,y,y);var C=a[0];return i(C)||(C=a[0]=new t),C.x=g.x,C.y=g.y,C.z=g.z,C.w=-e.dot(g,y),e.multiplyByScalar(g,p,y),e.add(v,y,y),C=a[1],i(C)||(C=a[1]=new t),C.x=-g.x,C.y=-g.y,C.z=-g.z,C.w=-e.dot(e.negate(g,h),y),e.multiplyByScalar(o,l,y),e.add(v,y,y),C=a[2],i(C)||(C=a[2]=new t),C.x=o.x,C.y=o.y,C.z=o.z,C.w=-e.dot(o,y),e.multiplyByScalar(o,s,y),e.add(v,y,y),C=a[3],i(C)||(C=a[3]=new t),C.x=-o.x,C.y=-o.y,C.z=-o.z,C.w=-e.dot(e.negate(o,h),y),C=a[4],i(C)||(C=a[4]=new t),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-e.dot(n,v),e.multiplyByScalar(n,_,y),e.add(r,y,y),C=a[5],i(C)||(C=a[5]=new t),C.x=-n.x,C.y=-n.y,C.z=-n.z,C.w=-e.dot(e.negate(n,h),y),this._cullingVolume},s.prototype.getPixelDimensions=function(e,t,i,r){l(this);var n=this.right-this.left,o=this.top-this.bottom,a=n/e,s=o/t;return r.x=a,r.y=s,r},s.prototype.clone=function(e){return i(e)||(e=new s),e.left=this.left,e.right=this.right,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},s.prototype.equals=function(e){return i(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},s}),define("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";function t(e){if("string"==typeof e){var t=document.getElementById(e);e=t}return e}return t}),define("Scene/PerformanceDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,i,r,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT);var i=o(t.container);this._container=i;var r=document.createElement("div");r.className="cesium-performanceDisplay";var n=document.createElement("div");n.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),n.appendChild(this._fpsText);var a=document.createElement("div");a.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),a.appendChild(this._msText),r.appendChild(a),r.appendChild(n),this._container.appendChild(r),this._lastFpsSampleTime=void 0,this._frameCount=0,this._time=void 0,this._fps=0,this._frameTime=0}return a.prototype.update=function(){if(!t(this._time))return this._lastFpsSampleTime=n(),void(this._time=n());var e=this._time,i=n();this._time=i;var r=i-e;this._frameCount++;var o=this._fps,a=i-this._lastFpsSampleTime;a>1e3&&(o=1e3*this._frameCount/a|0,this._lastFpsSampleTime=i,this._frameCount=0),o!==this._fps&&(this._fpsText.nodeValue=o+" FPS",this._fps=o),r!==this._frameTime&&(this._msText.nodeValue=r.toFixed(2)+" MS",this._frameTime=r)},a.prototype.destroy=function(){return i(this)},a}),define("Scene/PickDepth",["../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture"],function(e,t,i,r,n,o,a){"use strict";function s(){this.framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._debugPickDepthViewportCommand=void 0}function l(t,i,r){if(!e(t._debugPickDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\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";t._debugPickDepthViewportCommand=i.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return t._depthTexture}},owner:t})}t._debugPickDepthViewportCommand.execute(i,r)}function u(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function c(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy()}function d(e,t,r,o){e._depthTexture=new a({context:t,width:r,height:o,pixelFormat:i.RGBA,pixelDatatype:n.UNSIGNED_BYTE})}function h(e,t,i,n){u(e),c(e),d(e,t,i,n),e.framebuffer=new r({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function p(t,i,r){var n=r.width,o=r.height,a=t._depthTexture,s=!e(a)||a.width!==n||a.height!==o;e(t.framebuffer)&&!s||h(t,i,n,o)}function f(t,i,r){if(!e(t._copyDepthCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";t._copyDepthCommand=i.createViewportQuadCommand(n,{renderState:o.fromCache(),uniformMap:{u_texture:function(){return t._textureToCopy}},owner:t})}t._textureToCopy=r,t._copyDepthCommand.framebuffer=t.framebuffer}return s.prototype.executeDebugPickDepth=function(e,t){l(this,e,t)},s.prototype.update=function(e,t){p(this,e,t),f(this,e,t)},s.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return u(this),c(this),this._copyDepthCommand.shaderProgram=e(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),t(this)},s}),define("Shaders/Appearances/PointAppearanceFS",[],function(){"use strict";return"uniform vec4 highlightColor;\nvarying vec3 v_color;\nvoid main()\n{\ngl_FragColor = vec4(v_color * highlightColor.rgb, highlightColor.a);\n}\n"}),define("Shaders/Appearances/PointAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 color;\nattribute float batchId;\nuniform float pointSize;\nvarying vec3 v_positionEC;\nvarying vec3 v_color;\nvoid main()\n{\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * czm_computePosition();\ngl_PointSize = pointSize;\n}\n"}),define("Scene/PointAppearance",["../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PointAppearanceFS","../Shaders/Appearances/PointAppearanceVS","./Appearance"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(n){n=i(n,i.EMPTY_OBJECT),this._vertexShaderSource=i(n.vertexShaderSource,s),this._fragmentShaderSource=i(n.fragmentShaderSource,a),this._renderState=l.getDefaultRenderState(!1,!1,n.renderState),this._pointSize=i(n.pointSize,2),this._highlightColor=r(n.highlightColor)?n.highlightColor:new e,this.material=void 0,this.translucent=i(n.translucent,!1),this.uniforms={highlightColor:this._highlightColor,pointSize:this._pointSize};var o=n.uniforms;this.uniforms=t(this.uniforms,o,!0)}return n(u.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return!1}},vertexFormat:{get:function(){return u.VERTEX_FORMAT}},pixelSize:{get:function(){return this._pointSize}}}),u.VERTEX_FORMAT=o.POSITION_AND_COLOR,u.prototype.getFragmentShaderSource=l.prototype.getFragmentShaderSource,u.prototype.isTranslucent=l.prototype.isTranslucent,u.prototype.getRenderState=l.prototype.getRenderState,u}),define("Scene/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,i,r,n,o){"use strict";function a(i){i=t(i,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(i.show,!0),this.destroyPrimitives=t(i.destroyPrimitives,!0)}function s(e,t){return e._primitives.indexOf(t)}return r(a.prototype,{length:{get:function(){return this._primitives.length}}}),a.prototype.add=function(e){var t=e._external=e._external||{},i=t._composites=t._composites||{};return i[this._guid]={collection:this},this._primitives.push(e),e},a.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},a.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},a.prototype.removeAll=function(){if(this.destroyPrimitives)for(var e=this._primitives,t=e.length,i=0;i<t;++i)e[i].destroy();this._primitives=[]},a.prototype.contains=function(e){return!!(i(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},a.prototype.raise=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(t!==r.length-1){var n=r[t];r[t]=r[t+1],r[t+1]=n}}},a.prototype.raiseToTop=function(e){if(i(e)){var t=s(this,e),r=this._primitives;t!==r.length-1&&(r.splice(t,1),r.push(e))}},a.prototype.lower=function(e){if(i(e)){var t=s(this,e),r=this._primitives;if(0!==t){var n=r[t];r[t]=r[t-1],r[t-1]=n}}},a.prototype.lowerToBottom=function(e){if(i(e)){var t=s(this,e),r=this._primitives;0!==t&&(r.splice(t,1),r.unshift(e))}},a.prototype.get=function(e){return this._primitives[e]},a.prototype.update=function(e){if(this.show)for(var t=this._primitives,i=0;i<t.length;++i)t[i].update(e)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a}),define("Scene/QuadtreeTileProvider",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function i(){t.throwInstantiationError()}return i.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},e(i.prototype,{quadtree:{get:t.throwInstantiationError,set:t.throwInstantiationError},ready:{get:t.throwInstantiationError},tilingScheme:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError}}),i.prototype.beginUpdate=t.throwInstantiationError,i.prototype.endUpdate=t.throwInstantiationError,i.prototype.getLevelMaximumGeometricError=t.throwInstantiationError,i.prototype.loadTile=t.throwInstantiationError,i.prototype.computeTileVisibility=t.throwInstantiationError,i.prototype.showTileThisFrame=t.throwInstantiationError,i.prototype.computeDistanceToTile=t.throwInstantiationError,i.prototype.isDestroyed=t.throwInstantiationError,i.prototype.destroy=t.throwInstantiationError,i}),define("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","../Core/Matrix4","../Core/Ray","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../Core/Transforms","./Camera","./OrthographicFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0}function g(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new u(e._scene.canvas,!1);var i=function(){e._morphCancelled=!0,t(e)};e._completeMorph=i,e._morphHandler.setInputAction(i,c.LEFT_DOWN),e._morphHandler.setInputAction(i,c.MIDDLE_DOWN),e._morphHandler.setInputAction(i,c.RIGHT_DOWN),e._morphHandler.setInputAction(i,c.WHEEL)}}function v(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()}function y(e,t){var i=e._scene,r=i.camera,n=Y,o=n.position,a=n.direction,l=n.up,u=i.mapProjection.unproject(r.position,W);t.cartographicToCartesian(u,o);var c=t.scaleToGeodeticSurface(o,q),h=d.eastNorthUpToFixedFrame(c,t,j);return s.multiplyByPointAsVector(h,r.direction,a),s.multiplyByPointAsVector(h,r.up,l),n}function C(t,i,r,n){function a(t){S(c,f,t.time,u.position),S(d,m,t.time,u.direction),S(p,_,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}i*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,X),d=e.clone(u.direction,Z),p=e.clone(u.up,K),f=s.multiplyByPoint(h.TRANSFORM_2D_INVERSE,r.position,Q),m=s.multiplyByPointAsVector(h.TRANSFORM_2D_INVERSE,r.direction,J),_=s.multiplyByPointAsVector(h.TRANSFORM_2D_INVERSE,r.up,$),g=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){M(t,l,0,1,i,n)}});t._currentTweens.push(g)}function w(t,i,r){function n(t){S(h,_,t.time,l.position),S(p,v,t.time,l.direction),S(f,w,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right);var i=l.frustum;i.right=a.lerp(E,b,t.time),i.left=-i.right,i.top=i.right*(s.drawingBufferHeight/s.drawingBufferWidth),i.bottom=-i.top,l.position.z=2*s.mapProjection.ellipsoid.maximumRadius}i/=3;var s=t._scene,l=s.camera,u=ee;u.aspectRatio=s.drawingBufferWidth/s.drawingBufferHeight,u.fov=a.toRadians(60);var c;i>0?(c=Y,e.fromDegrees(0,0,5*r.maximumRadius,r,c.position),e.negate(c.position,c.direction),e.normalize(c.direction,c.direction),e.clone(e.UNIT_Z,c.up)):(l.position.z=l.frustum.right-l.frustum.left,c=y(t,r)),c.frustum=u;var d=D(c);g(t,d);var h=e.clone(l.position,ve),p=e.clone(l.direction,ye),f=e.clone(l.up,Ce),_=e.fromElements(0,0,5*r.maximumRadius,we),v=e.negate(e.UNIT_Z,Se),w=e.clone(e.UNIT_Y,Ee),E=l.frustum.right,b=.5*_.z;if(i>0){var T=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){s._mode=m.MORPHING,x(t,i,c,function(){C(t,i,c,d)})}});t._currentTweens.push(T)}else x(t,i,c,function(){C(t,i,c,d)})}function S(t,i,r,n){return e.lerp(t,i,r,n)}function E(e,t,i,r,n){function s(e){u.frustum.fov=a.lerp(c,d,e.time);var t=h/Math.tan(.5*u.frustum.fov);r(u,t)}var l=e._scene,u=l.camera,c=u.frustum.fov,d=.5*a.RADIANS_PER_DEGREE,h=i.position.z*Math.tan(.5*c);u.frustum.far=h/Math.tan(.5*d)+1e7;var p=l.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:s,complete:function(){u.frustum=i.frustum.clone(),n(e)}});e._currentTweens.push(p)}function b(t,r){function n(t){S(c,_,t.time,u.position),S(d,f,t.time,u.direction),S(p,m,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}function a(e,t){e.position.z=t}r*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,te),d=e.clone(u.direction,ie),p=e.clone(u.up,re),f=e.negate(e.UNIT_Z,oe),m=e.clone(e.UNIT_Y,ae),_=ne;if(r>0)e.clone(e.ZERO,ne),_.z=5*l.mapProjection.ellipsoid.maximumRadius;else{e.clone(c,ne);var v=le;s.multiplyByPoint(h.TRANSFORM_2D,c,v.origin),s.multiplyByPointAsVector(h.TRANSFORM_2D,d,v.direction);var y=l.globe;if(i(y)){var C=y.pick(v,l,ue);i(C)&&(s.multiplyByPoint(h.TRANSFORM_2D_INVERSE,C,_),_.z+=e.distance(c,_))}}var w=se;w.right=.5*_.z,w.left=-w.right,w.top=w.right*(l.drawingBufferHeight/l.drawingBufferWidth),w.bottom=-w.top;var b=ce;b.position=_,b.direction=f,b.up=m,b.frustum=w;var T=I(b);g(t,T);var x=l.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){E(t,r,b,a,T)}});t._currentTweens.push(x)}function T(t,r,n){function o(e,t){e.position.x=t}function a(){E(t,r,c,o,b)}r*=.5;var l=t._scene,u=l.camera,c=he;if(r>0)e.clone(e.ZERO,c.position),c.position.z=5*n.maximumRadius,e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);else{n.cartesianToCartographic(u.positionWC,de),l.mapProjection.project(de,c.position),e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);var p=me;e.clone(c.position2D,p.origin);var f=e.clone(u.directionWC,p.direction),m=n.scaleToGeodeticSurface(u.positionWC,ge),_=d.eastNorthUpToFixedFrame(m,n,_e);s.inverseTransformation(_,_),s.multiplyByPointAsVector(_,f,f),s.multiplyByPointAsVector(h.TRANSFORM_2D,f,f);var v=l.globe;if(i(v)){var y=v.pick(p,l,fe);if(i(y)){var C=e.distance(c.position2D,y);y.x+=C,e.clone(y,c.position2D)}}}s.multiplyByPoint(h.TRANSFORM_2D,c.position,c.position2D),s.multiplyByPointAsVector(h.TRANSFORM_2D,c.direction,c.direction2D),s.multiplyByPointAsVector(h.TRANSFORM_2D,c.up,c.up2D);var w=c.frustum;w.right=.5*c.position.z,w.left=-w.right,w.top=w.right*(l.drawingBufferHeight/l.drawingBufferWidth),w.bottom=-w.top;var S=pe;s.multiplyByPoint(h.TRANSFORM_2D_INVERSE,c.position2D,S.position),e.clone(c.direction,S.direction),e.clone(c.up,S.up),S.frustum=w;var b=I(S);g(t,b),P(t,r,c,a)}function x(e,t,i,r){function n(e){l.frustum.fov=a.lerp(d,c,e.time),l.position.z=h/Math.tan(.5*l.frustum.fov)}var s=e._scene,l=s.camera,u=l.frustum.right-l.frustum.left;l.frustum=i.frustum.clone();var c=l.frustum.fov,d=.5*a.RADIANS_PER_DEGREE,h=u*Math.tan(.5*c);l.frustum.far=h/Math.tan(.5*d)+1e7,l.frustum.fov=d;var p=s.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){r(e)}});e._currentTweens.push(p)}function A(t,i,r,n){i*=.5;var a=t._scene,s=a.camera,l=e.clone(r.position,we),u=e.clone(r.direction,Se),c=e.clone(r.up,Ee);a._mode=m.MORPHING,x(t,0,r,function(){function d(t){S(h,l,t.time,s.position),S(p,u,t.time,s.direction),S(f,c,t.time,s.up),e.cross(s.direction,s.up,s.right),e.normalize(s.right,s.right)}s.frustum=r.frustum.clone();var h=e.clone(s.position,ve),p=e.clone(s.direction,ye),f=e.clone(s.up,Ce);h.z=l.z;var m=a.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:d,complete:function(){n(t)}});t._currentTweens.push(m)})}function P(t,i,r,n){function a(t){S(u,h,t.time,l.position),S(c,p,t.time,l.direction),S(d,f,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right)}var s=t._scene,l=s.camera,u=e.clone(l.position,ve),c=e.clone(l.direction,ye),d=e.clone(l.up,Ce),h=e.clone(r.position2D,we),p=e.clone(r.direction2D,Se),f=e.clone(r.up2D,Ee),m=s.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){M(t,s,1,0,i,n)}});t._currentTweens.push(m)}function M(e,t,r,n,a,s){var l={object:t,property:"morphTime",startValue:r,stopValue:n,duration:a,easingFunction:o.QUARTIC_OUT};i(s)&&(l.complete=function(){s(e)});var u=t.tweens.addProperty(l);e._currentTweens.push(u)}function D(t){return function(r){var n=r._scene;if(n._mode=m.SCENE3D,n.morphTime=m.getMorphTime(m.SCENE3D),v(r),r._previousMode!==m.MORPHING||r._morphCancelled){r._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),i(t.frustum)&&(o.frustum=t.frustum.clone())}var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,m.SCENE3D,a)}}function I(t){return function(r){var n=r._scene;n._mode=m.SCENE2D,n.morphTime=m.getMorphTime(m.SCENE2D),v(r);var o=n.camera;e.clone(t.position,o.position),o.position.z=2*n.mapProjection.ellipsoid.maximumRadius,e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),o.frustum=t.frustum.clone();var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,m.SCENE2D,a)}}function R(t){return function(r){var n=r._scene;if(n._mode=m.COLUMBUS_VIEW,n.morphTime=m.getMorphTime(m.COLUMBUS_VIEW),v(r),n.camera.frustum=t.frustum.clone(),r._previousModeMode!==m.MORPHING||r._morphCancelled){r._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right)}var a=i(r._completeMorph);r._completeMorph=void 0,n.camera.update(n.mode),r._scene.morphComplete.raiseEvent(r,r._previousMode,m.COLUMBUS_VIEW,a)}}_.prototype.completeMorph=function(){i(this._completeMorph)&&this._completeMorph()},_.prototype.morphTo2D=function(e,t){i(this._completeMorph)&&this._completeMorph();var r=this._scene;this._previousMode=r.mode,this._previousMode!==m.SCENE2D&&this._previousMode!==m.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,m.SCENE2D,!0),r._mode=m.MORPHING,r.camera._setTransform(s.IDENTITY),this._previousMode===m.COLUMBUS_VIEW?b(this,e):T(this,e,t),0===e&&i(this._completeMorph)&&this._completeMorph())};var O=new e,N=new e,L=new e,B=new e,F=new e,k=new e,V=new e,z=new t,U=new s,G=new f,H={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};_.prototype.morphToColumbusView=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==m.COLUMBUS_VIEW&&this._previousMode!==m.MORPHING){this._scene.morphStart.raiseEvent(this,this._previousMode,m.COLUMBUS_VIEW,!0),n.camera._setTransform(s.IDENTITY);var o=O,l=N,u=L;if(t>0)o.x=0,o.y=-1,o.z=1,o=e.multiplyByScalar(e.normalize(o,o),5*r.maximumRadius,o),e.negate(e.normalize(o,l),l),e.cross(e.UNIT_X,l,u);else{var c=n.camera;if(this._previousMode===m.SCENE2D)e.clone(c.position,o),o.z=c.frustum.right-c.frustum.left,e.negate(e.UNIT_Z,l),e.clone(e.UNIT_Y,u);else{e.clone(c.positionWC,o),e.clone(c.directionWC,l),e.clone(c.upWC,u);var p=r.scaleToGeodeticSurface(o,V),f=d.eastNorthUpToFixedFrame(p,r,U);s.inverseTransformation(f,f),n.mapProjection.project(r.cartesianToCartographic(o,z),o),s.multiplyByPointAsVector(f,l,l),s.multiplyByPointAsVector(f,u,u)}}var _=G;_.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,_.fov=a.toRadians(60);var v=H;v.position=o,v.direction=l,v.up=u,v.frustum=_;var y=R(v);g(this,y),this._previousMode===m.SCENE2D?A(this,t,v,y):(v.position2D=s.multiplyByPoint(h.TRANSFORM_2D,o,B),v.direction2D=s.multiplyByPointAsVector(h.TRANSFORM_2D,l,F),v.up2D=s.multiplyByPointAsVector(h.TRANSFORM_2D,u,k),n._mode=m.MORPHING,P(this,t,v,y)),0===t&&i(this._completeMorph)&&this._completeMorph()}},_.prototype.morphTo3D=function(t,r){i(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==m.SCENE3D&&this._previousMode!==m.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,m.SCENE3D,!0),n._mode=m.MORPHING,n.camera._setTransform(s.IDENTITY),this._previousMode===m.SCENE2D)w(this,t,r);else{var o;t>0?(o=Y,e.fromDegrees(0,0,5*r.maximumRadius,r,o.position),e.negate(o.position,o.direction),e.normalize(o.direction,o.direction),e.clone(e.UNIT_Z,o.up)):o=y(this,r);var a=D(o);g(this,a),C(this,t,o,a)}0===t&&i(this._completeMorph)&&this._completeMorph()}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return v(this),r(this)};var W=new t,q=new e,j=new s,Y={position:new e,direction:new e,up:new e,frustum:void 0},X=new e,Z=new e,K=new e,Q=new e,J=new e,$=new e,ee=new f,te=new e,ie=new e,re=new e,ne=new e,oe=new e,ae=new e,se=new p,le=new l,ue=new e,ce={position:void 0,direction:void 0,up:void 0,frustum:void 0},de=new t,he={position:new e,direction:new e,up:new e,position2D:new e,direction2D:new e,up2D:new e,frustum:new p},pe={position:new e,direction:new e,up:new e,frustum:void 0},fe=new e,me=new l,_e=new s,ge=new e,ve=new e,ye=new e,Ce=new e,we=new e,Se=new e,Ee=new e;return _}),define("Scene/TweenCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/getTimestamp","../Core/TimeConstants","../ThirdParty/Tween"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i,r,n,o,a,s,l,u,c){this._tweens=t,this._tweenjs=i,this._startObject=e(r),this._stopObject=e(n),this._duration=o,this._delay=a,this._easingFunction=s,this._update=l,this._complete=u,this.cancel=c,this.needsStart=!0}function c(){this._tweens=[]}return r(u.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}}}),u.prototype.cancelTween=function(){this._tweens.remove(this)},r(c.prototype,{length:{get:function(){return this._tweens.length}}}),c.prototype.add=function(r){if(r=t(r,t.EMPTY_OBJECT),0===r.duration)return i(r.complete)&&r.complete(),new u(this);var n=r.duration/s.SECONDS_PER_MILLISECOND,a=t(r.delay,0),c=a/s.SECONDS_PER_MILLISECOND,d=t(r.easingFunction,o.LINEAR_NONE),h=r.startObject,p=new l.Tween(h);p.to(e(r.stopObject),n),p.delay(c),p.easing(d),i(r.update)&&p.onUpdate(function(){r.update(h)}),p.onComplete(t(r.complete,null)),p.repeat(t(r._repeat,0));var f=new u(this,p,r.startObject,r.stopObject,r.duration,a,d,r.update,r.complete,r.cancel);return this._tweens.push(f),f},c.prototype.addProperty=function(e){function i(e){r[n]=e.value}e=t(e,t.EMPTY_OBJECT);var r=e.object,n=e.property,o=e.startValue,a=e.stopValue;return this.add({startObject:{value:o},stopObject:{value:a},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},c.prototype.addAlpha=function(e){function r(e){for(var t=o.length,i=0;i<t;++i)n.uniforms[o[i]].alpha=e.alpha}e=t(e,t.EMPTY_OBJECT);var n=e.material,o=[];for(var a in n.uniforms)n.uniforms.hasOwnProperty(a)&&i(n.uniforms[a])&&i(n.uniforms[a].alpha)&&o.push(a);return this.add({startObject:{alpha:t(e.startValue,0)},stopObject:{alpha:t(e.stopValue,1)},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel})},c.prototype.addOffsetIncrement=function(e){e=t(e,t.EMPTY_OBJECT);var i=e.material,r=i.uniforms;return this.addProperty({object:r,property:"offset",startValue:r.offset,stopValue:r.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},c.prototype.remove=function(e){if(!i(e))return!1;var t=this._tweens.indexOf(e);return t!==-1&&(e.tweenjs.stop(),i(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},c.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var r=e[t];r.tweenjs.stop(),i(r.cancel)&&r.cancel()}e.length=0},c.prototype.contains=function(e){return i(e)&&this._tweens.indexOf(e)!==-1},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,r=0;for(e=i(e)?e/s.SECONDS_PER_MILLISECOND:a();r<t.length;){var n=t[r],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?r++:(o.stop(),t.splice(r,1))}},c}),define("Scene/ScreenSpaceCameraController",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/IntersectionTests","../Core/isArray","../Core/KeyboardEventModifier","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Plane","../Core/Quaternion","../Core/Ray","../Core/Transforms","./CameraEventAggregator","./CameraEventType","./MapMode2D","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b){ -"use strict";function T(i){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=C.LEFT_DRAG,this.zoomEventTypes=[C.RIGHT_DRAG,C.WHEEL,C.PINCH],this.rotateEventTypes=C.LEFT_DRAG,this.tiltEventTypes=[C.MIDDLE_DRAG,C.PINCH,{eventType:C.LEFT_DRAG,modifier:d.CTRL},{eventType:C.RIGHT_DRAG,modifier:d.CTRL}],this.lookEventTypes={eventType:C.LEFT_DRAG,modifier:d.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._scene=i,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new y(i.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new b,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new e(-1,-1),this._tiltCenter=new t,this._rotateMousePosition=new e(-1,-1),this._rotateStartPosition=new t,this._strafeStartPosition=new t,this._zoomMouseStart=new e(-1,-1),this._zoomWorldPosition=new t,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._rotatingZoom=!1;var n=i.mapProjection;this._maxCoord=n.project(new r(Math.PI,h.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 x(e,t){if(e<0)return 0;var i=25*(1-t);return Math.exp(-i*e)}function A(t){return e.equalsEpsilon(t.startPosition,t.endPosition,h.EPSILON14)}function P(t,i,r,n,a,s,l){var u=s[l];o(u)||(u=s[l]={startPosition:new e,endPosition:new e,motion:new e,active:!1});var c=t.getButtonPressTime(i,r),d=t.getButtonReleaseTime(i,r),h=c&&d&&(d.getTime()-c.getTime())/1e3,p=new Date,f=d&&(p.getTime()-d.getTime())/1e3;if(c&&d&&h<$){var m=x(f,n);if(u.active)u.startPosition=e.clone(u.endPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,m,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.motion=e.clone(e.ZERO,u.motion);else{var _=t.getLastMovement(i,r);if(!o(_)||A(_))return;u.motion.x=.5*(_.endPosition.x-_.startPosition.x),u.motion.y=.5*(_.endPosition.y-_.startPosition.y),u.startPosition=e.clone(_.startPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,m,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.active=!0}if(isNaN(u.endPosition.x)||isNaN(u.endPosition.y)||e.distance(u.startPosition,u.endPosition)<.5)return void(u.active=!1);if(!t.isButtonDown(i,r)){var g=t.getStartMousePosition(i,r);a(s,g,u)}}else u.active=!1}function M(e,t,i,r,n,a){if(o(i)){var s=e._aggregator;c(i)||(ee[0]=i,i=ee);for(var l=i.length,u=0;u<l;++u){var d=i[u],h=o(d.eventType)?d.eventType:d,p=d.modifier,f=s.isMoving(h,p)&&s.getMovement(h,p),m=s.getStartMousePosition(h,p);e.enableInputs&&t&&(f?r(e,m,f):n<1&&P(s,h,p,n,r,e,a))}}}function D(i,r,n,a,s,l){var u=1;o(l)&&(u=h.clamp(Math.abs(l),.25,1));var c=i.minimumZoomDistance*u,d=i.maximumZoomDistance,p=s-c,f=a*p;f=h.clamp(f,i._minimumZoomRate,i._maximumZoomRate);var m=n.endPosition.y-n.startPosition.y,_=m/i._scene.canvas.clientHeight;_=Math.min(_,i.maximumMovementRatio);var g=f*_;if(!(g>0&&Math.abs(s-c)<1||g<0&&Math.abs(s-d)<1)){s-g<c?g=s-c-1:s-g>d&&(g=s-d);var v,y=i._scene,C=y.camera,w=y.mode,b=e.equals(r,i._zoomMouseStart),T=i._zoomingOnVector,x=i._rotatingZoom;if(b||(i._zoomMouseStart=e.clone(r,i._zoomMouseStart),o(i._globe)&&(v=w!==S.SCENE2D?B(i,r,ie):C.getPickRay(r,te).origin),o(v)?(i._useZoomWorldPosition=!0,i._zoomWorldPosition=t.clone(v,i._zoomWorldPosition)):i._useZoomWorldPosition=!1,T=i._zoomingOnVector=!1,x=i._rotatingZoom=!1),!i._useZoomWorldPosition)return void C.zoomIn(g);var A=w===S.COLUMBUS_VIEW;if(C.positionCartographic.height<2e6&&(x=!0),!b||x){if(w===S.SCENE2D){var P=i._zoomWorldPosition,M=C.position;if(!t.equals(P,M)&&C.positionCartographic.height<2*i._maxCoord.x){var D=C.position.x,I=t.subtract(P,M,ne);t.normalize(I,I);var R=t.distance(P,M)*g/(.5*C.getMagnitude());C.move(I,.5*R),(C.position.x<0&&D>0||C.position.x>0&&D<0)&&(v=C.getPickRay(r,te).origin,i._zoomWorldPosition=t.clone(v,i._zoomWorldPosition))}}else if(w===S.SCENE3D){var O=t.normalize(C.position,ce);if(C.positionCartographic.height<3e3&&Math.abs(t.dot(C.direction,O))<.6)A=!0;else{var N=y.canvas,L=oe;L.x=N.clientWidth/2,L.y=N.clientHeight/2;var F=B(i,L,ae);if(o(F)&&C.positionCartographic.height<1e6){var k=he;t.clone(C.position,k);var V=i._zoomWorldPosition,z=de;if(z=t.normalize(V,z),t.dot(z,O)<0)return;var U=Ce,G=me;t.clone(C.direction,G),t.add(k,t.multiplyByScalar(G,1e3,we),U);var H=_e,W=ge;t.subtract(V,k,H),t.normalize(H,W);var q=t.dot(O,W);if(q>=0)return void(i._zoomMouseStart.x=-1);var j=Math.acos(-q),Y=t.magnitude(k),X=t.magnitude(V),Z=Y-g,K=t.magnitude(H),Q=Math.asin(h.clamp(K/X*Math.sin(j),-1,1)),J=Math.asin(h.clamp(Z/X*Math.sin(j),-1,1)),$=Q-J+j,ee=pe;t.normalize(k,ee);var be=fe;be=t.cross(W,ee,be),be=t.normalize(be,be),t.normalize(t.cross(ee,be,we),G),t.multiplyByScalar(t.normalize(U,we),t.magnitude(U)-g,U),t.normalize(k,k),t.multiplyByScalar(k,Z,k);var Te=ve;t.multiplyByScalar(t.add(t.multiplyByScalar(ee,Math.cos($)-1,Se),t.multiplyByScalar(G,Math.sin($),Ee),we),Z,Te),t.add(k,Te,k),t.normalize(U,ee),t.normalize(t.cross(ee,be,we),G);var xe=ye;return t.multiplyByScalar(t.add(t.multiplyByScalar(ee,Math.cos($)-1,Se),t.multiplyByScalar(G,Math.sin($),Ee),we),t.magnitude(U),xe),t.add(U,xe,U),t.clone(k,C.position),t.normalize(t.subtract(U,k,we),C.direction),t.clone(C.direction,C.direction),t.cross(C.direction,C.up,C.right),void t.cross(C.right,C.direction,C.up)}if(o(F)){var Ae=t.normalize(F,se),Pe=t.normalize(i._zoomWorldPosition,le),Me=t.dot(Pe,Ae);if(Me>0&&Me<1){var De=h.acosClamped(Me),Ie=t.cross(Pe,Ae,ue),Re=Math.abs(De)>h.toRadians(20)?.75*C.positionCartographic.height:C.positionCartographic.height-g,Oe=g/Re;C.rotate(Ie,De*Oe)}}else A=!0}}i._rotatingZoom=!A}if(!b&&A||T){var Ne,Le=E.wgs84ToWindowCoordinates(y,i._zoomWorldPosition,re);Ne=w!==S.COLUMBUS_VIEW&&e.equals(r,i._zoomMouseStart)&&o(Le)?C.getPickRay(Le,te):C.getPickRay(r,te);var Be=Ne.direction;w===S.COLUMBUS_VIEW&&t.fromElements(Be.y,Be.z,Be.x,Be),C.move(Be,g),i._zoomingOnVector=!0}else C.zoomIn(g)}}function I(e,i,r){var n=e._scene,o=n.camera,a=o.getPickRay(r.startPosition,be).origin,s=o.getPickRay(r.endPosition,Te).origin,l=t.subtract(a,s,xe),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function R(e,t,i){o(i.distance)&&(i=i.distance);var r=e._scene,n=r.camera;D(e,t,i,e._zoomFactor,n.getMagnitude())}function O(t,i,r){if(o(r.angleAndHeight))return void N(t,i,r.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=Ae;c.x=2/l*r.startPosition.x-1,c.y=2/u*(u-r.startPosition.y)-1,c=e.normalize(c,c);var d=Pe;d.x=2/l*r.endPosition.x-1,d.y=2/u*(u-r.endPosition.y)-1,d=e.normalize(d,d);var p=h.acosClamped(c.x);c.y<0&&(p=h.TWO_PI-p);var f=h.acosClamped(d.x);d.y<0&&(f=h.TWO_PI-f);var m=f-p;a.twistRight(m)}function N(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,o=n.camera,a=n.canvas,s=(i.endPosition.x-i.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);var l=r*s*Math.PI*4;o.twistRight(l)}function L(e){var t=e._scene.mapMode2D===w.ROTATE;f.equals(f.IDENTITY,e._scene.camera.transform)?(M(e,e.enableTranslate,e.translateEventTypes,I,e.inertiaTranslate,"_lastInertiaTranslateMovement"),M(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&M(e,e.enableRotate,e.tiltEventTypes,O,e.inertiaSpin,"_lastInertiaTiltMovement")):(M(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&M(e,e.enableRotate,e.translateEventTypes,O,e.inertiaSpin,"_lastInertiaSpinMovement"))}function B(e,i,r){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPositionWorldCoordinates(i,De));var u=s.getPickRay(i,Me),c=a.pick(u,n,Ie),d=o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY,h=o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY;return d<h?t.clone(l,r):t.clone(c,r)}}function F(i,r,n){if(t.equals(r,i._translateMousePosition)||(i._looking=!1),t.equals(r,i._strafeMousePosition)||(i._strafing=!1),i._looking)return void Q(i,r,n);if(i._strafing)return void H(i,r,n);var a,s=i._scene,l=s.camera,c=e.clone(n.startPosition,Ve),d=e.clone(n.endPosition,ze),p=l.getPickRay(c,Re),f=t.clone(t.ZERO,Fe),_=t.UNIT_X;if(l.position.z<i._minimumPickingTerrainHeight&&(a=B(i,c,Ne),o(a)&&(f.x=a.x)),f.x>l.position.z&&o(a))return t.clone(a,i._strafeStartPosition),i._strafing=!0,H(i,r,n),void(i._strafeMousePosition=e.clone(r,i._strafeMousePosition));var g=m.fromPointNormal(f,_,ke);p=l.getPickRay(c,Re);var v=u.rayPlane(p,g,Ne),y=l.getPickRay(d,Oe),C=u.rayPlane(y,g,Le);if(!o(v)||!o(C))return i._looking=!0,Q(i,r,n),void e.clone(r,i._translateMousePosition);var w=t.subtract(v,C,Be),S=w.x;w.x=w.y,w.y=w.z,w.z=S;var E=t.magnitude(w);E>h.EPSILON6&&(t.normalize(w,w),l.move(w,E))}function k(t,i,r){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltCVOffMap=!1,t._looking=!1),t._looking)return void Q(t,i,r);var n=t._scene,a=n.camera,s=t._maxCoord,l=Math.abs(a.position.x)-s.x<0&&Math.abs(a.position.y)-s.y<0;t._tiltCVOffMap||!l||a.position.z>t._minimumPickingTerrainHeight?(t._tiltCVOffMap=!0,V(t,i,r)):z(t,i,r)}function V(i,r,n){var a=i._scene,s=a.camera,u=a.canvas,c=Ue;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var d,p=s.getPickRay(c,Ge),m=t.UNIT_X,_=p.origin,g=p.direction,y=t.dot(m,g);if(Math.abs(y)>h.EPSILON6&&(d=-t.dot(m,_)/y),!o(d)||d<=0)return i._looking=!0,Q(i,r,n),void e.clone(r,i._tiltCenterMousePosition);var C=t.multiplyByScalar(g,d,He);t.add(_,C,C);var w=a.mapProjection,S=w.ellipsoid;t.fromElements(C.y,C.z,C.x,C);var E=w.unproject(C,Ke);S.cartographicToCartesian(E,C);var b=v.eastNorthUpToFixedFrame(C,S,qe),T=i._globe,x=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var A=f.clone(s.transform,Qe);s._setTransform(b),q(i,r,n,t.UNIT_Z),s._setTransform(A),i._globe=T,i._ellipsoid=x;var P=x.maximumRadius;i._rotateFactor=1/P,i._rotateRateRangeAdjustment=P}function z(i,r,n){var a,s,c=i._scene,d=c.camera,g=t.UNIT_X;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,He);else{if(d.position.z<i._minimumPickingTerrainHeight&&(a=B(i,r,He)),!o(a)){s=d.getPickRay(r,Ge);var y,C=s.origin,w=s.direction,S=t.dot(g,w);if(Math.abs(S)>h.EPSILON6&&(y=-t.dot(g,C)/S),!o(y)||y<=0)return i._looking=!0,Q(i,r,n),void e.clone(r,i._tiltCenterMousePosition);a=t.multiplyByScalar(w,y,He),t.add(C,a,a)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var E=c.canvas,b=Ue;b.x=E.clientWidth/2,b.y=i._tiltCenterMousePosition.y,s=d.getPickRay(b,Ge);var T=t.clone(t.ZERO,Ye);T.x=a.x;var x=m.fromPointNormal(T,g,Xe),A=u.rayPlane(s,x,We),P=d._projection,M=P.ellipsoid;t.fromElements(a.y,a.z,a.x,a);var D=P.unproject(a,Ke);M.cartographicToCartesian(D,a);var I,R=v.eastNorthUpToFixedFrame(a,M,qe);o(A)?(t.fromElements(A.y,A.z,A.x,A),D=P.unproject(A,Ke),M.cartographicToCartesian(D,A),I=v.eastNorthUpToFixedFrame(A,M,je)):I=R;var O=i._globe,N=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var L=t.UNIT_Z,F=f.clone(d.transform,Qe);d._setTransform(R);var k=t.cross(t.UNIT_Z,t.normalize(d.position,Ze),Ze),V=t.dot(d.right,k);if(q(i,r,n,L,!1,!0),d._setTransform(I),V<0){n.startPosition.y>n.endPosition.y&&(L=void 0);var z=d.constrainedAxis;d.constrainedAxis=void 0,q(i,r,n,L,!0,!1),d.constrainedAxis=z}else q(i,r,n,L,!0,!1);if(o(d.constrainedAxis)){var U=t.cross(d.direction,d.constrainedAxis,Mt);t.equalsEpsilon(U,t.ZERO,h.EPSILON6)||(t.dot(U,d.right)<0&&t.negate(U,U),t.cross(U,d.direction,d.up),t.cross(d.direction,d.up,d.right),t.normalize(d.up,d.up),t.normalize(d.right,d.right))}d._setTransform(F),i._globe=O,i._ellipsoid=N;var G=N.maximumRadius;i._rotateFactor=1/G,i._rotateRateRangeAdjustment=G;var H=t.clone(d.positionWC,Ze);if(d._adjustHeightForTerrain(),!t.equals(d.positionWC,H)){d._setTransform(I),d.worldToCameraCoordinatesPoint(H,H);var W=t.magnitudeSquared(H);t.magnitudeSquared(d.position)>W&&(t.normalize(d.position,d.position),t.multiplyByScalar(d.position,Math.sqrt(W),d.position));var j=t.angleBetween(H,d.position),Y=t.cross(H,d.position,H);t.normalize(Y,Y);var X=_.fromAxisAngle(Y,j,Je),Z=p.fromQuaternion(X,$e);p.multiplyByVector(Z,d.direction,d.direction),p.multiplyByVector(Z,d.up,d.up),t.cross(d.direction,d.up,d.right),t.cross(d.right,d.direction,d.up),d._setTransform(F)}}function U(e,i,r){o(r.distance)&&(r=r.distance);var n=e._scene,a=n.camera,s=n.canvas,l=et;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,tt);a.position.z<e._minimumPickingTerrainHeight&&(u=B(e,l,it));var d;if(o(u))d=t.distance(c.origin,u);else{var h=t.UNIT_X,p=c.origin,f=c.direction;d=-t.dot(h,p)/t.dot(h,f)}D(e,i,r,e._zoomFactor,d)}function G(e){var t=e._scene,i=t.camera;if(f.equals(f.IDENTITY,i.transform)){var r=e._tweens;if(e._aggregator.anyButtonDown&&r.removeAll(),M(e,e.enableTilt,e.tiltEventTypes,k,e.inertiaSpin,"_lastInertiaTiltMovement"),M(e,e.enableTranslate,e.translateEventTypes,F,e.inertiaTranslate,"_lastInertiaTranslateMovement"),M(e,e.enableZoom,e.zoomEventTypes,U,e.inertiaZoom,"_lastInertiaZoomMovement"),M(e,e.enableLook,e.lookEventTypes,Q),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||r.contains(e._tween))){var n=i.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=r.add(n))}r.update()}else M(e,e.enableRotate,e.rotateEventTypes,q,e.inertiaSpin,"_lastInertiaSpinMovement"),M(e,e.enableZoom,e.zoomEventTypes,Y,e.inertiaZoom,"_lastInertiaZoomMovement")}function H(e,i,r){var n=e._scene,a=n.camera,s=B(e,r.startPosition,ut);if(o(s)){var l=r.endPosition,c=a.getPickRay(l,rt),d=t.clone(a.direction,at);n.mode===S.COLUMBUS_VIEW&&t.fromElements(d.z,d.x,d.y,d);var h=m.fromPointNormal(s,d,nt),p=u.rayPlane(c,h,ot);o(p)&&(d=t.subtract(s,p,d),n.mode===S.COLUMBUS_VIEW&&t.fromElements(d.y,d.z,d.x,d),t.add(a.position,d,a.position))}}function W(i,r,n){var a=i._scene,s=a.camera;if(!f.equals(s.transform,f.IDENTITY))return void q(i,r,n);var u,c,d,h,p=i._ellipsoid.geodeticSurfaceNormal(s.position,ht),m=i._ellipsoid.cartesianToCartographic(s.positionWC,lt).height,_=i._globe,g=!1;if(o(_)&&m<i._minimumPickingTerrainHeight&&(h=B(i,n.startPosition,ut),o(h))){var v=s.getPickRay(n.startPosition,Me),y=i._ellipsoid.geodeticSurfaceNormal(h);g=Math.abs(t.dot(v.direction,y))<.05,g&&!i._looking&&(i._rotating=!1,i._strafing=!0)}return e.equals(r,i._rotateMousePosition)?void(i._looking?Q(i,r,n,p):i._rotating?q(i,r,n):i._strafing?(t.clone(h,i._strafeStartPosition),H(i,r,n)):(u=t.magnitude(i._rotateStartPosition),c=ct,c.x=c.y=c.z=u,d=l.fromCartesian3(c,dt),j(i,r,n,d))):(i._looking=!1,i._rotating=!1,i._strafing=!1,o(_)&&m<i._minimumPickingTerrainHeight?o(h)?t.magnitude(s.position)<t.magnitude(h)?(t.clone(h,i._strafeStartPosition),i._strafing=!0,H(i,r,n)):(u=t.magnitude(h),c=ct,c.x=c.y=c.z=u,d=l.fromCartesian3(c,dt),j(i,r,n,d),t.clone(h,i._rotateStartPosition)):(i._looking=!0,Q(i,r,n,p)):o(s.pickEllipsoid(n.startPosition,i._ellipsoid,st))?(j(i,r,n,i._ellipsoid),t.clone(st,i._rotateStartPosition)):m>i._minimumTrackBallHeight?(i._rotating=!0,q(i,r,n)):(i._looking=!0,Q(i,r,n,p)),void e.clone(r,i._rotateMousePosition))}function q(e,i,r,a,s,l){s=n(s,!1),l=n(l,!1);var u=e._scene,c=u.camera,d=u.canvas,h=c.constrainedAxis;o(a)&&(c.constrainedAxis=a);var p=t.magnitude(c.position),f=e._rotateFactor*(p-e._rotateRateRangeAdjustment);f>e._maximumRotateRate&&(f=e._maximumRotateRate),f<e._minimumRotateRate&&(f=e._minimumRotateRate);var m=(r.startPosition.x-r.endPosition.x)/d.clientWidth,_=(r.startPosition.y-r.endPosition.y)/d.clientHeight;m=Math.min(m,e.maximumMovementRatio),_=Math.min(_,e.maximumMovementRatio);var g=f*m*Math.PI*2,v=f*_*Math.PI;s||c.rotateRight(g),l||c.rotateUp(v),c.constrainedAxis=h}function j(i,r,n,a){var s=i._scene,l=s.camera,u=e.clone(n.startPosition,yt),c=e.clone(n.endPosition,Ct),d=l.pickEllipsoid(u,a,pt),p=l.pickEllipsoid(c,a,ft);if(!o(d)||!o(p))return i._rotating=!0,void q(i,r,n);if(d=l.worldToCameraCoordinates(d,d),p=l.worldToCameraCoordinates(p,p),o(l.constrainedAxis)){var f=l.constrainedAxis,m=t.mostOrthogonalAxis(f,mt);t.cross(m,f,m),t.normalize(m,m);var _=t.cross(f,m,_t),g=t.magnitude(d),v=t.dot(f,d),y=Math.acos(v/g),C=t.multiplyByScalar(f,v,gt);t.subtract(d,C,C),t.normalize(C,C);var w=t.magnitude(p),S=t.dot(f,p),E=Math.acos(S/w),b=t.multiplyByScalar(f,S,vt);t.subtract(p,b,b),t.normalize(b,b);var T=Math.acos(t.dot(C,m));t.dot(C,_)<0&&(T=h.TWO_PI-T);var x=Math.acos(t.dot(b,m));t.dot(b,_)<0&&(x=h.TWO_PI-x);var A,P=T-x;A=t.equalsEpsilon(f,l.position,h.EPSILON2)?l.right:t.cross(f,l.position,mt);var M,D=t.cross(f,A,mt),I=t.dot(D,t.subtract(d,f,_t)),R=t.dot(D,t.subtract(p,f,_t));M=I>0&&R>0?E-y:I>0&&R<=0?t.dot(l.position,f)>0?-y-E:y+E:y-E,l.rotateRight(P),l.rotateUp(M)}else{t.normalize(d,d),t.normalize(p,p);var O=t.dot(d,p),N=t.cross(d,p,mt);if(O<1&&!t.equalsEpsilon(N,t.ZERO,h.EPSILON14)){var L=Math.acos(O);l.rotate(N,L)}}}function Y(e,i,r){o(r.distance)&&(r=r.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=et;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,d=s.getPickRay(u,tt),h=n.cartesianToCartographic(s.position,St).height;h<e._minimumPickingTerrainHeight&&(c=B(e,u,it));var p;p=o(c)?t.distance(d.origin,c):h;var f=t.normalize(s.position,wt);D(e,i,r,e._zoomFactor,p,t.dot(f,s.direction))}function X(t,i,r){var n=t._scene,a=n.camera;if(f.equals(a.transform,f.IDENTITY)){if(o(r.angleAndHeight)&&(r=r.angleAndHeight),e.equals(i,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){var s=t._ellipsoid.geodeticSurfaceNormal(a.position,Nt);return void Q(t,i,r,s)}var l=t._ellipsoid,u=l.cartesianToCartographic(a.position,Ot);t._tiltOnEllipsoid||u.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,Z(t,i,r)):K(t,i,r)}}function Z(i,r,n){var a=i._ellipsoid,s=i._scene,c=s.camera,d=.25*i.minimumZoomDistance,p=a.cartesianToCartographic(c.positionWC,Lt).height;if(!(p-d-1<h.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var m=s.canvas,_=Et;_.x=m.clientWidth/2,_.y=m.clientHeight/2;var y,C=c.getPickRay(_,bt),w=u.rayEllipsoid(C,a);if(o(w))y=g.getPoint(C,w.start,Tt);else{if(!(p>i._minimumTrackBallHeight)){i._looking=!0;var S=i._ellipsoid.geodeticSurfaceNormal(c.position,Nt);return Q(i,r,n,S),void e.clone(r,i._tiltCenterMousePosition)}var E=u.grazingAltitudeLocation(C,a);if(!o(E))return;var b=a.cartesianToCartographic(E,Ot);b.height=0,y=a.cartographicToCartesian(b,Tt)}var T=v.eastNorthUpToFixedFrame(y,a,At),x=i._globe,A=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var P=f.clone(c.transform,Dt);c._setTransform(T),q(i,r,n,t.UNIT_Z),c._setTransform(P),i._globe=x,i._ellipsoid=A;var M=A.maximumRadius;i._rotateFactor=1/M,i._rotateRateRangeAdjustment=M}}function K(i,r,n){var a,s,c,d=i._ellipsoid,m=i._scene,y=m.camera;if(e.equals(r,i._tiltCenterMousePosition))a=t.clone(i._tiltCenter,Tt);else{if(a=B(i,r,Tt),!o(a)){if(s=y.getPickRay(r,bt),c=u.rayEllipsoid(s,d),!o(c)){var C=d.cartesianToCartographic(y.position,Ot);if(C.height<=i._minimumTrackBallHeight){i._looking=!0;var w=i._ellipsoid.geodeticSurfaceNormal(y.position,Nt);Q(i,r,n,w),e.clone(r,i._tiltCenterMousePosition)}return}a=g.getPoint(s,c.start,Tt)}e.clone(r,i._tiltCenterMousePosition),t.clone(a,i._tiltCenter)}var S=m.canvas,E=Et;E.x=S.clientWidth/2,E.y=i._tiltCenterMousePosition.y,s=y.getPickRay(E,bt);var b=t.magnitude(a),T=t.fromElements(b,b,b,ct),x=l.fromCartesian3(T,dt);if(c=u.rayEllipsoid(s,x),o(c)){var A=t.magnitude(s.origin)>b?c.start:c.stop,P=g.getPoint(s,A,xt),M=v.eastNorthUpToFixedFrame(a,d,At),D=v.eastNorthUpToFixedFrame(P,x,Pt),I=i._globe,R=i._ellipsoid;i._globe=void 0,i._ellipsoid=l.UNIT_SPHERE,i._rotateFactor=1,i._rotateRateRangeAdjustment=1;var O=t.UNIT_Z,N=f.clone(y.transform,Dt);y._setTransform(M);var L=t.cross(P,y.positionWC,Mt),F=t.dot(y.rightWC,L);if(q(i,r,n,O,!1,!0),y._setTransform(D),F<0){n.startPosition.y>n.endPosition.y&&(O=void 0);var k=y.constrainedAxis;y.constrainedAxis=void 0,q(i,r,n,O,!0,!1),y.constrainedAxis=k}else q(i,r,n,O,!0,!1);if(o(y.constrainedAxis)){var V=t.cross(y.direction,y.constrainedAxis,Mt);t.equalsEpsilon(V,t.ZERO,h.EPSILON6)||(t.dot(V,y.right)<0&&t.negate(V,V),t.cross(V,y.direction,y.up),t.cross(y.direction,y.up,y.right),t.normalize(y.up,y.up),t.normalize(y.right,y.right))}y._setTransform(N),i._globe=I,i._ellipsoid=R;var z=R.maximumRadius;i._rotateFactor=1/z,i._rotateRateRangeAdjustment=z;var U=t.clone(y.positionWC,Mt);if(y._adjustHeightForTerrain(),!t.equals(y.positionWC,U)){y._setTransform(D),y.worldToCameraCoordinatesPoint(U,U);var G=t.magnitudeSquared(U);t.magnitudeSquared(y.position)>G&&(t.normalize(y.position,y.position),t.multiplyByScalar(y.position,Math.sqrt(G),y.position));var H=t.angleBetween(U,y.position),W=t.cross(U,y.position,U);t.normalize(W,W);var j=_.fromAxisAngle(W,H,It),Y=p.fromQuaternion(j,Rt);p.multiplyByVector(Y,y.direction,y.direction),p.multiplyByVector(Y,y.up,y.up),t.cross(y.direction,y.up,y.right),t.cross(y.right,y.direction,y.up),y._setTransform(N)}}}function Q(e,i,r,a){var s=e._scene,l=s.camera,u=Bt;u.x=r.startPosition.x,u.y=0;var c=Ft;c.x=r.endPosition.x,c.y=0;var d=l.getPickRay(u,kt).direction,p=l.getPickRay(c,Vt).direction,f=0,m=t.dot(d,p);m<1&&(f=Math.acos(m)),f=r.startPosition.x>r.endPosition.x?-f:f;var _=e._horizontalRotationAxis;if(o(a)?l.look(a,-f):o(_)?l.look(_,-f):l.lookLeft(f),u.x=0,u.y=r.startPosition.y,c.x=0,c.y=r.endPosition.y,d=l.getPickRay(u,kt).direction,p=l.getPickRay(c,Vt).direction,f=0,m=t.dot(d,p),m<1&&(f=Math.acos(m)),f=r.startPosition.y>r.endPosition.y?-f:f,a=n(a,_),o(a)){var g=l.direction,v=t.negate(a,zt),y=t.equalsEpsilon(g,a,h.EPSILON2),C=t.equalsEpsilon(g,v,h.EPSILON2);if(y||C)(y&&f<0||C&&f>0)&&l.look(l.right,-f);else{m=t.dot(g,a);var w=h.acosClamped(m);f>0&&f>w&&(f=w-h.EPSILON4),m=t.dot(g,v),w=h.acosClamped(m),f<0&&-f>w&&(f=-w+h.EPSILON4);var S=t.cross(a,g,Ut);l.look(S,f)}}else l.lookUp(f)}function J(e){M(e,e.enableRotate,e.rotateEventTypes,W,e.inertiaSpin,"_lastInertiaSpinMovement"),M(e,e.enableZoom,e.zoomEventTypes,Y,e.inertiaZoom,"_lastInertiaZoomMovement"),M(e,e.enableTilt,e.tiltEventTypes,X,e.inertiaSpin,"_lastInertiaTiltMovement"),M(e,e.enableLook,e.lookEventTypes,Q)}var $=.4,ee=[],te=new g,ie=new t,re=new e,ne=new t,oe=new e,ae=new t,se=new t,le=new t,ue=new t,ce=new t,de=new t,he=new t,pe=new t,fe=new t,me=new t,_e=new t,ge=new t,ve=new t,ye=new t,Ce=new t,we=new t,Se=new t,Ee=new t,be=new g,Te=new g,xe=new t,Ae=new e,Pe=new e,Me=new g,De=new t,Ie=new t,Re=new g,Oe=new g,Ne=new t,Le=new t,Be=new t,Fe=new t,ke=new m(t.ZERO,0),Ve=new e,ze=new e,Ue=new e,Ge=new g,He=new t,We=new t,qe=new f,je=new f,Ye=new t,Xe=new m(t.ZERO,0),Ze=new t,Ke=new r,Qe=new f,Je=new _,$e=new p,et=new e,tt=new g,it=new t,rt=new g,nt=new m(t.ZERO,0),ot=new t,at=new t,st=new t,lt=new r,ut=new t,ct=new t,dt=new l,ht=new t,pt=i.clone(i.UNIT_W),ft=i.clone(i.UNIT_W),mt=new t,_t=new t,gt=new t,vt=new t,yt=new e,Ct=new e,wt=new t,St=new r,Et=new e,bt=new g,Tt=new t,xt=new t,At=new f,Pt=new f,Mt=new t,Dt=new f,It=new _,Rt=new p,Ot=new r,Nt=new t,Lt=new r,Bt=new e,Ft=new e,kt=new g,Vt=new g,zt=new t,Ut=new t;return T.prototype.update=function(){f.equals(this._scene.camera.transform,f.IDENTITY)?(this._globe=this._scene.globe,this._ellipsoid=o(this._globe)?this._globe.ellipsoid:this._scene.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=l.UNIT_SPHERE),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*this._scene.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*this._scene.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*this._scene.terrainExaggeration;var e=this._ellipsoid.maximumRadius;this._rotateFactor=1/e,this._rotateRateRangeAdjustment=e;var i=this._scene,r=i.mode;r===S.SCENE2D?L(this):r===S.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,G(this)):r===S.SCENE3D&&(this._horizontalRotationAxis=void 0,J(this)),this._aggregator.reset()},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),a(this)},T}),define("Scene/ShadowMapShader",["../Core/defined","../Renderer/ShaderSource"],function(e,t){"use strict";function i(){}return i.getShadowCastShaderKeyword=function(e,t,i,r){return"castShadow "+e+" "+t+" "+i+" "+r},i.createShadowCastVertexShader=function(i,r,n){var o=i.defines.slice(0),a=i.sources.slice(0);n&&o.push("GENERATE_POSITION");var s=t.findPositionVarying(i),l=e(s);if(r&&!l){for(var u=a.length,c=0;c<u;++c)a[c]=t.replaceMain(a[c],"czm_shadow_cast_main");var d="varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}";a.push(d)}return new t({defines:o,sources:a})},i.createShadowCastFragmentShader=function(i,r,n,o){var a=i.defines.slice(0),s=i.sources.slice(0),l=t.findPositionVarying(i),u=e(l);u||(l="v_positionEC");for(var c=s.length,d=0;d<c;++d)s[d]=t.replaceMain(s[d],"czm_shadow_cast_main");var h="";return r&&(u||(h+="varying vec3 v_positionEC; \n"),h+="uniform vec4 shadowMap_lightPositionEC; \n"),h+=o?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",h+=r?"float distance = length("+l+"); \ndistance /= shadowMap_lightPositionEC.w; // radius \ngl_FragColor = czm_packDepth(distance); \n":n?"gl_FragColor = vec4(1.0); \n":"gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",h+="} \n",s.push(h),new t({defines:a,sources:s})},i.getShadowReceiveShaderKeyword=function(e,t,i,r){var n=e._usesDepthTexture,o=e._polygonOffsetSupported,a=e._isPointLight,s=e._isSpotLight,l=e._numberOfCascades>1,u=e.debugCascadeColors,c=e.softShadows;return"receiveShadow "+n+o+a+s+l+u+c+t+i+r},i.createShadowReceiveVertexShader=function(e,i,r){var n=e.defines.slice(0),o=e.sources.slice(0);return i&&(r?n.push("GENERATE_POSITION_AND_NORMAL"):n.push("GENERATE_POSITION")),new t({defines:n,sources:o})},i.createShadowReceiveFragmentShader=function(i,r,n,o,a){for(var s=t.findNormalVarying(i),l=!o&&e(s)||o&&a,u=t.findPositionVarying(i),c=e(u),d=r._usesDepthTexture,h=r._polygonOffsetSupported,p=r._isPointLight,f=r._isSpotLight,m=r._numberOfCascades>1,_=r.debugCascadeColors,g=r.softShadows,v=p?r._pointBias:o?r._terrainBias:r._primitiveBias,y=i.defines.slice(0),C=i.sources.slice(0),w=C.length,S=0;S<w;++S)C[S]=t.replaceMain(C[S],"czm_shadow_receive_main");p?y.push("USE_CUBE_MAP_SHADOW"):d&&y.push("USE_SHADOW_DEPTH_TEXTURE"),g&&!p&&y.push("USE_SOFT_SHADOWS"),m&&n&&o&&(l?y.push("ENABLE_VERTEX_LIGHTING"):y.push("ENABLE_DAYNIGHT_SHADING")),n&&v.normalShading&&l&&(y.push("USE_NORMAL_SHADING"),v.normalShadingSmooth>0&&y.push("USE_NORMAL_SHADING_SMOOTH"));var E="";return E+=p?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",E+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \nvec4 getPositionEC() \n{ \n"+(c?" return vec4("+u+", 1.0); \n":" return czm_windowToEyeCoordinates(gl_FragCoord); \n")+"} \nvec3 getNormalEC() \n{ \n"+(l?" return normalize("+s+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(v.normalOffset&&l?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",E+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",E+=" 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",o?E+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":h||(E+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),E+=p?" 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":f?" 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":m?" 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"+(_?" // 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", -E+=" gl_FragColor.rgb *= visibility; \n} \n",C.push(E),new t({defines:y,sources:C})},i}),define("Scene/ShadowMap",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/GeometryInstance","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Quaternion","../Core/SphereOutlineGeometry","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/ContextLimits","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./Camera","./CullFace","./CullingVolume","./DebugCameraPrimitive","./OrthographicFrustum","./PerInstanceColorAppearance","./PerspectiveFrustum","./Primitive","./ShadowMapShader"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,M,D,I,R,O,N,L,B,F,k,V,z,U,G,H,W,q,j,Y,X,Z){"use strict";function K(e){e=d(e,d.EMPTY_OBJECT);var i=e.context;this._enabled=d(e.enabled,!0),this._softShadows=d(e.softShadows,!1),this._normalOffset=d(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=d(e.fromLightSource,!0),this.darkness=d(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=d(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;var a=!0;(_.isInternetExplorer()||_.isEdge()||(_.isChrome()||_.isFirefox())&&_.isWindows()&&!i.depthTexture)&&(a=!1),this._polygonOffsetSupported=a,this._terrainBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:a,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 C,this._shadowMapTexture=void 0,this._lightDirectionEC=new n,this._lightPositionEC=new o,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new fe,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new t,this._isPointLight=d(e.isPointLight,!1),this._pointLightRadius=d(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&d(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?d(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new r,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new q:h(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new o,new o],this._cascadeMatrices=[new C,new C,new C,new C],this._cascadeDistances=new o;var s;s=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(s);for(var u=0;u<s;++u)this._passes[u]=new Q(i);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=i.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,$(this),this._clearCommand=new T({depth:1,color:new l}),this._clearPassState=new I(i),this._size=d(e.size,2048),this.size=this._size}function Q(e){this.camera=new fe,this.passState=new I(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function J(e,t){return L.fromCache({cull:{enabled:!0,face:G.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 $(e){var t=!e._usesDepthTexture;e._primitiveRenderState=J(t,e._primitiveBias),e._terrainRenderState=J(t,e._terrainBias),e._pointRenderState=J(t,e._pointBias)}function ee(e){for(var t=e._passes.length,i=0;i<t;++i){var r=e._passes[i],n=r.framebuffer;h(n)&&!n.isDestroyed()&&n.destroy(),r.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function te(){return new B({wrapS:z.CLAMP_TO_EDGE,wrapT:z.CLAMP_TO_EDGE,minificationFilter:V.NEAREST,magnificationFilter:k.NEAREST})}function ie(e,t){for(var i=new O({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),r=new F({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:R.UNSIGNED_BYTE,sampler:te()}),n=new M({context:t,depthRenderbuffer:i,colorTextures:[r],destroyAttachments:!1}),o=e._passes.length,a=0;a<o;++a){var s=e._passes[a];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function re(e,t){for(var i=new F({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.DEPTH_STENCIL,pixelDatatype:R.UNSIGNED_INT_24_8,sampler:te()}),r=new M({context:t,depthStencilTexture:i,destroyAttachments:!1}),n=e._passes.length,o=0;o<n;++o){var a=e._passes[o];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=i}function ne(e,t){for(var i=new O({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),r=new A({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:w.RGBA,pixelDatatype:R.UNSIGNED_BYTE,sampler:te()}),n=[r.negativeX,r.negativeY,r.negativeZ,r.positiveX,r.positiveY,r.positiveZ],o=0;o<6;++o){var a=new M({context:t,depthRenderbuffer:i,colorTextures:[n[o]],destroyAttachments:!1}),s=e._passes[o];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=r,e._depthAttachment=i,e._colorAttachment=r}function oe(e,t){e._isPointLight?ne(e,t):e._usesDepthTexture?re(e,t):ie(e,t)}function ae(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==b.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,$(e),ee(e),oe(e,t))}function se(e,t){h(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(ee(e),oe(e,t),ae(e,t),le(e,t))}function le(e,t,i){i=d(i,0),(e._isPointLight||0===i)&&(e._clearCommand.framebuffer=e._passes[i].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function ue(t,i){t._size=i;var r=t._passes,n=r.length,o=t._textureSize;if(t._isPointLight){i=x.maximumCubeMapSize>=i?i:x.maximumCubeMapSize,o.x=i,o.y=i;var a=new e(0,0,i,i);r[0].passState.viewport=a,r[1].passState.viewport=a,r[2].passState.viewport=a,r[3].passState.viewport=a,r[4].passState.viewport=a,r[5].passState.viewport=a}else 1===n?(i=x.maximumTextureSize>=i?i:x.maximumTextureSize,o.x=i,o.y=i,r[0].passState.viewport=new e(0,0,i,i)):4===n&&(i=x.maximumTextureSize>=2*i?i:x.maximumTextureSize/2,o.x=2*i,o.y=2*i,r[0].passState.viewport=new e(0,0,i,i),r[1].passState.viewport=new e(i,0,i,i),r[2].passState.viewport=new e(0,i,i,i),r[3].passState.viewport=new e(i,i,i,i));t._clearPassState.viewport=new e(0,0,o.x,o.y);for(var s=0;s<n;++s){var l=r[s],u=l.passState.viewport,c=u.x/o.x,d=u.y/o.y,h=u.width/o.x,p=u.height/o.y;l.textureOffsets=new C(h,0,0,c,0,p,0,d,0,0,1,0,0,0,0,1)}}function ce(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=D.OVERLAY,r}function de(t,i){var r=i.context,n=i.context.drawingBufferWidth,o=i.context.drawingBufferHeight,a=.3*Math.min(n,o),s=Se;s.x=n-a,s.y=0,s.width=a,s.height=a;var l=t._debugShadowViewCommand;h(l)||(l=ce(t,r),t._debugShadowViewCommand=l),h(l.renderState)&&e.equals(l.renderState.viewport,s)||(l.renderState=L.fromCache({viewport:e.clone(s)})),i.commandList.push(t._debugShadowViewCommand)}function he(e,t){var r=new g({geometry:new i({minimum:new n(-.5,-.5,-.5),maximum:new n(.5,.5,.5)}),attributes:{color:u.fromColor(t)}}),o=new g({geometry:new E({radius:.5}),attributes:{color:u.fromColor(t)}});return new X({geometryInstances:[r,o],appearance:new j({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}function pe(e,t){de(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 W({camera:e._sceneCamera,color:l.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){i&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new W({camera:e._shadowMapCamera,color:l.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 W({camera:e._passes[r].camera,color:Ae[r],updateOnChange:!1})),e._debugCascadeFrustums[r].update(t)}}else if(e._isPointLight){if(!h(e._debugLightFrustum)||e._needsUpdate){var o=e._shadowMapCamera.positionWC,a=S.IDENTITY,s=2*e._pointLightRadius,u=n.fromElements(s,s,s,Pe),c=C.fromTranslationQuaternionRotationScale(o,a,u,be);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=he(c,l.YELLOW)}e._debugLightFrustum.update(t)}else h(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new W({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function fe(){this.viewMatrix=new C,this.inverseViewMatrix=new C,this.frustum=void 0,this.positionCartographic=new a,this.positionWC=new n,this.directionWC=n.clone(n.UNIT_Z),this.upWC=n.clone(n.UNIT_Y),this.rightWC=n.clone(n.UNIT_X),this.viewProjectionMatrix=new C}function me(e,t){var i,r=e._shadowMapCamera,a=e._sceneCamera,s=a.frustum.near,l=a.frustum.far,u=e._numberOfCascades,c=l-s,d=l/s,h=.9,p=!1;t.shadowHints.closestObjectSize<200&&(p=!0,h=.9);var f=Re,m=De;for(m[0]=s,m[u]=l,i=0;i<u;++i){var _=(i+1)/u,g=s*Math.pow(d,_),v=s+c*_,w=y.lerp(v,g,h);m[i+1]=w,f[i]=w-m[i]}if(p){for(i=0;i<u;++i)f[i]=Math.min(f[i],e._maximumCascadeDistances[i]);var S=m[0];for(i=0;i<u-1;++i)S+=f[i],m[i+1]=S}o.unpack(m,0,e._cascadeSplits[0]),o.unpack(m,1,e._cascadeSplits[1]),o.unpack(f,0,e._cascadeDistances);var E=r.frustum,b=E.left,T=E.right,x=E.bottom,A=E.top,P=E.near,M=E.far,D=r.positionWC,I=r.directionWC,R=r.upWC,O=a.frustum.clone(Ie),N=r.getViewProjection();for(i=0;i<u;++i){O.near=m[i],O.far=m[i+1];for(var L=C.multiply(O.projectionMatrix,a.viewMatrix,be),B=C.inverse(L,be),F=C.multiply(N,B,be),k=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Be),V=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Fe),z=0;z<8;++z){var U=o.clone(Ee[z],Te[z]);C.multiplyByVector(F,U,U),n.divideByScalar(U,U.w,U),n.minimumByComponent(U,k,k),n.maximumByComponent(U,V,V)}k.x=Math.max(k.x,0),k.y=Math.max(k.y,0),k.z=0,V.x=Math.min(V.x,1),V.y=Math.min(V.y,1),V.z=Math.min(V.z,1);var G=e._passes[i],H=G.camera;H.clone(r);var W=H.frustum;W.left=b+k.x*(T-b),W.right=b+V.x*(T-b),W.bottom=x+k.y*(A-x),W.top=x+V.y*(A-x),W.near=P+k.z*(M-P),W.far=P+V.z*(M-P),G.cullingVolume=H.frustum.computeCullingVolume(D,I,R);var q=e._cascadeMatrices[i];C.multiply(H.getViewProjection(),a.inverseViewMatrix,q),C.multiply(G.textureOffsets,q,q)}}function _e(e,t){var i=e._shadowMapCamera,r=e._sceneCamera,a=C.multiply(r.frustum.projectionMatrix,r.viewMatrix,be),s=C.inverse(a,be),l=i.directionWC,u=r.directionWC,c=n.cross(l,u,Ne);u=n.cross(c,l,Le),n.normalize(u,u),n.normalize(c,c);for(var d=n.fromElements(0,0,0,ke),h=C.computeView(d,l,u,c,Oe),p=C.multiply(h,s,be),f=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Be),m=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Fe),_=0;_<8;++_){var g=o.clone(Ee[_],Te[_]);C.multiplyByVector(p,g,g),n.divideByScalar(g,g.w,g),n.minimumByComponent(g,f,f),n.maximumByComponent(g,m,m)}m.z+=1e3,f.z-=10;var v=ke;v.x=-(.5*(f.x+m.x)),v.y=-(.5*(f.y+m.y)),v.z=-m.z;var y=C.fromTranslation(v,be);h=C.multiply(y,h,h);var w=.5*(m.x-f.x),S=.5*(m.y-f.y),E=m.z-f.z,b=i.frustum;b.left=-w,b.right=w,b.bottom=-S,b.top=S,b.near=.01,b.far=E,C.clone(h,i.viewMatrix),C.inverse(h,i.inverseViewMatrix),C.getTranslation(i.inverseViewMatrix,i.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(i.positionWC,i.positionCartographic),n.clone(l,i.directionWC),n.clone(u,i.upWC),n.clone(c,i.rightWC)}function ge(e,t){var i=new Y;i.fov=y.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=Ve[r],n.upWC=ze[r],n.rightWC=Ue[r],C.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),C.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=i}}function ve(e,i){var r=e._sceneCamera,o=e._shadowMapCamera,a=We;if(e._cascadesEnabled){if(r.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var s=i.mapProjection.ellipsoid.geodeticSurfaceNormal(r.positionWC,Ge),l=n.negate(o.directionWC,He),u=n.dot(s,l),c=y.clamp(u/.1,0,1);if(e._darkness=y.lerp(1,e.darkness,c),u<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)a.center=o.positionWC,a.radius=e._pointLightRadius,e._outOfView=i.cullingVolume.computeVisibility(a)===v.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere);else{var d=o.frustum.far/2,h=n.add(o.positionWC,n.multiplyByScalar(o.directionWC,d,qe),qe);a.center=h,a.radius=d,e._outOfView=i.cullingVolume.computeVisibility(a)===v.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere)}}function ye(e,t){var i=t.camera,r=e._lightCamera,o=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?n.clone(r.directionWC,a.directionWC):e._isPointLight?n.clone(r.positionWC,a.positionWC):a.clone(r);var s=e._lightDirectionEC;C.multiplyByPointAsVector(i.viewMatrix,a.directionWC,s),n.normalize(s,s),n.negate(s,s),C.multiplyByPoint(i.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;var l,u;e._fitNearFar?(l=Math.min(t.shadowHints.nearPlane,e.maximumDistance),u=Math.min(t.shadowHints.farPlane,e.maximumDistance+1)):(l=i.frustum.near,u=e.maximumDistance),e._sceneCamera=U.clone(i,o),i.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=l,e._sceneCamera.frustum.far=u,e._distance=u-l,ve(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}function Ce(e,t,i){var r=e._isPointLight?e._pointBias:i?e._terrainBias:e._primitiveBias,n={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var t=je;return t.x=1/e._textureSize.x,t.y=1/e._textureSize.y,o.fromElements(t.x,t.y,r.depthBias,r.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return o.fromElements(r.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new o,combinedUniforms2:new o};return c(t,n,!1)}function we(e,t,i,r,n,o){var a,l,u;if(h(o)&&(a=o.shaderProgram,l=o.renderState,u=o.uniformMap),o=P.shallowClone(i,o),o.castShadows=!0,o.receiveShadows=!1,!h(a)||n!==i.shaderProgram.id||t){var c=i.shaderProgram,d=i.pass===D.GLOBE,p=i.pass!==D.TRANSLUCENT,f=e._isPointLight,m=e._usesDepthTexture,_=Z.getShadowCastShaderKeyword(f,d,m,p);if(a=r.shaderCache.getDerivedShaderProgram(c,_),!h(a)){var g=c.vertexShaderSource,v=c.fragmentShaderSource,y=Z.createShadowCastVertexShader(g,f,d),C=Z.createShadowCastFragmentShader(v,f,m,p);a=r.shaderCache.createDerivedShaderProgram(c,_,{vertexShaderSource:y,fragmentShaderSource:C,attributeLocations:c._attributeLocations})}l=e._primitiveRenderState,f?l=e._pointRenderState:d&&(l=e._terrainRenderState);var w=i.renderState.cull.enabled;w||(l=s(l,!1),l.cull.enabled=!1,l=L.fromCache(l)),u=Ce(e,i.uniformMap,d)}return o.shaderProgram=a,o.renderState=l,o.uniformMap=u,o}K.MAXIMUM_DISTANCE=2e4,K.prototype.debugCreateRenderStates=function(){$(this)},p(K.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){ue(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 Se=new e,Ee=new Array(8);Ee[0]=new o(-1,-1,-1,1),Ee[1]=new o(1,-1,-1,1),Ee[2]=new o(1,1,-1,1),Ee[3]=new o(-1,1,-1,1),Ee[4]=new o(-1,-1,1,1),Ee[5]=new o(1,-1,1,1),Ee[6]=new o(1,1,1,1),Ee[7]=new o(-1,1,1,1);for(var be=new C,Te=new Array(8),xe=0;xe<8;++xe)Te[xe]=new o;var Ae=[l.RED,l.GREEN,l.BLUE,l.MAGENTA],Pe=new n;fe.prototype.clone=function(e){C.clone(e.viewMatrix,this.viewMatrix),C.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),a.clone(e.positionCartographic,this.positionCartographic),n.clone(e.positionWC,this.positionWC),n.clone(e.directionWC,this.directionWC),n.clone(e.upWC,this.upWC),n.clone(e.rightWC,this.rightWC)};var Me=new C(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);fe.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return C.multiply(t,e,this.viewProjectionMatrix),C.multiply(Me,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var De=new Array(5),Ie=new Y,Re=new Array(4),Oe=new C,Ne=new n,Le=new n,Be=new n,Fe=new n,ke=new n,Ve=[new n(-1,0,0),new n(0,-1,0),new n(0,0,-1),new n(1,0,0),new n(0,1,0),new n(0,0,1)],ze=[new n(0,-1,0),new n(0,0,-1),new n(0,-1,0),new n(0,-1,0),new n(0,0,1),new n(0,-1,0)],Ue=[new n(0,0,1),new n(1,0,0),new n(-1,0,0),new n(0,0,-1),new n(1,0,0),new n(1,0,0)],Ge=new n,He=new n,We=new t,qe=We.center;K.prototype.update=function(e){if(ye(this,e),this._needsUpdate)if(se(this,e.context),this._isPointLight&&ge(this,e),this._cascadesEnabled&&(_e(this,e),this._numberOfCascades>1&&me(this,e)),this._isPointLight)this._shadowMapCullingVolume=H.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 o=this._sceneCamera.inverseViewMatrix;C.multiply(this._shadowMapCamera.getViewProjection(),o,this._shadowMapMatrix)}this.debugShow&&pe(this,e)},K.prototype.updatePass=function(e,t){le(this,e,t)};var je=new r;return K.createDerivedCommands=function(e,t,i,r,n,o){h(o)||(o={});var a=t.length>0,s=i.shaderProgram,l=s.vertexShaderSource,u=s.fragmentShaderSource,c=i.pass===D.GLOBE,d=!1;if(c&&(d=i.owner.data.pickTerrain.mesh.encoding.hasVertexNormals),i.castShadows){var p=o.castCommands;h(p)||(p=o.castCommands=[]);var f=o.castShaderProgramId,m=e.length;p.length=m;for(var _=0;_<m;++_)p[_]=we(e[_],r,i,n,f,p[_]);o.castShaderProgramId=i.shaderProgram.id}if(i.receiveShadows&&a){var g,v;h(o.receiveCommand)&&(g=o.receiveCommand.shaderProgram,v=o.receiveCommand.uniformMap),o.receiveCommand=P.shallowClone(i,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;var y=o.receiveShaderCastShadows!==i.castShadows,C=o.receiveShaderProgramId!==i.shaderProgram.id;if(!h(g)||C||r||y){var w=Z.getShadowReceiveShaderKeyword(t[0],i.castShadows,c,d);if(g=n.shaderCache.getDerivedShaderProgram(s,w),!h(g)){var S=Z.createShadowReceiveVertexShader(l,c,d),E=Z.createShadowReceiveFragmentShader(u,t[0],i.castShadows,c,d);g=n.shaderCache.createDerivedShaderProgram(s,w,{vertexShaderSource:S,fragmentShaderSource:E,attributeLocations:s._attributeLocations})}v=Ce(t[0],i.uniformMap,c)}o.receiveCommand.shaderProgram=g,o.receiveCommand.uniformMap=v,o.receiveShaderProgramId=i.shaderProgram.id,o.receiveShaderCastShadows=i.castShadows}return o},K.prototype.isDestroyed=function(){return!1},K.prototype.destroy=function(){ee(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 f(this)},K}),define("Shaders/PostProcessFilters/AdditiveBlend",[],function(){"use strict";return"uniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\nuniform vec2 u_center;\nuniform float u_radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\nvec4 color1 = texture2D(u_texture1, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - u_center) / u_radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color0, t);\n}\n"}),define("Shaders/PostProcessFilters/BrightPass",[],function(){"use strict";return"uniform sampler2D u_texture;\nuniform float u_avgLuminance;\nuniform float u_threshold;\nuniform float u_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(u_texture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(u_avgLuminance) * luminance / u_avgLuminance;\nfloat brightLum = max(scaledLum - u_threshold, 0.0);\nfloat brightness = brightLum / (u_offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n"}),define("Shaders/PostProcessFilters/GaussianBlur1D",[],function(){"use strict";return"#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\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(u_texture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n"}),define("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Transforms","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S){"use strict";function E(){this._fbo=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._downSampleCommand=void 0,this._brightPassCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._downSamplePassState=new p,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new p,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t}E.prototype.clear=function(e,t){var i=this._clearFBO1Command;r.clone(n(t,r.BLACK),i.color),i.execute(e),i=this._clearFBO2Command,r.clone(n(t,r.BLACK),i.color),i.execute(e)},E.prototype.execute=function(e,t){this._downSampleCommand.execute(e,this._downSamplePassState),this._brightPassCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState),this._fullScreenCommand.framebuffer=t,this._blendCommand.framebuffer=t,this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var b=new e,T=new e,x=new i,A=new t,P=new t,M=new l;return E.prototype.update=function(e){var i=e.context,n=e.viewport,a=i.drawingBufferWidth,p=i.drawingBufferHeight,E=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new d({color:new r}),this._clearFBO2Command=new d({color:new r});var D={};this._downSampleCommand=i.createViewportQuadCommand(S,{uniformMap:D,owner:this}),D={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=i.createViewportQuadCommand(C,{uniformMap:D,owner:this});var I=1,R=2;D={delta:function(){return I},sigma:function(){return R},direction:function(){return 0}},this._blurXCommand=i.createViewportQuadCommand(w,{uniformMap:D,owner:this}),D={delta:function(){return I},sigma:function(){return R},direction:function(){return 1}},this._blurYCommand=i.createViewportQuadCommand(w,{uniformMap:D,owner:this}),D={u_center:function(){return E._uCenter},u_radius:function(){return E._uRadius}},this._blendCommand=i.createViewportQuadCommand(y,{uniformMap:D,owner:this}),D={},this._fullScreenCommand=i.createViewportQuadCommand(S,{uniformMap:D,owner:this})}var O=Math.pow(2,Math.ceil(Math.log(a)/Math.log(2))-2),N=Math.pow(2,Math.ceil(Math.log(p)/Math.log(2))-2),L=Math.max(1,O,N),B=T;B.width=L,B.height=L;var F=this._fbo,k=o(F)&&F.getColorTexture(0)||void 0;if(!o(k)||k.width!==a||k.height!==p){F=F&&F.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/L;var V=[new v({context:i,width:a,height:p})];F=i.depthTexture?this._fbo=new h({context:i,colorTextures:V,depthTexture:new v({context:i,width:a,height:p,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:f.UNSIGNED_SHORT})}):this._fbo=new h({context:i,colorTextures:V,depthRenderbuffer:new m({context:i,format:_.DEPTH_COMPONENT16})}),this._downSampleFBO1=new h({context:i,colorTextures:[new v({context:i,width:L,height:L})]}),this._downSampleFBO2=new h({context:i,colorTextures:[new v({context:i,width:L,height:L})]}),this._clearFBO1Command.framebuffer=this._downSampleFBO1,this._clearFBO2Command.framebuffer=this._downSampleFBO2,this._downSampleCommand.framebuffer=this._downSampleFBO1,this._brightPassCommand.framebuffer=this._downSampleFBO2,this._blurXCommand.framebuffer=this._downSampleFBO1,this._blurYCommand.framebuffer=this._downSampleFBO2;var z=g.fromCache({viewport:B});this._downSampleCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._downSampleCommand.renderState=z,this._brightPassCommand.uniformMap.u_texture=function(){return E._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=z,this._blurXCommand.uniformMap.u_texture=function(){return E._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return E._blurStep},this._blurXCommand.renderState=z,this._blurYCommand.uniformMap.u_texture=function(){return E._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return E._blurStep},this._blurYCommand.renderState=z;var U=b;U.width=a,U.height=p;var G=g.fromCache({viewport:U});this._blendCommand.uniformMap.u_texture0=function(){return F.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return E._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=G,this._fullScreenCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._fullScreenCommand.renderState=G}var H=i.uniformState,W=H.sunPositionWC,q=H.view,j=H.viewProjection,Y=H.projection,X=l.computeViewportTransformation(n,0,1,M),Z=l.multiplyByPoint(q,W,x),K=c.pointToGLWindowCoordinates(j,X,W,A);Z.x+=s.SOLAR_RADIUS;var Q=c.pointToGLWindowCoordinates(Y,X,Z,Z),J=30*t.magnitude(t.subtract(Q,K,Q))*2,$=P;$.x=J,$.y=J;var ee=this._upSamplePassState.scissorTest.rectangle;return ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._uCenter=t.clone(K,this._uCenter),this._uRadius=.5*Math.max($.x,$.y),X=l.computeViewportTransformation(B,0,1,M), -K=c.pointToGLWindowCoordinates(j,X,W,A),$.x*=O/a,$.y*=N/p,ee=this._downSamplePassState.scissorTest.rectangle,ee.x=Math.max(K.x-.5*$.x,0),ee.y=Math.max(K.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._downSamplePassState.context=i,this._upSamplePassState.context=i,this._fbo},E.prototype.isDestroyed=function(){return!1},E.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._downSampleCommand=this._downSampleCommand&&this._downSampleCommand.shaderProgram&&this._downSampleCommand.shaderProgram.destroy(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.destroy(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.destroy(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.destroy(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.destroy(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.destroy(),a(this)},E}),define("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/Event","../Core/GeographicProjection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/getTimestamp","../Core/Intersect","../Core/Interval","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/mergeSort","../Core/Occluder","../Core/PixelFormat","../Core/ShowGeometryInstanceAttribute","../Core/Transforms","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","./Camera","./CreditDisplay","./CullingVolume","./DebugCameraPrimitive","./DepthPlane","./DeviceOrientationCameraController","./Fog","./FrameState","./FrustumCommands","./FXAA","./GlobeDepth","./MapMode2D","./OIT","./OrthographicFrustum","./PerformanceDisplay","./PerInstanceColorAppearance","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./PickDepth","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./ShadowMap","./SunPostProcess","./TweenCollection"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,M,D,I,R,O,N,L,B,F,k,V,z,U,G,H,W,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,_e,ge){"use strict";function ve(t){t=c(t,c.EMPTY_OBJECT);var i=t.canvas,r=t.contextOptions,n=t.creditContainer,o=new O(i,r);d(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",i.parentNode.appendChild(n)),this._id=u(),this._frameState=new Q(o,new q(n)),this._frameState.scene3DOnly=c(t.scene3DOnly,!1);var a=new k(o);a.viewport=new e,a.viewport.x=0,a.viewport.y=0,a.viewport.width=o.drawingBufferWidth,a.viewport.height=o.drawingBufferHeight,this._passState=a,this._canvas=i,this._context=o,this._computeEngine=new R(o),this._globe=void 0,this._primitives=new ce,this._groundPrimitives=new ce,this._tweens=new ge,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._pickFramebuffer=void 0,this._useOIT=c(t.orderIndependentTranslucency,!0),this._executeOITFunction=void 0;var l;o.depthTexture&&(l=new ee);var h;this._useOIT&&d(l)&&(h=new ie(o)),this._globeDepth=l,this._depthPlane=new X,this._oit=h,this._fxaa=new $,this._clearColorCommand=new I({color:new s,stencil:0,owner:this}),this._depthClearCommand=new I({depth:1,owner:this}),this._stencilClearCommand=new I({stencil:0}),this._pickDepths=[],this._debugGlobeDepths=[],this._pickDepthPassState=void 0,this._pickDepthFramebuffer=void 0,this._pickDepthFramebufferWidth=void 0,this._pickDepthFramebufferHeight=void 0,this._depthOnlyRenderStateCache={},this._transitioner=new pe(this),this._renderError=new _,this._preRender=new _,this._postRender=new _,this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _,this.morphComplete=new _,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=s.clone(s.BLACK),this._mode=de.SCENE3D,this._mapProjection=d(t.mapProjection)?t.mapProjection:new g,this.morphTime=1,this.farToNearRatio=1e3,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this._debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.fxaa=!0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.copyGlobeDepth=!1,this.fog=new K,this._sunCamera=new W(this),this.shadowMap=new me({context:o,lightCamera:this._sunCamera,enabled:c(t.shadows,!1)}),this._terrainExaggeration=c(t.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0;var p=new W(this);this._camera=p,this._cameraClone=W.clone(p),this._screenSpaceCameraController=new fe(this),this._mapMode2D=c(t.mapMode2D,te.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,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useFXAA:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0;var f=p.frustum.near,m=p.frustum.far,v=Math.ceil(Math.log(m/f)/Math.log(this.farToNearRatio));Te(f,m,this.farToNearRatio,v,this._frustumCommandsList,!1,void 0),be(this,0,E.now()),this.initializeFrame()}function ye(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 Ce(e,t,i){var r=1/Math.max(1,ye(e.position,t.position));return n.multiplyByScalar(e.position,r,lt),n.multiplyByScalar(t.position,r,ut),n.equalsEpsilon(lt,ut,i)&&n.equalsEpsilon(e.direction,t.direction,i)&&n.equalsEpsilon(e.up,t.up,i)&&n.equalsEpsilon(e.right,t.right,i)&&T.equalsEpsilon(e.transform,t.transform,i)}function we(e,t){var i=e.frameState,r=e._context,n=i.shadowHints.shadowsEnabled,o=i.shadowHints.shadowMaps,a=i.shadowHints.lightShadowMaps,s=n&&a.length>0,l=!1,u=i.shadowHints.lastDirtyTime;t.lastDirtyTime!==u&&(t.lastDirtyTime=u,t.dirty=!0,l=!0);var c=t.derivedCommands;if(t.dirty&&d(c)){t.dirty=!1,n&&(t.receiveShadows||t.castShadows)&&(c.shadows=me.createDerivedCommands(o,a,t,l,r,c.shadows));var h=e._oit;t.pass===F.TRANSLUCENT&&d(h)&&h.isSupported()&&(s&&t.receiveShadows?(c.oit=d(c.oit)?c.oit:{},c.oit.shadows=h.createDerivedCommands(t.derivedCommands.shadows.receiveCommand,r,c.oit.shadows)):c.oit=h.createDerivedCommands(t,r,c.oit)),c.depth=nt(e,t,r,c.depth)}}function Se(e){var t=e.globe;if(e._mode===de.SCENE3D&&d(t)){var i=t.ellipsoid;return ct.radius=i.minimumRadius,st=A.fromBoundingSphere(ct,e._camera.positionWC,st)}}function Ee(e){e.render=!1,e.pick=!1,e.depth=!1}function be(e,t,i){var r=e._camera,n=e._frameState;n.commandList.length=0,n.shadowMaps.length=0,n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=E.clone(i,n.time),n.camera=r,n.cullingVolume=r.frustum.computeCullingVolume(r.positionWC,r.directionWC,r.upWC),n.occluder=Se(e),n.terrainExaggeration=e._terrainExaggeration,d(e.globe)?n.maximumScreenSpaceError=e.globe.maximumScreenSpaceError:n.maximumScreenSpaceError=2,Ee(n.passes)}function Te(e,t,i,r,n,o,a){n.length=r;for(var s=0;s<r;++s){var l,u;o?(l=Math.min(t-a,e+s*a),u=Math.min(t,l+a)):(l=Math.max(e,Math.pow(i,s)*e),u=Math.min(t,i*l));var c=n[s];d(c)?(c.near=l,c.far=u):c=n[s]=new J(l,u)}}function xe(e,t,i){e.debugShowFrustums&&(t.debugOverlappingFrustums=0),e.frameState.passes.pick||we(e,t);for(var r=e._frustumCommandsList,n=r.length,o=0;o<n;++o){var a=r[o],s=a.near,l=a.far;if(!(i.start>l)){if(i.stop<s)break;var u=t instanceof I?F.OPAQUE:t.pass,c=a.indices[u]++;if(a.commands[u][c]=t,e.debugShowFrustums&&(t.debugOverlappingFrustums|=1<<o),t.executeInClosestFrustum)break}}if(e.debugShowFrustums){var h=e._debugFrustumStatistics.commandsInFrustums;h[t.debugOverlappingFrustums]=d(h[t.debugOverlappingFrustums])?h[t.debugOverlappingFrustums]+1:1,++e._debugFrustumStatistics.totalCommands}}function Ae(e,t,i){return d(e)&&(!d(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==w.OUTSIDE&&(!d(i)||!e.boundingVolume.isOccluded(i)))}function Pe(e){var t=e._frameState,i=t.camera,r=i.directionWC,n=i.positionWC,o=e._computeCommandList,a=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(e._debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=e._frustumCommandsList,u=l.length,c=F.NUMBER_OF_PASSES,h=0;h<u;++h)for(var p=0;p<c;++p)l[h].indices[p]=0;o.length=0,a.length=0;for(var f=Number.MAX_VALUE,m=-Number.MAX_VALUE,_=!1,g=t.shadowHints.shadowsEnabled,v=Number.MAX_VALUE,y=-Number.MAX_VALUE,C=Number.MAX_VALUE,w=t.mode===de.SCENE3D?t.occluder:void 0,S=t.cullingVolume,E=dt.planes,T=0;T<5;++T)E[T]=S.planes[T];S=dt;var x=e._environmentState;x.isSkyAtmosphereVisible=d(x.skyAtmosphereCommand)&&x.isReadyForAtmosphere,x.isSunVisible=Ae(x.sunDrawCommand,S,w),x.isMoonVisible=Ae(x.moonCommand,S,w);for(var A=s.length,P=0;P<A;++P){var M=s[P],D=M.pass;if(D===F.COMPUTE)o.push(M);else if(D===F.OVERLAY)a.push(M);else{var R=M.boundingVolume;if(d(R)){if(!Ae(M,S,w))continue;if(ht=R.computePlaneDistances(n,r,ht),f=Math.min(f,ht.start),m=Math.max(m,ht.stop),g&&M.receiveShadows&&ht.start<me.MAXIMUM_DISTANCE&&!(D===F.GLOBE&&ht.start<-100&&ht.stop>100)){var O=ht.stop-ht.start;D!==F.GLOBE&&ht.start<100&&(C=Math.min(C,O)),v=Math.min(v,ht.start),y=Math.max(y,ht.stop)}}else ht.start=i.frustum.near,ht.stop=i.frustum.far,_=!(M instanceof I);xe(e,M,ht)}}_?(f=i.frustum.near,m=i.frustum.far):(f=Math.min(Math.max(f,i.frustum.near),i.frustum.far),m=Math.max(Math.min(m,i.frustum.far),f),g&&(v=Math.min(Math.max(v,i.frustum.near),i.frustum.far),y=Math.max(Math.min(y,i.frustum.far),v))),g&&(t.shadowHints.nearPlane=v,t.shadowHints.farPlane=y,t.shadowHints.closestObjectSize=C);var N,L=e.mode===de.SCENE2D,B=e.farToNearRatio;L?(m=Math.min(m,i.position.z+e.nearToFarDistance2D),f=Math.min(f,m),N=Math.ceil(Math.max(1,m-f)/e.nearToFarDistance2D)):N=Math.ceil(Math.log(m/f)/Math.log(B)),f!==Number.MAX_VALUE&&(N!==u||0!==l.length&&(f<l[0].near||m>l[u-1].far&&!b.equalsEpsilon(m,l[u-1].far,b.EPSILON8)))&&(Te(f,m,B,N,l,L,e.nearToFarDistance2D),Pe(e));var k=t.frustumSplits;k.length=N+1;for(var V=0;V<N;++V)k[V]=l[V].near,V===N-1&&(k[V+1]=l[V].far)}function Me(e){var t={},i=e.vertexAttributes;for(var r in i)i.hasOwnProperty(r)&&(t[r]=i[r].index);return t}function De(e,t,i){var r=t.context,n=c(i,e.shaderProgram),o=n.fragmentShaderSource.clone(),a=[];o.sources=o.sources.map(function(e){e=G.replaceMain(e,"czm_Debug_main");for(var t,i=/gl_FragData\[(\d+)\]/g;null!==(t=i.exec(e));)a.indexOf(t[1])===-1&&a.push(t[1]);return e});var l,u=a.length,h="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){d(e._debugColor)||(e._debugColor=s.fromRandom());var p=e._debugColor;if(u>0)for(l=0;l<u;++l)h+=" gl_FragData["+a[l]+"].rgb *= vec3("+p.red+", "+p.green+", "+p.blue+"); \n";else h+=" gl_FragColor.rgb *= vec3("+p.red+", "+p.green+", "+p.blue+"); \n"}if(t.debugShowFrustums){var f=1&e.debugOverlappingFrustums?"1.0":"0.0",m=2&e.debugOverlappingFrustums?"1.0":"0.0",_=4&e.debugOverlappingFrustums?"1.0":"0.0";if(u>0)for(l=0;l<u;++l)h+=" gl_FragData["+a[l]+"].rgb *= vec3("+f+", "+m+", "+_+"); \n";else h+=" gl_FragColor.rgb *= vec3("+f+", "+m+", "+_+"); \n"}h+="}",o.sources.push(h);var g=Me(n);return U.fromCache({context:r,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:g})}function Ie(e,t,i){var r=L.shallowClone(e);r.shaderProgram=De(e,t),r.execute(t.context,i),r.shaderProgram.destroy()}function Re(e,t,r,o,a){if(!d(t.debugCommandFilter)||t.debugCommandFilter(e)){var s=t.frameState.shadowHints.shadowsEnabled,u=s&&t.frameState.shadowHints.lightShadowMaps.length>0;if(t.debugShowCommands||t.debugShowFrustums?Ie(e,t,o):u&&e.receiveShadows&&d(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,o):t.frameState.passes.depth&&d(e.derivedCommands.depth)?e.derivedCommands.depth.depthOnlyCommand.execute(r,o):e.execute(r,o),e.debugShowBoundingVolume&&d(e.boundingVolume)){var c=t._frameState,h=e.boundingVolume;d(t._debugVolume)&&t._debugVolume.destroy();var p,f=n.clone(h.center);if(c.mode!==de.SCENE3D){f=T.multiplyByPoint(pt,f,f);var _=c.mapProjection,g=_.unproject(f);f=_.ellipsoid.cartographicToCartesian(g)}if(d(h.radius)){var C=h.radius;p=y.toWireframe(m.createGeometry(new m({radii:new n(C,C,C),vertexFormat:oe.FLAT_VERTEX_FORMAT}))),t._debugVolume=new ue({geometryInstances:new v({geometry:p,modelMatrix:T.multiplyByTranslation(T.IDENTITY,f,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new oe({flat:!0,translucent:!1}),asynchronous:!1})}else{var w=h.halfAxes;p=y.toWireframe(i.createGeometry(i.fromDimensions({dimensions:new n(2,2,2),vertexFormat:oe.FLAT_VERTEX_FORMAT}))),t._debugVolume=new ue({geometryInstances:new v({geometry:p,modelMatrix:T.fromRotationTranslation(w,f,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new oe({flat:!0,translucent:!1}),asynchronous:!1})}var S=c.commandList,E=c.commandList=[];t._debugVolume.update(c);var b;d(a)&&(b=o.framebuffer,o.framebuffer=a),E[0].execute(r,o),d(b)&&(o.framebuffer=b),c.commandList=S}}}function Oe(e,t,i){return t.boundingVolume.distanceSquaredTo(i)-e.boundingVolume.distanceSquaredTo(i)}function Ne(e,t,i,r){var n=e.context;x(r,Oe,e._camera.positionWC);for(var o=r.length,a=0;a<o;++a)t(r[a],e,n,i)}function Le(e,t){var i=e._debugGlobeDepths[t];return!d(i)&&e.context.depthTexture&&(i=new ee,e._debugGlobeDepths[t]=i),i}function Be(e,t){var i=e._pickDepths[t];return d(i)||(i=new le,e._pickDepths[t]=i),i}function Fe(e,t){var i=e._camera,r=e.context,n=r.uniformState;n.updateCamera(i);var o;o=d(i.frustum.fov)?i.frustum.clone(ft):d(i.frustum.infiniteProjectionMatrix)?i.frustum.clone(mt):i.frustum.clone(_t),o.near=i.frustum.near,o.far=i.frustum.far,n.updateFrustum(o),n.updatePass(F.ENVIRONMENT);var a=e._useWebVR&&e.mode!==de.SCENE2D,s=e._frameState.passes,l=s.pick,u=s.depth,c=e._environmentState;if(!l){var h=c.skyBoxCommand;if(d(h)&&Re(h,e,r,t),c.isSkyAtmosphereVisible&&Re(c.skyAtmosphereCommand,e,r,t),c.isSunVisible&&(c.sunDrawCommand.execute(r,t),e.sunBloom&&!a)){var p;p=c.useGlobeDepthFramebuffer?e._globeDepth.framebuffer:c.useFXAA?e._fxaa.getColorFramebuffer():c.originalFramebuffer,e._sunPostProcess.execute(r,p),t.framebuffer=p}c.isMoonVisible&&c.moonCommand.execute(r,t)}var f;c.useOIT?(d(e._executeOITFunction)||(e._executeOITFunction=function(e,t,i,r){e._oit.executeCommands(e,t,i,r)}),f=e._executeOITFunction):f=Ne;for(var m,_=c.clearGlobeDepth,g=c.useDepthPlane,v=e._depthClearCommand,y=e._depthPlane,C=i.position.z,w=e._frustumCommandsList,S=w.length,E=0;E<S;++E){var b=S-E-1,T=w[b];e.mode===de.SCENE2D?(i.position.z=C-T.near+1,o.far=Math.max(1,T.far-T.near),o.near=1,n.update(e.frameState),n.updateFrustum(o)):(o.near=0!==b?T.near*at:T.near,o.far=T.far,n.updateFrustum(o));var x,A=e.debugShowGlobeDepth?Le(e,b):e._globeDepth;e.debugShowGlobeDepth&&d(A)&&c.useGlobeDepthFramebuffer&&(x=t.framebuffer,t.framebuffer=A.framebuffer),v.execute(r,t),n.updatePass(F.GLOBE);var P=T.commands[F.GLOBE],M=T.indices[F.GLOBE];for(m=0;m<M;++m)Re(P[m],e,r,t);for(d(A)&&c.useGlobeDepthFramebuffer&&(e.copyGlobeDepth||e.debugShowGlobeDepth)&&(A.update(r),A.executeCopyDepth(r,t)),e.debugShowGlobeDepth&&d(A)&&c.useGlobeDepthFramebuffer&&(t.framebuffer=x),n.updatePass(F.GROUND),P=T.commands[F.GROUND],M=T.indices[F.GROUND],m=0;m<M;++m)Re(P[m],e,r,t);M>0&&r.stencilBuffer&&e._stencilClearCommand.execute(r,t),_&&(v.execute(r,t),g&&y.execute(r,t));for(var D=F.GROUND+1,I=F.TRANSLUCENT,R=D;R<I;++R)for(n.updatePass(R),P=T.commands[R],M=T.indices[R],m=0;m<M;++m)Re(P[m],e,r,t);if(0!==b&&e.mode!==de.SCENE2D&&(o.near=T.near,n.updateFrustum(o)),n.updatePass(F.TRANSLUCENT),P=T.commands[F.TRANSLUCENT],P.length=T.indices[F.TRANSLUCENT],f(e,Re,t,P),d(A)&&(c.useGlobeDepthFramebuffer||u)&&e.useDepthPicking){var O=u?t.framebuffer.depthStencilTexture:A.framebuffer.depthStencilTexture,N=Be(e,b);N.update(r,O),N.executeCopyDepth(r,t)}}}function ke(e){var t=e.context.uniformState;t.updatePass(F.COMPUTE);var i=e._environmentState.sunComputeCommand;d(i)&&i.execute(e._computeEngine);for(var r=e._computeCommandList,n=r.length,o=0;o<n;++o)r[o].execute(e._computeEngine)}function Ve(e,t){var i=e.context.uniformState;i.updatePass(F.OVERLAY);for(var r=e.context,n=e._overlayCommandList,o=n.length,a=0;a<o;++a)n[a].execute(r,t)}function ze(e,t,i){for(var r=i.shadowMapCullingVolume,n=i.isPointLight,o=i.passes,a=o.length,s=t.length,l=0;l<s;++l){var u=t[l];if(we(e,u),u.castShadows&&(u.pass===F.GLOBE||u.pass===F.OPAQUE||u.pass===F.TRANSLUCENT)&&Ae(u,r))if(n)for(var c=0;c<a;++c)o[c].commandList.push(u);else if(1===a)o[0].commandList.push(u);else for(var d=!1,h=a-1;h>=0;--h){var p=o[h].cullingVolume;if(Ae(u,p))o[h].commandList.push(u),d=!0;else if(d)break}}}function Ue(e){var t=e.frameState,i=t.shadowHints.shadowMaps,r=i.length;if(t.shadowHints.shadowsEnabled)for(var n=e.context,o=n.uniformState,a=0;a<r;++a){var s=i[a];if(!s.outOfView){var l,u=s.passes,c=u.length;for(l=0;l<c;++l)u[l].commandList.length=0;var d=e.frameState.commandList;for(ze(e,d,s),l=0;l<c;++l){var h=s.passes[l];o.updateCamera(h.camera),s.updatePass(n,l);for(var p=h.commandList.length,f=0;f<p;++f){var m=h.commandList[f];o.updatePass(m.pass),Re(m.derivedCommands.shadows.castCommands[a],e,n,h.passState)}}}}}function Ge(e,t,i){var r=e._context,o=t.viewport,a=e._frameState,s=a.camera,l=a.mode,u=a.passes.depth;if(e._useWebVR&&l!==de.SCENE2D){u||Xe(e),Pe(e),Ze(e,t,i),u||(ke(e),Ue(e)),o.x=0,o.y=0,o.width=.5*r.drawingBufferWidth,o.height=r.drawingBufferHeight;var c=W.clone(s,e._cameraVR),d=s.frustum.near,h=5*d,p=h/30,f=n.multiplyByScalar(c.right,.5*p,bt);s.frustum.aspectRatio=o.width/o.height;var m=.5*p*d/h;n.add(c.position,f,s.position),s.frustum.xOffset=m,Fe(e,t),o.x=t.viewport.width,n.subtract(c.position,f,s.position),s.frustum.xOffset=-m,Fe(e,t),W.clone(c,s)}else o.x=0,o.y=0,o.width=r.drawingBufferWidth,o.height=r.drawingBufferHeight,l!==de.SCENE2D||e._mapMode2D===te.ROTATE?We(!0,e,t,i):He(e,t,i)}function He(e,t,i){var r=e.context,o=e.frameState,a=e.camera,s=t.viewport,l=gt,u=vt,c=e.mapProjection;c.project(l,u);var d=n.clone(a.position,yt),h=T.clone(a.transform,wt),p=a.frustum.clone();a._setTransform(T.IDENTITY);var f=T.computeViewportTransformation(s,0,1,Ct),m=a.frustum.projectionMatrix,_=a.positionWC.y,g=n.fromElements(b.sign(_)*u.x-_,0,-a.positionWC.x,St),v=D.pointToGLWindowCoordinates(m,f,g,Et);v.x=Math.floor(v.x);var y=s.x,C=s.width;if(0===_||v.x<=0||v.x>=r.drawingBufferWidth)We(!0,e,t,i);else if(Math.abs(.5*r.drawingBufferWidth-v.x)<1)s.width=v.x,a.position.x*=b.sign(a.position.x),a.frustum.right=0,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(o),We(!0,e,t,i),s.x=s.width,a.position.x=-a.position.x,a.frustum.right=-a.frustum.left,a.frustum.left=0,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(o),We(!1,e,t,i);else if(v.x>.5*r.drawingBufferWidth){s.width=v.x;var w=a.frustum.right;a.frustum.right=u.x-_,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(o),We(!0,e,t,i),s.x+=v.x,s.width=r.drawingBufferWidth-v.x,a.position.x=-a.position.x,a.frustum.left=-a.frustum.right,a.frustum.right=w-2*a.frustum.right,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(o),We(!1,e,t,i)}else{s.x=v.x,s.width=r.drawingBufferWidth-v.x;var S=a.frustum.left;a.frustum.left=-u.x-_,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(o),We(!0,e,t,i),s.x=0,s.width=v.x,a.position.x=-a.position.x,a.frustum.right=-a.frustum.left,a.frustum.left=S-2*a.frustum.left,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),r.uniformState.update(o),We(!1,e,t,i)}a._setTransform(h),n.clone(d,a.position),a.frustum=p.clone(),s.x=y,s.width=C}function We(e,t,i,r){var n=t.frameState.passes.depth;e||n||(t.frameState.commandList.length=0),n||Xe(t),Pe(t),e&&(Ze(t,i,r),n||(ke(t),Ue(t))),Fe(t,i)}function qe(e){var t=e._frameState,i=e._environmentState,r=t.passes.render;i.skyBoxCommand=r&&d(e.skyBox)?e.skyBox.update(t):void 0;var n=e.skyAtmosphere,o=e.globe;d(n)&&d(o)&&(n.setDynamicAtmosphereColor(o.enableLighting),i.isReadyForAtmosphere=i.isReadyForAtmosphere||o._surface._tilesToRender.length>0),i.skyAtmosphereCommand=r&&d(n)?n.update(t):void 0;var a=r&&d(e.sun)?e.sun.update(e):void 0;i.sunDrawCommand=d(a)?a.drawCommand:void 0,i.sunComputeCommand=d(a)?a.computeCommand:void 0,i.moonCommand=r&&d(e.moon)?e.moon.update(t):void 0;var s=i.clearGlobeDepth=d(o)&&(!o.depthTestAgainstTerrain||e.mode===de.SCENE2D),l=i.useDepthPlane=s&&e.mode===de.SCENE3D;l&&e._depthPlane.update(t)}function je(e){var t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Y({camera:e.camera,updateOnChange:!1}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),d(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Ye(e){var t=e._frameState,i=t.shadowMaps,r=i.length,n=r>0&&!t.passes.pick&&e.mode===de.SCENE3D;if(n!==t.shadowHints.shadowsEnabled&&(++t.shadowHints.lastDirtyTime,t.shadowHints.shadowsEnabled=n),n){for(var o=0;o<r;++o)if(i[o]!==t.shadowHints.shadowMaps[o]){++t.shadowHints.lastDirtyTime;break}t.shadowHints.shadowMaps.length=0,t.shadowHints.lightShadowMaps.length=0;for(var a=0;a<r;++a){var s=i[a];s.update(t),t.shadowHints.shadowMaps.push(s),s.fromLightSource&&t.shadowHints.lightShadowMaps.push(s),s.dirty&&(++t.shadowHints.lastDirtyTime,s.dirty=!1)}}}function Xe(e){var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),je(e),Ye(e),e._globe&&e._globe.update(t)}function Ze(e,t,i){var r=e._context,n=e._environmentState,o=e._frameState.passes,a=o.pick,l=e._useWebVR&&e.mode!==de.SCENE2D;n.originalFramebuffer=t.framebuffer,d(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!l?e._sunPostProcess=new _e:d(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!d(e.sun)&&d(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var u=e._clearColorCommand;s.clone(i,u.color),u.execute(r,t);var c=n.useGlobeDepthFramebuffer=!a&&d(e._globeDepth);c&&(e._globeDepth.update(r),e._globeDepth.clear(r,t,i));for(var h=!1,p=e._frustumCommandsList,f=p.length,m=0;m<f;++m)if(p[m].indices[F.TRANSLUCENT]>0){h=!0;break}var _=n.useOIT=!a&&h&&d(e._oit)&&e._oit.isSupported();_&&(e._oit.update(r,e._globeDepth.framebuffer),e._oit.clear(r,t,i),n.useOIT=e._oit.isSupported());var g=n.useFXAA=!a&&e.fxaa;g&&(e._fxaa.update(r),e._fxaa.clear(r,t,i)),n.isSunVisible&&e.sunBloom&&!l?t.framebuffer=e._sunPostProcess.update(t):c?t.framebuffer=e._globeDepth.framebuffer:g&&(t.framebuffer=e._fxaa.getColorFramebuffer()),d(t.framebuffer)&&u.execute(r,t)}function Ke(e,t){var i=e._context,r=e._environmentState,n=r.useGlobeDepthFramebuffer;if(e.debugShowGlobeDepth&&n){var o=Le(e,e.debugShowDepthFrustum-1);o.executeDebugGlobeDepth(i,t)}if(e.debugShowPickDepth&&n){var a=Be(e,e.debugShowDepthFrustum-1);a.executeDebugPickDepth(i,t)}var s=r.useOIT,l=r.useFXAA;s&&(t.framebuffer=l?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(i,t)),l&&(!s&&n&&(t.framebuffer=e._fxaa.getColorFramebuffer(),e._globeDepth.executeCopyColor(i,t)),t.framebuffer=r.originalFramebuffer,e._fxaa.execute(i,t)),s||l||!n||(t.framebuffer=r.originalFramebuffer,e._globeDepth.executeCopyColor(i,t))}function Qe(e){for(var t=e.afterRender,i=0,r=t.length;i<r;++i)t[i]();t.length=0}function Je(e,t){d(t)||(t=E.now());var i=e._camera;Ce(i,e._cameraClone,b.EPSILON6)?e._cameraStartFired&&C()-e._cameraMovedTime>e.cameraEventWaitTime&&(i.moveEnd.raiseEvent(),e._cameraStartFired=!1):(e._cameraStartFired||(i.moveStart.raiseEvent(),e._cameraStartFired=!0),e._cameraMovedTime=C(),W.clone(i,e._cameraClone)),e._preRender.raiseEvent(e,t);var r=e.context,o=r.uniformState,a=e._frameState,l=b.incrementWrap(a.frameNumber,15e6,1);be(e,l,t),a.passes.render=!0,a.creditDisplay.beginFrame(),e.fog.update(a),o.update(a);var u=e.shadowMap;d(u)&&u.enabled&&(n.negate(o.sunDirectionWC,e._sunCamera.direction),a.shadowMaps.push(u)),e._computeCommandList.length=0,e._overlayCommandList.length=0;var h=e._passState;if(h.framebuffer=void 0,h.blendingEnabled=void 0,h.scissorTest=void 0,d(e.globe)&&e.globe.beginFrame(a),qe(e),Ge(e,h,c(e.backgroundColor,s.BLACK)),Ke(e,h),Ve(e,h),d(e.globe)&&e.globe.endFrame(a),a.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!d(e._performanceDisplay)){var p=document.createElement("div");p.className="cesium-performanceDisplay-defaultContainer";var f=e._canvas.parentNode;f.appendChild(p);var m=new ne({container:p});e._performanceDisplay=m,e._performanceContainer=p}e._performanceDisplay.update()}else d(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));r.endFrame(),Qe(a),e._postRender.raiseEvent(e,t)}function $e(e,t,i,r){var o=e._camera,a=o.frustum,s=e._passState.viewport,l=2*(t.x-s.x)/s.width-1;l*=.5*(a.right-a.left);var u=2*(s.height-t.y-s.y)/s.height-1;u*=.5*(a.top-a.bottom);var c=T.clone(o.transform,Mt);o._setTransform(T.IDENTITY);var d=n.clone(o.position,xt);n.multiplyByScalar(o.right,l,At),n.add(At,d,d),n.multiplyByScalar(o.up,u,At),n.add(At,d,d),o._setTransform(c),n.fromElements(d.z,d.x,d.y,d);var h=a.getPixelDimensions(s.width,s.height,1,Pt),p=Tt;return p.right=.5*h.x,p.left=-p.right,p.top=.5*h.y,p.bottom=-p.top,p.near=a.near,p.far=a.far,p.computeCullingVolume(d,o.directionWC,o.upWC)}function et(e,t,i,r){var n=e._camera,o=n.frustum,a=o.near,s=Math.tan(.5*o.fovy),l=o.aspectRatio*s,u=e._passState.viewport,c=2*(t.x-u.x)/u.width-1,d=2*(u.height-t.y-u.y)/u.height-1,h=c*a*l,p=d*a*s,f=o.getPixelDimensions(u.width,u.height,1,Pt),m=f.x*i*.5,_=f.y*r*.5,g=Dt;return g.top=p+_,g.bottom=p-_,g.right=h+m,g.left=h-m,g.near=a,g.far=o.far,g.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function tt(e,t,i,r){return e._mode===de.SCENE2D?$e(e,t,i,r):et(e,t,i,r)}function it(e,t){var i=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!d(i)){for(var r=t._attributeLocations,n=t.fragmentShaderSource,o=!1,a=n.sources,s=a.length,l=0;l<s;++l)if(Bt.test(a[l])||Ft.test(a[l])){o=!0;break}o||(n=new G({sources:["void main() { gl_FragColor = vec4(1.0); }"]})),i=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:n,attributeLocations:r})}return i}function rt(e,t){var i=e._depthOnlyRenderStateCache,r=i[t.id];if(!d(r)){var n=z.getState(t);n.depthMask=!0,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},r=z.fromCache(n),i[t.id]=r}return r}function nt(e,t,i,r){d(r)||(r={});var n,o;return d(r.depthOnlyCommand)&&(n=r.depthOnlyCommand.shaderProgram,o=r.depthOnlyCommand.renderState),r.depthOnlyCommand=L.shallowClone(t,r.depthOnlyCommand),d(n)&&r.shaderProgramId===t.shaderProgram.id?(r.depthOnlyCommand.shaderProgram=n,r.depthOnlyCommand.renderState=o):(r.depthOnlyCommand.shaderProgram=it(i,t.shaderProgram),r.depthOnlyCommand.renderState=rt(e,t.renderState),r.shaderProgramId=t.shaderProgram.id),r}function ot(t,i){var r=t._context,n=t._frameState;Ee(n.passes),n.passes.pick=!0,n.passes.depth=!0,n.cullingVolume=tt(t,i,1,1);var o=t._pickDepthPassState;d(o)||(o=t._pickDepthPassState=new k(r),o.scissorTest={enabled:!0,rectangle:new e},o.viewport=new e);var a=r.drawingBufferWidth,s=r.drawingBufferHeight,l=t._pickDepthFramebuffer,u=t._pickDepthFramebufferWidth,c=t._pickDepthFramebufferHeight;d(l)&&u===a&&c===s||(t._pickDepthFramebuffer=t._pickDepthFramebuffer&&t._pickDepthFramebuffer.destroy(),l=t._pickDepthFramebuffer=new B({context:r,depthStencilTexture:new H({context:r,width:a,height:s,pixelFormat:P.DEPTH_STENCIL,pixelDatatype:V.UNSIGNED_INT_24_8})}),t._pickDepthFramebufferWidth=a,t._pickDepthFramebufferHeight=s),o.framebuffer=l,o.viewport.width=a,o.viewport.height=s,o.scissorTest.rectangle.x=i.x,o.scissorTest.rectangle.y=s-i.y,o.scissorTest.rectangle.width=1,o.scissorTest.rectangle.height=1,Ge(t,o,Nt),Ke(t,o),r.endFrame()}var at=.99;h(ve.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 N.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return N.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._camera}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},frameState:{get:function(){return this._frameState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){return this.globe.imageryLayers}},terrainProvider:{get:function(){return this.globe.terrainProvider},set:function(e){this.globe.terrainProvider=e}},terrainProviderChanged:{get:function(){return this.globe.terrainProviderChanged}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return d(this._oit)}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===de.SCENE2D?this.morphTo2D(0):e===de.SCENE3D?this.morphTo3D(0):e===de.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},numberOfFrustums:{get:function(){return this._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 W(this),d(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Z(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}}}),ve.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};var st,lt=new n,ut=new n,ct=new t,dt=new j,ht=new S,pt=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);pt=T.inverseTransformation(pt,pt);var ft=new ae,mt=new se,_t=new re,gt=new a(Math.PI,b.PI_OVER_TWO),vt=new n,yt=new n,Ct=new T,wt=new T,St=new n,Et=new n;ve.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._tweens.update(),this._screenSpaceCameraController.update(),d(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this._camera.update(this._mode),this._camera._updateCameraChanged()};var bt=new n;ve.prototype.render=function(e){try{Je(this,e)}catch(e){if(this._renderError.raiseEvent(this,e),this.rethrowRenderErrors)throw e}},ve.prototype.clampLineWidth=function(e){return Math.max(N.minimumAliasedLineWidth,Math.min(e,N.maximumAliasedLineWidth))};var Tt=new re,xt=new n,At=new n,Pt=new r,Mt=new T,Dt=new se,It=3,Rt=3,Ot=new e(0,0,It,Rt),Nt=new s(0,0,0,0),Lt=new r;ve.prototype.pick=function(e){var t=this._context,i=t.uniformState,r=this._frameState,n=he.transformWindowToDrawingBuffer(this,e,Lt);d(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),be(this,r.frameNumber,r.time),r.cullingVolume=tt(this,n,It,Rt),r.passes.pick=!0,i.update(r),Ot.x=n.x-.5*(It-1),Ot.y=this.drawingBufferHeight-n.y-.5*(Rt-1);var o=this._pickFramebuffer.begin(Ot);Ge(this,o,Nt),Ke(this,o);var a=this._pickFramebuffer.end(Ot);return t.endFrame(),Qe(r),a};var Bt=/\bgl_FragDepthEXT\b/,Ft=/\bdiscard\b/,kt=new o,Vt=new o(1,1/255,1/65025,1/16581375);ve.prototype.pickPositionWorldCoordinates=function(e,t){if(this.useDepthPicking){var i=this._context,r=i.uniformState,n=he.transformWindowToDrawingBuffer(this,e,Lt);this.pickTranslucentDepth&&ot(this,n),n.y=this.drawingBufferHeight-n.y;var a,s=this._camera;a=d(s.frustum.fov)?s.frustum.clone(ft):d(s.frustum.infiniteProjectionMatrix)?s.frustum.clone(mt):s.frustum.clone(_t);for(var l=this.numberOfFrustums,u=0;u<l;++u){var c=Be(this,u),h=i.readPixels({x:n.x,y:n.y,width:1,height:1,framebuffer:c.framebuffer}),p=o.unpack(h,0,kt);o.divideByScalar(p,255,p);var f=o.dot(p,Vt);if(f>0&&f<1){var m,_=this._frustumCommandsList[u];return this.mode===de.SCENE2D?(m=s.position.z,s.position.z=m-_.near+1,a.far=Math.max(1,_.far-_.near),a.near=1,r.update(this.frameState),r.updateFrustum(a)):(a.near=_.near*(0!==u?at:1),a.far=_.far,r.updateFrustum(a)),t=he.drawingBufferToWgs84Coordinates(this,n,f,t),this.mode===de.SCENE2D&&(s.position.z=m,r.update(this.frameState)),t}}}};var zt=new a;return ve.prototype.pickPosition=function(e,t){if(t=this.pickPositionWorldCoordinates(e,t),d(t)&&this.mode!==de.SCENE3D){n.fromElements(t.y,t.z,t.x,t);var i=this.mapProjection,r=i.ellipsoid,o=i.unproject(t,zt);r.cartographicToCartesian(o,t)}return t},ve.prototype.drillPick=function(e,t){var i,r,n=[],o=[],a=[];d(t)||(t=Number.MAX_VALUE);for(var s=this.pick(e);d(s)&&d(s.primitive)&&(n.push(s),!(0>=--t));){var l=s.primitive,u=!1;"function"==typeof l.getGeometryInstanceAttributes&&d(s.id)&&(r=l.getGeometryInstanceAttributes(s.id),d(r)&&d(r.show)&&(u=!0,r.show=M.toValue(!1,r.show),a.push(r))),u||(l.show=!1,o.push(l)),s=this.pick(e)}for(i=0;i<o.length;++i)o[i].show=!0;for(i=0;i<a.length;++i)r=a[i],r.show=M.toValue(!0,r.show);return n},ve.prototype.completeMorph=function(){this._transitioner.completeMorph()},ve.prototype.morphTo2D=function(e){var t,i=this.globe;t=d(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo2D(e,t)},ve.prototype.morphToColumbusView=function(e){var t,i=this.globe;t=d(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphToColumbusView(e,t)},ve.prototype.morphTo3D=function(e){var t,i=this.globe;t=d(i)?i.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo3D(e,t)},ve.prototype.isDestroyed=function(){return!1},ve.prototype.destroy=function(){return 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._pickFramebuffer=this._pickFramebuffer&&this._pickFramebuffer.destroy(),this._pickDepthFramebuffer=this._pickDepthFramebuffer&&this._pickDepthFramebuffer.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.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),d(this._globeDepth)&&this._globeDepth.destroy(),d(this._oit)&&this._oit.destroy(),this._fxaa.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay.destroy(),d(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),p(this)},ve}),define("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadImage","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/when"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(r){function n(e){w._image=e,w._tileWidth=e.width,w._tileHeight=e.height,w._ready=!0,w._readyPromise.resolve(!0),c.handleSuccess(w._errorEvent)}function h(e){var t="Failed to load image "+v+".";C=c.handleError(C,w,w._errorEvent,t,0,0,0,p,e),w._readyPromise.reject(new u(t))}function p(){d(s(v),n,h)}r=t(r,{});var f=r.url;this._url=f;var m=r.proxy;this._proxy=m;var _=t(r.rectangle,l.MAX_VALUE),g=new a({rectangle:_,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:r.ellipsoid});this._tilingScheme=g,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1,this._readyPromise=d.defer();var v=f;i(m)&&(v=m.getURL(v));var y=r.credit;"string"==typeof y&&(y=new e(y)),this._credit=y;var C,w=this;p()}return r(h.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._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}}}),h.prototype.getTileCredits=function(e,t,i){},h.prototype.requestImage=function(e,t,i){return this._image},h.prototype.pickFeatures=function(e,t,i,r,n){},h}),define("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\nconst float g = -0.95;\nconst float g2 = g * g;\nconst vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nconst vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\n#ifdef COLOR_CORRECT\nvec3 rgb2hsb(vec3 rgbColor)\n{\nvec4 p = mix(vec4(rgbColor.bg, K_RGB2HSB.wz), vec4(rgbColor.gb, K_RGB2HSB.xy), step(rgbColor.b, rgbColor.g));\nvec4 q = mix(vec4(p.xyw, rgbColor.r), vec4(rgbColor.r, p.yzx), step(p.x, rgbColor.r));\nfloat d = q.x - min(q.w, q.y);\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\nvec3 hsb2rgb(vec3 hsbColor)\n{\nvec3 p = abs(fract(hsbColor.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\nreturn hsbColor.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsbColor.y);\n}\n#endif\nvoid main (void)\n{\nfloat cosAngle = dot(czm_sunDirectionWC, 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);\nconst float exposure = 2.0;\nvec3 rgb = rayleighPhase * v_rayleighColor + miePhase * v_mieColor;\nrgb = vec3(1.0) - exp(-exposure * rgb);\nfloat l = czm_luminance(rgb);\n#ifdef COLOR_CORRECT\nvec3 hsb = rgb2hsb(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 = hsb2rgb(hsb);\nl = min(l, czm_luminance(rgb));\n#endif\ngl_FragColor = vec4(rgb, min(smoothstep(0.0, 0.1, l), 1.0) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n"}),define("Shaders/SkyAtmosphereVS",[],function(){"use strict";return"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 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);\nvec3 lightDir = (u_cameraAndRadiiAndDynamicAtmosphereColor.w > 0.0) ? czm_sunPositionWC - czm_viewerPositionWC : czm_viewerPositionWC;\nlightDir = normalize(lightDir);\nfor(int i=0; i<nSamples; i++)\n{\nfloat height = length(samplePoint);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - height));\nfloat fLightAngle = dot(lightDir, 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"}),define("Scene/SkyAtmosphere",["../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/EllipsoidGeometry","../Core/GeometryPipeline","../Core/Math","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/SkyAtmosphereFS","../Shaders/SkyAtmosphereVS","./BlendingState","./CullFace","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w){"use strict";function S(r){r=i(r,a.WGS84),this.show=!0,this._ellipsoid=r,this._command=new h({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 e;var n=new t;n.w=0,n.y=e.maximumComponent(e.multiplyByScalar(r.radii,1.025,new e)),n.z=r.maximumRadius,this._cameraAndRadiiAndDynamicAtmosphereColor=n;var o=this;this._command.uniformMap={u_cameraAndRadiiAndDynamicAtmosphereColor:function(){return o._cameraAndRadiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness}}}function E(e){return!(u.equalsEpsilon(e.hueShift,0,u.EPSILON7)&&u.equalsEpsilon(e.saturationShift,0,u.EPSILON7)&&u.equalsEpsilon(e.brightnessShift,0,u.EPSILON7))}return n(S.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),S.prototype.setDynamicAtmosphereColor=function(e){this._cameraAndRadiiAndDynamicAtmosphereColor.w=e?1:0},S.prototype.update=function(t){if(this.show&&(t.mode===w.SCENE3D||t.mode===w.MORPHING)&&t.passes.render){var i=this._command;if(!r(i.vertexArray)){var n=t.context,o=s.createGeometry(new s({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:c.POSITION_ONLY}));i.vertexArray=_.fromGeometry({context:n,geometry:o,attributeLocations:l.createAttributeLocations(o),bufferUsage:d.STATIC_DRAW}),i.renderState=p.fromCache({cull:{enabled:!0,face:C.FRONT},blending:y.ALPHA_BLEND});var a=new m({defines:["SKY_FROM_SPACE"],sources:[v]});this._spSkyFromSpace=f.fromCache({context:n,vertexShaderSource:a,fragmentShaderSource:g}),a=new m({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphere=f.fromCache({context:n,vertexShaderSource:a,fragmentShaderSource:g})}var u=E(this);if(u&&(!r(this._spSkyFromSpaceColorCorrect)||!r(this._spSkyFromAtmosphereColorCorrect))){var h=t.context,S=new m({defines:["SKY_FROM_SPACE"],sources:[v]}),b=new m({defines:["COLOR_CORRECT"],sources:[g]});this._spSkyFromSpaceColorCorrect=f.fromCache({context:h,vertexShaderSource:S,fragmentShaderSource:b}),S=new m({defines:["SKY_FROM_ATMOSPHERE"],sources:[v]}),this._spSkyFromAtmosphereColorCorrect=f.fromCache({context:h,vertexShaderSource:S,fragmentShaderSource:b})}var T=t.camera.positionWC,x=e.magnitude(T);return this._cameraAndRadiiAndDynamicAtmosphereColor.x=x,x>this._cameraAndRadiiAndDynamicAtmosphereColor.y?i.shaderProgram=u?this._spSkyFromSpaceColorCorrect:this._spSkyFromSpace:i.shaderProgram=u?this._spSkyFromAtmosphereColorCorrect:this._spSkyFromAtmosphere,i}},S.prototype.isDestroyed=function(){return!1},S.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(),o(this)},S}),define("Shaders/SkyBoxFS",[],function(){"use strict";return"uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 rgb = textureCube(u_cubeMap, normalize(v_texCoord)).rgb;\ngl_FragColor = vec4(rgb, czm_morphTime);\n}\n"}),define("Shaders/SkyBoxVS",[],function(){"use strict";return"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"}),define("Scene/SkyBox",["../Core/BoxGeometry","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryPipeline","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/loadCubeMap","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/SkyBoxFS","../Shaders/SkyBoxVS","./BlendingState","./SceneMode"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y){"use strict";function C(e){this.sources=e.sources,this._sources=void 0,this.show=i(e.show,!0),this._command=new d({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0}return C.prototype.update=function(i){if(this.show&&(i.mode===y.SCENE3D||i.mode===y.MORPHING)&&i.passes.render){var n=i.context;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;"string"==typeof o.positiveX?h(n,this._sources).then(function(e){d._cubeMap=d._cubeMap&&d._cubeMap.destroy(),d._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new c({context:n,source:o}))}var s=this._command;if(!r(s.vertexArray)){var d=this;s.uniformMap={u_cubeMap:function(){return d._cubeMap}};var C=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),w=a.createAttributeLocations(C);s.vertexArray=m.fromGeometry({context:n,geometry:C,attributeLocations:w,bufferUsage:u.STATIC_DRAW}),s.shaderProgram=f.fromCache({context:n,vertexShaderSource:g,fragmentShaderSource:_,attributeLocations:w}),s.renderState=p.fromCache({blending:v.ALPHA_BLEND})}if(r(this._cubeMap))return s}},C.prototype.isDestroyed=function(){return!1},C.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(),n(this)},C}),define("Shaders/SunFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),define("Shaders/SunTextureFS",[],function(){"use strict";return"uniform float u_glowLengthTS;\nuniform 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)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition);\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position);\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(1.0, 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));\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348));\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754));\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924));\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239));\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678));\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n"}),define("Shaders/SunVS",[],function(){"use strict";return"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"}),define("Scene/Sun",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/VertexArray","../Shaders/SunFS","../Shaders/SunTextureFS","../Shaders/SunVS","./BlendingState","./SceneMode","./SceneTransforms"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x){"use strict";function A(){this.show=!0,this._drawCommand=new _({primitiveType:h.TRIANGLES,boundingVolume:new e,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new e,this._boundingVolume2D=new e,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;var t=this;this._uniformMap={u_texture:function(){return t._texture},u_size:function(){return t._size}}}a(A.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var P=new t,M=new t,D=new r,I=new r;return A.prototype.update=function(r){var a=r._passState,s=r.frameState,h=r.context;if(this.show){var _=s.mode;if(_!==T.SCENE2D&&_!==T.MORPHING&&s.passes.render){var A=a.viewport.width,R=a.viewport.height;if(!o(this._texture)||A!==this._drawingBufferWidth||R!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=A,this._drawingBufferHeight=R,this._glowFactorDirty=!1;var O=Math.max(A,R);O=Math.pow(2,Math.ceil(Math.log(O)/Math.log(2))-2),O=Math.max(1,O),this._texture=new y({context:h,width:O,height:O,pixelFormat:d.RGBA}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var N=this,L={u_glowLengthTS:function(){return N._glowLengthTS},u_radiusTS:function(){return N._radiusTS}};this._commands.computeCommand=new m({fragmentShaderSource:S,outputTexture:this._texture,uniformMap:L,persists:!1,owner:this,postExecute:function(){N._commands.computeCommand=void 0}})}var B=this._drawCommand;if(!o(B.vertexArray)){var F={direction:0},k=new Uint8Array(8);k[0]=0,k[1]=0,k[2]=255,k[3]=0,k[4]=255,k[5]=255,k[6]=0,k[7]=255;var V=p.createVertexBuffer({context:h,typedArray:k,usage:f.STATIC_DRAW}),z=[{index:F.direction,vertexBuffer:V,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE}],U=p.createIndexBuffer({context:h,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:f.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});B.vertexArray=new C({context:h,attributes:z,indexBuffer:U}),B.shaderProgram=v.fromCache({context:h,vertexShaderSource:E,fragmentShaderSource:w,attributeLocations:F}),B.renderState=g.fromCache({blending:b.ALPHA_BLEND}),B.uniformMap=this._uniformMap}var G=h.uniformState.sunPositionWC,H=h.uniformState.sunPositionColumbusView,W=this._boundingVolume,q=this._boundingVolume2D;i.clone(G,W.center),q.center.x=H.z,q.center.y=H.x,q.center.z=H.y,W.radius=u.SOLAR_RADIUS+u.SOLAR_RADIUS*this._glowLengthTS,q.radius=W.radius,_===T.SCENE3D?e.clone(W,B.boundingVolume):_===T.COLUMBUS_VIEW&&e.clone(q,B.boundingVolume);var j=x.computeActualWgs84Position(s,G,I),Y=i.magnitude(i.subtract(j,r.camera.position,I)),X=h.uniformState.projection,Z=D;Z.x=0,Z.y=0,Z.z=-Y,Z.w=1;var K=c.multiplyByVector(X,Z,I),Q=x.clipToDrawingBufferCoordinates(a.viewport,K,P);Z.x=u.SOLAR_RADIUS;var J=c.multiplyByVector(X,Z,I),$=x.clipToDrawingBufferCoordinates(a.viewport,J,M);return this._size=Math.ceil(t.magnitude(t.subtract($,Q,I))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},A.prototype.isDestroyed=function(){return!1},A.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(),s(this)},A}),define("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,i,r,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT),this._tilingScheme=i(r.tilingScheme)?r.tilingScheme:new o({ellipsoid:r.ellipsoid}),this._color=t(r.color,e.YELLOW),this._errorEvent=new n,this._tileWidth=t(r.tileWidth,256),this._tileHeight=t(r.tileHeight,256),this._readyPromise=a.resolve(!0)}return r(s.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}}}),s.prototype.getTileCredits=function(e,t,i){},s.prototype.requestImage=function(e,t,i){var r=document.createElement("canvas");r.width=256,r.height=256;var n=r.getContext("2d"),o=this._color.toCssColorString();n.strokeStyle=o,n.lineWidth=2,n.strokeRect(1,1,255,255);var a="L"+i+"X"+e+"Y"+t;return n.font="bold 25px Arial",n.textAlign="center",n.fillStyle="black",n.fillText(a,127,127),n.fillStyle=o,n.fillText(a,124,124),r},s.prototype.pickFeatures=function(e,t,i,r,n){},s}),define("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";function t(t){e.throwInstantiationError()}return t.prototype.isReady=e.throwInstantiationError,t.prototype.shouldDiscardImage=e.throwInstantiationError,t}),define("Scene/TileState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};return e(t)}),define("Shaders/ViewportQuadFS",[],function(){"use strict";return"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"}),define("Scene/ViewportQuad",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(r,n){this.show=!0,i(r)||(r=new e),this.rectangle=e.clone(r),i(n)||(n=c.fromType(c.ColorType,{color:new t(1,1,1,1)})),this.material=n,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}return d.prototype.update=function(t){if(this.show){var r=this._rs;i(r)&&e.equals(r.viewport,this.rectangle)||(this._rs=a.fromCache({blending:u.ALPHA_BLEND,viewport:this.rectangle}));var n=t.passes;if(n.render){var c=t.context;if(this._material!==this.material||!i(this._overlayCommand)){this._material=this.material,i(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var d=new s({sources:[this._material.shaderSource,l]});this._overlayCommand=c.createViewportQuadCommand(d,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=o.OVERLAY}this._material.update(c),this._overlayCommand.uniformMap=this._material._uniforms,t.commandList.push(this._overlayCommand)}}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return i(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),r(this)},d}),define("Scene/WebMapServiceImageryProvider",["../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/objectToQuery","../Core/queryToObject","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","./GetFeatureInfoFormat","./UrlTemplateImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h){"use strict";function p(r){function n(e,t){i(m[e])||(m[e]=t),i(v)&&!i(v[e])&&(v[e]=t)}r=t(r,t.EMPTY_OBJECT),this._url=r.url,this._layers=r.layers;var o=t(r.getFeatureInfoFormats,p.DefaultGetFeatureInfoFormats),d=new c(r.url),m=l(t(d.query,"")),_=e(f(t(r.parameters,t.EMPTY_OBJECT)),p.DefaultParameters);m=e(_,m);var g,v;g=new c(r.url),v=l(t(g.query,""));var y=e(f(t(r.getFeatureInfoParameters,t.EMPTY_OBJECT)),p.GetFeatureInfoDefaultParameters);v=e(y,v),n("layers",r.layers),parseFloat(_.version)>=1.3?n("crs",r.tilingScheme instanceof u?"EPSG:3857":"CRS:84"):n("srs",r.tilingScheme instanceof u?"EPSG:3857":"EPSG:4326"),n("bbox","{westProjected},{southProjected},{eastProjected},{northProjected}"),n("width","{width}"),n("height","{height}"),d.query=s(m);var C,w=d.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");i(v)&&(i(v.query_layers)||(v.query_layers=r.layers),i(v.x)||(v.x="{i}"),i(v.y)||(v.y="{j}"),i(v.info_format)||(v.info_format="{format}"),g.query=s(v),C=g.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")),this._tileProvider=new h({url:w,pickFeaturesUrl:C,tilingScheme:t(r.tilingScheme,new a({ellipsoid:r.ellipsoid})),rectangle:r.rectangle,tileWidth:r.tileWidth,tileHeight:r.tileHeight,minimumLevel:r.minimumLevel,maximumLevel:r.maximumLevel,proxy:r.proxy,subdomains:r.subdomains,tileDiscardPolicy:r.tileDiscardPolicy,credit:r.credit,getFeatureInfoFormats:o,enablePickFeatures:r.enablePickFeatures})}function f(e){var t={};for(var i in e)e.hasOwnProperty(i)&&(t[i.toLowerCase()]=e[i]);return t}return r(p.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._tileProvider.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}}}),p.prototype.getTileCredits=function(e,t,i){return this._tileProvider.getTileCredits(e,t,i)},p.prototype.requestImage=function(e,t,i){return this._tileProvider.requestImage(e,t,i)},p.prototype.pickFeatures=function(e,t,i,r,n){return this._tileProvider.pickFeatures(e,t,i,r,n)},p.DefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),p.GetFeatureInfoDefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),p.DefaultGetFeatureInfoFormats=o([o(new d("json","application/json")),o(new d("xml","text/xml")),o(new d("text","text/html"))]),p}),define("Scene/WebMapTileServiceImageryProvider",["../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/isArray","../Core/objectToQuery","../Core/queryToObject","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","../ThirdParty/when","./ImageryProvider"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function _(e){e=i(e,i.EMPTY_OBJECT),this._url=e.url,this._layer=e.layer,this._style=e.style,this._tileMatrixSetID=e.tileMatrixSetID,this._tileMatrixLabels=e.tileMatrixLabels,this._format=i(e.format,"image/jpeg"),this._proxy=e.proxy,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=r(e.tilingScheme)?e.tilingScheme:new h({ellipsoid:e.ellipsoid}),this._tileWidth=i(e.tileWidth,256),this._tileHeight=i(e.tileHeight,256),this._minimumLevel=i(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=i(e.rectangle,this._tilingScheme.rectangle),this._readyPromise=f.resolve(!0);var n=this._tilingScheme.positionToTileXY(d.southwest(this._rectangle),this._minimumLevel),o=this._tilingScheme.positionToTileXY(d.northeast(this._rectangle),this._minimumLevel);(Math.abs(o.x-n.x)+1)*(Math.abs(o.y-n.y)+1);this._errorEvent=new a;var s=e.credit;this._credit="string"==typeof s?new t(s):s,this._subdomains=e.subdomains,l(this._subdomains)?this._subdomains=this._subdomains.slice():r(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function g(t,n,o,a){var s,l=t._tileMatrixLabels,d=r(l)?l[a]:a.toString(),h=t._subdomains;if(t._url.indexOf("{")>=0)s=t._url.replace("{style}",t._style).replace("{Style}",t._style).replace("{TileMatrixSet}",t._tileMatrixSetID).replace("{TileMatrix}",d).replace("{TileRow}",o.toString()).replace("{TileCol}",n.toString()).replace("{s}",h[(n+o+a)%h.length]);else{var f=new p(t._url),m=c(i(f.query,""));m=e(v,m),m.tilematrix=d,m.layer=t._layer,m.style=t._style,m.tilerow=o,m.tilecol=n,m.tilematrixset=t._tileMatrixSetID,m.format=t._format,f.query=u(m),s=f.toString()}var _=t._proxy;return r(_)&&(s=_.getURL(s)),s}var v=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._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}}}),_.prototype.getTileCredits=function(e,t,i){},_.prototype.requestImage=function(e,t,i){var r=g(this,e,t,i);return m.loadImage(this,r)},_.prototype.pickFeatures=function(e,t,i,r,n){},_}),define("ThirdParty/crunch",[],function(){function globalEval(e){eval.call(null,e)}function assert(e,t){e||abort("Assertion failed: "+t)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,t,i,r){switch(i=i||"i8","*"===i.charAt(i.length-1)&&(i="i32"),i){case"i1":HEAP8[e>>0]=t;break;case"i8":HEAP8[e>>0]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;default:abort("invalid type for setValue: "+i)}}function getValue(e,t,i){switch(t=t||"i8","*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":return HEAP8[e>>0];case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+t)}return null}function allocate(e,t,i,r){var n,o;"number"==typeof e?(n=!0,o=e):(n=!1,o=e.length);var a,s="string"==typeof t?t:null;if(a=i==ALLOC_NONE?r:[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===i?ALLOC_STATIC:i](Math.max(o,s?1:t.length)),n){var l,r=a;for(assert(0==(3&a)),l=a+(o&-4);r<l;r+=4)HEAP32[r>>2]=0;for(l=a+o;r<l;)HEAP8[r++>>0]=0;return a}if("i8"===s)return e.subarray||e.slice?HEAPU8.set(e,a):HEAPU8.set(new Uint8Array(e),a),a;for(var u,c,d,h=0;h<o;){var p=e[h];"function"==typeof p&&(p=Runtime.getFunctionIndex(p)),u=s||t[h],0!==u?("i64"==u&&(u="i32"),setValue(a+h,p,u),d!==u&&(c=Runtime.getNativeTypeSize(u),d=u),h+=c):h++}return a}function getMemory(e){return staticSealed?"undefined"!=typeof _sbrk&&!_sbrk.called||!runtimeInitialized?Runtime.dynamicAlloc(e):_malloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,t){if(0===t||!e)return"";for(var i,r=0,n=0;;){if(i=HEAPU8[e+n>>0],r|=i,0==i&&!t)break;if(n++,t&&n==t)break}t||(t=n);var o="";if(r<128){for(var a,s=1024;t>0;)a=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(t,s))),o=o?o+a:a,e+=s,t-=s;return o}return Module.UTF8ToString(e)}function AsciiToString(e){for(var t="";;){var i=HEAP8[e++>>0];if(!i)return t;t+=String.fromCharCode(i)}}function stringToAscii(e,t){return writeAsciiToMemory(e,t,!1)}function UTF8ArrayToString(e,t){for(var i,r,n,o,a,s,l="";;){if(i=e[t++],!i)return l;if(128&i)if(r=63&e[t++],192!=(224&i))if(n=63&e[t++],224==(240&i)?i=(15&i)<<12|r<<6|n:(o=63&e[t++],240==(248&i)?i=(7&i)<<18|r<<12|n<<6|o:(a=63&e[t++],248==(252&i)?i=(3&i)<<24|r<<18|n<<12|o<<6|a:(s=63&e[t++],i=(1&i)<<30|r<<24|n<<18|o<<12|a<<6|s))),i<65536)l+=String.fromCharCode(i);else{var u=i-65536;l+=String.fromCharCode(55296|u>>10,56320|1023&u)}else l+=String.fromCharCode((31&i)<<6|r);else l+=String.fromCharCode(i)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,t,i,r){if(!(r>0))return 0;for(var n=i,o=i+r-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(i>=o)break;t[i++]=s}else if(s<=2047){if(i+1>=o)break;t[i++]=192|s>>6,t[i++]=128|63&s}else if(s<=65535){if(i+2>=o)break;t[i++]=224|s>>12,t[i++]=128|s>>6&63,t[i++]=128|63&s}else if(s<=2097151){if(i+3>=o)break;t[i++]=240|s>>18,t[i++]=128|s>>12&63,t[i++]=128|s>>6&63,t[i++]=128|63&s}else if(s<=67108863){if(i+4>=o)break;t[i++]=248|s>>24,t[i++]=128|s>>18&63,t[i++]=128|s>>12&63,t[i++]=128|s>>6&63,t[i++]=128|63&s}else{if(i+5>=o)break;t[i++]=252|s>>30,t[i++]=128|s>>24&63,t[i++]=128|s>>18&63,t[i++]=128|s>>12&63,t[i++]=128|s>>6&63,t[i++]=128|63&s}}return t[i]=0,i-n}function stringToUTF8(e,t,i){return stringToUTF8Array(e,HEAPU8,t,i)}function lengthBytesUTF8(e){for(var t=0,i=0;i<e.length;++i){var r=e.charCodeAt(i);r>=55296&&r<=57343&&(r=65536+((1023&r)<<10)|1023&e.charCodeAt(++i)),r<=127?++t:t+=r<=2047?2:r<=65535?3:r<=2097151?4:r<=67108863?5:6}return t}function UTF16ToString(e){for(var t=0,i="";;){var r=HEAP16[e+2*t>>1];if(0==r)return i;++t,i+=String.fromCharCode(r)}}function stringToUTF16(e,t,i){if(void 0===i&&(i=2147483647),i<2)return 0;i-=2;for(var r=t,n=i<2*e.length?i/2:e.length,o=0;o<n;++o){var a=e.charCodeAt(o);HEAP16[t>>1]=a,t+=2}return HEAP16[t>>1]=0,t-r}function lengthBytesUTF16(e){return 2*e.length}function UTF32ToString(e){for(var t=0,i="";;){var r=HEAP32[e+4*t>>2];if(0==r)return i;if(++t,r>=65536){var n=r-65536;i+=String.fromCharCode(55296|n>>10,56320|1023&n)}else i+=String.fromCharCode(r)}}function stringToUTF32(e,t,i){if(void 0===i&&(i=2147483647),i<4)return 0;for(var r=t,n=r+i-4,o=0;o<e.length;++o){var a=e.charCodeAt(o);if(a>=55296&&a<=57343){var s=e.charCodeAt(++o);a=65536+((1023&a)<<10)|1023&s}if(HEAP32[t>>2]=a,t+=4,t+4>n)break}return HEAP32[t>>2]=0,t-r}function lengthBytesUTF32(e){for(var t=0,i=0;i<e.length;++i){var r=e.charCodeAt(i);r>=55296&&r<=57343&&++i,t+=4}return t}function demangle(e){function t(){s++,"K"===e[s]&&s++;for(var t=[];"E"!==e[s];)if("S"!==e[s])if("C"!==e[s]){var i=parseInt(e.substr(s)),r=i.toString().length;if(!i||!r){s--;break}var n=e.substr(s+r,i);t.push(n),u.push(n),s+=r+i}else t.push(t[t.length-1]),s+=2;else{s++;var o=e.indexOf("_",s),a=e.substring(s,o)||0;t.push(u[a]||"?"),s=o+1}return s++,t}function i(r,n,o){function a(){return"("+h.join(", ")+")"}n=n||1/0;var u,d="",h=[];if("N"===e[s]){if(u=t().join("::"),n--,0===n)return r?[u]:u}else{("K"===e[s]||c&&"L"===e[s])&&s++;var p=parseInt(e.substr(s));if(p){var f=p.toString().length;u=e.substr(s+f,p),s+=f+p}}if(c=!1,"I"===e[s]){s++;var m=i(!0),_=i(!0,1,!0);d+=_[0]+" "+u+"<"+m.join(", ")+">"}else d=u;e:for(;s<e.length&&n-- >0;){var g=e[s++];if(g in l)h.push(l[g]);else switch(g){case"P":h.push(i(!0,1,!0)[0]+"*");break;case"R":h.push(i(!0,1,!0)[0]+"&");break;case"L":s++;var v=e.indexOf("E",s),p=v-s;h.push(e.substr(s,p)),s+=p+2;break;case"A":var p=parseInt(e.substr(s));if(s+=p.toString().length,"_"!==e[s])throw"?";s++,h.push(i(!0,1,!0)[0]+" ["+p+"]");break;case"E":break e;default:d+="?"+g;break e}}return o||1!==h.length||"void"!==h[0]||(h=[]),r?(d&&h.push(d+"?"),h):d+a()}var r=!!Module.___cxa_demangle;if(r)try{var n=_malloc(e.length);writeStringToMemory(e.substr(1),n);var o=_malloc(4),a=Module.___cxa_demangle(n,0,0,o);if(0===getValue(o,"i32")&&a)return Pointer_stringify(a)}catch(e){}finally{n&&_free(n),o&&_free(o),a&&_free(a)}var s=3,l={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},u=[],c=!0,d=e;try{if("Object._main"==e||"_main"==e)return"main()";if("number"==typeof e&&(e=Pointer_stringify(e)),"_"!==e[0])return e;if("_"!==e[1])return e;if("Z"!==e[2])return e;switch(e[3]){case"n":return"operator new()";case"d":return"operator delete()"}d=i()}catch(e){d+="?"}return d.indexOf("?")>=0&&!r&&Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),d}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,function(e){var t=demangle(e);return e===t?e:e+" ["+t+"]"})}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){return demangleAll(jsStackTrace())}function alignMemoryPage(e){return e%4096>0&&(e+=4096-e%4096),e}function enlargeMemory(){var e=Math.pow(2,31);if(DYNAMICTOP>=e)return!1;for(;TOTAL_MEMORY<=DYNAMICTOP;)if(TOTAL_MEMORY<e/2)TOTAL_MEMORY=alignMemoryPage(2*TOTAL_MEMORY);else{var t=TOTAL_MEMORY;if(TOTAL_MEMORY=alignMemoryPage((3*TOTAL_MEMORY+e)/4),TOTAL_MEMORY<=t)return!1}if(TOTAL_MEMORY=Math.max(TOTAL_MEMORY,16777216),TOTAL_MEMORY>=e)return!1;try{if(ArrayBuffer.transfer)buffer=ArrayBuffer.transfer(buffer,TOTAL_MEMORY);else{var i=HEAP8;buffer=new ArrayBuffer(TOTAL_MEMORY)}}catch(e){return!1}var r=_emscripten_replace_memory(buffer);return!!r&&(Module.buffer=buffer,Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer),ArrayBuffer.transfer||HEAP8.set(i),!0)}function callRuntimeCallbacks(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var i=t.func;"number"==typeof i?void 0===t.arg?Runtime.dynCall("v",i):Runtime.dynCall("vi",i,[t.arg]):i(void 0===t.arg?null:t.arg)}else t()}}function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,t,i){var r=i>0?i:lengthBytesUTF8(e)+1,n=new Array(r),o=stringToUTF8Array(e,n,0,n.length);return t&&(n.length=o),n}function intArrayToString(e){for(var t=[],i=0;i<e.length;i++){var r=e[i];r>255&&(r&=255),t.push(String.fromCharCode(r))}return t.join("")}function writeStringToMemory(e,t,i){for(var r=intArrayFromString(e,i),n=0;n<r.length;){var o=r[n];HEAP8[t+n>>0]=o,n+=1}}function writeArrayToMemory(e,t){for(var i=0;i<e.length;i++)HEAP8[t++>>0]=e[i]}function writeAsciiToMemory(e,t,i){for(var r=0;r<e.length;++r)HEAP8[t++>>0]=e.charCodeAt(r);i||(HEAP8[t>>0]=0)}function unSign(e,t,i){return e>=0?e:t<=32?2*Math.abs(1<<t-1)+e:Math.pow(2,t)+e}function reSign(e,t,i){if(e<=0)return e;var r=t<=32?Math.abs(1<<t-1):Math.pow(2,t-1);return e>=r&&(t<=32||e>r)&&(e=-2*r+e),e}function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function copyTempFloat(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3]}function copyTempDouble(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3],HEAP8[tempDoublePtr+4]=HEAP8[e+4],HEAP8[tempDoublePtr+5]=HEAP8[e+5],HEAP8[tempDoublePtr+6]=HEAP8[e+6],HEAP8[tempDoublePtr+7]=HEAP8[e+7]}function _pthread_cleanup_push(e,t){__ATEXIT__.push(function(){Runtime.dynCall("vi",e,[t])}),_pthread_cleanup_push.level=__ATEXIT__.length}function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!"),__ATEXIT__.pop(),_pthread_cleanup_push.level=__ATEXIT__.length}function _abort(){Module.abort()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}function ___cxa_begin_catch(e){return __ZSt18uncaught_exceptionv.uncaught_exception--,EXCEPTIONS.caught.push(e),EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(e)),e}function _pthread_once(e,t){_pthread_once.seen||(_pthread_once.seen={}),e in _pthread_once.seen||(Runtime.dynCall("v",t),_pthread_once.seen[e]=1)}function _emscripten_memcpy_big(e,t,i){return HEAPU8.set(HEAPU8.subarray(t,t+i),e),e}function ___syscall6(e,t){SYSCALLS.varargs=t;try{var i=SYSCALLS.getStreamFromFD();return FS.close(i),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function _pthread_getspecific(e){return PTHREAD_SPECIFIC[e]||0}function ___setErrNo(e){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=e),e}function _sysconf(e){switch(e){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator?navigator.hardwareConcurrency||1:1}return ___setErrNo(ERRNO_CODES.EINVAL),-1}function _sbrk(e){var t=_sbrk;t.called||(DYNAMICTOP=alignMemoryPage(DYNAMICTOP),t.called=!0,assert(Runtime.dynamicAlloc),t.alloc=Runtime.dynamicAlloc,Runtime.dynamicAlloc=function(){abort("cannot dynamically allocate, sbrk now has control")});var i=DYNAMICTOP;if(0!=e){var r=t.alloc(e);if(!r)return-1>>>0}return i}function _pthread_key_create(e,t){return 0==e?ERRNO_CODES.EINVAL:(HEAP32[e>>2]=PTHREAD_SPECIFIC_NEXT_KEY,PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0,PTHREAD_SPECIFIC_NEXT_KEY++,0)}function _emscripten_set_main_loop_timing(e,t){function i(e){e.source===window&&e.data===n&&(e.stopPropagation(),r.shift()())}if(Browser.mainLoop.timingMode=e,Browser.mainLoop.timingValue=t,!Browser.mainLoop.func)return 1;if(0==e)Browser.mainLoop.scheduler=function(){setTimeout(Browser.mainLoop.runner,t)},Browser.mainLoop.method="timeout";else if(1==e)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(2==e){if(!window.setImmediate){var r=[],n="__emcc";window.addEventListener("message",i,!0),window.setImmediate=function(e){r.push(e),window.postMessage(n,"*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(e,t,i,r,n){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=e,Browser.mainLoop.arg=r;var o=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var t=Date.now(),i=Browser.mainLoop.queue.shift();if(i.func(i.arg),Browser.mainLoop.remainingBlockers){var n=Browser.mainLoop.remainingBlockers,a=n%1==0?n-1:Math.floor(n);i.counted?Browser.mainLoop.remainingBlockers=a:(a+=.5,Browser.mainLoop.remainingBlockers=(8*n+a)/9)}return console.log('main loop blocker "'+i.name+'" took '+(Date.now()-t)+" ms"),Browser.mainLoop.updateStatus(),void setTimeout(Browser.mainLoop.runner,0)}if(!(o<Browser.mainLoop.currentlyRunningMainloop)){if(Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0,1==Browser.mainLoop.timingMode&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0)return void Browser.mainLoop.scheduler();"timeout"===Browser.mainLoop.method&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(function(){"undefined"!=typeof r?Runtime.dynCall("vi",e,[r]):Runtime.dynCall("v",e)}),o<Browser.mainLoop.currentlyRunningMainloop||("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Browser.mainLoop.scheduler())}}},n||(t&&t>0?_emscripten_set_main_loop_timing(0,1e3/t):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),i)throw"SimulateInfiniteLoop"}function _pthread_setspecific(e,t){return e in PTHREAD_SPECIFIC?(PTHREAD_SPECIFIC[e]=t,0):ERRNO_CODES.EINVAL}function _time(e){var t=Date.now()/1e3|0;return e&&(HEAP32[e>>2]=t),t}function _pthread_self(){return 0}function ___syscall140(e,t){SYSCALLS.varargs=t;try{var i=SYSCALLS.getStreamFromFD(),r=SYSCALLS.get(),n=SYSCALLS.get(),o=SYSCALLS.get(),a=SYSCALLS.get(),s=n;return assert(0===r),FS.llseek(i,s,a),HEAP32[o>>2]=i.position,i.getdents&&0===s&&0===a&&(i.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,t){SYSCALLS.varargs=t;try{var i=(SYSCALLS.get(),SYSCALLS.get()),r=SYSCALLS.get(),n=0;___syscall146.buffer||(___syscall146.buffer=[]);for(var o=___syscall146.buffer,a=0;a<r;a++){for(var s=HEAP32[i+8*a>>2],l=HEAP32[i+(8*a+4)>>2],u=0;u<l;u++){var c=HEAPU8[s+u];0===c||10===c?(Module.print(UTF8ArrayToString(o,0)),o.length=0):o.push(c)}n+=l}return n}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,t){SYSCALLS.varargs=t;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function invoke_iiii(e,t,i,r){try{return Module.dynCall_iiii(e,t,i,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiiii(e,t,i,r,n,o){try{Module.dynCall_viiiii(e,t,i,r,n,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_vi(e,t){try{Module.dynCall_vi(e,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_ii(e,t){try{return Module.dynCall_ii(e,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viii(e,t,i,r){try{Module.dynCall_viii(e,t,i,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_v(e){try{Module.dynCall_v(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiiiii(e,t,i,r,n,o,a){try{Module.dynCall_viiiiii(e,t,i,r,n,o,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiii(e,t,i,r,n){try{Module.dynCall_viiii(e,t,i,r,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function run(e){function t(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),t()},1)):t()))}function exit(e,t){if(!t||!Module.noExitRuntime)throw Module.noExitRuntime||(ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE?(process.stdout.once("drain",function(){process.exit(e)}),console.log(" "),setTimeout(function(){process.exit(e)},500)):ENVIRONMENT_IS_SHELL&&"function"==typeof quit&&quit(e),new ExitStatus(e)}function abort(e){void 0!==e?(Module.print(e),Module.printErr(e),e=JSON.stringify(e)):e="",ABORT=!0,EXITSTATUS=1;var t="\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.",i="abort("+e+") at "+stackTrace()+t;throw abortDecorators&&abortDecorators.forEach(function(t){i=t(i,e)}),i}var Module;Module||(Module=("undefined"!=typeof Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"function"==typeof require&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=function(e){process.stdout.write(e+"\n")}),Module.printErr||(Module.printErr=function(e){process.stderr.write(e+"\n")});var nodeFS=require("fs"),nodePath=require("path");Module.read=function(e,t){e=nodePath.normalize(e);var i=nodeFS.readFileSync(e);return i||e==nodePath.resolve(e)||(e=path.join(__dirname,"..","src",e),i=nodeFS.readFileSync(e)),i&&!t&&(i=i.toString()),i},Module.readBinary=function(e){var t=Module.read(e,!0);return t.buffer||(t=new Uint8Array(t)),assert(t.buffer),t},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available (jsc?)"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var t=read(e,"binary");return assert("object"==typeof t),t},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:"undefined"!=typeof arguments&&(Module.arguments=arguments);else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},"undefined"!=typeof arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.log(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),"undefined"==typeof Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var Runtime={setTempRet0:function(e){tempRet0=e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var t=parseInt(e.substr(1));return assert(t%8===0),t/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4===(7&e)),e+=4):assert(0===(3&e)),e},getAlignSize:function(e,t,i){return i||"i64"!=e&&"double"!=e?e?Math.min(t||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(t,8):8},dynCall:function(e,t,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,t),Module["dynCall_"+e].apply(null,i)):Module["dynCall_"+e].call(null,t)},functionPointers:[],addFunction:function(e){for(var t=0;t<Runtime.functionPointers.length;t++)if(!Runtime.functionPointers[t])return Runtime.functionPointers[t]=e,2*(1+t);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(e,t){assert(t),Runtime.funcWrappers[t]||(Runtime.funcWrappers[t]={});var i=Runtime.funcWrappers[t];return i[e]||(i[e]=function(){return Runtime.dynCall(t,e,arguments)}),i[e]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var t=STACKTOP;return STACKTOP=STACKTOP+e|0,STACKTOP=STACKTOP+15&-16,t},staticAlloc:function(e){var t=STATICTOP;return STATICTOP=STATICTOP+e|0,STATICTOP=STATICTOP+15&-16,t},dynamicAlloc:function(e){var t=DYNAMICTOP;if(DYNAMICTOP=DYNAMICTOP+e|0,DYNAMICTOP=DYNAMICTOP+15&-16,DYNAMICTOP>=TOTAL_MEMORY){var i=enlargeMemory();if(!i)return DYNAMICTOP=t,0}return t},alignMemory:function(e,t){var i=e=Math.ceil(e/(t?t:16))*(t?t:16);return i},makeBigInt:function(e,t,i){var r=i?+(e>>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t);return r},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var __THREW__=0,ABORT=!1,EXITSTATUS=0,undef=0,tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat,tempI64,tempI64b,tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9,globalScope=this,cwrap,ccall;!function(){function parseJSFunc(e){var t=e.toString().match(sourceRegex).slice(1);return{arguments:t[0],body:t[1],returnValue:t[2]}}var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var t=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,t),t},stringToC:function(e){var t=0;return null!==e&&void 0!==e&&0!==e&&(t=Runtime.stackAlloc((e.length<<2)+1), -writeStringToMemory(e,t)),t}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,t,i,r,n){var o=getCFunc(e),a=[],s=0;if(r)for(var l=0;l<r.length;l++){var u=toC[i[l]];u?(0===s&&(s=Runtime.stackSave()),a[l]=u(r[l])):a[l]=r[l]}var c=o.apply(null,a);if("string"===t&&(c=Pointer_stringify(c)),0!==s){if(n&&n.async)return void EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(s)});Runtime.stackRestore(s)}return c};var sourceRegex=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,JSsource={};for(var fun in JSfuncs)JSfuncs.hasOwnProperty(fun)&&(JSsource[fun]=parseJSFunc(JSfuncs[fun]));cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(e){return"number"===e}),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(e,t){return"$"+t}),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if("number"!==type){var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"="+convertCode.returnValue+";"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+="ret = "+strgfy+"(ret);"}return numericArgs||(funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii,Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.UTF16ToString=UTF16ToString,Module.stringToUTF16=stringToUTF16,Module.lengthBytesUTF16=lengthBytesUTF16,Module.UTF32ToString=UTF32ToString,Module.stringToUTF32=stringToUTF32,Module.lengthBytesUTF32=lengthBytesUTF32,Module.stackTrace=stackTrace;var PAGE_SIZE=4096,HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE=0,STATICTOP=0,staticSealed=!1,STACK_BASE=0,STACKTOP=0,STACK_MAX=0,DYNAMIC_BASE=0,DYNAMICTOP=0,byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(e){byteLength=function(e){return e.byteLength}}for(var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216,totalMemory=65536;totalMemory<TOTAL_MEMORY||totalMemory<2*TOTAL_STACK;)totalMemory<16777216?totalMemory*=2:totalMemory+=16777216;totalMemory=Math.max(totalMemory,16777216),totalMemory!==TOTAL_MEMORY&&(TOTAL_MEMORY=totalMemory),assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"JS engine does not provide full typed array support");var buffer;buffer=new ArrayBuffer(TOTAL_MEMORY),HEAP8=new Int8Array(buffer),HEAP16=new Int16Array(buffer),HEAP32=new Int32Array(buffer),HEAPU8=new Uint8Array(buffer),HEAPU16=new Uint16Array(buffer),HEAPU32=new Uint32Array(buffer),HEAPF32=new Float32Array(buffer),HEAPF64=new Float64Array(buffer),HEAP32[0]=255,assert(255===HEAPU8[0]&&0===HEAPU8[3],"Typed arrays 2 must be run on a little-endian system"),Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&Math.imul(4294967295,5)===-5||(Math.imul=function(e,t){var i=e>>>16,r=65535&e,n=t>>>16,o=65535&t;return r*o+(i*o+r*n<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_min=Math.min,Math_clz32=Math.clz32,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var memoryInitializer=null,ASM_CONSTS=[];STATIC_BASE=8,STATICTOP=STATIC_BASE+5888,__ATINIT__.push(),allocate([116,0,0,0,86,7,0,0,116,0,0,0,99,7,0,0,156,0,0,0,112,7,0,0,16,0,0,0,0,0,0,0,156,0,0,0,145,7,0,0,24,0,0,0,0,0,0,0,156,0,0,0,215,7,0,0,24,0,0,0,0,0,0,0,156,0,0,0,179,7,0,0,56,0,0,0,0,0,0,0,156,0,0,0,249,7,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,1,0,0,220,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,227,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,219,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,105,110,99,92,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0);var _BDtoIHigh=!0;Module._i64Subtract=_i64Subtract,Module._i64Add=_i64Add,Module._memset=_memset;var _BDtoILow=!0;Module._bitshift64Lshr=_bitshift64Lshr,Module._bitshift64Shl=_bitshift64Shl;var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(e){if(!e||EXCEPTIONS.infos[e])return e;for(var t in EXCEPTIONS.infos){var i=EXCEPTIONS.infos[t];if(i.adjusted===e)return t}return e},addRef:function(e){if(e){var t=EXCEPTIONS.infos[e];t.refcount++}},decRef:function(e){if(e){var t=EXCEPTIONS.infos[e];assert(t.refcount>0),t.refcount--,0===t.refcount&&(t.destructor&&Runtime.dynCall("vi",t.destructor,[e]),delete EXCEPTIONS.infos[e],___cxa_free_exception(e))}},clearRef:function(e){if(e){var t=EXCEPTIONS.infos[e];t.refcount=0}}};Module._memcpy=_memcpy;var SYSCALLS={varargs:0,get:function(e){SYSCALLS.varargs+=4;var t=HEAP32[SYSCALLS.varargs-4>>2];return t},getStr:function(){var e=Pointer_stringify(SYSCALLS.get());return e},get64:function(){var e=SYSCALLS.get(),t=SYSCALLS.get();return assert(e>=0?0===t:t===-1),e},getZero:function(){assert(0===SYSCALLS.get())}},PTHREAD_SPECIFIC={},ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86},PTHREAD_SPECIFIC_NEXT_KEY=1,_BItoD=!0,PATH=void 0,Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var e=Browser.mainLoop.timingMode,t=Browser.mainLoop.timingValue,i=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(i,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(e,t),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=Browser.mainLoop.remainingBlockers,i=Browser.mainLoop.expectedBlockers;t?t<i?Module.setStatus(e+" ("+(i-t)+"/"+i+")"):Module.setStatus(e):Module.setStatus("")}},runIter:function(e){if(!ABORT){if(Module.preMainLoop){var t=Module.preMainLoop();if(t===!1)return}try{e()}catch(e){if(e instanceof ExitStatus)return;throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}Module.postMainLoop&&Module.postMainLoop()}}},isFullScreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){function e(){Browser.pointerLock=document.pointerLockElement===r||document.mozPointerLockElement===r||document.webkitPointerLockElement===r||document.msPointerLockElement===r}if(Module.preloadPlugins||(Module.preloadPlugins=[]),!Browser.initted){Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch(e){Browser.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Browser.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),Browser.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,Module.noImageDecoding||"undefined"!=typeof Browser.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),Module.noImageDecoding=!0);var t={};t.canHandle=function(e){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},t.handle=function(e,t,i,r){var n=null;if(Browser.hasBlobConstructor)try{n=new Blob([e],{type:Browser.getMimetype(t)}),n.size!==e.length&&(n=new Blob([new Uint8Array(e).buffer],{type:Browser.getMimetype(t)}))}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!n){var o=new Browser.BlobBuilder;o.append(new Uint8Array(e).buffer),n=o.getBlob()}var a=Browser.URLObject.createObjectURL(n),s=new Image;s.onload=function(){assert(s.complete,"Image "+t+" could not be decoded");var r=document.createElement("canvas");r.width=s.width,r.height=s.height;var n=r.getContext("2d");n.drawImage(s,0,0),Module.preloadedImages[t]=r,Browser.URLObject.revokeObjectURL(a),i&&i(e)},s.onerror=function(e){console.log("Image "+a+" could not be decoded"),r&&r()},s.src=a},Module.preloadPlugins.push(t);var i={};i.canHandle=function(e){return!Module.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},i.handle=function(e,t,i,r){function n(r){a||(a=!0,Module.preloadedAudios[t]=r,i&&i(e))}function o(){a||(a=!0,Module.preloadedAudios[t]=new Audio,r&&r())}var a=!1;if(!Browser.hasBlobConstructor)return o();try{var s=new Blob([e],{type:Browser.getMimetype(t)})}catch(e){return o()}var l=Browser.URLObject.createObjectURL(s),u=new Audio;u.addEventListener("canplaythrough",function(){n(u)},!1),u.onerror=function(i){function r(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="=",r="",n=0,o=0,a=0;a<e.length;a++)for(n=n<<8|e[a],o+=8;o>=6;){var s=n>>o-6&63;o-=6,r+=t[s]}return 2==o?(r+=t[(3&n)<<4],r+=i+i):4==o&&(r+=t[(15&n)<<2],r+=i),r}a||(console.log("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),u.src="data:audio/x-"+t.substr(-3)+";base64,"+r(e),n(u))},u.src=l,Browser.safeSetTimeout(function(){n(u)},1e4)},Module.preloadPlugins.push(i);var r=Module.canvas;r&&(r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),document.addEventListener("mspointerlockchange",e,!1),Module.elementPointerLock&&r.addEventListener("click",function(e){!Browser.pointerLock&&r.requestPointerLock&&(r.requestPointerLock(),e.preventDefault())},!1))}},createContext:function(e,t,i,r){if(t&&Module.ctx&&e==Module.canvas)return Module.ctx;var n,o;if(t){var a={antialias:!1,alpha:!1};if(r)for(var s in r)a[s]=r[s];o=GL.createContext(e,a),o&&(n=GL.getContext(o).GLctx),e.style.backgroundColor="black"}else n=e.getContext("2d");return n?(i&&(t||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=n,t&&GL.makeContextCurrent(o),Module.useWebGL=t,Browser.moduleContextCreatedCallbacks.forEach(function(e){e()}),Browser.init()),n):null},destroyContext:function(e,t,i){},fullScreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullScreen:function(e,t,i){function r(){Browser.isFullScreen=!1;var e=n.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===e?(n.cancelFullScreen=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},n.cancelFullScreen=n.cancelFullScreen.bind(document),Browser.lockPointer&&n.requestPointerLock(),Browser.isFullScreen=!0,Browser.resizeCanvas&&Browser.setFullScreenCanvasSize()):(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullScreen),Browser.updateCanvasDimensions(n)}Browser.lockPointer=e,Browser.resizeCanvas=t,Browser.vrDevice=i,"undefined"==typeof Browser.lockPointer&&(Browser.lockPointer=!0),"undefined"==typeof Browser.resizeCanvas&&(Browser.resizeCanvas=!1),"undefined"==typeof Browser.vrDevice&&(Browser.vrDevice=null);var n=Module.canvas;Browser.fullScreenHandlersInstalled||(Browser.fullScreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",r,!1), -document.addEventListener("mozfullscreenchange",r,!1),document.addEventListener("webkitfullscreenchange",r,!1),document.addEventListener("MSFullscreenChange",r,!1));var o=document.createElement("div");n.parentNode.insertBefore(o,n),o.appendChild(n),o.requestFullScreen=o.requestFullScreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullScreen?function(){o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?o.requestFullScreen({vrDisplay:i}):o.requestFullScreen()},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===Browser.nextRAF)Browser.nextRAF=t+1e3/60;else for(;t+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var i=Math.max(Browser.nextRAF-t,0);setTimeout(e,i)},requestAnimationFrame:function(e){"undefined"==typeof window?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(e){return function(){if(!ABORT)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var e=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],e.forEach(function(e){e()})}},safeRequestAnimationFrame:function(e){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))})},safeSetTimeout:function(e,t){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))},t)},safeSetInterval:function(e,t){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&e()},t)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail;break;case"mousewheel":t=e.wheelDelta;break;case"wheel":t=e.deltaY;break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(Browser.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),"undefined"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var t=Module.canvas.getBoundingClientRect(),i=Module.canvas.width,r=Module.canvas.height,n="undefined"!=typeof window.scrollX?window.scrollX:window.pageXOffset,o="undefined"!=typeof window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var a=e.touch;if(void 0===a)return;var s=a.pageX-(n+t.left),l=a.pageY-(o+t.top);s*=i/t.width,l*=r/t.height;var u={x:s,y:l};if("touchstart"===e.type)Browser.lastTouches[a.identifier]=u,Browser.touches[a.identifier]=u;else if("touchend"===e.type||"touchmove"===e.type){var c=Browser.touches[a.identifier];c||(c=u),Browser.lastTouches[a.identifier]=c,Browser.touches[a.identifier]=u}return}var d=e.pageX-(n+t.left),h=e.pageY-(o+t.top);d*=i/t.width,h*=r/t.height,Browser.mouseMovementX=d-Browser.mouseX,Browser.mouseMovementY=h-Browser.mouseY,Browser.mouseX=d,Browser.mouseY=h}},xhrLoad: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)},asyncLoad:function(e,t,i,r){Browser.xhrLoad(e,function(i){assert(i,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(i)),r||removeRunDependency("al "+e)},function(t){if(!i)throw'Loading data file "'+e+'" failed.';i()}),r||addRunDependency("al "+e)},resizeListeners:[],updateResizeListeners:function(){var e=Module.canvas;Browser.resizeListeners.forEach(function(t){t(e.width,e.height)})},setCanvasSize:function(e,t,i){var r=Module.canvas;Browser.updateCanvasDimensions(r,e,t),i||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},updateCanvasDimensions:function(e,t,i){t&&i?(e.widthNative=t,e.heightNative=i):(t=e.widthNative,i=e.heightNative);var r=t,n=i;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(r/n<Module.forcedAspectRatio?r=Math.round(n*Module.forcedAspectRatio):n=Math.round(r/Module.forcedAspectRatio)),(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var o=Math.min(screen.width/r,screen.height/n);r=Math.round(r*o),n=Math.round(n*o)}Browser.resizeCanvas?(e.width!=r&&(e.width=r),e.height!=n&&(e.height=n),"undefined"!=typeof e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=i&&(e.height=i),"undefined"!=typeof e.style&&(r!=t||n!=i?(e.style.setProperty("width",r+"px","important"),e.style.setProperty("height",n+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var e=Browser.nextWgetRequestHandle;return Browser.nextWgetRequestHandle++,e}};Module.requestFullScreen=function(e,t,i){Browser.requestFullScreen(e,t,i)},Module.requestAnimationFrame=function(e){Browser.requestAnimationFrame(e)},Module.setCanvasSize=function(e,t,i){Browser.setCanvasSize(e,t,i)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},Module.createContext=function(e,t,i,r){return Browser.createContext(e,t,i,r)},STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),staticSealed=!0,STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX),assert(DYNAMIC_BASE<TOTAL_MEMORY,"TOTAL_MEMORY not big enough for stack");var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_DYNAMIC);Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0,byteLength:byteLength},Module.asmLibraryArg={abort:abort,assert:assert,invoke_iiii:invoke_iiii,invoke_viiiii:invoke_viiiii,invoke_vi:invoke_vi,invoke_ii:invoke_ii,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_viiiiii:invoke_viiiiii,invoke_viiii:invoke_viiii,_pthread_cleanup_pop:_pthread_cleanup_pop,_pthread_getspecific:_pthread_getspecific,_pthread_setspecific:_pthread_setspecific,__ZSt18uncaught_exceptionv:__ZSt18uncaught_exceptionv,_emscripten_set_main_loop:_emscripten_set_main_loop,_pthread_self:_pthread_self,_abort:_abort,_pthread_cleanup_push:_pthread_cleanup_push,___syscall6:___syscall6,_sbrk:_sbrk,_time:_time,_pthread_key_create:_pthread_key_create,___setErrNo:___setErrNo,_emscripten_memcpy_big:_emscripten_memcpy_big,___syscall54:___syscall54,___syscall140:___syscall140,_pthread_once:_pthread_once,_emscripten_set_main_loop_timing:_emscripten_set_main_loop_timing,_sysconf:_sysconf,___syscall146:___syscall146,___cxa_begin_catch:___cxa_begin_catch,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,tempDoublePtr:tempDoublePtr,ABORT:ABORT,cttz_i8:cttz_i8};var asm=function(e,t,i){"use asm";var r=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var l=e.Uint32Array;var u=e.Float32Array;var c=e.Float64Array;var d=new r(i);var h=new n(i);var p=new o(i);var f=new a(i);var m=new s(i);var _=new l(i);var g=new u(i);var v=new c(i);var y=e.byteLength;var C=t.STACKTOP|0;var w=t.STACK_MAX|0;var S=t.tempDoublePtr|0;var E=t.ABORT|0;var b=t.cttz_i8|0;var T=0;var x=0;var A=0;var P=0;var M=e.NaN,D=e.Infinity;var I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0,V=0;var z=0;var U=0;var G=0;var H=0;var W=0;var q=0;var j=0;var Y=0;var X=0;var Z=0;var K=e.Math.floor;var Q=e.Math.abs;var J=e.Math.sqrt;var $=e.Math.pow;var ee=e.Math.cos;var te=e.Math.sin;var ie=e.Math.tan;var re=e.Math.acos;var ne=e.Math.asin;var oe=e.Math.atan;var ae=e.Math.atan2;var se=e.Math.exp;var le=e.Math.log;var ue=e.Math.ceil;var ce=e.Math.imul;var de=e.Math.min;var he=e.Math.clz32;var pe=t.abort;var fe=t.assert;var me=t.invoke_iiii;var _e=t.invoke_viiiii;var ge=t.invoke_vi;var ve=t.invoke_ii;var ye=t.invoke_viii;var Ce=t.invoke_v;var we=t.invoke_viiiiii;var Se=t.invoke_viiii;var Ee=t._pthread_cleanup_pop;var be=t._pthread_getspecific;var Te=t._pthread_setspecific;var xe=t.__ZSt18uncaught_exceptionv;var Ae=t._emscripten_set_main_loop;var Pe=t._pthread_self;var Me=t._abort;var De=t._pthread_cleanup_push;var Ie=t.___syscall6;var Re=t._sbrk;var Oe=t._time;var Ne=t._pthread_key_create;var Le=t.___setErrNo;var Be=t._emscripten_memcpy_big;var Fe=t.___syscall54;var ke=t.___syscall140;var Ve=t._pthread_once;var ze=t._emscripten_set_main_loop_timing;var Ue=t._sysconf;var Ge=t.___syscall146;var He=t.___cxa_begin_catch;var We=0;function qe(e){if(y(e)&16777215||y(e)<=16777215||y(e)>2147483648)return false;d=new r(e);h=new n(e);p=new o(e);f=new a(e);m=new s(e);_=new l(e);g=new u(e);v=new c(e);i=e;return true}function je(e){e=e|0;var t=0;t=C;C=C+e|0;C=C+15&-16;return t|0}function Ye(){return C|0}function Xe(e){e=e|0;C=e}function Ze(e,t){e=e|0;t=t|0;C=e;w=t}function Ke(e,t){e=e|0;t=t|0;if(!T){T=e;x=t}}function Qe(e){e=e|0;d[S>>0]=d[e>>0];d[S+1>>0]=d[e+1>>0];d[S+2>>0]=d[e+2>>0];d[S+3>>0]=d[e+3>>0]}function Je(e){e=e|0;d[S>>0]=d[e>>0];d[S+1>>0]=d[e+1>>0];d[S+2>>0]=d[e+2>>0];d[S+3>>0]=d[e+3>>0];d[S+4>>0]=d[e+4>>0];d[S+5>>0]=d[e+5>>0];d[S+6>>0]=d[e+6>>0];d[S+7>>0]=d[e+7>>0]}function $e(e){e=e|0;z=e}function et(){return z|0}function tt(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0;f=C;C=C+576|0;c=f+48|0;s=f+32|0;a=f+16|0;o=f;u=f+64|0;d=f+60|0;l=e+4|0;h=e+8|0;if((p[l>>2]|0)>>>0>(p[h>>2]|0)>>>0){p[o>>2]=1138;p[o+4>>2]=2119;p[o+8>>2]=1117;yi(u,1084,o)|0;vi(u)|0}if((2147418112/(r>>>0)|0)>>>0<=t>>>0){p[a>>2]=1138;p[a+4>>2]=2120;p[a+8>>2]=1157;yi(u,1084,a)|0;vi(u)|0}a=p[h>>2]|0;if(a>>>0>=t>>>0){h=1;C=f;return h|0}do if(i){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10;while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){p[s>>2]=1138;p[s+4>>2]=2129;p[s+8>>2]=1205;yi(u,1084,s)|0;vi(u)|0}i=ce(t,r)|0;do if(!n){o=it(p[e>>2]|0,i,d,1)|0;if(!o){h=0;C=f;return h|0}else{p[e>>2]=o;break}}else{a=rt(i,d)|0;if(!a){h=0;C=f;return h|0}Ar[n&0](a,p[e>>2]|0,p[l>>2]|0);o=p[e>>2]|0;do if(o)if(!(o&7)){ot(o,0,0,1,0)|0;break}else{p[c>>2]=1138;p[c+4>>2]=2502;p[c+8>>2]=1504;yi(u,1084,c)|0;vi(u)|0;break}while(0);p[e>>2]=a}while(0);o=p[d>>2]|0;if(o>>>0>i>>>0)t=(o>>>0)/(r>>>0)|0;p[h>>2]=t;h=1;C=f;return h|0}function it(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0,a=0,s=0,l=0,u=0;u=C;C=C+560|0;l=u+32|0;o=u+16|0;n=u;s=u+48|0;a=u+44|0;if(e&7){p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1482;yi(s,1084,n)|0;vi(s)|0;l=0;C=u;return l|0}if(t>>>0>2147418112){p[o>>2]=1138;p[o+4>>2]=2502;p[o+8>>2]=1375;yi(s,1084,o)|0;vi(s)|0;l=0;C=u;return l|0}p[a>>2]=t;r=ot(e,t,a,r,0)|0;if(i)p[i>>2]=p[a>>2];if(!(r&7)){l=r;C=u;return l|0}p[l>>2]=1138;p[l+4>>2]=2554;p[l+8>>2]=1428;yi(s,1084,l)|0;vi(s)|0;l=r;C=u;return l|0}function rt(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0;l=C;C=C+560|0;s=l+32|0;a=l+16|0;i=l;o=l+48|0;n=l+44|0;r=e+3&-4;r=(r|0)!=0?r:4;if(r>>>0>2147418112){p[i>>2]=1138;p[i+4>>2]=2502;p[i+8>>2]=1375;yi(o,1084,i)|0;vi(o)|0;s=0;C=l;return s|0}p[n>>2]=r;i=ot(0,r,n,1,0)|0;e=p[n>>2]|0;if(t)p[t>>2]=e;if((i|0)==0|e>>>0<r>>>0){p[a>>2]=1138;p[a+4>>2]=2502;p[a+8>>2]=1401;yi(o,1084,a)|0;vi(o)|0;s=0;C=l;return s|0}if(!(i&7)){s=i;C=l;return s|0}p[s>>2]=1138;p[s+4>>2]=2529;p[s+8>>2]=1428;yi(o,1084,s)|0;vi(o)|0;s=i;C=l;return s|0}function nt(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,M=0,D=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0;F=C;C=C+880|0;N=F+144|0;O=F+128|0;R=F+112|0;I=F+96|0;P=F+80|0;S=F+64|0;y=F+48|0;w=F+32|0;_=F+16|0;c=F;D=F+360|0;L=F+296|0;B=F+224|0;v=F+156|0;if((t|0)==0|r>>>0>11){e=0;C=F;return e|0}p[e>>2]=t;n=B;o=n+68|0;do{p[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=d[i+o>>0]|0;if(n<<24>>24){M=B+((n&255)<<2)|0;p[M>>2]=(p[M>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;u=1;a=0;s=-1;l=0;while(1){n=p[B+(u<<2)>>2]|0;if(!n)p[e+28+(u+-1<<2)>>2]=0;else{M=u+-1|0;p[L+(M<<2)>>2]=o;o=n+o|0;A=16-u|0;p[e+28+(M<<2)>>2]=(o+-1<<A|(1<<A)+-1)+1;p[e+96+(M<<2)>>2]=l;p[v+(u<<2)>>2]=l;a=a>>>0>u>>>0?a:u;s=s>>>0<u>>>0?s:u;l=n+l|0}u=u+1|0;if((u|0)==17){M=a;break}else o=o<<1}p[e+4>>2]=l;o=e+172|0;do if(l>>>0>(p[o>>2]|0)>>>0){p[o>>2]=l;if(l){n=l+-1|0;if(n&l)g=14}else{n=-1;g=14}if((g|0)==14){A=n>>>16|n;A=A>>>8|A;A=A>>>4|A;A=A>>>2|A;A=(A>>>1|A)+1|0;p[o>>2]=A>>>0>t>>>0?t:A}a=e+176|0;n=p[a>>2]|0;do if(n){A=p[n+-4>>2]|0;n=n+-8|0;if(!((A|0)!=0?(A|0)==(~p[n>>2]|0):0)){p[c>>2]=1138;p[c+4>>2]=647;p[c+8>>2]=1851;yi(D,1084,c)|0;vi(D)|0}if(!(n&7)){ot(n,0,0,1,0)|0;break}else{p[_>>2]=1138;p[_+4>>2]=2502;p[_+8>>2]=1504;yi(D,1084,_)|0;vi(D)|0;break}}while(0);o=p[o>>2]|0;o=(o|0)!=0?o:1;n=rt((o<<1)+8|0,0)|0;if(!n){p[a>>2]=0;n=0;break}else{p[n+4>>2]=o;p[n>>2]=~o;p[a>>2]=n+8;g=25;break}}else g=25;while(0);e:do if((g|0)==25){A=e+24|0;d[A>>0]=s;d[e+25>>0]=M;o=e+176|0;a=0;do{x=d[i+a>>0]|0;n=x&255;if(x<<24>>24){if(!(p[B+(n<<2)>>2]|0)){p[w>>2]=1138;p[w+4>>2]=2272;p[w+8>>2]=1249;yi(D,1084,w)|0;vi(D)|0}x=v+(n<<2)|0;n=p[x>>2]|0;p[x>>2]=n+1;if(n>>>0>=l>>>0){p[y>>2]=1138;p[y+4>>2]=2276;p[y+8>>2]=1262;yi(D,1084,y)|0;vi(D)|0}h[(p[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=d[A>>0]|0;T=(n&255)>>>0<r>>>0?r:0;x=e+8|0;p[x>>2]=T;b=(T|0)!=0;if(b){E=1<<T;n=e+164|0;do if(E>>>0>(p[n>>2]|0)>>>0){p[n>>2]=E;a=e+168|0;n=p[a>>2]|0;do if(n){w=p[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~p[n>>2]|0):0)){p[S>>2]=1138;p[S+4>>2]=647;p[S+8>>2]=1851;yi(D,1084,S)|0;vi(D)|0}if(!(n&7)){ot(n,0,0,1,0)|0;break}else{p[P>>2]=1138;p[P+4>>2]=2502;p[P+8>>2]=1504;yi(D,1084,P)|0;vi(D)|0;break}}while(0);n=E<<2;o=rt(n+8|0,0)|0;if(!o){p[a>>2]=0;n=0;break e}else{P=o+8|0;p[o+4>>2]=E;p[o>>2]=~E;p[a>>2]=P;o=P;break}}else{o=e+168|0;n=E<<2;a=o;o=p[o>>2]|0}while(0);Xi(o|0,-1,n|0)|0;v=e+176|0;S=1;do{if(p[B+(S<<2)>>2]|0){y=T-S|0;w=1<<y;o=S+-1|0;s=p[L+(o<<2)>>2]|0;if(o>>>0>=16){p[I>>2]=1138;p[I+4>>2]=1956;p[I+8>>2]=1725;yi(D,1084,I)|0;vi(D)|0}n=p[e+28+(o<<2)>>2]|0;if(!n)t=-1;else t=(n+-1|0)>>>(16-S|0);if(s>>>0<=t>>>0){_=(p[e+96+(o<<2)>>2]|0)-s|0;g=S<<16;do{n=m[(p[v>>2]|0)+(_+s<<1)>>1]|0;if((f[i+n>>0]|0|0)!=(S|0)){p[R>>2]=1138;p[R+4>>2]=2318;p[R+8>>2]=1291;yi(D,1084,R)|0;vi(D)|0}c=s<<y;o=n|g;u=0;do{l=u+c|0;if(l>>>0>=E>>>0){p[O>>2]=1138;p[O+4>>2]=2324;p[O+8>>2]=1325;yi(D,1084,O)|0;vi(D)|0}n=p[a>>2]|0;if((p[n+(l<<2)>>2]|0)!=-1){p[N>>2]=1138;p[N+4>>2]=2326;p[N+8>>2]=1348;yi(D,1084,N)|0;vi(D)|0;n=p[a>>2]|0}p[n+(l<<2)>>2]=o;u=u+1|0}while(u>>>0<w>>>0);s=s+1|0}while(s>>>0<=t>>>0)}}S=S+1|0}while(T>>>0>=S>>>0);n=d[A>>0]|0}o=e+96|0;p[o>>2]=(p[o>>2]|0)-(p[L>>2]|0);o=e+100|0;p[o>>2]=(p[o>>2]|0)-(p[L+4>>2]|0);o=e+104|0;p[o>>2]=(p[o>>2]|0)-(p[L+8>>2]|0);o=e+108|0;p[o>>2]=(p[o>>2]|0)-(p[L+12>>2]|0);o=e+112|0;p[o>>2]=(p[o>>2]|0)-(p[L+16>>2]|0);o=e+116|0;p[o>>2]=(p[o>>2]|0)-(p[L+20>>2]|0);o=e+120|0;p[o>>2]=(p[o>>2]|0)-(p[L+24>>2]|0);o=e+124|0;p[o>>2]=(p[o>>2]|0)-(p[L+28>>2]|0);o=e+128|0;p[o>>2]=(p[o>>2]|0)-(p[L+32>>2]|0);o=e+132|0;p[o>>2]=(p[o>>2]|0)-(p[L+36>>2]|0);o=e+136|0;p[o>>2]=(p[o>>2]|0)-(p[L+40>>2]|0);o=e+140|0;p[o>>2]=(p[o>>2]|0)-(p[L+44>>2]|0);o=e+144|0;p[o>>2]=(p[o>>2]|0)-(p[L+48>>2]|0);o=e+148|0;p[o>>2]=(p[o>>2]|0)-(p[L+52>>2]|0);o=e+152|0;p[o>>2]=(p[o>>2]|0)-(p[L+56>>2]|0);o=e+156|0;p[o>>2]=(p[o>>2]|0)-(p[L+60>>2]|0);o=e+16|0;p[o>>2]=0;a=e+20|0;p[a>>2]=n&255;t:do if(b){while(1){if(!r)break t;n=r+-1|0;if(!(p[B+(r<<2)>>2]|0))r=n;else break}p[o>>2]=p[e+28+(n<<2)>>2];n=T+1|0;p[a>>2]=n;if(n>>>0<=M>>>0){while(1){if(p[B+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>M>>>0)break t}p[a>>2]=n}}while(0);p[e+92>>2]=-1;p[e+160>>2]=1048575;p[e+12>>2]=32-(p[x>>2]|0);n=1}while(0);e=n;C=F;return e|0}function ot(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;do if(!e){r=Vi(t)|0;if(i){if(!r)e=0;else e=Gi(r)|0;p[i>>2]=e}}else{if(!t){zi(e);if(!i){r=0;break}p[i>>2]=0;r=0;break}if(r){r=Ui(e,t)|0;e=(r|0)==0?e:r}else r=0;if(i){t=Gi(e)|0;p[i>>2]=t}}while(0);return r|0}function at(e,t,i){e=e|0;t=t|0;i=i|0;var r=0;if(!((e|0)!=0&t>>>0>73&(i|0)!=0)){i=0;return i|0}if((p[i>>2]|0)!=40|t>>>0<74){i=0;return i|0}if(((f[e>>0]|0)<<8|(f[e+1>>0]|0)|0)!=18552){i=0;return i|0}if(((f[e+2>>0]|0)<<8|(f[e+3>>0]|0))>>>0<74){i=0;return i|0}if(((f[e+7>>0]|0)<<16|(f[e+6>>0]|0)<<24|(f[e+8>>0]|0)<<8|(f[e+9>>0]|0))>>>0>t>>>0){i=0;return i|0}p[i+4>>2]=(f[e+12>>0]|0)<<8|(f[e+13>>0]|0);p[i+8>>2]=(f[e+14>>0]|0)<<8|(f[e+15>>0]|0);p[i+12>>2]=f[e+16>>0];p[i+16>>2]=f[e+17>>0];t=e+18|0;r=i+32|0;p[r>>2]=f[t>>0];p[r+4>>2]=0;t=d[t>>0]|0;p[i+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;p[i+24>>2]=(f[e+26>>0]|0)<<16|(f[e+25>>0]|0)<<24|(f[e+27>>0]|0)<<8|(f[e+28>>0]|0);p[i+28>>2]=(f[e+30>>0]|0)<<16|(f[e+29>>0]|0)<<24|(f[e+31>>0]|0)<<8|(f[e+32>>0]|0);i=1;return i|0}function st(e){e=e|0;He(e|0)|0;Vt()}function lt(e){e=e|0;var t=0,i=0,r=0,n=0,o=0;o=C;C=C+528|0;n=o;r=o+16|0;t=p[e+20>>2]|0;if(t)ut(t);t=e+4|0;i=p[t>>2]|0;if(!i){n=e+16|0;d[n>>0]=0;C=o;return}if(!(i&7))ot(i,0,0,1,0)|0;else{p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1504;yi(r,1084,n)|0;vi(r)|0}p[t>>2]=0;p[e+8>>2]=0;p[e+12>>2]=0;n=e+16|0;d[n>>0]=0;C=o;return}function ut(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0;l=C;C=C+592|0;a=l+64|0;o=l+48|0;s=l+32|0;r=l+16|0;i=l;n=l+80|0;if(!e){C=l;return}t=p[e+168>>2]|0;do if(t){u=p[t+-4>>2]|0;t=t+-8|0;if(!((u|0)!=0?(u|0)==(~p[t>>2]|0):0)){p[i>>2]=1138;p[i+4>>2]=647;p[i+8>>2]=1851;yi(n,1084,i)|0;vi(n)|0}if(!(t&7)){ot(t,0,0,1,0)|0;break}else{p[r>>2]=1138;p[r+4>>2]=2502;p[r+8>>2]=1504;yi(n,1084,r)|0;vi(n)|0;break}}while(0);t=p[e+176>>2]|0;do if(t){u=p[t+-4>>2]|0;t=t+-8|0;if(!((u|0)!=0?(u|0)==(~p[t>>2]|0):0)){p[s>>2]=1138;p[s+4>>2]=647;p[s+8>>2]=1851;yi(n,1084,s)|0;vi(n)|0}if(!(t&7)){ot(t,0,0,1,0)|0;break}else{p[o>>2]=1138;p[o+4>>2]=2502;p[o+8>>2]=1504;yi(n,1084,o)|0;vi(n)|0;break}}while(0);if(!(e&7)){ot(e,0,0,1,0)|0;C=l;return}else{p[a>>2]=1138;p[a+4>>2]=2502;p[a+8>>2]=1504;yi(n,1084,a)|0;vi(n)|0;C=l;return}}function ct(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0;l=C;C=C+544|0;a=l+16|0;t=l;o=l+32|0;n=e+8|0;i=p[n>>2]|0;if((i+-1|0)>>>0>=8192){p[t>>2]=1138;p[t+4>>2]=3002;p[t+8>>2]=1529;yi(o,1084,t)|0;vi(o)|0}p[e>>2]=i;r=e+20|0;t=p[r>>2]|0;if(!t){t=rt(180,0)|0;if(!t)t=0;else{s=t+164|0;p[s>>2]=0;p[s+4>>2]=0;p[s+8>>2]=0;p[s+12>>2]=0}p[r>>2]=t;s=p[e>>2]|0}else s=i;if(!(p[n>>2]|0)){p[a>>2]=1138;p[a+4>>2]=906;p[a+8>>2]=1769;yi(o,1084,a)|0;vi(o)|0;a=p[e>>2]|0}else a=s;o=p[e+4>>2]|0;if(a>>>0>16){r=a;i=0}else{e=0;e=nt(t,s,o,e)|0;C=l;return e|0}while(1){n=i+1|0;if(r>>>0>3){r=r>>>1;i=n}else{r=n;break}}e=i+2+((r|0)!=32&1<<r>>>0<a>>>0&1)|0;e=e>>>0<11?e&255:11;e=nt(t,s,o,e)|0;C=l;return e|0}function dt(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,M=0,D=0;D=C;C=C+720|0;T=D+160|0;b=D+144|0;E=D+128|0;S=D+112|0;w=D+96|0;y=D+80|0;v=D+64|0;g=D+48|0;c=D+32|0;s=D+16|0;n=D;P=D+200|0;M=D+176|0;x=ht(e,14)|0;if(!x){p[t>>2]=0;i=t+4|0;r=p[i>>2]|0;if(r){if(!(r&7))ot(r,0,0,1,0)|0;else{p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1504;yi(P,1084,n)|0;vi(P)|0}p[i>>2]=0;p[t+8>>2]=0;p[t+12>>2]=0}d[t+16>>0]=0;i=t+20|0;r=p[i>>2]|0;if(!r){t=1;C=D;return t|0}ut(r);p[i>>2]=0;t=1;C=D;return t|0}m=t+4|0;_=t+8|0;i=p[_>>2]|0;if((i|0)!=(x|0)){if(i>>>0<=x>>>0){do if((p[t+12>>2]|0)>>>0<x>>>0){if(tt(m,x,(i+1|0)==(x|0),1,0)|0){i=p[_>>2]|0;break}d[t+16>>0]=1;t=0;C=D;return t|0}while(0);Xi((p[m>>2]|0)+i|0,0,x-i|0)|0}p[_>>2]=x}Xi(p[m>>2]|0,0,x|0)|0;h=e+20|0;i=p[h>>2]|0;if((i|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{r=p[o>>2]|0;if((r|0)==(p[a>>2]|0))r=0;else{p[o>>2]=r+1;r=f[r>>0]|0}i=i+8|0;p[h>>2]=i;if((i|0)>=33){p[s>>2]=1138;p[s+4>>2]=3204;p[s+8>>2]=1638;yi(P,1084,s)|0;vi(P)|0;i=p[h>>2]|0}r=r<<32-i|p[n>>2];p[n>>2]=r}while((i|0)<5)}else{r=e+16|0;n=r;r=p[r>>2]|0}u=r>>>27;p[n>>2]=r<<5;p[h>>2]=i+-5;if((u+-1|0)>>>0>20){t=0;C=D;return t|0}p[M+20>>2]=0;p[M>>2]=0;p[M+4>>2]=0;p[M+8>>2]=0;p[M+12>>2]=0;d[M+16>>0]=0;i=M+4|0;r=M+8|0;e:do if(tt(i,21,0,1,0)|0){s=p[r>>2]|0;l=p[i>>2]|0;Xi(l+s|0,0,21-s|0)|0;p[r>>2]=21;if(u){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{i=p[h>>2]|0;if((i|0)<3){do{r=p[n>>2]|0;if((r|0)==(p[o>>2]|0))r=0;else{p[n>>2]=r+1;r=f[r>>0]|0}i=i+8|0;p[h>>2]=i;if((i|0)>=33){p[c>>2]=1138;p[c+4>>2]=3204;p[c+8>>2]=1638;yi(P,1084,c)|0;vi(P)|0;i=p[h>>2]|0}r=r<<32-i|p[a>>2];p[a>>2]=r}while((i|0)<3)}else r=p[a>>2]|0;p[a>>2]=r<<3;p[h>>2]=i+-3;d[l+(f[1599+s>>0]|0)>>0]=r>>>29;s=s+1|0}while((s|0)!=(u|0))}if(ct(M)|0){u=e+4|0;s=e+8|0;l=e+16|0;r=0;t:while(1){a=x-r|0;i=pt(e,M)|0;i:do if(i>>>0<17){if((p[_>>2]|0)>>>0<=r>>>0){p[g>>2]=1138;p[g+4>>2]=906;p[g+8>>2]=1769;yi(P,1084,g)|0;vi(P)|0}d[(p[m>>2]|0)+r>>0]=i;i=r+1|0}else switch(i|0){case 17:{i=p[h>>2]|0;if((i|0)<3){do{n=p[u>>2]|0;if((n|0)==(p[s>>2]|0))n=0;else{p[u>>2]=n+1;n=f[n>>0]|0}i=i+8|0;p[h>>2]=i;if((i|0)>=33){p[v>>2]=1138;p[v+4>>2]=3204;p[v+8>>2]=1638;yi(P,1084,v)|0;vi(P)|0;i=p[h>>2]|0}n=n<<32-i|p[l>>2];p[l>>2]=n}while((i|0)<3)}else n=p[l>>2]|0;p[l>>2]=n<<3;p[h>>2]=i+-3;i=(n>>>29)+3|0;if(i>>>0>a>>>0){i=0;break e}i=i+r|0;break i}case 18:{i=p[h>>2]|0;if((i|0)<7){do{n=p[u>>2]|0;if((n|0)==(p[s>>2]|0))n=0;else{p[u>>2]=n+1;n=f[n>>0]|0}i=i+8|0;p[h>>2]=i;if((i|0)>=33){p[y>>2]=1138;p[y+4>>2]=3204;p[y+8>>2]=1638;yi(P,1084,y)|0;vi(P)|0;i=p[h>>2]|0}n=n<<32-i|p[l>>2];p[l>>2]=n}while((i|0)<7)}else n=p[l>>2]|0;p[l>>2]=n<<7;p[h>>2]=i+-7;i=(n>>>25)+11|0;if(i>>>0>a>>>0){i=0;break e}i=i+r|0;break i}default:{if((i+-19|0)>>>0>=2){A=90;break t}o=p[h>>2]|0;if((i|0)==19){if((o|0)<2){n=o;while(1){i=p[u>>2]|0;if((i|0)==(p[s>>2]|0))o=0;else{p[u>>2]=i+1;o=f[i>>0]|0}i=n+8|0;p[h>>2]=i;if((i|0)>=33){p[w>>2]=1138;p[w+4>>2]=3204;p[w+8>>2]=1638;yi(P,1084,w)|0;vi(P)|0;i=p[h>>2]|0}n=o<<32-i|p[l>>2];p[l>>2]=n;if((i|0)<2)n=i;else break}}else{n=p[l>>2]|0;i=o}p[l>>2]=n<<2;p[h>>2]=i+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){i=p[u>>2]|0;if((i|0)==(p[s>>2]|0))o=0;else{p[u>>2]=i+1;o=f[i>>0]|0}i=n+8|0;p[h>>2]=i;if((i|0)>=33){p[S>>2]=1138;p[S+4>>2]=3204;p[S+8>>2]=1638;yi(P,1084,S)|0;vi(P)|0;i=p[h>>2]|0}n=o<<32-i|p[l>>2];p[l>>2]=n;if((i|0)<6)n=i;else break}}else{n=p[l>>2]|0;i=o}p[l>>2]=n<<6;p[h>>2]=i+-6;o=(n>>>26)+7|0}if((r|0)==0|o>>>0>a>>>0){i=0;break e}i=r+-1|0;if((p[_>>2]|0)>>>0<=i>>>0){p[E>>2]=1138;p[E+4>>2]=906;p[E+8>>2]=1769;yi(P,1084,E)|0;vi(P)|0}n=d[(p[m>>2]|0)+i>>0]|0;if(!(n<<24>>24)){i=0;break e}i=o+r|0;if(r>>>0>=i>>>0){i=r;break i}do{if((p[_>>2]|0)>>>0<=r>>>0){p[b>>2]=1138;p[b+4>>2]=906;p[b+8>>2]=1769;yi(P,1084,b)|0;vi(P)|0}d[(p[m>>2]|0)+r>>0]=n;r=r+1|0}while((r|0)!=(i|0))}}while(0);if(x>>>0>i>>>0)r=i;else break}if((A|0)==90){p[T>>2]=1138;p[T+4>>2]=3145;p[T+8>>2]=1620;yi(P,1084,T)|0;vi(P)|0;i=0;break}if((x|0)==(i|0))i=ct(t)|0;else i=0}else i=0}else{d[M+16>>0]=1;i=0}while(0);lt(M);t=i;C=D;return t|0}function ht(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0;u=C;C=C+528|0;a=u;o=u+16|0;if(!t){l=0;C=u;return l|0}if(t>>>0<=16){l=ft(e,t)|0;C=u;return l|0}s=ft(e,t+-16|0)|0;l=e+20|0;t=p[l>>2]|0;if((t|0)<16){r=e+4|0;n=e+8|0;i=e+16|0;do{e=p[r>>2]|0;if((e|0)==(p[n>>2]|0))e=0;else{p[r>>2]=e+1;e=f[e>>0]|0}t=t+8|0;p[l>>2]=t;if((t|0)>=33){p[a>>2]=1138;p[a+4>>2]=3204;p[a+8>>2]=1638;yi(o,1084,a)|0;vi(o)|0;t=p[l>>2]|0}e=e<<32-t|p[i>>2];p[i>>2]=e}while((t|0)<16)}else{e=e+16|0;i=e;e=p[e>>2]|0}p[i>>2]=e<<16;p[l>>2]=t+-16;l=e>>>16|s<<16;C=u;return l|0}function pt(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,_=0,g=0,v=0;v=C;C=C+576|0;d=v+48|0;c=v+32|0;u=v+16|0;l=v;_=v+64|0;h=p[t+20>>2]|0;g=e+20|0;s=p[g>>2]|0;do if((s|0)<24){a=e+4|0;r=p[a>>2]|0;n=p[e+8>>2]|0;i=r>>>0<n>>>0;if((s|0)>=16){if(i){p[a>>2]=r+1;i=f[r>>0]|0}else i=0;p[g>>2]=s+8;a=e+16|0;o=i<<24-s|p[a>>2];p[a>>2]=o;break}if(i){o=(f[r>>0]|0)<<8;i=r+1|0}else{o=0;i=r}if(i>>>0<n>>>0){r=f[i>>0]|0;i=i+1|0}else r=0;p[a>>2]=i;p[g>>2]=s+16;a=e+16|0;o=(r|o)<<16-s|p[a>>2];p[a>>2]=o}else{o=e+16|0;a=o;o=p[o>>2]|0}while(0);n=(o>>>16)+1|0;do if(n>>>0<=(p[h+16>>2]|0)>>>0){r=p[(p[h+168>>2]|0)+(o>>>(32-(p[h+8>>2]|0)|0)<<2)>>2]|0;if((r|0)==-1){p[l>>2]=1138;p[l+4>>2]=3249;p[l+8>>2]=1665;yi(_,1084,l)|0;vi(_)|0}i=r&65535;r=r>>>16;if((p[t+8>>2]|0)>>>0<=i>>>0){p[u>>2]=1138;p[u+4>>2]=905;p[u+8>>2]=1769;yi(_,1084,u)|0;vi(_)|0}if((f[(p[t+4>>2]|0)+i>>0]|0|0)!=(r|0)){p[c>>2]=1138;p[c+4>>2]=3253;p[c+8>>2]=1682;yi(_,1084,c)|0;vi(_)|0}}else{r=p[h+20>>2]|0;while(1){i=r+-1|0;if(n>>>0>(p[h+28+(i<<2)>>2]|0)>>>0)r=r+1|0;else break}i=(o>>>(32-r|0))+(p[h+96+(i<<2)>>2]|0)|0;if(i>>>0<(p[t>>2]|0)>>>0){i=m[(p[h+176>>2]|0)+(i<<1)>>1]|0;break}p[d>>2]=1138;p[d+4>>2]=3271;p[d+8>>2]=1620;yi(_,1084,d)|0;vi(_)|0;g=0;C=v;return g|0}while(0);p[a>>2]=p[a>>2]<<r;p[g>>2]=(p[g>>2]|0)-r;g=i;C=v;return g|0}function ft(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0;u=C;C=C+544|0;s=u+16|0;i=u;a=u+32|0;if(t>>>0>=33){p[i>>2]=1138;p[i+4>>2]=3195;p[i+8>>2]=1622;yi(a,1084,i)|0;vi(a)|0}l=e+20|0;i=p[l>>2]|0;if((i|0)>=(t|0)){n=e+16|0;o=n;n=p[n>>2]|0;a=i;s=32-t|0;s=n>>>s;n=n<<t;p[o>>2]=n;t=a-t|0;p[l>>2]=t;C=u;return s|0}n=e+4|0;o=e+8|0;r=e+16|0;do{e=p[n>>2]|0;if((e|0)==(p[o>>2]|0))e=0;else{p[n>>2]=e+1;e=f[e>>0]|0}i=i+8|0;p[l>>2]=i;if((i|0)>=33){p[s>>2]=1138;p[s+4>>2]=3204;p[s+8>>2]=1638;yi(a,1084,s)|0;vi(a)|0;i=p[l>>2]|0}e=e<<32-i|p[r>>2];p[r>>2]=e}while((i|0)<(t|0));s=32-t|0;s=e>>>s;a=e<<t;p[r>>2]=a;t=i-t|0;p[l>>2]=t;C=u;return s|0}function mt(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,_=0,g=0,v=0;_=C;C=C+528|0;h=_;c=_+16|0;if((e|0)==0|t>>>0<62){m=0;C=_;return m|0}u=rt(300,0)|0;if(!u){m=0;C=_;return m|0}p[u>>2]=519686845;i=u+4|0;p[i>>2]=0;r=u+8|0;p[r>>2]=0;l=u+88|0;n=u+136|0;o=u+160|0;a=l;s=a+44|0;do{p[a>>2]=0;a=a+4|0}while((a|0)<(s|0));d[l+44>>0]=0;g=u+184|0;a=u+208|0;s=u+232|0;v=u+252|0;p[v>>2]=0;p[v+4>>2]=0;p[v+8>>2]=0;d[v+12>>0]=0;v=u+268|0;p[v>>2]=0;p[v+4>>2]=0;p[v+8>>2]=0;d[v+12>>0]=0;v=u+284|0;p[v>>2]=0;p[v+4>>2]=0;p[v+8>>2]=0;d[v+12>>0]=0;p[n>>2]=0;p[n+4>>2]=0;p[n+8>>2]=0;p[n+12>>2]=0;p[n+16>>2]=0;d[n+20>>0]=0;p[o>>2]=0;p[o+4>>2]=0;p[o+8>>2]=0;p[o+12>>2]=0;p[o+16>>2]=0;d[o+20>>0]=0;p[g>>2]=0;p[g+4>>2]=0;p[g+8>>2]=0;p[g+12>>2]=0;p[g+16>>2]=0;d[g+20>>0]=0;p[a>>2]=0;p[a+4>>2]=0;p[a+8>>2]=0;p[a+12>>2]=0;p[a+16>>2]=0;d[a+20>>0]=0;p[s>>2]=0;p[s+4>>2]=0;p[s+8>>2]=0;p[s+12>>2]=0;d[s+16>>0]=0;do if(((t>>>0>=74?((f[e>>0]|0)<<8|(f[e+1>>0]|0)|0)==18552:0)?((f[e+2>>0]|0)<<8|(f[e+3>>0]|0))>>>0>=74:0)?((f[e+7>>0]|0)<<16|(f[e+6>>0]|0)<<24|(f[e+8>>0]|0)<<8|(f[e+9>>0]|0))>>>0<=t>>>0:0){p[l>>2]=e;p[i>>2]=e;p[r>>2]=t;if(Tt(u)|0){i=p[l>>2]|0;if((f[i+39>>0]|0)<<8|(f[i+40>>0]|0)){if(!(xt(u)|0))break;if(!(At(u)|0))break;i=p[l>>2]|0}if(!((f[i+55>>0]|0)<<8|(f[i+56>>0]|0))){v=u;C=_;return v|0}if(Pt(u)|0?Mt(u)|0:0){v=u;C=_;return v|0}}}else m=7;while(0);if((m|0)==7)p[l>>2]=0;Nt(u);if(!(u&7)){ot(u,0,0,1,0)|0;v=0;C=_;return v|0}else{p[h>>2]=1138;p[h+4>>2]=2502;p[h+8>>2]=1504;yi(c,1084,h)|0;vi(c)|0;v=0;C=_;return v|0}return 0}function _t(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0;c=C;C=C+528|0;u=c;l=c+16|0;o=p[e+88>>2]|0;s=(f[o+70+(n<<2)+1>>0]|0)<<16|(f[o+70+(n<<2)>>0]|0)<<24|(f[o+70+(n<<2)+2>>0]|0)<<8|(f[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(f[o+16>>0]|0)>>>0)o=(f[o+70+(a<<2)+1>>0]|0)<<16|(f[o+70+(a<<2)>>0]|0)<<24|(f[o+70+(a<<2)+2>>0]|0)<<8|(f[o+70+(a<<2)+3>>0]|0);else o=p[e+8>>2]|0;if(o>>>0>s>>>0){l=e+4|0;l=p[l>>2]|0;l=l+s|0;u=o-s|0;u=gt(e,l,u,t,i,r,n)|0;C=c;return u|0}p[u>>2]=1138;p[u+4>>2]=3690;p[u+8>>2]=1780;yi(l,1084,u)|0;vi(l)|0;l=e+4|0;l=p[l>>2]|0;l=l+s|0;u=o-s|0;u=gt(e,l,u,t,i,r,n)|0;C=c;return u|0}function gt(e,t,i,r,n,o,a){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;a=a|0;var s=0,l=0,u=0,c=0;c=p[e+88>>2]|0;l=((f[c+12>>0]|0)<<8|(f[c+13>>0]|0))>>>a;u=((f[c+14>>0]|0)<<8|(f[c+15>>0]|0))>>>a;l=l>>>0>1?(l+3|0)>>>2:1;u=u>>>0>1?(u+3|0)>>>2:1;c=c+18|0;a=d[c>>0]|0;a=ce(a<<24>>24==0|a<<24>>24==9?8:16,l)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ce(a,u)|0)>>>0>n>>>0){e=0;return e|0}o=(l+1|0)>>>1;s=(u+1|0)>>>1;if(!i){e=0;return e|0}p[e+92>>2]=t;p[e+96>>2]=t;p[e+104>>2]=i;p[e+100>>2]=t+i;p[e+108>>2]=0;p[e+112>>2]=0;switch(f[c>>0]|0|0){case 0:{Dt(e,r,n,a,l,u,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{It(e,r,n,a,l,u,o,s)|0;e=1;return e|0}case 9:{Rt(e,r,n,a,l,u,o,s)|0;e=1;return e|0}case 8:case 7:{Ot(e,r,n,a,l,u,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function vt(e,t){e=e|0;t=t|0;var i=0,r=0;r=C;C=C+48|0;i=r;p[i>>2]=40;at(e,t,i)|0;C=r;return p[i+4>>2]|0}function yt(e,t){e=e|0;t=t|0;var i=0,r=0;r=C;C=C+48|0;i=r;p[i>>2]=40;at(e,t,i)|0;C=r;return p[i+8>>2]|0}function Ct(e,t){e=e|0;t=t|0;var i=0,r=0;r=C;C=C+48|0;i=r;p[i>>2]=40;at(e,t,i)|0;C=r;return p[i+12>>2]|0}function wt(e,t){e=e|0;t=t|0;var i=0,r=0;r=C;C=C+48|0;i=r;p[i>>2]=40;at(e,t,i)|0;C=r;return p[i+32>>2]|0}function St(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0;n=C;C=C+576|0;r=n+40|0;i=n+56|0;o=n;p[o>>2]=40;at(e,t,o)|0;t=o+32|0;e=p[t+4>>2]|0;do switch(p[t>>2]|0){case 0:{if(!e){o=8;C=n;return o|0}else e=14;break}case 1:{if(!e)e=13;else e=14;break}case 2:{if(!e)e=13;else e=14;break}case 3:{if(!e)e=13;else e=14;break}case 4:{if(!e)e=13;else e=14;break}case 5:{if(!e)e=13;else e=14;break}case 6:{if(!e)e=13;else e=14;break}case 7:{if(!e)e=13;else e=14;break}case 8:{if(!e)e=13;else e=14;break}case 9:{if(!e){o=8;C=n;return o|0}else e=14;break}case 10:{if(!e){o=8;C=n;return o|0}else e=14;break}default:e=14}while(0);if((e|0)==13){o=16;C=n;return o|0}else if((e|0)==14){p[r>>2]=1138;p[r+4>>2]=2668;p[r+8>>2]=1523;yi(i,1084,r)|0;vi(i)|0;o=0;C=n;return o|0}return 0}function Et(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0,s=0,l=0;s=C;C=C+576|0;o=s+40|0;n=s+56|0;l=s;p[l>>2]=40;at(e,t,l)|0;r=(((p[l+4>>2]|0)>>>i)+3|0)>>>2;t=(((p[l+8>>2]|0)>>>i)+3|0)>>>2;i=l+32|0;e=p[i+4>>2]|0;do switch(p[i>>2]|0){case 0:{if(!e)e=8;else a=14;break}case 1:{if(!e)a=13;else a=14;break}case 2:{if(!e)a=13;else a=14;break}case 3:{if(!e)a=13;else a=14;break}case 4:{if(!e)a=13;else a=14;break}case 5:{if(!e)a=13;else a=14;break}case 6:{if(!e)a=13;else a=14;break}case 7:{if(!e)a=13;else a=14;break}case 8:{if(!e)a=13;else a=14;break}case 9:{if(!e)e=8;else a=14;break}case 10:{if(!e)e=8;else a=14;break}default:a=14}while(0);if((a|0)==13)e=16;else if((a|0)==14){p[o>>2]=1138;p[o+4>>2]=2668;p[o+8>>2]=1523;yi(n,1084,o)|0;vi(n)|0; -e=0}l=ce(ce(t,r)|0,e)|0;C=s;return l|0}function bt(e,t,i,r,n,o){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;var a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,_=0;_=C;C=C+592|0;m=_+56|0;a=_+40|0;h=_+72|0;d=_;f=_+68|0;p[d>>2]=40;at(e,t,d)|0;s=(p[d+4>>2]|0)>>>n;l=(p[d+8>>2]|0)>>>n;d=d+32|0;r=p[d+4>>2]|0;do switch(p[d>>2]|0){case 0:{if(!r)d=8;else u=14;break}case 1:{if(!r)u=13;else u=14;break}case 2:{if(!r)u=13;else u=14;break}case 3:{if(!r)u=13;else u=14;break}case 4:{if(!r)u=13;else u=14;break}case 5:{if(!r)u=13;else u=14;break}case 6:{if(!r)u=13;else u=14;break}case 7:{if(!r)u=13;else u=14;break}case 8:{if(!r)u=13;else u=14;break}case 9:{if(!r)d=8;else u=14;break}case 10:{if(!r)d=8;else u=14;break}default:u=14}while(0);if((u|0)==13)d=16;else if((u|0)==14){p[a>>2]=1138;p[a+4>>2]=2668;p[a+8>>2]=1523;yi(h,1084,a)|0;vi(h)|0;d=0}p[f>>2]=i;c=mt(e,t)|0;t=o+n|0;if(t>>>0>n>>>0){u=(c|0)==0;e=i;while(1){r=ce((s+3|0)>>>2,d)|0;a=ce(r,(l+3|0)>>>2)|0;if(!(n>>>0>15|(u|a>>>0<8))?(p[c>>2]|0)==519686845:0)_t(c,f,a,r,n)|0;e=e+a|0;p[f>>2]=e;n=n+1|0;if((n|0)==(t|0))break;else{l=l>>>1;s=s>>>1}}}if(!c){C=_;return}if((p[c>>2]|0)!=519686845){C=_;return}Nt(c);if(!(c&7)){ot(c,0,0,1,0)|0;C=_;return}else{p[m>>2]=1138;p[m+4>>2]=2502;p[m+8>>2]=1504;yi(h,1084,m)|0;vi(h)|0;C=_;return}}function Tt(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0;a=e+92|0;r=p[e+4>>2]|0;o=e+88|0;n=p[o>>2]|0;t=(f[n+68>>0]|0)<<8|(f[n+67>>0]|0)<<16|(f[n+69>>0]|0);i=r+t|0;n=(f[n+65>>0]|0)<<8|(f[n+66>>0]|0);if(!n){e=0;return e|0}p[a>>2]=i;p[e+96>>2]=i;p[e+104>>2]=n;p[e+100>>2]=r+(n+t);p[e+108>>2]=0;p[e+112>>2]=0;if(!(dt(a,e+116|0)|0)){e=0;return e|0}t=p[o>>2]|0;do if(!((f[t+39>>0]|0)<<8|(f[t+40>>0]|0))){if(!((f[t+55>>0]|0)<<8|(f[t+56>>0]|0))){e=0;return e|0}}else{if(!(dt(a,e+140|0)|0)){e=0;return e|0}if(dt(a,e+188|0)|0){t=p[o>>2]|0;break}else{e=0;return e|0}}while(0);if((f[t+55>>0]|0)<<8|(f[t+56>>0]|0)){if(!(dt(a,e+164|0)|0)){e=0;return e|0}if(!(dt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function xt(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,_=0;_=C;C=C+576|0;s=_;a=_+64|0;m=_+16|0;r=e+88|0;t=p[r>>2]|0;h=(f[t+39>>0]|0)<<8|(f[t+40>>0]|0);u=e+236|0;o=e+240|0;i=p[o>>2]|0;if((i|0)!=(h|0)){if(i>>>0<=h>>>0){do if((p[e+244>>2]|0)>>>0<h>>>0){if(tt(u,h,(i+1|0)==(h|0),4,0)|0){t=p[o>>2]|0;break}d[e+248>>0]=1;m=0;C=_;return m|0}else t=i;while(0);Xi((p[u>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=p[r>>2]|0}p[o>>2]=h}l=e+92|0;i=p[e+4>>2]|0;r=(f[t+34>>0]|0)<<8|(f[t+33>>0]|0)<<16|(f[t+35>>0]|0);n=i+r|0;t=(f[t+37>>0]|0)<<8|(f[t+36>>0]|0)<<16|(f[t+38>>0]|0);if(!t){m=0;C=_;return m|0}p[l>>2]=n;p[e+96>>2]=n;p[e+104>>2]=t;p[e+100>>2]=i+(t+r);p[e+108>>2]=0;p[e+112>>2]=0;p[m+20>>2]=0;p[m>>2]=0;p[m+4>>2]=0;p[m+8>>2]=0;p[m+12>>2]=0;d[m+16>>0]=0;e=m+24|0;p[m+44>>2]=0;p[e>>2]=0;p[e+4>>2]=0;p[e+8>>2]=0;p[e+12>>2]=0;d[e+16>>0]=0;if(dt(l,m)|0?(c=m+24|0,dt(l,c)|0):0){if(!(p[o>>2]|0)){p[s>>2]=1138;p[s+4>>2]=906;p[s+8>>2]=1769;yi(a,1084,s)|0;vi(a)|0}if(!h)t=1;else{r=0;n=0;o=0;t=0;a=0;e=0;s=0;i=p[u>>2]|0;while(1){r=(pt(l,m)|0)+r&31;n=(pt(l,c)|0)+n&63;o=(pt(l,m)|0)+o&31;t=(pt(l,m)|0)+t|0;a=(pt(l,c)|0)+a&63;e=(pt(l,m)|0)+e&31;p[i>>2]=n<<5|r<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;i=i+4|0}}}}else t=0;lt(m+24|0);lt(m);m=t;C=_;return m|0}function At(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,M=0,D=0,I=0;M=C;C=C+1008|0;a=M;o=M+496|0;P=M+472|0;x=M+276|0;A=M+80|0;T=M+16|0;n=p[e+88>>2]|0;b=(f[n+47>>0]|0)<<8|(f[n+48>>0]|0);E=e+92|0;t=p[e+4>>2]|0;i=(f[n+42>>0]|0)<<8|(f[n+41>>0]|0)<<16|(f[n+43>>0]|0);r=t+i|0;n=(f[n+45>>0]|0)<<8|(f[n+44>>0]|0)<<16|(f[n+46>>0]|0);if(!n){P=0;C=M;return P|0}p[E>>2]=r;p[e+96>>2]=r;p[e+104>>2]=n;p[e+100>>2]=t+(n+i);p[e+108>>2]=0;p[e+112>>2]=0;p[P+20>>2]=0;p[P>>2]=0;p[P+4>>2]=0;p[P+8>>2]=0;p[P+12>>2]=0;d[P+16>>0]=0;if(dt(E,P)|0){i=0;r=-3;n=-3;while(1){p[x+(i<<2)>>2]=r;p[A+(i<<2)>>2]=n;t=(r|0)>2;i=i+1|0;if((i|0)==49)break;else{r=t?-3:r+1|0;n=(t&1)+n|0}}t=T;i=t+64|0;do{p[t>>2]=0;t=t+4|0}while((t|0)<(i|0));S=e+252|0;i=e+256|0;t=p[i>>2]|0;e:do if((t|0)==(b|0))s=13;else{if(t>>>0<=b>>>0){do if((p[e+260>>2]|0)>>>0<b>>>0)if(tt(S,b,(t+1|0)==(b|0),4,0)|0){t=p[i>>2]|0;break}else{d[e+264>>0]=1;t=0;break e}while(0);Xi((p[S>>2]|0)+(t<<2)|0,0,b-t<<2|0)|0}p[i>>2]=b;s=13}while(0);do if((s|0)==13){if(!b){p[a>>2]=1138;p[a+4>>2]=906;p[a+8>>2]=1769;yi(o,1084,a)|0;vi(o)|0;t=1;break}r=T+4|0;n=T+8|0;e=T+12|0;o=T+16|0;a=T+20|0;s=T+24|0;l=T+28|0;u=T+32|0;c=T+36|0;h=T+40|0;m=T+44|0;_=T+48|0;g=T+52|0;v=T+56|0;y=T+60|0;w=0;i=p[S>>2]|0;while(1){t=0;do{D=pt(E,P)|0;S=t<<1;I=T+(S<<2)|0;p[I>>2]=(p[I>>2]|0)+(p[x+(D<<2)>>2]|0)&3;S=T+((S|1)<<2)|0;p[S>>2]=(p[S>>2]|0)+(p[A+(D<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);p[i>>2]=(f[1713+(p[r>>2]|0)>>0]|0)<<2|(f[1713+(p[T>>2]|0)>>0]|0)|(f[1713+(p[n>>2]|0)>>0]|0)<<4|(f[1713+(p[e>>2]|0)>>0]|0)<<6|(f[1713+(p[o>>2]|0)>>0]|0)<<8|(f[1713+(p[a>>2]|0)>>0]|0)<<10|(f[1713+(p[s>>2]|0)>>0]|0)<<12|(f[1713+(p[l>>2]|0)>>0]|0)<<14|(f[1713+(p[u>>2]|0)>>0]|0)<<16|(f[1713+(p[c>>2]|0)>>0]|0)<<18|(f[1713+(p[h>>2]|0)>>0]|0)<<20|(f[1713+(p[m>>2]|0)>>0]|0)<<22|(f[1713+(p[_>>2]|0)>>0]|0)<<24|(f[1713+(p[g>>2]|0)>>0]|0)<<26|(f[1713+(p[v>>2]|0)>>0]|0)<<28|(f[1713+(p[y>>2]|0)>>0]|0)<<30;w=w+1|0;if((w|0)==(b|0)){t=1;break}else i=i+4|0}}while(0)}else t=0;lt(P);I=t;C=M;return I|0}function Pt(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,m=0;m=C;C=C+560|0;s=m;a=m+40|0;c=m+16|0;n=p[e+88>>2]|0;u=(f[n+55>>0]|0)<<8|(f[n+56>>0]|0);l=e+92|0;t=p[e+4>>2]|0;i=(f[n+50>>0]|0)<<8|(f[n+49>>0]|0)<<16|(f[n+51>>0]|0);r=t+i|0;n=(f[n+53>>0]|0)<<8|(f[n+52>>0]|0)<<16|(f[n+54>>0]|0);if(!n){c=0;C=m;return c|0}p[l>>2]=r;p[e+96>>2]=r;p[e+104>>2]=n;p[e+100>>2]=t+(n+i);p[e+108>>2]=0;p[e+112>>2]=0;p[c+20>>2]=0;p[c>>2]=0;p[c+4>>2]=0;p[c+8>>2]=0;p[c+12>>2]=0;d[c+16>>0]=0;e:do if(dt(l,c)|0){o=e+268|0;i=e+272|0;t=p[i>>2]|0;if((t|0)!=(u|0)){if(t>>>0<=u>>>0){do if((p[e+276>>2]|0)>>>0<u>>>0)if(tt(o,u,(t+1|0)==(u|0),2,0)|0){t=p[i>>2]|0;break}else{d[e+280>>0]=1;t=0;break e}while(0);Xi((p[o>>2]|0)+(t<<1)|0,0,u-t<<1|0)|0}p[i>>2]=u}if(!u){p[s>>2]=1138;p[s+4>>2]=906;p[s+8>>2]=1769;yi(a,1084,s)|0;vi(a)|0;t=1;break}i=0;r=0;n=0;t=p[o>>2]|0;while(1){s=pt(l,c)|0;i=s+i&255;r=(pt(l,c)|0)+r&255;h[t>>1]=r<<8|i;n=n+1|0;if((n|0)==(u|0)){t=1;break}else t=t+2|0}}else t=0;while(0);lt(c);c=t;C=m;return c|0}function Mt(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,m=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,M=0,D=0,I=0,R=0;D=C;C=C+2416|0;a=D;o=D+1904|0;M=D+1880|0;A=D+980|0;P=D+80|0;x=D+16|0;n=p[e+88>>2]|0;T=(f[n+63>>0]|0)<<8|(f[n+64>>0]|0);b=e+92|0;t=p[e+4>>2]|0;i=(f[n+58>>0]|0)<<8|(f[n+57>>0]|0)<<16|(f[n+59>>0]|0);r=t+i|0;n=(f[n+61>>0]|0)<<8|(f[n+60>>0]|0)<<16|(f[n+62>>0]|0);if(!n){M=0;C=D;return M|0}p[b>>2]=r;p[e+96>>2]=r;p[e+104>>2]=n;p[e+100>>2]=t+(n+i);p[e+108>>2]=0;p[e+112>>2]=0;p[M+20>>2]=0;p[M>>2]=0;p[M+4>>2]=0;p[M+8>>2]=0;p[M+12>>2]=0;d[M+16>>0]=0;if(dt(b,M)|0){i=0;r=-7;n=-7;while(1){p[A+(i<<2)>>2]=r;p[P+(i<<2)>>2]=n;t=(r|0)>6;i=i+1|0;if((i|0)==225)break;else{r=t?-7:r+1|0;n=(t&1)+n|0}}t=x;i=t+64|0;do{p[t>>2]=0;t=t+4|0}while((t|0)<(i|0));E=e+284|0;i=T*3|0;r=e+288|0;t=p[r>>2]|0;e:do if((t|0)==(i|0))s=13;else{if(t>>>0<=i>>>0){do if((p[e+292>>2]|0)>>>0<i>>>0)if(tt(E,i,(t+1|0)==(i|0),2,0)|0){t=p[r>>2]|0;break}else{d[e+296>>0]=1;t=0;break e}while(0);Xi((p[E>>2]|0)+(t<<1)|0,0,i-t<<1|0)|0}p[r>>2]=i;s=13}while(0);do if((s|0)==13){if(!T){p[a>>2]=1138;p[a+4>>2]=906;p[a+8>>2]=1769;yi(o,1084,a)|0;vi(o)|0;t=1;break}r=x+4|0;n=x+8|0;e=x+12|0;o=x+16|0;a=x+20|0;s=x+24|0;l=x+28|0;u=x+32|0;c=x+36|0;m=x+40|0;_=x+44|0;g=x+48|0;v=x+52|0;y=x+56|0;w=x+60|0;S=0;i=p[E>>2]|0;while(1){t=0;do{I=pt(b,M)|0;E=t<<1;R=x+(E<<2)|0;p[R>>2]=(p[R>>2]|0)+(p[A+(I<<2)>>2]|0)&7;E=x+((E|1)<<2)|0;p[E>>2]=(p[E>>2]|0)+(p[P+(I<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);I=f[1717+(p[a>>2]|0)>>0]|0;h[i>>1]=(f[1717+(p[r>>2]|0)>>0]|0)<<3|(f[1717+(p[x>>2]|0)>>0]|0)|(f[1717+(p[n>>2]|0)>>0]|0)<<6|(f[1717+(p[e>>2]|0)>>0]|0)<<9|(f[1717+(p[o>>2]|0)>>0]|0)<<12|I<<15;R=f[1717+(p[m>>2]|0)>>0]|0;h[i+2>>1]=(f[1717+(p[s>>2]|0)>>0]|0)<<2|I>>>1|(f[1717+(p[l>>2]|0)>>0]|0)<<5|(f[1717+(p[u>>2]|0)>>0]|0)<<8|(f[1717+(p[c>>2]|0)>>0]|0)<<11|R<<14;h[i+4>>1]=(f[1717+(p[_>>2]|0)>>0]|0)<<1|R>>>2|(f[1717+(p[g>>2]|0)>>0]|0)<<4|(f[1717+(p[v>>2]|0)>>0]|0)<<7|(f[1717+(p[y>>2]|0)>>0]|0)<<10|(f[1717+(p[w>>2]|0)>>0]|0)<<13;S=S+1|0;if((S|0)==(T|0)){t=1;break}else i=i+6|0}}while(0)}else t=0;lt(M);R=t;C=D;return R|0}function Dt(e,t,i,r,n,o,a,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,m=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,M=0,D=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0,V=0,z=0,U=0,G=0,H=0,W=0,q=0,j=0,Y=0,X=0,Z=0,K=0,Q=0,J=0,$=0,ee=0,te=0,ie=0,re=0,ne=0,oe=0,ae=0,se=0,le=0;ae=C;C=C+656|0;ne=ae+112|0;ie=ae+96|0;te=ae+80|0;ee=ae+64|0;$=ae+48|0;oe=ae+32|0;re=ae+16|0;J=ae;K=ae+144|0;Q=ae+128|0;H=e+240|0;W=p[H>>2]|0;Y=e+256|0;X=p[Y>>2]|0;i=d[(p[e+88>>2]|0)+17>>0]|0;Z=r>>>2;if(!(i<<24>>24)){C=ae;return 1}q=(s|0)==0;j=s+-1|0;B=(o&1|0)!=0;F=r<<1;k=e+92|0;V=e+116|0;z=e+140|0;U=e+236|0;G=a+-1|0;L=(n&1|0)!=0;N=e+188|0;M=e+252|0;D=Z+1|0;I=Z+2|0;R=Z+3|0;O=G<<4;A=i&255;i=0;o=0;n=1;P=0;do{if(!q){T=p[t+(P<<2)>>2]|0;x=0;while(1){S=x&1;l=(S|0)==0;w=(S<<5^32)+-16|0;S=(S<<1^2)+-1|0;b=l?a:-1;u=l?0:G;e=(x|0)==(j|0);E=B&e;if((u|0)!=(b|0)){y=B&e^1;v=l?T:T+O|0;while(1){if((n|0)==1)n=pt(k,V)|0|512;g=n&7;n=n>>>3;l=f[1811+g>>0]|0;e=0;do{m=(pt(k,z)|0)+o|0;_=m-W|0;o=_>>31;o=o&m|_&~o;if((p[H>>2]|0)>>>0<=o>>>0){p[J>>2]=1138;p[J+4>>2]=906;p[J+8>>2]=1769;yi(K,1084,J)|0;vi(K)|0}p[Q+(e<<2)>>2]=p[(p[U>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0<l>>>0);_=L&(u|0)==(G|0);if(E|_){m=0;do{c=ce(m,r)|0;e=v+c|0;l=(m|0)==0|y;h=m<<1;le=(pt(k,N)|0)+i|0;se=le-X|0;i=se>>31;i=i&le|se&~i;do if(_){if(!l){se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;break}p[e>>2]=p[Q+((f[1819+(g<<2)+h>>0]|0)<<2)>>2];if((p[Y>>2]|0)>>>0<=i>>>0){p[ie>>2]=1138;p[ie+4>>2]=906;p[ie+8>>2]=1769;yi(K,1084,ie)|0;vi(K)|0}p[v+(c+4)>>2]=p[(p[M>>2]|0)+(i<<2)>>2];se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i}else{if(!l){se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;break}p[e>>2]=p[Q+((f[1819+(g<<2)+h>>0]|0)<<2)>>2];if((p[Y>>2]|0)>>>0<=i>>>0){p[te>>2]=1138;p[te+4>>2]=906;p[te+8>>2]=1769;yi(K,1084,te)|0;vi(K)|0}p[v+(c+4)>>2]=p[(p[M>>2]|0)+(i<<2)>>2];se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;p[v+(c+8)>>2]=p[Q+((f[(h|1)+(1819+(g<<2))>>0]|0)<<2)>>2];if((p[Y>>2]|0)>>>0<=i>>>0){p[ne>>2]=1138;p[ne+4>>2]=906;p[ne+8>>2]=1769;yi(K,1084,ne)|0;vi(K)|0}p[v+(c+12)>>2]=p[(p[M>>2]|0)+(i<<2)>>2]}while(0);m=m+1|0}while((m|0)!=2)}else{p[v>>2]=p[Q+((f[1819+(g<<2)>>0]|0)<<2)>>2];se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;if((p[Y>>2]|0)>>>0<=i>>>0){p[re>>2]=1138;p[re+4>>2]=906;p[re+8>>2]=1769;yi(K,1084,re)|0;vi(K)|0}p[v+4>>2]=p[(p[M>>2]|0)+(i<<2)>>2];p[v+8>>2]=p[Q+((f[1819+(g<<2)+1>>0]|0)<<2)>>2];se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;if((p[Y>>2]|0)>>>0<=i>>>0){p[oe>>2]=1138;p[oe+4>>2]=906;p[oe+8>>2]=1769;yi(K,1084,oe)|0;vi(K)|0}p[v+12>>2]=p[(p[M>>2]|0)+(i<<2)>>2];p[v+(Z<<2)>>2]=p[Q+((f[1819+(g<<2)+2>>0]|0)<<2)>>2];se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;if((p[Y>>2]|0)>>>0<=i>>>0){p[$>>2]=1138;p[$+4>>2]=906;p[$+8>>2]=1769;yi(K,1084,$)|0;vi(K)|0}p[v+(D<<2)>>2]=p[(p[M>>2]|0)+(i<<2)>>2];p[v+(I<<2)>>2]=p[Q+((f[1819+(g<<2)+3>>0]|0)<<2)>>2];se=(pt(k,N)|0)+i|0;le=se-X|0;i=le>>31;i=i&se|le&~i;if((p[Y>>2]|0)>>>0<=i>>>0){p[ee>>2]=1138;p[ee+4>>2]=906;p[ee+8>>2]=1769;yi(K,1084,ee)|0;vi(K)|0}p[v+(R<<2)>>2]=p[(p[M>>2]|0)+(i<<2)>>2]}u=u+S|0;if((u|0)==(b|0))break;else v=v+w|0}}x=x+1|0;if((x|0)==(s|0))break;else T=T+F|0}}P=P+1|0}while((P|0)!=(A|0));C=ae;return 1}function It(e,t,i,r,n,o,a,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,M=0,D=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0,V=0,z=0,U=0,G=0,H=0,W=0,q=0,j=0,Y=0,X=0,Z=0,K=0,Q=0,J=0,$=0,ee=0,te=0,ie=0,re=0,ne=0,oe=0,ae=0,se=0,le=0,ue=0,ce=0,de=0,he=0,pe=0;he=C;C=C+608|0;ue=he+48|0;de=he+32|0;ce=he+16|0;le=he;ae=he+96|0;se=he+80|0;oe=he+64|0;W=e+240|0;q=p[W>>2]|0;X=e+256|0;ie=p[X>>2]|0;re=e+272|0;ne=p[re>>2]|0;i=p[e+88>>2]|0;j=(f[i+63>>0]|0)<<8|(f[i+64>>0]|0);i=d[i+17>>0]|0;if(!(i<<24>>24)){C=he;return 1}Y=(s|0)==0;Z=s+-1|0;K=r<<1;Q=e+92|0;J=e+116|0;$=a+-1|0;ee=e+212|0;te=e+188|0;H=(n&1|0)==0;G=(o&1|0)==0;B=e+288|0;F=e+284|0;k=e+252|0;V=e+140|0;z=e+236|0;U=e+164|0;N=e+268|0;L=$<<5;R=i&255;i=0;n=0;o=0;e=0;l=1;O=0;do{if(!Y){D=p[t+(O<<2)>>2]|0;I=0;while(1){P=I&1;u=(P|0)==0;A=(P<<6^64)+-32|0;P=(P<<1^2)+-1|0;M=u?a:-1;c=u?0:$;if((c|0)!=(M|0)){x=G|(I|0)!=(Z|0);T=u?D:D+L|0;while(1){if((l|0)==1)l=pt(Q,J)|0|512;b=l&7;l=l>>>3;h=f[1811+b>>0]|0;u=0;do{S=(pt(Q,U)|0)+n|0;E=S-ne|0;n=E>>31;n=n&S|E&~n;if((p[re>>2]|0)>>>0<=n>>>0){p[le>>2]=1138;p[le+4>>2]=906;p[le+8>>2]=1769;yi(ae,1084,le)|0;vi(ae)|0}p[oe+(u<<2)>>2]=m[(p[N>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0<h>>>0);u=0;do{S=(pt(Q,V)|0)+e|0;E=S-q|0;e=E>>31;e=e&S|E&~e;if((p[W>>2]|0)>>>0<=e>>>0){p[ce>>2]=1138;p[ce+4>>2]=906;p[ce+8>>2]=1769;yi(ae,1084,ce)|0;vi(ae)|0}p[se+(u<<2)>>2]=p[(p[z>>2]|0)+(e<<2)>>2];u=u+1|0}while(u>>>0<h>>>0);E=H|(c|0)!=($|0);w=0;S=T;while(1){y=x|(w|0)==0;v=w<<1;_=0;g=S;while(1){h=(pt(Q,ee)|0)+i|0;u=h-j|0;i=u>>31;i=i&h|u&~i;u=(pt(Q,te)|0)+o|0;h=u-ie|0;o=h>>31;o=o&u|h&~o;if((E|(_|0)==0)&y){u=f[_+v+(1819+(b<<2))>>0]|0;h=i*3|0;if((p[B>>2]|0)>>>0<=h>>>0){p[de>>2]=1138;p[de+4>>2]=906;p[de+8>>2]=1769;yi(ae,1084,de)|0;vi(ae)|0}pe=p[F>>2]|0;p[g>>2]=(m[pe+(h<<1)>>1]|0)<<16|p[oe+(u<<2)>>2];p[g+4>>2]=(m[pe+(h+2<<1)>>1]|0)<<16|(m[pe+(h+1<<1)>>1]|0);p[g+8>>2]=p[se+(u<<2)>>2];if((p[X>>2]|0)>>>0<=o>>>0){p[ue>>2]=1138;p[ue+4>>2]=906;p[ue+8>>2]=1769;yi(ae,1084,ue)|0;vi(ae)|0}p[g+12>>2]=p[(p[k>>2]|0)+(o<<2)>>2]}_=_+1|0;if((_|0)==2)break;else g=g+16|0}w=w+1|0;if((w|0)==2)break;else S=S+r|0}c=c+P|0;if((c|0)==(M|0))break;else T=T+A|0}}I=I+1|0;if((I|0)==(s|0))break;else D=D+K|0}}O=O+1|0}while((O|0)!=(R|0));C=he;return 1}function Rt(e,t,i,r,n,o,a,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,M=0,D=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0,V=0,z=0,U=0,G=0,H=0,W=0,q=0,j=0,Y=0,X=0,Z=0,K=0,Q=0,J=0,$=0;$=C;C=C+576|0;J=$+32|0;Q=$+16|0;K=$;Z=$+64|0;X=$+48|0;k=e+272|0;V=p[k>>2]|0;i=p[e+88>>2]|0;z=(f[i+63>>0]|0)<<8|(f[i+64>>0]|0);i=d[i+17>>0]|0;if(!(i<<24>>24)){C=$;return 1}U=(s|0)==0;G=s+-1|0;H=r<<1;W=e+92|0;q=e+116|0;j=a+-1|0;Y=e+212|0;F=(o&1|0)==0;N=e+288|0;L=e+284|0;B=e+164|0;R=e+268|0;O=j<<4;I=i&255;D=(n&1|0)!=0;i=0;o=0;e=1;M=0;do{if(!U){A=p[t+(M<<2)>>2]|0;P=0;while(1){T=P&1;n=(T|0)==0;b=(T<<5^32)+-16|0;T=(T<<1^2)+-1|0;x=n?a:-1;l=n?0:j;if((l|0)!=(x|0)){E=F|(P|0)!=(G|0);S=n?A:A+O|0;while(1){if((e|0)==1)e=pt(W,q)|0|512;w=e&7;e=e>>>3;u=f[1811+w>>0]|0;n=0;do{v=(pt(W,B)|0)+o|0;y=v-V|0;o=y>>31;o=o&v|y&~o;if((p[k>>2]|0)>>>0<=o>>>0){p[K>>2]=1138;p[K+4>>2]=906;p[K+8>>2]=1769;yi(Z,1084,K)|0;vi(Z)|0}p[X+(n<<2)>>2]=m[(p[R>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0<u>>>0);y=(l|0)==(j|0)&D;g=0;v=S;while(1){_=E|(g|0)==0;h=g<<1;n=(pt(W,Y)|0)+i|0;c=n-z|0;u=c>>31;u=u&n|c&~u;if(_){i=f[1819+(w<<2)+h>>0]|0;n=u*3|0;if((p[N>>2]|0)>>>0<=n>>>0){p[Q>>2]=1138;p[Q+4>>2]=906;p[Q+8>>2]=1769;yi(Z,1084,Q)|0;vi(Z)|0}c=p[L>>2]|0;p[v>>2]=(m[c+(n<<1)>>1]|0)<<16|p[X+(i<<2)>>2];p[v+4>>2]=(m[c+(n+2<<1)>>1]|0)<<16|(m[c+(n+1<<1)>>1]|0)}c=v+8|0;n=(pt(W,Y)|0)+u|0;u=n-z|0;i=u>>31;i=i&n|u&~i;if(!(y|_^1)){n=f[(h|1)+(1819+(w<<2))>>0]|0;u=i*3|0;if((p[N>>2]|0)>>>0<=u>>>0){p[J>>2]=1138;p[J+4>>2]=906;p[J+8>>2]=1769;yi(Z,1084,J)|0;vi(Z)|0}_=p[L>>2]|0;p[c>>2]=(m[_+(u<<1)>>1]|0)<<16|p[X+(n<<2)>>2];p[v+12>>2]=(m[_+(u+2<<1)>>1]|0)<<16|(m[_+(u+1<<1)>>1]|0)}g=g+1|0;if((g|0)==2)break;else v=v+r|0}l=l+T|0;if((l|0)==(x|0))break;else S=S+b|0}}P=P+1|0;if((P|0)==(s|0))break;else A=A+H|0}}M=M+1|0}while((M|0)!=(I|0));C=$;return 1}function Ot(e,t,i,r,n,o,a,s){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,_=0,g=0,v=0,y=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,M=0,D=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0,V=0,z=0,U=0,G=0,H=0,W=0,q=0,j=0,Y=0,X=0,Z=0,K=0,Q=0,J=0,$=0,ee=0,te=0,ie=0,re=0,ne=0,oe=0,ae=0,se=0;se=C;C=C+608|0;ne=se+48|0;ae=se+32|0;oe=se+16|0;re=se;ie=se+96|0;ee=se+80|0;te=se+64|0;W=e+272|0;q=p[W>>2]|0;i=p[e+88>>2]|0;j=(f[i+63>>0]|0)<<8|(f[i+64>>0]|0);i=d[i+17>>0]|0;if(!(i<<24>>24)){C=se;return 1}Y=(s|0)==0;X=s+-1|0;Z=r<<1;K=e+92|0;Q=e+116|0;J=a+-1|0;$=e+212|0;H=(n&1|0)==0;G=(o&1|0)==0;V=e+288|0;z=e+284|0;U=e+164|0;F=e+268|0;k=J<<5;L=i&255;i=0;n=0;o=0;e=0;l=1;B=0;do{if(!Y){O=p[t+(B<<2)>>2]|0;N=0;while(1){I=N&1;u=(I|0)==0;D=(I<<6^64)+-32|0;I=(I<<1^2)+-1|0;R=u?a:-1;c=u?0:J;if((c|0)!=(R|0)){M=G|(N|0)!=(X|0);P=u?O:O+k|0;while(1){if((l|0)==1)l=pt(K,Q)|0|512;A=l&7;l=l>>>3;h=f[1811+A>>0]|0;u=0;do{T=(pt(K,U)|0)+e|0;x=T-q|0;e=x>>31;e=e&T|x&~e;if((p[W>>2]|0)>>>0<=e>>>0){p[re>>2]=1138;p[re+4>>2]=906;p[re+8>>2]=1769;yi(ie,1084,re)|0;vi(ie)|0}p[ee+(u<<2)>>2]=m[(p[F>>2]|0)+(e<<1)>>1];u=u+1|0}while(u>>>0<h>>>0);u=0;do{T=(pt(K,U)|0)+n|0;x=T-q|0;n=x>>31;n=n&T|x&~n;if((p[W>>2]|0)>>>0<=n>>>0){p[oe>>2]=1138;p[oe+4>>2]=906;p[oe+8>>2]=1769;yi(ie,1084,oe)|0;vi(ie)|0}p[te+(u<<2)>>2]=m[(p[F>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0<h>>>0);x=H|(c|0)!=(J|0);b=0;T=P;while(1){E=M|(b|0)==0;S=b<<1;y=0;w=T;while(1){v=(pt(K,$)|0)+o|0;g=v-j|0;o=g>>31;o=o&v|g&~o;g=(pt(K,$)|0)+i|0;v=g-j|0;i=v>>31;i=i&g|v&~i;if((x|(y|0)==0)&E){g=f[y+S+(1819+(A<<2))>>0]|0;v=o*3|0;u=p[V>>2]|0;if(u>>>0<=v>>>0){p[ae>>2]=1138;p[ae+4>>2]=906;p[ae+8>>2]=1769;yi(ie,1084,ae)|0;vi(ie)|0;u=p[V>>2]|0}h=p[z>>2]|0;_=i*3|0;if(u>>>0>_>>>0)u=h;else{p[ne>>2]=1138;p[ne+4>>2]=906;p[ne+8>>2]=1769;yi(ie,1084,ne)|0;vi(ie)|0;u=p[z>>2]|0}p[w>>2]=(m[h+(v<<1)>>1]|0)<<16|p[ee+(g<<2)>>2];p[w+4>>2]=(m[h+(v+2<<1)>>1]|0)<<16|(m[h+(v+1<<1)>>1]|0);p[w+8>>2]=(m[u+(_<<1)>>1]|0)<<16|p[te+(g<<2)>>2];p[w+12>>2]=(m[u+(_+2<<1)>>1]|0)<<16|(m[u+(_+1<<1)>>1]|0)}y=y+1|0;if((y|0)==2)break;else w=w+16|0}b=b+1|0;if((b|0)==2)break;else T=T+r|0}c=c+I|0;if((c|0)==(R|0))break;else P=P+D|0}}N=N+1|0;if((N|0)==(s|0))break;else O=O+Z|0}}B=B+1|0}while((B|0)!=(L|0));C=se;return 1}function Nt(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0;l=C;C=C+576|0;s=l+48|0;o=l+32|0;n=l+16|0;r=l;a=l+64|0;p[e>>2]=0;t=e+284|0;i=p[t>>2]|0;if(i){if(!(i&7))ot(i,0,0,1,0)|0;else{p[r>>2]=1138;p[r+4>>2]=2502;p[r+8>>2]=1504;yi(a,1084,r)|0;vi(a)|0}p[t>>2]=0;p[e+288>>2]=0;p[e+292>>2]=0}d[e+296>>0]=0;i=e+268|0;t=p[i>>2]|0;if(t){if(!(t&7))ot(t,0,0,1,0)|0;else{p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1504;yi(a,1084,n)|0;vi(a)|0}p[i>>2]=0;p[e+272>>2]=0;p[e+276>>2]=0}d[e+280>>0]=0;t=e+252|0;i=p[t>>2]|0;if(i){if(!(i&7))ot(i,0,0,1,0)|0;else{p[o>>2]=1138;p[o+4>>2]=2502;p[o+8>>2]=1504;yi(a,1084,o)|0;vi(a)|0}p[t>>2]=0;p[e+256>>2]=0;p[e+260>>2]=0}d[e+264>>0]=0;t=e+236|0;i=p[t>>2]|0;if(!i){s=e+248|0;d[s>>0]=0;s=e+212|0;lt(s);s=e+188|0;lt(s);s=e+164|0;lt(s);s=e+140|0;lt(s);s=e+116|0;lt(s);C=l;return}if(!(i&7))ot(i,0,0,1,0)|0;else{p[s>>2]=1138;p[s+4>>2]=2502;p[s+8>>2]=1504;yi(a,1084,s)|0;vi(a)|0}p[t>>2]=0;p[e+240>>2]=0;p[e+244>>2]=0;s=e+248|0;d[s>>0]=0;s=e+212|0;lt(s);s=e+188|0;lt(s);s=e+164|0;lt(s);s=e+140|0;lt(s);s=e+116|0;lt(s);C=l;return}function Lt(e,t){e=e|0;t=t|0;var i=0;i=C;C=C+16|0;p[i>>2]=t;t=p[60]|0;Ci(t,e,i)|0;fi(10,t)|0;Me()}function Bt(){var e=0,t=0;e=C;C=C+16|0;if(!(Ve(192,2)|0)){t=be(p[47]|0)|0;C=e;return t|0}else Lt(2078,e);return 0}function Ft(e){e=e|0;zi(e);return}function kt(e){e=e|0;var t=0;t=C;C=C+16|0;Pr[e&3]();Lt(2127,t)}function Vt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=p[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(p[e>>2]&-256|0)==1126902528?(p[e+4>>2]|0)==1129074247:0):0)kt(p[t+12>>2]|0);t=p[26]|0;p[26]=t+0;kt(t)}function zt(e){e=e|0;return}function Ut(e){e=e|0;return}function Gt(e){e=e|0;return}function Ht(e){e=e|0;return}function Wt(e){e=e|0;Ft(e);return}function qt(e){e=e|0;Ft(e);return}function jt(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0;a=C;C=C+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Kt(t,24,40,0)|0,(n|0)!=0):0){t=o;r=t+56|0;do{p[t>>2]=0;t=t+4|0}while((t|0)<(r|0));p[o>>2]=n;p[o+8>>2]=e;p[o+12>>2]=-1;p[o+48>>2]=1;Dr[p[(p[n>>2]|0)+28>>2]&3](n,o,p[i>>2]|0,1);if((p[o+24>>2]|0)==1){p[i>>2]=p[o+16>>2];t=1}else t=0}else t=0;else t=1;C=a;return t|0}function Yt(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0;e=t+16|0;n=p[e>>2]|0;do if(n){if((n|0)!=(i|0)){r=t+36|0;p[r>>2]=(p[r>>2]|0)+1;p[t+24>>2]=2;d[t+54>>0]=1;break}e=t+24|0;if((p[e>>2]|0)==2)p[e>>2]=r}else{p[e>>2]=i;p[t+24>>2]=r;p[t+36>>2]=1}while(0);return}function Xt(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;if((e|0)==(p[t+8>>2]|0))Yt(0,t,i,r);return}function Zt(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;if((e|0)==(p[t+8>>2]|0))Yt(0,t,i,r);else{e=p[e+8>>2]|0;Dr[p[(p[e>>2]|0)+28>>2]&3](e,t,i,r)}return}function Kt(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0,f=0,m=0,_=0;_=C;C=C+64|0;m=_;f=p[e>>2]|0;c=e+(p[f+-8>>2]|0)|0;f=p[f+-4>>2]|0;p[m>>2]=i;p[m+4>>2]=e;p[m+8>>2]=t;p[m+12>>2]=r;r=m+16|0;e=m+20|0;t=m+24|0;n=m+28|0;o=m+32|0;a=m+40|0;s=(f|0)==(i|0);l=r;u=l+36|0;do{p[l>>2]=0;l=l+4|0}while((l|0)<(u|0));h[r+36>>1]=0;d[r+38>>0]=0;e:do if(s){p[m+48>>2]=1;Mr[p[(p[i>>2]|0)+20>>2]&3](i,m,c,c,1,0);r=(p[t>>2]|0)==1?c:0}else{br[p[(p[f>>2]|0)+24>>2]&3](f,m,c,1,0);switch(p[m+36>>2]|0){case 0:{r=(p[a>>2]|0)==1&(p[n>>2]|0)==1&(p[o>>2]|0)==1?p[e>>2]|0:0;break e}case 1:break;default:{r=0;break e}}if((p[t>>2]|0)!=1?!((p[a>>2]|0)==0&(p[n>>2]|0)==1&(p[o>>2]|0)==1):0){r=0;break}r=p[r>>2]|0}while(0);C=_;return r|0}function Qt(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;d[t+53>>0]=1;do if((p[t+4>>2]|0)==(r|0)){d[t+52>>0]=1;r=t+16|0;e=p[r>>2]|0;if(!e){p[r>>2]=i;p[t+24>>2]=n;p[t+36>>2]=1;if(!((n|0)==1?(p[t+48>>2]|0)==1:0))break;d[t+54>>0]=1;break}if((e|0)!=(i|0)){n=t+36|0;p[n>>2]=(p[n>>2]|0)+1;d[t+54>>0]=1;break}e=t+24|0;r=p[e>>2]|0;if((r|0)==2){p[e>>2]=n;r=n}if((r|0)==1?(p[t+48>>2]|0)==1:0)d[t+54>>0]=1}while(0);return}function Jt(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0,s=0,l=0;e:do if((e|0)==(p[t+8>>2]|0)){if((p[t+4>>2]|0)==(i|0)?(o=t+28|0,(p[o>>2]|0)!=1):0)p[o>>2]=r}else{if((e|0)!=(p[t>>2]|0)){s=p[e+8>>2]|0;br[p[(p[s>>2]|0)+24>>2]&3](s,t,i,r,n);break}if((p[t+16>>2]|0)!=(i|0)?(a=t+20|0,(p[a>>2]|0)!=(i|0)):0){p[t+32>>2]=r;r=t+44|0;if((p[r>>2]|0)==4)break;o=t+52|0;d[o>>0]=0;l=t+53|0;d[l>>0]=0;e=p[e+8>>2]|0;Mr[p[(p[e>>2]|0)+20>>2]&3](e,t,i,i,1,n);if(d[l>>0]|0){if(!(d[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do if((s|0)==13){p[a>>2]=i;l=t+40|0;p[l>>2]=(p[l>>2]|0)+1;if((p[t+36>>2]|0)==1?(p[t+24>>2]|0)==2:0){d[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;p[r>>2]=4;break e}while(0);p[r>>2]=3;break}if((r|0)==1)p[t+32>>2]=1}while(0);return}function $t(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0;do if((e|0)==(p[t+8>>2]|0)){if((p[t+4>>2]|0)==(i|0)?(a=t+28|0,(p[a>>2]|0)!=1):0)p[a>>2]=r}else if((e|0)==(p[t>>2]|0)){if((p[t+16>>2]|0)!=(i|0)?(o=t+20|0,(p[o>>2]|0)!=(i|0)):0){p[t+32>>2]=r;p[o>>2]=i;n=t+40|0;p[n>>2]=(p[n>>2]|0)+1;if((p[t+36>>2]|0)==1?(p[t+24>>2]|0)==2:0)d[t+54>>0]=1;p[t+44>>2]=4;break}if((r|0)==1)p[t+32>>2]=1}while(0);return}function ei(e,t,i,r,n,o){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;if((e|0)==(p[t+8>>2]|0))Qt(0,t,i,r,n);else{e=p[e+8>>2]|0;Mr[p[(p[e>>2]|0)+20>>2]&3](e,t,i,r,n,o)}return}function ti(e,t,i,r,n,o){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;if((e|0)==(p[t+8>>2]|0))Qt(0,t,i,r,n);return}function ii(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0;n=C;C=C+16|0;r=n;p[r>>2]=p[i>>2];e=Er[p[(p[e>>2]|0)+16>>2]&7](e,t,r)|0;if(e)p[i>>2]=p[r>>2];C=n;return e&1|0}function ri(e){e=e|0;if(!e)e=0;else e=(Kt(e,24,72,0)|0)!=0;return e&1|0}function ni(){var e=0,t=0,i=0,r=0,n=0,o=0,a=0,s=0;n=C;C=C+48|0;a=n+32|0;i=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(r=p[e>>2]|0,(r|0)!=0):0){e=r+48|0;t=p[e>>2]|0;e=p[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){p[i>>2]=2406;Lt(2356,i)}if((t|0)==1126902529&(e|0)==1129074247)e=p[r+44>>2]|0;else e=r+80|0;p[n>>2]=e;r=p[r>>2]|0;e=p[r+4>>2]|0;if(Er[p[(p[8>>2]|0)+16>>2]&7](8,r,n)|0){s=p[n>>2]|0;s=xr[p[(p[s>>2]|0)+8>>2]&1](s)|0;p[o>>2]=2406;p[o+4>>2]=e;p[o+8>>2]=s;Lt(2270,o)}else{p[s>>2]=2406;p[s+4>>2]=e;Lt(2315,s)}}Lt(2394,a)}function oi(){var e=0;e=C;C=C+16|0;if(!(Ne(188,6)|0)){C=e;return}else Lt(2167,e)}function ai(e){e=e|0;var t=0;t=C;C=C+16|0;zi(e);if(!(Te(p[47]|0,0)|0)){C=t;return}else Lt(2217,t)}function si(e){e=e|0;var t=0,i=0;t=0;while(1){if((f[2415+t>>0]|0)==(e|0)){i=2;break}t=t+1|0;if((t|0)==87){t=87;e=2503;i=5;break}}if((i|0)==2)if(!t)e=2503;else{e=2503;i=5}if((i|0)==5)while(1){i=e;while(1){e=i+1|0;if(!(d[i>>0]|0))break;else i=e}t=t+-1|0;if(!t)break;else i=5}return e|0}function li(){var e=0;if(!0)e=248;else{e=(Pe()|0)+60|0;e=p[e>>2]|0}return e|0}function ui(e){e=e|0;var t=0;if(e>>>0>4294963200){t=li()|0;p[t>>2]=0-e;e=-1}return e|0}function ci(e,t){e=+e;t=t|0;var i=0,r=0,n=0;v[S>>3]=e;i=p[S>>2]|0;r=p[S+4>>2]|0;n=Zi(i|0,r|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0){e=+ci(e*0x10000000000000000,t);i=(p[t>>2]|0)+-64|0}else i=0;p[t>>2]=i;break}case 2047:break;default:{p[t>>2]=n+-1022;p[S>>2]=i;p[S+4>>2]=r&-2146435073|1071644672;e=+v[S>>3]}}return+e}function di(e,t){e=+e;t=t|0;return+ +ci(e,t)}function hi(e,t,i){e=e|0;t=t|0;i=i|0;do if(e){if(t>>>0<128){d[e>>0]=t;e=1;break}if(t>>>0<2048){d[e>>0]=t>>>6|192;d[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){d[e>>0]=t>>>12|224;d[e+1>>0]=t>>>6&63|128;d[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){d[e>>0]=t>>>18|240;d[e+1>>0]=t>>>12&63|128;d[e+2>>0]=t>>>6&63|128;d[e+3>>0]=t&63|128;e=4;break}else{e=li()|0;p[e>>2]=84;e=-1;break}}else e=1;while(0);return e|0}function pi(e,t){e=e|0;t=t|0;if(!e)e=0;else e=hi(e,t,0)|0;return e|0}function fi(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0;if((p[t+76>>2]|0)>=0?(Ei(t)|0)!=0:0){if((d[t+75>>0]|0)!=(e|0)?(r=t+20|0,n=p[r>>2]|0,n>>>0<(p[t+16>>2]|0)>>>0):0){p[r>>2]=n+1;d[n>>0]=e;i=e&255}else i=Ti(t,e)|0;bi(t)}else a=3;do if((a|0)==3){if((d[t+75>>0]|0)!=(e|0)?(o=t+20|0,i=p[o>>2]|0,i>>>0<(p[t+16>>2]|0)>>>0):0){p[o>>2]=i+1;d[i>>0]=e;i=e&255;break}i=Ti(t,e)|0}while(0);return i|0}function mi(e,t){e=e|0;t=t|0;return(gi(e,Ri(e)|0,1,t)|0)+-1|0}function _i(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0;r=i+16|0;n=p[r>>2]|0;if(!n)if(!(Di(i)|0)){n=p[r>>2]|0;o=4}else r=0;else o=4;e:do if((o|0)==4){a=i+20|0;o=p[a>>2]|0;if((n-o|0)>>>0<t>>>0){r=Er[p[i+36>>2]&7](i,e,t)|0;break}t:do if((d[i+75>>0]|0)>-1){r=t;while(1){if(!r){n=o;r=0;break t}n=r+-1|0;if((d[e+n>>0]|0)==10)break;else r=n}if((Er[p[i+36>>2]&7](i,e,r)|0)>>>0<r>>>0)break e;t=t-r|0;e=e+r|0;n=p[a>>2]|0}else{n=o;r=0}while(0);Qi(n|0,e|0,t|0)|0;p[a>>2]=(p[a>>2]|0)+t;r=r+t|0}while(0);return r|0}function gi(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0;n=ce(i,t)|0;if((p[r+76>>2]|0)>-1){o=(Ei(r)|0)==0;e=_i(e,n,r)|0;if(!o)bi(r)}else e=_i(e,n,r)|0;if((e|0)!=(n|0))i=(e>>>0)/(t>>>0)|0;return i|0}function vi(e){e=e|0;var t=0,i=0,r=0,n=0;r=p[61]|0;if((p[r+76>>2]|0)>-1)n=Ei(r)|0;else n=0;do if((mi(e,r)|0)<0)t=1;else{if((d[r+75>>0]|0)!=10?(t=r+20|0,i=p[t>>2]|0,i>>>0<(p[r+16>>2]|0)>>>0):0){p[t>>2]=i+1;d[i>>0]=10;t=0;break}t=(Ti(r,10)|0)<0}while(0);if(n)bi(r);return t<<31>>31|0}function yi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0;r=C;C=C+16|0;n=r;p[n>>2]=i;i=Si(e,t,n)|0;C=r;return i|0}function Ci(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,f=0,m=0,_=0,g=0;g=C;C=C+224|0;h=g+120|0;_=g+80|0;m=g;f=g+136|0;r=_;n=r+40|0;do{p[r>>2]=0;r=r+4|0}while((r|0)<(n|0));p[h>>2]=p[i>>2];if((Oi(0,t,h,m,_)|0)<0)i=-1;else{if((p[e+76>>2]|0)>-1)u=Ei(e)|0;else u=0;i=p[e>>2]|0;c=i&32;if((d[e+74>>0]|0)<1)p[e>>2]=i&-33;i=e+48|0;if(!(p[i>>2]|0)){n=e+44|0;o=p[n>>2]|0;p[n>>2]=f;a=e+28|0;p[a>>2]=f;s=e+20|0;p[s>>2]=f;p[i>>2]=80;l=e+16|0;p[l>>2]=f+80;r=Oi(e,t,h,m,_)|0;if(o){Er[p[e+36>>2]&7](e,0,0)|0;r=(p[s>>2]|0)==0?-1:r;p[n>>2]=o;p[i>>2]=0;p[l>>2]=0;p[a>>2]=0;p[s>>2]=0}}else r=Oi(e,t,h,m,_)|0;i=p[e>>2]|0;p[e>>2]=i|c;if(u)bi(e);i=(i&32|0)==0?r:-1}C=g;return i|0}function wi(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0;c=C;C=C+128|0;n=c+112|0;u=c;o=u;a=252;s=o+112|0;do{p[o>>2]=p[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;l=4}else{t=li()|0;p[t>>2]=75;t=-1}else{n=e;l=4}if((l|0)==4){l=-2-n|0;l=t>>>0>l>>>0?l:t;p[u+48>>2]=l;e=u+20|0;p[e>>2]=n;p[u+44>>2]=n;t=n+l|0;n=u+16|0;p[n>>2]=t;p[u+28>>2]=t;t=Ci(u,i,r)|0;if(l){i=p[e>>2]|0;d[i+(((i|0)==(p[n>>2]|0))<<31>>31)>>0]=0}}C=c;return t|0}function Si(e,t,i){e=e|0;t=t|0;i=i|0;return wi(e,2147483647,t,i)|0}function Ei(e){e=e|0;return 0}function bi(e){e=e|0;return}function Ti(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0;l=C;C=C+16|0;s=l;a=t&255;d[s>>0]=a;r=e+16|0;n=p[r>>2]|0;if(!n)if(!(Di(e)|0)){n=p[r>>2]|0;o=4}else i=-1;else o=4;do if((o|0)==4){r=e+20|0;o=p[r>>2]|0;if(o>>>0<n>>>0?(i=t&255,(i|0)!=(d[e+75>>0]|0)):0){p[r>>2]=o+1;d[o>>0]=a;break}if((Er[p[e+36>>2]&7](e,s,1)|0)==1)i=f[s>>0]|0;else i=-1}while(0);C=l;return i|0}function xi(e){e=e|0;var t=0,i=0;t=C;C=C+16|0;i=t;p[i>>2]=p[e+60>>2];e=ui(Ie(6,i|0)|0)|0;C=t;return e|0}function Ai(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0;n=C;C=C+32|0;o=n;r=n+20|0;p[o>>2]=p[e+60>>2];p[o+4>>2]=0;p[o+8>>2]=t;p[o+12>>2]=r;p[o+16>>2]=i;if((ui(ke(140,o|0)|0)|0)<0){p[r>>2]=-1;e=-1}else e=p[r>>2]|0;C=n;return e|0}function Pi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0;m=C;C=C+48|0;d=m+16|0;c=m;r=m+32|0;h=e+28|0;n=p[h>>2]|0;p[r>>2]=n;f=e+20|0;n=(p[f>>2]|0)-n|0;p[r+4>>2]=n;p[r+8>>2]=t;p[r+12>>2]=i;l=e+60|0;u=e+44|0;t=2;n=n+i|0;while(1){if(!(p[49]|0)){p[d>>2]=p[l>>2];p[d+4>>2]=r;p[d+8>>2]=t;a=ui(Ge(146,d|0)|0)|0}else{De(7,e|0);p[c>>2]=p[l>>2];p[c+4>>2]=r;p[c+8>>2]=t;a=ui(Ge(146,c|0)|0)|0;Ee(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=p[r+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){p[h>>2]=(p[h>>2]|0)+a;s=o;t=2}else s=o;else{s=p[u>>2]|0;p[h>>2]=s;p[f>>2]=s;s=p[r+12>>2]|0;a=a-o|0;r=r+8|0;t=t+-1|0}p[r>>2]=(p[r>>2]|0)+a;p[r+4>>2]=s-a}if((n|0)==6){d=p[u>>2]|0;p[e+16>>2]=d+(p[e+48>>2]|0);e=d;p[h>>2]=e;p[f>>2]=e}else if((n|0)==8){p[e+16>>2]=0;p[h>>2]=0;p[f>>2]=0;p[e>>2]=p[e>>2]|32;if((t|0)==2)i=0;else i=i-(p[r+4>>2]|0)|0}C=m;return i|0}function Mi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0;n=C;C=C+80|0;r=n;p[e+36>>2]=3;if((p[e>>2]&64|0)==0?(p[r>>2]=p[e+60>>2],p[r+4>>2]=21505,p[r+8>>2]=n+12,(Fe(54,r|0)|0)!=0):0)d[e+75>>0]=-1;r=Pi(e,t,i)|0;C=n;return r|0}function Di(e){e=e|0;var t=0,i=0;t=e+74|0;i=d[t>>0]|0;d[t>>0]=i+255|i;t=p[e>>2]|0;if(!(t&8)){p[e+8>>2]=0;p[e+4>>2]=0;t=p[e+44>>2]|0;p[e+28>>2]=t;p[e+20>>2]=t;p[e+16>>2]=t+(p[e+48>>2]|0);t=0}else{p[e>>2]=t|32;t=-1}return t|0}function Ii(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0;o=t&255;r=(i|0)!=0;e:do if(r&(e&3|0)!=0){n=t&255;while(1){if((d[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;i=i+-1|0;r=(i|0)!=0;if(!(r&(e&3|0)!=0)){a=5;break}}}else a=5;while(0);if((a|0)==5)if(r)a=6;else i=0;e:do if((a|0)==6){n=t&255;if((d[e>>0]|0)!=n<<24>>24){r=ce(o,16843009)|0;t:do if(i>>>0>3)while(1){o=p[e>>2]^r;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;i=i+-4|0;if(i>>>0<=3){a=11;break t}}else a=11;while(0);if((a|0)==11)if(!i){i=0;break}while(1){if((d[e>>0]|0)==n<<24>>24)break e;e=e+1|0;i=i+-1|0;if(!i){i=0;break}}}}while(0);return((i|0)!=0?e:0)|0}function Ri(e){e=e|0;var t=0,i=0,r=0;r=e;e:do if(!(r&3))i=4;else{t=e;e=r;while(1){if(!(d[t>>0]|0))break e;t=t+1|0;e=t;if(!(e&3)){e=t;i=4;break}}}while(0);if((i|0)==4){while(1){t=p[e>>2]|0;if(!((t&-2139062144^-2139062144)&t+-16843009))e=e+4|0;else break}if((t&255)<<24>>24)do e=e+1|0;while((d[e>>0]|0)!=0)}return e-r|0}function Oi(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0,m=0,_=0,g=0,y=0,w=0,E=0,b=0,T=0,x=0,A=0,P=0,M=0,D=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0,V=0,U=0,G=0,H=0,W=0,q=0,j=0,Y=0,X=0,Z=0,K=0,Q=0,J=0,$=0,ee=0,te=0,ie=0,re=0,ne=0,oe=0,ae=0;ae=C;C=C+624|0;te=ae+24|0;re=ae+16|0;ie=ae+588|0;K=ae+576|0;ee=ae;Y=ae+536|0;oe=ae+8|0;ne=ae+528|0;F=(e|0)!=0;k=Y+40|0;j=k;Y=Y+39|0;X=oe+4|0;Z=K+12|0;K=K+11|0;Q=ie;J=Z;$=J-Q|0;V=-2-Q|0;U=J+2|0;G=te+288|0;H=ie+9|0;W=H;q=ie+8|0;o=0;w=t;a=0;t=0;e:while(1){do if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=li()|0;p[o>>2]=75;o=-1;break}else{o=a+o|0;break}while(0);a=d[w>>0]|0;if(!(a<<24>>24)){B=245;break}else s=w;t:while(1){switch(a<<24>>24){case 37:{a=s;B=9;break t}case 0:{a=s;break t}default:{}}L=s+1|0;a=d[L>>0]|0;s=L}t:do if((B|0)==9)while(1){B=0;if((d[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((d[a>>0]|0)==37)B=9;else break}while(0);b=s-w|0;if(F?(p[e>>2]&32|0)==0:0)_i(w,b,e)|0;if((s|0)!=(w|0)){w=a;a=b;continue}c=a+1|0;s=d[c>>0]|0;l=(s<<24>>24)+-48|0;if(l>>>0<10){L=(d[a+2>>0]|0)==36;c=L?a+3|0:c;s=d[c>>0]|0;g=L?l:-1; -t=L?1:t}else g=-1;a=s<<24>>24;t:do if((a&-32|0)==32){l=0;while(1){if(!(1<<a+-32&75913)){m=l;a=c;break t}l=1<<(s<<24>>24)+-32|l;c=c+1|0;s=d[c>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){m=l;a=c;break}}}else{m=0;a=c}while(0);do if(s<<24>>24==42){l=a+1|0;s=(d[l>>0]|0)+-48|0;if(s>>>0<10?(d[a+2>>0]|0)==36:0){p[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=p[r+((d[l>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!F){E=m;a=l;t=0;L=0;break}t=(p[i>>2]|0)+(4-1)&~(4-1);s=p[t>>2]|0;p[i>>2]=t+4;t=0;a=l}if((s|0)<0){E=m|8192;L=0-s|0}else{E=m;L=s}}else{l=(s<<24>>24)+-48|0;if(l>>>0<10){s=0;do{s=(s*10|0)+l|0;a=a+1|0;l=(d[a>>0]|0)+-48|0}while(l>>>0<10);if((s|0)<0){o=-1;break e}else{E=m;L=s}}else{E=m;L=0}}while(0);t:do if((d[a>>0]|0)==46){l=a+1|0;s=d[l>>0]|0;if(s<<24>>24!=42){c=(s<<24>>24)+-48|0;if(c>>>0<10){a=l;s=0}else{a=l;c=0;break}while(1){s=(s*10|0)+c|0;a=a+1|0;c=(d[a>>0]|0)+-48|0;if(c>>>0>=10){c=s;break t}}}l=a+2|0;s=(d[l>>0]|0)+-48|0;if(s>>>0<10?(d[a+3>>0]|0)==36:0){p[n+(s<<2)>>2]=10;a=a+4|0;c=p[r+((d[l>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(F){a=(p[i>>2]|0)+(4-1)&~(4-1);c=p[a>>2]|0;p[i>>2]=a+4;a=l}else{a=l;c=0}}else c=-1;while(0);_=0;while(1){s=(d[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}l=a+1|0;s=d[5347+(_*58|0)+s>>0]|0;m=s&255;if((m+-1|0)>>>0<8){a=l;_=m}else{N=l;break}}if(!(s<<24>>24)){o=-1;break}l=(g|0)>-1;do if(s<<24>>24==19)if(l){o=-1;break e}else B=52;else{if(l){p[n+(g<<2)>>2]=m;R=r+(g<<3)|0;O=p[R+4>>2]|0;B=ee;p[B>>2]=p[R>>2];p[B+4>>2]=O;B=52;break}if(!F){o=0;break e}Bi(ee,m,i)}while(0);if((B|0)==52?(B=0,!F):0){w=N;a=b;continue}g=d[a>>0]|0;g=(_|0)!=0&(g&15|0)==3?g&-33:g;l=E&-65537;O=(E&8192|0)==0?E:l;t:do switch(g|0){case 110:switch(_|0){case 0:{p[p[ee>>2]>>2]=o;w=N;a=b;continue e}case 1:{p[p[ee>>2]>>2]=o;w=N;a=b;continue e}case 2:{w=p[ee>>2]|0;p[w>>2]=o;p[w+4>>2]=((o|0)<0)<<31>>31;w=N;a=b;continue e}case 3:{h[p[ee>>2]>>1]=o;w=N;a=b;continue e}case 4:{d[p[ee>>2]>>0]=o;w=N;a=b;continue e}case 6:{p[p[ee>>2]>>2]=o;w=N;a=b;continue e}case 7:{w=p[ee>>2]|0;p[w>>2]=o;p[w+4>>2]=((o|0)<0)<<31>>31;w=N;a=b;continue e}default:{w=N;a=b;continue e}}case 112:{_=O|8;c=c>>>0>8?c:8;g=120;B=64;break}case 88:case 120:{_=O;B=64;break}case 111:{l=ee;s=p[l>>2]|0;l=p[l+4>>2]|0;if((s|0)==0&(l|0)==0)a=k;else{a=k;do{a=a+-1|0;d[a>>0]=s&7|48;s=Zi(s|0,l|0,3)|0;l=z}while(!((s|0)==0&(l|0)==0))}if(!(O&8)){s=O;_=0;m=5827;B=77}else{_=j-a+1|0;s=O;c=(c|0)<(_|0)?_:c;_=0;m=5827;B=77}break}case 105:case 100:{s=ee;a=p[s>>2]|0;s=p[s+4>>2]|0;if((s|0)<0){a=ji(0,0,a|0,s|0)|0;s=z;l=ee;p[l>>2]=a;p[l+4>>2]=s;l=1;m=5827;B=76;break t}if(!(O&2048)){m=O&1;l=m;m=(m|0)==0?5827:5829;B=76}else{l=1;m=5828;B=76}break}case 117:{s=ee;a=p[s>>2]|0;s=p[s+4>>2]|0;l=0;m=5827;B=76;break}case 99:{d[Y>>0]=p[ee>>2];w=Y;s=1;_=0;g=5827;a=k;break}case 109:{a=li()|0;a=si(p[a>>2]|0)|0;B=82;break}case 115:{a=p[ee>>2]|0;a=(a|0)!=0?a:5837;B=82;break}case 67:{p[oe>>2]=p[ee>>2];p[X>>2]=0;p[ee>>2]=oe;c=-1;B=86;break}case 83:{if(!c){ki(e,32,L,0,O);a=0;B=98}else B=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{u=+v[ee>>3];p[re>>2]=0;v[S>>3]=u;if((p[S+4>>2]|0)>=0)if(!(O&2048)){R=O&1;I=R;R=(R|0)==0?5845:5850}else{I=1;R=5847}else{u=-u;I=1;R=5844}v[S>>3]=u;D=p[S+4>>2]&2146435072;do if(D>>>0<2146435072|(D|0)==2146435072&0<0){y=+di(u,re)*2;s=y!=0;if(s)p[re>>2]=(p[re>>2]|0)+-1;P=g|32;if((P|0)==97){w=g&32;b=(w|0)==0?R:R+9|0;E=I|2;a=12-c|0;do if(!(c>>>0>11|(a|0)==0)){u=8;do{a=a+-1|0;u=u*16}while((a|0)!=0);if((d[b>>0]|0)==45){u=-(u+(-y-u));break}else{u=y+u-u;break}}else u=y;while(0);s=p[re>>2]|0;a=(s|0)<0?0-s|0:s;a=Fi(a,((a|0)<0)<<31>>31,Z)|0;if((a|0)==(Z|0)){d[K>>0]=48;a=K}d[a+-1>>0]=(s>>31&2)+43;_=a+-2|0;d[_>>0]=g+15;m=(c|0)<1;l=(O&8|0)==0;s=ie;while(1){R=~~u;a=s+1|0;d[s>>0]=f[5811+R>>0]|w;u=(u-+(R|0))*16;do if((a-Q|0)==1){if(l&(m&u==0))break;d[a>>0]=46;a=s+2|0}while(0);if(!(u!=0))break;else s=a}c=(c|0)!=0&(V+a|0)<(c|0)?U+c-_|0:$-_+a|0;l=c+E|0;ki(e,32,L,l,O);if(!(p[e>>2]&32))_i(b,E,e)|0;ki(e,48,L,l,O^65536);a=a-Q|0;if(!(p[e>>2]&32))_i(ie,a,e)|0;s=J-_|0;ki(e,48,c-(a+s)|0,0,0);if(!(p[e>>2]&32))_i(_,s,e)|0;ki(e,32,L,l,O^8192);a=(l|0)<(L|0)?L:l;break}a=(c|0)<0?6:c;if(s){s=(p[re>>2]|0)+-28|0;p[re>>2]=s;u=y*268435456}else{u=y;s=p[re>>2]|0}D=(s|0)<0?te:G;M=D;s=D;do{A=~~u>>>0;p[s>>2]=A;s=s+4|0;u=(u-+(A>>>0))*1e9}while(u!=0);l=s;s=p[re>>2]|0;if((s|0)>0){m=D;while(1){_=(s|0)>29?29:s;c=l+-4|0;do if(c>>>0<m>>>0)c=m;else{s=0;do{A=Ki(p[c>>2]|0,0,_|0)|0;A=Yi(A|0,z|0,s|0,0)|0;s=z;x=or(A|0,s|0,1e9,0)|0;p[c>>2]=x;s=nr(A|0,s|0,1e9,0)|0;c=c+-4|0}while(c>>>0>=m>>>0);if(!s){c=m;break}c=m+-4|0;p[c>>2]=s}while(0);while(1){if(l>>>0<=c>>>0)break;s=l+-4|0;if(!(p[s>>2]|0))l=s;else break}s=(p[re>>2]|0)-_|0;p[re>>2]=s;if((s|0)>0)m=c;else break}}else c=D;if((s|0)<0){b=((a+25|0)/9|0)+1|0;T=(P|0)==102;w=c;while(1){E=0-s|0;E=(E|0)>9?9:E;do if(w>>>0<l>>>0){s=(1<<E)+-1|0;m=1e9>>>E;c=0;_=w;do{A=p[_>>2]|0;p[_>>2]=(A>>>E)+c;c=ce(A&s,m)|0;_=_+4|0}while(_>>>0<l>>>0);s=(p[w>>2]|0)==0?w+4|0:w;if(!c){c=s;break}p[l>>2]=c;c=s;l=l+4|0}else c=(p[w>>2]|0)==0?w+4|0:w;while(0);s=T?D:c;l=(l-s>>2|0)>(b|0)?s+(b<<2)|0:l;s=(p[re>>2]|0)+E|0;p[re>>2]=s;if((s|0)>=0){w=c;break}else w=c}}else w=c;do if(w>>>0<l>>>0){s=(M-w>>2)*9|0;m=p[w>>2]|0;if(m>>>0<10)break;else c=10;do{c=c*10|0;s=s+1|0}while(m>>>0>=c>>>0)}else s=0;while(0);x=(P|0)==103;A=(a|0)!=0;c=a-((P|0)!=102?s:0)+((A&x)<<31>>31)|0;if((c|0)<(((l-M>>2)*9|0)+-9|0)){_=c+9216|0;T=(_|0)/9|0;c=D+(T+-1023<<2)|0;_=((_|0)%9|0)+1|0;if((_|0)<9){m=10;do{m=m*10|0;_=_+1|0}while((_|0)!=9)}else m=10;E=p[c>>2]|0;b=(E>>>0)%(m>>>0)|0;if((b|0)==0?(D+(T+-1022<<2)|0)==(l|0):0)m=w;else B=163;do if((B|0)==163){B=0;y=(((E>>>0)/(m>>>0)|0)&1|0)==0?9007199254740992:9007199254740994;_=(m|0)/2|0;do if(b>>>0<_>>>0)u=.5;else{if((b|0)==(_|0)?(D+(T+-1022<<2)|0)==(l|0):0){u=1;break}u=1.5}while(0);do if(I){if((d[R>>0]|0)!=45)break;y=-y;u=-u}while(0);_=E-b|0;p[c>>2]=_;if(!(y+u!=y)){m=w;break}P=_+m|0;p[c>>2]=P;if(P>>>0>999999999){s=w;while(1){m=c+-4|0;p[c>>2]=0;if(m>>>0<s>>>0){s=s+-4|0;p[s>>2]=0}P=(p[m>>2]|0)+1|0;p[m>>2]=P;if(P>>>0>999999999)c=m;else{w=s;c=m;break}}}s=(M-w>>2)*9|0;_=p[w>>2]|0;if(_>>>0<10){m=w;break}else m=10;do{m=m*10|0;s=s+1|0}while(_>>>0>=m>>>0);m=w}while(0);P=c+4|0;w=m;l=l>>>0>P>>>0?P:l}b=0-s|0;while(1){if(l>>>0<=w>>>0){T=0;P=l;break}c=l+-4|0;if(!(p[c>>2]|0))l=c;else{T=1;P=l;break}}do if(x){a=(A&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){g=g+-1|0;a=a+-1-s|0}else{g=g+-2|0;a=a+-1|0}l=O&8;if(l)break;do if(T){l=p[P+-4>>2]|0;if(!l){c=9;break}if(!((l>>>0)%10|0)){m=10;c=0}else{c=0;break}do{m=m*10|0;c=c+1|0}while(((l>>>0)%(m>>>0)|0|0)==0)}else c=9;while(0);l=((P-M>>2)*9|0)+-9|0;if((g|32|0)==102){l=l-c|0;l=(l|0)<0?0:l;a=(a|0)<(l|0)?a:l;l=0;break}else{l=l+s-c|0;l=(l|0)<0?0:l;a=(a|0)<(l|0)?a:l;l=0;break}}else l=O&8;while(0);E=a|l;m=(E|0)!=0&1;_=(g|32|0)==102;if(_){s=(s|0)>0?s:0;g=0}else{c=(s|0)<0?b:s;c=Fi(c,((c|0)<0)<<31>>31,Z)|0;if((J-c|0)<2)do{c=c+-1|0;d[c>>0]=48}while((J-c|0)<2);d[c+-1>>0]=(s>>31&2)+43;M=c+-2|0;d[M>>0]=g;s=J-M|0;g=M}b=I+1+a+m+s|0;ki(e,32,L,b,O);if(!(p[e>>2]&32))_i(R,I,e)|0;ki(e,48,L,b,O^65536);do if(_){c=w>>>0>D>>>0?D:w;s=c;do{l=Fi(p[s>>2]|0,0,H)|0;do if((s|0)==(c|0)){if((l|0)!=(H|0))break;d[q>>0]=48;l=q}else{if(l>>>0<=ie>>>0)break;do{l=l+-1|0;d[l>>0]=48}while(l>>>0>ie>>>0)}while(0);if(!(p[e>>2]&32))_i(l,W-l|0,e)|0;s=s+4|0}while(s>>>0<=D>>>0);do if(E){if(p[e>>2]&32)break;_i(5879,1,e)|0}while(0);if((a|0)>0&s>>>0<P>>>0){l=s;while(1){s=Fi(p[l>>2]|0,0,H)|0;if(s>>>0>ie>>>0)do{s=s+-1|0;d[s>>0]=48}while(s>>>0>ie>>>0);if(!(p[e>>2]&32))_i(s,(a|0)>9?9:a,e)|0;l=l+4|0;s=a+-9|0;if(!((a|0)>9&l>>>0<P>>>0)){a=s;break}else a=s}}ki(e,48,a+9|0,9,0)}else{_=T?P:w+4|0;if((a|0)>-1){m=(l|0)==0;c=w;do{s=Fi(p[c>>2]|0,0,H)|0;if((s|0)==(H|0)){d[q>>0]=48;s=q}do if((c|0)==(w|0)){l=s+1|0;if(!(p[e>>2]&32))_i(s,1,e)|0;if(m&(a|0)<1){s=l;break}if(p[e>>2]&32){s=l;break}_i(5879,1,e)|0;s=l}else{if(s>>>0<=ie>>>0)break;do{s=s+-1|0;d[s>>0]=48}while(s>>>0>ie>>>0)}while(0);l=W-s|0;if(!(p[e>>2]&32))_i(s,(a|0)>(l|0)?l:a,e)|0;a=a-l|0;c=c+4|0}while(c>>>0<_>>>0&(a|0)>-1)}ki(e,48,a+18|0,18,0);if(p[e>>2]&32)break;_i(g,J-g|0,e)|0}while(0);ki(e,32,L,b,O^8192);a=(b|0)<(L|0)?L:b}else{_=(g&32|0)!=0;m=u!=u|0!=0;s=m?0:I;c=s+3|0;ki(e,32,L,c,l);a=p[e>>2]|0;if(!(a&32)){_i(R,s,e)|0;a=p[e>>2]|0}if(!(a&32))_i(m?_?5871:5875:_?5863:5867,3,e)|0;ki(e,32,L,c,O^8192);a=(c|0)<(L|0)?L:c}while(0);w=N;continue e}default:{l=O;s=c;_=0;g=5827;a=k}}while(0);t:do if((B|0)==64){l=ee;s=p[l>>2]|0;l=p[l+4>>2]|0;m=g&32;if(!((s|0)==0&(l|0)==0)){a=k;do{a=a+-1|0;d[a>>0]=f[5811+(s&15)>>0]|m;s=Zi(s|0,l|0,4)|0;l=z}while(!((s|0)==0&(l|0)==0));B=ee;if((_&8|0)==0|(p[B>>2]|0)==0&(p[B+4>>2]|0)==0){s=_;_=0;m=5827;B=77}else{s=_;_=2;m=5827+(g>>4)|0;B=77}}else{a=k;s=_;_=0;m=5827;B=77}}else if((B|0)==76){a=Fi(a,s,k)|0;s=O;_=l;B=77}else if((B|0)==82){B=0;O=Ii(a,0,c)|0;R=(O|0)==0;w=a;s=R?c:O-a|0;_=0;g=5827;a=R?a+c|0:O}else if((B|0)==86){B=0;s=0;a=0;m=p[ee>>2]|0;while(1){l=p[m>>2]|0;if(!l)break;a=pi(ne,l)|0;if((a|0)<0|a>>>0>(c-s|0)>>>0)break;s=a+s|0;if(c>>>0>s>>>0)m=m+4|0;else break}if((a|0)<0){o=-1;break e}ki(e,32,L,s,O);if(!s){a=0;B=98}else{l=0;c=p[ee>>2]|0;while(1){a=p[c>>2]|0;if(!a){a=s;B=98;break t}a=pi(ne,a)|0;l=a+l|0;if((l|0)>(s|0)){a=s;B=98;break t}if(!(p[e>>2]&32))_i(ne,a,e)|0;if(l>>>0>=s>>>0){a=s;B=98;break}else c=c+4|0}}}while(0);if((B|0)==98){B=0;ki(e,32,L,a,O^8192);w=N;a=(L|0)>(a|0)?L:a;continue}if((B|0)==77){B=0;l=(c|0)>-1?s&-65537:s;s=ee;s=(p[s>>2]|0)!=0|(p[s+4>>2]|0)!=0;if((c|0)!=0|s){s=(s&1^1)+(j-a)|0;w=a;s=(c|0)>(s|0)?c:s;g=m;a=k}else{w=k;s=0;g=m;a=k}}m=a-w|0;s=(s|0)<(m|0)?m:s;c=_+s|0;a=(L|0)<(c|0)?c:L;ki(e,32,a,c,l);if(!(p[e>>2]&32))_i(g,_,e)|0;ki(e,48,a,c,l^65536);ki(e,48,s,m,0);if(!(p[e>>2]&32))_i(w,m,e)|0;ki(e,32,a,c,l^8192);w=N}e:do if((B|0)==245)if(!e)if(t){o=1;while(1){t=p[n+(o<<2)>>2]|0;if(!t)break;Bi(r+(o<<3)|0,t,i);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(p[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0;while(0);C=ae;return o|0}function Ni(e){e=e|0;if(!(p[e+68>>2]|0))bi(e);return}function Li(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0;r=e+20|0;n=p[r>>2]|0;e=(p[e+16>>2]|0)-n|0;e=e>>>0>i>>>0?i:e;Qi(n|0,t|0,e|0)|0;p[r>>2]=(p[r>>2]|0)+e;return i|0}function Bi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0;e:do if(t>>>0<=20)do switch(t|0){case 9:{r=(p[i>>2]|0)+(4-1)&~(4-1);t=p[r>>2]|0;p[i>>2]=r+4;p[e>>2]=t;break e}case 10:{r=(p[i>>2]|0)+(4-1)&~(4-1);t=p[r>>2]|0;p[i>>2]=r+4;r=e;p[r>>2]=t;p[r+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{r=(p[i>>2]|0)+(4-1)&~(4-1);t=p[r>>2]|0;p[i>>2]=r+4;r=e;p[r>>2]=t;p[r+4>>2]=0;break e}case 12:{r=(p[i>>2]|0)+(8-1)&~(8-1);t=r;n=p[t>>2]|0;t=p[t+4>>2]|0;p[i>>2]=r+8;r=e;p[r>>2]=n;p[r+4>>2]=t;break e}case 13:{n=(p[i>>2]|0)+(4-1)&~(4-1);r=p[n>>2]|0;p[i>>2]=n+4;r=(r&65535)<<16>>16;n=e;p[n>>2]=r;p[n+4>>2]=((r|0)<0)<<31>>31;break e}case 14:{n=(p[i>>2]|0)+(4-1)&~(4-1);r=p[n>>2]|0;p[i>>2]=n+4;n=e;p[n>>2]=r&65535;p[n+4>>2]=0;break e}case 15:{n=(p[i>>2]|0)+(4-1)&~(4-1);r=p[n>>2]|0;p[i>>2]=n+4;r=(r&255)<<24>>24;n=e;p[n>>2]=r;p[n+4>>2]=((r|0)<0)<<31>>31;break e}case 16:{n=(p[i>>2]|0)+(4-1)&~(4-1);r=p[n>>2]|0;p[i>>2]=n+4;n=e;p[n>>2]=r&255;p[n+4>>2]=0;break e}case 17:{n=(p[i>>2]|0)+(8-1)&~(8-1);o=+v[n>>3];p[i>>2]=n+8;v[e>>3]=o;break e}case 18:{n=(p[i>>2]|0)+(8-1)&~(8-1);o=+v[n>>3];p[i>>2]=n+8;v[e>>3]=o;break e}default:break e}while(0);while(0);return}function Fi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){r=or(e|0,t|0,10,0)|0;i=i+-1|0;d[i>>0]=r|48;r=nr(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=r;t=z}else{e=r;break}}if(e)while(1){i=i+-1|0;d[i>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return i|0}function ki(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0,s=0;s=C;C=C+256|0;a=s;do if((i|0)>(r|0)&(n&73728|0)==0){n=i-r|0;Xi(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=p[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){r=i-r|0;do{if(o){_i(a,256,e)|0;t=p[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=r&255;else break}else if(!o)break;_i(a,n,e)|0}while(0);C=s;return}function Vi(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,_=0,g=0,v=0,y=0,C=0,w=0,S=0,E=0,b=0,T=0,x=0,A=0,P=0,M=0,D=0,I=0,R=0,O=0,N=0,L=0,B=0,F=0,k=0;do if(e>>>0<245){f=e>>>0<11?16:e+11&-8;e=f>>>3;s=p[147]|0;i=s>>>e;if(i&3){e=(i&1^1)+e|0;r=e<<1;i=628+(r<<2)|0;r=628+(r+2<<2)|0;n=p[r>>2]|0;o=n+8|0;a=p[o>>2]|0;do if((i|0)!=(a|0)){if(a>>>0<(p[151]|0)>>>0)Me();t=a+12|0;if((p[t>>2]|0)==(n|0)){p[t>>2]=i;p[r>>2]=a;break}else Me()}else p[147]=s&~(1<<e);while(0);k=e<<3;p[n+4>>2]=k|3;k=n+(k|4)|0;p[k>>2]=p[k>>2]|1;k=o;return k|0}a=p[149]|0;if(f>>>0>a>>>0){if(i){r=2<<e;r=i<<e&(r|0-r);r=(r&0-r)+-1|0;l=r>>>12&16;r=r>>>l;n=r>>>5&8;r=r>>>n;o=r>>>2&4;r=r>>>o;i=r>>>1&2;r=r>>>i;e=r>>>1&1;e=(n|l|o|i|e)+(r>>>e)|0;r=e<<1;i=628+(r<<2)|0;r=628+(r+2<<2)|0;o=p[r>>2]|0;l=o+8|0;n=p[l>>2]|0;do if((i|0)!=(n|0)){if(n>>>0<(p[151]|0)>>>0)Me();t=n+12|0;if((p[t>>2]|0)==(o|0)){p[t>>2]=i;p[r>>2]=n;u=p[149]|0;break}else Me()}else{p[147]=s&~(1<<e);u=a}while(0);k=e<<3;a=k-f|0;p[o+4>>2]=f|3;s=o+f|0;p[o+(f|4)>>2]=a|1;p[o+k>>2]=a;if(u){n=p[152]|0;i=u>>>3;t=i<<1;r=628+(t<<2)|0;e=p[147]|0;i=1<<i;if(e&i){e=628+(t+2<<2)|0;t=p[e>>2]|0;if(t>>>0<(p[151]|0)>>>0)Me();else{c=e;d=t}}else{p[147]=e|i;c=628+(t+2<<2)|0;d=r}p[c>>2]=n;p[d+12>>2]=n;p[n+8>>2]=d;p[n+12>>2]=r}p[149]=a;p[152]=s;k=l;return k|0}e=p[148]|0;if(e){i=(e&0-e)+-1|0;F=i>>>12&16;i=i>>>F;B=i>>>5&8;i=i>>>B;k=i>>>2&4;i=i>>>k;e=i>>>1&2;i=i>>>e;r=i>>>1&1;r=p[892+((B|F|k|e|r)+(i>>>r)<<2)>>2]|0;i=(p[r+4>>2]&-8)-f|0;e=r;while(1){t=p[e+16>>2]|0;if(!t){t=p[e+20>>2]|0;if(!t){l=i;break}}e=(p[t+4>>2]&-8)-f|0;k=e>>>0<i>>>0;i=k?e:i;e=t;r=k?t:r}o=p[151]|0;if(r>>>0<o>>>0)Me();s=r+f|0;if(r>>>0>=s>>>0)Me();a=p[r+24>>2]|0;i=p[r+12>>2]|0;do if((i|0)==(r|0)){e=r+20|0;t=p[e>>2]|0;if(!t){e=r+16|0;t=p[e>>2]|0;if(!t){h=0;break}}while(1){i=t+20|0;n=p[i>>2]|0;if(n){t=n;e=i;continue}i=t+16|0;n=p[i>>2]|0;if(!n)break;else{t=n;e=i}}if(e>>>0<o>>>0)Me();else{p[e>>2]=0;h=t;break}}else{n=p[r+8>>2]|0;if(n>>>0<o>>>0)Me();t=n+12|0;if((p[t>>2]|0)!=(r|0))Me();e=i+8|0;if((p[e>>2]|0)==(r|0)){p[t>>2]=i;p[e>>2]=n;h=i;break}else Me()}while(0);do if(a){t=p[r+28>>2]|0;e=892+(t<<2)|0;if((r|0)==(p[e>>2]|0)){p[e>>2]=h;if(!h){p[148]=p[148]&~(1<<t);break}}else{if(a>>>0<(p[151]|0)>>>0)Me();t=a+16|0;if((p[t>>2]|0)==(r|0))p[t>>2]=h;else p[a+20>>2]=h;if(!h)break}e=p[151]|0;if(h>>>0<e>>>0)Me();p[h+24>>2]=a;t=p[r+16>>2]|0;do if(t)if(t>>>0<e>>>0)Me();else{p[h+16>>2]=t;p[t+24>>2]=h;break}while(0);t=p[r+20>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)Me();else{p[h+20>>2]=t;p[t+24>>2]=h;break}}while(0);if(l>>>0<16){k=l+f|0;p[r+4>>2]=k|3;k=r+(k+4)|0;p[k>>2]=p[k>>2]|1}else{p[r+4>>2]=f|3;p[r+(f|4)>>2]=l|1;p[r+(l+f)>>2]=l;t=p[149]|0;if(t){o=p[152]|0;i=t>>>3;t=i<<1;n=628+(t<<2)|0;e=p[147]|0;i=1<<i;if(e&i){t=628+(t+2<<2)|0;e=p[t>>2]|0;if(e>>>0<(p[151]|0)>>>0)Me();else{m=t;_=e}}else{p[147]=e|i;m=628+(t+2<<2)|0;_=n}p[m>>2]=o;p[_+12>>2]=o;p[o+8>>2]=_;p[o+12>>2]=n}p[149]=l;p[152]=s}k=r+8|0;return k|0}else _=f}else _=f}else if(e>>>0<=4294967231){e=e+11|0;d=e&-8;c=p[148]|0;if(c){i=0-d|0;e=e>>>8;if(e)if(d>>>0>16777215)u=31;else{_=(e+1048320|0)>>>16&8;w=e<<_;m=(w+520192|0)>>>16&4;w=w<<m;u=(w+245760|0)>>>16&2;u=14-(m|_|u)+(w<<u>>>15)|0;u=d>>>(u+7|0)&1|u<<1}else u=0;e=p[892+(u<<2)>>2]|0;e:do if(!e){n=0;e=0;w=86}else{a=i;n=0;s=d<<((u|0)==31?0:25-(u>>>1)|0);l=e;e=0;while(1){o=p[l+4>>2]&-8;i=o-d|0;if(i>>>0<a>>>0)if((o|0)==(d|0)){o=l;e=l;w=90;break e}else e=l;else i=a;w=p[l+20>>2]|0;l=p[l+16+(s>>>31<<2)>>2]|0;n=(w|0)==0|(w|0)==(l|0)?n:w;if(!l){w=86;break}else{a=i;s=s<<1}}}while(0);if((w|0)==86){if((n|0)==0&(e|0)==0){e=2<<u;e=c&(e|0-e);if(!e){_=d;break}e=(e&0-e)+-1|0;h=e>>>12&16;e=e>>>h;c=e>>>5&8;e=e>>>c;m=e>>>2&4;e=e>>>m;_=e>>>1&2;e=e>>>_;n=e>>>1&1;n=p[892+((c|h|m|_|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=i;l=e}else{o=n;w=90}}if((w|0)==90)while(1){w=0;_=(p[o+4>>2]&-8)-d|0;n=_>>>0<i>>>0;i=n?_:i;e=n?o:e;n=p[o+16>>2]|0;if(n){o=n;w=90;continue}o=p[o+20>>2]|0;if(!o){s=i;l=e;break}else w=90}if((l|0)!=0?s>>>0<((p[149]|0)-d|0)>>>0:0){n=p[151]|0;if(l>>>0<n>>>0)Me();a=l+d|0;if(l>>>0>=a>>>0)Me();o=p[l+24>>2]|0;i=p[l+12>>2]|0;do if((i|0)==(l|0)){e=l+20|0;t=p[e>>2]|0;if(!t){e=l+16|0;t=p[e>>2]|0;if(!t){f=0;break}}while(1){i=t+20|0;r=p[i>>2]|0;if(r){t=r;e=i;continue}i=t+16|0;r=p[i>>2]|0;if(!r)break;else{t=r;e=i}}if(e>>>0<n>>>0)Me();else{p[e>>2]=0;f=t;break}}else{r=p[l+8>>2]|0;if(r>>>0<n>>>0)Me();t=r+12|0;if((p[t>>2]|0)!=(l|0))Me();e=i+8|0;if((p[e>>2]|0)==(l|0)){p[t>>2]=i;p[e>>2]=r;f=i;break}else Me()}while(0);do if(o){t=p[l+28>>2]|0;e=892+(t<<2)|0;if((l|0)==(p[e>>2]|0)){p[e>>2]=f;if(!f){p[148]=p[148]&~(1<<t);break}}else{if(o>>>0<(p[151]|0)>>>0)Me();t=o+16|0;if((p[t>>2]|0)==(l|0))p[t>>2]=f;else p[o+20>>2]=f;if(!f)break}e=p[151]|0;if(f>>>0<e>>>0)Me();p[f+24>>2]=o;t=p[l+16>>2]|0;do if(t)if(t>>>0<e>>>0)Me();else{p[f+16>>2]=t;p[t+24>>2]=f;break}while(0);t=p[l+20>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)Me();else{p[f+20>>2]=t;p[t+24>>2]=f;break}}while(0);e:do if(s>>>0>=16){p[l+4>>2]=d|3;p[l+(d|4)>>2]=s|1;p[l+(s+d)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;r=628+(e<<2)|0;i=p[147]|0;t=1<<t;if(i&t){t=628+(e+2<<2)|0;e=p[t>>2]|0;if(e>>>0<(p[151]|0)>>>0)Me();else{v=t;y=e}}else{p[147]=i|t;v=628+(e+2<<2)|0;y=r}p[v>>2]=a;p[y+12>>2]=a;p[l+(d+8)>>2]=y;p[l+(d+12)>>2]=r;break}t=s>>>8;if(t)if(s>>>0>16777215)r=31;else{F=(t+1048320|0)>>>16&8;k=t<<F;B=(k+520192|0)>>>16&4;k=k<<B;r=(k+245760|0)>>>16&2;r=14-(B|F|r)+(k<<r>>>15)|0;r=s>>>(r+7|0)&1|r<<1}else r=0;t=892+(r<<2)|0;p[l+(d+28)>>2]=r;p[l+(d+20)>>2]=0;p[l+(d+16)>>2]=0;e=p[148]|0;i=1<<r;if(!(e&i)){p[148]=e|i;p[t>>2]=a;p[l+(d+24)>>2]=t;p[l+(d+12)>>2]=a;p[l+(d+8)>>2]=a;break}t=p[t>>2]|0;t:do if((p[t+4>>2]&-8|0)!=(s|0)){r=s<<((r|0)==31?0:25-(r>>>1)|0);while(1){e=t+16+(r>>>31<<2)|0;i=p[e>>2]|0;if(!i)break;if((p[i+4>>2]&-8|0)==(s|0)){b=i;break t}else{r=r<<1;t=i}}if(e>>>0<(p[151]|0)>>>0)Me();else{p[e>>2]=a;p[l+(d+24)>>2]=t;p[l+(d+12)>>2]=a;p[l+(d+8)>>2]=a;break e}}else b=t;while(0);t=b+8|0;e=p[t>>2]|0;k=p[151]|0;if(e>>>0>=k>>>0&b>>>0>=k>>>0){p[e+12>>2]=a;p[t>>2]=a;p[l+(d+8)>>2]=e;p[l+(d+12)>>2]=b;p[l+(d+24)>>2]=0;break}else Me()}else{k=s+d|0;p[l+4>>2]=k|3;k=l+(k+4)|0;p[k>>2]=p[k>>2]|1}while(0);k=l+8|0;return k|0}else _=d}else _=d}else _=-1;while(0);i=p[149]|0;if(i>>>0>=_>>>0){t=i-_|0;e=p[152]|0;if(t>>>0>15){p[152]=e+_;p[149]=t;p[e+(_+4)>>2]=t|1;p[e+i>>2]=t;p[e+4>>2]=_|3}else{p[149]=0;p[152]=0;p[e+4>>2]=i|3;k=e+(i+4)|0;p[k>>2]=p[k>>2]|1}k=e+8|0;return k|0}e=p[150]|0;if(e>>>0>_>>>0){F=e-_|0;p[150]=F;k=p[153]|0;p[153]=k+_;p[k+(_+4)>>2]=F|1;p[k+4>>2]=_|3;k=k+8|0;return k|0}do if(!(p[265]|0)){e=Ue(30)|0;if(!(e+-1&e)){p[267]=e;p[266]=e;p[268]=-1;p[269]=-1;p[270]=0;p[258]=0;b=(Oe(0)|0)&-16^1431655768;p[265]=b;break}else Me()}while(0);l=_+48|0;s=p[267]|0;u=_+47|0;a=s+u|0;s=0-s|0;c=a&s;if(c>>>0<=_>>>0){k=0;return k|0}e=p[257]|0;if((e|0)!=0?(y=p[255]|0,b=y+c|0,b>>>0<=y>>>0|b>>>0>e>>>0):0){k=0;return k|0}e:do if(!(p[258]&4)){e=p[153]|0;t:do if(e){n=1036;while(1){i=p[n>>2]|0;if(i>>>0<=e>>>0?(g=n+4|0,(i+(p[g>>2]|0)|0)>>>0>e>>>0):0){o=n;e=g;break}n=p[n+8>>2]|0;if(!n){w=174;break t}}i=a-(p[150]|0)&s;if(i>>>0<2147483647){n=Re(i|0)|0;b=(n|0)==((p[o>>2]|0)+(p[e>>2]|0)|0);e=b?i:0;if(b){if((n|0)!=(-1|0)){S=n;m=e;w=194;break e}}else w=184}else e=0}else w=174;while(0);do if((w|0)==174){o=Re(0)|0;if((o|0)!=(-1|0)){e=o;i=p[266]|0;n=i+-1|0;if(!(n&e))i=c;else i=c-e+(n+e&0-i)|0;e=p[255]|0;n=e+i|0;if(i>>>0>_>>>0&i>>>0<2147483647){b=p[257]|0;if((b|0)!=0?n>>>0<=e>>>0|n>>>0>b>>>0:0){e=0;break}n=Re(i|0)|0;b=(n|0)==(o|0);e=b?i:0;if(b){S=o;m=e;w=194;break e}else w=184}else e=0}else e=0}while(0);t:do if((w|0)==184){o=0-i|0;do if(l>>>0>i>>>0&(i>>>0<2147483647&(n|0)!=(-1|0))?(C=p[267]|0,C=u-i+C&0-C,C>>>0<2147483647):0)if((Re(C|0)|0)==(-1|0)){Re(o|0)|0;break t}else{i=C+i|0;break}while(0);if((n|0)!=(-1|0)){S=n;m=i;w=194;break e}}while(0);p[258]=p[258]|4;w=191}else{e=0;w=191}while(0);if((((w|0)==191?c>>>0<2147483647:0)?(S=Re(c|0)|0,E=Re(0)|0,S>>>0<E>>>0&((S|0)!=(-1|0)&(E|0)!=(-1|0))):0)?(T=E-S|0,x=T>>>0>(_+40|0)>>>0,x):0){m=x?T:e;w=194}if((w|0)==194){e=(p[255]|0)+m|0;p[255]=e;if(e>>>0>(p[256]|0)>>>0)p[256]=e;a=p[153]|0;e:do if(a){o=1036;do{e=p[o>>2]|0;i=o+4|0;n=p[i>>2]|0;if((S|0)==(e+n|0)){A=e;P=i;M=n;D=o;w=204;break}o=p[o+8>>2]|0}while((o|0)!=0);if(((w|0)==204?(p[D+12>>2]&8|0)==0:0)?a>>>0<S>>>0&a>>>0>=A>>>0:0){p[P>>2]=M+m;k=(p[150]|0)+m|0;F=a+8|0;F=(F&7|0)==0?0:0-F&7;B=k-F|0;p[153]=a+F;p[150]=B;p[a+(F+4)>>2]=B|1;p[a+(k+4)>>2]=40;p[154]=p[269];break}e=p[151]|0;if(S>>>0<e>>>0){p[151]=S;e=S}i=S+m|0;o=1036;while(1){if((p[o>>2]|0)==(i|0)){n=o;i=o;w=212;break}o=p[o+8>>2]|0;if(!o){i=1036;break}}if((w|0)==212)if(!(p[i+12>>2]&8)){p[n>>2]=S;h=i+4|0;p[h>>2]=(p[h>>2]|0)+m;h=S+8|0;h=(h&7|0)==0?0:0-h&7;u=S+(m+8)|0;u=(u&7|0)==0?0:0-u&7;t=S+(u+m)|0;d=h+_|0;f=S+d|0;c=t-(S+h)-_|0;p[S+(h+4)>>2]=_|3;t:do if((t|0)!=(a|0)){if((t|0)==(p[152]|0)){k=(p[149]|0)+c|0;p[149]=k;p[152]=f;p[S+(d+4)>>2]=k|1;p[S+(k+d)>>2]=k;break}s=m+4|0;i=p[S+(s+u)>>2]|0;if((i&3|0)==1){l=i&-8;o=i>>>3;i:do if(i>>>0>=256){a=p[S+((u|24)+m)>>2]|0;r=p[S+(m+12+u)>>2]|0;do if((r|0)==(t|0)){n=u|16;r=S+(s+n)|0;i=p[r>>2]|0;if(!i){r=S+(n+m)|0;i=p[r>>2]|0;if(!i){L=0;break}}while(1){n=i+20|0;o=p[n>>2]|0;if(o){i=o;r=n;continue}n=i+16|0;o=p[n>>2]|0;if(!o)break;else{i=o;r=n}}if(r>>>0<e>>>0)Me();else{p[r>>2]=0;L=i;break}}else{n=p[S+((u|8)+m)>>2]|0;if(n>>>0<e>>>0)Me();e=n+12|0;if((p[e>>2]|0)!=(t|0))Me();i=r+8|0;if((p[i>>2]|0)==(t|0)){p[e>>2]=r;p[i>>2]=n;L=r;break}else Me()}while(0);if(!a)break;e=p[S+(m+28+u)>>2]|0;i=892+(e<<2)|0;do if((t|0)!=(p[i>>2]|0)){if(a>>>0<(p[151]|0)>>>0)Me();e=a+16|0;if((p[e>>2]|0)==(t|0))p[e>>2]=L;else p[a+20>>2]=L;if(!L)break i}else{p[i>>2]=L;if(L)break;p[148]=p[148]&~(1<<e);break i}while(0);i=p[151]|0;if(L>>>0<i>>>0)Me();p[L+24>>2]=a;t=u|16;e=p[S+(t+m)>>2]|0;do if(e)if(e>>>0<i>>>0)Me();else{p[L+16>>2]=e;p[e+24>>2]=L;break}while(0);t=p[S+(s+t)>>2]|0;if(!t)break;if(t>>>0<(p[151]|0)>>>0)Me();else{p[L+20>>2]=t;p[t+24>>2]=L;break}}else{r=p[S+((u|8)+m)>>2]|0;n=p[S+(m+12+u)>>2]|0;i=628+(o<<1<<2)|0;do if((r|0)!=(i|0)){if(r>>>0<e>>>0)Me();if((p[r+12>>2]|0)==(t|0))break;Me()}while(0);if((n|0)==(r|0)){p[147]=p[147]&~(1<<o);break}do if((n|0)==(i|0))I=n+8|0;else{if(n>>>0<e>>>0)Me();e=n+8|0;if((p[e>>2]|0)==(t|0)){I=e;break}Me()}while(0);p[r+12>>2]=n;p[I>>2]=r}while(0);t=S+((l|u)+m)|0;n=l+c|0}else n=c;t=t+4|0;p[t>>2]=p[t>>2]&-2;p[S+(d+4)>>2]=n|1;p[S+(n+d)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;r=628+(e<<2)|0;i=p[147]|0;t=1<<t;do if(!(i&t)){p[147]=i|t;B=628+(e+2<<2)|0;F=r}else{t=628+(e+2<<2)|0;e=p[t>>2]|0;if(e>>>0>=(p[151]|0)>>>0){B=t;F=e;break}Me()}while(0);p[B>>2]=f;p[F+12>>2]=f;p[S+(d+8)>>2]=F;p[S+(d+12)>>2]=r;break}t=n>>>8;do if(!t)r=0;else{if(n>>>0>16777215){r=31;break}B=(t+1048320|0)>>>16&8;F=t<<B;L=(F+520192|0)>>>16&4;F=F<<L;r=(F+245760|0)>>>16&2;r=14-(L|B|r)+(F<<r>>>15)|0;r=n>>>(r+7|0)&1|r<<1}while(0);t=892+(r<<2)|0;p[S+(d+28)>>2]=r;p[S+(d+20)>>2]=0;p[S+(d+16)>>2]=0;e=p[148]|0;i=1<<r;if(!(e&i)){p[148]=e|i;p[t>>2]=f;p[S+(d+24)>>2]=t;p[S+(d+12)>>2]=f;p[S+(d+8)>>2]=f;break}t=p[t>>2]|0;i:do if((p[t+4>>2]&-8|0)!=(n|0)){r=n<<((r|0)==31?0:25-(r>>>1)|0);while(1){e=t+16+(r>>>31<<2)|0;i=p[e>>2]|0;if(!i)break;if((p[i+4>>2]&-8|0)==(n|0)){k=i;break i}else{r=r<<1;t=i}}if(e>>>0<(p[151]|0)>>>0)Me();else{p[e>>2]=f;p[S+(d+24)>>2]=t;p[S+(d+12)>>2]=f;p[S+(d+8)>>2]=f;break t}}else k=t;while(0);t=k+8|0;e=p[t>>2]|0;F=p[151]|0;if(e>>>0>=F>>>0&k>>>0>=F>>>0){p[e+12>>2]=f;p[t>>2]=f;p[S+(d+8)>>2]=e;p[S+(d+12)>>2]=k;p[S+(d+24)>>2]=0;break}else Me()}else{k=(p[150]|0)+c|0;p[150]=k;p[153]=f;p[S+(d+4)>>2]=k|1}while(0);k=S+(h|8)|0;return k|0}else i=1036;while(1){e=p[i>>2]|0;if(e>>>0<=a>>>0?(t=p[i+4>>2]|0,r=e+t|0,r>>>0>a>>>0):0)break;i=p[i+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0<n>>>0?a:e;t=e+8|0;i=S+8|0;i=(i&7|0)==0?0:0-i&7;k=m+-40-i|0;p[153]=S+i;p[150]=k;p[S+(i+4)>>2]=k|1;p[S+(m+-36)>>2]=40;p[154]=p[269];i=e+4|0;p[i>>2]=27;p[t>>2]=p[259];p[t+4>>2]=p[260];p[t+8>>2]=p[261];p[t+12>>2]=p[262];p[259]=S;p[260]=m;p[262]=0;p[261]=t;t=e+28|0;p[t>>2]=7;if((e+32|0)>>>0<r>>>0)do{k=t;t=t+4|0;p[t>>2]=7}while((k+8|0)>>>0<r>>>0);if((e|0)!=(a|0)){o=e-a|0;p[i>>2]=p[i>>2]&-2;p[a+4>>2]=o|1;p[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;r=628+(e<<2)|0;i=p[147]|0;t=1<<t;if(i&t){t=628+(e+2<<2)|0;e=p[t>>2]|0;if(e>>>0<(p[151]|0)>>>0)Me();else{R=t;O=e}}else{p[147]=i|t;R=628+(e+2<<2)|0;O=r}p[R>>2]=a;p[O+12>>2]=a;p[a+8>>2]=O;p[a+12>>2]=r;break}t=o>>>8;if(t)if(o>>>0>16777215)r=31;else{F=(t+1048320|0)>>>16&8;k=t<<F;B=(k+520192|0)>>>16&4;k=k<<B;r=(k+245760|0)>>>16&2;r=14-(B|F|r)+(k<<r>>>15)|0;r=o>>>(r+7|0)&1|r<<1}else r=0;i=892+(r<<2)|0;p[a+28>>2]=r;p[a+20>>2]=0;p[n>>2]=0;t=p[148]|0;e=1<<r;if(!(t&e)){p[148]=t|e;p[i>>2]=a;p[a+24>>2]=i;p[a+12>>2]=a;p[a+8>>2]=a;break}t=p[i>>2]|0;t:do if((p[t+4>>2]&-8|0)!=(o|0)){r=o<<((r|0)==31?0:25-(r>>>1)|0);while(1){e=t+16+(r>>>31<<2)|0;i=p[e>>2]|0;if(!i)break;if((p[i+4>>2]&-8|0)==(o|0)){N=i;break t}else{r=r<<1;t=i}}if(e>>>0<(p[151]|0)>>>0)Me();else{p[e>>2]=a;p[a+24>>2]=t;p[a+12>>2]=a;p[a+8>>2]=a;break e}}else N=t;while(0);t=N+8|0;e=p[t>>2]|0;k=p[151]|0;if(e>>>0>=k>>>0&N>>>0>=k>>>0){p[e+12>>2]=a;p[t>>2]=a;p[a+8>>2]=e;p[a+12>>2]=N;p[a+24>>2]=0;break}else Me()}}else{k=p[151]|0;if((k|0)==0|S>>>0<k>>>0)p[151]=S;p[259]=S;p[260]=m;p[262]=0;p[156]=p[265];p[155]=-1;t=0;do{k=t<<1;F=628+(k<<2)|0;p[628+(k+3<<2)>>2]=F;p[628+(k+2<<2)>>2]=F;t=t+1|0}while((t|0)!=32);k=S+8|0;k=(k&7|0)==0?0:0-k&7;F=m+-40-k|0;p[153]=S+k;p[150]=F;p[S+(k+4)>>2]=F|1;p[S+(m+-36)>>2]=40;p[154]=p[269]}while(0);t=p[150]|0;if(t>>>0>_>>>0){F=t-_|0;p[150]=F;k=p[153]|0;p[153]=k+_;p[k+(_+4)>>2]=F|1;p[k+4>>2]=_|3;k=k+8|0;return k|0}}k=li()|0;p[k>>2]=12;k=0;return k|0}function zi(e){e=e|0;var t=0,i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,_=0,g=0,v=0,y=0,C=0;if(!e)return;t=e+-8|0;s=p[151]|0;if(t>>>0<s>>>0)Me();i=p[e+-4>>2]|0;r=i&3;if((r|0)==1)Me();f=i&-8;_=e+(f+-8)|0;do if(!(i&1)){t=p[t>>2]|0;if(!r)return;l=-8-t|0;c=e+l|0;d=t+f|0;if(c>>>0<s>>>0)Me();if((c|0)==(p[152]|0)){t=e+(f+-4)|0;i=p[t>>2]|0;if((i&3|0)!=3){C=c;o=d;break}p[149]=d;p[t>>2]=i&-2;p[e+(l+4)>>2]=d|1;p[_>>2]=d;return}n=t>>>3;if(t>>>0<256){r=p[e+(l+8)>>2]|0;i=p[e+(l+12)>>2]|0;t=628+(n<<1<<2)|0;if((r|0)!=(t|0)){if(r>>>0<s>>>0)Me();if((p[r+12>>2]|0)!=(c|0))Me()}if((i|0)==(r|0)){p[147]=p[147]&~(1<<n);C=c;o=d;break}if((i|0)!=(t|0)){if(i>>>0<s>>>0)Me();t=i+8|0;if((p[t>>2]|0)==(c|0))a=t;else Me()}else a=i+8|0;p[r+12>>2]=i;p[a>>2]=r;C=c;o=d;break}a=p[e+(l+24)>>2]|0;r=p[e+(l+12)>>2]|0;do if((r|0)==(c|0)){i=e+(l+20)|0;t=p[i>>2]|0;if(!t){i=e+(l+16)|0;t=p[i>>2]|0;if(!t){u=0;break}}while(1){r=t+20|0;n=p[r>>2]|0;if(n){t=n;i=r;continue}r=t+16|0;n=p[r>>2]|0;if(!n)break;else{t=n;i=r}}if(i>>>0<s>>>0)Me();else{p[i>>2]=0;u=t;break}}else{n=p[e+(l+8)>>2]|0;if(n>>>0<s>>>0)Me();t=n+12|0;if((p[t>>2]|0)!=(c|0))Me();i=r+8|0;if((p[i>>2]|0)==(c|0)){p[t>>2]=r;p[i>>2]=n;u=r;break}else Me()}while(0);if(a){t=p[e+(l+28)>>2]|0;i=892+(t<<2)|0;if((c|0)==(p[i>>2]|0)){p[i>>2]=u;if(!u){p[148]=p[148]&~(1<<t);C=c;o=d;break}}else{if(a>>>0<(p[151]|0)>>>0)Me();t=a+16|0;if((p[t>>2]|0)==(c|0))p[t>>2]=u;else p[a+20>>2]=u;if(!u){C=c;o=d;break}}i=p[151]|0;if(u>>>0<i>>>0)Me();p[u+24>>2]=a;t=p[e+(l+16)>>2]|0;do if(t)if(t>>>0<i>>>0)Me();else{p[u+16>>2]=t;p[t+24>>2]=u;break}while(0);t=p[e+(l+20)>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)Me();else{p[u+20>>2]=t;p[t+24>>2]=u;C=c;o=d;break}else{C=c;o=d}}else{C=c;o=d}}else{C=t;o=f}while(0);if(C>>>0>=_>>>0)Me();t=e+(f+-4)|0;i=p[t>>2]|0;if(!(i&1))Me();if(!(i&2)){if((_|0)==(p[153]|0)){y=(p[150]|0)+o|0;p[150]=y;p[153]=C;p[C+4>>2]=y|1;if((C|0)!=(p[152]|0))return;p[152]=0;p[149]=0;return}if((_|0)==(p[152]|0)){y=(p[149]|0)+o|0;p[149]=y;p[152]=C;p[C+4>>2]=y|1;p[C+y>>2]=y;return}o=(i&-8)+o|0;n=i>>>3;do if(i>>>0>=256){a=p[e+(f+16)>>2]|0;t=p[e+(f|4)>>2]|0;do if((t|0)==(_|0)){i=e+(f+12)|0;t=p[i>>2]|0;if(!t){i=e+(f+8)|0;t=p[i>>2]|0;if(!t){m=0;break}}while(1){r=t+20|0;n=p[r>>2]|0;if(n){t=n;i=r;continue}r=t+16|0;n=p[r>>2]|0;if(!n)break;else{t=n;i=r}}if(i>>>0<(p[151]|0)>>>0)Me();else{p[i>>2]=0;m=t;break}}else{i=p[e+f>>2]|0;if(i>>>0<(p[151]|0)>>>0)Me();r=i+12|0;if((p[r>>2]|0)!=(_|0))Me();n=t+8|0;if((p[n>>2]|0)==(_|0)){p[r>>2]=t;p[n>>2]=i;m=t;break}else Me()}while(0);if(a){t=p[e+(f+20)>>2]|0;i=892+(t<<2)|0;if((_|0)==(p[i>>2]|0)){p[i>>2]=m;if(!m){p[148]=p[148]&~(1<<t);break}}else{if(a>>>0<(p[151]|0)>>>0)Me();t=a+16|0;if((p[t>>2]|0)==(_|0))p[t>>2]=m;else p[a+20>>2]=m;if(!m)break}i=p[151]|0;if(m>>>0<i>>>0)Me();p[m+24>>2]=a;t=p[e+(f+8)>>2]|0;do if(t)if(t>>>0<i>>>0)Me();else{p[m+16>>2]=t;p[t+24>>2]=m;break}while(0);t=p[e+(f+12)>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)Me();else{p[m+20>>2]=t;p[t+24>>2]=m;break}}}else{r=p[e+f>>2]|0;i=p[e+(f|4)>>2]|0;t=628+(n<<1<<2)|0;if((r|0)!=(t|0)){if(r>>>0<(p[151]|0)>>>0)Me();if((p[r+12>>2]|0)!=(_|0))Me()}if((i|0)==(r|0)){p[147]=p[147]&~(1<<n);break}if((i|0)!=(t|0)){if(i>>>0<(p[151]|0)>>>0)Me();t=i+8|0;if((p[t>>2]|0)==(_|0))h=t;else Me()}else h=i+8|0;p[r+12>>2]=i;p[h>>2]=r}while(0);p[C+4>>2]=o|1;p[C+o>>2]=o;if((C|0)==(p[152]|0)){p[149]=o;return}}else{p[t>>2]=i&-2;p[C+4>>2]=o|1;p[C+o>>2]=o}t=o>>>3;if(o>>>0<256){i=t<<1;n=628+(i<<2)|0;r=p[147]|0;t=1<<t;if(r&t){t=628+(i+2<<2)|0;i=p[t>>2]|0;if(i>>>0<(p[151]|0)>>>0)Me();else{g=t;v=i}}else{p[147]=r|t;g=628+(i+2<<2)|0;v=n}p[g>>2]=C;p[v+12>>2]=C;p[C+8>>2]=v;p[C+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{g=(t+1048320|0)>>>16&8;v=t<<g;_=(v+520192|0)>>>16&4;v=v<<_;n=(v+245760|0)>>>16&2;n=14-(_|g|n)+(v<<n>>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=892+(n<<2)|0;p[C+28>>2]=n;p[C+20>>2]=0;p[C+16>>2]=0;i=p[148]|0;r=1<<n;e:do if(i&r){t=p[t>>2]|0;t:do if((p[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){i=t+16+(n>>>31<<2)|0;r=p[i>>2]|0;if(!r)break;if((p[r+4>>2]&-8|0)==(o|0)){y=r;break t}else{n=n<<1;t=r}}if(i>>>0<(p[151]|0)>>>0)Me();else{p[i>>2]=C;p[C+24>>2]=t;p[C+12>>2]=C;p[C+8>>2]=C;break e}}else y=t;while(0);t=y+8|0;i=p[t>>2]|0;v=p[151]|0;if(i>>>0>=v>>>0&y>>>0>=v>>>0){p[i+12>>2]=C;p[t>>2]=C;p[C+8>>2]=i;p[C+12>>2]=y;p[C+24>>2]=0;break}else Me()}else{p[148]=i|r;p[t>>2]=C;p[C+24>>2]=t;p[C+12>>2]=C;p[C+8>>2]=C}while(0);C=(p[155]|0)+-1|0;p[155]=C;if(!C)t=1044;else return;while(1){t=p[t>>2]|0;if(!t)break;else t=t+8|0}p[155]=-1;return}function Ui(e,t){e=e|0;t=t|0;var i=0,r=0;if(!e){e=Vi(t)|0;return e|0}if(t>>>0>4294967231){e=li()|0;p[e>>2]=12;e=0;return e|0}i=Hi(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(i){e=i+8|0;return e|0}i=Vi(t)|0;if(!i){e=0;return e|0}r=p[e+-4>>2]|0;r=(r&-8)-((r&3|0)==0?8:4)|0;Qi(i|0,e|0,(r>>>0<t>>>0?r:t)|0)|0;zi(e);e=i;return e|0}function Gi(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=p[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function Hi(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0;f=e+4|0;m=p[f>>2]|0;l=m&-8;c=e+l|0;s=p[151]|0;i=m&3;if(!((i|0)!=1&e>>>0>=s>>>0&e>>>0<c>>>0))Me();r=e+(l|4)|0;n=p[r>>2]|0;if(!(n&1))Me();if(!i){if(t>>>0<256){e=0;return e|0}if(l>>>0>=(t+4|0)>>>0?(l-t|0)>>>0<=p[267]<<1>>>0:0)return e|0;e=0;return e|0}if(l>>>0>=t>>>0){i=l-t|0;if(i>>>0<=15)return e|0;p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=i|3;p[r>>2]=p[r>>2]|1;Wi(e+t|0,i);return e|0}if((c|0)==(p[153]|0)){i=(p[150]|0)+l|0;if(i>>>0<=t>>>0){e=0;return e|0}h=i-t|0;p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=h|1;p[153]=e+t;p[150]=h;return e|0}if((c|0)==(p[152]|0)){r=(p[149]|0)+l|0;if(r>>>0<t>>>0){e=0;return e|0}i=r-t|0;if(i>>>0>15){p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=i|1;p[e+r>>2]=i;r=e+(r+4)|0;p[r>>2]=p[r>>2]&-2;r=e+t|0}else{p[f>>2]=m&1|r|2;r=e+(r+4)|0;p[r>>2]=p[r>>2]|1;r=0;i=0}p[149]=i;p[152]=r;return e|0}if(n&2){e=0;return e|0}d=(n&-8)+l|0;if(d>>>0<t>>>0){e=0;return e|0}h=d-t|0;o=n>>>3;do if(n>>>0>=256){a=p[e+(l+24)>>2]|0;o=p[e+(l+12)>>2]|0;do if((o|0)==(c|0)){r=e+(l+20)|0;i=p[r>>2]|0;if(!i){r=e+(l+16)|0;i=p[r>>2]|0;if(!i){u=0;break}}while(1){n=i+20|0;o=p[n>>2]|0;if(o){i=o;r=n;continue}n=i+16|0;o=p[n>>2]|0;if(!o)break;else{i=o;r=n}}if(r>>>0<s>>>0)Me();else{p[r>>2]=0;u=i;break}}else{n=p[e+(l+8)>>2]|0;if(n>>>0<s>>>0)Me();i=n+12|0;if((p[i>>2]|0)!=(c|0))Me();r=o+8|0;if((p[r>>2]|0)==(c|0)){p[i>>2]=o;p[r>>2]=n;u=o;break}else Me()}while(0);if(a){i=p[e+(l+28)>>2]|0;r=892+(i<<2)|0;if((c|0)==(p[r>>2]|0)){p[r>>2]=u;if(!u){p[148]=p[148]&~(1<<i);break}}else{if(a>>>0<(p[151]|0)>>>0)Me();i=a+16|0;if((p[i>>2]|0)==(c|0))p[i>>2]=u;else p[a+20>>2]=u;if(!u)break}r=p[151]|0;if(u>>>0<r>>>0)Me();p[u+24>>2]=a;i=p[e+(l+16)>>2]|0;do if(i)if(i>>>0<r>>>0)Me();else{p[u+16>>2]=i;p[i+24>>2]=u;break}while(0);i=p[e+(l+20)>>2]|0;if(i)if(i>>>0<(p[151]|0)>>>0)Me();else{p[u+20>>2]=i;p[i+24>>2]=u;break}}}else{n=p[e+(l+8)>>2]|0; -r=p[e+(l+12)>>2]|0;i=628+(o<<1<<2)|0;if((n|0)!=(i|0)){if(n>>>0<s>>>0)Me();if((p[n+12>>2]|0)!=(c|0))Me()}if((r|0)==(n|0)){p[147]=p[147]&~(1<<o);break}if((r|0)!=(i|0)){if(r>>>0<s>>>0)Me();i=r+8|0;if((p[i>>2]|0)==(c|0))a=i;else Me()}else a=r+8|0;p[n+12>>2]=r;p[a>>2]=n}while(0);if(h>>>0<16){p[f>>2]=d|m&1|2;t=e+(d|4)|0;p[t>>2]=p[t>>2]|1;return e|0}else{p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=h|3;m=e+(d|4)|0;p[m>>2]=p[m>>2]|1;Wi(e+t|0,h);return e|0}return 0}function Wi(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,_=0,g=0,v=0,y=0;_=e+t|0;i=p[e+4>>2]|0;do if(!(i&1)){u=p[e>>2]|0;if(!(i&3))return;h=e+(0-u)|0;d=u+t|0;l=p[151]|0;if(h>>>0<l>>>0)Me();if((h|0)==(p[152]|0)){r=e+(t+4)|0;i=p[r>>2]|0;if((i&3|0)!=3){y=h;a=d;break}p[149]=d;p[r>>2]=i&-2;p[e+(4-u)>>2]=d|1;p[_>>2]=d;return}o=u>>>3;if(u>>>0<256){n=p[e+(8-u)>>2]|0;r=p[e+(12-u)>>2]|0;i=628+(o<<1<<2)|0;if((n|0)!=(i|0)){if(n>>>0<l>>>0)Me();if((p[n+12>>2]|0)!=(h|0))Me()}if((r|0)==(n|0)){p[147]=p[147]&~(1<<o);y=h;a=d;break}if((r|0)!=(i|0)){if(r>>>0<l>>>0)Me();i=r+8|0;if((p[i>>2]|0)==(h|0))s=i;else Me()}else s=r+8|0;p[n+12>>2]=r;p[s>>2]=n;y=h;a=d;break}s=p[e+(24-u)>>2]|0;n=p[e+(12-u)>>2]|0;do if((n|0)==(h|0)){n=16-u|0;r=e+(n+4)|0;i=p[r>>2]|0;if(!i){r=e+n|0;i=p[r>>2]|0;if(!i){c=0;break}}while(1){n=i+20|0;o=p[n>>2]|0;if(o){i=o;r=n;continue}n=i+16|0;o=p[n>>2]|0;if(!o)break;else{i=o;r=n}}if(r>>>0<l>>>0)Me();else{p[r>>2]=0;c=i;break}}else{o=p[e+(8-u)>>2]|0;if(o>>>0<l>>>0)Me();i=o+12|0;if((p[i>>2]|0)!=(h|0))Me();r=n+8|0;if((p[r>>2]|0)==(h|0)){p[i>>2]=n;p[r>>2]=o;c=n;break}else Me()}while(0);if(s){i=p[e+(28-u)>>2]|0;r=892+(i<<2)|0;if((h|0)==(p[r>>2]|0)){p[r>>2]=c;if(!c){p[148]=p[148]&~(1<<i);y=h;a=d;break}}else{if(s>>>0<(p[151]|0)>>>0)Me();i=s+16|0;if((p[i>>2]|0)==(h|0))p[i>>2]=c;else p[s+20>>2]=c;if(!c){y=h;a=d;break}}n=p[151]|0;if(c>>>0<n>>>0)Me();p[c+24>>2]=s;i=16-u|0;r=p[e+i>>2]|0;do if(r)if(r>>>0<n>>>0)Me();else{p[c+16>>2]=r;p[r+24>>2]=c;break}while(0);i=p[e+(i+4)>>2]|0;if(i)if(i>>>0<(p[151]|0)>>>0)Me();else{p[c+20>>2]=i;p[i+24>>2]=c;y=h;a=d;break}else{y=h;a=d}}else{y=h;a=d}}else{y=e;a=t}while(0);l=p[151]|0;if(_>>>0<l>>>0)Me();i=e+(t+4)|0;r=p[i>>2]|0;if(!(r&2)){if((_|0)==(p[153]|0)){v=(p[150]|0)+a|0;p[150]=v;p[153]=y;p[y+4>>2]=v|1;if((y|0)!=(p[152]|0))return;p[152]=0;p[149]=0;return}if((_|0)==(p[152]|0)){v=(p[149]|0)+a|0;p[149]=v;p[152]=y;p[y+4>>2]=v|1;p[y+v>>2]=v;return}a=(r&-8)+a|0;o=r>>>3;do if(r>>>0>=256){s=p[e+(t+24)>>2]|0;n=p[e+(t+12)>>2]|0;do if((n|0)==(_|0)){r=e+(t+20)|0;i=p[r>>2]|0;if(!i){r=e+(t+16)|0;i=p[r>>2]|0;if(!i){m=0;break}}while(1){n=i+20|0;o=p[n>>2]|0;if(o){i=o;r=n;continue}n=i+16|0;o=p[n>>2]|0;if(!o)break;else{i=o;r=n}}if(r>>>0<l>>>0)Me();else{p[r>>2]=0;m=i;break}}else{o=p[e+(t+8)>>2]|0;if(o>>>0<l>>>0)Me();i=o+12|0;if((p[i>>2]|0)!=(_|0))Me();r=n+8|0;if((p[r>>2]|0)==(_|0)){p[i>>2]=n;p[r>>2]=o;m=n;break}else Me()}while(0);if(s){i=p[e+(t+28)>>2]|0;r=892+(i<<2)|0;if((_|0)==(p[r>>2]|0)){p[r>>2]=m;if(!m){p[148]=p[148]&~(1<<i);break}}else{if(s>>>0<(p[151]|0)>>>0)Me();i=s+16|0;if((p[i>>2]|0)==(_|0))p[i>>2]=m;else p[s+20>>2]=m;if(!m)break}r=p[151]|0;if(m>>>0<r>>>0)Me();p[m+24>>2]=s;i=p[e+(t+16)>>2]|0;do if(i)if(i>>>0<r>>>0)Me();else{p[m+16>>2]=i;p[i+24>>2]=m;break}while(0);i=p[e+(t+20)>>2]|0;if(i)if(i>>>0<(p[151]|0)>>>0)Me();else{p[m+20>>2]=i;p[i+24>>2]=m;break}}}else{n=p[e+(t+8)>>2]|0;r=p[e+(t+12)>>2]|0;i=628+(o<<1<<2)|0;if((n|0)!=(i|0)){if(n>>>0<l>>>0)Me();if((p[n+12>>2]|0)!=(_|0))Me()}if((r|0)==(n|0)){p[147]=p[147]&~(1<<o);break}if((r|0)!=(i|0)){if(r>>>0<l>>>0)Me();i=r+8|0;if((p[i>>2]|0)==(_|0))f=i;else Me()}else f=r+8|0;p[n+12>>2]=r;p[f>>2]=n}while(0);p[y+4>>2]=a|1;p[y+a>>2]=a;if((y|0)==(p[152]|0)){p[149]=a;return}}else{p[i>>2]=r&-2;p[y+4>>2]=a|1;p[y+a>>2]=a}i=a>>>3;if(a>>>0<256){r=i<<1;o=628+(r<<2)|0;n=p[147]|0;i=1<<i;if(n&i){i=628+(r+2<<2)|0;r=p[i>>2]|0;if(r>>>0<(p[151]|0)>>>0)Me();else{g=i;v=r}}else{p[147]=n|i;g=628+(r+2<<2)|0;v=o}p[g>>2]=y;p[v+12>>2]=y;p[y+8>>2]=v;p[y+12>>2]=o;return}i=a>>>8;if(i)if(a>>>0>16777215)o=31;else{g=(i+1048320|0)>>>16&8;v=i<<g;_=(v+520192|0)>>>16&4;v=v<<_;o=(v+245760|0)>>>16&2;o=14-(_|g|o)+(v<<o>>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;i=892+(o<<2)|0;p[y+28>>2]=o;p[y+20>>2]=0;p[y+16>>2]=0;r=p[148]|0;n=1<<o;if(!(r&n)){p[148]=r|n;p[i>>2]=y;p[y+24>>2]=i;p[y+12>>2]=y;p[y+8>>2]=y;return}i=p[i>>2]|0;e:do if((p[i+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){r=i+16+(o>>>31<<2)|0;n=p[r>>2]|0;if(!n)break;if((p[n+4>>2]&-8|0)==(a|0)){i=n;break e}else{o=o<<1;i=n}}if(r>>>0<(p[151]|0)>>>0)Me();p[r>>2]=y;p[y+24>>2]=i;p[y+12>>2]=y;p[y+8>>2]=y;return}while(0);r=i+8|0;n=p[r>>2]|0;v=p[151]|0;if(!(n>>>0>=v>>>0&i>>>0>=v>>>0))Me();p[n+12>>2]=y;p[r>>2]=y;p[y+8>>2]=n;p[y+12>>2]=i;p[y+24>>2]=0;return}function qi(){}function ji(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;r=t-r-(i>>>0>e>>>0|0)>>>0;return(z=r,e-i>>>0|0)|0}function Yi(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;i=e+i>>>0;return(z=t+r+(i>>>0<e>>>0|0)>>>0,i|0)|0}function Xi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0,n=0,o=0,a=0;r=e+i|0;if((i|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=r&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){d[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){p[e>>2]=a;e=e+4|0}}while((e|0)<(r|0)){d[e>>0]=t;e=e+1|0}return e-i|0}function Zi(e,t,i){e=e|0;t=t|0;i=i|0;if((i|0)<32){z=t>>>i;return e>>>i|(t&(1<<i)-1)<<32-i}z=0;return t>>>i-32|0}function Ki(e,t,i){e=e|0;t=t|0;i=i|0;if((i|0)<32){z=t<<i|(e&(1<<i)-1<<32-i)>>>32-i;return e<<i}z=e<<i-32;return 0}function Qi(e,t,i){e=e|0;t=t|0;i=i|0;var r=0;if((i|0)>=4096)return Be(e|0,t|0,i|0)|0;r=e|0;if((e&3)==(t&3)){while(e&3){if(!i)return r|0;d[e>>0]=d[t>>0]|0;e=e+1|0;t=t+1|0;i=i-1|0}while((i|0)>=4){p[e>>2]=p[t>>2];e=e+4|0;t=t+4|0;i=i-4|0}}while((i|0)>0){d[e>>0]=d[t>>0]|0;e=e+1|0;t=t+1|0;i=i-1|0}return r|0}function Ji(e,t,i){e=e|0;t=t|0;i=i|0;if((i|0)<32){z=t>>i;return e>>>i|(t&(1<<i)-1)<<32-i}z=(t|0)<0?-1:0;return t>>i-32|0}function $i(e){e=e|0;var t=0;t=d[b+(e&255)>>0]|0;if((t|0)<8)return t|0;t=d[b+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=d[b+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(d[b+(e>>>24)>>0]|0)+24|0}function er(e,t){e=e|0;t=t|0;var i=0,r=0,n=0,o=0;o=e&65535;n=t&65535;i=ce(n,o)|0;r=e>>>16;e=(i>>>16)+(ce(n,r)|0)|0;n=t>>>16;t=ce(n,o)|0;return(z=(e>>>16)+(ce(n,r)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|i&65535|0)|0}function tr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0,a=0,s=0,l=0,u=0;u=t>>31|((t|0)<0?-1:0)<<1;l=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=r>>31|((r|0)<0?-1:0)<<1;n=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1;s=ji(u^e,l^t,u,l)|0;a=z;e=o^u;t=n^l;return ji((ar(s,a,ji(o^i,n^r,o,n)|0,z,0)|0)^e,z^t,e,t)|0}function ir(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0,a=0,s=0,l=0,u=0;n=C;C=C+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;u=r>>31|((r|0)<0?-1:0)<<1;l=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1;e=ji(a^e,o^t,a,o)|0;t=z;ar(e,t,ji(u^i,l^r,u,l)|0,z,s)|0;r=ji(p[s>>2]^a,p[s+4>>2]^o,a,o)|0;i=z;C=n;return(z=i,r)|0}function rr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0;n=e;o=i;i=er(n,o)|0;e=z;return(z=(ce(t,o)|0)+(ce(r,n)|0)+e|e&0,i|0|0)|0}function nr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;return ar(e,t,i,r,0)|0}function or(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;var n=0,o=0;o=C;C=C+16|0;n=o|0;ar(e,t,i,r,n)|0;C=o;return(z=p[n+4>>2]|0,p[n>>2]|0)|0}function ar(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0;c=e;l=t;u=l;a=i;h=r;s=h;if(!u){o=(n|0)!=0;if(!s){if(o){p[n>>2]=(c>>>0)%(a>>>0);p[n+4>>2]=0}h=0;n=(c>>>0)/(a>>>0)>>>0;return(z=h,n)|0}else{if(!o){h=0;n=0;return(z=h,n)|0}p[n>>2]=e|0;p[n+4>>2]=t&0;h=0;n=0;return(z=h,n)|0}}o=(s|0)==0;do if(a){if(!o){o=(he(s|0)|0)-(he(u|0)|0)|0;if(o>>>0<=31){d=o+1|0;s=31-o|0;t=o-31>>31;a=d;e=c>>>(d>>>0)&t|u<<s;t=u>>>(d>>>0)&t;o=0;s=c<<s;break}if(!n){h=0;n=0;return(z=h,n)|0}p[n>>2]=e|0;p[n+4>>2]=l|t&0;h=0;n=0;return(z=h,n)|0}o=a-1|0;if(o&a){s=(he(a|0)|0)+33-(he(u|0)|0)|0;m=64-s|0;d=32-s|0;l=d>>31;f=s-32|0;t=f>>31;a=s;e=d-1>>31&u>>>(f>>>0)|(u<<d|c>>>(s>>>0))&t;t=t&u>>>(s>>>0);o=c<<m&l;s=(u<<m|c>>>(f>>>0))&l|c<<d&s-33>>31;break}if(n){p[n>>2]=o&c;p[n+4>>2]=0}if((a|0)==1){f=l|t&0;m=e|0|0;return(z=f,m)|0}else{m=$i(a|0)|0;f=u>>>(m>>>0)|0;m=u<<32-m|c>>>(m>>>0)|0;return(z=f,m)|0}}else{if(o){if(n){p[n>>2]=(u>>>0)%(a>>>0);p[n+4>>2]=0}f=0;m=(u>>>0)/(a>>>0)>>>0;return(z=f,m)|0}if(!c){if(n){p[n>>2]=0;p[n+4>>2]=(u>>>0)%(s>>>0)}f=0;m=(u>>>0)/(s>>>0)>>>0;return(z=f,m)|0}o=s-1|0;if(!(o&s)){if(n){p[n>>2]=e|0;p[n+4>>2]=o&u|t&0}f=0;m=u>>>(($i(s|0)|0)>>>0);return(z=f,m)|0}o=(he(s|0)|0)-(he(u|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=u<<s|c>>>(t>>>0);t=u>>>(t>>>0);o=0;s=c<<s;break}if(!n){f=0;m=0;return(z=f,m)|0}p[n>>2]=e|0;p[n+4>>2]=l|t&0;f=0;m=0;return(z=f,m)|0}while(0);if(!a){u=s;l=0;s=0}else{d=i|0|0;c=h|r&0;u=Yi(d|0,c|0,-1,-1)|0;i=z;l=s;s=0;do{r=l;l=o>>>31|l<<1;o=s|o<<1;r=e<<1|r>>>31|0;h=e>>>31|t<<1|0;ji(u,i,r,h)|0;m=z;f=m>>31|((m|0)<0?-1:0)<<1;s=f&1;e=ji(r,h,f&d,(((m|0)<0?-1:0)>>31|((m|0)<0?-1:0)<<1)&c)|0;t=z;a=a-1|0}while((a|0)!=0);u=l;l=0}a=0;if(n){p[n>>2]=e;p[n+4>>2]=t}f=(o|0)>>>31|(u|a)<<1|(a<<1|o>>>31)&0|l;m=(o<<1|0>>>31)&-2|s;return(z=f,m)|0}function sr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;return Er[e&7](t|0,i|0,r|0)|0}function lr(e,t,i,r,n,o){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;br[e&3](t|0,i|0,r|0,n|0,o|0)}function ur(e,t){e=e|0;t=t|0;Tr[e&7](t|0)}function cr(e,t){e=e|0;t=t|0;return xr[e&1](t|0)|0}function dr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;Ar[e&0](t|0,i|0,r|0)}function hr(e){e=e|0;Pr[e&3]()}function pr(e,t,i,r,n,o,a){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;a=a|0;Mr[e&3](t|0,i|0,r|0,n|0,o|0,a|0)}function fr(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;Dr[e&3](t|0,i|0,r|0,n|0)}function mr(e,t,i){e=e|0;t=t|0;i=i|0;pe(0);return 0}function _r(e,t,i,r,n){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;pe(1)}function gr(e){e=e|0;pe(2)}function vr(e){e=e|0;pe(3);return 0}function yr(e,t,i){e=e|0;t=t|0;i=i|0;pe(4)}function Cr(){pe(5)}function wr(e,t,i,r,n,o){e=e|0;t=t|0;i=i|0;r=r|0;n=n|0;o=o|0;pe(6)}function Sr(e,t,i,r){e=e|0;t=t|0;i=i|0;r=r|0;pe(7)}var Er=[mr,jt,Li,Pi,Ai,Mi,mr,mr];var br=[_r,$t,Jt,_r];var Tr=[gr,Ut,Wt,Gt,Ht,qt,ai,Ni];var xr=[vr,xi];var Ar=[yr];var Pr=[Cr,ni,oi,Cr];var Mr=[wr,ti,ei,wr];var Dr=[Sr,Xt,Zt,Sr];return{___cxa_can_catch:ii,_crn_get_levels:Ct,_crn_get_uncompressed_size:Et,_crn_decompress:bt,_i64Add:Yi,_crn_get_width:vt,___cxa_is_pointer_type:ri,_crn_get_bytes_per_block:St,_memset:Xi,_malloc:Vi,_memcpy:Qi,_i64Subtract:ji,_bitshift64Lshr:Zi,_free:zi,_bitshift64Shl:Ki,_crn_get_height:yt,_crn_get_dxt_format:wt,runPostSets:qi,_emscripten_replace_memory:qe,stackAlloc:je,stackSave:Ye,stackRestore:Xe,establishStackSpace:Ze,setThrew:Ke,setTempRet0:$e,getTempRet0:et,dynCall_iiii:sr,dynCall_viiiii:lr,dynCall_vi:ur,dynCall_ii:cr,dynCall_viii:dr,dynCall_v:hr,dynCall_viiiiii:pr,dynCall_viiii:fr}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),___cxa_can_catch=Module.___cxa_can_catch=asm.___cxa_can_catch,_crn_get_levels=Module._crn_get_levels=asm._crn_get_levels,runPostSets=Module.runPostSets=asm.runPostSets,_crn_get_uncompressed_size=Module._crn_get_uncompressed_size=asm._crn_get_uncompressed_size,_crn_decompress=Module._crn_decompress=asm._crn_decompress,_i64Add=Module._i64Add=asm._i64Add,_crn_get_height=Module._crn_get_height=asm._crn_get_height,___cxa_is_pointer_type=Module.___cxa_is_pointer_type=asm.___cxa_is_pointer_type,_crn_get_bytes_per_block=Module._crn_get_bytes_per_block=asm._crn_get_bytes_per_block,_memset=Module._memset=asm._memset,_malloc=Module._malloc=asm._malloc,_memcpy=Module._memcpy=asm._memcpy,_emscripten_replace_memory=Module._emscripten_replace_memory=asm._emscripten_replace_memory,_i64Subtract=Module._i64Subtract=asm._i64Subtract,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_free=Module._free=asm._free,_crn_get_dxt_format=Module._crn_get_dxt_format=asm._crn_get_dxt_format,_crn_get_width=Module._crn_get_width=asm._crn_get_width,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii;Runtime.stackAlloc=asm.stackAlloc,Runtime.stackSave=asm.stackSave,Runtime.stackRestore=asm.stackRestore,Runtime.establishStackSpace=asm.establishStackSpace,Runtime.setTempRet0=asm.setTempRet0,Runtime.getTempRet0=asm.getTempRet0,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop,preloadStartTime=null,calledMain=!1;dependenciesFulfilled=function e(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){function t(){for(var e=0;e<3;e++)r.push(0)}assert(0==runDependencies,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(0==__ATPRERUN__.length,"cannot call main when preRun functions remain to be called"),e=e||[],ensureInitRuntime();var i=e.length+1,r=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];t();for(var n=0;n<i-1;n+=1)r.push(allocate(intArrayFromString(e[n]),"i8",ALLOC_NORMAL)),t();r.push(0),r=allocate(r,"i32",ALLOC_NORMAL);try{var o=Module._main(i,r,0);exit(o,!0)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}finally{calledMain=!0}},Module.run=Module.run=run,Module.exit=Module.exit=exit;var abortDecorators=[];if(Module.abort=Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),Module.noExitRuntime=!0,run(),Module}),function(){!function(e){var t=this||(0,eval)("this"),i=t.document,r=t.navigator,n=t.jQuery,o=t.JSON;!function(e){"function"==typeof define&&define.amd?define("ThirdParty/knockout-3.4.0",["exports","require"],e):e("object"==typeof exports&&"object"==typeof module?module.exports||exports:t.ko={})}(function(a,s){function l(e,t){return(null===e||typeof e in _)&&e===t}function u(t,i){var r;return function(){r||(r=m.a.setTimeout(function(){r=e,t()},i))}}function c(e,t){var i;return function(){clearTimeout(i),i=m.a.setTimeout(e,t)}}function d(e,t){t&&t!==g?"beforeChange"===t?this.Kb(e):this.Ha(e,t):this.Lb(e)}function h(e,t){null!==t&&t.k&&t.k()}function p(e,t){var i=this.Hc,r=i[S];r.R||(this.lb&&this.Ma[t]?(i.Pb(t,e,this.Ma[t]),this.Ma[t]=null,--this.lb):r.r[t]||i.Pb(t,e,r.s?{ia:e}:i.uc(e)))}function f(e,t,i,r){m.d[e]={init:function(e,n,o,a,s){var l,u;return m.m(function(){var o=m.a.c(n()),a=!i!=!o,c=!u;(c||t||a!==l)&&(c&&m.va.Aa()&&(u=m.a.ua(m.f.childNodes(e),!0)),a?(c||m.f.da(e,m.a.ua(u)),m.eb(r?r(s,o):s,e)):m.f.xa(e),l=a)},null,{i:e}),{controlsDescendantBindings:!0}}},m.h.ta[e]=!1,m.f.Z[e]=!0}var m="undefined"!=typeof a?a:{};m.b=function(e,t){for(var i=e.split("."),r=m,n=0;n<i.length-1;n++)r=r[i[n]];r[i[i.length-1]]=t},m.G=function(e,t,i){e[t]=i},m.version="3.4.0",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1},m.a=function(){function a(e,t){for(var i in e)e.hasOwnProperty(i)&&t(i,e[i])}function s(e,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}function l(e,t){return e.__proto__=t,e}function u(e,t,i,r){var n=e[t].match(g)||[];m.a.q(i.match(g),function(e){m.a.pa(n,e,r)}),e[t]=n.join(" ")}var c={__proto__:[]}instanceof Array,d="function"==typeof Symbol,h={},p={};h[r&&/Firefox\/2/i.test(r.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],h.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),a(h,function(e,t){if(t.length)for(var i=0,r=t.length;i<r;i++)p[t[i]]=e});var f={propertychange:!0},_=i&&function(){for(var t=3,r=i.createElement("div"),n=r.getElementsByTagName("i");r.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->",n[0];);return 4<t?t:e}(),g=/\S+/g;return{cc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],q:function(e,t){for(var i=0,r=e.length;i<r;i++)t(e[i],i)},o:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var i=0,r=e.length;i<r;i++)if(e[i]===t)return i;return-1},Sb:function(e,t,i){for(var r=0,n=e.length;r<n;r++)if(t.call(i,e[r],r))return e[r];return null},La:function(e,t){var i=m.a.o(e,t);0<i?e.splice(i,1):0===i&&e.shift()},Tb:function(e){e=e||[];for(var t=[],i=0,r=e.length;i<r;i++)0>m.a.o(t,e[i])&&t.push(e[i]);return t},fb:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;r<n;r++)i.push(t(e[r],r));return i},Ka:function(e,t){e=e||[];for(var i=[],r=0,n=e.length;r<n;r++)t(e[r],r)&&i.push(e[r]);return i},ra: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},pa:function(e,t,i){var r=m.a.o(m.a.zb(e),t);0>r?i&&e.push(t):i||e.splice(r,1)},ka:c,extend:s,Xa:l,Ya:c?l:s,D:a,Ca:function(e,t){if(!e)return e;var i,r={};for(i in e)e.hasOwnProperty(i)&&(r[i]=t(e[i],i,e));return r},ob:function(e){for(;e.firstChild;)m.removeNode(e.firstChild)},jc:function(e){e=m.a.V(e);for(var t=(e[0]&&e[0].ownerDocument||i).createElement("div"),r=0,n=e.length;r<n;r++)t.appendChild(m.$(e[r]));return t},ua:function(e,t){for(var i=0,r=e.length,n=[];i<r;i++){var o=e[i].cloneNode(!0);n.push(t?m.$(o):o)}return n},da:function(e,t){if(m.a.ob(e),t)for(var i=0,r=t.length;i<r;i++)e.appendChild(t[i])},qc:function(e,t){var i=e.nodeType?[e]:e;if(0<i.length){for(var r=i[0],n=r.parentNode,o=0,a=t.length;o<a;o++)n.insertBefore(t[o],r);for(o=0,a=i.length;o<a;o++)m.removeNode(i[o])}},za: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},sc:function(e,t){7>_?e.setAttribute("selected",t):e.selected=t},$a:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},nd:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},Mc:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(3===e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},nb:function(e){return m.a.Mc(e,e.ownerDocument.documentElement)},Qb:function(e){return!!m.a.Sb(e,m.a.nb)},A:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Wb:function(e){return m.onError?function(){try{return e.apply(this,arguments)}catch(e){throw m.onError&&m.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(m.a.Wb(e),t)},$b:function(e){setTimeout(function(){throw m.onError&&m.onError(e),e},0)},p:function(e,t,i){var r=m.a.Wb(i);if(i=_&&f[t],m.options.useOnlyNativeEvents||i||!n)if(i||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var o=function(t){r.call(e,t)},a="on"+t;e.attachEvent(a,o),m.a.F.oa(e,function(){e.detachEvent(a,o)})}else e.addEventListener(t,r,!1);else n(e).bind(t,r)},Da:function(e,r){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var o;if("input"===m.a.A(e)&&e.type&&"click"==r.toLowerCase()?(o=e.type,o="checkbox"==o||"radio"==o):o=!1,m.options.useOnlyNativeEvents||!n||o)if("function"==typeof i.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");o=i.createEvent(p[r]||"HTMLEvents"),o.initEvent(r,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(o)}else if(o&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+r)}else n(e).trigger(r)},c:function(e){return m.H(e)?e():e},zb:function(e){return m.H(e)?e.t():e},bb:function(e,t,i){var r;t&&("object"==typeof e.classList?(r=e.classList[i?"add":"remove"],m.a.q(t.match(g),function(t){r.call(e.classList,t)})):"string"==typeof e.className.baseVal?u(e.className,"baseVal",t,i):u(e,"className",t,i))},Za:function(t,i){var r=m.a.c(i);null!==r&&r!==e||(r="");var n=m.f.firstChild(t);!n||3!=n.nodeType||m.f.nextSibling(n)?m.f.da(t,[t.ownerDocument.createTextNode(r)]):n.data=r,m.a.Rc(t)},rc:function(e,t){if(e.name=t,7>=_)try{e.mergeAttributes(i.createElement("<input name='"+e.name+"'/>"),!1)}catch(e){}},Rc:function(e){9<=_&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Nc:function(e){if(_){var t=e.style.width;e.style.width=0,e.style.width=t}},hd:function(e,t){e=m.a.c(e),t=m.a.c(t);for(var i=[],r=e;r<=t;r++)i.push(r);return i},V:function(e){for(var t=[],i=0,r=e.length;i<r;i++)t.push(e[i]);return t},Yb:function(e){return d?Symbol(e):e},rd:6===_,sd:7===_,C:_,ec:function(e,t){for(var i=m.a.V(e.getElementsByTagName("input")).concat(m.a.V(e.getElementsByTagName("textarea"))),r="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=i.length-1;0<=o;o--)r(i[o])&&n.push(i[o]);return n},ed:function(e){return"string"==typeof e&&(e=m.a.$a(e))?o&&o.parse?o.parse(e):new Function("return "+e)():null},Eb:function(e,t,i){if(!o||!o.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 o.stringify(m.a.c(e),t,i)},fd:function(e,t,r){r=r||{};var n=r.params||{},o=r.includeFields||this.cc,s=e;if("object"==typeof e&&"form"===m.a.A(e))for(var s=e.action,l=o.length-1;0<=l;l--)for(var u=m.a.ec(e,o[l]),c=u.length-1;0<=c;c--)n[u[c].name]=u[c].value;t=m.a.c(t);var d=i.createElement("form");d.style.display="none",d.action=s,d.method="post";for(var h in t)e=i.createElement("input"),e.type="hidden",e.name=h,e.value=m.a.Eb(m.a.c(t[h])),d.appendChild(e);a(n,function(e,t){var r=i.createElement("input");r.type="hidden",r.name=e,r.value=t,d.appendChild(r)}),i.body.appendChild(d),r.submitter?r.submitter(d):d.submit(),setTimeout(function(){d.parentNode.removeChild(d)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.q),m.b("utils.arrayFirst",m.a.Sb),m.b("utils.arrayFilter",m.a.Ka),m.b("utils.arrayGetDistinctValues",m.a.Tb),m.b("utils.arrayIndexOf",m.a.o),m.b("utils.arrayMap",m.a.fb),m.b("utils.arrayPushAll",m.a.ra),m.b("utils.arrayRemoveItem",m.a.La),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.cc),m.b("utils.getFormFields",m.a.ec),m.b("utils.peekObservable",m.a.zb),m.b("utils.postJson",m.a.fd),m.b("utils.parseJson",m.a.ed),m.b("utils.registerEventHandler",m.a.p),m.b("utils.stringifyJson",m.a.Eb),m.b("utils.range",m.a.hd),m.b("utils.toggleDomNodeCssClass",m.a.bb),m.b("utils.triggerEvent",m.a.Da),m.b("utils.unwrapObservable",m.a.c),m.b("utils.objectForEach",m.a.D),m.b("utils.addOrRemoveItem",m.a.pa),m.b("utils.setTextContent",m.a.Za),m.b("unwrap",m.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var i=Array.prototype.slice.call(arguments,1);return function(){var r=i.slice(0);return r.push.apply(r,arguments),t.apply(e,r)}}),m.a.e=new function(){function t(t,o){var a=t[r];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[r]="ko"+i++,n[a]={}}return n[a]}var i=0,r="__ko__"+(new Date).getTime(),n={};return{get:function(i,r){var n=t(i,!1);return n===e?e:n[r]},set:function(i,r,n){n===e&&t(i,!1)===e||(t(i,!0)[r]=n)},clear:function(e){var t=e[r];return!!t&&(delete n[t],e[r]=null,!0)},I:function(){return i++ +r}}},m.b("utils.domData",m.a.e),m.b("utils.domData.clear",m.a.e.clear),m.a.F=new function(){function t(t,i){var n=m.a.e.get(t,r);return n===e&&i&&(n=[],m.a.e.set(t,r,n)),n}function i(e){var r=t(e,!1);if(r)for(var r=r.slice(0),n=0;n<r.length;n++)r[n](e);if(m.a.e.clear(e),m.a.F.cleanExternalData(e),a[e.nodeType])for(r=e.firstChild;e=r;)r=e.nextSibling,8===e.nodeType&&i(e)}var r=m.a.e.I(),o={1:!0,8:!0,9:!0},a={1:!0,9:!0};return{oa:function(e,i){if("function"!=typeof i)throw Error("Callback must be a function");t(e,!0).push(i)},pc:function(i,n){var o=t(i,!1);o&&(m.a.La(o,n),0==o.length&&m.a.e.set(i,r,e))},$:function(e){if(o[e.nodeType]&&(i(e),a[e.nodeType])){var t=[];m.a.ra(t,e.getElementsByTagName("*"));for(var r=0,n=t.length;r<n;r++)i(t[r])}return e},removeNode:function(e){m.$(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){n&&"function"==typeof n.cleanData&&n.cleanData([e])}}},m.$=m.a.F.$,m.removeNode=m.a.F.removeNode,m.b("cleanNode",m.$),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.F),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.F.oa),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.F.pc),function(){var r=[0,"",""],o=[1,"<table>","</table>"],a=[3,"<table><tbody><tr>","</tr></tbody></table>"],s=[1,"<select multiple='multiple'>","</select>"],l={thead:o,tbody:o,tfoot:o,tr:[2,"<table><tbody>","</tbody></table>"],td:a,th:a,option:s,optgroup:s},u=8>=m.a.C;m.a.ma=function(e,o){var a;if(n){if(n.parseHTML)a=n.parseHTML(e,o)||[];else if((a=n.clean([e],o))&&a[0]){for(var s=a[0];s.parentNode&&11!==s.parentNode.nodeType;)s=s.parentNode;s.parentNode&&s.parentNode.removeChild(s)}}else{(a=o)||(a=i);var c,s=a.parentWindow||a.defaultView||t,d=m.a.$a(e).toLowerCase(),h=a.createElement("div");for(c=(d=d.match(/^<([a-z]+)[ >]/))&&l[d[1]]||r,d=c[0],c="ignored<div>"+c[1]+e+c[2]+"</div>","function"==typeof s.innerShiv?h.appendChild(s.innerShiv(c)):(u&&a.appendChild(h),h.innerHTML=c,u&&h.parentNode.removeChild(h));d--;)h=h.lastChild;a=m.a.V(h.lastChild.childNodes)}return a},m.a.Cb=function(t,i){if(m.a.ob(t),i=m.a.c(i),null!==i&&i!==e)if("string"!=typeof i&&(i=i.toString()),n)n(t).html(i);else for(var r=m.a.ma(i,t.ownerDocument),o=0;o<r.length;o++)t.appendChild(r[o])}}(),m.b("utils.parseHtmlFragment",m.a.ma),m.b("utils.setHtml",m.a.Cb),m.M=function(){function t(e,i){if(e)if(8==e.nodeType){var r=m.M.lc(e.nodeValue);null!=r&&i.push({Lc:e,cd:r})}else if(1==e.nodeType)for(var r=0,n=e.childNodes,o=n.length;r<o;r++)t(n[r],i)}var i={};return{wb: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 i[t]=e,"<!--[ko_memo:"+t+"]-->"},xc:function(t,r){var n=i[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,r||[]),!0}finally{delete i[t]}},yc:function(e,i){var r=[];t(e,r);for(var n=0,o=r.length;n<o;n++){var a=r[n].Lc,s=[a];i&&m.a.ra(s,i),m.M.xc(r[n].cd,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},lc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),m.b("memoization",m.M),m.b("memoization.memoize",m.M.wb),m.b("memoization.unmemoize",m.M.xc),m.b("memoization.parseMemoText",m.M.lc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.M.yc),m.Y=function(){function e(){if(o)for(var e,t=o,i=0;s<o;)if(e=n[s++]){if(s>t){if(5e3<=++i){s=o,m.a.$b(Error("'Too much recursion' after processing "+i+" task groups."));break}t=o}try{e()}catch(e){m.a.$b(e)}}}function r(){e(),s=o=n.length=0}var n=[],o=0,a=1,s=0;return{scheduler:t.MutationObserver?function(e){var t=i.createElement("div");return new MutationObserver(e).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(r):i&&"onreadystatechange"in i.createElement("script")?function(e){var t=i.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,i.documentElement.removeChild(t),t=null,e()},i.documentElement.appendChild(t)}:function(e){setTimeout(e,0)},Wa:function(e){return o||m.Y.scheduler(r),n[o++]=e,a++},cancel:function(e){e-=a-o,e>=s&&e<o&&(n[e]=null)},resetForTesting:function(){var e=o-s;return s=o=n.length=0,e},md:e}}(),m.b("tasks",m.Y),m.b("tasks.schedule",m.Y.Wa),m.b("tasks.runEarly",m.Y.md),m.ya={throttle:function(e,t){e.throttleEvaluation=t;var i=null;return m.B({read:e,write:function(r){clearTimeout(i),i=m.a.setTimeout(function(){e(r)},t)}})},rateLimit:function(e,t){var i,r,n;"number"==typeof t?i=t:(i=t.timeout,r=t.method),e.cb=!1,n="notifyWhenChangesStop"==r?c:u,e.Ta(function(e){return n(e,i)})},deferred:function(t,i){if(!0!==i)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");t.cb||(t.cb=!0,t.Ta(function(i){var r;return function(){m.Y.cancel(r),r=m.Y.Wa(i),t.notifySubscribers(e,"dirty")}}))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var _={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.ya),m.vc=function(e,t,i){this.ia=e,this.gb=t,this.Kc=i,this.R=!1,m.G(this,"dispose",this.k)},m.vc.prototype.k=function(){this.R=!0,this.Kc()},m.J=function(){m.a.Ya(this,v),v.rb(this)};var g="change",v={rb:function(e){e.K={},e.Nb=1},X:function(e,t,i){var r=this;i=i||g;var n=new m.vc(r,t?e.bind(t):e,function(){m.a.La(r.K[i],n),r.Ia&&r.Ia(i)});return r.sa&&r.sa(i),r.K[i]||(r.K[i]=[]),r.K[i].push(n),n},notifySubscribers:function(e,t){if(t=t||g,t===g&&this.zc(),this.Pa(t))try{m.l.Ub();for(var i,r=this.K[t].slice(0),n=0;i=r[n];++n)i.R||i.gb(e)}finally{m.l.end()}},Na:function(){return this.Nb},Uc:function(e){return this.Na()!==e},zc:function(){++this.Nb},Ta:function(e){var t,i,r,n=this,o=m.H(n);n.Ha||(n.Ha=n.notifySubscribers,n.notifySubscribers=d);var a=e(function(){n.Mb=!1,o&&r===n&&(r=n()),t=!1,n.tb(i,r)&&n.Ha(i=r)});n.Lb=function(e){n.Mb=t=!0,r=e,a()},n.Kb=function(e){t||(i=e,n.Ha(e,"beforeChange"))}},Pa:function(e){return this.K[e]&&this.K[e].length},Sc:function(e){if(e)return this.K[e]&&this.K[e].length||0;var t=0;return m.a.D(this.K,function(e,i){"dirty"!==e&&(t+=i.length)}),t},tb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&m.a.D(e,function(e,i){var r=m.ya[e];"function"==typeof r&&(t=r(t,i)||t)}),t}};m.G(v,"subscribe",v.X),m.G(v,"extend",v.extend),m.G(v,"getSubscriptionsCount",v.Sc),m.a.ka&&m.a.Xa(v,Function.prototype),m.J.fn=v,m.hc=function(e){return null!=e&&"function"==typeof e.X&&"function"==typeof e.notifySubscribers},m.b("subscribable",m.J),m.b("isSubscribable",m.hc),m.va=m.l=function(){function e(e){r.push(i),i=e}function t(){i=r.pop()}var i,r=[],n=0;return{Ub:e,end:t,oc:function(e){if(i){if(!m.hc(e))throw Error("Only subscribable things can act as dependencies");i.gb.call(i.Gc,e,e.Cc||(e.Cc=++n))}},w:function(i,r,n){try{return e(),i.apply(r,n||[])}finally{t()}},Aa:function(){if(i)return i.m.Aa()},Sa:function(){if(i)return i.Sa}}}(),m.b("computedContext",m.va),m.b("computedContext.getDependenciesCount",m.va.Aa),m.b("computedContext.isInitial",m.va.Sa),m.b("ignoreDependencies",m.qd=m.l.w);var y=m.a.Yb("_latestValue");m.N=function(e){function t(){return 0<arguments.length?(t.tb(t[y],arguments[0])&&(t.ga(),t[y]=arguments[0],t.fa()),this):(m.l.oc(t),t[y])}return t[y]=e,m.a.ka||m.a.extend(t,m.J.fn),m.J.fn.rb(t),m.a.Ya(t,C),m.options.deferUpdates&&m.ya.deferred(t,!0),t};var C={equalityComparer:l,t:function(){return this[y]},fa:function(){this.notifySubscribers(this[y])},ga:function(){this.notifySubscribers(this[y],"beforeChange")}};m.a.ka&&m.a.Xa(C,m.J.fn);var w=m.N.gd="__ko_proto__";C[w]=m.N,m.Oa=function(t,i){return null!==t&&t!==e&&t[w]!==e&&(t[w]===i||m.Oa(t[w],i))},m.H=function(e){return m.Oa(e,m.N)},m.Ba=function(e){return!!("function"==typeof e&&e[w]===m.N||"function"==typeof e&&e[w]===m.B&&e.Vc)},m.b("observable",m.N),m.b("isObservable",m.H),m.b("isWriteableObservable",m.Ba),m.b("isWritableObservable",m.Ba),m.b("observable.fn",C),m.G(C,"peek",C.t),m.G(C,"valueHasMutated",C.fa),m.G(C,"valueWillMutate",C.ga),m.la=function(e){if(e=e||[],"object"!=typeof e||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=m.N(e),m.a.Ya(e,m.la.fn), -e.extend({trackArrayChanges:!0})},m.la.fn={remove:function(e){for(var t=this.t(),i=[],r="function"!=typeof e||m.H(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];r(o)&&(0===i.length&&this.ga(),i.push(o),t.splice(n,1),n--)}return i.length&&this.fa(),i},removeAll:function(t){if(t===e){var i=this.t(),r=i.slice(0);return this.ga(),i.splice(0,i.length),this.fa(),r}return t?this.remove(function(e){return 0<=m.a.o(t,e)}):[]},destroy:function(e){var t=this.t(),i="function"!=typeof e||m.H(e)?function(t){return t===e}:e;this.ga();for(var r=t.length-1;0<=r;r--)i(t[r])&&(t[r]._destroy=!0);this.fa()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=m.a.o(t,e)}):[]},indexOf:function(e){var t=this();return m.a.o(t,e)},replace:function(e,t){var i=this.indexOf(e);0<=i&&(this.ga(),this.t()[i]=t,this.fa())}},m.a.ka&&m.a.Xa(m.la.fn,m.N.fn),m.a.q("pop push reverse shift sort splice unshift".split(" "),function(e){m.la.fn[e]=function(){var t=this.t();this.ga(),this.Vb(t,e,arguments);var i=t[e].apply(t,arguments);return this.fa(),i===t?this:i}}),m.a.q(["slice"],function(e){m.la.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),m.b("observableArray",m.la),m.ya.trackArrayChanges=function(e,t){function i(){if(!n){n=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,i){return i&&i!==g||++a,t.apply(this,arguments)};var i=[].concat(e.t()||[]);o=null,r=e.X(function(t){if(t=[].concat(t||[]),e.Pa("arrayChange")){var r;(!o||1<a)&&(o=m.a.ib(i,t,e.hb)),r=o}i=t,o=null,a=0,r&&r.length&&e.notifySubscribers(r,"arrayChange")})}}if(e.hb={},t&&"object"==typeof t&&m.a.extend(e.hb,t),e.hb.sparse=!0,!e.Vb){var r,n=!1,o=null,a=0,s=e.sa,l=e.Ia;e.sa=function(t){s&&s.call(e,t),"arrayChange"===t&&i()},e.Ia=function(t){l&&l.call(e,t),"arrayChange"!==t||e.Pa("arrayChange")||(r.k(),n=!1)},e.Vb=function(e,t,i){function r(e,t,i){return s[s.length]={status:e,value:t,index:i}}if(n&&!a){var s=[],l=e.length,u=i.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;t<u;t++)r("added",i[t],c+t);break;case"pop":c=l-1;case"shift":l&&r("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>i[0]?l+i[0]:i[0]),l);for(var l=1===u?l:Math.min(t+(i[1]||0),l),u=t+u-2,c=Math.max(l,u),d=[],h=[],p=2;t<c;++t,++p)t<l&&h.push(r("deleted",e[t],t)),t<u&&d.push(r("added",i[p],t));m.a.dc(h,d);break;default:return}o=s}}}};var S=m.a.Yb("_state");m.m=m.B=function(t,i,r){function n(){if(0<arguments.length){if("function"!=typeof o)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 o.apply(a.pb,arguments),this}return m.l.oc(n),(a.S||a.s&&n.Qa())&&n.aa(),a.T}if("object"==typeof t?r=t:(r=r||{},t&&(r.read=t)),"function"!=typeof r.read)throw Error("Pass a function that returns the value of the ko.computed");var o=r.write,a={T:e,S:!0,Ra:!1,Fb:!1,R:!1,Va:!1,s:!1,jd:r.read,pb:i||r.owner,i:r.disposeWhenNodeIsRemoved||r.i||null,wa:r.disposeWhen||r.wa,mb:null,r:{},L:0,bc:null};return n[S]=a,n.Vc="function"==typeof o,m.a.ka||m.a.extend(n,m.J.fn),m.J.fn.rb(n),m.a.Ya(n,E),r.pure?(a.Va=!0,a.s=!0,m.a.extend(n,b)):r.deferEvaluation&&m.a.extend(n,T),m.options.deferUpdates&&m.ya.deferred(n,!0),a.i&&(a.Fb=!0,a.i.nodeType||(a.i=null)),a.s||r.deferEvaluation||n.aa(),a.i&&n.ba()&&m.a.F.oa(a.i,a.mb=function(){n.k()}),n};var E={equalityComparer:l,Aa:function(){return this[S].L},Pb:function(e,t,i){if(this[S].Va&&t===this)throw Error("A 'pure' computed must not be called recursively");this[S].r[e]=i,i.Ga=this[S].L++,i.na=t.Na()},Qa:function(){var e,t,i=this[S].r;for(e in i)if(i.hasOwnProperty(e)&&(t=i[e],t.ia.Uc(t.na)))return!0},bd:function(){this.Fa&&!this[S].Ra&&this.Fa()},ba:function(){return this[S].S||0<this[S].L},ld:function(){this.Mb||this.ac()},uc:function(e){if(e.cb&&!this[S].i){var t=e.X(this.bd,this,"dirty"),i=e.X(this.ld,this);return{ia:e,k:function(){t.k(),i.k()}}}return e.X(this.ac,this)},ac:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[S].bc),this[S].bc=m.a.setTimeout(function(){e.aa(!0)},t)):e.Fa?e.Fa():e.aa(!0)},aa:function(e){var t=this[S],i=t.wa;if(!t.Ra&&!t.R){if(t.i&&!m.a.nb(t.i)||i&&i()){if(!t.Fb)return void this.k()}else t.Fb=!1;t.Ra=!0;try{this.Qc(e)}finally{t.Ra=!1}t.L||this.k()}},Qc:function(t){var i=this[S],r=i.Va?e:!i.L,n={Hc:this,Ma:i.r,lb:i.L};m.l.Ub({Gc:n,gb:p,m:this,Sa:r}),i.r={},i.L=0,n=this.Pc(i,n),this.tb(i.T,n)&&(i.s||this.notifySubscribers(i.T,"beforeChange"),i.T=n,i.s?this.zc():t&&this.notifySubscribers(i.T)),r&&this.notifySubscribers(i.T,"awake")},Pc:function(e,t){try{var i=e.jd;return e.pb?i.call(e.pb):i()}finally{m.l.end(),t.lb&&!e.s&&m.a.D(t.Ma,h),e.S=!1}},t:function(){var e=this[S];return(e.S&&!e.L||e.s&&this.Qa())&&this.aa(),e.T},Ta:function(e){m.J.fn.Ta.call(this,e),this.Fa=function(){this.Kb(this[S].T),this[S].S=!0,this.Lb(this)}},k:function(){var e=this[S];!e.s&&e.r&&m.a.D(e.r,function(e,t){t.k&&t.k()}),e.i&&e.mb&&m.a.F.pc(e.i,e.mb),e.r=null,e.L=0,e.R=!0,e.S=!1,e.s=!1,e.i=null}},b={sa:function(e){var t=this,i=t[S];if(!i.R&&i.s&&"change"==e){if(i.s=!1,i.S||t.Qa())i.r=null,i.L=0,i.S=!0,t.aa();else{var r=[];m.a.D(i.r,function(e,t){r[t.Ga]=e}),m.a.q(r,function(e,r){var n=i.r[e],o=t.uc(n.ia);o.Ga=r,o.na=n.na,i.r[e]=o})}i.R||t.notifySubscribers(i.T,"awake")}},Ia:function(t){var i=this[S];i.R||"change"!=t||this.Pa("change")||(m.a.D(i.r,function(e,t){t.k&&(i.r[e]={ia:t.ia,Ga:t.Ga,na:t.na},t.k())}),i.s=!0,this.notifySubscribers(e,"asleep"))},Na:function(){var e=this[S];return e.s&&(e.S||this.Qa())&&this.aa(),m.J.fn.Na.call(this)}},T={sa:function(e){"change"!=e&&"beforeChange"!=e||this.t()}};m.a.ka&&m.a.Xa(E,m.J.fn);var x=m.N.gd;m.m[x]=m.N,E[x]=m.m,m.Xc=function(e){return m.Oa(e,m.m)},m.Yc=function(e){return m.Oa(e,m.m)&&e[S]&&e[S].Va},m.b("computed",m.m),m.b("dependentObservable",m.m),m.b("isComputed",m.Xc),m.b("isPureComputed",m.Yc),m.b("computed.fn",E),m.G(E,"peek",E.t),m.G(E,"dispose",E.k),m.G(E,"isActive",E.ba),m.G(E,"getDependenciesCount",E.Aa),m.nc=function(e,t){return"function"==typeof e?m.m(e,t,{pure:!0}):(e=m.a.extend({},e),e.pure=!0,m.m(e,t))},m.b("pureComputed",m.nc),function(){function t(n,o,a){if(a=a||new r,n=o(n),"object"!=typeof n||null===n||n===e||n instanceof RegExp||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),i(n,function(i){var r=o(n[i]);switch(typeof r){case"boolean":case"number":case"string":case"function":s[i]=r;break;case"object":case"undefined":var l=a.get(r);s[i]=l!==e?l:t(r,o,a)}}),s}function i(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)}function r(){this.keys=[],this.Ib=[]}m.wc=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;m.H(e)&&10>t;t++)e=e();return e})},m.toJSON=function(e,t,i){return e=m.wc(e),m.a.Eb(e,t,i)},r.prototype={save:function(e,t){var i=m.a.o(this.keys,e);0<=i?this.Ib[i]=t:(this.keys.push(e),this.Ib.push(t))},get:function(t){return t=m.a.o(this.keys,t),0<=t?this.Ib[t]:e}}}(),m.b("toJS",m.wc),m.b("toJSON",m.toJSON),function(){m.j={u:function(t){switch(m.a.A(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?m.a.e.get(t,m.d.options.xb):7>=m.a.C?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?m.j.u(t.options[t.selectedIndex]):e;default:return t.value}},ha:function(t,i,r){switch(m.a.A(t)){case"option":switch(typeof i){case"string":m.a.e.set(t,m.d.options.xb,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=i;break;default:m.a.e.set(t,m.d.options.xb,i),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof i?i:""}break;case"select":""!==i&&null!==i||(i=e);for(var n,o=-1,a=0,s=t.options.length;a<s;++a)if(n=m.j.u(t.options[a]),n==i||""==n&&i===e){o=a;break}(r||0<=o||i===e&&1<t.size)&&(t.selectedIndex=o);break;default:null!==i&&i!==e||(i=""),t.value=i}}}}(),m.b("selectExtensions",m.j),m.b("selectExtensions.readValue",m.j.u),m.b("selectExtensions.writeValue",m.j.ha),m.h=function(){function e(e){e=m.a.$a(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var t,i=[],a=e.match(r),s=[],l=0;if(a){a.push(",");for(var u,c=0;u=a[c];++c){var d=u.charCodeAt(0);if(44===d){if(0>=l){i.push(t&&s.length?{key:t,value:s.join("")}:{unknown:t||s.join("")}),t=l=0,s=[];continue}}else if(58===d){if(!l&&!t&&1===s.length){t=s.pop();continue}}else 47===d&&c&&1<u.length?(d=a[c-1].match(n))&&!o[d[0]]&&(e=e.substr(e.indexOf(u)+1),a=e.match(r),a.push(","),c=-1,u="/"):40===d||123===d||91===d?++l:41===d||125===d||93===d?--l:t||s.length||34!==d&&39!==d||(u=u.slice(1,-1));s.push(u)}}return i}var t=["true","false","null","undefined"],i=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,r=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},a={};return{ta:[],ea:a,yb:e,Ua:function(r,n){function o(e,r){var n;if(!c){var d=m.getBindingHandler(e);if(d&&d.preprocess&&!(r=d.preprocess(r,e,o)))return;(d=a[e])&&(n=r,0<=m.a.o(t,n)?n=!1:(d=n.match(i),n=null!==d&&(d[1]?"Object("+d[1]+")"+d[2]:n)),d=n),d&&l.push("'"+e+"':function(_z){"+n+"=_z}")}u&&(r="function(){return "+r+" }"),s.push("'"+e+"':"+r)}n=n||{};var s=[],l=[],u=n.valueAccessors,c=n.bindingParams,d="string"==typeof r?e(r):r;return m.a.q(d,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},ad:function(e,t){for(var i=0;i<e.length;i++)if(e[i].key==t)return!0;return!1},Ea:function(e,t,i,r,n){e&&m.H(e)?!m.Ba(e)||n&&e.t()===r||e(r):(e=t.get("_ko_property_writers"))&&e[i]&&e[i](r)}}}(),m.b("expressionRewriting",m.h),m.b("expressionRewriting.bindingRewriteValidators",m.h.ta),m.b("expressionRewriting.parseObjectLiteral",m.h.yb),m.b("expressionRewriting.preProcessBindings",m.h.Ua),m.b("expressionRewriting._twoWayBindings",m.h.ea),m.b("jsonExpressionRewriting",m.h),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.h.Ua),function(){function e(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function r(i,r){for(var n=i,o=1,a=[];n=n.nextSibling;){if(t(n)&&(o--,0===o))return a;a.push(n),e(n)&&o++}if(!r)throw Error("Cannot find closing comment tag to match: "+i.nodeValue);return null}function n(e,t){var i=r(e,t);return i?0<i.length?i[i.length-1].nextSibling:e.nextSibling:null}var o=i&&"<!--test-->"===i.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0};m.f={Z:{},childNodes:function(t){return e(t)?r(t):t.childNodes},xa:function(t){if(e(t)){t=m.f.childNodes(t);for(var i=0,r=t.length;i<r;i++)m.removeNode(t[i])}else m.a.ob(t)},da:function(t,i){if(e(t)){m.f.xa(t);for(var r=t.nextSibling,n=0,o=i.length;n<o;n++)r.parentNode.insertBefore(i[n],r)}else m.a.da(t,i)},mc:function(t,i){e(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},gc:function(t,i,r){r?e(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):m.f.mc(t,i)},firstChild:function(i){return e(i)?!i.nextSibling||t(i.nextSibling)?null:i.nextSibling:i.firstChild},nextSibling:function(i){return e(i)&&(i=n(i)),i.nextSibling&&t(i.nextSibling)?null:i.nextSibling},Tc:e,pd:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},kc:function(i){if(l[m.a.A(i)]){var r=i.firstChild;if(r)do if(1===r.nodeType){var o;o=r.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=n(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=r.nextSibling,s=0;s<o.length;s++)a?i.insertBefore(o[s],a):i.appendChild(o[s])}while(r=r.nextSibling)}}}}(),m.b("virtualElements",m.f),m.b("virtualElements.allowedBindings",m.f.Z),m.b("virtualElements.emptyNode",m.f.xa),m.b("virtualElements.insertAfter",m.f.gc),m.b("virtualElements.prepend",m.f.mc),m.b("virtualElements.setDomNodeChildren",m.f.da),function(){m.Q=function(){this.Fc={}},m.a.extend(m.Q.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||m.g.getComponentNameForNode(e);case 8:return m.f.Tc(e);default:return!1}},getBindings:function(e,t){var i=this.getBindingsString(e,t),i=i?this.parseBindingsString(i,t,e):null;return m.g.Ob(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 m.g.Ob(i,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return m.f.pd(e);default:return null}},parseBindingsString:function(e,t,i,r){try{var n,o=this.Fc,a=e+(r&&r.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+m.h.Ua(e,r)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,i)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),m.Q.instance=new m.Q}(),m.b("bindingProvider",m.Q),function(){function i(e){return function(){return e}}function r(e){return e()}function o(e){return m.a.Ca(m.l.w(e),function(t,i){return function(){return e()[i]}})}function a(e,t,r){return"function"==typeof e?o(e.bind(null,t,r)):m.a.Ca(e,i)}function s(e,t){return o(this.getBindings.bind(this,e,t))}function l(e,t,i){var r,n=m.f.firstChild(t),o=m.Q.instance,a=o.preprocessNode;if(a){for(;r=n;)n=m.f.nextSibling(r),a.call(o,r);n=m.f.firstChild(t)}for(;r=n;)n=m.f.nextSibling(r),u(e,r,i)}function u(e,t,i){var r=!0,n=1===t.nodeType;n&&m.f.kc(t),(n&&i||m.Q.instance.nodeHasBindings(t))&&(r=d(t,null,e,i).shouldBindDescendants),r&&!p[m.a.A(t)]&&l(e,t,!n)}function c(e){var t=[],i={},r=[];return m.a.D(e,function n(o){if(!i[o]){var a=m.getBindingHandler(o);a&&(a.after&&(r.push(o),m.a.q(a.after,function(t){if(e[t]){if(-1!==m.a.o(r,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+r.join(", "));n(t)}}),r.length--),t.push({key:o,fc:a})),i[o]=!0}}),t}function d(t,i,n,o){var a=m.a.e.get(t,f);if(!i){if(a)throw Error("You cannot apply bindings multiple times to the same element.");m.a.e.set(t,f,!0)}!a&&o&&m.tc(t,n);var l;if(i&&"function"!=typeof i)l=i;else{var u=m.Q.instance,d=u.getBindingAccessors||s,h=m.B(function(){return(l=i?i(n,t):d.call(u,t,n))&&n.P&&n.P(),l},null,{i:t});l&&h.ba()||(h=null)}var p;if(l){var _=h?function(e){return function(){return r(h()[e])}}:function(e){return l[e]},g=function(){return m.a.Ca(h?h():l,r)};g.get=function(e){return l[e]&&r(_(e))},g.has=function(e){return e in l},o=c(l),m.a.q(o,function(i){var r=i.fc.init,o=i.fc.update,a=i.key;if(8===t.nodeType&&!m.f.Z[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof r&&m.l.w(function(){var i=r(t,_(a),g,n.$data,n);if(i&&i.controlsDescendantBindings){if(p!==e)throw Error("Multiple bindings ("+p+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");p=a}}),"function"==typeof o&&m.B(function(){o(t,_(a),g,n.$data,n)},null,{i:t})}catch(e){throw e.message='Unable to process binding "'+a+": "+l[a]+'"\nMessage: '+e.message,e}})}return{shouldBindDescendants:p===e}}function h(e){return e&&e instanceof m.U?e:new m.U(e)}m.d={};var p={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(e){return m.d[e]},m.U=function(t,i,r,n){var o,a=this,s="function"==typeof t&&!m.H(t),l=m.B(function(){var e=s?t():t,o=m.a.c(e);return i?(i.P&&i.P(),m.a.extend(a,i),l&&(a.P=l)):(a.$parents=[],a.$root=o,a.ko=m),a.$rawData=e,a.$data=o,r&&(a[r]=o),n&&n(a,i,o),a.$data},null,{wa:function(){return o&&!m.a.Qb(o)},i:!0});l.ba()&&(a.P=l,l.equalityComparer=null,o=[],l.Ac=function(t){o.push(t),m.a.F.oa(t,function(t){m.a.La(o,t),o.length||(l.k(),a.P=l=e)})})},m.U.prototype.createChildContext=function(e,t,i){return new m.U(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),i&&i(e)})},m.U.prototype.extend=function(e){return new m.U(this.P||this.$data,this,null,function(t,i){t.$rawData=i.$rawData,m.a.extend(t,"function"==typeof e?e():e)})};var f=m.a.e.I(),_=m.a.e.I();m.tc=function(e,t){return 2!=arguments.length?m.a.e.get(e,_):(m.a.e.set(e,_,t),void(t.P&&t.P.Ac(e)))},m.Ja=function(e,t,i){return 1===e.nodeType&&m.f.kc(e),d(e,t,h(i),!0)},m.Dc=function(e,t,i){return i=h(i),m.Ja(e,a(t,i,e),i)},m.eb=function(e,t){1!==t.nodeType&&8!==t.nodeType||l(h(e),t,!0)},m.Rb=function(e,i){if(!n&&t.jQuery&&(n=t.jQuery),i&&1!==i.nodeType&&8!==i.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");i=i||t.document.body,u(h(e),i,!0)},m.kb=function(t){switch(t.nodeType){case 1:case 8:var i=m.tc(t);if(i)return i;if(t.parentNode)return m.kb(t.parentNode)}return e},m.Jc=function(t){return(t=m.kb(t))?t.$data:e},m.b("bindingHandlers",m.d),m.b("applyBindings",m.Rb),m.b("applyBindingsToDescendants",m.eb),m.b("applyBindingAccessorsToNode",m.Ja),m.b("applyBindingsToNode",m.Dc),m.b("contextFor",m.kb),m.b("dataFor",m.Jc)}(),function(e){function t(t,r){var a,s=n.hasOwnProperty(t)?n[t]:e;s?s.X(r):(s=n[t]=new m.J,s.X(r),i(t,function(e,i){var r=!(!i||!i.synchronous);o[t]={definition:e,Zc:r},delete n[t],a||r?s.notifySubscribers(e):m.Y.Wa(function(){s.notifySubscribers(e)})}),a=!0)}function i(e,t){r("getConfig",[e],function(i){i?r("loadComponent",[e,i],function(e){t(e,i)}):t(null,null)})}function r(t,i,n,o){o||(o=m.g.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,i.concat(function(e){l?n(null):null!==e?n(e):r(t,i,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else r(t,i,n,o)}else n(null)}var n={},o={};m.g={get:function(i,r){var n=o.hasOwnProperty(i)?o[i]:e;n?n.Zc?m.l.w(function(){r(n.definition)}):m.Y.Wa(function(){r(n.definition)}):t(i,r)},Xb:function(e){delete o[e]},Jb:r},m.g.loaders=[],m.b("components",m.g),m.b("components.get",m.g.get),m.b("components.clearCachedDefinition",m.g.Xb)}(),function(){function e(e,t,i,r){function n(){0===--s&&r(o)}var o={},s=2,l=i.template;i=i.viewModel,l?a(t,l,function(t){m.g.Jb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),i?a(t,i,function(t){m.g.Jb("loadViewModel",[e,t],function(e){o[c]=e,n()})}):n()}function r(e,t,i){if("function"==typeof t)i(function(e){return new t(e)});else if("function"==typeof t[c])i(t[c]);else if("instance"in t){var n=t.instance;i(function(){return n})}else"viewModel"in t?r(e,t.viewModel,i):e("Unknown viewModel value: "+t)}function n(e){switch(m.a.A(e)){case"script":return m.a.ma(e.text);case"textarea":return m.a.ma(e.value);case"template":if(o(e.content))return m.a.ua(e.content.childNodes)}return m.a.ua(e.childNodes)}function o(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,i,r){"string"==typeof i.require?s||t.require?(s||t.require)([i.require],r):e("Uses require, but no AMD loader is present"):r(i)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};m.g.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(m.g.ub(e))throw Error("Component "+e+" is already registered");u[e]=t},m.g.ub=function(e){return u.hasOwnProperty(e)},m.g.od=function(e){delete u[e],m.g.Xb(e)},m.g.Zb={getConfig:function(e,t){t(u.hasOwnProperty(e)?u[e]:null)},loadComponent:function(t,i,r){var n=l(t);a(n,i,function(i){e(t,n,i,r)})},loadTemplate:function(e,r,a){if(e=l(e),"string"==typeof r)a(m.a.ma(r));else if(r instanceof Array)a(r);else if(o(r))a(m.a.V(r.childNodes));else if(r.element)if(r=r.element,t.HTMLElement?r instanceof HTMLElement:r&&r.tagName&&1===r.nodeType)a(n(r));else if("string"==typeof r){var s=i.getElementById(r);s?a(n(s)):e("Cannot find element with ID "+r)}else e("Unknown element type: "+r);else e("Unknown template value: "+r)},loadViewModel:function(e,t,i){r(l(e),t,i)}};var c="createViewModel";m.b("components.register",m.g.register),m.b("components.isRegistered",m.g.ub),m.b("components.unregister",m.g.od),m.b("components.defaultLoader",m.g.Zb),m.g.loaders.push(m.g.Zb),m.g.Bc=u}(),function(){function e(e,i){var r=e.getAttribute("params");if(r){var r=t.parseBindingsString(r,i,e,{valueAccessors:!0,bindingParams:!0}),r=m.a.Ca(r,function(t){return m.m(t,null,{i:e})}),n=m.a.Ca(r,function(t){var i=t.t();return t.ba()?m.m({read:function(){return m.a.c(t())},write:m.Ba(i)&&function(e){t()(e)},i:e}):i});return n.hasOwnProperty("$raw")||(n.$raw=r),n}return{$raw:{}}}m.g.getComponentNameForNode=function(e){var t=m.a.A(e);if(m.g.ub(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=m.a.C&&e.tagName===t))return t},m.g.Ob=function(t,i,r,n){if(1===i.nodeType){var o=m.g.getComponentNameForNode(i);if(o){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(i,r)};t.component=n?function(){return a}:a}}return t};var t=new m.Q;9>m.a.C&&(m.g.register=function(e){return function(t){return i.createElement(t),e.apply(this,arguments)}}(m.g.register),i.createDocumentFragment=function(e){return function(){var t,i=e(),r=m.g.Bc;for(t in r)r.hasOwnProperty(t)&&i.createElement(t);return i}}(i.createDocumentFragment))}(),function(e){function t(e,t,i){if(t=t.template,!t)throw Error("Component '"+e+"' has no template");e=m.a.ua(t),m.f.da(i,e)}function i(e,t,i,r){var n=e.createViewModel;return n?n.call(e,r,{element:t,templateNodes:i}):r}var r=0;m.d.component={init:function(n,o,a,s,l){function u(){var e=c&&c.dispose;"function"==typeof e&&e.call(c),d=c=null}var c,d,h=m.a.V(m.f.childNodes(n));return m.a.F.oa(n,u),m.m(function(){var a,s,p=m.a.c(o());if("string"==typeof p?a=p:(a=m.a.c(p.name),s=m.a.c(p.params)),!a)throw Error("No component name specified");var f=d=++r;m.g.get(a,function(r){if(d===f){if(u(),!r)throw Error("Unknown component '"+a+"'");t(a,r,n);var o=i(r,n,h,s);r=l.createChildContext(o,e,function(e){e.$component=o,e.$componentTemplateNodes=h}),c=o,m.eb(r,n)}})},null,{i:n}),{controlsDescendantBindings:!0}}},m.f.Z.component=!0}();var A={class:"className",for:"htmlFor"};m.d.attr={update:function(t,i){var r=m.a.c(i())||{};m.a.D(r,function(i,r){r=m.a.c(r);var n=!1===r||null===r||r===e;n&&t.removeAttribute(i),8>=m.a.C&&i in A?(i=A[i],n?t.removeAttribute(i):t[i]=r):n||t.setAttribute(i,r.toString()),"name"===i&&m.a.rc(t,n?"":r.toString())})}},function(){m.d.checked={after:["value","attr"],init:function(t,i,r){function n(){var e=t.checked,n=p?a():e;if(!m.va.Sa()&&(!l||e)){var o=m.l.w(i);if(c){var s=d?o.t():o;h!==n?(e&&(m.a.pa(s,n,!0),m.a.pa(s,h,!1)),h=n):m.a.pa(s,n,e),d&&m.Ba(o)&&o(s)}else m.h.Ea(o,r,"checked",n,!0)}}function o(){var e=m.a.c(i());t.checked=c?0<=m.a.o(e,a()):s?e:a()===e}var a=m.nc(function(){return r.has("checkedValue")?m.a.c(r.get("checkedValue")):r.has("value")?m.a.c(r.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=i(),c=s&&m.a.c(u)instanceof Array,d=!(c&&u.push&&u.splice),h=c?a():e,p=l||c;l&&!t.name&&m.d.uniqueName.init(t,function(){return!0}),m.m(n,null,{i:t}),m.a.p(t,"click",n),m.m(o,null,{i:t}),u=e}}},m.h.ea.checked=!0,m.d.checkedValue={update:function(e,t){e.value=m.a.c(t())}}}(),m.d.css={update:function(e,t){var i=m.a.c(t());null!==i&&"object"==typeof i?m.a.D(i,function(t,i){i=m.a.c(i),m.a.bb(e,t,i)}):(i=m.a.$a(String(i||"")),m.a.bb(e,e.__ko__cssValue,!1),e.__ko__cssValue=i,m.a.bb(e,i,!0))}},m.d.enable={update:function(e,t){var i=m.a.c(t());i&&e.disabled?e.removeAttribute("disabled"):i||e.disabled||(e.disabled=!0)}},m.d.disable={update:function(e,t){m.d.enable.update(e,function(){return!m.a.c(t())})}},m.d.event={init:function(e,t,i,r,n){var o=t()||{};m.a.D(o,function(o){"string"==typeof o&&m.a.p(e,o,function(e){var a,s=t()[o];if(s){try{var l=m.a.V(arguments);r=n.$data,l.unshift(r),a=s.apply(r,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===i.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},m.d.foreach={ic:function(e){return function(){var t=e(),i=m.a.zb(t);return i&&"number"!=typeof i.length?(m.a.c(t),{foreach:i.data,as:i.as,includeDestroyed:i.includeDestroyed,afterAdd:i.afterAdd,beforeRemove:i.beforeRemove,afterRender:i.afterRender,beforeMove:i.beforeMove,afterMove:i.afterMove,templateEngine:m.W.sb}):{foreach:t,templateEngine:m.W.sb}}},init:function(e,t){return m.d.template.init(e,m.d.foreach.ic(t))},update:function(e,t,i,r,n){return m.d.template.update(e,m.d.foreach.ic(t),i,r,n)}},m.h.ta.foreach=!1,m.f.Z.foreach=!0,m.d.hasfocus={init:function(e,t,i){function r(r){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(e){o=n.body}r=o===e}n=t(),m.h.Ea(n,i,"hasfocus",r,!0),e.__ko_hasfocusLastValue=r,e.__ko_hasfocusUpdating=!1}var n=r.bind(null,!0),o=r.bind(null,!1);m.a.p(e,"focus",n),m.a.p(e,"focusin",n),m.a.p(e,"blur",o),m.a.p(e,"focusout",o)},update:function(e,t){var i=!!m.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===i||(i?e.focus():e.blur(),!i&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),m.l.w(m.a.Da,null,[e,i?"focusin":"focusout"]))}},m.h.ea.hasfocus=!0,m.d.hasFocus=m.d.hasfocus,m.h.ea.hasFocus=!0,m.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){m.a.Cb(e,t())}},f("if"),f("ifnot",!1,!0),f("with",!0,!1,function(e,t){return e.createChildContext(t)});var P={};m.d.options={init:function(e){if("select"!==m.a.A(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,i,r){function n(){return m.a.Ka(t.options,function(e){return e.selected})}function o(e,t,i){var r=typeof t;return"function"==r?t(e):"string"==r?e[t]:i}function a(e,i){if(f&&c)m.j.ha(t,m.a.c(r.get("value")),!0);else if(p.length){var n=0<=m.a.o(p,m.j.u(i[0]));m.a.sc(i[0],n),f&&!n&&m.l.w(m.a.Da,null,[t,"change"])}}var s=t.multiple,l=0!=t.length&&s?t.scrollTop:null,u=m.a.c(i()),c=r.get("valueAllowUnset")&&r.has("value"),d=r.get("optionsIncludeDestroyed");i={};var h,p=[];c||(s?p=m.a.fb(n(),m.j.u):0<=t.selectedIndex&&p.push(m.j.u(t.options[t.selectedIndex]))),u&&("undefined"==typeof u.length&&(u=[u]),h=m.a.Ka(u,function(t){return d||t===e||null===t||!m.a.c(t._destroy)}),r.has("optionsCaption")&&(u=m.a.c(r.get("optionsCaption")),null!==u&&u!==e&&h.unshift(P)));var f=!1;i.beforeRemove=function(e){t.removeChild(e)},u=a,r.has("optionsAfterRender")&&"function"==typeof r.get("optionsAfterRender")&&(u=function(t,i){a(0,i),m.l.w(r.get("optionsAfterRender"),null,[i[0],t!==P?t:e])}),m.a.Bb(t,h,function(i,n,a){return a.length&&(p=!c&&a[0].selected?[m.j.u(a[0])]:[],f=!0),n=t.ownerDocument.createElement("option"),i===P?(m.a.Za(n,r.get("optionsCaption")),m.j.ha(n,e)):(a=o(i,r.get("optionsValue"),i),m.j.ha(n,m.a.c(a)),i=o(i,r.get("optionsText"),a),m.a.Za(n,i)),[n]},i,u),m.l.w(function(){c?m.j.ha(t,m.a.c(r.get("value")),!0):(s?p.length&&n().length<p.length:p.length&&0<=t.selectedIndex?m.j.u(t.options[t.selectedIndex])!==p[0]:p.length||0<=t.selectedIndex)&&m.a.Da(t,"change")}),m.a.Nc(t),l&&20<Math.abs(l-t.scrollTop)&&(t.scrollTop=l)}},m.d.options.xb=m.a.e.I(),m.d.selectedOptions={after:["options","foreach"],init:function(e,t,i){m.a.p(e,"change",function(){var r=t(),n=[];m.a.q(e.getElementsByTagName("option"),function(e){e.selected&&n.push(m.j.u(e))}),m.h.Ea(r,i,"selectedOptions",n)})},update:function(e,t){if("select"!=m.a.A(e))throw Error("values binding applies only to SELECT elements");var i=m.a.c(t()),r=e.scrollTop;i&&"number"==typeof i.length&&m.a.q(e.getElementsByTagName("option"),function(e){var t=0<=m.a.o(i,m.j.u(e));e.selected!=t&&m.a.sc(e,t)}),e.scrollTop=r}},m.h.ea.selectedOptions=!0,m.d.style={update:function(t,i){var r=m.a.c(i()||{});m.a.D(r,function(i,r){r=m.a.c(r),null!==r&&r!==e&&!1!==r||(r=""),t.style[i]=r})}},m.d.submit={init:function(e,t,i,r,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");m.a.p(e,"submit",function(i){var r,o=t();try{r=o.call(n.$data,e)}finally{!0!==r&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}},m.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){m.a.Za(e,t())}},m.f.Z.text=!0,function(){if(t&&t.navigator)var i=function(e){if(e)return parseFloat(e[1])},r=t.opera&&t.opera.version&&parseInt(t.opera.version()),n=t.navigator.userAgent,o=i(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),a=i(n.match(/Firefox\/([^ ]*)/));if(10>m.a.C)var s=m.a.e.I(),l=m.a.e.I(),u=function(e){var t=this.activeElement;(t=t&&m.a.e.get(t,l))&&t(e)},c=function(e,t){var i=e.ownerDocument;m.a.e.get(i,s)||(m.a.e.set(i,s,!0),m.a.p(i,"selectionchange",u)),m.a.e.set(e,l,t)};m.d.textInput={init:function(t,i,n){function s(e,i){m.a.p(t,e,i)}function l(){var r=m.a.c(i());null!==r&&r!==e||(r=""),p!==e&&r===p?m.a.setTimeout(l,4):t.value!==r&&(f=r,t.value=r)}function u(){h||(p=t.value,h=m.a.setTimeout(d,4))}function d(){clearTimeout(h),p=h=e;var r=t.value;f!==r&&(f=r,m.h.Ea(i(),n,"textInput",r))}var h,p,f=t.value,_=9==m.a.C?u:d;10>m.a.C?(s("propertychange",function(e){"value"===e.propertyName&&_(e)}),8==m.a.C&&(s("keyup",d),s("keydown",d)),8<=m.a.C&&(c(t,_),s("dragend",u))):(s("input",d),5>o&&"textarea"===m.a.A(t)?(s("keydown",u),s("paste",u),s("cut",u)):11>r?s("keydown",u):4>a&&(s("DOMAutoComplete",d),s("dragdrop",d),s("drop",d))),s("change",d),m.m(l,null,{i:t})}},m.h.ea.textInput=!0,m.d.textinput={preprocess:function(e,t,i){i("textInput",e)}}}(),m.d.uniqueName={init:function(e,t){if(t()){var i="ko_unique_"+ ++m.d.uniqueName.Ic;m.a.rc(e,i)}}},m.d.uniqueName.Ic=0,m.d.value={after:["options","foreach"],init:function(e,t,i){if("input"!=e.tagName.toLowerCase()||"checkbox"!=e.type&&"radio"!=e.type){var r=["change"],n=i.get("valueUpdate"),o=!1,a=null;n&&("string"==typeof n&&(n=[n]),m.a.ra(r,n),r=m.a.Tb(r));var s=function(){a=null,o=!1;var r=t(),n=m.j.u(e);m.h.Ea(r,i,"value",n)};!m.a.C||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=m.a.o(r,"propertychange")||(m.a.p(e,"propertychange",function(){o=!0}),m.a.p(e,"focus",function(){o=!1}),m.a.p(e,"blur",function(){o&&s()})),m.a.q(r,function(t){var i=s;m.a.nd(t,"after")&&(i=function(){a=m.j.u(e),m.a.setTimeout(s,0)},t=t.substring(5)),m.a.p(e,t,i)});var l=function(){var r=m.a.c(t()),n=m.j.u(e);if(null!==a&&r===a)m.a.setTimeout(l,0);else if(r!==n)if("select"===m.a.A(e)){var o=i.get("valueAllowUnset"),n=function(){m.j.ha(e,r,o)};n(),o||r===m.j.u(e)?m.a.setTimeout(n,0):m.l.w(m.a.Da,null,[e,"change"])}else m.j.ha(e,r)};m.m(l,null,{i:e})}else m.Ja(e,{checkedValue:t})},update:function(){}},m.h.ea.value=!0,m.d.visible={update:function(e,t){var i=m.a.c(t()),r="none"!=e.style.display;i&&!r?e.style.display="":!i&&r&&(e.style.display="none")}},function(e){m.d[e]={init:function(t,i,r,n,o){return m.d.event.init.call(this,t,function(){var t={};return t[e]=i(),t},r,n,o)}}}("click"),m.O=function(){},m.O.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.O.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.O.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||i;var r=t.getElementById(e);if(!r)throw Error("Cannot find template with ID "+e);return new m.v.n(r)}if(1==e.nodeType||8==e.nodeType)return new m.v.qa(e);throw Error("Unknown template type: "+e)},m.O.prototype.renderTemplate=function(e,t,i,r){return e=this.makeTemplateSource(e,r),this.renderTemplateSource(e,t,i,r)},m.O.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten"); -},m.O.prototype.rewriteTemplate=function(e,t,i){e=this.makeTemplateSource(e,i),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},m.b("templateEngine",m.O),m.Gb=function(){function e(e,t,i,r){e=m.h.yb(e);for(var n=m.h.ta,o=0;o<e.length;o++){var a=e[o].key;if(n.hasOwnProperty(a)){var s=n[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.h.Ua(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{Oc:function(e,t,i){t.isTemplateRewritten(e,i)||t.rewriteTemplate(e,function(e){return m.Gb.dd(e,t)},i)},dd:function(r,n){return r.replace(t,function(t,i,r,o,a){return e(a,i,r,n)}).replace(i,function(t,i){return e(i,"<!-- ko -->","#comment",n)})},Ec:function(e,t){return m.M.wb(function(i,r){var n=i.nextSibling;n&&n.nodeName.toLowerCase()===t&&m.Ja(n,e,r)})}}}(),m.b("__tr_ambtns",m.Gb.Ec),function(){m.v={},m.v.n=function(e){if(this.n=e){var t=m.a.A(e);this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},m.v.n.prototype.text=function(){var e=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.n[e];var t=arguments[0];"innerHTML"===e?m.a.Cb(this.n,t):this.n[e]=t};var t=m.a.e.I()+"_";m.v.n.prototype.data=function(e){return 1===arguments.length?m.a.e.get(this.n,t+e):void m.a.e.set(this.n,t+e,arguments[1])};var i=m.a.e.I();m.v.n.prototype.nodes=function(){var t=this.n;return 0==arguments.length?(m.a.e.get(t,i)||{}).jb||(3===this.ab?t.content:4===this.ab?t:e):void m.a.e.set(t,i,{jb:arguments[0]})},m.v.qa=function(e){this.n=e},m.v.qa.prototype=new m.v.n,m.v.qa.prototype.text=function(){if(0==arguments.length){var t=m.a.e.get(this.n,i)||{};return t.Hb===e&&t.jb&&(t.Hb=t.jb.innerHTML),t.Hb}m.a.e.set(this.n,i,{Hb:arguments[0]})},m.b("templateSources",m.v),m.b("templateSources.domElement",m.v.n),m.b("templateSources.anonymousTemplate",m.v.qa)}(),function(){function t(e,t,i){var r;for(t=m.f.nextSibling(t);e&&(r=e)!==t;)e=m.f.nextSibling(r),i(r,e)}function i(e,i){if(e.length){var r=e[0],n=e[e.length-1],o=r.parentNode,a=m.Q.instance,s=a.preprocessNode;if(s){if(t(r,n,function(e,t){var i=e.previousSibling,o=s.call(a,e);o&&(e===r&&(r=o[0]||t),e===n&&(n=o[o.length-1]||i))}),e.length=0,!r)return;r===n?e.push(r):(e.push(r,n),m.a.za(e,o))}t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||m.Rb(i,e)}),t(r,n,function(e){1!==e.nodeType&&8!==e.nodeType||m.M.yc(e,[i])}),m.a.za(e,o)}}function r(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,o,s){s=s||{};var l=(e&&r(e)||n||{}).ownerDocument,u=s.templateEngine||a;if(m.Gb.Oc(n,u,l),n=u.renderTemplate(n,o,s,l),"number"!=typeof n.length||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":m.f.da(e,n),l=!0;break;case"replaceNode":m.a.qc(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(i(n,o),s.afterRender&&m.l.w(s.afterRender,null,[n,o.$data])),n}function o(e,t,i){return m.H(e)?e():"function"==typeof e?e(t,i):e}var a;m.Db=function(t){if(t!=e&&!(t instanceof m.O))throw Error("templateEngine must inherit from ko.templateEngine");a=t},m.Ab=function(t,i,s,l,u){if(s=s||{},(s.templateEngine||a)==e)throw Error("Set a template engine before calling renderTemplate");if(u=u||"replaceChildren",l){var c=r(l);return m.B(function(){var e=i&&i instanceof m.U?i:new m.U(m.a.c(i)),a=o(t,e.$data,e),e=n(l,u,a,e,s);"replaceNode"==u&&(l=e,c=r(l))},null,{wa:function(){return!c||!m.a.nb(c)},i:c&&"replaceNode"==u?c.parentNode:c})}return m.M.wb(function(e){m.Ab(t,i,s,e,"replaceNode")})},m.kd=function(t,r,a,s,l){function u(e,t){i(t,d),a.afterRender&&a.afterRender(t,e),d=null}function c(e,i){d=l.createChildContext(e,a.as,function(e){e.$index=i});var r=o(t,e,d);return n(null,"ignoreTargetNode",r,d,a)}var d;return m.B(function(){var t=m.a.c(r)||[];"undefined"==typeof t.length&&(t=[t]),t=m.a.Ka(t,function(t){return a.includeDestroyed||t===e||null===t||!m.a.c(t._destroy)}),m.l.w(m.a.Bb,null,[s,t,c,a,u])},null,{i:s})};var s=m.a.e.I();m.d.template={init:function(e,t){var i=m.a.c(t());if("string"==typeof i||i.name)m.f.xa(e);else{if("nodes"in i){if(i=i.nodes||[],m.H(i))throw Error('The "nodes" option must be a plain, non-observable array.')}else i=m.f.childNodes(e);i=m.a.jc(i),new m.v.qa(e).nodes(i)}return{controlsDescendantBindings:!0}},update:function(t,i,r,n,o){var a,l=i();i=m.a.c(l),r=!0,n=null,"string"==typeof i?i={}:(l=i.name,"if"in i&&(r=m.a.c(i.if)),r&&"ifnot"in i&&(r=!m.a.c(i.ifnot)),a=m.a.c(i.data)),"foreach"in i?n=m.kd(l||t,r&&i.foreach||[],i,t,o):r?(o="data"in i?o.createChildContext(a,i.as):o,n=m.Ab(l||t,o,i,t)):m.f.xa(t),o=n,(a=m.a.e.get(t,s))&&"function"==typeof a.k&&a.k(),m.a.e.set(t,s,o&&o.ba()?o:e)}},m.h.ta.template=function(e){return e=m.h.yb(e),1==e.length&&e[0].unknown||m.h.ad(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.f.Z.template=!0}(),m.b("setTemplateEngine",m.Db),m.b("renderTemplate",m.Ab),m.a.dc=function(e,t,i){if(e.length&&t.length){var r,n,o,a,s;for(r=n=0;(!i||r<i)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),r=o=0;break}r+=o}}},m.a.ib=function(){function e(e,t,i,r,n){var o,a,s,l,u,c=Math.min,d=Math.max,h=[],p=e.length,f=t.length,_=f-p||1,g=p+f+1;for(o=0;o<=p;o++)for(l=s,h.push(s=[]),u=c(f,o+_),a=d(0,o-1);a<=u;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||g,s[a-1]||g)+1:a+1:o+1;for(c=[],d=[],_=[],o=p,a=f;o||a;)f=h[o][a]-1,a&&f===h[o][a-1]?d.push(c[c.length]={status:i,value:t[--a],index:a}):o&&f===h[o-1][a]?_.push(c[c.length]={status:r,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return m.a.dc(_,d,!n.dontLimitMoves&&10*p),c.reverse()}return function(t,i,r){return r="boolean"==typeof r?{dontLimitMoves:r}:r||{},t=t||[],i=i||[],t.length<i.length?e(t,i,"added","deleted",r):e(i,t,"deleted","added",r)}}(),m.b("utils.compareArrays",m.a.ib),function(){function t(t,i,r,n,o){var a=[],s=m.B(function(){var e=i(r,o,m.a.za(a,t))||[];0<a.length&&(m.a.qc(a,e),n&&m.l.w(n,null,[r,e,o])),a.length=0,m.a.ra(a,e)},null,{i:t,wa:function(){return!m.a.Qb(a)}});return{ca:a,B:s.ba()?s:e}}var i=m.a.e.I(),r=m.a.e.I();m.a.Bb=function(n,o,a,s,l){function u(e,t){w=h[t],v!==t&&(b[e]=w),w.qb(v++),m.a.za(w.ca,n),_.push(w),C.push(w)}function c(e,t){if(e)for(var i=0,r=t.length;i<r;i++)t[i]&&m.a.q(t[i].ca,function(r){e(r,i,t[i].ja)})}o=o||[],s=s||{};var d=m.a.e.get(n,i)===e,h=m.a.e.get(n,i)||[],p=m.a.fb(h,function(e){return e.ja}),f=m.a.ib(p,o,s.dontLimitMoves),_=[],g=0,v=0,y=[],C=[];o=[];for(var w,S,E,b=[],p=[],T=0;S=f[T];T++)switch(E=S.moved,S.status){case"deleted":E===e&&(w=h[g],w.B&&(w.B.k(),w.B=e),m.a.za(w.ca,n).length&&(s.beforeRemove&&(_.push(w),C.push(w),w.ja===r?w=null:o[T]=w),w&&y.push.apply(y,w.ca))),g++;break;case"retained":u(T,g++);break;case"added":E!==e?u(T,E):(w={ja:S.value,qb:m.N(v++)},_.push(w),C.push(w),d||(p[T]=w))}m.a.e.set(n,i,_),c(s.beforeMove,b),m.a.q(y,s.beforeRemove?m.$:m.removeNode);for(var x,T=0,d=m.f.firstChild(n);w=C[T];T++){for(w.ca||m.a.extend(w,t(n,a,w.ja,l,w.qb)),g=0;f=w.ca[g];d=f.nextSibling,x=f,g++)f!==d&&m.f.gc(n,f,x);!w.Wc&&l&&(l(w.ja,w.ca,w.qb),w.Wc=!0)}for(c(s.beforeRemove,o),T=0;T<o.length;++T)o[T]&&(o[T].ja=r);c(s.afterMove,b),c(s.afterAdd,p)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.Bb),m.W=function(){this.allowTemplateRewriting=!1},m.W.prototype=new m.O,m.W.prototype.renderTemplateSource=function(e,t,i,r){return(t=(9>m.a.C?0:e.nodes)?e.nodes():null)?m.a.V(t.cloneNode(!0).childNodes):(e=e.text(),m.a.ma(e,r))},m.W.sb=new m.W,m.Db(m.W.sb),m.b("nativeTemplateEngine",m.W),function(){m.vb=function(){var e=this.$c=function(){if(!n||!n.tmpl)return 0;try{if(0<=n.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,r,o,a){if(a=a||i,o=o||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var s=t.data("precompiled");return s||(s=t.text()||"",s=n.template(null,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),t.data("precompiled",s)),t=[r.$data],r=n.extend({koBindingContext:r},o.templateOptions),r=n.tmpl(s,t,r),r.appendTo(a.createElement("div")),n.fragments={},r},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){i.write("<script type='text/html' id='"+e+"'>"+t+"</script>")},0<e&&(n.tmpl.tag.ko_code={open:"__.push($1 || '');"},n.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.vb.prototype=new m.O;var e=new m.vb;0<e.$c&&m.Db(e),m.b("jqueryTmplTemplateEngine",m.vb)}()})}()}(),define("ThirdParty/knockout-es5",[],function(){"use strict";function e(e,i){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,o=t(e,!0);return i=i||Object.getOwnPropertyNames(e),i.forEach(function(t){if(t!==d&&t!==h&&!(t in o)){var i=e[t],a=i instanceof Array,s=n.isObservable(i)?i:a?n.observableArray(i):n.observable(i);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),o[t]=s,a&&r(n,s)}}),e}function t(e,t){var i=e[d];return!i&&t&&(i={},Object.defineProperty(e,d,{value:i})),i}function i(t,i,r){var n=this,o={owner:t,deferEvaluation:!0};if("function"==typeof r)o.read=r;else{if("value"in r)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if("function"!=typeof r.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".');o.read=r.get,o.write=r.set}return t[i]=n.computed(o),e.call(n,t,[i]),t}function r(e,t){var i=null;e.computed(function(){i&&(i.dispose(),i=null);var r=t();r instanceof Array&&(i=n(e,t,r))})}function n(e,t,i){var r=o(e,i);return r.subscribe(t)}function o(e,t){var i=t[h];if(!i){i=new e.subscribable,Object.defineProperty(t,h,{value:i});var r={};a(t,i,r),s(e,t,i,r)}return i}function a(e,t,i){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(r){var n=e[r];e[r]=function(){var e=n.apply(this,arguments);return i.pause!==!0&&t.notifySubscribers(this),e}})}function s(e,t,i,r){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;r.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{r.pause=!1}return i.notifySubscribers(t),o}})})}function l(e,i){if(!e)return null;var r=t(e,!1);return r&&r[i]||null}function u(e,t){var i=l(e,t);i&&i.valueHasMutated()}function c(t){t.track=e,t.getObservable=l,t.valueHasMutated=u,t.defineProperty=i}var d="__knockoutObservables",h="__knockoutSubscribable";return{attachToKo:c}}),define("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg",t="cesium-svgPath-svg",i={register:function(i){i.bindingHandlers.cesiumSvgPath={init:function(r,n){var o=document.createElementNS(e,"svg:svg");o.setAttribute("class",t);var a=document.createElementNS(e,"path");return o.appendChild(a),i.virtualElements.setDomNodeChildren(r,[o]),i.computed({read:function(){var e=i.unwrap(n());a.setAttribute("d",i.unwrap(e.path));var r=i.unwrap(e.width),s=i.unwrap(e.height);o.setAttribute("width",r),o.setAttribute("height",s),o.setAttribute("viewBox","0 0 "+r+" "+s),e.css&&o.setAttribute("class",t+" "+i.unwrap(e.css))},disposeWhenNodeIsRemoved:r}),{controlsDescendantBindings:!0}}},i.virtualElements.allowedBindings.cesiumSvgPath=!0}};return i}),define("ThirdParty/knockout",["./knockout-3.4.0","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,i){"use strict";return t.attachToKo(e),i.register(e),e}),define("ThirdParty/NoSleep",[],function(){"use strict";function e(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/"+t,e.appendChild(r)}var t={Android:"undefined"!=typeof navigator&&/Android/gi.test(navigator.userAgent),iOS:"undefined"!=typeof navigator&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)},i={WebM:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",MP4:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthADAowdbb9/AAAC6W1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAA+gAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiB9FAEQBFGMAAAGyTGF2YzUyLjg3LjQGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAAAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGB1ZHRhAAAAWG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAK2lsc3QAAAAjqXRvbwAAABtkYXRhAAAAAQAAAABMYXZmNTIuNzguMw=="},r=function(){return t.iOS?this.noSleepTimer=null:t.Android&&(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("loop",""),e(this.noSleepVideo,"webm",i.WebM),e(this.noSleepVideo,"mp4",i.MP4)),this};return r.prototype.enable=function(e){t.iOS?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location=window.location,window.setTimeout(window.stop,0)},e||15e3)):t.Android&&this.noSleepVideo.play()},r.prototype.disable=function(){t.iOS?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):t.Android&&this.noSleepVideo.pause()},r}),define("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";function t(t,i,r,n,o){return r.call(n,t[i]),e.getObservable(t,i).subscribe(r,n,o)}return t}),define("Widgets/Animation/Animation",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","../subscribeAndEvaluate"],function(e,t,i,r,n,o,a){"use strict";function s(t){return e.fromCssColorString(window.getComputedStyle(t).getPropertyValue("color"))}function l(e){var t=document.createElementNS(v,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(l(e.children[r]))}else 0===i.indexOf("xlink:")?t.setAttributeNS(y,i.substring(6),e[i]):"textContent"===i?t.textContent=e[i]:t.setAttribute(i,e[i]);return t}function u(e,t,i){var r=document.createElementNS(v,"text");r.setAttribute("x",e),r.setAttribute("y",t),r.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(v,"tspan");return n.textContent=i,r.appendChild(n),r}function c(e,t,i){e.setAttribute("transform","translate(100,100) rotate("+i+")"),t.setAttribute("transform","rotate("+i+")")}function d(e,t){var i=t.alpha,r=1-i;return P.red=e.red*r+t.red*i,P.green=e.green*r+t.green*i,P.blue=e.blue*r+t.blue*i,P.toCssColorString()}function h(e,t,i){var r={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:""}]};return l(r)}function p(e,t,i){var r={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:""}]};return l(r)}function f(e,t){var i=e._viewModel,r=i.shuttleRingDragging;if(!r||g===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,o,a=e._centerX,s=e._centerY,l=e._svgNode,u=l.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!r&&(n>u.right||n<u.left||o<u.top||o>u.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),d=n-a-u.left,h=o-s-u.top,p=180*Math.atan2(h,d)/Math.PI+90;p>180&&(p-=360);var f=i.shuttleRingAngle;r||n<c.right&&n>c.left&&o>c.top&&o<c.bottom?(g=e,i.shuttleRingDragging=!0,i.shuttleRingAngle=p):p<f?i.slower():p>f&&i.faster(),t.preventDefault()}else e===g&&(g=void 0),i.shuttleRingDragging=!1}function m(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=[a(t,"toggled",this.setToggled,this),a(t,"tooltip",this.setTooltip,this),a(t.command,"canExecute",this.setEnabled,this)]}function _(e,t){function i(e){f(x,e)}e=o(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 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); }",document.head.insertBefore(r,document.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 s=document.createElementNS(v,"svg:svg");this._svgNode=s,s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",y);var d=document.createElementNS(v,"g");this._topG=d,this._realtimeSVG=new m(p(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new m(h(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new m(h(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new m(h(84,99,"#animation_pathPause"),t.pauseViewModel);var _=document.createElementNS(v,"g");_.appendChild(this._realtimeSVG.svgElement),_.appendChild(this._playReverseSVG.svgElement),_.appendChild(this._playForwardSVG.svgElement),_.appendChild(this._pauseSVG.svgElement);var g=l({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=g;var C=l({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=C,this._shuttleRingPointer=l({tagName:"use",class:"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var w=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});var S=61,E=l({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:S});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var b=l({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:S}),T=document.createElementNS(v,"g");T.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),d.appendChild(T),d.appendChild(w),d.appendChild(_),T.appendChild(g),T.appendChild(C),T.appendChild(this._shuttleRingPointer),w.appendChild(this._knobOuter),w.appendChild(E),w.appendChild(this._knobDate),w.appendChild(this._knobTime),w.appendChild(this._knobStatus),w.appendChild(b),s.appendChild(d),e.appendChild(s);var x=this;this._mouseCallback=i,g.addEventListener("mousedown",i,!0),g.addEventListener("touchstart",i,!0),C.addEventListener("mousedown",i,!0),C.addEventListener("touchstart",i,!0),document.addEventListener("mousemove",i,!0),document.addEventListener("touchmove",i,!0),document.addEventListener("mouseup",i,!0),document.addEventListener("touchend",i,!0),document.addEventListener("touchcancel",i,!0),this._shuttleRingPointer.addEventListener("mousedown",i,!0),this._shuttleRingPointer.addEventListener("touchstart",i,!0),this._knobOuter.addEventListener("mousedown",i,!0),this._knobOuter.addEventListener("touchstart",i,!0);var A,P=this._knobTime.childNodes[0],M=this._knobDate.childNodes[0],D=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){A!==e&&(A=e,A?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(x._shuttleRingPointer,x._knobOuter,e)}),a(t,"dateLabel",function(e){M.textContent!==e&&(M.textContent=e)}),a(t,"timeLabel",function(e){P.textContent!==e&&(P.textContent=e)}),a(t,"multiplierLabel",function(e){D.textContent!==e&&(D.textContent=e)})],this.applyThemeChanges(),this.resize()}var g,v="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",C=e.fromCssColorString("rgba(247,250,255,0.384)"),w=e.fromCssColorString("rgba(143,191,255,0.216)"),S=e.fromCssColorString("rgba(153,197,255,0.098)"),E=e.fromCssColorString("rgba(255,255,255,0.086)"),b=e.fromCssColorString("rgba(255,255,255,0.267)"),T=e.fromCssColorString("rgba(255,255,255,0)"),x=e.fromCssColorString("rgba(66,67,68,0.3)"),A=e.fromCssColorString("rgba(0,0,0,0.5)"),P=new e;return m.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();r(this)},m.prototype.isDestroyed=function(){return!1},m.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!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")}},m.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")))},m.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},i(_.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("touchcancel",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!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 t=this._subscriptions,i=0,n=t.length;i<n;i++)t[i].dispose();return r(this)},_.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var i=this._svgNode,r=200,n=132,o=e,a=t;0===e&&0===t?(o=r,a=n):0===e?(a=t,o=r*(t/n)):0===t&&(o=e,a=n*(e/r));var s=o/r,l=a/n;i.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",i.setAttribute("width",o),i.setAttribute("height",a),i.setAttribute("viewBox","0 0 "+o+" "+a),this._topG.setAttribute("transform","scale("+s+","+l+")"),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t}},_.prototype.applyThemeChanges=function(){var e=s(this._themeNormal),i=s(this._themeHover),r=s(this._themeSelect),n=s(this._themeDisabled),o=s(this._themeKnob),a=s(this._themePointer),u=s(this._themeSwoosh),c=s(this._themeSwooshHover),h=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(e,C)},{tagName:"stop",offset:"12%","stop-color":d(e,w)},{tagName:"stop",offset:"46%","stop-color":d(e,S)},{tagName:"stop",offset:"81%","stop-color":d(e,E)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(i,C)},{tagName:"stop",offset:"12%","stop-color":d(i,w)},{tagName:"stop",offset:"46%","stop-color":d(i,S)},{tagName:"stop",offset:"81%","stop-color":d(i,E)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(r,C)},{tagName:"stop",offset:"12%","stop-color":d(r,w)},{tagName:"stop",offset:"46%","stop-color":d(r,S)},{tagName:"stop",offset:"81%","stop-color":d(r,E)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(n,b)},{tagName:"stop",offset:"75%","stop-color":d(n,T)}]},{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":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_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":d(a,A)},{tagName:"stop",offset:"100%","stop-color":d(a,A)}]},{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":d(o,C)},{tagName:"stop",offset:"60%","stop-color":d(o,x)},{tagName:"stop",offset:"85%","stop-color":d(o,w)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":d(o,x)},{tagName:"stop",offset:"60%","stop-color":d(o,C)},{tagName:"stop",offset:"85%","stop-color":d(o,E)}]},{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"}]});t(this._defsElement)?this._svgNode.replaceChild(h,this._defsElement):this._svgNode.appendChild(h),this._defsElement=h},_}),define("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,i,r,n,o){"use strict";function a(t,r){function a(){var e,i={args:arguments,cancel:!1};return s.raiseEvent(i),i.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}r=e(r,!0);var s=new n,l=new n;return a.canExecute=r,o.track(a,["canExecute"]),i(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a}return a}),define("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,i,r,n){"use strict";function o(t,i){this._command=t,i=e(i,e.EMPTY_OBJECT),this.toggled=e(i.toggled,!1),this.tooltip=e(i.tooltip,""),n.track(this,["toggled","tooltip"])}return i(o.prototype,{command:{get:function(){return this._command}}}),o}),define("Widgets/Animation/AnimationViewModel",["../../Core/binarySearch","../../Core/ClockRange","../../Core/ClockStep","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/JulianDate","../../ThirdParty/knockout","../../ThirdParty/sprintf","../createCommand","../ToggleButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u,c){"use strict";function d(e,t){return e-t}function h(t,i){var r=e(i,t,d);return r<0?~r:r}function p(e,t){if(Math.abs(e)<=g)return e/g;var i,r,n=g,o=v,a=0;return e>0?(i=Math.log(t[t.length-1]),r=(i-a)/(o-n),Math.exp(a+r*(e-n))):(i=Math.log(-t[0]),r=(i-a)/(o-n),-Math.exp(a+r*(Math.abs(e)-n)))}function f(e,t,r){if(r.clockStep===i.SYSTEM_CLOCK)return g;if(Math.abs(e)<=1)return e*g;var n=t[t.length-1];e>n?e=n:e<-n&&(e=-n);var o,a,s=g,l=v,u=0;return e>0?(o=Math.log(n),a=(o-u)/(l-s),(Math.log(e)-u)/a+s):(o=Math.log(-t[0]),a=(o-u)/(l-s),-((Math.log(Math.abs(e))-u)/a+s))}function m(e){var r=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=m.defaultDateFormatter,this._timeFormatter=m.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(m.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return r._timeFormatter(r._clockViewModel.currentTime,r)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return r._dateFormatter(r._clockViewModel.currentTime,r)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=r._clockViewModel;if(e.clockStep===i.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,s.defineProperty(this,"shuttleRingAngle",{get:function(){return f(e.multiplier,r._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,v),-v);var t=r._allShuttleRingTicks,n=r._clockViewModel;if(n.clockStep=i.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===v)return void(n.multiplier=e>0?t[t.length-1]:t[0]);var o=p(e,t);if(r.snapToTicks)o=t[h(o,t)];else if(0!==o){var a=Math.abs(o);if(a>100){var s=a.toFixed(0).length-2,l=Math.pow(10,s);o=Math.round(o/l)*l|0}else a>g?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}n.multiplier=o}}),this._canAnimate=void 0,s.defineProperty(this,"_canAnimate",function(){var e=r._clockViewModel,i=e.clockRange;if(r.shuttleRingDragging||i===t.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(i===t.LOOP_STOP)l=a.greaterThan(o,s)||o.equals(s)&&n>0;else{var u=e.stopTime;l=a.greaterThan(o,s)&&a.lessThan(o,u)||o.equals(s)&&n>0||o.equals(u)&&n<0}return l||(e.shouldAnimate=!1),l}),this._isSystemTimeAvailable=void 0,s.defineProperty(this,"_isSystemTimeAvailable",function(){var e=r._clockViewModel,i=e.clockRange;if(i===t.UNBOUNDED)return!0;var n=e.systemTime;return a.greaterThanOrEquals(n,e.startTime)&&a.lessThanOrEquals(n,e.stopTime)}),this._isAnimating=void 0,s.defineProperty(this,"_isAnimating",function(){return r._clockViewModel.shouldAnimate&&(r._canAnimate||r.shuttleRingDragging)});var n=u(function(){var e=r._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:r._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!r._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=r._clockViewModel,t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(o,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=u(function(){var e=r._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(l,{toggled:s.computed(function(){return r._isAnimating&&e.multiplier>0&&e.clockStep!==i.SYSTEM_CLOCK}),tooltip:"Play Forward"});var d=u(function(){r._clockViewModel.clockStep=i.SYSTEM_CLOCK},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(d,{toggled:s.computed(function(){return e.clockStep===i.SYSTEM_CLOCK}),tooltip:s.computed(function(){return r._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=r._clockViewModel,t=r._allShuttleRingTicks,i=e.multiplier,n=h(i,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=r._clockViewModel,t=r._allShuttleRingTicks,i=e.multiplier,n=h(i,t)+1;n<t.length&&(e.multiplier=t[n])})}var _=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],g=15,v=105;return m.defaultDateFormatter=function(e,t){var i=a.toGregorianDate(e);return _[i.month-1]+" "+i.day+" "+i.year},m.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],m.defaultTimeFormatter=function(e,t){var i=a.toGregorianDate(e),r=Math.round(i.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?l("%02d:%02d:%02d.%03d",i.hour,i.minute,i.second,r):l("%02d:%02d:%02d UTC",i.hour,i.minute,i.second)},m.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},m.prototype.setShuttleRingTicks=function(e){var t,i,r,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,i=e.length;t<i;++t)r=e[t],n.hasOwnProperty(r)||(n[r]=!0,o.push(r));o.sort(d);var a=[];for(i=o.length,t=i-1;t>=0;--t)r=o[t],0!==r&&a.push(-r);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(m.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}}}),m._maxShuttleRingAngle=v,m._realtimeShuttleRingAngle=g,m}),define("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(i){i=e(i,e.EMPTY_OBJECT);var r=i.globe,l=e(i.imageryProviderViewModels,[]),u=e(i.terrainProviderViewModels,[]);this._globe=r,this.imageryProviderViewModels=l.slice(0),this.terrainProviderViewModels=u.slice(0),this.dropDownVisible=!1,a.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]),this.buttonTooltip=void 0,a.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,i=this.selectedTerrain,r=t(e)?e.name:void 0,n=t(i)?i.name:void 0;return t(r)&&t(n)?r+"\n"+n:t(r)?r:n}),this.buttonImageUrl=void 0,a.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;return t(e)?e.iconUrl:void 0}),this.selectedImagery=void 0;var c=a.observable();this._currentImageryProviders=[],a.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(e){if(c()===e)return void(this.dropDownVisible=!1);var i,r=this._currentImageryProviders,n=r.length,a=this._globe.imageryLayers;for(i=0;i<n;i++)for(var s=a.length,l=0;l<s;l++){var u=a.get(l);if(u.imageryProvider===r[i]){a.remove(u);break}}if(t(e)){var d=e.creationCommand();if(o(d)){var h=d.length;for(i=h-1;i>=0;i--)a.addImageryProvider(d[i],0);this._currentImageryProviders=d.slice(0)}else this._currentImageryProviders=[d],a.addImageryProvider(d,0)}c(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var d=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(e){if(d()===e)return void(this.dropDownVisible=!1);var i;t(e)&&(i=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(i instanceof n),this._globe.terrainProvider=i,d(e),this.dropDownVisible=!1}});var h=this;this._toggleDropDown=s(function(){h.dropDownVisible=!h.dropDownVisible}),this.selectedImagery=e(i.selectedImageryProviderViewModel,l[0]),this.selectedTerrain=e(i.selectedTerrainProviderViewModel,u[0])}return i(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),define("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=a(e);var i=new s(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 l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: buttonImageUrl }"),r.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-dropDown",u.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-sectionTitle",c.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),c.innerHTML="Imagery",u.appendChild(c);var d=document.createElement("div");d.className="cesium-baseLayerPicker-choices",d.setAttribute("data-bind","foreach: imageryProviderViewModels"),u.appendChild(d);var h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),d.appendChild(h);var p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);var f=document.createElement("div");f.className="cesium-baseLayerPicker-itemLabel",f.setAttribute("data-bind","text: name"),h.appendChild(f);var m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",u.appendChild(m);var _=document.createElement("div");_.className="cesium-baseLayerPicker-choices",_.setAttribute("data-bind","foreach: terrainProviderViewModels"),u.appendChild(_);var g=document.createElement("div");g.className="cesium-baseLayerPicker-item",g.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),_.appendChild(g);var v=document.createElement("img");v.className="cesium-baseLayerPicker-itemIcon",v.setAttribute("data-bind","attr: { src: iconUrl }"),v.setAttribute("draggable","false"),g.appendChild(v);var y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),g.appendChild(y),o.applyBindings(i,r),o.applyBindings(i,u),this._viewModel=i,this._container=e,this._element=r,this._dropPanel=u,this._closeDropDown=function(e){r.contains(e.target)||u.contains(e.target)||(i.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._element),o.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),i(this)},l}),define("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(t){var i=t.creationFunction;e(i.canExecute)||(i=n(i)),this._creationCommand=i,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,r.track(this,["name","tooltip","iconUrl"])}return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),define("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/createOpenStreetMapImageryProvider","../../Scene/createTileMapServiceImageryProvider","../../Scene/MapboxImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(){var l=[];return l.push(new s({name:"Bing Maps Aerial",iconUrl:e("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.AERIAL})}})),l.push(new s({name:"Bing Maps Aerial with Labels",iconUrl:e("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.AERIAL_WITH_LABELS})}})),l.push(new s({name:"Bing Maps Roads",iconUrl:e("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps\nhttp://www.bing.com/maps",creationFunction:function(){return new i({url:"https://dev.virtualearth.net",mapStyle:r.ROAD})}})),l.push(new s({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxSatellite.png"),creationFunction:function(){return new a({mapId:"mapbox.satellite"})}})),l.push(new s({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxTerrain.png"),creationFunction:function(){return new a({mapId:"mapbox.streets"})}})),l.push(new s({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxStreets.png"),creationFunction:function(){return new a({mapId:"mapbox.streets-basic"})}})),l.push(new s({name:"ESRI World Imagery",iconUrl:e("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",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI World Street Map",iconUrl:e("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",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI National Geographic",iconUrl:e("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",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),l.push(new s({name:"Open­Street­Map",iconUrl:e("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",creationFunction:function(){return n({url:"https://a.tile.openstreetmap.org/"})}})),l.push(new s({name:"Stamen Watercolor",iconUrl:e("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",creationFunction:function(){return n({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."})}})),l.push(new s({name:"Stamen Toner",iconUrl:e("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return n({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."})}})),l.push(new s({name:"The Black Marble",iconUrl:e("Widgets/Images/ImageryProviders/blackMarble.png"),tooltip:"The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.",creationFunction:function(){return o({url:"https://cesiumjs.org/blackmarble",flipXY:!0,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),l.push(new s({name:"Natural Earth II",iconUrl:e("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return o({url:e("Assets/Textures/NaturalEarthII")})}})),l}return l}),define("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/CesiumTerrainProvider","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,i,r){"use strict";function n(){var n=[];return n.push(new r({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new i}})),n.push(new r({name:"STK World Terrain meshes",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"High-resolution, mesh-based terrain for the entire globe. Free for use on the Internet. Closed-network options are available.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"https://assets.agi.com/stk-terrain/world",requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),define("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Rectangle","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(t){var i;if(e(t)){i="Command Statistics";var r=t.commandsInFrustums;for(var n in r)if(r.hasOwnProperty(n)){var o,a=parseInt(n,10);if(7===a)o="1, 2 and 3";else{for(var s=[],l=2;l>=0;l--){var u=Math.pow(2,l);a>=u&&(s.push(l+1),a-=u)}o=s.reverse().join(" and ")}i+="<br>    "+r[n]+" in frustum "+o}i+="<br>Total: "+t.totalCommands}return i}function p(e,t,i){var r=Math.min(i,t);return r=Math.max(r,e)}function f(t,i){function r(t){var i=f._scene.pick({x:t.position.x,y:t.position.y});e(i)&&(f.primitive=e(i.collection)?i.collection:i.primitive),f.pickPrimitiveActive=!1}function h(t){var i,r=g.ellipsoid,o=f._scene.camera.pickEllipsoid({x:t.position.x,y:t.position.y},r);if(e(o))for(var a=r.cartesianToCartographic(o),s=g._surface.tileProvider._tilesToRenderByTextureCount,l=0;!i&&l<s.length;++l){var u=s[l];if(e(u))for(var c=0;!i&&c<u.length;++c){var d=u[c];n.contains(d.rectangle,a)&&(i=d)}}f.tile=i,f.pickTileActive=!1}var f=this,m=t.canvas,_=new o(m);this._eventHandler=_,this._scene=t,this._canvas=m,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=i;var g=this._scene.globe;g.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="",this.generalSwitchText=c.pureComputed(function(){return f.generalVisible?"-":"+"}),this.primitivesSwitchText=c.pureComputed(function(){return f.primitivesVisible?"-":"+"}),this.terrainSwitchText=c.pureComputed(function(){return f.terrainVisible?"-":"+"}),c.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=d(function(){f.dropDownVisible=!f.dropDownVisible}),this._toggleGeneral=d(function(){f.generalVisible=!f.generalVisible}),this._togglePrimitives=d(function(){f.primitivesVisible=!f.primitivesVisible}),this._toggleTerrain=d(function(){f.terrainVisible=!f.terrainVisible}),this._frustumsSubscription=c.getObservable(this,"frustums").subscribe(function(e){f._scene.debugShowFrustums=e}),this._frustumPlanesSubscription=c.getObservable(this,"frustumPlanes").subscribe(function(e){f._scene.debugShowFrustumPlanes=e}),this._performanceSubscription=c.getObservable(this,"performance").subscribe(function(e){e?f._performanceDisplay=new l({container:f._performanceContainer}):f._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=d(function(){return f._primitive.debugShowBoundingVolume=f.primitiveBoundingSphere,!0}),this._primitiveBoundingSphereSubscription=c.getObservable(this,"primitiveBoundingSphere").subscribe(function(){f._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=d(function(){if(f.primitiveReferenceFrame){var t=f._primitive.modelMatrix;f._modelMatrixPrimitive=new s({modelMatrix:t}),f._scene.primitives.add(f._modelMatrixPrimitive)}else e(f._modelMatrixPrimitive)&&(f._scene.primitives.remove(f._modelMatrixPrimitive),f._modelMatrixPrimitive=void 0);return!0}),this._primitiveReferenceFrameSubscription=c.getObservable(this,"primitiveReferenceFrame").subscribe(function(){f._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=d(function(){return f.filterPrimitive?f._scene.debugCommandFilter=function(t){return!(!e(f._modelMatrixPrimitive)||t.owner!==f._modelMatrixPrimitive._primitive)||!!e(f._primitive)&&(t.owner===f._primitive||t.owner===f._primitive._billboardCollection||t.owner.primitive===f._primitive)}:f._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=c.getObservable(this,"filterPrimitive").subscribe(function(){f._doFilterPrimitive()}),this._wireframeSubscription=c.getObservable(this,"wireframe").subscribe(function(e){g._surface.tileProvider._debug.wireframe=e}),this._globeDepthSubscription=c.getObservable(this,"globeDepth").subscribe(function(e){f._scene.debugShowGlobeDepth=e}),this._pickDepthSubscription=c.getObservable(this,"pickDepth").subscribe(function(e){f._scene.debugShowPickDepth=e}),this._depthFrustumSubscription=c.getObservable(this,"depthFrustum").subscribe(function(e){f.scene.debugShowDepthFrustum=e}),this._incrementDepthFrustum=d(function(){var e=f.depthFrustum+1;return f.depthFrustum=p(1,f._numberOfFrustums,e),!0}),this._decrementDepthFrustum=d(function(){var e=f.depthFrustum-1;return f.depthFrustum=p(1,f._numberOfFrustums,e),!0}),this._suspendUpdatesSubscription=c.getObservable(this,"suspendUpdates").subscribe(function(e){g._surface._debug.suspendLodUpdate=e,e||(f.filterTile=!1)});var v;this._showTileCoordinates=d(function(){return f.tileCoordinates&&!e(v)?v=t.imageryLayers.addImageryProvider(new u({tilingScheme:t.terrainProvider.tilingScheme})):!f.tileCoordinates&&e(v)&&(t.imageryLayers.remove(v),v=void 0),!0}),this._tileCoordinatesSubscription=c.getObservable(this,"tileCoordinates").subscribe(function(){f._showTileCoordinates()}),this._tileBoundingSphereSubscription=c.getObservable(this,"tileBoundingSphere").subscribe(function(){f._showTileBoundingSphere()}),this._showTileBoundingSphere=d(function(){return f.tileBoundingSphere?g._surface.tileProvider._debug.boundingSphereTile=f._tile:g._surface.tileProvider._debug.boundingSphereTile=void 0,!0}),this._doFilterTile=d(function(){return f.filterTile?(f.suspendUpdates=!0,g._surface._tilesToRender=[],e(f._tile)&&g._surface._tilesToRender.push(f._tile)):f.suspendUpdates=!1,!0}),this._filterTileSubscription=c.getObservable(this,"filterTile").subscribe(function(){f.doFilterTile()}),this._pickPrimitive=d(function(){f.pickPrimitiveActive=!f.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=c.getObservable(this,"pickPrimitiveActive").subscribe(function(e){e?_.setInputAction(r,a.LEFT_CLICK):_.removeInputAction(a.LEFT_CLICK)}),this._pickTile=d(function(){f.pickTileActive=!f.pickTileActive}),this._pickTileActiveSubscription=c.getObservable(this,"pickTileActive").subscribe(function(e){e?_.setInputAction(h,a.LEFT_CLICK):_.removeInputAction(a.LEFT_CLICK)})}return t(f.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 d(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return d(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return d(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return d(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return d(function(){e.tile=e.tile.southeastChild})}},primitive:{set:function(t){var i=this._primitive;t!==i&&(this.hasPickedPrimitive=!0,e(i)&&(i.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,e(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=t,t.show=!1,setTimeout(function(){t.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())},get:function(){return this._primitive}},tile:{set:function(t){if(e(t)){this.hasPickedTile=!0;var i=this._tile;t!==i&&(this.tileText="L: "+t.level+" X: "+t.x+" Y: "+t.y,this.tileText+="<br>SW corner: "+t.rectangle.west+", "+t.rectangle.south,this.tileText+="<br>NE corner: "+t.rectangle.east+", "+t.rectangle.north,this.tileText+="<br>Min: "+t.data.minimumHeight+" Max: "+t.data.maximumHeight),this._tile=t,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0},get:function(){return this._tile}},update:{get:function(){var e=this;return function(){e.frustums&&(e.frustumStatisticText=h(e._scene.debugFrustumStatistics));var t=e._scene.numberOfFrustums;e._numberOfFrustums=t,e.depthFrustum=p(1,t,e.depthFrustum),e.depthFrustumText=e.depthFrustum+" of "+t,e.performance&&e._performanceDisplay.update(),e.primitiveReferenceFrame&&(e._modelMatrixPrimitive.modelMatrix=e._primitive.modelMatrix), -e.shaderCacheText="Cached shaders: "+e._scene.context.shaderCache.numberOfShaders}}}}),f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._eventHandler.destroy(),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(),i(this)},f}),define("Widgets/CesiumInspector/CesiumInspector",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./CesiumInspectorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=document.createElement("div"),r=new a(t,i);this._viewModel=r,this._container=e;var s=document.createElement("div");this._element=s;var l=document.createElement("div");l.textContent="Cesium Inspector",l.className="cesium-cesiumInspector-button",l.setAttribute("data-bind","click: toggleDropDown"),s.appendChild(l),s.className="cesium-cesiumInspector",s.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var u=document.createElement("div");this._panel=u,u.className="cesium-cesiumInspector-dropDown",s.appendChild(u);var c=document.createElement("div");c.className="cesium-cesiumInspector-sectionHeader";var d=document.createElement("span");d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: toggleGeneral, text: generalSwitchText"),c.appendChild(d),c.appendChild(document.createTextNode("General")),u.appendChild(c);var h=document.createElement("div");h.className="cesium-cesiumInspector-section",h.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : generalVisible, "cesium-cesiumInspector-hide" : !generalVisible}'),u.appendChild(h);var p=document.createElement("div");h.appendChild(p);var f=document.createElement("div");f.className="cesium-cesiumInspector-frustumStats",f.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText');var m=document.createElement("input");m.type="checkbox",m.setAttribute("data-bind","checked: frustums"),p.appendChild(m),p.appendChild(document.createTextNode("Show Frustums")),p.appendChild(f);var _=document.createElement("div");h.appendChild(_);var g=document.createElement("input");g.type="checkbox",g.setAttribute("data-bind","checked: frustumPlanes"),_.appendChild(g),_.appendChild(document.createTextNode("Show Frustum Planes"));var v=document.createElement("div");h.appendChild(v);var y=document.createElement("input");y.type="checkbox",y.setAttribute("data-bind","checked: performance"),v.appendChild(y),v.appendChild(document.createTextNode("Performance Display")),i.className="cesium-cesiumInspector-performanceDisplay",h.appendChild(i);var C=document.createElement("div");C.className="cesium-cesiumInspector-shaderCache",C.setAttribute("data-bind","html: shaderCacheText"),h.appendChild(C);var w=document.createElement("div");h.appendChild(w);var S=document.createElement("input");S.type="checkbox",S.setAttribute("data-bind","checked: globeDepth"),w.appendChild(S),w.appendChild(document.createTextNode("Show globe depth"));var E=document.createElement("div");w.appendChild(E);var b=document.createElement("div");h.appendChild(b);var T=document.createElement("input");T.type="checkbox",T.setAttribute("data-bind","checked: pickDepth"),b.appendChild(T),b.appendChild(document.createTextNode("Show pick depth"));var x=document.createElement("div");h.appendChild(x);var A=document.createElement("span");A.setAttribute("data-bind",'html: "     Frustum:"'),x.appendChild(A);var P=document.createElement("span");P.setAttribute("data-bind","text: depthFrustumText"),x.appendChild(P);var M=document.createElement("input");M.type="button",M.value="-",M.className="cesium-cesiumInspector-pickButton",M.setAttribute("data-bind","click: decrementDepthFrustum"),x.appendChild(M);var D=document.createElement("input");D.type="button",D.value="+",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: incrementDepthFrustum"),x.appendChild(D);var I=document.createElement("div");I.className="cesium-cesiumInspector-sectionHeader",d=document.createElement("span"),d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),I.appendChild(d),I.appendChild(document.createTextNode("Primitives")),u.appendChild(I);var R=document.createElement("div");R.className="cesium-cesiumInspector-section",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : primitivesVisible, "cesium-cesiumInspector-hide" : !primitivesVisible}'),u.appendChild(R);var O=document.createElement("div");O.className="cesium-cesiumInspector-pickSection",R.appendChild(O);var N=document.createElement("input");N.type="button",N.value="Pick a primitive",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var L=document.createElement("div");L.className="cesium-cesiumInspector-center",L.appendChild(N),O.appendChild(L);var B=document.createElement("div");O.appendChild(B);var F=document.createElement("input");F.type="checkbox",F.setAttribute("data-bind","checked: primitiveBoundingSphere, enable: hasPickedPrimitive"),B.appendChild(F),B.appendChild(document.createTextNode("Show bounding sphere"));var k=document.createElement("div");O.appendChild(k);var V=document.createElement("input");V.type="checkbox",V.setAttribute("data-bind","checked: primitiveReferenceFrame, enable: hasPickedPrimitive"),k.appendChild(V),k.appendChild(document.createTextNode("Show reference frame"));var z=document.createElement("div");this._primitiveOnly=z,O.appendChild(z);var U=document.createElement("input");U.type="checkbox",U.setAttribute("data-bind","checked: filterPrimitive, enable: hasPickedPrimitive"),z.appendChild(U),z.appendChild(document.createTextNode("Show only selected"));var G=document.createElement("div");G.className="cesium-cesiumInspector-sectionHeader",d=document.createElement("span"),d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),G.appendChild(d),G.appendChild(document.createTextNode("Terrain")),u.appendChild(G);var H=document.createElement("div");H.className="cesium-cesiumInspector-section",H.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'),u.appendChild(H);var W=document.createElement("div");W.className="cesium-cesiumInspector-pickSection",H.appendChild(W);var q=document.createElement("input");q.type="button",q.value="Pick a tile",q.className="cesium-cesiumInspector-pickButton",q.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),L=document.createElement("div"),L.appendChild(q),L.className="cesium-cesiumInspector-center",W.appendChild(L);var j=document.createElement("div");W.appendChild(j);var Y=document.createElement("input");Y.type="button",Y.value="Parent",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectParent");var X=document.createElement("input");X.type="button",X.value="NW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectNW");var Z=document.createElement("input");Z.type="button",Z.value="NE",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectNE");var K=document.createElement("input");K.type="button",K.value="SW",K.className="cesium-cesiumInspector-pickButton",K.setAttribute("data-bind","click: selectSW");var Q=document.createElement("input");Q.type="button",Q.value="SE",Q.className="cesium-cesiumInspector-pickButton",Q.setAttribute("data-bind","click: selectSE");var J=document.createElement("div");J.className="cesium-cesiumInspector-tileText",j.className="cesium-cesiumInspector-frustumStats",j.appendChild(J),j.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'),J.setAttribute("data-bind","html: tileText");var $=document.createElement("div");$.className="cesium-cesiumInspector-relativeText",$.textContent="Select relative:",j.appendChild($);var ee=document.createElement("table"),te=document.createElement("tr"),ie=document.createElement("tr"),re=document.createElement("td");re.appendChild(Y);var ne=document.createElement("td");ne.appendChild(X);var oe=document.createElement("td");oe.appendChild(Z),te.appendChild(re),te.appendChild(ne),te.appendChild(oe);var ae=document.createElement("td"),se=document.createElement("td");se.appendChild(K);var le=document.createElement("td");le.appendChild(Q),ie.appendChild(ae),ie.appendChild(se),ie.appendChild(le),ee.appendChild(te),ee.appendChild(ie),j.appendChild(ee);var ue=document.createElement("div");W.appendChild(ue);var ce=document.createElement("input");ce.type="checkbox",ce.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile"),ue.appendChild(ce),ue.appendChild(document.createTextNode("Show bounding volume"));var de=document.createElement("div");W.appendChild(de);var he=document.createElement("input");he.type="checkbox",he.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile"),de.appendChild(he),de.appendChild(document.createTextNode("Show only selected"));var pe=document.createElement("div");H.appendChild(pe);var fe=document.createElement("input");fe.type="checkbox",fe.setAttribute("data-bind","checked: wireframe"),pe.appendChild(fe),pe.appendChild(document.createTextNode("Wireframe"));var me=document.createElement("div");H.appendChild(me);var _e=document.createElement("input");_e.type="checkbox",_e.setAttribute("data-bind","checked: suspendUpdates"),me.appendChild(_e),me.appendChild(document.createTextNode("Suspend LOD update"));var ge=document.createElement("div");H.appendChild(ge);var ve=document.createElement("input");ve.type="checkbox",ve.setAttribute("data-bind","checked: tileCoordinates"),ge.appendChild(ve),ge.appendChild(document.createTextNode("Show tile coordinates")),n.applyBindings(r,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),i(this)},s}),define("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/Credit","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/FeatureDetection","../../Core/formatError","../../Core/requestAnimationFrame","../../Core/ScreenSpaceEventHandler","../../Scene/BingMapsImageryProvider","../../Scene/Globe","../../Scene/Moon","../../Scene/Scene","../../Scene/SceneMode","../../Scene/ShadowMode","../../Scene/SkyAtmosphere","../../Scene/SkyBox","../../Scene/Sun","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E){"use strict";function b(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function T(e){function t(r){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(o(n)){var a=1e3/n,s=r-i;s>a&&(e.resize(),e.render(),i=r-s%a),h(t)}else e.resize(),e.render(),h(t)}catch(t){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){var l="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(l,void 0,t)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0;var i=0;h(t)}function x(e){var t=e._canvas,i=t.clientWidth,r=t.clientHeight,o=e._resolutionScale;e._supportsImageRenderingPixelated||(o*=n(window.devicePixelRatio,1)),e._canvasWidth=i,e._canvasHeight=r,i*=o,r*=o,t.width=i,t.height=r,e._canRender=0!==i&&0!==r}function A(e){var t=e._canvas,i=t.width,r=t.height;if(0!==i&&0!==r){var n=e._scene.camera.frustum;o(n.aspectRatio)?n.aspectRatio=i/r:(n.top=n.right*(r/i),n.bottom=-n.top)}}function P(e,a){e=E(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s);var l=document.createElement("canvas"),d=c.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=d,d&&(l.style.imageRendering=c.imageRenderingValue()),l.oncontextmenu=function(){return!1},l.onselectstart=function(){return!1},s.appendChild(l);var h=document.createElement("div");h.className="cesium-widget-credits";var T=o(a.creditContainer)?E(a.creditContainer):s;T.appendChild(h);var P=n(a.showRenderLoopErrors,!0);this._element=s,this._container=e,this._canvas=l,this._canvasWidth=0,this._canvasHeight=0,this._creditContainer=h,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=P,this._resolutionScale=1,this._forceResize=!1,this._clock=o(a.clock)?a.clock:new i,x(this);try{var D=new g({canvas:l,contextOptions:a.contextOptions,creditContainer:h,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1),terrainExaggeration:a.terrainExaggeration,shadows:a.shadows,mapMode2D:a.mapMode2D});this._scene=D,D.camera.constrainedAxis=t.UNIT_Z,A(this);var I=n(D.mapProjection.ellipsoid,u.WGS84),R=D.frameState.creditDisplay,O=new r("Cesium",M,"http://cesiumjs.org/");R.addDefaultCredit(O);var N=a.globe;o(N)||(N=new m(I)),N!==!1&&(D.globe=N,D.globe.shadows=n(a.terrainShadows,y.RECEIVE_ONLY));var L=a.skyBox;o(L)||(L=new w({sources:{positiveX:b("px"),negativeX:b("mx"),positiveY:b("py"),negativeY:b("my"),positiveZ:b("pz"),negativeZ:b("mz")}})),L!==!1&&(D.skyBox=L,D.sun=new S,D.moon=new _);var B=a.skyAtmosphere;o(B)||(B=new C(I)),B!==!1&&(D.skyAtmosphere=B);var F=a.globe!==!1&&a.imageryProvider;o(F)||(F=new f({url:"https://dev.virtualearth.net"})),F!==!1&&D.imageryLayers.addImageryProvider(F),o(a.terrainProvider)&&a.globe!==!1&&(D.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new p(l,!1),o(a.sceneMode)&&(a.sceneMode===v.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===v.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=n(a.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=a.targetFrameRate;var k=this;D.renderError.addEventListener(function(e,t){if(k._useDefaultRenderLoop=!1,k._renderLoopRunning=!1,k._showRenderLoopErrors){var i="An error occurred while rendering. Rendering has stopped.";k.showErrorPanel(i,void 0,t)}})}catch(e){if(P){var V="Error constructing CesiumWidget.",z='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:';this.showErrorPanel(V,z,e)}throw e}}var M="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAeCAYAAAD5AOomAAAQWUlEQVR42u1beXxOxxpudrEktkbUkriI4lZpq5JbW6pJuFG0qrFeexVRak3TBm3RUgS1hFhrCdKgQWKLrUGQBiVBJMgiq0Qiuyxzn/fzTu74ZPnS9nfrj4zf8/ty5sw7M+c8824zx0svVa3oAfqAAWAIGAHGCoy43oDb6TGqywta9JgsIq4GUAswB+oDDRXU5/ragCm3N6gm+MUkVJ+1kAg1AyyA5oAN8BrQCXiTfzsArwLWgCVQF6jJBOtXk/tikWrMGkiEtgTeAOyBfsAQS0vL8YMHD/aws7ObiuthwAeAA/A20AZozAvCRNHe6vI3k2rCprUp8DoR1qVLF1c/P7+A5OTkhyUlJaKwuETkPSkRBUUlgkpmZmbW2bNnQyZOnLgA7Z2BzkALNtM1qsl9MTSVSLUCugADAwMDTxKZVI7cfCw8DiWK6fselMLtlwSxJyxDPM4vFsXFxSWRkZFRkBsOdAdaAw2qyf37ij77RDMm1a5evXojY2NjH5BW7ruaIab4xotPd8cJV/xO0cKkPXGae97n0kR6TpHIzs7O7d279xdsvoncemwJqn3u/1lbDTnqfYXN6JCUlJS03CfFwt0/4TkiK8IEEBydWiBIy21tbaejr24cWJlpBVT6ShpVFvS10iddZP6MbFkyqpw2Kor6K5P9M33onG1Iv0omsz3Q//79+7HpuUViDsys697KyZy89ynk9Wc/x4u7DwvE48ePs2mRcARtqUTLRjxmDa6rpYWanDqZKHmyzJ+lTFlyUrZGGbIm3GdF49VQcnMjZUwTJW83Ua4NtayQmlEYKW1NlOc11RrLoAxLpqdYUSmnPlOlbk1qa21OZ7ovX758E/lTz1MpOmvp5gvp4qeL6c8sAjLNOQXF4sKFC6Hotw+nSrR46rAfb8hkN+WxVTTlyPplNuNmDArGGgFNgGZloClbHQtua8bj1eW+GnObZspY2nL1WKaOkreraKDk7jXLsEJGXG+u1b4Bz/0VZayyUkO5f2DCc5DvyZL/1inb0ONVU5+1dSBMcHrIvRwNMbqQ6u6fKGSZ4POszFaQDZNc0q9fvzkcjFkzKf/gfJjSo3c40OrBoL+7cvvXeUFYM17l1MuOTbxEV8a/uE8pZ8Ww4bouPJ62bFlyzXmebRg2jLY8jxa8WGopxEiX9jLff1Vp357zfluefyeOPxpp9WHAGl2fn/k1do+Ef/K86lYWs+hzJ7SSbXv06OFGAfAMRLtlBUjkPyfuidMyw3Fi37UM8TMCLFVj6W9qW1BYIg4ePBjEWkukdCTyZsyYMcvX13f7iRMnDv36669B0OxTBKRNx4OCggIPHDiwa+XKld+j7Xv84v/l4+Oz6PLlywHnzp07Su0gdyw4OPgYXQNHzp8/f+TixYuHw8LCDuDeGiaLXqLj6tWrlyLC9ztz5gy1PwEcV3AU89i3detWT2NjYyeWedvLy2va77//7hcREeHfsWPH91HX6/r16/7h4eH+6H+ZVtQvN3ToujXm9wPJYS6+FhYWzggmh4eGhh6hsTHnE/j7eN++fQczWY1Yc6WrIVJb0SLEu9iJ93I0JCTkKMY+PHLkSGe2MLV5TL3ytgxr88pwuHLlyvXY9CcaH6mSR5HwwRuPRWZekTgXnfPcfW0QqfMDk0Qc+nqCnDc+Pj6FNzJoE+PfeDEXhQ6FtD0rKyu9Tp06LpAbBN9/S+hYEJmnck79EazQA5myVTKeyM/Pp7jgI2AAXv4JeW/AgAGzUTdKXj969CiOF04T1jhj/qXrzrgfQ+0KUdq1azdt6tSpntrjxcTEUGroyBrdkLmoy3x0HT9+vIe2zIoVK9y5fT0eU688/2rOJqY/bTRcjsl5hqRPYF5P38nSdJrwMErzezMpX1NfHrELjiQ9fbl56SIjO5leViH6nwwMnjZt2gL5EmWh/Lf4f+U5BtauXbsJshPu3LkTLQl/+PBhVmpqagZ+HxHS0tLSCShpGRkZqXhp12i8RYsWrVP7wr1ctM9E2wy0lch88uRJoWwTFRV1A7JjoVnBss7BwWEJ6ubIa/SRgOt32VybKduvZILtMbd4JraoZcuWC8eMGbNN+7noWTt06DCVXUIL9rtNOdj8uABFW+bbb7/9js34y4o5fo5YI14h7QwNDV1yc3MLAsIfP0PS9kvpmg6Db+wXn6/pKrwOztBcn7mTXWbEPHlPvMguKBFFxYXiq819hZu3k6Y9xpgFjN+xY8cBOcmkpKQ0rh8HDCUieHNjHExgmGwHQomkKbdu3bpP10VFRcU2NjZ7UbcKWATMB74C3IBpSn8jTp48eVb2k5iYSNq4BVjJcl8zFrq5ue3Py8vLB/Kg4USa6+nTp0OkLNwUmfYFckGiTRJZH1YKc3Zp5mye+yQnJydQOyyYImtr65XDhw/3lX2B7BJlgaSxhXiL+6K99z4wwadkG/RRLP/28PBYxpaiES+mcokllW4PczcUz1Twy++ZpSTRrhJtUCSnx4gvNzkL9419xBfevUVIxEHNIEuDUp4j90ZCHjSqUHj+/AnaOmnkmFgyIa6Y8Hk5SScnp6VMwLs82Tc5wOkJv9Tfz89v3f79+73xMPTyJyrEloCI8+PGjTs0adIkX1dXVx+Yuu2ff/75tlmzZm1A+xUDBw6kHHo4/GqQHA8Lt9DT0/OSu7v70SlTpuwdMmTIFhC2tlmzZivQ9geAtOFLgLRoGhbFJSnbrVu3DahbrEXs+4pZrMm/FGj1xaJNlMRaWVmtGTZs2D7ZV3R0dA6sWJG8Riayhd1GNzbNo0nTpWWbP3/+dYXY5fyOLCsjti5Hbh/hwfODbmeVkkS5rCgpFgt2DNaQKjHTy16kZsRpBpp1IKE0uNoSkqapO3llp2YBUFuPLf01Jgf9007UFAQCv8lJmpubf4Y6J478rNgMWfHL6cRBE+1e9SXTKInVpdy7d+8KmbOhQ4d+rasMLRjML5xMLlkSBFShCrEbiXxJLDQymQ8/2rN/lKkJXQ+AdUiSxDZv3nydSuzNmzczQWaEvIZbeESuhhf5mLt375Y+Z0BAQDQW7Dl5PXfu3KW6EGvIfoEisL6Ya+p1aBz5z/N3czQdbQ5w12ieSizhu13DEPHmajYiKDXyPJmiaX8t6pSYs8FB04bM8ObAL2ijIg/9zyCtU4lFBDqJA6p2nE/KPLMVmyRbToGcq0osAq0rrFEu8Eve5IfJhOsiCxN8FXJzjx07FqYQ6426JZJYaGQKu463eO4W/EvXLiqx0Ni1MMV+ig9PR5ut0PosWbd582bKHL50cXHZIOMMGqtJkybrQWZpEDdv3rwfdCHWgCM5yo3s/f39j9G8H2Y/tRKXbgUItw2Oz5EqSfMJWvT0dCefA5PsVPHNTx+VtpkFzb4Ve0ncuHHjLq/I0UhJSv1W27Zt57F/6cpp0Gv8awfz6Lxq1ar5P/7448KxY8eSH/5UNcUffPBBQKdOnTZ37tx5la2t7VI7O7vv33nnnYUwrR6Ojo7TEIm6sFkjckfxwvIAaMyvTE1NPRC4LEFQtAH9+yOVSFYiXvLFC48ePXpF1nXv3n09mWqF2Ie4/oTHeIM19Q2+/iQhISFVIXb1iBEj9irWhCL2pXPmzPlF9aOoW4+gL13W7d69+ywtMASApe1glhez2yqXWJnH1uDVRv5tpMY0PE4Qu4IWlkmoNlb6TRKRcaHiQoS/+Ir9sMTCnYM1q27NmjW+tIqJxMOHDwfISe7bty8YdZ8pZ7r9aZOEruE7F2lFqZ+pwRNI8WG/SGTNZuKm8gIawlrusGDBgi+wsEJ+Q8Fq38W+fg7LkHv4hoKwUaNGlWoFLEwuEatqrL29PQVq86TW5+Tk5LP8aDK9PN4AvnaXPhKBbSEW6bLRo0fvkH3FxsYmcaA3m6JzWR8ZGVlKKmUoHAhORFywSysqfqui4Enbz1JE5nz16tXwrNx0nUh9Gkw5QTPfFbPX93pWo6Hpp6740EqkVOc/lNzTZgM0cKVq9qAdmSlPS5IEHjaN8h7Z5iAKpUt48LsyTYCGPcBc7+L3DvLi2xEREYSbt2/fDkdwci0sLOwwRZfbt29frmhFIdpEgehIkqFfRN9RQAzmkSvbQdvIzLqdOnWqNN+GFaAoeircVYr68rHoohG138KYN+mXji1Rny1NKeKWXDMzM/cJEyZskHIPUMiX0ntp06aNm5riSYsA0+zLpn6Ql5fXRnl/8eLFX7NVsygv3VHNcU3ev+xC23800NlrvqUBUFVBckv3jNZMBNHnSvajr/OEHLDaM3X1lSCjoFGjRmRKhyGoiKziBgWZRWf0kSeqUGbOnOlJmod44Iys+/DDD8kiuMAULlMXXWUFUfkhIhB9LpZ1WBwxHBDSexmIBXFTlcHCeMQuqidh586dK+S91atXu3EkXp83KPQrOt0xZq2loMVh2bJlmmT6+OVt0MT3qkiqk1jsM0LkFWQL0iI2rx2UjXfyo73gPzZCu64iyIhHYJMMJU2RoJ0ikBiOiNBn0KBBY/gB7UNDQ3/B/QTcT1SRmpqaQEA/D3A/HtoXGxcXd07uy3bt2nUQSPKHJkbLthIsnwifGY/5/oZ0gnxwb5ojTPG6jIyMGCySBCz4gTJKnz59+szg4OBAjBEFkuIg+wxQojHXszD983hx9Zw8efI4EBZHgFYHsjnV7JdjfkMw50R+hnikauM4QKJspb23t/dkuAeaR9ySJUuG8Lusw9ZWr7KvEU15N4P2Lt9HZKjZdTkeuk3MRcpSVmT8DKEbe2vaePlPFyX4B8IoHfiYH6AJJ+/m7PRtuL47r9revJfch/92YDK78Hxas0xHDrTeU2R6c8rkWIZcK/5mqx1vondnWUeWUdGL++7EL9SG5Tooc2ihFbH3VPpzVOZgz4ugI6durVjLpNV6lRd5Y/5tx3Puxv3Kzf5G3KaFcpjQvCqfHKmH7Y15An3hqDeRWaZo1+fkIjFjXQ9NKiNNNJFJvpR87JLdI8X95HCNj6CjOtrJ4uituXLUZKwk8pbKCUpr5fSkNZNhxe6hIbeXR3bNFBlttOKX0Izb1mfZhtyXFcu20kFOfmZrwQteHtXJI8AmvKfbUulPLiRrTtvk8WFdPhyw4P4b8DupxZrXgOfXTHnmOvyu5P6x/NxX7nIZVuXA3Yg7asyrxoG+RER4HoMorzj/SY64ijw18OIm4Xd2uTh4fq04f+OASEy7pyGUvrqYPXv2CvYfb/JEzbUOlA342lR5MDNFo+UZam1+MBPlgNuU69X25mXI1lIO6qVsTUXWrAK5GloH49qH3Ophf21l/mZlzL2G1gG9aTkfEJgoHwDU1LpvqIxZ0eG8TuTKM8VWbCKcoYGj1q1btwehegJtPVIuSVEmnd8iQDhtbW3tamxs/CGbs7a8OOooDr68z1QMlQdUH0b7kxX1sxbDSmBQzqcoBpXIGJQjo/1ZSmVzqaivyvozqOB96f+Z78b0lLPFumwabFgDe3K+NpDz0kH8rXEvNrttWUvr6/DRuJ6O+CMyf0a2Ku+pqn390Xt/6QduBopPNFe2zFrJaI2dfmv2XZbsz2op5qL6v3m8oF8vqv9/R/oB+Q1RPf41U3yT0R+x/9Xlryn/BY268qsf3smdAAAAAElFTkSuQmCC";return a(P.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},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,e&&!this._renderLoopRunning&&T(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale=e,this._forceResize=!0}}}),P.prototype.showErrorPanel=function(e,t,i){function r(){u.style.maxHeight=Math.max(Math.round(.9*n.clientHeight-100),30)+"px"}var n=this._element,a=document.createElement("div");a.className="cesium-widget-errorPanel";var s=document.createElement("div");s.className="cesium-widget-errorPanel-content",a.appendChild(s);var l=document.createElement("div");l.className="cesium-widget-errorPanel-header",l.appendChild(document.createTextNode(e)),s.appendChild(l);var u=document.createElement("div");if(u.className="cesium-widget-errorPanel-scroll",s.appendChild(u),r(),o(window.addEventListener)&&window.addEventListener("resize",r,!1),o(t)){var c=document.createElement("div");c.className="cesium-widget-errorPanel-message",c.innerHTML="<p>"+t+"</p>",u.appendChild(c)}var h="(no error details available)";o(i)&&(h=d(i));var p=document.createElement("div");p.className="cesium-widget-errorPanel-message",p.appendChild(document.createTextNode(h)),u.appendChild(p);var f=document.createElement("div");f.className="cesium-widget-errorPanel-buttonPanel",s.appendChild(f);var m=document.createElement("button");m.setAttribute("type","button"),m.className="cesium-button",m.appendChild(document.createTextNode("OK")),m.onclick=function(){o(r)&&o(window.removeEventListener)&&window.removeEventListener("resize",r,!1),n.removeChild(a)},f.appendChild(m),n.appendChild(a),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+h)},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},P.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,i=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==i)&&(this._forceResize=!1,x(this),A(this))},P.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},P}),define("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,i,r,n,o,a){"use strict";function s(i){t(i)||(i=new e),this._clock=i,this._eventHelper=new n,this._eventHelper.add(i.onTick,this.synchronize,this),this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,this.startTime=a.observable(i.startTime),this.startTime.equalityComparer=o.equals,this.startTime.subscribe(function(e){i.startTime=e,this.synchronize()},this),this.stopTime=a.observable(i.stopTime),this.stopTime.equalityComparer=o.equals,this.stopTime.subscribe(function(e){i.stopTime=e,this.synchronize()},this),this.currentTime=a.observable(i.currentTime),this.currentTime.equalityComparer=o.equals,this.currentTime.subscribe(function(e){i.currentTime=e,this.synchronize()},this),this.multiplier=a.observable(i.multiplier),this.multiplier.subscribe(function(e){i.multiplier=e,this.synchronize()},this),this.clockStep=a.observable(i.clockStep),this.clockStep.subscribe(function(e){i.clockStep=e,this.synchronize()},this),this.clockRange=a.observable(i.clockRange),this.clockRange.subscribe(function(e){i.clockRange=e,this.synchronize()},this),this.canAnimate=a.observable(i.canAnimate),this.canAnimate.subscribe(function(e){i.canAnimate=e,this.synchronize()},this),this.shouldAnimate=a.observable(i.shouldAnimate),this.shouldAnimate.subscribe(function(e){i.shouldAnimate=e,this.synchronize()},this),a.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}return i(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock;this.systemTime=o.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},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},s}),define("Widgets/Command",["../Core/DeveloperError"],function(e){"use strict";function t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,e.throwInstantiationError()}return t}),define("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){var i=this,r=o.observable(n.fullscreen),l=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return r()}}),this.isFullscreenEnabled=void 0,o.defineProperty(this,"isFullscreenEnabled",{get:function(){return l()},set:function(e){l(e&&n.enabled)}}),this.tooltip=void 0,o.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?r()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(i._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(s(t),document.body),this._callback=function(){r(n.fullscreen)},document.addEventListener(n.changeEventName,this._callback)}return t(l.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){document.removeEventListener(n.changeEventName,this._callback),i(this)},l}),define("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(e);var i=new a(t);i._exitFullScreenPath=u,i._enterFullScreenPath=l;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),n.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}var l="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",u="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";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),define("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsGeocoderService","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/CartographicGeocoderService","../../Core/Matrix4","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s,l,u,c,d){"use strict";function h(r){i(r.geocoderServices)?this._geocoderServices=r.geocoderServices:this._geocoderServices=[new a,new e({scene:r.scene})],this._viewContainer=r.container,this._scene=r.scene,this._flightDuration=r.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new o,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._updateCamera=m,this._adjustSuggestionsScroll=v,this._updateSearchSuggestions=S,this._handleArrowDown=f,this._handleArrowUp=p;var n=this;this._suggestionsVisible=l.pureComputed(function(){var e=l.getObservable(n,"_suggestions"),t=e().length>0,i=l.getObservable(n,"_showSuggestions")();return t&&i}),this._searchCommand=c(function(){return n.hideSuggestions(),n._focusTextbox=!1,i(n._selectedSuggestion)?(n.activateSuggestion(n._selectedSuggestion),!1):void(n.isSearchInProgress?y(n):g(n,n._geocoderServices))}),this.deselectSuggestion=function(){n._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,o="Enter"===t.key||13===t.keyCode;return r?p(n):i?f(n):o&&n._searchCommand(),!0},this.activateSuggestion=function(e){n.hideSuggestions(),n._searchText=e.displayName;var t=e.destination;w(n),m(n,t)},this.hideSuggestions=function(){n._showSuggestions=!1,n._selectedSuggestion=void 0},this.showSuggestions=function(){n._showSuggestions=!0},this.handleMouseover=function(e,t){e!==n._selectedSuggestion&&(n._selectedSuggestion=e)},this.keepExpanded=!1,this.autoComplete=t(r.autocomplete,!0),this._focusTextbox=!1,l.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);var s=l.getObservable(this,"_searchText");s.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=s.subscribe(function(){S(n)}),this.isSearchInProgress=void 0,l.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,l.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,l.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function p(e){if(0!==e._suggestions.length){var t,i=e._suggestions.indexOf(e._selectedSuggestion);if(i===-1||0===i)return void(e._selectedSuggestion=void 0);t=i-1,e._selectedSuggestion=e._suggestions[t],v(e,t)}}function f(e){if(0!==e._suggestions.length){var t=e._suggestions.length,i=e._suggestions.indexOf(e._selectedSuggestion),r=(i+1)%t;e._selectedSuggestion=e._suggestions[r],v(e,r)}}function m(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:s.IDENTITY})}function _(e,t,r){return e.then(function(e){if(i(e)&&"fulfilled"===e.state&&e.value.length>0)return e;var n=t.geocode(r).then(function(e){return{state:"fulfilled",value:e}}).otherwise(function(e){return{state:"rejected",reason:e}});return n})}function g(e,t){var r=e._searchText;if(C(r))return void e.showSuggestions();e._isSearchInProgress=!0;for(var n=u.resolve(),o=0;o<t.length;o++)n=_(n,t[o],r);e._geocodePromise=n,n.then(function(t){if(!n.cancel){e._isSearchInProgress=!1;var o=t.value;return"fulfilled"===t.state&&i(o)&&o.length>0?(e._searchText=o[0].displayName,void m(e,o[0].destination)):void(e._searchText=r+" (not found)")}})}function v(e,t){var i=d(e._viewContainer),r=i.getElementsByClassName("search-results")[0],n=i.getElementsByTagName("li"),o=n[t];if(0===t)return void(r.scrollTop=0);var a=o.offsetTop;a+o.clientHeight>r.clientHeight?r.scrollTop=a+o.clientHeight:a<r.scrollTop&&(r.scrollTop=a)}function y(e){e._isSearchInProgress=!1,i(e._geocodePromise)&&(e._geocodePromise.cancel=!0,e._geocodePromise=void 0)}function C(e){return/^\s*$/.test(e)}function w(e){l.getObservable(e,"_suggestions").removeAll()}function S(e){if(e.autoComplete){var t=e._searchText;if(w(e),!C(t)){var i=u.resolve([]);e._geocoderServices.forEach(function(e){i=i.then(function(i){return i.length>=5?i:e.geocode(t).then(function(e){return i=i.concat(e)})})}),i.then(function(t){for(var i=e._suggestions,r=0;r<t.length;r++)i.push(t[r])})}}}return r(h.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}}}),h.prototype.destroy=function(){this._suggestionSubscription.dispose()},h}),define("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e){var t=a(e.container),i=new s(e);i._startSearchPath=u,i._stopSearchPath=c;var r=document.createElement("form");r.setAttribute("data-bind","submit: search");var l=document.createElement("input");l.type="search",l.className="cesium-geocoder-input",l.setAttribute("placeholder","Enter an address or landmark..."),l.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(){l.select()},0)},l.addEventListener("focus",this._onTextBoxFocus,!1),r.appendChild(l),this._textBox=l;var d=document.createElement("span");d.className="cesium-geocoder-searchButton",d.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),r.appendChild(d),t.appendChild(r);var h=document.createElement("div");h.className="search-results",h.setAttribute("data-bind","visible: _suggestionsVisible");var p=document.createElement("ul");p.setAttribute("data-bind","foreach: _suggestions");var f=document.createElement("li");p.appendChild(f),f.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),h.appendChild(p),t.appendChild(h),o.applyBindings(i,r),o.applyBindings(i,h),this._container=t,this._searchSuggestionsContainer=h,this._viewModel=i,this._form=r,this._onInputBegin=function(e){t.contains(e.target)||(i._focusTextbox=!1,i.hideSuggestions())},this._onInputEnd=function(e){t.contains(e.target)&&(i._focusTextbox=!0,i.showSuggestions())},n.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),document.addEventListener("pointerup",this._onInputEnd,!0),document.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0),document.addEventListener("touchcancel",this._onInputEnd,!0))}var u="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",c="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";return t(l.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),document.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),o.cleanNode(this._form),o.cleanNode(this._searchSuggestionsContainer),this._container.removeChild(this._form),this._container.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),i(this)},l}),define("Widgets/HomeButton/HomeButtonViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n){"use strict";function o(e,t){this._scene=e,this._duration=t;var i=this;this._command=n(function(){i._scene.camera.flyHome(i._duration)}),this.tooltip="View Home",r.track(this,["tooltip"])}return t(o.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}}}),o}),define("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(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 s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-home-button",s.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),define("Widgets/InfoBox/InfoBoxViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/Event","../../ThirdParty/knockout"],function(e,t,i,r){"use strict";function n(){this._cameraClicked=new i,this._closeClicked=new i,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",r.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,r.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?a:o}}),r.defineProperty(this,"_bodyless",{get:function(){return!e(this.description)||0===this.description.length}})}var o="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",a="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";return n.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},t(n.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),n}),define("Widgets/InfoBox/InfoBox",["../../Core/buildModuleUrl","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(r){r=s(r);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),r.appendChild(n);var o=document.createElement("div");o.className="cesium-infoBox-title",o.setAttribute("data-bind","text: titleText"),n.appendChild(o);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-infoBox-camera",c.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(c);var d=document.createElement("button");d.type="button",d.className="cesium-infoBox-close",d.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),d.innerHTML="×",n.appendChild(d);var h=document.createElement("iframe");h.className="cesium-infoBox-iframe",h.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),h.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),h.setAttribute("allowfullscreen",!0),n.appendChild(h);var p=new u;a.applyBindings(p,n),this._container=r,this._element=n,this._frame=h,this._viewModel=p,this._descriptionSubscription=void 0;var f=this;h.addEventListener("load",function(){var r=h.contentDocument,o=r.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=r.createElement("div");a.className="cesium-infoBox-description",r.head.appendChild(o),r.body.appendChild(a),f._descriptionSubscription=l(p,"description",function(e){h.style.height="5px",a.innerHTML=e;var r=null,o=a.firstElementChild;if(null!==o&&1===a.childNodes.length){var s=window.getComputedStyle(o);if(null!==s){var l=s["background-color"],u=t.fromCssColorString(l);i(u)&&0!==u.alpha&&(r=s["background-color"])}}n.style["background-color"]=r;var c=a.getBoundingClientRect().height;h.style.height=c+"px"})}),h.setAttribute("src","about:blank")}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){var e=this._container;return a.cleanNode(this._element),e.removeChild(this._element),i(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),n(this)},c}),define("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,i){"use strict";function r(){this.showInstructions=!1;var e=this;this._command=i(function(){e.showInstructions=!e.showInstructions}),this._showClick=i(function(){e._touch=!1}),this._showTouch=i(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions","_touch"])}return e(r.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),r}),define("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(i){var r=l(i.container),n=new u,o=t(i.instructionsInitiallyVisible,!1);n.showInstructions=o,n._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 c=document.createElement("span");c.className="cesium-navigationHelpButton-wrapper",r.appendChild(c);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",d.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),c.appendChild(d);var h=document.createElement("div");h.className="cesium-navigation-help",h.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),c.appendChild(h);var p=document.createElement("button");p.type="button",p.className="cesium-navigation-button cesium-navigation-button-left",p.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');var f=document.createElement("img");f.src=e("Widgets/Images/NavigationHelp/Mouse.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",p.appendChild(f),p.appendChild(document.createTextNode("Mouse"));var m=document.createElement("button");m.type="button",m.className="cesium-navigation-button cesium-navigation-button-right",m.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var _=document.createElement("img");_.src=e("Widgets/Images/NavigationHelp/Touch.svg"),_.className="cesium-navigation-button-icon",_.style.width="25px",_.style.height="25px",m.appendChild(_),m.appendChild(document.createTextNode("Touch")),h.appendChild(p),h.appendChild(m);var g=document.createElement("div");g.className="cesium-click-navigation-help cesium-navigation-help-instructions",g.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),g.innerHTML=' <table> <tr> <td><img src="'+e("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="'+e("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="'+e("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>',h.appendChild(g);var v=document.createElement("div");v.className="cesium-touch-navigation-help cesium-navigation-help-instructions",v.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),v.innerHTML=' <table> <tr> <td><img src="'+e("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="'+e("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="'+e("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="'+e("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>',h.appendChild(v),s.applyBindings(n,c),this._container=r,this._viewModel=n,this._wrapper=c,this._closeInstructions=function(e){c.contains(e.target)||(n.showInstructions=!1)},a.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}return r(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return a.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),s.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),n(this)},c}),define("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Scene/FrameRateMonitor","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s){"use strict";function l(t){this._scene=t.scene,this.lowFrameRateMessage=e(t.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,a.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var i=this;this._dismissMessage=s(function(){i.showingLowFrameRateMessage=!1,i.lowFrameRateMessageDismissed=!0});var r=o.fromScene(t.scene);this._unsubscribeLowFrameRate=r.lowFrameRate.addEventListener(function(){i.lowFrameRateMessageDismissed||(i.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=r.nominalFrameRate.addEventListener(function(){i.showingLowFrameRateMessage=!1})}return i(l.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),l.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),r(this)},l}),define("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./PerformanceWatchdogViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e){var t=o(e.container),i=new a(e),r=document.createElement("div");r.className="cesium-performance-watchdog-message-area",r.setAttribute("data-bind","visible: showingLowFrameRateMessage");var s=document.createElement("button");s.setAttribute("type","button"),s.className="cesium-performance-watchdog-message-dismiss",s.innerHTML="×",s.setAttribute("data-bind","click: dismissMessage"),r.appendChild(s);var l=document.createElement("div");l.className="cesium-performance-watchdog-message",l.setAttribute("data-bind","html: lowFrameRateMessage"),r.appendChild(l),t.appendChild(r),n.applyBindings(i,r),this._container=t,this._viewModel=i,this._element=r}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),define("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,i,r,n,o,a,s,l){"use strict";function u(t,i){this._scene=t;var r=this,n=function(e,t,i,n){r.sceneMode=i,r.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(t.morphStart,n),this._duration=e(i,2),this.sceneMode=t.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",s.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,s.defineProperty(this,"selectedTooltip",function(){var e=r.sceneMode;return e===a.SCENE2D?r.tooltip2D:e===a.SCENE3D?r.tooltip3D:r.tooltipColumbusView}),this._toggleDropDown=l(function(){r.dropDownVisible=!r.dropDownVisible}),this._morphTo2D=l(function(){t.morphTo2D(r._duration)}),this._morphTo3D=l(function(){t.morphTo3D(r._duration)}),this._morphToColumbusView=l(function(){t.morphToColumbusView(r._duration)}),this._sceneMode=a}return i(u.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}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),r(this)},u}),define("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t,i){e=a(e);var r=new s(t,i);r._globePath=u,r._flatMapPath=c,r._columbusViewPath=d;var l=document.createElement("span");l.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(l);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button",h.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'),h.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',l.appendChild(h);var p=document.createElement("button");p.type="button",p.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",p.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 }'),l.appendChild(p);var f=document.createElement("button");f.type="button",f.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",f.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 }'),l.appendChild(f);var m=document.createElement("button");m.type="button",m.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",m.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 }'),l.appendChild(m),o.applyBindings(r,l),this._viewModel=r,this._container=e,this._wrapper=l,this._closeDropDown=function(e){l.contains(e.target)||(r.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}var u="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",c="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",d="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"; -return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),i(this)},l}),define("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EasingFunction","../../Scene/SceneTransforms","../../ThirdParty/knockout"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,r,n){this._scene=e,this._screenPositionX=c,this._screenPositionY=c,this._tweens=e.tweens,this._container=t(n,document.body),this._selectionIndicatorElement=r,this._scale=1,this.position=void 0,this.showSelection=!1,s.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,s.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&i(this.position)}}),s.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,i){return a.wgs84ToWindowCoordinates(e,t,i)}}var u=new e,c="-1000px";return l.prototype.update=function(){if(this.showSelection&&i(this.position)){var e=this.computeScreenSpacePosition(this.position,u);if(i(e)){var t=this._container,r=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,-o),r+o)-a,e.y=Math.min(Math.max(e.y,-o),n+o)-a,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX=c,this._screenPositionY=c}},l.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},l.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},r(l.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),l}),define("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t){e=o(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",s="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",l=document.createElementNS(r,"svg:svg");l.setAttribute("width",160),l.setAttribute("height",160),l.setAttribute("viewBox","0 0 160 160");var u=document.createElementNS(r,"g");u.setAttribute("transform","translate(80,80)"),l.appendChild(u);var c=document.createElementNS(r,"path");c.setAttribute("data-bind","attr: { transform: _transform }"),c.setAttribute("d",s),u.appendChild(c),i.appendChild(l);var d=new a(t,this._element,this._container);this._viewModel=d,n.applyBindings(this._viewModel,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){var e=this._container;return n.cleanNode(this._element),e.removeChild(this._element),i(this)},s}),define("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function i(t,i,r){this._color=t,this._height=i,this._base=e(r,0)}return i.prototype.getHeight=function(){return this._height},i.prototype.getBase=function(){return this._base},i.prototype.getStartTime=function(){return this._start},i.prototype.getStopTime=function(){return this._stop},i.prototype.setRange=function(e,t){this._start=e,this._stop=t},i.prototype.render=function(e){var i="";if(this._start&&this._stop&&this._color){var r=t.secondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(r)),o=t.secondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(o))-n;n<0&&(a+=n,n=0),n+a>e.timeBarWidth&&(a=e.timeBarWidth-n),a>0&&(i='<span class="cesium-timeline-highlight" style="left: '+n.toString()+"px; width: "+a.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')}return i},i}),define("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,i){"use strict";function r(t,i,r,n){this.interval=t,this.height=i,this.color=r||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return r.prototype.render=function(e,r){var n=this.interval.start,o=this.interval.stop,a=r.startJulian,s=i.addSeconds(r.startJulian,r.duration,new i);if(i.lessThan(n,a)&&i.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height);else if(i.lessThanOrEquals(n,s)&&i.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;l<r.timeBarWidth;++l){var d=i.addSeconds(r.startJulian,l/r.timeBarWidth*r.duration,new i);!t(u)&&i.greaterThanOrEquals(d,n)?u=l:!t(c)&&i.greaterThanOrEquals(d,o)&&(c=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,r.y,r.timeBarWidth,this.height),t(u)&&(t(c)||(c=r.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(u,r.y,Math.max(c-u,1),this.height))}},r}),define("Widgets/Timeline/Timeline",["../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/JulianDate","../getElement","./TimelineHighlightRange","./TimelineTrack"],function(e,t,i,r,n,o,a,s){"use strict";function l(e,t){e=o(e),this.container=e;var i=document.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,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=v.none,this._touchMode=y.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=c(this),this._onMouseUp=d(this),this._onMouseMove=h(this),this._onMouseWheel=p(this),this._onTouchStart=f(this),this._onTouchMove=_(this),this._onTouchEnd=m(this);var r=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return e<10?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==v.touchOnly&&(0===t.button?(e._mouseMode=v.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,2===t.button?e._mouseMode=v.zoom:e._mouseMode=v.slide)),t.preventDefault()}}function d(e){return function(t){e._mouseMode=v.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function h(e){return function(t){var i;if(e._mouseMode===v.scrub){t.preventDefault();var r=t.clientX-e._topDiv.getBoundingClientRect().left;r<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):r>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(r,r*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===v.slide){if(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i){var o=i*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(n.addSeconds(e._startJulian,o,new n),n.addSeconds(e._endJulian,o,new n))}}else e._mouseMode===v.zoom&&(i=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==i&&e.zoomFrom(Math.pow(1.01,i)))}}function p(e){return function(t){var i=t.wheelDeltaY||t.wheelDelta||-t.detail;g=Math.max(Math.min(Math.abs(i),g),1),i/=g,e.zoomFrom(Math.pow(1.05,-i))}}function f(e){return function(t){var i,r,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=v.touchOnly,1===o?(i=n.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=y.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===o?"-16px 0":"0 0")):(e._touchMode=y.singleTap,e._touchState.centerX=t.touches[0].clientX-a)):2===o?(e._touchMode=y.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-a,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=y.ignore}}function m(e){return function(t){var i=t.touches.length,r=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap?(e._touchMode=y.scrub,e._onTouchMove(t)):e._touchMode===y.scrub&&e._onTouchMove(t),e._mouseMode=v.touchOnly,1!==i?e._touchMode=i>0?y.ignore:y.none:e._touchMode===y.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-r),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function _(e){return function(i){var r,o,a,s,l,u,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=v.touchOnly,e._touchMode===y.scrub?(i.preventDefault(),1===i.changedTouches.length&&(o=i.changedTouches[0].clientX-d,o>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===y.slideZoom&&(a=i.touches.length,2===a?(s=.5*(i.touches[0].clientX+i.touches[1].clientX)-d,l=Math.abs(i.touches[0].clientX-i.touches[1].clientX)):1===a&&(s=i.touches[0].clientX-d,l=0),t(s)&&(l>0&&e._touchState.spanX>0?(c=e._touchState.spanX/l,u=n.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-s*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new n)):(r=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,r*e._timeBarSecondsSpan/e._topDiv.clientWidth,new n)),e.zoomTo(u,n.addSeconds(u,e._timeBarSecondsSpan*c,new n)),e._touchState.centerX=s,e._touchState.spanX=l))}}var g=1e12,v={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},C=[.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],w=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,i){this._topDiv.addEventListener(e,t,i)},l.prototype.removeEventListener=function(e,t,i){this._topDiv.removeEventListener(e,t,i)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),e.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),i(this)},l.prototype.addHighlightRange=function(e,t,i){var r=new a(e,t,i);return this._highlightRanges.push(r),this.resize(),r},l.prototype.addTrack=function(e,t,i,r){var n=new s(e,t,i,r);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(t,i){if(this._startJulian=t,this._endJulian=i,this._timeBarSecondsSpan=n.secondsDifference(i,t),this._clock&&this._clock.clockRange!==e.UNBOUNDED){var r=this._clock.startTime,o=this._clock.stopTime,a=n.secondsDifference(o,r),s=n.secondsDifference(r,this._startJulian),l=n.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=a?(this._timeBarSecondsSpan=a,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=n.addSeconds(this._endJulian,s,new n),this._startJulian=r,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian)):l<0&&(this._startJulian=n.addSeconds(this._startJulian,l,new n),this._endJulian=o,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();var u=document.createEvent("Event");u.initEvent("setzoom",!0,!0),u.startJulian=this._startJulian,u.endJulian=this._endJulian,u.epochJulian=this._epochJulian,u.totalSpan=this._timeBarSecondsSpan,u.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(u)},l.prototype.zoomFrom=function(e){var t=n.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var i=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,i*e-i,new n))},l.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),i=t.millisecond,r=" UTC";if(i>0&&this._timeBarSecondsSpan<3600){for(r=Math.floor(i).toString();r.length<3;)r="0"+r;r="."+r}return w[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+r},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(E/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function i(e){return(e-E)/_}function r(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=n.secondsDifference(this._scrubJulian,this._startJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var d="",h=.01,p=31536e6,f=1e-10,m=0,_=this._timeBarSecondsSpan;_<h?(_=h,this._timeBarSecondsSpan=h,this._endJulian=n.addSeconds(this._startJulian,h,new n)):_>p&&(_=p,this._timeBarSecondsSpan=p,this._endJulian=n.addSeconds(this._startJulian,p,new n));var g=this._timeBarEle.clientWidth;g<10&&(g=10);var v,y=this._startJulian,w=Math.min(_/g*1e-5,.4),S=n.toGregorianDate(y);v=_>31536e4?n.fromDate(new Date(Date.UTC(100*Math.floor(S.year/100),0))):_>31536e3?n.fromDate(new Date(Date.UTC(10*Math.floor(S.year/10),0))):_>86400?n.fromDate(new Date(Date.UTC(S.year,0))):n.fromDate(new Date(Date.UTC(S.year,S.month,S.day)));var E=n.secondsDifference(this._startJulian,n.addSeconds(v,w,new n)),b=E+_;this._epochJulian=v,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-h,new n));var T=this._rulerEle.offsetWidth+20;T<30&&(T=180);var x=m;m-=f;var A={startTime:E,startJulian:y,epochJulian:v,duration:_,timeBarWidth:g,getAlpha:i};this._highlightRanges.forEach(function(e){d+=e.render(A)});var P=0,M=0,D=0,I=T/g;I>1&&(I=1),I*=this._timeBarSecondsSpan;var R,O=-1,N=-1,L=C.length;for(R=0;R<L;++R){var B=C[R];if(++O,P=B,B>I&&B>m)break;N<0&&g*(B/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=O)}if(O>0){for(;O>0;)if(--O,Math.abs(r(P,C[O]))<1e-5){C[O]>=m&&(M=C[O]);break}if(N>=0)for(;N<O;){if(Math.abs(r(M,C[N]))<1e-5&&C[N]>=m){D=C[N];break}++N}}m=x,m>f&&D<1e-5&&Math.abs(m-P)>f&&(D=m,m<=P+f&&(M=0));var F,k=-999999;if(g*(D/this._timeBarSecondsSpan)>=3)for(o=e(D);o<=b;o=t(o,D))d+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(M/this._timeBarSecondsSpan)>=3)for(o=e(M);o<=b;o=t(o,M))d+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(g*i(o)).toString()+'px;"></span>';if(g*(P/this._timeBarSecondsSpan)>=2){this._mainTicSpan=P,b+=P,o=e(P);for(var V=n.computeTaiMinusUtc(v);o<=b;){var z=n.addSeconds(y,o-E,new n);if(P>2.1){var U=n.computeTaiMinusUtc(z);Math.abs(U-V)>.1&&(o+=U-V,z=n.addSeconds(y,o-E,new n))}var G=Math.round(g*i(o)),H=this.makeLabel(z);this._rulerEle.innerHTML=H,F=this._rulerEle.offsetWidth,F<10&&(F=T);var W=G-(F/2-1);W>k?(k=W+F+5,d+='<span class="cesium-timeline-ticMain" style="left: '+G.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+W.toString()+'px;">'+H+"</span>"):d+='<span class="cesium-timeline-ticSub" style="left: '+G.toString()+'px;"></span>',o=t(o,P)}}else this._mainTicSpan=-1;d+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0 0;"></span>',a.innerHTML=d,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),A.y=0,this._trackList.forEach(function(e){e.render(c._context,A),A.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(t(this._scrubElement)){var i=n.secondsDifference(this._scrubJulian,this._startJulian),r=Math.round(i*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==r&&(this._lastXPos=r,e.style.left=r-8+"px",this._needleEle.style.left=r+"px")}t(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(n.addSeconds(this._startJulian,this._timelineDrag,new n),n.addSeconds(this._endJulian,this._timelineDrag,new n)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=n.addSeconds(this._startJulian,t,new n),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)},l.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}},l}),define("Widgets/VRButton/VRButtonViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../../ThirdParty/NoSleep","../createCommand","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(e){var i=!1,r=window.screen;return t(r)&&(t(r.lockOrientation)?i=r.lockOrientation(e):t(r.mozLockOrientation)?i=r.mozLockOrientation(e):t(r.msLockOrientation)?i=r.msLockOrientation(e):t(r.orientation&&r.orientation.lock)&&(i=r.orientation.lock(e))),i}function d(){var e=window.screen;t(e)&&(t(e.unlockOrientation)?e.unlockOrientation():t(e.mozUnlockOrientation)?e.mozUnlockOrientation():t(e.msUnlockOrientation)?e.msUnlockOrientation():t(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function h(e,t,i){i()?(t.useWebVR=!1,e._locked&&(d(),e._locked=!1),e._noSleep.disable(),o.exitFullscreen(),i(!1)):(o.fullscreen||o.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=c("landscape")),t.useWebVR=!0,i(!0))}function p(t,i){var r=this,n=a.observable(o.enabled),c=a.observable(!1);this.isVRMode=void 0,a.defineProperty(this,"isVRMode",{get:function(){return c()}}),this.isVREnabled=void 0,a.defineProperty(this,"isVREnabled",{get:function(){return n()},set:function(e){n(e&&o.enabled)}}),this.tooltip=void 0,a.defineProperty(this,"tooltip",function(){return n()?c()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"}),this._locked=!1,this._noSleep=new s,this._command=l(function(){h(r,t,c)},a.getObservable(this,"isVREnabled")),this._vrElement=e(u(i),document.body),this._callback=function(){!o.fullscreen&&c()&&(t.useWebVR=!1,r._locked&&(d(),r._locked=!1),r._noSleep.disable(),c(!1))},document.addEventListener(o.changeEventName,this._callback)}return i(p.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),p.prototype.isDestroyed=function(){return!1},p.prototype.destroy=function(){r(this)},p}),define("Widgets/VRButton/VRButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./VRButtonViewModel"],function(e,t,i,r,n,o,a){"use strict";function s(e,t,i){e=o(e);var r=new a(t,i);r._exitVRPath=u,r._enterVRPath=l;var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-vrButton",s.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }"),e.appendChild(s),n.applyBindings(r,s),this._container=e,this._viewModel=r,this._element=s}var l="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",u="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";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),i(this)},s}),define("Widgets/Viewer/Viewer",["../../Core/BoundingSphere","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Event","../../Core/EventHelper","../../Core/isArray","../../Core/Matrix4","../../Core/Rectangle","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../Scene/ImageryLayer","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultImageryProviderViewModels","../BaseLayerPicker/createDefaultTerrainProviderViewModels","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../HomeButton/HomeButton","../InfoBox/InfoBox","../NavigationHelpButton/NavigationHelpButton","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline","../VRButton/VRButton"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,M,D,I,R,O,N,L,B,F,k,V,z,U){"use strict";function G(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function H(e,t){var n=e.scene.pick(t.position);if(r(n)){var o=i(n.id,n.primitive.id);if(o instanceof g)return o}if(r(e.scene.globe))return q(e,t.position)}function W(e,t,i){if(r(i)){var n=i.clock;r(n)&&(n.getValue(t),r(e)&&(e.updateFromClock(),e.zoomTo(n.startTime,n.stopTime)))}}function q(e,t){var i=e.scene,n=i.camera.getPickRay(t),o=i.imageryLayers.pickImageryLayerFeatures(n,i);if(r(o)){var a=new g({id:"Loading...",description:"Loading feature information..."});return E(o,function(t){if(e.selectedEntity===a){if(!r(t)||0===t.length)return void(e.selectedEntity=j());var i=t[0],n=new g({id:i.name,description:i.description});if(r(i.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(i.position,te);n.position=new f(o)}e.selectedEntity=n}},function(){e.selectedEntity===a&&(e.selectedEntity=j())}),a}}function j(){return new g({id:"None",description:"No features found."})}function Y(e,t){var i=e._geocoder,n=e._homeButton,o=e._sceneModePicker,a=e._baseLayerPicker,s=e._animation,l=e._timeline,u=e._fullscreenButton,c=e._infoBox,d=e._selectionIndicator,h=t?"hidden":"visible";if(r(i)&&(i.container.style.visibility=h),r(n)&&(n.container.style.visibility=h),r(o)&&(o.container.style.visibility=h),r(a)&&(a.container.style.visibility=h),r(s)&&(s.container.style.visibility=h),r(l)&&(l.container.style.visibility=h),r(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=h),r(c)&&(c.container.style.visibility=h),r(d)&&(d.container.style.visibility=h),e._container){var p=t||!r(u)?0:u.container.clientWidth;e._vrButton.container.style.right=p+"px",e.forceResize()}}function X(e,t){function n(e){var t=H(c,e);r(t)&&(y.getValueOrUndefined(t.position,c.clock.currentTime)?c.trackedEntity=t:c.zoomTo(t))}function o(e){c.selectedEntity=H(c,e)}e=O(e),t=i(t,i.EMPTY_OBJECT);var a=!(r(t.globe)&&t.globe===!1||r(t.baseLayerPicker)&&t.baseLayerPicker===!1),c=this,d=document.createElement("div");d.className="cesium-viewer",e.appendChild(d);var p=document.createElement("div");p.className="cesium-viewer-cesiumWidgetContainer",d.appendChild(p);var f=document.createElement("div");f.className="cesium-viewer-bottom",d.appendChild(f);var g=i(t.scene3DOnly,!1),v=new M(p,{terrainProvider:t.terrainProvider,imageryProvider:!a&&t.imageryProvider,clock:t.clock,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,creditContainer:r(t.creditContainer)?t.creditContainer:f,scene3DOnly:g,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D}),C=t.dataSources,w=!1;r(C)||(C=new m,w=!0);var E=new _({scene:v.scene,dataSourceCollection:C}),W=v.clock,q=new D(W),j=new l;j.add(W.onTick,X.prototype._onTick,this),j.add(v.scene.morphStart,X.prototype._clearTrackedObject,this);var Z;if(!r(t.selectionIndicator)||t.selectionIndicator!==!1){var K=document.createElement("div");K.className="cesium-viewer-selectionIndicatorContainer",d.appendChild(K),Z=new k(K,v.scene)}var Q;if(!r(t.infoBox)||t.infoBox!==!1){var J=document.createElement("div");J.className="cesium-viewer-infoBoxContainer",d.appendChild(J),Q=new L(J);var $=Q.viewModel;j.add($.cameraClicked,X.prototype._onInfoBoxCameraClicked,this),j.add($.closeClicked,X.prototype._onInfoBoxClockClicked,this)}var ee=document.createElement("div");ee.className="cesium-viewer-toolbar",d.appendChild(ee);var te;if(!r(t.geocoder)||t.geocoder!==!1){var ie=document.createElement("div");ie.className="cesium-viewer-geocoderContainer",ee.appendChild(ie),te=new R({container:ie,geocoderServices:r(t.geocoder)?u(t.geocoder)?t.geocoder:[t.geocoder]:void 0,scene:v.scene}),j.add(te.viewModel.search.beforeExecute,X.prototype._clearObjects,this)}var re;r(t.homeButton)&&t.homeButton===!1||(re=new N(ee,v.scene),r(te)&&j.add(re.viewModel.command.afterExecute,function(){var e=te.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),j.add(re.viewModel.command.beforeExecute,X.prototype._clearTrackedObject,this));var ne;g||r(t.sceneModePicker)&&t.sceneModePicker===!1||(ne=new F(ee,v.scene));var oe,ae;if(a){var se=i(t.imageryProviderViewModels,A()),le=i(t.terrainProviderViewModels,P());oe=new x(ee,{globe:v.scene.globe,imageryProviderViewModels:se,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:le,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});var ue=ee.getElementsByClassName("cesium-baseLayerPicker-dropDown");ae=ue[0]}var ce;if(!r(t.navigationHelpButton)||t.navigationHelpButton!==!1){var de=!0;try{if(r(window.localStorage)){var he=window.localStorage.getItem("cesium-hasSeenNavHelp");r(he)&&Boolean(he)?de=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(e){}ce=new B({ -container:ee,instructionsInitiallyVisible:i(t.navigationInstructionsInitiallyVisible,de)})}var pe;if(!r(t.animation)||t.animation!==!1){var fe=document.createElement("div");fe.className="cesium-viewer-animationContainer",d.appendChild(fe),pe=new b(fe,new T(q))}var me;if(!r(t.timeline)||t.timeline!==!1){var _e=document.createElement("div");_e.className="cesium-viewer-timelineContainer",d.appendChild(_e),me=new z(_e,W),me.addEventListener("settime",G,!1),me.zoomTo(W.startTime,W.stopTime)}var ge,ve;if(!r(t.fullscreenButton)||t.fullscreenButton!==!1){var ye=document.createElement("div");ye.className="cesium-viewer-fullscreenContainer",d.appendChild(ye),ge=new I(ye,t.fullscreenElement),ve=V(ge.viewModel,"isFullscreenEnabled",function(e){ye.style.display=e?"block":"none",r(me)&&(me.container.style.right=ye.clientWidth+"px",me.resize())})}var Ce,we,Se;if(t.vrButton){var Ee=document.createElement("div");Ee.className="cesium-viewer-vrContainer",d.appendChild(Ee),Ce=new U(Ee,v.scene,t.fullScreenElement),we=V(Ce.viewModel,"isVREnabled",function(e){Ee.style.display=e?"block":"none",r(ge)&&(Ee.style.right=ye.clientWidth+"px"),r(me)&&(me.container.style.right=Ee.clientWidth+"px",me.resize())}),Se=V(Ce.viewModel,"isVRMode",function(e){Y(c,e)})}this._baseLayerPickerDropDown=ae,this._fullscreenSubscription=ve,this._vrSubscription=we,this._vrModeSubscription=Se,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=i(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=f,this._element=d,this._cesiumWidget=v,this._selectionIndicator=Z,this._infoBox=Q,this._dataSourceCollection=C,this._destroyDataSourceCollection=w,this._dataSourceDisplay=E,this._clockViewModel=q,this._toolbar=ee,this._homeButton=re,this._sceneModePicker=ne,this._baseLayerPicker=oe,this._navigationHelpButton=ce,this._animation=pe,this._timeline=me,this._fullscreenButton=ge,this._vrButton=Ce,this._geocoder=te,this._eventHelper=j,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=r(Q)||r(Z),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._forceResize=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new s,S.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),j.add(C.dataSourceAdded,X.prototype._onDataSourceAdded,this),j.add(C.dataSourceRemoved,X.prototype._onDataSourceRemoved,this),j.add(v.scene.preRender,X.prototype.resize,this),j.add(v.scene.postRender,X.prototype._postRender,this);for(var be=C.length,Te=0;Te<be;Te++)this._dataSourceAdded(C,C.get(Te));this._dataSourceAdded(void 0,E.defaultDataSource),j.add(C.dataSourceAdded,X.prototype._dataSourceAdded,this),j.add(C.dataSourceRemoved,X.prototype._dataSourceRemoved,this),v.screenSpaceEventHandler.setInputAction(o,h.LEFT_CLICK),v.screenSpaceEventHandler.setInputAction(n,h.LEFT_DOUBLE_CLICK)}function Z(e,t,n,o){Q(e);var a=E.defer();return e._zoomPromise=a,e._zoomIsFlight=o,e._zoomOptions=n,E(t,function(t){if(e._zoomPromise===a){if(t instanceof C)return void t.getViewableRectangle().then(function(t){e._zoomPromise===a&&(e._zoomTarget=t)});if(t.isLoading&&r(t.loadingEvent))var n=t.loadingEvent.addEventListener(function(){n(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else{if(u(t))return void(e._zoomTarget=t.slice(0));t=i(t.values,t),r(t.entities)&&(t=t.entities.values),u(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}}}),a.promise}function K(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function Q(e){var t=e._zoomPromise;r(t)&&(K(e),t.resolve(!1))}function J(t){var n=t._zoomTarget;if(r(n)&&t.scene.mode!==w.MORPHING){var o=t.scene,a=o.camera,s=t._zoomPromise,l=i(t._zoomOptions,{});if(n instanceof d){var u={destination:n,duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)}};return t._zoomIsFlight?a.flyTo(u):(a.setView(u),s.resolve(!0)),void K(t)}for(var h=[],f=0,m=n.length;f<m;f++){var _=t._dataSourceDisplay.getBoundingSphere(n[f],!1,ee);if(_===p.PENDING)return;_!==p.FAILED&&h.push(e.clone(ee))}if(0===h.length)return void Q(t);t.trackedEntity=void 0;var g=e.fromBoundingSpheres(h),v=o.screenSpaceCameraController;v.minimumZoomDistance=Math.min(v.minimumZoomDistance,.5*g.radius),t._zoomIsFlight?(K(t),a.flyToBoundingSphere(g,{duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)},offset:l.offset})):(a.viewBoundingSphere(g,t._zoomOptions),a.lookAtTransform(c.IDENTITY),K(t),s.resolve(!0))}}function $(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,i=e.clock.currentTime,n=y.getValueOrUndefined(t.position,i);if(r(n)){var o=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,ee);if(a!==p.PENDING){var s=o.mode;s!==w.COLUMBUS_VIEW&&s!==w.SCENE2D||(o.screenSpaceCameraController.enableTranslate=!1),s!==w.COLUMBUS_VIEW&&s!==w.SCENE3D||(o.screenSpaceCameraController.enableTilt=!1);var l=a!==p.FAILED?ee:void 0;e._entityView=new v(t,o,o.mapProjection.ellipsoid),e._entityView.update(i,l),e._needTrackedEntityUpdate=!1}}}}var ee=new e,te=new t;return n(X.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}},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}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},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}},clock:{get:function(){return this._cesiumWidget.clock}},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,this._forceResize=!0}},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,Q(this);var t=this.scene,i=t.mode;if(!r(e)||!r(e.position))return this._needTrackedEntityUpdate=!1,i!==w.COLUMBUS_VIEW&&i!==w.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),i!==w.COLUMBUS_VIEW&&i!==w.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,void this.camera.lookAtTransform(c.IDENTITY);this._needTrackedEntityUpdate=!0}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(e)?r(t)&&t.animateAppear():r(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,W(this._timeline,this.clock,e))}}}),X.prototype.extend=function(e,t){e(this,t)},X.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,i=t.clientWidth,n=t.clientHeight,o=r(this._animation),a=r(this._timeline);if(this._forceResize||i!==this._lastWidth||n!==this._lastHeight){e.resize(),this._forceResize=!1;var s=n-125,l=this._baseLayerPickerDropDown;if(r(l)&&(l.style.maxHeight=s+"px"),r(this._geocoder)){var u=this._geocoder.searchSuggestionsContainer;u.style.maxHeight=s+"px"}r(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);var c,d=this._timeline,h=0,p=0,f=0;if(o&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var m=this._lastWidth;c=this._animation.container,i>900?(h=169,m<=900&&(c.style.width="169px",c.style.height="112px",this._animation.resize())):i>=600?(h=136,(m<600||m>900)&&(c.style.width="136px",c.style.height="90px",this._animation.resize())):(h=106,(m>600||0===m)&&(c.style.width="106px",c.style.height="70px",this._animation.resize())),p=h+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var _=this._fullscreenButton,g=this._vrButton,v=d.container,y=v.style;f=v.clientHeight+3,y.left=h+"px";var C=0;r(_)&&(C+=_.container.clientWidth),r(g)&&(C+=g.container.clientWidth),y.right=C+"px",d.resize()}this._bottomContainer.style.left=p+"px",this._bottomContainer.style.bottom=f+"px",this._lastWidth=i,this._lastHeight=n}},X.prototype.forceResize=function(){this._lastWidth=0,this.resize()},X.prototype.render=function(){this._cesiumWidget.render()},X.prototype.isDestroyed=function(){return!1},X.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(h.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(h.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(),r(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),r(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),r(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),r(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),r(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),r(this._timeline)&&(this._timeline.removeEventListener("settime",G,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),r(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),r(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),r(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),r(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._clockViewModel=this._clockViewModel.destroy(),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),o(this)},X.prototype._dataSourceAdded=function(e,t){var i=t.entities;i.collectionChanged.addEventListener(X.prototype._onEntityCollectionChanged,this)},X.prototype._dataSourceRemoved=function(e,t){var i=t.entities;i.collectionChanged.removeEventListener(X.prototype._onEntityCollectionChanged,this),r(this.trackedEntity)&&i.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),r(this.selectedEntity)&&i.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},X.prototype._onTick=function(e){var n=e.currentTime,o=this._dataSourceDisplay.update(n);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=o);var a=this._entityView;if(r(a)){var s=this._trackedEntity,l=this._dataSourceDisplay.getBoundingSphere(s,!1,ee);l===p.DONE&&a.update(n,ee)}var u,c=!1,d=this.selectedEntity,h=r(d)&&this._enableInfoOrSelection;if(h&&d.isShowing&&d.isAvailable(n)){var f=this._dataSourceDisplay.getBoundingSphere(d,!0,ee);f!==p.FAILED?u=ee.center:r(d.position)&&(u=d.position.getValue(n,u)),c=r(u)}var m=r(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;r(m)&&(m.position=t.clone(u,m.position),m.showSelection=h&&c,m.update());var _=r(this._infoBox)?this._infoBox.viewModel:void 0;r(_)&&(_.showInfo=h,_.enableCamera=c,_.isCameraTracking=this.trackedEntity===this.selectedEntity,h?(_.titleText=i(d.name,d.id),_.description=y.getValueOrDefault(d.description,n,"")):(_.titleText="",_.description=""))},X.prototype._onEntityCollectionChanged=function(e,t,i){for(var r=i.length,n=0;n<r;n++){var o=i[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},X.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,i=t.position;r(i)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}},X.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},X.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},X.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},X.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&W(this.timeline,this.clock,e)},X.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var i=t.entities.id,r=this._eventHelper.add(t.changedEvent,X.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[i]=r},X.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&&n>0?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},X.prototype.zoomTo=function(e,t){return Z(this,e,t,!1)},X.prototype.flyTo=function(e,t){return Z(this,e,t,!0)},X.prototype._postRender=function(){J(this),$(this)},X}),define("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,i,r){"use strict";function n(e){var i=document.createElement("div");i.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(i);var n=new r(i,e.scene);t(e,{cesiumInspector:{get:function(){return n}}}),e.scene.postRender.addEventListener(function(){e.cesiumInspector.viewModel.update()})}return n}),define("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/wrapFunction","../../DataSources/CzmlDataSource","../../DataSources/GeoJsonDataSource","../../DataSources/KmlDataSource","../getElement"],function(e,t,i,r,n,o,a,s,l,u){"use strict";function c(t,r){function a(e){d(e),_&&(t.entities.removeAll(),t.dataSources.removeAll());for(var i=e.dataTransfer.files,r=i.length,n=0;n<r;n++){var o=i[n],a=new FileReader;a.onload=f(t,o,y,v),a.onerror=m(t,o),a.readAsText(o)}}r=e(r,e.EMPTY_OBJECT);var s=!0,l=e(r.flyToOnDrop,!0),c=new n,_=e(r.clearOnDrop,!0),g=e(r.dropTarget,t.container),v=e(r.clampToGround,!0),y=r.proxy;g=u(g),i(t,{dropTarget:{get:function(){return g},set:function(e){h(g,a),g=e,p(g,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?p(g,a):h(g,a),s=e)}},dropError:{get:function(){return c}},clearOnDrop:{get:function(){return _},set:function(e){_=e}},flyToOnDrop:{get:function(){return l},set:function(e){l=e}},proxy:{get:function(){return y},set:function(e){y=e}},clampToGround:{get:function(){return v},set:function(e){v=e}}}),p(g,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a}function d(e){e.stopPropagation(),e.preventDefault()}function h(e,i){var r=e;t(r)&&(r.removeEventListener("drop",i,!1),r.removeEventListener("dragenter",d,!1),r.removeEventListener("dragover",d,!1),r.removeEventListener("dragexit",d,!1))}function p(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",d,!1),e.addEventListener("dragover",d,!1),e.addEventListener("dragexit",d,!1)}function f(e,i,r,n){var o=e.scene;return function(u){var c=i.name;try{var d;if(/\.czml$/i.test(c))d=a.load(JSON.parse(u.target.result),{sourceUri:c});else if(/\.geojson$/i.test(c)||/\.json$/i.test(c)||/\.topojson$/i.test(c))d=s.load(JSON.parse(u.target.result),{sourceUri:c,clampToGround:n});else{if(!/\.(kml|kmz)$/i.test(c))return void e.dropError.raiseEvent(e,c,"Unrecognized file: "+c);d=l.load(i,{sourceUri:c,proxy:r,camera:o.camera,canvas:o.canvas})}t(d)&&e.dataSources.add(d).then(function(t){e.flyToOnDrop&&e.flyTo(t)}).otherwise(function(t){e.dropError.raiseEvent(e,c,t)})}catch(t){e.dropError.raiseEvent(e,c,t)}}}function m(e,t){return function(i){e.dropError.raiseEvent(e,t.name,i.target.error)}}return c}),define("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,i,r,n){"use strict";function o(t,r){r=e(r,e.EMPTY_OBJECT);var o=new n({scene:t.scene,container:t.bottomContainer,lowFrameRateMessage:r.lowFrameRateMessage});i(t,{performanceWatchdog:{get:function(){return o}}})}return o}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,i){"use strict";function r(r){var n,o=[],a={id:void 0,result:void 0,error:void 0};return function(s){var l=s.data;o.length=0,a.id=l.id,a.error=void 0,a.result=void 0;try{a.result=r(l.parameters,o)}catch(e){e instanceof Error?a.error={name:e.name,message:e.message,stack:e.stack}:a.error=e}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(e){a.result=void 0,a.error="postMessage failed with error: "+i(e)+"\n with responseMessage: "+JSON.stringify(a),n(a)}}}return r}),define("Cesium",["./Core/appendForwardSlash","./Core/ArcGisImageServerTerrainProvider","./Core/arrayRemoveDuplicates","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/barycentricCoordinates","./Core/binarySearch","./Core/BingMapsApi","./Core/BingMapsGeocoderService","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CartographicGeocoderService","./Core/CatmullRomSpline","./Core/CesiumTerrainProvider","./Core/Check","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/clone","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/combine","./Core/ComponentDatatype","./Core/CompressedTextureBuffer","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/createGuid","./Core/Credit","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/DefaultProxy","./Core/defaultValue","./Core/defined","./Core/defineProperties","./Core/deprecationWarning","./Core/destroyObject","./Core/DeveloperError","./Core/DistanceDisplayCondition","./Core/DistanceDisplayConditionGeometryInstanceAttribute","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EasingFunction","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidalOccluder","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidTerrainProvider","./Core/EncodedCartesian3","./Core/Event","./Core/EventHelper","./Core/ExtrapolationType","./Core/FeatureDetection","./Core/formatError","./Core/freezeObject","./Core/Fullscreen","./Core/GeocoderService","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/GeometryType","./Core/getAbsoluteUri","./Core/getBaseUri","./Core/getExtensionFromUri","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getMagic","./Core/getStringFromTypedArray","./Core/getTimestamp","./Core/GregorianDate","./Core/HeadingPitchRange","./Core/HeadingPitchRoll","./Core/HeightmapTerrainData","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/Intersections2D","./Core/IntersectionTests","./Core/Interval","./Core/isArray","./Core/isCrossOriginUrl","./Core/isLeapYear","./Core/Iso8601","./Core/joinUrls","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadCRN","./Core/loadImage","./Core/loadImageFromTypedArray","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadJsonp","./Core/loadKTX","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/MapboxApi","./Core/MapProjection","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/mergeSort","./Core/NearFarScalar","./Core/objectToQuery","./Core/Occluder","./Core/oneTimeWarning","./Core/OrientedBoundingBox","./Core/Packable","./Core/PackableForInterpolation","./Core/parseResponseHeaders","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/PointGeometry","./Core/pointInsideTriangle","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonHierarchy","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuantizedMeshTerrainData","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/queryToObject","./Core/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleGeometry","./Core/RectangleGeometryLibrary","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/requestAnimationFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/sampleTerrain","./Core/sampleTerrainMostDetailed","./Core/scaleToGeodeticSurface","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/subdivideArray","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainEncoding","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TerrainQuantization","./Core/throttleRequestByServer","./Core/TileAvailability","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TranslationRotationScale","./Core/TridiagonalSystemSolver","./Core/TrustedServers","./Core/VertexFormat","./Core/VideoSynchronizer","./Core/Visibility","./Core/VRTheWorldTerrainProvider","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebGLConstants","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WindingOrder","./Core/wrapFunction","./Core/writeTextToCanvas","./DataSources/BillboardGraphics","./DataSources/BillboardVisualizer","./DataSources/BoundingSphereState","./DataSources/BoxGeometryUpdater","./DataSources/BoxGraphics","./DataSources/CallbackProperty","./DataSources/CheckerboardMaterialProperty","./DataSources/ColorMaterialProperty","./DataSources/CompositeEntityCollection","./DataSources/CompositeMaterialProperty","./DataSources/CompositePositionProperty","./DataSources/CompositeProperty","./DataSources/ConstantPositionProperty","./DataSources/ConstantProperty","./DataSources/CorridorGeometryUpdater","./DataSources/CorridorGraphics","./DataSources/createMaterialPropertyDescriptor","./DataSources/createPropertyDescriptor","./DataSources/createRawPropertyDescriptor","./DataSources/CustomDataSource","./DataSources/CylinderGeometryUpdater","./DataSources/CylinderGraphics","./DataSources/CzmlDataSource","./DataSources/DataSource","./DataSources/DataSourceClock","./DataSources/DataSourceCollection","./DataSources/DataSourceDisplay","./DataSources/dynamicGeometryGetBoundingSphere","./DataSources/DynamicGeometryUpdater","./DataSources/EllipseGeometryUpdater","./DataSources/EllipseGraphics","./DataSources/EllipsoidGeometryUpdater","./DataSources/EllipsoidGraphics","./DataSources/Entity","./DataSources/EntityCluster","./DataSources/EntityCollection","./DataSources/EntityView","./DataSources/GeoJsonDataSource","./DataSources/GeometryUpdater","./DataSources/GeometryVisualizer","./DataSources/GridMaterialProperty","./DataSources/ImageMaterialProperty","./DataSources/KmlDataSource","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/NodeTransformationProperty","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineArrowMaterialProperty","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PolylineVolumeGeometryUpdater","./DataSources/PolylineVolumeGraphics","./DataSources/PositionProperty","./DataSources/PositionPropertyArray","./DataSources/Property","./DataSources/PropertyArray","./DataSources/PropertyBag","./DataSources/RectangleGeometryUpdater","./DataSources/RectangleGraphics","./DataSources/ReferenceProperty","./DataSources/Rotation","./DataSources/SampledPositionProperty","./DataSources/SampledProperty","./DataSources/ScaledPositionProperty","./DataSources/StaticGeometryColorBatch","./DataSources/StaticGeometryPerMaterialBatch","./DataSources/StaticGroundGeometryColorBatch","./DataSources/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/VelocityOrientationProperty","./DataSources/VelocityVectorProperty","./DataSources/Visualizer","./DataSources/WallGeometryUpdater","./DataSources/WallGraphics","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/ComputeCommand","./Renderer/ComputeEngine","./Renderer/Context","./Renderer/ContextLimits","./Renderer/createUniform","./Renderer/createUniformArray","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/loadCubeMap","./Renderer/MipmapHint","./Renderer/Pass","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/RenderState","./Renderer/Sampler","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/ShaderSource","./Renderer/Texture","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/Axis","./Scene/BatchTable","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/BlendOption","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/ColorBlendMode","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/CreditDisplay","./Scene/CullFace","./Scene/CullingVolume","./Scene/DebugAppearance","./Scene/DebugCameraPrimitive","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DepthPlane","./Scene/DeviceOrientationCameraController","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/Fog","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/FXAA","./Scene/getAttributeOrUniformBySemantic","./Scene/getBinaryAccessor","./Scene/GetFeatureInfoFormat","./Scene/Globe","./Scene/GlobeDepth","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/GroundPrimitive","./Scene/HeightReference","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImagerySplitDirection","./Scene/ImageryState","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/MapboxImageryProvider","./Scene/MapMode2D","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelMaterial","./Scene/modelMaterialsCommon","./Scene/ModelMesh","./Scene/ModelNode","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/OrthographicFrustum","./Scene/PerformanceDisplay","./Scene/PerInstanceColorAppearance","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/PickDepth","./Scene/PointAppearance","./Scene/PointPrimitive","./Scene/PointPrimitiveCollection","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitiveCollection","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/QuadtreeOccluders","./Scene/QuadtreePrimitive","./Scene/QuadtreeTile","./Scene/QuadtreeTileLoadState","./Scene/QuadtreeTileProvider","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/ShadowMap","./Scene/ShadowMapShader","./Scene/ShadowMode","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileBoundingBox","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TweenCollection","./Scene/UrlTemplateImageryProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMapTileServiceImageryProvider","./Shaders/AdjustTranslucentFS","./Shaders/Appearances/AllMaterialAppearanceFS","./Shaders/Appearances/AllMaterialAppearanceVS","./Shaders/Appearances/BasicMaterialAppearanceFS","./Shaders/Appearances/BasicMaterialAppearanceVS","./Shaders/Appearances/EllipsoidSurfaceAppearanceFS","./Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Shaders/Appearances/PerInstanceColorAppearanceFS","./Shaders/Appearances/PerInstanceColorAppearanceVS","./Shaders/Appearances/PerInstanceFlatColorAppearanceFS","./Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Shaders/Appearances/PointAppearanceFS","./Shaders/Appearances/PointAppearanceVS","./Shaders/Appearances/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/Builtin/Constants/degreesPerRadian","./Shaders/Builtin/Constants/depthRange","./Shaders/Builtin/Constants/epsilon1","./Shaders/Builtin/Constants/epsilon2","./Shaders/Builtin/Constants/epsilon3","./Shaders/Builtin/Constants/epsilon4","./Shaders/Builtin/Constants/epsilon5","./Shaders/Builtin/Constants/epsilon6","./Shaders/Builtin/Constants/epsilon7","./Shaders/Builtin/Constants/infinity","./Shaders/Builtin/Constants/oneOverPi","./Shaders/Builtin/Constants/oneOverTwoPi","./Shaders/Builtin/Constants/passCompute","./Shaders/Builtin/Constants/passEnvironment","./Shaders/Builtin/Constants/passGlobe","./Shaders/Builtin/Constants/passGround","./Shaders/Builtin/Constants/passOpaque","./Shaders/Builtin/Constants/passOverlay","./Shaders/Builtin/Constants/passTranslucent","./Shaders/Builtin/Constants/pi","./Shaders/Builtin/Constants/piOverFour","./Shaders/Builtin/Constants/piOverSix","./Shaders/Builtin/Constants/piOverThree","./Shaders/Builtin/Constants/piOverTwo","./Shaders/Builtin/Constants/radiansPerDegree","./Shaders/Builtin/Constants/sceneMode2D","./Shaders/Builtin/Constants/sceneMode3D","./Shaders/Builtin/Constants/sceneModeColumbusView","./Shaders/Builtin/Constants/sceneModeMorphing","./Shaders/Builtin/Constants/solarRadius","./Shaders/Builtin/Constants/threePiOver2","./Shaders/Builtin/Constants/twoPi","./Shaders/Builtin/Constants/webMercatorMaxLatitude","./Shaders/Builtin/CzmBuiltins","./Shaders/Builtin/Functions/alphaWeight","./Shaders/Builtin/Functions/antialias","./Shaders/Builtin/Functions/cascadeColor","./Shaders/Builtin/Functions/cascadeDistance","./Shaders/Builtin/Functions/cascadeMatrix","./Shaders/Builtin/Functions/cascadeWeights","./Shaders/Builtin/Functions/columbusViewMorph","./Shaders/Builtin/Functions/computePosition","./Shaders/Builtin/Functions/cosineAndSine","./Shaders/Builtin/Functions/decompressTextureCoordinates","./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates","./Shaders/Builtin/Functions/ellipsoidContainsPoint","./Shaders/Builtin/Functions/ellipsoidNew","./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates","./Shaders/Builtin/Functions/equalsEpsilon","./Shaders/Builtin/Functions/eyeOffset","./Shaders/Builtin/Functions/eyeToWindowCoordinates","./Shaders/Builtin/Functions/fog","./Shaders/Builtin/Functions/geodeticSurfaceNormal","./Shaders/Builtin/Functions/getDefaultMaterial","./Shaders/Builtin/Functions/getLambertDiffuse","./Shaders/Builtin/Functions/getSpecular","./Shaders/Builtin/Functions/getWaterNoise","./Shaders/Builtin/Functions/getWgs84EllipsoidEC","./Shaders/Builtin/Functions/hue","./Shaders/Builtin/Functions/isEmpty","./Shaders/Builtin/Functions/isFull","./Shaders/Builtin/Functions/latitudeToWebMercatorFraction","./Shaders/Builtin/Functions/luminance","./Shaders/Builtin/Functions/metersPerPixel","./Shaders/Builtin/Functions/modelToWindowCoordinates","./Shaders/Builtin/Functions/multiplyWithColorBalance","./Shaders/Builtin/Functions/nearFarScalar","./Shaders/Builtin/Functions/octDecode","./Shaders/Builtin/Functions/packDepth","./Shaders/Builtin/Functions/phong","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/RGBToXYZ","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/shadowDepthCompare","./Shaders/Builtin/Functions/shadowVisibility","./Shaders/Builtin/Functions/signNotZero","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/unpackDepth","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Structs/depthRangeStruct","./Shaders/Builtin/Structs/ellipsoid","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/Builtin/Structs/shadowParameters","./Shaders/CompositeOITFS","./Shaders/DepthPlaneFS","./Shaders/DepthPlaneVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeVS","./Shaders/GroundAtmosphere","./Shaders/Materials/BumpMapMaterial","./Shaders/Materials/CheckerboardMaterial","./Shaders/Materials/DotMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/StripeMaterial","./Shaders/Materials/Water","./Shaders/PointPrimitiveCollectionFS","./Shaders/PointPrimitiveCollectionVS","./Shaders/PolylineCommon","./Shaders/PolylineFS","./Shaders/PolylineVS","./Shaders/PostProcessFilters/AdditiveBlend","./Shaders/PostProcessFilters/BrightPass","./Shaders/PostProcessFilters/FXAA","./Shaders/PostProcessFilters/GaussianBlur1D","./Shaders/PostProcessFilters/PassThrough","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/ShadowVolumeFS","./Shaders/ShadowVolumeVS","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Autolinker","./ThirdParty/crunch","./ThirdParty/earcut-2.1.1","./ThirdParty/gltfDefaults","./ThirdParty/kdbush","./ThirdParty/knockout-3.4.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/NoSleep","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/when","./ThirdParty/zip","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./Widgets/BaseLayerPicker/ProviderViewModel","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/createCommand","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/getElement","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/InfoBox/InfoBox","./Widgets/InfoBox/InfoBoxViewModel","./Widgets/NavigationHelpButton/NavigationHelpButton","./Widgets/NavigationHelpButton/NavigationHelpButtonViewModel","./Widgets/PerformanceWatchdog/PerformanceWatchdog","./Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SelectionIndicator/SelectionIndicator","./Widgets/SelectionIndicator/SelectionIndicatorViewModel","./Widgets/subscribeAndEvaluate","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Widgets/VRButton/VRButton","./Widgets/VRButton/VRButtonViewModel","./Workers/createTaskProcessorWorker"],function(e,t,i,r,n,o,a,s,l,u,c,d,h,p,f,m,_,g,v,y,C,w,S,E,b,T,x,A,P,M,D,I,R,O,N,L,B,F,k,V,z,U,G,H,W,q,j,Y,X,Z,K,Q,J,$,ee,te,ie,re,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,_e,ge,ve,ye,Ce,we,Se,Ee,be,Te,xe,Ae,Pe,Me,De,Ie,Re,Oe,Ne,Le,Be,Fe,ke,Ve,ze,Ue,Ge,He,We,qe,je,Ye,Xe,Ze,Ke,Qe,Je,$e,et,tt,it,rt,nt,ot,at,st,lt,ut,ct,dt,ht,pt,ft,mt,_t,gt,vt,yt,Ct,wt,St,Et,bt,Tt,xt,At,Pt,Mt,Dt,It,Rt,Ot,Nt,Lt,Bt,Ft,kt,Vt,zt,Ut,Gt,Ht,Wt,qt,jt,Yt,Xt,Zt,Kt,Qt,Jt,$t,ei,ti,ii,ri,ni,oi,ai,si,li,ui,ci,di,hi,pi,fi,mi,_i,gi,vi,yi,Ci,wi,Si,Ei,bi,Ti,xi,Ai,Pi,Mi,Di,Ii,Ri,Oi,Ni,Li,Bi,Fi,ki,Vi,zi,Ui,Gi,Hi,Wi,qi,ji,Yi,Xi,Zi,Ki,Qi,Ji,$i,er,tr,ir,rr,nr,or,ar,sr,lr,ur,cr,dr,hr,pr,fr,mr,_r,gr,vr,yr,Cr,wr,Sr,Er,br,Tr,xr,Ar,Pr,Mr,Dr,Ir,Rr,Or,Nr,Lr,Br,Fr,kr,Vr,zr,Ur,Gr,Hr,Wr,qr,jr,Yr,Xr,Zr,Kr,Qr,Jr,$r,en,tn,rn,nn,on,an,sn,ln,un,cn,dn,hn,pn,fn,mn,_n,gn,vn,yn,Cn,wn,Sn,En,bn,Tn,xn,An,Pn,Mn,Dn,In,Rn,On,Nn,Ln,Bn,Fn,kn,Vn,zn,Un,Gn,Hn,Wn,qn,jn,Yn,Xn,Zn,Kn,Qn,Jn,$n,eo,to,io,ro,no,oo,ao,so,lo,uo,co,ho,po,fo,mo,_o,go,vo,yo,Co,wo,So,Eo,bo,To,xo,Ao,Po,Mo,Do,Io,Ro,Oo,No,Lo,Bo,Fo,ko,Vo,zo,Uo,Go,Ho,Wo,qo,jo,Yo,Xo,Zo,Ko,Qo,Jo,$o,ea,ta,ia,ra,na,oa,aa,sa,la,ua,ca,da,ha,pa,fa,ma,_a,ga,va,ya,Ca,wa,Sa,Ea,ba,Ta,xa,Aa,Pa,Ma,Da,Ia,Ra,Oa,Na,La,Ba,Fa,ka,Va,za,Ua,Ga,Ha,Wa,qa,ja,Ya,Xa,Za,Ka,Qa,Ja,$a,es,ts,is,rs,ns,os,as,ss,ls,us,cs,ds,hs,ps,fs,ms,_s,gs,vs,ys,Cs,ws,Ss,Es,bs,Ts,xs,As,Ps,Ms,Ds,Is,Rs,Os,Ns,Ls,Bs,Fs,ks,Vs,zs,Us,Gs,Hs,Ws,qs,js,Ys,Xs,Zs,Ks,Qs,Js,$s,el,tl,il,rl,nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl,ml,_l,gl,vl,yl,Cl,wl,Sl,El,bl,Tl,xl,Al,Pl,Ml,Dl,Il,Rl,Ol,Nl,Ll,Bl,Fl,kl,Vl,zl,Ul,Gl,Hl,Wl,ql,jl,Yl,Xl,Zl,Kl,Ql,Jl,$l,eu,tu,iu,ru,nu,ou,au,su,lu,uu,cu,du,hu,pu,fu,mu,_u,gu,vu,yu,Cu,wu,Su,Eu,bu,Tu,xu,Au,Pu,Mu,Du,Iu,Ru,Ou,Nu,Lu,Bu,Fu,ku,Vu,zu,Uu,Gu,Hu,Wu,qu,ju,Yu,Xu,Zu,Ku,Qu,Ju,$u,ec,tc,ic,rc,nc,oc,ac,sc,lc,uc,cc,dc,hc,pc,fc,mc,_c,gc,vc,yc,Cc,wc,Sc,Ec,bc,Tc,xc,Ac,Pc,Mc,Dc,Ic,Rc,Oc,Nc,Lc,Bc,Fc,kc,Vc,zc,Uc,Gc,Hc,Wc,qc,jc,Yc,Xc,Zc,Kc,Qc,Jc,$c,ed,td,id,rd,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md,_d,gd,vd,yd,Cd,wd,Sd,Ed,bd,Td,xd,Ad,Pd,Md,Dd,Id,Rd,Od,Nd,Ld,Bd,Fd,kd,Vd,zd,Ud,Gd){ -"use strict";var Hd={VERSION:"1.31",_shaders:{}};return Hd.appendForwardSlash=e,Hd.ArcGisImageServerTerrainProvider=t,Hd.arrayRemoveDuplicates=i,Hd.AssociativeArray=r,Hd.AttributeCompression=n,Hd.AxisAlignedBoundingBox=o,Hd.barycentricCoordinates=a,Hd.binarySearch=s,Hd.BingMapsApi=l,Hd.BingMapsGeocoderService=u,Hd.BoundingRectangle=c,Hd.BoundingSphere=d,Hd.BoxGeometry=h,Hd.BoxOutlineGeometry=p,Hd.buildModuleUrl=f,Hd.cancelAnimationFrame=m,Hd.Cartesian2=_,Hd.Cartesian3=g,Hd.Cartesian4=v,Hd.Cartographic=y,Hd.CartographicGeocoderService=C,Hd.CatmullRomSpline=w,Hd.CesiumTerrainProvider=S,Hd.Check=E,Hd.CircleGeometry=b,Hd.CircleOutlineGeometry=T,Hd.Clock=x,Hd.ClockRange=A,Hd.ClockStep=P,Hd.clone=M,Hd.Color=D,Hd.ColorGeometryInstanceAttribute=I,Hd.combine=R,Hd.ComponentDatatype=O,Hd.CompressedTextureBuffer=N,Hd.CornerType=L,Hd.CorridorGeometry=B,Hd.CorridorGeometryLibrary=F,Hd.CorridorOutlineGeometry=k,Hd.createGuid=V,Hd.Credit=z,Hd.CubicRealPolynomial=U,Hd.CylinderGeometry=G,Hd.CylinderGeometryLibrary=H,Hd.CylinderOutlineGeometry=W,Hd.DefaultProxy=q,Hd.defaultValue=j,Hd.defined=Y,Hd.defineProperties=X,Hd.deprecationWarning=Z,Hd.destroyObject=K,Hd.DeveloperError=Q,Hd.DistanceDisplayCondition=J,Hd.DistanceDisplayConditionGeometryInstanceAttribute=$,Hd.EarthOrientationParameters=ee,Hd.EarthOrientationParametersSample=te,Hd.EasingFunction=ie,Hd.EllipseGeometry=re,Hd.EllipseGeometryLibrary=ne,Hd.EllipseOutlineGeometry=oe,Hd.Ellipsoid=ae,Hd.EllipsoidalOccluder=se,Hd.EllipsoidGeodesic=le,Hd.EllipsoidGeometry=ue,Hd.EllipsoidOutlineGeometry=ce,Hd.EllipsoidTangentPlane=de,Hd.EllipsoidTerrainProvider=he,Hd.EncodedCartesian3=pe,Hd.Event=fe,Hd.EventHelper=me,Hd.ExtrapolationType=_e,Hd.FeatureDetection=ge,Hd.formatError=ve,Hd.freezeObject=ye,Hd.Fullscreen=Ce,Hd.GeocoderService=we,Hd.GeographicProjection=Se,Hd.GeographicTilingScheme=Ee,Hd.Geometry=be,Hd.GeometryAttribute=Te,Hd.GeometryAttributes=xe,Hd.GeometryInstance=Ae,Hd.GeometryInstanceAttribute=Pe,Hd.GeometryPipeline=Me,Hd.GeometryType=De,Hd.getAbsoluteUri=Ie,Hd.getBaseUri=Re,Hd.getExtensionFromUri=Oe,Hd.getFilenameFromUri=Ne,Hd.getImagePixels=Le,Hd.getMagic=Be,Hd.getStringFromTypedArray=Fe,Hd.getTimestamp=ke,Hd.GregorianDate=Ve,Hd.HeadingPitchRange=ze,Hd.HeadingPitchRoll=Ue,Hd.HeightmapTerrainData=Ge,Hd.HeightmapTessellator=He,Hd.HermitePolynomialApproximation=We,Hd.HermiteSpline=qe,Hd.Iau2000Orientation=je,Hd.Iau2006XysData=Ye,Hd.Iau2006XysSample=Xe,Hd.IauOrientationAxes=Ze,Hd.IauOrientationParameters=Ke,Hd.IndexDatatype=Qe,Hd.InterpolationAlgorithm=Je,Hd.Intersect=$e,Hd.Intersections2D=et,Hd.IntersectionTests=tt,Hd.Interval=it,Hd.isArray=rt,Hd.isCrossOriginUrl=nt,Hd.isLeapYear=ot,Hd.Iso8601=at,Hd.joinUrls=st,Hd.JulianDate=lt,Hd.KeyboardEventModifier=ut,Hd.LagrangePolynomialApproximation=ct,Hd.LeapSecond=dt,Hd.LinearApproximation=ht,Hd.LinearSpline=pt,Hd.loadArrayBuffer=ft,Hd.loadBlob=mt,Hd.loadCRN=_t,Hd.loadImage=gt,Hd.loadImageFromTypedArray=vt,Hd.loadImageViaBlob=yt,Hd.loadJson=Ct,Hd.loadJsonp=wt,Hd.loadKTX=St,Hd.loadText=Et,Hd.loadWithXhr=bt,Hd.loadXML=Tt,Hd.MapboxApi=xt,Hd.MapProjection=At,Hd.Math=Pt,Hd.Matrix2=Mt,Hd.Matrix3=Dt,Hd.Matrix4=It,Hd.mergeSort=Rt,Hd.NearFarScalar=Ot,Hd.objectToQuery=Nt,Hd.Occluder=Lt,Hd.oneTimeWarning=Bt,Hd.OrientedBoundingBox=Ft,Hd.Packable=kt,Hd.PackableForInterpolation=Vt,Hd.parseResponseHeaders=zt,Hd.PinBuilder=Ut,Hd.PixelFormat=Gt,Hd.Plane=Ht,Hd.PointGeometry=Wt,Hd.pointInsideTriangle=qt,Hd.PolygonGeometry=jt,Hd.PolygonGeometryLibrary=Yt,Hd.PolygonHierarchy=Xt,Hd.PolygonOutlineGeometry=Zt,Hd.PolygonPipeline=Kt,Hd.PolylineGeometry=Qt,Hd.PolylinePipeline=Jt,Hd.PolylineVolumeGeometry=$t,Hd.PolylineVolumeGeometryLibrary=ei,Hd.PolylineVolumeOutlineGeometry=ti,Hd.PrimitiveType=ii,Hd.QuadraticRealPolynomial=ri,Hd.QuantizedMeshTerrainData=ni,Hd.QuarticRealPolynomial=oi,Hd.Quaternion=ai,Hd.QuaternionSpline=si,Hd.queryToObject=li,Hd.Queue=ui,Hd.Ray=ci,Hd.Rectangle=di,Hd.RectangleGeometry=hi,Hd.RectangleGeometryLibrary=pi,Hd.RectangleOutlineGeometry=fi,Hd.ReferenceFrame=mi,Hd.requestAnimationFrame=_i,Hd.RequestErrorEvent=gi,Hd.RuntimeError=vi,Hd.sampleTerrain=yi,Hd.sampleTerrainMostDetailed=Ci,Hd.scaleToGeodeticSurface=wi,Hd.ScreenSpaceEventHandler=Si,Hd.ScreenSpaceEventType=Ei,Hd.ShowGeometryInstanceAttribute=bi,Hd.Simon1994PlanetaryPositions=Ti,Hd.SimplePolylineGeometry=xi,Hd.SphereGeometry=Ai,Hd.SphereOutlineGeometry=Pi,Hd.Spherical=Mi,Hd.Spline=Di,Hd.subdivideArray=Ii,Hd.TaskProcessor=Ri,Hd.TerrainData=Oi,Hd.TerrainEncoding=Ni,Hd.TerrainMesh=Li,Hd.TerrainProvider=Bi,Hd.TerrainQuantization=Fi,Hd.throttleRequestByServer=ki,Hd.TileAvailability=Vi,Hd.TileProviderError=zi,Hd.TilingScheme=Ui,Hd.TimeConstants=Gi,Hd.TimeInterval=Hi,Hd.TimeIntervalCollection=Wi,Hd.TimeStandard=qi,Hd.Tipsify=ji,Hd.Transforms=Yi,Hd.TranslationRotationScale=Xi,Hd.TridiagonalSystemSolver=Zi,Hd.TrustedServers=Ki,Hd.VertexFormat=Qi,Hd.VideoSynchronizer=Ji,Hd.Visibility=$i,Hd.VRTheWorldTerrainProvider=er,Hd.WallGeometry=tr,Hd.WallGeometryLibrary=ir,Hd.WallOutlineGeometry=rr,Hd.WebGLConstants=nr,Hd.WebMercatorProjection=or,Hd.WebMercatorTilingScheme=ar,Hd.WindingOrder=sr,Hd.wrapFunction=lr,Hd.writeTextToCanvas=ur,Hd.BillboardGraphics=cr,Hd.BillboardVisualizer=dr,Hd.BoundingSphereState=hr,Hd.BoxGeometryUpdater=pr,Hd.BoxGraphics=fr,Hd.CallbackProperty=mr,Hd.CheckerboardMaterialProperty=_r,Hd.ColorMaterialProperty=gr,Hd.CompositeEntityCollection=vr,Hd.CompositeMaterialProperty=yr,Hd.CompositePositionProperty=Cr,Hd.CompositeProperty=wr,Hd.ConstantPositionProperty=Sr,Hd.ConstantProperty=Er,Hd.CorridorGeometryUpdater=br,Hd.CorridorGraphics=Tr,Hd.createMaterialPropertyDescriptor=xr,Hd.createPropertyDescriptor=Ar,Hd.createRawPropertyDescriptor=Pr,Hd.CustomDataSource=Mr,Hd.CylinderGeometryUpdater=Dr,Hd.CylinderGraphics=Ir,Hd.CzmlDataSource=Rr,Hd.DataSource=Or,Hd.DataSourceClock=Nr,Hd.DataSourceCollection=Lr,Hd.DataSourceDisplay=Br,Hd.dynamicGeometryGetBoundingSphere=Fr,Hd.DynamicGeometryUpdater=kr,Hd.EllipseGeometryUpdater=Vr,Hd.EllipseGraphics=zr,Hd.EllipsoidGeometryUpdater=Ur,Hd.EllipsoidGraphics=Gr,Hd.Entity=Hr,Hd.EntityCluster=Wr,Hd.EntityCollection=qr,Hd.EntityView=jr,Hd.GeoJsonDataSource=Yr,Hd.GeometryUpdater=Xr,Hd.GeometryVisualizer=Zr,Hd.GridMaterialProperty=Kr,Hd.ImageMaterialProperty=Qr,Hd.KmlDataSource=Jr,Hd.LabelGraphics=$r,Hd.LabelVisualizer=en,Hd.MaterialProperty=tn,Hd.ModelGraphics=rn,Hd.ModelVisualizer=nn,Hd.NodeTransformationProperty=on,Hd.PathGraphics=an,Hd.PathVisualizer=sn,Hd.PointGraphics=ln,Hd.PointVisualizer=un,Hd.PolygonGeometryUpdater=cn,Hd.PolygonGraphics=dn,Hd.PolylineArrowMaterialProperty=hn,Hd.PolylineGeometryUpdater=pn,Hd.PolylineGlowMaterialProperty=fn,Hd.PolylineGraphics=mn,Hd.PolylineOutlineMaterialProperty=_n,Hd.PolylineVolumeGeometryUpdater=gn,Hd.PolylineVolumeGraphics=vn,Hd.PositionProperty=yn,Hd.PositionPropertyArray=Cn,Hd.Property=wn,Hd.PropertyArray=Sn,Hd.PropertyBag=En,Hd.RectangleGeometryUpdater=bn,Hd.RectangleGraphics=Tn,Hd.ReferenceProperty=xn,Hd.Rotation=An,Hd.SampledPositionProperty=Pn,Hd.SampledProperty=Mn,Hd.ScaledPositionProperty=Dn,Hd.StaticGeometryColorBatch=In,Hd.StaticGeometryPerMaterialBatch=Rn,Hd.StaticGroundGeometryColorBatch=On,Hd.StaticOutlineGeometryBatch=Nn,Hd.StripeMaterialProperty=Ln,Hd.StripeOrientation=Bn,Hd.TimeIntervalCollectionPositionProperty=Fn,Hd.TimeIntervalCollectionProperty=kn,Hd.VelocityOrientationProperty=Vn,Hd.VelocityVectorProperty=zn,Hd.Visualizer=Un,Hd.WallGeometryUpdater=Gn,Hd.WallGraphics=Hn,Hd.AutomaticUniforms=Wn,Hd.Buffer=qn,Hd.BufferUsage=jn,Hd.ClearCommand=Yn,Hd.ComputeCommand=Xn,Hd.ComputeEngine=Zn,Hd.Context=Kn,Hd.ContextLimits=Qn,Hd.createUniform=Jn,Hd.createUniformArray=$n,Hd.CubeMap=eo,Hd.CubeMapFace=to,Hd.DrawCommand=io,Hd.Framebuffer=ro,Hd.loadCubeMap=no,Hd.MipmapHint=oo,Hd.Pass=ao,Hd.PassState=so,Hd.PickFramebuffer=lo,Hd.PixelDatatype=uo,Hd.Renderbuffer=co,Hd.RenderbufferFormat=ho,Hd.RenderState=po,Hd.Sampler=fo,Hd.ShaderCache=mo,Hd.ShaderProgram=_o,Hd.ShaderSource=go,Hd.Texture=vo,Hd.TextureMagnificationFilter=yo,Hd.TextureMinificationFilter=Co,Hd.TextureWrap=wo,Hd.UniformState=So,Hd.VertexArray=Eo,Hd.VertexArrayFacade=bo,Hd.Appearance=To,Hd.ArcGisMapServerImageryProvider=xo,Hd.Axis=Ao,Hd.BatchTable=Po,Hd.Billboard=Mo,Hd.BillboardCollection=Do,Hd.BingMapsImageryProvider=Io,Hd.BingMapsStyle=Ro,Hd.BlendEquation=Oo,Hd.BlendFunction=No,Hd.BlendingState=Lo,Hd.BlendOption=Bo,Hd.Camera=Fo,Hd.CameraEventAggregator=ko,Hd.CameraEventType=Vo,Hd.CameraFlightPath=zo,Hd.ColorBlendMode=Uo,Hd.createOpenStreetMapImageryProvider=Go,Hd.createTangentSpaceDebugPrimitive=Ho,Hd.createTileMapServiceImageryProvider=Wo,Hd.CreditDisplay=qo,Hd.CullFace=jo,Hd.CullingVolume=Yo,Hd.DebugAppearance=Xo,Hd.DebugCameraPrimitive=Zo,Hd.DebugModelMatrixPrimitive=Ko,Hd.DepthFunction=Qo,Hd.DepthPlane=Jo,Hd.DeviceOrientationCameraController=$o,Hd.DiscardMissingTileImagePolicy=ea,Hd.EllipsoidPrimitive=ta,Hd.EllipsoidSurfaceAppearance=ia,Hd.Fog=ra,Hd.FrameRateMonitor=na,Hd.FrameState=oa,Hd.FrustumCommands=aa,Hd.FXAA=sa,Hd.getAttributeOrUniformBySemantic=la,Hd.getBinaryAccessor=ua,Hd.GetFeatureInfoFormat=ca,Hd.Globe=da,Hd.GlobeDepth=ha,Hd.GlobeSurfaceShaderSet=pa,Hd.GlobeSurfaceTile=fa,Hd.GlobeSurfaceTileProvider=ma,Hd.GoogleEarthImageryProvider=_a,Hd.GridImageryProvider=ga,Hd.GroundPrimitive=va,Hd.HeightReference=ya,Hd.HorizontalOrigin=Ca,Hd.Imagery=wa,Hd.ImageryLayer=Sa,Hd.ImageryLayerCollection=Ea,Hd.ImageryLayerFeatureInfo=ba,Hd.ImageryProvider=Ta,Hd.ImagerySplitDirection=xa,Hd.ImageryState=Aa,Hd.Label=Pa,Hd.LabelCollection=Ma,Hd.LabelStyle=Da,Hd.MapboxImageryProvider=Ia,Hd.MapMode2D=Ra,Hd.Material=Oa,Hd.MaterialAppearance=Na,Hd.Model=La,Hd.ModelAnimation=Ba,Hd.ModelAnimationCache=Fa,Hd.ModelAnimationCollection=ka,Hd.ModelAnimationLoop=Va,Hd.ModelAnimationState=za,Hd.ModelMaterial=Ua,Hd.modelMaterialsCommon=Ga,Hd.ModelMesh=Ha,Hd.ModelNode=Wa,Hd.Moon=qa,Hd.NeverTileDiscardPolicy=ja,Hd.OIT=Ya,Hd.OrthographicFrustum=Xa,Hd.PerformanceDisplay=Za,Hd.PerInstanceColorAppearance=Ka,Hd.PerspectiveFrustum=Qa,Hd.PerspectiveOffCenterFrustum=Ja,Hd.PickDepth=$a,Hd.PointAppearance=es,Hd.PointPrimitive=ts,Hd.PointPrimitiveCollection=is,Hd.Polyline=rs,Hd.PolylineCollection=ns,Hd.PolylineColorAppearance=os,Hd.PolylineMaterialAppearance=as,Hd.Primitive=ss,Hd.PrimitiveCollection=ls,Hd.PrimitivePipeline=us,Hd.PrimitiveState=cs,Hd.QuadtreeOccluders=ds,Hd.QuadtreePrimitive=hs,Hd.QuadtreeTile=ps,Hd.QuadtreeTileLoadState=fs,Hd.QuadtreeTileProvider=ms,Hd.Scene=_s,Hd.SceneMode=gs,Hd.SceneTransforms=vs,Hd.SceneTransitioner=ys,Hd.ScreenSpaceCameraController=Cs,Hd.ShadowMap=ws,Hd.ShadowMapShader=Ss,Hd.ShadowMode=Es,Hd.SingleTileImageryProvider=bs,Hd.SkyAtmosphere=Ts,Hd.SkyBox=xs,Hd.StencilFunction=As,Hd.StencilOperation=Ps,Hd.Sun=Ms,Hd.SunPostProcess=Ds,Hd.TerrainState=Is,Hd.TextureAtlas=Rs,Hd.TileBoundingBox=Os,Hd.TileCoordinatesImageryProvider=Ns,Hd.TileDiscardPolicy=Ls,Hd.TileImagery=Bs,Hd.TileReplacementQueue=Fs,Hd.TileState=ks,Hd.TileTerrain=Vs,Hd.TweenCollection=zs,Hd.UrlTemplateImageryProvider=Us,Hd.VerticalOrigin=Gs,Hd.ViewportQuad=Hs,Hd.WebMapServiceImageryProvider=Ws,Hd.WebMapTileServiceImageryProvider=qs,Hd._shaders.AdjustTranslucentFS=js,Hd._shaders.AllMaterialAppearanceFS=Ys,Hd._shaders.AllMaterialAppearanceVS=Xs,Hd._shaders.BasicMaterialAppearanceFS=Zs,Hd._shaders.BasicMaterialAppearanceVS=Ks,Hd._shaders.EllipsoidSurfaceAppearanceFS=Qs,Hd._shaders.EllipsoidSurfaceAppearanceVS=Js,Hd._shaders.PerInstanceColorAppearanceFS=$s,Hd._shaders.PerInstanceColorAppearanceVS=el,Hd._shaders.PerInstanceFlatColorAppearanceFS=tl,Hd._shaders.PerInstanceFlatColorAppearanceVS=il,Hd._shaders.PointAppearanceFS=rl,Hd._shaders.PointAppearanceVS=nl,Hd._shaders.PolylineColorAppearanceVS=ol,Hd._shaders.PolylineMaterialAppearanceVS=al,Hd._shaders.TexturedMaterialAppearanceFS=sl,Hd._shaders.TexturedMaterialAppearanceVS=ll,Hd._shaders.BillboardCollectionFS=ul,Hd._shaders.BillboardCollectionVS=cl,Hd._shaders.degreesPerRadian=dl,Hd._shaders.depthRange=hl,Hd._shaders.epsilon1=pl,Hd._shaders.epsilon2=fl,Hd._shaders.epsilon3=ml,Hd._shaders.epsilon4=_l,Hd._shaders.epsilon5=gl,Hd._shaders.epsilon6=vl,Hd._shaders.epsilon7=yl,Hd._shaders.infinity=Cl,Hd._shaders.oneOverPi=wl,Hd._shaders.oneOverTwoPi=Sl,Hd._shaders.passCompute=El,Hd._shaders.passEnvironment=bl,Hd._shaders.passGlobe=Tl,Hd._shaders.passGround=xl,Hd._shaders.passOpaque=Al,Hd._shaders.passOverlay=Pl,Hd._shaders.passTranslucent=Ml,Hd._shaders.pi=Dl,Hd._shaders.piOverFour=Il,Hd._shaders.piOverSix=Rl,Hd._shaders.piOverThree=Ol,Hd._shaders.piOverTwo=Nl,Hd._shaders.radiansPerDegree=Ll,Hd._shaders.sceneMode2D=Bl,Hd._shaders.sceneMode3D=Fl,Hd._shaders.sceneModeColumbusView=kl,Hd._shaders.sceneModeMorphing=Vl,Hd._shaders.solarRadius=zl,Hd._shaders.threePiOver2=Ul,Hd._shaders.twoPi=Gl,Hd._shaders.webMercatorMaxLatitude=Hl,Hd._shaders.CzmBuiltins=Wl,Hd._shaders.alphaWeight=ql,Hd._shaders.antialias=jl,Hd._shaders.cascadeColor=Yl,Hd._shaders.cascadeDistance=Xl,Hd._shaders.cascadeMatrix=Zl,Hd._shaders.cascadeWeights=Kl,Hd._shaders.columbusViewMorph=Ql,Hd._shaders.computePosition=Jl,Hd._shaders.cosineAndSine=$l,Hd._shaders.decompressTextureCoordinates=eu,Hd._shaders.eastNorthUpToEyeCoordinates=tu,Hd._shaders.ellipsoidContainsPoint=iu,Hd._shaders.ellipsoidNew=ru,Hd._shaders.ellipsoidWgs84TextureCoordinates=nu,Hd._shaders.equalsEpsilon=ou,Hd._shaders.eyeOffset=au,Hd._shaders.eyeToWindowCoordinates=su,Hd._shaders.fog=lu,Hd._shaders.geodeticSurfaceNormal=uu,Hd._shaders.getDefaultMaterial=cu,Hd._shaders.getLambertDiffuse=du,Hd._shaders.getSpecular=hu,Hd._shaders.getWaterNoise=pu,Hd._shaders.getWgs84EllipsoidEC=fu,Hd._shaders.hue=mu,Hd._shaders.isEmpty=_u,Hd._shaders.isFull=gu,Hd._shaders.latitudeToWebMercatorFraction=vu,Hd._shaders.luminance=yu,Hd._shaders.metersPerPixel=Cu,Hd._shaders.modelToWindowCoordinates=wu,Hd._shaders.multiplyWithColorBalance=Su,Hd._shaders.nearFarScalar=Eu,Hd._shaders.octDecode=bu,Hd._shaders.packDepth=Tu,Hd._shaders.phong=xu,Hd._shaders.pointAlongRay=Au,Hd._shaders.rayEllipsoidIntersectionInterval=Pu,Hd._shaders.RGBToXYZ=Mu,Hd._shaders.saturation=Du,Hd._shaders.shadowDepthCompare=Iu,Hd._shaders.shadowVisibility=Ru,Hd._shaders.signNotZero=Ou,Hd._shaders.tangentToEyeSpaceMatrix=Nu,Hd._shaders.translateRelativeToEye=Lu,Hd._shaders.translucentPhong=Bu,Hd._shaders.transpose=Fu,Hd._shaders.unpackDepth=ku,Hd._shaders.windowToEyeCoordinates=Vu,Hd._shaders.XYZToRGB=zu,Hd._shaders.depthRangeStruct=Uu,Hd._shaders.ellipsoid=Gu,Hd._shaders.material=Hu,Hd._shaders.materialInput=Wu,Hd._shaders.ray=qu,Hd._shaders.raySegment=ju,Hd._shaders.shadowParameters=Yu,Hd._shaders.CompositeOITFS=Xu,Hd._shaders.DepthPlaneFS=Zu,Hd._shaders.DepthPlaneVS=Ku,Hd._shaders.EllipsoidFS=Qu,Hd._shaders.EllipsoidVS=Ju,Hd._shaders.GlobeFS=$u,Hd._shaders.GlobeVS=ec,Hd._shaders.GroundAtmosphere=tc,Hd._shaders.BumpMapMaterial=ic,Hd._shaders.CheckerboardMaterial=rc,Hd._shaders.DotMaterial=nc,Hd._shaders.FadeMaterial=oc,Hd._shaders.GridMaterial=ac,Hd._shaders.NormalMapMaterial=sc,Hd._shaders.PolylineArrowMaterial=lc,Hd._shaders.PolylineGlowMaterial=uc,Hd._shaders.PolylineOutlineMaterial=cc,Hd._shaders.RimLightingMaterial=dc,Hd._shaders.StripeMaterial=hc,Hd._shaders.Water=pc,Hd._shaders.PointPrimitiveCollectionFS=fc,Hd._shaders.PointPrimitiveCollectionVS=mc,Hd._shaders.PolylineCommon=_c,Hd._shaders.PolylineFS=gc,Hd._shaders.PolylineVS=vc,Hd._shaders.AdditiveBlend=yc,Hd._shaders.BrightPass=Cc,Hd._shaders.FXAA=wc,Hd._shaders.GaussianBlur1D=Sc,Hd._shaders.PassThrough=Ec,Hd._shaders.ReprojectWebMercatorFS=bc,Hd._shaders.ReprojectWebMercatorVS=Tc,Hd._shaders.ShadowVolumeFS=xc,Hd._shaders.ShadowVolumeVS=Ac,Hd._shaders.SkyAtmosphereFS=Pc,Hd._shaders.SkyAtmosphereVS=Mc,Hd._shaders.SkyBoxFS=Dc,Hd._shaders.SkyBoxVS=Ic,Hd._shaders.SunFS=Rc,Hd._shaders.SunTextureFS=Oc,Hd._shaders.SunVS=Nc,Hd._shaders.ViewportQuadFS=Lc,Hd._shaders.ViewportQuadVS=Bc,Hd.Autolinker=Fc,Hd.crunch=kc,Hd["earcut-2.1.1"]=Vc,Hd.gltfDefaults=zc,Hd.kdbush=Uc,Hd["knockout-3.4.0"]=Gc,Hd["knockout-es5"]=Hc,Hd.knockout=Wc,Hd.measureText=qc,Hd["mersenne-twister"]=jc,Hd.NoSleep=Yc,Hd.sprintf=Xc,Hd.topojson=Zc,Hd.Tween=Kc,Hd.Uri=Qc,Hd.when=Jc,Hd.zip=$c,Hd.Animation=ed,Hd.AnimationViewModel=td,Hd.BaseLayerPicker=id,Hd.BaseLayerPickerViewModel=rd,Hd.createDefaultImageryProviderViewModels=nd,Hd.createDefaultTerrainProviderViewModels=od,Hd.ProviderViewModel=ad,Hd.CesiumInspector=sd,Hd.CesiumInspectorViewModel=ld,Hd.CesiumWidget=ud,Hd.ClockViewModel=cd,Hd.Command=dd,Hd.createCommand=hd,Hd.FullscreenButton=pd,Hd.FullscreenButtonViewModel=fd,Hd.Geocoder=md,Hd.GeocoderViewModel=_d,Hd.getElement=gd,Hd.HomeButton=vd,Hd.HomeButtonViewModel=yd,Hd.InfoBox=Cd,Hd.InfoBoxViewModel=wd,Hd.NavigationHelpButton=Sd,Hd.NavigationHelpButtonViewModel=Ed,Hd.PerformanceWatchdog=bd,Hd.PerformanceWatchdogViewModel=Td,Hd.SceneModePicker=xd,Hd.SceneModePickerViewModel=Ad,Hd.SelectionIndicator=Pd,Hd.SelectionIndicatorViewModel=Md,Hd.subscribeAndEvaluate=Dd,Hd.SvgPathBindingHandler=Id,Hd.Timeline=Rd,Hd.TimelineHighlightRange=Od,Hd.TimelineTrack=Nd,Hd.ToggleButtonViewModel=Ld,Hd.Viewer=Bd,Hd.viewerCesiumInspectorMixin=Fd,Hd.viewerDragDropMixin=kd,Hd.viewerPerformanceWatchdogMixin=Vd,Hd.VRButton=zd,Hd.VRButtonViewModel=Ud,Hd.createTaskProcessorWorker=Gd,Hd}),require(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}(); \ No newline at end of file +!function(){var requirejs,require,define;!function(e){function t(e,t){return _.call(e,t)}function r(e,t){var r,i,n,o,a,s,l,u,c,d,h,p,f=t&&t.split("/"),m=g.map,v=m&&m["*"]||{};if(e){for(e=e.split("/"),a=e.length-1,g.nodeIdCompat&&b.test(e[a])&&(e[a]=e[a].replace(b,"")),"."===e[0].charAt(0)&&f&&(p=f.slice(0,f.length-1),e=p.concat(e)),c=0;c<e.length;c++)if(h=e[c],"."===h)e.splice(c,1),c-=1;else if(".."===h){if(0===c||1===c&&".."===e[2]||".."===e[c-1])continue;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}if((f||v)&&m){for(r=e.split("/"),c=r.length;c>0;c-=1){if(i=r.slice(0,c).join("/"),f)for(d=f.length;d>0;d-=1)if(n=m[f.slice(0,d).join("/")],n&&(n=n[i])){o=n,s=c;break}if(o)break;!l&&v&&v[i]&&(l=v[i],u=c)}!o&&l&&(o=l,s=u),o&&(r.splice(0,s,o),e=r.join("/"))}return e}function i(t,r){return function(){var i=y.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),d.apply(e,i.concat([t,r]))}}function n(e){return function(t){return r(t,e)}}function o(e){return function(t){f[e]=t}}function a(r){if(t(m,r)){var i=m[r];delete m[r],v[r]=!0,c.apply(e,i)}if(!t(f,r)&&!t(v,r))throw new Error("No "+r);return f[r]}function s(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function l(e){return e?s(e):[]}function u(e){return function(){return g&&g.config&&g.config[e]||{}}}var c,d,h,p,f={},m={},g={},v={},_=Object.prototype.hasOwnProperty,y=[].slice,b=/\.js$/;h=function(e,t){var i,o=s(e),l=o[0],u=t[1];return e=o[1],l&&(l=r(l,u),i=a(l)),l?e=i&&i.normalize?i.normalize(e,n(u)):r(e,u):(e=r(e,u),o=s(e),l=o[0],e=o[1],l&&(i=a(l))),{f:l?l+"!"+e:e,n:e,pr:l,p:i}},p={require:function(e){return i(e)},exports:function(e){var t=f[e];return"undefined"!=typeof t?t:f[e]={}},module:function(e){return{id:e,uri:"",exports:f[e],config:u(e)}}},c=function(r,n,s,u){var c,d,g,_,y,b,C,w=[],S=typeof s;if(u=u||r,b=l(u),"undefined"===S||"function"===S){for(n=!n.length&&s.length?["require","exports","module"]:n,y=0;y<n.length;y+=1)if(_=h(n[y],b),d=_.f,"require"===d)w[y]=p.require(r);else if("exports"===d)w[y]=p.exports(r),C=!0;else if("module"===d)c=w[y]=p.module(r);else if(t(f,d)||t(m,d)||t(v,d))w[y]=a(d);else{if(!_.p)throw new Error(r+" missing "+d);_.p.load(_.n,i(u,!0),o(d),{}),w[y]=f[d]}g=s?s.apply(f[r],w):void 0,r&&(c&&c.exports!==e&&c.exports!==f[r]?f[r]=c.exports:g===e&&C||(f[r]=g))}else r&&(f[r]=s)},requirejs=require=d=function(t,r,i,n,o){if("string"==typeof t)return p[t]?p[t](r):a(h(t,l(r)).f);if(!t.splice){if(g=t,g.deps&&d(g.deps,g.callback),!r)return;r.splice?(t=r,r=i,i=null):t=e}return r=r||function(){},"function"==typeof i&&(i=n,n=o),n?c(e,t,r,i):setTimeout(function(){c(e,t,r,i)},4),d},d.config=function(e){return d(e)},requirejs._defined=f,define=function(e,r,i){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");r.splice||(i=r,r=[]),t(f,e)||t(m,e)||(m[e]=[e,r,i])},define.amd={jQuery:!0}}(),define("Core/appendForwardSlash",[],function(){"use strict";function e(e){return 0!==e.length&&"/"===e[e.length-1]||(e+="/"),e}return e}),define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function i(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var n={};return n.typeOf={},n.defined=function(i,n){if(!e(n))throw new t(r(i))},n.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(i(typeof r,"function",e))},n.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(i(typeof r,"string",e))},n.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(i(typeof r,"number",e))},n.typeOf.number.lessThan=function(e,r,i){if(n.typeOf.number(e,r),r>=i)throw new t("Expected "+e+" to be less than "+i+", actual value was "+r)},n.typeOf.number.lessThanOrEquals=function(e,r,i){if(n.typeOf.number(e,r),r>i)throw new t("Expected "+e+" to be less than or equal to "+i+", actual value was "+r)},n.typeOf.number.greaterThan=function(e,r,i){if(n.typeOf.number(e,r),r<=i)throw new t("Expected "+e+" to be greater than "+i+", actual value was "+r)},n.typeOf.number.greaterThanOrEquals=function(e,r,i){if(n.typeOf.number(e,r),r<i)throw new t("Expected "+e+" to be greater than or equal to"+i+", actual value was "+r)},n.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(i(typeof r,"object",e))},n.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(i(typeof r,"boolean",e))},n}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/arrayFill",["./Check","./defaultValue","./defined"],function(e,t,r){"use strict";function i(e,r,i,n){if("function"==typeof e.fill)return e.fill(r,i,n);for(var o=e.length>>>0,a=t(i,0),s=a<0?Math.max(o+a,0):Math.min(a,o),l=t(n,o),u=l<0?Math.max(o+l,0):Math.min(l,o);s<u;)e[s]=r,s++;return e}return i}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";var n={};n.EPSILON1=.1,n.EPSILON2=.01,n.EPSILON3=.001,n.EPSILON4=1e-4,n.EPSILON5=1e-5,n.EPSILON6=1e-6,n.EPSILON7=1e-7,n.EPSILON8=1e-8,n.EPSILON9=1e-9,n.EPSILON10=1e-10,n.EPSILON11=1e-11,n.EPSILON12=1e-12,n.EPSILON13=1e-13,n.EPSILON14=1e-14,n.EPSILON15=1e-15,n.EPSILON16=1e-16,n.EPSILON17=1e-17,n.EPSILON18=1e-18,n.EPSILON19=1e-19,n.EPSILON20=1e-20,n.GRAVITATIONALPARAMETER=3986004418e5,n.SOLAR_RADIUS=6955e5,n.LUNAR_RADIUS=1737400,n.SIXTY_FOUR_KILOBYTES=65536,n.sign=function(e){return e>0?1:e<0?-1:0},n.signNotZero=function(e){return e<0?-1:1},n.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*n.clamp(e,-1,1)+.5)*r)},n.fromSNorm=function(e,r){return r=t(r,255),n.clamp(e,0,r)/r*2-1},n.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},n.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},n.lerp=function(e,t,r){return(1-r)*e+r*t},n.PI=Math.PI,n.ONE_OVER_PI=1/Math.PI,n.PI_OVER_TWO=.5*Math.PI,n.PI_OVER_THREE=Math.PI/3,n.PI_OVER_FOUR=Math.PI/4,n.PI_OVER_SIX=Math.PI/6,n.THREE_PI_OVER_TWO=3*Math.PI*.5,n.TWO_PI=2*Math.PI,n.ONE_OVER_TWO_PI=1/(2*Math.PI),n.RADIANS_PER_DEGREE=Math.PI/180,n.DEGREES_PER_RADIAN=180/Math.PI,n.RADIANS_PER_ARCSECOND=n.RADIANS_PER_DEGREE/3600,n.toRadians=function(e){return e*n.RADIANS_PER_DEGREE},n.toDegrees=function(e){return e*n.DEGREES_PER_RADIAN},n.convertLongitudeRange=function(e){var t=n.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},n.clampToLatitudeRange=function(e){return n.clamp(e,-1*n.PI_OVER_TWO,n.PI_OVER_TWO)},n.negativePiToPi=function(e){return n.zeroToTwoPi(e+n.PI)-n.PI},n.zeroToTwoPi=function(e){var t=n.mod(e,n.TWO_PI);return Math.abs(t)<n.EPSILON14&&Math.abs(e)>n.EPSILON14?n.TWO_PI:t},n.mod=function(e,t){return(e%t+t)%t},n.equalsEpsilon=function(e,r,i,n){n=t(n,i);var o=Math.abs(e-r);return o<=n||o<=i*Math.max(Math.abs(e),Math.abs(r))};var o=[1];n.factorial=function(e){var t=o.length;if(e>=t)for(var r=o[t-1],i=t;i<=e;i++)o.push(r*i);return o[e]},n.incrementWrap=function(e,r,i){return i=t(i,0),++e,e>r&&(e=i),e},n.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},n.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},n.clamp=function(e,t,r){return e<t?t:e>r?r:e};var a=new e;return n.setRandomNumberSeed=function(t){a=new e(t)},n.nextRandomNumber=function(){return a.random()},n.acosClamped=function(e){return Math.acos(n.clamp(e,-1,1))},n.asinClamped=function(e){return Math.asin(n.clamp(e,-1,1))},n.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},n.logBase=function(e,t){return Math.log(e)/Math.log(t)},n.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},n}),define("Core/arrayRemoveDuplicates",["./Check","./defaultValue","./defined","./Math"],function(e,t,r,i){"use strict";function n(e,i,n){if(r(e)){n=t(n,!1);var a=e.length;if(a<2)return e;var s,l,u;for(s=1;s<a&&(l=e[s-1],u=e[s],!i(l,u,o));++s);if(s===a)return n&&i(e[0],e[e.length-1],o)?e.slice(1):e;for(var c=e.slice(0,s);s<a;++s)u=e[s],i(l,u,o)||(c.push(u),l=u);return n&&c.length>1&&i(c[0],c[c.length-1],o)&&c.shift(),c}}var o=i.EPSILON10;return n}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/AssociativeArray",["./defined","./defineProperties","./DeveloperError"],function(e,t,r){"use strict";function i(){this._array=[],this._hash={}}return t(i.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}}),i.prototype.contains=function(t){return e(this._hash[t])},i.prototype.set=function(e,t){var r=this._hash[e];t!==r&&(this.remove(e),this._hash[e]=t,this._array.push(t))},i.prototype.get=function(e){return this._hash[e]},i.prototype.remove=function(t){var r=this._hash[t],i=e(r);if(i){var n=this._array;n.splice(n.indexOf(r),1),delete this._hash[t]}return i},i.prototype.removeAll=function(){var e=this._array;e.length>0&&(this._hash={},e.length=0)},i}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,r){this.x=t(e,0),this.y=t(r,0)}a.fromElements=function(e,t,i){return r(i)?(i.x=e,i.y=t,i):new a(e,t)},a.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new a(e.x,e.y)},a.fromCartesian3=a.clone,a.fromCartesian4=a.clone,a.packedLength=2,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.x,r[i]=e.y,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.x=e[i++],n.y=e[i],n},a.packArray=function(e,t){var i=e.length;r(t)?t.length=2*i:t=new Array(2*i);for(var n=0;n<i;++n)a.pack(e[n],t,2*n);return t},a.unpackArray=function(e,t){var i=e.length;r(t)?t.length=i/2:t=new Array(i/2);for(var n=0;n<i;n+=2){var o=n/2;t[o]=a.unpack(e,n,t[o])}return t},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y)},a.minimumComponent=function(e){return Math.min(e.x,e.y)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},a.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var l=new a;a.lerp=function(e,t,r,i){return a.multiplyByScalar(t,r,l),i=a.multiplyByScalar(e,1-r,i),a.add(l,i,i)};var u=new a,c=new a;a.angleBetween=function(e,t){return a.normalize(e,u),a.normalize(t,c),o.acosClamped(a.dot(u,c))};var d=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,d);return a.abs(r,r),t=r.x<=r.y?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Y,t)},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},a.equalsEpsilon=function(e,t,i,n){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,i,n)&&o.equalsEpsilon(e.y,t.y,i,n)},a.ZERO=n(new a(0,0)),a.UNIT_X=n(new a(1,0)),a.UNIT_Y=n(new a(0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+")"},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,r,i){this.x=t(e,0),this.y=t(r,0),this.z=t(i,0)}a.fromSpherical=function(e,i){r(i)||(i=new a);var n=e.clock,o=e.cone,s=t(e.magnitude,1),l=s*Math.sin(o);return i.x=l*Math.cos(n),i.y=l*Math.sin(n),i.z=s*Math.cos(o),i},a.fromElements=function(e,t,i,n){return r(n)?(n.x=e,n.y=t,n.z=i,n):new a(e,t,i)},a.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new a(e.x,e.y,e.z)},a.fromCartesian4=a.clone,a.packedLength=3,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.x,r[i++]=e.y,r[i]=e.z,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.x=e[i++],n.y=e[i++],n.z=e[i],n},a.packArray=function(e,t){var i=e.length;r(t)?t.length=3*i:t=new Array(3*i);for(var n=0;n<i;++n)a.pack(e[n],t,3*n);return t},a.unpackArray=function(e,t){var i=e.length;r(t)?t.length=i/3:t=new Array(i/3);for(var n=0;n<i;n+=3){var o=n/3;t[o]=a.unpack(e,n,t[o])}return t},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},a.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var l=new a;a.lerp=function(e,t,r,i){return a.multiplyByScalar(t,r,l),i=a.multiplyByScalar(e,1-r,i),a.add(l,i,i)};var u=new a,c=new a;a.angleBetween=function(e,t){a.normalize(e,u),a.normalize(t,c);var r=a.dot(u,c),i=a.magnitude(a.cross(u,c,u));return Math.atan2(i,r)};var d=new a;a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,d);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?a.clone(a.UNIT_X,t):a.clone(a.UNIT_Z,t):r.y<=r.z?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_Z,t)},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},a.equalsEpsilon=function(e,t,i,n){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,i,n)&&o.equalsEpsilon(e.y,t.y,i,n)&&o.equalsEpsilon(e.z,t.z,i,n)},a.cross=function(e,t,r){var i=e.x,n=e.y,o=e.z,a=t.x,s=t.y,l=t.z,u=n*l-o*s,c=o*a-i*l,d=i*s-n*a;return r.x=u,r.y=c,r.z=d,r},a.fromDegrees=function(e,t,r,i,n){return e=o.toRadians(e),t=o.toRadians(t),a.fromRadians(e,t,r,i,n)};var h=new a,p=new a,f=new a(40680631590769,40680631590769,40408299984661.445);return a.fromRadians=function(e,i,n,o,s){n=t(n,0);var l=r(o)?o.radiiSquared:f,u=Math.cos(i);h.x=u*Math.cos(e),h.y=u*Math.sin(e),h.z=Math.sin(i),h=a.normalize(h,h),a.multiplyComponents(l,h,p);var c=Math.sqrt(a.dot(h,p));return p=a.divideByScalar(p,c,p),h=a.multiplyByScalar(h,n,h),r(s)||(s=new a),a.add(p,h,s)},a.fromDegreesArray=function(e,t,i){var n=e.length;r(i)?i.length=n/2:i=new Array(n/2);for(var o=0;o<n;o+=2){var s=e[o],l=e[o+1],u=o/2;i[u]=a.fromDegrees(s,l,0,t,i[u])}return i},a.fromRadiansArray=function(e,t,i){var n=e.length;r(i)?i.length=n/2:i=new Array(n/2);for(var o=0;o<n;o+=2){var s=e[o],l=e[o+1],u=o/2;i[u]=a.fromRadians(s,l,0,t,i[u])}return i},a.fromDegreesArrayHeights=function(e,t,i){var n=e.length;r(i)?i.length=n/3:i=new Array(n/3);for(var o=0;o<n;o+=3){var s=e[o],l=e[o+1],u=e[o+2],c=o/3;i[c]=a.fromDegrees(s,l,u,t,i[c])}return i},a.fromRadiansArrayHeights=function(e,t,i){var n=e.length;r(i)?i.length=n/3:i=new Array(n/3);for(var o=0;o<n;o+=3){var s=e[o],l=e[o+1],u=e[o+2],c=o/3;i[c]=a.fromRadians(s,l,u,t,i[c])}return i},a.ZERO=n(new a(0,0,0)),a.UNIT_X=n(new a(1,0,0)),a.UNIT_Y=n(new a(0,1,0)),a.UNIT_Z=n(new a(0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,r,i,n,o){"use strict";var a={};a.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var i=r.x,n=r.y;r.x=(1-Math.abs(n))*o.signNotZero(i),r.y=(1-Math.abs(i))*o.signNotZero(n)}return r.x=o.toSNorm(r.x,t),r.y=o.toSNorm(r.y,t),r},a.octEncode=function(e,t){return a.octEncodeInRange(e,255,t)},a.octDecodeInRange=function(e,r,i,n){if(n.x=o.fromSNorm(e,i),n.y=o.fromSNorm(r,i),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){var a=n.x;n.x=(1-Math.abs(n.y))*o.signNotZero(a),n.y=(1-Math.abs(a))*o.signNotZero(n.y)}return t.normalize(n,n)},a.octDecode=function(e,t,r){return a.octDecodeInRange(e,t,255,r)},a.octPackFloat=function(e){return 256*e.x+e.y};var s=new e;return a.octEncodeFloat=function(e){return a.octEncode(e,s),a.octPackFloat(s)},a.octDecodeFloat=function(e,t){var r=e/256,i=Math.floor(r),n=256*(r-i);return a.octDecode(i,n,t)},a.octPack=function(e,t,r,i){var n=a.octEncodeFloat(e),o=a.octEncodeFloat(t),l=a.octEncode(r,s);return i.x=65536*l.x+n,i.y=65536*l.y+o,i},a.octUnpack=function(e,t,r,i){var n=e.x/65536,o=Math.floor(n),s=65536*(n-o);n=e.y/65536;var l=Math.floor(n),u=65536*(n-l);a.octDecodeFloat(s,t),a.octDecodeFloat(u,r),a.octDecode(o,l,i)},a.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},a.decompressTextureCoordinates=function(e,t){var r=e/4096,i=Math.floor(r);return t.x=i/4095,t.y=(e-4096*i)/4095,t},a}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,r,i,n){"use strict";function o(t,n,o){this.minimum=e.clone(r(t,e.ZERO)),this.maximum=e.clone(r(n,e.ZERO)),i(o)?o=e.clone(o):(o=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(o,.5,o)),this.center=o}o.fromPoints=function(t,r){if(i(r)||(r=new o),!i(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var n=t[0].x,a=t[0].y,s=t[0].z,l=t[0].x,u=t[0].y,c=t[0].z,d=t.length,h=1;h<d;h++){var p=t[h],f=p.x,m=p.y,g=p.z;n=Math.min(f,n),l=Math.max(f,l),a=Math.min(m,a),u=Math.max(m,u),s=Math.min(g,s),c=Math.max(g,c)}var v=r.minimum;v.x=n,v.y=a,v.z=s;var _=r.maximum;_.x=l,_.y=u,_.z=c;var y=e.add(v,_,r.center);return e.multiplyByScalar(y,.5,y),r},o.clone=function(t,r){if(i(t))return i(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new o(t.minimum,t.maximum)},o.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var a=new e;return o.intersectPlane=function(t,r){a=e.subtract(t.maximum,t.minimum,a);var i=e.multiplyByScalar(a,.5,a),o=r.normal,s=i.x*Math.abs(o.x)+i.y*Math.abs(o.y)+i.z*Math.abs(o.z),l=e.dot(t.center,o)+r.distance;return l-s>0?n.INSIDE:l+s<0?n.OUTSIDE:n.INTERSECTING},o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.intersectPlane=function(e){return o.intersectPlane(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined"],function(e,t,r,i){"use strict";function n(r,n,l,u,c){i(c)||(c=new t);var d,h,p,f,m,g,v,_;i(n.z)?(d=t.subtract(l,n,o),h=t.subtract(u,n,a),p=t.subtract(r,n,s),f=t.dot(d,d),m=t.dot(d,h),g=t.dot(d,p),v=t.dot(h,h),_=t.dot(h,p)):(d=e.subtract(l,n,o),h=e.subtract(u,n,a),p=e.subtract(r,n,s),f=e.dot(d,d),m=e.dot(d,h),g=e.dot(d,p),v=e.dot(h,h),_=e.dot(h,p));var y=1/(f*v-m*m);return c.y=(v*g-m*_)*y,c.z=(f*_-m*g)*y,c.x=1-c.y-c.z,c}var o=new t,a=new t,s=new t;return n}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function r(e,t,r){for(var i,n,o=0,a=e.length-1;o<=a;)if(i=~~((o+a)/2),n=r(e[i],t),n<0)o=i+1;else{if(!(n>0))return i;a=i-1}return~(a+1)}return r}),define("Core/Credit",["./defined","./defineProperties","./DeveloperError"],function(e,t,r){"use strict";function i(t,r,i){var a=e(i),s=e(r),l=e(t);l||s||(t=i),this._text=t,this._imageUrl=r,this._link=i,this._hasLink=a,this._hasImage=s;var u,c=JSON.stringify([t,r,i]);e(o[c])?u=o[c]:(u=n++,o[c]=u),this._id=u}var n=0,o={};return t(i.prototype,{text:{get:function(){return this._text}},imageUrl:{get:function(){return this._imageUrl}},link:{get:function(){return this._link}},id:{get:function(){return this._id}}}),i.prototype.hasImage=function(){return this._hasImage},i.prototype.hasLink=function(){return this._hasLink},i.equals=function(t,r){return t===r||e(t)&&e(r)&&t._id===r._id},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/BingMapsApi",["./Credit","./defined"],function(e,t){"use strict";var r={};r.defaultKey=void 0;var i,n=!1,o="This application is using Cesium's default Bing Maps key. Please create a new key for the application as soon as possible and prior to deployment by visiting https://www.bingmapsportal.com/, and provide your key to Cesium by setting the Cesium.BingMapsApi.defaultKey property before constructing the CesiumWidget or any other object that uses the Bing Maps API.";return r.getKey=function(e){return t(e)?e:t(r.defaultKey)?r.defaultKey:(n||(console.log(o),n=!0),"AihaXS6TtE_olKOVdtkMenAMq1L5nDlnU69mRtNisz1vZavr1HhdqGRNkB2Bcqvs")},r.getErrorCredit=function(n){if(!t(n)&&!t(r.defaultKey))return t(i)||(i=new e(o)),i},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=i.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return o.test(t)?t:e.toUpperCase()}function r(e,t,r,i){return(t||"")+r.toLowerCase()+(i||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var i=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(a,r).replace(n,t)),this.path&&(this.path=this.path.replace(n,t)),this.query&&(this.query=this.query.replace(n,t)),this.fragment&&(this.fragment=this.fragment.replace(n,t))};var n=/%[0-9a-z]{2}/gi,o=/[a-zA-Z0-9\-\._~]/,a=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],i=""==t[0];i&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),i&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,i,n){return t(e).then(r,i,n)}function t(e){var t,r;return e instanceof i?t=e:s(e)?(r=a(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=n(e),t}function r(t){return e(t,o)}function i(e){this.then=e}function n(e){var r=new i(function(r){try{return t(r?r(e):e)}catch(e){return o(e)}});return r}function o(e){var r=new i(function(r,i){try{return i?t(i(e)):o(e)}catch(e){return o(e)}});return r}function a(){function e(e,t,r){return h(e,t,r)}function r(e){return f(e)}function n(e){return f(o(e))}function s(e){return p(e)}var l,u,c,d,h,p,f;return u=new i(e),l={then:e,resolve:r,reject:n,progress:s,promise:u,resolver:{resolve:r,reject:n,progress:s}},c=[],d=[],h=function(e,t,r){var i,n;return i=a(),n="function"==typeof r?function(e){try{i.progress(r(e))}catch(e){i.progress(e)}}:function(e){i.progress(e)},c.push(function(r){r.then(e,t).then(i.resolve,i.reject,n)}),d.push(n),i.promise},p=function(e){return m(d,e),e},f=function(e){return e=t(e),h=e.then,f=t,p=v,m(c,e),d=c=C,e},l}function s(e){return e&&"function"==typeof e.then}function l(t,r,i,n,o){return g(2,arguments),e(t,function(t){function s(e){m(e)}function l(e){f(e)}var u,c,d,h,p,f,m,g,_,y;if(_=t.length>>>0,u=Math.max(0,Math.min(r,_)),d=[],c=_-u+1,h=[],p=a(),u)for(g=p.progress,m=function(e){h.push(e),--c||(f=m=v,p.reject(h))},f=function(e){d.push(e),--u||(f=m=v,p.resolve(d))},y=0;y<_;++y)y in t&&e(t[y],l,s,g);else p.resolve(d);return p.then(i,n,o)})}function u(e,t,r,i){function n(e){return t?t(e[0]):e[0]}return l(e,1,n,r,i)}function c(e,t,r,i){return g(1,arguments),h(e,_).then(t,r,i)}function d(){return h(arguments,_)}function h(t,r){return e(t,function(t){var i,n,o,s,l,u;if(o=n=t.length>>>0,i=[],u=a(),o)for(s=function(t,n){e(t,r).then(function(e){i[n]=e,--o||u.resolve(i)},u.reject)},l=0;l<n;l++)l in t?s(t[l],l):--o;else u.resolve(i);return u.promise})}function p(t,r){var i=b.call(arguments,1);return e(t,function(t){var n;return n=t.length,i[0]=function(t,i,o){return e(t,function(t){return e(i,function(e){return r(t,e,o,n)})})},y.apply(t,i)})}function f(t,r,i){var n=arguments.length>2;return e(t,function(e){return e=n?i:e,r.resolve(e),e},function(e){return r.reject(e),o(e)},r.progress)}function m(e,t){for(var r,i=0;r=e[i++];)r(t)}function g(e,t){for(var r,i=t.length;i>e;)if(r=t[--i],null!=r&&"function"!=typeof r)throw new Error("arg "+i+" must be a function")}function v(){}function _(e){return e}var y,b,C;return e.defer=a,e.resolve=t,e.reject=r,e.join=d,e.all=c,e.map=h,e.reduce=p,e.any=u,e.some=l,e.chain=f,e.isPromise=s,i.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(C,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return c(t,function(t){return e.apply(C,t)})})}},b=[].slice,y=[].reduce||function(e){var t,r,i,n,o;if(o=0,t=Object(this),n=t.length>>>0,r=arguments,r.length<=1)for(;;){if(o in t){i=t[o++];break}if(++o>=n)throw new TypeError}else i=r[1];for(;o<n;++o)o in t&&(i=e(i,t[o],o,t));return i},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/combine",["./defaultValue","./defined"],function(e,t){"use strict";function r(i,n,o){o=e(o,!1);var a,s,l,u={},c=t(i),d=t(n);if(c)for(a in i)i.hasOwnProperty(a)&&(s=i[a],d&&o&&"object"==typeof s&&n.hasOwnProperty(a)?(l=n[a],"object"==typeof l?u[a]=r(s,l,o):u[a]=s):u[a]=s);if(d)for(a in n)n.hasOwnProperty(a)&&!u.hasOwnProperty(a)&&(l=n[a],u[a]=l);return u}return r}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/objectToQuery",["./defined","./DeveloperError","./isArray"],function(e,t,r){"use strict";function i(e){var t="";for(var i in e)if(e.hasOwnProperty(i)){var n=e[i],o=encodeURIComponent(i)+"=";if(r(n))for(var a=0,s=n.length;a<s;++a)t+=o+encodeURIComponent(n[a])+"&";else t+=o+encodeURIComponent(n)+"&"}return t=t.slice(0,-1)}return i}),define("Core/queryToObject",["./defined","./DeveloperError","./isArray"],function(e,t,r){"use strict";function i(t){var i={};if(""===t)return i;for(var n=t.replace(/\+/g,"%20").split("&"),o=0,a=n.length;o<a;++o){var s=n[o].split("="),l=decodeURIComponent(s[0]),u=s[1];u=e(u)?decodeURIComponent(u):"";var c=i[l];"string"==typeof c?i[l]=[c,u]:r(c)?c.push(u):i[l]=u}return i}return i}),define("Core/loadJsonp",["../ThirdParty/Uri","../ThirdParty/when","./combine","./defaultValue","./defined","./DeveloperError","./objectToQuery","./queryToObject"],function(e,t,r,i,n,o,a,s){"use strict";function l(o,u){u=i(u,i.EMPTY_OBJECT); +var c;do c="loadJsonp"+Math.random().toString().substring(2,8);while(n(window[c]));var d=t.defer();window[c]=function(e){d.resolve(e);try{delete window[c]}catch(e){window[c]=void 0}};var h=new e(o),p=s(i(h.query,""));n(u.parameters)&&(p=r(u.parameters,p));var f=i(u.callbackParameterName,"callback");p[f]=c,h.query=a(p),o=h.toString();var m=u.proxy;return n(m)&&(o=m.getURL(o)),l.loadAndExecuteScript(o,c,d),d.promise}return l.loadAndExecuteScript=function(e,t,r){var i=document.createElement("script");i.async=!0,i.src=e;var n=document.getElementsByTagName("head")[0];i.onload=function(){i.onload=void 0,n.removeChild(i)},i.onerror=function(e){r.reject(e)},n.appendChild(i)},l.defaultLoadAndExecuteScript=l.loadAndExecuteScript,l}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(r,n,s,l,u){var c=r.x,d=r.y,h=r.z,p=n.x,f=n.y,m=n.z,g=c*c*p*p,v=d*d*f*f,_=h*h*m*m,y=g+v+_,b=Math.sqrt(1/y),C=e.multiplyByScalar(r,b,o);if(y<l)return isFinite(b)?e.clone(C,u):void 0;var w=s.x,S=s.y,E=s.z,T=a;T.x=C.x*w*2,T.y=C.y*S*2,T.z=C.z*E*2;var x,P,A,D,I,M,O,R,N,k,L,F=(1-b)*e.magnitude(r)/(.5*e.magnitude(T)),B=0;do{F-=B,A=1/(1+F*w),D=1/(1+F*S),I=1/(1+F*E),M=A*A,O=D*D,R=I*I,N=M*A,k=O*D,L=R*I,x=g*M+v*O+_*R-1,P=g*N*w+v*k*S+_*L*E;var U=-2*P;B=x/U}while(Math.abs(x)>i.EPSILON12);return t(u)?(u.x=c*A,u.y=d*D,u.z=h*I,u):new e(c*A,d*D,h*I)}var o=new e,a=new e;return n}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,i){this.longitude=r(e,0),this.latitude=r(t,0),this.height=r(i,0)}s.fromRadians=function(e,t,n,o){return n=r(n,0),i(o)?(o.longitude=e,o.latitude=t,o.height=n,o):new s(e,t,n)},s.fromDegrees=function(e,t,r,i){return e=o.toRadians(e),t=o.toRadians(t),s.fromRadians(e,t,r,i)};var l=new e,u=new e,c=new e,d=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),p=o.EPSILON1;return s.fromCartesian=function(t,r,n){var f=i(r)?r.oneOverRadii:d,m=i(r)?r.oneOverRadiiSquared:h,g=i(r)?r._centerToleranceSquared:p,v=a(t,f,m,g,u);if(i(v)){var _=e.multiplyComponents(v,m,l);_=e.normalize(_,_);var y=e.subtract(t,v,c),b=Math.atan2(_.y,_.x),C=Math.asin(_.z),w=o.sign(e.dot(y,t))*e.magnitude(y);return i(n)?(n.longitude=b,n.latitude=C,n.height=w,n):new s(b,C,w)}},s.clone=function(e,t){if(i(e))return i(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new s(e.longitude,e.latitude,e.height)},s.equals=function(e,t){return e===t||i(e)&&i(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},s.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},s.ZERO=n(new s(0,0,0)),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},s}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t,i,n,o){i=r(i,0),n=r(n,0),o=r(o,0),t._radii=new e(i,n,o),t._radiiSquared=new e(i*i,n*n,o*o),t._radiiToTheFourth=new e(i*i*i*i,n*n*n*n,o*o*o*o),t._oneOverRadii=new e(0===i?0:1/i,0===n?0:1/n,0===o?0:1/o),t._oneOverRadiiSquared=new e(0===i?0:1/(i*i),0===n?0:1/(n*n),0===o?0:1/(o*o)),t._minimumRadius=Math.min(i,n,o),t._maximumRadius=Math.max(i,n,o),t._centerToleranceSquared=s.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,r){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._sqauredXOverSquaredZ=void 0,u(this,e,t,r)}n(c.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}}}),c.clone=function(t,r){if(i(t)){var n=t._radii;return i(r)?(e.clone(n,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new c(n.x,n.y,n.z)}},c.fromCartesian3=function(e,t){return i(t)||(t=new c),i(e)?(u(t,e.x,e.y,e.z),t):t},c.WGS84=a(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=a(new c(1,1,1)),c.MOON=a(new c(s.LUNAR_RADIUS,s.LUNAR_RADIUS,s.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,i,n){return n=r(n,0),e.pack(t._radii,i,n),i},c.unpack=function(t,i,n){i=r(i,0);var o=e.unpack(t,i);return c.fromCartesian3(o,n)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,r){var n=t.longitude,o=t.latitude,a=Math.cos(o),s=a*Math.cos(n),l=a*Math.sin(n),u=Math.sin(o);return i(r)||(r=new e),r.x=s,r.y=l,r.z=u,e.normalize(r,r)},c.prototype.geodeticSurfaceNormal=function(t,r){return i(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var d=new e,h=new e;c.prototype.cartographicToCartesian=function(t,r){var n=d,o=h;this.geodeticSurfaceNormalCartographic(t,n),e.multiplyComponents(this._radiiSquared,n,o);var a=Math.sqrt(e.dot(n,o));return e.divideByScalar(o,a,o),e.multiplyByScalar(n,t.height,n),i(r)||(r=new e),e.add(o,n,r)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var n=0;n<r;n++)t[n]=this.cartographicToCartesian(e[n],t[n]);return t};var p=new e,f=new e,m=new e;return c.prototype.cartesianToCartographic=function(r,n){var o=this.scaleToGeodeticSurface(r,f);if(i(o)){var a=this.geodeticSurfaceNormal(o,p),l=e.subtract(r,o,m),u=Math.atan2(a.y,a.x),c=Math.asin(a.z),d=s.sign(e.dot(l,r))*e.magnitude(l);return i(n)?(n.longitude=u,n.latitude=c,n.height=d,n):new t(u,c,d)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var n=0;n<r;++n)t[n]=this.cartesianToCartographic(e[n],t[n]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return l(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,r){i(r)||(r=new e);var n=t.x,o=t.y,a=t.z,s=this._oneOverRadiiSquared,l=1/Math.sqrt(n*n*s.x+o*o*s.y+a*a*s.z);return e.multiplyByScalar(t,l,r)},c.prototype.transformPositionToScaledSpace=function(t,r){return i(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(t,r){return i(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},c.prototype.equals=function(t){return this===t||i(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,n,o){n=r(n,0);var a=this._sqauredXOverSquaredZ;if(i(o)||(o=new e),o.x=0,o.y=0,o.z=t.z*(1-a),!(Math.abs(o.z)>=this._radii.z-n))return o},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i,n){this.west=r(e,0),this.south=r(t,0),this.east=r(i,0),this.north=r(n,0)}n(l.prototype,{width:{get:function(){return l.computeWidth(this)}},height:{get:function(){return l.computeHeight(this)}}}),l.packedLength=4,l.pack=function(e,t,i){return i=r(i,0),t[i++]=e.west,t[i++]=e.south,t[i++]=e.east,t[i]=e.north,t},l.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new l),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n},l.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=s.TWO_PI),t-r},l.computeHeight=function(e){return e.north-e.south},l.fromDegrees=function(e,t,n,o,a){return e=s.toRadians(r(e,0)),t=s.toRadians(r(t,0)),n=s.toRadians(r(n,0)),o=s.toRadians(r(o,0)),i(a)?(a.west=e,a.south=t,a.east=n,a.north=o,a):new l(e,t,n,o)},l.fromRadians=function(e,t,n,o,a){return i(a)?(a.west=r(e,0),a.south=r(t,0),a.east=r(n,0),a.north=r(o,0),a):new l(e,t,n,o)},l.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,a=-Number.MAX_VALUE,u=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var p=e[d];r=Math.min(r,p.longitude),n=Math.max(n,p.longitude),u=Math.min(u,p.latitude),c=Math.max(c,p.latitude);var f=p.longitude>=0?p.longitude:p.longitude+s.TWO_PI;o=Math.min(o,f),a=Math.max(a,f)}return n-r>a-o&&(r=o,n=a,n>s.PI&&(n-=s.TWO_PI),r>s.PI&&(r-=s.TWO_PI)),i(t)?(t.west=r,t.south=u,t.east=n,t.north=c,t):new l(r,u,n,c)},l.fromCartesianArray=function(e,t,r){for(var n=Number.MAX_VALUE,o=-Number.MAX_VALUE,a=Number.MAX_VALUE,u=-Number.MAX_VALUE,c=Number.MAX_VALUE,d=-Number.MAX_VALUE,h=0,p=e.length;h<p;h++){var f=t.cartesianToCartographic(e[h]);n=Math.min(n,f.longitude),o=Math.max(o,f.longitude),c=Math.min(c,f.latitude),d=Math.max(d,f.latitude);var m=f.longitude>=0?f.longitude:f.longitude+s.TWO_PI;a=Math.min(a,m),u=Math.max(u,m)}return o-n>u-a&&(n=a,o=u,o>s.PI&&(o-=s.TWO_PI),n>s.PI&&(n-=s.TWO_PI)),i(r)?(r.west=n,r.south=c,r.east=o,r.north=d,r):new l(n,c,o,d)},l.clone=function(e,t){if(i(e))return i(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new l(e.west,e.south,e.east,e.north)},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},l.prototype.equalsEpsilon=function(e,t){return i(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},l.validate=function(e){},l.southwest=function(t,r){return i(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},l.northwest=function(t,r){return i(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},l.northeast=function(t,r){return i(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},l.southeast=function(t,r){return i(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},l.center=function(t,r){var n=t.east,o=t.west;n<o&&(n+=s.TWO_PI);var a=s.negativePiToPi(.5*(o+n)),l=.5*(t.south+t.north);return i(r)?(r.longitude=a,r.latitude=l,r.height=0,r):new e(a,l)},l.intersection=function(e,t,r){var n=e.east,o=e.west,a=t.east,u=t.west;n<o&&a>0?n+=s.TWO_PI:a<u&&n>0&&(a+=s.TWO_PI),n<o&&u<0?u+=s.TWO_PI:a<u&&o<0&&(o+=s.TWO_PI);var c=s.negativePiToPi(Math.max(o,u)),d=s.negativePiToPi(Math.min(n,a));if(!((e.west<e.east||t.west<t.east)&&d<=c)){var h=Math.max(e.south,t.south),p=Math.min(e.north,t.north);if(!(h>=p))return i(r)?(r.west=c,r.south=h,r.east=d,r.north=p,r):new l(c,h,d,p)}},l.simpleIntersection=function(e,t,r){var n=Math.max(e.west,t.west),o=Math.max(e.south,t.south),a=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||n>=a))return i(r)?(r.west=n,r.south=o,r.east=a,r.north=s,r):new l(n,o,a,s)},l.union=function(e,t,r){i(r)||(r=new l);var n=e.east,o=e.west,a=t.east,u=t.west;n<o&&a>0?n+=s.TWO_PI:a<u&&n>0&&(a+=s.TWO_PI),n<o&&u<0?u+=s.TWO_PI:a<u&&o<0&&(o+=s.TWO_PI);var c=s.convertLongitudeRange(Math.min(o,u)),d=s.convertLongitudeRange(Math.max(n,a));return r.west=c,r.south=Math.min(e.south,t.south),r.east=d,r.north=Math.max(e.north,t.north),r},l.expand=function(e,t,r){return i(r)||(r=new l),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},l.contains=function(e,t){var r=t.longitude,i=t.latitude,n=e.west,o=e.east;return o<n&&(o+=s.TWO_PI,r<0&&(r+=s.TWO_PI)),(r>n||s.equalsEpsilon(r,n,s.EPSILON14))&&(r<o||s.equalsEpsilon(r,o,s.EPSILON14))&&i>=e.south&&i<=e.north};var u=new e;return l.subsample=function(e,t,n,a){t=r(t,o.WGS84),n=r(n,0),i(a)||(a=[]);var c=0,d=e.north,h=e.south,p=e.east,f=e.west,m=u;m.height=n,m.longitude=f,m.latitude=d,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=p,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.latitude=h,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=f,a[c]=t.cartographicToCartesian(m,a[c]),c++,d<0?m.latitude=d:h>0?m.latitude=h:m.latitude=0;for(var g=1;g<8;++g)m.longitude=-Math.PI+g*s.PI_OVER_TWO,l.contains(e,m)&&(a[c]=t.cartographicToCartesian(m,a[c]),c++);return 0===m.latitude&&(m.longitude=f,a[c]=t.cartographicToCartesian(m,a[c]),c++,m.longitude=p,a[c]=t.cartographicToCartesian(m,a[c]),c++),a.length=c,a},l.MAX_VALUE=a(new l(-Math.PI,-s.PI_OVER_TWO,Math.PI,s.PI_OVER_TWO)),l}),define("Core/BingMapsGeocoderService",["./BingMapsApi","./Check","./defaultValue","./defined","./defineProperties","./loadJsonp","./Rectangle"],function(e,t,r,i,n,o,a){"use strict";function s(t){t=r(t,r.EMPTY_OBJECT);var n=t.key;if(this._key=e.getKey(n),i(n)){var o=e.getErrorCredit(n);i(o)&&t.scene._frameState.creditDisplay.addDefaultCredit(o)}}var l="https://dev.virtualearth.net/REST/v1/Locations";return n(s.prototype,{url:{get:function(){return l}},key:{get:function(){return this._key}}}),s.prototype.geocode=function(e){var t=this.key,r=o(l,{parameters:{query:e,key:t},callbackParameterName:"jsonp"});return r.then(function(e){if(0===e.resourceSets.length)return[];var t=e.resourceSets[0].resources;return t.map(function(e){var t=e.bbox,r=t[0],i=t[1],n=t[2],o=t[3];return{displayName:e.name,destination:a.fromDegrees(i,r,o,n)}})})},s}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,i,n,o,a){"use strict";function s(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.prototype.project=function(t,r){var n=this._semimajorAxis,o=t.longitude*n,a=t.latitude*n,s=t.height;return i(r)?(r.x=o,r.y=a,r.z=s,r):new e(o,a,s)},s.prototype.unproject=function(e,r){var n=this._oneOverSemimajorAxis,o=e.x*n,a=e.y*n,s=e.z;return i(r)?(r.longitude=o,r.latitude=a,r.height=s,r):new t(o,a,s)},s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r,n){this.x=i(e,0),this.y=i(t,0),this.width=i(r,0),this.height=i(n,0)}l.packedLength=4,l.pack=function(e,t,r){return r=i(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.width,t[r]=e.height,t},l.unpack=function(e,t,r){return t=i(t,0),n(r)||(r=new l),r.x=e[t++],r.y=e[t++],r.width=e[t++],r.height=e[t],r},l.fromPoints=function(e,t){if(n(t)||(t=new l),!n(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var r=e.length,i=e[0].x,o=e[0].y,a=e[0].x,s=e[0].y,u=1;u<r;u++){var c=e[u],d=c.x,h=c.y;i=Math.min(d,i),a=Math.max(d,a),o=Math.min(h,o),s=Math.max(h,s)}return t.x=i,t.y=o,t.width=a-i,t.height=s-o,t};var u=new o,c=new t,d=new t;return l.fromRectangle=function(t,r,o){if(n(o)||(o=new l),!n(t))return o.x=0,o.y=0,o.width=0,o.height=0,o;r=i(r,u);var a=r.project(s.southwest(t,c)),h=r.project(s.northeast(t,d));return e.subtract(h,a,h),o.x=a.x,o.y=a.y,o.width=h.x,o.height=h.y,o},l.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new l(e.x,e.y,e.width,e.height)},l.union=function(e,t,r){n(r)||(r=new l);var i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),a=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return r.x=i,r.y=o,r.width=a-i,r.height=s-o,r},l.expand=function(e,t,r){r=l.clone(e,r);var i=t.x-r.x,n=t.y-r.y;return i>r.width?r.width=i:i<0&&(r.width-=i,r.x=t.x),n>r.height?r.height=n:n<0&&(r.height-=n,r.y=t.y),r},l.intersect=function(e,t){var r=e.x,i=e.y,n=t.x,o=t.y;return r>n+t.width||r+e.width<n||i+e.height<o||i>o+t.height?a.OUTSIDE:a.INTERSECTING},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.intersect=function(e){return l.intersect(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,i,n,o,a,s,l,u){this[0]=r(e,0),this[1]=r(n,0),this[2]=r(s,0),this[3]=r(t,0),this[4]=r(o,0),this[5]=r(l,0),this[6]=r(i,0),this[7]=r(a,0),this[8]=r(u,0)}function u(e){for(var t=0,r=0;r<9;++r){var i=e[r];t+=i*i}return Math.sqrt(t)}function c(e){for(var t=0,r=0;r<3;++r){var i=e[l.getElementIndex(m[r],f[r])];t+=2*i*i}return Math.sqrt(t)}function d(e,t){for(var r=s.EPSILON15,i=0,n=1,o=0;o<3;++o){var a=Math.abs(e[l.getElementIndex(m[o],f[o])]);a>i&&(n=o,i=a)}var u=1,c=0,d=f[n],h=m[n];if(Math.abs(e[l.getElementIndex(h,d)])>r){var p,g=e[l.getElementIndex(h,h)],v=e[l.getElementIndex(d,d)],_=e[l.getElementIndex(h,d)],y=(g-v)/2/_;p=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),u=1/Math.sqrt(1+p*p),c=p*u}return t=l.clone(l.IDENTITY,t),t[l.getElementIndex(d,d)]=t[l.getElementIndex(h,h)]=u,t[l.getElementIndex(h,d)]=c,t[l.getElementIndex(d,h)]=-c,t}l.packedLength=9,l.pack=function(e,t,i){return i=r(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t[i++]=e[4],t[i++]=e[5],t[i++]=e[6],t[i++]=e[7],t[i++]=e[8],t},l.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n},l.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new l(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},l.fromArray=function(e,t,n){return t=r(t,0),i(n)||(n=new l),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n[4]=e[t+4],n[5]=e[t+5],n[6]=e[t+6],n[7]=e[t+7],n[8]=e[t+8],n},l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},l.fromQuaternion=function(e,t){var r=e.x*e.x,n=e.x*e.y,o=e.x*e.z,a=e.x*e.w,s=e.y*e.y,u=e.y*e.z,c=e.y*e.w,d=e.z*e.z,h=e.z*e.w,p=e.w*e.w,f=r-s-d+p,m=2*(n-h),g=2*(o+c),v=2*(n+h),_=-r+s-d+p,y=2*(u-a),b=2*(o-c),C=2*(u+a),w=-r-s+d+p;return i(t)?(t[0]=f,t[1]=v,t[2]=b,t[3]=m,t[4]=_,t[5]=C,t[6]=g,t[7]=y,t[8]=w,t):new l(f,m,g,v,_,y,b,C,w)},l.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),n=Math.cos(-e.heading),o=Math.cos(e.roll),a=Math.sin(-e.pitch),s=Math.sin(-e.heading),u=Math.sin(e.roll),c=r*n,d=-o*s+u*a*n,h=u*s+o*a*n,p=r*s,f=o*n+u*a*s,m=-u*n+o*a*s,g=-a,v=u*r,_=o*r;return i(t)?(t[0]=c,t[1]=p,t[2]=g,t[3]=d,t[4]=f,t[5]=v,t[6]=h,t[7]=m,t[8]=_,t):new l(c,d,h,p,f,m,g,v,_)},l.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new l(e.x,0,0,0,e.y,0,0,0,e.z)},l.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new l(e,0,0,0,e,0,0,0,e)},l.fromCrossProduct=function(e,t){return i(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new l(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},l.fromRotationX=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=n,t[6]=0,t[7]=-n,t[8]=r,t):new l(1,0,0,0,r,-n,0,n,r)},l.fromRotationY=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=1,t[5]=0,t[6]=n,t[7]=0,t[8]=r,t):new l(r,0,n,0,1,0,-n,0,r)},l.fromRotationZ=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=0,t[3]=-n,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new l(r,-n,0,n,r,0,0,0,1)},l.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},l.getElementIndex=function(e,t){return 3*e+t},l.getColumn=function(e,t,r){var i=3*t,n=e[i],o=e[i+1],a=e[i+2];return r.x=n,r.y=o,r.z=a,r},l.setColumn=function(e,t,r,i){i=l.clone(e,i);var n=3*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i},l.getRow=function(e,t,r){var i=e[t],n=e[t+3],o=e[t+6];return r.x=i,r.y=n,r.z=o,r},l.setRow=function(e,t,r,i){return i=l.clone(e,i),i[t]=r.x,i[t+3]=r.y,i[t+6]=r.z,i};var h=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),r};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,r){var i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],n=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],o=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=i,r[1]=n,r[2]=o,r[3]=a,r[4]=s,r[5]=l,r[6]=u,r[7]=c,r[8]=d,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},l.multiplyByVector=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=e[0]*i+e[3]*n+e[6]*o,s=e[1]*i+e[4]*n+e[7]*o,l=e[2]*i+e[5]*n+e[8]*o;return r.x=a,r.y=s,r.z=l,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},l.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},l.transpose=function(e,t){var r=e[0],i=e[3],n=e[6],o=e[1],a=e[4],s=e[7],l=e[2],u=e[5],c=e[8];return t[0]=r,t[1]=i,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=l,t[7]=u,t[8]=c,t};var f=[1,0,0],m=[2,2,1],g=new l,v=new l;return l.computeEigenDecomposition=function(e,t){var r=s.EPSILON20,n=10,o=0,a=0;i(t)||(t={});for(var h=t.unitary=l.clone(l.IDENTITY,t.unitary),p=t.diagonal=l.clone(e,t.diagonal),f=r*u(p);a<n&&c(p)>f;)d(p,g),l.transpose(g,v),l.multiply(p,g,p),l.multiply(v,p,p),l.multiply(h,g,h),++o>2&&(++a,o=0);return t},l.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},l.determinant=function(e){var t=e[0],r=e[3],i=e[6],n=e[1],o=e[4],a=e[7],s=e[2],l=e[5],u=e[8];return t*(o*u-l*a)+n*(l*i-r*u)+s*(r*a-o*i)},l.inverse=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],d=e[8],h=l.determinant(e);t[0]=a*d-c*s,t[1]=c*n-i*d,t[2]=i*s-a*n,t[3]=u*s-o*d,t[4]=r*d-u*n,t[5]=o*n-r*s,t[6]=o*c-u*a,t[7]=u*i-r*c,t[8]=r*a-o*i;var p=1/h;return l.multiplyByScalar(t,p,t)},l.equals=function(e,t){return e===t||i(e)&&i(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]},l.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},l.IDENTITY=a(new l(1,0,0,0,1,0,0,0,1)),l.ZERO=a(new l(0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN1ROW0=3,l.COLUMN1ROW1=4,l.COLUMN1ROW2=5,l.COLUMN2ROW0=6,l.COLUMN2ROW1=7,l.COLUMN2ROW2=8,n(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},l}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,r,i,n){this.x=t(e,0),this.y=t(r,0),this.z=t(i,0),this.w=t(n,0)}a.fromElements=function(e,t,i,n,o){return r(o)?(o.x=e,o.y=t,o.z=i,o.w=n,o):new a(e,t,i,n)},a.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new a(e.red,e.green,e.blue,e.alpha)},a.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new a(e.x,e.y,e.z,e.w)},a.packedLength=4,a.pack=function(e,r,i){return i=t(i,0),r[i++]=e.x,r[i++]=e.y,r[i++]=e.z,r[i]=e.w,r},a.unpack=function(e,i,n){return i=t(i,0),r(n)||(n=new a),n.x=e[i++],n.y=e[i++],n.z=e[i++],n.w=e[i],n},a.packArray=function(e,t){var i=e.length;r(t)?t.length=4*i:t=new Array(4*i);for(var n=0;n<i;++n)a.pack(e[n],t,4*n);return t},a.unpackArray=function(e,t){var i=e.length;r(t)?t.length=i/4:t=new Array(i/4);for(var n=0;n<i;n+=4){var o=n/4;t[o]=a.unpack(e,n,t[o])}return t},a.fromArray=a.unpack,a.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},a.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},a.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},a.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},a.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},a.magnitude=function(e){return Math.sqrt(a.magnitudeSquared(e))};var s=new a;a.distance=function(e,t){return a.subtract(e,t,s),a.magnitude(s)},a.distanceSquared=function(e,t){return a.subtract(e,t,s),a.magnitudeSquared(s)},a.normalize=function(e,t){var r=a.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},a.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},a.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},a.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},a.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},a.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},a.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},a.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},a.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},a.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var l=new a;a.lerp=function(e,t,r,i){return a.multiplyByScalar(t,r,l),i=a.multiplyByScalar(e,1-r,i),a.add(l,i,i)};var u=new a;return a.mostOrthogonalAxis=function(e,t){var r=a.normalize(e,u);return a.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?a.clone(a.UNIT_X,t):a.clone(a.UNIT_W,t):r.z<=r.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t):r.y<=r.z?r.y<=r.w?a.clone(a.UNIT_Y,t):a.clone(a.UNIT_W,t):r.z<=r.w?a.clone(a.UNIT_Z,t):a.clone(a.UNIT_W,t)},a.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},a.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},a.equalsEpsilon=function(e,t,i,n){return e===t||r(e)&&r(t)&&o.equalsEpsilon(e.x,t.x,i,n)&&o.equalsEpsilon(e.y,t.y,i,n)&&o.equalsEpsilon(e.z,t.z,i,n)&&o.equalsEpsilon(e.w,t.w,i,n)},a.ZERO=n(new a(0,0,0,0)),a.UNIT_X=n(new a(1,0,0,0)),a.UNIT_Y=n(new a(0,1,0,0)),a.UNIT_Z=n(new a(0,0,1,0)),a.UNIT_W=n(new a(0,0,0,1)),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},a}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r,n,o,a,s,l,u,c,d,h,p,f,m,g){this[0]=i(e,0),this[1]=i(o,0),this[2]=i(u,0),this[3]=i(p,0),this[4]=i(t,0),this[5]=i(a,0),this[6]=i(c,0),this[7]=i(f,0),this[8]=i(r,0),this[9]=i(s,0),this[10]=i(d,0),this[11]=i(m,0),this[12]=i(n,0),this[13]=i(l,0),this[14]=i(h,0),this[15]=i(g,0)}c.packedLength=16,c.pack=function(e,t,r){return r=i(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},c.unpack=function(e,t,r){return t=i(t,0),n(r)||(r=new c),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},c.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,r,o){return r=i(r,e.ZERO),n(o)?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=0,o[4]=t[3],o[5]=t[4],o[6]=t[5],o[7]=0,o[8]=t[6],o[9]=t[7],o[10]=t[8],o[11]=0,o[12]=r.x,o[13]=r.y,o[14]=r.z,o[15]=1,o):new c(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,r,i){n(i)||(i=new c);var o=r.x,a=r.y,s=r.z,l=t.x*t.x,u=t.x*t.y,d=t.x*t.z,h=t.x*t.w,p=t.y*t.y,f=t.y*t.z,m=t.y*t.w,g=t.z*t.z,v=t.z*t.w,_=t.w*t.w,y=l-p-g+_,b=2*(u-v),C=2*(d+m),w=2*(u+v),S=-l+p-g+_,E=2*(f-h),T=2*(d-m),x=2*(f+h),P=-l-p+g+_;return i[0]=y*o,i[1]=w*o,i[2]=T*o,i[3]=0,i[4]=b*a,i[5]=S*a,i[6]=x*a,i[7]=0,i[8]=C*s,i[9]=E*s,i[10]=P*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t); +},c.fromTranslation=function(e,t){return c.fromRotationTranslation(l.IDENTITY,e,t)},c.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var d=new e,h=new e,p=new e;c.fromCamera=function(t,r){var i=t.position,o=t.direction,a=t.up;e.normalize(o,d),e.normalize(e.cross(d,a,h),h),e.normalize(e.cross(h,d,p),p);var s=h.x,l=h.y,u=h.z,f=d.x,m=d.y,g=d.z,v=p.x,_=p.y,y=p.z,b=i.x,C=i.y,w=i.z,S=s*-b+l*-C+u*-w,E=v*-b+_*-C+y*-w,T=f*b+m*C+g*w;return n(r)?(r[0]=s,r[1]=v,r[2]=-f,r[3]=0,r[4]=l,r[5]=_,r[6]=-m,r[7]=0,r[8]=u,r[9]=y,r[10]=-g,r[11]=0,r[12]=S,r[13]=E,r[14]=T,r[15]=1,r):new c(s,l,u,S,v,_,y,E,-f,-m,-g,T,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,r,i,n){var o=Math.tan(.5*e),a=1/o,s=a/t,l=(i+r)/(r-i),u=2*i*r/(r-i);return n[0]=s,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=a,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=l,n[11]=-1,n[12]=0,n[13]=0,n[14]=u,n[15]=0,n},c.computeOrthographicOffCenter=function(e,t,r,i,n,o,a){var s=1/(t-e),l=1/(i-r),u=1/(o-n),c=-(t+e)*s,d=-(i+r)*l,h=-(o+n)*u;return s*=2,l*=2,u*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=0,a[12]=c,a[13]=d,a[14]=h,a[15]=1,a},c.computePerspectiveOffCenter=function(e,t,r,i,n,o,a){var s=2*n/(t-e),l=2*n/(i-r),u=(t+e)/(t-e),c=(i+r)/(i-r),d=-(o+n)/(o-n),h=-1,p=-2*o*n/(o-n);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=u,a[9]=c,a[10]=d,a[11]=h,a[12]=0,a[13]=0,a[14]=p,a[15]=0,a},c.computeInfinitePerspectiveOffCenter=function(e,t,r,i,n,o){var a=2*n/(t-e),s=2*n/(i-r),l=(t+e)/(t-e),u=(i+r)/(i-r),c=-1,d=-1,h=-2*n;return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=l,o[9]=u,o[10]=c,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},c.computeViewportTransformation=function(e,t,r,n){e=i(e,i.EMPTY_OBJECT);var o=i(e.x,0),a=i(e.y,0),s=i(e.width,0),l=i(e.height,0);t=i(t,0),r=i(r,1);var u=.5*s,c=.5*l,d=.5*(r-t),h=u,p=c,f=d,m=o+u,g=a+c,v=t+d,_=1;return n[0]=h,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=p,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=f,n[11]=0,n[12]=m,n[13]=g,n[14]=v,n[15]=_,n},c.computeView=function(t,r,i,n,o){return o[0]=n.x,o[1]=i.x,o[2]=-r.x,o[3]=0,o[4]=n.y,o[5]=i.y,o[6]=-r.y,o[7]=0,o[8]=n.z,o[9]=i.z,o[10]=-r.z,o[11]=0,o[12]=-e.dot(n,t),o[13]=-e.dot(i,t),o[14]=e.dot(r,t),o[15]=1,o},c.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,r){var i=4*t,n=e[i],o=e[i+1],a=e[i+2],s=e[i+3];return r.x=n,r.y=o,r.z=a,r.w=s,r},c.setColumn=function(e,t,r,i){i=c.clone(e,i);var n=4*t;return i[n]=r.x,i[n+1]=r.y,i[n+2]=r.z,i[n+3]=r.w,i},c.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},c.getRow=function(e,t,r){var i=e[t],n=e[t+4],o=e[t+8],a=e[t+12];return r.x=i,r.y=n,r.z=o,r.w=a,r},c.setRow=function(e,t,r,i){return i=c.clone(e,i),i[t]=r.x,i[t+4]=r.y,i[t+8]=r.z,i[t+12]=r.w,i};var f=new e;c.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],f)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],f)),r};var m=new e;c.getMaximumScale=function(t){return c.getScale(t,m),e.maximumComponent(m)},c.multiply=function(e,t,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],l=e[5],u=e[6],c=e[7],d=e[8],h=e[9],p=e[10],f=e[11],m=e[12],g=e[13],v=e[14],_=e[15],y=t[0],b=t[1],C=t[2],w=t[3],S=t[4],E=t[5],T=t[6],x=t[7],P=t[8],A=t[9],D=t[10],I=t[11],M=t[12],O=t[13],R=t[14],N=t[15],k=i*y+s*b+d*C+m*w,L=n*y+l*b+h*C+g*w,F=o*y+u*b+p*C+v*w,B=a*y+c*b+f*C+_*w,U=i*S+s*E+d*T+m*x,V=n*S+l*E+h*T+g*x,z=o*S+u*E+p*T+v*x,G=a*S+c*E+f*T+_*x,H=i*P+s*A+d*D+m*I,W=n*P+l*A+h*D+g*I,j=o*P+u*A+p*D+v*I,q=a*P+c*A+f*D+_*I,Y=i*M+s*O+d*R+m*N,X=n*M+l*O+h*R+g*N,Q=o*M+u*O+p*R+v*N,Z=a*M+c*O+f*R+_*N;return r[0]=k,r[1]=L,r[2]=F,r[3]=B,r[4]=U,r[5]=V,r[6]=z,r[7]=G,r[8]=H,r[9]=W,r[10]=j,r[11]=q,r[12]=Y,r[13]=X,r[14]=Q,r[15]=Z,r},c.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},c.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},c.multiplyTransformation=function(e,t,r){var i=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],d=e[10],h=e[12],p=e[13],f=e[14],m=t[0],g=t[1],v=t[2],_=t[4],y=t[5],b=t[6],C=t[8],w=t[9],S=t[10],E=t[12],T=t[13],x=t[14],P=i*m+a*g+u*v,A=n*m+s*g+c*v,D=o*m+l*g+d*v,I=i*_+a*y+u*b,M=n*_+s*y+c*b,O=o*_+l*y+d*b,R=i*C+a*w+u*S,N=n*C+s*w+c*S,k=o*C+l*w+d*S,L=i*E+a*T+u*x+h,F=n*E+s*T+c*x+p,B=o*E+l*T+d*x+f;return r[0]=P,r[1]=A,r[2]=D,r[3]=0,r[4]=I,r[5]=M,r[6]=O,r[7]=0,r[8]=R,r[9]=N,r[10]=k,r[11]=0,r[12]=L,r[13]=F,r[14]=B,r[15]=1,r},c.multiplyByMatrix3=function(e,t,r){var i=e[0],n=e[1],o=e[2],a=e[4],s=e[5],l=e[6],u=e[8],c=e[9],d=e[10],h=t[0],p=t[1],f=t[2],m=t[3],g=t[4],v=t[5],_=t[6],y=t[7],b=t[8],C=i*h+a*p+u*f,w=n*h+s*p+c*f,S=o*h+l*p+d*f,E=i*m+a*g+u*v,T=n*m+s*g+c*v,x=o*m+l*g+d*v,P=i*_+a*y+u*b,A=n*_+s*y+c*b,D=o*_+l*y+d*b;return r[0]=C,r[1]=w,r[2]=S,r[3]=0,r[4]=E,r[5]=T,r[6]=x,r[7]=0,r[8]=P,r[9]=A,r[10]=D,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},c.multiplyByTranslation=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=i*e[0]+n*e[4]+o*e[8]+e[12],s=i*e[1]+n*e[5]+o*e[9]+e[13],l=i*e[2]+n*e[6]+o*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=a,r[13]=s,r[14]=l,r[15]=e[15],r};var g=new e;c.multiplyByUniformScale=function(e,t,r){return g.x=t,g.y=t,g.z=t,c.multiplyByScale(e,g,r)},c.multiplyByScale=function(e,t,r){var i=t.x,n=t.y,o=t.z;return 1===i&&1===n&&1===o?c.clone(e,r):(r[0]=i*e[0],r[1]=i*e[1],r[2]=i*e[2],r[3]=0,r[4]=n*e[4],r[5]=n*e[5],r[6]=n*e[6],r[7]=0,r[8]=o*e[8],r[9]=o*e[9],r[10]=o*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},c.multiplyByVector=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=t.w,s=e[0]*i+e[4]*n+e[8]*o+e[12]*a,l=e[1]*i+e[5]*n+e[9]*o+e[13]*a,u=e[2]*i+e[6]*n+e[10]*o+e[14]*a,c=e[3]*i+e[7]*n+e[11]*o+e[15]*a;return r.x=s,r.y=l,r.z=u,r.w=c,r},c.multiplyByPointAsVector=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=e[0]*i+e[4]*n+e[8]*o,s=e[1]*i+e[5]*n+e[9]*o,l=e[2]*i+e[6]*n+e[10]*o;return r.x=a,r.y=s,r.z=l,r},c.multiplyByPoint=function(e,t,r){var i=t.x,n=t.y,o=t.z,a=e[0]*i+e[4]*n+e[8]*o+e[12],s=e[1]*i+e[5]*n+e[9]*o+e[13],l=e[2]*i+e[6]*n+e[10]*o+e[14];return r.x=a,r.y=s,r.z=l,r},c.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var r=e[1],i=e[2],n=e[3],o=e[6],a=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=o,t[10]=e[10],t[11]=e[14],t[12]=n,t[13]=a,t[14]=s,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||n(e)&&n(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var v=new l,_=new l,y=new t,b=new t(0,0,0,1);return c.inverse=function(e,r){if(l.equalsEpsilon(c.getRotation(e,v),_,s.EPSILON7)&&t.equals(c.getRow(e,3,y),b))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var i=e[0],n=e[4],o=e[8],a=e[12],d=e[1],h=e[5],p=e[9],f=e[13],m=e[2],g=e[6],C=e[10],w=e[14],S=e[3],E=e[7],T=e[11],x=e[15],P=C*x,A=w*T,D=g*x,I=w*E,M=g*T,O=C*E,R=m*x,N=w*S,k=m*T,L=C*S,F=m*E,B=g*S,U=P*h+I*p+M*f-(A*h+D*p+O*f),V=A*d+R*p+L*f-(P*d+N*p+k*f),z=D*d+N*h+F*f-(I*d+R*h+B*f),G=O*d+k*h+B*p-(M*d+L*h+F*p),H=A*n+D*o+O*a-(P*n+I*o+M*a),W=P*i+N*o+k*a-(A*i+R*o+L*a),j=I*i+R*n+B*a-(D*i+N*n+F*a),q=M*i+L*n+F*o-(O*i+k*n+B*o);P=o*f,A=a*p,D=n*f,I=a*h,M=n*p,O=o*h,R=i*f,N=a*d,k=i*p,L=o*d,F=i*h,B=n*d;var Y=P*E+I*T+M*x-(A*E+D*T+O*x),X=A*S+R*T+L*x-(P*S+N*T+k*x),Q=D*S+N*E+F*x-(I*S+R*E+B*x),Z=O*S+k*E+B*T-(M*S+L*E+F*T),K=D*C+O*w+A*g-(M*w+P*g+I*C),J=k*w+P*m+N*C-(R*C+L*w+A*m),$=R*g+B*w+I*m-(F*w+D*m+N*g),ee=F*C+M*m+L*g-(k*g+B*C+O*m),te=i*U+n*V+o*z+a*G;if(Math.abs(te)<s.EPSILON20)throw new u("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=U*te,r[1]=V*te,r[2]=z*te,r[3]=G*te,r[4]=H*te,r[5]=W*te,r[6]=j*te,r[7]=q*te,r[8]=Y*te,r[9]=X*te,r[10]=Q*te,r[11]=Z*te,r[12]=K*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},c.inverseTransformation=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[4],a=e[5],s=e[6],l=e[8],u=e[9],c=e[10],d=e[12],h=e[13],p=e[14],f=-r*d-i*h-n*p,m=-o*d-a*h-s*p,g=-l*d-u*h-c*p;return t[0]=r,t[1]=o,t[2]=l,t[3]=0,t[4]=i,t[5]=a,t[6]=u,t[7]=0,t[8]=n,t[9]=s,t[10]=c,t[11]=0,t[12]=f,t[13]=m,t[14]=g,t[15]=1,t},c.IDENTITY=a(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=a(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,o(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r){this.center=e.clone(i(t,e.ZERO)),this.radius=i(r,0)}var p=new e,f=new e,m=new e,g=new e,v=new e,_=new e,y=new e,b=new e,C=new e,w=new e,S=new e,E=new e;h.fromPoints=function(t,r){if(n(r)||(r=new h),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var i=e.clone(t[0],y),o=e.clone(i,p),a=e.clone(i,f),s=e.clone(i,m),l=e.clone(i,g),u=e.clone(i,v),c=e.clone(i,_),d=t.length,T=1;T<d;T++){e.clone(t[T],i);var x=i.x,P=i.y,A=i.z;x<o.x&&e.clone(i,o),x>l.x&&e.clone(i,l),P<a.y&&e.clone(i,a),P>u.y&&e.clone(i,u),A<s.z&&e.clone(i,s),A>c.z&&e.clone(i,c)}var D=e.magnitudeSquared(e.subtract(l,o,b)),I=e.magnitudeSquared(e.subtract(u,a,b)),M=e.magnitudeSquared(e.subtract(c,s,b)),O=o,R=l,N=D;I>N&&(N=I,O=a,R=u),M>N&&(N=M,O=s,R=c);var k=C;k.x=.5*(O.x+R.x),k.y=.5*(O.y+R.y),k.z=.5*(O.z+R.z);var L=e.magnitudeSquared(e.subtract(R,k,b)),F=Math.sqrt(L),B=w;B.x=o.x,B.y=a.y,B.z=s.z;var U=S;U.x=l.x,U.y=u.y,U.z=c.z;var V=e.multiplyByScalar(e.add(B,U,b),.5,E),z=0;for(T=0;T<d;T++){e.clone(t[T],i);var G=e.magnitude(e.subtract(i,V,b));G>z&&(z=G);var H=e.magnitudeSquared(e.subtract(i,k,b));if(H>L){var W=Math.sqrt(H);F=.5*(F+W),L=F*F;var j=W-F;k.x=(F*k.x+j*i.x)/W,k.y=(F*k.y+j*i.y)/W,k.z=(F*k.z+j*i.z)/W}}return F<z?(e.clone(k,r.center),r.radius=F):(e.clone(V,r.center),r.radius=z),r};var T=new a,x=new e,P=new e,A=new t,D=new t;h.fromRectangle2D=function(e,t,r){return h.fromRectangleWithHeights2D(e,t,0,0,r)},h.fromRectangleWithHeights2D=function(t,r,o,a,s){if(n(s)||(s=new h),!n(t))return s.center=e.clone(e.ZERO,s.center),s.radius=0,s;r=i(r,T),d.southwest(t,A),A.height=o,d.northeast(t,D),D.height=a;var l=r.project(A,x),u=r.project(D,P),c=u.x-l.x,p=u.y-l.y,f=u.z-l.z;s.radius=.5*Math.sqrt(c*c+p*p+f*f);var m=s.center;return m.x=l.x+.5*c,m.y=l.y+.5*p,m.z=l.z+.5*f,s};var I=[];h.fromRectangle3D=function(e,t,r,a){t=i(t,o.WGS84),r=i(r,0);var s;return n(e)&&(s=d.subsample(e,t,r,I)),h.fromPoints(s,a)},h.fromVertices=function(t,r,o,a){if(n(a)||(a=new h),!n(t)||0===t.length)return a.center=e.clone(e.ZERO,a.center),a.radius=0,a;r=i(r,e.ZERO),o=i(o,3);var s=y;s.x=t[0]+r.x,s.y=t[1]+r.y,s.z=t[2]+r.z;for(var l=e.clone(s,p),u=e.clone(s,f),c=e.clone(s,m),d=e.clone(s,g),T=e.clone(s,v),x=e.clone(s,_),P=t.length,A=0;A<P;A+=o){var D=t[A]+r.x,I=t[A+1]+r.y,M=t[A+2]+r.z;s.x=D,s.y=I,s.z=M,D<l.x&&e.clone(s,l),D>d.x&&e.clone(s,d),I<u.y&&e.clone(s,u),I>T.y&&e.clone(s,T),M<c.z&&e.clone(s,c),M>x.z&&e.clone(s,x)}var O=e.magnitudeSquared(e.subtract(d,l,b)),R=e.magnitudeSquared(e.subtract(T,u,b)),N=e.magnitudeSquared(e.subtract(x,c,b)),k=l,L=d,F=O;R>F&&(F=R,k=u,L=T),N>F&&(F=N,k=c,L=x);var B=C;B.x=.5*(k.x+L.x),B.y=.5*(k.y+L.y),B.z=.5*(k.z+L.z);var U=e.magnitudeSquared(e.subtract(L,B,b)),V=Math.sqrt(U),z=w;z.x=l.x,z.y=u.y,z.z=c.z;var G=S;G.x=d.x,G.y=T.y,G.z=x.z;var H=e.multiplyByScalar(e.add(z,G,b),.5,E),W=0;for(A=0;A<P;A+=o){s.x=t[A]+r.x,s.y=t[A+1]+r.y,s.z=t[A+2]+r.z;var j=e.magnitude(e.subtract(s,H,b));j>W&&(W=j);var q=e.magnitudeSquared(e.subtract(s,B,b));if(q>U){var Y=Math.sqrt(q);V=.5*(V+Y),U=V*V;var X=Y-V;B.x=(V*B.x+X*s.x)/Y,B.y=(V*B.y+X*s.y)/Y,B.z=(V*B.z+X*s.z)/Y}}return V<W?(e.clone(B,a.center),a.radius=V):(e.clone(H,a.center),a.radius=W),a},h.fromEncodedCartesianVertices=function(t,r,i){if(n(i)||(i=new h),!n(t)||!n(r)||t.length!==r.length||0===t.length)return i.center=e.clone(e.ZERO,i.center),i.radius=0,i;var o=y;o.x=t[0]+r[0],o.y=t[1]+r[1],o.z=t[2]+r[2];for(var a=e.clone(o,p),s=e.clone(o,f),l=e.clone(o,m),u=e.clone(o,g),c=e.clone(o,v),d=e.clone(o,_),T=t.length,x=0;x<T;x+=3){var P=t[x]+r[x],A=t[x+1]+r[x+1],D=t[x+2]+r[x+2];o.x=P,o.y=A,o.z=D,P<a.x&&e.clone(o,a),P>u.x&&e.clone(o,u),A<s.y&&e.clone(o,s),A>c.y&&e.clone(o,c),D<l.z&&e.clone(o,l),D>d.z&&e.clone(o,d)}var I=e.magnitudeSquared(e.subtract(u,a,b)),M=e.magnitudeSquared(e.subtract(c,s,b)),O=e.magnitudeSquared(e.subtract(d,l,b)),R=a,N=u,k=I;M>k&&(k=M,R=s,N=c),O>k&&(k=O,R=l,N=d);var L=C;L.x=.5*(R.x+N.x),L.y=.5*(R.y+N.y),L.z=.5*(R.z+N.z);var F=e.magnitudeSquared(e.subtract(N,L,b)),B=Math.sqrt(F),U=w;U.x=a.x,U.y=s.y,U.z=l.z;var V=S;V.x=u.x,V.y=c.y,V.z=d.z;var z=e.multiplyByScalar(e.add(U,V,b),.5,E),G=0;for(x=0;x<T;x+=3){o.x=t[x]+r[x],o.y=t[x+1]+r[x+1],o.z=t[x+2]+r[x+2];var H=e.magnitude(e.subtract(o,z,b));H>G&&(G=H);var W=e.magnitudeSquared(e.subtract(o,L,b));if(W>F){var j=Math.sqrt(W);B=.5*(B+j),F=B*B;var q=j-B;L.x=(B*L.x+q*o.x)/j,L.y=(B*L.y+q*o.y)/j,L.z=(B*L.z+q*o.z)/j}}return B<G?(e.clone(L,i.center),i.radius=B):(e.clone(z,i.center),i.radius=G),i},h.fromCornerPoints=function(t,r,i){n(i)||(i=new h);var o=i.center;return e.add(t,r,o),e.multiplyByScalar(o,.5,o),i.radius=e.distance(o,r),i},h.fromEllipsoid=function(t,r){return n(r)||(r=new h),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var M=new e;h.fromBoundingSpheres=function(t,r){if(n(r)||(r=new h),!n(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=t.length;if(1===i)return h.clone(t[0],r);if(2===i)return h.union(t[0],t[1],r);for(var o=[],a=0;a<i;a++)o.push(t[a].center);r=h.fromPoints(o,r);var s=r.center,l=r.radius;for(a=0;a<i;a++){var u=t[a];l=Math.max(l,e.distance(s,u.center,M)+u.radius)}return r.radius=l,r};var O=new e,R=new e,N=new e;h.fromOrientedBoundingBox=function(t,r){n(r)||(r=new h);var i=t.halfAxes,o=u.getColumn(i,0,O),a=u.getColumn(i,1,R),s=u.getColumn(i,2,N);return e.add(o,a,o),e.add(o,s,o),r.center=e.clone(t.center,r.center),r.radius=e.magnitude(o),r},h.clone=function(t,r){if(n(t))return n(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,r){r=i(r,0);var n=e.center;return t[r++]=n.x,t[r++]=n.y,t[r++]=n.z,t[r]=e.radius,t},h.unpack=function(e,t,r){t=i(t,0),n(r)||(r=new h);var o=r.center;return o.x=e[t++],o.y=e[t++],o.z=e[t++],r.radius=e[t],r};var k=new e,L=new e;h.union=function(t,r,i){n(i)||(i=new h);var o=t.center,a=t.radius,s=r.center,l=r.radius,u=e.subtract(s,o,k),c=e.magnitude(u);if(a>=c+l)return t.clone(i),i;if(l>=c+a)return r.clone(i),i;var d=.5*(a+c+l),p=e.multiplyByScalar(u,(-a+d)/c,L);return e.add(p,o,p),e.clone(p,i.center),i.radius=d,i};var F=new e;h.expand=function(t,r,i){i=h.clone(t,i);var n=e.magnitude(e.subtract(r,i.center,F));return n>i.radius&&(i.radius=n),i},h.intersectPlane=function(t,r){var i=t.center,n=t.radius,o=r.normal,a=e.dot(o,i)+r.distance;return a<-n?s.OUTSIDE:a<n?s.INTERSECTING:s.INSIDE},h.transform=function(e,t,r){return n(r)||(r=new h),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=c.getMaximumScale(t)*e.radius,r};var B=new e;h.distanceSquaredTo=function(t,r){var i=e.subtract(t.center,r,B);return e.magnitudeSquared(i)-t.radius*t.radius},h.transformWithoutScale=function(e,t,r){return n(r)||(r=new h),r.center=c.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var U=new e;h.computePlaneDistances=function(t,r,i,o){n(o)||(o=new l);var a=e.subtract(t.center,r,U),s=e.dot(i,a);return o.start=s-t.radius,o.stop=s+t.radius,o};for(var V=new e,z=new e,G=new e,H=new e,W=new e,j=new t,q=new Array(8),Y=0;Y<8;++Y)q[Y]=new e;var X=new a;return h.projectTo2D=function(t,r,n){r=i(r,X);var o=r.ellipsoid,a=t.center,s=t.radius,l=o.geodeticSurfaceNormal(a,V),u=e.cross(e.UNIT_Z,l,z);e.normalize(u,u);var c=e.cross(l,u,G);e.normalize(c,c),e.multiplyByScalar(l,s,l),e.multiplyByScalar(c,s,c),e.multiplyByScalar(u,s,u);var d=e.negate(c,W),p=e.negate(u,H),f=q,m=f[0];e.add(l,c,m),e.add(m,u,m),m=f[1],e.add(l,c,m),e.add(m,p,m),m=f[2],e.add(l,d,m),e.add(m,p,m),m=f[3],e.add(l,d,m),e.add(m,u,m),e.negate(l,l),m=f[4],e.add(l,c,m),e.add(m,u,m),m=f[5],e.add(l,c,m),e.add(m,p,m),m=f[6],e.add(l,d,m),e.add(m,p,m),m=f[7],e.add(l,d,m),e.add(m,u,m);for(var g=f.length,v=0;v<g;++v){var _=f[v];e.add(a,_,_);var y=o.cartesianToCartographic(_,j);r.project(y,_)}n=h.fromPoints(f,n),a=n.center;var b=a.x,C=a.y,w=a.z;return a.x=w,a.y=b,a.z=C,n},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,r){return h.computePlaneDistances(this,e,t,r)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,i={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},n={};return t(n,{element:{get:function(){if(n.supportsFullscreen())return document[i.fullscreenElement]}},changeEventName:{get:function(){if(n.supportsFullscreen())return i.fullscreenchange}},errorEventName:{get:function(){if(n.supportsFullscreen())return i.fullscreenerror}},enabled:{get:function(){if(n.supportsFullscreen())return document[i.fullscreenEnabled]}},fullscreen:{get:function(){if(n.supportsFullscreen())return null!==n.element}}}),n.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return i.requestFullscreen="requestFullscreen",i.exitFullscreen="exitFullscreen",i.fullscreenEnabled="fullscreenEnabled",i.fullscreenElement="fullscreenElement",i.fullscreenchange="fullscreenchange",i.fullscreenerror="fullscreenerror",r=!0;for(var n,o=["webkit","moz","o","ms","khtml"],a=0,s=o.length;a<s;++a){var l=o[a];n=l+"RequestFullscreen","function"==typeof t[n]?(i.requestFullscreen=n,r=!0):(n=l+"RequestFullScreen","function"==typeof t[n]&&(i.requestFullscreen=n,r=!0)),n=l+"ExitFullscreen","function"==typeof document[n]?i.exitFullscreen=n:(n=l+"CancelFullScreen","function"==typeof document[n]&&(i.exitFullscreen=n)),n=l+"FullscreenEnabled",void 0!==document[n]?i.fullscreenEnabled=n:(n=l+"FullScreenEnabled",void 0!==document[n]&&(i.fullscreenEnabled=n)),n=l+"FullscreenElement",void 0!==document[n]?i.fullscreenElement=n:(n=l+"FullScreenElement",void 0!==document[n]&&(i.fullscreenElement=n)),n=l+"fullscreenchange",void 0!==document["on"+n]&&("ms"===l&&(n="MSFullscreenChange"),i.fullscreenchange=n),n=l+"fullscreenerror",void 0!==document["on"+n]&&("ms"===l&&(n="MSFullscreenError"),i.fullscreenerror=n)}return r},n.requestFullscreen=function(e,t){n.supportsFullscreen()&&e[i.requestFullscreen]({vrDisplay:t})},n.exitFullscreen=function(){n.supportsFullscreen()&&document[i.exitFullscreen]()},n}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function i(e){for(var t=e.split("."),r=0,i=t.length;r<i;++r)t[r]=parseInt(t[r],10);return t}function n(){if(!t(C)&&(C=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(b.userAgent);null!==e&&(C=!0,w=i(e[1]))}return C}function o(){return n()&&w}function a(){if(!t(S)&&(S=!1,!n()&&!h()&&/ Safari\/[\.0-9]+/.test(b.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(b.userAgent);null!==e&&(S=!0,E=i(e[1]))}return S}function s(){return a()&&E}function l(){if(!t(T)){T=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(b.userAgent);null!==e&&(T=!0,x=i(e[1]),x.isNightly=!!e[2])}return T}function u(){return l()&&x}function c(){if(!t(P)){P=!1;var e;"Microsoft Internet Explorer"===b.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(b.userAgent),null!==e&&(P=!0,A=i(e[1]))):"Netscape"===b.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(b.userAgent),null!==e&&(P=!0,A=i(e[1])))}return P}function d(){return c()&&A}function h(){if(!t(D)){D=!1;var e=/ Edge\/([\.0-9]+)/.exec(b.userAgent);null!==e&&(D=!0,I=i(e[1]))}return D}function p(){return h()&&I}function f(){if(!t(M)){M=!1;var e=/Firefox\/([\.0-9]+)/.exec(b.userAgent);null!==e&&(M=!0,O=i(e[1]))}return M}function m(){return t(R)||(R=/Windows/i.test(b.appVersion)),R}function g(){return f()&&O}function v(){return t(N)||(N="undefined"!=typeof PointerEvent&&(!t(b.pointerEnabled)||b.pointerEnabled)),N}function _(){if(!t(L)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;L=t(r)&&""!==r,L&&(k=r)}return L}function y(){return _()?k:void 0}var b;b="undefined"!=typeof navigator?navigator:{};var C,w,S,E,T,x,P,A,D,I,M,O,R,N,k,L,F={isChrome:n,chromeVersion:o,isSafari:a,safariVersion:s,isWebkit:l,webkitVersion:u,isInternetExplorer:c,internetExplorerVersion:d,isEdge:h,edgeVersion:p,isFirefox:f,firefoxVersion:g,isWindows:m,hardwareConcurrency:e(b.hardwareConcurrency,3),supportsPointerEvents:v,supportsImageRenderingPixelated:_,imageRenderingValue:y};return F.supportsFullscreen=function(){return r.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,i,n,o){"use strict";if(!i.supportsTypedArrays())return{};var a={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return a.getSizeInBytes=function(e){switch(e){case a.BYTE:return Int8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.SHORT:return Int16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.INT:return Int32Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case a.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case a.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},a.fromTypedArray=function(e){return e instanceof Int8Array?a.BYTE:e instanceof Uint8Array?a.UNSIGNED_BYTE:e instanceof Int16Array?a.SHORT:e instanceof Uint16Array?a.UNSIGNED_SHORT:e instanceof Int32Array?a.INT:e instanceof Uint32Array?a.UNSIGNED_INT:e instanceof Float32Array?a.FLOAT:e instanceof Float64Array?a.DOUBLE:void 0},a.validate=function(e){return t(e)&&(e===a.BYTE||e===a.UNSIGNED_BYTE||e===a.SHORT||e===a.UNSIGNED_SHORT||e===a.INT||e===a.UNSIGNED_INT||e===a.FLOAT||e===a.DOUBLE)},a.createTypedArray=function(e,t){switch(e){case a.BYTE:return new Int8Array(t);case a.UNSIGNED_BYTE:return new Uint8Array(t);case a.SHORT:return new Int16Array(t);case a.UNSIGNED_SHORT:return new Uint16Array(t);case a.INT:return new Int32Array(t);case a.UNSIGNED_INT:return new Uint32Array(t);case a.FLOAT:return new Float32Array(t);case a.DOUBLE:return new Float64Array(t)}},a.createArrayBufferView=function(t,r,i,n){switch(i=e(i,0),n=e(n,(r.byteLength-i)/a.getSizeInBytes(t)),t){case a.BYTE:return new Int8Array(r,i,n);case a.UNSIGNED_BYTE:return new Uint8Array(r,i,n);case a.SHORT:return new Int16Array(r,i,n);case a.UNSIGNED_SHORT:return new Uint16Array(r,i,n);case a.INT:return new Int32Array(r,i,n);case a.UNSIGNED_INT:return new Uint32Array(r,i,n);case a.FLOAT:return new Float32Array(r,i,n);case a.DOUBLE:return new Float64Array(r,i,n)}},a.fromName=function(e){switch(e){case"BYTE":return a.BYTE;case"UNSIGNED_BYTE":return a.UNSIGNED_BYTE;case"SHORT":return a.SHORT;case"UNSIGNED_SHORT":return a.UNSIGNED_SHORT;case"INT":return a.INT;case"UNSIGNED_INT":return a.UNSIGNED_INT;case"FLOAT":return a.FLOAT;case"DOUBLE":return a.DOUBLE}},n(a)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,i,n){"use strict";function o(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,n.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,i.NONE),this.boundingSphereCV=t.boundingSphereCV}return o.computeNumberOfVertices=function(e){var r=-1;for(var i in e.attributes)if(e.attributes.hasOwnProperty(i)&&t(e.attributes[i])&&t(e.attributes[i].values)){var n=e.attributes[i],o=n.values.length/n.componentsPerAttribute;r=o}return r},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return i}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,i){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return n.POSITION_ONLY=i(new n({position:!0})),n.POSITION_AND_NORMAL=i(new n({position:!0,normal:!0})),n.POSITION_NORMAL_AND_ST=i(new n({position:!0,normal:!0,st:!0})),n.POSITION_AND_ST=i(new n({position:!0,st:!0})),n.POSITION_AND_COLOR=i(new n({position:!0,color:!0})),n.ALL=i(new n({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),n.DEFAULT=n.POSITION_NORMAL_AND_ST,n.packedLength=6,n.pack=function(t,r,i){return i=e(i,0),r[i++]=t.position?1:0,r[i++]=t.normal?1:0,r[i++]=t.st?1:0,r[i++]=t.tangent?1:0,r[i++]=t.bitangent?1:0,r[i++]=t.color?1:0,r},n.unpack=function(r,i,o){return i=e(i,0),t(o)||(o=new n),o.position=1===r[i++],o.normal=1===r[i++],o.st=1===r[i++],o.tangent=1===r[i++],o.bitangent=1===r[i++],o.color=1===r[i++],o},n.clone=function(e,r){if(t(e))return t(r)||(r=new n),r.position=e.position,r.normal=e.normal,r.st=e.st,r.tangent=e.tangent,r.bitangent=e.bitangent,r.color=e.color,r},n}),define("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e){e=n(e,n.EMPTY_OBJECT);var r=e.minimum,i=e.maximum,o=n(e.vertexFormat,c.DEFAULT);this._minimum=t.clone(r),this._maximum=t.clone(i),this._vertexFormat=o,this._workerName="createBoxGeometry"}var h=new t;d.fromDimensions=function(e){e=n(e,n.EMPTY_OBJECT);var r=e.dimensions,i=t.multiplyByScalar(r,.5,new t);return new d({minimum:t.negate(i,new t),maximum:i,vertexFormat:e.vertexFormat})},d.fromAxisAlignedBoundingBox=function(e){return new d({minimum:e.minimum,maximum:e.maximum})},d.packedLength=2*t.packedLength+c.packedLength,d.pack=function(e,r,i){return i=n(i,0),t.pack(e._minimum,r,i),t.pack(e._maximum,r,i+t.packedLength),c.pack(e._vertexFormat,r,i+2*t.packedLength),r};var p=new t,f=new t,m=new c,g={minimum:p,maximum:f,vertexFormat:m};return d.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r,p),s=t.unpack(e,r+t.packedLength,f),l=c.unpack(e,r+2*t.packedLength,m);return o(i)?(i._minimum=t.clone(a,i._minimum),i._maximum=t.clone(s,i._maximum),i._vertexFormat=c.clone(l,i._vertexFormat),i):new d(g)},d.createGeometry=function(r){var n=r._minimum,o=r._maximum,c=r._vertexFormat;if(!t.equals(n,o)){var d,p,f=new l;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&(p=new Float64Array(72),p[0]=n.x,p[1]=n.y,p[2]=o.z,p[3]=o.x,p[4]=n.y,p[5]=o.z,p[6]=o.x,p[7]=o.y,p[8]=o.z,p[9]=n.x,p[10]=o.y,p[11]=o.z,p[12]=n.x,p[13]=n.y,p[14]=n.z,p[15]=o.x,p[16]=n.y,p[17]=n.z,p[18]=o.x,p[19]=o.y,p[20]=n.z,p[21]=n.x,p[22]=o.y,p[23]=n.z,p[24]=o.x,p[25]=n.y,p[26]=n.z,p[27]=o.x,p[28]=o.y,p[29]=n.z,p[30]=o.x,p[31]=o.y,p[32]=o.z,p[33]=o.x,p[34]=n.y,p[35]=o.z,p[36]=n.x,p[37]=n.y,p[38]=n.z,p[39]=n.x,p[40]=o.y,p[41]=n.z,p[42]=n.x,p[43]=o.y,p[44]=o.z,p[45]=n.x,p[46]=n.y,p[47]=o.z,p[48]=n.x,p[49]=o.y,p[50]=n.z,p[51]=o.x,p[52]=o.y,p[53]=n.z,p[54]=o.x,p[55]=o.y,p[56]=o.z,p[57]=n.x,p[58]=o.y,p[59]=o.z,p[60]=n.x,p[61]=n.y,p[62]=n.z,p[63]=o.x,p[64]=n.y,p[65]=n.z,p[66]=o.x,p[67]=n.y,p[68]=o.z,p[69]=n.x,p[70]=n.y,p[71]=o.z,f.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p})),c.normal){var m=new Float32Array(72);m[0]=0,m[1]=0,m[2]=1,m[3]=0,m[4]=0,m[5]=1,m[6]=0,m[7]=0,m[8]=1,m[9]=0,m[10]=0,m[11]=1,m[12]=0,m[13]=0,m[14]=-1,m[15]=0,m[16]=0,m[17]=-1,m[18]=0,m[19]=0,m[20]=-1,m[21]=0,m[22]=0,m[23]=-1,m[24]=1,m[25]=0,m[26]=0,m[27]=1,m[28]=0,m[29]=0,m[30]=1,m[31]=0,m[32]=0,m[33]=1,m[34]=0,m[35]=0,m[36]=-1,m[37]=0,m[38]=0,m[39]=-1,m[40]=0,m[41]=0,m[42]=-1,m[43]=0,m[44]=0,m[45]=-1,m[46]=0,m[47]=0,m[48]=0,m[49]=1,m[50]=0,m[51]=0,m[52]=1,m[53]=0,m[54]=0,m[55]=1,m[56]=0,m[57]=0,m[58]=1,m[59]=0,m[60]=0,m[61]=-1,m[62]=0,m[63]=0,m[64]=-1,m[65]=0,m[66]=0,m[67]=-1,m[68]=0,m[69]=0,m[70]=-1,m[71]=0,f.normal=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:m})}if(c.st){var g=new Float32Array(48);g[0]=0,g[1]=0,g[2]=1,g[3]=0,g[4]=1,g[5]=1,g[6]=0,g[7]=1,g[8]=1,g[9]=0,g[10]=0,g[11]=0,g[12]=0,g[13]=1,g[14]=1,g[15]=1,g[16]=0,g[17]=0,g[18]=1,g[19]=0,g[20]=1,g[21]=1,g[22]=0,g[23]=1,g[24]=1,g[25]=0,g[26]=0,g[27]=0,g[28]=0,g[29]=1,g[30]=1,g[31]=1,g[32]=1,g[33]=0,g[34]=0,g[35]=0,g[36]=0,g[37]=1,g[38]=1,g[39]=1,g[40]=0,g[41]=0,g[42]=1,g[43]=0,g[44]=1,g[45]=1,g[46]=0,g[47]=1,f.st=new s({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:g})}if(c.tangent){var v=new Float32Array(72);v[0]=1,v[1]=0,v[2]=0,v[3]=1,v[4]=0,v[5]=0,v[6]=1,v[7]=0,v[8]=0,v[9]=1,v[10]=0,v[11]=0,v[12]=-1,v[13]=0,v[14]=0,v[15]=-1,v[16]=0,v[17]=0,v[18]=-1,v[19]=0,v[20]=0,v[21]=-1,v[22]=0,v[23]=0,v[24]=0,v[25]=1,v[26]=0,v[27]=0,v[28]=1,v[29]=0,v[30]=0,v[31]=1,v[32]=0,v[33]=0,v[34]=1,v[35]=0,v[36]=0,v[37]=-1,v[38]=0,v[39]=0,v[40]=-1,v[41]=0,v[42]=0,v[43]=-1,v[44]=0,v[45]=0,v[46]=-1,v[47]=0,v[48]=-1,v[49]=0,v[50]=0,v[51]=-1,v[52]=0,v[53]=0,v[54]=-1,v[55]=0,v[56]=0,v[57]=-1,v[58]=0,v[59]=0,v[60]=1,v[61]=0,v[62]=0,v[63]=1,v[64]=0,v[65]=0,v[66]=1,v[67]=0,v[68]=0,v[69]=1,v[70]=0,v[71]=0,f.tangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:v})}if(c.bitangent){var _=new Float32Array(72);_[0]=0,_[1]=1,_[2]=0,_[3]=0,_[4]=1,_[5]=0,_[6]=0,_[7]=1,_[8]=0,_[9]=0,_[10]=1,_[11]=0,_[12]=0,_[13]=1,_[14]=0,_[15]=0,_[16]=1,_[17]=0,_[18]=0,_[19]=1,_[20]=0,_[21]=0,_[22]=1,_[23]=0,_[24]=0,_[25]=0,_[26]=1,_[27]=0,_[28]=0,_[29]=1,_[30]=0,_[31]=0,_[32]=1,_[33]=0,_[34]=0,_[35]=1,_[36]=0,_[37]=0,_[38]=1,_[39]=0,_[40]=0,_[41]=1,_[42]=0,_[43]=0,_[44]=1,_[45]=0,_[46]=0,_[47]=1,_[48]=0,_[49]=0,_[50]=1,_[51]=0,_[52]=0,_[53]=1,_[54]=0,_[55]=0,_[56]=1,_[57]=0,_[58]=0,_[59]=1,_[60]=0,_[61]=0,_[62]=1,_[63]=0,_[64]=0,_[65]=1,_[66]=0,_[67]=0,_[68]=1,_[69]=0,_[70]=0,_[71]=1,f.bitangent=new s({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:_})}d=new Uint16Array(36),d[0]=0,d[1]=1,d[2]=2,d[3]=0,d[4]=2,d[5]=3,d[6]=6,d[7]=5,d[8]=4,d[9]=7,d[10]=6,d[11]=4,d[12]=8,d[13]=9,d[14]=10,d[15]=8,d[16]=10,d[17]=11,d[18]=14,d[19]=13,d[20]=12,d[21]=15,d[22]=14,d[23]=12,d[24]=18,d[25]=17,d[26]=16,d[27]=19,d[28]=18,d[29]=16,d[30]=20,d[31]=21,d[32]=22,d[33]=20,d[34]=22,d[35]=23}else p=new Float64Array(24),p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,f.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),d=new Uint16Array(36),d[0]=4,d[1]=5,d[2]=6,d[3]=4,d[4]=6,d[5]=7,d[6]=1,d[7]=0,d[8]=3,d[9]=1,d[10]=3,d[11]=2,d[12]=1,d[13]=6,d[14]=5,d[15]=1,d[16]=2,d[17]=6,d[18]=2,d[19]=3,d[20]=7,d[21]=2,d[22]=7,d[23]=6,d[24]=3,d[25]=0,d[26]=4,d[27]=3,d[28]=4,d[29]=7,d[30]=0,d[31]=1,d[32]=5,d[33]=0,d[34]=5,d[35]=4;var y=t.subtract(o,n,h),b=.5*t.magnitude(y);return new a({attributes:f,indices:d,primitiveType:u.TRIANGLES,boundingSphere:new e(t.ZERO,b)})}},d}),define("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e=n(e,n.EMPTY_OBJECT);var r=e.minimum,i=e.maximum;this._min=t.clone(r),this._max=t.clone(i),this._workerName="createBoxOutlineGeometry"}var d=new t;c.fromDimensions=function(e){e=n(e,n.EMPTY_OBJECT);var r=e.dimensions,i=t.multiplyByScalar(r,.5,new t);return new c({minimum:t.negate(i,new t),maximum:i})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._min,r,i),t.pack(e._max,r,i+t.packedLength),r};var h=new t,p=new t,f={minimum:h,maximum:p};return c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r,h),s=t.unpack(e,r+t.packedLength,p);return o(i)?(i._min=t.clone(a,i._min),i._max=t.clone(s,i._max),i):new c(f)},c.createGeometry=function(r){var n=r._min,o=r._max;if(!t.equals(n,o)){var c=new l,h=new Uint16Array(24),p=new Float64Array(24);p[0]=n.x,p[1]=n.y,p[2]=n.z,p[3]=o.x,p[4]=n.y,p[5]=n.z,p[6]=o.x,p[7]=o.y,p[8]=n.z,p[9]=n.x,p[10]=o.y,p[11]=n.z,p[12]=n.x,p[13]=n.y,p[14]=o.z,p[15]=o.x,p[16]=n.y,p[17]=o.z,p[18]=o.x,p[19]=o.y,p[20]=o.z,p[21]=n.x,p[22]=o.y,p[23]=o.z,c.position=new s({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:p}),h[0]=4,h[1]=5,h[2]=5,h[3]=6,h[4]=6,h[5]=7,h[6]=7,h[7]=4,h[8]=0,h[9]=1,h[10]=1,h[11]=2,h[12]=2,h[13]=3,h[14]=3,h[15]=0,h[16]=0,h[17]=4,h[18]=1,h[19]=5,h[20]=2,h[21]=6,h[22]=3,h[23]=7;var f=t.subtract(o,n,d),m=.5*t.magnitude(f);return new a({attributes:c,indices:h,primitiveType:u.LINES,boundingSphere:new e(t.ZERO,m)})}},c}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";function n(r,i){i=t(i,document.location.href);var n=new e(i),o=new e(r);return o.resolve(n).toString()}return n}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";function n(i,n,o){if(o=t(o,!0),i instanceof e||(i=new e(i)),n instanceof e||(n=new e(n)),"data"===i.scheme)return i.toString();if("data"===n.scheme)return n.toString();r(n.authority)&&!r(n.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?n.scheme=new e(document.location.href).scheme:n.scheme=i.scheme);var a=i;n.isAbsolute()&&(a=n);var s="";r(a.scheme)&&(s+=a.scheme+":"),r(a.authority)&&(s+="//"+a.authority,""!==a.path&&"/"!==a.path&&(s=s.replace(/\/?$/,"/"),a.path=a.path.replace(/^\/?/g,""))),s+=a===i?o?i.path.replace(/\/?$/,"/")+n.path.replace(/^\/?/g,""):i.path+n.path:n.path;var l=r(i.query),u=r(n.query);l&&u?s+="?"+i.query+"&"+n.query:l&&!u?s+="?"+i.query:!l&&u&&(s+="?"+n.query);var c=r(n.fragment);return r(i.fragment)&&!c?s+="#"+i.fragment:c&&(s+="#"+n.fragment),s}return n}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,i,n,o){"use strict";function a(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var i=e[t].getAttribute("src"),n=f.exec(i);if(null!==n)return n[1]}}function s(){if(t(d))return d;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:a(),d=new e(i(r))}function l(e){return o.toUrl("../"+e)}function u(e){return n(s(),e)}function c(e){t(h)||(h=t(o.toUrl)?l:u),t(p)||(p=document.createElement("a"));var r=h(e);return p.href=r,p.href=p.href,p.href}var d,h,p,f=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return c._cesiumScriptRegex=f,c.setBaseUrl=function(t){d=new e(t).resolve(new e(document.location.href))},c}),define("Core/cancelAnimationFrame",["./defined"],function(e){"use strict";function t(e){r(e)}if("undefined"!=typeof window){var r=window.cancelAnimationFrame;return function(){if(!e(r))for(var t=["webkit","moz","ms","o"],i=0,n=t.length;i<n&&!e(r);)r=window[t[i]+"CancelAnimationFrame"],e(r)||(r=window[t[i]+"CancelRequestAnimationFrame"]),++i;e(r)||(r=clearTimeout)}(),t}}),define("Core/CartographicGeocoderService",["./Cartesian3","./Check","./defaultValue","./defineProperties","./defined","../ThirdParty/when"],function(e,t,r,i,n,o){"use strict";function a(){}return a.prototype.geocode=function(t){var r=t.match(/[^\s,\n]+/g);if(2===r.length||3===r.length){var i=+r[0],n=+r[1],a=3===r.length?+r[2]:300;if(!isNaN(i)&&!isNaN(n)&&!isNaN(a)){var s={displayName:t,destination:e.fromDegrees(i,n,a)};return o.resolve([s])}}return o.resolve([])},a}),define("Core/Spline",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(){this.times=void 0,this.points=void 0,r.throwInstantiationError()}return i.prototype.evaluate=r.throwInstantiationError,i.prototype.findTimeInterval=function(t,r){var i=this.times,n=i.length;if(r=e(r,0),t>=i[r]){if(r+1<n&&t<i[r+1])return r;if(r+2<n&&t<i[r+2])return r+1}else if(r-1>=0&&t>=i[r-1])return r-1;var o;if(t>i[r])for(o=r;o<n-1&&!(t>=i[o]&&t<i[o+1]);++o);else for(o=r-1;o>=0&&!(t>=i[o]&&t<i[o+1]);--o);return o===n-1&&(o=n-2),o},i}),define("Core/LinearSpline",["./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Spline"],function(e,t,r,i,n,o){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT);var r=e.points,i=e.times;this._times=i,this._points=r,this._lastTimeIndex=0}return i(a.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}}),a.prototype.findTimeInterval=o.prototype.findTimeInterval,a.prototype.evaluate=function(t,i){var n=this.points,o=this.times,a=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),s=(t-o[a])/(o[a+1]-o[a]);return r(i)||(i=new e),e.lerp(n[a],n[a+1],s,i)},a}),define("Core/TridiagonalSystemSolver",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var i={};return i.solve=function(t,r,i,n){var o,a=new Array(i.length),s=new Array(n.length),l=new Array(n.length);for(o=0;o<s.length;o++)s[o]=new e,l[o]=new e;a[0]=i[0]/r[0],s[0]=e.multiplyByScalar(n[0],1/r[0],s[0]);var u;for(o=1;o<a.length;++o)u=1/(r[o]-a[o-1]*t[o-1]),a[o]=i[o]*u,s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]);for(u=1/(r[o]-a[o-1]*t[o-1]),s[o]=e.subtract(n[o],e.multiplyByScalar(s[o-1],t[o-1],s[o]),s[o]),s[o]=e.multiplyByScalar(s[o],u,s[o]),l[l.length-1]=s[s.length-1],o=l.length-2;o>=0;--o)l[o]=e.subtract(s[o],e.multiplyByScalar(l[o+1],a[o],l[o]),l[o]);return l},i}),define("Core/HermiteSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./LinearSpline","./Matrix4","./Spline","./TridiagonalSystemSolver"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,r,n){var o=p,a=m,s=f,l=g;o.length=a.length=t.length-1,s.length=l.length=t.length;var c;o[0]=s[0]=1,a[0]=0;var d=l[0];for(i(d)||(d=l[0]=new e),e.clone(r,d),c=1;c<o.length-1;++c)o[c]=a[c]=1,s[c]=4,d=l[c],i(d)||(d=l[c]=new e),e.subtract(t[c+1],t[c-1],d),e.multiplyByScalar(d,3,d);return o[c]=0,a[c]=1,s[c]=4,d=l[c],i(d)||(d=l[c]=new e),e.subtract(t[c+1],t[c-1],d),e.multiplyByScalar(d,3,d),s[c+1]=1,d=l[c+1],i(d)||(d=l[c+1]=new e),e.clone(n,d),u.solve(o,s,a,l)}function d(t){var r=p,n=m,o=f,a=g;r.length=n.length=t.length-1,o.length=a.length=t.length;var s;r[0]=n[0]=1,o[0]=2;var l=a[0];for(i(l)||(l=a[0]=new e),e.subtract(t[1],t[0],l),e.multiplyByScalar(l,3,l),s=1;s<r.length;++s)r[s]=n[s]=1,o[s]=4,l=a[s],i(l)||(l=a[s]=new e),e.subtract(t[s+1],t[s-1],l),e.multiplyByScalar(l,3,l);return o[s]=2,l=a[s],i(l)||(l=a[s]=new e),e.subtract(t[s],t[s-1],l),e.multiplyByScalar(l,3,l),u.solve(r,o,n,a)}function h(e){e=r(e,r.EMPTY_OBJECT);var t=e.points,i=e.times,n=e.inTangents,o=e.outTangents;this._times=i,this._points=t,this._inTangents=n,this._outTangents=o,this._lastTimeIndex=0}var p=[],f=[],m=[],g=[];n(h.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}}}),h.createC1=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.times,i=e.points,n=e.tangents,o=n.slice(0,n.length-1),a=n.slice(1,n.length);return new h({times:t,points:i,inTangents:a,outTangents:o})},h.createNaturalCubic=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.times,i=e.points;if(i.length<3)return new a({points:i,times:t});var n=d(i),o=n.slice(0,n.length-1),s=n.slice(1,n.length);return new h({times:t,points:i,inTangents:s,outTangents:o})},h.createClampedCubic=function(e){e=r(e,r.EMPTY_OBJECT);var t=e.times,i=e.points,n=e.firstTangent,o=e.lastTangent;if(i.length<3)return new a({points:i,times:t});var s=c(i,n,o),l=s.slice(0,s.length-1),u=s.slice(1,s.length);return new h({times:t,points:i,inTangents:u,outTangents:l})},h.hermiteCoefficientMatrix=new s(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0),h.prototype.findTimeInterval=l.prototype.findTimeInterval;var v=new t,_=new e;return h.prototype.evaluate=function(t,r){i(r)||(r=new e);var n=this.points,o=this.times,a=this.inTangents,l=this.outTangents,u=this._lastTimeIndex=this.findTimeInterval(t,this._lastTimeIndex),c=(t-o[u])/(o[u+1]-o[u]),d=v;d.z=c,d.y=c*c,d.x=d.y*c,d.w=1;var p=s.multiplyByVector(h.hermiteCoefficientMatrix,d,d);return r=e.multiplyByScalar(n[u],p.x,r),e.multiplyByScalar(n[u+1],p.y,_),e.add(r,_,r),e.multiplyByScalar(l[u],p.z,_),e.add(r,_,r),e.multiplyByScalar(a[u],p.w,_),e.add(r,_,r)},h}),define("Core/CatmullRomSpline",["./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./HermiteSpline","./Matrix4","./Spline"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t){var r=t.points,n=t.times;if(r.length<3){var o=n[0],l=1/(n[1]-o),u=r[0],f=r[1];return function(t,r){i(r)||(r=new e);var n=(t-o)*l;return e.lerp(u,f,n,r)}}return function(o,l){i(l)||(l=new e);var u=t._lastTimeIndex=t.findTimeInterval(o,t._lastTimeIndex),f=(o-n[u])/(n[u+1]-n[u]),m=d;m.z=f,m.y=f*f,m.x=m.y*f,m.w=1;var g,v,_,y,b;return 0===u?(g=r[0],v=r[1],_=t.firstTangent,y=e.subtract(r[2],g,h),e.multiplyByScalar(y,.5,y),b=s.multiplyByVector(a.hermiteCoefficientMatrix,m,m)):u===r.length-2?(g=r[u],v=r[u+1],y=t.lastTangent,_=e.subtract(v,r[u-1],h),e.multiplyByScalar(_,.5,_),b=s.multiplyByVector(a.hermiteCoefficientMatrix,m,m)):(g=r[u-1],v=r[u],_=r[u+1],y=r[u+2],b=s.multiplyByVector(c.catmullRomCoefficientMatrix,m,m)),l=e.multiplyByScalar(g,b.x,l),e.multiplyByScalar(v,b.y,p),e.add(l,p,l),e.multiplyByScalar(_,b.z,p),e.add(l,p,l),e.multiplyByScalar(y,b.w,p),e.add(l,p,l)}}function c(t){t=r(t,r.EMPTY_OBJECT);var n=t.points,o=t.times,a=t.firstTangent,s=t.lastTangent;if(n.length>2&&(i(a)||(a=f,e.multiplyByScalar(n[1],2,a),e.subtract(a,n[2],a),e.subtract(a,n[0],a),e.multiplyByScalar(a,.5,a)),!i(s))){var l=n.length-1;s=m,e.multiplyByScalar(n[l-1],2,s),e.subtract(n[l],s,s),e.add(s,n[l-2],s),e.multiplyByScalar(s,.5,s)}this._times=o,this._points=n,this._firstTangent=e.clone(a),this._lastTangent=e.clone(s),this._evaluateFunction=u(this),this._lastTimeIndex=0}var d=new t,h=new e,p=new e,f=new e,m=new e;return n(c.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}}}),c.catmullRomCoefficientMatrix=new s(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),c.prototype.findTimeInterval=l.prototype.findTimeInterval,c.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},c}),define("Core/Event",["./defined","./defineProperties","./DeveloperError"],function(e,t,r){"use strict";function i(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}return t(i.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),i.prototype.addEventListener=function(e,t){this._listeners.push(e),this._scopes.push(t);var r=this;return function(){r.removeEventListener(e,t)}},i.prototype.removeEventListener=function(e,t){for(var r=this._listeners,i=this._scopes,n=-1,o=0;o<r.length;o++)if(r[o]===e&&i[o]===t){n=o;break}return n!==-1&&(this._insideRaiseEvent?(this._toRemove.push(n),r[n]=void 0,i[n]=void 0):(r.splice(n,1),i.splice(n,1)),!0)},i.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;var t,r=this._listeners,i=this._scopes,n=r.length;for(t=0;t<n;t++){var o=r[t];e(o)&&r[t].apply(i[t],arguments)}var a=this._toRemove;for(n=a.length,t=0;t<n;t++){var s=a[t];r.splice(s,1),i.splice(s,1)}a.length=0,this._insideRaiseEvent=!1},i}),define("Core/GeographicTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./GeographicProjection","./Math","./Rectangle"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e){e=t(e,{}),this._ellipsoid=t(e.ellipsoid,o.WGS84),this._rectangle=t(e.rectangle,l.MAX_VALUE),this._projection=new a(this._ellipsoid),this._numberOfLevelZeroTilesX=t(e.numberOfLevelZeroTilesX,2),this._numberOfLevelZeroTilesY=t(e.numberOfLevelZeroTilesY,1)}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),u.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},u.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},u.prototype.rectangleToNativeRectangle=function(e,t){var i=s.toDegrees(e.west),n=s.toDegrees(e.south),o=s.toDegrees(e.east),a=s.toDegrees(e.north);return r(t)?(t.west=i,t.south=n,t.east=o,t.north=a,t):new l(i,n,o,a)},u.prototype.tileXYToNativeRectangle=function(e,t,r,i){var n=this.tileXYToRectangle(e,t,r,i);return n.west=s.toDegrees(n.west),n.south=s.toDegrees(n.south),n.east=s.toDegrees(n.east),n.north=s.toDegrees(n.north),n},u.prototype.tileXYToRectangle=function(e,t,i,n){var o=this._rectangle,a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),u=o.width/a,c=e*u+o.west,d=(e+1)*u+o.west,h=o.height/s,p=o.north-t*h,f=o.north-(t+1)*h;return r(n)||(n=new l(c,f,d,p)), +n.west=c,n.south=f,n.east=d,n.north=p,n},u.prototype.positionToTileXY=function(t,i,n){var o=this._rectangle;if(l.contains(o,t)){var a=this.getNumberOfXTilesAtLevel(i),u=this.getNumberOfYTilesAtLevel(i),c=o.width/a,d=o.height/u,h=t.longitude;o.east<o.west&&(h+=s.TWO_PI);var p=(h-o.west)/c|0;p>=a&&(p=a-1);var f=(o.north-t.latitude)/d|0;return f>=u&&(f=u-1),r(n)?(n.x=p,n.y=f,n):new e(p,f)}},u}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,r,i,n,o,a){"use strict";function s(e,r){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,i(r)&&(this.cameraPosition=r)}function l(e,r,i){var n=e.transformPositionToScaledSpace(r,f),o=t.magnitudeSquared(n),a=Math.sqrt(o),s=t.divideByScalar(n,a,m);o=Math.max(1,o),a=Math.max(1,a);var l=t.dot(s,i),u=t.magnitude(t.cross(s,i,s)),c=1/a,d=Math.sqrt(o-1)*c;return 1/(l*c-u*d)}function u(e,r,i){if(!(r<=0||r===1/0||r!==r))return t.multiplyByScalar(e,r,i)}function c(e,r){return t.equals(r,t.ZERO)?r:(e.transformPositionToScaledSpace(r,g),t.normalize(g,g))}n(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var r=this._ellipsoid,i=r.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),n=t.magnitudeSquared(i)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=i,this._distanceToLimbInScaledSpaceSquared=n}}});var d=new t;s.prototype.isPointVisible=function(e){var t=this._ellipsoid,r=t.transformPositionToScaledSpace(e,d);return this.isScaledSpacePointVisible(r)},s.prototype.isScaledSpacePointVisible=function(e){var r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared,n=t.subtract(e,r,d),o=-t.dot(n,r),a=i<0?o>0:o>i&&o*o/t.magnitudeSquared(n)>i;return!a},s.prototype.computeHorizonCullingPoint=function(e,r,n){i(n)||(n=new t);for(var o=this._ellipsoid,a=c(o,e),s=0,d=0,h=r.length;d<h;++d){var p=r[d],f=l(o,p,a);s=Math.max(s,f)}return u(a,s,n)};var h=new t;s.prototype.computeHorizonCullingPointFromVertices=function(e,n,o,a,s){i(s)||(s=new t),a=r(a,t.ZERO);for(var d=this._ellipsoid,p=c(d,e),f=0,m=0,g=n.length;m<g;m+=o){h.x=n[m]+a.x,h.y=n[m+1]+a.y,h.z=n[m+2]+a.z;var v=l(d,h,p);f=Math.max(f,v)}return u(p,f,s)};var p=[];s.prototype.computeHorizonCullingPointFromRectangle=function(r,i,n){var o=a.subsample(r,i,0,p),s=e.fromPoints(o);if(!(t.magnitude(s.center)<.1*i.minimumRadius))return this.computeHorizonCullingPoint(s.center,o,n)};var f=new t,m=new t,g=new t;return s}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,i){var n=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(r)))<i?0:n}var i={};return i.computeDiscriminant=function(e,t,r){var i=t*t-4*e*r;return i},i.computeRealRoots=function(e,i,n){var o;if(0===e)return 0===i?[]:[-n/i];if(0===i){if(0===n)return[0,0];var a=Math.abs(n),s=Math.abs(e);if(a<s&&a/s<t.EPSILON14)return[0,0];if(a>s&&s/a<t.EPSILON14)return[];if(o=-n/e,o<0)return[];var l=Math.sqrt(o);return[-l,l]}if(0===n)return o=-i/e,o<0?[o,0]:[0,o];var u=i*i,c=4*e*n,d=r(u,-c,t.EPSILON14);if(d<0)return[];var h=-.5*r(i,t.sign(i)*Math.sqrt(d),t.EPSILON14);return i>0?[h/e,n/h]:[n/h,h/e]},i}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,i){var n,o,a=e,s=t/3,l=r/3,u=i,c=a*l,d=s*u,h=s*s,p=l*l,f=a*l-h,m=a*u-s*l,g=s*u-p,v=4*f*g-m*m;if(v<0){var _,y,b;h*d>=c*p?(_=a,y=f,b=-2*s*f+a*m):(_=u,y=g,b=-u*m+2*l*g);var C=b<0?-1:1,w=-C*Math.abs(_)*Math.sqrt(-v);o=-b+w;var S=o/2,E=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),T=o===w?-E:-y/E;return n=y<=0?E+T:-b/(E*E+T*T+y),h*d>=c*p?[(n-s)/a]:[-u/(n+l)]}var x=f,P=-2*s*f+a*m,A=g,D=-u*m+2*l*g,I=Math.sqrt(v),M=Math.sqrt(3)/2,O=Math.abs(Math.atan2(a*I,-P)/3);n=2*Math.sqrt(-x);var R=Math.cos(O);o=n*R;var N=n*(-R/2-M*Math.sin(O)),k=o+N>2*s?o-s:N-s,L=a,F=k/L;O=Math.abs(Math.atan2(u*I,-D)/3),n=2*Math.sqrt(-A),R=Math.cos(O),o=n*R,N=n*(-R/2-M*Math.sin(O));var B=-u,U=o+N<2*l?o+l:N+l,V=B/U,z=L*U,G=-k*U-L*B,H=k*B,W=(l*G-s*H)/(-s*G+l*z);return F<=W?F<=V?W<=V?[F,W,V]:[F,V,W]:[V,F,W]:F<=V?[W,F,V]:W<=V?[W,V,F]:[V,W,F]}var i={};return i.computeDiscriminant=function(e,t,r,i){var n=e*e,o=t*t,a=r*r,s=i*i,l=18*e*t*r*i+o*a-27*n*s-4*(e*a*r+o*t*i);return l},i.computeRealRoots=function(e,i,n,o){var a,s;if(0===e)return t.computeRealRoots(i,n,o);if(0===i){if(0===n){if(0===o)return[0,0,0];s=-o/e;var l=s<0?-Math.pow(-s,1/3):Math.pow(s,1/3);return[l,l,l]}return 0===o?(a=t.computeRealRoots(e,0,n),0===a.Length?[0]:[a[0],0,a[1]]):r(e,0,n,o)}return 0===n?0===o?(s=-i/e,s<0?[s,0,0]:[0,0,s]):r(e,i,0,o):0===o?(a=t.computeRealRoots(e,i,n),0===a.length?[0]:a[1]<=0?[a[0],a[1],0]:a[0]>=0?[0,a[0],a[1]]:[a[0],0,a[1]]):r(e,i,n,o)},i}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,i){"use strict";function n(t,n,o,a){var s=t*t,l=n-3*s/8,u=o-n*t/2+s*t/8,c=a-o*t/4+n*s/16-3*s*s/256,d=e.computeRealRoots(1,2*l,l*l-4*c,-u*u);if(d.length>0){var h=-t/4,p=d[d.length-1];if(Math.abs(p)<r.EPSILON14){var f=i.computeRealRoots(1,l,c);if(2===f.length){var m,g=f[0],v=f[1];if(g>=0&&v>=0){var _=Math.sqrt(g),y=Math.sqrt(v);return[h-y,h-_,h+_,h+y]}if(g>=0&&v<0)return m=Math.sqrt(g),[h-m,h+m];if(g<0&&v>=0)return m=Math.sqrt(v),[h-m,h+m]}return[]}if(p>0){var b=Math.sqrt(p),C=(l+p-u/b)/2,w=(l+p+u/b)/2,S=i.computeRealRoots(1,b,C),E=i.computeRealRoots(1,-b,w);return 0!==S.length?(S[0]+=h,S[1]+=h,0!==E.length?(E[0]+=h,E[1]+=h,S[1]<=E[0]?[S[0],S[1],E[0],E[1]]:E[1]<=S[0]?[E[0],E[1],S[0],S[1]]:S[0]>=E[0]&&S[1]<=E[1]?[E[0],S[0],S[1],E[1]]:E[0]>=S[0]&&E[1]<=S[1]?[S[0],E[0],E[1],S[1]]:S[0]>E[0]&&S[0]<E[1]?[E[0],S[0],E[1],S[1]]:[S[0],E[0],S[1],E[1]]):S):0!==E.length?(E[0]+=h,E[1]+=h,E):[]}}return[]}function o(t,n,o,a){var s=o*o,l=n*n,u=t*t,c=-2*n,d=o*t+l-4*a,h=u*a-o*n*t+s,p=e.computeRealRoots(1,c,d,h);if(p.length>0){var f,m,g=p[0],v=n-g,_=v*v,y=t/2,b=v/2,C=_-4*a,w=_+4*Math.abs(a),S=u-4*g,E=u+4*Math.abs(g);if(g<0||C*E<S*w){var T=Math.sqrt(S);f=T/2,m=0===T?0:(t*b-o)/T}else{var x=Math.sqrt(C);f=0===x?0:(t*b-o)/x,m=x/2}var P,A;0===y&&0===f?(P=0,A=0):r.sign(y)===r.sign(f)?(P=y+f,A=g/P):(A=y-f,P=g/A);var D,I;0===b&&0===m?(D=0,I=0):r.sign(b)===r.sign(m)?(D=b+m,I=a/D):(I=b-m,D=a/I);var M=i.computeRealRoots(1,P,D),O=i.computeRealRoots(1,A,I);if(0!==M.length)return 0!==O.length?M[1]<=O[0]?[M[0],M[1],O[0],O[1]]:O[1]<=M[0]?[O[0],O[1],M[0],M[1]]:M[0]>=O[0]&&M[1]<=O[1]?[O[0],M[0],M[1],O[1]]:O[0]>=M[0]&&O[1]<=M[1]?[M[0],O[0],O[1],M[1]]:M[0]>O[0]&&M[0]<O[1]?[O[0],M[0],O[1],M[1]]:[M[0],O[0],M[1],O[1]]:M;if(0!==O.length)return O}return[]}var a={};return a.computeDiscriminant=function(e,t,r,i,n){var o=e*e,a=o*e,s=t*t,l=s*t,u=r*r,c=u*r,d=i*i,h=d*i,p=n*n,f=p*n,m=s*u*d-4*l*h-4*e*c*d+18*e*t*r*h-27*o*d*d+256*a*f+n*(18*l*r*i-4*s*c+16*e*u*u-80*e*t*u*i-6*e*s*d+144*o*r*d)+p*(144*e*s*r-27*s*s-128*o*u-192*o*t*i);return m},a.computeRealRoots=function(t,i,a,s,l){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(i,a,s,l);var u=i/t,c=a/t,d=s/t,h=l/t,p=u<0?1:0;switch(p+=c<0?p+1:p,p+=d<0?p+1:p,p+=h<0?p+1:p){case 0:return n(u,c,d,h);case 1:return o(u,c,d,h);case 2:return o(u,c,d,h);case 3:return n(u,c,d,h);case 4:return n(u,c,d,h);case 5:return o(u,c,d,h);case 6:return n(u,c,d,h);case 7:return n(u,c,d,h);case 8:return o(u,c,d,h);case 9:return n(u,c,d,h);case 10:return n(u,c,d,h);case 11:return o(u,c,d,h);case 12:return n(u,c,d,h);case 13:return n(u,c,d,h);case 14:return n(u,c,d,h);case 15:return n(u,c,d,h);default:return}},a}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i){"use strict";function n(r,i){i=e.clone(t(i,e.ZERO)),e.equals(i,e.ZERO)||e.normalize(i,i),this.origin=e.clone(t(r,e.ZERO)),this.direction=i}return n.getPoint=function(t,i,n){return r(n)||(n=new e),n=e.multiplyByScalar(t.direction,i,n),e.add(t.origin,n,n)},n}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e,t,r,i){var n=t*t-4*e*r;if(!(n<0)){if(n>0){var o=1/(2*e),a=Math.sqrt(n),s=(-t+a)*o,l=(-t-a)*o;return s<l?(i.root0=s,i.root1=l):(i.root0=l,i.root1=s),i}var u=-t/(2*e);if(0!==u)return i.root0=i.root1=u,i}}function h(t,r,n){i(n)||(n=new o);var a=t.origin,s=t.direction,l=r.center,u=r.radius*r.radius,c=e.subtract(a,l,_),h=e.dot(s,s),p=2*e.dot(s,c),f=e.magnitudeSquared(c)-u,m=d(h,p,f,w);if(i(m))return n.start=m.root0,n.stop=m.root1,n}function p(e,t,r){var i=e+t;return a.sign(e)!==a.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<r?0:i}function f(t,r,i,n,o){var c,d=n*n,h=o*o,f=(t[s.COLUMN1ROW1]-t[s.COLUMN2ROW2])*h,m=o*(n*p(t[s.COLUMN1ROW0],t[s.COLUMN0ROW1],a.EPSILON15)+r.y),g=t[s.COLUMN0ROW0]*d+t[s.COLUMN2ROW2]*h+n*r.x+i,v=h*p(t[s.COLUMN2ROW1],t[s.COLUMN1ROW2],a.EPSILON15),_=o*(n*p(t[s.COLUMN2ROW0],t[s.COLUMN0ROW2])+r.z),y=[];if(0===_&&0===v){if(c=l.computeRealRoots(f,m,g),0===c.length)return y;var b=c[0],C=Math.sqrt(Math.max(1-b*b,0));if(y.push(new e(n,o*b,o*-C)),y.push(new e(n,o*b,o*C)),2===c.length){var w=c[1],S=Math.sqrt(Math.max(1-w*w,0));y.push(new e(n,o*w,o*-S)),y.push(new e(n,o*w,o*S))}return y}var E=_*_,T=v*v,x=f*f,P=_*v,A=x+T,D=2*(m*f+P),I=2*g*f+m*m-T+E,M=2*(g*m-P),O=g*g-E;if(0===A&&0===D&&0===I&&0===M)return y;c=u.computeRealRoots(A,D,I,M,O);var R=c.length;if(0===R)return y;for(var N=0;N<R;++N){var k,L=c[N],F=L*L,B=Math.max(1-F,0),U=Math.sqrt(B);k=a.sign(f)===a.sign(g)?p(f*F+g,m*L,a.EPSILON12):a.sign(g)===a.sign(m*L)?p(f*F,m*L+g,a.EPSILON12):p(f*F+m*L,g,a.EPSILON12);var V=p(v*L,_,a.EPSILON15),z=k*V;z<0?y.push(new e(n,o*L,o*U)):z>0?y.push(new e(n,o*L,o*-U)):0!==U?(y.push(new e(n,o*L,o*-U)),y.push(new e(n,o*L,o*U)),++N):y.push(new e(n,o*L,o*U))}return y}var m={};m.rayPlane=function(t,r,n){i(n)||(n=new e);var o=t.origin,s=t.direction,l=r.normal,u=e.dot(l,s);if(!(Math.abs(u)<a.EPSILON15)){var c=(-r.distance-e.dot(l,o))/u;if(!(c<0))return n=e.multiplyByScalar(s,c,n),e.add(o,n,n)}};var g=new e,v=new e,_=new e,y=new e,b=new e;m.rayTriangleParametric=function(t,i,n,o,s){s=r(s,!1);var l,u,c,d,h,p=t.origin,f=t.direction,m=e.subtract(n,i,g),C=e.subtract(o,i,v),w=e.cross(f,C,_),S=e.dot(m,w);if(s){if(S<a.EPSILON6)return;if(l=e.subtract(p,i,y),c=e.dot(l,w),c<0||c>S)return;if(u=e.cross(l,m,b),d=e.dot(f,u),d<0||c+d>S)return;h=e.dot(C,u)/S}else{if(Math.abs(S)<a.EPSILON6)return;var E=1/S;if(l=e.subtract(p,i,y),c=e.dot(l,w)*E,c<0||c>1)return;if(u=e.cross(l,m,b),d=e.dot(f,u)*E,d<0||c+d>1)return;h=e.dot(C,u)*E}return h},m.rayTriangle=function(t,r,n,o,a,s){var l=m.rayTriangleParametric(t,r,n,o,a);if(i(l)&&!(l<0))return i(s)||(s=new e),e.multiplyByScalar(t.direction,l,s),e.add(t.origin,s,s)};var C=new c;m.lineSegmentTriangle=function(t,r,n,o,a,s,l){var u=C;e.clone(t,u.origin),e.subtract(r,t,u.direction),e.normalize(u.direction,u.direction);var c=m.rayTriangleParametric(u,n,o,a,s);if(!(!i(c)||c<0||c>e.distance(t,r)))return i(l)||(l=new e),e.multiplyByScalar(u.direction,c,l),e.add(u.origin,l,l)};var w={root0:0,root1:0};m.raySphere=function(e,t,r){if(r=h(e,t,r),i(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new c;m.lineSegmentSphere=function(t,r,n,o){var a=S;e.clone(t,a.origin);var s=e.subtract(r,t,a.direction),l=e.magnitude(s);if(e.normalize(s,s),o=h(a,n,o),!(!i(o)||o.stop<0||o.start>l))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,l),o};var E=new e,T=new e;m.rayEllipsoid=function(t,r){var i,n,a,s,l,u=r.oneOverRadii,c=e.multiplyComponents(u,t.origin,E),d=e.multiplyComponents(u,t.direction,T),h=e.magnitudeSquared(c),p=e.dot(c,d);if(h>1){if(p>=0)return;var f=p*p;if(i=h-1,n=e.magnitudeSquared(d),a=n*i,f<a)return;if(f>a){s=p*p-a,l=-p+Math.sqrt(s);var m=l/n,g=i/l;return m<g?new o(m,g):{start:g,stop:m}}var v=Math.sqrt(i/n);return new o(v,v)}return h<1?(i=h-1,n=e.magnitudeSquared(d),a=n*i,s=p*p-a,l=-p+Math.sqrt(s),new o(0,l/n)):p<0?(n=e.magnitudeSquared(d),new o(0,-p/n)):void 0};var x=new e,P=new e,A=new e,D=new e,I=new e,M=new s,O=new s,R=new s,N=new s,k=new s,L=new s,F=new s,B=new e,U=new e,V=new t;m.grazingAltitudeLocation=function(t,r){var n=t.origin,o=t.direction;if(!e.equals(n,e.ZERO)){var l=r.geodeticSurfaceNormal(n,x);if(e.dot(o,l)>=0)return n}var u=i(this.rayEllipsoid(t,r)),c=r.transformPositionToScaledSpace(o,x),d=e.normalize(c,c),h=e.mostOrthogonalAxis(c,D),p=e.normalize(e.cross(h,d,P),P),m=e.normalize(e.cross(d,p,A),A),g=M;g[0]=d.x,g[1]=d.y,g[2]=d.z,g[3]=p.x,g[4]=p.y,g[5]=p.z,g[6]=m.x,g[7]=m.y,g[8]=m.z;var v=s.transpose(g,O),_=s.fromScale(r.radii,R),y=s.fromScale(r.oneOverRadii,N),b=k;b[0]=0,b[1]=-o.z,b[2]=o.y,b[3]=o.z,b[4]=0,b[5]=-o.x,b[6]=-o.y,b[7]=o.x,b[8]=0;var C,w,S=s.multiply(s.multiply(v,y,L),b,L),E=s.multiply(s.multiply(S,_,F),g,F),T=s.multiplyByVector(S,n,I),z=f(E,e.negate(T,x),0,0,1),G=z.length;if(G>0){for(var H=e.clone(e.ZERO,U),W=Number.NEGATIVE_INFINITY,j=0;j<G;++j){C=s.multiplyByVector(_,s.multiplyByVector(g,z[j],B),B);var q=e.normalize(e.subtract(C,n,D),D),Y=e.dot(q,o);Y>W&&(W=Y,H=e.clone(C,H))}var X=r.cartesianToCartographic(H,V);return W=a.clamp(W,0,1),w=e.magnitude(e.subtract(H,n,D))*Math.sqrt(1-W*W),w=u?-w:w,X.height=w,r.cartographicToCartesian(X,new e)}};var z=new e;return m.lineSegmentPlane=function(t,r,n,o){i(o)||(o=new e);var s=e.subtract(r,t,z),l=n.normal,u=e.dot(l,s);if(!(Math.abs(u)<a.EPSILON6)){var c=e.dot(l,t),d=-(n.distance+c)/u;if(!(d<0||d>1))return e.multiplyByScalar(s,d,o),e.add(t,o,o),o}},m.trianglePlaneIntersection=function(t,r,i,n){var o=n.normal,a=n.distance,s=e.dot(o,t)+a<0,l=e.dot(o,r)+a<0,u=e.dot(o,i)+a<0,c=0;c+=s?1:0,c+=l?1:0,c+=u?1:0;var d,h;if(1!==c&&2!==c||(d=new e,h=new e),1===c){if(s)return m.lineSegmentPlane(t,r,n,d),m.lineSegmentPlane(t,i,n,h),{positions:[t,r,i,d,h],indices:[0,3,4,1,2,4,1,4,3]};if(l)return m.lineSegmentPlane(r,i,n,d),m.lineSegmentPlane(r,t,n,h),{positions:[t,r,i,d,h],indices:[1,3,4,2,0,4,2,4,3]};if(u)return m.lineSegmentPlane(i,t,n,d),m.lineSegmentPlane(i,r,n,h),{positions:[t,r,i,d,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!s)return m.lineSegmentPlane(r,t,n,d),m.lineSegmentPlane(i,t,n,h),{positions:[t,r,i,d,h],indices:[1,2,4,1,4,3,0,3,4]};if(!l)return m.lineSegmentPlane(i,r,n,d),m.lineSegmentPlane(t,r,n,h),{positions:[t,r,i,d,h],indices:[2,0,4,2,4,3,1,3,4]};if(!u)return m.lineSegmentPlane(t,i,n,d),m.lineSegmentPlane(r,i,n,h),{positions:[t,r,i,d,h],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,r,i,n){"use strict";function o(t,r){this.normal=e.clone(t),this.distance=r}o.fromPointNormal=function(r,i,n){var a=-e.dot(i,r);return t(n)?(e.clone(i,n.normal),n.distance=a,n):new o(i,a)};var a=new e;return o.fromCartesian4=function(r,i){var n=e.fromCartesian4(r,a),s=r.w;return t(i)?(e.clone(n,i.normal),i.distance=s,i):new o(n,s)},o.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},o.ORIGIN_XY_PLANE=n(new o(e.UNIT_Z,0)),o.ORIGIN_YZ_PLANE=n(new o(e.UNIT_X,0)),o.ORIGIN_ZX_PLANE=n(new o(e.UNIT_Y,0)),o}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(r,i){t(n[r])||(n[r]=!0,console.warn(e(i,r)))}var n={};return i.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.",i}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function i(e,t){r(e,t)}return i}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,i,n){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=i,this.ut1MinusUtc=n}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,i=t[r++],n=function(e,t,r,i){r||(r=" ");var n=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return i?e+n:n+e},o=function(e,t,r,i,o,a){var s=i-e.length;return s>0&&(e=r||!o?n(e,i,a,r):e.slice(0,t.length)+n("",s,"0",!0)+e.slice(t.length)),e},a=function(e,t,r,i,a,s,l){var u=e>>>0;return r=r&&u&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+n(u.toString(t),s||0,"0",!1),o(e,r,i,a,l)},s=function(e,t,r,i,n,a){return null!=i&&(e=e.slice(0,i)),o(e,"",t,r,n,a)},l=function(e,i,l,u,c,d,h){var p,f,m,g,v;if("%%"==e)return"%";for(var _=!1,y="",b=!1,C=!1,w=" ",S=l.length,E=0;l&&E<S;E++)switch(l.charAt(E)){case" ":y=" ";break;case"+":y="+";break;case"-":_=!0;break;case"'":w=l.charAt(E+1);break;case"0":b=!0;break;case"#":C=!0}if(u=u?"*"==u?+t[r++]:"*"==u.charAt(0)?+t[u.slice(1,-1)]:+u:0,u<0&&(u=-u,_=!0),!isFinite(u))throw new Error("sprintf: (minimum-)width must be finite");switch(d=d?"*"==d?+t[r++]:"*"==d.charAt(0)?+t[d.slice(1,-1)]:+d:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,v=i?t[i.slice(0,-1)]:t[r++],h){case"s":return s(String(v),_,u,d,b,w);case"c":return s(String.fromCharCode(+v),_,u,d,b);case"b":return a(v,2,C,_,u,d,b);case"o":return a(v,8,C,_,u,d,b);case"x":return a(v,16,C,_,u,d,b);case"X":return a(v,16,C,_,u,d,b).toUpperCase();case"u":return a(v,10,C,_,u,d,b);case"i":case"d":return p=+v||0,p=Math.round(p-p%1),f=p<0?"-":y,v=f+n(String(Math.abs(p)),d,"0",!1),o(v,f,_,u,b);case"e":case"E":case"f":case"F":case"g":case"G":return p=+v,f=p<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],g=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],v=f+Math.abs(p)[m](d),o(v,f,_,u,b)[g]();default:return e}};return i.replace(e,l)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,i,n,o,a,s){this.year=e,this.month=t,this.day=r,this.hour=i,this.minute=n,this.second=o,this.millisecond=a,this.isLeapSecond=s}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t){return m.compare(e.julianDate,t.julianDate)}function d(e){y.julianDate=e;var r=m.leapSeconds,i=t(r,y,c);i<0&&(i=~i),i>=r.length&&(i=r.length-1);var n=r[i].offset;if(i>0){var o=m.secondsDifference(r[i].julianDate,e);o>n&&(i--,n=r[i].offset)}m.addSeconds(e,n,e)}function h(e,r){y.julianDate=e;var i=m.leapSeconds,n=t(i,y,c);if(n<0&&(n=~n),0===n)return m.addSeconds(e,-i[0].offset,r);if(n>=i.length)return m.addSeconds(e,-i[n-1].offset,r);var o=m.secondsDifference(i[n].julianDate,e);return 0===o?m.addSeconds(e,-i[n].offset,r):o<=1?void 0:m.addSeconds(e,-i[--n].offset,r)}function p(e,t,r){var i=t/l.SECONDS_PER_DAY|0;return e+=i,t-=l.SECONDS_PER_DAY*i,t<0&&(e--,t+=l.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function f(e,t,r,i,n,o,a){var s=(t-14)/12|0,u=e+4800+s,c=(1461*u/4|0)+(367*(t-2-12*s)/12|0)-(3*((u+100)/100|0)/4|0)+r-32075;i-=12,i<0&&(i+=24);var d=o+(i*l.SECONDS_PER_HOUR+n*l.SECONDS_PER_MINUTE+a*l.SECONDS_PER_MILLISECOND);return d>=43200&&(c-=1),[c,d]}function m(e,t,i){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),i=r(i,u.UTC);var n=0|e;t+=(e-n)*l.SECONDS_PER_DAY,p(n,t,this),i===u.UTC&&d(this)}var g=new o,v=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,y=new s,b=/^(\d{4})$/,C=/^(\d{4})-(\d{2})$/,w=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,E=/^(\d{4})-?(\d{2})-?(\d{2})$/,T=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+T.source,P=/^(\d{2}):?(\d{2})(\.\d+)?/.source+T.source,A=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+T.source;m.fromDate=function(e,t){var r=f(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return i(t)?(p(r[0],r[1],t),d(t),t):new m(r[0],r[1],u.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var r,n,o,s=e.split("T"),l=1,c=1,h=0,g=0,y=0,T=0,D=s[0],I=s[1];if(s=D.match(E),null!==s)r=+s[1],l=+s[2],c=+s[3];else if(s=D.match(C),null!==s)r=+s[1],l=+s[2];else if(s=D.match(b),null!==s)r=+s[1];else{var M;if(s=D.match(w),null!==s)r=+s[1],M=+s[2],o=a(r);else if(s=D.match(S),null!==s){r=+s[1];var O=+s[2],R=+s[3]||0,N=new Date(Date.UTC(r,0,4));M=7*O+R-N.getUTCDay()-3}n=new Date(Date.UTC(r,0,1)),n.setUTCDate(M),l=n.getUTCMonth()+1,c=n.getUTCDate()}o=a(r);var k;if(i(I)){s=I.match(A),null!==s?(h=+s[1],g=+s[2],y=+s[3],T=1e3*+(s[4]||0),k=5):(s=I.match(P),null!==s?(h=+s[1],g=+s[2],y=60*+(s[3]||0),k=4):(s=I.match(x),null!==s&&(h=+s[1],g=60*+(s[2]||0),k=3)));var L=s[k],F=+s[k+1],B=+(s[k+2]||0);switch(L){case"+":h-=F,g-=B;break;case"-":h+=F,g+=B;break;case"Z":break;default:g+=new Date(Date.UTC(r,l-1,c,h,g)).getTimezoneOffset()}}else g+=new Date(r,l-1,c).getTimezoneOffset();var U=60===y;for(U&&y--;g>=60;)g-=60,h++;for(;h>=24;)h-=24,c++;for(n=o&&2===l?_:v[l-1];c>n;)c-=n,l++,l>12&&(l-=12,r++),n=o&&2===l?_:v[l-1];for(;g<0;)g+=60,h--;for(;h<0;)h+=24,c--;for(;c<1;)l--,l<1&&(l+=12,r--),n=o&&2===l?_:v[l-1],c+=n;var V=f(r,l,c,h,g,y,T);return i(t)?(p(V[0],V[1],t),d(t)):t=new m(V[0],V[1],u.UTC),U&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var D=new m(0,0,u.TAI);return m.toGregorianDate=function(e,t){var r=!1,n=h(e,D);i(n)||(m.addSeconds(e,-1,D),n=h(D,D),r=!0);var a=n.dayNumber,s=n.secondsOfDay;s>=43200&&(a+=1);var u=a+68569|0,c=4*u/146097|0;u=u-((146097*c+3)/4|0)|0;var d=4e3*(u+1)/1461001|0;u=u-(1461*d/4|0)+31|0;var p=80*u/2447|0,f=u-(2447*p/80|0)|0;u=p/11|0;var g=p+2-12*u|0,v=100*(c-49)+d+u|0,_=s/l.SECONDS_PER_HOUR|0,y=s-_*l.SECONDS_PER_HOUR,b=y/l.SECONDS_PER_MINUTE|0;y-=b*l.SECONDS_PER_MINUTE;var C=0|y,w=(y-C)/l.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(C+=1),i(t)?(t.year=v,t.month=g,t.day=f,t.hour=_,t.minute=b,t.second=C,t.millisecond=w,t.isLeapSecond=r,t):new o(v,g,f,_,b,C,w,r)},m.toDate=function(e){var t=m.toGregorianDate(e,g),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},m.toIso8601=function(t,r){var n,o=m.toGregorianDate(t,o);return i(r)||0===o.millisecond?i(r)&&0!==r?(n=(.01*o.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",o.year,o.month,o.day,o.hour,o.minute,o.second):(n=(.01*o.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",o.year,o.month,o.day,o.hour,o.minute,o.second,n))},m.clone=function(e,t){if(i(e))return i(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,u.TAI)},m.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||i(e)&&i(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(m.secondsDifference(e,t))<=r},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/l.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*l.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/l.SECONDS_PER_DAY;return r+i},m.computeTaiMinusUtc=function(e){y.julianDate=e;var r=m.leapSeconds,i=t(r,y,c);return i<0&&(i=~i,--i,i<0&&(i=0)),r[i].offset},m.addSeconds=function(e,t,r){return p(e.dayNumber,e.secondsOfDay+t,r)},m.addMinutes=function(e,t,r){var i=e.secondsOfDay+t*l.SECONDS_PER_MINUTE;return p(e.dayNumber,i,r)},m.addHours=function(e,t,r){var i=e.secondsOfDay+t*l.SECONDS_PER_HOUR;return p(e.dayNumber,i,r)},m.addDays=function(e,t,r){var i=e.dayNumber+t;return p(i,e.secondsOfDay,r)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new s(new m(2441317,43210,u.TAI),10),new s(new m(2441499,43211,u.TAI),11),new s(new m(2441683,43212,u.TAI),12),new s(new m(2442048,43213,u.TAI),13),new s(new m(2442413,43214,u.TAI),14),new s(new m(2442778,43215,u.TAI),15),new s(new m(2443144,43216,u.TAI),16),new s(new m(2443509,43217,u.TAI),17),new s(new m(2443874,43218,u.TAI),18),new s(new m(2444239,43219,u.TAI),19),new s(new m(2444786,43220,u.TAI),20),new s(new m(2445151,43221,u.TAI),21),new s(new m(2445516,43222,u.TAI),22),new s(new m(2446247,43223,u.TAI),23),new s(new m(2447161,43224,u.TAI),24),new s(new m(2447892,43225,u.TAI),25),new s(new m(2448257,43226,u.TAI),26),new s(new m(2448804,43227,u.TAI),27),new s(new m(2449169,43228,u.TAI),28),new s(new m(2449534,43229,u.TAI),29),new s(new m(2450083,43230,u.TAI),30),new s(new m(2450630,43231,u.TAI),31),new s(new m(2451179,43232,u.TAI),32),new s(new m(2453736,43233,u.TAI),33),new s(new m(2454832,43234,u.TAI),34),new s(new m(2456109,43235,u.TAI),35),new s(new m(2457204,43236,u.TAI),36),new s(new m(2457754,43237,u.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,i){if(null===r||"object"!=typeof r)return r;i=e(i,!1);var n=new r.constructor;for(var o in r)if(r.hasOwnProperty(o)){var a=r[o];i&&(a=t(a,i)),n[o]=a}return n}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),i=0;i<r.length;++i){var n=r[i],o=n.indexOf(": ");if(o>0){var a=n.substring(0,o),s=n.substring(o+2);t[a]=s}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,i){this.statusCode=e,this.response=r,this.responseHeaders=i,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(r){var i=new e(r);i.normalize();var n=i.getAuthority();if(t(n)){if(n.indexOf("@")!==-1){var o=n.split("@");n=o[1]}if(n.indexOf(":")===-1){var a=i.getScheme();if(t(a)||(a=window.location.protocol,a=a.substring(0,a.length-1)),"http"===a)n+=":80";else{if("https"!==a)return;n+=":443"}}return n}}var n={},o={};return n.add=function(e,r){var i=e.toLowerCase()+":"+r;t(o[i])||(o[i]=!0)},n.remove=function(e,r){var i=e.toLowerCase()+":"+r;t(o[i])&&delete o[i]},n.contains=function(e){var r=i(e);return!(!t(r)||!t(o[r]))},n.clear=function(){o={}},n}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,i,n,o,a){"use strict";function s(r){r=t(r,t.EMPTY_OBJECT);var i=r.responseType,n=t(r.method,"GET"),o=r.data,a=r.headers,l=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return s.load(t,i,n,o,a,r,l),r.promise})}function l(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function u(e,t){for(var r=l(e,t),i=new ArrayBuffer(r.length),n=new Uint8Array(i),o=0;o<r.length;o++)n[o]=r.charCodeAt(o);return i}function c(e,r){r=t(r,"");var i=e[1],n=!!e[2],o=e[3];switch(r){case"":case"text":return l(n,o);case"arraybuffer":return u(n,o);case"blob":var a=u(n,o);return new Blob([a],{type:i});case"document":var s=new DOMParser;return s.parseFromString(l(n,o),i);case"json":return JSON.parse(l(n,o))}}var d=/^data:(.*?)(;base64)?,(.*)$/;return s.load=function(e,t,i,s,l,u,h){var p=d.exec(e);if(null!==p)return void u.resolve(c(p,t));var f=new XMLHttpRequest;if(a.contains(e)&&(f.withCredentials=!0),r(h)&&r(f.overrideMimeType)&&f.overrideMimeType(h),f.open(i,e,!0),r(l))for(var m in l)l.hasOwnProperty(m)&&f.setRequestHeader(m,l[m]);r(t)&&(f.responseType=t),f.onload=function(){if(f.status<200||f.status>=300)return void u.reject(new n(f.status,f.response,f.getAllResponseHeaders()));var e=f.response,i=f.responseType;if(!r(e)||r(t)&&i!==t)if("json"===t&&"string"==typeof e)try{u.resolve(JSON.parse(e))}catch(e){u.reject(e)}else(""===i||"document"===i)&&r(f.responseXML)&&f.responseXML.hasChildNodes()?u.resolve(f.responseXML):""!==i&&"text"!==i||!r(f.responseText)?u.reject(new o("Invalid XMLHttpRequest response type.")):u.resolve(f.responseText);else u.resolve(e)},f.onerror=function(e){u.reject(new n)},f.send(s)},s.defaultLoad=s.load,s}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,i){"use strict";function n(r,n){return t(n)?t(n.Accept)||(n=e(n),n.Accept=o.Accept):n=o,i(r,n).then(function(e){return JSON.parse(e)})}var o={Accept:"application/json,*/*;q=0.01"};return n}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),i(t.data))f(this,t.data);else if(i(t.url)){var n=this;this._downloadPromise=e(l(t.url),function(e){f(n,e)},function(){n._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else f(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function p(e,t){return a.compare(e.julianDate,t)}function f(e,r){if(!i(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!i(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var n=r.columnNames.indexOf("modifiedJulianDateUtc"),o=r.columnNames.indexOf("xPoleWanderRadians"),l=r.columnNames.indexOf("yPoleWanderRadians"),u=r.columnNames.indexOf("ut1MinusUtcSeconds"),h=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),f=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||o<0||l<0||u<0||h<0||f<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var g=e._samples=r.samples,v=e._dates=[]; +e._dateColumn=n,e._xPoleWanderRadiansColumn=o,e._yPoleWanderRadiansColumn=l,e._ut1MinusUtcSecondsColumn=u,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=f,e._taiMinusUtcSecondsColumn=m,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,y=e._addNewLeapSeconds,b=0,C=g.length;b<C;b+=e._columnCount){var w=g[b+n],S=g[b+m],E=w+c.MODIFIED_JULIAN_DATE_DIFFERENCE,T=new a(E,S,d.TAI);if(v.push(T),y){if(S!==_&&i(_)){var x=a.leapSeconds,P=t(x,T,p);if(P<0){var A=new s(T,S);x.splice(~P,0,A)}}_=S}}}function m(e,t,r,i,n){var o=r*i;n.xPoleWander=t[o+e._xPoleWanderRadiansColumn],n.yPoleWander=t[o+e._yPoleWanderRadiansColumn],n.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],n.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],n.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function g(e,t,r){return t+e*(r-t)}function v(e,t,r,i,n,o,s){var l=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;var u=t[n],c=t[o];if(u.equals(c)||i.equals(u))return m(e,r,n,l,s),s;if(i.equals(c))return m(e,r,o,l,s),s;var d=a.secondsDifference(i,u)/a.secondsDifference(c,u),h=n*l,p=o*l,f=r[h+e._ut1MinusUtcSecondsColumn],v=r[p+e._ut1MinusUtcSecondsColumn],_=v-f;if(_>.5||_<-.5){var y=r[h+e._taiMinusUtcSecondsColumn],b=r[p+e._taiMinusUtcSecondsColumn];y!==b&&(c.equals(i)?f=v:v-=b-y)}return s.xPoleWander=g(d,r[h+e._xPoleWanderRadiansColumn],r[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=g(d,r[h+e._yPoleWanderRadiansColumn],r[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=g(d,r[h+e._xCelestialPoleOffsetRadiansColumn],r[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=g(d,r[h+e._yCelestialPoleOffsetRadiansColumn],r[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=g(d,f,v),s}return h.NONE=o({getPromiseToLoad:function(){return e()},compute:function(e,t){return i(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new n(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,r){if(i(this._samples)){if(i(r)||(r=new n(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var o=this._dates,s=this._lastIndex,l=0,c=0;if(i(s)){var d=o[s],h=o[s+1],p=a.lessThanOrEquals(d,e),f=!i(h),m=f||a.greaterThanOrEquals(h,e);if(p&&m)return l=s,!f&&h.equals(e)&&++l,c=l+1,v(this,o,this._samples,e,l,c,r),r}var g=t(o,e,a.compare,this._dateColumn);return g>=0?(g<o.length-1&&o[g+1].equals(e)&&++g,l=g,c=g):(c=~g,l=c-1,l<0&&(l=0)),this._lastIndex=l,v(this,o,this._samples,e,l,c,r),r}if(i(this._dataError))throw new u(this._dataError)},h}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new o(this._sampleZeroJulianEphemerisDate,0,s.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,i=this._denominators=new Array(t+1),n=this._xTable=new Array(t+1),a=Math.pow(this._stepSizeDays,t),l=0;l<=t;++l){i[l]=a,n[l]=l*this._stepSizeDays;for(var u=0;u<=t;++u)u!==l&&(i[l]*=l-u);i[l]=1/i[l]}this._work=new Array(t+1),this._coef=new Array(t+1)}function u(e,t,r){var i=d;return i.dayNumber=t,i.secondsOfDay=r,o.daysDifference(i,e._sampleZeroDateTT)}function c(r,n){if(r._chunkDownloadsInProgress[n])return r._chunkDownloadsInProgress[n];var o=e.defer();r._chunkDownloadsInProgress[n]=o;var s,l=r._xysFileUrlTemplate;return s=i(l)?l.replace("{0}",n):t("Assets/IAU2006_XYS/IAU2006_XYS_"+n+".json"),e(a(s),function(e){r._chunkDownloadsInProgress[n]=!1;for(var t=r._samples,i=e.samples,a=n*r._samplesPerXysFile*3,s=0,l=i.length;s<l;++s)t[a+s]=i[s];o.resolve()}),o.promise}var d=new o(0,0,s.TAI);return l.prototype.preload=function(t,r,i,n){var o=u(this,t,r),a=u(this,i,n),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);var l=a/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);for(var d=s/this._samplesPerXysFile|0,h=l/this._samplesPerXysFile|0,p=[],f=d;f<=h;++f)p.push(c(this,f));return e.all(p)},l.prototype.computeXysRadians=function(e,t,r){var o=u(this,e,t);if(!(o<0)){var a=o/this._stepSizeDays|0;if(!(a>=this._totalSamples)){var s=this._interpolationOrder,l=a-(s/2|0);l<0&&(l=0);var d=l+s;d>=this._totalSamples&&(d=this._totalSamples-1,l=d-s,l<0&&(l=0));var h=!1,p=this._samples;if(i(p[3*l])||(c(this,l/this._samplesPerXysFile|0),h=!0),i(p[3*d])||(c(this,d/this._samplesPerXysFile|0),h=!0),!h){i(r)?(r.x=0,r.y=0,r.s=0):r=new n(0,0,0);var f,m,g=o-l*this._stepSizeDays,v=this._work,_=this._denominators,y=this._coef,b=this._xTable;for(f=0;f<=s;++f)v[f]=g-b[f];for(f=0;f<=s;++f){for(y[f]=1,m=0;m<=s;++m)m!==f&&(y[f]*=v[m]);y[f]*=_[f];var C=3*(l+f);r.x+=y[f]*p[C++],r.y+=y[f]*p[C++],r.s+=y[f]*p[C]}return r}}}},l}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(t,r,i){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(i,0)}return n.fromQuaternion=function(e,r){t(r)||(r=new n);var i=2*(e.w*e.y-e.z*e.x),o=1-2*(e.x*e.x+e.y*e.y),a=2*(e.w*e.x+e.y*e.z),s=1-2*(e.y*e.y+e.z*e.z),l=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(l,s),r.roll=Math.atan2(a,o),r.pitch=-Math.asin(i),r},n.fromDegrees=function(e,r,o,a){return t(a)||(a=new n),a.heading=e*i.RADIANS_PER_DEGREE,a.pitch=r*i.RADIANS_PER_DEGREE,a.roll=o*i.RADIANS_PER_DEGREE,a},n.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new n(e.heading,e.pitch,e.roll)},n.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},n.equalsEpsilon=function(e,r,n,o){return e===r||t(e)&&t(r)&&i.equalsEpsilon(e.heading,r.heading,n,o)&&i.equalsEpsilon(e.pitch,r.pitch,n,o)&&i.equalsEpsilon(e.roll,r.roll,n,o)},n.prototype.clone=function(e){return n.clone(this,e)},n.prototype.equals=function(e){return n.equals(this,e)},n.prototype.equalsEpsilon=function(e,t,r){return n.equalsEpsilon(this,e,t,r)},n.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},n}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,i,n){this.x=r(e,0),this.y=r(t,0),this.z=r(i,0),this.w=r(n,0)}var d=new e;c.fromAxisAngle=function(t,r,n){var o=r/2,a=Math.sin(o);d=e.normalize(t,d);var s=d.x*a,l=d.y*a,u=d.z*a,h=Math.cos(o);return i(n)?(n.x=s,n.y=l,n.z=u,n.w=h,n):new c(s,l,u,h)};var h=[1,2,0],p=new Array(3);c.fromRotationMatrix=function(e,t){var r,n,o,a,s,l=e[u.COLUMN0ROW0],d=e[u.COLUMN1ROW1],f=e[u.COLUMN2ROW2],m=l+d+f;if(m>0)r=Math.sqrt(m+1),s=.5*r,r=.5/r,n=(e[u.COLUMN1ROW2]-e[u.COLUMN2ROW1])*r,o=(e[u.COLUMN2ROW0]-e[u.COLUMN0ROW2])*r,a=(e[u.COLUMN0ROW1]-e[u.COLUMN1ROW0])*r;else{var g=h,v=0;d>l&&(v=1),f>l&&f>d&&(v=2);var _=g[v],y=g[_];r=Math.sqrt(e[u.getElementIndex(v,v)]-e[u.getElementIndex(_,_)]-e[u.getElementIndex(y,y)]+1);var b=p;b[v]=.5*r,r=.5/r,s=(e[u.getElementIndex(y,_)]-e[u.getElementIndex(_,y)])*r,b[_]=(e[u.getElementIndex(_,v)]+e[u.getElementIndex(v,_)])*r,b[y]=(e[u.getElementIndex(y,v)]+e[u.getElementIndex(v,y)])*r,n=-b[0],o=-b[1],a=-b[2]}return i(t)?(t.x=n,t.y=o,t.z=a,t.w=s,t):new c(n,o,a,s)};var f=new c,m=new c,g=new c,v=new c;c.fromHeadingPitchRoll=function(t,r,i,o){var a;return t instanceof s?(a=t,o=r):(n("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),a=new s(t,r,i)),v=c.fromAxisAngle(e.UNIT_X,a.roll,f),g=c.fromAxisAngle(e.UNIT_Y,-a.pitch,o),o=c.multiply(g,v,g),m=c.fromAxisAngle(e.UNIT_Z,-a.heading,f),c.multiply(m,o,o)};var _=new e,y=new e,b=new c,C=new c,w=new c;c.packedLength=4,c.pack=function(e,t,i){return i=r(i,0),t[i++]=e.x,t[i++]=e.y,t[i++]=e.z,t[i]=e.w,t},c.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new c),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,r,i){c.unpack(e,4*r,w),c.conjugate(w,w);for(var n=0,o=r-t+1;n<o;n++){var a=3*n;c.unpack(e,4*(t+n),b),c.multiply(b,w,b),b.w<0&&c.negate(b,b),c.computeAxis(b,_);var s=c.computeAngle(b);i[a]=_.x*s,i[a+1]=_.y*s,i[a+2]=_.z*s}},c.unpackInterpolationResult=function(t,r,n,o,a){i(a)||(a=new c),e.fromArray(t,0,y);var s=e.magnitude(y);return c.unpack(r,4*o,C),0===s?c.clone(c.IDENTITY,b):c.fromAxisAngle(y,s,b),c.multiply(b,C,a)},c.clone=function(e,t){if(i(e))return i(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var r=1/c.magnitude(e),i=e.x*r,n=e.y*r,o=e.z*r,a=e.w*r;return t.x=i,t.y=n,t.z=o,t.w=a,t},c.inverse=function(e,t){var r=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/r,t)},c.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},c.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,r){var i=e.x,n=e.y,o=e.z,a=e.w,s=t.x,l=t.y,u=t.z,c=t.w,d=a*s+i*c+n*u-o*l,h=a*l-i*u+n*c+o*s,p=a*u+i*l-n*s+o*c,f=a*c-i*s-n*l-o*u;return r.x=d,r.y=h,r.z=p,r.w=f,r},c.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},c.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},c.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<l.EPSILON6)return t.x=t.y=t.z=0,t;var i=1/Math.sqrt(1-r*r);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t},c.computeAngle=function(e){return Math.abs(e.w-1)<l.EPSILON6?0:2*Math.acos(e.w)};var S=new c;c.lerp=function(e,t,r,i){return S=c.multiplyByScalar(t,r,S),i=c.multiplyByScalar(e,1-r,i),c.add(S,i,i)};var E=new c,T=new c,x=new c;c.slerp=function(e,t,r,i){var n=c.dot(e,t),o=t;if(n<0&&(n=-n,o=E=c.negate(t,E)),1-n<l.EPSILON6)return c.lerp(e,o,r,i);var a=Math.acos(n);return T=c.multiplyByScalar(e,Math.sin((1-r)*a),T),x=c.multiplyByScalar(o,Math.sin(r*a),x),i=c.add(T,x,i),c.multiplyByScalar(i,1/Math.sin(a),i)},c.log=function(t,r){var i=l.acosClamped(t.w),n=0;return 0!==i&&(n=i/Math.sin(i)),e.multiplyByScalar(t,n,r)},c.exp=function(t,r){var i=e.magnitude(t),n=0;return 0!==i&&(n=Math.sin(i)/i),r.x=t.x*n,r.y=t.y*n,r.z=t.z*n,r.w=Math.cos(i),r};var P=new e,A=new e,D=new c,I=new c;c.computeInnerQuadrangle=function(t,r,i,n){var o=c.conjugate(r,D);c.multiply(o,i,I);var a=c.log(I,P);c.multiply(o,t,I);var s=c.log(I,A);return e.add(a,s,a),e.multiplyByScalar(a,.25,a),e.negate(a,a),c.exp(a,D),c.multiply(r,D,n)},c.squad=function(e,t,r,i,n,o){var a=c.slerp(e,t,n,D),s=c.slerp(r,i,n,I);return c.slerp(a,s,2*n*(1-n),o)};for(var M=new c,O=1.9011074535173003,R=o.supportsTypedArrays()?new Float32Array(8):[],N=o.supportsTypedArrays()?new Float32Array(8):[],k=o.supportsTypedArrays()?new Float32Array(8):[],L=o.supportsTypedArrays()?new Float32Array(8):[],F=0;F<7;++F){var B=F+1,U=2*B+1;R[F]=1/(B*U),N[F]=B/U}return R[7]=O/136,N[7]=8*O/17,c.fastSlerp=function(e,t,r,i){var n,o=c.dot(e,t);o>=0?n=1:(n=-1,o=-o);for(var a=o-1,s=1-r,l=r*r,u=s*s,d=7;d>=0;--d)k[d]=(R[d]*l-N[d])*a,L[d]=(R[d]*u-N[d])*a;var h=n*r*(1+k[0]*(1+k[1]*(1+k[2]*(1+k[3]*(1+k[4]*(1+k[5]*(1+k[6]*(1+k[7])))))))),p=s*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),f=c.multiplyByScalar(e,p,M);return c.multiplyByScalar(t,h,i),c.add(f,i,i)},c.fastSquad=function(e,t,r,i,n,o){var a=c.fastSlerp(e,t,n,D),s=c.fastSlerp(r,i,n,I);return c.fastSlerp(a,s,2*n*(1-n),o)},c.equals=function(e,t){return e===t||i(e)&&i(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},c.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},c.ZERO=a(new c(0,0,0,0)),c.IDENTITY=a(new c(0,0,0,1)),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b){"use strict";var C={},w={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},S={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},E={},T={east:new r,north:new r,up:new r,west:new r,south:new r,down:new r},x=new r,P=new r,A=new r;C.localFrameToFixedFrameGenerator=function(e,t){if(!w.hasOwnProperty(e)||!w[e].hasOwnProperty(t))throw new u("firstAxis and secondAxis must be east, north, up, west, south or down.");var i,n=w[e][t],o=e+t;return s(E[o])?i=E[o]:(i=function(i,o,l){if(s(l)||(l=new _),g.equalsEpsilon(i.x,0,g.EPSILON14)&&g.equalsEpsilon(i.y,0,g.EPSILON14)){var u=g.sign(i.z);r.unpack(S[e],0,x),"east"!==e&&"west"!==e&&r.multiplyByScalar(x,u,x),r.unpack(S[t],0,P),"east"!==t&&"west"!==t&&r.multiplyByScalar(P,u,P),r.unpack(S[n],0,A),"east"!==n&&"west"!==n&&r.multiplyByScalar(A,u,A)}else{o=a(o,h.WGS84),o.geodeticSurfaceNormal(i,T.up);var c=T.up,d=T.east;d.x=-i.y,d.y=i.x,d.z=0,r.normalize(d,T.east),r.cross(c,d,T.north),r.multiplyByScalar(T.up,-1,T.down),r.multiplyByScalar(T.east,-1,T.west),r.multiplyByScalar(T.north,-1,T.south),x=T[e],P=T[t],A=T[n]}return l[0]=x.x,l[1]=x.y,l[2]=x.z,l[3]=0,l[4]=P.x,l[5]=P.y,l[6]=P.z,l[7]=0,l[8]=A.x,l[9]=A.y,l[10]=A.z,l[11]=0,l[12]=i.x,l[13]=i.y,l[14]=i.z,l[15]=1,l},E[o]=i),i},C.eastNorthUpToFixedFrame=C.localFrameToFixedFrameGenerator("east","north"),C.northEastDownToFixedFrame=C.localFrameToFixedFrameGenerator("north","east"),C.northUpEastToFixedFrame=C.localFrameToFixedFrameGenerator("north","up"),C.northWestUpToFixedFrame=C.localFrameToFixedFrameGenerator("north","west");var D=new y,I=new r(1,1,1),M=new _;C.headingPitchRollToFixedFrame=function(e,t,i,n,o){n instanceof _&&(o=n,n=void 0,l("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),n=a(n,C.eastNorthUpToFixedFrame);var s=y.fromHeadingPitchRoll(t,D),u=_.fromTranslationQuaternionRotationScale(r.ZERO,s,I,M);return o=n(e,i,o),_.multiply(o,u,o)};var O=new _,R=new v;C.headingPitchRollQuaternion=function(e,t,r,i,n){i instanceof y&&(n=i,i=void 0,l("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var o=C.headingPitchRollToFixedFrame(e,t,r,i,O),a=_.getRotation(o,R);return y.fromRotationMatrix(a,n)};var N=24110.54841,k=8640184.812866,L=.093104,F=-62e-7,B=1.1772758384668e-19,U=72921158553e-15,V=g.TWO_PI/86400,z=new m;C.computeTemeToPseudoFixedMatrix=function(e,t){z=m.addSeconds(e,-m.computeTaiMinusUtc(e),z);var r,i=z.dayNumber,n=z.secondsOfDay,o=i-2451545;r=n>=43200?(o+.5)/b.DAYS_PER_JULIAN_CENTURY:(o-.5)/b.DAYS_PER_JULIAN_CENTURY;var a=N+r*(k+r*(L+r*F)),l=a*V%g.TWO_PI,u=U+B*(i-2451545.5),c=(n+.5*b.SECONDS_PER_DAY)%b.SECONDS_PER_DAY,d=l+u*c,h=Math.cos(d),p=Math.sin(d);return s(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new v(h,p,0,-p,h,0,0,0,1)},C.iau2006XysData=new p,C.earthOrientationParameters=c.NONE;var G=32.184,H=2451545;C.preloadIcrfFixed=function(t){var r=t.start.dayNumber,i=t.start.secondsOfDay+G,n=t.stop.dayNumber,o=t.stop.secondsOfDay+G,a=C.iau2006XysData.preload(r,i,n,o),s=C.earthOrientationParameters.getPromiseToLoad();return e.all([a,s])},C.computeIcrfToFixedMatrix=function(e,t){s(t)||(t=new v);var r=C.computeFixedToIcrfMatrix(e,t);if(s(r))return v.transpose(r,t)};var W=new f(0,0,0),j=new d(0,0,0,0,0,0),q=new v,Y=new v;C.computeFixedToIcrfMatrix=function(e,t){s(t)||(t=new v);var r=C.earthOrientationParameters.compute(e,j);if(s(r)){var i=e.dayNumber,n=e.secondsOfDay+G,o=C.iau2006XysData.computeXysRadians(i,n,W);if(s(o)){var a=o.x+r.xPoleOffset,l=o.y+r.yPoleOffset,u=1/(1+Math.sqrt(1-a*a-l*l)),c=q;c[0]=1-u*a*a,c[3]=-u*a*l,c[6]=a,c[1]=-u*a*l,c[4]=1-u*l*l,c[7]=l,c[2]=-a,c[5]=-l,c[8]=1-u*(a*a+l*l);var d=v.fromRotationZ(-o.s,Y),h=v.multiply(c,d,q),p=e.dayNumber,f=e.secondsOfDay-m.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=p-2451545,y=f/b.SECONDS_PER_DAY,w=.779057273264+y+.00273781191135448*(_+y);w=w%1*g.TWO_PI;var S=v.fromRotationZ(w,Y),E=v.multiply(h,S,q),T=Math.cos(r.xPoleWander),x=Math.cos(r.yPoleWander),P=Math.sin(r.xPoleWander),A=Math.sin(r.yPoleWander),D=i-H+n/b.SECONDS_PER_DAY;D/=36525;var I=-47e-6*D*g.RADIANS_PER_DEGREE/3600,M=Math.cos(I),O=Math.sin(I),R=Y;return R[0]=T*M,R[1]=T*O,R[2]=P,R[3]=-x*O+A*P*M,R[4]=x*M+A*P*O,R[5]=-A*T,R[6]=-A*O-x*P*M,R[7]=A*M-x*P*O,R[8]=x*T,v.multiply(E,R,t)}}};var X=new i;C.pointToWindowCoordinates=function(e,t,r,i){return i=C.pointToGLWindowCoordinates(e,t,r,i),i.y=2*t[5]-i.y,i},C.pointToGLWindowCoordinates=function(e,r,n,o){s(o)||(o=new t);var a=X;return _.multiplyByVector(e,i.fromElements(n.x,n.y,n.z,1,a),a),i.multiplyByScalar(a,1/a.w,a),_.multiplyByVector(r,a,a),t.fromCartesian4(a,o)};var Q=new r,Z=new r,K=new r;C.rotationMatrixFromPositionVelocity=function(e,t,i,n){var o=a(i,h.WGS84).geodeticSurfaceNormal(e,Q),l=r.cross(t,o,Z);r.equalsEpsilon(l,r.ZERO,g.EPSILON6)&&(l=r.clone(r.UNIT_X,l));var u=r.cross(l,t,K);return r.cross(t,u,l),r.negate(l,l),s(n)||(n=new v),n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=l.x,n[4]=l.y,n[5]=l.z,n[6]=u.x,n[7]=u.y,n[8]=u.z,n};var J=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new n,ee=new r,te=new r,re=new v,ie=new _,ne=new _;return C.basisTo2D=function(e,t,i){var n=_.getTranslation(t,te),o=e.ellipsoid,a=o.cartesianToCartographic(n,$),s=e.project(a,ee);r.fromElements(s.z,s.x,s.y,s);var l=C.eastNorthUpToFixedFrame(n,o,ie),u=_.inverseTransformation(l,ne),c=_.getRotation(t,re),d=_.multiplyByMatrix3(u,c,i);return _.multiply(J,d,i),_.setTranslation(i,s,i),i},C.wgs84To2DModelMatrix=function(e,t,i){var n=e.ellipsoid,o=C.eastNorthUpToFixedFrame(t,n,ie),a=_.inverseTransformation(o,ne),s=n.cartesianToCartographic(t,$),l=e.project(s,ee);r.fromElements(l.z,l.x,l.y,l);var u=_.fromTranslation(l,ie);return _.multiply(J,a,i),_.multiply(u,i,i),i},C}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t){t=n(t,l.WGS84),e=t.scaleToGeodeticSurface(e);var i=p.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(c.getColumn(i,0,m)),this._yAxis=r.fromCartesian4(c.getColumn(i,1,m));var o=r.fromCartesian4(c.getColumn(i,2,m));this._plane=d.fromPointNormal(e,o)}var m=new i;a(f.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var g=new e;f.fromPoints=function(t,r){var i=e.fromPoints(t,g);return new f(i.center,r)};var v=new h,_=new r;f.prototype.projectPointOntoPlane=function(e,i){var n=v;n.origin=e,r.normalize(e,n.direction);var a=u.rayPlane(n,this._plane,_);if(o(a)||(r.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,_)),o(a)){var s=r.subtract(a,this._origin,a),l=r.dot(this._xAxis,s),c=r.dot(this._yAxis,s);return o(i)?(i.x=l,i.y=c,i):new t(l,c)}},f.prototype.projectPointsOntoPlane=function(e,t){o(t)||(t=[]);for(var r=0,i=e.length,n=0;n<i;n++){var a=this.projectPointOntoPlane(e[n],t[r]);o(a)&&(t[r]=a,r++)}return t.length=r,t},f.prototype.projectPointToNearestOnPlane=function(e,i){o(i)||(i=new t);var n=v;n.origin=e,r.clone(this._plane.normal,n.direction);var a=u.rayPlane(n,this._plane,_);o(a)||(r.negate(n.direction,n.direction),a=u.rayPlane(n,this._plane,_));var s=r.subtract(a,this._origin,a),l=r.dot(this._xAxis,s),c=r.dot(this._yAxis,s);return i.x=l,i.y=c,i},f.prototype.projectPointsToNearestOnPlane=function(e,t){o(t)||(t=[]);var r=e.length;t.length=r;for(var i=0;i<r;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var y=new r;return f.prototype.projectPointsOntoEllipsoid=function(e,t){var i=e.length;o(t)?t.length=i:t=new Array(i);for(var n=this._ellipsoid,a=this._origin,s=this._xAxis,l=this._yAxis,u=y,c=0;c<i;++c){var d=e[c];r.multiplyByScalar(s,d.x,u),o(t[c])||(t[c]=new r);var h=r.add(a,u,t[c]);r.multiplyByScalar(l,d.y,u),r.add(h,u,h),n.scaleToGeocentricSurface(h,h)}return t},f}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e,t){this.center=r.clone(n(e,r.ZERO)),this.halfAxes=h.clone(n(t,h.ZERO))}function g(e,t,i,n,a,s,l,u){o(u)||(u=new m);var c=u.halfAxes;h.setColumn(c,0,e.xAxis,c),h.setColumn(c,1,e.yAxis,c),h.setColumn(c,2,e.zAxis,c);var d=T;d.x=(t+i)/2,d.y=(n+a)/2,d.z=(s+l)/2;var p=x;p.x=(i-t)/2,p.y=(a-n)/2,p.z=(l-s)/2;var f=u.center;return d=h.multiplyByVector(c,d,d),r.add(e.origin,d,f),h.multiplyByScale(c,p,c),u}var v=new r,_=new r,y=new r,b=new r,C=new r,w=new r,S=new h,E={unitary:new h,diagonal:new h};m.fromPoints=function(e,t){if(o(t)||(t=new m),!o(e)||0===e.length)return t.halfAxes=h.ZERO,t.center=r.ZERO,t;var i,n=e.length,a=r.clone(e[0],v);for(i=1;i<n;i++)r.add(a,e[i],a);var s=1/n;r.multiplyByScalar(a,s,a);var l,u=0,c=0,d=0,p=0,f=0,g=0;for(i=0;i<n;i++)l=r.subtract(e[i],a,_),u+=l.x*l.x,c+=l.x*l.y,d+=l.x*l.z,p+=l.y*l.y,f+=l.y*l.z,g+=l.z*l.z;u*=s,c*=s,d*=s,p*=s,f*=s,g*=s;var T=S;T[0]=u,T[1]=c,T[2]=d,T[3]=c,T[4]=p,T[5]=f,T[6]=d,T[7]=f,T[8]=g;var x=h.computeEigenDecomposition(T,E),P=h.clone(x.unitary,t.halfAxes),A=h.getColumn(P,0,b),D=h.getColumn(P,1,C),I=h.getColumn(P,2,w),M=-Number.MAX_VALUE,O=-Number.MAX_VALUE,R=-Number.MAX_VALUE,N=Number.MAX_VALUE,k=Number.MAX_VALUE,L=Number.MAX_VALUE;for(i=0;i<n;i++)l=e[i],M=Math.max(r.dot(A,l),M),O=Math.max(r.dot(D,l),O),R=Math.max(r.dot(I,l),R),N=Math.min(r.dot(A,l),N),k=Math.min(r.dot(D,l),k),L=Math.min(r.dot(I,l),L);A=r.multiplyByScalar(A,.5*(N+M),A),D=r.multiplyByScalar(D,.5*(k+O),D),I=r.multiplyByScalar(I,.5*(L+R),I);var F=r.add(A,D,t.center);r.add(F,I,F);var B=y;return B.x=M-N,B.y=O-k,B.z=R-L,r.multiplyByScalar(B,.5,B),h.multiplyByScale(t.halfAxes,B,t.halfAxes),t};var T=new r,x=new r,P=new i,A=new r,D=[new i,new i,new i,new i,new i,new i,new i,new i],I=[new r,new r,new r,new r,new r,new r,new r,new r],M=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,r,i,o){t=n(t,0),r=n(r,0),i=n(i,s.WGS84);var a=f.center(e,P),u=i.cartographicToCartesian(a,A),c=new l(u,i),d=c.plane,h=D[0],m=D[1],v=D[2],_=D[3],y=D[4],b=D[5],C=D[6],w=D[7],S=a.longitude,E=e.south<0&&e.north>0?0:a.latitude;C.latitude=b.latitude=y.latitude=e.south,w.latitude=_.latitude=E,h.latitude=m.latitude=v.latitude=e.north,C.longitude=w.longitude=h.longitude=e.west,b.longitude=m.longitude=S,y.longitude=_.longitude=v.longitude=e.east,v.height=m.height=h.height=w.height=C.height=b.height=y.height=_.height=r,i.cartographicArrayToCartesianArray(D,I),c.projectPointsToNearestOnPlane(I,M);var T=Math.min(M[6].x,M[7].x,M[0].x),x=Math.max(M[2].x,M[3].x,M[4].x),O=Math.min(M[4].y,M[5].y,M[6].y),R=Math.max(M[0].y,M[1].y,M[2].y);v.height=h.height=y.height=C.height=t,i.cartographicArrayToCartesianArray(D,I);var N=Math.min(p.getPointDistance(d,I[0]),p.getPointDistance(d,I[2]),p.getPointDistance(d,I[4]),p.getPointDistance(d,I[6])),k=r;return g(c,T,x,O,R,N,k,o)},m.clone=function(e,t){if(o(e))return o(t)?(r.clone(e.center,t.center),h.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var i=e.center,n=t.normal,o=e.halfAxes,a=n.x,s=n.y,l=n.z,c=Math.abs(a*o[h.COLUMN0ROW0]+s*o[h.COLUMN0ROW1]+l*o[h.COLUMN0ROW2])+Math.abs(a*o[h.COLUMN1ROW0]+s*o[h.COLUMN1ROW1]+l*o[h.COLUMN1ROW2])+Math.abs(a*o[h.COLUMN2ROW0]+s*o[h.COLUMN2ROW1]+l*o[h.COLUMN2ROW2]),d=r.dot(n,i)+t.distance;return d<=-c?u.OUTSIDE:d>=c?u.INSIDE:u.INTERSECTING};var O=new r,R=new r,N=new r,k=new r;m.distanceSquaredTo=function(e,t){var i=r.subtract(t,e.center,T),n=e.halfAxes,o=h.getColumn(n,0,O),a=h.getColumn(n,1,R),s=h.getColumn(n,2,N),l=r.magnitude(o),u=r.magnitude(a),c=r.magnitude(s);r.normalize(o,o),r.normalize(a,a),r.normalize(s,s);var d=k;d.x=r.dot(i,o),d.y=r.dot(i,a),d.z=r.dot(i,s);var p,f=0;return d.x<-l?(p=d.x+l,f+=p*p):d.x>l&&(p=d.x-l,f+=p*p),d.y<-u?(p=d.y+u,f+=p*p):d.y>u&&(p=d.y-u,f+=p*p),d.z<-c?(p=d.z+c,f+=p*p):d.z>c&&(p=d.z-c,f+=p*p),f};var L=new r,F=new r;m.computePlaneDistances=function(e,t,i,n){o(n)||(n=new c);var a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=e.center,u=e.halfAxes,d=h.getColumn(u,0,O),p=h.getColumn(u,1,R),f=h.getColumn(u,2,N),m=r.add(d,p,L);r.add(m,f,m),r.add(m,l,m);var g=r.subtract(m,t,F),v=r.dot(i,g);return a=Math.min(v,a),s=Math.max(v,s),r.add(l,d,m),r.add(m,p,m),r.subtract(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),r.add(l,d,m),r.subtract(m,p,m),r.add(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),r.add(l,d,m),r.subtract(m,p,m),r.subtract(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),r.subtract(l,d,m),r.add(m,p,m),r.add(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),r.subtract(l,d,m),r.add(m,p,m),r.subtract(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),r.subtract(l,d,m),r.subtract(m,p,m),r.add(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),r.subtract(l,d,m),r.subtract(m,p,m),r.subtract(m,f,m),r.subtract(m,t,g),v=r.dot(i,g),a=Math.min(v,a),s=Math.max(v,s),n.start=a,n.stop=s,n};var B=new e;return m.isOccluded=function(t,r){var i=e.fromOrientedBoundingBox(t,B);return!r.isBoundingSphereVisible(i)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,r){return m.computePlaneDistances(this,e,t,r)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||o(e)&&o(t)&&r.equals(e.center,t.center)&&h.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t,i,a,u,h){var g,v,_,y;if(o(e)&&o(t)&&o(i)&&o(a)){var b=e.minimum,C=e.maximum,w=r.subtract(C,b,d),S=i-t,E=Math.max(r.maximumComponent(w),S);g=E<m-1?l.BITS12:l.NONE,v=e.center,_=s.inverseTransformation(a,new s);var T=r.negate(b,c);s.multiply(s.fromTranslation(T,p),_,_);var x=c;x.x=1/w.x,x.y=1/w.y,x.z=1/w.z,s.multiply(s.fromScale(x,p),_,_),y=s.clone(a),s.setTranslation(y,r.ZERO,y),a=s.clone(a,new s);var P=s.fromTranslation(b,p),A=s.fromScale(w,f),D=s.multiply(P,A,p);s.multiply(a,D,a),s.multiply(y,D,y)}this.quantization=g,this.minimumHeight=t,this.maximumHeight=i,this.center=v,this.toScaledENU=_,this.fromScaledENU=a,this.matrix=y,this.hasVertexNormals=u,this.hasWebMercatorT=n(h,!1)}var c=new r,d=new r,h=new t,p=new s,f=new s,m=Math.pow(2,12);u.prototype.encode=function(i,n,o,u,d,p,f){var m=u.x,g=u.y;if(this.quantization===l.BITS12){o=s.multiplyByPoint(this.toScaledENU,o,c),o.x=a.clamp(o.x,0,1),o.y=a.clamp(o.y,0,1),o.z=a.clamp(o.z,0,1);var v=this.maximumHeight-this.minimumHeight,_=a.clamp((d-this.minimumHeight)/v,0,1);t.fromElements(o.x,o.y,h);var y=e.compressTextureCoordinates(h);t.fromElements(o.z,_,h);var b=e.compressTextureCoordinates(h);t.fromElements(m,g,h);var C=e.compressTextureCoordinates(h);if(i[n++]=y,i[n++]=b,i[n++]=C,this.hasWebMercatorT){t.fromElements(f,0,h);var w=e.compressTextureCoordinates(h);i[n++]=w}}else r.subtract(o,this.center,c),i[n++]=c.x,i[n++]=c.y,i[n++]=c.z,i[n++]=d,i[n++]=m,i[n++]=g,this.hasWebMercatorT&&(i[n++]=f);return this.hasVertexNormals&&(i[n++]=e.octPackFloat(p)),n},u.prototype.decodePosition=function(t,i,n){if(o(n)||(n=new r),i*=this.getStride(),this.quantization===l.BITS12){var a=e.decompressTextureCoordinates(t[i],h);n.x=a.x,n.y=a.y;var u=e.decompressTextureCoordinates(t[i+1],h);return n.z=u.x,s.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=t[i],n.y=t[i+1],n.z=t[i+2],r.add(n,this.center,n)},u.prototype.decodeTextureCoordinates=function(r,i,n){return o(n)||(n=new t),i*=this.getStride(),this.quantization===l.BITS12?e.decompressTextureCoordinates(r[i+2],n):t.fromElements(r[i+4],r[i+5],n)},u.prototype.decodeHeight=function(t,r){if(r*=this.getStride(),this.quantization===l.BITS12){var i=e.decompressTextureCoordinates(t[r+1],h);return i.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[r+3]},u.prototype.getOctEncodedNormal=function(e,r,i){var n=this.getStride();r=(r+1)*n-1;var o=e[r]/256,a=Math.floor(o),s=256*(o-a);return t.fromElements(a,s,i)},u.prototype.getStride=function(){var e;switch(this.quantization){case l.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var g={position3DAndHeight:0,textureCoordAndEncodedNormals:1},v={compressed0:0,compressed1:1};return u.prototype.getAttributes=function(e){var t,r=i.FLOAT,n=i.getSizeInBytes(r);if(this.quantization===l.NONE){var o=4,a=2;return this.hasWebMercatorT&&++a,this.hasVertexNormals&&++a,t=(o+a)*n,[{index:g.position3DAndHeight,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:o,offsetInBytes:0,strideInBytes:t},{index:g.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:a,offsetInBytes:o*n,strideInBytes:t}]}var s=3,u=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++s, +this.hasWebMercatorT&&this.hasVertexNormals?(++u,t=(s+u)*n,[{index:v.compressed0,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:s,offsetInBytes:0,strideInBytes:t},{index:v.compressed1,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:u,offsetInBytes:s*n,strideInBytes:t}]):[{index:v.compressed0,vertexBuffer:e,componentDatatype:r,componentsPerAttribute:s}]},u.prototype.getAttributeLocations=function(){return this.quantization===l.NONE?g:v},u.clone=function(e,t){return o(t)||(t=new u),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=r.clone(e.center),t.toScaledENU=s.clone(e.toScaledENU),t.fromScaledENU=s.clone(e.fromScaledENU),t.matrix=s.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},u}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){this._ellipsoid=r(e,a.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return n(l.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),l.mercatorAngleToGeodeticLatitude=function(e){return s.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},l.geodeticLatitudeToMercatorAngle=function(e){e>l.MaximumLatitude?e=l.MaximumLatitude:e<-l.MaximumLatitude&&(e=-l.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},l.MaximumLatitude=l.mercatorAngleToGeodeticLatitude(Math.PI),l.prototype.project=function(t,r){var n=this._semimajorAxis,o=t.longitude*n,a=l.geodeticLatitudeToMercatorAngle(t.latitude)*n,s=t.height;return i(r)?(r.x=o,r.y=a,r.z=s,r):new e(o,a,s)},l.prototype.unproject=function(e,r){var n=this._oneOverSemimajorAxis,o=e.x*n,a=l.mercatorAngleToGeodeticLatitude(e.y*n),s=e.z;return i(r)?(r.longitude=o,r.latitude=a,r.height=s,r):new t(o,a,s)},l}),define("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";var v={};v.DEFAULT_STRUCTURE=u({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var _=new i,y=new d,b=new i,C=new i;return v.computeVertices=function(a){var u,w,S,E,T=Math.cos,x=Math.sin,P=Math.sqrt,A=Math.atan,D=Math.exp,I=c.PI_OVER_TWO,M=c.toRadians,O=a.heightmap,R=a.width,N=a.height,k=a.skirtHeight,L=n(a.isGeographic,!0),F=n(a.ellipsoid,s.WGS84),B=1/F.maximumRadius,U=a.nativeRectangle,V=a.rectangle;o(V)?(u=V.west,w=V.south,S=V.east,E=V.north):L?(u=M(U.west),w=M(U.south),S=M(U.east),E=M(U.north)):(u=U.west*B,w=I-2*A(D(-U.south*B)),S=U.east*B,E=I-2*A(D(-U.north*B)));var z=a.relativeToCenter,G=o(z);z=G?z:i.ZERO;var H,W,j=n(a.exaggeration,1),q=n(a.includeWebMercatorT,!1),Y=n(a.structure,v.DEFAULT_STRUCTURE),X=n(Y.heightScale,v.DEFAULT_STRUCTURE.heightScale),Q=n(Y.heightOffset,v.DEFAULT_STRUCTURE.heightOffset),Z=n(Y.elementsPerHeight,v.DEFAULT_STRUCTURE.elementsPerHeight),K=n(Y.stride,v.DEFAULT_STRUCTURE.stride),J=n(Y.elementMultiplier,v.DEFAULT_STRUCTURE.elementMultiplier),$=n(Y.isBigEndian,v.DEFAULT_STRUCTURE.isBigEndian),ee=p.computeWidth(U),te=p.computeHeight(U),re=ee/(R-1),ie=te/(N-1),ne=F.radiiSquared,oe=ne.x,ae=ne.y,se=ne.z,le=65536,ue=-65536,ce=m.eastNorthUpToFixedFrame(z,F),de=d.inverseTransformation(ce,y);q&&(H=g.geodeticLatitudeToMercatorAngle(w),W=1/(g.geodeticLatitudeToMercatorAngle(E)-H));var he=b;he.x=Number.POSITIVE_INFINITY,he.y=Number.POSITIVE_INFINITY,he.z=Number.POSITIVE_INFINITY;var pe=C;pe.x=Number.NEGATIVE_INFINITY,pe.y=Number.NEGATIVE_INFINITY,pe.z=Number.NEGATIVE_INFINITY;var fe=Number.POSITIVE_INFINITY,me=R+(k>0?2:0),ge=N+(k>0?2:0),ve=me*ge,_e=new Array(ve),ye=new Array(ve),be=new Array(ve),Ce=q?new Array(ve):[],we=0,Se=N,Ee=0,Te=R;k>0&&(--we,++Se,--Ee,++Te);for(var xe=0,Pe=we;Pe<Se;++Pe){var Ae=Pe;Ae<0&&(Ae=0),Ae>=N&&(Ae=N-1);var De=U.north-ie*Ae;De=L?M(De):I-2*A(D(-De*B));var Ie=T(De),Me=x(De),Oe=se*Me,Re=(De-w)/(E-w);Re=c.clamp(Re,0,1);var Ne;q&&(Ne=(g.geodeticLatitudeToMercatorAngle(De)-H)*W);for(var ke=Ee;ke<Te;++ke){var Le=ke;Le<0&&(Le=0),Le>=R&&(Le=R-1);var Fe=U.west+re*Le;L?Fe=M(Fe):Fe*=B;var Be,Ue=Ae*(R*K)+Le*K;if(1===Z)Be=O[Ue];else{Be=0;var Ve;if($)for(Ve=0;Ve<Z;++Ve)Be=Be*J+O[Ue+Ve];else for(Ve=Z-1;Ve>=0;--Ve)Be=Be*J+O[Ue+Ve]}Be=(Be*X+Q)*j;var ze=(Fe-u)/(S-u);if(ze=c.clamp(ze,0,1),be[xe]=new r(ze,Re),ue=Math.max(ue,Be),le=Math.min(le,Be),ke!==Le||Pe!==Ae){var Ge=1e-5;ke<0?Fe-=Ge*ee:Fe+=Ge*ee,Pe<0?De+=Ge*te:De-=Ge*te,Ie=T(De),Me=x(De),Oe=se*Me,Be-=k}var He=Ie*T(Fe),We=Ie*x(Fe),je=oe*He,qe=ae*We,Ye=P(je*He+qe*We+Oe*Me),Xe=1/Ye,Qe=je*Xe,Ze=qe*Xe,Ke=Oe*Xe,Je=new i;Je.x=Qe+He*Be,Je.y=Ze+We*Be,Je.z=Ke+Me*Be,_e[xe]=Je,ye[xe]=Be,q&&(Ce[xe]=Ne),xe++,d.multiplyByPoint(de,Je,_),i.minimumByComponent(_,he,he),i.maximumByComponent(_,pe,pe),fe=Math.min(fe,Be)}}var $e,et=t.fromPoints(_e);o(V)&&V.width<c.PI_OVER_TWO+c.EPSILON5&&($e=h.fromRectangle(V,le,ue,F));var tt;if(G){var rt=new l(F);tt=rt.computeHorizonCullingPoint(z,_e)}for(var it=new e(he,pe,z),nt=new f(it,fe,ue,ce,!1,q),ot=new Float32Array(ve*nt.getStride()),at=0,st=0;st<ve;++st)at=nt.encode(ot,at,_e[st],be[st],ye[st],void 0,Ce[st]);return{vertices:ot,maximumHeight:ue,minimumHeight:le,encoding:nt,boundingSphere3D:et,orientedBoundingBox:$e,occludeePointInScaledSpace:tt}},v}),define("Core/destroyObject",["./defaultValue","./DeveloperError"],function(e,t){"use strict";function r(){return!0}function i(t,i){function n(){}i=e(i,"This object was destroyed, i.e., destroy() was called.");for(var o in t)"function"==typeof t[o]&&(t[o]=n);t.isDestroyed=r}return i}),define("Core/isCrossOriginUrl",["./defined"],function(e){"use strict";function t(t){e(r)||(r=document.createElement("a")),r.href=window.location.href;var i=r.host,n=r.protocol;return r.href=t,r.href=r.href,n!==r.protocol||i!==r.host}var r;return t}),define("Core/TaskProcessor",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./destroyObject","./DeveloperError","./getAbsoluteUri","./isCrossOriginUrl","./RuntimeError","require"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(){if(!i(m._canTransferArrayBuffer)){var t=new Worker(h("Workers/transferTypedArrayTest.js"));t.postMessage=r(t.webkitPostMessage,t.postMessage);var n=99,o=new Int8Array([n]);try{t.postMessage({array:o},[o.buffer])}catch(e){return m._canTransferArrayBuffer=!1,m._canTransferArrayBuffer}var a=e.defer();t.onmessage=function(e){var r=e.data.array,o=i(r)&&r[0]===n;a.resolve(o),t.terminate(),m._canTransferArrayBuffer=o},m._canTransferArrayBuffer=a.promise}return m._canTransferArrayBuffer}function d(e,t){--e._activeTasks;var r=t.id;if(i(r)){var n=e._deferreds,a=n[r];if(i(t.error)){var s=t.error;"RuntimeError"===s.name?(s=new l(t.error.message),s.stack=t.error.stack):"DeveloperError"===s.name&&(s=new o(t.error.message),s.stack=t.error.stack),a.reject(s)}else a.resolve(t.result);delete n[r]}}function h(e){var r=t(e);if(s(r)){var i,n='importScripts("'+r+'");';try{i=new Blob([n],{type:"application/javascript"})}catch(e){var o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,a=new o;a.append(n),i=a.getBlob("application/javascript")}var l=window.URL||window.webkitURL;r=l.createObjectURL(i)}return r}function p(){return i(g)||(g=h("Workers/cesiumWorkerBootstrapper.js")),g}function f(e){var n=new Worker(p());n.postMessage=r(n.webkitPostMessage,n.postMessage);var o={loaderConfig:{},workerModule:m._workerModulePrefix+e._workerName};return i(m._loaderConfig)?o.loaderConfig=m._loaderConfig:i(u.toUrl)?o.loaderConfig.baseUrl=a("..",t("Workers/cesiumWorkerBootstrapper.js")):o.loaderConfig.paths={Workers:t("Workers")},n.postMessage(o),n.onmessage=function(t){d(e,t.data)},n}function m(e,t){this._workerName=e,this._maximumActiveTasks=r(t,5),this._activeTasks=0,this._deferreds={},this._nextID=0}var g,v=[];return m.prototype.scheduleTask=function(t,r){if(i(this._worker)||(this._worker=f(this)),!(this._activeTasks>=this._maximumActiveTasks)){++this._activeTasks;var n=this;return e(c(),function(o){i(r)?o||(r.length=0):r=v;var a=n._nextID++,s=e.defer();return n._deferreds[a]=s,n._worker.postMessage({id:a,parameters:t,canTransferArrayBuffer:o},r),s.promise})}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return i(this._worker)&&this._worker.terminate(),n(this)},m._defaultWorkerModulePrefix="Workers/",m._workerModulePrefix=m._defaultWorkerModulePrefix,m._loaderConfig=void 0,m._canTransferArrayBuffer=void 0,m}),define("Core/TerrainMesh",["./defaultValue"],function(e){"use strict";function t(t,r,i,n,o,a,s,l,u,c,d){this.center=t,this.vertices=r,this.stride=e(l,6),this.indices=i,this.minimumHeight=n,this.maximumHeight=o,this.boundingSphere3D=a,this.occludeePointInScaledSpace=s,this.orientedBoundingBox=u,this.encoding=c,this.exaggeration=d}return t}),define("Core/TerrainProvider",["./defined","./defineProperties","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(){r.throwInstantiationError()}t(n.prototype,{errorEvent:{get:r.throwInstantiationError},credit:{get:r.throwInstantiationError},tilingScheme:{get:r.throwInstantiationError},ready:{get:r.throwInstantiationError},readyPromise:{get:r.throwInstantiationError},hasWaterMask:{get:r.throwInstantiationError},hasVertexNormals:{get:r.throwInstantiationError},availability:{get:r.throwInstantiationError}});var o=[];return n.getRegularGridIndices=function(t,r){var i=o[t];e(i)||(o[t]=i=[]);var n=i[r];if(!e(n)){n=i[r]=new Uint16Array((t-1)*(r-1)*6);for(var a=0,s=0,l=0;l<r-1;++l){for(var u=0;u<t-1;++u){var c=a,d=c+t,h=d+1,p=c+1;n[s++]=c,n[s++]=d,n[s++]=p,n[s++]=p,n[s++]=d,n[s++]=h,++a}++a}}return n},n.heightmapTerrainQuality=.25,n.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,r){return 2*e.maximumRadius*Math.PI*n.heightmapTerrainQuality/(t*r)},n.prototype.requestTileGeometry=r.throwInstantiationError,n.prototype.getLevelMaximumGeometricError=r.throwInstantiationError,n.prototype.getTileDataAvailable=r.throwInstantiationError,n}),define("Core/HeightmapTerrainData",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./DeveloperError","./GeographicTilingScheme","./HeightmapTessellator","./Math","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh","./TerrainProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=t(e.childTileMask,15);var i=a.DEFAULT_STRUCTURE,n=e.structure;r(n)?n!==i&&(n.heightScale=t(n.heightScale,i.heightScale),n.heightOffset=t(n.heightOffset,i.heightOffset),n.elementsPerHeight=t(n.elementsPerHeight,i.elementsPerHeight),n.stride=t(n.stride,i.stride),n.elementMultiplier=t(n.elementMultiplier,i.elementMultiplier),n.isBigEndian=t(n.isBigEndian,i.isBigEndian)):n=i,this._structure=n,this._createdByUpsampling=t(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0}function f(e,t,r,i,n,o,a,s,l,u){var c=(l-o.west)*(a-1)/(o.east-o.west),d=(u-o.south)*(s-1)/(o.north-o.south),h=0|c,p=h+1;p>=a&&(p=a-1,h=a-2);var f=0|d,m=f+1;m>=s&&(m=s-1,f=s-2);var _=c-h,y=d-f;f=s-1-f,m=s-1-m;var b=v(e,t,r,i,n,f*a+h),C=v(e,t,r,i,n,f*a+p),w=v(e,t,r,i,n,m*a+h),S=v(e,t,r,i,n,m*a+p);return g(_,y,b,C,w,S)}function m(e,t,r,i,n,o,a,s,l,u,c){var d=(l-o.west)*(a-1)/(o.east-o.west),h=(u-o.south)*(s-1)/(o.north-o.south);n>0&&(d+=1,h+=1,a+=2,s+=2);var p=n>0?a-1:a,f=0|d,m=f+1;m>=p&&(m=a-1,f=a-2);var v=n>0?s-1:s,_=0|h,y=_+1;y>=v&&(y=s-1,_=s-2);var b=d-f,C=h-_;_=s-1-_,y=s-1-y;var w=(t.decodeHeight(e,_*a+f)/c-r)/i,S=(t.decodeHeight(e,_*a+m)/c-r)/i,E=(t.decodeHeight(e,y*a+f)/c-r)/i,T=(t.decodeHeight(e,y*a+m)/c-r)/i;return g(b,C,w,S,E,T)}function g(e,t,r,i,n,o){return t<e?r+e*(i-r)+t*(o-i):r+e*(o-n)+t*(n-r)}function v(e,t,r,i,n,o){o*=i;var a,s=0;if(n)for(a=0;a<t;++a)s=s*r+e[o+a];else for(a=t-1;a>=0;--a)s=s*r+e[o+a];return s}function _(e,t,r,i,n,o,a,s){a*=n;var l;if(o)for(l=0;l<t-1;++l)e[a+l]=s/i|0,s-=e[a+l]*i,i/=r;else for(l=t-1;l>0;--l)e[a+l]=s/i|0,s-=e[a+l]*i,i/=r;e[a+l]=s}i(p.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}}});var y=new u("createVerticesFromHeightmap");return p.prototype.createMesh=function(i,n,a,s,u){var p=i.ellipsoid,f=i.tileXYToNativeRectangle(n,a,s),m=i.tileXYToRectangle(n,a,s);u=t(u,1);var g=p.cartographicToCartesian(l.center(m)),v=this._structure,_=h.getEstimatedLevelZeroGeometricErrorForAHeightmap(p,this._width,i.getNumberOfXTilesAtLevel(0)),b=_/(1<<s);this._skirtHeight=Math.min(4*b,1e3);var C=y.scheduleTask({heightmap:this._buffer,structure:v,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:f,rectangle:m,relativeToCenter:g,ellipsoid:p,skirtHeight:this._skirtHeight,isGeographic:i instanceof o,exaggeration:u});if(r(C)){var w=this;return e(C,function(e){return w._mesh=new d(g,new Float32Array(e.vertices),h.getRegularGridIndices(e.gridWidth,e.gridHeight),e.minimumHeight,e.maximumHeight,e.boundingSphere3D,e.occludeePointInScaledSpace,e.numberOfAttributes,e.orientedBoundingBox,c.clone(e.encoding),u),w._buffer=void 0,w._mesh})}},p.prototype.interpolateHeight=function(e,t,i){var n,o=this._width,a=this._height,s=this._structure,l=s.stride,u=s.elementsPerHeight,c=s.elementMultiplier,d=s.isBigEndian,h=s.heightOffset,p=s.heightScale;if(r(this._mesh)){var g=this._mesh.vertices,v=this._mesh.encoding,_=this._skirtHeight,y=this._mesh.exaggeration;n=m(g,v,h,p,_,e,o,a,t,i,y)}else n=f(this._buffer,u,c,l,d,e,o,a,t,i),n=n*p+h;return n},p.prototype.upsample=function(e,t,i,n,o,a,l){var u=this._width,c=this._height,d=this._structure,h=this._skirtHeight,f=d.stride,g=new this._bufferType(u*c*f),v=this._mesh;if(r(v)){for(var y=v.vertices,b=v.encoding,C=e.tileXYToRectangle(t,i,n),w=e.tileXYToRectangle(o,a,l),S=d.heightOffset,E=d.heightScale,T=v.exaggeration,x=d.elementsPerHeight,P=d.elementMultiplier,A=d.isBigEndian,D=Math.pow(P,x-1),I=0;I<c;++I)for(var M=s.lerp(w.north,w.south,I/(c-1)),O=0;O<u;++O){var R=s.lerp(w.west,w.east,O/(u-1)),N=m(y,b,S,E,h,C,u,c,R,M,T);N=N<d.lowestEncodedHeight?d.lowestEncodedHeight:N,N=N>d.highestEncodedHeight?d.highestEncodedHeight:N,_(g,x,P,D,f,A,I*u+O,N)}return new p({buffer:g,width:u,height:c,childTileMask:0,structure:this._structure,createdByUpsampling:!0})}},p.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!==(this._childTileMask&1<<n)},p.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},p}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,i,n){"use strict";var o={UNSIGNED_BYTE:n.UNSIGNED_BYTE,UNSIGNED_SHORT:n.UNSIGNED_SHORT,UNSIGNED_INT:n.UNSIGNED_INT};return o.getSizeInBytes=function(e){switch(e){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(t){return e(t)&&(t===o.UNSIGNED_BYTE||t===o.UNSIGNED_SHORT||t===o.UNSIGNED_INT)},o.createTypedArray=function(e,t){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},o.createTypedArrayFromArrayBuffer=function(e,t,r,n){return e>=i.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,n):new Uint16Array(t,r,n)},r(o)}),define("Core/loadArrayBuffer",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,responseType:"arraybuffer",headers:r})}return t}),define("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";var i={};return i.clipTriangleAtAxisAlignedThreshold=function(e,r,i,n,o,a){t(a)?a.length=0:a=[];var s,l,u;r?(s=i<e,l=n<e,u=o<e):(s=i>e,l=n>e,u=o>e);var c,d,h,p,f,m,g=s+l+u;return 1===g?s?(c=(e-i)/(n-i),d=(e-i)/(o-i),a.push(1),a.push(2),1!==d&&(a.push(-1),a.push(0),a.push(2),a.push(d)),1!==c&&(a.push(-1),a.push(0),a.push(1),a.push(c))):l?(h=(e-n)/(o-n),p=(e-n)/(i-n),a.push(2),a.push(0),1!==p&&(a.push(-1),a.push(1),a.push(0),a.push(p)),1!==h&&(a.push(-1),a.push(1),a.push(2),a.push(h))):u&&(f=(e-o)/(i-o),m=(e-o)/(n-o),a.push(0),a.push(1),1!==m&&(a.push(-1),a.push(2),a.push(1),a.push(m)),1!==f&&(a.push(-1),a.push(2),a.push(0),a.push(f))):2===g?s||i===e?l||n===e?u||o===e||(d=(e-i)/(o-i),h=(e-n)/(o-n),a.push(2),a.push(-1),a.push(0),a.push(2),a.push(d),a.push(-1),a.push(1),a.push(2),a.push(h)):(m=(e-o)/(n-o),c=(e-i)/(n-i),a.push(1),a.push(-1),a.push(2),a.push(1),a.push(m),a.push(-1),a.push(0),a.push(1),a.push(c)):(p=(e-n)/(i-n),f=(e-o)/(i-o),a.push(0),a.push(-1),a.push(1),a.push(0),a.push(p),a.push(-1),a.push(2),a.push(0),a.push(f)):3!==g&&(a.push(0),a.push(1),a.push(2)),a},i.computeBarycentricCoordinates=function(r,i,n,o,a,s,l,u,c){var d=n-l,h=l-a,p=s-u,f=o-u,m=1/(p*d+h*f),g=i-u,v=r-l,_=(p*v+h*g)*m,y=(-f*v+d*g)*m,b=1-_-y;return t(c)?(c.x=_,c.y=y,c.z=b,c):new e(_,y,b)},i}),define("Core/QuantizedMeshTerrainData",["../ThirdParty/when","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){function t(e,t){return a[e]-a[t]}function r(e,t){return o[e]-o[t]}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 i=this._quantizedVertices.length/3,o=this._uValues=this._quantizedVertices.subarray(0,i),a=this._vValues=this._quantizedVertices.subarray(i,2*i);this._heightValues=this._quantizedVertices.subarray(2*i,3*i),this._westIndices=g(e.westIndices,t,i),this._southIndices=g(e.southIndices,r,i),this._eastIndices=g(e.eastIndices,t,i),this._northIndices=g(e.northIndices,r,i),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=n(e.childTileMask,15),this._createdByUpsampling=n(e.createdByUpsampling,!1),this._waterMask=e.waterMask,this._mesh=void 0}function g(e,t,r){y.length=e.length;for(var i=!1,n=0,o=e.length;n<o;++n)y[n]=e[n],i=i||n>0&&t(e[n-1],e[n])>0;return i?(y.sort(t),l.createTypedArray(r,y)):e}function v(e,t,r){for(var i=e._mesh,n=i.vertices,o=i.encoding,a=i.indices,s=0,l=a.length;s<l;s+=3){var c=a[s],d=a[s+1],h=a[s+2],p=o.decodeTextureCoordinates(n,c,E),f=o.decodeTextureCoordinates(n,d,T),m=o.decodeTextureCoordinates(n,h,x),g=u.computeBarycentricCoordinates(t,r,p.x,p.y,f.x,f.y,m.x,m.y,S);if(g.x>=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){var v=o.decodeHeight(n,c),_=o.decodeHeight(n,d),y=o.decodeHeight(n,h);return g.x*v+g.y*_+g.z*y}}}function _(e,t,r){for(var i=e._uValues,n=e._vValues,o=e._heightValues,a=e._indices,s=0,l=a.length;s<l;s+=3){var d=a[s],h=a[s+1],p=a[s+2],f=i[d],m=i[h],g=i[p],v=n[d],_=n[h],y=n[p],b=u.computeBarycentricCoordinates(t,r,f,v,m,_,g,y,S);if(b.x>=-1e-15&&b.y>=-1e-15&&b.z>=-1e-15){var C=b.x*o[d]+b.y*o[h]+b.z*o[p];return c.lerp(e._minimumHeight,e._maximumHeight,C/w)}}}a(m.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});var y=[],b=new h("createVerticesFromQuantizedTerrainMesh");m.prototype.createMesh=function(t,r,i,a,s){var u=t.ellipsoid,c=t.tileXYToRectangle(r,i,a);s=n(s,1);var d=b.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:c,relativeToCenter:this._boundingSphere.center,ellipsoid:u,exaggeration:s});if(o(d)){var h=this;return e(d,function(e){var t=h._quantizedVertices.length/3;t+=h._westIndices.length+h._southIndices.length+h._eastIndices.length+h._northIndices.length;var r=l.createTypedArray(t,e.indices),i=new Float32Array(e.vertices),o=e.center,a=e.minimumHeight,u=e.maximumHeight,c=n(e.boundingSphere,h._boundingSphere),d=n(e.orientedBoundingBox,h._orientedBoundingBox),m=h._horizonOcclusionPoint,g=e.vertexStride,v=p.clone(e.encoding);return h._skirtIndex=e.skirtIndex,h._vertexCountWithoutSkirts=h._quantizedVertices.length/3,h._mesh=new f(o,i,r,a,u,c,m,g,d,v,s),h._quantizedVertices=void 0,h._encodedNormals=void 0,h._indices=void 0,h._uValues=void 0,h._vValues=void 0,h._heightValues=void 0,h._westIndices=void 0,h._southIndices=void 0,h._eastIndices=void 0,h._northIndices=void 0,h._mesh})}};var C=new h("upsampleQuantizedTerrainMesh");m.prototype.upsample=function(r,n,a,s,u,c,h){var p=this._mesh;if(o(this._mesh)){var f=2*n!==u,g=2*a===c,v=r.ellipsoid,_=r.tileXYToRectangle(u,c,h),y=C.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:f,isNorthChild:g,childRectangle:_,ellipsoid:v,exaggeration:p.exaggeration});if(o(y)){var b=Math.min(this._westSkirtHeight,this._eastSkirtHeight);b=Math.min(b,this._southSkirtHeight),b=Math.min(b,this._northSkirtHeight);var w=f?.5*b:this._westSkirtHeight,S=g?.5*b:this._southSkirtHeight,E=f?this._eastSkirtHeight:.5*b,T=g?this._northSkirtHeight:.5*b;return e(y,function(e){var r,n=new Uint16Array(e.vertices),a=l.createTypedArray(n.length/3,e.indices);return o(e.encodedNormals)&&(r=new Uint8Array(e.encodedNormals)),new m({quantizedVertices:n,indices:a,encodedNormals:r,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,boundingSphere:t.clone(e.boundingSphere),orientedBoundingBox:d.clone(e.orientedBoundingBox),horizonOcclusionPoint:i.clone(e.horizonOcclusionPoint),westIndices:e.westIndices,southIndices:e.southIndices,eastIndices:e.eastIndices,northIndices:e.northIndices,westSkirtHeight:w,southSkirtHeight:S,eastSkirtHeight:E,northSkirtHeight:T,childTileMask:0,createdByUpsampling:!0})})}}};var w=32767,S=new i;m.prototype.interpolateHeight=function(e,t,r){var i=c.clamp((t-e.west)/e.width,0,1);i*=w;var n=c.clamp((r-e.south)/e.height,0,1);return n*=w,o(this._mesh)?v(this,i,n):_(this,i,n)};var E=new r,T=new r,x=new r;return m.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!==(this._childTileMask&1<<n)},m.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling},m}),define("Core/throttleRequestByServer",["../ThirdParty/Uri","../ThirdParty/when","./defaultValue"],function(e,t,r){"use strict";function i(t){var r=new e(t).resolve(a);r.normalize();var i=r.authority;return/:/.test(i)||(i=i+":"+("https"===r.scheme?"443":"80")),i}function n(e,a){var s=i(e),l=r(o[s],0);if(!(l>=n.maximumRequestsPerServer))return o[s]=l+1,t(a(e),function(e){return o[s]--,e}).otherwise(function(e){return o[s]--,t.reject(e)})}var o={},a="undefined"!=typeof document?new e(document.location.href):new e;return n.maximumRequestsPerServer=6,n}),define("Core/TileAvailability",["./binarySearch","./Cartographic","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,r,i,n,o){"use strict";function a(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[];for(var r=0;r<e.getNumberOfYTilesAtLevel();++r)for(var i=0;i<e.getNumberOfXTilesAtLevel();++i)this._rootNodes.push(new s(e,void 0,0,i,r))}function s(e,t,r,i,n){this.tilingScheme=e,this.parent=t,this.level=r,this.x=i,this.y=n,this.extent=e.tileXYToRectangle(i,n,r),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}function l(e,t,r,i,n){this.level=e,this.west=t,this.south=r,this.east=i,this.north=n}function u(e,t){var r=Math.max(e.west,t.west),i=Math.max(e.south,t.south),n=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i<o&&r<n}function c(t,r,i){for(;r.level<t;)if(h(r.nw.extent,i))r=r.nw;else if(h(r.ne.extent,i))r=r.ne;else if(h(r.sw.extent,i))r=r.sw;else{if(!h(r.se.extent,i))break;r=r.se}if(0===r.rectangles.length||r.rectangles[r.rectangles.length-1].level<=i.level)r.rectangles.push(i);else{var n=e(r.rectangles,i.level,d);n<=0&&(n=~n),r.rectangles.splice(n,0,i)}}function d(e,t){return e.level-t}function h(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function p(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function f(e,t,r){for(var i=0,n=!1;!n;){var o=t._nw&&p(t._nw.extent,r),a=t._ne&&p(t._ne.extent,r),s=t._sw&&p(t._sw.extent,r),l=t._se&&p(t._se.extent,r);if(o+a+s+l>1){o&&(i=Math.max(i,f(t,t._nw,r))),a&&(i=Math.max(i,f(t,t._ne,r))),s&&(i=Math.max(i,f(t,t._sw,r))),l&&(i=Math.max(i,f(t,t._se,r)));break}o?t=t._nw:a?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;c>=0&&u[c].level>i;--c){var d=u[c];p(d,r)&&(i=d.level)}t=t.parent}return i}function m(e,t,r){if(t){var i,n=!1;for(i=0;i<r.length;++i)n=n||u(t.extent,r[i]);if(n){var o=t.rectangles;for(i=0;i<o.length;++i){var a=o[i];e[a.level]||(e[a.level]=r),e[a.level]=g(e[a.level],a)}m(e,t._nw,r),m(e,t._ne,r),m(e,t._sw,r),m(e,t._se,r)}}}function g(e,t){for(var r=[],i=0;i<e.length;++i){var n=e[i];u(n,t)?(n.west<t.west&&r.push(new o(n.west,n.south,t.west,n.north)),n.east>t.east&&r.push(new o(t.east,n.south,n.east,n.north)),n.south<t.south&&r.push(new o(Math.max(t.west,n.west),n.south,Math.min(t.east,n.east),t.south)),n.north>t.north&&r.push(new o(Math.max(t.west,n.west),t.north,Math.min(t.east,n.east),n.north))):r.push(n)}return r}var v=new o;a.prototype.addAvailableTileRange=function(e,t,r,i,n){var o=this._tilingScheme;o.tileXYToRectangle(t,r,e,v);var a=v.west,s=v.north;o.tileXYToRectangle(i,n,e,v);for(var d=v.east,h=v.south,p=new l(e,a,h,d,s),f=0;f<this._rootNodes.length;++f){var m=this._rootNodes[f];u(m.extent,p)&&c(this._maximumLevel,m,p)}},a.prototype.computeMaximumLevelAtPosition=function(e){for(var t,r=0;r<this._rootNodes.length;++r){var i=this._rootNodes[r];if(p(i.extent,e)){t=i;break}}return f(void 0,t,e)};var _=[],y=[],b=new o,C=new o;a.prototype.computeBestAvailableLevelOverRectangle=function(e){var t=_;t.length=0,e.east<e.west?(t.push(o.fromRadians(-Math.PI,e.south,e.east,e.north,b)),t.push(o.fromRadians(e.west,e.south,Math.PI,e.north,C))):t.push(e);var i=y;i.length=0;var n;for(n=0;n<this._rootNodes.length;++n)m(i,this._rootNodes[n],t);for(n=i.length-1;n>=0;--n)if(r(i[n])&&0===i[n].length)return n;return 0};var w=new t;return a.prototype.isTileAvailable=function(e,t,r){var i=this._tilingScheme.tileXYToRectangle(t,r,e,v);return o.center(i,w),this.computeMaximumLevelAtPosition(w)>=e},a.prototype.computeChildMaskForTile=function(e,t,r){var i=e+1;if(i>=this._maximumLevel)return 0;var n=0;return n|=this.isTileAvailable(i,2*t,2*r+1)?1:0,n|=this.isTileAvailable(i,2*t+1,2*r+1)?2:0,n|=this.isTileAvailable(i,2*t,2*r)?4:0,n|=this.isTileAvailable(i,2*t+1,2*r)?8:0},i(s.prototype,{nw:{get:function(){return this._nw||(this._nw=new s(this.tilingScheme,this,this.level+1,2*this.x,2*this.y)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new s(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new s(this.tilingScheme,this,this.level+1,2*this.x,2*this.y+1)),this._sw}},se:{get:function(){return this._se||(this._se=new s(this.tilingScheme,this,this.level+1,2*this.x+1,2*this.y+1)),this._se}}}),a}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,i=t.name,n=t.message;r=e(i)&&e(n)?i+": "+n:t.toString();var o=t.stack;return e(o)&&(r+="\n"+o),r}return t}),define("Core/TileProviderError",["./defaultValue","./defined","./formatError"],function(e,t,r){"use strict";function i(t,r,i,n,o,a,s){this.provider=t,this.message=r,this.x=i,this.y=n,this.level=o,this.timesRetried=e(a,0),this.retry=!1,this.error=s}return i.handleError=function(e,n,o,a,s,l,u,c,d){var h=e;return t(e)?(h.provider=n,h.message=a,h.x=s,h.y=l,h.level=u,h.retry=!1,h.error=d,++h.timesRetried):h=new i(n,a,s,l,u,0,d),o.numberOfListeners>0?o.raiseEvent(h):console.log('An error occurred in "'+n.constructor.name+'": '+r(a)),h.retry&&t(c)&&c(),h},i.handleSuccess=function(e){t(e)&&(e.timesRetried=-1)},i}),define("Core/CesiumTerrainProvider",["../ThirdParty/Uri","../ThirdParty/when","./BoundingSphere","./Cartesian3","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./IndexDatatype","./joinUrls","./loadArrayBuffer","./loadJson","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./TerrainProvider","./throttleRequestByServer","./TileAvailability","./TileProviderError"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w){"use strict";function S(r){function i(t){var r;if(!t.format)return r="The tile format is not specified in the layer.json file.",void(f=w.handleError(f,g,g._errorEvent,r,void 0,void 0,void 0,l));if(!t.tiles||0===t.tiles.length)return r="The layer.json file does not specify any tile URL templates.",void(f=w.handleError(f,g,g._errorEvent,r,void 0,void 0,void 0,l));if("heightmap-1.0"===t.format)g._heightmapStructure={heightScale:.2,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:65535},g._hasWaterMask=!0,g._requestWaterMask=!0;else if(0!==t.format.indexOf("quantized-mesh-1."))return r='The tile format "'+t.format+'" is invalid or not supported.',void(f=w.handleError(f,g,g._errorEvent,r,void 0,void 0,void 0,l));g._tileUrlTemplates=t.tiles;for(var i=0;i<g._tileUrlTemplates.length;++i){var o=new e(g._tileUrlTemplates[i]),s=new e(g._url);o.authority&&!s.authority&&(s.authority=o.authority,s.scheme=o.scheme),g._tileUrlTemplates[i]=p(s,o).toString().replace("{version}",t.version)}var u=t.available;if(a(u)){g._availability=new C(g._tilingScheme,u.length);for(var c=0;c<u.length;++c)for(var d=u[c],h=g._tilingScheme.getNumberOfYTilesAtLevel(c),m=0;m<d.length;++m){var v=d[m];g._availability.addAvailableTileRange(c,v.startX,h-v.endY-1,v.endX,h-v.startY-1)}}!a(g._credit)&&a(t.attribution)&&null!==t.attribution&&(g._credit=new n(t.attribution)),a(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?g._hasVertexNormals=!0:a(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(g._hasVertexNormals=!0,g._littleEndianExtensionSize=!1),a(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(g._hasWaterMask=!0),g._ready=!0,g._readyPromise.resolve(!0)}function s(e){if(a(e)&&404===e.statusCode)return void i({tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]});var t="An error occurred while accessing "+h+".";f=w.handleError(f,g,g._errorEvent,t,void 0,void 0,void 0,l)}function l(){var e=m(h);t(e,i,s)}this._url=r.url,this._proxy=r.proxy,this._tilingScheme=new c({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:r.ellipsoid}),this._heightmapWidth=65,this._levelZeroMaximumGeometricError=y.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,this._heightmapWidth,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._requestVertexNormals=o(r.requestVertexNormals,!1),this._littleEndianExtensionSize=!0,this._requestWaterMask=o(r.requestWaterMask,!1), +this._errorEvent=new u,this._availability=void 0;var d=r.credit;"string"==typeof d&&(d=new n(d)),this._credit=d,this._ready=!1,this._readyPromise=t.defer();var h=p(this._url,"layer.json");a(this._proxy)&&(h=this._proxy.getURL(h));var f,g=this;l()}function E(e){if(a(e)&&0!==e.length){var t=e.join("-");return{Accept:"application/vnd.quantized-mesh;extensions="+t+",application/octet-stream;q=0.9,*/*;q=0.01"}}return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}}function T(e,t,r,i,n,o){var a=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new d({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})}function x(e,t,n,o,a,s){function l(e){return e>>1^-(1&e)}var u=0,c=3,d=c+1,p=Float64Array.BYTES_PER_ELEMENT*c,f=Float64Array.BYTES_PER_ELEMENT*d,m=3,y=Uint16Array.BYTES_PER_ELEMENT*m,b=3,C=Uint16Array.BYTES_PER_ELEMENT,w=C*b,S=new DataView(t),E=new i(S.getFloat64(u,!0),S.getFloat64(u+8,!0),S.getFloat64(u+16,!0));u+=p;var T=S.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var x=S.getFloat32(u,!0);u+=Float32Array.BYTES_PER_ELEMENT;var A=new r(new i(S.getFloat64(u,!0),S.getFloat64(u+8,!0),S.getFloat64(u+16,!0)),S.getFloat64(u+p,!0));u+=f;var D=new i(S.getFloat64(u,!0),S.getFloat64(u+8,!0),S.getFloat64(u+16,!0));u+=p;var I=S.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var M=new Uint16Array(t,u,3*I);u+=I*y,I>65536&&(C=Uint32Array.BYTES_PER_ELEMENT,w=C*b);var O,R=M.subarray(0,I),N=M.subarray(I,2*I),k=M.subarray(2*I,3*I),L=0,F=0,B=0;for(O=0;O<I;++O)L+=l(R[O]),F+=l(N[O]),B+=l(k[O]),R[O]=L,N[O]=F,k[O]=B;u%C!==0&&(u+=C-u%C);var U=S.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var V=h.createTypedArrayFromArrayBuffer(I,t,u,U*b);u+=U*w;var z=0;for(O=0;O<V.length;++O){var G=V[O];V[O]=z-G,0===G&&++z}var H=S.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var W=h.createTypedArrayFromArrayBuffer(I,t,u,H);u+=H*C;var j=S.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var q=h.createTypedArrayFromArrayBuffer(I,t,u,j);u+=j*C;var Y=S.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var X=h.createTypedArrayFromArrayBuffer(I,t,u,Y);u+=Y*C;var Q=S.getUint32(u,!0);u+=Uint32Array.BYTES_PER_ELEMENT;var Z=h.createTypedArrayFromArrayBuffer(I,t,u,Q);u+=Q*C;for(var K,J;u<S.byteLength;){var $=S.getUint8(u,!0);u+=Uint8Array.BYTES_PER_ELEMENT;var ee=S.getUint32(u,e._littleEndianExtensionSize);u+=Uint32Array.BYTES_PER_ELEMENT,$===P.OCT_VERTEX_NORMALS&&e._requestVertexNormals?K=new Uint8Array(t,u,2*I):$===P.WATER_MASK&&e._requestWaterMask&&(J=new Uint8Array(t,u,ee)),u+=ee}var te,re=5*e.getLevelMaximumGeometricError(n),ie=e._tilingScheme.tileXYToRectangle(o,a,n);return ie.width<g.PI_OVER_TWO+g.EPSILON5&&(te=v.fromRectangle(ie,T,x,e._tilingScheme.ellipsoid)),new _({center:E,minimumHeight:T,maximumHeight:x,boundingSphere:A,orientedBoundingBox:te,horizonOcclusionPoint:D,quantizedVertices:M,encodedNormals:K,indices:V,westIndices:W,southIndices:q,eastIndices:X,northIndices:Z,westSkirtHeight:re,southSkirtHeight:re,eastSkirtHeight:re,northSkirtHeight:re,childTileMask:e.availability.computeChildMaskForTile(n,o,a),waterMask:J})}var P={OCT_VERTEX_NORMALS:1,WATER_MASK:2};return S.prototype.requestTileGeometry=function(e,r,i,n){function s(e){return f(e,E(m))}var l=this._tileUrlTemplates;if(0!==l.length){var u=this._tilingScheme.getNumberOfYTilesAtLevel(i),c=u-r-1,d=l[(e+c+i)%l.length].replace("{z}",i).replace("{x}",e).replace("{y}",c),h=this._proxy;a(h)&&(d=h.getURL(d));var p,m=[];if(this._requestVertexNormals&&this._hasVertexNormals&&m.push(this._littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),this._requestWaterMask&&this._hasWaterMask&&m.push("watermask"),n=o(n,!0)){if(p=b(d,s),!a(p))return}else p=s(d);var g=this;return t(p,function(t){return a(g._heightmapStructure)?T(g,t,i,e,r,c):x(g,t,i,e,r,c)})}},s(S.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}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},availability:{get:function(){return this._availability}}}),S.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},S.prototype.getTileDataAvailable=function(e,t,r){if(a(this.availability))return this.availability.isTileAvailable(r,e,t)},S}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,i){"use strict";function n(t,n,o,c,d,h,p,f,m,g){var v=t+n;e.multiplyByScalar(c,Math.cos(v),a),e.multiplyByScalar(o,Math.sin(v),s),e.add(a,s,a);var _=Math.cos(t);_*=_;var y=Math.sin(t);y*=y;var b=h/Math.sqrt(p*_+d*y),C=b/f;return i.fromAxisAngle(a,C,l),r.fromQuaternion(l,u),r.multiplyByVector(u,m,g),e.normalize(g,g),e.multiplyByScalar(g,f,g),g}var o={},a=new e,s=new e,l=new i,u=new r,c=new e,d=new e,h=new e,p=new e;o.raisePositionsToHeight=function(t,r,i){for(var n=r.ellipsoid,o=r.height,a=r.extrudedHeight,s=i?t.length/3*2:t.length/3,l=new Float64Array(3*s),u=t.length,f=i?u:0,m=0;m<u;m+=3){var g=m+1,v=m+2,_=e.fromArray(t,m,c);n.scaleToGeodeticSurface(_,_);var y=e.clone(_,d),b=n.geodeticSurfaceNormal(_,p),C=e.multiplyByScalar(b,o,h);e.add(_,C,_),i&&(e.multiplyByScalar(b,a,C),e.add(y,C,y),l[m+f]=y.x,l[g+f]=y.y,l[v+f]=y.z),l[m]=_.x,l[g]=_.y,l[v]=_.z}return l};var f=new e,m=new e,g=new e;return o.computeEllipsePositions=function(r,i,o){var a=r.semiMinorAxis,s=r.semiMajorAxis,l=r.rotation,u=r.center,p=8*r.granularity,v=a*a,_=s*s,y=s*a,b=e.magnitude(u),C=e.normalize(u,f),w=e.cross(e.UNIT_Z,u,m);w=e.normalize(w,w);var S=e.cross(C,w,g),E=1+Math.ceil(t.PI_OVER_TWO/p),T=t.PI_OVER_TWO/(E-1),x=t.PI_OVER_TWO-E*T;x<0&&(E-=Math.ceil(Math.abs(x)/T));var P,A,D,I,M,O=2*(E*(E+2)),R=i?new Array(3*O):void 0,N=0,k=c,L=d,F=4*E*3,B=F-1,U=0,V=o?new Array(F):void 0;for(x=t.PI_OVER_TWO,k=n(x,l,S,w,v,y,_,b,C,k),i&&(R[N++]=k.x,R[N++]=k.y,R[N++]=k.z),o&&(V[B--]=k.z,V[B--]=k.y,V[B--]=k.x),x=t.PI_OVER_TWO-T,P=1;P<E+1;++P){if(k=n(x,l,S,w,v,y,_,b,C,k),L=n(Math.PI-x,l,S,w,v,y,_,b,C,L),i){for(R[N++]=k.x,R[N++]=k.y,R[N++]=k.z,D=2*P+2,A=1;A<D-1;++A)I=A/(D-1),M=e.lerp(k,L,I,h),R[N++]=M.x,R[N++]=M.y,R[N++]=M.z;R[N++]=L.x,R[N++]=L.y,R[N++]=L.z}o&&(V[B--]=k.z,V[B--]=k.y,V[B--]=k.x,V[U++]=L.x,V[U++]=L.y,V[U++]=L.z),x=t.PI_OVER_TWO-(P+1)*T}for(P=E;P>1;--P){if(x=t.PI_OVER_TWO-(P-1)*T,k=n(-x,l,S,w,v,y,_,b,C,k),L=n(x+Math.PI,l,S,w,v,y,_,b,C,L),i){for(R[N++]=k.x,R[N++]=k.y,R[N++]=k.z,D=2*(P-1)+2,A=1;A<D-1;++A)I=A/(D-1),M=e.lerp(k,L,I,h),R[N++]=M.x,R[N++]=M.y,R[N++]=M.z;R[N++]=L.x,R[N++]=L.y,R[N++]=L.z}o&&(V[B--]=k.z,V[B--]=k.y,V[B--]=k.x,V[U++]=L.x,V[U++]=L.y,V[U++]=L.z)}x=t.PI_OVER_TWO,k=n(-x,l,S,w,v,y,_,b,C,k);var z={};return i&&(R[N++]=k.x,R[N++]=k.y,R[N++]=k.z,z.positions=R,z.numPts=E),o&&(V[B--]=k.z,V[B--]=k.y,V[B--]=k.x,z.outerPositions=V),z},o}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,i){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=i.clone(e(t.modelMatrix,i.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return n}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}i.encode=function(e,r){t(r)||(r={high:0,low:0});var i;return e>=0?(i=65536*Math.floor(e/65536),r.high=i,r.low=e-i):(i=65536*Math.floor(-e/65536),r.high=-i,r.low=e+i),r};var n={high:0,low:0};i.fromCartesian=function(e,r){t(r)||(r=new i);var o=r.high,a=r.low;return i.encode(e.x,n),o.x=n.high,a.x=n.low,i.encode(e.y,n),o.y=n.high,a.y=n.low,i.encode(e.z,n),o.z=n.high,a.z=n.low,r};var o=new i;return i.writeElements=function(e,t,r){i.fromCartesian(e,o);var n=o.high,a=o.low;t[r]=n.x,t[r+1]=n.y,t[r+2]=n.z,t[r+3]=a.x,t[r+4]=a.y,t[r+5]=a.z},i}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var i={};return i.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var i=r.indices,n=r.maximumIndex,o=e(r.cacheSize,24),a=i.length;if(!t(n)){n=0;for(var s=0,l=i[s];s<a;)l>n&&(n=l),++s,l=i[s]}for(var u=[],c=0;c<n+1;c++)u[c]=0;for(var d=o+1,h=0;h<a;++h)d-u[i[h]]>o&&(u[i[h]]=d,++d);return(d-o+1)/(a/3)},i.tipsify=function(r){function i(e,t,r,i){for(;t.length>=1;){var n=t[t.length-1];if(t.splice(t.length-1,1),e[n].numLiveTriangles>0)return n}for(;o<i;){if(e[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function n(e,t,r,n,o,a,s){for(var l,u=-1,c=-1,d=0;d<r.length;){var h=r[d];n[h].numLiveTriangles&&(l=0,o-n[h].timeStamp+2*n[h].numLiveTriangles<=t&&(l=o-n[h].timeStamp),(l>c||c===-1)&&(c=l,u=h)),++d}return u===-1?i(n,a,e,s):u}r=e(r,e.EMPTY_OBJECT);var o,a=r.indices,s=r.maximumIndex,l=e(r.cacheSize,24),u=a.length,c=0,d=0,h=a[d],p=u;if(t(s))c=s+1;else{for(;d<p;)h>c&&(c=h),++d,h=a[d];if(c===-1)return 0;++c}for(var f=[],m=0;m<c;m++)f[m]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};d=0;for(var g=0;d<p;)f[a[d]].vertexTriangles.push(g),++f[a[d]].numLiveTriangles,f[a[d+1]].vertexTriangles.push(g),++f[a[d+1]].numLiveTriangles,f[a[d+2]].vertexTriangles.push(g),++f[a[d+2]].numLiveTriangles,++g,d+=3;var v=0,_=l+1;o=1;var y,b,C=[],w=[],S=0,E=[],T=u/3,x=[];for(m=0;m<T;m++)x[m]=!1;for(var P,A;v!==-1;){C=[],b=f[v],A=b.vertexTriangles.length;for(var D=0;D<A;++D)if(g=b.vertexTriangles[D],!x[g]){x[g]=!0,d=g+g+g;for(var I=0;I<3;++I)P=a[d],C.push(P),w.push(P),E[S]=P,++S,y=f[P],--y.numLiveTriangles,_-y.timeStamp>l&&(y.timeStamp=_,++_),++d}v=n(a,l,C,f,_,w,c)}return E},i}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E){"use strict";function T(e,t,r,i,n){e[t++]=r,e[t++]=i,e[t++]=i,e[t++]=n,e[t++]=n,e[t]=r}function x(e){for(var t=e.length,r=t/3*6,i=g.createTypedArray(t,r),n=0,o=0;o<t;o+=3,n+=6)T(i,n,e[o],e[o+1],e[o+2]);return i}function P(e){var t=e.length;if(t>=3){var r=6*(t-2),i=g.createTypedArray(t,r);T(i,0,e[0],e[1],e[2]);for(var n=6,o=3;o<t;++o,n+=6)T(i,n,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function A(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),i=g.createTypedArray(t,r),n=e[0],o=0,a=1;a<t;++a,o+=6)T(i,o,n,e[a],e[a+1]);return i}return new Uint16Array}function D(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&u(e[r])&&u(e[r].values)){var i=e[r];t[r]=new f({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function I(e,t,r){for(var i in t)if(t.hasOwnProperty(i)&&u(t[i])&&u(t[i].values))for(var n=t[i],o=0;o<n.componentsPerAttribute;++o)e[i].values.push(n.values[r*n.componentsPerAttribute+o])}function M(e,t){if(u(t))for(var r=t.values,i=r.length,o=0;o<i;o+=3)n.unpack(r,o,oe),C.multiplyByPoint(e,oe,oe),n.pack(oe,r,o)}function O(e,t){if(u(t))for(var r=t.values,i=r.length,o=0;o<i;o+=3)n.unpack(r,o,oe),b.multiplyByVector(e,oe,oe),oe=n.normalize(oe,oe),n.pack(oe,r,o)}function R(e,t){var r,i=e.length,n={},o=e[0][t].attributes;for(r in o)if(o.hasOwnProperty(r)&&u(o[r])&&u(o[r].values)){for(var a=o[r],l=a.values.length,c=!0,d=1;d<i;++d){var h=e[d][t].attributes[r];if(!u(h)||a.componentDatatype!==h.componentDatatype||a.componentsPerAttribute!==h.componentsPerAttribute||a.normalize!==h.normalize){c=!1;break}l+=h.values.length}c&&(n[r]=new f({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:s.createTypedArray(a.componentDatatype,l)}))}return n}function N(e,t){var i,o,a,s,l,c,d,h=e.length,f=(e[0].modelMatrix,u(e[0][t].indices)),m=e[0][t].primitiveType,v=R(e,t);for(i in v)if(v.hasOwnProperty(i))for(l=v[i].values,s=0,o=0;o<h;++o)for(c=e[o][t].attributes[i].values,d=c.length,a=0;a<d;++a)l[s++]=c[a];var _;if(f){var y=0;for(o=0;o<h;++o)y+=e[o][t].indices.length;var b=p.computeNumberOfVertices(new p({attributes:v,primitiveType:S.POINTS})),C=g.createTypedArray(b,y),w=0,E=0;for(o=0;o<h;++o){var T=e[o][t].indices,x=T.length;for(s=0;s<x;++s)C[w++]=E+T[s];E+=p.computeNumberOfVertices(e[o][t])}_=C}var P,A=new n,D=0;for(o=0;o<h;++o){if(P=e[o][t].boundingSphere,!u(P)){A=void 0;break}n.add(P.center,A,A)}if(u(A))for(n.divideByScalar(A,h,A),o=0;o<h;++o){P=e[o][t].boundingSphere;var I=n.magnitude(n.subtract(P.center,A,le))+P.radius;I>D&&(D=I)}return new p({attributes:v,indices:_,primitiveType:m,boundingSphere:u(A)?new r(A,D):void 0})}function k(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,t),i=0;i<t;++i)r[i]=i;return e.indices=r,e}function L(e){var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var i=3,n=3;n<t;++n)r[i++]=n-1,r[i++]=0,r[i++]=n;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function F(e){var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var i=6,n=3;n<t-1;n+=2)r[i++]=n,r[i++]=n-1,r[i++]=n+1,n+2<t&&(r[i++]=n,r[i++]=n+1,r[i++]=n+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function B(e){if(u(e.indices))return e;for(var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,t),i=0;i<t;++i)r[i]=i;return e.indices=r,e}function U(e){var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var i=2,n=2;n<t;++n)r[i++]=n-1,r[i++]=n;return e.indices=r,e.primitiveType=S.LINES,e}function V(e){var t=p.computeNumberOfVertices(e),r=g.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var i=2,n=2;n<t;++n)r[i++]=n-1,r[i++]=n;return r[i++]=t-1,r[i]=0,e.indices=r,e.primitiveType=S.LINES,e}function z(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return L(e);case S.TRIANGLE_STRIP:return F(e);case S.TRIANGLES:return k(e);case S.LINE_STRIP:return U(e);case S.LINE_LOOP:return V(e);case S.LINES:return B(e)}return e}function G(e,t){Math.abs(e.y)<y.EPSILON6&&(t?e.y=-y.EPSILON6:e.y=y.EPSILON6)}function H(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return G(e,e.y<0),G(t,t.y<0),void G(r,r.y<0);var i,n=Math.abs(e.y),o=Math.abs(t.y),a=Math.abs(r.y);i=n>o?n>a?y.sign(e.y):y.sign(r.y):o>a?y.sign(t.y):y.sign(r.y);var s=i<0;G(e,s),G(t,s),G(r,s)}function W(e,t,r,i){n.add(e,n.multiplyByScalar(n.subtract(t,e,Ce),e.y/(e.y-t.y),Ce),r),n.clone(r,i),G(r,!0),G(i,!1)}function j(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){H(e,t,r);var i=e.y<0,n=t.y<0,o=r.y<0,a=0;a+=i?1:0,a+=n?1:0,a+=o?1:0;var s=xe.indices;1===a?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(W(e,t,we,Ee),W(e,r,Se,Te),s[0]=0,s[3]=1,s[4]=2,s[6]=1):n?(W(t,r,we,Ee),W(t,e,Se,Te),s[0]=1,s[3]=2,s[4]=0,s[6]=2):o&&(W(r,e,we,Ee),W(r,t,Se,Te),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):2===a&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,i?n?o||(W(r,e,we,Ee),W(r,t,Se,Te),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(W(t,r,we,Ee),W(t,e,Se,Te),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(W(e,t,we,Ee),W(e,r,Se,Te),s[0]=1,s[1]=2,s[3]=1,s[6]=0));var l=xe.positions;return l[0]=e,l[1]=t,l[2]=r,l.length=3,1!==a&&2!==a||(l[3]=we,l[4]=Se,l[5]=Ee,l[6]=Te,l.length=7),xe}}function q(e,t){var i=e.attributes;if(0!==i.position.values.length){for(var n in i)if(i.hasOwnProperty(n)&&u(i[n])&&u(i[n].values)){var o=i[n];o.values=s.createTypedArray(o.componentDatatype,o.values)}var a=p.computeNumberOfVertices(e);return e.indices=g.createTypedArray(a,e.indices),t&&(e.boundingSphere=r.fromVertices(i.position.values)),e}}function Y(e){var t=e.attributes,r={};for(var i in t)if(t.hasOwnProperty(i)&&u(t[i])&&u(t[i].values)){var n=t[i];r[i]=new f({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return new p({attributes:r,indices:[],primitiveType:e.primitiveType})}function X(e,t,r){var i=u(e.geometry.boundingSphere);t=q(t,i),r=q(r,i),u(r)&&!u(t)?e.geometry=r:!u(r)&&u(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Q(e,r,o,a,s,l,c,d,h,p,f,m){if(u(l)||u(c)||u(d)||u(h)||u(p)){var g=n.fromArray(s,3*e,Pe),v=n.fromArray(s,3*r,Ae),_=n.fromArray(s,3*o,De),y=t(a,g,v,_,Ie);if(u(l)){var b=n.fromArray(l,3*e,Pe),C=n.fromArray(l,3*r,Ae),w=n.fromArray(l,3*o,De);n.multiplyByScalar(b,y.x,b),n.multiplyByScalar(C,y.y,C),n.multiplyByScalar(w,y.z,w);var S=n.add(b,C,b);n.add(S,w,S),n.normalize(S,S),n.pack(S,f.normal.values,3*m)}if(u(p)){var E=n.fromArray(p,3*e,Pe),T=n.fromArray(p,3*r,Ae),x=n.fromArray(p,3*o,De);n.multiplyByScalar(E,y.x,E),n.multiplyByScalar(T,y.y,T),n.multiplyByScalar(x,y.z,x);var P;n.equals(E,n.ZERO)&&n.equals(T,n.ZERO)&&n.equals(x,n.ZERO)?(P=Pe,P.x=0,P.y=0,P.z=0):(P=n.add(E,T,E),n.add(P,x,P),n.normalize(P,P)),n.pack(P,f.extrudeDirection.values,3*m)}if(u(c)){var A=n.fromArray(c,3*e,Pe),D=n.fromArray(c,3*r,Ae),I=n.fromArray(c,3*o,De);n.multiplyByScalar(A,y.x,A),n.multiplyByScalar(D,y.y,D),n.multiplyByScalar(I,y.z,I);var M=n.add(A,D,A);n.add(M,I,M),n.normalize(M,M),n.pack(M,f.tangent.values,3*m)}if(u(d)){var O=n.fromArray(d,3*e,Pe),R=n.fromArray(d,3*r,Ae),N=n.fromArray(d,3*o,De);n.multiplyByScalar(O,y.x,O),n.multiplyByScalar(R,y.y,R),n.multiplyByScalar(N,y.z,N);var k=n.add(O,R,O);n.add(k,N,k),n.normalize(k,k),n.pack(k,f.bitangent.values,3*m)}if(u(h)){var L=i.fromArray(h,2*e,Me),F=i.fromArray(h,2*r,Oe),B=i.fromArray(h,2*o,Re);i.multiplyByScalar(L,y.x,L),i.multiplyByScalar(F,y.y,F),i.multiplyByScalar(B,y.z,B);var U=i.add(L,F,L);i.add(U,B,U),i.pack(U,f.st.values,2*m)}}}function Z(e,t,r,i,n,o){var a=e.position.values.length/3;if(n!==-1){var s=i[n],l=r[s];return l===-1?(r[s]=a,e.position.values.push(o.x,o.y,o.z),t.push(a),a):(t.push(l),l)}return e.position.values.push(o.x,o.y,o.z),t.push(a),a}function K(e){var t,r,i,o,a,s=e.geometry,l=s.attributes,c=l.position.values,d=u(l.normal)?l.normal.values:void 0,h=u(l.bitangent)?l.bitangent.values:void 0,p=u(l.tangent)?l.tangent.values:void 0,f=u(l.st)?l.st.values:void 0,m=u(l.extrudeDirection)?l.extrudeDirection.values:void 0,g=s.indices,v=Y(s),_=Y(s),y=[];y.length=c.length/3;var b=[];for(b.length=c.length/3,a=0;a<y.length;++a)y[a]=-1,b[a]=-1;var C=g.length;for(a=0;a<C;a+=3){var w=g[a],S=g[a+1],E=g[a+2],T=n.fromArray(c,3*w),x=n.fromArray(c,3*S),P=n.fromArray(c,3*E),A=j(T,x,P);if(u(A)&&A.positions.length>3)for(var D=A.positions,I=A.indices,M=I.length,O=0;O<M;++O){var R=I[O],N=D[R];N.y<0?(t=_.attributes,r=_.indices,i=y):(t=v.attributes,r=v.indices,i=b),o=Z(t,r,i,g,R<3?a+R:-1,N),Q(w,S,E,N,c,d,p,h,f,m,t,o)}else u(A)&&(T=A.positions[0],x=A.positions[1],P=A.positions[2]),T.y<0?(t=_.attributes,r=_.indices,i=y):(t=v.attributes,r=v.indices,i=b),o=Z(t,r,i,g,a,T),Q(w,S,E,T,c,d,p,h,f,m,t,o),o=Z(t,r,i,g,a+1,x),Q(w,S,E,x,c,d,p,h,f,m,t,o),o=Z(t,r,i,g,a+2,P),Q(w,S,E,P,c,d,p,h,f,m,t,o)}X(e,_,v)}function J(e){var t,r=e.geometry,i=r.attributes,o=i.position.values,a=r.indices,s=Y(r),l=Y(r),c=a.length,d=[];d.length=o.length/3;var h=[];for(h.length=o.length/3,t=0;t<d.length;++t)d[t]=-1,h[t]=-1;for(t=0;t<c;t+=2){var p=a[t],f=a[t+1],m=n.fromArray(o,3*p,Pe),g=n.fromArray(o,3*f,Ae);Math.abs(m.y)<y.EPSILON6&&(m.y<0?m.y=-y.EPSILON6:m.y=y.EPSILON6),Math.abs(g.y)<y.EPSILON6&&(g.y<0?g.y=-y.EPSILON6:g.y=y.EPSILON6);var v=s.attributes,b=s.indices,C=h,w=l.attributes,S=l.indices,E=d,T=_.lineSegmentPlane(m,g,Ne,De);if(u(T)){var x=n.multiplyByScalar(n.UNIT_Y,5*y.EPSILON9,ke);m.y<0&&(n.negate(x,x),v=l.attributes,b=l.indices,C=d,w=s.attributes,S=s.indices,E=h);var P=n.add(T,x,Le);Z(v,b,C,a,t,m),Z(v,b,C,a,-1,P),n.negate(x,x),n.add(T,x,P),Z(w,S,E,a,-1,P),Z(w,S,E,a,t+1,g)}else{var A,D,I;m.y<0?(A=l.attributes,D=l.indices,I=d):(A=s.attributes,D=s.indices,I=h),Z(A,D,I,a,t,m),Z(A,D,I,a,t+1,g)}}X(e,l,s)}function $(e){for(var t=e.attributes,r=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,a=r.length,s=0;s<a;s+=3){var l=n.unpack(r,s,Ue);if(!(l.x>0)){var u=n.unpack(i,s,Ve);(l.y<0&&u.y>0||l.y>0&&u.y<0)&&(s-3>0?(i[s]=r[s-3],i[s+1]=r[s-2],i[s+2]=r[s-1]):n.pack(l,i,s));var c=n.unpack(o,s,ze);(l.y<0&&c.y>0||l.y>0&&c.y<0)&&(s+3<a?(o[s]=r[s+3],o[s+1]=r[s+4],o[s+2]=r[s+5]):n.pack(l,o,s))}}}function ee(e){var t,r,a,s=e.geometry,l=s.attributes,c=l.position.values,d=l.prevPosition.values,h=l.nextPosition.values,p=l.expandAndWidth.values,f=u(l.st)?l.st.values:void 0,m=u(l.color)?l.color.values:void 0,g=Y(s),v=Y(s),b=!1,C=c.length/3;for(t=0;t<C;t+=4){var w=t,S=t+2,E=n.fromArray(c,3*w,Ue),T=n.fromArray(c,3*S,Ve);if(Math.abs(E.y)<Ye)for(E.y=Ye*(T.y<0?-1:1),c[3*t+1]=E.y,c[3*(t+1)+1]=E.y,r=3*w;r<3*w+12;r+=3)d[r]=c[3*t],d[r+1]=c[3*t+1],d[r+2]=c[3*t+2];if(Math.abs(T.y)<Ye)for(T.y=Ye*(E.y<0?-1:1),c[3*(t+2)+1]=T.y,c[3*(t+3)+1]=T.y,r=3*w;r<3*w+12;r+=3)h[r]=c[3*(t+2)],h[r+1]=c[3*(t+2)+1],h[r+2]=c[3*(t+2)+2];var x=g.attributes,P=g.indices,A=v.attributes,D=v.indices,I=_.lineSegmentPlane(E,T,Ne,Ge);if(u(I)){b=!0;var M=n.multiplyByScalar(n.UNIT_Y,qe,He);E.y<0&&(n.negate(M,M),x=v.attributes,P=v.indices,A=g.attributes,D=g.indices);var O=n.add(I,M,We);x.position.values.push(E.x,E.y,E.z,E.x,E.y,E.z),x.position.values.push(O.x,O.y,O.z),x.position.values.push(O.x,O.y,O.z),x.prevPosition.values.push(d[3*w],d[3*w+1],d[3*w+2]),x.prevPosition.values.push(d[3*w+3],d[3*w+4],d[3*w+5]),x.prevPosition.values.push(E.x,E.y,E.z,E.x,E.y,E.z),x.nextPosition.values.push(O.x,O.y,O.z),x.nextPosition.values.push(O.x,O.y,O.z),x.nextPosition.values.push(O.x,O.y,O.z),x.nextPosition.values.push(O.x,O.y,O.z),n.negate(M,M),n.add(I,M,O),A.position.values.push(O.x,O.y,O.z),A.position.values.push(O.x,O.y,O.z),A.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),A.prevPosition.values.push(O.x,O.y,O.z),A.prevPosition.values.push(O.x,O.y,O.z),A.prevPosition.values.push(O.x,O.y,O.z),A.prevPosition.values.push(O.x,O.y,O.z),A.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),A.nextPosition.values.push(h[3*S],h[3*S+1],h[3*S+2]),A.nextPosition.values.push(h[3*S+3],h[3*S+4],h[3*S+5]);var R=i.fromArray(p,2*w,Fe),N=Math.abs(R.y);x.expandAndWidth.values.push(-1,N,1,N),x.expandAndWidth.values.push(-1,-N,1,-N),A.expandAndWidth.values.push(-1,N,1,N),A.expandAndWidth.values.push(-1,-N,1,-N);var k=n.magnitudeSquared(n.subtract(I,E,ze));if(k/=n.magnitudeSquared(n.subtract(T,E,ze)),u(m)){var L=o.fromArray(m,4*w,je),F=o.fromArray(m,4*S,je),B=y.lerp(L.x,F.x,k),U=y.lerp(L.y,F.y,k),V=y.lerp(L.z,F.z,k),z=y.lerp(L.w,F.w,k);for(r=4*w;r<4*w+8;++r)x.color.values.push(m[r]);for(x.color.values.push(B,U,V,z),x.color.values.push(B,U,V,z),A.color.values.push(B,U,V,z),A.color.values.push(B,U,V,z),r=4*S;r<4*S+8;++r)A.color.values.push(m[r])}if(u(f)){var G=i.fromArray(f,2*w,Fe),H=i.fromArray(f,2*(t+3),Be),W=y.lerp(G.x,H.x,k);for(r=2*w;r<2*w+4;++r)x.st.values.push(f[r]);for(x.st.values.push(W,G.y),x.st.values.push(W,H.y),A.st.values.push(W,G.y),A.st.values.push(W,H.y),r=2*S;r<2*S+4;++r)A.st.values.push(f[r])}a=x.position.values.length/3-4,P.push(a,a+2,a+1),P.push(a+1,a+2,a+3),a=A.position.values.length/3-4,D.push(a,a+2,a+1),D.push(a+1,a+2,a+3)}else{var j,q;for(E.y<0?(j=v.attributes,q=v.indices):(j=g.attributes,q=g.indices),j.position.values.push(E.x,E.y,E.z),j.position.values.push(E.x,E.y,E.z),j.position.values.push(T.x,T.y,T.z),j.position.values.push(T.x,T.y,T.z),r=3*t;r<3*t+12;++r)j.prevPosition.values.push(d[r]),j.nextPosition.values.push(h[r]);for(r=2*t;r<2*t+8;++r)j.expandAndWidth.values.push(p[r]),u(f)&&j.st.values.push(f[r]);if(u(m))for(r=4*t;r<4*t+16;++r)j.color.values.push(m[r]);a=j.position.values.length/3-4,q.push(a,a+2,a+1),q.push(a+1,a+2,a+3)}}b&&($(v),$(g)),X(e,v,g)}var te={};te.toWireframe=function(e){var t=e.indices;if(u(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=x(t);break;case S.TRIANGLE_STRIP:e.indices=P(t);break;case S.TRIANGLE_FAN:e.indices=A(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,i){t=l(t,"normal"),i=l(i,1e4);for(var n=e.attributes.position.values,o=e.attributes[t].values,a=n.length,c=new Float64Array(2*a),d=0,h=0;h<a;h+=3)c[d++]=n[h],c[d++]=n[h+1],c[d++]=n[h+2],c[d++]=n[h]+o[h]*i,c[d++]=n[h+1]+o[h+1]*i,c[d++]=n[h+2]+o[h+2]*i;var m,g=e.boundingSphere;return u(g)&&(m=new r(g.center,g.radius+i)),new p({attributes:{position:new f({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:c})},primitiveType:S.LINES,boundingSphere:m})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],i=e.attributes,n={},o=0,a=r.length;for(t=0;t<a;++t){var s=r[t];u(i[s])&&(n[s]=o++)}for(var l in i)i.hasOwnProperty(l)&&!u(n[l])&&(n[l]=o++);return n},te.reorderForPreVertexCache=function(e){var t=p.computeNumberOfVertices(e),r=e.indices;if(u(r)){for(var i=new Int32Array(t),n=0;n<t;n++)i[n]=-1;for(var o,a=r,l=a.length,c=g.createTypedArray(t,l),d=0,h=0,f=0;d<l;)o=i[a[d]],o!==-1?c[h]=o:(o=a[d],i[o]=f,c[h]=f,++f),++d,++h;e.indices=c;var m=e.attributes;for(var v in m)if(m.hasOwnProperty(v)&&u(m[v])&&u(m[v].values)){for(var _=m[v],y=_.values,b=0,C=_.componentsPerAttribute,w=s.createTypedArray(_.componentDatatype,f*C);b<t;){var S=i[b];if(S!==-1)for(n=0;n<C;n++)w[C*S+n]=y[C*b+n];++b}_.values=w}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&u(r)){for(var i=r.length,n=0,o=0;o<i;o++)r[o]>n&&(n=r[o]);e.indices=E.tipsify({indices:r,maximumIndex:n,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=p.computeNumberOfVertices(e);if(u(e.indices)&&r>=y.SIXTY_FOUR_KILOBYTES){var i,n=[],o=[],a=0,s=D(e.attributes),l=e.indices,c=l.length;e.primitiveType===S.TRIANGLES?i=3:e.primitiveType===S.LINES?i=2:e.primitiveType===S.POINTS&&(i=1);for(var d=0;d<c;d+=i){for(var h=0;h<i;++h){var f=l[d+h],m=n[f];u(m)||(m=a++,n[f]=m,I(s,e.attributes,f)),o.push(m)}a+i>=y.SIXTY_FOUR_KILOBYTES&&(t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),n=[],o=[],a=0,s=D(e.attributes))}0!==o.length&&t.push(new p({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new n,ie=new a;te.projectTo2D=function(e,t,r,i,o){var a=e.attributes[t];o=u(o)?o:new h;for(var l=o.ellipsoid,c=a.values,d=new Float64Array(c.length),p=0,m=0;m<c.length;m+=3){var g=n.fromArray(c,m,re),v=l.cartesianToCartographic(g,ie),_=o.project(v,re);d[p++]=_.x,d[p++]=_.y,d[p++]=_.z}return e.attributes[r]=a,e.attributes[i]=new f({componentDatatype:s.DOUBLE,componentsPerAttribute:3,values:d}),delete e.attributes[t],e};var ne={high:0,low:0};te.encodeAttribute=function(e,t,r,i){for(var n=e.attributes[t],o=n.values,a=o.length,l=new Float32Array(a),u=new Float32Array(a),c=0;c<a;++c)d.encode(o[c],ne),l[c]=ne.high,u[c]=ne.low;var h=n.componentsPerAttribute;return e.attributes[r]=new f({componentDatatype:s.FLOAT,componentsPerAttribute:h,values:l}),e.attributes[i]=new f({componentDatatype:s.FLOAT,componentsPerAttribute:h,values:u}),delete e.attributes[t],e};var oe=new n,ae=new C,se=new b;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(C.equals(t,C.IDENTITY))return e;var i=e.geometry.attributes;M(t,i.position),M(t,i.prevPosition),M(t,i.nextPosition),(u(i.normal)||u(i.tangent)||u(i.bitangent))&&(C.inverse(t,ae),C.transpose(ae,ae),C.getRotation(ae,se),O(se,i.normal),O(se,i.tangent),O(se,i.bitangent));var n=e.geometry.boundingSphere;return u(n)&&(e.geometry.boundingSphere=r.transform(n,t,n)),e.modelMatrix=C.clone(C.IDENTITY),e};var le=new n;te.combineInstances=function(e){for(var t=[],r=[],i=e.length,n=0;n<i;++n){var o=e[n];u(o.geometry)?t.push(o):u(o.westHemisphereGeometry)&&u(o.eastHemisphereGeometry)&&r.push(o)}var a=[];return t.length>0&&a.push(N(t,"geometry")),r.length>0&&(a.push(N(r,"westHemisphereGeometry")),a.push(N(r,"eastHemisphereGeometry"))),a};var ue=new n,ce=new n,de=new n,he=new n;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,i=r.position.values,o=r.position.values.length/3,a=t.length,l=new Array(o),u=new Array(a/3),c=new Array(a),d=0;d<o;d++)l[d]={indexOffset:0,count:0,currentCount:0};var h=0;for(d=0;d<a;d+=3){var p=t[d],m=t[d+1],g=t[d+2],v=3*p,_=3*m,b=3*g;ce.x=i[v],ce.y=i[v+1],ce.z=i[v+2],de.x=i[_],de.y=i[_+1],de.z=i[_+2],he.x=i[b],he.y=i[b+1],he.z=i[b+2],l[p].count++,l[m].count++,l[g].count++,n.subtract(de,ce,de),n.subtract(he,ce,he),u[h]=n.cross(de,he,new n),h++}var C=0;for(d=0;d<o;d++)l[d].indexOffset+=C,C+=l[d].count;h=0;var w;for(d=0;d<a;d+=3){w=l[t[d]];var S=w.indexOffset+w.currentCount;c[S]=h,w.currentCount++,w=l[t[d+1]],S=w.indexOffset+w.currentCount,c[S]=h,w.currentCount++,w=l[t[d+2]],S=w.indexOffset+w.currentCount,c[S]=h,w.currentCount++,h++}var E=new Float32Array(3*o);for(d=0;d<o;d++){var T=3*d;if(w=l[d],n.clone(n.ZERO,ue),w.count>0){for(h=0;h<w.count;h++)n.add(ue,u[c[w.indexOffset+h]],ue);n.equalsEpsilon(n.ZERO,ue,y.EPSILON10)&&n.clone(u[c[w.indexOffset]],ue)}n.equalsEpsilon(n.ZERO,ue,y.EPSILON10)&&(ue.z=1),n.normalize(ue,ue),E[T]=ue.x,E[T+1]=ue.y,E[T+2]=ue.z}return e.attributes.normal=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:E}),e};var pe=new n,fe=new n,me=new n;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,i=e.attributes.normal.values,o=e.attributes.st.values,a=e.attributes.position.values.length/3,l=t.length,u=new Array(3*a),c=0;c<u.length;c++)u[c]=0;var d,h,p;for(c=0;c<l;c+=3){var m=t[c],g=t[c+1],v=t[c+2];d=3*m,h=3*g,p=3*v;var _=2*m,y=2*g,b=2*v,C=r[d],w=r[d+1],S=r[d+2],E=o[_],T=o[_+1],x=o[y+1]-T,P=o[b+1]-T,A=1/((o[y]-E)*P-(o[b]-E)*x),D=(P*(r[h]-C)-x*(r[p]-C))*A,I=(P*(r[h+1]-w)-x*(r[p+1]-w))*A,M=(P*(r[h+2]-S)-x*(r[p+2]-S))*A;u[d]+=D,u[d+1]+=I,u[d+2]+=M,u[h]+=D,u[h+1]+=I,u[h+2]+=M,u[p]+=D,u[p+1]+=I,u[p+2]+=M}var O=new Float32Array(3*a),R=new Float32Array(3*a);for(c=0;c<a;c++){d=3*c,h=d+1,p=d+2;var N=n.fromArray(i,d,pe),k=n.fromArray(u,d,me),L=n.dot(N,k);n.multiplyByScalar(N,L,fe),n.normalize(n.subtract(k,fe,k),k),O[d]=k.x,O[h]=k.y,O[p]=k.z,n.normalize(n.cross(N,k,k),k),R[d]=k.x,R[h]=k.y,R[p]=k.z}return e.attributes.tangent=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:O}),e.attributes.bitangent=new f({componentDatatype:s.FLOAT,componentsPerAttribute:3,values:R}),e};var ge=new i,ve=new n,_e=new n,ye=new n,be=new i;te.compressVertices=function(t){var r,o,a=t.attributes.extrudeDirection;if(u(a)){var l=a.values;o=l.length/3;var c=new Float32Array(2*o),d=0;for(r=0;r<o;++r)n.fromArray(l,3*r,ve),n.equals(ve,n.ZERO)?d+=2:(be=e.octEncodeInRange(ve,65535,be),c[d++]=be.x,c[d++]=be.y);return t.attributes.compressedAttributes=new f({componentDatatype:s.FLOAT,componentsPerAttribute:2,values:c}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,p=t.attributes.st,m=u(h),g=u(p);if(!m&&!g)return t;var v,_,y,b,C=t.attributes.tangent,w=t.attributes.bitangent,S=u(C),E=u(w);m&&(v=h.values),g&&(_=p.values),S&&(y=C.values),E&&(b=w.values);var T=m?v.length:_.length,x=m?3:2;o=T/x;var P=o,A=g&&m?2:1;A+=S||E?1:0,P*=A;var D=new Float32Array(P),I=0;for(r=0;r<o;++r){g&&(i.fromArray(_,2*r,ge),D[I++]=e.compressTextureCoordinates(ge));var M=3*r;m&&u(y)&&u(b)?(n.fromArray(v,M,ve),n.fromArray(y,M,_e),n.fromArray(b,M,ye),e.octPack(ve,_e,ye,ge),D[I++]=ge.x,D[I++]=ge.y):(m&&(n.fromArray(v,M,ve),D[I++]=e.octEncodeFloat(ve)),S&&(n.fromArray(y,M,ve),D[I++]=e.octEncodeFloat(ve)),E&&(n.fromArray(b,M,ve), +D[I++]=e.octEncodeFloat(ve)))}return t.attributes.compressedAttributes=new f({componentDatatype:s.FLOAT,componentsPerAttribute:A,values:D}),m&&delete t.attributes.normal,g&&delete t.attributes.st,E&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Ce=new n,we=new n,Se=new n,Ee=new n,Te=new n,xe={positions:new Array(7),indices:new Array(9)},Pe=new n,Ae=new n,De=new n,Ie=new n,Me=new i,Oe=new i,Re=new i,Ne=w.fromPointNormal(n.ZERO,n.UNIT_Y),ke=new n,Le=new n,Fe=new i,Be=new i,Ue=new n,Ve=new n,ze=new n,Ge=new n,He=new n,We=new n,je=new o,qe=5*y.EPSILON9,Ye=y.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,i=t.boundingSphere;if(u(i)){var n=i.center.x-i.radius;if(n>0||r.intersectPlane(i,w.ORIGIN_ZX_PLANE)!==v.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:K(e);break;case m.LINES:J(e)}else z(t),t.primitiveType===S.TRIANGLES?K(e):t.primitiveType===S.LINES&&J(e);return e},te}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T){"use strict";function x(e,i,o){var a=i.vertexFormat,s=i.center,l=i.semiMajorAxis,c=i.semiMinorAxis,h=i.ellipsoid,m=i.stRotation,g=o?e.length/3*2:e.length/3,v=i.shadowVolume,_=a.st?new Float32Array(2*g):void 0,b=a.normal?new Float32Array(3*g):void 0,C=a.tangent?new Float32Array(3*g):void 0,S=a.bitangent?new Float32Array(3*g):void 0,E=v?new Float32Array(3*g):void 0,T=0,x=z,P=G,A=H,D=new d(h),I=D.project(h.cartesianToCartographic(s,W),j),M=h.scaleToGeodeticSurface(s,N);h.geodeticSurfaceNormal(M,M);for(var O=w.fromAxisAngle(M,m,V),R=y.fromQuaternion(O,U),F=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,q),X=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),Q=e.length,Z=o?Q:0,K=Z/3*2,J=0;J<Q;J+=3){var $=J+1,ee=J+2,te=r.fromArray(e,J,N);if(a.st){var re=y.multiplyByVector(R,te,k),ie=D.project(h.cartesianToCartographic(re,W),L);r.subtract(ie,I,ie),B.x=(ie.x+l)/(2*l),B.y=(ie.y+c)/(2*c),F.x=Math.min(B.x,F.x),F.y=Math.min(B.y,F.y),X.x=Math.max(B.x,X.x),X.y=Math.max(B.y,X.y),o&&(_[T+K]=B.x,_[T+1+K]=B.y),_[T++]=B.x,_[T++]=B.y}(a.normal||a.tangent||a.bitangent||v)&&(x=h.geodeticSurfaceNormal(te,x),v&&(E[J+Z]=-x.x,E[$+Z]=-x.y,E[ee+Z]=-x.z),(a.normal||a.tangent||a.bitangent)&&((a.tangent||a.bitangent)&&(P=r.normalize(r.cross(r.UNIT_Z,x,P),P),y.multiplyByVector(R,P,P)),a.normal&&(b[J]=x.x,b[$]=x.y,b[ee]=x.z,o&&(b[J+Z]=-x.x,b[$+Z]=-x.y,b[ee+Z]=-x.z)),a.tangent&&(C[J]=P.x,C[$]=P.y,C[ee]=P.z,o&&(C[J+Z]=-P.x,C[$+Z]=-P.y,C[ee+Z]=-P.z)),a.bitangent&&(A=r.normalize(r.cross(x,P,A),A),S[J]=A.x,S[$]=A.y,S[ee]=A.z,o&&(S[J+Z]=A.x,S[$+Z]=A.y,S[ee+Z]=A.z))))}if(a.st){Q=_.length;for(var ne=0;ne<Q;ne+=2)_[ne]=(_[ne]-F.x)/(X.x-F.x),_[ne+1]=(_[ne+1]-F.y)/(X.y-F.y)}var oe=new f;if(a.position){var ae=u.raisePositionsToHeight(e,i,o);oe.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:ae})}return a.st&&(oe.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:_})),a.normal&&(oe.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:b})),a.tangent&&(oe.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),a.bitangent&&(oe.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),v&&(oe.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:E})),oe}function P(e){var t,r,i,n,o,a=new Array(12*(e*(e+1))-6),s=0;for(t=0,i=1,n=0;n<3;n++)a[s++]=i++,a[s++]=t,a[s++]=i;for(n=2;n<e+1;++n){for(i=n*(n+1)-1,t=(n-1)*n-1,a[s++]=i++,a[s++]=t,a[s++]=i,r=2*n,o=0;o<r-1;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=i++,a[s++]=t,a[s++]=i}for(r=2*e,++i,++t,n=0;n<r-1;++n)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;for(a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t++,a[s++]=t,++t,n=e-1;n>1;--n){for(a[s++]=t++,a[s++]=t,a[s++]=i,r=2*n,o=0;o<r-1;++o)a[s++]=i,a[s++]=t++,a[s++]=t,a[s++]=i++,a[s++]=t,a[s++]=i;a[s++]=t++,a[s++]=t++,a[s++]=i++}for(n=0;n<3;n++)a[s++]=t++,a[s++]=t,a[s++]=i;return a}function A(t){var i=t.center;X=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(i,X),t.height,X),X=r.add(i,X,X);var n=new e(X,t.semiMajorAxis),o=u.computeEllipsePositions(t,!0,!1),a=o.positions,s=o.numPts,l=x(a,t,!1),c=P(s);return c=v.createTypedArray(a.length/3,c),{boundingSphere:n,attributes:l,indices:c}}function D(e,i){var o=i.vertexFormat,a=i.center,s=i.semiMajorAxis,l=i.semiMinorAxis,u=i.ellipsoid,c=i.height,h=i.extrudedHeight,m=i.stRotation,g=e.length/3*2,v=new Float64Array(3*g),_=o.st?new Float32Array(2*g):void 0,b=o.normal?new Float32Array(3*g):void 0,C=o.tangent?new Float32Array(3*g):void 0,S=o.bitangent?new Float32Array(3*g):void 0,E=i.shadowVolume,T=E?new Float32Array(3*g):void 0,x=0,P=z,A=G,D=H,I=new d(u),M=I.project(u.cartesianToCartographic(a,W),j),O=u.scaleToGeodeticSurface(a,N);u.geodeticSurfaceNormal(O,O);for(var R=w.fromAxisAngle(O,m,V),X=y.fromQuaternion(R,U),Q=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,q),Z=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Y),K=e.length,J=K/3*2,$=0;$<K;$+=3){var ee,te=$+1,re=$+2,ie=r.fromArray(e,$,N);if(o.st){var ne=y.multiplyByVector(X,ie,k),oe=I.project(u.cartesianToCartographic(ne,W),L);r.subtract(oe,M,oe),B.x=(oe.x+s)/(2*s),B.y=(oe.y+l)/(2*l),Q.x=Math.min(B.x,Q.x),Q.y=Math.min(B.y,Q.y),Z.x=Math.max(B.x,Z.x),Z.y=Math.max(B.y,Z.y),_[x+J]=B.x,_[x+1+J]=B.y,_[x++]=B.x,_[x++]=B.y}ie=u.scaleToGeodeticSurface(ie,ie),ee=r.clone(ie,k),P=u.geodeticSurfaceNormal(ie,P),E&&(T[$+K]=-P.x,T[te+K]=-P.y,T[re+K]=-P.z);var ae=r.multiplyByScalar(P,c,F);if(ie=r.add(ie,ae,ie),ae=r.multiplyByScalar(P,h,ae),ee=r.add(ee,ae,ee),o.position&&(v[$+K]=ee.x,v[te+K]=ee.y,v[re+K]=ee.z,v[$]=ie.x,v[te]=ie.y,v[re]=ie.z),o.normal||o.tangent||o.bitangent){D=r.clone(P,D);var se=r.fromArray(e,($+3)%K,F);r.subtract(se,ie,se);var le=r.subtract(ee,ie,L);P=r.normalize(r.cross(le,se,P),P),o.normal&&(b[$]=P.x,b[te]=P.y,b[re]=P.z,b[$+K]=P.x,b[te+K]=P.y,b[re+K]=P.z),o.tangent&&(A=r.normalize(r.cross(D,P,A),A),C[$]=A.x,C[te]=A.y,C[re]=A.z,C[$+K]=A.x,C[$+1+K]=A.y,C[$+2+K]=A.z),o.bitangent&&(S[$]=D.x,S[te]=D.y,S[re]=D.z,S[$+K]=D.x,S[te+K]=D.y,S[re+K]=D.z)}}if(o.st){K=_.length;for(var ue=0;ue<K;ue+=2)_[ue]=(_[ue]-Q.x)/(Z.x-Q.x),_[ue+1]=(_[ue+1]-Q.y)/(Z.y-Q.y)}var ce=new f;return o.position&&(ce.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:v})),o.st&&(ce.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:_})),o.normal&&(ce.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:b})),o.tangent&&(ce.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:C})),o.bitangent&&(ce.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:S})),E&&(ce.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:T})),ce}function I(e){for(var t=e.length/3,r=v.createTypedArray(t,6*t),i=0,n=0;n<t;n++){var o=n,a=n+t,s=(o+1)%t,l=s+t;r[i++]=o,r[i++]=a,r[i++]=s,r[i++]=s,r[i++]=a,r[i++]=l}return r}function M(t){var i=t.center,n=t.ellipsoid,o=t.semiMajorAxis,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,N),t.height,N);Q.center=r.add(i,a,Q.center),Q.radius=o,a=r.multiplyByScalar(n.geodeticSurfaceNormal(i,a),t.extrudedHeight,a),Z.center=r.add(i,a,Z.center),Z.radius=o;var s=u.computeEllipsePositions(t,!0,!0),l=s.positions,c=s.numPts,d=s.outerPositions,p=e.union(Q,Z),f=x(l,t,!0),_=P(c),y=_.length;_.length=2*y;for(var b=l.length/3,w=0;w<y;w+=3)_[w+y]=_[w+2]+b,_[w+1+y]=_[w+1]+b,_[w+2+y]=_[w]+b;var S=v.createTypedArray(2*b/3,_),E=new h({attributes:f,indices:S,primitiveType:C.TRIANGLES}),T=D(d,t);_=I(d);var A=v.createTypedArray(2*d.length/3,_),M=new h({attributes:T,indices:A,primitiveType:C.TRIANGLES}),O=g.combineInstances([new m({geometry:E}),new m({geometry:M})]);return{boundingSphere:p,attributes:O[0].attributes,indices:O[0].indices}}function O(e,t,i,n,o){E.eastNorthUpToFixedFrame(e,t,K),b.inverseTransformation(K,J);for(var a=0;a<4;++a)r.clone(r.ZERO,ee[a]);for(ee[0].x+=i,ee[1].x-=i,ee[2].y+=n,ee[3].y-=n,y.fromRotationZ(o,$),a=0;a<4;++a)y.multiplyByVector($,ee[a],ee[a]),b.multiplyByPoint(K,ee[a],ee[a]),t.cartesianToCartographic(ee[a],te[a]);return S.fromCartographicArray(te)}function R(e){e=o(e,o.EMPTY_OBJECT);var t=e.center,i=o(e.ellipsoid,c.WGS84),n=e.semiMajorAxis,s=e.semiMinorAxis,l=o(e.granularity,_.RADIANS_PER_DEGREE),u=o(e.height,0),d=e.extrudedHeight,h=a(d)&&Math.abs(u-d)>1,p=o(e.vertexFormat,T.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=n,this._semiMinorAxis=s,this._ellipsoid=c.clone(i),this._rotation=o(e.rotation,0),this._stRotation=o(e.stRotation,0),this._height=u,this._granularity=l,this._vertexFormat=T.clone(p),this._extrudedHeight=o(d,u),this._extrude=h,this._shadowVolume=o(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._rectangle=O(this._center,this._ellipsoid,n,s,this._rotation)}var N=new r,k=new r,L=new r,F=new r,B=new t,U=new y,V=new w,z=new r,G=new r,H=new r,W=new i,j=new r,q=new t,Y=new t,X=new r,Q=new e,Z=new e,K=new b,J=new b,$=new y,ee=[new r,new r,new r,new r],te=[new i,new i,new i,new i];R.packedLength=r.packedLength+c.packedLength+T.packedLength+S.packedLength+9,R.pack=function(e,t,i){return i=o(i,0),r.pack(e._center,t,i),i+=r.packedLength,c.pack(e._ellipsoid,t,i),i+=c.packedLength,T.pack(e._vertexFormat,t,i),i+=T.packedLength,S.pack(e._rectangle,t,i),i+=S.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._extrude?1:0,t[i]=e._shadowVolume?1:0,t};var re=new r,ie=new c,ne=new T,oe=new S,ae={center:re,ellipsoid:ie,vertexFormat:ne,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0};return R.unpack=function(e,t,i){t=o(t,0);var n=r.unpack(e,t,re);t+=r.packedLength;var s=c.unpack(e,t,ie);t+=c.packedLength;var l=T.unpack(e,t,ne);t+=T.packedLength;var u=S.unpack(e,t,oe);t+=S.packedLength;var d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=e[t++],g=e[t++],v=e[t++],_=1===e[t++],y=1===e[t];return a(i)?(i._center=r.clone(n,i._center),i._ellipsoid=c.clone(s,i._ellipsoid),i._vertexFormat=T.clone(l,i._vertexFormat),i._semiMajorAxis=d,i._semiMinorAxis=h,i._rotation=p,i._stRotation=f,i._height=m,i._granularity=g,i._extrudedHeight=v,i._extrude=_,i._shadowVolume=y,i._rectangle=S.clone(u),i):(ae.height=m,ae.extrudedHeight=v,ae.granularity=g,ae.stRotation=f,ae.rotation=p,ae.semiMajorAxis=d,ae.semiMinorAxis=h,ae.shadowVolume=y,new R(ae))},R.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),r.shadowVolume=e._shadowVolume,t=M(r)):t=A(r),new h({attributes:t.attributes,indices:t.indices,primitiveType:C.TRIANGLES,boundingSphere:t.boundingSphere})}},R.createShadowVolume=function(e,t,r){var i=e._granularity,n=e._ellipsoid,o=t(i,n),a=r(i,n);return new R({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:n,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:a,vertexFormat:T.POSITION_ONLY,shadowVolume:!0})},s(R.prototype,{rectangle:{get:function(){return this._rectangle}}}),R}),define("Core/CircleGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.EMPTY_OBJECT);var t=e.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 o(i),this._workerName="createCircleGeometry"}l.packedLength=o.packedLength,l.pack=function(e,t,r){return o.pack(e._ellipseGeometry,t,r)};var u=new o({center:new e,semiMajorAxis:1,semiMinorAxis:1}),c={center:new e,radius:void 0,ellipsoid:a.clone(a.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new s,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return l.unpack=function(t,r,n){var d=o.unpack(t,r,u);return c.center=e.clone(d._center,c.center),c.ellipsoid=a.clone(d._ellipsoid,c.ellipsoid),c.height=d._height,c.extrudedHeight=d._extrudedHeight,c.granularity=d._granularity,c.vertexFormat=s.clone(d._vertexFormat,c.vertexFormat),c.stRotation=d._stRotation,c.shadowVolume=d._shadowVolume,i(n)?(c.semiMajorAxis=d._semiMajorAxis,c.semiMinorAxis=d._semiMinorAxis,n._ellipseGeometry=new o(c),n):(c.radius=d._semiMajorAxis,new l(c))},l.createGeometry=function(e){return o.createGeometry(e._ellipseGeometry)},l.createShadowVolume=function(e,t,r){var i=e._ellipseGeometry._granularity,n=e._ellipseGeometry._ellipsoid,o=t(i,n),a=r(i,n);return new l({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:n,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:a,vertexFormat:s.POSITION_ONLY,shadowVolume:!0})},n(l.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),l}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(i){var n=i.center;_=t.multiplyByScalar(i.ellipsoid.geodeticSurfaceNormal(n,_),i.height,_),_=t.add(n,_,_);for(var o=new e(_,i.semiMajorAxis),s=a.computeEllipsePositions(i,!1,!0).outerPositions,l=new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(s,i,!1)})}),h=s.length/3,p=d.createTypedArray(h,2*h),f=0,m=0;m<h;++m)p[f++]=m,p[f++]=(m+1)%h;return{boundingSphere:o,attributes:l,indices:p}}function m(n){var o=n.center,s=n.ellipsoid,l=n.semiMajorAxis,p=t.multiplyByScalar(s.geodeticSurfaceNormal(o,v),n.height,v);y.center=t.add(o,p,y.center),y.radius=l,p=t.multiplyByScalar(s.geodeticSurfaceNormal(o,p),n.extrudedHeight,p),b.center=t.add(o,p,b.center),b.radius=l;var f=a.computeEllipsePositions(n,!1,!0).outerPositions,m=new c({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:a.raisePositionsToHeight(f,n,!0)})});f=m.position.values;var g=e.union(y,b),_=f.length/3,C=i(n.numberOfVerticalLines,16);C=h.clamp(C,0,_/2);var w=d.createTypedArray(_,2*_+2*C);_/=2;var S,E=0;for(S=0;S<_;++S)w[E++]=S,w[E++]=(S+1)%_,w[E++]=S+_,w[E++]=(S+1)%_+_;var T;if(C>0){var x=Math.min(C,_);T=Math.round(_/x);var P=Math.min(T*C,_);for(S=0;S<P;S+=T)w[E++]=S,w[E++]=S+_}return{boundingSphere:g,attributes:m,indices:w}}function g(e){e=i(e,i.EMPTY_OBJECT);var r=e.center,o=i(e.ellipsoid,s.WGS84),a=e.semiMajorAxis,l=e.semiMinorAxis,u=i(e.granularity,h.RADIANS_PER_DEGREE),c=i(e.height,0),d=e.extrudedHeight,p=n(d)&&Math.abs(c-d)>1;this._center=t.clone(r),this._semiMajorAxis=a,this._semiMinorAxis=l,this._ellipsoid=s.clone(o),this._rotation=i(e.rotation,0),this._height=c,this._granularity=u,this._extrudedHeight=d,this._extrude=p,this._numberOfVerticalLines=Math.max(i(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var v=new t,_=new t,y=new e,b=new e;g.packedLength=t.packedLength+s.packedLength+9,g.pack=function(e,r,o){return o=i(o,0),t.pack(e._center,r,o),o+=t.packedLength,s.pack(e._ellipsoid,r,o),o+=s.packedLength,r[o++]=e._semiMajorAxis,r[o++]=e._semiMinorAxis,r[o++]=e._rotation,r[o++]=e._height,r[o++]=e._granularity,r[o++]=n(e._extrudedHeight)?1:0,r[o++]=i(e._extrudedHeight,0),r[o++]=e._extrude?1:0,r[o]=e._numberOfVerticalLines,r};var C=new t,w=new s,S={center:C,ellipsoid:w,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return g.unpack=function(e,r,o){r=i(r,0);var a=t.unpack(e,r,C);r+=t.packedLength;var l=s.unpack(e,r,w);r+=s.packedLength;var u=e[r++],c=e[r++],d=e[r++],h=e[r++],p=e[r++],f=e[r++],m=e[r++],v=1===e[r++],_=e[r];return n(o)?(o._center=t.clone(a,o._center),o._ellipsoid=s.clone(l,o._ellipsoid),o._semiMajorAxis=u,o._semiMinorAxis=c,o._rotation=d,o._height=h,o._granularity=p,o._extrudedHeight=f?m:void 0,o._extrude=v,o._numberOfVerticalLines=_,o):(S.height=h,S.extrudedHeight=f?m:void 0,S.granularity=p,S.rotation=d,S.semiMajorAxis=u,S.semiMinorAxis=c,S.numberOfVerticalLines=_,new g(S))},g.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),t=m(r)):t=f(r),new l({attributes:t.attributes,indices:t.indices,primitiveType:p.LINES,boundingSphere:t.boundingSphere})}},g}),define("Core/CircleOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,r,i,n,o){"use strict";function a(e){e=r(e,r.EMPTY_OBJECT);var t=e.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 n(i),this._workerName="createCircleOutlineGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,r){return n.pack(e._ellipseGeometry,t,r)};var s=new n({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.center=e.clone(c._center,l.center),l.ellipsoid=o.clone(c._ellipsoid,l.ellipsoid),l.height=c._height,l.extrudedHeight=c._extrudedHeight,l.granularity=c._granularity,l.numberOfVerticalLines=c._numberOfVerticalLines,i(u)?(l.semiMajorAxis=c._semiMajorAxis,l.semiMinorAxis=c._semiMinorAxis,u._ellipseGeometry=new n(l),u):(l.radius=c._semiMajorAxis,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipseGeometry)},a}),define("Core/ClockRange",["./freezeObject"],function(e){"use strict";var t={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};return e(t)}),define("Core/ClockStep",["./freezeObject"],function(e){"use strict";var t={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};return e(t)}),define("Core/getTimestamp",["./defined"],function(e){"use strict";var t;return t="undefined"!=typeof performance&&e(performance.now)?function(){return performance.now()}:function(){return Date.now()}}),define("Core/Clock",["./ClockRange","./ClockStep","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./getTimestamp","./JulianDate"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(n){n=r(n,r.EMPTY_OBJECT);var o=n.currentTime,u=n.startTime,c=n.stopTime;o=i(o)?l.clone(o):i(u)?l.clone(u):i(c)?l.addDays(c,-1,new l):l.now(),u=i(u)?l.clone(u):l.clone(o),c=i(c)?l.clone(c):l.addDays(u,1,new l),this.startTime=u,this.stopTime=c,this.clockRange=r(n.clockRange,e.UNBOUNDED),this.canAnimate=r(n.canAnimate,!0),this.onTick=new a,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=s(),this.currentTime=o,this.multiplier=r(n.multiplier,1),this.clockStep=r(n.clockStep,t.SYSTEM_CLOCK_MULTIPLIER),this.shouldAnimate=r(n.shouldAnimate,!0)}return n(u.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){l.equals(this._currentTime,e)||(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===t.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=l.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===t.SYSTEM_CLOCK&&(this._clockStep=t.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}}),u.prototype.tick=function(){var r=s(),i=l.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){var n=this._clockStep;if(n===t.SYSTEM_CLOCK)i=l.now(i);else{var o=this._multiplier;if(n===t.TICK_DEPENDENT)i=l.addSeconds(i,o,i);else{var a=r-this._lastSystemTime;i=l.addSeconds(i,o*(a/1e3),i)}var u=this.clockRange,c=this.startTime,d=this.stopTime;if(u===e.CLAMPED)l.lessThan(i,c)?i=l.clone(c,i):l.greaterThan(i,d)&&(i=l.clone(d,i));else if(u===e.LOOP_STOP)for(l.lessThan(i,c)&&(i=l.clone(c,i));l.greaterThan(i,d);)i=l.addSeconds(c,l.secondsDifference(i,d),i)}}return this._currentTime=i,this._lastSystemTime=r,this.onTick.raiseEvent(this),i},u}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(e,t,r,i,n,o){"use strict";function a(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?e+6*(t-e)*r:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function s(t,r,i,n){this.red=e(t,1),this.green=e(r,1),this.blue=e(i,1),this.alpha=e(n,1)}s.fromCartesian4=function(e,r){return t(r)?(r.red=e.x,r.green=e.y,r.blue=e.z,r.alpha=e.w,r):new s(e.x,e.y,e.z,e.w)},s.fromBytes=function(r,i,n,o,a){return r=s.byteToFloat(e(r,255)),i=s.byteToFloat(e(i,255)),n=s.byteToFloat(e(n,255)),o=s.byteToFloat(e(o,255)),t(a)?(a.red=r,a.green=i,a.blue=n,a.alpha=o,a):new s(r,i,n,o)},s.fromAlpha=function(e,r,i){return t(i)?(i.red=e.red,i.green=e.green,i.blue=e.blue,i.alpha=r,i):new s(e.red,e.green,e.blue,r)};var l,u,c;i.supportsTypedArrays()&&(l=new ArrayBuffer(4),u=new Uint32Array(l),c=new Uint8Array(l)),s.fromRgba=function(e,t){return u[0]=e,s.fromBytes(c[0],c[1],c[2],c[3],t)},s.fromHsl=function(r,i,n,o,l){r=e(r,0)%1,i=e(i,0),n=e(n,0),o=e(o,1);var u=n,c=n,d=n;if(0!==i){var h;h=n<.5?n*(1+i):n+i-n*i;var p=2*n-h;u=a(p,h,r+1/3),c=a(p,h,r),d=a(p,h,r-1/3)}return t(l)?(l.red=u,l.green=c,l.blue=d,l.alpha=o,l):new s(u,c,d,o)},s.fromRandom=function(r,i){r=e(r,e.EMPTY_OBJECT);var n=r.red;if(!t(n)){var a=e(r.minimumRed,0),l=e(r.maximumRed,1);n=a+o.nextRandomNumber()*(l-a)}var u=r.green;if(!t(u)){var c=e(r.minimumGreen,0),d=e(r.maximumGreen,1);u=c+o.nextRandomNumber()*(d-c)}var h=r.blue;if(!t(h)){var p=e(r.minimumBlue,0),f=e(r.maximumBlue,1);h=p+o.nextRandomNumber()*(f-p)}var m=r.alpha;if(!t(m)){var g=e(r.minimumAlpha,0),v=e(r.maximumAlpha,1);m=g+o.nextRandomNumber()*(v-g)}return t(i)?(i.red=n,i.green=u,i.blue=h,i.alpha=m,i):new s(n,u,h,m)};var d=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,h=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,p=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,f=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return s.fromCssColorString=function(r,i){t(i)||(i=new s);var n=s[r.toUpperCase()];if(t(n))return s.clone(n,i),i;var o=d.exec(r);return null!==o?(i.red=parseInt(o[1],16)/15,i.green=parseInt(o[2],16)/15,i.blue=parseInt(o[3],16)/15,i.alpha=1,i):(o=h.exec(r),null!==o?(i.red=parseInt(o[1],16)/255,i.green=parseInt(o[2],16)/255,i.blue=parseInt(o[3],16)/255,i.alpha=1,i):(o=p.exec(r),null!==o?(i.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),i.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),i.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),i.alpha=parseFloat(e(o[4],"1.0")),i):(o=f.exec(r),null!==o?s.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(e(o[4],"1.0")),i):i=void 0)))},s.packedLength=4,s.pack=function(t,r,i){return i=e(i,0),r[i++]=t.red,r[i++]=t.green,r[i++]=t.blue,r[i]=t.alpha,r},s.unpack=function(r,i,n){return i=e(i,0),t(n)||(n=new s),n.red=r[i++],n.green=r[i++],n.blue=r[i++],n.alpha=r[i],n},s.byteToFloat=function(e){return e/255},s.floatToByte=function(e){return 1===e?255:256*e|0},s.clone=function(e,r){if(t(e))return t(r)?(r.red=e.red,r.green=e.green,r.blue=e.blue,r.alpha=e.alpha,r):new s(e.red,e.green,e.blue,e.alpha)},s.equals=function(e,r){return e===r||t(e)&&t(r)&&e.red===r.red&&e.green===r.green&&e.blue===r.blue&&e.alpha===r.alpha},s.equalsArray=function(e,t,r){return e.red===t[r]&&e.green===t[r+1]&&e.blue===t[r+2]&&e.alpha===t[r+3]},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.prototype.equalsEpsilon=function(e,r){return this===e||t(e)&&Math.abs(this.red-e.red)<=r&&Math.abs(this.green-e.green)<=r&&Math.abs(this.blue-e.blue)<=r&&Math.abs(this.alpha-e.alpha)<=r},s.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},s.prototype.toCssColorString=function(){var e=s.floatToByte(this.red),t=s.floatToByte(this.green),r=s.floatToByte(this.blue);return 1===this.alpha?"rgb("+e+","+t+","+r+")":"rgba("+e+","+t+","+r+","+this.alpha+")"},s.prototype.toBytes=function(e){var r=s.floatToByte(this.red),i=s.floatToByte(this.green),n=s.floatToByte(this.blue),o=s.floatToByte(this.alpha);return t(e)?(e[0]=r,e[1]=i,e[2]=n,e[3]=o,e):[r,i,n,o]},s.prototype.toRgba=function(){return c[0]=s.floatToByte(this.red),c[1]=s.floatToByte(this.green),c[2]=s.floatToByte(this.blue),c[3]=s.floatToByte(this.alpha),u[0]},s.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},s.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},s.prototype.withAlpha=function(e,t){return s.fromAlpha(this,e,t)},s.add=function(e,t,r){return r.red=e.red+t.red,r.green=e.green+t.green,r.blue=e.blue+t.blue,r.alpha=e.alpha+t.alpha,r},s.subtract=function(e,t,r){return r.red=e.red-t.red,r.green=e.green-t.green,r.blue=e.blue-t.blue,r.alpha=e.alpha-t.alpha,r},s.multiply=function(e,t,r){return r.red=e.red*t.red,r.green=e.green*t.green,r.blue=e.blue*t.blue,r.alpha=e.alpha*t.alpha,r},s.divide=function(e,t,r){return r.red=e.red/t.red,r.green=e.green/t.green,r.blue=e.blue/t.blue,r.alpha=e.alpha/t.alpha,r},s.mod=function(e,t,r){return r.red=e.red%t.red,r.green=e.green%t.green,r.blue=e.blue%t.blue,r.alpha=e.alpha%t.alpha,r},s.multiplyByScalar=function(e,t,r){return r.red=e.red*t,r.green=e.green*t,r.blue=e.blue*t,r.alpha=e.alpha*t,r},s.divideByScalar=function(e,t,r){return r.red=e.red/t,r.green=e.green/t,r.blue=e.blue/t,r.alpha=e.alpha/t,r},s.ALICEBLUE=n(s.fromCssColorString("#F0F8FF")),s.ANTIQUEWHITE=n(s.fromCssColorString("#FAEBD7")),s.AQUA=n(s.fromCssColorString("#00FFFF")),s.AQUAMARINE=n(s.fromCssColorString("#7FFFD4")),s.AZURE=n(s.fromCssColorString("#F0FFFF")),s.BEIGE=n(s.fromCssColorString("#F5F5DC")),s.BISQUE=n(s.fromCssColorString("#FFE4C4")),s.BLACK=n(s.fromCssColorString("#000000")),s.BLANCHEDALMOND=n(s.fromCssColorString("#FFEBCD")),s.BLUE=n(s.fromCssColorString("#0000FF")),s.BLUEVIOLET=n(s.fromCssColorString("#8A2BE2")),s.BROWN=n(s.fromCssColorString("#A52A2A")),s.BURLYWOOD=n(s.fromCssColorString("#DEB887")),s.CADETBLUE=n(s.fromCssColorString("#5F9EA0")),s.CHARTREUSE=n(s.fromCssColorString("#7FFF00")),s.CHOCOLATE=n(s.fromCssColorString("#D2691E")),s.CORAL=n(s.fromCssColorString("#FF7F50")),s.CORNFLOWERBLUE=n(s.fromCssColorString("#6495ED")),s.CORNSILK=n(s.fromCssColorString("#FFF8DC")),s.CRIMSON=n(s.fromCssColorString("#DC143C")),s.CYAN=n(s.fromCssColorString("#00FFFF")),s.DARKBLUE=n(s.fromCssColorString("#00008B")),s.DARKCYAN=n(s.fromCssColorString("#008B8B")),s.DARKGOLDENROD=n(s.fromCssColorString("#B8860B")),s.DARKGRAY=n(s.fromCssColorString("#A9A9A9")),s.DARKGREEN=n(s.fromCssColorString("#006400")),s.DARKGREY=s.DARKGRAY,s.DARKKHAKI=n(s.fromCssColorString("#BDB76B")),s.DARKMAGENTA=n(s.fromCssColorString("#8B008B")),s.DARKOLIVEGREEN=n(s.fromCssColorString("#556B2F")),s.DARKORANGE=n(s.fromCssColorString("#FF8C00")),s.DARKORCHID=n(s.fromCssColorString("#9932CC")),s.DARKRED=n(s.fromCssColorString("#8B0000")),s.DARKSALMON=n(s.fromCssColorString("#E9967A")),s.DARKSEAGREEN=n(s.fromCssColorString("#8FBC8F")),s.DARKSLATEBLUE=n(s.fromCssColorString("#483D8B")),s.DARKSLATEGRAY=n(s.fromCssColorString("#2F4F4F")),s.DARKSLATEGREY=s.DARKSLATEGRAY,s.DARKTURQUOISE=n(s.fromCssColorString("#00CED1")),s.DARKVIOLET=n(s.fromCssColorString("#9400D3")),s.DEEPPINK=n(s.fromCssColorString("#FF1493")),s.DEEPSKYBLUE=n(s.fromCssColorString("#00BFFF")),s.DIMGRAY=n(s.fromCssColorString("#696969")),s.DIMGREY=s.DIMGRAY,s.DODGERBLUE=n(s.fromCssColorString("#1E90FF")),s.FIREBRICK=n(s.fromCssColorString("#B22222")),s.FLORALWHITE=n(s.fromCssColorString("#FFFAF0")),s.FORESTGREEN=n(s.fromCssColorString("#228B22")),s.FUCHSIA=n(s.fromCssColorString("#FF00FF")),s.GAINSBORO=n(s.fromCssColorString("#DCDCDC")),s.GHOSTWHITE=n(s.fromCssColorString("#F8F8FF")),s.GOLD=n(s.fromCssColorString("#FFD700")),s.GOLDENROD=n(s.fromCssColorString("#DAA520")),s.GRAY=n(s.fromCssColorString("#808080")),s.GREEN=n(s.fromCssColorString("#008000")),s.GREENYELLOW=n(s.fromCssColorString("#ADFF2F")),s.GREY=s.GRAY,s.HONEYDEW=n(s.fromCssColorString("#F0FFF0")),s.HOTPINK=n(s.fromCssColorString("#FF69B4")),s.INDIANRED=n(s.fromCssColorString("#CD5C5C")),s.INDIGO=n(s.fromCssColorString("#4B0082")),s.IVORY=n(s.fromCssColorString("#FFFFF0")),s.KHAKI=n(s.fromCssColorString("#F0E68C")),s.LAVENDER=n(s.fromCssColorString("#E6E6FA")),s.LAVENDAR_BLUSH=n(s.fromCssColorString("#FFF0F5")),s.LAWNGREEN=n(s.fromCssColorString("#7CFC00")),s.LEMONCHIFFON=n(s.fromCssColorString("#FFFACD")),s.LIGHTBLUE=n(s.fromCssColorString("#ADD8E6")),s.LIGHTCORAL=n(s.fromCssColorString("#F08080")),s.LIGHTCYAN=n(s.fromCssColorString("#E0FFFF")),s.LIGHTGOLDENRODYELLOW=n(s.fromCssColorString("#FAFAD2")),s.LIGHTGRAY=n(s.fromCssColorString("#D3D3D3")),s.LIGHTGREEN=n(s.fromCssColorString("#90EE90")),s.LIGHTGREY=s.LIGHTGRAY,s.LIGHTPINK=n(s.fromCssColorString("#FFB6C1")),s.LIGHTSEAGREEN=n(s.fromCssColorString("#20B2AA")),s.LIGHTSKYBLUE=n(s.fromCssColorString("#87CEFA")),s.LIGHTSLATEGRAY=n(s.fromCssColorString("#778899")),s.LIGHTSLATEGREY=s.LIGHTSLATEGRAY,s.LIGHTSTEELBLUE=n(s.fromCssColorString("#B0C4DE")),s.LIGHTYELLOW=n(s.fromCssColorString("#FFFFE0")),s.LIME=n(s.fromCssColorString("#00FF00")),s.LIMEGREEN=n(s.fromCssColorString("#32CD32")),s.LINEN=n(s.fromCssColorString("#FAF0E6")),s.MAGENTA=n(s.fromCssColorString("#FF00FF")),s.MAROON=n(s.fromCssColorString("#800000")),s.MEDIUMAQUAMARINE=n(s.fromCssColorString("#66CDAA")),s.MEDIUMBLUE=n(s.fromCssColorString("#0000CD")),s.MEDIUMORCHID=n(s.fromCssColorString("#BA55D3")),s.MEDIUMPURPLE=n(s.fromCssColorString("#9370DB")),s.MEDIUMSEAGREEN=n(s.fromCssColorString("#3CB371")),s.MEDIUMSLATEBLUE=n(s.fromCssColorString("#7B68EE")),s.MEDIUMSPRINGGREEN=n(s.fromCssColorString("#00FA9A")),s.MEDIUMTURQUOISE=n(s.fromCssColorString("#48D1CC")), +s.MEDIUMVIOLETRED=n(s.fromCssColorString("#C71585")),s.MIDNIGHTBLUE=n(s.fromCssColorString("#191970")),s.MINTCREAM=n(s.fromCssColorString("#F5FFFA")),s.MISTYROSE=n(s.fromCssColorString("#FFE4E1")),s.MOCCASIN=n(s.fromCssColorString("#FFE4B5")),s.NAVAJOWHITE=n(s.fromCssColorString("#FFDEAD")),s.NAVY=n(s.fromCssColorString("#000080")),s.OLDLACE=n(s.fromCssColorString("#FDF5E6")),s.OLIVE=n(s.fromCssColorString("#808000")),s.OLIVEDRAB=n(s.fromCssColorString("#6B8E23")),s.ORANGE=n(s.fromCssColorString("#FFA500")),s.ORANGERED=n(s.fromCssColorString("#FF4500")),s.ORCHID=n(s.fromCssColorString("#DA70D6")),s.PALEGOLDENROD=n(s.fromCssColorString("#EEE8AA")),s.PALEGREEN=n(s.fromCssColorString("#98FB98")),s.PALETURQUOISE=n(s.fromCssColorString("#AFEEEE")),s.PALEVIOLETRED=n(s.fromCssColorString("#DB7093")),s.PAPAYAWHIP=n(s.fromCssColorString("#FFEFD5")),s.PEACHPUFF=n(s.fromCssColorString("#FFDAB9")),s.PERU=n(s.fromCssColorString("#CD853F")),s.PINK=n(s.fromCssColorString("#FFC0CB")),s.PLUM=n(s.fromCssColorString("#DDA0DD")),s.POWDERBLUE=n(s.fromCssColorString("#B0E0E6")),s.PURPLE=n(s.fromCssColorString("#800080")),s.RED=n(s.fromCssColorString("#FF0000")),s.ROSYBROWN=n(s.fromCssColorString("#BC8F8F")),s.ROYALBLUE=n(s.fromCssColorString("#4169E1")),s.SADDLEBROWN=n(s.fromCssColorString("#8B4513")),s.SALMON=n(s.fromCssColorString("#FA8072")),s.SANDYBROWN=n(s.fromCssColorString("#F4A460")),s.SEAGREEN=n(s.fromCssColorString("#2E8B57")),s.SEASHELL=n(s.fromCssColorString("#FFF5EE")),s.SIENNA=n(s.fromCssColorString("#A0522D")),s.SILVER=n(s.fromCssColorString("#C0C0C0")),s.SKYBLUE=n(s.fromCssColorString("#87CEEB")),s.SLATEBLUE=n(s.fromCssColorString("#6A5ACD")),s.SLATEGRAY=n(s.fromCssColorString("#708090")),s.SLATEGREY=s.SLATEGRAY,s.SNOW=n(s.fromCssColorString("#FFFAFA")),s.SPRINGGREEN=n(s.fromCssColorString("#00FF7F")),s.STEELBLUE=n(s.fromCssColorString("#4682B4")),s.TAN=n(s.fromCssColorString("#D2B48C")),s.TEAL=n(s.fromCssColorString("#008080")),s.THISTLE=n(s.fromCssColorString("#D8BFD8")),s.TOMATO=n(s.fromCssColorString("#FF6347")),s.TURQUOISE=n(s.fromCssColorString("#40E0D0")),s.VIOLET=n(s.fromCssColorString("#EE82EE")),s.WHEAT=n(s.fromCssColorString("#F5DEB3")),s.WHITE=n(s.fromCssColorString("#FFFFFF")),s.WHITESMOKE=n(s.fromCssColorString("#F5F5F5")),s.YELLOW=n(s.fromCssColorString("#FFFF00")),s.YELLOWGREEN=n(s.fromCssColorString("#9ACD32")),s.TRANSPARENT=n(new s(0,0,0,0)),s}),define("Core/ColorGeometryInstanceAttribute",["./Color","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i,n,o){"use strict";function a(t,i,n,o){t=r(t,1),i=r(i,1),n=r(n,1),o=r(o,1),this.value=new Uint8Array([e.floatToByte(t),e.floatToByte(i),e.floatToByte(n),e.floatToByte(o)])}return n(a.prototype,{componentDatatype:{get:function(){return t.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}}),a.fromColor=function(e){return new a(e.red,e.green,e.blue,e.alpha)},a.toValue=function(e,t){return i(t)?e.toBytes(t):new Uint8Array(e.toBytes())},a.equals=function(e,t){return e===t||i(e)&&i(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]},a}),define("Core/CompressedTextureBuffer",["./defined","./defineProperties"],function(e,t){"use strict";function r(e,t,r,i){this._format=e,this._width=t,this._height=r,this._buffer=i}return t(r.prototype,{internalFormat:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}}),r.clone=function(t){if(e(t))return new r(t._format,t._width,t._height,t._buffer)},r.prototype.clone=function(){return r.clone(this)},r}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=e._uSquared,r=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,n=(r-i)/r,o=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-n)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+s*s),u=l*s,c=Math.atan2(s,o),d=l*a,h=d*d,p=1-h,f=Math.sqrt(p),m=t/4,g=m*m,v=g*m,_=g*g,y=1+m-3*g/4+5*v/4-175*_/64,b=1-m+15*g/8-35*v/8,C=1-3*m+35*g/4,w=1-5*m,S=y*c-b*Math.sin(2*c)*m/2-C*Math.sin(4*c)*g/16-w*Math.sin(6*c)*v/48-5*Math.sin(8*c)*_/512,E=e._constants;E.a=r,E.b=i,E.f=n,E.cosineHeading=o,E.sineHeading=a,E.tanU=s,E.cosineU=l,E.sineU=u,E.sigma=c,E.sineAlpha=d,E.sineSquaredAlpha=h,E.cosineSquaredAlpha=p,E.cosineAlpha=f,E.u2Over4=m,E.u4Over16=g,E.u6Over64=v,E.u8Over256=_,E.a0=y,E.a1=b,E.a2=C,E.a3=w,E.distanceRatio=S}function u(e,t){return e*t*(4+e*(4-3*t))/16}function c(e,t,r,i,n,o,a){var s=u(e,r);return(1-s)*e*t*(i+s*n*(a+s*o*(2*a*a-1)))}function d(e,t,r,i,n,o,a){var l,u,d,h,p,f=(t-r)/t,m=o-i,g=Math.atan((1-f)*Math.tan(n)),v=Math.atan((1-f)*Math.tan(a)),_=Math.cos(g),y=Math.sin(g),b=Math.cos(v),C=Math.sin(v),w=_*b,S=_*C,E=y*C,T=y*b,x=m,P=s.TWO_PI,A=Math.cos(x),D=Math.sin(x);do{A=Math.cos(x),D=Math.sin(x);var I=S-T*A;d=Math.sqrt(b*b*D*D+I*I),u=E+w*A,l=Math.atan2(d,u);var M;0===d?(M=0,h=1):(M=w*D/d,h=1-M*M),P=x,p=u-2*E/h,isNaN(p)&&(p=0),x=m+c(f,M,h,l,d,u,p)}while(Math.abs(x-P)>s.EPSILON12);var O=h*(t*t-r*r)/(r*r),R=1+O*(4096+O*(O*(320-175*O)-768))/16384,N=O*(256+O*(O*(74-47*O)-128))/1024,k=p*p,L=N*d*(p+N*(u*(2*k-1)-N*p*(4*d*d-3)*(4*k-3)/6)/4),F=r*R*(l-L),B=Math.atan2(b*D,S-T*A),U=Math.atan2(_*D,S*A-T);e._distance=F,e._startHeading=B,e._endHeading=U,e._uSquared=O}function h(r,i,n,o){e.normalize(o.cartographicToCartesian(i,m),f),e.normalize(o.cartographicToCartesian(n,m),m);d(r,o.maximumRadius,o.minimumRadius,i.longitude,i.latitude,n.longitude,n.latitude),r._start=t.clone(i,r._start),r._end=t.clone(n,r._end),r._start.height=0,r._end.height=0,l(r)}function p(e,n,o){var s=r(o,a.WGS84);this._ellipsoid=s,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,i(e)&&i(n)&&h(this,e,n,s)}var f=new e,m=new e;return n(p.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}}}),p.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},p.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},p.prototype.interpolateUsingSurfaceDistance=function(e,r){var n=this._constants,o=n.distanceRatio+e/n.b,a=Math.cos(2*o),s=Math.cos(4*o),l=Math.cos(6*o),u=Math.sin(2*o),d=Math.sin(4*o),h=Math.sin(6*o),p=Math.sin(8*o),f=o*o,m=o*f,g=n.u8Over256,v=n.u2Over4,_=n.u6Over64,y=n.u4Over16,b=2*m*g*a/3+o*(1-v+7*y/4-15*_/4+579*g/64-(y-15*_/4+187*g/16)*a-(5*_/4-115*g/16)*s-29*g*l/16)+(v/2-y+71*_/32-85*g/16)*u+(5*y/16-5*_/4+383*g/96)*d-f*((_-11*g/2)*u+5*g*d/2)+(29*_/96-29*g/16)*h+539*g*p/1536,C=Math.asin(Math.sin(b)*n.cosineAlpha),w=Math.atan(n.a/n.b*Math.tan(C));b-=n.sigma;var S=Math.cos(2*n.sigma+b),E=Math.sin(b),T=Math.cos(b),x=n.cosineU*T,P=n.sineU*E,A=Math.atan2(E*n.sineHeading,x-P*n.cosineHeading),D=A-c(n.f,n.sineAlpha,n.cosineSquaredAlpha,b,E,T,S);return i(r)?(r.longitude=this._start.longitude+D,r.latitude=w,r.height=0,r):new t(this._start.longitude+D,w,0)},p}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(e,t,r){var i=E;i.length=e;var n;if(t===r){for(n=0;n<e;n++)i[n]=t;return i}var o=r-t,a=o/e;for(n=0;n<e;n++){var s=t+n*a;i[n]=s}return i}function p(t,r,i,n,o,a,s,l){var u=n.scaleToGeodeticSurface(t,A),c=n.scaleToGeodeticSurface(r,D),d=f.numberOfPoints(t,r,i),p=n.cartesianToCartographic(u,T),m=n.cartesianToCartographic(c,x),g=h(d,o,a);I.setEndPoints(p,m);var v=I.surfaceDistance/d,_=l;p.height=o;var y=n.cartographicToCartesian(p,P);e.pack(y,s,_),_+=3;for(var b=1;b<d;b++){var C=I.interpolateUsingSurfaceDistance(b*v,x);C.height=g[b],y=n.cartographicToCartesian(C,P),e.pack(y,s,_),_+=3}return _}var f={};f.numberOfPoints=function(t,r,i){var n=e.distance(t,r);return Math.ceil(n/i)};var m=new t;f.extractHeights=function(e,t){for(var r=e.length,i=new Array(r),n=0;n<r;n++){var o=e[n];i[n]=t.cartesianToCartographic(o,m).height}return i};var g=new c,v=new e,_=new e,y=new d(e.UNIT_X,0),b=new e,C=new d(e.UNIT_X,0),w=new e,S=new e,E=[],T=new t,x=new t,P=new e,A=new e,D=new e,I=new a;return f.wrapLongitude=function(t,n){var o=[],a=[];if(i(t)&&t.length>0){n=r(n,c.IDENTITY);var l=c.inverseTransformation(n,g),u=c.multiplyByPoint(l,e.ZERO,v),h=e.normalize(c.multiplyByPointAsVector(l,e.UNIT_Y,_),_),p=d.fromPointNormal(u,h,y),f=e.normalize(c.multiplyByPointAsVector(l,e.UNIT_X,b),b),m=d.fromPointNormal(u,f,C),E=1;o.push(e.clone(t[0]));for(var T=o[0],x=t.length,P=1;P<x;++P){var A=t[P];if(d.getPointDistance(m,T)<0||d.getPointDistance(m,A)<0){var D=s.lineSegmentPlane(T,A,p,w);if(i(D)){var I=e.multiplyByScalar(h,5e-9,S);d.getPointDistance(p,T)<0&&e.negate(I,I),o.push(e.add(D,I,new e)),a.push(E+1),e.negate(I,I),o.push(e.add(D,I,new e)),E=1}}o.push(e.clone(t[P])),E++,T=A}a.push(E)}return{positions:o,lengths:a}},f.generateArc=function(t){i(t)||(t={});var n=t.positions,a=n.length,s=r(t.ellipsoid,o.WGS84),c=r(t.height,0),d=l(c);if(a<1)return[];if(1===a){var h=s.scaleToGeodeticSurface(n[0],A);if(c=d?c[0]:c,0!==c){var m=s.geodeticSurfaceNormal(h,P);e.multiplyByScalar(m,c,m),e.add(h,m,h)}return[h.x,h.y,h.z]}var g=t.minDistance;if(!i(g)){var v=r(t.granularity,u.RADIANS_PER_DEGREE);g=u.chordLength(v,s.maximumRadius)}var _,y=0;for(_=0;_<a-1;_++)y+=f.numberOfPoints(n[_],n[_+1],g);var b=3*(y+1),C=new Array(b),w=0;for(_=0;_<a-1;_++){var S=n[_],x=n[_+1],D=d?c[_]:c,I=d?c[_+1]:c;w=p(S,x,g,s,D,I,C,w)}E.length=0;var M=n[a-1],O=s.cartesianToCartographic(M,T);O.height=d?c[a-1]:c;var R=s.cartographicToCartesian(O,P);return e.pack(R,C,b-3),C},f.generateCartesianArc=function(t){for(var r=f.generateArc(t),i=r.length/3,n=new Array(i),o=0;o<i;o++)n[o]=e.unpack(r,3*o);return n},f}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(e,t){for(var r=new Array(e.length),i=0;i<e.length;i++){var n=e[i];R=t.cartesianToCartographic(n,R),r[i]=R.height,e[i]=t.scaleToGeodeticSurface(n,n)}return r}function p(e,r,i,n){var o,a=e[0],s=e[1],l=t.angleBetween(a,s),u=Math.ceil(l/n),c=new Array(u);if(r===i){for(o=0;o<u;o++)c[o]=r;return c.push(i),c}var d=i-r,h=d/u;for(o=1;o<u;o++){var p=r+o*h;c[o]=p}return c[0]=r,c.push(i),c}function f(r,i,n,a){var s=new o(n,a),l=s.projectPointOntoPlane(t.add(n,r,q),q),u=s.projectPointOntoPlane(t.add(n,i,Y),Y),c=e.angleBetween(l,u);return u.x*l.y-u.y*l.x>=0?-c:c}function m(e,r,i,n,o,a,u,c){var h=U,p=V;k=d.eastNorthUpToFixedFrame(e,o,k),h=l.multiplyByPointAsVector(k,N,h),h=t.normalize(h,h);var m=f(h,r,e,o);F=s.fromRotationZ(m,F),z.z=a,k=l.multiplyTransformation(k,l.fromRotationTranslation(F,z,L),k);var g=B;g[0]=u;for(var v=0;v<c;v++)for(var _=0;_<i.length;_+=3)p=t.fromArray(i,_,p),p=s.multiplyByVector(g,p,p),p=l.multiplyByPoint(k,p,p),n.push(p.x,p.y,p.z);return n}function g(e,r,i,n,o,a,s){for(var l=0;l<e.length;l+=3){var u=t.fromArray(e,l,G);n=m(u,r,i,n,o,a[l/3],s,1)}return n}function v(e,t){var r=e.length,i=new Array(6*r),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=e[0];i[n++]=s.x-o,i[n++]=0,i[n++]=s.y-a;for(var l=1;l<r;l++){s=e[l];var u=s.x-o,c=s.y-a;i[n++]=u,i[n++]=0,i[n++]=c,i[n++]=u,i[n++]=0,i[n++]=c}return s=e[0],i[n++]=s.x-o,i[n++]=0,i[n++]=s.y-a,i}function _(e,t){for(var r=e.length,i=new Array(3*r),n=0,o=t.x+t.width/2,a=t.y+t.height/2,s=0;s<r;s++)i[n++]=e[s].x-o,i[n++]=0,i[n++]=e[s].y-a;return i}function y(e,r,i,o,l,u,d,h,p,f){var g,v=t.angleBetween(t.subtract(r,e,I),t.subtract(i,e,M)),_=o===n.BEVELED?0:Math.ceil(v/a.toRadians(5));g=l?s.fromQuaternion(c.fromAxisAngle(t.negate(e,I),v/(_+1),H),j):s.fromQuaternion(c.fromAxisAngle(e,v/(_+1),H),j);var y,b;if(r=t.clone(r,W),_>0)for(var C=f?2:1,w=0;w<_;w++)r=s.multiplyByVector(g,r,r),y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),b=u.scaleToGeodeticSurface(r,M),d=m(b,y,h,d,u,p,1,C);else y=t.subtract(r,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),b=u.scaleToGeodeticSurface(r,M),d=m(b,y,h,d,u,p,1,1),i=t.clone(i,W),y=t.subtract(i,e,I),y=t.normalize(y,y),l||(y=t.negate(y,y)),b=u.scaleToGeodeticSurface(i,M),d=m(b,y,h,d,u,p,1,1);return d}var b=[new t,new t],C=new t,w=new t,S=new t,E=new t,T=new t,x=new t,P=new t,A=new t,D=new t,I=new t,M=new t,O={},R=new i,N=new t(-1,0,0),k=new l,L=new l,F=new s,B=s.IDENTITY.clone(),U=new t,V=new r,z=new t,G=new t,H=new c,W=new t,j=new s;O.removeDuplicatesFromShape=function(t){for(var r=t.length,i=[],n=r-1,o=0;o<r;n=o++){var a=t[n],s=t[o];e.equals(a,s)||i.push(s)}return i};var q=new t,Y=new t;O.angleIsGreaterThanPi=function(e,r,i,n){var a=new o(i,n),s=a.projectPointOntoPlane(t.add(i,e,q),q),l=a.projectPointOntoPlane(t.add(i,r,Y),Y);return l.x*s.y-l.y*s.x>=0};var X=new t,Q=new t;return O.computePositions=function(e,r,i,o,s){var l=o._ellipsoid,c=h(e,l),d=o._granularity,f=o._cornerType,M=s?v(r,i):_(r,i),R=s?_(r,i):void 0,N=i.height/2,k=i.width/2,L=e.length,F=[],B=s?[]:void 0,U=C,V=w,z=S,G=E,H=T,W=x,j=P,q=A,Y=D,Z=e[0],K=e[1];G=l.geodeticSurfaceNormal(Z,G),U=t.subtract(K,Z,U),U=t.normalize(U,U),q=t.cross(G,U,q),q=t.normalize(q,q);var J=c[0],$=c[1];s&&(B=m(Z,q,R,B,l,J+N,1,1)),Y=t.clone(Z,Y),Z=K,V=t.negate(U,V);for(var ee,te,re=1;re<L-1;re++){var ie=s?2:1;K=e[re+1],U=t.subtract(K,Z,U),U=t.normalize(U,U),z=t.add(U,V,z),z=t.normalize(z,z),G=l.geodeticSurfaceNormal(Z,G);var ne=t.multiplyByScalar(G,t.dot(U,G),X);t.subtract(U,ne,ne),t.normalize(ne,ne);var oe=t.multiplyByScalar(G,t.dot(V,G),Q);t.subtract(V,oe,oe),t.normalize(oe,oe);var ae=!a.equalsEpsilon(Math.abs(t.dot(ne,oe)),1,a.EPSILON7);if(ae){z=t.cross(z,G,z),z=t.cross(G,z,z),z=t.normalize(z,z);var se=1/Math.max(.25,t.magnitude(t.cross(z,V,I))),le=O.angleIsGreaterThanPi(U,V,Z,l);le?(H=t.add(Z,t.multiplyByScalar(z,se*k,z),H),W=t.add(H,t.multiplyByScalar(q,k,W),W),b[0]=t.clone(Y,b[0]),b[1]=t.clone(W,b[1]),ee=p(b,J+N,$+N,d),te=u.generateArc({positions:b,granularity:d,ellipsoid:l}),F=g(te,q,M,F,l,ee,1),q=t.cross(G,U,q),q=t.normalize(q,q),j=t.add(H,t.multiplyByScalar(q,k,j),j),f===n.ROUNDED||f===n.BEVELED?y(H,W,j,f,le,l,F,M,$+N,s):(z=t.negate(z,z),F=m(Z,z,M,F,l,$+N,se,ie)),Y=t.clone(j,Y)):(H=t.add(Z,t.multiplyByScalar(z,se*k,z),H),W=t.add(H,t.multiplyByScalar(q,-k,W),W),b[0]=t.clone(Y,b[0]),b[1]=t.clone(W,b[1]),ee=p(b,J+N,$+N,d),te=u.generateArc({positions:b,granularity:d,ellipsoid:l}),F=g(te,q,M,F,l,ee,1),q=t.cross(G,U,q),q=t.normalize(q,q),j=t.add(H,t.multiplyByScalar(q,-k,j),j),f===n.ROUNDED||f===n.BEVELED?y(H,W,j,f,le,l,F,M,$+N,s):F=m(Z,z,M,F,l,$+N,se,ie),Y=t.clone(j,Y)),V=t.negate(U,V)}else F=m(Y,q,M,F,l,J+N,1,1),Y=Z;J=$,$=c[re+1],Z=K}b[0]=t.clone(Y,b[0]),b[1]=t.clone(Z,b[1]),ee=p(b,J+N,$+N,d),te=u.generateArc({positions:b,granularity:d,ellipsoid:l}),F=g(te,q,M,F,l,ee,1),s&&(B=m(Z,q,R,B,l,$+N,1,1)),L=F.length;var ue=s?L+B.length:L,ce=new Float64Array(ue);return ce.set(F),s&&ce.set(B,L),ce},O}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,r,i,n,o,a,s){"use strict";function l(r,o,a,l,u){var c=e.angleBetween(e.subtract(o,r,f),e.subtract(a,r,m)),d=l===t.BEVELED?1:Math.ceil(c/i.toRadians(5))+1,h=3*d,p=new Array(h);p[h-3]=a.x,p[h-2]=a.y,p[h-1]=a.z;var g;g=u?n.fromQuaternion(s.fromAxisAngle(e.negate(r,f),c/d,D),I):n.fromQuaternion(s.fromAxisAngle(r,c/d,D),I);var v=0;o=e.clone(o,f);for(var _=0;_<d;_++)o=n.multiplyByVector(g,o,o),p[v++]=o.x,p[v++]=o.y,p[v++]=o.z;return p}function u(r){var i=y,n=b,o=C,a=r[1];n=e.fromArray(r[1],a.length-3,n),o=e.fromArray(r[0],0,o),i=e.multiplyByScalar(e.add(n,o,i),.5,i);var s=l(i,n,o,t.ROUNDED,!1),u=r.length-1,c=r[u-1];a=r[u],n=e.fromArray(c,c.length-3,n),o=e.fromArray(a,0,o),i=e.multiplyByScalar(e.add(n,o,i),.5,i);var d=l(i,n,o,t.ROUNDED,!1);return[s,d]}function c(t,r,i,n){var o=f;return n?o=e.add(t,r,o):(r=e.negate(r,r),o=e.add(t,r,o)),[o.x,o.y,o.z,i.x,i.y,i.z]}function d(t,r,i,n){for(var o=new Array(t.length),a=new Array(t.length),s=e.multiplyByScalar(r,i,f),l=e.negate(s,m),u=0,c=t.length-1,d=0;d<t.length;d+=3){var h=e.fromArray(t,d,g),p=e.add(h,l,v);o[u++]=p.x,o[u++]=p.y,o[u++]=p.z;var _=e.add(h,s,v);a[c--]=_.z,a[c--]=_.y,a[c--]=_.x}return n.push(o,a),n}function h(e,t){for(var r=0;r<e.length;r++)e[r]=t.scaleToGeodeticSurface(e[r],e[r]);return e}var p={},f=new e,m=new e,g=new e,v=new e,_=[new e,new e],y=new e,b=new e,C=new e,w=new e,S=new e,E=new e,T=new e,x=new e,P=new e,A=new e,D=new s,I=new n;p.addAttribute=function(e,t,i,n){var o=t.x,a=t.y,s=t.z;r(i)&&(e[i]=o,e[i+1]=a,e[i+2]=s),r(n)&&(e[n]=s,e[n-1]=a,e[n-2]=o)};var M=new e,O=new e;return p.computePositions=function(r){var n=r.granularity,s=r.positions,p=r.ellipsoid;s=h(s,p);var m=r.width/2,g=r.cornerType,v=r.saveAttributes,D=y,I=b,R=C,N=w,k=S,L=E,F=T,B=x,U=P,V=A,z=[],G=v?[]:void 0,H=v?[]:void 0,W=s[0],j=s[1];I=e.normalize(e.subtract(j,W,I),I),D=p.geodeticSurfaceNormal(W,D),N=e.normalize(e.cross(D,I,N),N),v&&(G.push(N.x,N.y,N.z),H.push(D.x,D.y,D.z)),F=e.clone(W,F),W=j,R=e.negate(I,R);var q,Y,X=[],Q=s.length;for(Y=1;Y<Q-1;Y++){D=p.geodeticSurfaceNormal(W,D),j=s[Y+1],I=e.normalize(e.subtract(j,W,I),I),k=e.normalize(e.add(I,R,k),k);var Z=e.multiplyByScalar(D,e.dot(I,D),M);e.subtract(I,Z,Z),e.normalize(Z,Z);var K=e.multiplyByScalar(D,e.dot(R,D),O);e.subtract(R,K,K),e.normalize(K,K);var J=!i.equalsEpsilon(Math.abs(e.dot(Z,K)),1,i.EPSILON7);if(J){k=e.cross(k,D,k),k=e.cross(D,k,k),k=e.normalize(k,k);var $=m/Math.max(.25,e.magnitude(e.cross(k,R,f))),ee=a.angleIsGreaterThanPi(I,R,W,p);k=e.multiplyByScalar(k,$,k),ee?(B=e.add(W,k,B),V=e.add(B,e.multiplyByScalar(N,m,V),V),U=e.add(B,e.multiplyByScalar(N,2*m,U),U),_[0]=e.clone(F,_[0]),_[1]=e.clone(V,_[1]),q=o.generateArc({positions:_,granularity:n,ellipsoid:p}),z=d(q,N,m,z),v&&(G.push(N.x,N.y,N.z),H.push(D.x,D.y,D.z)),L=e.clone(U,L),N=e.normalize(e.cross(D,I,N),N),U=e.add(B,e.multiplyByScalar(N,2*m,U),U),F=e.add(B,e.multiplyByScalar(N,m,F),F),g===t.ROUNDED||g===t.BEVELED?X.push({leftPositions:l(B,L,U,g,ee)}):X.push({leftPositions:c(W,e.negate(k,k),U,ee)})):(U=e.add(W,k,U),V=e.add(U,e.negate(e.multiplyByScalar(N,m,V),V),V),B=e.add(U,e.negate(e.multiplyByScalar(N,2*m,B),B),B),_[0]=e.clone(F,_[0]),_[1]=e.clone(V,_[1]),q=o.generateArc({positions:_,granularity:n,ellipsoid:p}),z=d(q,N,m,z),v&&(G.push(N.x,N.y,N.z),H.push(D.x,D.y,D.z)),L=e.clone(B,L),N=e.normalize(e.cross(D,I,N),N),B=e.add(U,e.negate(e.multiplyByScalar(N,2*m,B),B),B),F=e.add(U,e.negate(e.multiplyByScalar(N,m,F),F),F),g===t.ROUNDED||g===t.BEVELED?X.push({rightPositions:l(U,L,B,g,ee)}):X.push({rightPositions:c(W,k,B,ee)})),R=e.negate(I,R)}W=j}D=p.geodeticSurfaceNormal(W,D),_[0]=e.clone(F,_[0]),_[1]=e.clone(W,_[1]),q=o.generateArc({positions:_,granularity:n,ellipsoid:p}),z=d(q,N,m,z),v&&(G.push(N.x,N.y,N.z),H.push(D.x,D.y,D.z));var te;return g===t.ROUNDED&&(te=u(z)),{positions:z,corners:X,lefts:G,normals:H,endPositions:te}},p}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,r,n){n=n||2;var o=r&&r.length,a=o?r[0]*n:e.length,s=t(e,0,a,n,!0),u=[];if(!s)return u;var c,d,h,p,f,m,g;if(o&&(s=l(e,r,s,n)),e.length>80*n){c=h=e[0],d=p=e[1];for(var v=n;v<a;v+=n)f=e[v],m=e[v+1],f<c&&(c=f),m<d&&(d=m),f>h&&(h=f),m>p&&(p=m);g=Math.max(h-c,p-d)}return i(s,u,n,c,d,g),u}function t(e,t,r,i,n){var o,a;if(n===A(e,t,r,i)>0)for(o=t;o<r;o+=i)a=T(o,e[o],e[o+1],a);else for(o=r-i;o>=t;o-=i)a=T(o,e[o],e[o+1],a);return a&&y(a,a.next)&&(x(a),a=a.next),a}function r(e,t){if(!e)return e;t||(t=e);var r,i=e;do if(r=!1,i.steiner||!y(i,i.next)&&0!==_(i.prev,i,i.next))i=i.next;else{if(x(i),i=t=i.prev,i===i.next)return null;r=!0}while(r||i!==t);return t}function i(e,t,l,u,c,d,p){if(e){!p&&d&&h(e,u,c,d);for(var f,m,g=e;e.prev!==e.next;)if(f=e.prev,m=e.next,d?o(e,u,c,d):n(e))t.push(f.i/l),t.push(e.i/l),t.push(m.i/l),x(e),e=m.next,g=m.next;else if(e=m,e===g){p?1===p?(e=a(e,t,l),i(e,t,l,u,c,d,2)):2===p&&s(e,t,l,u,c,d):i(r(e),t,l,u,c,d,1);break}}}function n(e){var t=e.prev,r=e,i=e.next;if(_(t,r,i)>=0)return!1;for(var n=e.next.next;n!==e.prev;){if(g(t.x,t.y,r.x,r.y,i.x,i.y,n.x,n.y)&&_(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function o(e,t,r,i){var n=e.prev,o=e,a=e.next;if(_(n,o,a)>=0)return!1;for(var s=n.x<o.x?n.x<a.x?n.x:a.x:o.x<a.x?o.x:a.x,l=n.y<o.y?n.y<a.y?n.y:a.y:o.y<a.y?o.y:a.y,u=n.x>o.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,c=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,d=f(s,l,t,r,i),h=f(u,c,t,r,i),p=e.nextZ;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&g(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&_(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=e.prevZ;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&g(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&_(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function a(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!y(n,o)&&b(n,i,i.next,o)&&w(n,o)&&w(o,n)&&(t.push(n.i/r),t.push(i.i/r),t.push(o.i/r),x(i),x(i.next),i=e=o),i=i.next}while(i!==e);return i}function s(e,t,n,o,a,s){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&v(l,u)){var c=E(l,u);return l=r(l,l.next),c=r(c,c.next),i(l,t,n,o,a,s),void i(c,t,n,o,a,s)}u=u.next}l=l.next}while(l!==e)}function l(e,i,n,o){var a,s,l,d,h,p=[];for(a=0,s=i.length;a<s;a++)l=i[a]*o,d=a<s-1?i[a+1]*o:e.length,h=t(e,l,d,o,!1),h===h.next&&(h.steiner=!0),p.push(m(h));for(p.sort(u),a=0;a<p.length;a++)c(p[a],n),n=r(n,n.next);return n}function u(e,t){return e.x-t.x}function c(e,t){if(t=d(e,t)){var i=E(t,e);r(i,i.next)}}function d(e,t){var r,i=t,n=e.x,o=e.y,a=-(1/0);do{if(o<=i.y&&o>=i.next.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&s>a){if(a=s,s===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}i=i.next}while(i!==t);if(!r)return null;if(n===a)return r.prev;var l,u=r,c=r.x,d=r.y,h=1/0;for(i=r.next;i!==u;)n>=i.x&&i.x>=c&&g(o<d?n:a,o,c,d,o<d?a:n,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(n-i.x),(l<h||l===h&&i.x>r.x)&&w(i,e)&&(r=i,h=l)),i=i.next;return r}function h(e,t,r,i){var n=e;do null===n.z&&(n.z=f(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,p(n)}function p(e){var t,r,i,n,o,a,s,l,u=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,i=r,s=0,t=0;t<u&&(s++,i=i.nextZ,i);t++);for(l=u;s>0||l>0&&i;)0===s?(n=i,i=i.nextZ,l--):0!==l&&i?r.z<=i.z?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,l--):(n=r,r=r.nextZ,s--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(a>1);return e}function f(e,t,r,i,n){return e=32767*(e-r)/n,t=32767*(t-i)/n,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,r=e;do t.x<r.x&&(r=t),t=t.next;while(t!==e);return r}function g(e,t,r,i,n,o,a,s){return(n-a)*(t-s)-(e-a)*(o-s)>=0&&(e-a)*(i-s)-(r-a)*(t-s)>=0&&(r-a)*(o-s)-(n-a)*(i-s)>=0}function v(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!C(e,t)&&w(e,t)&&w(t,e)&&S(e,t)}function _(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function y(e,t){return e.x===t.x&&e.y===t.y}function b(e,t,r,i){return!!(y(e,t)&&y(r,i)||y(e,i)&&y(r,t))||_(e,t,r)>0!=_(e,t,i)>0&&_(r,i,e)>0!=_(r,i,t)>0}function C(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&b(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function w(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do r.y>o!=r.next.y>o&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==e);return i}function E(e,t){var r=new P(e.i,e.x,e.y),i=new P(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function T(e,t,r,i){var n=new P(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function x(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 P(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function A(e,t,r,i){for(var n=0,o=t,a=r-i;o<r;o+=i)n+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return n}return e.deviation=function(e,t,r,i){var n=t&&t.length,o=n?t[0]*r:e.length,a=Math.abs(A(e,0,o,r));if(n)for(var s=0,l=t.length;s<l;s++){var u=t[s]*r,c=s<l-1?t[s+1]*r:e.length;a-=Math.abs(A(e,u,c,r))}var d=0;for(s=0;s<i.length;s+=3){var h=i[s]*r,p=i[s+1]*r,f=i[s+2]*r;d+=Math.abs((e[h]-e[f])*(e[p+1]-e[h+1])-(e[h]-e[p])*(e[f+1]-e[h+1]))}return 0===a&&0===d?0:Math.abs((d-a)/a)},e.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},i=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[n][o][a]);n>0&&(i+=e[n-1].length,r.holes.push(i))}return r},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return e(r)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";var p=new r,f=new r,m={};m.computeArea2D=function(e){for(var t=e.length,r=0,i=t-1,n=0;n<t;i=n++){var o=e[i],a=e[n];r+=o.x*a.y-a.x*o.y}return.5*r},m.computeWindingOrder2D=function(e){var t=m.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},m.triangulate=function(r,i){var n=t.packArray(r);return e(n,i,2)};var g=new r,v=new r,_=new r,y=new r,b=new r,C=new r,w=new r;return m.computeSubdivision=function(e,t,a,s){s=n(s,c.RADIANS_PER_DEGREE);var h,p=a.slice(0),f=t.length,m=new Array(3*f),S=0;for(h=0;h<f;h++){var E=t[h];m[S++]=E.x,m[S++]=E.y,m[S++]=E.z}for(var T=[],x={},P=e.maximumRadius,A=c.chordLength(s,P),D=A*A;p.length>0;){var I,M,O=p.pop(),R=p.pop(),N=p.pop(),k=r.fromArray(m,3*N,g),L=r.fromArray(m,3*R,v),F=r.fromArray(m,3*O,_),B=r.multiplyByScalar(r.normalize(k,y),P,y),U=r.multiplyByScalar(r.normalize(L,b),P,b),V=r.multiplyByScalar(r.normalize(F,C),P,C),z=r.magnitudeSquared(r.subtract(B,U,w)),G=r.magnitudeSquared(r.subtract(U,V,w)),H=r.magnitudeSquared(r.subtract(V,B,w)),W=Math.max(z,G,H);W>D?z===W?(I=Math.min(N,R)+" "+Math.max(N,R),h=x[I],o(h)||(M=r.add(k,L,w),r.multiplyByScalar(M,.5,M),m.push(M.x,M.y,M.z),h=m.length/3-1,x[I]=h),p.push(N,h,O),p.push(h,R,O)):G===W?(I=Math.min(R,O)+" "+Math.max(R,O),h=x[I],o(h)||(M=r.add(L,F,w),r.multiplyByScalar(M,.5,M),m.push(M.x,M.y,M.z),h=m.length/3-1,x[I]=h),p.push(R,h,N),p.push(h,O,N)):H===W&&(I=Math.min(O,N)+" "+Math.max(O,N),h=x[I],o(h)||(M=r.add(F,k,w),r.multiplyByScalar(M,.5,M),m.push(M.x,M.y,M.z),h=m.length/3-1,x[I]=h),p.push(O,h,R),p.push(h,N,R)):(T.push(N),T.push(R),T.push(O))}return new l({attributes:{position:new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:m})},indices:T,primitiveType:d.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,i,a){i=n(i,s.WGS84);var l=p,u=f;if(t=n(t,0),a=n(a,!0),o(e))for(var c=e.length,d=0;d<c;d+=3)r.fromArray(e,d,u),a&&(u=i.scaleToGeodeticSurface(u,u)),0!==t&&(l=i.geodeticSurfaceNormal(u,l),r.multiplyByScalar(l,t,l),r.add(u,l,u)),e[d]=u.x,e[d+1]=u.y,e[d+2]=u.z;return e},m}),define("Core/CorridorGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b){"use strict";function C(e,t,i,n,o,s){var l=e.normals,u=e.tangents,c=e.bitangents,d=r.normalize(r.cross(i,t,k),k);s.normal&&a.addAttribute(l,t,n,o),s.tangent&&a.addAttribute(u,d,n,o),s.bitangent&&a.addAttribute(c,i,n,o)}function w(e,t,i){var o,s,u,c=e.positions,d=e.corners,h=e.endPositions,v=e.lefts,_=e.normals,y=new f,b=0,w=0,S=0;for(s=0;s<c.length;s+=2)u=c[s].length-3,b+=u,S+=2*u,w+=c[s+1].length-3;for(b+=3,w+=3,s=0;s<d.length;s++){o=d[s];var E=d[s].leftPositions;l(E)?(u=E.length,b+=u,S+=u):(u=d[s].rightPositions.length,w+=u,S+=u)}var T,x=l(h);x&&(T=h[0].length-3,b+=T,w+=T,T/=3,S+=6*T);var P,A,R,F,B,U,V=b+w,z=new Float64Array(V),G=t.normal?new Float32Array(V):void 0,H=t.tangent?new Float32Array(V):void 0,W=t.bitangent?new Float32Array(V):void 0,j={normals:G,tangents:H,bitangents:W},q=0,Y=V-1,X=D,Q=I,Z=T/2,K=m.createTypedArray(V/3,S),J=0;if(x){U=M,B=O;var $=h[0];for(X=r.fromArray(_,0,X),Q=r.fromArray(v,0,Q),s=0;s<Z;s++)U=r.fromArray($,3*(Z-1-s),U),B=r.fromArray($,3*(Z+s),B),a.addAttribute(z,B,q),a.addAttribute(z,U,void 0,Y),C(j,X,Q,q,Y,t),A=q/3,F=A+1,P=(Y-2)/3,R=P-1,K[J++]=P,K[J++]=A,K[J++]=R,K[J++]=R,K[J++]=A,K[J++]=F,q+=3,Y-=3}var ee=0,te=0,re=c[ee++],ie=c[ee++];z.set(re,q),z.set(ie,Y-ie.length+1),Q=r.fromArray(v,te,Q);var ne,oe;for(u=ie.length-3,s=0;s<u;s+=3)ne=i.geodeticSurfaceNormal(r.fromArray(re,s,k),k),oe=i.geodeticSurfaceNormal(r.fromArray(ie,u-s,L),L),X=r.normalize(r.add(ne,oe,X),X),C(j,X,Q,q,Y,t),A=q/3,F=A+1,P=(Y-2)/3,R=P-1,K[J++]=P,K[J++]=A,K[J++]=R,K[J++]=R,K[J++]=A,K[J++]=F,q+=3,Y-=3;for(ne=i.geodeticSurfaceNormal(r.fromArray(re,u,k),k),oe=i.geodeticSurfaceNormal(r.fromArray(ie,u,L),L),X=r.normalize(r.add(ne,oe,X),X),te+=3,s=0;s<d.length;s++){var ae;o=d[s];var se,le,ue=o.leftPositions,ce=o.rightPositions,de=N,he=M,pe=O;if(X=r.fromArray(_,te,X),l(ue)){for(C(j,X,Q,void 0,Y,t),Y-=3,se=F,le=R,ae=0;ae<ue.length/3;ae++)de=r.fromArray(ue,3*ae,de),K[J++]=se,K[J++]=le-ae-1,K[J++]=le-ae,a.addAttribute(z,de,void 0,Y),he=r.fromArray(z,3*(le-ae-1),he),pe=r.fromArray(z,3*se,pe),Q=r.normalize(r.subtract(he,pe,Q),Q),C(j,X,Q,void 0,Y,t),Y-=3;de=r.fromArray(z,3*se,de),he=r.subtract(r.fromArray(z,3*le,he),de,he),pe=r.subtract(r.fromArray(z,3*(le-ae),pe),de,pe),Q=r.normalize(r.add(he,pe,Q),Q),C(j,X,Q,q,void 0,t),q+=3}else{for(C(j,X,Q,q,void 0,t),q+=3,se=R,le=F,ae=0;ae<ce.length/3;ae++)de=r.fromArray(ce,3*ae,de),K[J++]=se,K[J++]=le+ae,K[J++]=le+ae+1,a.addAttribute(z,de,q),he=r.fromArray(z,3*se,he),pe=r.fromArray(z,3*(le+ae),pe),Q=r.normalize(r.subtract(he,pe,Q),Q),C(j,X,Q,q,void 0,t),q+=3;de=r.fromArray(z,3*se,de),he=r.subtract(r.fromArray(z,3*(le+ae),he),de,he),pe=r.subtract(r.fromArray(z,3*le,pe),de,pe),Q=r.normalize(r.negate(r.add(pe,he,Q),Q),Q),C(j,X,Q,void 0,Y,t),Y-=3}for(re=c[ee++],ie=c[ee++],re.splice(0,3),ie.splice(ie.length-3,3),z.set(re,q),z.set(ie,Y-ie.length+1),u=ie.length-3,te+=3,Q=r.fromArray(v,te,Q),ae=0;ae<ie.length;ae+=3)ne=i.geodeticSurfaceNormal(r.fromArray(re,ae,k),k),oe=i.geodeticSurfaceNormal(r.fromArray(ie,u-ae,L),L),X=r.normalize(r.add(ne,oe,X),X),C(j,X,Q,q,Y,t),F=q/3,A=F-1,R=(Y-2)/3,P=R+1,K[J++]=P,K[J++]=A,K[J++]=R,K[J++]=R,K[J++]=A,K[J++]=F,q+=3,Y-=3;q-=3,Y+=3}if(X=r.fromArray(_,_.length-3,X),C(j,X,Q,q,Y,t),x){q+=3,Y-=3,U=M,B=O;var fe=h[1];for(s=0;s<Z;s++)U=r.fromArray(fe,3*(T-s-1),U),B=r.fromArray(fe,3*s,B),a.addAttribute(z,U,void 0,Y),a.addAttribute(z,B,q),C(j,X,Q,q,Y,t),F=q/3,A=F-1,R=(Y-2)/3,P=R+1,K[J++]=P,K[J++]=A,K[J++]=R,K[J++]=R,K[J++]=A,K[J++]=F,q+=3,Y-=3}if(y.position=new p({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:z}),t.st){var me,ge,ve=new Float32Array(V/3*2),_e=0;if(x){b/=3,w/=3;var ye=Math.PI/(T+1); +ge=1/(b-T+1),me=1/(w-T+1);var be,Ce=T/2;for(s=Ce+1;s<T+1;s++)be=g.PI_OVER_TWO+ye*s,ve[_e++]=me*(1+Math.cos(be)),ve[_e++]=.5*(1+Math.sin(be));for(s=1;s<w-T+1;s++)ve[_e++]=s*me,ve[_e++]=0;for(s=T;s>Ce;s--)be=g.PI_OVER_TWO-s*ye,ve[_e++]=1-me*(1+Math.cos(be)),ve[_e++]=.5*(1+Math.sin(be));for(s=Ce;s>0;s--)be=g.PI_OVER_TWO-ye*s,ve[_e++]=1-ge*(1+Math.cos(be)),ve[_e++]=.5*(1+Math.sin(be));for(s=b-T;s>0;s--)ve[_e++]=s*ge,ve[_e++]=1;for(s=1;s<Ce+1;s++)be=g.PI_OVER_TWO+ye*s,ve[_e++]=ge*(1+Math.cos(be)),ve[_e++]=.5*(1+Math.sin(be))}else{for(b/=3,w/=3,ge=1/(b-1),me=1/(w-1),s=0;s<w;s++)ve[_e++]=s*me,ve[_e++]=0;for(s=b;s>0;s--)ve[_e++]=(s-1)*ge,ve[_e++]=1}y.st=new p({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:ve})}return t.normal&&(y.normal=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:j.normals})),t.tangent&&(y.tangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:j.tangents})),t.bitangent&&(y.bitangent=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:j.bitangents})),{attributes:y,indices:K}}function S(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var i,n,o=e.position.values;(t.normal||t.bitangent)&&(i=e.normal.values,n=e.bitangent.values);var s,l=e.position.values.length/18,u=3*l,c=2*l,d=2*u;if(t.normal||t.bitangent||t.tangent){var h=t.normal?new Float32Array(6*u):void 0,p=t.tangent?new Float32Array(6*u):void 0,f=t.bitangent?new Float32Array(6*u):void 0,m=D,g=I,v=M,_=O,y=R,b=N,C=d;for(s=0;s<u;s+=3){var w=C+d;m=r.fromArray(o,s,m),g=r.fromArray(o,s+u,g),v=r.fromArray(o,(s+3)%u,v),g=r.subtract(g,m,g),v=r.subtract(v,m,v),_=r.normalize(r.cross(g,v,_),_),t.normal&&(a.addAttribute(h,_,w),a.addAttribute(h,_,w+3),a.addAttribute(h,_,C),a.addAttribute(h,_,C+3)),(t.tangent||t.bitangent)&&(b=r.fromArray(i,s,b),t.bitangent&&(a.addAttribute(f,b,w),a.addAttribute(f,b,w+3),a.addAttribute(f,b,C),a.addAttribute(f,b,C+3)),t.tangent&&(y=r.normalize(r.cross(b,_,y),y),a.addAttribute(p,y,w),a.addAttribute(p,y,w+3),a.addAttribute(p,y,C),a.addAttribute(p,y,C+3))),C+=6}if(t.normal){for(h.set(i),s=0;s<u;s+=3)h[s+u]=-i[s],h[s+u+1]=-i[s+1],h[s+u+2]=-i[s+2];e.normal.values=h}else e.normal=void 0;if(t.bitangent?(f.set(n),f.set(n,u),e.bitangent.values=f):e.bitangent=void 0,t.tangent){var S=e.tangent.values;p.set(S),p.set(S,u),e.tangent.values=p}}if(t.st){var E=e.st.values,T=new Float32Array(6*c);T.set(E),T.set(E,c);for(var x=2*c,P=0;P<2;P++){for(T[x++]=E[0],T[x++]=E[1],s=2;s<c;s+=2){var A=E[s],k=E[s+1];T[x++]=A,T[x++]=k,T[x++]=A,T[x++]=k}T[x++]=E[0],T[x++]=E[1]}e.st.values=T}return e}function E(e,t,r){r[t++]=e[0],r[t++]=e[1],r[t++]=e[2];for(var i=3;i<e.length;i+=3){var n=e[i],o=e[i+1],a=e[i+2];r[t++]=n,r[t++]=o,r[t++]=a,r[t++]=n,r[t++]=o,r[t++]=a}return r[t++]=e[0],r[t++]=e[1],r[t++]=e[2],r}function T(e,t){var r=new b({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=a.computePositions(e),s=w(o,r,i),l=e.height,u=e.extrudedHeight,c=s.attributes,d=s.indices,h=c.position.values,f=h.length,g=new Float64Array(6*f),_=new Float64Array(f);_.set(h);var y=new Float64Array(4*f);h=v.scaleToGeodeticHeight(h,l,i),y=E(h,0,y),_=v.scaleToGeodeticHeight(_,u,i),y=E(_,2*f,y),g.set(h),g.set(_,f),g.set(y,2*f),c.position.values=g,c=S(c,t);var C=f/3;if(e.shadowVolume){var T=c.normal.values;f=T.length;var x=new Float32Array(6*f);for(P=0;P<f;P++)T[P]=-T[P];x.set(T,f),x=E(T,4*f,x),c.extrudeDirection=new p({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:x}),t.normal||(c.normal=void 0)}var P,A=d.length,D=C+C,I=m.createTypedArray(g.length/3,2*A+3*D);I.set(d);var M=A;for(P=0;P<A;P+=3){var O=d[P],R=d[P+1],N=d[P+2];I[M++]=N+C,I[M++]=R+C,I[M++]=O+C}var k,L,F,B;for(P=0;P<D;P+=2)k=P+D,L=k+D,F=k+1,B=L+1,I[M++]=k,I[M++]=L,I[M++]=F,I[M++]=F,I[M++]=L,I[M++]=B;return{attributes:c,indices:I}}function x(e,t,i,n,o,a){var s=r.subtract(t,e,F);r.normalize(s,s);var l=i.geodeticSurfaceNormal(e,B),u=r.cross(s,l,F);r.multiplyByScalar(u,n,u);var c=o.latitude,d=o.longitude,h=a.latitude,p=a.longitude;r.add(e,u,B),i.cartesianToCartographic(B,U);var f=U.latitude,m=U.longitude;c=Math.min(c,f),d=Math.min(d,m),h=Math.max(h,f),p=Math.max(p,m),r.subtract(e,u,B),i.cartesianToCartographic(B,U),f=U.latitude,m=U.longitude,c=Math.min(c,f),d=Math.min(d,m),h=Math.max(h,f),p=Math.max(p,m),o.latitude=c,o.longitude=d,a.latitude=h,a.longitude=p}function P(t,i,n,a){var s=e(t,r.equalsEpsilon),l=s.length;if(l<2||n<=0)return new y;var u=.5*n;G.latitude=Number.POSITIVE_INFINITY,G.longitude=Number.POSITIVE_INFINITY,H.latitude=Number.NEGATIVE_INFINITY,H.longitude=Number.NEGATIVE_INFINITY;var c,d;if(a===o.ROUNDED){var h=s[0];r.subtract(h,s[1],V),r.normalize(V,V),r.multiplyByScalar(V,u,V),r.add(h,V,z),i.cartesianToCartographic(z,U),c=U.latitude,d=U.longitude,G.latitude=Math.min(G.latitude,c),G.longitude=Math.min(G.longitude,d),H.latitude=Math.max(H.latitude,c),H.longitude=Math.max(H.longitude,d)}for(var p=0;p<l-1;++p)x(s[p],s[p+1],i,u,G,H);var f=s[l-1];r.subtract(f,s[l-2],V),r.normalize(V,V),r.multiplyByScalar(V,u,V),r.add(f,V,z),x(f,z,i,u,G,H),a===o.ROUNDED&&(i.cartesianToCartographic(z,U),c=U.latitude,d=U.longitude,G.latitude=Math.min(G.latitude,c),G.longitude=Math.min(G.longitude,d),H.latitude=Math.max(H.latitude,c),H.longitude=Math.max(H.longitude,d));var m=new y;return m.north=H.latitude,m.south=G.latitude,m.east=H.longitude,m.west=G.longitude,m}function A(e){e=s(e,s.EMPTY_OBJECT);var t=e.positions,i=e.width;this._positions=t,this._ellipsoid=d.clone(s(e.ellipsoid,d.WGS84)),this._vertexFormat=b.clone(s(e.vertexFormat,b.DEFAULT)),this._width=i,this._height=s(e.height,0),this._extrudedHeight=s(e.extrudedHeight,this._height),this._cornerType=s(e.cornerType,o.ROUNDED),this._granularity=s(e.granularity,g.RADIANS_PER_DEGREE),this._shadowVolume=s(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._rectangle=P(t,this._ellipsoid,i,this._cornerType),this.packedLength=1+t.length*r.packedLength+d.packedLength+b.packedLength+y.packedLength+6}var D=new r,I=new r,M=new r,O=new r,R=new r,N=new r,k=new r,L=new r,F=new r,B=new r,U=new i,V=new r,z=new r,G=new i,H=new i;A.pack=function(e,t,i){i=s(i,0);var n=e._positions,o=n.length;t[i++]=o;for(var a=0;a<o;++a,i+=r.packedLength)r.pack(n[a],t,i);return d.pack(e._ellipsoid,t,i),i+=d.packedLength,b.pack(e._vertexFormat,t,i),i+=b.packedLength,y.pack(e._rectangle,t,i),i+=y.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};var W=d.clone(d.UNIT_SPHERE),j=new b,q=new y,Y={positions:void 0,ellipsoid:W,vertexFormat:j,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0};return A.unpack=function(e,t,i){t=s(t,0);for(var n=e[t++],o=new Array(n),a=0;a<n;++a,t+=r.packedLength)o[a]=r.unpack(e,t);var u=d.unpack(e,t,W);t+=d.packedLength;var c=b.unpack(e,t,j);t+=b.packedLength;var h=y.unpack(e,t,q);t+=y.packedLength;var p=e[t++],f=e[t++],m=e[t++],g=e[t++],v=e[t++],_=1===e[t];return l(i)?(i._positions=o,i._ellipsoid=d.clone(u,i._ellipsoid),i._vertexFormat=b.clone(c,i._vertexFormat),i._width=p,i._height=f,i._extrudedHeight=m,i._cornerType=g,i._granularity=v,i._rectangle=y.clone(h),i._shadowVolume=_,i):(Y.positions=o,Y.width=p,Y.height=f,Y.extrudedHeight=m,Y.cornerType=g,Y.granularity=v,Y.shadowVolume=_,new A(Y))},A.createGeometry=function(i){var n=i._positions,o=i._height,s=i._width,l=i._extrudedHeight,u=o!==l,c=e(n,r.equalsEpsilon);if(!(c.length<2||s<=0)){var d,p=i._ellipsoid,f=i._vertexFormat,m={ellipsoid:p,positions:c,width:s,cornerType:i._cornerType,granularity:i._granularity,saveAttributes:!0};if(u){var g=Math.max(o,l);l=Math.min(o,l),o=g,m.height=o,m.extrudedHeight=l,m.shadowVolume=i._shadowVolume,d=T(m,f)}else{var y=a.computePositions(m);d=w(y,f,p),d.attributes.position.values=v.scaleToGeodeticHeight(d.attributes.position.values,o,p)}var b=d.attributes,C=t.fromVertices(b.position.values,void 0,3);return f.position||(d.attributes.position.values=void 0),new h({attributes:b,indices:d.indices,primitiveType:_.TRIANGLES,boundingSphere:C})}},A.createShadowVolume=function(e,t,r){var i=e._granularity,n=e._ellipsoid,o=t(i,n),a=r(i,n);return new A({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:n,granularity:i,extrudedHeight:o,height:a,vertexFormat:b.POSITION_ONLY,shadowVolume:!0})},u(A.prototype,{rectangle:{get:function(){return this._rectangle}}}),A}),define("Core/CorridorOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e,t){var a,l,u,c=[],f=e.positions,m=e.corners,g=e.endPositions,v=new h,_=0,y=0,S=0;for(l=0;l<f.length;l+=2)u=f[l].length-3,_+=u,S+=u/3*4,y+=f[l+1].length-3;for(_+=3,y+=3,l=0;l<m.length;l++){a=m[l];var E=m[l].leftPositions;s(E)?(u=E.length,_+=u,S+=u/3*2):(u=m[l].rightPositions.length,y+=u,S+=u/3*2)}var T,x=s(g);x&&(T=g[0].length-3,_+=T,y+=T,T/=3,S+=4*T);var P,A,D,I,M,O,R=_+y,N=new Float64Array(R),k=0,L=R-1,F=T/2,B=p.createTypedArray(R/3,S+4),U=0;if(B[U++]=k/3,B[U++]=(L-2)/3,x){c.push(k/3),O=b,M=C;var V=g[0];for(l=0;l<F;l++)O=r.fromArray(V,3*(F-1-l),O),M=r.fromArray(V,3*(F+l),M),o.addAttribute(N,M,k),o.addAttribute(N,O,void 0,L),A=k/3,I=A+1,P=(L-2)/3,D=P-1,B[U++]=P,B[U++]=D,B[U++]=A,B[U++]=I,k+=3,L-=3}var z=0,G=f[z++],H=f[z++];for(N.set(G,k),N.set(H,L-H.length+1),u=H.length-3,c.push(k/3,(L-2)/3),l=0;l<u;l+=3)A=k/3,I=A+1,P=(L-2)/3,D=P-1,B[U++]=P,B[U++]=D,B[U++]=A,B[U++]=I,k+=3,L-=3;for(l=0;l<m.length;l++){var W;a=m[l];var j,q=a.leftPositions,Y=a.rightPositions,X=w;if(s(q)){for(L-=3,j=D,c.push(I),W=0;W<q.length/3;W++)X=r.fromArray(q,3*W,X),B[U++]=j-W-1,B[U++]=j-W,o.addAttribute(N,X,void 0,L),L-=3;c.push(j-Math.floor(q.length/6)),t===n.BEVELED&&c.push((L-2)/3+1),k+=3}else{for(k+=3,j=I,c.push(D),W=0;W<Y.length/3;W++)X=r.fromArray(Y,3*W,X),B[U++]=j+W,B[U++]=j+W+1,o.addAttribute(N,X,k),k+=3;c.push(j+Math.floor(Y.length/6)),t===n.BEVELED&&c.push(k/3-1),L-=3}for(G=f[z++],H=f[z++],G.splice(0,3),H.splice(H.length-3,3),N.set(G,k),N.set(H,L-H.length+1),u=H.length-3,W=0;W<H.length;W+=3)I=k/3,A=I-1,D=(L-2)/3,P=D+1,B[U++]=P,B[U++]=D,B[U++]=A,B[U++]=I,k+=3,L-=3;k-=3,L+=3,c.push(k/3,(L-2)/3)}if(x){k+=3,L-=3,O=b,M=C;var Q=g[1];for(l=0;l<F;l++)O=r.fromArray(Q,3*(T-l-1),O),M=r.fromArray(Q,3*l,M),o.addAttribute(N,O,void 0,L),o.addAttribute(N,M,k),I=k/3,A=I-1,D=(L-2)/3,P=D+1,B[U++]=P,B[U++]=D,B[U++]=A,B[U++]=I,k+=3,L-=3;c.push(k/3)}else c.push(k/3,(L-2)/3);return B[U++]=k/3,B[U++]=(L-2)/3,v.position=new d({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:N}),{attributes:v,indices:B,wallIndices:c}}function _(e){var t=e.ellipsoid,r=o.computePositions(e),i=v(r,e.cornerType),n=i.wallIndices,a=e.height,s=e.extrudedHeight,l=i.attributes,u=i.indices,c=l.position.values,d=c.length,h=new Float64Array(d);h.set(c);var f=new Float64Array(2*d);c=m.scaleToGeodeticHeight(c,a,t),h=m.scaleToGeodeticHeight(h,s,t),f.set(c),f.set(h,d),l.position.values=f,d/=3;var g,_=u.length,y=p.createTypedArray(f.length/3,2*(_+n.length));y.set(u);var b=_;for(g=0;g<_;g+=2){var C=u[g],w=u[g+1];y[b++]=C+d,y[b++]=w+d}var S,E;for(g=0;g<n.length;g++)S=n[g],E=S+d,y[b++]=S,y[b++]=E;return{attributes:l,indices:y}}function y(e){e=a(e,a.EMPTY_OBJECT);var t=e.positions,i=e.width;this._positions=t,this._ellipsoid=u.clone(a(e.ellipsoid,u.WGS84)),this._width=i,this._height=a(e.height,0),this._extrudedHeight=a(e.extrudedHeight,this._height),this._cornerType=a(e.cornerType,n.ROUNDED),this._granularity=a(e.granularity,f.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*r.packedLength+u.packedLength+5}var b=new r,C=new r,w=new r;y.pack=function(e,t,i){i=a(i,0);var n=e._positions,o=n.length;t[i++]=o;for(var s=0;s<o;++s,i+=r.packedLength)r.pack(n[s],t,i);return u.pack(e._ellipsoid,t,i),i+=u.packedLength,t[i++]=e._width,t[i++]=e._height,t[i++]=e._extrudedHeight,t[i++]=e._cornerType,t[i]=e._granularity,t};var S=u.clone(u.UNIT_SPHERE),E={positions:void 0,ellipsoid:S,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return y.unpack=function(e,t,i){t=a(t,0);for(var n=e[t++],o=new Array(n),l=0;l<n;++l,t+=r.packedLength)o[l]=r.unpack(e,t);var c=u.unpack(e,t,S);t+=u.packedLength;var d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=e[t];return s(i)?(i._positions=o,i._ellipsoid=u.clone(c,i._ellipsoid),i._width=d,i._height=h,i._extrudedHeight=p,i._cornerType=f,i._granularity=m,i):(E.positions=o,E.width=d,E.height=h,E.extrudedHeight=p,E.cornerType=f,E.granularity=m,new y(E))},y.createGeometry=function(i){var n=i._positions,a=i._height,s=i._width,l=i._extrudedHeight,u=a!==l,d=e(n,r.equalsEpsilon);if(!(d.length<2||s<=0)){var h,p=i._ellipsoid,f={ellipsoid:p,positions:d,width:s,cornerType:i._cornerType,granularity:i._granularity,saveAttributes:!1};if(u){var y=Math.max(a,l);l=Math.min(a,l),a=y,f.height=a,f.extrudedHeight=l,h=_(f)}else{var b=o.computePositions(f);h=v(b,f.cornerType),h.attributes.position.values=m.scaleToGeodeticHeight(h.attributes.position.values,a,p)}var C=h.attributes,w=t.fromVertices(C.position.values,void 0,3);return new c({attributes:C,indices:h.indices,primitiveType:g.LINES,boundingSphere:w})}},y}),define("Core/createGuid",[],function(){"use strict";function e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}return e}),define("Core/CylinderGeometryLibrary",["./Math"],function(e){"use strict";var t={};return t.computePositions=function(t,r,i,n,o){var a,s=.5*t,l=-s,u=n+n,c=o?2*u:u,d=new Float64Array(3*c),h=0,p=0,f=o?3*u:0,m=o?3*(u+n):3*n;for(a=0;a<n;a++){var g=a/n*e.TWO_PI,v=Math.cos(g),_=Math.sin(g),y=v*i,b=_*i,C=v*r,w=_*r;d[p+f]=y,d[p+f+1]=b,d[p+f+2]=l,d[p+m]=C,d[p+m+1]=w,d[p+m+2]=s,p+=3,o&&(d[h++]=y,d[h++]=b,d[h++]=l,d[h++]=C,d[h++]=w,d[h++]=s)}return d},t}),define("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,r=e.topRadius,i=e.bottomRadius,n=o(e.vertexFormat,f.DEFAULT),a=o(e.slices,128);this._length=t,this._topRadius=r,this._bottomRadius=i,this._vertexFormat=f.clone(n),this._slices=a,this._workerName="createCylinderGeometry"}var g=new t,v=new r,_=new r,y=new r,b=new r;m.packedLength=f.packedLength+4,m.pack=function(e,t,r){return r=o(r,0),f.pack(e._vertexFormat,t,r),r+=f.packedLength,t[r++]=e._length,t[r++]=e._topRadius,t[r++]=e._bottomRadius,t[r]=e._slices,t};var C=new f,w={vertexFormat:C,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return m.unpack=function(e,t,r){t=o(t,0);var i=f.unpack(e,t,C);t+=f.packedLength;var n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(r)?(r._vertexFormat=f.clone(i,r._vertexFormat),r._length=n,r._topRadius=s,r._bottomRadius=l,r._slices=u,r):(w.length=n,w.topRadius=s,w.bottomRadius=l,w.slices=u,new m(w))},m.createGeometry=function(o){var a=o._length,s=o._topRadius,f=o._bottomRadius,m=o._vertexFormat,C=o._slices;if(!(a<=0||s<0||f<0||0===s&&0===f)){var w,S=C+C,E=C+S,T=S+S,x=n.computePositions(a,s,f,C,!0),P=m.st?new Float32Array(2*T):void 0,A=m.normal?new Float32Array(3*T):void 0,D=m.tangent?new Float32Array(3*T):void 0,I=m.bitangent?new Float32Array(3*T):void 0,M=m.normal||m.tangent||m.bitangent;if(M){var O=m.tangent||m.bitangent,R=0,N=0,k=0,L=v;L.z=0;var F=y,B=_;for(w=0;w<C;w++){var U=w/C*h.TWO_PI,V=Math.cos(U),z=Math.sin(U);M&&(L.x=V,L.y=z,O&&(F=r.normalize(r.cross(r.UNIT_Z,L,F),F)),m.normal&&(A[R++]=V,A[R++]=z,A[R++]=0,A[R++]=V,A[R++]=z,A[R++]=0),m.tangent&&(D[N++]=F.x,D[N++]=F.y,D[N++]=F.z,D[N++]=F.x,D[N++]=F.y,D[N++]=F.z),m.bitangent&&(B=r.normalize(r.cross(L,F,B),B),I[k++]=B.x,I[k++]=B.y,I[k++]=B.z,I[k++]=B.x,I[k++]=B.y,I[k++]=B.z))}for(w=0;w<C;w++)m.normal&&(A[R++]=0,A[R++]=0,A[R++]=-1),m.tangent&&(D[N++]=1,D[N++]=0,D[N++]=0),m.bitangent&&(I[k++]=0,I[k++]=-1,I[k++]=0);for(w=0;w<C;w++)m.normal&&(A[R++]=0,A[R++]=0,A[R++]=1),m.tangent&&(D[N++]=1,D[N++]=0,D[N++]=0),m.bitangent&&(I[k++]=0,I[k++]=1,I[k++]=0)}var G=12*C-12,H=d.createTypedArray(T,G),W=0,j=0;for(w=0;w<C-1;w++)H[W++]=j,H[W++]=j+2,H[W++]=j+3,H[W++]=j,H[W++]=j+3,H[W++]=j+1,j+=2;for(H[W++]=S-2,H[W++]=0,H[W++]=1,H[W++]=S-2,H[W++]=1,H[W++]=S-1,w=1;w<C-1;w++)H[W++]=S+w+1,H[W++]=S+w,H[W++]=S;for(w=1;w<C-1;w++)H[W++]=E,H[W++]=E+w,H[W++]=E+w+1;var q=0;if(m.st){var Y=Math.max(s,f);for(w=0;w<T;w++){var X=r.fromArray(x,3*w,b);P[q++]=(X.x+Y)/(2*Y),P[q++]=(X.y+Y)/(2*Y)}}var Q=new c;m.position&&(Q.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:x})),m.normal&&(Q.normal=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:A})),m.tangent&&(Q.tangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:D})),m.bitangent&&(Q.bitangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:I})),m.st&&(Q.st=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:P})),g.x=.5*a,g.y=Math.max(f,s);var Z=new e(r.ZERO,t.magnitude(g));return new l({attributes:Q,indices:H,primitiveType:p.TRIANGLES,boundingSphere:Z})}},m}),define("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){e=o(e,o.EMPTY_OBJECT);var t=e.length,r=e.topRadius,i=e.bottomRadius,n=o(e.slices,128),a=Math.max(o(e.numberOfVerticalLines,16),0);this._length=t,this._topRadius=r,this._bottomRadius=i,this._slices=n,this._numberOfVerticalLines=a,this._workerName="createCylinderOutlineGeometry"}var f=new t;p.packedLength=5,p.pack=function(e,t,r){return r=o(r,0),t[r++]=e._length,t[r++]=e._topRadius,t[r++]=e._bottomRadius,t[r++]=e._slices,t[r]=e._numberOfVerticalLines,t};var m={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return p.unpack=function(e,t,r){t=o(t,0);var i=e[t++],n=e[t++],s=e[t++],l=e[t++],u=e[t];return a(r)?(r._length=i,r._topRadius=n,r._bottomRadius=s,r._slices=l,r._numberOfVerticalLines=u,r):(m.length=i,m.topRadius=n,m.bottomRadius=s,m.slices=l,m.numberOfVerticalLines=u,new p(m))},p.createGeometry=function(o){var a=o._length,s=o._topRadius,p=o._bottomRadius,m=o._slices,g=o._numberOfVerticalLines;if(!(a<=0||s<0||p<0||0===s&&0===p)){var v,_=2*m,y=n.computePositions(a,s,p,m,!1),b=2*m;if(g>0){var C=Math.min(g,m);v=Math.round(m/C),b+=C}for(var w=d.createTypedArray(_,2*b),S=0,E=0;E<m-1;E++)w[S++]=E,w[S++]=E+1,w[S++]=E+m,w[S++]=E+1+m;if(w[S++]=m-1,w[S++]=0,w[S++]=m+m-1,w[S++]=m,g>0)for(E=0;E<m;E+=v)w[S++]=E,w[S++]=E+m;var T=new c;T.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:y}),f.x=.5*a,f.y=Math.max(p,s);var x=new e(r.ZERO,t.magnitude(f));return new l({attributes:T,indices:w,primitiveType:h.LINES,boundingSphere:x})}},p}),define("Core/decodeGoogleEarthEnterpriseData",["./Check","./defined","./RuntimeError"],function(e,t,r){"use strict";function i(e,t){if(i.passThroughDataForTesting)return t;var a=e.byteLength;if(0===a||a%4!==0)throw new r("The length of key must be greater than 0 and a multiple of 4.");var s=new DataView(t),l=s.getUint32(0,!0);if(l===n||l===o)return t;for(var u,c=new DataView(e),d=0,h=t.byteLength,p=h-h%8,f=a,m=8;d<p;)for(m=(m+8)%24,u=m;d<p&&u<f;)s.setUint32(d,s.getUint32(d,!0)^c.getUint32(u,!0),!0),s.setUint32(d+4,s.getUint32(d+4,!0)^c.getUint32(u+4,!0),!0),d+=8,u+=24;if(d<h)for(u>=f&&(m=(m+8)%24,u=m);d<h;)s.setUint8(d,s.getUint8(d)^c.getUint8(u)),d++,u++}var n=1953029805,o=2917034100;return i.passThroughDataForTesting=!1,i}),define("Core/DefaultProxy",[],function(){"use strict";function e(e){this.proxy=e}return e.prototype.getURL=function(e){var t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)},e}),define("Core/DistanceDisplayCondition",["./defaultValue","./defined","./defineProperties"],function(e,t,r){"use strict";function i(t,r){t=e(t,0),this._near=t,r=e(r,Number.MAX_VALUE),this._far=r}return r(i.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}}}),i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.near===r.near&&e.far===r.far},i.clone=function(e,r){if(t(e))return t(r)||(r=new i),r.near=e.near,r.far=e.far,r},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/DistanceDisplayConditionGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i,n){"use strict";function o(e,r){e=t(e,0),r=t(r,Number.MAX_VALUE),this.value=new Float32Array([e,r])}return i(o.prototype,{componentDatatype:{get:function(){return e.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}}),o.fromDistanceDisplayCondition=function(e){return new o(e.near,e.far)},o.toValue=function(e,t){return r(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])},o}),define("ThirdParty/Tween",[],function(){void 0===Date.now&&(Date.now=function(){return(new Date).valueOf()});var e=e||function(){var e=[];return{REVISION:"13",getAll:function(){return e},removeAll:function(){e=[]},add:function(t){e.push(t)},remove:function(t){var r=e.indexOf(t);r!==-1&&e.splice(r,1)},update:function(t){if(0===e.length)return!1;var r=0;for(t=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now();r<e.length;)e[r].update(t)?r++:e.splice(r,1);return!0}}}();return e.Tween=function(t){var r=t,i={},n={},o={},a=1e3,s=0,l=!1,u=!1,c=!1,d=0,h=null,p=e.Easing.Linear.None,f=e.Interpolation.Linear,m=[],g=null,v=!1,_=null,y=null,b=null;for(var C in t)i[C]=parseFloat(t[C],10);this.to=function(e,t){return void 0!==t&&(a=t),n=e,this},this.start=function(t){e.add(this),u=!0,v=!1,h=void 0!==t?t:"undefined"!=typeof window&&void 0!==window.performance&&void 0!==window.performance.now?window.performance.now():Date.now(),h+=d;for(var a in n){if(n[a]instanceof Array){if(0===n[a].length)continue;n[a]=[r[a]].concat(n[a])}i[a]=r[a],i[a]instanceof Array==!1&&(i[a]*=1),o[a]=i[a]||0}return this},this.stop=function(){return u?(e.remove(this),u=!1,null!==b&&b.call(r),this.stopChainedTweens(),this):this},this.stopChainedTweens=function(){for(var e=0,t=m.length;e<t;e++)m[e].stop()},this.delay=function(e){return d=e,this},this.repeat=function(e){return s=e,this},this.yoyo=function(e){return l=e,this},this.easing=function(e){return p=e,this},this.interpolation=function(e){return f=e,this},this.chain=function(){return m=arguments,this},this.onStart=function(e){return g=e,this},this.onUpdate=function(e){return _=e,this},this.onComplete=function(e){return y=e,this},this.onStop=function(e){return b=e,this},this.update=function(e){var t;if(e<h)return!0;v===!1&&(null!==g&&g.call(r),v=!0);var u=(e-h)/a;u=u>1?1:u;var b=p(u);for(t in n){var C=i[t]||0,w=n[t];w instanceof Array?r[t]=f(w,b):("string"==typeof w&&(w=C+parseFloat(w,10)),"number"==typeof w&&(r[t]=C+(w-C)*b))}if(null!==_&&_.call(r,b),1==u){if(s>0){isFinite(s)&&s--;for(t in o){if("string"==typeof n[t]&&(o[t]=o[t]+parseFloat(n[t],10)),l){var S=o[t];o[t]=n[t],n[t]=S}i[t]=o[t]}return l&&(c=!c),h=e+d,!0}null!==y&&y.call(r);for(var E=0,T=m.length;E<T;E++)m[E].start(e);return!1}return!0}},e.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*(-Math.pow(2,-10*(e-1))+2)}},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,r=.1,i=.4;return 0===e?0:1===e?1:(!r||r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)))},Out:function(e){var t,r=.1,i=.4;return 0===e?0:1===e?1:(!r||r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*e)*Math.sin((e-t)*(2*Math.PI)/i)+1)},InOut:function(e){var t,r=.1,i=.4;return 0===e?0:1===e?1:(!r||r<1?(r=1,t=i/4):t=i*Math.asin(1/r)/(2*Math.PI),(e*=2)<1?-.5*(r*Math.pow(2,10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)):r*Math.pow(2,-10*(e-=1))*Math.sin((e-t)*(2*Math.PI)/i)*.5+1)}},Back:{In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}},Bounce:{In:function(t){return 1-e.Easing.Bounce.Out(1-t)},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(t){return t<.5?.5*e.Easing.Bounce.In(2*t):.5*e.Easing.Bounce.Out(2*t-1)+.5}}},e.Interpolation={Linear:function(t,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.Linear;return r<0?a(t[0],t[1],n):r>1?a(t[i],t[i-1],i-n):a(t[o],t[o+1>i?i:o+1],n-o)},Bezier:function(t,r){var i,n=0,o=t.length-1,a=Math.pow,s=e.Interpolation.Utils.Bernstein;for(i=0;i<=o;i++)n+=a(1-r,o-i)*a(r,i)*t[i]*s(o,i);return n},CatmullRom:function(t,r){var i=t.length-1,n=i*r,o=Math.floor(n),a=e.Interpolation.Utils.CatmullRom;return t[0]===t[i]?(r<0&&(o=Math.floor(n=i*(1+r))),a(t[(o-1+i)%i],t[o],t[(o+1)%i],t[(o+2)%i],n-o)):r<0?t[0]-(a(t[0],t[0],t[1],t[1],-n)-t[0]):r>1?t[i]-(a(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):a(t[o?o-1:0],t[o],t[i<o+1?i:o+1],t[i<o+2?i:o+2],n-o)},Utils:{Linear:function(e,t,r){return(t-e)*r+e},Bernstein:function(t,r){var i=e.Interpolation.Utils.Factorial;return i(t)/i(r)/i(t-r)},Factorial:function(){var e=[1];return function(t){var r,i=1;if(e[t])return e[t];for(r=t;r>1;r--)i*=r;return e[t]=i}}(),CatmullRom:function(e,t,r,i,n){var o=.5*(r-e),a=.5*(i-t),s=n*n,l=n*s;return(2*t-2*r+o+a)*l+(-3*t+3*r-2*o-a)*s+o*n+t}}},e}),define("Core/EasingFunction",["../ThirdParty/Tween","./freezeObject"],function(e,t){"use strict";var r={LINEAR_NONE:e.Easing.Linear.None,QUADRACTIC_IN:e.Easing.Quadratic.In,QUADRACTIC_OUT:e.Easing.Quadratic.Out,QUADRACTIC_IN_OUT:e.Easing.Quadratic.InOut,CUBIC_IN:e.Easing.Cubic.In,CUBIC_OUT:e.Easing.Cubic.Out,CUBIC_IN_OUT:e.Easing.Cubic.InOut,QUARTIC_IN:e.Easing.Quartic.In,QUARTIC_OUT:e.Easing.Quartic.Out,QUARTIC_IN_OUT:e.Easing.Quartic.InOut,QUINTIC_IN:e.Easing.Quintic.In,QUINTIC_OUT:e.Easing.Quintic.Out,QUINTIC_IN_OUT:e.Easing.Quintic.InOut,SINUSOIDAL_IN:e.Easing.Sinusoidal.In,SINUSOIDAL_OUT:e.Easing.Sinusoidal.Out,SINUSOIDAL_IN_OUT:e.Easing.Sinusoidal.InOut,EXPONENTIAL_IN:e.Easing.Exponential.In,EXPONENTIAL_OUT:e.Easing.Exponential.Out,EXPONENTIAL_IN_OUT:e.Easing.Exponential.InOut,CIRCULAR_IN:e.Easing.Circular.In,CIRCULAR_OUT:e.Easing.Circular.Out,CIRCULAR_IN_OUT:e.Easing.Circular.InOut,ELASTIC_IN:e.Easing.Elastic.In,ELASTIC_OUT:e.Easing.Elastic.Out,ELASTIC_IN_OUT:e.Easing.Elastic.InOut,BACK_IN:e.Easing.Back.In,BACK_OUT:e.Easing.Back.Out,BACK_IN_OUT:e.Easing.Back.InOut,BOUNCE_IN:e.Easing.Bounce.In,BOUNCE_OUT:e.Easing.Bounce.Out,BOUNCE_IN_OUT:e.Easing.Bounce.InOut};return t(r)}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=n(e,n.EMPTY_OBJECT);var t=n(e.radii,C),i=Math.round(n(e.stackPartitions,64)),o=Math.round(n(e.slicePartitions,64)),a=n(e.vertexFormat,f.DEFAULT);this._radii=r.clone(t),this._stackPartitions=i,this._slicePartitions=o,this._vertexFormat=f.clone(a),this._workerName="createEllipsoidGeometry"}var g=new r,v=new r,_=new r,y=new r,b=new r,C=new r(1,1,1),w=Math.cos,S=Math.sin;m.packedLength=r.packedLength+f.packedLength+2,m.pack=function(e,t,i){return i=n(i,0),r.pack(e._radii,t,i),i+=r.packedLength,f.pack(e._vertexFormat,t,i),i+=f.packedLength,t[i++]=e._stackPartitions,t[i]=e._slicePartitions,t};var E=new r,T=new f,x={radii:E,vertexFormat:T,stackPartitions:void 0,slicePartitions:void 0};return m.unpack=function(e,t,i){t=n(t,0);var a=r.unpack(e,t,E);t+=r.packedLength;var s=f.unpack(e,t,T);t+=f.packedLength;var l=e[t++],u=e[t];return o(i)?(i._radii=r.clone(a,i._radii),i._vertexFormat=f.clone(s,i._vertexFormat),i._stackPartitions=l,i._slicePartitions=u,i):(x.stackPartitions=l,x.slicePartitions=u,new m(x))},m.createGeometry=function(n){var o=n._radii;if(!(o.x<=0||o.y<=0||o.z<=0)){var a,f,m=s.fromCartesian3(o),C=n._vertexFormat,E=n._slicePartitions+1,T=n._stackPartitions+1,x=T*E,P=new Float64Array(3*x),A=6*(E-1)*(T-2),D=d.createTypedArray(x,A),I=C.normal?new Float32Array(3*x):void 0,M=C.tangent?new Float32Array(3*x):void 0,O=C.bitangent?new Float32Array(3*x):void 0,R=C.st?new Float32Array(2*x):void 0,N=new Array(E),k=new Array(E),L=0;for(a=0;a<E;a++){var F=h.TWO_PI*a/(E-1);N[a]=w(F),k[a]=S(F),P[L++]=0,P[L++]=0,P[L++]=o.z}for(a=1;a<T-1;a++){var B=Math.PI*a/(T-1),U=S(B),V=o.x*U,z=o.y*U,G=o.z*w(B);for(f=0;f<E;f++)P[L++]=N[f]*V,P[L++]=k[f]*z,P[L++]=G}for(a=0;a<E;a++)P[L++]=0,P[L++]=0,P[L++]=-o.z;var H=new c;C.position&&(H.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:P}));var W=0,j=0,q=0,Y=0;if(C.st||C.normal||C.tangent||C.bitangent){for(a=0;a<x;a++){var X=r.fromArray(P,3*a,g),Q=m.geodeticSurfaceNormal(X,v);if(C.st){var Z=t.negate(Q,b);t.magnitude(Z)<h.EPSILON6&&(L=3*(a+E*Math.floor(.5*T)),L>P.length&&(L=3*(a-E*Math.floor(.5*T))),r.fromArray(P,L,Z),m.geodeticSurfaceNormal(Z,Z),t.negate(Z,Z)),R[W++]=Math.atan2(Z.y,Z.x)/h.TWO_PI+.5,R[W++]=Math.asin(Q.z)/Math.PI+.5}if(C.normal&&(I[j++]=Q.x,I[j++]=Q.y,I[j++]=Q.z),C.tangent||C.bitangent){var K=_;if(a<E||a>x-E-1?(r.cross(r.UNIT_X,Q,K),r.normalize(K,K)):(r.cross(r.UNIT_Z,Q,K),r.normalize(K,K)),C.tangent&&(M[q++]=K.x,M[q++]=K.y,M[q++]=K.z),C.bitangent){var J=r.cross(Q,K,y);r.normalize(J,J),O[Y++]=J.x,O[Y++]=J.y,O[Y++]=J.z}}}C.st&&(H.st=new u({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:R})),C.normal&&(H.normal=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:I})),C.tangent&&(H.tangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:M})),C.bitangent&&(H.bitangent=new u({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:O}))}for(L=0,f=0;f<E-1;f++)D[L++]=E+f,D[L++]=E+f+1,D[L++]=f+1;var $,ee;for(a=1;a<T-2;a++)for($=a*E,ee=(a+1)*E,f=0;f<E-1;f++)D[L++]=ee+f,D[L++]=ee+f+1,D[L++]=$+f+1,D[L++]=ee+f,D[L++]=$+f+1,D[L++]=$+f;for(a=T-2,$=a*E,ee=(a+1)*E,f=0;f<E-1;f++)D[L++]=ee+f,D[L++]=$+f+1,D[L++]=$+f;return new l({attributes:H,indices:D,primitiveType:p.TRIANGLES, +boundingSphere:e.fromEllipsoid(m)})}},m}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){e=i(e,i.EMPTY_OBJECT);var r=i(e.radii,f),n=Math.round(i(e.stackPartitions,10)),o=Math.round(i(e.slicePartitions,8)),a=Math.round(i(e.subdivisions,128));this._radii=t.clone(r),this._stackPartitions=n,this._slicePartitions=o,this._subdivisions=a,this._workerName="createEllipsoidOutlineGeometry"}var f=new t(1,1,1),m=Math.cos,g=Math.sin;p.packedLength=t.packedLength+3,p.pack=function(e,r,n){return n=i(n,0),t.pack(e._radii,r,n),n+=t.packedLength,r[n++]=e._stackPartitions,r[n++]=e._slicePartitions,r[n]=e._subdivisions,r};var v=new t,_={radii:v,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return p.unpack=function(e,r,o){r=i(r,0);var a=t.unpack(e,r,v);r+=t.packedLength;var s=e[r++],l=e[r++],u=e[r++];return n(o)?(o._radii=t.clone(a,o._radii),o._stackPartitions=s,o._slicePartitions=l,o._subdivisions=u,o):(_.stackPartitions=s,_.slicePartitions=l,_.subdivisions=u,new p(_))},p.createGeometry=function(t){var i=t._radii;if(!(i.x<=0||i.y<=0||i.z<=0)){var n,o,p,f,v,_,y=a.fromCartesian3(i),b=t._stackPartitions,C=t._slicePartitions,w=t._subdivisions,S=w*(b+C-1),E=S-C+2,T=new Float64Array(3*E),x=c.createTypedArray(E,2*S),P=0,A=new Array(w),D=new Array(w);for(n=0;n<w;n++)p=d.TWO_PI*n/w,A[n]=m(p),D[n]=g(p);for(n=1;n<b;n++)for(f=Math.PI*n/b,v=m(f),_=g(f),o=0;o<w;o++)T[P++]=i.x*A[o]*_,T[P++]=i.y*D[o]*_,T[P++]=i.z*v;for(A.length=C,D.length=C,n=0;n<C;n++)p=d.TWO_PI*n/C,A[n]=m(p),D[n]=g(p);for(T[P++]=0,T[P++]=0,T[P++]=i.z,n=1;n<w;n++)for(f=Math.PI*n/w,v=m(f),_=g(f),o=0;o<C;o++)T[P++]=i.x*A[o]*_,T[P++]=i.y*D[o]*_,T[P++]=i.z*v;for(T[P++]=0,T[P++]=0,T[P++]=-i.z,P=0,n=0;n<b-1;++n){var I=n*w;for(o=0;o<w-1;++o)x[P++]=I+o,x[P++]=I+o+1;x[P++]=I+w-1,x[P++]=I}var M=w*(b-1);for(o=1;o<C+1;++o)x[P++]=M,x[P++]=M+o;for(n=0;n<w-2;++n){var O=n*C+1+M,R=(n+1)*C+1+M;for(o=0;o<C-1;++o)x[P++]=R+o,x[P++]=O+o;x[P++]=R+C-1,x[P++]=O+C-1}var N=T.length/3-1;for(o=N-1;o>N-C-1;--o)x[P++]=N,x[P++]=o;var k=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:T})});return new s({attributes:k,indices:x,primitiveType:h.LINES,boundingSphere:e.fromEllipsoid(y)})}},p}),define("Core/EllipsoidTerrainProvider",["../ThirdParty/when","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Event","./GeographicTilingScheme","./HeightmapTerrainData","./TerrainProvider"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(i){i=t(i,{}),this._tilingScheme=i.tilingScheme,r(this._tilingScheme)||(this._tilingScheme=new a({ellipsoid:t(i.ellipsoid,n.WGS84)})),this._levelZeroMaximumGeometricError=l.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new o,this._readyPromise=e.resolve(!0)}return i(u.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}}}),u.prototype.requestTileGeometry=function(e,t,r,i){var n=16,o=16;return new s({buffer:new Uint8Array(n*o),width:n,height:o})},u.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},u.prototype.getTileDataAvailable=function(e,t,r){},u}),define("Core/EventHelper",["./defined","./DeveloperError"],function(e,t){"use strict";function r(){this._removalFunctions=[]}return r.prototype.add=function(e,t,r){var i=e.addEventListener(t,r);this._removalFunctions.push(i);var n=this;return function(){i();var e=n._removalFunctions;e.splice(e.indexOf(i),1)}},r.prototype.removeAll=function(){for(var e=this._removalFunctions,t=0,r=e.length;t<r;++t)e[t]();e.length=0},r}),define("Core/ExtrapolationType",["./freezeObject"],function(e){"use strict";var t={NONE:0,HOLD:1,EXTRAPOLATE:2};return e(t)}),define("Core/GeocoderService",["./DeveloperError"],function(e){"use strict";function t(){}return t.prototype.geocode=e.throwInstantiationError,t}),define("Core/GeometryInstanceAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.value=t.value}return i}),define("Core/getBaseUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(r,i){var n="",o=r.lastIndexOf("/");return o!==-1&&(n=r.substring(0,o+1)),i?(r=new e(r),t(r.query)&&(n+="?"+r.query),t(r.fragment)&&(n+="#"+r.fragment),n):n}return i}),define("Core/getExtensionFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t){var r=new e(t);r.normalize();var i=r.path,n=i.lastIndexOf("/");return n!==-1&&(i=i.substr(n+1)),n=i.lastIndexOf("."),i=n===-1?"":i.substr(n+1)}return i}),define("Core/getFilenameFromUri",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t){var r=new e(t);r.normalize();var i=r.path,n=i.lastIndexOf("/");return n!==-1&&(i=i.substr(n+1)),i}return i}),define("Core/getImagePixels",["./defined"],function(e){"use strict";function t(t,i,n){e(i)||(i=t.width),e(n)||(n=t.height);var o=r[i];e(o)||(o={},r[i]=o);var a=o[n];if(!e(a)){var s=document.createElement("canvas");s.width=i,s.height=n,a=s.getContext("2d"),a.globalCompositeOperation="copy",o[n]=a}return a.drawImage(t,0,0,i,n),a.getImageData(0,0,i,n).data}var r={};return t}),define("Core/getStringFromTypedArray",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t,r,n){return r=e(r,0),n=e(n,t.byteLength-r),t=t.subarray(r,r+n),i.decode(t)}return i.decodeWithTextDecoder=function(e){var t=new TextDecoder("utf-8");return t.decode(e)},i.decodeWithFromCharCode=function(e){for(var t="",r=e.length,i=0;i<r;++i)t+=String.fromCharCode(e[i]);return t},"undefined"!=typeof TextDecoder?i.decode=i.decodeWithTextDecoder:i.decode=i.decodeWithFromCharCode,i}),define("Core/getMagic",["./defaultValue","./getStringFromTypedArray"],function(e,t){"use strict";function r(r,i){return i=e(i,0),t(r,i,Math.min(4,r.length))}return r}),function(global,undefined){"use strict";!function(e,t,r){function i(r){var n=t[r];return n||e[r][0].call(n=t[r]={exports:{}},i,n,n.exports),n.exports}var n=global.protobuf=i(r[0]);"function"==typeof define&&define.amd&&define("ThirdParty/protobuf-minimal",[],function(){return n.configure(),n}),"object"==typeof module&&module&&module.exports&&(module.exports=n)}({1:[function(e,t,r){function i(e,t){for(var r=[],i=2;i<arguments.length;)r.push(arguments[i++]);var n=!0;return new Promise(function(i,o){r.push(function(e){if(n)if(n=!1,e)o(e);else{for(var t=[],r=1;r<arguments.length;)t.push(arguments[r++]);i.apply(null,t)}});try{e.apply(t||this,r)}catch(e){n&&(n=!1,o(e))}})}t.exports=i},{}],2:[function(e,t,r){var i=r;i.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),o=new Array(123),a=0;a<64;)o[n[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;i.encode=function(e,t,r){for(var i,o=[],a=0,s=0;t<r;){var l=e[t++];switch(s){case 0:o[a++]=n[l>>2],i=(3&l)<<4,s=1;break;case 1:o[a++]=n[i|l>>4],i=(15&l)<<2,s=2;break;case 2:o[a++]=n[i|l>>6],o[a++]=n[63&l],s=0}}return s&&(o[a++]=n[i],o[a]=61,1===s&&(o[a+1]=61)),String.fromCharCode.apply(String,o)};var s="invalid encoding";i.decode=function(e,t,r){for(var i,n=r,a=0,l=0;l<e.length;){var u=e.charCodeAt(l++);if(61===u&&a>1)break;if((u=o[u])===undefined)throw Error(s);switch(a){case 0:i=u,a=1;break;case 1:t[r++]=i<<2|(48&u)>>4,i=u,a=2;break;case 2:t[r++]=(15&i)<<4|(60&u)>>2,i=u,a=3;break;case 3:t[r++]=(3&i)<<6|u,a=0}}if(1===a)throw Error(s);return r-n},i.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,r){function i(){this._listeners={}}t.exports=i,i.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},i.prototype.off=function(e,t){if(e===undefined)this._listeners={};else if(t===undefined)this._listeners[e]=[];else for(var r=this._listeners[e],i=0;i<r.length;)r[i].fn===t?r.splice(i,1):++i;return this},i.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,r)}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,r){function i(e,t,r){var i=r||8192,n=i>>>1,o=null,a=i;return function(r){if(r<1||r>n)return e(r);a+r>i&&(o=e(i),a=0);var s=t.call(o,a,a+=r);return 7&a&&(a=(7|a)+1),s}}t.exports=i},{}],6:[function(e,t,r){var i=r;i.length=function(e){for(var t=0,r=0,i=0;i<e.length;++i)r=e.charCodeAt(i),r<128?t+=1:r<2048?t+=2:55296===(64512&r)&&56320===(64512&e.charCodeAt(i+1))?(++i,t+=4):t+=3;return t},i.read=function(e,t,r){var i=r-t;if(i<1)return"";for(var n,o=null,a=[],s=0;t<r;)n=e[t++],n<128?a[s++]=n:n>191&&n<224?a[s++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[s++]=55296+(n>>10),a[s++]=56320+(1023&n)):a[s++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0);return o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))},i.write=function(e,t,r){for(var i,n,o=r,a=0;a<e.length;++a)i=e.charCodeAt(a),i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296===(64512&i)&&56320===(64512&(n=e.charCodeAt(a+1)))?(i=65536+((1023&i)<<10)+(1023&n),++a,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128);return r-o}},{}],7:[function(e,t,r){function i(){n.Reader._configure(n.BufferReader),n.util._configure()}var n=r;n.build="minimal",n.roots={},n.Writer=e(14),n.BufferWriter=e(15),n.Reader=e(8),n.BufferReader=e(9),n.util=e(13),n.rpc=e(10),n.configure=i,n.Writer._configure(n.BufferWriter),i()},{10:10,13:13,14:14,15:15,8:8,9:9}],8:[function(e,t,r){function i(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function n(e){this.buf=e,this.pos=0,this.len=e.length}function o(){var e=new c(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw i(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,this.len-this.pos>4){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 i(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 a(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function s(){if(this.pos+8>this.len)throw i(this,8);return new c(a(this.buf,this.pos+=4),a(this.buf,this.pos+=4))}t.exports=n;var l,u=e(13),c=u.LongBits,d=u.utf8,h="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new n(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new n(e);throw Error("illegal buffer")};n.create=u.Buffer?function(e){return(n.create=function(e){return u.Buffer.isBuffer(e)?new l(e):h(e)})(e)}:h,n.prototype._slice=u.Array.prototype.subarray||u.Array.prototype.slice,n.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,i(this,10);return e}}(),n.prototype.int32=function(){return 0|this.uint32()},n.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},n.prototype.bool=function(){return 0!==this.uint32()},n.prototype.fixed32=function(){if(this.pos+4>this.len)throw i(this,4);return a(this.buf,this.pos+=4)},n.prototype.sfixed32=function(){if(this.pos+4>this.len)throw i(this,4);return 0|a(this.buf,this.pos+=4)};var p="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,i){return t[0]=r[i],t[1]=r[i+1],t[2]=r[i+2],t[3]=r[i+3],e[0]}:function(r,i){return t[0]=r[i+3],t[1]=r[i+2],t[2]=r[i+1],t[3]=r[i],e[0]}}():function(e,t){var r=a(e,t+4),i=2*(r>>31)+1,n=r>>>23&255,o=8388607&r;return 255===n?o?NaN:i*(1/0):0===n?1.401298464324817e-45*i*o:i*Math.pow(2,n-150)*(o+8388608)};n.prototype.float=function(){if(this.pos+4>this.len)throw i(this,4);var e=p(this.buf,this.pos);return this.pos+=4,e};var f="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,i){return t[0]=r[i],t[1]=r[i+1],t[2]=r[i+2],t[3]=r[i+3],t[4]=r[i+4],t[5]=r[i+5],t[6]=r[i+6],t[7]=r[i+7],e[0]}:function(r,i){return t[0]=r[i+7],t[1]=r[i+6],t[2]=r[i+5],t[3]=r[i+4],t[4]=r[i+3],t[5]=r[i+2],t[6]=r[i+1],t[7]=r[i],e[0]}}():function(e,t){var r=a(e,t+4),i=a(e,t+8),n=2*(i>>31)+1,o=i>>>20&2047,s=4294967296*(1048575&i)+r;return 2047===o?s?NaN:n*(1/0):0===o?5e-324*n*s:n*Math.pow(2,o-1075)*(s+4503599627370496)};n.prototype.double=function(){if(this.pos+8>this.len)throw i(this,4);var e=f(this.buf,this.pos);return this.pos+=8,e},n.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw i(this,e);return this.pos+=e,t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},n.prototype.string=function(){var e=this.bytes();return d.read(e,0,e.length)},n.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw i(this,e);this.pos+=e}else do if(this.pos>=this.len)throw i(this);while(128&this.buf[this.pos++]);return this},n.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},n._configure=function(e){l=e;var t=u.Long?"toLong":"toNumber";u.merge(n.prototype,{int64:function(){return o.call(this)[t](!1)},uint64:function(){return o.call(this)[t](!0)},sint64:function(){return o.call(this).zzDecode()[t](!1)},fixed64:function(){return s.call(this)[t](!0)},sfixed64:function(){return s.call(this)[t](!1)}})}},{13:13}],9:[function(e,t,r){function i(e){n.call(this,e)}t.exports=i;var n=e(8);(i.prototype=Object.create(n.prototype)).constructor=i;var o=e(13);o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice),i.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,r){var i=r;i.Service=e(11)},{11:11}],11:[function(e,t,r){function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}t.exports=i;var n=e(13);(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,r,i,o);if(!s.rpcImpl)return setTimeout(function(){a(Error("already ended"))},0),undefined;try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(e,r){if(e)return s.emit("error",e,t),a(e);if(null===r)return s.end(!0),undefined;if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)})}catch(e){return s.emit("error",e,t),setTimeout(function(){a(e)},0),undefined}},i.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,r){function i(e,t){this.lo=e>>>0,this.hi=t>>>0}t.exports=i;var n=e(13),o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.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;i.fromHash=function(e){return e===a?o:new i((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)},i.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)},i.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},i.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},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},{13:13}],13:[function(e,t,r){function i(e,t,r){for(var i=Object.keys(t),n=0;n<i.length;++n)e[i[n]]!==undefined&&r||(e[i[n]]=t[i[n]]);return e}function n(e){function t(e,r){return this instanceof t?(Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),void(r&&i(this,r))):new t(e,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}var o=r;o.asPromise=e(1),o.base64=e(2),o.EventEmitter=e(3),o.inquire=e(4),o.utf8=e(6),o.pool=e(5),o.LongBits=e(12),o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isNode=Boolean(global.process&&global.process.versions&&global.process.versions.node),o.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},o.isString=function(e){return"string"==typeof e||e instanceof String},o.isObject=function(e){return e&&"object"==typeof e},o.Buffer=function(){try{var e=o.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),o._Buffer_from=null,o._Buffer_allocUnsafe=null,o.newBuffer=function(e){return"number"==typeof e?o.Buffer?o._Buffer_allocUnsafe(e):new o.Array(e):o.Buffer?o._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},o.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,o.Long=global.dcodeIO&&global.dcodeIO.Long||o.inquire("long"),o.key2Re=/^true|false|0|1$/,o.key32Re=/^-?(?:0|[1-9][0-9]*)$/,o.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,o.longToHash=function(e){return e?o.LongBits.from(e).toHash():o.LongBits.zeroHash},o.longFromHash=function(e,t){var r=o.LongBits.fromHash(e);return o.Long?o.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},o.merge=i,o.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},o.newError=n,o.ProtocolError=n("ProtocolError"),o.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&this[e[r]]!==undefined&&null!==this[e[r]])return e[r]}},o.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},o.lazyResolve=function(e,t){for(var r=0;r<t.length;++r)for(var i=Object.keys(t[r]),n=0;n<i.length;++n){for(var o=t[r][i[n]].split("."),a=e;o.length;)a=a[o.shift()];t[r][i[n]]=a}},o.toJSONOptions={longs:String,enums:String,bytes:String},o._configure=function(){var e=o.Buffer;return e?(o._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},void(o._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)})):void(o._Buffer_from=o._Buffer_allocUnsafe=null)}},{1:1,12:12,2:2,3:3,4:4,5:5,6:6}],14:[function(e,t,r){function i(e,t,r){this.fn=e,this.len=t,this.next=undefined,this.val=r}function n(){}function o(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function a(){this.len=0,this.head=new i(n,0,0),this.tail=this.head,this.states=null}function s(e,t,r){t[r]=255&e}function l(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e}function u(e,t){this.len=e,this.next=undefined,this.val=t}function c(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function d(e,t,r){t[r++]=255&e,t[r++]=e>>>8&255,t[r++]=e>>>16&255,t[r]=e>>>24}t.exports=a;var h,p=e(13),f=p.LongBits,m=p.base64,g=p.utf8;a.create=p.Buffer?function(){return(a.create=function(){return new h})()}:function(){return new a},a.alloc=function(e){return new p.Array(e)},p.Array!==Array&&(a.alloc=p.pool(a.alloc,p.Array.prototype.subarray)),a.prototype.push=function(e,t,r){return this.tail=this.tail.next=new i(e,t,r),this.len+=t,this},u.prototype=Object.create(i.prototype),u.prototype.fn=l,a.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new u((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},a.prototype.int32=function(e){return e<0?this.push(c,10,f.fromNumber(e)):this.uint32(e)},a.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},a.prototype.uint64=function(e){var t=f.from(e);return this.push(c,t.length(),t)},a.prototype.int64=a.prototype.uint64,a.prototype.sint64=function(e){var t=f.from(e).zzEncode();return this.push(c,t.length(),t)},a.prototype.bool=function(e){return this.push(s,1,e?1:0)},a.prototype.fixed32=function(e){return this.push(d,4,e>>>0)},a.prototype.sfixed32=a.prototype.fixed32,a.prototype.fixed64=function(e){var t=f.from(e);return this.push(d,4,t.lo).push(d,4,t.hi)},a.prototype.sfixed64=a.prototype.fixed64;var v="undefined"!=typeof Float32Array?function(){var e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[3]?function(r,i,n){e[0]=r,i[n++]=t[0],i[n++]=t[1],i[n++]=t[2],i[n]=t[3]}:function(r,i,n){e[0]=r,i[n++]=t[3],i[n++]=t[2],i[n++]=t[1],i[n]=t[0]}}():function(e,t,r){var i=e<0?1:0;if(i&&(e=-e),0===e)d(1/e>0?0:2147483648,t,r);else if(isNaN(e))d(2147483647,t,r);else if(e>3.4028234663852886e38)d((i<<31|2139095040)>>>0,t,r);else if(e<1.1754943508222875e-38)d((i<<31|Math.round(e/1.401298464324817e-45))>>>0,t,r);else{var n=Math.floor(Math.log(e)/Math.LN2),o=8388607&Math.round(e*Math.pow(2,-n)*8388608);d((i<<31|n+127<<23|o)>>>0,t,r)}};a.prototype.float=function(e){return this.push(v,4,e)};var _="undefined"!=typeof Float64Array?function(){var e=new Float64Array(1),t=new Uint8Array(e.buffer);return e[0]=-0,t[7]?function(r,i,n){e[0]=r,i[n++]=t[0],i[n++]=t[1],i[n++]=t[2],i[n++]=t[3],i[n++]=t[4],i[n++]=t[5],i[n++]=t[6],i[n]=t[7]}:function(r,i,n){e[0]=r,i[n++]=t[7],i[n++]=t[6],i[n++]=t[5],i[n++]=t[4],i[n++]=t[3],i[n++]=t[2],i[n++]=t[1],i[n]=t[0]}}():function(e,t,r){var i=e<0?1:0;if(i&&(e=-e),0===e)d(0,t,r),d(1/e>0?0:2147483648,t,r+4);else if(isNaN(e))d(4294967295,t,r),d(2147483647,t,r+4);else if(e>1.7976931348623157e308)d(0,t,r),d((i<<31|2146435072)>>>0,t,r+4);else{var n;if(e<2.2250738585072014e-308)n=e/5e-324,d(n>>>0,t,r),d((i<<31|n/4294967296)>>>0,t,r+4);else{var o=Math.floor(Math.log(e)/Math.LN2);1024===o&&(o=1023),n=e*Math.pow(2,-o),d(4503599627370496*n>>>0,t,r),d((i<<31|o+1023<<20|1048576*n&1048575)>>>0,t,r+4)}}};a.prototype.double=function(e){return this.push(_,8,e)};var y=p.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var i=0;i<e.length;++i)t[r+i]=e[i]};a.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this.push(s,1,0);if(p.isString(e)){var r=a.alloc(t=m.length(e));m.decode(e,r,0),e=r}return this.uint32(t).push(y,t,e)},a.prototype.string=function(e){var t=g.length(e);return t?this.uint32(t).push(g.write,t,e):this.push(s,1,0)},a.prototype.fork=function(){return this.states=new o(this),this.head=this.tail=new i(n,0,0),this.len=0,this},a.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 i(n,0,0),this.len=0),this},a.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},a.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},a._configure=function(e){h=e}},{13:13}],15:[function(e,t,r){function i(){o.call(this)}function n(e,t,r){e.length<40?a.utf8.write(e,t,r):t.utf8Write(e,r)}t.exports=i;var o=e(14);(i.prototype=Object.create(o.prototype)).constructor=i;var a=e(13),s=a.Buffer;i.alloc=function(e){return(i.alloc=a._Buffer_allocUnsafe)(e)};var l=s&&s.prototype instanceof Uint8Array&&"set"===s.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var i=0;i<e.length;)t[r++]=e[i++]};i.prototype.bytes=function(e){a.isString(e)&&(e=a._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this.push(l,t,e),this},i.prototype.string=function(e){var t=s.byteLength(e);return this.uint32(t),t&&this.push(n,t,e),this}},{13:13,14:14}]},{},[7])}("object"==typeof window&&window||"object"==typeof self&&self||this),define("ThirdParty/google-earth-dbroot-parser",["./protobuf-minimal"],function(e){"use strict";var t=e.Reader,r=(e.Writer,e.util),i=[],n=e.roots.default||(e.roots.default={});return n.keyhole=function(){var o={};return o.dbroot=function(){var o={};return o.StringEntryProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.stringId=0,i.prototype.stringValue="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.StringEntryProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.stringId=e.fixed32();break;case 2:o.stringValue=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isInteger(e.stringId)?r.isString(e.stringValue)?null:"stringValue: string expected":"stringId: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StringEntryProto)return e;var t=new n.keyhole.dbroot.StringEntryProto;return void 0!==e.stringId&&null!==e.stringId&&(t.stringId=e.stringId>>>0),void 0!==e.stringValue&&null!==e.stringValue&&(t.stringValue=String(e.stringValue)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.stringId=0,r.stringValue=""),void 0!==e.stringId&&null!==e.stringId&&e.hasOwnProperty("stringId")&&(r.stringId=e.stringId),void 0!==e.stringValue&&null!==e.stringValue&&e.hasOwnProperty("stringValue")&&(r.stringValue=e.stringValue),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.StringIdOrValueProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.stringId=0,i.prototype.value="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.StringIdOrValueProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.stringId=e.fixed32();break;case 2:o.value=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.stringId||r.isInteger(e.stringId)?void 0===e.value||r.isString(e.value)?null:"value: string expected":"stringId: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StringIdOrValueProto)return e;var t=new n.keyhole.dbroot.StringIdOrValueProto;return void 0!==e.stringId&&null!==e.stringId&&(t.stringId=e.stringId>>>0),void 0!==e.value&&null!==e.value&&(t.value=String(e.value)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.stringId=0,r.value=""),void 0!==e.stringId&&null!==e.stringId&&e.hasOwnProperty("stringId")&&(r.stringId=e.stringId),void 0!==e.value&&null!==e.value&&e.hasOwnProperty("value")&&(r.value=e.value),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.PlanetModelProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.radius=6378.137,i.prototype.flattening=.00335281066474748,i.prototype.elevationBias=0,i.prototype.negativeAltitudeExponentBias=0,i.prototype.compressedNegativeAltitudeThreshold=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.PlanetModelProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.radius=e.double();break;case 2:o.flattening=e.double();break;case 4:o.elevationBias=e.double();break;case 5:o.negativeAltitudeExponentBias=e.int32();break;case 6:o.compressedNegativeAltitudeThreshold=e.double();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.radius&&"number"!=typeof e.radius?"radius: number expected":void 0!==e.flattening&&"number"!=typeof e.flattening?"flattening: number expected":void 0!==e.elevationBias&&"number"!=typeof e.elevationBias?"elevationBias: number expected":void 0===e.negativeAltitudeExponentBias||r.isInteger(e.negativeAltitudeExponentBias)?void 0!==e.compressedNegativeAltitudeThreshold&&"number"!=typeof e.compressedNegativeAltitudeThreshold?"compressedNegativeAltitudeThreshold: number expected":null:"negativeAltitudeExponentBias: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PlanetModelProto)return e;var t=new n.keyhole.dbroot.PlanetModelProto;return void 0!==e.radius&&null!==e.radius&&(t.radius=Number(e.radius)),void 0!==e.flattening&&null!==e.flattening&&(t.flattening=Number(e.flattening)),void 0!==e.elevationBias&&null!==e.elevationBias&&(t.elevationBias=Number(e.elevationBias)),void 0!==e.negativeAltitudeExponentBias&&null!==e.negativeAltitudeExponentBias&&(t.negativeAltitudeExponentBias=0|e.negativeAltitudeExponentBias),void 0!==e.compressedNegativeAltitudeThreshold&&null!==e.compressedNegativeAltitudeThreshold&&(t.compressedNegativeAltitudeThreshold=Number(e.compressedNegativeAltitudeThreshold)), +t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.radius=6378.137,r.flattening=.00335281066474748,r.elevationBias=0,r.negativeAltitudeExponentBias=0,r.compressedNegativeAltitudeThreshold=0),void 0!==e.radius&&null!==e.radius&&e.hasOwnProperty("radius")&&(r.radius=e.radius),void 0!==e.flattening&&null!==e.flattening&&e.hasOwnProperty("flattening")&&(r.flattening=e.flattening),void 0!==e.elevationBias&&null!==e.elevationBias&&e.hasOwnProperty("elevationBias")&&(r.elevationBias=e.elevationBias),void 0!==e.negativeAltitudeExponentBias&&null!==e.negativeAltitudeExponentBias&&e.hasOwnProperty("negativeAltitudeExponentBias")&&(r.negativeAltitudeExponentBias=e.negativeAltitudeExponentBias),void 0!==e.compressedNegativeAltitudeThreshold&&null!==e.compressedNegativeAltitudeThreshold&&e.hasOwnProperty("compressedNegativeAltitudeThreshold")&&(r.compressedNegativeAltitudeThreshold=e.compressedNegativeAltitudeThreshold),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.ProviderInfoProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.providerId=0,o.prototype.copyrightString=null,o.prototype.verticalPixelOffset=-1;var a={1:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ProviderInfoProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.providerId=e.int32();break;case 2:o.copyrightString=a[1].decode(e,e.uint32());break;case 3:o.verticalPixelOffset=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isInteger(e.providerId))return"providerId: integer expected";if(void 0!==e.copyrightString&&null!==e.copyrightString){var t=a[1].verify(e.copyrightString);if(t)return"copyrightString."+t}return void 0===e.verticalPixelOffset||r.isInteger(e.verticalPixelOffset)?null:"verticalPixelOffset: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ProviderInfoProto)return e;var t=new n.keyhole.dbroot.ProviderInfoProto;if(void 0!==e.providerId&&null!==e.providerId&&(t.providerId=0|e.providerId),void 0!==e.copyrightString&&null!==e.copyrightString){if("object"!=typeof e.copyrightString)throw TypeError(".keyhole.dbroot.ProviderInfoProto.copyrightString: object expected");t.copyrightString=a[1].fromObject(e.copyrightString)}return void 0!==e.verticalPixelOffset&&null!==e.verticalPixelOffset&&(t.verticalPixelOffset=0|e.verticalPixelOffset),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.providerId=0,r.copyrightString=null,r.verticalPixelOffset=-1),void 0!==e.providerId&&null!==e.providerId&&e.hasOwnProperty("providerId")&&(r.providerId=e.providerId),void 0!==e.copyrightString&&null!==e.copyrightString&&e.hasOwnProperty("copyrightString")&&(r.copyrightString=a[1].toObject(e.copyrightString,t)),void 0!==e.verticalPixelOffset&&null!==e.verticalPixelOffset&&e.hasOwnProperty("verticalPixelOffset")&&(r.verticalPixelOffset=e.verticalPixelOffset),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.PopUpProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.isBalloonStyle=!1,o.prototype.text=null,o.prototype.backgroundColorAbgr=4294967295,o.prototype.textColorAbgr=4278190080;var a={1:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.PopUpProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.isBalloonStyle=e.bool();break;case 2:o.text=a[1].decode(e,e.uint32());break;case 3:o.backgroundColorAbgr=e.fixed32();break;case 4:o.textColorAbgr=e.fixed32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.isBalloonStyle&&"boolean"!=typeof e.isBalloonStyle)return"isBalloonStyle: boolean expected";if(void 0!==e.text&&null!==e.text){var t=a[1].verify(e.text);if(t)return"text."+t}return void 0===e.backgroundColorAbgr||r.isInteger(e.backgroundColorAbgr)?void 0===e.textColorAbgr||r.isInteger(e.textColorAbgr)?null:"textColorAbgr: integer expected":"backgroundColorAbgr: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PopUpProto)return e;var t=new n.keyhole.dbroot.PopUpProto;if(void 0!==e.isBalloonStyle&&null!==e.isBalloonStyle&&(t.isBalloonStyle=Boolean(e.isBalloonStyle)),void 0!==e.text&&null!==e.text){if("object"!=typeof e.text)throw TypeError(".keyhole.dbroot.PopUpProto.text: object expected");t.text=a[1].fromObject(e.text)}return void 0!==e.backgroundColorAbgr&&null!==e.backgroundColorAbgr&&(t.backgroundColorAbgr=e.backgroundColorAbgr>>>0),void 0!==e.textColorAbgr&&null!==e.textColorAbgr&&(t.textColorAbgr=e.textColorAbgr>>>0),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.isBalloonStyle=!1,r.text=null,r.backgroundColorAbgr=4294967295,r.textColorAbgr=4278190080),void 0!==e.isBalloonStyle&&null!==e.isBalloonStyle&&e.hasOwnProperty("isBalloonStyle")&&(r.isBalloonStyle=e.isBalloonStyle),void 0!==e.text&&null!==e.text&&e.hasOwnProperty("text")&&(r.text=a[1].toObject(e.text,t)),void 0!==e.backgroundColorAbgr&&null!==e.backgroundColorAbgr&&e.hasOwnProperty("backgroundColorAbgr")&&(r.backgroundColorAbgr=e.backgroundColorAbgr),void 0!==e.textColorAbgr&&null!==e.textColorAbgr&&e.hasOwnProperty("textColorAbgr")&&(r.textColorAbgr=e.textColorAbgr),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.StyleAttributeProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.styleId="",o.prototype.providerId=0,o.prototype.polyColorAbgr=4294967295,o.prototype.lineColorAbgr=4294967295,o.prototype.lineWidth=1,o.prototype.labelColorAbgr=4294967295,o.prototype.labelScale=1,o.prototype.placemarkIconColorAbgr=4294967295,o.prototype.placemarkIconScale=1,o.prototype.placemarkIconPath=null,o.prototype.placemarkIconX=0,o.prototype.placemarkIconY=0,o.prototype.placemarkIconWidth=32,o.prototype.placemarkIconHeight=32,o.prototype.popUp=null,o.prototype.drawFlag=r.emptyArray;var a={9:"keyhole.dbroot.StringIdOrValueProto",14:"keyhole.dbroot.PopUpProto",15:"keyhole.dbroot.DrawFlagProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.StyleAttributeProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.styleId=e.string();break;case 3:o.providerId=e.int32();break;case 4:o.polyColorAbgr=e.fixed32();break;case 5:o.lineColorAbgr=e.fixed32();break;case 6:o.lineWidth=e.float();break;case 7:o.labelColorAbgr=e.fixed32();break;case 8:o.labelScale=e.float();break;case 9:o.placemarkIconColorAbgr=e.fixed32();break;case 10:o.placemarkIconScale=e.float();break;case 11:o.placemarkIconPath=a[9].decode(e,e.uint32());break;case 12:o.placemarkIconX=e.int32();break;case 13:o.placemarkIconY=e.int32();break;case 14:o.placemarkIconWidth=e.int32();break;case 15:o.placemarkIconHeight=e.int32();break;case 16:o.popUp=a[14].decode(e,e.uint32());break;case 17:o.drawFlag&&o.drawFlag.length||(o.drawFlag=[]),o.drawFlag.push(a[15].decode(e,e.uint32()));break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.styleId))return"styleId: string expected";if(void 0!==e.providerId&&!r.isInteger(e.providerId))return"providerId: integer expected";if(void 0!==e.polyColorAbgr&&!r.isInteger(e.polyColorAbgr))return"polyColorAbgr: integer expected";if(void 0!==e.lineColorAbgr&&!r.isInteger(e.lineColorAbgr))return"lineColorAbgr: integer expected";if(void 0!==e.lineWidth&&"number"!=typeof e.lineWidth)return"lineWidth: number expected";if(void 0!==e.labelColorAbgr&&!r.isInteger(e.labelColorAbgr))return"labelColorAbgr: integer expected";if(void 0!==e.labelScale&&"number"!=typeof e.labelScale)return"labelScale: number expected";if(void 0!==e.placemarkIconColorAbgr&&!r.isInteger(e.placemarkIconColorAbgr))return"placemarkIconColorAbgr: integer expected";if(void 0!==e.placemarkIconScale&&"number"!=typeof e.placemarkIconScale)return"placemarkIconScale: number expected";if(void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath){var t=a[9].verify(e.placemarkIconPath);if(t)return"placemarkIconPath."+t}if(void 0!==e.placemarkIconX&&!r.isInteger(e.placemarkIconX))return"placemarkIconX: integer expected";if(void 0!==e.placemarkIconY&&!r.isInteger(e.placemarkIconY))return"placemarkIconY: integer expected";if(void 0!==e.placemarkIconWidth&&!r.isInteger(e.placemarkIconWidth))return"placemarkIconWidth: integer expected";if(void 0!==e.placemarkIconHeight&&!r.isInteger(e.placemarkIconHeight))return"placemarkIconHeight: integer expected";if(void 0!==e.popUp&&null!==e.popUp){var t=a[14].verify(e.popUp);if(t)return"popUp."+t}if(void 0!==e.drawFlag){if(!Array.isArray(e.drawFlag))return"drawFlag: array expected";for(var i=0;i<e.drawFlag.length;++i){var t=a[15].verify(e.drawFlag[i]);if(t)return"drawFlag."+t}}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StyleAttributeProto)return e;var t=new n.keyhole.dbroot.StyleAttributeProto;if(void 0!==e.styleId&&null!==e.styleId&&(t.styleId=String(e.styleId)),void 0!==e.providerId&&null!==e.providerId&&(t.providerId=0|e.providerId),void 0!==e.polyColorAbgr&&null!==e.polyColorAbgr&&(t.polyColorAbgr=e.polyColorAbgr>>>0),void 0!==e.lineColorAbgr&&null!==e.lineColorAbgr&&(t.lineColorAbgr=e.lineColorAbgr>>>0),void 0!==e.lineWidth&&null!==e.lineWidth&&(t.lineWidth=Number(e.lineWidth)),void 0!==e.labelColorAbgr&&null!==e.labelColorAbgr&&(t.labelColorAbgr=e.labelColorAbgr>>>0),void 0!==e.labelScale&&null!==e.labelScale&&(t.labelScale=Number(e.labelScale)),void 0!==e.placemarkIconColorAbgr&&null!==e.placemarkIconColorAbgr&&(t.placemarkIconColorAbgr=e.placemarkIconColorAbgr>>>0),void 0!==e.placemarkIconScale&&null!==e.placemarkIconScale&&(t.placemarkIconScale=Number(e.placemarkIconScale)),void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath){if("object"!=typeof e.placemarkIconPath)throw TypeError(".keyhole.dbroot.StyleAttributeProto.placemarkIconPath: object expected");t.placemarkIconPath=a[9].fromObject(e.placemarkIconPath)}if(void 0!==e.placemarkIconX&&null!==e.placemarkIconX&&(t.placemarkIconX=0|e.placemarkIconX),void 0!==e.placemarkIconY&&null!==e.placemarkIconY&&(t.placemarkIconY=0|e.placemarkIconY),void 0!==e.placemarkIconWidth&&null!==e.placemarkIconWidth&&(t.placemarkIconWidth=0|e.placemarkIconWidth),void 0!==e.placemarkIconHeight&&null!==e.placemarkIconHeight&&(t.placemarkIconHeight=0|e.placemarkIconHeight),void 0!==e.popUp&&null!==e.popUp){if("object"!=typeof e.popUp)throw TypeError(".keyhole.dbroot.StyleAttributeProto.popUp: object expected");t.popUp=a[14].fromObject(e.popUp)}if(e.drawFlag){if(!Array.isArray(e.drawFlag))throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: array expected");t.drawFlag=[];for(var r=0;r<e.drawFlag.length;++r){if("object"!=typeof e.drawFlag[r])throw TypeError(".keyhole.dbroot.StyleAttributeProto.drawFlag: object expected");t.drawFlag[r]=a[15].fromObject(e.drawFlag[r])}}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.drawFlag=[]),t.defaults&&(r.styleId="",r.providerId=0,r.polyColorAbgr=4294967295,r.lineColorAbgr=4294967295,r.lineWidth=1,r.labelColorAbgr=4294967295,r.labelScale=1,r.placemarkIconColorAbgr=4294967295,r.placemarkIconScale=1,r.placemarkIconPath=null,r.placemarkIconX=0,r.placemarkIconY=0,r.placemarkIconWidth=32,r.placemarkIconHeight=32,r.popUp=null),void 0!==e.styleId&&null!==e.styleId&&e.hasOwnProperty("styleId")&&(r.styleId=e.styleId),void 0!==e.providerId&&null!==e.providerId&&e.hasOwnProperty("providerId")&&(r.providerId=e.providerId),void 0!==e.polyColorAbgr&&null!==e.polyColorAbgr&&e.hasOwnProperty("polyColorAbgr")&&(r.polyColorAbgr=e.polyColorAbgr),void 0!==e.lineColorAbgr&&null!==e.lineColorAbgr&&e.hasOwnProperty("lineColorAbgr")&&(r.lineColorAbgr=e.lineColorAbgr),void 0!==e.lineWidth&&null!==e.lineWidth&&e.hasOwnProperty("lineWidth")&&(r.lineWidth=e.lineWidth),void 0!==e.labelColorAbgr&&null!==e.labelColorAbgr&&e.hasOwnProperty("labelColorAbgr")&&(r.labelColorAbgr=e.labelColorAbgr),void 0!==e.labelScale&&null!==e.labelScale&&e.hasOwnProperty("labelScale")&&(r.labelScale=e.labelScale),void 0!==e.placemarkIconColorAbgr&&null!==e.placemarkIconColorAbgr&&e.hasOwnProperty("placemarkIconColorAbgr")&&(r.placemarkIconColorAbgr=e.placemarkIconColorAbgr),void 0!==e.placemarkIconScale&&null!==e.placemarkIconScale&&e.hasOwnProperty("placemarkIconScale")&&(r.placemarkIconScale=e.placemarkIconScale),void 0!==e.placemarkIconPath&&null!==e.placemarkIconPath&&e.hasOwnProperty("placemarkIconPath")&&(r.placemarkIconPath=a[9].toObject(e.placemarkIconPath,t)),void 0!==e.placemarkIconX&&null!==e.placemarkIconX&&e.hasOwnProperty("placemarkIconX")&&(r.placemarkIconX=e.placemarkIconX),void 0!==e.placemarkIconY&&null!==e.placemarkIconY&&e.hasOwnProperty("placemarkIconY")&&(r.placemarkIconY=e.placemarkIconY),void 0!==e.placemarkIconWidth&&null!==e.placemarkIconWidth&&e.hasOwnProperty("placemarkIconWidth")&&(r.placemarkIconWidth=e.placemarkIconWidth),void 0!==e.placemarkIconHeight&&null!==e.placemarkIconHeight&&e.hasOwnProperty("placemarkIconHeight")&&(r.placemarkIconHeight=e.placemarkIconHeight),void 0!==e.popUp&&null!==e.popUp&&e.hasOwnProperty("popUp")&&(r.popUp=a[14].toObject(e.popUp,t)),void 0!==e.drawFlag&&null!==e.drawFlag&&e.hasOwnProperty("drawFlag")){r.drawFlag=[];for(var i=0;i<e.drawFlag.length;++i)r.drawFlag[i]=a[15].toObject(e.drawFlag[i],t)}return r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.StyleMapProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.styleMapId=0,i.prototype.channelId=r.emptyArray,i.prototype.normalStyleAttribute=0,i.prototype.highlightStyleAttribute=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.StyleMapProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.styleMapId=e.int32();break;case 2:if(o.channelId&&o.channelId.length||(o.channelId=[]),2===(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)o.channelId.push(e.int32());else o.channelId.push(e.int32());break;case 3:o.normalStyleAttribute=e.int32();break;case 4:o.highlightStyleAttribute=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isInteger(e.styleMapId))return"styleMapId: integer expected";if(void 0!==e.channelId){if(!Array.isArray(e.channelId))return"channelId: array expected";for(var t=0;t<e.channelId.length;++t)if(!r.isInteger(e.channelId[t]))return"channelId: integer[] expected"}return void 0===e.normalStyleAttribute||r.isInteger(e.normalStyleAttribute)?void 0===e.highlightStyleAttribute||r.isInteger(e.highlightStyleAttribute)?null:"highlightStyleAttribute: integer expected":"normalStyleAttribute: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.StyleMapProto)return e;var t=new n.keyhole.dbroot.StyleMapProto;if(void 0!==e.styleMapId&&null!==e.styleMapId&&(t.styleMapId=0|e.styleMapId),e.channelId){if(!Array.isArray(e.channelId))throw TypeError(".keyhole.dbroot.StyleMapProto.channelId: array expected");t.channelId=[];for(var r=0;r<e.channelId.length;++r)t.channelId[r]=0|e.channelId[r]}return void 0!==e.normalStyleAttribute&&null!==e.normalStyleAttribute&&(t.normalStyleAttribute=0|e.normalStyleAttribute),void 0!==e.highlightStyleAttribute&&null!==e.highlightStyleAttribute&&(t.highlightStyleAttribute=0|e.highlightStyleAttribute),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.channelId=[]),t.defaults&&(r.styleMapId=0,r.normalStyleAttribute=0,r.highlightStyleAttribute=0),void 0!==e.styleMapId&&null!==e.styleMapId&&e.hasOwnProperty("styleMapId")&&(r.styleMapId=e.styleMapId),void 0!==e.channelId&&null!==e.channelId&&e.hasOwnProperty("channelId")){r.channelId=[];for(var i=0;i<e.channelId.length;++i)r.channelId[i]=e.channelId[i]}return void 0!==e.normalStyleAttribute&&null!==e.normalStyleAttribute&&e.hasOwnProperty("normalStyleAttribute")&&(r.normalStyleAttribute=e.normalStyleAttribute),void 0!==e.highlightStyleAttribute&&null!==e.highlightStyleAttribute&&e.hasOwnProperty("highlightStyleAttribute")&&(r.highlightStyleAttribute=e.highlightStyleAttribute),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.ZoomRangeProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.minZoom=0,i.prototype.maxZoom=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ZoomRangeProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.minZoom=e.int32();break;case 2:o.maxZoom=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isInteger(e.minZoom)?r.isInteger(e.maxZoom)?null:"maxZoom: integer expected":"minZoom: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ZoomRangeProto)return e;var t=new n.keyhole.dbroot.ZoomRangeProto;return void 0!==e.minZoom&&null!==e.minZoom&&(t.minZoom=0|e.minZoom),void 0!==e.maxZoom&&null!==e.maxZoom&&(t.maxZoom=0|e.maxZoom),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.minZoom=0,r.maxZoom=0),void 0!==e.minZoom&&null!==e.minZoom&&e.hasOwnProperty("minZoom")&&(r.minZoom=e.minZoom),void 0!==e.maxZoom&&null!==e.maxZoom&&e.hasOwnProperty("maxZoom")&&(r.maxZoom=e.maxZoom),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.DrawFlagProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.drawFlagType=1;var o={0:"keyhole.dbroot.DrawFlagProto.DrawFlagType"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DrawFlagProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.drawFlagType=e.uint32();break;default:e.skipType(7&a)}}return o},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";switch(e.drawFlagType){default:return"drawFlagType: enum value expected";case 1:case 2:case 3:case 4:case 5:}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DrawFlagProto)return e;var t=new n.keyhole.dbroot.DrawFlagProto;switch(e.drawFlagType){case"TYPE_FILL_ONLY":case 1:t.drawFlagType=1;break;case"TYPE_OUTLINE_ONLY":case 2:t.drawFlagType=2;break;case"TYPE_FILL_AND_OUTLINE":case 3:t.drawFlagType=3;break;case"TYPE_ANTIALIASING":case 4:t.drawFlagType=4;break;case"TYPE_CENTER_LABEL":case 5:t.drawFlagType=5}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.drawFlagType=t.enums===String?"TYPE_FILL_ONLY":1),void 0!==e.drawFlagType&&null!==e.drawFlagType&&e.hasOwnProperty("drawFlagType")&&(r.drawFlagType=t.enums===String?o[0][e.drawFlagType]:e.drawFlagType),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r.DrawFlagType=function(){var e={},t=Object.create(e);return t.TYPE_FILL_ONLY=1,t.TYPE_OUTLINE_ONLY=2,t.TYPE_FILL_AND_OUTLINE=3,t.TYPE_ANTIALIASING=4,t.TYPE_CENTER_LABEL=5,t}(),r}(),o.LayerProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.zoomRange=r.emptyArray,o.prototype.preserveTextLevel=30,o.prototype.lodBeginTransition=!1,o.prototype.lodEndTransition=!1;var a={0:"keyhole.dbroot.ZoomRangeProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.LayerProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.zoomRange&&o.zoomRange.length||(o.zoomRange=[]),o.zoomRange.push(a[0].decode(e,e.uint32()));break;case 2:o.preserveTextLevel=e.int32();break;case 4:o.lodBeginTransition=e.bool();break;case 5:o.lodEndTransition=e.bool();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.zoomRange){if(!Array.isArray(e.zoomRange))return"zoomRange: array expected";for(var t=0;t<e.zoomRange.length;++t){var i=a[0].verify(e.zoomRange[t]);if(i)return"zoomRange."+i}}return void 0===e.preserveTextLevel||r.isInteger(e.preserveTextLevel)?void 0!==e.lodBeginTransition&&"boolean"!=typeof e.lodBeginTransition?"lodBeginTransition: boolean expected":void 0!==e.lodEndTransition&&"boolean"!=typeof e.lodEndTransition?"lodEndTransition: boolean expected":null:"preserveTextLevel: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.LayerProto)return e;var t=new n.keyhole.dbroot.LayerProto;if(e.zoomRange){if(!Array.isArray(e.zoomRange))throw TypeError(".keyhole.dbroot.LayerProto.zoomRange: array expected");t.zoomRange=[];for(var r=0;r<e.zoomRange.length;++r){if("object"!=typeof e.zoomRange[r])throw TypeError(".keyhole.dbroot.LayerProto.zoomRange: object expected");t.zoomRange[r]=a[0].fromObject(e.zoomRange[r])}}return void 0!==e.preserveTextLevel&&null!==e.preserveTextLevel&&(t.preserveTextLevel=0|e.preserveTextLevel),void 0!==e.lodBeginTransition&&null!==e.lodBeginTransition&&(t.lodBeginTransition=Boolean(e.lodBeginTransition)),void 0!==e.lodEndTransition&&null!==e.lodEndTransition&&(t.lodEndTransition=Boolean(e.lodEndTransition)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.zoomRange=[]),t.defaults&&(r.preserveTextLevel=30,r.lodBeginTransition=!1,r.lodEndTransition=!1),void 0!==e.zoomRange&&null!==e.zoomRange&&e.hasOwnProperty("zoomRange")){r.zoomRange=[];for(var i=0;i<e.zoomRange.length;++i)r.zoomRange[i]=a[0].toObject(e.zoomRange[i],t)}return void 0!==e.preserveTextLevel&&null!==e.preserveTextLevel&&e.hasOwnProperty("preserveTextLevel")&&(r.preserveTextLevel=e.preserveTextLevel),void 0!==e.lodBeginTransition&&null!==e.lodBeginTransition&&e.hasOwnProperty("lodBeginTransition")&&(r.lodBeginTransition=e.lodBeginTransition),void 0!==e.lodEndTransition&&null!==e.lodEndTransition&&e.hasOwnProperty("lodEndTransition")&&(r.lodEndTransition=e.lodEndTransition),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.FolderProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return r.prototype.isExpandable=!0,r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.FolderProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.isExpandable=e.bool();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.isExpandable&&"boolean"!=typeof e.isExpandable?"isExpandable: boolean expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.FolderProto)return e;var t=new n.keyhole.dbroot.FolderProto;return void 0!==e.isExpandable&&null!==e.isExpandable&&(t.isExpandable=Boolean(e.isExpandable)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.isExpandable=!0),void 0!==e.isExpandable&&null!==e.isExpandable&&e.hasOwnProperty("isExpandable")&&(r.isExpandable=e.isExpandable),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.RequirementProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.requiredVram="",i.prototype.requiredClientVer="",i.prototype.probability="",i.prototype.requiredUserAgent="",i.prototype.requiredClientCapabilities="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.RequirementProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 3:o.requiredVram=e.string();break;case 4:o.requiredClientVer=e.string();break;case 5:o.probability=e.string();break;case 6:o.requiredUserAgent=e.string();break;case 7:o.requiredClientCapabilities=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.requiredVram||r.isString(e.requiredVram)?void 0===e.requiredClientVer||r.isString(e.requiredClientVer)?void 0===e.probability||r.isString(e.probability)?void 0===e.requiredUserAgent||r.isString(e.requiredUserAgent)?void 0===e.requiredClientCapabilities||r.isString(e.requiredClientCapabilities)?null:"requiredClientCapabilities: string expected":"requiredUserAgent: string expected":"probability: string expected":"requiredClientVer: string expected":"requiredVram: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.RequirementProto)return e;var t=new n.keyhole.dbroot.RequirementProto;return void 0!==e.requiredVram&&null!==e.requiredVram&&(t.requiredVram=String(e.requiredVram)),void 0!==e.requiredClientVer&&null!==e.requiredClientVer&&(t.requiredClientVer=String(e.requiredClientVer)),void 0!==e.probability&&null!==e.probability&&(t.probability=String(e.probability)),void 0!==e.requiredUserAgent&&null!==e.requiredUserAgent&&(t.requiredUserAgent=String(e.requiredUserAgent)),void 0!==e.requiredClientCapabilities&&null!==e.requiredClientCapabilities&&(t.requiredClientCapabilities=String(e.requiredClientCapabilities)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.requiredVram="",r.requiredClientVer="",r.probability="",r.requiredUserAgent="",r.requiredClientCapabilities=""),void 0!==e.requiredVram&&null!==e.requiredVram&&e.hasOwnProperty("requiredVram")&&(r.requiredVram=e.requiredVram),void 0!==e.requiredClientVer&&null!==e.requiredClientVer&&e.hasOwnProperty("requiredClientVer")&&(r.requiredClientVer=e.requiredClientVer),void 0!==e.probability&&null!==e.probability&&e.hasOwnProperty("probability")&&(r.probability=e.probability),void 0!==e.requiredUserAgent&&null!==e.requiredUserAgent&&e.hasOwnProperty("requiredUserAgent")&&(r.requiredUserAgent=e.requiredUserAgent),void 0!==e.requiredClientCapabilities&&null!==e.requiredClientCapabilities&&e.hasOwnProperty("requiredClientCapabilities")&&(r.requiredClientCapabilities=e.requiredClientCapabilities),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.LookAtProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return r.prototype.longitude=0,r.prototype.latitude=0,r.prototype.range=0,r.prototype.tilt=0,r.prototype.heading=0,r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.LookAtProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.longitude=e.float();break;case 2:o.latitude=e.float();break;case 3:o.range=e.float();break;case 4:o.tilt=e.float();break;case 5:o.heading=e.float();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":"number"!=typeof e.longitude?"longitude: number expected":"number"!=typeof e.latitude?"latitude: number expected":void 0!==e.range&&"number"!=typeof e.range?"range: number expected":void 0!==e.tilt&&"number"!=typeof e.tilt?"tilt: number expected":void 0!==e.heading&&"number"!=typeof e.heading?"heading: number expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.LookAtProto)return e;var t=new n.keyhole.dbroot.LookAtProto;return void 0!==e.longitude&&null!==e.longitude&&(t.longitude=Number(e.longitude)),void 0!==e.latitude&&null!==e.latitude&&(t.latitude=Number(e.latitude)),void 0!==e.range&&null!==e.range&&(t.range=Number(e.range)),void 0!==e.tilt&&null!==e.tilt&&(t.tilt=Number(e.tilt)),void 0!==e.heading&&null!==e.heading&&(t.heading=Number(e.heading)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.longitude=0,r.latitude=0,r.range=0,r.tilt=0,r.heading=0),void 0!==e.longitude&&null!==e.longitude&&e.hasOwnProperty("longitude")&&(r.longitude=e.longitude),void 0!==e.latitude&&null!==e.latitude&&e.hasOwnProperty("latitude")&&(r.latitude=e.latitude),void 0!==e.range&&null!==e.range&&e.hasOwnProperty("range")&&(r.range=e.range),void 0!==e.tilt&&null!==e.tilt&&e.hasOwnProperty("tilt")&&(r.tilt=e.tilt),void 0!==e.heading&&null!==e.heading&&e.hasOwnProperty("heading")&&(r.heading=e.heading),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.NestedFeatureProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.featureType=1,o.prototype.kmlUrl=null,o.prototype.databaseUrl="",o.prototype.layer=null,o.prototype.folder=null,o.prototype.requirement=null,o.prototype.channelId=0,o.prototype.displayName=null,o.prototype.isVisible=!0,o.prototype.isEnabled=!0,o.prototype.isChecked=!1,o.prototype.layerMenuIconPath="icons/773_l.png",o.prototype.description=null,o.prototype.lookAt=null,o.prototype.assetUuid="",o.prototype.isSaveLocked=!0,o.prototype.children=r.emptyArray,o.prototype.clientConfigScriptName="",o.prototype.dioramaDataChannelBase=-1,o.prototype.replicaDataChannelBase=-1;var a={0:"keyhole.dbroot.NestedFeatureProto.FeatureType",1:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.LayerProto",4:"keyhole.dbroot.FolderProto",5:"keyhole.dbroot.RequirementProto",7:"keyhole.dbroot.StringIdOrValueProto",12:"keyhole.dbroot.StringIdOrValueProto",13:"keyhole.dbroot.LookAtProto",16:"keyhole.dbroot.NestedFeatureProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.NestedFeatureProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.featureType=e.uint32();break;case 2:o.kmlUrl=a[1].decode(e,e.uint32());break;case 21:o.databaseUrl=e.string();break;case 3:o.layer=a[3].decode(e,e.uint32());break;case 4:o.folder=a[4].decode(e,e.uint32());break;case 5:o.requirement=a[5].decode(e,e.uint32());break;case 6:o.channelId=e.int32();break;case 7:o.displayName=a[7].decode(e,e.uint32());break;case 8:o.isVisible=e.bool();break;case 9:o.isEnabled=e.bool();break;case 10:o.isChecked=e.bool();break;case 11:o.layerMenuIconPath=e.string();break;case 12:o.description=a[12].decode(e,e.uint32());break;case 13:o.lookAt=a[13].decode(e,e.uint32());break;case 15:o.assetUuid=e.string();break;case 16:o.isSaveLocked=e.bool();break;case 17:o.children&&o.children.length||(o.children=[]),o.children.push(a[16].decode(e,e.uint32()));break;case 18:o.clientConfigScriptName=e.string();break;case 19:o.dioramaDataChannelBase=e.int32();break;case 20:o.replicaDataChannelBase=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.featureType)switch(e.featureType){default:return"featureType: enum value expected"; +case 1:case 2:case 3:case 4:}if(void 0!==e.kmlUrl&&null!==e.kmlUrl){var t=a[1].verify(e.kmlUrl);if(t)return"kmlUrl."+t}if(void 0!==e.databaseUrl&&!r.isString(e.databaseUrl))return"databaseUrl: string expected";if(void 0!==e.layer&&null!==e.layer){var t=a[3].verify(e.layer);if(t)return"layer."+t}if(void 0!==e.folder&&null!==e.folder){var t=a[4].verify(e.folder);if(t)return"folder."+t}if(void 0!==e.requirement&&null!==e.requirement){var t=a[5].verify(e.requirement);if(t)return"requirement."+t}if(!r.isInteger(e.channelId))return"channelId: integer expected";if(void 0!==e.displayName&&null!==e.displayName){var t=a[7].verify(e.displayName);if(t)return"displayName."+t}if(void 0!==e.isVisible&&"boolean"!=typeof e.isVisible)return"isVisible: boolean expected";if(void 0!==e.isEnabled&&"boolean"!=typeof e.isEnabled)return"isEnabled: boolean expected";if(void 0!==e.isChecked&&"boolean"!=typeof e.isChecked)return"isChecked: boolean expected";if(void 0!==e.layerMenuIconPath&&!r.isString(e.layerMenuIconPath))return"layerMenuIconPath: string expected";if(void 0!==e.description&&null!==e.description){var t=a[12].verify(e.description);if(t)return"description."+t}if(void 0!==e.lookAt&&null!==e.lookAt){var t=a[13].verify(e.lookAt);if(t)return"lookAt."+t}if(void 0!==e.assetUuid&&!r.isString(e.assetUuid))return"assetUuid: string expected";if(void 0!==e.isSaveLocked&&"boolean"!=typeof e.isSaveLocked)return"isSaveLocked: boolean expected";if(void 0!==e.children){if(!Array.isArray(e.children))return"children: array expected";for(var i=0;i<e.children.length;++i){var t=a[16].verify(e.children[i]);if(t)return"children."+t}}return void 0===e.clientConfigScriptName||r.isString(e.clientConfigScriptName)?void 0===e.dioramaDataChannelBase||r.isInteger(e.dioramaDataChannelBase)?void 0===e.replicaDataChannelBase||r.isInteger(e.replicaDataChannelBase)?null:"replicaDataChannelBase: integer expected":"dioramaDataChannelBase: integer expected":"clientConfigScriptName: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.NestedFeatureProto)return e;var t=new n.keyhole.dbroot.NestedFeatureProto;switch(e.featureType){case"TYPE_POINT_Z":case 1:t.featureType=1;break;case"TYPE_POLYGON_Z":case 2:t.featureType=2;break;case"TYPE_LINE_Z":case 3:t.featureType=3;break;case"TYPE_TERRAIN":case 4:t.featureType=4}if(void 0!==e.kmlUrl&&null!==e.kmlUrl){if("object"!=typeof e.kmlUrl)throw TypeError(".keyhole.dbroot.NestedFeatureProto.kmlUrl: object expected");t.kmlUrl=a[1].fromObject(e.kmlUrl)}if(void 0!==e.databaseUrl&&null!==e.databaseUrl&&(t.databaseUrl=String(e.databaseUrl)),void 0!==e.layer&&null!==e.layer){if("object"!=typeof e.layer)throw TypeError(".keyhole.dbroot.NestedFeatureProto.layer: object expected");t.layer=a[3].fromObject(e.layer)}if(void 0!==e.folder&&null!==e.folder){if("object"!=typeof e.folder)throw TypeError(".keyhole.dbroot.NestedFeatureProto.folder: object expected");t.folder=a[4].fromObject(e.folder)}if(void 0!==e.requirement&&null!==e.requirement){if("object"!=typeof e.requirement)throw TypeError(".keyhole.dbroot.NestedFeatureProto.requirement: object expected");t.requirement=a[5].fromObject(e.requirement)}if(void 0!==e.channelId&&null!==e.channelId&&(t.channelId=0|e.channelId),void 0!==e.displayName&&null!==e.displayName){if("object"!=typeof e.displayName)throw TypeError(".keyhole.dbroot.NestedFeatureProto.displayName: object expected");t.displayName=a[7].fromObject(e.displayName)}if(void 0!==e.isVisible&&null!==e.isVisible&&(t.isVisible=Boolean(e.isVisible)),void 0!==e.isEnabled&&null!==e.isEnabled&&(t.isEnabled=Boolean(e.isEnabled)),void 0!==e.isChecked&&null!==e.isChecked&&(t.isChecked=Boolean(e.isChecked)),void 0!==e.layerMenuIconPath&&null!==e.layerMenuIconPath&&(t.layerMenuIconPath=String(e.layerMenuIconPath)),void 0!==e.description&&null!==e.description){if("object"!=typeof e.description)throw TypeError(".keyhole.dbroot.NestedFeatureProto.description: object expected");t.description=a[12].fromObject(e.description)}if(void 0!==e.lookAt&&null!==e.lookAt){if("object"!=typeof e.lookAt)throw TypeError(".keyhole.dbroot.NestedFeatureProto.lookAt: object expected");t.lookAt=a[13].fromObject(e.lookAt)}if(void 0!==e.assetUuid&&null!==e.assetUuid&&(t.assetUuid=String(e.assetUuid)),void 0!==e.isSaveLocked&&null!==e.isSaveLocked&&(t.isSaveLocked=Boolean(e.isSaveLocked)),e.children){if(!Array.isArray(e.children))throw TypeError(".keyhole.dbroot.NestedFeatureProto.children: array expected");t.children=[];for(var r=0;r<e.children.length;++r){if("object"!=typeof e.children[r])throw TypeError(".keyhole.dbroot.NestedFeatureProto.children: object expected");t.children[r]=a[16].fromObject(e.children[r])}}return void 0!==e.clientConfigScriptName&&null!==e.clientConfigScriptName&&(t.clientConfigScriptName=String(e.clientConfigScriptName)),void 0!==e.dioramaDataChannelBase&&null!==e.dioramaDataChannelBase&&(t.dioramaDataChannelBase=0|e.dioramaDataChannelBase),void 0!==e.replicaDataChannelBase&&null!==e.replicaDataChannelBase&&(t.replicaDataChannelBase=0|e.replicaDataChannelBase),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.children=[]),t.defaults&&(r.featureType=t.enums===String?"TYPE_POINT_Z":1,r.kmlUrl=null,r.databaseUrl="",r.layer=null,r.folder=null,r.requirement=null,r.channelId=0,r.displayName=null,r.isVisible=!0,r.isEnabled=!0,r.isChecked=!1,r.layerMenuIconPath="icons/773_l.png",r.description=null,r.lookAt=null,r.assetUuid="",r.isSaveLocked=!0,r.clientConfigScriptName="",r.dioramaDataChannelBase=-1,r.replicaDataChannelBase=-1),void 0!==e.featureType&&null!==e.featureType&&e.hasOwnProperty("featureType")&&(r.featureType=t.enums===String?a[0][e.featureType]:e.featureType),void 0!==e.kmlUrl&&null!==e.kmlUrl&&e.hasOwnProperty("kmlUrl")&&(r.kmlUrl=a[1].toObject(e.kmlUrl,t)),void 0!==e.databaseUrl&&null!==e.databaseUrl&&e.hasOwnProperty("databaseUrl")&&(r.databaseUrl=e.databaseUrl),void 0!==e.layer&&null!==e.layer&&e.hasOwnProperty("layer")&&(r.layer=a[3].toObject(e.layer,t)),void 0!==e.folder&&null!==e.folder&&e.hasOwnProperty("folder")&&(r.folder=a[4].toObject(e.folder,t)),void 0!==e.requirement&&null!==e.requirement&&e.hasOwnProperty("requirement")&&(r.requirement=a[5].toObject(e.requirement,t)),void 0!==e.channelId&&null!==e.channelId&&e.hasOwnProperty("channelId")&&(r.channelId=e.channelId),void 0!==e.displayName&&null!==e.displayName&&e.hasOwnProperty("displayName")&&(r.displayName=a[7].toObject(e.displayName,t)),void 0!==e.isVisible&&null!==e.isVisible&&e.hasOwnProperty("isVisible")&&(r.isVisible=e.isVisible),void 0!==e.isEnabled&&null!==e.isEnabled&&e.hasOwnProperty("isEnabled")&&(r.isEnabled=e.isEnabled),void 0!==e.isChecked&&null!==e.isChecked&&e.hasOwnProperty("isChecked")&&(r.isChecked=e.isChecked),void 0!==e.layerMenuIconPath&&null!==e.layerMenuIconPath&&e.hasOwnProperty("layerMenuIconPath")&&(r.layerMenuIconPath=e.layerMenuIconPath),void 0!==e.description&&null!==e.description&&e.hasOwnProperty("description")&&(r.description=a[12].toObject(e.description,t)),void 0!==e.lookAt&&null!==e.lookAt&&e.hasOwnProperty("lookAt")&&(r.lookAt=a[13].toObject(e.lookAt,t)),void 0!==e.assetUuid&&null!==e.assetUuid&&e.hasOwnProperty("assetUuid")&&(r.assetUuid=e.assetUuid),void 0!==e.isSaveLocked&&null!==e.isSaveLocked&&e.hasOwnProperty("isSaveLocked")&&(r.isSaveLocked=e.isSaveLocked),void 0!==e.children&&null!==e.children&&e.hasOwnProperty("children")){r.children=[];for(var i=0;i<e.children.length;++i)r.children[i]=a[16].toObject(e.children[i],t)}return void 0!==e.clientConfigScriptName&&null!==e.clientConfigScriptName&&e.hasOwnProperty("clientConfigScriptName")&&(r.clientConfigScriptName=e.clientConfigScriptName),void 0!==e.dioramaDataChannelBase&&null!==e.dioramaDataChannelBase&&e.hasOwnProperty("dioramaDataChannelBase")&&(r.dioramaDataChannelBase=e.dioramaDataChannelBase),void 0!==e.replicaDataChannelBase&&null!==e.replicaDataChannelBase&&e.hasOwnProperty("replicaDataChannelBase")&&(r.replicaDataChannelBase=e.replicaDataChannelBase),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.FeatureType=function(){var e={},t=Object.create(e);return t.TYPE_POINT_Z=1,t.TYPE_POLYGON_Z=2,t.TYPE_LINE_Z=3,t.TYPE_TERRAIN=4,t}(),o}(),o.MfeDomainFeaturesProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.countryCode="",o.prototype.domainName="",o.prototype.supportedFeatures=r.emptyArray;var a={2:"keyhole.dbroot.MfeDomainFeaturesProto.SupportedFeature"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.MfeDomainFeaturesProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.countryCode=e.string();break;case 2:o.domainName=e.string();break;case 3:if(o.supportedFeatures&&o.supportedFeatures.length||(o.supportedFeatures=[]),2===(7&a))for(var s=e.uint32()+e.pos;e.pos<s;)o.supportedFeatures.push(e.uint32());else o.supportedFeatures.push(e.uint32());break;default:e.skipType(7&a)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.countryCode))return"countryCode: string expected";if(!r.isString(e.domainName))return"domainName: string expected";if(void 0!==e.supportedFeatures){if(!Array.isArray(e.supportedFeatures))return"supportedFeatures: array expected";for(var t=0;t<e.supportedFeatures.length;++t)switch(e.supportedFeatures[t]){default:return"supportedFeatures: enum value[] expected";case 0:case 1:case 2:}}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.MfeDomainFeaturesProto)return e;var t=new n.keyhole.dbroot.MfeDomainFeaturesProto;if(void 0!==e.countryCode&&null!==e.countryCode&&(t.countryCode=String(e.countryCode)),void 0!==e.domainName&&null!==e.domainName&&(t.domainName=String(e.domainName)),e.supportedFeatures){if(!Array.isArray(e.supportedFeatures))throw TypeError(".keyhole.dbroot.MfeDomainFeaturesProto.supportedFeatures: array expected");t.supportedFeatures=[];for(var r=0;r<e.supportedFeatures.length;++r)switch(e.supportedFeatures[r]){default:case"GEOCODING":case 0:t.supportedFeatures[r]=0;break;case"LOCAL_SEARCH":case 1:t.supportedFeatures[r]=1;break;case"DRIVING_DIRECTIONS":case 2:t.supportedFeatures[r]=2}}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.supportedFeatures=[]),t.defaults&&(r.countryCode="",r.domainName=""),void 0!==e.countryCode&&null!==e.countryCode&&e.hasOwnProperty("countryCode")&&(r.countryCode=e.countryCode),void 0!==e.domainName&&null!==e.domainName&&e.hasOwnProperty("domainName")&&(r.domainName=e.domainName),void 0!==e.supportedFeatures&&null!==e.supportedFeatures&&e.hasOwnProperty("supportedFeatures")){r.supportedFeatures=[];for(var i=0;i<e.supportedFeatures.length;++i)r.supportedFeatures[i]=t.enums===String?a[2][e.supportedFeatures[i]]:e.supportedFeatures[i]}return r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.SupportedFeature=function(){var e={},t=Object.create(e);return t.GEOCODING=0,t.LOCAL_SEARCH=1,t.DRIVING_DIRECTIONS=2,t}(),o}(),o.ClientOptionsProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.disableDiskCache=!1,o.prototype.disableEmbeddedBrowserVista=!1,o.prototype.drawAtmosphere=!0,o.prototype.drawStars=!0,o.prototype.shaderFilePrefix="",o.prototype.useProtobufQuadtreePackets=!1,o.prototype.useExtendedCopyrightIds=!0,o.prototype.precipitationsOptions=null,o.prototype.captureOptions=null,o.prototype.show_2dMapsIcon=!0,o.prototype.disableInternalBrowser=!1,o.prototype.internalBrowserBlacklist="",o.prototype.internalBrowserOriginWhitelist="*",o.prototype.polarTileMergingLevel=0,o.prototype.jsBridgeRequestWhitelist="http://*.google.com/*",o.prototype.mapsOptions=null;var a={7:"keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions",8:"keyhole.dbroot.ClientOptionsProto.CaptureOptions",15:"keyhole.dbroot.ClientOptionsProto.MapsOptions"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.disableDiskCache=e.bool();break;case 2:o.disableEmbeddedBrowserVista=e.bool();break;case 3:o.drawAtmosphere=e.bool();break;case 4:o.drawStars=e.bool();break;case 5:o.shaderFilePrefix=e.string();break;case 6:o.useProtobufQuadtreePackets=e.bool();break;case 7:o.useExtendedCopyrightIds=e.bool();break;case 8:o.precipitationsOptions=a[7].decode(e,e.uint32());break;case 9:o.captureOptions=a[8].decode(e,e.uint32());break;case 10:o.show_2dMapsIcon=e.bool();break;case 11:o.disableInternalBrowser=e.bool();break;case 12:o.internalBrowserBlacklist=e.string();break;case 13:o.internalBrowserOriginWhitelist=e.string();break;case 14:o.polarTileMergingLevel=e.int32();break;case 15:o.jsBridgeRequestWhitelist=e.string();break;case 16:o.mapsOptions=a[15].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.disableDiskCache&&"boolean"!=typeof e.disableDiskCache)return"disableDiskCache: boolean expected";if(void 0!==e.disableEmbeddedBrowserVista&&"boolean"!=typeof e.disableEmbeddedBrowserVista)return"disableEmbeddedBrowserVista: boolean expected";if(void 0!==e.drawAtmosphere&&"boolean"!=typeof e.drawAtmosphere)return"drawAtmosphere: boolean expected";if(void 0!==e.drawStars&&"boolean"!=typeof e.drawStars)return"drawStars: boolean expected";if(void 0!==e.shaderFilePrefix&&!r.isString(e.shaderFilePrefix))return"shaderFilePrefix: string expected";if(void 0!==e.useProtobufQuadtreePackets&&"boolean"!=typeof e.useProtobufQuadtreePackets)return"useProtobufQuadtreePackets: boolean expected";if(void 0!==e.useExtendedCopyrightIds&&"boolean"!=typeof e.useExtendedCopyrightIds)return"useExtendedCopyrightIds: boolean expected";if(void 0!==e.precipitationsOptions&&null!==e.precipitationsOptions){var t=a[7].verify(e.precipitationsOptions);if(t)return"precipitationsOptions."+t}if(void 0!==e.captureOptions&&null!==e.captureOptions){var t=a[8].verify(e.captureOptions);if(t)return"captureOptions."+t}if(void 0!==e.show_2dMapsIcon&&"boolean"!=typeof e.show_2dMapsIcon)return"show_2dMapsIcon: boolean expected";if(void 0!==e.disableInternalBrowser&&"boolean"!=typeof e.disableInternalBrowser)return"disableInternalBrowser: boolean expected";if(void 0!==e.internalBrowserBlacklist&&!r.isString(e.internalBrowserBlacklist))return"internalBrowserBlacklist: string expected";if(void 0!==e.internalBrowserOriginWhitelist&&!r.isString(e.internalBrowserOriginWhitelist))return"internalBrowserOriginWhitelist: string expected";if(void 0!==e.polarTileMergingLevel&&!r.isInteger(e.polarTileMergingLevel))return"polarTileMergingLevel: integer expected";if(void 0!==e.jsBridgeRequestWhitelist&&!r.isString(e.jsBridgeRequestWhitelist))return"jsBridgeRequestWhitelist: string expected";if(void 0!==e.mapsOptions&&null!==e.mapsOptions){var t=a[15].verify(e.mapsOptions);if(t)return"mapsOptions."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto)return e;var t=new n.keyhole.dbroot.ClientOptionsProto;if(void 0!==e.disableDiskCache&&null!==e.disableDiskCache&&(t.disableDiskCache=Boolean(e.disableDiskCache)),void 0!==e.disableEmbeddedBrowserVista&&null!==e.disableEmbeddedBrowserVista&&(t.disableEmbeddedBrowserVista=Boolean(e.disableEmbeddedBrowserVista)),void 0!==e.drawAtmosphere&&null!==e.drawAtmosphere&&(t.drawAtmosphere=Boolean(e.drawAtmosphere)),void 0!==e.drawStars&&null!==e.drawStars&&(t.drawStars=Boolean(e.drawStars)),void 0!==e.shaderFilePrefix&&null!==e.shaderFilePrefix&&(t.shaderFilePrefix=String(e.shaderFilePrefix)),void 0!==e.useProtobufQuadtreePackets&&null!==e.useProtobufQuadtreePackets&&(t.useProtobufQuadtreePackets=Boolean(e.useProtobufQuadtreePackets)),void 0!==e.useExtendedCopyrightIds&&null!==e.useExtendedCopyrightIds&&(t.useExtendedCopyrightIds=Boolean(e.useExtendedCopyrightIds)),void 0!==e.precipitationsOptions&&null!==e.precipitationsOptions){if("object"!=typeof e.precipitationsOptions)throw TypeError(".keyhole.dbroot.ClientOptionsProto.precipitationsOptions: object expected");t.precipitationsOptions=a[7].fromObject(e.precipitationsOptions)}if(void 0!==e.captureOptions&&null!==e.captureOptions){if("object"!=typeof e.captureOptions)throw TypeError(".keyhole.dbroot.ClientOptionsProto.captureOptions: object expected");t.captureOptions=a[8].fromObject(e.captureOptions)}if(void 0!==e.show_2dMapsIcon&&null!==e.show_2dMapsIcon&&(t.show_2dMapsIcon=Boolean(e.show_2dMapsIcon)),void 0!==e.disableInternalBrowser&&null!==e.disableInternalBrowser&&(t.disableInternalBrowser=Boolean(e.disableInternalBrowser)),void 0!==e.internalBrowserBlacklist&&null!==e.internalBrowserBlacklist&&(t.internalBrowserBlacklist=String(e.internalBrowserBlacklist)),void 0!==e.internalBrowserOriginWhitelist&&null!==e.internalBrowserOriginWhitelist&&(t.internalBrowserOriginWhitelist=String(e.internalBrowserOriginWhitelist)),void 0!==e.polarTileMergingLevel&&null!==e.polarTileMergingLevel&&(t.polarTileMergingLevel=0|e.polarTileMergingLevel),void 0!==e.jsBridgeRequestWhitelist&&null!==e.jsBridgeRequestWhitelist&&(t.jsBridgeRequestWhitelist=String(e.jsBridgeRequestWhitelist)),void 0!==e.mapsOptions&&null!==e.mapsOptions){if("object"!=typeof e.mapsOptions)throw TypeError(".keyhole.dbroot.ClientOptionsProto.mapsOptions: object expected");t.mapsOptions=a[15].fromObject(e.mapsOptions)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.disableDiskCache=!1,r.disableEmbeddedBrowserVista=!1,r.drawAtmosphere=!0,r.drawStars=!0,r.shaderFilePrefix="",r.useProtobufQuadtreePackets=!1,r.useExtendedCopyrightIds=!0,r.precipitationsOptions=null,r.captureOptions=null,r.show_2dMapsIcon=!0,r.disableInternalBrowser=!1,r.internalBrowserBlacklist="",r.internalBrowserOriginWhitelist="*",r.polarTileMergingLevel=0,r.jsBridgeRequestWhitelist="http://*.google.com/*",r.mapsOptions=null),void 0!==e.disableDiskCache&&null!==e.disableDiskCache&&e.hasOwnProperty("disableDiskCache")&&(r.disableDiskCache=e.disableDiskCache),void 0!==e.disableEmbeddedBrowserVista&&null!==e.disableEmbeddedBrowserVista&&e.hasOwnProperty("disableEmbeddedBrowserVista")&&(r.disableEmbeddedBrowserVista=e.disableEmbeddedBrowserVista),void 0!==e.drawAtmosphere&&null!==e.drawAtmosphere&&e.hasOwnProperty("drawAtmosphere")&&(r.drawAtmosphere=e.drawAtmosphere),void 0!==e.drawStars&&null!==e.drawStars&&e.hasOwnProperty("drawStars")&&(r.drawStars=e.drawStars),void 0!==e.shaderFilePrefix&&null!==e.shaderFilePrefix&&e.hasOwnProperty("shaderFilePrefix")&&(r.shaderFilePrefix=e.shaderFilePrefix),void 0!==e.useProtobufQuadtreePackets&&null!==e.useProtobufQuadtreePackets&&e.hasOwnProperty("useProtobufQuadtreePackets")&&(r.useProtobufQuadtreePackets=e.useProtobufQuadtreePackets),void 0!==e.useExtendedCopyrightIds&&null!==e.useExtendedCopyrightIds&&e.hasOwnProperty("useExtendedCopyrightIds")&&(r.useExtendedCopyrightIds=e.useExtendedCopyrightIds),void 0!==e.precipitationsOptions&&null!==e.precipitationsOptions&&e.hasOwnProperty("precipitationsOptions")&&(r.precipitationsOptions=a[7].toObject(e.precipitationsOptions,t)),void 0!==e.captureOptions&&null!==e.captureOptions&&e.hasOwnProperty("captureOptions")&&(r.captureOptions=a[8].toObject(e.captureOptions,t)),void 0!==e.show_2dMapsIcon&&null!==e.show_2dMapsIcon&&e.hasOwnProperty("show_2dMapsIcon")&&(r.show_2dMapsIcon=e.show_2dMapsIcon),void 0!==e.disableInternalBrowser&&null!==e.disableInternalBrowser&&e.hasOwnProperty("disableInternalBrowser")&&(r.disableInternalBrowser=e.disableInternalBrowser),void 0!==e.internalBrowserBlacklist&&null!==e.internalBrowserBlacklist&&e.hasOwnProperty("internalBrowserBlacklist")&&(r.internalBrowserBlacklist=e.internalBrowserBlacklist),void 0!==e.internalBrowserOriginWhitelist&&null!==e.internalBrowserOriginWhitelist&&e.hasOwnProperty("internalBrowserOriginWhitelist")&&(r.internalBrowserOriginWhitelist=e.internalBrowserOriginWhitelist),void 0!==e.polarTileMergingLevel&&null!==e.polarTileMergingLevel&&e.hasOwnProperty("polarTileMergingLevel")&&(r.polarTileMergingLevel=e.polarTileMergingLevel),void 0!==e.jsBridgeRequestWhitelist&&null!==e.jsBridgeRequestWhitelist&&e.hasOwnProperty("jsBridgeRequestWhitelist")&&(r.jsBridgeRequestWhitelist=e.jsBridgeRequestWhitelist),void 0!==e.mapsOptions&&null!==e.mapsOptions&&e.hasOwnProperty("mapsOptions")&&(r.mapsOptions=a[15].toObject(e.mapsOptions,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.PrecipitationsOptions=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.imageUrl="",o.prototype.imageExpireTime=900,o.prototype.maxColorDistance=20,o.prototype.imageLevel=5,o.prototype.weatherMapping=r.emptyArray,o.prototype.cloudsLayerUrl="",o.prototype.animationDecelerationDelay=20;var a={4:"keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.imageUrl=e.string();break;case 2:o.imageExpireTime=e.int32();break;case 3:o.maxColorDistance=e.int32();break;case 4:o.imageLevel=e.int32();break;case 5:o.weatherMapping&&o.weatherMapping.length||(o.weatherMapping=[]),o.weatherMapping.push(a[4].decode(e,e.uint32()));break;case 6:o.cloudsLayerUrl=e.string();break;case 7:o.animationDecelerationDelay=e.float();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.imageUrl&&!r.isString(e.imageUrl))return"imageUrl: string expected";if(void 0!==e.imageExpireTime&&!r.isInteger(e.imageExpireTime))return"imageExpireTime: integer expected";if(void 0!==e.maxColorDistance&&!r.isInteger(e.maxColorDistance))return"maxColorDistance: integer expected";if(void 0!==e.imageLevel&&!r.isInteger(e.imageLevel))return"imageLevel: integer expected";if(void 0!==e.weatherMapping){if(!Array.isArray(e.weatherMapping))return"weatherMapping: array expected";for(var t=0;t<e.weatherMapping.length;++t){var i=a[4].verify(e.weatherMapping[t]);if(i)return"weatherMapping."+i}}return void 0===e.cloudsLayerUrl||r.isString(e.cloudsLayerUrl)?void 0!==e.animationDecelerationDelay&&"number"!=typeof e.animationDecelerationDelay?"animationDecelerationDelay: number expected":null:"cloudsLayerUrl: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions;if(void 0!==e.imageUrl&&null!==e.imageUrl&&(t.imageUrl=String(e.imageUrl)),void 0!==e.imageExpireTime&&null!==e.imageExpireTime&&(t.imageExpireTime=0|e.imageExpireTime),void 0!==e.maxColorDistance&&null!==e.maxColorDistance&&(t.maxColorDistance=0|e.maxColorDistance),void 0!==e.imageLevel&&null!==e.imageLevel&&(t.imageLevel=0|e.imageLevel),e.weatherMapping){if(!Array.isArray(e.weatherMapping))throw TypeError(".keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.weatherMapping: array expected");t.weatherMapping=[];for(var r=0;r<e.weatherMapping.length;++r){if("object"!=typeof e.weatherMapping[r])throw TypeError(".keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.weatherMapping: object expected");t.weatherMapping[r]=a[4].fromObject(e.weatherMapping[r])}}return void 0!==e.cloudsLayerUrl&&null!==e.cloudsLayerUrl&&(t.cloudsLayerUrl=String(e.cloudsLayerUrl)),void 0!==e.animationDecelerationDelay&&null!==e.animationDecelerationDelay&&(t.animationDecelerationDelay=Number(e.animationDecelerationDelay)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.weatherMapping=[]),t.defaults&&(r.imageUrl="",r.imageExpireTime=900,r.maxColorDistance=20,r.imageLevel=5,r.cloudsLayerUrl="",r.animationDecelerationDelay=20),void 0!==e.imageUrl&&null!==e.imageUrl&&e.hasOwnProperty("imageUrl")&&(r.imageUrl=e.imageUrl),void 0!==e.imageExpireTime&&null!==e.imageExpireTime&&e.hasOwnProperty("imageExpireTime")&&(r.imageExpireTime=e.imageExpireTime),void 0!==e.maxColorDistance&&null!==e.maxColorDistance&&e.hasOwnProperty("maxColorDistance")&&(r.maxColorDistance=e.maxColorDistance),void 0!==e.imageLevel&&null!==e.imageLevel&&e.hasOwnProperty("imageLevel")&&(r.imageLevel=e.imageLevel),void 0!==e.weatherMapping&&null!==e.weatherMapping&&e.hasOwnProperty("weatherMapping")){r.weatherMapping=[];for(var i=0;i<e.weatherMapping.length;++i)r.weatherMapping[i]=a[4].toObject(e.weatherMapping[i],t)}return void 0!==e.cloudsLayerUrl&&null!==e.cloudsLayerUrl&&e.hasOwnProperty("cloudsLayerUrl")&&(r.cloudsLayerUrl=e.cloudsLayerUrl),void 0!==e.animationDecelerationDelay&&null!==e.animationDecelerationDelay&&e.hasOwnProperty("animationDecelerationDelay")&&(r.animationDecelerationDelay=e.animationDecelerationDelay),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.WeatherMapping=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.colorAbgr=0,o.prototype.weatherType=0,o.prototype.elongation=1,o.prototype.opacity=0,o.prototype.fogDensity=0,o.prototype.speed0=0,o.prototype.speed1=0,o.prototype.speed2=0,o.prototype.speed3=0;var a={1:"keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping.WeatherType"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.colorAbgr=e.uint32();break;case 2:o.weatherType=e.uint32();break;case 3:o.elongation=e.float();break;case 4:o.opacity=e.float();break;case 5:o.fogDensity=e.float();break;case 6:o.speed0=e.float();break;case 7:o.speed1=e.float();break;case 8:o.speed2=e.float();break;case 9:o.speed3=e.float();break;default:e.skipType(7&a)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isInteger(e.colorAbgr))return"colorAbgr: integer expected";switch(e.weatherType){default:return"weatherType: enum value expected";case 0:case 1:case 2:}return void 0!==e.elongation&&"number"!=typeof e.elongation?"elongation: number expected":void 0!==e.opacity&&"number"!=typeof e.opacity?"opacity: number expected":void 0!==e.fogDensity&&"number"!=typeof e.fogDensity?"fogDensity: number expected":void 0!==e.speed0&&"number"!=typeof e.speed0?"speed0: number expected":void 0!==e.speed1&&"number"!=typeof e.speed1?"speed1: number expected":void 0!==e.speed2&&"number"!=typeof e.speed2?"speed2: number expected":void 0!==e.speed3&&"number"!=typeof e.speed3?"speed3: number expected":null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.PrecipitationsOptions.WeatherMapping;switch(void 0!==e.colorAbgr&&null!==e.colorAbgr&&(t.colorAbgr=e.colorAbgr>>>0),e.weatherType){case"NO_PRECIPITATION":case 0:t.weatherType=0;break;case"RAIN":case 1:t.weatherType=1;break;case"SNOW":case 2:t.weatherType=2}return void 0!==e.elongation&&null!==e.elongation&&(t.elongation=Number(e.elongation)),void 0!==e.opacity&&null!==e.opacity&&(t.opacity=Number(e.opacity)),void 0!==e.fogDensity&&null!==e.fogDensity&&(t.fogDensity=Number(e.fogDensity)),void 0!==e.speed0&&null!==e.speed0&&(t.speed0=Number(e.speed0)),void 0!==e.speed1&&null!==e.speed1&&(t.speed1=Number(e.speed1)),void 0!==e.speed2&&null!==e.speed2&&(t.speed2=Number(e.speed2)),void 0!==e.speed3&&null!==e.speed3&&(t.speed3=Number(e.speed3)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.colorAbgr=0,r.weatherType=t.enums===String?"NO_PRECIPITATION":0,r.elongation=1,r.opacity=0,r.fogDensity=0,r.speed0=0,r.speed1=0,r.speed2=0,r.speed3=0),void 0!==e.colorAbgr&&null!==e.colorAbgr&&e.hasOwnProperty("colorAbgr")&&(r.colorAbgr=e.colorAbgr),void 0!==e.weatherType&&null!==e.weatherType&&e.hasOwnProperty("weatherType")&&(r.weatherType=t.enums===String?a[1][e.weatherType]:e.weatherType),void 0!==e.elongation&&null!==e.elongation&&e.hasOwnProperty("elongation")&&(r.elongation=e.elongation),void 0!==e.opacity&&null!==e.opacity&&e.hasOwnProperty("opacity")&&(r.opacity=e.opacity),void 0!==e.fogDensity&&null!==e.fogDensity&&e.hasOwnProperty("fogDensity")&&(r.fogDensity=e.fogDensity),void 0!==e.speed0&&null!==e.speed0&&e.hasOwnProperty("speed0")&&(r.speed0=e.speed0),void 0!==e.speed1&&null!==e.speed1&&e.hasOwnProperty("speed1")&&(r.speed1=e.speed1),void 0!==e.speed2&&null!==e.speed2&&e.hasOwnProperty("speed2")&&(r.speed2=e.speed2),void 0!==e.speed3&&null!==e.speed3&&e.hasOwnProperty("speed3")&&(r.speed3=e.speed3),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.WeatherType=function(){var e={},t=Object.create(e);return t.NO_PRECIPITATION=0,t.RAIN=1,t.SNOW=2,t}(),o}(),o}(),o.CaptureOptions=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.allowSaveAsImage=!0,i.prototype.maxFreeCaptureRes=2400,i.prototype.maxPremiumCaptureRes=4800,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto.CaptureOptions;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.allowSaveAsImage=e.bool();break;case 2:o.maxFreeCaptureRes=e.int32();break;case 3:o.maxPremiumCaptureRes=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.allowSaveAsImage&&"boolean"!=typeof e.allowSaveAsImage?"allowSaveAsImage: boolean expected":void 0===e.maxFreeCaptureRes||r.isInteger(e.maxFreeCaptureRes)?void 0===e.maxPremiumCaptureRes||r.isInteger(e.maxPremiumCaptureRes)?null:"maxPremiumCaptureRes: integer expected":"maxFreeCaptureRes: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.CaptureOptions)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.CaptureOptions;return void 0!==e.allowSaveAsImage&&null!==e.allowSaveAsImage&&(t.allowSaveAsImage=Boolean(e.allowSaveAsImage)),void 0!==e.maxFreeCaptureRes&&null!==e.maxFreeCaptureRes&&(t.maxFreeCaptureRes=0|e.maxFreeCaptureRes),void 0!==e.maxPremiumCaptureRes&&null!==e.maxPremiumCaptureRes&&(t.maxPremiumCaptureRes=0|e.maxPremiumCaptureRes),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.allowSaveAsImage=!0,r.maxFreeCaptureRes=2400,r.maxPremiumCaptureRes=4800),void 0!==e.allowSaveAsImage&&null!==e.allowSaveAsImage&&e.hasOwnProperty("allowSaveAsImage")&&(r.allowSaveAsImage=e.allowSaveAsImage),void 0!==e.maxFreeCaptureRes&&null!==e.maxFreeCaptureRes&&e.hasOwnProperty("maxFreeCaptureRes")&&(r.maxFreeCaptureRes=e.maxFreeCaptureRes),void 0!==e.maxPremiumCaptureRes&&null!==e.maxPremiumCaptureRes&&e.hasOwnProperty("maxPremiumCaptureRes")&&(r.maxPremiumCaptureRes=e.maxPremiumCaptureRes),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.MapsOptions=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.enableMaps=!1,i.prototype.docsAutoDownloadEnabled=!1,i.prototype.docsAutoDownloadInterval=0,i.prototype.docsAutoUploadEnabled=!1,i.prototype.docsAutoUploadDelay=0, +i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ClientOptionsProto.MapsOptions;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.enableMaps=e.bool();break;case 2:o.docsAutoDownloadEnabled=e.bool();break;case 3:o.docsAutoDownloadInterval=e.int32();break;case 4:o.docsAutoUploadEnabled=e.bool();break;case 5:o.docsAutoUploadDelay=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.enableMaps&&"boolean"!=typeof e.enableMaps?"enableMaps: boolean expected":void 0!==e.docsAutoDownloadEnabled&&"boolean"!=typeof e.docsAutoDownloadEnabled?"docsAutoDownloadEnabled: boolean expected":void 0===e.docsAutoDownloadInterval||r.isInteger(e.docsAutoDownloadInterval)?void 0!==e.docsAutoUploadEnabled&&"boolean"!=typeof e.docsAutoUploadEnabled?"docsAutoUploadEnabled: boolean expected":void 0===e.docsAutoUploadDelay||r.isInteger(e.docsAutoUploadDelay)?null:"docsAutoUploadDelay: integer expected":"docsAutoDownloadInterval: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ClientOptionsProto.MapsOptions)return e;var t=new n.keyhole.dbroot.ClientOptionsProto.MapsOptions;return void 0!==e.enableMaps&&null!==e.enableMaps&&(t.enableMaps=Boolean(e.enableMaps)),void 0!==e.docsAutoDownloadEnabled&&null!==e.docsAutoDownloadEnabled&&(t.docsAutoDownloadEnabled=Boolean(e.docsAutoDownloadEnabled)),void 0!==e.docsAutoDownloadInterval&&null!==e.docsAutoDownloadInterval&&(t.docsAutoDownloadInterval=0|e.docsAutoDownloadInterval),void 0!==e.docsAutoUploadEnabled&&null!==e.docsAutoUploadEnabled&&(t.docsAutoUploadEnabled=Boolean(e.docsAutoUploadEnabled)),void 0!==e.docsAutoUploadDelay&&null!==e.docsAutoUploadDelay&&(t.docsAutoUploadDelay=0|e.docsAutoUploadDelay),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.enableMaps=!1,r.docsAutoDownloadEnabled=!1,r.docsAutoDownloadInterval=0,r.docsAutoUploadEnabled=!1,r.docsAutoUploadDelay=0),void 0!==e.enableMaps&&null!==e.enableMaps&&e.hasOwnProperty("enableMaps")&&(r.enableMaps=e.enableMaps),void 0!==e.docsAutoDownloadEnabled&&null!==e.docsAutoDownloadEnabled&&e.hasOwnProperty("docsAutoDownloadEnabled")&&(r.docsAutoDownloadEnabled=e.docsAutoDownloadEnabled),void 0!==e.docsAutoDownloadInterval&&null!==e.docsAutoDownloadInterval&&e.hasOwnProperty("docsAutoDownloadInterval")&&(r.docsAutoDownloadInterval=e.docsAutoDownloadInterval),void 0!==e.docsAutoUploadEnabled&&null!==e.docsAutoUploadEnabled&&e.hasOwnProperty("docsAutoUploadEnabled")&&(r.docsAutoUploadEnabled=e.docsAutoUploadEnabled),void 0!==e.docsAutoUploadDelay&&null!==e.docsAutoUploadDelay&&e.hasOwnProperty("docsAutoUploadDelay")&&(r.docsAutoUploadDelay=e.docsAutoUploadDelay),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o}(),o.FetchingOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.maxRequestsPerQuery=1,i.prototype.forceMaxRequestsPerQuery=!1,i.prototype.sortBatches=!1,i.prototype.maxDrawable=2,i.prototype.maxImagery=2,i.prototype.maxTerrain=5,i.prototype.maxQuadtree=5,i.prototype.maxDioramaMetadata=1,i.prototype.maxDioramaData=0,i.prototype.maxConsumerFetchRatio=1,i.prototype.maxProEcFetchRatio=0,i.prototype.safeOverallQps=0,i.prototype.safeImageryQps=0,i.prototype.domainsForHttps="google.com gstatic.com",i.prototype.hostsForHttp="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.FetchingOptionsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.maxRequestsPerQuery=e.int32();break;case 12:o.forceMaxRequestsPerQuery=e.bool();break;case 13:o.sortBatches=e.bool();break;case 2:o.maxDrawable=e.int32();break;case 3:o.maxImagery=e.int32();break;case 4:o.maxTerrain=e.int32();break;case 5:o.maxQuadtree=e.int32();break;case 6:o.maxDioramaMetadata=e.int32();break;case 7:o.maxDioramaData=e.int32();break;case 8:o.maxConsumerFetchRatio=e.float();break;case 9:o.maxProEcFetchRatio=e.float();break;case 10:o.safeOverallQps=e.float();break;case 11:o.safeImageryQps=e.float();break;case 14:o.domainsForHttps=e.string();break;case 15:o.hostsForHttp=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.maxRequestsPerQuery||r.isInteger(e.maxRequestsPerQuery)?void 0!==e.forceMaxRequestsPerQuery&&"boolean"!=typeof e.forceMaxRequestsPerQuery?"forceMaxRequestsPerQuery: boolean expected":void 0!==e.sortBatches&&"boolean"!=typeof e.sortBatches?"sortBatches: boolean expected":void 0===e.maxDrawable||r.isInteger(e.maxDrawable)?void 0===e.maxImagery||r.isInteger(e.maxImagery)?void 0===e.maxTerrain||r.isInteger(e.maxTerrain)?void 0===e.maxQuadtree||r.isInteger(e.maxQuadtree)?void 0===e.maxDioramaMetadata||r.isInteger(e.maxDioramaMetadata)?void 0===e.maxDioramaData||r.isInteger(e.maxDioramaData)?void 0!==e.maxConsumerFetchRatio&&"number"!=typeof e.maxConsumerFetchRatio?"maxConsumerFetchRatio: number expected":void 0!==e.maxProEcFetchRatio&&"number"!=typeof e.maxProEcFetchRatio?"maxProEcFetchRatio: number expected":void 0!==e.safeOverallQps&&"number"!=typeof e.safeOverallQps?"safeOverallQps: number expected":void 0!==e.safeImageryQps&&"number"!=typeof e.safeImageryQps?"safeImageryQps: number expected":void 0===e.domainsForHttps||r.isString(e.domainsForHttps)?void 0===e.hostsForHttp||r.isString(e.hostsForHttp)?null:"hostsForHttp: string expected":"domainsForHttps: string expected":"maxDioramaData: integer expected":"maxDioramaMetadata: integer expected":"maxQuadtree: integer expected":"maxTerrain: integer expected":"maxImagery: integer expected":"maxDrawable: integer expected":"maxRequestsPerQuery: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.FetchingOptionsProto)return e;var t=new n.keyhole.dbroot.FetchingOptionsProto;return void 0!==e.maxRequestsPerQuery&&null!==e.maxRequestsPerQuery&&(t.maxRequestsPerQuery=0|e.maxRequestsPerQuery),void 0!==e.forceMaxRequestsPerQuery&&null!==e.forceMaxRequestsPerQuery&&(t.forceMaxRequestsPerQuery=Boolean(e.forceMaxRequestsPerQuery)),void 0!==e.sortBatches&&null!==e.sortBatches&&(t.sortBatches=Boolean(e.sortBatches)),void 0!==e.maxDrawable&&null!==e.maxDrawable&&(t.maxDrawable=0|e.maxDrawable),void 0!==e.maxImagery&&null!==e.maxImagery&&(t.maxImagery=0|e.maxImagery),void 0!==e.maxTerrain&&null!==e.maxTerrain&&(t.maxTerrain=0|e.maxTerrain),void 0!==e.maxQuadtree&&null!==e.maxQuadtree&&(t.maxQuadtree=0|e.maxQuadtree),void 0!==e.maxDioramaMetadata&&null!==e.maxDioramaMetadata&&(t.maxDioramaMetadata=0|e.maxDioramaMetadata),void 0!==e.maxDioramaData&&null!==e.maxDioramaData&&(t.maxDioramaData=0|e.maxDioramaData),void 0!==e.maxConsumerFetchRatio&&null!==e.maxConsumerFetchRatio&&(t.maxConsumerFetchRatio=Number(e.maxConsumerFetchRatio)),void 0!==e.maxProEcFetchRatio&&null!==e.maxProEcFetchRatio&&(t.maxProEcFetchRatio=Number(e.maxProEcFetchRatio)),void 0!==e.safeOverallQps&&null!==e.safeOverallQps&&(t.safeOverallQps=Number(e.safeOverallQps)),void 0!==e.safeImageryQps&&null!==e.safeImageryQps&&(t.safeImageryQps=Number(e.safeImageryQps)),void 0!==e.domainsForHttps&&null!==e.domainsForHttps&&(t.domainsForHttps=String(e.domainsForHttps)),void 0!==e.hostsForHttp&&null!==e.hostsForHttp&&(t.hostsForHttp=String(e.hostsForHttp)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.maxRequestsPerQuery=1,r.forceMaxRequestsPerQuery=!1,r.sortBatches=!1,r.maxDrawable=2,r.maxImagery=2,r.maxTerrain=5,r.maxQuadtree=5,r.maxDioramaMetadata=1,r.maxDioramaData=0,r.maxConsumerFetchRatio=1,r.maxProEcFetchRatio=0,r.safeOverallQps=0,r.safeImageryQps=0,r.domainsForHttps="google.com gstatic.com",r.hostsForHttp=""),void 0!==e.maxRequestsPerQuery&&null!==e.maxRequestsPerQuery&&e.hasOwnProperty("maxRequestsPerQuery")&&(r.maxRequestsPerQuery=e.maxRequestsPerQuery),void 0!==e.forceMaxRequestsPerQuery&&null!==e.forceMaxRequestsPerQuery&&e.hasOwnProperty("forceMaxRequestsPerQuery")&&(r.forceMaxRequestsPerQuery=e.forceMaxRequestsPerQuery),void 0!==e.sortBatches&&null!==e.sortBatches&&e.hasOwnProperty("sortBatches")&&(r.sortBatches=e.sortBatches),void 0!==e.maxDrawable&&null!==e.maxDrawable&&e.hasOwnProperty("maxDrawable")&&(r.maxDrawable=e.maxDrawable),void 0!==e.maxImagery&&null!==e.maxImagery&&e.hasOwnProperty("maxImagery")&&(r.maxImagery=e.maxImagery),void 0!==e.maxTerrain&&null!==e.maxTerrain&&e.hasOwnProperty("maxTerrain")&&(r.maxTerrain=e.maxTerrain),void 0!==e.maxQuadtree&&null!==e.maxQuadtree&&e.hasOwnProperty("maxQuadtree")&&(r.maxQuadtree=e.maxQuadtree),void 0!==e.maxDioramaMetadata&&null!==e.maxDioramaMetadata&&e.hasOwnProperty("maxDioramaMetadata")&&(r.maxDioramaMetadata=e.maxDioramaMetadata),void 0!==e.maxDioramaData&&null!==e.maxDioramaData&&e.hasOwnProperty("maxDioramaData")&&(r.maxDioramaData=e.maxDioramaData),void 0!==e.maxConsumerFetchRatio&&null!==e.maxConsumerFetchRatio&&e.hasOwnProperty("maxConsumerFetchRatio")&&(r.maxConsumerFetchRatio=e.maxConsumerFetchRatio),void 0!==e.maxProEcFetchRatio&&null!==e.maxProEcFetchRatio&&e.hasOwnProperty("maxProEcFetchRatio")&&(r.maxProEcFetchRatio=e.maxProEcFetchRatio),void 0!==e.safeOverallQps&&null!==e.safeOverallQps&&e.hasOwnProperty("safeOverallQps")&&(r.safeOverallQps=e.safeOverallQps),void 0!==e.safeImageryQps&&null!==e.safeImageryQps&&e.hasOwnProperty("safeImageryQps")&&(r.safeImageryQps=e.safeImageryQps),void 0!==e.domainsForHttps&&null!==e.domainsForHttps&&e.hasOwnProperty("domainsForHttps")&&(r.domainsForHttps=e.domainsForHttps),void 0!==e.hostsForHttp&&null!==e.hostsForHttp&&e.hasOwnProperty("hostsForHttp")&&(r.hostsForHttp=e.hostsForHttp),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.TimeMachineOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.serverUrl="",i.prototype.isTimemachine=!1,i.prototype.dwellTimeMs=500,i.prototype.discoverabilityAltitudeMeters=15e3,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.TimeMachineOptionsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.serverUrl=e.string();break;case 2:o.isTimemachine=e.bool();break;case 3:o.dwellTimeMs=e.int32();break;case 4:o.discoverabilityAltitudeMeters=e.int32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.serverUrl||r.isString(e.serverUrl)?void 0!==e.isTimemachine&&"boolean"!=typeof e.isTimemachine?"isTimemachine: boolean expected":void 0===e.dwellTimeMs||r.isInteger(e.dwellTimeMs)?void 0===e.discoverabilityAltitudeMeters||r.isInteger(e.discoverabilityAltitudeMeters)?null:"discoverabilityAltitudeMeters: integer expected":"dwellTimeMs: integer expected":"serverUrl: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.TimeMachineOptionsProto)return e;var t=new n.keyhole.dbroot.TimeMachineOptionsProto;return void 0!==e.serverUrl&&null!==e.serverUrl&&(t.serverUrl=String(e.serverUrl)),void 0!==e.isTimemachine&&null!==e.isTimemachine&&(t.isTimemachine=Boolean(e.isTimemachine)),void 0!==e.dwellTimeMs&&null!==e.dwellTimeMs&&(t.dwellTimeMs=0|e.dwellTimeMs),void 0!==e.discoverabilityAltitudeMeters&&null!==e.discoverabilityAltitudeMeters&&(t.discoverabilityAltitudeMeters=0|e.discoverabilityAltitudeMeters),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.serverUrl="",r.isTimemachine=!1,r.dwellTimeMs=500,r.discoverabilityAltitudeMeters=15e3),void 0!==e.serverUrl&&null!==e.serverUrl&&e.hasOwnProperty("serverUrl")&&(r.serverUrl=e.serverUrl),void 0!==e.isTimemachine&&null!==e.isTimemachine&&e.hasOwnProperty("isTimemachine")&&(r.isTimemachine=e.isTimemachine),void 0!==e.dwellTimeMs&&null!==e.dwellTimeMs&&e.hasOwnProperty("dwellTimeMs")&&(r.dwellTimeMs=e.dwellTimeMs),void 0!==e.discoverabilityAltitudeMeters&&null!==e.discoverabilityAltitudeMeters&&e.hasOwnProperty("discoverabilityAltitudeMeters")&&(r.discoverabilityAltitudeMeters=e.discoverabilityAltitudeMeters),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.AutopiaOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.metadataServerUrl="http://cbk0.google.com/cbk",i.prototype.depthmapServerUrl="http://cbk0.google.com/cbk",i.prototype.coverageOverlayUrl="",i.prototype.maxImageryQps=0,i.prototype.maxMetadataDepthmapQps=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.AutopiaOptionsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.metadataServerUrl=e.string();break;case 2:o.depthmapServerUrl=e.string();break;case 3:o.coverageOverlayUrl=e.string();break;case 4:o.maxImageryQps=e.float();break;case 5:o.maxMetadataDepthmapQps=e.float();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.metadataServerUrl||r.isString(e.metadataServerUrl)?void 0===e.depthmapServerUrl||r.isString(e.depthmapServerUrl)?void 0===e.coverageOverlayUrl||r.isString(e.coverageOverlayUrl)?void 0!==e.maxImageryQps&&"number"!=typeof e.maxImageryQps?"maxImageryQps: number expected":void 0!==e.maxMetadataDepthmapQps&&"number"!=typeof e.maxMetadataDepthmapQps?"maxMetadataDepthmapQps: number expected":null:"coverageOverlayUrl: string expected":"depthmapServerUrl: string expected":"metadataServerUrl: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.AutopiaOptionsProto)return e;var t=new n.keyhole.dbroot.AutopiaOptionsProto;return void 0!==e.metadataServerUrl&&null!==e.metadataServerUrl&&(t.metadataServerUrl=String(e.metadataServerUrl)),void 0!==e.depthmapServerUrl&&null!==e.depthmapServerUrl&&(t.depthmapServerUrl=String(e.depthmapServerUrl)),void 0!==e.coverageOverlayUrl&&null!==e.coverageOverlayUrl&&(t.coverageOverlayUrl=String(e.coverageOverlayUrl)),void 0!==e.maxImageryQps&&null!==e.maxImageryQps&&(t.maxImageryQps=Number(e.maxImageryQps)),void 0!==e.maxMetadataDepthmapQps&&null!==e.maxMetadataDepthmapQps&&(t.maxMetadataDepthmapQps=Number(e.maxMetadataDepthmapQps)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.metadataServerUrl="http://cbk0.google.com/cbk",r.depthmapServerUrl="http://cbk0.google.com/cbk",r.coverageOverlayUrl="",r.maxImageryQps=0,r.maxMetadataDepthmapQps=0),void 0!==e.metadataServerUrl&&null!==e.metadataServerUrl&&e.hasOwnProperty("metadataServerUrl")&&(r.metadataServerUrl=e.metadataServerUrl),void 0!==e.depthmapServerUrl&&null!==e.depthmapServerUrl&&e.hasOwnProperty("depthmapServerUrl")&&(r.depthmapServerUrl=e.depthmapServerUrl),void 0!==e.coverageOverlayUrl&&null!==e.coverageOverlayUrl&&e.hasOwnProperty("coverageOverlayUrl")&&(r.coverageOverlayUrl=e.coverageOverlayUrl),void 0!==e.maxImageryQps&&null!==e.maxImageryQps&&e.hasOwnProperty("maxImageryQps")&&(r.maxImageryQps=e.maxImageryQps),void 0!==e.maxMetadataDepthmapQps&&null!==e.maxMetadataDepthmapQps&&e.hasOwnProperty("maxMetadataDepthmapQps")&&(r.maxMetadataDepthmapQps=e.maxMetadataDepthmapQps),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.CSIOptionsProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.samplingPercentage=0,i.prototype.experimentId="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.CSIOptionsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.samplingPercentage=e.int32();break;case 2:o.experimentId=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.samplingPercentage||r.isInteger(e.samplingPercentage)?void 0===e.experimentId||r.isString(e.experimentId)?null:"experimentId: string expected":"samplingPercentage: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.CSIOptionsProto)return e;var t=new n.keyhole.dbroot.CSIOptionsProto;return void 0!==e.samplingPercentage&&null!==e.samplingPercentage&&(t.samplingPercentage=0|e.samplingPercentage),void 0!==e.experimentId&&null!==e.experimentId&&(t.experimentId=String(e.experimentId)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.samplingPercentage=0,r.experimentId=""),void 0!==e.samplingPercentage&&null!==e.samplingPercentage&&e.hasOwnProperty("samplingPercentage")&&(r.samplingPercentage=e.samplingPercentage),void 0!==e.experimentId&&null!==e.experimentId&&e.hasOwnProperty("experimentId")&&(r.experimentId=e.experimentId),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.SearchTabProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.isVisible=!1,o.prototype.tabLabel=null,o.prototype.baseUrl="",o.prototype.viewportPrefix="",o.prototype.inputBox=r.emptyArray,o.prototype.requirement=null;var a={1:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.SearchTabProto.InputBoxInfo",5:"keyhole.dbroot.RequirementProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.SearchTabProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.isVisible=e.bool();break;case 2:o.tabLabel=a[1].decode(e,e.uint32());break;case 3:o.baseUrl=e.string();break;case 4:o.viewportPrefix=e.string();break;case 5:o.inputBox&&o.inputBox.length||(o.inputBox=[]),o.inputBox.push(a[4].decode(e,e.uint32()));break;case 6:o.requirement=a[5].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if("boolean"!=typeof e.isVisible)return"isVisible: boolean expected";if(void 0!==e.tabLabel&&null!==e.tabLabel){var t=a[1].verify(e.tabLabel);if(t)return"tabLabel."+t}if(void 0!==e.baseUrl&&!r.isString(e.baseUrl))return"baseUrl: string expected";if(void 0!==e.viewportPrefix&&!r.isString(e.viewportPrefix))return"viewportPrefix: string expected";if(void 0!==e.inputBox){if(!Array.isArray(e.inputBox))return"inputBox: array expected";for(var i=0;i<e.inputBox.length;++i){var t=a[4].verify(e.inputBox[i]);if(t)return"inputBox."+t}}if(void 0!==e.requirement&&null!==e.requirement){var t=a[5].verify(e.requirement);if(t)return"requirement."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.SearchTabProto)return e;var t=new n.keyhole.dbroot.SearchTabProto;if(void 0!==e.isVisible&&null!==e.isVisible&&(t.isVisible=Boolean(e.isVisible)),void 0!==e.tabLabel&&null!==e.tabLabel){if("object"!=typeof e.tabLabel)throw TypeError(".keyhole.dbroot.SearchTabProto.tabLabel: object expected");t.tabLabel=a[1].fromObject(e.tabLabel)}if(void 0!==e.baseUrl&&null!==e.baseUrl&&(t.baseUrl=String(e.baseUrl)),void 0!==e.viewportPrefix&&null!==e.viewportPrefix&&(t.viewportPrefix=String(e.viewportPrefix)),e.inputBox){if(!Array.isArray(e.inputBox))throw TypeError(".keyhole.dbroot.SearchTabProto.inputBox: array expected");t.inputBox=[];for(var r=0;r<e.inputBox.length;++r){if("object"!=typeof e.inputBox[r])throw TypeError(".keyhole.dbroot.SearchTabProto.inputBox: object expected");t.inputBox[r]=a[4].fromObject(e.inputBox[r])}}if(void 0!==e.requirement&&null!==e.requirement){if("object"!=typeof e.requirement)throw TypeError(".keyhole.dbroot.SearchTabProto.requirement: object expected");t.requirement=a[5].fromObject(e.requirement)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.inputBox=[]),t.defaults&&(r.isVisible=!1,r.tabLabel=null,r.baseUrl="",r.viewportPrefix="",r.requirement=null),void 0!==e.isVisible&&null!==e.isVisible&&e.hasOwnProperty("isVisible")&&(r.isVisible=e.isVisible),void 0!==e.tabLabel&&null!==e.tabLabel&&e.hasOwnProperty("tabLabel")&&(r.tabLabel=a[1].toObject(e.tabLabel,t)),void 0!==e.baseUrl&&null!==e.baseUrl&&e.hasOwnProperty("baseUrl")&&(r.baseUrl=e.baseUrl),void 0!==e.viewportPrefix&&null!==e.viewportPrefix&&e.hasOwnProperty("viewportPrefix")&&(r.viewportPrefix=e.viewportPrefix),void 0!==e.inputBox&&null!==e.inputBox&&e.hasOwnProperty("inputBox")){r.inputBox=[];for(var i=0;i<e.inputBox.length;++i)r.inputBox[i]=a[4].toObject(e.inputBox[i],t)}return void 0!==e.requirement&&null!==e.requirement&&e.hasOwnProperty("requirement")&&(r.requirement=a[5].toObject(e.requirement,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.InputBoxInfo=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.label=null,o.prototype.queryVerb="",o.prototype.queryPrepend="";var a={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.SearchTabProto.InputBoxInfo;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.label=a[0].decode(e,e.uint32());break;case 2:o.queryVerb=e.string();break;case 3:o.queryPrepend=e.string();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t=a[0].verify(e.label);return t?"label."+t:r.isString(e.queryVerb)?void 0===e.queryPrepend||r.isString(e.queryPrepend)?null:"queryPrepend: string expected":"queryVerb: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.SearchTabProto.InputBoxInfo)return e;var t=new n.keyhole.dbroot.SearchTabProto.InputBoxInfo;if(void 0!==e.label&&null!==e.label){if("object"!=typeof e.label)throw TypeError(".keyhole.dbroot.SearchTabProto.InputBoxInfo.label: object expected");t.label=a[0].fromObject(e.label)}return void 0!==e.queryVerb&&null!==e.queryVerb&&(t.queryVerb=String(e.queryVerb)),void 0!==e.queryPrepend&&null!==e.queryPrepend&&(t.queryPrepend=String(e.queryPrepend)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.label=null,r.queryVerb="",r.queryPrepend=""),void 0!==e.label&&null!==e.label&&e.hasOwnProperty("label")&&(r.label=a[0].toObject(e.label,t)),void 0!==e.queryVerb&&null!==e.queryVerb&&e.hasOwnProperty("queryVerb")&&(r.queryVerb=e.queryVerb),void 0!==e.queryPrepend&&null!==e.queryPrepend&&e.hasOwnProperty("queryPrepend")&&(r.queryPrepend=e.queryPrepend),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o}(),o.CobrandProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.logoUrl="",o.prototype.xCoord=null,o.prototype.yCoord=null,o.prototype.tiePoint=6,o.prototype.screenSize=0;var a={1:"keyhole.dbroot.CobrandProto.Coord",2:"keyhole.dbroot.CobrandProto.Coord",3:"keyhole.dbroot.CobrandProto.TiePoint"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.CobrandProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.logoUrl=e.string();break;case 2:o.xCoord=a[1].decode(e,e.uint32());break;case 3:o.yCoord=a[2].decode(e,e.uint32());break;case 4:o.tiePoint=e.uint32();break;case 5:o.screenSize=e.double();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.logoUrl))return"logoUrl: string expected";if(void 0!==e.xCoord&&null!==e.xCoord){var t=a[1].verify(e.xCoord);if(t)return"xCoord."+t}if(void 0!==e.yCoord&&null!==e.yCoord){var t=a[2].verify(e.yCoord);if(t)return"yCoord."+t}if(void 0!==e.tiePoint)switch(e.tiePoint){default:return"tiePoint: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:}return void 0!==e.screenSize&&"number"!=typeof e.screenSize?"screenSize: number expected":null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.CobrandProto)return e;var t=new n.keyhole.dbroot.CobrandProto;if(void 0!==e.logoUrl&&null!==e.logoUrl&&(t.logoUrl=String(e.logoUrl)),void 0!==e.xCoord&&null!==e.xCoord){if("object"!=typeof e.xCoord)throw TypeError(".keyhole.dbroot.CobrandProto.xCoord: object expected");t.xCoord=a[1].fromObject(e.xCoord)}if(void 0!==e.yCoord&&null!==e.yCoord){if("object"!=typeof e.yCoord)throw TypeError(".keyhole.dbroot.CobrandProto.yCoord: object expected");t.yCoord=a[2].fromObject(e.yCoord)}switch(e.tiePoint){case"TOP_LEFT":case 0:t.tiePoint=0;break;case"TOP_CENTER":case 1:t.tiePoint=1;break;case"TOP_RIGHT":case 2:t.tiePoint=2;break;case"MID_LEFT":case 3:t.tiePoint=3;break;case"MID_CENTER":case 4:t.tiePoint=4;break;case"MID_RIGHT":case 5:t.tiePoint=5;break;case"BOTTOM_LEFT":case 6:t.tiePoint=6;break;case"BOTTOM_CENTER":case 7:t.tiePoint=7;break;case"BOTTOM_RIGHT":case 8:t.tiePoint=8}return void 0!==e.screenSize&&null!==e.screenSize&&(t.screenSize=Number(e.screenSize)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.logoUrl="",r.xCoord=null,r.yCoord=null,r.tiePoint=t.enums===String?"BOTTOM_LEFT":6,r.screenSize=0),void 0!==e.logoUrl&&null!==e.logoUrl&&e.hasOwnProperty("logoUrl")&&(r.logoUrl=e.logoUrl),void 0!==e.xCoord&&null!==e.xCoord&&e.hasOwnProperty("xCoord")&&(r.xCoord=a[1].toObject(e.xCoord,t)),void 0!==e.yCoord&&null!==e.yCoord&&e.hasOwnProperty("yCoord")&&(r.yCoord=a[2].toObject(e.yCoord,t)),void 0!==e.tiePoint&&null!==e.tiePoint&&e.hasOwnProperty("tiePoint")&&(r.tiePoint=t.enums===String?a[3][e.tiePoint]:e.tiePoint),void 0!==e.screenSize&&null!==e.screenSize&&e.hasOwnProperty("screenSize")&&(r.screenSize=e.screenSize),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.Coord=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return r.prototype.value=0,r.prototype.isRelative=!1,r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.CobrandProto.Coord;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.value=e.double();break;case 2:o.isRelative=e.bool();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":"number"!=typeof e.value?"value: number expected":void 0!==e.isRelative&&"boolean"!=typeof e.isRelative?"isRelative: boolean expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.CobrandProto.Coord)return e;var t=new n.keyhole.dbroot.CobrandProto.Coord;return void 0!==e.value&&null!==e.value&&(t.value=Number(e.value)),void 0!==e.isRelative&&null!==e.isRelative&&(t.isRelative=Boolean(e.isRelative)),t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.value=0,r.isRelative=!1),void 0!==e.value&&null!==e.value&&e.hasOwnProperty("value")&&(r.value=e.value),void 0!==e.isRelative&&null!==e.isRelative&&e.hasOwnProperty("isRelative")&&(r.isRelative=e.isRelative),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.TiePoint=function(){var e={},t=Object.create(e);return t.TOP_LEFT=0,t.TOP_CENTER=1,t.TOP_RIGHT=2,t.MID_LEFT=3,t.MID_CENTER=4,t.MID_RIGHT=5,t.BOTTOM_LEFT=6,t.BOTTOM_CENTER=7,t.BOTTOM_RIGHT=8,t}(),o}(),o.DatabaseDescriptionProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.databaseName=null,o.prototype.databaseUrl="";var a={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DatabaseDescriptionProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.databaseName=a[0].decode(e,e.uint32());break;case 2:o.databaseUrl=e.string();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.databaseName&&null!==e.databaseName){var t=a[0].verify(e.databaseName);if(t)return"databaseName."+t}return r.isString(e.databaseUrl)?null:"databaseUrl: string expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DatabaseDescriptionProto)return e;var t=new n.keyhole.dbroot.DatabaseDescriptionProto;if(void 0!==e.databaseName&&null!==e.databaseName){if("object"!=typeof e.databaseName)throw TypeError(".keyhole.dbroot.DatabaseDescriptionProto.databaseName: object expected");t.databaseName=a[0].fromObject(e.databaseName)}return void 0!==e.databaseUrl&&null!==e.databaseUrl&&(t.databaseUrl=String(e.databaseUrl)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.databaseName=null,r.databaseUrl=""),void 0!==e.databaseName&&null!==e.databaseName&&e.hasOwnProperty("databaseName")&&(r.databaseName=a[0].toObject(e.databaseName,t)),void 0!==e.databaseUrl&&null!==e.databaseUrl&&e.hasOwnProperty("databaseUrl")&&(r.databaseUrl=e.databaseUrl),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.ConfigScriptProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.scriptName="",i.prototype.scriptData="",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.ConfigScriptProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.scriptName=e.string();break;case 2:o.scriptData=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isString(e.scriptName)?r.isString(e.scriptData)?null:"scriptData: string expected":"scriptName: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.ConfigScriptProto)return e;var t=new n.keyhole.dbroot.ConfigScriptProto;return void 0!==e.scriptName&&null!==e.scriptName&&(t.scriptName=String(e.scriptName)),void 0!==e.scriptData&&null!==e.scriptData&&(t.scriptData=String(e.scriptData)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.scriptName="",r.scriptData=""),void 0!==e.scriptName&&null!==e.scriptName&&e.hasOwnProperty("scriptName")&&(r.scriptName=e.scriptName),void 0!==e.scriptData&&null!==e.scriptData&&e.hasOwnProperty("scriptData")&&(r.scriptData=e.scriptData),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.SwoopParamsProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return r.prototype.startDistInMeters=0,r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.SwoopParamsProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.startDistInMeters=e.double();break;default:e.skipType(7&a)}}return o},r.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0!==e.startDistInMeters&&"number"!=typeof e.startDistInMeters?"startDistInMeters: number expected":null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.SwoopParamsProto)return e;var t=new n.keyhole.dbroot.SwoopParamsProto;return void 0!==e.startDistInMeters&&null!==e.startDistInMeters&&(t.startDistInMeters=Number(e.startDistInMeters)), +t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.startDistInMeters=0),void 0!==e.startDistInMeters&&null!==e.startDistInMeters&&e.hasOwnProperty("startDistInMeters")&&(r.startDistInMeters=e.startDistInMeters),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.PostingServerProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.name=null,r.prototype.baseUrl=null,r.prototype.postWizardPath=null,r.prototype.fileSubmitPath=null;var o={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto",2:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.StringIdOrValueProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.PostingServerProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.name=o[0].decode(e,e.uint32());break;case 2:a.baseUrl=o[1].decode(e,e.uint32());break;case 3:a.postWizardPath=o[2].decode(e,e.uint32());break;case 4:a.fileSubmitPath=o[3].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.name&&null!==e.name){var t=o[0].verify(e.name);if(t)return"name."+t}if(void 0!==e.baseUrl&&null!==e.baseUrl){var t=o[1].verify(e.baseUrl);if(t)return"baseUrl."+t}if(void 0!==e.postWizardPath&&null!==e.postWizardPath){var t=o[2].verify(e.postWizardPath);if(t)return"postWizardPath."+t}if(void 0!==e.fileSubmitPath&&null!==e.fileSubmitPath){var t=o[3].verify(e.fileSubmitPath);if(t)return"fileSubmitPath."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PostingServerProto)return e;var t=new n.keyhole.dbroot.PostingServerProto;if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.PostingServerProto.name: object expected");t.name=o[0].fromObject(e.name)}if(void 0!==e.baseUrl&&null!==e.baseUrl){if("object"!=typeof e.baseUrl)throw TypeError(".keyhole.dbroot.PostingServerProto.baseUrl: object expected");t.baseUrl=o[1].fromObject(e.baseUrl)}if(void 0!==e.postWizardPath&&null!==e.postWizardPath){if("object"!=typeof e.postWizardPath)throw TypeError(".keyhole.dbroot.PostingServerProto.postWizardPath: object expected");t.postWizardPath=o[2].fromObject(e.postWizardPath)}if(void 0!==e.fileSubmitPath&&null!==e.fileSubmitPath){if("object"!=typeof e.fileSubmitPath)throw TypeError(".keyhole.dbroot.PostingServerProto.fileSubmitPath: object expected");t.fileSubmitPath=o[3].fromObject(e.fileSubmitPath)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.name=null,r.baseUrl=null,r.postWizardPath=null,r.fileSubmitPath=null),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=o[0].toObject(e.name,t)),void 0!==e.baseUrl&&null!==e.baseUrl&&e.hasOwnProperty("baseUrl")&&(r.baseUrl=o[1].toObject(e.baseUrl,t)),void 0!==e.postWizardPath&&null!==e.postWizardPath&&e.hasOwnProperty("postWizardPath")&&(r.postWizardPath=o[2].toObject(e.postWizardPath,t)),void 0!==e.fileSubmitPath&&null!==e.fileSubmitPath&&e.hasOwnProperty("fileSubmitPath")&&(r.fileSubmitPath=o[3].toObject(e.fileSubmitPath,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.PlanetaryDatabaseProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.url=null,r.prototype.name=null;var o={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.PlanetaryDatabaseProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.url=o[0].decode(e,e.uint32());break;case 2:a.name=o[1].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";var t=o[0].verify(e.url);if(t)return"url."+t;var t=o[1].verify(e.name);return t?"name."+t:null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.PlanetaryDatabaseProto)return e;var t=new n.keyhole.dbroot.PlanetaryDatabaseProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.PlanetaryDatabaseProto.url: object expected");t.url=o[0].fromObject(e.url)}if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.PlanetaryDatabaseProto.name: object expected");t.name=o[1].fromObject(e.name)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.name=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=o[1].toObject(e.name,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.LogServerProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.url=null,o.prototype.enable=!1,o.prototype.throttlingFactor=1;var a={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.LogServerProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.url=a[0].decode(e,e.uint32());break;case 2:o.enable=e.bool();break;case 3:o.throttlingFactor=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=a[0].verify(e.url);if(t)return"url."+t}return void 0!==e.enable&&"boolean"!=typeof e.enable?"enable: boolean expected":void 0===e.throttlingFactor||r.isInteger(e.throttlingFactor)?null:"throttlingFactor: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.LogServerProto)return e;var t=new n.keyhole.dbroot.LogServerProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.LogServerProto.url: object expected");t.url=a[0].fromObject(e.url)}return void 0!==e.enable&&null!==e.enable&&(t.enable=Boolean(e.enable)),void 0!==e.throttlingFactor&&null!==e.throttlingFactor&&(t.throttlingFactor=0|e.throttlingFactor),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.enable=!1,r.throttlingFactor=1),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=a[0].toObject(e.url,t)),void 0!==e.enable&&null!==e.enable&&e.hasOwnProperty("enable")&&(r.enable=e.enable),void 0!==e.throttlingFactor&&null!==e.throttlingFactor&&e.hasOwnProperty("throttlingFactor")&&(r.throttlingFactor=e.throttlingFactor),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.EndSnippetProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.model=null,o.prototype.authServerUrl=null,o.prototype.disableAuthentication=!1,o.prototype.mfeDomains=r.emptyArray,o.prototype.mfeLangParam="hl=$5Bhl5D",o.prototype.adsUrlPatterns="",o.prototype.reverseGeocoderUrl=null,o.prototype.reverseGeocoderProtocolVersion=3,o.prototype.skyDatabaseIsAvailable=!0,o.prototype.skyDatabaseUrl=null,o.prototype.defaultWebPageIntlUrl=null,o.prototype.numStartUpTips=17,o.prototype.startUpTipsUrl=null,o.prototype.numProStartUpTips=0,o.prototype.proStartUpTipsUrl=null,o.prototype.startupTipsIntlUrl=null,o.prototype.userGuideIntlUrl=null,o.prototype.supportCenterIntlUrl=null,o.prototype.businessListingIntlUrl=null,o.prototype.supportAnswerIntlUrl=null,o.prototype.supportTopicIntlUrl=null,o.prototype.supportRequestIntlUrl=null,o.prototype.earthIntlUrl=null,o.prototype.addContentUrl=null,o.prototype.sketchupNotInstalledUrl=null,o.prototype.sketchupErrorUrl=null,o.prototype.freeLicenseUrl=null,o.prototype.proLicenseUrl=null,o.prototype.tutorialUrl=null,o.prototype.keyboardShortcutsUrl=null,o.prototype.releaseNotesUrl=null,o.prototype.hideUserData=!1,o.prototype.useGeLogo=!0,o.prototype.dioramaDescriptionUrlBase=null,o.prototype.dioramaDefaultColor=4291281607,o.prototype.dioramaBlacklistUrl=null,o.prototype.clientOptions=null,o.prototype.fetchingOptions=null,o.prototype.timeMachineOptions=null,o.prototype.csiOptions=null,o.prototype.searchTab=r.emptyArray,o.prototype.cobrandInfo=r.emptyArray,o.prototype.validDatabase=r.emptyArray,o.prototype.configScript=r.emptyArray,o.prototype.deauthServerUrl=null,o.prototype.swoopParameters=null,o.prototype.bbsServerInfo=null,o.prototype.dataErrorServerInfo=null,o.prototype.planetaryDatabase=r.emptyArray,o.prototype.logServer=null,o.prototype.autopiaOptions=null,o.prototype.searchConfig=null,o.prototype.searchInfo=null,o.prototype.elevationServiceBaseUrl="http://maps.google.com/maps/api/elevation/",o.prototype.elevationProfileQueryDelay=500,o.prototype.proUpgradeUrl=null,o.prototype.earthCommunityUrl=null,o.prototype.googleMapsUrl=null,o.prototype.sharingUrl=null,o.prototype.privacyPolicyUrl=null,o.prototype.doGplusUserCheck=!1,o.prototype.rocktreeDataProto=null,o.prototype.filmstripConfig=r.emptyArray,o.prototype.showSigninButton=!1,o.prototype.proMeasureUpsellUrl=null,o.prototype.proPrintUpsellUrl=null,o.prototype.starDataProto=null,o.prototype.feedbackUrl=null,o.prototype.oauth2LoginUrl=null;var a={0:"keyhole.dbroot.PlanetModelProto",1:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.MfeDomainFeaturesProto",6:"keyhole.dbroot.StringIdOrValueProto",9:"keyhole.dbroot.StringIdOrValueProto",10:"keyhole.dbroot.StringIdOrValueProto",12:"keyhole.dbroot.StringIdOrValueProto",14:"keyhole.dbroot.StringIdOrValueProto",15:"keyhole.dbroot.StringIdOrValueProto",16:"keyhole.dbroot.StringIdOrValueProto",17:"keyhole.dbroot.StringIdOrValueProto",18:"keyhole.dbroot.StringIdOrValueProto",19:"keyhole.dbroot.StringIdOrValueProto",20:"keyhole.dbroot.StringIdOrValueProto",21:"keyhole.dbroot.StringIdOrValueProto",22:"keyhole.dbroot.StringIdOrValueProto",23:"keyhole.dbroot.StringIdOrValueProto",24:"keyhole.dbroot.StringIdOrValueProto",25:"keyhole.dbroot.StringIdOrValueProto",26:"keyhole.dbroot.StringIdOrValueProto",27:"keyhole.dbroot.StringIdOrValueProto",28:"keyhole.dbroot.StringIdOrValueProto",29:"keyhole.dbroot.StringIdOrValueProto",30:"keyhole.dbroot.StringIdOrValueProto",33:"keyhole.dbroot.StringIdOrValueProto",35:"keyhole.dbroot.StringIdOrValueProto",36:"keyhole.dbroot.ClientOptionsProto",37:"keyhole.dbroot.FetchingOptionsProto",38:"keyhole.dbroot.TimeMachineOptionsProto",39:"keyhole.dbroot.CSIOptionsProto",40:"keyhole.dbroot.SearchTabProto",41:"keyhole.dbroot.CobrandProto",42:"keyhole.dbroot.DatabaseDescriptionProto",43:"keyhole.dbroot.ConfigScriptProto",44:"keyhole.dbroot.StringIdOrValueProto",45:"keyhole.dbroot.SwoopParamsProto",46:"keyhole.dbroot.PostingServerProto",47:"keyhole.dbroot.PostingServerProto",48:"keyhole.dbroot.PlanetaryDatabaseProto",49:"keyhole.dbroot.LogServerProto",50:"keyhole.dbroot.AutopiaOptionsProto",51:"keyhole.dbroot.EndSnippetProto.SearchConfigProto",52:"keyhole.dbroot.EndSnippetProto.SearchInfoProto",55:"keyhole.dbroot.StringIdOrValueProto",56:"keyhole.dbroot.StringIdOrValueProto",57:"keyhole.dbroot.StringIdOrValueProto",58:"keyhole.dbroot.StringIdOrValueProto",59:"keyhole.dbroot.StringIdOrValueProto",61:"keyhole.dbroot.EndSnippetProto.RockTreeDataProto",62:"keyhole.dbroot.EndSnippetProto.FilmstripConfigProto",64:"keyhole.dbroot.StringIdOrValueProto",65:"keyhole.dbroot.StringIdOrValueProto",66:"keyhole.dbroot.EndSnippetProto.StarDataProto",67:"keyhole.dbroot.StringIdOrValueProto",68:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.model=a[0].decode(e,e.uint32());break;case 2:o.authServerUrl=a[1].decode(e,e.uint32());break;case 3:o.disableAuthentication=e.bool();break;case 4:o.mfeDomains&&o.mfeDomains.length||(o.mfeDomains=[]),o.mfeDomains.push(a[3].decode(e,e.uint32()));break;case 5:o.mfeLangParam=e.string();break;case 6:o.adsUrlPatterns=e.string();break;case 7:o.reverseGeocoderUrl=a[6].decode(e,e.uint32());break;case 8:o.reverseGeocoderProtocolVersion=e.int32();break;case 9:o.skyDatabaseIsAvailable=e.bool();break;case 10:o.skyDatabaseUrl=a[9].decode(e,e.uint32());break;case 11:o.defaultWebPageIntlUrl=a[10].decode(e,e.uint32());break;case 12:o.numStartUpTips=e.int32();break;case 13:o.startUpTipsUrl=a[12].decode(e,e.uint32());break;case 51:o.numProStartUpTips=e.int32();break;case 52:o.proStartUpTipsUrl=a[14].decode(e,e.uint32());break;case 64:o.startupTipsIntlUrl=a[15].decode(e,e.uint32());break;case 14:o.userGuideIntlUrl=a[16].decode(e,e.uint32());break;case 15:o.supportCenterIntlUrl=a[17].decode(e,e.uint32());break;case 16:o.businessListingIntlUrl=a[18].decode(e,e.uint32());break;case 17:o.supportAnswerIntlUrl=a[19].decode(e,e.uint32());break;case 18:o.supportTopicIntlUrl=a[20].decode(e,e.uint32());break;case 19:o.supportRequestIntlUrl=a[21].decode(e,e.uint32());break;case 20:o.earthIntlUrl=a[22].decode(e,e.uint32());break;case 21:o.addContentUrl=a[23].decode(e,e.uint32());break;case 22:o.sketchupNotInstalledUrl=a[24].decode(e,e.uint32());break;case 23:o.sketchupErrorUrl=a[25].decode(e,e.uint32());break;case 24:o.freeLicenseUrl=a[26].decode(e,e.uint32());break;case 25:o.proLicenseUrl=a[27].decode(e,e.uint32());break;case 48:o.tutorialUrl=a[28].decode(e,e.uint32());break;case 49:o.keyboardShortcutsUrl=a[29].decode(e,e.uint32());break;case 50:o.releaseNotesUrl=a[30].decode(e,e.uint32());break;case 26:o.hideUserData=e.bool();break;case 27:o.useGeLogo=e.bool();break;case 28:o.dioramaDescriptionUrlBase=a[33].decode(e,e.uint32());break;case 29:o.dioramaDefaultColor=e.uint32();break;case 53:o.dioramaBlacklistUrl=a[35].decode(e,e.uint32());break;case 30:o.clientOptions=a[36].decode(e,e.uint32());break;case 31:o.fetchingOptions=a[37].decode(e,e.uint32());break;case 32:o.timeMachineOptions=a[38].decode(e,e.uint32());break;case 33:o.csiOptions=a[39].decode(e,e.uint32());break;case 34:o.searchTab&&o.searchTab.length||(o.searchTab=[]),o.searchTab.push(a[40].decode(e,e.uint32()));break;case 35:o.cobrandInfo&&o.cobrandInfo.length||(o.cobrandInfo=[]),o.cobrandInfo.push(a[41].decode(e,e.uint32()));break;case 36:o.validDatabase&&o.validDatabase.length||(o.validDatabase=[]),o.validDatabase.push(a[42].decode(e,e.uint32()));break;case 37:o.configScript&&o.configScript.length||(o.configScript=[]),o.configScript.push(a[43].decode(e,e.uint32()));break;case 38:o.deauthServerUrl=a[44].decode(e,e.uint32());break;case 39:o.swoopParameters=a[45].decode(e,e.uint32());break;case 40:o.bbsServerInfo=a[46].decode(e,e.uint32());break;case 41:o.dataErrorServerInfo=a[47].decode(e,e.uint32());break;case 42:o.planetaryDatabase&&o.planetaryDatabase.length||(o.planetaryDatabase=[]),o.planetaryDatabase.push(a[48].decode(e,e.uint32()));break;case 43:o.logServer=a[49].decode(e,e.uint32());break;case 44:o.autopiaOptions=a[50].decode(e,e.uint32());break;case 54:o.searchConfig=a[51].decode(e,e.uint32());break;case 45:o.searchInfo=a[52].decode(e,e.uint32());break;case 46:o.elevationServiceBaseUrl=e.string();break;case 47:o.elevationProfileQueryDelay=e.int32();break;case 55:o.proUpgradeUrl=a[55].decode(e,e.uint32());break;case 56:o.earthCommunityUrl=a[56].decode(e,e.uint32());break;case 57:o.googleMapsUrl=a[57].decode(e,e.uint32());break;case 58:o.sharingUrl=a[58].decode(e,e.uint32());break;case 59:o.privacyPolicyUrl=a[59].decode(e,e.uint32());break;case 60:o.doGplusUserCheck=e.bool();break;case 61:o.rocktreeDataProto=a[61].decode(e,e.uint32());break;case 62:o.filmstripConfig&&o.filmstripConfig.length||(o.filmstripConfig=[]),o.filmstripConfig.push(a[62].decode(e,e.uint32()));break;case 63:o.showSigninButton=e.bool();break;case 65:o.proMeasureUpsellUrl=a[64].decode(e,e.uint32());break;case 66:o.proPrintUpsellUrl=a[65].decode(e,e.uint32());break;case 67:o.starDataProto=a[66].decode(e,e.uint32());break;case 68:o.feedbackUrl=a[67].decode(e,e.uint32());break;case 69:o.oauth2LoginUrl=a[68].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.model&&null!==e.model){var t=a[0].verify(e.model);if(t)return"model."+t}if(void 0!==e.authServerUrl&&null!==e.authServerUrl){var t=a[1].verify(e.authServerUrl);if(t)return"authServerUrl."+t}if(void 0!==e.disableAuthentication&&"boolean"!=typeof e.disableAuthentication)return"disableAuthentication: boolean expected";if(void 0!==e.mfeDomains){if(!Array.isArray(e.mfeDomains))return"mfeDomains: array expected";for(var i=0;i<e.mfeDomains.length;++i){var t=a[3].verify(e.mfeDomains[i]);if(t)return"mfeDomains."+t}}if(void 0!==e.mfeLangParam&&!r.isString(e.mfeLangParam))return"mfeLangParam: string expected";if(void 0!==e.adsUrlPatterns&&!r.isString(e.adsUrlPatterns))return"adsUrlPatterns: string expected";if(void 0!==e.reverseGeocoderUrl&&null!==e.reverseGeocoderUrl){var t=a[6].verify(e.reverseGeocoderUrl);if(t)return"reverseGeocoderUrl."+t}if(void 0!==e.reverseGeocoderProtocolVersion&&!r.isInteger(e.reverseGeocoderProtocolVersion))return"reverseGeocoderProtocolVersion: integer expected";if(void 0!==e.skyDatabaseIsAvailable&&"boolean"!=typeof e.skyDatabaseIsAvailable)return"skyDatabaseIsAvailable: boolean expected";if(void 0!==e.skyDatabaseUrl&&null!==e.skyDatabaseUrl){var t=a[9].verify(e.skyDatabaseUrl);if(t)return"skyDatabaseUrl."+t}if(void 0!==e.defaultWebPageIntlUrl&&null!==e.defaultWebPageIntlUrl){var t=a[10].verify(e.defaultWebPageIntlUrl);if(t)return"defaultWebPageIntlUrl."+t}if(void 0!==e.numStartUpTips&&!r.isInteger(e.numStartUpTips))return"numStartUpTips: integer expected";if(void 0!==e.startUpTipsUrl&&null!==e.startUpTipsUrl){var t=a[12].verify(e.startUpTipsUrl);if(t)return"startUpTipsUrl."+t}if(void 0!==e.numProStartUpTips&&!r.isInteger(e.numProStartUpTips))return"numProStartUpTips: integer expected";if(void 0!==e.proStartUpTipsUrl&&null!==e.proStartUpTipsUrl){var t=a[14].verify(e.proStartUpTipsUrl);if(t)return"proStartUpTipsUrl."+t}if(void 0!==e.startupTipsIntlUrl&&null!==e.startupTipsIntlUrl){var t=a[15].verify(e.startupTipsIntlUrl);if(t)return"startupTipsIntlUrl."+t}if(void 0!==e.userGuideIntlUrl&&null!==e.userGuideIntlUrl){var t=a[16].verify(e.userGuideIntlUrl);if(t)return"userGuideIntlUrl."+t}if(void 0!==e.supportCenterIntlUrl&&null!==e.supportCenterIntlUrl){var t=a[17].verify(e.supportCenterIntlUrl);if(t)return"supportCenterIntlUrl."+t}if(void 0!==e.businessListingIntlUrl&&null!==e.businessListingIntlUrl){var t=a[18].verify(e.businessListingIntlUrl);if(t)return"businessListingIntlUrl."+t}if(void 0!==e.supportAnswerIntlUrl&&null!==e.supportAnswerIntlUrl){var t=a[19].verify(e.supportAnswerIntlUrl);if(t)return"supportAnswerIntlUrl."+t}if(void 0!==e.supportTopicIntlUrl&&null!==e.supportTopicIntlUrl){var t=a[20].verify(e.supportTopicIntlUrl);if(t)return"supportTopicIntlUrl."+t}if(void 0!==e.supportRequestIntlUrl&&null!==e.supportRequestIntlUrl){var t=a[21].verify(e.supportRequestIntlUrl);if(t)return"supportRequestIntlUrl."+t}if(void 0!==e.earthIntlUrl&&null!==e.earthIntlUrl){var t=a[22].verify(e.earthIntlUrl);if(t)return"earthIntlUrl."+t}if(void 0!==e.addContentUrl&&null!==e.addContentUrl){var t=a[23].verify(e.addContentUrl);if(t)return"addContentUrl."+t}if(void 0!==e.sketchupNotInstalledUrl&&null!==e.sketchupNotInstalledUrl){var t=a[24].verify(e.sketchupNotInstalledUrl);if(t)return"sketchupNotInstalledUrl."+t}if(void 0!==e.sketchupErrorUrl&&null!==e.sketchupErrorUrl){var t=a[25].verify(e.sketchupErrorUrl);if(t)return"sketchupErrorUrl."+t}if(void 0!==e.freeLicenseUrl&&null!==e.freeLicenseUrl){var t=a[26].verify(e.freeLicenseUrl);if(t)return"freeLicenseUrl."+t}if(void 0!==e.proLicenseUrl&&null!==e.proLicenseUrl){var t=a[27].verify(e.proLicenseUrl);if(t)return"proLicenseUrl."+t}if(void 0!==e.tutorialUrl&&null!==e.tutorialUrl){var t=a[28].verify(e.tutorialUrl);if(t)return"tutorialUrl."+t}if(void 0!==e.keyboardShortcutsUrl&&null!==e.keyboardShortcutsUrl){var t=a[29].verify(e.keyboardShortcutsUrl);if(t)return"keyboardShortcutsUrl."+t}if(void 0!==e.releaseNotesUrl&&null!==e.releaseNotesUrl){var t=a[30].verify(e.releaseNotesUrl);if(t)return"releaseNotesUrl."+t}if(void 0!==e.hideUserData&&"boolean"!=typeof e.hideUserData)return"hideUserData: boolean expected";if(void 0!==e.useGeLogo&&"boolean"!=typeof e.useGeLogo)return"useGeLogo: boolean expected";if(void 0!==e.dioramaDescriptionUrlBase&&null!==e.dioramaDescriptionUrlBase){var t=a[33].verify(e.dioramaDescriptionUrlBase);if(t)return"dioramaDescriptionUrlBase."+t}if(void 0!==e.dioramaDefaultColor&&!r.isInteger(e.dioramaDefaultColor))return"dioramaDefaultColor: integer expected";if(void 0!==e.dioramaBlacklistUrl&&null!==e.dioramaBlacklistUrl){var t=a[35].verify(e.dioramaBlacklistUrl);if(t)return"dioramaBlacklistUrl."+t}if(void 0!==e.clientOptions&&null!==e.clientOptions){var t=a[36].verify(e.clientOptions);if(t)return"clientOptions."+t}if(void 0!==e.fetchingOptions&&null!==e.fetchingOptions){var t=a[37].verify(e.fetchingOptions);if(t)return"fetchingOptions."+t}if(void 0!==e.timeMachineOptions&&null!==e.timeMachineOptions){var t=a[38].verify(e.timeMachineOptions);if(t)return"timeMachineOptions."+t}if(void 0!==e.csiOptions&&null!==e.csiOptions){var t=a[39].verify(e.csiOptions);if(t)return"csiOptions."+t}if(void 0!==e.searchTab){if(!Array.isArray(e.searchTab))return"searchTab: array expected";for(var i=0;i<e.searchTab.length;++i){var t=a[40].verify(e.searchTab[i]);if(t)return"searchTab."+t}}if(void 0!==e.cobrandInfo){if(!Array.isArray(e.cobrandInfo))return"cobrandInfo: array expected";for(var i=0;i<e.cobrandInfo.length;++i){var t=a[41].verify(e.cobrandInfo[i]);if(t)return"cobrandInfo."+t}}if(void 0!==e.validDatabase){if(!Array.isArray(e.validDatabase))return"validDatabase: array expected";for(var i=0;i<e.validDatabase.length;++i){var t=a[42].verify(e.validDatabase[i]);if(t)return"validDatabase."+t}}if(void 0!==e.configScript){if(!Array.isArray(e.configScript))return"configScript: array expected";for(var i=0;i<e.configScript.length;++i){var t=a[43].verify(e.configScript[i]);if(t)return"configScript."+t}}if(void 0!==e.deauthServerUrl&&null!==e.deauthServerUrl){var t=a[44].verify(e.deauthServerUrl);if(t)return"deauthServerUrl."+t}if(void 0!==e.swoopParameters&&null!==e.swoopParameters){var t=a[45].verify(e.swoopParameters);if(t)return"swoopParameters."+t}if(void 0!==e.bbsServerInfo&&null!==e.bbsServerInfo){var t=a[46].verify(e.bbsServerInfo);if(t)return"bbsServerInfo."+t}if(void 0!==e.dataErrorServerInfo&&null!==e.dataErrorServerInfo){var t=a[47].verify(e.dataErrorServerInfo);if(t)return"dataErrorServerInfo."+t}if(void 0!==e.planetaryDatabase){if(!Array.isArray(e.planetaryDatabase))return"planetaryDatabase: array expected";for(var i=0;i<e.planetaryDatabase.length;++i){var t=a[48].verify(e.planetaryDatabase[i]);if(t)return"planetaryDatabase."+t}}if(void 0!==e.logServer&&null!==e.logServer){var t=a[49].verify(e.logServer);if(t)return"logServer."+t}if(void 0!==e.autopiaOptions&&null!==e.autopiaOptions){var t=a[50].verify(e.autopiaOptions);if(t)return"autopiaOptions."+t}if(void 0!==e.searchConfig&&null!==e.searchConfig){var t=a[51].verify(e.searchConfig);if(t)return"searchConfig."+t}if(void 0!==e.searchInfo&&null!==e.searchInfo){var t=a[52].verify(e.searchInfo);if(t)return"searchInfo."+t}if(void 0!==e.elevationServiceBaseUrl&&!r.isString(e.elevationServiceBaseUrl))return"elevationServiceBaseUrl: string expected";if(void 0!==e.elevationProfileQueryDelay&&!r.isInteger(e.elevationProfileQueryDelay))return"elevationProfileQueryDelay: integer expected";if(void 0!==e.proUpgradeUrl&&null!==e.proUpgradeUrl){var t=a[55].verify(e.proUpgradeUrl);if(t)return"proUpgradeUrl."+t}if(void 0!==e.earthCommunityUrl&&null!==e.earthCommunityUrl){var t=a[56].verify(e.earthCommunityUrl);if(t)return"earthCommunityUrl."+t}if(void 0!==e.googleMapsUrl&&null!==e.googleMapsUrl){var t=a[57].verify(e.googleMapsUrl);if(t)return"googleMapsUrl."+t}if(void 0!==e.sharingUrl&&null!==e.sharingUrl){var t=a[58].verify(e.sharingUrl);if(t)return"sharingUrl."+t}if(void 0!==e.privacyPolicyUrl&&null!==e.privacyPolicyUrl){var t=a[59].verify(e.privacyPolicyUrl);if(t)return"privacyPolicyUrl."+t}if(void 0!==e.doGplusUserCheck&&"boolean"!=typeof e.doGplusUserCheck)return"doGplusUserCheck: boolean expected";if(void 0!==e.rocktreeDataProto&&null!==e.rocktreeDataProto){var t=a[61].verify(e.rocktreeDataProto);if(t)return"rocktreeDataProto."+t}if(void 0!==e.filmstripConfig){if(!Array.isArray(e.filmstripConfig))return"filmstripConfig: array expected";for(var i=0;i<e.filmstripConfig.length;++i){var t=a[62].verify(e.filmstripConfig[i]);if(t)return"filmstripConfig."+t}}if(void 0!==e.showSigninButton&&"boolean"!=typeof e.showSigninButton)return"showSigninButton: boolean expected";if(void 0!==e.proMeasureUpsellUrl&&null!==e.proMeasureUpsellUrl){var t=a[64].verify(e.proMeasureUpsellUrl);if(t)return"proMeasureUpsellUrl."+t}if(void 0!==e.proPrintUpsellUrl&&null!==e.proPrintUpsellUrl){var t=a[65].verify(e.proPrintUpsellUrl);if(t)return"proPrintUpsellUrl."+t}if(void 0!==e.starDataProto&&null!==e.starDataProto){var t=a[66].verify(e.starDataProto);if(t)return"starDataProto."+t}if(void 0!==e.feedbackUrl&&null!==e.feedbackUrl){var t=a[67].verify(e.feedbackUrl);if(t)return"feedbackUrl."+t}if(void 0!==e.oauth2LoginUrl&&null!==e.oauth2LoginUrl){var t=a[68].verify(e.oauth2LoginUrl);if(t)return"oauth2LoginUrl."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto;if(void 0!==e.model&&null!==e.model){if("object"!=typeof e.model)throw TypeError(".keyhole.dbroot.EndSnippetProto.model: object expected");t.model=a[0].fromObject(e.model)}if(void 0!==e.authServerUrl&&null!==e.authServerUrl){if("object"!=typeof e.authServerUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.authServerUrl: object expected");t.authServerUrl=a[1].fromObject(e.authServerUrl)}if(void 0!==e.disableAuthentication&&null!==e.disableAuthentication&&(t.disableAuthentication=Boolean(e.disableAuthentication)),e.mfeDomains){if(!Array.isArray(e.mfeDomains))throw TypeError(".keyhole.dbroot.EndSnippetProto.mfeDomains: array expected");t.mfeDomains=[];for(var r=0;r<e.mfeDomains.length;++r){if("object"!=typeof e.mfeDomains[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.mfeDomains: object expected");t.mfeDomains[r]=a[3].fromObject(e.mfeDomains[r])}}if(void 0!==e.mfeLangParam&&null!==e.mfeLangParam&&(t.mfeLangParam=String(e.mfeLangParam)),void 0!==e.adsUrlPatterns&&null!==e.adsUrlPatterns&&(t.adsUrlPatterns=String(e.adsUrlPatterns)),void 0!==e.reverseGeocoderUrl&&null!==e.reverseGeocoderUrl){if("object"!=typeof e.reverseGeocoderUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.reverseGeocoderUrl: object expected");t.reverseGeocoderUrl=a[6].fromObject(e.reverseGeocoderUrl)}if(void 0!==e.reverseGeocoderProtocolVersion&&null!==e.reverseGeocoderProtocolVersion&&(t.reverseGeocoderProtocolVersion=0|e.reverseGeocoderProtocolVersion),void 0!==e.skyDatabaseIsAvailable&&null!==e.skyDatabaseIsAvailable&&(t.skyDatabaseIsAvailable=Boolean(e.skyDatabaseIsAvailable)),void 0!==e.skyDatabaseUrl&&null!==e.skyDatabaseUrl){if("object"!=typeof e.skyDatabaseUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.skyDatabaseUrl: object expected");t.skyDatabaseUrl=a[9].fromObject(e.skyDatabaseUrl)}if(void 0!==e.defaultWebPageIntlUrl&&null!==e.defaultWebPageIntlUrl){if("object"!=typeof e.defaultWebPageIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.defaultWebPageIntlUrl: object expected");t.defaultWebPageIntlUrl=a[10].fromObject(e.defaultWebPageIntlUrl)}if(void 0!==e.numStartUpTips&&null!==e.numStartUpTips&&(t.numStartUpTips=0|e.numStartUpTips),void 0!==e.startUpTipsUrl&&null!==e.startUpTipsUrl){if("object"!=typeof e.startUpTipsUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.startUpTipsUrl: object expected");t.startUpTipsUrl=a[12].fromObject(e.startUpTipsUrl)}if(void 0!==e.numProStartUpTips&&null!==e.numProStartUpTips&&(t.numProStartUpTips=0|e.numProStartUpTips),void 0!==e.proStartUpTipsUrl&&null!==e.proStartUpTipsUrl){if("object"!=typeof e.proStartUpTipsUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proStartUpTipsUrl: object expected");t.proStartUpTipsUrl=a[14].fromObject(e.proStartUpTipsUrl)}if(void 0!==e.startupTipsIntlUrl&&null!==e.startupTipsIntlUrl){if("object"!=typeof e.startupTipsIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.startupTipsIntlUrl: object expected");t.startupTipsIntlUrl=a[15].fromObject(e.startupTipsIntlUrl)}if(void 0!==e.userGuideIntlUrl&&null!==e.userGuideIntlUrl){if("object"!=typeof e.userGuideIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.userGuideIntlUrl: object expected");t.userGuideIntlUrl=a[16].fromObject(e.userGuideIntlUrl)}if(void 0!==e.supportCenterIntlUrl&&null!==e.supportCenterIntlUrl){if("object"!=typeof e.supportCenterIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.supportCenterIntlUrl: object expected");t.supportCenterIntlUrl=a[17].fromObject(e.supportCenterIntlUrl)}if(void 0!==e.businessListingIntlUrl&&null!==e.businessListingIntlUrl){if("object"!=typeof e.businessListingIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.businessListingIntlUrl: object expected");t.businessListingIntlUrl=a[18].fromObject(e.businessListingIntlUrl)}if(void 0!==e.supportAnswerIntlUrl&&null!==e.supportAnswerIntlUrl){if("object"!=typeof e.supportAnswerIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.supportAnswerIntlUrl: object expected");t.supportAnswerIntlUrl=a[19].fromObject(e.supportAnswerIntlUrl)}if(void 0!==e.supportTopicIntlUrl&&null!==e.supportTopicIntlUrl){if("object"!=typeof e.supportTopicIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.supportTopicIntlUrl: object expected");t.supportTopicIntlUrl=a[20].fromObject(e.supportTopicIntlUrl)}if(void 0!==e.supportRequestIntlUrl&&null!==e.supportRequestIntlUrl){if("object"!=typeof e.supportRequestIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.supportRequestIntlUrl: object expected");t.supportRequestIntlUrl=a[21].fromObject(e.supportRequestIntlUrl)}if(void 0!==e.earthIntlUrl&&null!==e.earthIntlUrl){if("object"!=typeof e.earthIntlUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.earthIntlUrl: object expected");t.earthIntlUrl=a[22].fromObject(e.earthIntlUrl)}if(void 0!==e.addContentUrl&&null!==e.addContentUrl){if("object"!=typeof e.addContentUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.addContentUrl: object expected");t.addContentUrl=a[23].fromObject(e.addContentUrl)}if(void 0!==e.sketchupNotInstalledUrl&&null!==e.sketchupNotInstalledUrl){if("object"!=typeof e.sketchupNotInstalledUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.sketchupNotInstalledUrl: object expected");t.sketchupNotInstalledUrl=a[24].fromObject(e.sketchupNotInstalledUrl)}if(void 0!==e.sketchupErrorUrl&&null!==e.sketchupErrorUrl){if("object"!=typeof e.sketchupErrorUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.sketchupErrorUrl: object expected");t.sketchupErrorUrl=a[25].fromObject(e.sketchupErrorUrl)}if(void 0!==e.freeLicenseUrl&&null!==e.freeLicenseUrl){if("object"!=typeof e.freeLicenseUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.freeLicenseUrl: object expected");t.freeLicenseUrl=a[26].fromObject(e.freeLicenseUrl)}if(void 0!==e.proLicenseUrl&&null!==e.proLicenseUrl){if("object"!=typeof e.proLicenseUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proLicenseUrl: object expected");t.proLicenseUrl=a[27].fromObject(e.proLicenseUrl)}if(void 0!==e.tutorialUrl&&null!==e.tutorialUrl){ +if("object"!=typeof e.tutorialUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.tutorialUrl: object expected");t.tutorialUrl=a[28].fromObject(e.tutorialUrl)}if(void 0!==e.keyboardShortcutsUrl&&null!==e.keyboardShortcutsUrl){if("object"!=typeof e.keyboardShortcutsUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.keyboardShortcutsUrl: object expected");t.keyboardShortcutsUrl=a[29].fromObject(e.keyboardShortcutsUrl)}if(void 0!==e.releaseNotesUrl&&null!==e.releaseNotesUrl){if("object"!=typeof e.releaseNotesUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.releaseNotesUrl: object expected");t.releaseNotesUrl=a[30].fromObject(e.releaseNotesUrl)}if(void 0!==e.hideUserData&&null!==e.hideUserData&&(t.hideUserData=Boolean(e.hideUserData)),void 0!==e.useGeLogo&&null!==e.useGeLogo&&(t.useGeLogo=Boolean(e.useGeLogo)),void 0!==e.dioramaDescriptionUrlBase&&null!==e.dioramaDescriptionUrlBase){if("object"!=typeof e.dioramaDescriptionUrlBase)throw TypeError(".keyhole.dbroot.EndSnippetProto.dioramaDescriptionUrlBase: object expected");t.dioramaDescriptionUrlBase=a[33].fromObject(e.dioramaDescriptionUrlBase)}if(void 0!==e.dioramaDefaultColor&&null!==e.dioramaDefaultColor&&(t.dioramaDefaultColor=e.dioramaDefaultColor>>>0),void 0!==e.dioramaBlacklistUrl&&null!==e.dioramaBlacklistUrl){if("object"!=typeof e.dioramaBlacklistUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.dioramaBlacklistUrl: object expected");t.dioramaBlacklistUrl=a[35].fromObject(e.dioramaBlacklistUrl)}if(void 0!==e.clientOptions&&null!==e.clientOptions){if("object"!=typeof e.clientOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.clientOptions: object expected");t.clientOptions=a[36].fromObject(e.clientOptions)}if(void 0!==e.fetchingOptions&&null!==e.fetchingOptions){if("object"!=typeof e.fetchingOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.fetchingOptions: object expected");t.fetchingOptions=a[37].fromObject(e.fetchingOptions)}if(void 0!==e.timeMachineOptions&&null!==e.timeMachineOptions){if("object"!=typeof e.timeMachineOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.timeMachineOptions: object expected");t.timeMachineOptions=a[38].fromObject(e.timeMachineOptions)}if(void 0!==e.csiOptions&&null!==e.csiOptions){if("object"!=typeof e.csiOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.csiOptions: object expected");t.csiOptions=a[39].fromObject(e.csiOptions)}if(e.searchTab){if(!Array.isArray(e.searchTab))throw TypeError(".keyhole.dbroot.EndSnippetProto.searchTab: array expected");t.searchTab=[];for(var r=0;r<e.searchTab.length;++r){if("object"!=typeof e.searchTab[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.searchTab: object expected");t.searchTab[r]=a[40].fromObject(e.searchTab[r])}}if(e.cobrandInfo){if(!Array.isArray(e.cobrandInfo))throw TypeError(".keyhole.dbroot.EndSnippetProto.cobrandInfo: array expected");t.cobrandInfo=[];for(var r=0;r<e.cobrandInfo.length;++r){if("object"!=typeof e.cobrandInfo[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.cobrandInfo: object expected");t.cobrandInfo[r]=a[41].fromObject(e.cobrandInfo[r])}}if(e.validDatabase){if(!Array.isArray(e.validDatabase))throw TypeError(".keyhole.dbroot.EndSnippetProto.validDatabase: array expected");t.validDatabase=[];for(var r=0;r<e.validDatabase.length;++r){if("object"!=typeof e.validDatabase[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.validDatabase: object expected");t.validDatabase[r]=a[42].fromObject(e.validDatabase[r])}}if(e.configScript){if(!Array.isArray(e.configScript))throw TypeError(".keyhole.dbroot.EndSnippetProto.configScript: array expected");t.configScript=[];for(var r=0;r<e.configScript.length;++r){if("object"!=typeof e.configScript[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.configScript: object expected");t.configScript[r]=a[43].fromObject(e.configScript[r])}}if(void 0!==e.deauthServerUrl&&null!==e.deauthServerUrl){if("object"!=typeof e.deauthServerUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.deauthServerUrl: object expected");t.deauthServerUrl=a[44].fromObject(e.deauthServerUrl)}if(void 0!==e.swoopParameters&&null!==e.swoopParameters){if("object"!=typeof e.swoopParameters)throw TypeError(".keyhole.dbroot.EndSnippetProto.swoopParameters: object expected");t.swoopParameters=a[45].fromObject(e.swoopParameters)}if(void 0!==e.bbsServerInfo&&null!==e.bbsServerInfo){if("object"!=typeof e.bbsServerInfo)throw TypeError(".keyhole.dbroot.EndSnippetProto.bbsServerInfo: object expected");t.bbsServerInfo=a[46].fromObject(e.bbsServerInfo)}if(void 0!==e.dataErrorServerInfo&&null!==e.dataErrorServerInfo){if("object"!=typeof e.dataErrorServerInfo)throw TypeError(".keyhole.dbroot.EndSnippetProto.dataErrorServerInfo: object expected");t.dataErrorServerInfo=a[47].fromObject(e.dataErrorServerInfo)}if(e.planetaryDatabase){if(!Array.isArray(e.planetaryDatabase))throw TypeError(".keyhole.dbroot.EndSnippetProto.planetaryDatabase: array expected");t.planetaryDatabase=[];for(var r=0;r<e.planetaryDatabase.length;++r){if("object"!=typeof e.planetaryDatabase[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.planetaryDatabase: object expected");t.planetaryDatabase[r]=a[48].fromObject(e.planetaryDatabase[r])}}if(void 0!==e.logServer&&null!==e.logServer){if("object"!=typeof e.logServer)throw TypeError(".keyhole.dbroot.EndSnippetProto.logServer: object expected");t.logServer=a[49].fromObject(e.logServer)}if(void 0!==e.autopiaOptions&&null!==e.autopiaOptions){if("object"!=typeof e.autopiaOptions)throw TypeError(".keyhole.dbroot.EndSnippetProto.autopiaOptions: object expected");t.autopiaOptions=a[50].fromObject(e.autopiaOptions)}if(void 0!==e.searchConfig&&null!==e.searchConfig){if("object"!=typeof e.searchConfig)throw TypeError(".keyhole.dbroot.EndSnippetProto.searchConfig: object expected");t.searchConfig=a[51].fromObject(e.searchConfig)}if(void 0!==e.searchInfo&&null!==e.searchInfo){if("object"!=typeof e.searchInfo)throw TypeError(".keyhole.dbroot.EndSnippetProto.searchInfo: object expected");t.searchInfo=a[52].fromObject(e.searchInfo)}if(void 0!==e.elevationServiceBaseUrl&&null!==e.elevationServiceBaseUrl&&(t.elevationServiceBaseUrl=String(e.elevationServiceBaseUrl)),void 0!==e.elevationProfileQueryDelay&&null!==e.elevationProfileQueryDelay&&(t.elevationProfileQueryDelay=0|e.elevationProfileQueryDelay),void 0!==e.proUpgradeUrl&&null!==e.proUpgradeUrl){if("object"!=typeof e.proUpgradeUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proUpgradeUrl: object expected");t.proUpgradeUrl=a[55].fromObject(e.proUpgradeUrl)}if(void 0!==e.earthCommunityUrl&&null!==e.earthCommunityUrl){if("object"!=typeof e.earthCommunityUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.earthCommunityUrl: object expected");t.earthCommunityUrl=a[56].fromObject(e.earthCommunityUrl)}if(void 0!==e.googleMapsUrl&&null!==e.googleMapsUrl){if("object"!=typeof e.googleMapsUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.googleMapsUrl: object expected");t.googleMapsUrl=a[57].fromObject(e.googleMapsUrl)}if(void 0!==e.sharingUrl&&null!==e.sharingUrl){if("object"!=typeof e.sharingUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.sharingUrl: object expected");t.sharingUrl=a[58].fromObject(e.sharingUrl)}if(void 0!==e.privacyPolicyUrl&&null!==e.privacyPolicyUrl){if("object"!=typeof e.privacyPolicyUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.privacyPolicyUrl: object expected");t.privacyPolicyUrl=a[59].fromObject(e.privacyPolicyUrl)}if(void 0!==e.doGplusUserCheck&&null!==e.doGplusUserCheck&&(t.doGplusUserCheck=Boolean(e.doGplusUserCheck)),void 0!==e.rocktreeDataProto&&null!==e.rocktreeDataProto){if("object"!=typeof e.rocktreeDataProto)throw TypeError(".keyhole.dbroot.EndSnippetProto.rocktreeDataProto: object expected");t.rocktreeDataProto=a[61].fromObject(e.rocktreeDataProto)}if(e.filmstripConfig){if(!Array.isArray(e.filmstripConfig))throw TypeError(".keyhole.dbroot.EndSnippetProto.filmstripConfig: array expected");t.filmstripConfig=[];for(var r=0;r<e.filmstripConfig.length;++r){if("object"!=typeof e.filmstripConfig[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.filmstripConfig: object expected");t.filmstripConfig[r]=a[62].fromObject(e.filmstripConfig[r])}}if(void 0!==e.showSigninButton&&null!==e.showSigninButton&&(t.showSigninButton=Boolean(e.showSigninButton)),void 0!==e.proMeasureUpsellUrl&&null!==e.proMeasureUpsellUrl){if("object"!=typeof e.proMeasureUpsellUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proMeasureUpsellUrl: object expected");t.proMeasureUpsellUrl=a[64].fromObject(e.proMeasureUpsellUrl)}if(void 0!==e.proPrintUpsellUrl&&null!==e.proPrintUpsellUrl){if("object"!=typeof e.proPrintUpsellUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.proPrintUpsellUrl: object expected");t.proPrintUpsellUrl=a[65].fromObject(e.proPrintUpsellUrl)}if(void 0!==e.starDataProto&&null!==e.starDataProto){if("object"!=typeof e.starDataProto)throw TypeError(".keyhole.dbroot.EndSnippetProto.starDataProto: object expected");t.starDataProto=a[66].fromObject(e.starDataProto)}if(void 0!==e.feedbackUrl&&null!==e.feedbackUrl){if("object"!=typeof e.feedbackUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.feedbackUrl: object expected");t.feedbackUrl=a[67].fromObject(e.feedbackUrl)}if(void 0!==e.oauth2LoginUrl&&null!==e.oauth2LoginUrl){if("object"!=typeof e.oauth2LoginUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.oauth2LoginUrl: object expected");t.oauth2LoginUrl=a[68].fromObject(e.oauth2LoginUrl)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.mfeDomains=[],r.searchTab=[],r.cobrandInfo=[],r.validDatabase=[],r.configScript=[],r.planetaryDatabase=[],r.filmstripConfig=[]),t.defaults&&(r.model=null,r.authServerUrl=null,r.disableAuthentication=!1,r.mfeLangParam="hl=$5Bhl5D",r.adsUrlPatterns="",r.reverseGeocoderUrl=null,r.reverseGeocoderProtocolVersion=3,r.skyDatabaseIsAvailable=!0,r.skyDatabaseUrl=null,r.defaultWebPageIntlUrl=null,r.numStartUpTips=17,r.startUpTipsUrl=null,r.numProStartUpTips=0,r.proStartUpTipsUrl=null,r.startupTipsIntlUrl=null,r.userGuideIntlUrl=null,r.supportCenterIntlUrl=null,r.businessListingIntlUrl=null,r.supportAnswerIntlUrl=null,r.supportTopicIntlUrl=null,r.supportRequestIntlUrl=null,r.earthIntlUrl=null,r.addContentUrl=null,r.sketchupNotInstalledUrl=null,r.sketchupErrorUrl=null,r.freeLicenseUrl=null,r.proLicenseUrl=null,r.tutorialUrl=null,r.keyboardShortcutsUrl=null,r.releaseNotesUrl=null,r.hideUserData=!1,r.useGeLogo=!0,r.dioramaDescriptionUrlBase=null,r.dioramaDefaultColor=4291281607,r.dioramaBlacklistUrl=null,r.clientOptions=null,r.fetchingOptions=null,r.timeMachineOptions=null,r.csiOptions=null,r.deauthServerUrl=null,r.swoopParameters=null,r.bbsServerInfo=null,r.dataErrorServerInfo=null,r.logServer=null,r.autopiaOptions=null,r.searchConfig=null,r.searchInfo=null,r.elevationServiceBaseUrl="http://maps.google.com/maps/api/elevation/",r.elevationProfileQueryDelay=500,r.proUpgradeUrl=null,r.earthCommunityUrl=null,r.googleMapsUrl=null,r.sharingUrl=null,r.privacyPolicyUrl=null,r.doGplusUserCheck=!1,r.rocktreeDataProto=null,r.showSigninButton=!1,r.proMeasureUpsellUrl=null,r.proPrintUpsellUrl=null,r.starDataProto=null,r.feedbackUrl=null,r.oauth2LoginUrl=null),void 0!==e.model&&null!==e.model&&e.hasOwnProperty("model")&&(r.model=a[0].toObject(e.model,t)),void 0!==e.authServerUrl&&null!==e.authServerUrl&&e.hasOwnProperty("authServerUrl")&&(r.authServerUrl=a[1].toObject(e.authServerUrl,t)),void 0!==e.disableAuthentication&&null!==e.disableAuthentication&&e.hasOwnProperty("disableAuthentication")&&(r.disableAuthentication=e.disableAuthentication),void 0!==e.mfeDomains&&null!==e.mfeDomains&&e.hasOwnProperty("mfeDomains")){r.mfeDomains=[];for(var i=0;i<e.mfeDomains.length;++i)r.mfeDomains[i]=a[3].toObject(e.mfeDomains[i],t)}if(void 0!==e.mfeLangParam&&null!==e.mfeLangParam&&e.hasOwnProperty("mfeLangParam")&&(r.mfeLangParam=e.mfeLangParam),void 0!==e.adsUrlPatterns&&null!==e.adsUrlPatterns&&e.hasOwnProperty("adsUrlPatterns")&&(r.adsUrlPatterns=e.adsUrlPatterns),void 0!==e.reverseGeocoderUrl&&null!==e.reverseGeocoderUrl&&e.hasOwnProperty("reverseGeocoderUrl")&&(r.reverseGeocoderUrl=a[6].toObject(e.reverseGeocoderUrl,t)),void 0!==e.reverseGeocoderProtocolVersion&&null!==e.reverseGeocoderProtocolVersion&&e.hasOwnProperty("reverseGeocoderProtocolVersion")&&(r.reverseGeocoderProtocolVersion=e.reverseGeocoderProtocolVersion),void 0!==e.skyDatabaseIsAvailable&&null!==e.skyDatabaseIsAvailable&&e.hasOwnProperty("skyDatabaseIsAvailable")&&(r.skyDatabaseIsAvailable=e.skyDatabaseIsAvailable),void 0!==e.skyDatabaseUrl&&null!==e.skyDatabaseUrl&&e.hasOwnProperty("skyDatabaseUrl")&&(r.skyDatabaseUrl=a[9].toObject(e.skyDatabaseUrl,t)),void 0!==e.defaultWebPageIntlUrl&&null!==e.defaultWebPageIntlUrl&&e.hasOwnProperty("defaultWebPageIntlUrl")&&(r.defaultWebPageIntlUrl=a[10].toObject(e.defaultWebPageIntlUrl,t)),void 0!==e.numStartUpTips&&null!==e.numStartUpTips&&e.hasOwnProperty("numStartUpTips")&&(r.numStartUpTips=e.numStartUpTips),void 0!==e.startUpTipsUrl&&null!==e.startUpTipsUrl&&e.hasOwnProperty("startUpTipsUrl")&&(r.startUpTipsUrl=a[12].toObject(e.startUpTipsUrl,t)),void 0!==e.numProStartUpTips&&null!==e.numProStartUpTips&&e.hasOwnProperty("numProStartUpTips")&&(r.numProStartUpTips=e.numProStartUpTips),void 0!==e.proStartUpTipsUrl&&null!==e.proStartUpTipsUrl&&e.hasOwnProperty("proStartUpTipsUrl")&&(r.proStartUpTipsUrl=a[14].toObject(e.proStartUpTipsUrl,t)),void 0!==e.startupTipsIntlUrl&&null!==e.startupTipsIntlUrl&&e.hasOwnProperty("startupTipsIntlUrl")&&(r.startupTipsIntlUrl=a[15].toObject(e.startupTipsIntlUrl,t)),void 0!==e.userGuideIntlUrl&&null!==e.userGuideIntlUrl&&e.hasOwnProperty("userGuideIntlUrl")&&(r.userGuideIntlUrl=a[16].toObject(e.userGuideIntlUrl,t)),void 0!==e.supportCenterIntlUrl&&null!==e.supportCenterIntlUrl&&e.hasOwnProperty("supportCenterIntlUrl")&&(r.supportCenterIntlUrl=a[17].toObject(e.supportCenterIntlUrl,t)),void 0!==e.businessListingIntlUrl&&null!==e.businessListingIntlUrl&&e.hasOwnProperty("businessListingIntlUrl")&&(r.businessListingIntlUrl=a[18].toObject(e.businessListingIntlUrl,t)),void 0!==e.supportAnswerIntlUrl&&null!==e.supportAnswerIntlUrl&&e.hasOwnProperty("supportAnswerIntlUrl")&&(r.supportAnswerIntlUrl=a[19].toObject(e.supportAnswerIntlUrl,t)),void 0!==e.supportTopicIntlUrl&&null!==e.supportTopicIntlUrl&&e.hasOwnProperty("supportTopicIntlUrl")&&(r.supportTopicIntlUrl=a[20].toObject(e.supportTopicIntlUrl,t)),void 0!==e.supportRequestIntlUrl&&null!==e.supportRequestIntlUrl&&e.hasOwnProperty("supportRequestIntlUrl")&&(r.supportRequestIntlUrl=a[21].toObject(e.supportRequestIntlUrl,t)),void 0!==e.earthIntlUrl&&null!==e.earthIntlUrl&&e.hasOwnProperty("earthIntlUrl")&&(r.earthIntlUrl=a[22].toObject(e.earthIntlUrl,t)),void 0!==e.addContentUrl&&null!==e.addContentUrl&&e.hasOwnProperty("addContentUrl")&&(r.addContentUrl=a[23].toObject(e.addContentUrl,t)),void 0!==e.sketchupNotInstalledUrl&&null!==e.sketchupNotInstalledUrl&&e.hasOwnProperty("sketchupNotInstalledUrl")&&(r.sketchupNotInstalledUrl=a[24].toObject(e.sketchupNotInstalledUrl,t)),void 0!==e.sketchupErrorUrl&&null!==e.sketchupErrorUrl&&e.hasOwnProperty("sketchupErrorUrl")&&(r.sketchupErrorUrl=a[25].toObject(e.sketchupErrorUrl,t)),void 0!==e.freeLicenseUrl&&null!==e.freeLicenseUrl&&e.hasOwnProperty("freeLicenseUrl")&&(r.freeLicenseUrl=a[26].toObject(e.freeLicenseUrl,t)),void 0!==e.proLicenseUrl&&null!==e.proLicenseUrl&&e.hasOwnProperty("proLicenseUrl")&&(r.proLicenseUrl=a[27].toObject(e.proLicenseUrl,t)),void 0!==e.tutorialUrl&&null!==e.tutorialUrl&&e.hasOwnProperty("tutorialUrl")&&(r.tutorialUrl=a[28].toObject(e.tutorialUrl,t)),void 0!==e.keyboardShortcutsUrl&&null!==e.keyboardShortcutsUrl&&e.hasOwnProperty("keyboardShortcutsUrl")&&(r.keyboardShortcutsUrl=a[29].toObject(e.keyboardShortcutsUrl,t)),void 0!==e.releaseNotesUrl&&null!==e.releaseNotesUrl&&e.hasOwnProperty("releaseNotesUrl")&&(r.releaseNotesUrl=a[30].toObject(e.releaseNotesUrl,t)),void 0!==e.hideUserData&&null!==e.hideUserData&&e.hasOwnProperty("hideUserData")&&(r.hideUserData=e.hideUserData),void 0!==e.useGeLogo&&null!==e.useGeLogo&&e.hasOwnProperty("useGeLogo")&&(r.useGeLogo=e.useGeLogo),void 0!==e.dioramaDescriptionUrlBase&&null!==e.dioramaDescriptionUrlBase&&e.hasOwnProperty("dioramaDescriptionUrlBase")&&(r.dioramaDescriptionUrlBase=a[33].toObject(e.dioramaDescriptionUrlBase,t)),void 0!==e.dioramaDefaultColor&&null!==e.dioramaDefaultColor&&e.hasOwnProperty("dioramaDefaultColor")&&(r.dioramaDefaultColor=e.dioramaDefaultColor),void 0!==e.dioramaBlacklistUrl&&null!==e.dioramaBlacklistUrl&&e.hasOwnProperty("dioramaBlacklistUrl")&&(r.dioramaBlacklistUrl=a[35].toObject(e.dioramaBlacklistUrl,t)),void 0!==e.clientOptions&&null!==e.clientOptions&&e.hasOwnProperty("clientOptions")&&(r.clientOptions=a[36].toObject(e.clientOptions,t)),void 0!==e.fetchingOptions&&null!==e.fetchingOptions&&e.hasOwnProperty("fetchingOptions")&&(r.fetchingOptions=a[37].toObject(e.fetchingOptions,t)),void 0!==e.timeMachineOptions&&null!==e.timeMachineOptions&&e.hasOwnProperty("timeMachineOptions")&&(r.timeMachineOptions=a[38].toObject(e.timeMachineOptions,t)),void 0!==e.csiOptions&&null!==e.csiOptions&&e.hasOwnProperty("csiOptions")&&(r.csiOptions=a[39].toObject(e.csiOptions,t)),void 0!==e.searchTab&&null!==e.searchTab&&e.hasOwnProperty("searchTab")){r.searchTab=[];for(var i=0;i<e.searchTab.length;++i)r.searchTab[i]=a[40].toObject(e.searchTab[i],t)}if(void 0!==e.cobrandInfo&&null!==e.cobrandInfo&&e.hasOwnProperty("cobrandInfo")){r.cobrandInfo=[];for(var i=0;i<e.cobrandInfo.length;++i)r.cobrandInfo[i]=a[41].toObject(e.cobrandInfo[i],t)}if(void 0!==e.validDatabase&&null!==e.validDatabase&&e.hasOwnProperty("validDatabase")){r.validDatabase=[];for(var i=0;i<e.validDatabase.length;++i)r.validDatabase[i]=a[42].toObject(e.validDatabase[i],t)}if(void 0!==e.configScript&&null!==e.configScript&&e.hasOwnProperty("configScript")){r.configScript=[];for(var i=0;i<e.configScript.length;++i)r.configScript[i]=a[43].toObject(e.configScript[i],t)}if(void 0!==e.deauthServerUrl&&null!==e.deauthServerUrl&&e.hasOwnProperty("deauthServerUrl")&&(r.deauthServerUrl=a[44].toObject(e.deauthServerUrl,t)),void 0!==e.swoopParameters&&null!==e.swoopParameters&&e.hasOwnProperty("swoopParameters")&&(r.swoopParameters=a[45].toObject(e.swoopParameters,t)),void 0!==e.bbsServerInfo&&null!==e.bbsServerInfo&&e.hasOwnProperty("bbsServerInfo")&&(r.bbsServerInfo=a[46].toObject(e.bbsServerInfo,t)),void 0!==e.dataErrorServerInfo&&null!==e.dataErrorServerInfo&&e.hasOwnProperty("dataErrorServerInfo")&&(r.dataErrorServerInfo=a[47].toObject(e.dataErrorServerInfo,t)),void 0!==e.planetaryDatabase&&null!==e.planetaryDatabase&&e.hasOwnProperty("planetaryDatabase")){r.planetaryDatabase=[];for(var i=0;i<e.planetaryDatabase.length;++i)r.planetaryDatabase[i]=a[48].toObject(e.planetaryDatabase[i],t)}if(void 0!==e.logServer&&null!==e.logServer&&e.hasOwnProperty("logServer")&&(r.logServer=a[49].toObject(e.logServer,t)),void 0!==e.autopiaOptions&&null!==e.autopiaOptions&&e.hasOwnProperty("autopiaOptions")&&(r.autopiaOptions=a[50].toObject(e.autopiaOptions,t)),void 0!==e.searchConfig&&null!==e.searchConfig&&e.hasOwnProperty("searchConfig")&&(r.searchConfig=a[51].toObject(e.searchConfig,t)),void 0!==e.searchInfo&&null!==e.searchInfo&&e.hasOwnProperty("searchInfo")&&(r.searchInfo=a[52].toObject(e.searchInfo,t)),void 0!==e.elevationServiceBaseUrl&&null!==e.elevationServiceBaseUrl&&e.hasOwnProperty("elevationServiceBaseUrl")&&(r.elevationServiceBaseUrl=e.elevationServiceBaseUrl),void 0!==e.elevationProfileQueryDelay&&null!==e.elevationProfileQueryDelay&&e.hasOwnProperty("elevationProfileQueryDelay")&&(r.elevationProfileQueryDelay=e.elevationProfileQueryDelay),void 0!==e.proUpgradeUrl&&null!==e.proUpgradeUrl&&e.hasOwnProperty("proUpgradeUrl")&&(r.proUpgradeUrl=a[55].toObject(e.proUpgradeUrl,t)),void 0!==e.earthCommunityUrl&&null!==e.earthCommunityUrl&&e.hasOwnProperty("earthCommunityUrl")&&(r.earthCommunityUrl=a[56].toObject(e.earthCommunityUrl,t)),void 0!==e.googleMapsUrl&&null!==e.googleMapsUrl&&e.hasOwnProperty("googleMapsUrl")&&(r.googleMapsUrl=a[57].toObject(e.googleMapsUrl,t)),void 0!==e.sharingUrl&&null!==e.sharingUrl&&e.hasOwnProperty("sharingUrl")&&(r.sharingUrl=a[58].toObject(e.sharingUrl,t)),void 0!==e.privacyPolicyUrl&&null!==e.privacyPolicyUrl&&e.hasOwnProperty("privacyPolicyUrl")&&(r.privacyPolicyUrl=a[59].toObject(e.privacyPolicyUrl,t)),void 0!==e.doGplusUserCheck&&null!==e.doGplusUserCheck&&e.hasOwnProperty("doGplusUserCheck")&&(r.doGplusUserCheck=e.doGplusUserCheck),void 0!==e.rocktreeDataProto&&null!==e.rocktreeDataProto&&e.hasOwnProperty("rocktreeDataProto")&&(r.rocktreeDataProto=a[61].toObject(e.rocktreeDataProto,t)),void 0!==e.filmstripConfig&&null!==e.filmstripConfig&&e.hasOwnProperty("filmstripConfig")){r.filmstripConfig=[];for(var i=0;i<e.filmstripConfig.length;++i)r.filmstripConfig[i]=a[62].toObject(e.filmstripConfig[i],t)}return void 0!==e.showSigninButton&&null!==e.showSigninButton&&e.hasOwnProperty("showSigninButton")&&(r.showSigninButton=e.showSigninButton),void 0!==e.proMeasureUpsellUrl&&null!==e.proMeasureUpsellUrl&&e.hasOwnProperty("proMeasureUpsellUrl")&&(r.proMeasureUpsellUrl=a[64].toObject(e.proMeasureUpsellUrl,t)),void 0!==e.proPrintUpsellUrl&&null!==e.proPrintUpsellUrl&&e.hasOwnProperty("proPrintUpsellUrl")&&(r.proPrintUpsellUrl=a[65].toObject(e.proPrintUpsellUrl,t)),void 0!==e.starDataProto&&null!==e.starDataProto&&e.hasOwnProperty("starDataProto")&&(r.starDataProto=a[66].toObject(e.starDataProto,t)),void 0!==e.feedbackUrl&&null!==e.feedbackUrl&&e.hasOwnProperty("feedbackUrl")&&(r.feedbackUrl=a[67].toObject(e.feedbackUrl,t)),void 0!==e.oauth2LoginUrl&&null!==e.oauth2LoginUrl&&e.hasOwnProperty("oauth2LoginUrl")&&(r.oauth2LoginUrl=a[68].toObject(e.oauth2LoginUrl,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.SearchConfigProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.searchServer=r.emptyArray,o.prototype.oneboxService=r.emptyArray,o.prototype.kmlSearchUrl=null,o.prototype.kmlRenderUrl=null,o.prototype.searchHistoryUrl=null,o.prototype.errorPageUrl=null;var a={0:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer",1:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto",2:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.StringIdOrValueProto",5:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.searchServer&&o.searchServer.length||(o.searchServer=[]),o.searchServer.push(a[0].decode(e,e.uint32()));break;case 2:o.oneboxService&&o.oneboxService.length||(o.oneboxService=[]),o.oneboxService.push(a[1].decode(e,e.uint32()));break;case 3:o.kmlSearchUrl=a[2].decode(e,e.uint32());break;case 4:o.kmlRenderUrl=a[3].decode(e,e.uint32());break;case 6:o.searchHistoryUrl=a[4].decode(e,e.uint32());break;case 5:o.errorPageUrl=a[5].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.searchServer){if(!Array.isArray(e.searchServer))return"searchServer: array expected";for(var t=0;t<e.searchServer.length;++t){var r=a[0].verify(e.searchServer[t]);if(r)return"searchServer."+r}}if(void 0!==e.oneboxService){if(!Array.isArray(e.oneboxService))return"oneboxService: array expected";for(var t=0;t<e.oneboxService.length;++t){var r=a[1].verify(e.oneboxService[t]);if(r)return"oneboxService."+r}}if(void 0!==e.kmlSearchUrl&&null!==e.kmlSearchUrl){var r=a[2].verify(e.kmlSearchUrl);if(r)return"kmlSearchUrl."+r}if(void 0!==e.kmlRenderUrl&&null!==e.kmlRenderUrl){var r=a[3].verify(e.kmlRenderUrl);if(r)return"kmlRenderUrl."+r}if(void 0!==e.searchHistoryUrl&&null!==e.searchHistoryUrl){var r=a[4].verify(e.searchHistoryUrl);if(r)return"searchHistoryUrl."+r}if(void 0!==e.errorPageUrl&&null!==e.errorPageUrl){var r=a[5].verify(e.errorPageUrl);if(r)return"errorPageUrl."+r}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto;if(e.searchServer){if(!Array.isArray(e.searchServer))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchServer: array expected");t.searchServer=[];for(var r=0;r<e.searchServer.length;++r){if("object"!=typeof e.searchServer[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchServer: object expected");t.searchServer[r]=a[0].fromObject(e.searchServer[r])}}if(e.oneboxService){if(!Array.isArray(e.oneboxService))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.oneboxService: array expected");t.oneboxService=[];for(var r=0;r<e.oneboxService.length;++r){if("object"!=typeof e.oneboxService[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.oneboxService: object expected");t.oneboxService[r]=a[1].fromObject(e.oneboxService[r])}}if(void 0!==e.kmlSearchUrl&&null!==e.kmlSearchUrl){if("object"!=typeof e.kmlSearchUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.kmlSearchUrl: object expected");t.kmlSearchUrl=a[2].fromObject(e.kmlSearchUrl)}if(void 0!==e.kmlRenderUrl&&null!==e.kmlRenderUrl){if("object"!=typeof e.kmlRenderUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.kmlRenderUrl: object expected");t.kmlRenderUrl=a[3].fromObject(e.kmlRenderUrl)}if(void 0!==e.searchHistoryUrl&&null!==e.searchHistoryUrl){if("object"!=typeof e.searchHistoryUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.searchHistoryUrl: object expected");t.searchHistoryUrl=a[4].fromObject(e.searchHistoryUrl)}if(void 0!==e.errorPageUrl&&null!==e.errorPageUrl){if("object"!=typeof e.errorPageUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.errorPageUrl: object expected");t.errorPageUrl=a[5].fromObject(e.errorPageUrl)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.searchServer=[],r.oneboxService=[]),t.defaults&&(r.kmlSearchUrl=null,r.kmlRenderUrl=null,r.searchHistoryUrl=null,r.errorPageUrl=null),void 0!==e.searchServer&&null!==e.searchServer&&e.hasOwnProperty("searchServer")){r.searchServer=[];for(var i=0;i<e.searchServer.length;++i)r.searchServer[i]=a[0].toObject(e.searchServer[i],t)}if(void 0!==e.oneboxService&&null!==e.oneboxService&&e.hasOwnProperty("oneboxService")){r.oneboxService=[];for(var i=0;i<e.oneboxService.length;++i)r.oneboxService[i]=a[1].toObject(e.oneboxService[i],t)}return void 0!==e.kmlSearchUrl&&null!==e.kmlSearchUrl&&e.hasOwnProperty("kmlSearchUrl")&&(r.kmlSearchUrl=a[2].toObject(e.kmlSearchUrl,t)),void 0!==e.kmlRenderUrl&&null!==e.kmlRenderUrl&&e.hasOwnProperty("kmlRenderUrl")&&(r.kmlRenderUrl=a[3].toObject(e.kmlRenderUrl,t)),void 0!==e.searchHistoryUrl&&null!==e.searchHistoryUrl&&e.hasOwnProperty("searchHistoryUrl")&&(r.searchHistoryUrl=a[4].toObject(e.searchHistoryUrl,t)),void 0!==e.errorPageUrl&&null!==e.errorPageUrl&&e.hasOwnProperty("errorPageUrl")&&(r.errorPageUrl=a[5].toObject(e.errorPageUrl,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.SearchServer=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.name=null,o.prototype.url=null,o.prototype.type=0,o.prototype.htmlTransformUrl=null,o.prototype.kmlTransformUrl=null,o.prototype.supplementalUi=null,o.prototype.suggestion=r.emptyArray,o.prototype.searchlet=r.emptyArray,o.prototype.requirements=null,o.prototype.suggestServer=null;var a={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto",2:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.ResultType",3:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.StringIdOrValueProto",5:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi",6:"keyhole.dbroot.StringIdOrValueProto",7:"keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto",8:"keyhole.dbroot.RequirementProto",9:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.name=a[0].decode(e,e.uint32());break;case 2:o.url=a[1].decode(e,e.uint32());break;case 3:o.type=e.uint32();break;case 4:o.htmlTransformUrl=a[3].decode(e,e.uint32());break;case 5:o.kmlTransformUrl=a[4].decode(e,e.uint32());break;case 6:o.supplementalUi=a[5].decode(e,e.uint32());break;case 9:o.suggestion&&o.suggestion.length||(o.suggestion=[]),o.suggestion.push(a[6].decode(e,e.uint32()));break;case 7:o.searchlet&&o.searchlet.length||(o.searchlet=[]),o.searchlet.push(a[7].decode(e,e.uint32()));break;case 8:o.requirements=a[8].decode(e,e.uint32());break;case 10:o.suggestServer=a[9].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.name&&null!==e.name){var t=a[0].verify(e.name);if(t)return"name."+t}if(void 0!==e.url&&null!==e.url){var t=a[1].verify(e.url);if(t)return"url."+t}if(void 0!==e.type)switch(e.type){default:return"type: enum value expected";case 0:case 1:}if(void 0!==e.htmlTransformUrl&&null!==e.htmlTransformUrl){var t=a[3].verify(e.htmlTransformUrl);if(t)return"htmlTransformUrl."+t}if(void 0!==e.kmlTransformUrl&&null!==e.kmlTransformUrl){var t=a[4].verify(e.kmlTransformUrl);if(t)return"kmlTransformUrl."+t}if(void 0!==e.supplementalUi&&null!==e.supplementalUi){var t=a[5].verify(e.supplementalUi);if(t)return"supplementalUi."+t}if(void 0!==e.suggestion){if(!Array.isArray(e.suggestion))return"suggestion: array expected";for(var r=0;r<e.suggestion.length;++r){var t=a[6].verify(e.suggestion[r]);if(t)return"suggestion."+t}}if(void 0!==e.searchlet){if(!Array.isArray(e.searchlet))return"searchlet: array expected";for(var r=0;r<e.searchlet.length;++r){var t=a[7].verify(e.searchlet[r]);if(t)return"searchlet."+t}}if(void 0!==e.requirements&&null!==e.requirements){var t=a[8].verify(e.requirements);if(t)return"requirements."+t}if(void 0!==e.suggestServer&&null!==e.suggestServer){var t=a[9].verify(e.suggestServer);if(t)return"suggestServer."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer;if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.name: object expected");t.name=a[0].fromObject(e.name)}if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.url: object expected");t.url=a[1].fromObject(e.url)}switch(e.type){case"RESULT_TYPE_KML":case 0:t.type=0;break;case"RESULT_TYPE_XML":case 1:t.type=1}if(void 0!==e.htmlTransformUrl&&null!==e.htmlTransformUrl){if("object"!=typeof e.htmlTransformUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.htmlTransformUrl: object expected");t.htmlTransformUrl=a[3].fromObject(e.htmlTransformUrl)}if(void 0!==e.kmlTransformUrl&&null!==e.kmlTransformUrl){if("object"!=typeof e.kmlTransformUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.kmlTransformUrl: object expected");t.kmlTransformUrl=a[4].fromObject(e.kmlTransformUrl)}if(void 0!==e.supplementalUi&&null!==e.supplementalUi){if("object"!=typeof e.supplementalUi)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.supplementalUi: object expected"); +t.supplementalUi=a[5].fromObject(e.supplementalUi)}if(e.suggestion){if(!Array.isArray(e.suggestion))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestion: array expected");t.suggestion=[];for(var r=0;r<e.suggestion.length;++r){if("object"!=typeof e.suggestion[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestion: object expected");t.suggestion[r]=a[6].fromObject(e.suggestion[r])}}if(e.searchlet){if(!Array.isArray(e.searchlet))throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.searchlet: array expected");t.searchlet=[];for(var r=0;r<e.searchlet.length;++r){if("object"!=typeof e.searchlet[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.searchlet: object expected");t.searchlet[r]=a[7].fromObject(e.searchlet[r])}}if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.requirements: object expected");t.requirements=a[8].fromObject(e.requirements)}if(void 0!==e.suggestServer&&null!==e.suggestServer){if("object"!=typeof e.suggestServer)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.suggestServer: object expected");t.suggestServer=a[9].fromObject(e.suggestServer)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.suggestion=[],r.searchlet=[]),t.defaults&&(r.name=null,r.url=null,r.type=t.enums===String?"RESULT_TYPE_KML":0,r.htmlTransformUrl=null,r.kmlTransformUrl=null,r.supplementalUi=null,r.requirements=null,r.suggestServer=null),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=a[0].toObject(e.name,t)),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=a[1].toObject(e.url,t)),void 0!==e.type&&null!==e.type&&e.hasOwnProperty("type")&&(r.type=t.enums===String?a[2][e.type]:e.type),void 0!==e.htmlTransformUrl&&null!==e.htmlTransformUrl&&e.hasOwnProperty("htmlTransformUrl")&&(r.htmlTransformUrl=a[3].toObject(e.htmlTransformUrl,t)),void 0!==e.kmlTransformUrl&&null!==e.kmlTransformUrl&&e.hasOwnProperty("kmlTransformUrl")&&(r.kmlTransformUrl=a[4].toObject(e.kmlTransformUrl,t)),void 0!==e.supplementalUi&&null!==e.supplementalUi&&e.hasOwnProperty("supplementalUi")&&(r.supplementalUi=a[5].toObject(e.supplementalUi,t)),void 0!==e.suggestion&&null!==e.suggestion&&e.hasOwnProperty("suggestion")){r.suggestion=[];for(var i=0;i<e.suggestion.length;++i)r.suggestion[i]=a[6].toObject(e.suggestion[i],t)}if(void 0!==e.searchlet&&null!==e.searchlet&&e.hasOwnProperty("searchlet")){r.searchlet=[];for(var i=0;i<e.searchlet.length;++i)r.searchlet[i]=a[7].toObject(e.searchlet[i],t)}return void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=a[8].toObject(e.requirements,t)),void 0!==e.suggestServer&&null!==e.suggestServer&&e.hasOwnProperty("suggestServer")&&(r.suggestServer=a[9].toObject(e.suggestServer,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.ResultType=function(){var e={},t=Object.create(e);return t.RESULT_TYPE_KML=0,t.RESULT_TYPE_XML=1,t}(),o.SupplementalUi=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.url=null,o.prototype.label=null,o.prototype.height=160;var a={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.url=a[0].decode(e,e.uint32());break;case 2:o.label=a[1].decode(e,e.uint32());break;case 3:o.height=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=a[0].verify(e.url);if(t)return"url."+t}if(void 0!==e.label&&null!==e.label){var t=a[1].verify(e.label);if(t)return"label."+t}return void 0===e.height||r.isInteger(e.height)?null:"height: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.url: object expected");t.url=a[0].fromObject(e.url)}if(void 0!==e.label&&null!==e.label){if("object"!=typeof e.label)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SupplementalUi.label: object expected");t.label=a[1].fromObject(e.label)}return void 0!==e.height&&null!==e.height&&(t.height=0|e.height),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.label=null,r.height=160),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=a[0].toObject(e.url,t)),void 0!==e.label&&null!==e.label&&e.hasOwnProperty("label")&&(r.label=a[1].toObject(e.label,t)),void 0!==e.height&&null!==e.height&&e.hasOwnProperty("height")&&(r.height=e.height),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.SearchletProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.url=null,r.prototype.name=null,r.prototype.requirements=null;var o={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.StringIdOrValueProto",2:"keyhole.dbroot.RequirementProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.url=o[0].decode(e,e.uint32());break;case 2:a.name=o[1].decode(e,e.uint32());break;case 3:a.requirements=o[2].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=o[0].verify(e.url);if(t)return"url."+t}if(void 0!==e.name&&null!==e.name){var t=o[1].verify(e.name);if(t)return"name."+t}if(void 0!==e.requirements&&null!==e.requirements){var t=o[2].verify(e.requirements);if(t)return"requirements."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.url: object expected");t.url=o[0].fromObject(e.url)}if(void 0!==e.name&&null!==e.name){if("object"!=typeof e.name)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.name: object expected");t.name=o[1].fromObject(e.name)}if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.SearchServer.SearchletProto.requirements: object expected");t.requirements=o[2].fromObject(e.requirements)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null,r.name=null,r.requirements=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),void 0!==e.name&&null!==e.name&&e.hasOwnProperty("name")&&(r.name=o[1].toObject(e.name,t)),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=o[2].toObject(e.requirements,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o}(),o.OneboxServiceProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.serviceUrl=null,r.prototype.requirements=null;var o={0:"keyhole.dbroot.StringIdOrValueProto",1:"keyhole.dbroot.RequirementProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.serviceUrl=o[0].decode(e,e.uint32());break;case 2:a.requirements=o[1].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.serviceUrl&&null!==e.serviceUrl){var t=o[0].verify(e.serviceUrl);if(t)return"serviceUrl."+t}if(void 0!==e.requirements&&null!==e.requirements){var t=o[1].verify(e.requirements);if(t)return"requirements."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto;if(void 0!==e.serviceUrl&&null!==e.serviceUrl){if("object"!=typeof e.serviceUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.serviceUrl: object expected");t.serviceUrl=o[0].fromObject(e.serviceUrl)}if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.SearchConfigProto.OneboxServiceProto.requirements: object expected");t.requirements=o[1].fromObject(e.requirements)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.serviceUrl=null,r.requirements=null),void 0!==e.serviceUrl&&null!==e.serviceUrl&&e.hasOwnProperty("serviceUrl")&&(r.serviceUrl=o[0].toObject(e.serviceUrl,t)),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=o[1].toObject(e.requirements,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o}(),o.SearchInfoProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.defaultUrl="http://maps.google.com/maps",i.prototype.geocodeParam="q",i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.SearchInfoProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.defaultUrl=e.string();break;case 2:o.geocodeParam=e.string();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":void 0===e.defaultUrl||r.isString(e.defaultUrl)?void 0===e.geocodeParam||r.isString(e.geocodeParam)?null:"geocodeParam: string expected":"defaultUrl: string expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.SearchInfoProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.SearchInfoProto;return void 0!==e.defaultUrl&&null!==e.defaultUrl&&(t.defaultUrl=String(e.defaultUrl)),void 0!==e.geocodeParam&&null!==e.geocodeParam&&(t.geocodeParam=String(e.geocodeParam)),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.defaultUrl="http://maps.google.com/maps",r.geocodeParam="q"),void 0!==e.defaultUrl&&null!==e.defaultUrl&&e.hasOwnProperty("defaultUrl")&&(r.defaultUrl=e.defaultUrl),void 0!==e.geocodeParam&&null!==e.geocodeParam&&e.hasOwnProperty("geocodeParam")&&(r.geocodeParam=e.geocodeParam),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.RockTreeDataProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.url=null;var o={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.url=o[0].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=o[0].verify(e.url);if(t)return"url."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.RockTreeDataProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.RockTreeDataProto.url: object expected");t.url=o[0].fromObject(e.url)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o.FilmstripConfigProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.requirements=null,o.prototype.alleycatUrlTemplate=null,o.prototype.fallbackAlleycatUrlTemplate=null,o.prototype.metadataUrlTemplate=null,o.prototype.thumbnailUrlTemplate=null,o.prototype.kmlUrlTemplate=null,o.prototype.featuredToursUrl=null,o.prototype.enableViewportFallback=!1,o.prototype.viewportFallbackDistance=0,o.prototype.imageryType=r.emptyArray;var a={0:"keyhole.dbroot.RequirementProto",1:"keyhole.dbroot.StringIdOrValueProto",2:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.StringIdOrValueProto",5:"keyhole.dbroot.StringIdOrValueProto",6:"keyhole.dbroot.StringIdOrValueProto",9:"keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.requirements=a[0].decode(e,e.uint32());break;case 2:o.alleycatUrlTemplate=a[1].decode(e,e.uint32());break;case 9:o.fallbackAlleycatUrlTemplate=a[2].decode(e,e.uint32());break;case 3:o.metadataUrlTemplate=a[3].decode(e,e.uint32());break;case 4:o.thumbnailUrlTemplate=a[4].decode(e,e.uint32());break;case 5:o.kmlUrlTemplate=a[5].decode(e,e.uint32());break;case 6:o.featuredToursUrl=a[6].decode(e,e.uint32());break;case 7:o.enableViewportFallback=e.bool();break;case 8:o.viewportFallbackDistance=e.uint32();break;case 10:o.imageryType&&o.imageryType.length||(o.imageryType=[]),o.imageryType.push(a[9].decode(e,e.uint32()));break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.requirements&&null!==e.requirements){var t=a[0].verify(e.requirements);if(t)return"requirements."+t}if(void 0!==e.alleycatUrlTemplate&&null!==e.alleycatUrlTemplate){var t=a[1].verify(e.alleycatUrlTemplate);if(t)return"alleycatUrlTemplate."+t}if(void 0!==e.fallbackAlleycatUrlTemplate&&null!==e.fallbackAlleycatUrlTemplate){var t=a[2].verify(e.fallbackAlleycatUrlTemplate);if(t)return"fallbackAlleycatUrlTemplate."+t}if(void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){var t=a[3].verify(e.metadataUrlTemplate);if(t)return"metadataUrlTemplate."+t}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){var t=a[4].verify(e.thumbnailUrlTemplate);if(t)return"thumbnailUrlTemplate."+t}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){var t=a[5].verify(e.kmlUrlTemplate);if(t)return"kmlUrlTemplate."+t}if(void 0!==e.featuredToursUrl&&null!==e.featuredToursUrl){var t=a[6].verify(e.featuredToursUrl);if(t)return"featuredToursUrl."+t}if(void 0!==e.enableViewportFallback&&"boolean"!=typeof e.enableViewportFallback)return"enableViewportFallback: boolean expected";if(void 0!==e.viewportFallbackDistance&&!r.isInteger(e.viewportFallbackDistance))return"viewportFallbackDistance: integer expected";if(void 0!==e.imageryType){if(!Array.isArray(e.imageryType))return"imageryType: array expected";for(var i=0;i<e.imageryType.length;++i){var t=a[9].verify(e.imageryType[i]);if(t)return"imageryType."+t}}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto;if(void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.requirements: object expected");t.requirements=a[0].fromObject(e.requirements)}if(void 0!==e.alleycatUrlTemplate&&null!==e.alleycatUrlTemplate){if("object"!=typeof e.alleycatUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.alleycatUrlTemplate: object expected");t.alleycatUrlTemplate=a[1].fromObject(e.alleycatUrlTemplate)}if(void 0!==e.fallbackAlleycatUrlTemplate&&null!==e.fallbackAlleycatUrlTemplate){if("object"!=typeof e.fallbackAlleycatUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.fallbackAlleycatUrlTemplate: object expected");t.fallbackAlleycatUrlTemplate=a[2].fromObject(e.fallbackAlleycatUrlTemplate)}if(void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){if("object"!=typeof e.metadataUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.metadataUrlTemplate: object expected");t.metadataUrlTemplate=a[3].fromObject(e.metadataUrlTemplate)}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){if("object"!=typeof e.thumbnailUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.thumbnailUrlTemplate: object expected");t.thumbnailUrlTemplate=a[4].fromObject(e.thumbnailUrlTemplate)}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){if("object"!=typeof e.kmlUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.kmlUrlTemplate: object expected");t.kmlUrlTemplate=a[5].fromObject(e.kmlUrlTemplate)}if(void 0!==e.featuredToursUrl&&null!==e.featuredToursUrl){if("object"!=typeof e.featuredToursUrl)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.featuredToursUrl: object expected");t.featuredToursUrl=a[6].fromObject(e.featuredToursUrl)}if(void 0!==e.enableViewportFallback&&null!==e.enableViewportFallback&&(t.enableViewportFallback=Boolean(e.enableViewportFallback)),void 0!==e.viewportFallbackDistance&&null!==e.viewportFallbackDistance&&(t.viewportFallbackDistance=e.viewportFallbackDistance>>>0),e.imageryType){if(!Array.isArray(e.imageryType))throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: array expected");t.imageryType=[];for(var r=0;r<e.imageryType.length;++r){if("object"!=typeof e.imageryType[r])throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.imageryType: object expected");t.imageryType[r]=a[9].fromObject(e.imageryType[r])}}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.imageryType=[]),t.defaults&&(r.requirements=null,r.alleycatUrlTemplate=null,r.fallbackAlleycatUrlTemplate=null,r.metadataUrlTemplate=null,r.thumbnailUrlTemplate=null,r.kmlUrlTemplate=null,r.featuredToursUrl=null,r.enableViewportFallback=!1,r.viewportFallbackDistance=0),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=a[0].toObject(e.requirements,t)),void 0!==e.alleycatUrlTemplate&&null!==e.alleycatUrlTemplate&&e.hasOwnProperty("alleycatUrlTemplate")&&(r.alleycatUrlTemplate=a[1].toObject(e.alleycatUrlTemplate,t)),void 0!==e.fallbackAlleycatUrlTemplate&&null!==e.fallbackAlleycatUrlTemplate&&e.hasOwnProperty("fallbackAlleycatUrlTemplate")&&(r.fallbackAlleycatUrlTemplate=a[2].toObject(e.fallbackAlleycatUrlTemplate,t)),void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate&&e.hasOwnProperty("metadataUrlTemplate")&&(r.metadataUrlTemplate=a[3].toObject(e.metadataUrlTemplate,t)),void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate&&e.hasOwnProperty("thumbnailUrlTemplate")&&(r.thumbnailUrlTemplate=a[4].toObject(e.thumbnailUrlTemplate,t)),void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate&&e.hasOwnProperty("kmlUrlTemplate")&&(r.kmlUrlTemplate=a[5].toObject(e.kmlUrlTemplate,t)),void 0!==e.featuredToursUrl&&null!==e.featuredToursUrl&&e.hasOwnProperty("featuredToursUrl")&&(r.featuredToursUrl=a[6].toObject(e.featuredToursUrl,t)),void 0!==e.enableViewportFallback&&null!==e.enableViewportFallback&&e.hasOwnProperty("enableViewportFallback")&&(r.enableViewportFallback=e.enableViewportFallback),void 0!==e.viewportFallbackDistance&&null!==e.viewportFallbackDistance&&e.hasOwnProperty("viewportFallbackDistance")&&(r.viewportFallbackDistance=e.viewportFallbackDistance),void 0!==e.imageryType&&null!==e.imageryType&&e.hasOwnProperty("imageryType")){r.imageryType=[];for(var i=0;i<e.imageryType.length;++i)r.imageryType[i]=a[9].toObject(e.imageryType[i],t)}return r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.AlleycatImageryTypeProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.imageryTypeId=0,o.prototype.imageryTypeLabel="",o.prototype.metadataUrlTemplate=null,o.prototype.thumbnailUrlTemplate=null,o.prototype.kmlUrlTemplate=null;var a={2:"keyhole.dbroot.StringIdOrValueProto",3:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.StringIdOrValueProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:o.imageryTypeId=e.int32();break;case 2:o.imageryTypeLabel=e.string();break;case 3:o.metadataUrlTemplate=a[2].decode(e,e.uint32());break;case 4:o.thumbnailUrlTemplate=a[3].decode(e,e.uint32());break;case 5:o.kmlUrlTemplate=a[4].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.imageryTypeId&&!r.isInteger(e.imageryTypeId))return"imageryTypeId: integer expected";if(void 0!==e.imageryTypeLabel&&!r.isString(e.imageryTypeLabel))return"imageryTypeLabel: string expected";if(void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){var t=a[2].verify(e.metadataUrlTemplate);if(t)return"metadataUrlTemplate."+t}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){var t=a[3].verify(e.thumbnailUrlTemplate);if(t)return"thumbnailUrlTemplate."+t}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){var t=a[4].verify(e.kmlUrlTemplate);if(t)return"kmlUrlTemplate."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto;if(void 0!==e.imageryTypeId&&null!==e.imageryTypeId&&(t.imageryTypeId=0|e.imageryTypeId),void 0!==e.imageryTypeLabel&&null!==e.imageryTypeLabel&&(t.imageryTypeLabel=String(e.imageryTypeLabel)),void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate){if("object"!=typeof e.metadataUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.metadataUrlTemplate: object expected");t.metadataUrlTemplate=a[2].fromObject(e.metadataUrlTemplate)}if(void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate){if("object"!=typeof e.thumbnailUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.thumbnailUrlTemplate: object expected");t.thumbnailUrlTemplate=a[3].fromObject(e.thumbnailUrlTemplate)}if(void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate){if("object"!=typeof e.kmlUrlTemplate)throw TypeError(".keyhole.dbroot.EndSnippetProto.FilmstripConfigProto.AlleycatImageryTypeProto.kmlUrlTemplate: object expected");t.kmlUrlTemplate=a[4].fromObject(e.kmlUrlTemplate)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.imageryTypeId=0,r.imageryTypeLabel="",r.metadataUrlTemplate=null,r.thumbnailUrlTemplate=null,r.kmlUrlTemplate=null),void 0!==e.imageryTypeId&&null!==e.imageryTypeId&&e.hasOwnProperty("imageryTypeId")&&(r.imageryTypeId=e.imageryTypeId),void 0!==e.imageryTypeLabel&&null!==e.imageryTypeLabel&&e.hasOwnProperty("imageryTypeLabel")&&(r.imageryTypeLabel=e.imageryTypeLabel),void 0!==e.metadataUrlTemplate&&null!==e.metadataUrlTemplate&&e.hasOwnProperty("metadataUrlTemplate")&&(r.metadataUrlTemplate=a[2].toObject(e.metadataUrlTemplate,t)),void 0!==e.thumbnailUrlTemplate&&null!==e.thumbnailUrlTemplate&&e.hasOwnProperty("thumbnailUrlTemplate")&&(r.thumbnailUrlTemplate=a[3].toObject(e.thumbnailUrlTemplate,t)),void 0!==e.kmlUrlTemplate&&null!==e.kmlUrlTemplate&&e.hasOwnProperty("kmlUrlTemplate")&&(r.kmlUrlTemplate=a[4].toObject(e.kmlUrlTemplate,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o}(),o.StarDataProto=function(){function r(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}r.prototype.url=null;var o={0:"keyhole.dbroot.StringIdOrValueProto"};return i.push(o),r.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,a=new n.keyhole.dbroot.EndSnippetProto.StarDataProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 1:a.url=o[0].decode(e,e.uint32());break;default:e.skipType(7&s)}}return a},r.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.url&&null!==e.url){var t=o[0].verify(e.url);if(t)return"url."+t}return null},r.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EndSnippetProto.StarDataProto)return e;var t=new n.keyhole.dbroot.EndSnippetProto.StarDataProto;if(void 0!==e.url&&null!==e.url){if("object"!=typeof e.url)throw TypeError(".keyhole.dbroot.EndSnippetProto.StarDataProto.url: object expected");t.url=o[0].fromObject(e.url)}return t},r.from=r.fromObject,r.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=o[0].toObject(e.url,t)),r},r.prototype.toObject=function(e){return this.constructor.toObject(this,e)},r.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},r}(),o}(),o.DbRootRefProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.url="",o.prototype.isCritical=!1,o.prototype.requirements=null;var a={2:"keyhole.dbroot.RequirementProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DbRootRefProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 2:o.url=e.string();break;case 1:o.isCritical=e.bool();break;case 3:o.requirements=a[2].decode(e,e.uint32());break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(!r.isString(e.url))return"url: string expected";if(void 0!==e.isCritical&&"boolean"!=typeof e.isCritical)return"isCritical: boolean expected";if(void 0!==e.requirements&&null!==e.requirements){var t=a[2].verify(e.requirements);if(t)return"requirements."+t}return null},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DbRootRefProto)return e;var t=new n.keyhole.dbroot.DbRootRefProto;if(void 0!==e.url&&null!==e.url&&(t.url=String(e.url)),void 0!==e.isCritical&&null!==e.isCritical&&(t.isCritical=Boolean(e.isCritical)),void 0!==e.requirements&&null!==e.requirements){if("object"!=typeof e.requirements)throw TypeError(".keyhole.dbroot.DbRootRefProto.requirements: object expected");t.requirements=a[2].fromObject(e.requirements)}return t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.url="",r.isCritical=!1,r.requirements=null),void 0!==e.url&&null!==e.url&&e.hasOwnProperty("url")&&(r.url=e.url),void 0!==e.isCritical&&null!==e.isCritical&&e.hasOwnProperty("isCritical")&&(r.isCritical=e.isCritical),void 0!==e.requirements&&null!==e.requirements&&e.hasOwnProperty("requirements")&&(r.requirements=a[2].toObject(e.requirements,t)),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.DatabaseVersionProto=function(){function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}return i.prototype.quadtreeVersion=0,i.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DatabaseVersionProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.quadtreeVersion=e.uint32();break;default:e.skipType(7&a)}}return o},i.verify=function(e){return"object"!=typeof e||null===e?"object expected":r.isInteger(e.quadtreeVersion)?null:"quadtreeVersion: integer expected"},i.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DatabaseVersionProto)return e;var t=new n.keyhole.dbroot.DatabaseVersionProto;return void 0!==e.quadtreeVersion&&null!==e.quadtreeVersion&&(t.quadtreeVersion=e.quadtreeVersion>>>0),t},i.from=i.fromObject,i.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.quadtreeVersion=0),void 0!==e.quadtreeVersion&&null!==e.quadtreeVersion&&e.hasOwnProperty("quadtreeVersion")&&(r.quadtreeVersion=e.quadtreeVersion),r},i.prototype.toObject=function(e){return this.constructor.toObject(this,e)},i.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},i}(),o.DbRootProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.databaseName=null,o.prototype.imageryPresent=!0,o.prototype.protoImagery=!1,o.prototype.terrainPresent=!1,o.prototype.providerInfo=r.emptyArray,o.prototype.nestedFeature=r.emptyArray,o.prototype.styleAttribute=r.emptyArray,o.prototype.styleMap=r.emptyArray,o.prototype.endSnippet=null,o.prototype.translationEntry=r.emptyArray,o.prototype.language="en",o.prototype.version=5,o.prototype.dbrootReference=r.emptyArray,o.prototype.databaseVersion=null,o.prototype.refreshTimeout=0;var a={0:"keyhole.dbroot.StringIdOrValueProto",4:"keyhole.dbroot.ProviderInfoProto",5:"keyhole.dbroot.NestedFeatureProto",6:"keyhole.dbroot.StyleAttributeProto",7:"keyhole.dbroot.StyleMapProto",8:"keyhole.dbroot.EndSnippetProto",9:"keyhole.dbroot.StringEntryProto",12:"keyhole.dbroot.DbRootRefProto",13:"keyhole.dbroot.DatabaseVersionProto"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.DbRootProto;e.pos<i;){var s=e.uint32();switch(s>>>3){case 15:o.databaseName=a[0].decode(e,e.uint32());break;case 1:o.imageryPresent=e.bool();break;case 14:o.protoImagery=e.bool();break;case 2:o.terrainPresent=e.bool();break;case 3:o.providerInfo&&o.providerInfo.length||(o.providerInfo=[]),o.providerInfo.push(a[4].decode(e,e.uint32()));break;case 4:o.nestedFeature&&o.nestedFeature.length||(o.nestedFeature=[]),o.nestedFeature.push(a[5].decode(e,e.uint32()));break;case 5:o.styleAttribute&&o.styleAttribute.length||(o.styleAttribute=[]),o.styleAttribute.push(a[6].decode(e,e.uint32()));break;case 6:o.styleMap&&o.styleMap.length||(o.styleMap=[]),o.styleMap.push(a[7].decode(e,e.uint32()));break;case 7:o.endSnippet=a[8].decode(e,e.uint32());break;case 8:o.translationEntry&&o.translationEntry.length||(o.translationEntry=[]),o.translationEntry.push(a[9].decode(e,e.uint32())); +break;case 9:o.language=e.string();break;case 10:o.version=e.int32();break;case 11:o.dbrootReference&&o.dbrootReference.length||(o.dbrootReference=[]),o.dbrootReference.push(a[12].decode(e,e.uint32()));break;case 13:o.databaseVersion=a[13].decode(e,e.uint32());break;case 16:o.refreshTimeout=e.int32();break;default:e.skipType(7&s)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.databaseName&&null!==e.databaseName){var t=a[0].verify(e.databaseName);if(t)return"databaseName."+t}if(void 0!==e.imageryPresent&&"boolean"!=typeof e.imageryPresent)return"imageryPresent: boolean expected";if(void 0!==e.protoImagery&&"boolean"!=typeof e.protoImagery)return"protoImagery: boolean expected";if(void 0!==e.terrainPresent&&"boolean"!=typeof e.terrainPresent)return"terrainPresent: boolean expected";if(void 0!==e.providerInfo){if(!Array.isArray(e.providerInfo))return"providerInfo: array expected";for(var i=0;i<e.providerInfo.length;++i){var t=a[4].verify(e.providerInfo[i]);if(t)return"providerInfo."+t}}if(void 0!==e.nestedFeature){if(!Array.isArray(e.nestedFeature))return"nestedFeature: array expected";for(var i=0;i<e.nestedFeature.length;++i){var t=a[5].verify(e.nestedFeature[i]);if(t)return"nestedFeature."+t}}if(void 0!==e.styleAttribute){if(!Array.isArray(e.styleAttribute))return"styleAttribute: array expected";for(var i=0;i<e.styleAttribute.length;++i){var t=a[6].verify(e.styleAttribute[i]);if(t)return"styleAttribute."+t}}if(void 0!==e.styleMap){if(!Array.isArray(e.styleMap))return"styleMap: array expected";for(var i=0;i<e.styleMap.length;++i){var t=a[7].verify(e.styleMap[i]);if(t)return"styleMap."+t}}if(void 0!==e.endSnippet&&null!==e.endSnippet){var t=a[8].verify(e.endSnippet);if(t)return"endSnippet."+t}if(void 0!==e.translationEntry){if(!Array.isArray(e.translationEntry))return"translationEntry: array expected";for(var i=0;i<e.translationEntry.length;++i){var t=a[9].verify(e.translationEntry[i]);if(t)return"translationEntry."+t}}if(void 0!==e.language&&!r.isString(e.language))return"language: string expected";if(void 0!==e.version&&!r.isInteger(e.version))return"version: integer expected";if(void 0!==e.dbrootReference){if(!Array.isArray(e.dbrootReference))return"dbrootReference: array expected";for(var i=0;i<e.dbrootReference.length;++i){var t=a[12].verify(e.dbrootReference[i]);if(t)return"dbrootReference."+t}}if(void 0!==e.databaseVersion&&null!==e.databaseVersion){var t=a[13].verify(e.databaseVersion);if(t)return"databaseVersion."+t}return void 0===e.refreshTimeout||r.isInteger(e.refreshTimeout)?null:"refreshTimeout: integer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.DbRootProto)return e;var t=new n.keyhole.dbroot.DbRootProto;if(void 0!==e.databaseName&&null!==e.databaseName){if("object"!=typeof e.databaseName)throw TypeError(".keyhole.dbroot.DbRootProto.databaseName: object expected");t.databaseName=a[0].fromObject(e.databaseName)}if(void 0!==e.imageryPresent&&null!==e.imageryPresent&&(t.imageryPresent=Boolean(e.imageryPresent)),void 0!==e.protoImagery&&null!==e.protoImagery&&(t.protoImagery=Boolean(e.protoImagery)),void 0!==e.terrainPresent&&null!==e.terrainPresent&&(t.terrainPresent=Boolean(e.terrainPresent)),e.providerInfo){if(!Array.isArray(e.providerInfo))throw TypeError(".keyhole.dbroot.DbRootProto.providerInfo: array expected");t.providerInfo=[];for(var r=0;r<e.providerInfo.length;++r){if("object"!=typeof e.providerInfo[r])throw TypeError(".keyhole.dbroot.DbRootProto.providerInfo: object expected");t.providerInfo[r]=a[4].fromObject(e.providerInfo[r])}}if(e.nestedFeature){if(!Array.isArray(e.nestedFeature))throw TypeError(".keyhole.dbroot.DbRootProto.nestedFeature: array expected");t.nestedFeature=[];for(var r=0;r<e.nestedFeature.length;++r){if("object"!=typeof e.nestedFeature[r])throw TypeError(".keyhole.dbroot.DbRootProto.nestedFeature: object expected");t.nestedFeature[r]=a[5].fromObject(e.nestedFeature[r])}}if(e.styleAttribute){if(!Array.isArray(e.styleAttribute))throw TypeError(".keyhole.dbroot.DbRootProto.styleAttribute: array expected");t.styleAttribute=[];for(var r=0;r<e.styleAttribute.length;++r){if("object"!=typeof e.styleAttribute[r])throw TypeError(".keyhole.dbroot.DbRootProto.styleAttribute: object expected");t.styleAttribute[r]=a[6].fromObject(e.styleAttribute[r])}}if(e.styleMap){if(!Array.isArray(e.styleMap))throw TypeError(".keyhole.dbroot.DbRootProto.styleMap: array expected");t.styleMap=[];for(var r=0;r<e.styleMap.length;++r){if("object"!=typeof e.styleMap[r])throw TypeError(".keyhole.dbroot.DbRootProto.styleMap: object expected");t.styleMap[r]=a[7].fromObject(e.styleMap[r])}}if(void 0!==e.endSnippet&&null!==e.endSnippet){if("object"!=typeof e.endSnippet)throw TypeError(".keyhole.dbroot.DbRootProto.endSnippet: object expected");t.endSnippet=a[8].fromObject(e.endSnippet)}if(e.translationEntry){if(!Array.isArray(e.translationEntry))throw TypeError(".keyhole.dbroot.DbRootProto.translationEntry: array expected");t.translationEntry=[];for(var r=0;r<e.translationEntry.length;++r){if("object"!=typeof e.translationEntry[r])throw TypeError(".keyhole.dbroot.DbRootProto.translationEntry: object expected");t.translationEntry[r]=a[9].fromObject(e.translationEntry[r])}}if(void 0!==e.language&&null!==e.language&&(t.language=String(e.language)),void 0!==e.version&&null!==e.version&&(t.version=0|e.version),e.dbrootReference){if(!Array.isArray(e.dbrootReference))throw TypeError(".keyhole.dbroot.DbRootProto.dbrootReference: array expected");t.dbrootReference=[];for(var r=0;r<e.dbrootReference.length;++r){if("object"!=typeof e.dbrootReference[r])throw TypeError(".keyhole.dbroot.DbRootProto.dbrootReference: object expected");t.dbrootReference[r]=a[12].fromObject(e.dbrootReference[r])}}if(void 0!==e.databaseVersion&&null!==e.databaseVersion){if("object"!=typeof e.databaseVersion)throw TypeError(".keyhole.dbroot.DbRootProto.databaseVersion: object expected");t.databaseVersion=a[13].fromObject(e.databaseVersion)}return void 0!==e.refreshTimeout&&null!==e.refreshTimeout&&(t.refreshTimeout=0|e.refreshTimeout),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var r={};if((t.arrays||t.defaults)&&(r.providerInfo=[],r.nestedFeature=[],r.styleAttribute=[],r.styleMap=[],r.translationEntry=[],r.dbrootReference=[]),t.defaults&&(r.databaseName=null,r.imageryPresent=!0,r.protoImagery=!1,r.terrainPresent=!1,r.endSnippet=null,r.language="en",r.version=5,r.databaseVersion=null,r.refreshTimeout=0),void 0!==e.databaseName&&null!==e.databaseName&&e.hasOwnProperty("databaseName")&&(r.databaseName=a[0].toObject(e.databaseName,t)),void 0!==e.imageryPresent&&null!==e.imageryPresent&&e.hasOwnProperty("imageryPresent")&&(r.imageryPresent=e.imageryPresent),void 0!==e.protoImagery&&null!==e.protoImagery&&e.hasOwnProperty("protoImagery")&&(r.protoImagery=e.protoImagery),void 0!==e.terrainPresent&&null!==e.terrainPresent&&e.hasOwnProperty("terrainPresent")&&(r.terrainPresent=e.terrainPresent),void 0!==e.providerInfo&&null!==e.providerInfo&&e.hasOwnProperty("providerInfo")){r.providerInfo=[];for(var i=0;i<e.providerInfo.length;++i)r.providerInfo[i]=a[4].toObject(e.providerInfo[i],t)}if(void 0!==e.nestedFeature&&null!==e.nestedFeature&&e.hasOwnProperty("nestedFeature")){r.nestedFeature=[];for(var i=0;i<e.nestedFeature.length;++i)r.nestedFeature[i]=a[5].toObject(e.nestedFeature[i],t)}if(void 0!==e.styleAttribute&&null!==e.styleAttribute&&e.hasOwnProperty("styleAttribute")){r.styleAttribute=[];for(var i=0;i<e.styleAttribute.length;++i)r.styleAttribute[i]=a[6].toObject(e.styleAttribute[i],t)}if(void 0!==e.styleMap&&null!==e.styleMap&&e.hasOwnProperty("styleMap")){r.styleMap=[];for(var i=0;i<e.styleMap.length;++i)r.styleMap[i]=a[7].toObject(e.styleMap[i],t)}if(void 0!==e.endSnippet&&null!==e.endSnippet&&e.hasOwnProperty("endSnippet")&&(r.endSnippet=a[8].toObject(e.endSnippet,t)),void 0!==e.translationEntry&&null!==e.translationEntry&&e.hasOwnProperty("translationEntry")){r.translationEntry=[];for(var i=0;i<e.translationEntry.length;++i)r.translationEntry[i]=a[9].toObject(e.translationEntry[i],t)}if(void 0!==e.language&&null!==e.language&&e.hasOwnProperty("language")&&(r.language=e.language),void 0!==e.version&&null!==e.version&&e.hasOwnProperty("version")&&(r.version=e.version),void 0!==e.dbrootReference&&null!==e.dbrootReference&&e.hasOwnProperty("dbrootReference")){r.dbrootReference=[];for(var i=0;i<e.dbrootReference.length;++i)r.dbrootReference[i]=a[12].toObject(e.dbrootReference[i],t)}return void 0!==e.databaseVersion&&null!==e.databaseVersion&&e.hasOwnProperty("databaseVersion")&&(r.databaseVersion=a[13].toObject(e.databaseVersion,t)),void 0!==e.refreshTimeout&&null!==e.refreshTimeout&&e.hasOwnProperty("refreshTimeout")&&(r.refreshTimeout=e.refreshTimeout),r},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o}(),o.EncryptedDbRootProto=function(){function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.prototype.encryptionType=0,o.prototype.encryptionData=r.newBuffer([]),o.prototype.dbrootData=r.newBuffer([]);var a={0:"keyhole.dbroot.EncryptedDbRootProto.EncryptionType"};return i.push(a),o.decode=function(e,r){e instanceof t||(e=t.create(e));for(var i=void 0===r?e.len:e.pos+r,o=new n.keyhole.dbroot.EncryptedDbRootProto;e.pos<i;){var a=e.uint32();switch(a>>>3){case 1:o.encryptionType=e.uint32();break;case 2:o.encryptionData=e.bytes();break;case 3:o.dbrootData=e.bytes();break;default:e.skipType(7&a)}}return o},o.verify=function(e){if("object"!=typeof e||null===e)return"object expected";if(void 0!==e.encryptionType)switch(e.encryptionType){default:return"encryptionType: enum value expected";case 0:}return void 0===e.encryptionData||e.encryptionData&&"number"==typeof e.encryptionData.length||r.isString(e.encryptionData)?void 0===e.dbrootData||e.dbrootData&&"number"==typeof e.dbrootData.length||r.isString(e.dbrootData)?null:"dbrootData: buffer expected":"encryptionData: buffer expected"},o.fromObject=function(e){if(e instanceof n.keyhole.dbroot.EncryptedDbRootProto)return e;var t=new n.keyhole.dbroot.EncryptedDbRootProto;switch(e.encryptionType){case"ENCRYPTION_XOR":case 0:t.encryptionType=0}return void 0!==e.encryptionData&&null!==e.encryptionData&&("string"==typeof e.encryptionData?r.base64.decode(e.encryptionData,t.encryptionData=r.newBuffer(r.base64.length(e.encryptionData)),0):e.encryptionData.length&&(t.encryptionData=e.encryptionData)),void 0!==e.dbrootData&&null!==e.dbrootData&&("string"==typeof e.dbrootData?r.base64.decode(e.dbrootData,t.dbrootData=r.newBuffer(r.base64.length(e.dbrootData)),0):e.dbrootData.length&&(t.dbrootData=e.dbrootData)),t},o.from=o.fromObject,o.toObject=function(e,t){t||(t={});var i={};return t.defaults&&(i.encryptionType=t.enums===String?"ENCRYPTION_XOR":0,i.encryptionData=t.bytes===String?"":[],i.dbrootData=t.bytes===String?"":[]),void 0!==e.encryptionType&&null!==e.encryptionType&&e.hasOwnProperty("encryptionType")&&(i.encryptionType=t.enums===String?a[0][e.encryptionType]:e.encryptionType),void 0!==e.encryptionData&&null!==e.encryptionData&&e.hasOwnProperty("encryptionData")&&(i.encryptionData=t.bytes===String?r.base64.encode(e.encryptionData,0,e.encryptionData.length):t.bytes===Array?Array.prototype.slice.call(e.encryptionData):e.encryptionData),void 0!==e.dbrootData&&null!==e.dbrootData&&e.hasOwnProperty("dbrootData")&&(i.dbrootData=t.bytes===String?r.base64.encode(e.dbrootData,0,e.dbrootData.length):t.bytes===Array?Array.prototype.slice.call(e.dbrootData):e.dbrootData),i},o.prototype.toObject=function(e){return this.constructor.toObject(this,e)},o.prototype.toJSON=function(){return this.constructor.toObject(this,e.util.toJSONOptions)},o.EncryptionType=function(){var e={},t=Object.create(e);return t.ENCRYPTION_XOR=0,t}(),o}(),o}(),o}(),r.lazyResolve(n,i),n.keyhole.dbroot}),define("Core/isBitSet",[],function(){"use strict";function e(e,t){return 0!==(e&t)}return e}),define("Core/GoogleEarthEnterpriseTileInformation",["./defined","./isBitSet"],function(e,t){"use strict";function r(e,t,r,i,n,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=r,this.terrainVersion=i,this.imageryProvider=n,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}var i=[1,2,4,8],n=15,o=16,a=64,s=128;return r.clone=function(t,i){return e(i)?(i._bits=t._bits,i.cnodeVersion=t.cnodeVersion,i.imageryVersion=t.imageryVersion,i.terrainVersion=t.terrainVersion,i.imageryProvider=t.imageryProvider,i.terrainProvider=t.terrainProvider):i=new r(t._bits,t.cnodeVersion,t.imageryVersion,t.terrainVersion,t.imageryProvider,t.terrainProvider),i.ancestorHasTerrain=t.ancestorHasTerrain,i.terrainState=t.terrainState,i},r.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},r.prototype.hasSubtree=function(){return t(this._bits,o)},r.prototype.hasImagery=function(){return t(this._bits,a)},r.prototype.hasTerrain=function(){return t(this._bits,s)},r.prototype.hasChildren=function(){return t(this._bits,n)},r.prototype.hasChild=function(e){return t(this._bits,i[e])},r.prototype.getChildBitmask=function(){return this._bits&n},r}),define("Core/GoogleEarthEnterpriseMetadata",["../ThirdParty/google-earth-dbroot-parser","../ThirdParty/when","./appendForwardSlash","./Check","./Credit","./defaultValue","./defined","./defineProperties","./GoogleEarthEnterpriseTileInformation","./isBitSet","./joinUrls","./loadArrayBuffer","./Math","./RuntimeError","./TaskProcessor","./throttleRequestByServer"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e){for(var t=e.length,r=new ArrayBuffer(t),i=new Uint8Array(r),n=0;n<t;++n)i[n]=e.charCodeAt(n);return r}function v(e){e=o(e,o.EMPTY_OBJECT),this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=h.EPSILON12,this.providers={},this.key=void 0,this._quadPacketVersion=1,this._url=r(e.url),this._proxy=e.proxy,this._tileInfo={},this._subtreePromises={};var i=this;this._readyPromise=b(this).then(function(){return i.getQuadTreePacket("",i._quadPacketVersion,!1)}).then(function(){return!0}).otherwise(function(e){var r="An error occurred while accessing "+y(i,"",1)+".";return t.reject(new p(r))})}function _(e,r,i){var n=e._tileInfo,o=r,s=n[o];if(a(s)&&(!s.hasSubtree()||s.hasChildren()))return s;for(;void 0===s&&o.length>1;)o=o.substring(0,o.length-1),s=n[o];var l=e._subtreePromises,u=l[o];return a(u)?u.then(function(){return _(e,r,i)}):a(s)&&s.hasSubtree()?(u=e.getQuadTreePacket(o,s.cnodeVersion,i),a(u)?(l[o]=u,u.then(function(){return _(e,r,i)}).always(function(){delete l[o]})):void 0):t.reject(new p("Couldn't load metadata for tile "+r))}function y(e,t,r){return c(e._url,"flatfile?q2-0"+t+"-q."+r.toString())}function b(t){var r=c(t._url,"dbRoot.v5?output=proto"),i=t._proxy;a(i)&&(r=i.getURL(r));var s=d(r).then(function(r){var i=e.EncryptedDbRootProto.decode(new Uint8Array(r)),n=i.encryptionData,o=n.byteOffset,a=o+n.byteLength,s=t.key=n.buffer.slice(o,a);n=i.dbrootData,o=n.byteOffset,a=o+n.byteLength;var l=n.buffer.slice(o,a);return w.scheduleTask({buffer:l,type:"DbRoot",key:s},[l])}).then(function(r){var i=e.DbRootProto.decode(new Uint8Array(r.buffer));if(t.imageryPresent=o(i.imageryPresent,t.imageryPresent),t.protoImagery=i.protoImagery,t.terrainPresent=o(i.terrainPresent,t.terrainPresent),a(i.endSnippet)&&a(i.endSnippet.model)){var s=i.endSnippet.model;t.negativeAltitudeExponentBias=o(s.negativeAltitudeExponentBias,t.negativeAltitudeExponentBias),t.negativeAltitudeThreshold=o(s.compressedNegativeAltitudeThreshold,t.negativeAltitudeThreshold)}a(i.databaseVersion)&&(t._quadPacketVersion=o(i.databaseVersion.quadtreeVersion,t._quadPacketVersion));for(var l=t.providers,u=o(i.providerInfo,[]),c=u.length,d=0;d<c;++d){var h=u[d],p=h.copyrightString;a(p)&&(l[h.providerId]=new n(p.value))}}).otherwise(function(){console.log("Failed to retrieve "+r+". Using defaults."),t.key=C});return s}var C=g('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|Š["');s(v.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._proxy}},readyPromise:{get:function(){return this._readyPromise}}}),v.tileXYToQuadKey=function(e,t,r){for(var i="",n=r;n>=0;--n){var o=1<<n,a=0;u(t,o)?u(e,o)&&(a|=1):(a|=2,u(e,o)||(a|=1)),i+=a}return i},v.quadKeyToTileXY=function(e){for(var t=0,r=0,i=e.length-1,n=i;n>=0;--n){var o=1<<n,a=+e[i-n];u(a,2)?u(a,1)||(t|=o):(r|=o,u(a,1)&&(t|=o))}return{x:t,y:r,level:i}},v.prototype.isValid=function(e){var t=this.getTileInformationFromQuadKey(e);if(a(t))return null!==t;for(var r,i=!0,n=e;n.length>1;){if(r=n.substring(n.length-1),n=n.substring(0,n.length-1),t=this.getTileInformationFromQuadKey(n),a(t)){t.hasSubtree()||t.hasChild(parseInt(r))||(i=!1);break}if(null===t){i=!1;break}}return i};var w=new f("decodeGoogleEarthEnterprisePacket",Number.POSITIVE_INFINITY);return v.prototype.getQuadTreePacket=function(e,t,r){t=o(t,1),e=o(e,""),r=o(r,!0);var i=y(this,e,t),n=this._proxy;a(n)&&(i=n.getURL(i));var s;if(r){if(s=m(i,d),!a(s))return}else s=d(i);var u=this._tileInfo,c=this.key;return s.then(function(t){var r=w.scheduleTask({buffer:t,quadKey:e,type:"Metadata",key:c},[t]);return r.then(function(t){var r,i=-1;if(""!==e){i=e.length+1;var n=t[e];r=u[e],r._bits|=n._bits,delete t[e]}var o=Object.keys(t);o.sort(function(e,t){return e.length-t.length});for(var a=o.length,s=0;s<a;++s){var c=o[s],d=t[c];if(null!==d){var h=l.clone(t[c]),p=c.length;if(p===i)h.setParent(r);else if(p>1){var f=u[c.substring(0,c.length-1)];h.setParent(f)}u[c]=h}else u[c]=null}})})},v.prototype.populateSubtree=function(e,t,r,i){i=o(i,!0);var n=v.tileXYToQuadKey(e,t,r);return _(this,n,i)},v.prototype.getTileInformation=function(e,t,r){var i=v.tileXYToQuadKey(e,t,r);return this._tileInfo[i]},v.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]},v}),define("Core/GoogleEarthEnterpriseTerrainData",["./BoundingSphere","./Cartesian2","./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./IndexDatatype","./Intersections2D","./Math","./OrientedBoundingBox","./QuantizedMeshTerrainData","./Rectangle","./TaskProcessor","./TerrainEncoding","./TerrainMesh"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e){e=n(e,n.EMPTY_OBJECT),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;var t=n(e.childTileMask,15),r=3&t;r|=4&t?8:0,r|=8&t?4:0,this._childTileMask=r,this._createdByUpsampling=n(e.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0,this._vertexCountWithoutSkirts=void 0,this._skirtIndex=void 0}function _(e,t,r){for(var i=e._mesh,n=i.vertices,o=i.encoding,a=i.indices,s=0,l=a.length;s<l;s+=3){var c=a[s],d=a[s+1],h=a[s+2],p=o.decodeTextureCoordinates(n,c,E),f=o.decodeTextureCoordinates(n,d,T),m=o.decodeTextureCoordinates(n,h,x),g=u.computeBarycentricCoordinates(t,r,p.x,p.y,f.x,f.y,m.x,m.y,P);if(g.x>=-1e-15&&g.y>=-1e-15&&g.z>=-1e-15){var v=o.decodeHeight(n,c),_=o.decodeHeight(n,d),y=o.decodeHeight(n,h);return g.x*v+g.y*_+g.z*y}}}function y(e,t,r,i){var n=e._buffer,o=0,a=0,s=0;r>.5?(t>.5?(o=2,a=.5):o=3,s=.5):t>.5&&(o=1,a=.5);for(var l=new DataView(n),d=0,h=0;h<o;++h)d+=l.getUint32(d,!0),d+=D;d+=D,d+=2*O;var p=c.toRadians(180*l.getFloat64(d,!0));d+=O;var f=c.toRadians(180*l.getFloat64(d,!0));d+=O;var m=i.width/p/2,g=i.height/f/2,v=l.getInt32(d,!0);d+=I;var _=3*l.getInt32(d,!0);d+=I,d+=I;for(var y=new Array(v),b=new Array(v),C=new Array(v),w=0;w<v;++w)y[w]=a+l.getUint8(d++)*m,b[w]=s+l.getUint8(d++)*g,C[w]=6371010*l.getFloat32(d,!0),d+=M;var S=new Array(_);for(w=0;w<_;++w)S[w]=l.getUint16(d,!0),d+=A;for(w=0;w<_;w+=3){var E=S[w],T=S[w+1],x=S[w+2],R=y[E],N=y[T],k=y[x],L=b[E],F=b[T],B=b[x],U=u.computeBarycentricCoordinates(t,r,R,L,N,F,k,B,P);if(U.x>=-1e-15&&U.y>=-1e-15&&U.z>=-1e-15)return U.x*C[E]+U.y*C[T]+U.z*C[x]}}a(v.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var b=new f("createVerticesFromGoogleEarthEnterpriseBuffer"),C=new p,w=new p;v.prototype.createMesh=function(e,t,r,i,a){var s=e.ellipsoid;e.tileXYToNativeRectangle(t,r,i,C),e.tileXYToRectangle(t,r,i,w),a=n(a,1);var l=s.cartographicToCartesian(p.center(w)),u=40075.16,c=u/(1<<i);this._skirtHeight=Math.min(8*c,1e3);var d=b.scheduleTask({buffer:this._buffer,nativeRectangle:C,rectangle:w,relativeToCenter:l,ellipsoid:s,skirtHeight:this._skirtHeight,exaggeration:a,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(o(d)){var h=this;return d.then(function(e){return h._mesh=new g(l,new Float32Array(e.vertices),new Uint16Array(e.indices),e.minimumHeight,e.maximumHeight,e.boundingSphere3D,e.occludeePointInScaledSpace,e.numberOfAttributes,e.orientedBoundingBox,m.clone(e.encoding),a),h._vertexCountWithoutSkirts=e.vertexCountWithoutSkirts,h._skirtIndex=e.skirtIndex,h._minimumHeight=e.minimumHeight,h._maximumHeight=e.maximumHeight,h._buffer=void 0,h._mesh})}},v.prototype.interpolateHeight=function(e,t,r){var i=c.clamp((t-e.west)/e.width,0,1),n=c.clamp((r-e.south)/e.height,0,1);return o(this._mesh)?_(this,i,n):y(this,i,n,e)};var S=new f("upsampleQuantizedTerrainMesh");v.prototype.upsample=function(t,i,n,a,s,u,c){var p=this._mesh;if(o(this._mesh)){var f=2*i!==s,m=2*n===u,g=t.ellipsoid,v=t.tileXYToRectangle(s,u,c),_=S.scheduleTask({vertices:p.vertices,vertexCountWithoutSkirts:this._vertexCountWithoutSkirts,indices:p.indices,skirtIndex:this._skirtIndex,encoding:p.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:f,isNorthChild:m,childRectangle:v,ellipsoid:g,exaggeration:p.exaggeration});if(o(_)){var y=this;return _.then(function(t){var i=new Uint16Array(t.vertices),n=l.createTypedArray(i.length/3,t.indices),o=y._skirtHeight;return new h({quantizedVertices:i,indices:n,minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight,boundingSphere:e.clone(t.boundingSphere),orientedBoundingBox:d.clone(t.orientedBoundingBox),horizonOcclusionPoint:r.clone(t.horizonOcclusionPoint),westIndices:t.westIndices,southIndices:t.southIndices,eastIndices:t.eastIndices,northIndices:t.northIndices,westSkirtHeight:o,southSkirtHeight:o,eastSkirtHeight:o,northSkirtHeight:o,childTileMask:0,createdByUpsampling:!0,credits:y._credits})})}}},v.prototype.isChildAvailable=function(e,t,r,i){var n=2;return r!==2*e&&++n,i!==2*t&&(n-=2),0!==(this._childTileMask&1<<n)},v.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var E=new t,T=new t,x=new t,P=new r,A=Uint16Array.BYTES_PER_ELEMENT,D=Uint32Array.BYTES_PER_ELEMENT,I=Int32Array.BYTES_PER_ELEMENT,M=Float32Array.BYTES_PER_ELEMENT,O=Float64Array.BYTES_PER_ELEMENT;return v}),define("Core/GoogleEarthEnterpriseTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./GeographicTilingScheme","./GoogleEarthEnterpriseMetadata","./GoogleEarthEnterpriseTerrainData","./HeightmapTerrainData","./JulianDate","./loadArrayBuffer","./Math","./Rectangle","./RuntimeError","./TaskProcessor","./throttleRequestByServer","./TileProviderError"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_){"use strict";function y(){this._terrainCache={},this._lastTidy=d.now()}function b(n){n=r(n,{});var o;o=i(n.metadata)?this._metadata=n.metadata:this._metadata=new l({url:n.url,proxy:n.proxy}),this._proxy=r(n.proxy,this._metadata.proxy),this._tilingScheme=new s({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new f(-p.PI,-p.PI,p.PI,p.PI),ellipsoid:n.ellipsoid});var u=n.credit;"string"==typeof u&&(u=new t(u)),this._credit=u,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new y,this._terrainPromises={},this._errorEvent=new a,this._ready=!1;var c,d=this;this._readyPromise=o.readyPromise.then(function(t){if(!o.terrainPresent){var r=new m("The server "+o.url+" doesn't have terrain");return c=_.handleError(c,d,d._errorEvent,r.message,void 0,void 0,void 0,r),e.reject(r)}return _.handleSuccess(c),d._ready=t,t}).otherwise(function(t){return c=_.handleError(c,d,d._errorEvent,t.message,void 0,void 0,void 0,t),e.reject(t)})}function C(e,t,r){var n=t.getChildBitmask();if(t.terrainState===S.PARENT){n=0;for(var o=0;o<4;++o){var a=r.getTileInformationFromQuadKey(e+o.toString());i(a)&&a.hasTerrain()&&(n|=1<<o)}}return n}function w(e,t,r){r=i(r)&&r>0?r:1;var n=e.url+"flatfile?f1c-0"+t+"-t."+r.toString(),o=e._proxy;return i(o)&&(n=o.getURL(n)),n}var S={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},E=new d;y.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:d.now()}},y.prototype.get=function(e){var t=this._terrainCache,r=t[e];if(i(r))return delete this._terrainCache[e],r.buffer},y.prototype.tidy=function(){if(d.now(E),d.secondsDifference(E,this._lastTidy)>10){for(var e=this._terrainCache,t=Object.keys(e),r=t.length,i=0;i<r;++i){var n=t[i],o=e[n];d.secondsDifference(E,o.timestamp)>10&&delete e[n]}d.clone(E,this._lastTidy)}},n(b.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._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 T=new g("decodeGoogleEarthEnterprisePacket",Number.POSITIVE_INFINITY);return b.prototype.requestTileGeometry=function(t,n,o,a){var s=l.tileXYToQuadKey(t,n,o),d=this._terrainCache,p=this._metadata,f=p.getTileInformationFromQuadKey(s);if(!i(f))return e.reject(new m("Terrain tile doesn't exist"));var g=f.terrainState;i(g)||(g=f.terrainState=S.UNKNOWN);var _=d.get(s);if(i(_)){var y=p.providers[f.terrainProvider];return new u({buffer:_,childTileMask:C(s,f,p),credits:i(y)?[y]:void 0,negativeAltitudeExponentBias:p.negativeAltitudeExponentBias,negativeElevationThreshold:p.negativeAltitudeThreshold})}if(d.tidy(),!f.ancestorHasTerrain)return new c({buffer:new Uint8Array(256),width:16,height:16});if(g===S.NONE)return e.reject(new m("Terrain tile doesn't exist"));var b,E=s,x=-1;switch(g){case S.SELF:x=f.terrainVersion;break;case S.PARENT:E=E.substring(0,E.length-1),b=p.getTileInformationFromQuadKey(E),x=b.terrainVersion;break;case S.UNKNOWN:f.hasTerrain()?x=f.terrainVersion:(E=E.substring(0,E.length-1),b=p.getTileInformationFromQuadKey(E),i(b)&&b.hasTerrain()&&(x=b.terrainVersion))}if(x<0)return e.reject(new m("Terrain tile doesn't exist"));var P,A=this._terrainPromises,D=w(this,E,x);if(i(A[E]))P=A[E];else{var I;if(a=r(a,!0)){if(I=v(D,h),!i(I))return}else I=h(D);P=I.then(function(t){return i(t)?T.scheduleTask({buffer:t,type:"Terrain",key:p.key},[t]).then(function(e){var t=p.getTileInformationFromQuadKey(E);t.terrainState=S.SELF,d.add(E,e[0]);for(var r=t.terrainProvider,n=e.length-1,o=0;o<n;++o){var a=E+o.toString(),s=p.getTileInformationFromQuadKey(a);i(s)&&(d.add(a,e[o+1]),s.terrainState=S.PARENT,0===s.terrainProvider&&(s.terrainProvider=r))}}):e.reject(new m("Failed to load terrain."))}).otherwise(function(t){return f.terrainState=S.NONE,e.reject(t)}),A[E]=P,P=P.always(function(){delete A[E]})}return P.then(function(){var t=d.get(s);if(i(t)){var r=p.providers[f.terrainProvider];return new u({buffer:t,childTileMask:C(s,f,p),credits:i(r)?[r]:void 0,negativeAltitudeExponentBias:p.negativeAltitudeExponentBias,negativeElevationThreshold:p.negativeAltitudeThreshold})}return f.terrainState=S.NONE,e.reject(new m("Failed to load terrain."))})},b.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)},b.prototype.getTileDataAvailable=function(e,t,r){var n=this._metadata,o=l.tileXYToQuadKey(e,t,r),a=n.getTileInformation(e,t,r);if(null===a)return!1;if(i(a)){if(!a.ancestorHasTerrain)return!0;var s=a.terrainState;if(s===S.NONE)return!1;if(!(i(s)&&s!==S.UNKNOWN||(a.terrainState=S.UNKNOWN,a.hasTerrain()))){o=o.substring(0,o.length-1);var u=n.getTileInformationFromQuadKey(o);if(!i(u)||!u.hasTerrain())return!1}return!0}return n.isValid(o)&&n.populateSubtree(e,t,r),!1},b}),define("Core/HeadingPitchRange",["./defaultValue","./defined"],function(e,t){"use strict";function r(t,r,i){this.heading=e(t,0),this.pitch=e(r,0),this.range=e(i,0)}return r.clone=function(e,i){if(t(e))return t(i)||(i=new r),i.heading=e.heading,i.pitch=e.pitch,i.range=e.range,i},r}),define("Core/HermitePolynomialApproximation",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,i){"use strict";function n(e,t,r,i,o,a){var s,l,u,c=0;if(i>0){for(l=0;l<o;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(a.push(l),c+=n(e,t,r,i-1,o,a),a.splice(a.length-1,1))}return c}for(c=1,l=0;l<o;l++){for(s=!1,u=0;u<a.length&&!s;u++)l===a[u]&&(s=!0);s||(c*=e-r[t[l]])}return c}function o(e,t,r,n,o,a){for(var s,l,u=-1,c=t.length,d=c*(c+1)/2,h=0;h<o;h++){var p=Math.floor(h*d);for(s=0;s<c;s++)l=t[s]*o*(a+1)+h,e[p+s]=n[l];for(var f=1;f<c;f++){var m=0,g=Math.floor(f*(1-f)/2)+c*f,v=!1;for(s=0;s<c-f;s++){var _,y,b=r[t[s]],C=r[t[s+f]];if(C-b<=0)l=t[s]*o*(a+1)+o*f+h,_=n[l],y=_/i.factorial(f),e[p+g+m]=y,m++;else{var w=Math.floor((f-1)*(2-f)/2)+c*(f-1);_=e[p+w+s+1]-e[p+w+s],y=_/(C-b),e[p+g+m]=y,m++}v=v||0!==_}v&&(u=Math.max(u,f))}}return u}var a=i.factorial,s={type:"Hermite"};s.getRequiredDataPoints=function(t,r){return r=e(r,0),Math.max(Math.floor((t+1)/(r+1)),2)},s.interpolateOrderZero=function(e,r,i,o,s){t(s)||(s=new Array(o));var l,u,c,d,h,p,f=r.length,m=new Array(o);for(l=0;l<o;l++){s[l]=0;var g=new Array(f);for(m[l]=g,u=0;u<f;u++)g[u]=[]}var v=f,_=new Array(v);for(l=0;l<v;l++)_[l]=l;var y=f-1;for(d=0;d<o;d++){for(u=0;u<v;u++)p=_[u]*o+d,m[d][0].push(i[p]);for(l=1;l<v;l++){var b=!1;for(u=0;u<v-l;u++){var C,w=r[_[u]],S=r[_[u+l]];S-w<=0?(p=_[u]*o+o*l+d,C=i[p],m[d][l].push(C/a(l))):(C=m[d][l-1][u+1]-m[d][l-1][u],m[d][l].push(C/(S-w))),b=b||0!==C}b||(y=l-1)}}for(c=0,h=0;c<=h;c++)for(l=c;l<=y;l++){var E=n(e,_,r,c,l,[]);for(d=0;d<o;d++){var T=m[d][l][0];s[d+c*o]+=T*E}}return s};var l=[];return s.interpolate=function(e,r,i,a,s,u,c){var d=a*(u+1);t(c)||(c=new Array(d));for(var h=0;h<d;h++)c[h]=0;for(var p=r.length,f=new Array(p*(s+1)),m=0;m<p;m++)for(var g=0;g<s+1;g++)f[m*(s+1)+g]=m;for(var v=f.length,_=l,y=o(_,f,r,i,a,s),b=[],C=v*(v+1)/2,w=Math.min(y,u),S=0;S<=w;S++)for(m=S;m<=y;m++){b.length=0;for(var E=n(e,f,r,S,m,b),T=Math.floor(m*(1-m)/2)+v*m,x=0;x<a;x++){var P=Math.floor(x*C),A=_[P+T];c[x+S*a]+=A*E}}return c},s}),define("Core/IauOrientationParameters",[],function(){"use strict";function e(e,t,r,i){this.rightAscension=e,this.declination=t,this.rotation=r, +this.rotationRate=i}return e}),define("Core/Iau2000Orientation",["./defined","./IauOrientationParameters","./JulianDate","./Math","./TimeConstants"],function(e,t,r,i,n){"use strict";var o={},a=32.184,s=2451545,l=-.0529921,u=-.1059842,c=13.0120009,d=13.3407154,h=.9856003,p=26.4057084,f=13.064993,m=.3287146,g=1.7484877,v=-.1589763,_=.0036096,y=.1643573,b=12.9590088,C=new r;return o.ComputeMoon=function(o,w){e(o)||(o=r.now()),C=r.addSeconds(o,a,C);var S=r.totalDays(C)-s,E=S/n.DAYS_PER_JULIAN_CENTURY,T=(125.045+l*S)*i.RADIANS_PER_DEGREE,x=(250.089+u*S)*i.RADIANS_PER_DEGREE,P=(260.008+c*S)*i.RADIANS_PER_DEGREE,A=(176.625+d*S)*i.RADIANS_PER_DEGREE,D=(357.529+h*S)*i.RADIANS_PER_DEGREE,I=(311.589+p*S)*i.RADIANS_PER_DEGREE,M=(134.963+f*S)*i.RADIANS_PER_DEGREE,O=(276.617+m*S)*i.RADIANS_PER_DEGREE,R=(34.226+g*S)*i.RADIANS_PER_DEGREE,N=(15.134+v*S)*i.RADIANS_PER_DEGREE,k=(119.743+_*S)*i.RADIANS_PER_DEGREE,L=(239.961+y*S)*i.RADIANS_PER_DEGREE,F=(25.053+b*S)*i.RADIANS_PER_DEGREE,B=Math.sin(T),U=Math.sin(x),V=Math.sin(P),z=Math.sin(A),G=Math.sin(D),H=Math.sin(I),W=Math.sin(M),j=Math.sin(O),q=Math.sin(R),Y=Math.sin(N),X=Math.sin(k),Q=Math.sin(L),Z=Math.sin(F),K=Math.cos(T),J=Math.cos(x),$=Math.cos(P),ee=Math.cos(A),te=Math.cos(D),re=Math.cos(I),ie=Math.cos(M),ne=Math.cos(O),oe=Math.cos(R),ae=Math.cos(N),se=Math.cos(k),le=Math.cos(L),ue=Math.cos(F),ce=(269.9949+.0031*E-3.8787*B-.1204*U+.07*V-.0172*z+.0072*H-.0052*Y+.0043*Z)*i.RADIANS_PER_DEGREE,de=(66.5392+.013*E+1.5419*K+.0239*J-.0278*$+.0068*ee-.0029*re+9e-4*ie+8e-4*ae-9e-4*ue)*i.RADIANS_PER_DEGREE,he=(38.3213+13.17635815*S-1.4e-12*S*S+3.561*B+.1208*U-.0642*V+.0158*z+.0252*G-.0066*H-.0047*W-.0046*j+.0028*q+.0052*Y+.004*X+.0019*Q-.0044*Z)*i.RADIANS_PER_DEGREE,pe=(13.17635815-1.4e-12*(2*S)+3.561*K*l+.1208*J*u-.0642*$*c+.0158*ee*d+.0252*te*h-.0066*re*p-.0047*ie*f-.0046*ne*m+.0028*oe*g+.0052*ae*v+.004*se*_+.0019*le*y-.0044*ue*b)/86400*i.RADIANS_PER_DEGREE;return e(w)||(w=new t),w.rightAscension=ce,w.declination=de,w.rotation=he,w.rotationRate=pe,w},o}),define("Core/IauOrientationAxes",["./Cartesian3","./defined","./Iau2000Orientation","./JulianDate","./Math","./Matrix3","./Quaternion"],function(e,t,r,i,n,o,a){"use strict";function s(e){t(e)&&"function"==typeof e||(e=r.ComputeMoon),this._computeFunction=e}function l(r,i,a){var s=u;s.x=Math.cos(r+n.PI_OVER_TWO),s.y=Math.sin(r+n.PI_OVER_TWO),s.z=0;var l=Math.cos(i),h=d;h.x=l*Math.cos(r),h.y=l*Math.sin(r),h.z=Math.sin(i);var p=e.cross(h,s,c);return t(a)||(a=new o),a[0]=s.x,a[1]=p.x,a[2]=h.x,a[3]=s.y,a[4]=p.y,a[5]=h.y,a[6]=s.z,a[7]=p.z,a[8]=h.z,a}var u=new e,c=new e,d=new e,h=new o,p=new a;return s.prototype.evaluate=function(r,s){t(r)||(r=i.now());var u=this._computeFunction(r),c=l(u.rightAscension,u.declination,s),d=n.zeroToTwoPi(u.rotation),f=a.fromAxisAngle(e.UNIT_Z,d,p),m=o.fromQuaternion(a.conjugate(f,f),h),g=o.multiply(m,c,c);return g},s}),define("Core/InterpolationAlgorithm",["./DeveloperError"],function(e){"use strict";var t={};return t.type=void 0,t.getRequiredDataPoints=e.throwInstantiationError,t.interpolateOrderZero=e.throwInstantiationError,t.interpolate=e.throwInstantiationError,t}),define("Core/isDataUri",["./defined"],function(e){"use strict";function t(t){return!!e(t)&&r.test(t)}var r=/^data:/i;return t}),define("Core/TimeInterval",["./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./JulianDate"],function(e,t,r,i,n,o){"use strict";function a(r){r=e(r,e.EMPTY_OBJECT),this.start=t(r.start)?o.clone(r.start):new o,this.stop=t(r.stop)?o.clone(r.stop):new o,this.data=r.data,this.isStartIncluded=e(r.isStartIncluded,!0),this.isStopIncluded=e(r.isStopIncluded,!0)}r(a.prototype,{isEmpty:{get:function(){var e=o.compare(this.stop,this.start);return e<0||0===e&&(!this.isStartIncluded||!this.isStopIncluded)}}});var s={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};return a.fromIso8601=function(r,i){var n=r.iso8601.split("/"),l=o.fromIso8601(n[0]),u=o.fromIso8601(n[1]),c=e(r.isStartIncluded,!0),d=e(r.isStopIncluded,!0),h=r.data;return t(i)?(i.start=l,i.stop=u,i.isStartIncluded=c,i.isStopIncluded=d,i.data=h,i):(s.start=l,s.stop=u,s.isStartIncluded=c,s.isStopIncluded=d,s.data=h,new a(s))},a.toIso8601=function(e,t){return o.toIso8601(e.start,t)+"/"+o.toIso8601(e.stop,t)},a.clone=function(e,r){if(t(e))return t(r)?(r.start=e.start,r.stop=e.stop,r.isStartIncluded=e.isStartIncluded,r.isStopIncluded=e.isStopIncluded,r.data=e.data,r):new a(e)},a.equals=function(e,r,i){return e===r||t(e)&&t(r)&&(e.isEmpty&&r.isEmpty||e.isStartIncluded===r.isStartIncluded&&e.isStopIncluded===r.isStopIncluded&&o.equals(e.start,r.start)&&o.equals(e.stop,r.stop)&&(e.data===r.data||t(i)&&i(e.data,r.data)))},a.equalsEpsilon=function(e,r,i,n){return e===r||t(e)&&t(r)&&(e.isEmpty&&r.isEmpty||e.isStartIncluded===r.isStartIncluded&&e.isStopIncluded===r.isStopIncluded&&o.equalsEpsilon(e.start,r.start,i)&&o.equalsEpsilon(e.stop,r.stop,i)&&(e.data===r.data||t(n)&&n(e.data,r.data)))},a.intersect=function(e,r,i,n){if(!t(r))return a.clone(a.EMPTY,i);var s=e.start,l=e.stop,u=r.start,c=r.stop,d=o.greaterThanOrEquals(u,s)&&o.greaterThanOrEquals(l,u),h=!d&&o.lessThanOrEquals(u,s)&&o.lessThanOrEquals(s,c);if(!d&&!h)return a.clone(a.EMPTY,i);var p=e.isStartIncluded,f=e.isStopIncluded,m=r.isStartIncluded,g=r.isStopIncluded,v=o.lessThan(l,c);return i.start=d?u:s,i.isStartIncluded=p&&m||!o.equals(u,s)&&(d&&m||h&&p),i.stop=v?l:c,i.isStopIncluded=v?f:f&&g||!o.equals(c,l)&&g,i.data=t(n)?n(e.data,r.data):e.data,i},a.contains=function(e,t){if(e.isEmpty)return!1;var r=o.compare(e.start,t);if(0===r)return e.isStartIncluded;var i=o.compare(t,e.stop);return 0===i?e.isStopIncluded:r<0&&i<0},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e,t){return a.equals(this,e,t)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return a.toIso8601(this)},a.EMPTY=n(new a({start:new o,stop:new o,isStartIncluded:!1,isStopIncluded:!1})),a}),define("Core/Iso8601",["./freezeObject","./JulianDate","./TimeInterval"],function(e,t,r){"use strict";var i=e(t.fromIso8601("0000-01-01T00:00:00Z")),n=e(t.fromIso8601("9999-12-31T24:00:00Z")),o=e(new r({start:i,stop:n})),a={MINIMUM_VALUE:i,MAXIMUM_VALUE:n,MAXIMUM_INTERVAL:o};return a}),define("Core/KeyboardEventModifier",["./freezeObject"],function(e){"use strict";var t={SHIFT:0,CTRL:1,ALT:2};return e(t)}),define("Core/LagrangePolynomialApproximation",["./defined"],function(e){"use strict";var t={type:"Lagrange"};return t.getRequiredDataPoints=function(e){return Math.max(e+1,2)},t.interpolateOrderZero=function(t,r,i,n,o){e(o)||(o=new Array(n));var a,s,l=r.length;for(a=0;a<n;a++)o[a]=0;for(a=0;a<l;a++){var u=1;for(s=0;s<l;s++)if(s!==a){var c=r[a]-r[s];u*=(t-r[s])/c}for(s=0;s<n;s++)o[s]+=u*i[a*n+s]}return o},t}),define("Core/LinearApproximation",["./defined","./DeveloperError"],function(e,t){"use strict";var r={type:"Linear"};return r.getRequiredDataPoints=function(e){return 2},r.interpolateOrderZero=function(t,r,i,n,o){e(o)||(o=new Array(n));var a,s,l,u=r[0],c=r[1];for(a=0;a<n;a++)s=i[a],l=i[a+n],o[a]=((l-s)*t+c*s-u*l)/(c-u);return o},r}),define("Core/loadBlob",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,responseType:"blob",headers:r})}return t}),define("Core/loadCRN",["./CompressedTextureBuffer","./defined","./DeveloperError","./loadArrayBuffer","./TaskProcessor","../ThirdParty/when"],function(e,t,r,i,n,o){"use strict";function a(t,r){var n;return n=t instanceof ArrayBuffer||ArrayBuffer.isView(t)?o.resolve(t):i(t,r),n.then(function(e){var t=[];return e instanceof ArrayBuffer?t.push(e):0===e.byteOffset&&e.byteLength===e.buffer.byteLength?t.push(e.buffer):(e=e.slice(0,e.length),t.push(e.buffer)),s.scheduleTask(e,t)}).then(function(t){return e.clone(t)})}var s=new n("transcodeCRNToDXT",Number.POSITIVE_INFINITY);return a}),define("Core/loadImage",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./isCrossOriginUrl","./TrustedServers"],function(e,t,r,i,n,o){"use strict";function a(r,i){return i=t(i,!0),e(r,function(t){var r;r=!(s.test(t)||!i)&&n(t);var o=e.defer();return a.createImage(t,r,o),o.promise})}var s=/^data:/;return a.createImage=function(e,t,r){var i=new Image;i.onload=function(){r.resolve(i)},i.onerror=function(e){r.reject(e)},t&&(o.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e},a.defaultCreateImage=a.createImage,a}),define("Core/loadImageFromTypedArray",["../ThirdParty/when","./defined","./DeveloperError","./loadImage"],function(e,t,r,i){"use strict";function n(t,r){var n=new Blob([t],{type:r}),o=window.URL.createObjectURL(n);return i(o,!1).then(function(e){return window.URL.revokeObjectURL(o),e},function(t){return window.URL.revokeObjectURL(o),e.reject(t)})}return n}),define("Core/loadImageViaBlob",["../ThirdParty/when","./loadBlob","./loadImage"],function(e,t,r){"use strict";function i(i){return n.test(i)?r(i):t(i).then(function(t){var i=window.URL.createObjectURL(t);return r(i,!1).then(function(e){return e.blob=t,window.URL.revokeObjectURL(i),e},function(t){return window.URL.revokeObjectURL(i),e.reject(t)})})}var n=/^data:/,o=function(){try{var e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob","blob"===e.responseType}catch(e){return!1}}();return o?i:r}),define("Renderer/PixelDatatype",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={UNSIGNED_BYTE:t.UNSIGNED_BYTE,UNSIGNED_SHORT:t.UNSIGNED_SHORT,UNSIGNED_INT:t.UNSIGNED_INT,FLOAT:t.FLOAT,UNSIGNED_INT_24_8:t.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:t.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:t.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:t.UNSIGNED_SHORT_5_6_5,isPacked:function(e){return e===r.UNSIGNED_INT_24_8||e===r.UNSIGNED_SHORT_4_4_4_4||e===r.UNSIGNED_SHORT_5_5_5_1||e===r.UNSIGNED_SHORT_5_6_5},sizeInBytes:function(e){switch(e){case r.UNSIGNED_BYTE:return 1;case r.UNSIGNED_SHORT:case r.UNSIGNED_SHORT_4_4_4_4:case r.UNSIGNED_SHORT_5_5_5_1:case r.UNSIGNED_SHORT_5_6_5:return 2;case r.UNSIGNED_INT:case r.FLOAT:case r.UNSIGNED_INT_24_8:return 4}},validate:function(e){return e===r.UNSIGNED_BYTE||e===r.UNSIGNED_SHORT||e===r.UNSIGNED_INT||e===r.FLOAT||e===r.UNSIGNED_INT_24_8||e===r.UNSIGNED_SHORT_4_4_4_4||e===r.UNSIGNED_SHORT_5_5_5_1||e===r.UNSIGNED_SHORT_5_6_5}};return e(r)}),define("Core/PixelFormat",["../Renderer/PixelDatatype","./freezeObject","./WebGLConstants"],function(e,t,r){"use strict";var i={DEPTH_COMPONENT:r.DEPTH_COMPONENT,DEPTH_STENCIL:r.DEPTH_STENCIL,ALPHA:r.ALPHA,RGB:r.RGB,RGBA:r.RGBA,LUMINANCE:r.LUMINANCE,LUMINANCE_ALPHA:r.LUMINANCE_ALPHA,RGB_DXT1:r.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:r.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:r.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:r.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGB_ETC1:r.COMPRESSED_RGB_ETC1_WEBGL,componentsLength:function(e){switch(e){case i.RGB:case i.RGBA:return 4;case i.LUMINANCE_ALPHA:return 2;case i.ALPHA:case i.LUMINANCE:return 1;default:return 1}},validate:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL||e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA||e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5||e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1||e===i.RGB_ETC1},isColorFormat:function(e){return e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL},isCompressedFormat:function(e){return e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5||e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1||e===i.RGB_ETC1},isDXTFormat:function(e){return e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5},isPVRTCFormat:function(e){return e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1},isETC1Format:function(e){return e===i.RGB_ETC1},compressedTextureSizeInBytes:function(e,t,r){switch(e){case i.RGB_DXT1:case i.RGBA_DXT1:case i.RGB_ETC1:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*8;case i.RGBA_DXT3:case i.RGBA_DXT5:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*16;case i.RGB_PVRTC_4BPPV1:case i.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(r,8)*4+7)/8);case i.RGB_PVRTC_2BPPV1:case i.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(r,8)*2+7)/8);default:return 0}},textureSizeInBytes:function(t,r,n,o){var a=i.componentsLength(t);return e.isPacked(r)&&(a=1),a*e.sizeInBytes(r)*n*o}};return t(i)}),define("Core/loadKTX",["../ThirdParty/when","./CompressedTextureBuffer","./defined","./DeveloperError","./loadArrayBuffer","./PixelFormat","./RuntimeError"],function(e,t,r,i,n,o,a){"use strict";function s(t,r){var i;return i=t instanceof ArrayBuffer||ArrayBuffer.isView(t)?e.resolve(t):n(t,r),i.then(function(e){return l(e)})}function l(e){for(var i=new Uint8Array(e),n=!0,s=0;s<u.length;++s)if(u[s]!==i[s]){n=!1;break}if(!n)throw new a("Invalid KTX file.");var l,h;r(e.buffer)?(l=new DataView(e.buffer),h=e.byteOffset):(l=new DataView(e),h=0),h+=12;var p=l.getUint32(h,!0);if(h+=d,p!==c)throw new a("File is the wrong endianness.");var f=l.getUint32(h,!0);h+=d;var m=l.getUint32(h,!0);h+=d;var g=l.getUint32(h,!0);h+=d;var v=l.getUint32(h,!0);h+=d;var _=l.getUint32(h,!0);h+=d;var y=l.getUint32(h,!0);h+=d;var b=l.getUint32(h,!0);h+=d;var C=l.getUint32(h,!0);h+=d;var w=l.getUint32(h,!0);h+=d;var S=l.getUint32(h,!0);h+=d;var E=l.getUint32(h,!0);h+=d;var T=l.getUint32(h,!0);h+=d,h+=T;var x=l.getUint32(h,!0);h+=d;var P;if(P=r(e.buffer)?new Uint8Array(e.buffer,h,x):new Uint8Array(e,h,x),32849===v?v=o.RGB:32856===v&&(v=o.RGBA),!o.validate(v))throw new a("glInternalFormat is not a valid format.");if(o.isCompressedFormat(v)){if(0!==f)throw new a("glType must be zero when the texture is compressed.");if(1!==m)throw new a("The type size for compressed textures must be 1.");if(0!==g)throw new a("glFormat must be zero when the texture is compressed.");if(0===E)throw new a("Generating mipmaps for a compressed texture is unsupported.")}else if(_!==g)throw new a("The base internal format must be the same as the format for uncompressed textures.");if(0!==C)throw new a("3D textures are unsupported.");if(0!==w)throw new a("Texture arrays are unsupported.");if(1!==S)throw new a("Cubemaps are unsupported.");if(o.isCompressedFormat(v)&&E>1){var A=o.compressedTextureSizeInBytes(v,y,b);P=P.slice(0,A)}return new t(v,y,b,P)}var u=[171,75,84,88,32,49,49,187,13,10,26,10],c=67305985,d=4;return s}),define("Core/loadXML",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,responseType:"document",headers:r,overrideMimeType:"text/xml"})}return t}),define("Core/MapboxApi",["./defined","./Credit"],function(e,t){"use strict";var r={};r.defaultAccessToken=void 0;var i,n=!1,o="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 https://www.mapbox.com/account/apps/, 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.";return r.getAccessToken=function(t){return e(t)?t:e(r.defaultAccessToken)?r.defaultAccessToken:(n||(console.log(o),n=!0),"pk.eyJ1IjoiYW5hbHl0aWNhbGdyYXBoaWNzIiwiYSI6ImNpd204Zm4wejAwNzYyeW5uNjYyZmFwdWEifQ.7i-VIZZWX8pd1bTfxIVj9g")},r.getErrorCredit=function(n){if(!e(n)&&!e(r.defaultAccessToken))return e(i)||(i=new t(o)),i},r}),define("Core/MapProjection",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function r(){t.throwInstantiationError()}return e(r.prototype,{ellipsoid:{get:t.throwInstantiationError}}),r.prototype.project=t.throwInstantiationError,r.prototype.unproject=t.throwInstantiationError,r}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./freezeObject"],function(e,t,r,i,n,o){"use strict";function a(e,t,i,n){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(t,0),this[3]=r(n,0)}a.packedLength=4,a.pack=function(e,t,i){return i=r(i,0),t[i++]=e[0],t[i++]=e[1],t[i++]=e[2],t[i++]=e[3],t},a.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new a),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n},a.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new a(e[0],e[2],e[1],e[3])},a.fromArray=function(e,t,n){return t=r(t,0),i(n)||(n=new a),n[0]=e[t],n[1]=e[t+1],n[2]=e[t+2],n[3]=e[t+3],n},a.fromColumnMajorArray=function(e,t){return a.clone(e,t)},a.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new a(e[0],e[1],e[2],e[3])},a.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new a(e.x,0,0,e.y)},a.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new a(e,0,0,e)},a.fromRotation=function(e,t){var r=Math.cos(e),n=Math.sin(e);return i(t)?(t[0]=r,t[1]=n,t[2]=-n,t[3]=r,t):new a(r,-n,n,r)},a.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},a.getElementIndex=function(e,t){return 2*e+t},a.getColumn=function(e,t,r){var i=2*t,n=e[i],o=e[i+1];return r.x=n,r.y=o,r},a.setColumn=function(e,t,r,i){i=a.clone(e,i);var n=2*t;return i[n]=r.x,i[n+1]=r.y,i},a.getRow=function(e,t,r){var i=e[t],n=e[t+2];return r.x=i,r.y=n,r},a.setRow=function(e,t,r,i){return i=a.clone(e,i),i[t]=r.x,i[t+2]=r.y,i};var s=new e;a.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],s)),r.y=e.magnitude(e.fromElements(t[2],t[3],s)),r};var l=new e;return a.getMaximumScale=function(t){return a.getScale(t,l),e.maximumComponent(l)},a.multiply=function(e,t,r){var i=e[0]*t[0]+e[2]*t[1],n=e[0]*t[2]+e[2]*t[3],o=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return r[0]=i,r[1]=o,r[2]=n,r[3]=a,r},a.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r},a.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r},a.multiplyByVector=function(e,t,r){var i=e[0]*t.x+e[2]*t.y,n=e[1]*t.x+e[3]*t.y;return r.x=i,r.y=n,r},a.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r},a.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.y,r[3]=e[3]*t.y,r},a.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},a.transpose=function(e,t){var r=e[0],i=e[2],n=e[1],o=e[3];return t[0]=r,t[1]=i,t[2]=n,t[3]=o,t},a.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},a.equals=function(e,t){return e===t||i(e)&&i(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},a.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]},a.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r},a.IDENTITY=o(new a(1,0,0,1)),a.ZERO=o(new a(0,0,0,0)),a.COLUMN0ROW0=0,a.COLUMN0ROW1=1,a.COLUMN1ROW0=2,a.COLUMN1ROW1=3,n(a.prototype,{length:{get:function(){return a.packedLength}}}),a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t){return a.equalsEpsilon(this,e,t)},a.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},a}),define("Core/mergeSort",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r,i,n,s){var l,u,c=n-i+1,d=s-n,h=o,p=a;for(l=0;l<c;++l)h[l]=e[i+l];for(u=0;u<d;++u)p[u]=e[n+u+1];l=0,u=0;for(var f=i;f<=s;++f){var m=h[l],g=p[u];l<c&&(u>=d||t(m,g,r)<=0)?(e[f]=m,++l):u<d&&(e[f]=g,++u)}}function i(e,t,n,o,a){if(!(o>=a)){var s=Math.floor(.5*(o+a));i(e,t,n,o,s),i(e,t,n,s+1,a),r(e,t,n,o,s,a)}}function n(e,t,r){var n=e.length,s=Math.ceil(.5*n);o.length=s,a.length=s,i(e,t,r,0,n-1),o.length=0,a.length=0}var o=[],a=[];return n}),define("Core/NearFarScalar",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t,r,i,n){this.near=e(t,0),this.nearValue=e(r,0),this.far=e(i,1),this.farValue=e(n,0)}return i.clone=function(e,r){if(t(e))return t(r)?(r.near=e.near,r.nearValue=e.nearValue,r.far=e.far,r.farValue=e.farValue,r):new i(e.near,e.nearValue,e.far,e.farValue)},i.packedLength=4,i.pack=function(t,r,i){return i=e(i,0),r[i++]=t.near,r[i++]=t.nearValue,r[i++]=t.far,r[i]=t.farValue,r},i.unpack=function(r,n,o){return n=e(n,0),t(o)||(o=new i),o.near=r[n++],o.nearValue=r[n++],o.far=r[n++],o.farValue=r[n],o},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.near===r.near&&e.nearValue===r.nearValue&&e.far===r.far&&e.farValue===r.farValue},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/Visibility",["./freezeObject"],function(e){"use strict";var t={NONE:-1,PARTIAL:0,FULL:1};return e(t)});define("Core/Occluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math","./Rectangle","./Visibility"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r){this._occluderPosition=t.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=r}var d=new t;n(c.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=t.clone(e,this._cameraPosition);var r,i,n,o=t.subtract(this._occluderPosition,e,d),a=t.magnitudeSquared(o),s=this._occluderRadius*this._occluderRadius;if(a>s){r=Math.sqrt(a-s),a=1/Math.sqrt(a),i=t.multiplyByScalar(o,a,d);var l=r*r*a;n=t.add(e,t.multiplyByScalar(i,l,d),d)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=i,this._horizonPlanePosition=n,this._cameraPosition=e}}}),c.fromBoundingSphere=function(e,r,n){return i(n)?(t.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=r,n):new c(e,r)};var h=new t;c.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){var r=t.subtract(e,this._occluderPosition,h),i=this._occluderRadius;if(i=t.magnitudeSquared(r)-i*i,i>0)return i=Math.sqrt(i)+this._horizonDistance,r=t.subtract(e,this._cameraPosition,r),i*i>t.magnitudeSquared(r)}return!1};var p=new t;c.prototype.isBoundingSphereVisible=function(e){var r=t.clone(e.center,p),i=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(r,this._occluderPosition,h),o=this._occluderRadius-i;if(o=t.magnitudeSquared(n)-o*o,i<this._occluderRadius)return o>0&&(o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(r,this._cameraPosition,n),o*o+i*i>t.magnitudeSquared(n));if(o>0){n=t.subtract(r,this._cameraPosition,n);var a=t.magnitudeSquared(n),s=this._occluderRadius*this._occluderRadius,l=i*i;return(this._horizonDistance*this._horizonDistance+s)*l>a*s||(o=Math.sqrt(o)+this._horizonDistance,o*o+l>a)}return!0}return!1};var f=new t;c.prototype.computeVisibility=function(e){var r=t.clone(e.center),i=e.radius;if(i>this._occluderRadius)return u.FULL;if(this._horizonDistance!==Number.MAX_VALUE){var n=t.subtract(r,this._occluderPosition,f),o=this._occluderRadius-i,a=t.magnitudeSquared(n);if(o=a-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,n=t.subtract(r,this._cameraPosition,n);var s=t.magnitudeSquared(n);return o*o+i*i<s?u.NONE:(o=this._occluderRadius+i,o=a-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+i*i?u.FULL:u.PARTIAL):(n=t.subtract(r,this._horizonPlanePosition,n),t.dot(n,this._horizonPlaneNormal)>-i?u.PARTIAL:u.FULL))}}return u.NONE};var m=new t;c.computeOccludeePoint=function(e,r,i){var n=t.clone(r),o=t.clone(e.center),a=e.radius,s=i.length,l=t.normalize(t.subtract(n,o,m),m),u=-t.dot(l,o),d=c._anyRotationVector(o,l,u),h=c._horizonToPlaneNormalDotProduct(e,l,u,d,i[0]);if(h){for(var p,f=1;f<s;++f){if(p=c._horizonToPlaneNormalDotProduct(e,l,u,d,i[f]),!p)return;p<h&&(h=p)}if(!(h<.0017453283658983088)){var g=a/h;return t.add(o,t.multiplyByScalar(l,g,m),m)}}};var g=[];c.computeOccludeePointFromRectangle=function(i,n){n=r(n,a.WGS84);var o=l.subsample(i,n,0,g),s=e.fromPoints(o),u=t.ZERO;if(!t.equals(u,s.center))return c.computeOccludeePoint(new e(u,n.minimumRadius),s.center,o)};var v=new t;c._anyRotationVector=function(e,r,i){var n=t.abs(r,v),o=n.x>n.y?0:1;(0===o&&n.z>n.x||1===o&&n.z>n.y)&&(o=2);var a,s=new t;0===o?(n.x=e.x,n.y=e.y+1,n.z=e.z+1,a=t.UNIT_X):1===o?(n.x=e.x+1,n.y=e.y,n.z=e.z+1,a=t.UNIT_Y):(n.x=e.x+1,n.y=e.y+1,n.z=e.z,a=t.UNIT_Z);var l=(t.dot(r,n)+i)/-t.dot(r,a);return t.normalize(t.subtract(t.add(n,t.multiplyByScalar(a,l,s),n),e,n),n)};var _=new t;c._rotationVector=function(e,r,i,n,o){var a=t.subtract(n,e,_);if(a=t.normalize(a,a),t.dot(r,a)<.9999999847691291){var l=t.cross(r,a,a),u=t.magnitude(l);if(u>s.EPSILON13)return t.normalize(l,new t)}return o};var y=new t,b=new t,C=new t,w=new t;return c._horizonToPlaneNormalDotProduct=function(e,r,i,n,o){var a=t.clone(o,y),s=t.clone(e.center,b),l=e.radius,u=t.subtract(s,a,C),c=t.magnitudeSquared(u),d=l*l;if(c<d)return!1;var h=c-d,p=Math.sqrt(h),f=Math.sqrt(c),m=1/f,g=p*m,v=g*p;u=t.normalize(u,u);var _=t.add(a,t.multiplyByScalar(u,v,w),w),S=Math.sqrt(h-v*v),E=this._rotationVector(s,r,i,a,n),T=t.fromElements(E.x*E.x*u.x+(E.x*E.y-E.z)*u.y+(E.x*E.z+E.y)*u.z,(E.x*E.y+E.z)*u.x+E.y*E.y*u.y+(E.y*E.z-E.x)*u.z,(E.x*E.z-E.y)*u.x+(E.y*E.z+E.x)*u.y+E.z*E.z*u.z,y);T=t.normalize(T,T);var x=t.multiplyByScalar(T,S,y);E=t.normalize(t.subtract(t.add(_,x,C),s,C),C);var P=t.dot(r,E);E=t.normalize(t.subtract(t.subtract(_,x,E),s,E),E);var A=t.dot(r,E);return P<A?P:A},c});define("Core/Packable",["./DeveloperError"],function(e){"use strict";var t={packedLength:void 0,pack:e.throwInstantiationError,unpack:e.throwInstantiationError};return t}),define("Core/PackableForInterpolation",["./DeveloperError"],function(e){"use strict";var t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:e.throwInstantiationError,unpackInterpolationResult:e.throwInstantiationError};return t}),define("ThirdParty/measureText",[],function(){var e=function(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)},t=function(t,r,i,n){var o=t.measureText(r),a=e(t.canvas,"font-family"),s=e(t.canvas,"font-size").replace("px",""),l=e(t.canvas,"font-style"),u=e(t.canvas,"font-weight"),c=!/\S/.test(r);o.fontsize=s;var d=document.createElement("div");d.style.position="absolute",d.style.opacity=0,d.style.font=l+" "+u+" "+s+"px "+a,d.innerHTML=r+"<br/>"+r,document.body.appendChild(d),o.leading=1.2*s;var h=e(d,"height");if(h=h.replace("px",""),h>=2*s&&(o.leading=h/2|0),document.body.removeChild(d),c)o.ascent=0,o.descent=0,o.bounds={minx:0,maxx:o.width,miny:0,maxy:0},o.height=0;else{var p=document.createElement("canvas"),f=100;p.width=o.width+f,p.height=3*s,p.style.opacity=1,p.style.fontFamily=a,p.style.fontSize=s,p.style.fontStyle=l,p.style.fontWeight=u;var m=p.getContext("2d");m.font=l+" "+u+" "+s+"px "+a;var g=p.width,v=p.height,_=v/2;m.fillStyle="white",m.fillRect(-1,-1,g+2,v+2),i&&(m.strokeStyle="black",m.lineWidth=t.lineWidth,m.strokeText(r,f/2,_)),n&&(m.fillStyle="black",m.fillText(r,f/2,_));for(var y=m.getImageData(0,0,g,v).data,b=0,C=4*g,w=y.length;++b<w&&255===y[b];);var S=b/C|0;for(b=w-1;--b>0&&255===y[b];);var E=b/C|0;for(b=0;b<w&&255===y[b];)b+=C,b>=w&&(b=b-w+4);var T=b%C/4|0,x=1;for(b=w-3;b>=0&&255===y[b];)b-=C,b<0&&(b=w-3-4*x++);var P=b%C/4+1|0;o.ascent=_-S,o.descent=E-_,o.bounds={minx:T-f/2,maxx:P-f/2,miny:0,maxy:E-S},o.height=1+(E-S)}return o};return t}),define("Core/writeTextToCanvas",["../ThirdParty/measureText","./Color","./defaultValue","./defined","./DeveloperError"],function(e,t,r,i,n){"use strict";function o(n,o){if(""!==n){o=r(o,r.EMPTY_OBJECT);var s=r(o.font,"10px sans-serif"),l=r(o.stroke,!1),u=r(o.fill,!0),c=r(o.strokeWidth,1),d=r(o.backgroundColor,t.TRANSPARENT),h=r(o.padding,0),p=2*h,f=document.createElement("canvas");f.width=1,f.height=1,f.style.font=s;var m=f.getContext("2d");i(a)||(i(m.imageSmoothingEnabled)?a="imageSmoothingEnabled":i(m.mozImageSmoothingEnabled)?a="mozImageSmoothingEnabled":i(m.webkitImageSmoothingEnabled)?a="webkitImageSmoothingEnabled":i(m.msImageSmoothingEnabled)&&(a="msImageSmoothingEnabled")),m.font=s,m.lineJoin="round",m.lineWidth=c,m[a]=!1,m.textBaseline=r(o.textBaseline,"bottom"),f.style.visibility="hidden",document.body.appendChild(f);var g=e(m,n,l,u);f.dimensions=g,document.body.removeChild(f),f.style.visibility="";var v=-g.bounds.minx,_=Math.ceil(g.width)+v+p,y=g.height+p,b=y-g.ascent+p,C=y-b+p;if(f.width=_,f.height=y,m.font=s,m.lineJoin="round",m.lineWidth=c,m[a]=!1,d!==t.TRANSPARENT&&(m.fillStyle=d.toCssColorString(),m.fillRect(0,0,f.width,f.height)),l){var w=r(o.strokeColor,t.BLACK);m.strokeStyle=w.toCssColorString(),m.strokeText(n,v+h,C)}if(u){var S=r(o.fillColor,t.WHITE);m.fillStyle=S.toCssColorString(),m.fillText(n,v+h,C)}return f}}var a;return o}),define("Core/PinBuilder",["./buildModuleUrl","./Color","./defined","./DeveloperError","./loadImage","./writeTextToCanvas"],function(e,t,r,i,n,o){"use strict";function a(){this._cache={}}function s(e,t,r){e.save(),e.scale(r/24,r/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,c).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 l(e,r,i){var n=i/2.5,o=n,a=n;r.width>r.height?a=n*(r.height/r.width):r.width<r.height&&(o=n*(r.width/r.height));var s=Math.round((i-o)/2),l=Math.round(7/24*i-a/2);e.globalCompositeOperation="destination-out",e.drawImage(r,s-1,l,o,a),e.drawImage(r,s,l-1,o,a),e.drawImage(r,s+1,l,o,a),e.drawImage(r,s,l+1,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.BLACK.toCssColorString(),e.fillRect(s-1,l-1,o+2,a+2),e.globalCompositeOperation="destination-out",e.drawImage(r,s,l,o,a),e.globalCompositeOperation="destination-over",e.fillStyle=t.WHITE.toCssColorString(),e.fillRect(s-1,l-2,o+2,a+2)}function u(e,t,i,a,u){d[0]=e,d[1]=t,d[2]=i,d[3]=a;var c=JSON.stringify(d),h=u[c];if(r(h))return h;var p=document.createElement("canvas");p.width=a,p.height=a;var f=p.getContext("2d");if(s(f,i,a),r(e)){var m=n(e).then(function(e){return l(f,e,a),u[c]=p,p});return u[c]=m,m}if(r(t)){var g=o(t,{font:"bold "+a+"px sans-serif"});l(f,g,a)}return u[c]=p,p}a.prototype.fromColor=function(e,t){return u(void 0,void 0,e,t,this._cache)},a.prototype.fromUrl=function(e,t,r){return u(e,void 0,t,r,this._cache)},a.prototype.fromMakiIconId=function(t,r,i){return u(e("Assets/Textures/maki/"+encodeURIComponent(t)+".png"),void 0,r,i,this._cache)},a.prototype.fromText=function(e,t,r){return u(void 0,e,t,r,this._cache)};var c=new t,d=new Array(4);return a}),define("Core/pointInsideTriangle",["./barycentricCoordinates","./Cartesian3"],function(e,t){"use strict";function r(t,r,n,o){return e(t,r,n,o,i),i.x>0&&i.y>0&&i.z>0}var i=new t;return r}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,r=e[t];return e[t]=void 0, +t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,r}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e,r,i,n){return t.subtract(r,e,_),t.multiplyByScalar(_,i/n,_),t.add(e,_,_),[_.x,_.y,_.z]}var v={};v.computeHierarchyPackedLength=function(e){for(var r=0,i=[e];i.length>0;){var o=i.pop();if(n(o)){r+=2;var a=o.positions,s=o.holes;if(n(a)&&(r+=a.length*t.packedLength),n(s))for(var l=s.length,u=0;u<l;++u)i.push(s[u])}}return r},v.packPolygonHierarchy=function(e,r,i){for(var o=[e];o.length>0;){var a=o.pop();if(n(a)){var s=a.positions,l=a.holes;if(r[i++]=n(s)?s.length:0,r[i++]=n(l)?l.length:0,n(s))for(var u=s.length,c=0;c<u;++c,i+=3)t.pack(s[c],r,i);if(n(l))for(var d=l.length,h=0;h<d;++h)o.push(l[h])}}return i},v.unpackPolygonHierarchy=function(e,r){for(var i=e[r++],n=e[r++],o=new Array(i),a=n>0?new Array(n):void 0,s=0;s<i;++s,r+=t.packedLength)o[s]=t.unpack(e,r);for(var l=0;l<n;++l)a[l]=v.unpackPolygonHierarchy(e,r),r=a[l].startingIndex,delete a[l].startingIndex;return{positions:o,holes:a,startingIndex:r}};var _=new t;v.subdivideLineCount=function(e,r,i){var n=t.distance(e,r),o=n/i,a=Math.max(0,Math.ceil(Math.log(o)/Math.log(2)));return Math.pow(2,a)},v.subdivideLine=function(e,r,i,o){var a=v.subdivideLineCount(e,r,i),s=t.distance(e,r),l=s/a;n(o)||(o=[]);var u=o;u.length=3*a;for(var c=0,d=0;d<a;d++){var h=g(e,r,d*l,s);u[c++]=h[0],u[c++]=h[1],u[c++]=h[2]}return u};var y=new t,b=new t,C=new t,w=new t;v.scaleToGeodeticHeightExtruded=function(e,r,a,s,l){s=i(s,o.WGS84);var u=y,c=b,d=C,h=w;if(n(e)&&n(e.attributes)&&n(e.attributes.position))for(var p=e.attributes.position.values,f=p.length/2,m=0;m<f;m+=3)t.fromArray(p,m,d),s.geodeticSurfaceNormal(d,u),h=s.scaleToGeodeticSurface(d,h),c=t.multiplyByScalar(u,a,c),c=t.add(h,c,c),p[m+f]=c.x,p[m+1+f]=c.y,p[m+2+f]=c.z,l&&(h=t.clone(d,h)),c=t.multiplyByScalar(u,r,c),c=t.add(h,c,c),p[m]=c.x,p[m+1]=c.y,p[m+2]=c.z;return e},v.polygonsFromHierarchy=function(r,i,o,a){var s=[],l=[],u=new f;for(u.enqueue(r);0!==u.length;){var c=u.dequeue(),d=c.positions,p=c.holes;if(d=e(d,t.equalsEpsilon,!0),!(d.length<3)){var g=o.projectPointsOntoPlane(d),v=[],_=h.computeWindingOrder2D(g);_===m.CLOCKWISE&&(g.reverse(),d=d.slice().reverse());var y,b,C=d.slice(),w=n(p)?p.length:0,S=[];for(y=0;y<w;y++){var E=p[y],T=e(E.positions,t.equalsEpsilon,!0);if(!(T.length<3)){var x=o.projectPointsOntoPlane(T);_=h.computeWindingOrder2D(x),_===m.CLOCKWISE&&(x.reverse(),T=T.slice().reverse()),S.push(T),v.push(C.length),C=C.concat(T),g=g.concat(x);var P=0;for(n(E.holes)&&(P=E.holes.length),b=0;b<P;b++)u.enqueue(E.holes[b])}}if(!i){for(y=0;y<d.length;y++)a.scaleToGeodeticSurface(d[y],d[y]);for(y=0;y<S.length;y++){var A=S[y];for(b=0;b<A.length;++b)a.scaleToGeodeticSurface(A[b],A[b])}}s.push({outerRing:d,holes:S}),l.push({positions:C,positions2D:g,holes:v})}}return{hierarchy:s,polygons:l}},v.createGeometryFromPositions=function(e,t,i,n,o){var l=h.triangulate(t.positions2D,t.holes);l.length<3&&(l=[0,1,2]);var c=t.positions;if(n){for(var d=c.length,f=new Array(3*d),m=0,g=0;g<d;g++){var v=c[g];f[m++]=v.x,f[m++]=v.y,f[m++]=v.z}var _=new a({attributes:{position:new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:f})},indices:l,primitiveType:p.TRIANGLES});return o.normal?u.computeNormal(_):_}return h.computeSubdivision(e,c,l,i)};var S=[],E=new t,T=new t;return v.computeWallGeometry=function(e,i,n,o){var u,h,f,m,g,_=e.length,y=0;if(o)for(h=3*_*2,u=new Array(2*h),f=0;f<_;f++)m=e[f],g=e[(f+1)%_],u[y]=u[y+h]=m.x,++y,u[y]=u[y+h]=m.y,++y,u[y]=u[y+h]=m.z,++y,u[y]=u[y+h]=g.x,++y,u[y]=u[y+h]=g.y,++y,u[y]=u[y+h]=g.z,++y;else{var b=d.chordLength(n,i.maximumRadius),C=0;for(f=0;f<_;f++)C+=v.subdivideLineCount(e[f],e[(f+1)%_],b);for(h=3*(C+_),u=new Array(2*h),f=0;f<_;f++){m=e[f],g=e[(f+1)%_];for(var w=v.subdivideLine(m,g,b,S),x=w.length,P=0;P<x;++P,++y)u[y]=w[P],u[y+h]=w[P];u[y]=g.x,u[y+h]=g.x,++y,u[y]=g.y,u[y+h]=g.y,++y,u[y]=g.z,u[y+h]=g.z,++y}}_=u.length;var A=c.createTypedArray(_/3,_-6*e.length),D=0;for(_/=6,f=0;f<_;f++){var I=f,M=I+1,O=I+_,R=O+1;m=t.fromArray(u,3*I,E),g=t.fromArray(u,3*M,T),t.equalsEpsilon(m,g,d.EPSILON14)||(A[D++]=I,A[D++]=O,A[D++]=M,A[D++]=M,A[D++]=O,A[D++]=R)}return new a({attributes:new l({position:new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:u})}),indices:A,primitiveType:p.TRIANGLES})},v}),define("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./Rectangle","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T){"use strict";function x(e,t,r,n){for(var o=w.fromAxisAngle(e._plane.normal,r,R),a=y.fromQuaternion(o,N),s=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=Number.POSITIVE_INFINITY,d=Number.NEGATIVE_INFINITY,h=t.length,p=0;p<h;++p){var f=i.clone(t[p],O);y.multiplyByVector(a,f,f);var m=e.projectPointOntoPlane(f,M);l(m)&&(s=Math.min(s,m.x),u=Math.max(u,m.x),c=Math.min(c,m.y),d=Math.max(d,m.y))}return n.x=s,n.y=c,n.width=u-s,n.height=d-c,n}function P(e,t,r,i){var n=i.cartesianToCartographic(e,k),o=n.height,a=i.cartesianToCartographic(t,L);a.height=o,i.cartographicToCartesian(a,t);var s=i.cartesianToCartographic(r,L);s.height=o-100,i.cartographicToCartesian(s,r)}function A(e){var t=e.vertexFormat,n=e.geometry,o=e.shadowVolume;if(t.st||t.normal||t.tangent||t.bitangent||o){var s=e.boundingRectangle,l=e.tangentPlane,u=e.ellipsoid,c=e.stRotation,d=e.wall,h=e.top||d,p=e.bottom||d,m=e.perPositionHeight,g=Y;g.x=s.x,g.y=s.y;var v,b=n.attributes.position.values,C=b.length,S=t.st?new Float32Array(2*(C/3)):void 0;t.normal&&(v=m&&h&&!d?n.attributes.normal.values:new Float32Array(C));var E=t.tangent?new Float32Array(C):void 0,T=t.bitangent?new Float32Array(C):void 0,x=o?new Float32Array(C):void 0,A=0,D=0,I=U,M=V,O=z,R=!0,N=w.fromAxisAngle(l._plane.normal,c,Z),k=y.fromQuaternion(N,K),L=0,F=0;h&&p&&(L=C/2,F=C/3,C/=2);for(var J=0;J<C;J+=3){var $=i.fromArray(b,J,Q);if(t.st){var ee=y.multiplyByVector(k,$,B);ee=u.scaleToGeodeticSurface(ee,ee);var te=l.projectPointOntoPlane(ee,X);r.subtract(te,g,te);var re=_.clamp(te.x/s.width,0,1),ie=_.clamp(te.y/s.height,0,1);p&&(S[A+F]=re,S[A+1+F]=ie),h&&(S[A]=re,S[A+1]=ie),A+=2}if(t.normal||t.tangent||t.bitangent||o){var ne=D+1,oe=D+2;if(d){if(J+3<C){var ae=i.fromArray(b,J+3,G);if(R){var se=i.fromArray(b,J+C,H);m&&P($,ae,se,u),i.subtract(ae,$,ae),i.subtract(se,$,se),I=i.normalize(i.cross(se,ae,I),I),R=!1}i.equalsEpsilon(ae,$,_.EPSILON10)&&(R=!0)}(t.tangent||t.bitangent)&&(O=u.geodeticSurfaceNormal($,O),t.tangent&&(M=i.normalize(i.cross(O,I,M),M)))}else I=u.geodeticSurfaceNormal($,I),(t.tangent||t.bitangent)&&(m&&(W=i.fromArray(v,D,W),j=i.cross(i.UNIT_Z,W,j),j=i.normalize(y.multiplyByVector(k,j,j),j),t.bitangent&&(q=i.normalize(i.cross(W,j,q),q))),M=i.cross(i.UNIT_Z,I,M),M=i.normalize(y.multiplyByVector(k,M,M),M),t.bitangent&&(O=i.normalize(i.cross(I,M,O),O)));t.normal&&(e.wall?(v[D+L]=I.x,v[ne+L]=I.y,v[oe+L]=I.z):p&&(v[D+L]=-I.x,v[ne+L]=-I.y,v[oe+L]=-I.z),(h&&!m||d)&&(v[D]=I.x,v[ne]=I.y,v[oe]=I.z)),o&&(d&&(I=u.geodeticSurfaceNormal($,I)),x[D+L]=-I.x,x[ne+L]=-I.y,x[oe+L]=-I.z),t.tangent&&(e.wall?(E[D+L]=M.x,E[ne+L]=M.y,E[oe+L]=M.z):p&&(E[D+L]=-M.x,E[ne+L]=-M.y,E[oe+L]=-M.z),h&&(m?(E[D]=j.x,E[ne]=j.y,E[oe]=j.z):(E[D]=M.x,E[ne]=M.y,E[oe]=M.z))),t.bitangent&&(p&&(T[D+L]=O.x,T[ne+L]=O.y,T[oe+L]=O.z),h&&(m?(T[D]=q.x,T[ne]=q.y,T[oe]=q.z):(T[D]=O.x,T[ne]=O.y,T[oe]=O.z))),D+=3}}t.st&&(n.attributes.st=new f({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:S})),t.normal&&(n.attributes.normal=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),t.tangent&&(n.attributes.tangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:E})),t.bitangent&&(n.attributes.bitangent=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:T})),o&&(n.attributes.extrudeDirection=new f({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:x}))}return n}function D(e,t,r,i,n,o,a,s){var l,u={walls:[]};if(o||a){var c,d,p=b.createGeometryFromPositions(e,t,r,n,s),f=p.attributes.position.values,g=p.indices;if(o&&a){var _=f.concat(f);c=_.length/3,d=v.createTypedArray(c,2*g.length),d.set(g);var y=g.length,w=c/2;for(l=0;l<y;l+=3){var S=d[l]+w,E=d[l+1]+w,x=d[l+2]+w;d[l+y]=x,d[l+1+y]=E,d[l+2+y]=S}if(p.attributes.position.values=_,n){var P=p.attributes.normal.values;p.attributes.normal.values=new Float32Array(_.length),p.attributes.normal.values.set(P)}p.indices=d}else if(a){for(c=f.length/3,d=v.createTypedArray(c,g.length),l=0;l<g.length;l+=3)d[l]=g[l+2],d[l+1]=g[l+1],d[l+2]=g[l];p.indices=d}u.topAndBottom=new m({geometry:p})}var A=i.outerRing,D=h.fromPoints(A,e),I=D.projectPointsOntoPlane(A,J),M=C.computeWindingOrder2D(I);M===T.CLOCKWISE&&(A=A.slice().reverse());var O=b.computeWallGeometry(A,e,r,n);u.walls.push(new m({geometry:O}));var R=i.holes;for(l=0;l<R.length;l++){var N=R[l];D=h.fromPoints(N,e),I=D.projectPointsOntoPlane(N,J),M=C.computeWindingOrder2D(I),M===T.COUNTER_CLOCKWISE&&(N=N.slice().reverse()),O=b.computeWallGeometry(N,e,r),u.walls.push(new m({geometry:O}))}return u}function I(e){var t=e.polygonHierarchy,r=s(e.vertexFormat,E.DEFAULT),i=s(e.ellipsoid,d.WGS84),n=s(e.granularity,_.RADIANS_PER_DEGREE),o=s(e.stRotation,0),a=s(e.height,0),u=s(e.perPositionHeight,!1),c=e.extrudedHeight,h=l(c);if(!u&&h)if(_.equalsEpsilon(a,c,_.EPSILON10))c=void 0,h=!1;else{var p=c;c=Math.min(p,a),a=Math.max(p,a)}this._vertexFormat=E.clone(r),this._ellipsoid=d.clone(i),this._granularity=n,this._stRotation=o,this._height=a,this._extrudedHeight=s(c,0),this._extrude=h,this._closeTop=s(e.closeTop,!0),this._closeBottom=s(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=u,this._shadowVolume=s(e.shadowVolume,!1),this._workerName="createPolygonGeometry";var f=t.positions;!l(f)||f.length<3?this._rectangle=new S:this._rectangle=S.fromCartesianArray(f,i),this.packedLength=b.computeHierarchyPackedLength(t)+d.packedLength+E.packedLength+S.packedLength+10}var M=new r,O=new i,R=new w,N=new y,k=new n,L=new n,F=new e,B=new i,U=new i,V=new i,z=new i,G=new i,H=new i,W=new i,j=new i,q=new i,Y=new r,X=new r,Q=new i,Z=new w,K=new y,J=[];I.fromPositions=function(e){e=s(e,s.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.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};return new I(t)},I.pack=function(e,t,r){return r=s(r,0),r=b.packPolygonHierarchy(e._polygonHierarchy,t,r),d.pack(e._ellipsoid,t,r),r+=d.packedLength,E.pack(e._vertexFormat,t,r),r+=E.packedLength,S.pack(e._rectangle,t,r),r+=S.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._stRotation,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e._closeTop?1:0,t[r++]=e._closeBottom?1:0,t[r++]=e._shadowVolume?1:0,t[r]=e.packedLength,t};var $=d.clone(d.UNIT_SPHERE),ee=new E,te=new S,re={polygonHierarchy:{}};return I.unpack=function(e,t,r){t=s(t,0);var i=b.unpackPolygonHierarchy(e,t);t=i.startingIndex,delete i.startingIndex;var n=d.unpack(e,t,$);t+=d.packedLength;var o=E.unpack(e,t,ee);t+=E.packedLength;var a=S.unpack(e,t,te);t+=S.packedLength;var u=e[t++],c=e[t++],h=e[t++],p=e[t++],f=1===e[t++],m=1===e[t++],g=1===e[t++],v=1===e[t++],_=1===e[t++],y=e[t];return l(r)||(r=new I(re)),r._polygonHierarchy=i,r._ellipsoid=d.clone(n,r._ellipsoid),r._vertexFormat=E.clone(o,r._vertexFormat),r._height=u,r._extrudedHeight=c,r._granularity=h,r._stRotation=p,r._extrude=f,r._perPositionHeight=m,r._closeTop=g,r._closeBottom=v,r._rectangle=S.clone(a),r._shadowVolume=_,r.packedLength=y,r},I.createGeometry=function(e){var r=e._vertexFormat,i=e._ellipsoid,n=e._granularity,o=e._stRotation,a=e._height,s=e._extrudedHeight,l=e._extrude,u=e._polygonHierarchy,c=e._perPositionHeight,d=e._closeTop,f=e._closeBottom,_=u.positions;if(!(_.length<3)){var y=h.fromPoints(_,i),w=b.polygonsFromHierarchy(u,c,y,i),S=w.hierarchy,E=w.polygons;if(0!==S.length){_=S[0].outerRing;var T,P,I=x(y,_,o,F),M=[],O={perPositionHeight:c,vertexFormat:r,geometry:void 0,tangentPlane:y,boundingRectangle:I,ellipsoid:i,stRotation:o,bottom:!1,top:!0,wall:!1};if(l)for(O.top=d,O.bottom=f,O.shadowVolume=e._shadowVolume,P=0;P<E.length;P++){T=D(i,E[P],n,S[P],c,d,f,r);var R;d&&f?(R=T.topAndBottom,O.geometry=b.scaleToGeodeticHeightExtruded(R.geometry,a,s,i,c)):d?(R=T.topAndBottom,R.geometry.attributes.position.values=C.scaleToGeodeticHeight(R.geometry.attributes.position.values,a,i,!c),O.geometry=R.geometry):f&&(R=T.topAndBottom,R.geometry.attributes.position.values=C.scaleToGeodeticHeight(R.geometry.attributes.position.values,s,i,!0),O.geometry=R.geometry),(d||f)&&(O.wall=!1,R.geometry=A(O),M.push(R));var N=T.walls;O.wall=!0;for(var k=0;k<N.length;k++){var L=N[k];O.geometry=b.scaleToGeodeticHeightExtruded(L.geometry,a,s,i,c),L.geometry=A(O),M.push(L)}}else for(P=0;P<E.length;P++)T=new m({geometry:b.createGeometryFromPositions(i,E[P],n,c,r)}),T.geometry.attributes.position.values=C.scaleToGeodeticHeight(T.geometry.attributes.position.values,a,i,!c),O.geometry=T.geometry,T.geometry=A(O),M.push(T);T=g.combineInstances(M)[0],T.attributes.position.values=new Float64Array(T.attributes.position.values),T.indices=v.createTypedArray(T.attributes.position.values.length/3,T.indices);var B=T.attributes,U=t.fromVertices(B.position.values);return r.position||delete B.position,new p({attributes:B,indices:T.indices,primitiveType:T.primitiveType,boundingSphere:U})}}},I.createShadowVolume=function(e,t,r){var i=e._granularity,n=e._ellipsoid,o=t(i,n),a=r(i,n);return new I({polygonHierarchy:e._polygonHierarchy,ellipsoid:n,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:a,vertexFormat:E.POSITION_ONLY,shadowVolume:!0})},u(I.prototype,{rectangle:{get:function(){return this._rectangle}}}),I}),define("Core/PolygonHierarchy",["./defined"],function(e){"use strict";function t(t,r){this.positions=e(t)?t:[],this.holes=e(r)?r:[]}return t}),define("Core/PolygonOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C){"use strict";function w(e,t,r,i){var o=u.fromPoints(t,e),a=o.projectPointsOntoPlane(t,T),s=_.computeWindingOrder2D(a);s===C.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l,f,g=t.length,b=0;if(i)for(l=new Float64Array(2*g*3),f=0;f<g;f++){var w=t[f],S=t[(f+1)%g];l[b++]=w.x,l[b++]=w.y,l[b++]=w.z,l[b++]=S.x,l[b++]=S.y,l[b++]=S.z}else{var E=0;for(f=0;f<g;f++)E+=v.subdivideLineCount(t[f],t[(f+1)%g],r);for(l=new Float64Array(3*E),f=0;f<g;f++)for(var P=v.subdivideLine(t[f],t[(f+1)%g],r,x),A=P.length,D=0;D<A;++D)l[b++]=P[D]}g=l.length/3;var I=2*g,M=m.createTypedArray(g,I);for(b=0,f=0;f<g-1;f++)M[b++]=f,M[b++]=f+1;return M[b++]=g-1,M[b++]=0,new p({geometry:new c({attributes:new h({position:new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l})}),indices:M,primitiveType:y.LINES})})}function S(e,t,r,i){var o=u.fromPoints(t,e),a=o.projectPointsOntoPlane(t,T),s=_.computeWindingOrder2D(a);s===C.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());var l,f,g=t.length,b=new Array(g),w=0;if(i)for(l=new Float64Array(2*g*3*2),f=0;f<g;++f){b[f]=w/3;var S=t[f],E=t[(f+1)%g];l[w++]=S.x,l[w++]=S.y,l[w++]=S.z,l[w++]=E.x,l[w++]=E.y,l[w++]=E.z}else{var P=0;for(f=0;f<g;f++)P+=v.subdivideLineCount(t[f],t[(f+1)%g],r);for(l=new Float64Array(3*P*2),f=0;f<g;++f){b[f]=w/3;for(var A=v.subdivideLine(t[f],t[(f+1)%g],r,x),D=A.length,I=0;I<D;++I)l[w++]=A[I]}}g=l.length/6;var M=b.length,O=2*(2*g+M),R=m.createTypedArray(g,O);for(w=0,f=0;f<g;++f)R[w++]=f,R[w++]=(f+1)%g,R[w++]=f+g,R[w++]=(f+1)%g+g;for(f=0;f<M;f++){var N=b[f];R[w++]=N,R[w++]=N+g}return new p({geometry:new c({attributes:new h({position:new d({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:l})}),indices:R,primitiveType:y.LINES})})}function E(e){var t=e.polygonHierarchy,r=o(e.ellipsoid,l.WGS84),i=o(e.granularity,g.RADIANS_PER_DEGREE),n=o(e.height,0),s=o(e.perPositionHeight,!1),u=e.extrudedHeight,c=a(u);if(c&&!s){var d=u;u=Math.min(d,n),n=Math.max(d,n)}this._ellipsoid=l.clone(r),this._granularity=i,this._height=n,this._extrudedHeight=o(u,0),this._extrude=c,this._polygonHierarchy=t,this._perPositionHeight=s,this._workerName="createPolygonOutlineGeometry",this.packedLength=v.computeHierarchyPackedLength(t)+l.packedLength+6}var T=[],x=[];E.pack=function(e,t,r){return r=o(r,0),r=v.packPolygonHierarchy(e._polygonHierarchy,t,r),l.pack(e._ellipsoid,t,r),r+=l.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e.packedLength,t};var P=l.clone(l.UNIT_SPHERE),A={polygonHierarchy:{}};return E.unpack=function(e,t,r){t=o(t,0);var i=v.unpackPolygonHierarchy(e,t);t=i.startingIndex,delete i.startingIndex;var n=l.unpack(e,t,P);t+=l.packedLength;var s=e[t++],u=e[t++],c=e[t++],d=1===e[t++],h=1===e[t++],p=e[t++];return a(r)||(r=new E(A)),r._polygonHierarchy=i,r._ellipsoid=l.clone(n,r._ellipsoid),r._height=s,r._extrudedHeight=u,r._granularity=c,r._extrude=d,r._perPositionHeight=h,r.packedLength=p,r},E.fromPositions=function(e){e=o(e,o.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight};return new E(t)},E.createGeometry=function(i){var n=i._ellipsoid,o=i._granularity,s=i._height,l=i._extrudedHeight,u=i._extrude,d=i._polygonHierarchy,h=i._perPositionHeight,p=[],m=new b;m.enqueue(d);for(var y;0!==m.length;){var C=m.dequeue(),E=C.positions;if(E=e(E,r.equalsEpsilon,!0),!(E.length<3)){var T=C.holes?C.holes.length:0;for(y=0;y<T;y++){var x=C.holes[y];if(x.positions=e(x.positions,r.equalsEpsilon,!0),!(x.positions.length<3)){p.push(x.positions);var P=0;a(x.holes)&&(P=x.holes.length);for(var A=0;A<P;A++)m.enqueue(x.holes[A])}}p.push(E)}}if(0!==p.length){var D,I=[],M=g.chordLength(o,n.maximumRadius);if(u)for(y=0;y<p.length;y++)D=S(n,p[y],M,h),D.geometry=v.scaleToGeodeticHeightExtruded(D.geometry,s,l,n,h),I.push(D);else for(y=0;y<p.length;y++)D=w(n,p[y],M,h),D.geometry.attributes.position.values=_.scaleToGeodeticHeight(D.geometry.attributes.position.values,s,n,!h),I.push(D);D=f.combineInstances(I)[0];var O=t.fromVertices(D.attributes.position.values);return new c({attributes:D.attributes,indices:D.indices,primitiveType:D.primitiveType,boundingSphere:O})}},E}),define("Core/PolylineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(e,t,r,n,o){var a=b;a.length=o;var s,l=r.red,u=r.green,c=r.blue,d=r.alpha,h=n.red,p=n.green,f=n.blue,m=n.alpha;if(i.equals(r,n)){for(s=0;s<o;s++)a[s]=i.clone(r);return a}var g=(h-l)/o,v=(p-u)/o,_=(f-c)/o,y=(m-d)/o;for(s=0;s<o;s++)a[s]=new i(l+s*g,u+s*v,c+s*_,d+s*y);return a}function y(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,n=e.colors,s=o(e.width,1),u=o(e.colorsPerVertex,!1);this._positions=t,this._colors=n,this._width=s,this._colorsPerVertex=u,this._vertexFormat=v.clone(o(e.vertexFormat,v.DEFAULT)),this._followSurface=o(e.followSurface,!0),this._granularity=o(e.granularity,f.RADIANS_PER_DEGREE),this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._workerName="createPolylineGeometry";var c=1+t.length*r.packedLength;c+=a(n)?1+n.length*i.packedLength:1,this.packedLength=c+l.packedLength+v.packedLength+4}var b=[];y.pack=function(e,t,n){n=o(n,0);var s,u=e._positions,c=u.length;for(t[n++]=c,s=0;s<c;++s,n+=r.packedLength)r.pack(u[s],t,n);var d=e._colors;for(c=a(d)?d.length:0,t[n++]=c,s=0;s<c;++s,n+=i.packedLength)i.pack(d[s],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,v.pack(e._vertexFormat,t,n),n+=v.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._followSurface?1:0,t[n]=e._granularity,t};var C=l.clone(l.UNIT_SPHERE),w=new v,S={positions:void 0,colors:void 0,ellipsoid:C,vertexFormat:w,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};y.unpack=function(e,t,n){t=o(t,0);var s,u=e[t++],c=new Array(u);for(s=0;s<u;++s,t+=r.packedLength)c[s]=r.unpack(e,t);u=e[t++];var d=u>0?new Array(u):void 0;for(s=0;s<u;++s,t+=i.packedLength)d[s]=i.unpack(e,t);var h=l.unpack(e,t,C);t+=l.packedLength;var p=v.unpack(e,t,w);t+=v.packedLength;var f=e[t++],m=1===e[t++],g=1===e[t++],_=e[t];return a(n)?(n._positions=c,n._colors=d,n._ellipsoid=l.clone(h,n._ellipsoid),n._vertexFormat=v.clone(p,n._vertexFormat),n._width=f,n._colorsPerVertex=m,n._followSurface=g,n._granularity=_,n):(S.positions=c,S.colors=d,S.width=f,S.colorsPerVertex=m,S.followSurface=g,S.granularity=_,new y(S))};var E=new r,T=new r,x=new r,P=new r;return y.createGeometry=function(o){var s,l,v,y=o._width,C=o._vertexFormat,w=o._colors,S=o._colorsPerVertex,A=o._followSurface,D=o._granularity,I=o._ellipsoid,M=e(o._positions,r.equalsEpsilon),O=M.length;if(!(O<2||y<=0)){if(A){var R=m.extractHeights(M,I),N=f.chordLength(D,I.maximumRadius);if(a(w)){var k=1;for(s=0;s<O-1;++s)k+=m.numberOfPoints(M[s],M[s+1],N);var L=new Array(k),F=0;for(s=0;s<O-1;++s){var B=M[s],U=M[s+1],V=w[s],z=m.numberOfPoints(B,U,N);if(S&&s<k){var G=w[s+1],H=_(B,U,V,G,z),W=H.length;for(l=0;l<W;++l)L[F++]=H[l]}else for(l=0;l<z;++l)L[F++]=i.clone(V)}L[F]=i.clone(w[w.length-1]),w=L,b.length=0}M=m.generateCartesianArc({positions:M,minDistance:N,ellipsoid:I,height:R})}O=M.length;var j,q=4*O-4,Y=new Float64Array(3*q),X=new Float64Array(3*q),Q=new Float64Array(3*q),Z=new Float32Array(2*q),K=C.st?new Float32Array(2*q):void 0,J=a(w)?new Uint8Array(4*q):void 0,$=0,ee=0,te=0,re=0;for(l=0;l<O;++l){0===l?(j=E,r.subtract(M[0],M[1],j),r.add(M[0],j,j)):j=M[l-1],r.clone(j,x),r.clone(M[l],T),l===O-1?(j=E,r.subtract(M[O-1],M[O-2],j),r.add(M[O-1],j,j)):j=M[l+1],r.clone(j,P);var ie,ne;a(J)&&(ie=0===l||S?w[l]:w[l-1],l!==O-1&&(ne=w[l]));var oe=0===l?2:0,ae=l===O-1?2:4;for(v=oe;v<ae;++v){r.pack(T,Y,$),r.pack(x,X,$),r.pack(P,Q,$),$+=3;var se=v-2<0?-1:1;if(Z[ee++]=2*(v%2)-1,Z[ee++]=se*y,C.st&&(K[te++]=l/(O-1),K[te++]=Math.max(Z[ee-2],0)),a(J)){var le=v<2?ie:ne;J[re++]=i.floatToByte(le.red),J[re++]=i.floatToByte(le.green),J[re++]=i.floatToByte(le.blue),J[re++]=i.floatToByte(le.alpha)}}}var ue=new d;ue.position=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:Y}),ue.prevPosition=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:X}),ue.nextPosition=new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:Q}),ue.expandAndWidth=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:Z}),C.st&&(ue.st=new c({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:K})),a(J)&&(ue.color=new c({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:J,normalize:!0}));var ce=p.createTypedArray(q,6*O-6),de=0,he=0,pe=O-1;for(l=0;l<pe;++l)ce[he++]=de,ce[he++]=de+2,ce[he++]=de+1,ce[he++]=de+1,ce[he++]=de+2,ce[he++]=de+3,de+=4;return new u({attributes:ue,indices:ce,primitiveType:g.TRIANGLES,boundingSphere:t.fromPoints(M),geometryType:h.POLYLINES})}},y}),define("Core/PolylineVolumeGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./oneTimeWarning","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w){"use strict";function S(e,t,i,n){var a=new p;n.position&&(a.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:e}));var s,l,u,c,g,y,C=t.length,w=e.length/3,S=(w-2*C)/(2*C),E=_.triangulate(t),T=(S-1)*C*6+2*E.length,x=m.createTypedArray(w,T),P=2*C,A=0;for(s=0;s<S-1;s++){for(l=0;l<C-1;l++)u=2*l+s*C*2,y=u+P,c=u+1,g=c+P,x[A++]=c,x[A++]=u,x[A++]=g,x[A++]=g,x[A++]=u,x[A++]=y;u=2*C-2+s*C*2,c=u+1,g=c+P,y=u+P,x[A++]=c,x[A++]=u,x[A++]=g,x[A++]=g,x[A++]=u,x[A++]=y}if(n.st||n.tangent||n.bitangent){var D,I,M=new Float32Array(2*w),O=1/(S-1),R=1/i.height,N=i.height/2,k=0;for(s=0;s<S;s++){for(D=s*O,I=R*(t[0].y+N),M[k++]=D,M[k++]=I,l=1;l<C;l++)I=R*(t[l].y+N),M[k++]=D,M[k++]=I,M[k++]=D,M[k++]=I;I=R*(t[0].y+N),M[k++]=D,M[k++]=I}for(l=0;l<C;l++)D=0,I=R*(t[l].y+N),M[k++]=D,M[k++]=I;for(l=0;l<C;l++)D=(S-1)*O,I=R*(t[l].y+N),M[k++]=D,M[k++]=I;a.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:new Float32Array(M)})}var L=w-2*C;for(s=0;s<E.length;s+=3){var F=E[s]+L,B=E[s+1]+L,U=E[s+2]+L;x[A++]=F,x[A++]=B,x[A++]=U,x[A++]=U+C,x[A++]=B+C,x[A++]=F+C}var V=new d({attributes:a,indices:x,boundingSphere:r.fromVertices(e),primitiveType:b.TRIANGLES});if(n.normal&&(V=f.computeNormal(V)),n.tangent||n.bitangent){try{V=f.computeTangentAndBitangent(V)}catch(e){v("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}n.tangent||(V.attributes.tangent=void 0),n.bitangent||(V.attributes.bitangent=void 0),n.st||(V.attributes.st=void 0)}return V}function E(e){e=s(e,s.EMPTY_OBJECT);var t=e.polylinePositions,r=e.shapePositions;this._positions=t,this._shape=r,this._ellipsoid=c.clone(s(e.ellipsoid,c.WGS84)),this._cornerType=s(e.cornerType,a.ROUNDED),this._vertexFormat=C.clone(s(e.vertexFormat,C.DEFAULT)),this._granularity=s(e.granularity,g.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var o=1+t.length*n.packedLength;o+=1+r.length*i.packedLength,this.packedLength=o+c.packedLength+C.packedLength+2}E.pack=function(e,t,r){r=s(r,0);var o,a=e._positions,l=a.length;for(t[r++]=l,o=0;o<l;++o,r+=n.packedLength)n.pack(a[o],t,r);var u=e._shape;for(l=u.length,t[r++]=l,o=0;o<l;++o,r+=i.packedLength)i.pack(u[o],t,r);return c.pack(e._ellipsoid,t,r),r+=c.packedLength,C.pack(e._vertexFormat,t,r),r+=C.packedLength,t[r++]=e._cornerType,t[r]=e._granularity,t};var T=c.clone(c.UNIT_SPHERE),x=new C,P={polylinePositions:void 0,shapePositions:void 0,ellipsoid:T,vertexFormat:x,cornerType:void 0,granularity:void 0};E.unpack=function(e,t,r){t=s(t,0);var o,a=e[t++],u=new Array(a);for(o=0;o<a;++o,t+=n.packedLength)u[o]=n.unpack(e,t);a=e[t++];var d=new Array(a);for(o=0;o<a;++o,t+=i.packedLength)d[o]=i.unpack(e,t);var h=c.unpack(e,t,T);t+=c.packedLength;var p=C.unpack(e,t,x);t+=C.packedLength;var f=e[t++],m=e[t];return l(r)?(r._positions=u,r._shape=d,r._ellipsoid=c.clone(h,r._ellipsoid),r._vertexFormat=C.clone(p,r._vertexFormat),r._cornerType=f,r._granularity=m,r):(P.polylinePositions=u,P.shapePositions=d,P.cornerType=f,P.granularity=m,new E(P))};var A=new t;return E.createGeometry=function(r){var i=r._positions,o=e(i,n.equalsEpsilon),a=r._shape;if(a=y.removeDuplicatesFromShape(a),!(o.length<2||a.length<3)){_.computeWindingOrder2D(a)===w.CLOCKWISE&&a.reverse();var s=t.fromPoints(a,A),l=y.computePositions(o,a,s,r,!0);return S(l,a,s,r._vertexFormat)}},E}),define("Core/PolylineVolumeOutlineGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y){"use strict";function b(e,t){var i=new p;i.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:e});var n,a,s=t.length,l=i.position.values.length/3,u=e.length/3,c=u/s,m=f.createTypedArray(l,2*s*(c+1)),g=0;n=0;var v=n*s;for(a=0;a<s-1;a++)m[g++]=a+v,m[g++]=a+v+1;for(m[g++]=s-1+v,m[g++]=v,n=c-1,v=n*s,a=0;a<s-1;a++)m[g++]=a+v,m[g++]=a+v+1;for(m[g++]=s-1+v,m[g++]=v,n=0;n<c-1;n++){var y=s*n,b=y+s;for(a=0;a<s;a++)m[g++]=a+y,m[g++]=a+b}var C=new d({attributes:i,indices:f.createTypedArray(l,m),boundingSphere:r.fromVertices(e),primitiveType:_.LINES});return C}function C(e){e=s(e,s.EMPTY_OBJECT);var t=e.polylinePositions,r=e.shapePositions;this._positions=t,this._shape=r,this._ellipsoid=c.clone(s(e.ellipsoid,c.WGS84)),this._cornerType=s(e.cornerType,a.ROUNDED),this._granularity=s(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var o=1+t.length*n.packedLength;o+=1+r.length*i.packedLength,this.packedLength=o+c.packedLength+2}C.pack=function(e,t,r){r=s(r,0);var o,a=e._positions,l=a.length;for(t[r++]=l,o=0;o<l;++o,r+=n.packedLength)n.pack(a[o],t,r);var u=e._shape;for(l=u.length,t[r++]=l,o=0;o<l;++o,r+=i.packedLength)i.pack(u[o],t,r);return c.pack(e._ellipsoid,t,r),r+=c.packedLength,t[r++]=e._cornerType,t[r]=e._granularity,t};var w=c.clone(c.UNIT_SPHERE),S={polylinePositions:void 0,shapePositions:void 0,ellipsoid:w,height:void 0,cornerType:void 0,granularity:void 0};C.unpack=function(e,t,r){t=s(t,0);var o,a=e[t++],u=new Array(a);for(o=0;o<a;++o,t+=n.packedLength)u[o]=n.unpack(e,t);a=e[t++];var d=new Array(a);for(o=0;o<a;++o,t+=i.packedLength)d[o]=i.unpack(e,t);var h=c.unpack(e,t,w);t+=c.packedLength;var p=e[t++],f=e[t];return l(r)?(r._positions=u,r._shape=d,r._ellipsoid=c.clone(h,r._ellipsoid),r._cornerType=p,r._granularity=f,r):(S.polylinePositions=u,S.shapePositions=d,S.cornerType=p,S.granularity=f,new C(S))};var E=new t;return C.createGeometry=function(r){var i=r._positions,o=e(i,n.equalsEpsilon),a=r._shape;if(a=v.removeDuplicatesFromShape(a),!(o.length<2||a.length<3)){g.computeWindingOrder2D(a)===y.CLOCKWISE&&a.reverse();var s=t.fromPoints(a,E),l=v.computePositions(o,a,s,r,!1);return b(l,a)}},C}),define("Core/QuaternionSpline",["./defaultValue","./defined","./defineProperties","./DeveloperError","./Quaternion","./Spline"],function(e,t,r,i,n,o){"use strict";function a(e,r,i){var o=e.length,a=new Array(o);a[0]=t(r)?r:e[0],a[o-1]=t(i)?i:e[o-1];for(var s=1;s<o-1;++s)a[s]=n.computeInnerQuadrangle(e[s-1],e[s],e[s+1],new n);return a}function s(e){var r=e.points,i=e.innerQuadrangles,o=e.times;if(r.length<3){var a=o[0],s=1/(o[1]-a),l=r[0],u=r[1];return function(e,r){t(r)||(r=new n);var i=(e-a)*s;return n.fastSlerp(l,u,i,r)}}return function(a,s){t(s)||(s=new n);var l=e._lastTimeIndex=e.findTimeInterval(a,e._lastTimeIndex),u=(a-o[l])/(o[l+1]-o[l]),c=r[l],d=r[l+1],h=i[l],p=i[l+1];return n.fastSquad(c,d,h,p,u,s)}}function l(t){t=e(t,e.EMPTY_OBJECT);var r=t.points,i=t.times,n=t.firstInnerQuadrangle,o=t.lastInnerQuadrangle,l=a(r,n,o);this._times=i,this._points=r, +this._innerQuadrangles=l,this._evaluateFunction=s(this),this._lastTimeIndex=0}return r(l.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},innerQuadrangles:{get:function(){return this._innerQuadrangles}}}),l.prototype.findTimeInterval=o.prototype.findTimeInterval,l.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)},l}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,r,i,n,o,s,l){var u=Math.cos(r),c=n*u,d=i*u,h=Math.sin(r),m=n*h,_=i*h;f=v.project(t,f),f=e.subtract(f,g,f);var y=a.fromRotation(r,p);f=a.multiplyByVector(y,f,f),f=e.add(f,g,f),t=v.unproject(f,t),s-=1,l-=1;var b=t.latitude,C=b+s*_,w=b-c*l,S=b-c*l+s*_,E=Math.max(b,C,w,S),T=Math.min(b,C,w,S),x=t.longitude,P=x+s*d,A=x+l*m,D=x+l*m+s*d,I=Math.max(x,P,A,D),M=Math.min(x,P,A,D);return{north:E,south:T,east:I,west:M,granYCos:c,granYSin:m,granXCos:d,granXSin:_,nwCorner:t}}var u=Math.cos,c=Math.sin,d=Math.sqrt,h={};h.computePosition=function(e,t,i,n,o){var a=e.ellipsoid.radiiSquared,s=e.nwCorner,l=e.rectangle,h=s.latitude-e.granYCos*t+i*e.granXSin,p=u(h),f=c(h),m=a.z*f,g=s.longitude+t*e.granYSin+i*e.granXCos,v=p*u(g),_=p*c(g),y=a.x*v,b=a.y*_,C=d(y*v+b*_+m*f);if(n.x=y/C,n.y=b/C,n.z=m/C,r(e.vertexFormat)&&e.vertexFormat.st){var w=e.stNwCorner;r(w)?(h=w.latitude-e.stGranYCos*t+i*e.stGranXSin,g=w.longitude+t*e.stGranYSin+i*e.stGranXCos,o.x=(g-e.stWest)*e.lonScalar,o.y=(h-e.stSouth)*e.latScalar):(o.x=(g-l.west)*e.lonScalar,o.y=(h-l.south)*e.latScalar)}};var p=new a,f=new e,m=new t,g=new e,v=new n;return h.computeOptions=function(e,t,r,i){var n,a,u,c,d,h=e._granularity,p=e._ellipsoid,f=e._surfaceHeight,_=e._rotation,y=e._stRotation,b=e._extrudedHeight,C=t.east,w=t.west,S=t.north,E=t.south,T=S-E;w>C?(d=o.TWO_PI-w+C,n=Math.ceil(d/h)+1,a=Math.ceil(T/h)+1,u=d/(n-1),c=T/(a-1)):(d=C-w,n=Math.ceil(d/h)+1,a=Math.ceil(T/h)+1,u=d/(n-1),c=T/(a-1)),r=s.northwest(t,r);var x=s.center(t,m);0===_&&0===y||(x.longitude<r.longitude&&(x.longitude+=o.TWO_PI),g=v.project(x,g));var P=c,A=u,D=0,I=0,M={granYCos:P,granYSin:D,granXCos:A,granXSin:I,ellipsoid:p,surfaceHeight:f,extrudedHeight:b,nwCorner:r,rectangle:t,width:n,height:a};if(0!==_){var O=l(r,_,u,c,x,n,a);S=O.north,E=O.south,C=O.east,w=O.west,M.granYCos=O.granYCos,M.granYSin=O.granYSin,M.granXCos=O.granXCos,M.granXSin=O.granXSin,t.north=S,t.south=E,t.east=C,t.west=w}if(0!==y){_-=y,i=s.northwest(t,i);var R=l(i,_,u,c,x,n,a);M.stGranYCos=R.granYCos,M.stGranXCos=R.granXCos,M.stGranYSin=R.granYSin,M.stGranXSin=R.granXSin,M.stNwCorner=i,M.stWest=R.west,M.stSouth=R.south}return M},h}),define("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E){"use strict";function T(e,t){var r=new d({attributes:new p,primitiveType:b.TRIANGLES});return r.attributes.position=new h({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(r.attributes.normal=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(r.attributes.tangent=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(r.attributes.bitangent=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:t.bitangents})),r}function x(e,t,i,n){var o=e.length,a=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,l=t.bitangent?new Float32Array(o):void 0,u=0,c=F,d=L,h=k;if(t.normal||t.tangent||t.bitangent)for(var p=0;p<o;p+=3){var f=r.fromArray(e,p,N),m=u+1,g=u+2;h=i.geodeticSurfaceNormal(f,h),(t.tangent||t.bitangent)&&(r.cross(r.UNIT_Z,h,d),_.multiplyByVector(n,d,d),r.normalize(d,d),t.bitangent&&r.normalize(r.cross(h,d,c),c)),t.normal&&(a[u]=h.x,a[m]=h.y,a[g]=h.z),t.tangent&&(s[u]=d.x,s[m]=d.y,s[g]=d.z),t.bitangent&&(l[u]=c.x,l[m]=c.y,l[g]=c.z),u+=3}return T(t,{positions:e,normals:a,tangents:s,bitangents:l})}function P(e,t,i){var n=e.length,o=t.normal?new Float32Array(n):void 0,a=t.tangent?new Float32Array(n):void 0,s=t.bitangent?new Float32Array(n):void 0,l=0,u=0,c=0,d=!0,h=F,p=L,f=k;if(t.normal||t.tangent||t.bitangent)for(var m=0;m<n;m+=6){var g=r.fromArray(e,m,N),_=r.fromArray(e,(m+6)%n,G);if(d){var y=r.fromArray(e,(m+3)%n,H);r.subtract(_,g,_),r.subtract(y,g,y),f=r.normalize(r.cross(y,_,f),f),d=!1}r.equalsEpsilon(_,g,v.EPSILON10)&&(d=!0),(t.tangent||t.bitangent)&&(h=i.geodeticSurfaceNormal(g,h),t.tangent&&(p=r.normalize(r.cross(h,f,p),p))),t.normal&&(o[l++]=f.x,o[l++]=f.y,o[l++]=f.z,o[l++]=f.x,o[l++]=f.y,o[l++]=f.z),t.tangent&&(a[u++]=p.x,a[u++]=p.y,a[u++]=p.z,a[u++]=p.x,a[u++]=p.y,a[u++]=p.z),t.bitangent&&(s[c++]=h.x,s[c++]=h.y,s[c++]=h.z,s[c++]=h.x,s[c++]=h.y,s[c++]=h.z)}return T(t,{positions:e,normals:o,tangents:a,bitangents:s})}function A(e){for(var t=e.vertexFormat,r=e.ellipsoid,i=e.size,n=e.height,a=e.width,s=t.position?new Float64Array(3*i):void 0,l=t.st?new Float32Array(2*i):void 0,u=0,c=0,d=N,p=U,f=Number.MAX_VALUE,m=Number.MAX_VALUE,v=-Number.MAX_VALUE,_=-Number.MAX_VALUE,y=0;y<n;++y)for(var b=0;b<a;++b)S.computePosition(e,y,b,d,p),s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,t.st&&(l[c++]=p.x,l[c++]=p.y,f=Math.min(f,p.x),m=Math.min(m,p.y),v=Math.max(v,p.x),_=Math.max(_,p.y));if(t.st&&(f<0||m<0||v>1||_>1))for(var C=0;C<l.length;C+=2)l[C]=(l[C]-f)/(v-f),l[C+1]=(l[C+1]-m)/(_-m);for(var w=x(s,t,r,e.tangentRotationMatrix),E=6*(a-1)*(n-1),T=g.createTypedArray(i,E),P=0,A=0,D=0;D<n-1;++D){for(var I=0;I<a-1;++I){var M=P,O=M+a,R=O+1,k=M+1;T[A++]=M,T[A++]=O,T[A++]=k,T[A++]=k,T[A++]=O,T[A++]=R,++P}++P}return w.indices=T,t.st&&(w.attributes.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:l})),w}function D(e,t,r,i,n){return e[t++]=i[r],e[t++]=i[r+1],e[t++]=i[r+2],e[t++]=n[r],e[t++]=n[r+1],e[t++]=n[r+2],e}function I(e,t,r,i){return e[t++]=i[r],e[t++]=i[r+1],e[t++]=i[r],e[t++]=i[r+1],e}function M(e){var t,i=e.shadowVolume,n=e.vertexFormat,a=e.surfaceHeight,s=e.extrudedHeight,l=Math.min(s,a),u=Math.max(s,a),c=e.height,d=e.width,p=e.ellipsoid;i&&(e.vertexFormat=E.clone(n,W),e.vertexFormat.normal=!0);var _=A(e);if(v.equalsEpsilon(l,u,v.EPSILON10))return _;var b=y.scaleToGeodeticHeight(_.attributes.position.values,u,p,!1);b=new Float64Array(b);var C=b.length,w=2*C,S=new Float64Array(w);S.set(b);var T=y.scaleToGeodeticHeight(_.attributes.position.values,l,p);S.set(T,C),_.attributes.position.values=S;var x,M,O=n.normal?new Float32Array(w):void 0,R=n.tangent?new Float32Array(w):void 0,N=n.bitangent?new Float32Array(w):void 0,k=n.st?new Float32Array(w/3*2):void 0;if(n.normal){for(M=_.attributes.normal.values,O.set(M),t=0;t<C;t++)M[t]=-M[t];O.set(M,C),_.attributes.normal.values=O}if(i){M=_.attributes.normal.values,n.normal||(_.attributes.normal=void 0);var L=new Float32Array(w);for(t=0;t<C;t++)M[t]=-M[t];L.set(M,C),_.attributes.extrudeDirection=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:L})}if(n.tangent){var F=_.attributes.tangent.values;for(R.set(F),t=0;t<C;t++)F[t]=-F[t];R.set(F,C),_.attributes.tangent.values=R}if(n.bitangent){var B=_.attributes.bitangent.values;N.set(B),N.set(B,C),_.attributes.bitangent.values=N}n.st&&(x=_.attributes.st.values,k.set(x),k.set(x,C/3*2),_.attributes.st.values=k);var U=_.indices,V=U.length,z=C/3,j=g.createTypedArray(w/3,2*V);for(j.set(U),t=0;t<V;t+=3)j[t+V]=U[t+2]+z,j[t+1+V]=U[t+1]+z,j[t+2+V]=U[t]+z;_.indices=j;var q,Y=2*d+2*c-4,X=2*(Y+4),Q=new Float64Array(3*X),Z=i?new Float32Array(3*X):void 0,K=n.st?new Float32Array(2*X):void 0,J=0,$=0,ee=0,te=d*c;for(t=0;t<te;t+=d)q=3*t,Q=D(Q,J,q,b,T),J+=6,n.st&&(K=I(K,$,2*t,x),$+=4),i&&(ee+=3,Z[ee++]=M[q],Z[ee++]=M[q+1],Z[ee++]=M[q+2]);for(t=te-d;t<te;t++)q=3*t,Q=D(Q,J,q,b,T),J+=6,n.st&&(K=I(K,$,2*t,x),$+=4),i&&(ee+=3,Z[ee++]=M[q],Z[ee++]=M[q+1],Z[ee++]=M[q+2]);for(t=te-1;t>0;t-=d)q=3*t,Q=D(Q,J,q,b,T),J+=6,n.st&&(K=I(K,$,2*t,x),$+=4),i&&(ee+=3,Z[ee++]=M[q],Z[ee++]=M[q+1],Z[ee++]=M[q+2]);for(t=d-1;t>=0;t--)q=3*t,Q=D(Q,J,q,b,T),J+=6,n.st&&(K=I(K,$,2*t,x),$+=4),i&&(ee+=3,Z[ee++]=M[q],Z[ee++]=M[q+1],Z[ee++]=M[q+2]);var re=P(Q,n,p);n.st&&(re.attributes.st=new h({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:K})),i&&(re.attributes.extrudeDirection=new h({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:Z}));var ie,ne,oe,ae,se=g.createTypedArray(X,6*Y);C=Q.length/3;var le=0;for(t=0;t<C-1;t+=2){ie=t,ae=(ie+2)%C;var ue=r.fromArray(Q,3*ie,G),ce=r.fromArray(Q,3*ae,H);r.equalsEpsilon(ue,ce,v.EPSILON10)||(ne=(ie+1)%C,oe=(ne+2)%C,se[le++]=ie,se[le++]=ne,se[le++]=ae,se[le++]=ae,se[le++]=ne,se[le++]=oe)}return re.indices=se,re=m.combineInstances([new f({geometry:_}),new f({geometry:re})]),re[0]}function O(e,t,r){if(0===r)return w.clone(e);w.northeast(e,Q[0]),w.northwest(e,Q[1]),w.southeast(e,Q[2]),w.southwest(e,Q[3]),t.cartographicArrayToCartesianArray(Q,X);var i=t.geodeticSurfaceNormalCartographic(w.center(e,q));C.fromAxisAngle(i,r,Y),_.fromQuaternion(Y,j);for(var n=0;n<4;++n)_.multiplyByVector(j,X[n],X[n]);return t.cartesianArrayToCartographicArray(X,Q),w.fromCartographicArray(Q)}function R(e){e=a(e,a.EMPTY_OBJECT);var t=e.rectangle,r=a(e.rotation,0);this._rectangle=t,this._granularity=a(e.granularity,v.RADIANS_PER_DEGREE),this._ellipsoid=c.clone(a(e.ellipsoid,c.WGS84)),this._surfaceHeight=a(e.height,0),this._rotation=r,this._stRotation=a(e.stRotation,0),this._vertexFormat=E.clone(a(e.vertexFormat,E.DEFAULT)),this._extrudedHeight=a(e.extrudedHeight,0),this._extrude=s(e.extrudedHeight),this._closeTop=a(e.closeTop,!0),this._closeBottom=a(e.closeBottom,!0),this._shadowVolume=a(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._rotatedRectangle=O(this._rectangle,this._ellipsoid,r)}var N=new r,k=new r,L=new r,F=new r,B=new w,U=new t,V=new e,z=new e,G=new r,H=new r,W=new E,j=new _,q=new r,Y=new C,X=[new r,new r,new r,new r],Q=[new i,new i,new i,new i];R.packedLength=w.packedLength+c.packedLength+E.packedLength+w.packedLength+9,R.pack=function(e,t,r){return r=a(r,0),w.pack(e._rectangle,t,r),r+=w.packedLength,c.pack(e._ellipsoid,t,r),r+=c.packedLength,E.pack(e._vertexFormat,t,r),r+=E.packedLength,w.pack(e._rotatedRectangle,t,r),r+=w.packedLength,t[r++]=e._granularity,t[r++]=e._surfaceHeight,t[r++]=e._rotation,t[r++]=e._stRotation,t[r++]=e._extrudedHeight,t[r++]=e._extrude?1:0,t[r++]=e._closeTop?1:0,t[r++]=e._closeBottom?1:0,t[r]=e._shadowVolume?1:0,t};var Z=new w,K=new w,J=c.clone(c.UNIT_SPHERE),$={rectangle:Z,ellipsoid:J,vertexFormat:W,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0,shadowVolume:void 0};R.unpack=function(e,t,r){t=a(t,0);var i=w.unpack(e,t,Z);t+=w.packedLength;var n=c.unpack(e,t,J);t+=c.packedLength;var o=E.unpack(e,t,W);t+=E.packedLength;var l=w.unpack(e,t,K);t+=w.packedLength;var u=e[t++],d=e[t++],h=e[t++],p=e[t++],f=e[t++],m=1===e[t++],g=1===e[t++],v=1===e[t++],_=1===e[t];return s(r)?(r._rectangle=w.clone(i,r._rectangle),r._ellipsoid=c.clone(n,r._ellipsoid),r._vertexFormat=E.clone(o,r._vertexFormat),r._granularity=u,r._surfaceHeight=d,r._rotation=h,r._stRotation=p,r._extrudedHeight=m?f:void 0,r._extrude=m,r._closeTop=g,r._closeBottom=v,r._rotatedRectangle=l,r._shadowVolume=_,r):($.granularity=u,$.height=d,$.rotation=h,$.stRotation=p,$.extrudedHeight=m?f:void 0,$.closeTop=g,$.closeBottom=v,$.shadowVolume=_,new R($))};var ee=new _,te=new i,re=new i,ie=new C,ne=new i;return R.createGeometry=function(t){if(!v.equalsEpsilon(t._rectangle.north,t._rectangle.south,v.EPSILON10)&&!v.equalsEpsilon(t._rectangle.east,t._rectangle.west,v.EPSILON10)){var r=w.clone(t._rectangle,B),i=t._ellipsoid,n=t._surfaceHeight,o=t._extrude,a=t._extrudedHeight,s=t._rotation,l=t._stRotation,u=t._vertexFormat,c=S.computeOptions(t,r,te,re),h=ee;if(0!==l||0!==s){var p=w.center(r,ne),f=i.geodeticSurfaceNormalCartographic(p,G);C.fromAxisAngle(f,-l,ie),_.fromQuaternion(ie,h)}else _.clone(_.IDENTITY,h);c.lonScalar=1/t._rectangle.width,c.latScalar=1/t._rectangle.height,c.vertexFormat=u,c.rotation=s,c.stRotation=l,c.tangentRotationMatrix=h,c.size=c.width*c.height;var m,g;if(r=t._rectangle,o){c.shadowVolume=t._shadowVolume,m=M(c);var b=e.fromRectangle3D(r,i,n,z),E=e.fromRectangle3D(r,i,a,V);g=e.union(b,E)}else m=A(c),m.attributes.position.values=y.scaleToGeodeticHeight(m.attributes.position.values,n,i,!1),g=e.fromRectangle3D(r,i,n);return u.position||delete m.attributes.position,new d({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:g})}},R.createShadowVolume=function(e,t,r){var i=e._granularity,n=e._ellipsoid,o=t(i,n),a=r(i,n);return new R({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:n,stRotation:e._stRotation,granularity:i,extrudedHeight:a,height:o,closeTop:!0,closeBottom:!0,vertexFormat:E.POSITION_ONLY,shadowVolume:!0})},l(R.prototype,{rectangle:{get:function(){return this._rotatedRectangle}}}),R}),define("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e){var t,r=e.size,n=e.height,o=e.width,a=new Float64Array(3*r),s=0,h=0,p=w;for(t=0;t<o;t++)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=o-1,h=1;h<n;h++)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(h=n-1,t=o-2;t>=0;t--)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(t=0,h=n-2;h>0;h--)g.computePosition(e,h,t,p),a[s++]=p.x,a[s++]=p.y,a[s++]=p.z;for(var m=a.length/3*2,v=d.createTypedArray(a.length/3,m),_=0,y=0;y<a.length/3-1;y++)v[_++]=y,v[_++]=y+1;v[_++]=a.length/3-1,v[_++]=0;var b=new l({attributes:new c,primitiveType:f.LINES});return b.attributes.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:a}),b.indices=v,b}function _(e){var t=e.surfaceHeight,r=e.extrudedHeight,i=e.ellipsoid,n=Math.min(r,t),o=Math.max(r,t),a=v(e);if(h.equalsEpsilon(n,o,h.EPSILON10))return a;var s=e.height,l=e.width,u=p.scaleToGeodeticHeight(a.attributes.position.values,o,i,!1),c=u.length,f=new Float64Array(2*c);f.set(u);var m=p.scaleToGeodeticHeight(a.attributes.position.values,n,i);f.set(m,c),a.attributes.position.values=f;var g=f.length/3*2+8,_=d.createTypedArray(f.length/3,g);c=f.length/6;for(var y=0,b=0;b<c-1;b++)_[y++]=b,_[y++]=b+1,_[y++]=b+c,_[y++]=b+c+1;return _[y++]=c-1,_[y++]=0,_[y++]=c+c-1,_[y++]=c,_[y++]=0,_[y++]=c,_[y++]=l-1,_[y++]=c+l-1,_[y++]=l+s-2,_[y++]=l+s-2+c,_[y++]=2*l+s-3,_[y++]=2*l+s-3+c,a.indices=_,a}function y(e){e=n(e,n.EMPTY_OBJECT);var t=e.rectangle,r=n(e.granularity,h.RADIANS_PER_DEGREE),i=n(e.ellipsoid,s.WGS84),o=n(e.height,0),a=n(e.rotation,0),l=e.extrudedHeight;this._rectangle=t,this._granularity=r,this._ellipsoid=i,this._surfaceHeight=o,this._rotation=a,this._extrudedHeight=l,this._workerName="createRectangleOutlineGeometry"}var b=new e,C=new e,w=new t,S=new m;y.packedLength=m.packedLength+s.packedLength+5,y.pack=function(e,t,r){return r=n(r,0),m.pack(e._rectangle,t,r),r+=m.packedLength,s.pack(e._ellipsoid,t,r),r+=s.packedLength,t[r++]=e._granularity,t[r++]=e._surfaceHeight,t[r++]=e._rotation,t[r++]=o(e._extrudedHeight)?1:0,t[r]=n(e._extrudedHeight,0),t};var E=new m,T=s.clone(s.UNIT_SPHERE),x={rectangle:E,ellipsoid:T,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};y.unpack=function(e,t,r){t=n(t,0);var i=m.unpack(e,t,E);t+=m.packedLength;var a=s.unpack(e,t,T);t+=s.packedLength;var l=e[t++],u=e[t++],c=e[t++],d=e[t++],h=e[t];return o(r)?(r._rectangle=m.clone(i,r._rectangle),r._ellipsoid=s.clone(a,r._ellipsoid),r._surfaceHeight=u,r._rotation=c,r._extrudedHeight=d?h:void 0,r):(x.granularity=l,x.height=u,x.rotation=c,x.extrudedHeight=d?h:void 0,new y(x))};var P=new r;return y.createGeometry=function(t){var r=m.clone(t._rectangle,S),i=t._ellipsoid,n=t._surfaceHeight,a=t._extrudedHeight,s=g.computeOptions(t,r,P);s.size=2*s.width+2*s.height-4;var u,c;if(r=t._rectangle,!h.equalsEpsilon(r.north,r.south,h.EPSILON10)&&!h.equalsEpsilon(r.east,r.west,h.EPSILON10)){if(o(a)){u=_(s);var d=e.fromRectangle3D(r,i,n,C),y=e.fromRectangle3D(r,i,a,b);c=e.union(d,y)}else u=v(s),u.attributes.position.values=p.scaleToGeodeticHeight(u.attributes.position.values,n,i,!1),c=e.fromRectangle3D(r,i,n);return new l({attributes:u.attributes,indices:u.indices,primitiveType:f.LINES,boundingSphere:c})}},y}),define("Core/ReferenceFrame",["./freezeObject"],function(e){"use strict";var t={FIXED:0,INERTIAL:1};return e(t)}),define("Core/requestAnimationFrame",["./defined","./getTimestamp"],function(e,t){"use strict";function r(e){return i(e)}if("undefined"!=typeof window){var i=window.requestAnimationFrame;return function(){if(!e(i))for(var r=["webkit","moz","ms","o"],n=0,o=r.length;n<o&&!e(i);)i=window[r[n]+"RequestAnimationFrame"],++n;if(!e(i)){var a=1e3/60,s=0;i=function(e){var r=t(),i=Math.max(a-(r-s),0);return s=r+i,setTimeout(function(){e(s)},i)}}}(),r}}),define("Core/sampleTerrain",["../ThirdParty/when","./defined","./DeveloperError"],function(e,t,r){"use strict";function i(t,r,i){function o(){t.ready?e(n(t,r,i),function(e){a.resolve(e)}):setTimeout(o,10)}var a=e.defer();return o(),a.promise}function n(t,r,i){var n,s=t.tilingScheme,l=[],u={};for(n=0;n<i.length;++n){var c=s.positionToTileXY(i[n],r),d=c.toString();if(!u.hasOwnProperty(d)){var h={x:c.x,y:c.y,level:r,tilingScheme:s,terrainProvider:t,positions:[]};u[d]=h,l.push(h)}u[d].positions.push(i[n])}var p=[];for(n=0;n<l.length;++n){var f=l[n],m=f.terrainProvider.requestTileGeometry(f.x,f.y,f.level,!1),g=e(m,o(f),a(f));p.push(g)}return e.all(p,function(){return i})}function o(e){var t=e.positions,r=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(e){for(var i=0;i<t.length;++i){var n=t[i];n.height=e.interpolateHeight(r,n.longitude,n.latitude)}}}function a(e){var t=e.positions;return function(){for(var e=0;e<t.length;++e){var r=t[e];r.height=void 0}}}return i}),define("Core/sampleTerrainMostDetailed",["../ThirdParty/when","./defined","./sampleTerrain","./DeveloperError"],function(e,t,r,i){"use strict";function n(i,n){return i.readyPromise.then(function(){for(var o=[],a=i.availability,s=0;s<n.length;++s){var l=n[s],u=a.computeMaximumLevelAtPosition(l),c=o[u];t(c)||(o[u]=c=[]),c.push(l)}return e.all(o.map(function(e,n){if(t(e))return r(i,n,e)})).then(function(){return n})})}return n}),define("Core/ScreenSpaceEventType",["./freezeObject"],function(e){"use strict";var t={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};return e(t)}),define("Core/ScreenSpaceEventHandler",["./AssociativeArray","./Cartesian2","./defaultValue","./defined","./destroyObject","./DeveloperError","./FeatureDetection","./getTimestamp","./KeyboardEventModifier","./ScreenSpaceEventType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r){var i=e._element;if(i===document)return r.x=t.clientX,r.y=t.clientY,r;var n=i.getBoundingClientRect();return r.x=t.clientX-n.left,r.y=t.clientY-n.top,r}function d(e,t){var r=e;return i(t)&&(r+="+"+t),r}function h(e){return e.shiftKey?l.SHIFT:e.ctrlKey?l.CTRL:e.altKey?l.ALT:void 0}function p(e,t,r,i){function n(t){i(e,t)}r.addEventListener(t,n,!1),e._removalFunctions.push(function(){r.removeEventListener(t,n,!1)})}function f(e){var t=e._element,r=i(t.disableRootEvents)?t:document;a.supportsPointerEvents()?(p(e,"pointerdown",t,A),p(e,"pointerup",t,D),p(e,"pointermove",t,I),p(e,"pointercancel",t,D)):(p(e,"mousedown",t,_),p(e,"mouseup",r,y),p(e,"mousemove",r,b),p(e,"touchstart",t,S),p(e,"touchend",r,E),p(e,"touchmove",r,x),p(e,"touchcancel",r,E)),p(e,"dblclick",t,C);var n;n="onwheel"in t?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll",p(e,n,t,w)}function m(e){for(var t=e._removalFunctions,r=0;r<t.length;++r)t[r]()}function g(e){e._lastSeenTouchEvent=s()}function v(e){return s()-e._lastSeenTouchEvent>M.mouseEmulationIgnoreMilliseconds}function _(e,r){if(v(e)){var n=r.button;e._buttonDown=n;var o;if(n===O.LEFT)o=u.LEFT_DOWN;else if(n===O.MIDDLE)o=u.MIDDLE_DOWN;else{if(n!==O.RIGHT)return;o=u.RIGHT_DOWN}var a=c(e,r,e._primaryPosition);t.clone(a,e._primaryStartPosition),t.clone(a,e._primaryPreviousPosition);var s=h(r),l=e.getInputAction(o,s);i(l)&&(t.clone(a,R.position),l(R),r.preventDefault())}}function y(e,r){if(v(e)){var n=r.button;e._buttonDown=void 0;var o,a;if(n===O.LEFT)o=u.LEFT_UP,a=u.LEFT_CLICK;else if(n===O.MIDDLE)o=u.MIDDLE_UP,a=u.MIDDLE_CLICK;else{if(n!==O.RIGHT)return;o=u.RIGHT_UP,a=u.RIGHT_CLICK}var s=h(r),l=e.getInputAction(o,s),d=e.getInputAction(a,s);if(i(l)||i(d)){var p=c(e,r,e._primaryPosition);if(i(l)&&(t.clone(p,N.position),l(N)),i(d)){var f=e._primaryStartPosition,m=f.x-p.x,g=f.y-p.y,_=Math.sqrt(m*m+g*g);_<e._clickPixelTolerance&&(t.clone(p,k.position),d(k))}}}}function b(e,r){if(v(e)){var n=h(r),o=c(e,r,e._primaryPosition),a=e._primaryPreviousPosition,s=e.getInputAction(u.MOUSE_MOVE,n);i(s)&&(t.clone(a,L.startPosition),t.clone(o,L.endPosition),s(L)),t.clone(o,a),i(e._buttonDown)&&r.preventDefault()}}function C(e,t){var r,n=t.button;if(n===O.LEFT){r=u.LEFT_DOUBLE_CLICK;var o=h(t),a=e.getInputAction(r,o);i(a)&&(c(e,t,F.position),a(F))}}function w(e,t){var r;if(i(t.deltaY)){var n=t.deltaMode;r=n===t.DOM_DELTA_PIXEL?-t.deltaY:n===t.DOM_DELTA_LINE?40*-t.deltaY:120*-t.deltaY}else r=t.detail>0?t.detail*-120:t.wheelDelta;if(i(r)){var o=h(t),a=e.getInputAction(u.WHEEL,o);i(a)&&(a(r),t.preventDefault())}}function S(e,r){g(e);var i,n,o,a=r.changedTouches,s=a.length,l=e._positions;for(i=0;i<s;++i)n=a[i],o=n.identifier,l.set(o,c(e,n,new t));T(e,r);var u=e._previousPositions;for(i=0;i<s;++i)n=a[i],o=n.identifier,u.set(o,t.clone(l.get(o)))}function E(e,t){g(e);var r,i,n,o=t.changedTouches,a=o.length,s=e._positions;for(r=0;r<a;++r)i=o[r],n=i.identifier,s.remove(n);T(e,t);var l=e._previousPositions;for(r=0;r<a;++r)i=o[r],n=i.identifier,l.remove(n)}function T(e,r){var n,o,a=h(r),s=e._positions,l=e._previousPositions,c=s.length;if(1!==c&&e._buttonDown===O.LEFT&&(e._buttonDown=void 0,n=e.getInputAction(u.LEFT_UP,a),i(n)&&(t.clone(e._primaryPosition,V.position),n(V)),0===c&&(o=e.getInputAction(u.LEFT_CLICK,a),i(o)))){var d=e._primaryStartPosition,p=l.values[0],f=d.x-p.x,m=d.y-p.y,g=Math.sqrt(f*f+m*m);g<e._clickPixelTolerance&&(t.clone(e._primaryPosition,z.position),o(z))}if(2!==c&&e._isPinching&&(e._isPinching=!1,n=e.getInputAction(u.PINCH_END,a),i(n)&&n()),1===c){var v=s.values[0];t.clone(v,e._primaryPosition),t.clone(v,e._primaryStartPosition),t.clone(v,e._primaryPreviousPosition),e._buttonDown=O.LEFT,n=e.getInputAction(u.LEFT_DOWN,a),i(n)&&(t.clone(v,B.position),n(B)),r.preventDefault()}2===c&&(e._isPinching=!0,n=e.getInputAction(u.PINCH_START,a),i(n)&&(t.clone(s.values[0],U.position1),t.clone(s.values[1],U.position2),n(U),r.preventDefault()))}function x(e,r){g(e);var n,o,a,s=r.changedTouches,l=s.length,u=e._positions;for(n=0;n<l;++n){o=s[n],a=o.identifier;var d=u.get(a);i(d)&&c(e,o,d)}P(e,r);var h=e._previousPositions;for(n=0;n<l;++n)o=s[n],a=o.identifier,t.clone(u.get(a),h.get(a))}function P(e,r){var n,o=h(r),a=e._positions,s=e._previousPositions,l=a.length;if(1===l&&e._buttonDown===O.LEFT){var c=a.values[0];t.clone(c,e._primaryPosition);var d=e._primaryPreviousPosition;n=e.getInputAction(u.MOUSE_MOVE,o),i(n)&&(t.clone(d,G.startPosition),t.clone(c,G.endPosition),n(G)),t.clone(c,d),r.preventDefault()}else if(2===l&&e._isPinching&&(n=e.getInputAction(u.PINCH_MOVE,o),i(n))){var p=a.values[0],f=a.values[1],m=s.values[0],g=s.values[1],v=f.x-p.x,_=f.y-p.y,y=.25*Math.sqrt(v*v+_*_),b=g.x-m.x,C=g.y-m.y,w=.25*Math.sqrt(b*b+C*C),S=.125*(f.y+p.y),E=.125*(g.y+m.y),T=Math.atan2(_,v),x=Math.atan2(C,b);t.fromElements(0,w,H.distance.startPosition),t.fromElements(0,y,H.distance.endPosition),t.fromElements(x,E,H.angleAndHeight.startPosition),t.fromElements(T,S,H.angleAndHeight.endPosition),n(H)}}function A(e,r){if(r.target.setPointerCapture(r.pointerId),"touch"===r.pointerType){var i=e._positions,n=r.pointerId;i.set(n,c(e,r,new t)),T(e,r);var o=e._previousPositions;o.set(n,t.clone(i.get(n)))}else _(e,r)}function D(e,t){if("touch"===t.pointerType){var r=e._positions,i=t.pointerId;r.remove(i),T(e,t);var n=e._previousPositions;n.remove(i)}else y(e,t)}function I(e,r){if("touch"===r.pointerType){var n=e._positions,o=r.pointerId,a=n.get(o);if(!i(a))return;c(e,r,a),P(e,r);var s=e._previousPositions;t.clone(n.get(o),s.get(o))}else b(e,r)}function M(i){this._inputEvents={},this._buttonDown=void 0,this._isPinching=!1,this._lastSeenTouchEvent=-M.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new t,this._primaryPosition=new t,this._primaryPreviousPosition=new t,this._positions=new e,this._previousPositions=new e,this._removalFunctions=[],this._clickPixelTolerance=5,this._element=r(i,document),f(this)}var O={LEFT:0,MIDDLE:1,RIGHT:2},R={position:new t},N={position:new t},k={position:new t},L={startPosition:new t,endPosition:new t},F={position:new t},B={position:new t},U={position1:new t,position2:new t},V={position:new t},z={position:new t},G={startPosition:new t,endPosition:new t},H={distance:{startPosition:new t,endPosition:new t},angleAndHeight:{startPosition:new t,endPosition:new t}};return M.prototype.setInputAction=function(e,t,r){var i=d(t,r);this._inputEvents[i]=e},M.prototype.getInputAction=function(e,t){var r=d(e,t);return this._inputEvents[r]},M.prototype.removeInputAction=function(e,t){var r=d(e,t);delete this._inputEvents[r]},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){return m(this),n(this)},M.mouseEmulationIgnoreMilliseconds=800,M}),define("Core/ShowGeometryInstanceAttribute",["./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError"],function(e,t,r,i,n){"use strict";function o(e){e=t(e,!0),this.value=o.toValue(e)}return i(o.prototype,{componentDatatype:{get:function(){return e.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}}),o.toValue=function(e,t){return r(t)?(t[0]=e,t):new Uint8Array([e])},o}),define("Core/Simon1994PlanetaryPositions",["./Cartesian3","./defined","./DeveloperError","./JulianDate","./Math","./Matrix3","./TimeConstants","./TimeStandard"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=6.239996+.0172019696544*e;return.001657*Math.sin(t+.01671*Math.sin(t))}function u(e,t){t=i.addSeconds(e,b,t);var r=i.totalDays(t)-C;return t=i.addSeconds(t,l(r),t)}function c(r,i,a,s,l,u,c){a<0&&(a=-a,l+=n.PI);var p=r*(1-i),f=s-l,g=l,v=h(u-s,i);d(i,0);m(f,a,g,P);var _=p*(1+i),y=Math.cos(v),b=Math.sin(v),C=1+i*y,w=_/C;return t(c)?(c.x=w*y,c.y=w*b,c.z=0):c=new e(w*y,w*b,0),o.multiplyByVector(P,c,c)}function d(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function h(e,t){var r=p(e,t);return f(r,t)}function p(e,t){var r=Math.floor(e/n.TWO_PI);e-=r*n.TWO_PI;var i,o=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),a=Number.MAX_VALUE;for(i=0;i<A&&Math.abs(a-o)>D;++i){a=o;var s=a-t*Math.sin(a)-e,l=1-t*Math.cos(a);o=a-s/l}return a=o+r*n.TWO_PI}function f(e,t){var r=Math.floor(e/n.TWO_PI);e-=r*n.TWO_PI;var i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),a=Math.atan2(o,i);return a=n.zeroToTwoPi(a),e<0&&(a-=n.TWO_PI),a+=r*n.TWO_PI}function m(e,r,i,n){var a=Math.cos(e),s=Math.sin(e),l=Math.cos(r),u=Math.sin(r),c=Math.cos(i),d=Math.sin(i);return t(n)?(n[0]=c*a-d*s*l,n[1]=d*a+c*s*l,n[2]=s*u,n[3]=-c*s-d*a*l,n[4]=-d*s+c*a*l,n[5]=a*u,n[6]=d*u,n[7]=-c*u,n[8]=l):n=new o(c*a-d*s*l,-c*s-d*a*l,d*u,d*a+c*s*l,-d*s+c*a*l,-c*u,s*u,a*u,l),n}function g(e,t){u(e,Pe);var r=Pe.dayNumber-w.dayNumber+(Pe.secondsOfDay-w.secondsOfDay)/a.SECONDS_PER_DAY,i=r/(10*a.DAYS_PER_JULIAN_CENTURY),n=.3595362*i,o=I+z*Math.cos(R*n)+Q*Math.sin(R*n)+G*Math.cos(N*n)+Z*Math.sin(N*n)+H*Math.cos(k*n)+K*Math.sin(k*n)+W*Math.cos(L*n)+J*Math.sin(L*n)+j*Math.cos(F*n)+$*Math.sin(F*n)+q*Math.cos(B*n)+ee*Math.sin(B*n)+Y*Math.cos(U*n)+te*Math.sin(U*n)+X*Math.cos(V*n)+re*Math.sin(V*n),s=M+O*i+de*Math.cos(ie*n)+ye*Math.sin(ie*n)+he*Math.cos(ne*n)+be*Math.sin(ne*n)+pe*Math.cos(oe*n)+Ce*Math.sin(oe*n)+fe*Math.cos(ae*n)+we*Math.sin(ae*n)+me*Math.cos(se*n)+Se*Math.sin(se*n)+ge*Math.cos(le*n)+Ee*Math.sin(le*n)+ve*Math.cos(ue*n)+Te*Math.sin(ue*n)+_e*Math.cos(ce*n)+xe*Math.sin(ce*n),l=.0167086342-.0004203654*i,d=102.93734808*E+11612.3529*T*i,h=469.97289*T*i,p=174.87317577*E-8679.27034*T*i;return c(o,l,h,d,p,s,t)}function v(e,t){u(e,Pe);var r=Pe.dayNumber-w.dayNumber+(Pe.secondsOfDay-w.secondsOfDay)/a.SECONDS_PER_DAY,i=r/a.DAYS_PER_JULIAN_CENTURY,n=i*i,o=n*i,s=o*i,l=383397.7725+.004*i,d=.055545526-1.6e-8*i,h=5.15668983*E,p=-8e-5*i+.02966*n-42e-6*o-1.3e-7*s,f=83.35324312*E,m=14643420.2669*i-38.2702*n-.045047*o+21301e-8*s,g=125.04455501*E,v=-6967919.3631*i+6.3602*n+.007625*o-3586e-8*s,_=218.31664563*E,y=1732559343.4847*i-6.391*n+.006588*o-3169e-8*s,b=297.85019547*E+T*(1602961601.209*i-6.3706*n+.006593*o-3169e-8*s),C=93.27209062*E+T*(1739527262.8478*i-12.7512*n-.001037*o+417e-8*s),x=134.96340251*E+T*(1717915923.2178*i+31.8792*n+.051635*o-2447e-7*s),P=357.52910918*E+T*(129596581.0481*i-.5532*n+136e-6*o-1149e-8*s),A=310.17137918*E-T*(6967051.436*i+6.2068*n+.007618*o-3219e-8*s),D=2*b,I=4*b,M=6*b,O=2*x,R=3*x,N=4*x,k=2*C;l+=3400.4*Math.cos(D)-635.6*Math.cos(D-x)-235.6*Math.cos(x)+218.1*Math.cos(D-P)+181*Math.cos(D+x),d+=.014216*Math.cos(D-x)+.008551*Math.cos(D-O)-.001383*Math.cos(x)+.001356*Math.cos(D+x)-.001147*Math.cos(I-R)-914e-6*Math.cos(I-O)+869e-6*Math.cos(D-P-x)-627e-6*Math.cos(D)-394e-6*Math.cos(I-N)+282e-6*Math.cos(D-P-O)-279e-6*Math.cos(b-x)-236e-6*Math.cos(O)+231e-6*Math.cos(I)+229e-6*Math.cos(M-N)-201e-6*Math.cos(O-k),p+=486.26*Math.cos(D-k)-40.13*Math.cos(D)+37.51*Math.cos(k)+25.73*Math.cos(O-k)+19.97*Math.cos(D-P-k),m+=-55609*Math.sin(D-x)-34711*Math.sin(D-O)-9792*Math.sin(x)+9385*Math.sin(I-R)+7505*Math.sin(I-O)+5318*Math.sin(D+x)+3484*Math.sin(I-N)-3417*Math.sin(D-P-x)-2530*Math.sin(M-N)-2376*Math.sin(D)-2075*Math.sin(D-R)-1883*Math.sin(O)-1736*Math.sin(M-5*x)+1626*Math.sin(P)-1370*Math.sin(M-R),v+=-5392*Math.sin(D-k)-540*Math.sin(P)-441*Math.sin(D)+423*Math.sin(k)-288*Math.sin(O-k),y+=-3332.9*Math.sin(D)+1197.4*Math.sin(D-x)-662.5*Math.sin(P)+396.3*Math.sin(x)-218*Math.sin(D-P);var L=2*A,F=3*A;p+=46.997*Math.cos(A)*i-.614*Math.cos(D-k+A)*i+.614*Math.cos(D-k-A)*i-.0297*Math.cos(L)*n-.0335*Math.cos(A)*n+.0012*Math.cos(D-k+L)*n-16e-5*Math.cos(A)*o+4e-5*Math.cos(F)*o+4e-5*Math.cos(L)*o;var B=2.116*Math.sin(A)*i-.111*Math.sin(D-k-A)*i-.0015*Math.sin(A)*n;m+=B,y+=B,v+=-520.77*Math.sin(A)*i+13.66*Math.sin(D-k+A)*i+1.12*Math.sin(D-A)*i-1.06*Math.sin(k-A)*i+.66*Math.sin(L)*n+.371*Math.sin(A)*n-.035*Math.sin(D-k+L)*n-.015*Math.sin(D-k+A)*n+.0014*Math.sin(A)*o-.0011*Math.sin(F)*o-9e-4*Math.sin(L)*o,l*=S;var U=h+p*T,V=f+m*T,z=_+y*T,G=g+v*T;return c(l,d,U,V,G,z,t)}function _(t,r){return r=v(t,r),e.multiplyByScalar(r,De,r)}var y={},b=32.184,C=2451545,w=new i(2451545,0,s.TAI),S=1e3,E=n.RADIANS_PER_DEGREE,T=n.RADIANS_PER_ARCSECOND,x=14959787e4,P=new o,A=50,D=n.EPSILON8,I=1.0000010178*x,M=100.46645683*E,O=1295977422.83429*T,R=16002,N=21863,k=32004,L=10931,F=14529,B=16368,U=15318,V=32794,z=64e-7*x,G=-152e-7*x,H=62e-7*x,W=-8e-7*x,j=32e-7*x,q=-41e-7*x,Y=19e-7*x,X=-11e-7*x,Q=1e-7*-150*x,Z=-46e-7*x,K=68*1e-7*x,J=54e-7*x,$=14e-7*x,ee=24e-7*x,te=-28e-7*x,re=22e-7*x,ie=10,ne=16002,oe=21863,ae=10931,se=1473,le=32004,ue=4387,ce=73,de=-325e-7,he=-322e-7,pe=1e-7*-79,fe=232*1e-7,me=1e-7*-52,ge=97e-7,ve=55e-7,_e=-41e-7,ye=-105e-7,be=-137e-7,Ce=258e-7,we=35e-7,Se=1e-7*-116,Ee=-88e-7,Te=-112e-7,xe=-8e-6,Pe=new i(0,0,s.TAI),Ae=.012300034,De=Ae/(Ae+1)*-1,Ie=new o(1.0000000000000002,5.619723173785822e-16,4.690511510146299e-19,-5.154129427414611e-16,.9174820620691819,-.39777715593191376,-2.23970096136568e-16,.39777715593191376,.9174820620691819),Me=new e; +return y.computeSunPositionInEarthInertialFrame=function(r,n){return t(r)||(r=i.now()),t(n)||(n=new e),Me=g(r,Me),n=e.negate(Me,n),_(r,Me),e.subtract(n,Me,n),o.multiplyByVector(Ie,n,n),n},y.computeMoonPositionInEarthInertialFrame=function(e,r){return t(e)||(e=i.now()),r=v(e,r),o.multiplyByVector(Ie,r,r),r},y}),define("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e,t,i,n,o,a,s){var l,u=p.numberOfPoints(e,t,o),c=i.red,d=i.green,h=i.blue,f=i.alpha,m=n.red,g=n.green,v=n.blue,_=n.alpha;if(r.equals(i,n)){for(l=0;l<u;l++)a[s++]=r.floatToByte(c),a[s++]=r.floatToByte(d),a[s++]=r.floatToByte(h),a[s++]=r.floatToByte(f);return s}var y=(m-c)/u,b=(g-d)/u,C=(v-h)/u,w=(_-f)/u,S=s;for(l=0;l<u;l++)a[S++]=r.floatToByte(c+l*y),a[S++]=r.floatToByte(d+l*b),a[S++]=r.floatToByte(h+l*C),a[S++]=r.floatToByte(f+l*w);return S}function g(e){e=n(e,n.EMPTY_OBJECT);var i=e.positions,a=e.colors,l=n(e.colorsPerVertex,!1);this._positions=i,this._colors=a,this._colorsPerVertex=l,this._followSurface=n(e.followSurface,!0),this._granularity=n(e.granularity,h.RADIANS_PER_DEGREE),this._ellipsoid=n(e.ellipsoid,s.WGS84),this._workerName="createSimplePolylineGeometry";var u=1+i.length*t.packedLength;u+=o(a)?1+a.length*r.packedLength:1,this.packedLength=u+s.packedLength+3}g.pack=function(e,i,a){a=n(a,0);var l,u=e._positions,c=u.length;for(i[a++]=c,l=0;l<c;++l,a+=t.packedLength)t.pack(u[l],i,a);var d=e._colors;for(c=o(d)?d.length:0,i[a++]=c,l=0;l<c;++l,a+=r.packedLength)r.pack(d[l],i,a);return s.pack(e._ellipsoid,i,a),a+=s.packedLength,i[a++]=e._colorsPerVertex?1:0,i[a++]=e._followSurface?1:0,i[a]=e._granularity,i},g.unpack=function(e,i,a){i=n(i,0);var l,u=e[i++],c=new Array(u);for(l=0;l<u;++l,i+=t.packedLength)c[l]=t.unpack(e,i);u=e[i++];var d=u>0?new Array(u):void 0;for(l=0;l<u;++l,i+=r.packedLength)d[l]=r.unpack(e,i);var h=s.unpack(e,i);i+=s.packedLength;var p=1===e[i++],f=1===e[i++],m=e[i];return o(a)?(a._positions=c,a._colors=d,a._ellipsoid=h,a._colorsPerVertex=p,a._followSurface=f,a._granularity=m,a):new g({positions:c,colors:d,ellipsoid:h,colorsPerVertex:p,followSurface:f,granularity:m})};var v=new Array(2),_=new Array(2),y={positions:v,height:_,ellipsoid:void 0,minDistance:void 0};return g.createGeometry=function(n){var a,s,g,b,C,w=n._positions,S=n._colors,E=n._colorsPerVertex,T=n._followSurface,x=n._granularity,P=n._ellipsoid,A=h.chordLength(x,P.maximumRadius),D=o(S)&&!E,I=w.length,M=0;if(T){var O=p.extractHeights(w,P),R=y;if(R.minDistance=A,R.ellipsoid=P,D){var N=0;for(a=0;a<I-1;a++)N+=p.numberOfPoints(w[a],w[a+1],A)+1;s=new Float64Array(3*N),b=new Uint8Array(4*N),R.positions=v,R.height=_;var k=0;for(a=0;a<I-1;++a){v[0]=w[a],v[1]=w[a+1],_[0]=O[a],_[1]=O[a+1];var L=p.generateArc(R);if(o(S)){var F=L.length/3;C=S[a];for(var B=0;B<F;++B)b[k++]=r.floatToByte(C.red),b[k++]=r.floatToByte(C.green),b[k++]=r.floatToByte(C.blue),b[k++]=r.floatToByte(C.alpha)}s.set(L,M),M+=L.length}}else if(R.positions=w,R.height=O,s=new Float64Array(p.generateArc(R)),o(S)){for(b=new Uint8Array(s.length/3*4),a=0;a<I-1;++a){var U=w[a],V=w[a+1],z=S[a],G=S[a+1];M=m(U,V,z,G,A,b,M)}var H=S[I-1];b[M++]=r.floatToByte(H.red),b[M++]=r.floatToByte(H.green),b[M++]=r.floatToByte(H.blue),b[M++]=r.floatToByte(H.alpha)}}else{g=D?2*I-2:I,s=new Float64Array(3*g),b=o(S)?new Uint8Array(4*g):void 0;var W=0,j=0;for(a=0;a<I;++a){var q=w[a];if(D&&a>0&&(t.pack(q,s,W),W+=3,C=S[a-1],b[j++]=r.floatToByte(C.red),b[j++]=r.floatToByte(C.green),b[j++]=r.floatToByte(C.blue),b[j++]=r.floatToByte(C.alpha)),D&&a===I-1)break;t.pack(q,s,W),W+=3,o(S)&&(C=S[a],b[j++]=r.floatToByte(C.red),b[j++]=r.floatToByte(C.green),b[j++]=r.floatToByte(C.blue),b[j++]=r.floatToByte(C.alpha))}}var Y=new c;Y.position=new u({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:s}),o(S)&&(Y.color=new u({componentDatatype:i.UNSIGNED_BYTE,componentsPerAttribute:4,values:b,normalize:!0})),g=s.length/3;var X=2*(g-1),Q=d.createTypedArray(g,X),Z=0;for(a=0;a<g-1;++a)Q[Z++]=a,Q[Z++]=a+1;return new l({attributes:Y,indices:Q,primitiveType:f.LINES,boundingSphere:e.fromPoints(w)})},g}),define("Core/SphereGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidGeometry","./VertexFormat"],function(e,t,r,i,n,o){"use strict";function a(t){var i=r(t.radius,1),o=new e(i,i,i),a={radii:o,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,vertexFormat:t.vertexFormat};this._ellipsoidGeometry=new n(a),this._workerName="createSphereGeometry"}a.packedLength=n.packedLength,a.pack=function(e,t,r){return n.pack(e._ellipsoidGeometry,t,r)};var s=new n,l={radius:void 0,radii:new e,vertexFormat:new o,stackPartitions:void 0,slicePartitions:void 0};return a.unpack=function(t,r,u){var c=n.unpack(t,r,s);return l.vertexFormat=o.clone(c._vertexFormat,l.vertexFormat),l.stackPartitions=c._stackPartitions,l.slicePartitions=c._slicePartitions,i(u)?(e.clone(c._radii,l.radii),u._ellipsoidGeometry=new n(l),u):(l.radius=c._radii.x,new a(l))},a.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},a}),define("Core/SphereOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidOutlineGeometry"],function(e,t,r,i,n){"use strict";function o(t){var i=r(t.radius,1),o=new e(i,i,i),a={radii:o,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,subdivisions:t.subdivisions};this._ellipsoidGeometry=new n(a),this._workerName="createSphereOutlineGeometry"}o.packedLength=n.packedLength,o.pack=function(e,t,r){return n.pack(e._ellipsoidGeometry,t,r)};var a=new n,s={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return o.unpack=function(t,r,l){var u=n.unpack(t,r,a);return s.stackPartitions=u._stackPartitions,s.slicePartitions=u._slicePartitions,s.subdivisions=u._subdivisions,i(l)?(e.clone(u._radii,s.radii),l._ellipsoidGeometry=new n(s),l):(s.radius=u._radii.x,new o(s))},o.createGeometry=function(e){return n.createGeometry(e._ellipsoidGeometry)},o}),define("Core/Spherical",["./Check","./defaultValue","./defined"],function(e,t,r){"use strict";function i(e,r,i){this.clock=t(e,0),this.cone=t(r,0),this.magnitude=t(i,1)}return i.fromCartesian3=function(e,t){var n=e.x,o=e.y,a=e.z,s=n*n+o*o;return r(t)||(t=new i),t.clock=Math.atan2(o,n),t.cone=Math.atan2(Math.sqrt(s),a),t.magnitude=Math.sqrt(s+a*a),t},i.clone=function(e,t){if(r(e))return r(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new i(e.clock,e.cone,e.magnitude)},i.normalize=function(e,t){return r(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new i(e.clock,e.cone,1)},i.equals=function(e,t){return e===t||r(e)&&r(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude},i.equalsEpsilon=function(e,i,n){return n=t(n,0),e===i||r(e)&&r(i)&&Math.abs(e.clock-i.clock)<=n&&Math.abs(e.cone-i.cone)<=n&&Math.abs(e.magnitude-i.magnitude)<=n},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equalsEpsilon=function(e,t){return i.equalsEpsilon(this,e,t)},i.prototype.toString=function(){return"("+this.clock+", "+this.cone+", "+this.magnitude+")"},i}),define("Core/subdivideArray",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t){for(var r=[],i=e.length,n=0;n<i;){var o=Math.ceil((i-n)/t--);r.push(e.slice(n,n+o)),n+=o}return r}return r}),define("Core/TerrainData",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function r(){t.throwInstantiationError()}return e(r.prototype,{credits:{get:t.throwInstantiationError},waterMask:{get:t.throwInstantiationError}}),r.prototype.interpolateHeight=t.throwInstantiationError,r.prototype.isChildAvailable=t.throwInstantiationError,r.prototype.createMesh=t.throwInstantiationError,r.prototype.upsample=t.throwInstantiationError,r.prototype.wasCreatedByUpsampling=t.throwInstantiationError,r}),define("Core/TilingScheme",["./defineProperties","./DeveloperError"],function(e,t){"use strict";function r(e){}return e(r.prototype,{ellipsoid:{get:t.throwInstantiationError},rectangle:{get:t.throwInstantiationError},projection:{get:t.throwInstantiationError}}),r.prototype.getNumberOfXTilesAtLevel=t.throwInstantiationError,r.prototype.getNumberOfYTilesAtLevel=t.throwInstantiationError,r.prototype.rectangleToNativeRectangle=t.throwInstantiationError,r.prototype.tileXYToNativeRectangle=t.throwInstantiationError,r.prototype.tileXYToRectangle=t.throwInstantiationError,r.prototype.positionToTileXY=t.throwInstantiationError,r}),define("Core/TimeIntervalCollection",["./binarySearch","./defaultValue","./defined","./defineProperties","./DeveloperError","./Event","./JulianDate","./TimeInterval"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){return a.compare(e.start,t.start)}function u(e){if(this._intervals=[],this._changedEvent=new o,r(e))for(var t=e.length,i=0;i<t;i++)this.addInterval(e[i])}i(u.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}}}),u.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof u))return!1;var r=this._intervals,i=e._intervals,n=r.length;if(n!==i.length)return!1;for(var o=0;o<n;o++)if(!s.equals(r[o],i[o],t))return!1;return!0},u.prototype.get=function(e){return this._intervals[e]},u.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))},u.prototype.findIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t]:void 0},u.prototype.findDataForIntervalContainingDate=function(e){var t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0},u.prototype.contains=function(e){return this.indexOf(e)>=0};var c=new s;return u.prototype.indexOf=function(t){var r=this._intervals;c.start=t,c.stop=t;var i=e(r,c,l);return i>=0?r[i].isStartIncluded?i:i>0&&r[i-1].stop.equals(t)&&r[i-1].isStopIncluded?i-1:~i:(i=~i,i>0&&i-1<r.length&&s.contains(r[i-1],t)?i-1:~i)},u.prototype.findInterval=function(e){e=t(e,t.EMPTY_OBJECT);for(var i=e.start,n=e.stop,o=e.isStartIncluded,a=e.isStopIncluded,s=this._intervals,l=0,u=s.length;l<u;l++){var c=s[l];if((!r(i)||c.start.equals(i))&&(!r(n)||c.stop.equals(n))&&(!r(o)||c.isStartIncluded===o)&&(!r(a)||c.isStopIncluded===a))return s[l]}},u.prototype.addInterval=function(t,i){if(!t.isEmpty){var n,o,u=this._intervals;if(0===u.length||a.greaterThan(t.start,u[u.length-1].stop))return u.push(t),void this._changedEvent.raiseEvent(this);for(o=e(u,t,l),o<0?o=~o:o>0&&t.isStartIncluded&&u[o-1].isStartIncluded&&u[o-1].start.equals(t.start)?--o:o<u.length&&!t.isStartIncluded&&u[o].isStartIncluded&&u[o].start.equals(t.start)&&++o,o>0&&(n=a.compare(u[o-1].stop,t.start),(n>0||0===n&&(u[o-1].isStopIncluded||t.isStartIncluded))&&((r(i)?i(u[o-1].data,t.data):u[o-1].data===t.data)?(t=new s(a.greaterThan(t.stop,u[o-1].stop)?{start:u[o-1].start,stop:t.stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:t.isStopIncluded,data:t.data}:{start:u[o-1].start,stop:u[o-1].stop,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:u[o-1].isStopIncluded||t.stop.equals(u[o-1].stop)&&t.isStopIncluded,data:t.data}),u.splice(o-1,1),--o):(n=a.compare(u[o-1].stop,t.stop),n>0||0===n&&u[o-1].isStopIncluded&&!t.isStopIncluded?u.splice(o-1,1,new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}),new s({start:t.stop,stop:u[o-1].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o-1].isStopIncluded,data:u[o-1].data})):u[o-1]=new s({start:u[o-1].start,stop:t.start,isStartIncluded:u[o-1].isStartIncluded,isStopIncluded:!t.isStartIncluded,data:u[o-1].data}))));o<u.length&&(n=a.compare(t.stop,u[o].start),n>0||0===n&&(t.isStopIncluded||u[o].isStartIncluded));)if(r(i)?i(u[o].data,t.data):u[o].data===t.data)t=new s({start:t.start,stop:a.greaterThan(u[o].stop,t.stop)?u[o].stop:t.stop,isStartIncluded:t.isStartIncluded,isStopIncluded:a.greaterThan(u[o].stop,t.stop)?u[o].isStopIncluded:t.isStopIncluded,data:t.data}),u.splice(o,1);else{if(u[o]=new s({start:t.stop,stop:u[o].stop,isStartIncluded:!t.isStopIncluded,isStopIncluded:u[o].isStopIncluded,data:u[o].data}),!u[o].isEmpty)break;u.splice(o,1)}u.splice(o,0,t),this._changedEvent.raiseEvent(this)}},u.prototype.removeInterval=function(t){if(t.isEmpty)return!1;var r=!1,i=this._intervals,n=e(i,t,l);n<0&&(n=~n);var o=t.start,u=t.stop,c=t.isStartIncluded,d=t.isStopIncluded;if(n>0){var h=i[n-1],p=h.stop;(a.greaterThan(p,o)||s.equals(p,o)&&h.isStopIncluded&&c)&&(r=!0,(a.greaterThan(p,u)||h.isStopIncluded&&!d&&s.equals(p,u))&&i.splice(n,0,new s({start:u,stop:p,isStartIncluded:!d,isStopIncluded:h.isStopIncluded,data:h.data})),i[n-1]=new s({start:h.start,stop:o,isStartIncluded:h.isStartIncluded,isStopIncluded:!c,data:h.data}))}var f=i[n];for(n<i.length&&!c&&f.isStartIncluded&&o.equals(f.start)&&(r=!0,i.splice(n,0,new s({start:f.start,stop:f.start,isStartIncluded:!0,isStopIncluded:!0,data:f.data})),++n,f=i[n]);n<i.length&&a.greaterThan(u,f.stop);)r=!0,i.splice(n,1),f=i[n];return n<i.length&&u.equals(f.stop)&&(r=!0,!d&&f.isStopIncluded?(n+1<i.length&&i[n+1].start.equals(u)&&f.data===i[n+1].data?(i.splice(n,1),f=new s({start:f.start,stop:f.stop,isStartIncluded:!0,isStopIncluded:f.isStopIncluded,data:f.data})):f=new s({start:u,stop:u,isStartIncluded:!0,isStopIncluded:!0,data:f.data}),i[n]=f):i.splice(n,1)),n<i.length&&(a.greaterThan(u,f.start)||u.equals(f.start)&&d&&f.isStartIncluded)&&(r=!0,i[n]=new s({start:u,stop:f.stop,isStartIncluded:!d,isStopIncluded:f.isStopIncluded,data:f.data})),r&&this._changedEvent.raiseEvent(this),r},u.prototype.intersect=function(e,t,i){for(var n=0,o=0,l=new u,c=this._intervals,d=e._intervals;n<c.length&&o<d.length;){var h=c[n],p=d[o];if(a.lessThan(h.stop,p.start))++n;else if(a.lessThan(p.stop,h.start))++o;else{if(r(i)||r(t)&&t(h.data,p.data)||!r(t)&&p.data===h.data){var f=s.intersect(h,p,new s,i);f.isEmpty||l.addInterval(f,t)}a.lessThan(h.stop,p.stop)||h.stop.equals(p.stop)&&!h.isStopIncluded&&p.isStopIncluded?++n:++o}}return l},u}),define("Core/TranslationRotationScale",["./Cartesian3","./defaultValue","./defined","./Quaternion"],function(e,t,r,i){"use strict";var n=new e(1,1,1),o=e.ZERO,a=i.IDENTITY,s=function(r,s,l){this.translation=e.clone(t(r,o)),this.rotation=i.clone(t(s,a)),this.scale=e.clone(t(l,n))};return s.prototype.equals=function(t){return this===t||r(t)&&e.equals(this.translation,t.translation)&&i.equals(this.rotation,t.rotation)&&e.equals(this.scale,t.scale)},s}),define("Core/VideoSynchronizer",["./defaultValue","./defined","./defineProperties","./destroyObject","./Iso8601","./JulianDate"],function(e,t,r,i,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this.clock=t.clock,this.element=t.element,this.epoch=e(t.epoch,n.MINIMUM_VALUE),this.tolerance=e(t.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}function s(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}return r(a.prototype,{clock:{get:function(){return this._clock},set:function(e){var r=this._clock;r!==e&&(t(r)&&(this._clockSubscription(),this._clockSubscription=void 0),t(e)&&(this._clockSubscription=e.onTick.addEventListener(a.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){var r=this._element;r!==e&&(t(r)&&r.removeEventListener("seeked",this._seekFunction,!1),t(e)&&(this._seeking=!1,this._seekFunction=s(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}}),a.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,i(this)},a.prototype.isDestroyed=function(){return!1},a.prototype._onTick=function(r){var i=this._element;if(t(i)&&!(i.readyState<2)){var a=i.paused,s=r.shouldAnimate;if(s===a&&(s?i.play():i.pause()),this._seeking||this._firstTickAfterSeek)return void(this._firstTickAfterSeek=!1);i.playbackRate=r.multiplier;var l,u=r.currentTime,c=e(this.epoch,n.MINIMUM_VALUE),d=o.secondsDifference(u,c),h=i.duration,p=i.currentTime;i.loop?(d%=h,d<0&&(d=h-d),l=d):l=d>h?h:d<0?0:d;var f=s?e(this.tolerance,1):.001;Math.abs(l-p)>f&&(this._seeking=!0,i.currentTime=l)}},a}),define("Core/VRTheWorldTerrainProvider",["../ThirdParty/when","./Credit","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Event","./GeographicTilingScheme","./getImagePixels","./HeightmapTerrainData","./loadImage","./loadXML","./Math","./Rectangle","./TerrainProvider","./throttleRequestByServer","./TileProviderError"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(e,t){this.rectangle=e,this.maxLevel=t}function y(i){function n(e){var t=e.getElementsByTagName("SRS")[0].textContent;if("EPSG:4326"!==t)return void o("SRS "+t+" is not supported.");g._tilingScheme=new l({ellipsoid:y});var r=e.getElementsByTagName("TileFormat")[0];g._heightmapWidth=parseInt(r.getAttribute("width"),10),g._heightmapHeight=parseInt(r.getAttribute("height"),10),g._levelZeroMaximumGeometricError=m.getEstimatedLevelZeroGeometricErrorForAHeightmap(y,Math.min(g._heightmapWidth,g._heightmapHeight),g._tilingScheme.getNumberOfXTilesAtLevel(0));for(var i=e.getElementsByTagName("DataExtent"),n=0;n<i.length;++n){var a=i[n],s=p.toRadians(parseFloat(a.getAttribute("minx"))),u=p.toRadians(parseFloat(a.getAttribute("miny"))),c=p.toRadians(parseFloat(a.getAttribute("maxx"))),d=p.toRadians(parseFloat(a.getAttribute("maxy"))),h=parseInt(a.getAttribute("maxlevel"),10);g._rectangles.push(new _(new f(s,u,c,d),h))}g._ready=!0,g._readyPromise.resolve(!0)}function o(e){var t=r(e,"An error occurred while accessing "+g._url+".");d=v.handleError(d,g,g._errorEvent,t,void 0,void 0,void 0,u)}function u(){e(h(g._url),n,o)}i=r(i,r.EMPTY_OBJECT),this._url=i.url,this._url.length>0&&"/"!==this._url[this._url.length-1]&&(this._url+="/"),this._errorEvent=new s,this._ready=!1,this._readyPromise=e.defer(),this._proxy=i.proxy,this._terrainDataStructure={heightScale:.001,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:16777215};var c=i.credit;"string"==typeof c&&(c=new t(c)),this._credit=c,this._tilingScheme=void 0,this._rectangles=[];var d,g=this,y=r(i.ellipsoid,a.WGS84);u()}function b(e,t,r,n){for(var o=e._tilingScheme,a=e._rectangles,s=o.tileXYToRectangle(t,r,n),l=0,u=0;u<a.length&&15!==l;++u){var c=a[u];if(!(c.maxLevel<=n)){var d=c.rectangle,h=f.intersection(d,s,w);i(h)&&(C(o,d,2*t,2*r,n+1)&&(l|=4),C(o,d,2*t+1,2*r,n+1)&&(l|=8),C(o,d,2*t,2*r+1,n+1)&&(l|=1),C(o,d,2*t+1,2*r+1,n+1)&&(l|=2))}}return l}function C(e,t,r,n,o){var a=e.tileXYToRectangle(r,n,o);return i(f.intersection(a,t,w))}n(y.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}}}),y.prototype.requestTileGeometry=function(t,n,o,a){var s=this._tilingScheme.getNumberOfYTilesAtLevel(o),l=this._url+o+"/"+t+"/"+(s-n-1)+".tif?cesium=true",h=this._proxy;i(h)&&(l=h.getURL(l));var p;if(a=r(a,!0)){if(p=g(l,d),!i(p))return}else p=d(l);var f=this;return e(p,function(e){return new c({buffer:u(e),width:f._heightmapWidth,height:f._heightmapHeight,childTileMask:b(f,t,n,o),structure:f._terrainDataStructure})})},y.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var w=new f;return y.prototype.getTileDataAvailable=function(e,t,r){},y}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){return i.equalsEpsilon(e.latitude,t.latitude,i.EPSILON14)&&i.equalsEpsilon(e.longitude,t.longitude,i.EPSILON14)}function l(r,i,n,o){var a=i.length;if(!(a<2)){var l=t(o),u=t(n),h=!0,p=new Array(a),f=new Array(a),m=new Array(a),g=i[0];p[0]=g;var v=r.cartesianToCartographic(g,c);u&&(v.height=n[0]),h=h&&v.height<=0,f[0]=v.height,l?m[0]=o[0]:m[0]=0;for(var _=1,y=1;y<a;++y){var b=i[y],C=r.cartesianToCartographic(b,d);u&&(C.height=n[y]),h=h&&C.height<=0,s(v,C)?v.height<C.height&&(f[_-1]=C.height):(p[_]=b,f[_]=C.height,l?m[_]=o[y]:m[_]=0,e.clone(C,v),++_)}if(!(h||_<2))return p.length=_,f.length=_,m.length=_,{positions:p,topHeights:f,bottomHeights:m}}}var u={},c=new e,d=new e,h=new Array(2),p=new Array(2),f={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return u.computePositions=function(e,s,u,c,d,m){var g=l(e,s,u,c);if(t(g)){if(s=g.positions,u=g.topHeights,c=g.bottomHeights,s.length>=3){var v=r.fromPoints(s,e),_=v.projectPointsOntoPlane(s);n.computeWindingOrder2D(_)===a.CLOCKWISE&&(s.reverse(),u.reverse(),c.reverse())}var y,b,C=s.length,w=C-2,S=i.chordLength(d,e.maximumRadius),E=f;if(E.minDistance=S,E.ellipsoid=e,m){var T,x=0;for(T=0;T<C-1;T++)x+=o.numberOfPoints(s[T],s[T+1],S)+1;y=new Float64Array(3*x),b=new Float64Array(3*x);var P=h,A=p;E.positions=P,E.height=A;var D=0;for(T=0;T<C-1;T++){P[0]=s[T],P[1]=s[T+1],A[0]=u[T],A[1]=u[T+1];var I=o.generateArc(E);y.set(I,D),A[0]=c[T],A[1]=c[T+1],b.set(o.generateArc(E),D),D+=I.length}}else E.positions=s,E.height=u,y=new Float64Array(o.generateArc(E)),E.height=c,b=new Float64Array(o.generateArc(E));return{bottomPositions:b,topPositions:y,numCorners:w}}},u}),define("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e=i(e,i.EMPTY_OBJECT);var r=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=i(e.vertexFormat,p.DEFAULT),u=i(e.granularity,d.RADIANS_PER_DEGREE),c=i(e.ellipsoid,a.WGS84);this._positions=r,this._minimumHeights=s,this._maximumHeights=o,this._vertexFormat=p.clone(l),this._granularity=u,this._ellipsoid=a.clone(c),this._workerName="createWallGeometry";var h=1+r.length*t.packedLength+2;n(s)&&(h+=s.length),n(o)&&(h+=o.length),this.packedLength=h+a.packedLength+p.packedLength+1}var g=new t,v=new t,_=new t,y=new t,b=new t,C=new t,w=new t,S=new t;m.pack=function(e,r,o){o=i(o,0);var s,l=e._positions,u=l.length;for(r[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],r,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,r[o++]=u,n(c))for(s=0;s<u;++s)r[o++]=c[s];var d=e._maximumHeights;if(u=n(d)?d.length:0,r[o++]=u,n(d))for(s=0;s<u;++s)r[o++]=d[s];return a.pack(e._ellipsoid,r,o),o+=a.packedLength,p.pack(e._vertexFormat,r,o),o+=p.packedLength,r[o]=e._granularity,r};var E=a.clone(a.UNIT_SPHERE),T=new p,x={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:E,vertexFormat:T,granularity:void 0};return m.unpack=function(e,r,o){r=i(r,0);var s,l=e[r++],u=new Array(l);for(s=0;s<l;++s,r+=t.packedLength)u[s]=t.unpack(e,r);l=e[r++];var c;if(l>0)for(c=new Array(l),s=0;s<l;++s)c[s]=e[r++];l=e[r++];var d;if(l>0)for(d=new Array(l),s=0;s<l;++s)d[s]=e[r++];var h=a.unpack(e,r,E);r+=a.packedLength;var f=p.unpack(e,r,T);r+=p.packedLength;var g=e[r];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=d,o._ellipsoid=a.clone(h,o._ellipsoid),o._vertexFormat=p.clone(f,o._vertexFormat),o._granularity=g,o):(x.positions=u,x.minimumHeights=c,x.maximumHeights=d,x.granularity=g,new m(x))},m.fromConstantHeights=function(e){e=i(e,i.EMPTY_OBJECT);var t,r,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,r=u?new Array(c):void 0;for(var d=0;d<c;++d)l&&(t[d]=a),u&&(r[d]=s)}var h={positions:o,maximumHeights:r,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new m(h)},m.createGeometry=function(i){var o=i._positions,a=i._minimumHeights,p=i._maximumHeights,m=i._vertexFormat,E=i._granularity,T=i._ellipsoid,x=f.computePositions(T,o,p,a,E,!0);if(n(x)){var P=x.bottomPositions,A=x.topPositions,D=x.numCorners,I=A.length,M=2*I,O=m.position?new Float64Array(M):void 0,R=m.normal?new Float32Array(M):void 0,N=m.tangent?new Float32Array(M):void 0,k=m.bitangent?new Float32Array(M):void 0,L=m.st?new Float32Array(M/3*2):void 0,F=0,B=0,U=0,V=0,z=0,G=S,H=w,W=C,j=!0;I/=3;var q,Y=0,X=1/(I-o.length+1);for(q=0;q<I;++q){var Q=3*q,Z=t.fromArray(A,Q,g),K=t.fromArray(P,Q,v);if(m.position&&(O[F++]=K.x,O[F++]=K.y,O[F++]=K.z,O[F++]=Z.x,O[F++]=Z.y,O[F++]=Z.z),m.st&&(L[z++]=Y,L[z++]=0,L[z++]=Y,L[z++]=1),m.normal||m.tangent||m.bitangent){var J,$=t.clone(t.ZERO,b),ee=T.scaleToGeodeticSurface(t.fromArray(A,Q,v),v);if(q+1<I&&(J=T.scaleToGeodeticSurface(t.fromArray(A,Q+3,_),_),$=t.fromArray(A,Q+3,b)),j){var te=t.subtract($,Z,y),re=t.subtract(ee,Z,g);G=t.normalize(t.cross(re,te,G),G),j=!1}t.equalsEpsilon(J,ee,d.EPSILON10)?j=!0:(Y+=X,m.tangent&&(H=t.normalize(t.subtract(J,ee,H),H)),m.bitangent&&(W=t.normalize(t.cross(G,H,W),W))),m.normal&&(R[B++]=G.x,R[B++]=G.y,R[B++]=G.z,R[B++]=G.x,R[B++]=G.y,R[B++]=G.z),m.tangent&&(N[V++]=H.x,N[V++]=H.y,N[V++]=H.z,N[V++]=H.x,N[V++]=H.y,N[V++]=H.z),m.bitangent&&(k[U++]=W.x,k[U++]=W.y,k[U++]=W.z,k[U++]=W.x,k[U++]=W.y,k[U++]=W.z)}}var ie=new u;m.position&&(ie.position=new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:O})),m.normal&&(ie.normal=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:R})),m.tangent&&(ie.tangent=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:N})),m.bitangent&&(ie.bitangent=new l({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:k})),m.st&&(ie.st=new l({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:L}));var ne=M/3;M-=6*(D+1);var oe=c.createTypedArray(ne,M),ae=0;for(q=0;q<ne-2;q+=2){var se=q,le=q+2,ue=t.fromArray(O,3*se,g),ce=t.fromArray(O,3*le,v);if(!t.equalsEpsilon(ue,ce,d.EPSILON10)){var de=q+1,he=q+3;oe[ae++]=de,oe[ae++]=se,oe[ae++]=he,oe[ae++]=he,oe[ae++]=se,oe[ae++]=le}}return new s({attributes:ie,indices:oe,primitiveType:h.TRIANGLES,boundingSphere:new e.fromVertices(O)})}},m}),define("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e){e=i(e,i.EMPTY_OBJECT);var r=e.positions,o=e.maximumHeights,s=e.minimumHeights,l=i(e.granularity,d.RADIANS_PER_DEGREE),u=i(e.ellipsoid,a.WGS84);this._positions=r,this._minimumHeights=s,this._maximumHeights=o,this._granularity=l,this._ellipsoid=a.clone(u),this._workerName="createWallOutlineGeometry";var c=1+r.length*t.packedLength+2;n(s)&&(c+=s.length),n(o)&&(c+=o.length),this.packedLength=c+a.packedLength+1}var m=new t,g=new t;f.pack=function(e,r,o){o=i(o,0);var s,l=e._positions,u=l.length;for(r[o++]=u,s=0;s<u;++s,o+=t.packedLength)t.pack(l[s],r,o);var c=e._minimumHeights;if(u=n(c)?c.length:0,r[o++]=u,n(c))for(s=0;s<u;++s)r[o++]=c[s];var d=e._maximumHeights;if(u=n(d)?d.length:0,r[o++]=u,n(d))for(s=0;s<u;++s)r[o++]=d[s];return a.pack(e._ellipsoid,r,o),o+=a.packedLength,r[o]=e._granularity,r};var v=a.clone(a.UNIT_SPHERE),_={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:v,granularity:void 0};return f.unpack=function(e,r,o){r=i(r,0);var s,l=e[r++],u=new Array(l);for(s=0;s<l;++s,r+=t.packedLength)u[s]=t.unpack(e,r);l=e[r++];var c;if(l>0)for(c=new Array(l),s=0;s<l;++s)c[s]=e[r++];l=e[r++];var d;if(l>0)for(d=new Array(l),s=0;s<l;++s)d[s]=e[r++];var h=a.unpack(e,r,v);r+=a.packedLength;var p=e[r];return n(o)?(o._positions=u,o._minimumHeights=c,o._maximumHeights=d,o._ellipsoid=a.clone(h,o._ellipsoid),o._granularity=p,o):(_.positions=u,_.minimumHeights=c,_.maximumHeights=d,_.granularity=p,new f(_))},f.fromConstantHeights=function(e){e=i(e,i.EMPTY_OBJECT);var t,r,o=e.positions,a=e.minimumHeight,s=e.maximumHeight,l=n(a),u=n(s);if(l||u){var c=o.length;t=l?new Array(c):void 0,r=u?new Array(c):void 0;for(var d=0;d<c;++d)l&&(t[d]=a),u&&(r[d]=s)}var h={positions:o,maximumHeights:r,minimumHeights:t,ellipsoid:e.ellipsoid};return new f(h)},f.createGeometry=function(i){var o=i._positions,a=i._minimumHeights,f=i._maximumHeights,v=i._granularity,_=i._ellipsoid,y=p.computePositions(_,o,f,a,v,!1);if(n(y)){var b=y.bottomPositions,C=y.topPositions,w=C.length,S=2*w,E=new Float64Array(S),T=0;w/=3;var x;for(x=0;x<w;++x){var P=3*x,A=t.fromArray(C,P,m),D=t.fromArray(b,P,g);E[T++]=D.x,E[T++]=D.y,E[T++]=D.z,E[T++]=A.x,E[T++]=A.y,E[T++]=A.z}var I=new u({position:new l({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:E})}),M=S/3;S=2*M-4+M;var O=c.createTypedArray(M,S),R=0;for(x=0;x<M-2;x+=2){var N=x,k=x+2,L=t.fromArray(E,3*N,m),F=t.fromArray(E,3*k,g);if(!t.equalsEpsilon(L,F,d.EPSILON10)){var B=x+1,U=x+3;O[R++]=B,O[R++]=N,O[R++]=B,O[R++]=U,O[R++]=N,O[R++]=k}}return O[R++]=M-2,O[R++]=M-1,new s({attributes:I,indices:O,primitiveType:h.LINES,boundingSphere:new e.fromVertices(E)})}},f}),define("Core/WebMercatorTilingScheme",["./Cartesian2","./defaultValue","./defined","./defineProperties","./Ellipsoid","./Rectangle","./WebMercatorProjection"],function(e,t,r,i,n,o,a){"use strict";function s(i){if(i=t(i,{}),this._ellipsoid=t(i.ellipsoid,n.WGS84),this._numberOfLevelZeroTilesX=t(i.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=t(i.numberOfLevelZeroTilesY,1),this._projection=new a(this._ellipsoid),r(i.rectangleSouthwestInMeters)&&r(i.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=i.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=i.rectangleNortheastInMeters;else{var s=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new e(-s,-s),this._rectangleNortheastInMeters=new e(s,s)}var l=this._projection.unproject(this._rectangleSouthwestInMeters),u=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new o(l.longitude,l.latitude,u.longitude,u.latitude)}return i(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),s.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e},s.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e},s.prototype.rectangleToNativeRectangle=function(e,t){var i=this._projection,n=i.project(o.southwest(e)),a=i.project(o.northeast(e));return r(t)?(t.west=n.x,t.south=n.y,t.east=a.x,t.north=a.y,t):new o(n.x,n.y,a.x,a.y)},s.prototype.tileXYToNativeRectangle=function(e,t,i,n){var a=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),l=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/a,u=this._rectangleSouthwestInMeters.x+e*l,c=this._rectangleSouthwestInMeters.x+(e+1)*l,d=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,h=this._rectangleNortheastInMeters.y-t*d,p=this._rectangleNortheastInMeters.y-(t+1)*d;return r(n)?(n.west=u,n.south=p,n.east=c,n.north=h,n):new o(u,p,c,h)},s.prototype.tileXYToRectangle=function(t,r,i,n){var o=this.tileXYToNativeRectangle(t,r,i,n),a=this._projection,s=a.unproject(new e(o.west,o.south)),l=a.unproject(new e(o.east,o.north)); +return o.west=s.longitude,o.south=s.latitude,o.east=l.longitude,o.north=l.latitude,o},s.prototype.positionToTileXY=function(t,i,n){var a=this._rectangle;if(o.contains(a,t)){var s=this.getNumberOfXTilesAtLevel(i),l=this.getNumberOfYTilesAtLevel(i),u=this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x,c=u/s,d=this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y,h=d/l,p=this._projection,f=p.project(t),m=f.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-f.y,v=m/c|0;v>=s&&(v=s-1);var _=g/h|0;return _>=l&&(_=l-1),r(n)?(n.x=v,n.y=_,n):new e(v,_)}},s}),define("Core/wrapFunction",["./DeveloperError"],function(e){"use strict";function t(e,t,r){return function(){r.apply(e,arguments),t.apply(e,arguments)}}return t}),define("DataSources/ConstantProperty",["../Core/defined","../Core/defineProperties","../Core/Event"],function(e,t,r){"use strict";function i(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new r,this.setValue(e)}return t(i.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}}),i.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value},i.prototype.setValue=function(t){var r=this._value;if(r!==t){var i=e(t),n=i&&"function"==typeof t.clone,o=i&&"function"==typeof t.equals,a=!o||!t.equals(r);a&&(this._hasClone=n,this._hasEquals=o,this._value=n?t.clone(this._value):t,this._definitionChanged.raiseEvent(this))}},i.prototype.equals=function(e){return this===e||e instanceof i&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))},i.prototype.valueOf=function(){return this._value},i.prototype.toString=function(){return String(this._value)},i}),define("DataSources/createPropertyDescriptor",["../Core/defaultValue","../Core/defined","./ConstantProperty"],function(e,t,r){"use strict";function i(e,r,i,n,o){return{configurable:n,get:function(){return this[r]},set:function(n){var a=this[r],s=this[i];t(s)&&(s(),this[i]=void 0);var l=void 0!==n;!l||t(n)&&t(n.getValue)||!t(o)||(n=o(n)),a!==n&&(this[r]=n,this._definitionChanged.raiseEvent(this,e,n,a)),t(n)&&t(n.definitionChanged)&&(this[i]=n.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,n,n)},this))}}}function n(e){return new r(e)}function o(t,r,o){return i(t,"_"+t.toString(),"_"+t.toString()+"Subscription",e(r,!1),e(o,n))}return o}),define("DataSources/BillboardGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";function a(t){this._image=void 0,this._imageSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},image:o("image"),imageSubRegion:o("imageSubRegion"),scale:o("scale"),rotation:o("rotation"),alignedAxis:o("alignedAxis"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),color:o("color"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),show:o("show"),width:o("width"),height:o("height"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),sizeInMeters:o("sizeInMeters"),distanceDisplayCondition:o("distanceDisplayCondition"),disableDepthTestDistance:o("disableDepthTestDistance")}),a.prototype.clone=function(e){return t(e)?(e.color=this._color,e.eyeOffset=this._eyeOffset,e.heightReference=this._heightReference,e.horizontalOrigin=this._horizontalOrigin,e.image=this._image,e.imageSubRegion=this._imageSubRegion,e.pixelOffset=this._pixelOffset,e.scale=this._scale,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.show=this._show,e.verticalOrigin=this._verticalOrigin,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.sizeInMeters=this._sizeInMeters,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e):new a(this)},a.prototype.merge=function(t){this.color=e(this._color,t.color),this.eyeOffset=e(this._eyeOffset,t.eyeOffset),this.heightReference=e(this._heightReference,t.heightReference),this.horizontalOrigin=e(this._horizontalOrigin,t.horizontalOrigin),this.image=e(this._image,t.image),this.imageSubRegion=e(this._imageSubRegion,t.imageSubRegion),this.pixelOffset=e(this._pixelOffset,t.pixelOffset),this.scale=e(this._scale,t.scale),this.rotation=e(this._rotation,t.rotation),this.alignedAxis=e(this._alignedAxis,t.alignedAxis),this.show=e(this._show,t.show),this.verticalOrigin=e(this._verticalOrigin,t.verticalOrigin),this.width=e(this._width,t.width),this.height=e(this._height,t.height),this.scaleByDistance=e(this._scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this._pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.sizeInMeters=e(this._sizeInMeters,t.sizeInMeters),this.distanceDisplayCondition=e(this._distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=e(this._disableDepthTestDistance,t.disableDepthTestDistance)},a}),define("Scene/HeightReference",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2};return e(t)}),define("Scene/HorizontalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,LEFT:1,RIGHT:-1};return e(t)}),define("Scene/VerticalOrigin",["../Core/freezeObject"],function(e){"use strict";var t={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};return e(t)}),define("DataSources/BoundingSphereState",["../Core/freezeObject"],function(e){"use strict";var t={DONE:0,PENDING:1,FAILED:2};return e(t)}),define("DataSources/Property",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,r,i){"use strict";function n(){i.throwInstantiationError()}return r(n.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError}}),n.prototype.getValue=i.throwInstantiationError,n.prototype.equals=i.throwInstantiationError,n.equals=function(e,r){return e===r||t(e)&&e.equals(r)},n.arrayEquals=function(e,r){if(e===r)return!0;if(!t(e)||!t(r)||e.length!==r.length)return!1;for(var i=e.length,o=0;o<i;o++)if(!n.equals(e[o],r[o]))return!1;return!0},n.isConstant=function(e){return!t(e)||e.isConstant},n.getValueOrUndefined=function(e,r,i){return t(e)?e.getValue(r,i):void 0},n.getValueOrDefault=function(r,i,n,o){return t(r)?e(r.getValue(i,o),n):n},n.getValueOrClonedDefault=function(e,r,i,n){var o;return t(e)&&(o=e.getValue(r,n)),t(o)||(o=i.clone(o)),o},n}),define("DataSources/BillboardVisualizer",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function g(t,r){r.collectionChanged.addEventListener(g.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}function v(e,t,r){o(e)&&(e.billboard=void 0,r.removeBillboard(t))}var _=n.WHITE,y=i.ZERO,b=c.NONE,C=r.ZERO,w=1,S=0,E=i.ZERO,T=d.CENTER,x=h.CENTER,P=!1,A=0,D=new i,I=new n,M=new i,O=new r,R=new u,N=new u,k=new u,L=new t,F=new l;return g.prototype.update=function(e){for(var t=this._items.values,r=this._cluster,i=0,n=t.length;i<n;i++){var a,s=t[i],l=s.entity,u=l._billboard,c=s.billboard,d=l.isShowing&&l.isAvailable(e)&&f.getValueOrDefault(u._show,e,!0);if(d&&(D=f.getValueOrUndefined(l._position,e,D),a=f.getValueOrUndefined(u._image,e),d=o(D)&&o(a)),d){f.isConstant(l._position)||(r._clusterDirty=!0),o(c)||(c=r.getBillboard(l),c.id=l,c.image=void 0,s.billboard=c),c.show=d,o(c.image)&&s.textureValue===a||(c.image=a,s.textureValue=a),c.position=D,c.color=f.getValueOrDefault(u._color,e,_,I),c.eyeOffset=f.getValueOrDefault(u._eyeOffset,e,y,M),c.heightReference=f.getValueOrDefault(u._heightReference,e,b),c.pixelOffset=f.getValueOrDefault(u._pixelOffset,e,C,O),c.scale=f.getValueOrDefault(u._scale,e,w),c.rotation=f.getValueOrDefault(u._rotation,e,S),c.alignedAxis=f.getValueOrDefault(u._alignedAxis,e,E),c.horizontalOrigin=f.getValueOrDefault(u._horizontalOrigin,e,T),c.verticalOrigin=f.getValueOrDefault(u._verticalOrigin,e,x),c.width=f.getValueOrUndefined(u._width,e),c.height=f.getValueOrUndefined(u._height,e),c.scaleByDistance=f.getValueOrUndefined(u._scaleByDistance,e,R),c.translucencyByDistance=f.getValueOrUndefined(u._translucencyByDistance,e,N),c.pixelOffsetScaleByDistance=f.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,k),c.sizeInMeters=f.getValueOrDefault(u._sizeInMeters,e,P),c.distanceDisplayCondition=f.getValueOrUndefined(u._distanceDisplayCondition,e,F),c.disableDepthTestDistance=f.getValueOrDefault(u._disableDepthTestDistance,e,A);var h=f.getValueOrUndefined(u._imageSubRegion,e,L);o(h)&&c.setImageSubRegion(c._imageId,h)}else v(s,l,r)}return!0},g.prototype.getBoundingSphere=function(e,t){var r=this._items.get(e.id);if(!o(r)||!o(r.billboard))return p.FAILED;var n=r.billboard;if(n.heightReference===c.NONE)t.center=i.clone(n.position,t.center);else{if(!o(n._clampedPosition))return p.PENDING;t.center=i.clone(n._clampedPosition,t.center)}return t.radius=0,p.DONE},g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(g.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return a(this)},g.prototype._onCollectionChanged=function(e,t,r,i){var n,a,s=this._items,l=this._cluster;for(n=t.length-1;n>-1;n--)a=t[n],o(a._billboard)&&o(a._position)&&s.set(a.id,new m(a));for(n=i.length-1;n>-1;n--)a=i[n],o(a._billboard)&&o(a._position)?s.contains(a.id)||s.set(a.id,new m(a)):(v(s.get(a.id),a,l),s.remove(a.id));for(n=r.length-1;n>-1;n--)a=r[n],v(s.get(a.id),a,l),s.remove(a.id)},g}),define("Shaders/Appearances/AllMaterialAppearanceFS",[],function(){"use strict";return"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);\n#endif\n}\n"}),define("Shaders/Appearances/AllMaterialAppearanceVS",[],function(){"use strict";return"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"}),define("Shaders/Appearances/BasicMaterialAppearanceFS",[],function(){"use strict";return"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);\n#endif\n}\n"}),define("Shaders/Appearances/BasicMaterialAppearanceVS",[],function(){"use strict";return"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"}),define("Shaders/Appearances/TexturedMaterialAppearanceFS",[],function(){"use strict";return"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);\n#endif\n}\n"}),define("Shaders/Appearances/TexturedMaterialAppearanceVS",[],function(){"use strict";return"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"}),define("Scene/BlendEquation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={ADD:t.FUNC_ADD,SUBTRACT:t.FUNC_SUBTRACT,REVERSE_SUBTRACT:t.FUNC_REVERSE_SUBTRACT};return e(r)}),define("Scene/BlendFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={ZERO:t.ZERO,ONE:t.ONE,SOURCE_COLOR:t.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:t.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:t.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:t.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:t.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:t.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:t.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:t.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:t.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:t.ONE_MINUS_CONSTANT_ALPHA,CONSTANT_ALPHA:t.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:t.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:t.SRC_ALPHA_SATURATE};return e(r)}),define("Scene/BlendingState",["../Core/freezeObject","./BlendEquation","./BlendFunction"],function(e,t,r){"use strict";var i={DISABLED:e({enabled:!1}),ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.SOURCE_ALPHA,functionSourceAlpha:r.SOURCE_ALPHA,functionDestinationRgb:r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:r.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.ONE,functionSourceAlpha:r.ONE,functionDestinationRgb:r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:r.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:e({enabled:!0,equationRgb:t.ADD,equationAlpha:t.ADD,functionSourceRgb:r.SOURCE_ALPHA,functionSourceAlpha:r.SOURCE_ALPHA,functionDestinationRgb:r.ONE,functionDestinationAlpha:r.ONE})};return e(i)}),define("Scene/CullFace",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={FRONT:t.FRONT,BACK:t.BACK,FRONT_AND_BACK:t.FRONT_AND_BACK};return e(r)}),define("Scene/Appearance",["../Core/clone","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","./BlendingState","./CullFace"],function(e,t,r,i,n,o,a){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this.material=e.material,this.translucent=r(e.translucent,!0),this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=r(e.closed,!1)}return n(s.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}}}),s.prototype.getFragmentShaderSource=function(){var e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),i(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join("\n")},s.prototype.isTranslucent=function(){return i(this.material)&&this.material.isTranslucent()||!i(this.material)&&this.translucent},s.prototype.getRenderState=function(){var t=this.isTranslucent(),r=e(this.renderState,!1);return t?(r.depthMask=!1,r.blending=o.ALPHA_BLEND):r.depthMask=!0,r},s.getDefaultRenderState=function(e,r,n){var s={depthTest:{enabled:!0}};return e&&(s.depthMask=!1,s.blending=o.ALPHA_BLEND),r&&(s.cull={enabled:!0,face:a.BACK}),i(n)&&(s=t(n,s,!0)),s},s}),define("Renderer/ContextLimits",["../Core/defineProperties"],function(e){"use strict";var t={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_highpFloatSupported:!1,_highpIntSupported:!1};return e(t,{maximumCombinedTextureImageUnits:{get:function(){return t._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return t._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return t._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return t._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return t._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return t._maximumTextureSize}},maximumVaryingVectors:{get:function(){return t._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return t._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return t._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return t._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return t._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return t._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return t._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return t._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return t._maximumViewportWidth}},maximumViewportHeight:{get:function(){return t._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return t._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return t._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return t._maximumColorAttachments}},highpFloatSupported:{get:function(){return t._highpFloatSupported}},highpIntSupported:{get:function(){return t._highpIntSupported}}}),t}),define("Renderer/CubeMapFace",["../Core/defaultValue","../Core/defineProperties","../Core/DeveloperError","./PixelDatatype"],function(e,t,r,i){"use strict";function n(e,t,r,i,n,o,a,s,l){this._gl=e,this._texture=t,this._textureTarget=r,this._targetFace=i,this._pixelFormat=n,this._pixelDatatype=o,this._size=a,this._preMultiplyAlpha=s,this._flipY=l}return t(n.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}}),n.prototype.copyFrom=function(t,r,i){r=e(r,0),i=e(i,0);var n=this._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),t.arrayBufferView?n.texSubImage2D(this._targetFace,0,r,i,t.width,t.height,this._pixelFormat,this._pixelDatatype,t.arrayBufferView):n.texSubImage2D(this._targetFace,0,r,i,this._pixelFormat,this._pixelDatatype,t),n.bindTexture(o,null)},n.prototype.copyFromFramebuffer=function(t,r,i,n,o,a){t=e(t,0),r=e(r,0),i=e(i,0),n=e(n,0),o=e(o,this._size),a=e(a,this._size);var s=this._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(this._targetFace,0,t,r,i,n,o,a),s.bindTexture(l,null)},n}),define("Renderer/MipmapHint",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={DONT_CARE:t.DONT_CARE,FASTEST:t.FASTEST,NICEST:t.NICEST,validate:function(e){return e===r.DONT_CARE||e===r.FASTEST||e===r.NICEST}};return e(r)}),define("Renderer/TextureMagnificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={NEAREST:t.NEAREST,LINEAR:t.LINEAR,validate:function(e){return e===r.NEAREST||e===r.LINEAR}};return e(r)}),define("Renderer/TextureMinificationFilter",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={NEAREST:t.NEAREST,LINEAR:t.LINEAR,NEAREST_MIPMAP_NEAREST:t.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:t.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:t.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:t.LINEAR_MIPMAP_LINEAR,validate:function(e){return e===r.NEAREST||e===r.LINEAR||e===r.NEAREST_MIPMAP_NEAREST||e===r.LINEAR_MIPMAP_NEAREST||e===r.NEAREST_MIPMAP_LINEAR||e===r.LINEAR_MIPMAP_LINEAR}};return e(r)}),define("Renderer/TextureWrap",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={CLAMP_TO_EDGE:t.CLAMP_TO_EDGE,REPEAT:t.REPEAT,MIRRORED_REPEAT:t.MIRRORED_REPEAT,validate:function(e){return e===r.CLAMP_TO_EDGE||e===r.REPEAT||e===r.MIRRORED_REPEAT}};return e(r)}),define("Renderer/Sampler",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./TextureMagnificationFilter","./TextureMinificationFilter","./TextureWrap"],function(e,t,r,i,n,o,a){"use strict";function s(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.wrapS,a.CLAMP_TO_EDGE),s=e(r.wrapT,a.CLAMP_TO_EDGE),l=e(r.minificationFilter,o.LINEAR),u=e(r.magnificationFilter,n.LINEAR),c=t(r.maximumAnisotropy)?r.maximumAnisotropy:1;this._wrapS=i,this._wrapT=s,this._minificationFilter=l,this._magnificationFilter=u,this._maximumAnisotropy=c}return r(s.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}}),s}),define("Renderer/CubeMap",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","./ContextLimits","./CubeMapFace","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(r){function i(e,t){t.arrayBufferView?y.texImage2D(e,0,f,p,p,0,f,m,t.arrayBufferView):y.texImage2D(e,0,f,f,m,t)}r=e(r,e.EMPTY_OBJECT);var n,o,s=r.context,u=r.source;if(t(u)){var h=[u.positiveX,u.negativeX,u.positiveY,u.negativeY,u.positiveZ,u.negativeZ];n=h[0].width,o=h[0].height}else n=r.width,o=r.height;var p=n,f=e(r.pixelFormat,a.RGBA),m=e(r.pixelDatatype,c.UNSIGNED_BYTE),g=6*a.textureSizeInBytes(f,m,p,p),v=r.preMultiplyAlpha||f===a.RGB||f===a.LUMINANCE,_=e(r.flipY,!0),y=s._gl,b=y.TEXTURE_CUBE_MAP,C=y.createTexture();y.activeTexture(y.TEXTURE0),y.bindTexture(b,C),t(u)?(y.pixelStorei(y.UNPACK_PREMULTIPLY_ALPHA_WEBGL,v),y.pixelStorei(y.UNPACK_FLIP_Y_WEBGL,_),i(y.TEXTURE_CUBE_MAP_POSITIVE_X,u.positiveX),i(y.TEXTURE_CUBE_MAP_NEGATIVE_X,u.negativeX),i(y.TEXTURE_CUBE_MAP_POSITIVE_Y,u.positiveY),i(y.TEXTURE_CUBE_MAP_NEGATIVE_Y,u.negativeY),i(y.TEXTURE_CUBE_MAP_POSITIVE_Z,u.positiveZ),i(y.TEXTURE_CUBE_MAP_NEGATIVE_Z,u.negativeZ)):(y.texImage2D(y.TEXTURE_CUBE_MAP_POSITIVE_X,0,f,p,p,0,f,m,null),y.texImage2D(y.TEXTURE_CUBE_MAP_NEGATIVE_X,0,f,p,p,0,f,m,null),y.texImage2D(y.TEXTURE_CUBE_MAP_POSITIVE_Y,0,f,p,p,0,f,m,null),y.texImage2D(y.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,f,p,p,0,f,m,null),y.texImage2D(y.TEXTURE_CUBE_MAP_POSITIVE_Z,0,f,p,p,0,f,m,null),y.texImage2D(y.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,f,p,p,0,f,m,null)),y.bindTexture(b,null),this._gl=y,this._textureFilterAnisotropic=s._textureFilterAnisotropic,this._textureTarget=b,this._texture=C,this._pixelFormat=f,this._pixelDatatype=m,this._size=p,this._hasMipmap=!1,this._sizeInBytes=g,this._preMultiplyAlpha=v,this._flipY=_,this._sampler=void 0,this._positiveX=new l(y,C,b,y.TEXTURE_CUBE_MAP_POSITIVE_X,f,m,p,v,_),this._negativeX=new l(y,C,b,y.TEXTURE_CUBE_MAP_NEGATIVE_X,f,m,p,v,_),this._positiveY=new l(y,C,b,y.TEXTURE_CUBE_MAP_POSITIVE_Y,f,m,p,v,_),this._negativeY=new l(y,C,b,y.TEXTURE_CUBE_MAP_NEGATIVE_Y,f,m,p,v,_),this._positiveZ=new l(y,C,b,y.TEXTURE_CUBE_MAP_POSITIVE_Z,f,m,p,v,_),this._negativeZ=new l(y,C,b,y.TEXTURE_CUBE_MAP_NEGATIVE_Z,f,m,p,v,_),this.sampler=t(r.sampler)?r.sampler:new d}return r(f.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){var r=e.minificationFilter,i=e.magnificationFilter,n=r===p.NEAREST_MIPMAP_NEAREST||r===p.NEAREST_MIPMAP_LINEAR||r===p.LINEAR_MIPMAP_NEAREST||r===p.LINEAR_MIPMAP_LINEAR;this._pixelDatatype===c.FLOAT&&(r=n?p.NEAREST_MIPMAP_NEAREST:p.NEAREST,i=h.NEAREST);var o=this._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,r),o.texParameteri(a,o.TEXTURE_MAG_FILTER,i),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),t(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}}),f.prototype.generateMipmap=function(t){t=e(t,u.DONT_CARE),this._hasMipmap=!0;var r=this._gl,i=this._textureTarget;r.hint(r.GENERATE_MIPMAP_HINT,t),r.activeTexture(r.TEXTURE0),r.bindTexture(i,this._texture),r.generateMipmap(i),r.bindTexture(i,null)},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._gl.deleteTexture(this._texture),this._positiveX=i(this._positiveX),this._negativeX=i(this._negativeX),this._positiveY=i(this._positiveY),this._negativeY=i(this._negativeY),this._positiveZ=i(this._positiveZ),this._negativeZ=i(this._negativeZ),i(this)},f}),define("Renderer/Texture",["../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/PixelFormat","../Core/WebGLConstants","./ContextLimits","./MipmapHint","./PixelDatatype","./Sampler","./TextureMagnificationFilter","./TextureMinificationFilter"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(i){i=t(i,t.EMPTY_OBJECT);var n=i.context,o=i.width,a=i.height,u=i.source;r(u)&&(r(o)||(o=t(u.videoWidth,u.width)),r(a)||(a=t(u.videoHeight,u.height)));var c=t(i.pixelFormat,s.RGBA),p=t(i.pixelDatatype,d.UNSIGNED_BYTE),f=c,m=s.isCompressedFormat(f);n.webgl2&&(c===s.DEPTH_STENCIL?f=l.DEPTH24_STENCIL8:c===s.DEPTH_COMPONENT&&(p===d.UNSIGNED_SHORT?f=l.DEPTH_COMPONENT16:p===d.UNSIGNED_INT&&(f=l.DEPTH_COMPONENT24)));var g=i.preMultiplyAlpha||c===s.RGB||c===s.LUMINANCE,v=t(i.flipY,!0),_=n._gl,y=_.TEXTURE_2D,b=_.createTexture();_.activeTexture(_.TEXTURE0),_.bindTexture(y,b),r(u)?(_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL,g),_.pixelStorei(_.UNPACK_FLIP_Y_WEBGL,v),r(u.arrayBufferView)?m?_.compressedTexImage2D(y,0,f,o,a,0,u.arrayBufferView):_.texImage2D(y,0,f,o,a,0,c,p,u.arrayBufferView):r(u.framebuffer)?(u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._bind(),_.copyTexImage2D(y,0,f,u.xOffset,u.yOffset,o,a,0),u.framebuffer!==n.defaultFramebuffer&&u.framebuffer._unBind()):_.texImage2D(y,0,f,c,p,u)):_.texImage2D(y,0,f,o,a,0,c,p,null),_.bindTexture(y,null);var C;C=m?s.compressedTextureSizeInBytes(c,o,a):s.textureSizeInBytes(c,p,o,a),this._context=n,this._textureFilterAnisotropic=n._textureFilterAnisotropic,this._textureTarget=y,this._texture=b,this._pixelFormat=c,this._pixelDatatype=p,this._width=o,this._height=a,this._dimensions=new e(o,a),this._hasMipmap=!1,this._sizeInBytes=C,this._preMultiplyAlpha=g,this._flipY=v,this._sampler=void 0,this.sampler=r(i.sampler)?i.sampler:new h}return m.fromFramebuffer=function(e){e=t(e,t.EMPTY_OBJECT);var i=e.context,n=i._gl,o=t(e.pixelFormat,s.RGB),a=t(e.framebufferXOffset,0),l=t(e.framebufferYOffset,0),u=t(e.width,n.drawingBufferWidth),c=t(e.height,n.drawingBufferHeight),d=e.framebuffer,h=new m({context:i,width:u,height:c,pixelFormat:o,source:{framebuffer:r(d)?d:i.defaultFramebuffer,xOffset:a,yOffset:l,width:u,height:c}});return h},i(m.prototype,{sampler:{get:function(){return this._sampler},set:function(e){var t=e.minificationFilter,i=e.magnificationFilter,n=t===f.NEAREST_MIPMAP_NEAREST||t===f.NEAREST_MIPMAP_LINEAR||t===f.LINEAR_MIPMAP_NEAREST||t===f.LINEAR_MIPMAP_LINEAR; +this._pixelDatatype===d.FLOAT&&(t=n?f.NEAREST_MIPMAP_NEAREST:f.NEAREST,i=p.NEAREST);var o=this._context._gl,a=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(a,this._texture),o.texParameteri(a,o.TEXTURE_MIN_FILTER,t),o.texParameteri(a,o.TEXTURE_MAG_FILTER,i),o.texParameteri(a,o.TEXTURE_WRAP_S,e.wrapS),o.texParameteri(a,o.TEXTURE_WRAP_T,e.wrapT),r(this._textureFilterAnisotropic)&&o.texParameteri(a,this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,e.maximumAnisotropy),o.bindTexture(a,null),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(4*this._sizeInBytes/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}}),m.prototype.copyFrom=function(e,r,i){r=t(r,0),i=t(i,0);var n=this._context._gl,o=this._textureTarget;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._preMultiplyAlpha),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this._flipY),n.activeTexture(n.TEXTURE0),n.bindTexture(o,this._texture),e.arrayBufferView?n.texSubImage2D(o,0,r,i,e.width,e.height,this._pixelFormat,this._pixelDatatype,e.arrayBufferView):n.texSubImage2D(o,0,r,i,this._pixelFormat,this._pixelDatatype,e),n.bindTexture(o,null)},m.prototype.copyFromFramebuffer=function(e,r,i,n,o,a){e=t(e,0),r=t(r,0),i=t(i,0),n=t(n,0),o=t(o,this._width),a=t(a,this._height);var s=this._context._gl,l=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(l,this._texture),s.copyTexSubImage2D(l,0,e,r,i,n,o,a),s.bindTexture(l,null)},m.prototype.generateMipmap=function(e){e=t(e,c.DONT_CARE),this._hasMipmap=!0;var r=this._context._gl,i=this._textureTarget;r.hint(r.GENERATE_MIPMAP_HINT,e),r.activeTexture(r.TEXTURE0),r.bindTexture(i,this._texture),r.generateMipmap(i),r.bindTexture(i,null)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),n(this)},m}),define("Shaders/Materials/BumpMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n"}),define("Shaders/Materials/CheckerboardMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/DotMaterial",[],function(){"use strict";return"uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/FadeMaterial",[],function(){"use strict";return"uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/GridMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nuniform vec2 lineOffset;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s - lineOffset.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t - lineOffset.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = (lineThickness * czm_resolutionScale) - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n"}),define("Shaders/Materials/NormalMapMaterial",[],function(){"use strict";return"uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineArrowMaterial",[],function(){"use strict";return"#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\n#ifdef GL_OES_standard_derivatives\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\n#else\nfloat base = 0.99;\n#endif\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineDashMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 gapColor;\nuniform float dashLength;\nuniform float dashPattern;\nvarying float v_angle;\nconst float maskLength = 16.0;\nmat2 rotate(float rad) {\nfloat c = cos(rad);\nfloat s = sin(rad);\nreturn mat2(\nc, s,\n-s, c\n);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 pos = rotate(v_angle) * gl_FragCoord.xy;\nfloat dashPosition = fract(pos.x / dashLength);\nfloat maskIndex = floor(dashPosition * maskLength);\nfloat maskTest = floor(dashPattern / pow(2.0, maskIndex));\nvec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;\nif (fragColor.a < 0.005) {\ndiscard;\n}\nmaterial.emission = fragColor.rgb;\nmaterial.alpha = fragColor.a;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineGlowMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/PolylineOutlineMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n"}),define("Shaders/Materials/RimLightingMaterial",[],function(){"use strict";return"uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n"}),define("Shaders/Materials/StripeMaterial",[],function(){"use strict";return"uniform vec4 evenColor;\nuniform vec4 oddColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(evenColor, oddColor, step(0.5, value));\nvec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"}),define("Shaders/Materials/Water",[],function(){"use strict";return"uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n"}),define("Scene/Material",["../Core/Cartesian2","../Core/clone","../Core/Color","../Core/combine","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/isArray","../Core/loadCRN","../Core/loadImage","../Core/loadKTX","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Renderer/CubeMap","../Renderer/Texture","../Shaders/Materials/BumpMapMaterial","../Shaders/Materials/CheckerboardMaterial","../Shaders/Materials/DotMaterial","../Shaders/Materials/FadeMaterial","../Shaders/Materials/GridMaterial","../Shaders/Materials/NormalMapMaterial","../Shaders/Materials/PolylineArrowMaterial","../Shaders/Materials/PolylineDashMaterial","../Shaders/Materials/PolylineGlowMaterial","../Shaders/Materials/PolylineOutlineMaterial","../Shaders/Materials/RimLightingMaterial","../Shaders/Materials/StripeMaterial","../Shaders/Materials/Water","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O){"use strict";function R(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,N(e,this),s(this,{type:{value:this.type,writable:!1}}),a(R._uniformList[this.type])||(R._uniformList[this.type]=Object.keys(this._uniforms))}function N(e,r){e=o(e,o.EMPTY_OBJECT),r._strict=o(e.strict,!1),r._count=o(e.count,0),r._template=t(o(e.fabric,o.EMPTY_OBJECT)),r._template.uniforms=t(o(r._template.uniforms,o.EMPTY_OBJECT)),r._template.materials=t(o(r._template.materials,o.EMPTY_OBJECT)),r.type=a(r._template.type)?r._template.type:n(),r.shaderSource="",r.materials={},r.uniforms={},r._uniforms={},r._translucentFunctions=[];var s,l=R._materialCache.getMaterial(r.type);if(a(l)){var u=t(l.fabric,!0);r._template=i(r._template,u,!0),s=l.translucent}B(r),a(l)||R._materialCache.addMaterial(r.type,r),U(r),G(r),j(r);var c=0===r._translucentFunctions.length||void 0;if(s=o(s,c),s=o(e.translucent,s),a(s))if("function"==typeof s){var d=function(){return s(r)};r._translucentFunctions.push(d)}else r._translucentFunctions.push(s)}function k(e,t,r,i){if(a(e))for(var n in e)if(e.hasOwnProperty(n)){var o=t.indexOf(n)!==-1;(i&&!o||!i&&o)&&r(n,t)}}function L(e,t){}function F(e,t){}function B(e){var t=e._template,r=t.uniforms,i=t.materials,n=t.components;k(t,X,L,!0),k(n,Q,L,!0);var o=[];for(var a in i)i.hasOwnProperty(a)&&o.push(a);k(r,o,F,!1)}function U(e){var t=e._template.components,r=e._template.source;if(a(r))e.shaderSource+=r+"\n";else{if(e.shaderSource+="czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n",e.shaderSource+="czm_material material = czm_getDefaultMaterial(materialInput);\n",a(t))for(var i in t)t.hasOwnProperty(i)&&(e.shaderSource+="material."+i+" = "+t[i]+";\n");e.shaderSource+="return material;\n}\n"}}function V(e){var t;return function(r,i){var n=r.uniforms,o=n[e],s=t!==o;t=o;var l,u,c=r._textures[e];if(o instanceof HTMLVideoElement)if(o.readyState>=2){if(s&&a(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!a(c)||c===i.defaultTexture)return c=new _({context:i,source:o}),void(r._textures[e]=c);c.copyFrom(o)}else a(c)||(r._textures[e]=i.defaultTexture);else{if(o instanceof _&&o!==c){r._texturePaths[e]=void 0;var f=r._textures[e];return f!==r._defaultTexture&&f.destroy(),r._textures[e]=o,l=e+"Dimensions",void(n.hasOwnProperty(l)&&(u=n[l],u.x=o._width,u.y=o._height))}if(a(c)||(r._texturePaths[e]=void 0,a(r._defaultTexture)||(r._defaultTexture=i.defaultTexture),c=r._textures[e]=r._defaultTexture,l=e+"Dimensions",n.hasOwnProperty(l)&&(u=n[l],u.x=c._width,u.y=c._height)),o!==R.DefaultImageId&&o!==r._texturePaths[e]){if("string"==typeof o){var m;m=K.test(o)?p(o):J.test(o)?d(o):h(o),O(m,function(t){r._loadedImages.push({id:e,image:t})})}else o instanceof HTMLCanvasElement&&r._loadedImages.push({id:e,image:o});r._texturePaths[e]=o}}}}function z(e){return function(t,r){var i=t.uniforms[e];if(i instanceof v){var n=t._textures[e];return n!==t._defaultTexture&&n.destroy(),t._texturePaths[e]=void 0,void(t._textures[e]=i)}if(a(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=r.defaultCubeMap),i!==R.DefaultCubeMapId){var o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){var s=[h(i.positiveX),h(i.negativeX),h(i.positiveY),h(i.negativeY),h(i.positiveZ),h(i.negativeZ)];O.all(s).then(function(r){t._loadedCubeMaps.push({id:e,images:r})}),t._texturePaths[e]=o}}}}function G(e){var t=e._template.uniforms;for(var r in t)t.hasOwnProperty(r)&&H(e,r)}function H(e,t){var r,i=(e._strict,e._template.uniforms),n=i[t],o=W(n);if("channels"===o)r=q(e,t,n,!1);else{if("sampler2D"===o){var a=t+"Dimensions";Y(e,a)>0&&(i[a]={type:"ivec3",x:1,y:1},H(e,a))}var s=new RegExp("uniform\\s+"+o+"\\s+"+t+"\\s*;");if(!s.test(e.shaderSource)){var l="uniform "+o+" "+t+";";e.shaderSource=l+e.shaderSource}var u=t+"_"+e._count++;if(r=q(e,t,u),e.uniforms[t]=n,"sampler2D"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(V(t));else if("samplerCube"===o)e._uniforms[u]=function(){return e._textures[t]},e._updateFunctions.push(z(t));else if(o.indexOf("mat")!==-1){var c=new Z[o];e._uniforms[u]=function(){return Z[o].fromColumnMajorArray(e.uniforms[t],c)}}else e._uniforms[u]=function(){return e.uniforms[t]}}}function W(e){var t=e.type;if(!a(t)){var r=typeof e;if("number"===r)t="float";else if("boolean"===r)t="bool";else if("string"===r||e instanceof HTMLCanvasElement)t=/^([rgba]){1,4}$/i.test(e)?"channels":e===R.DefaultCubeMapId?"samplerCube":"sampler2D";else if("object"===r)if(c(e))4!==e.length&&9!==e.length&&16!==e.length||(t="mat"+Math.sqrt(e.length));else{var i=0;for(var n in e)e.hasOwnProperty(n)&&(i+=1);i>=2&&i<=4?t="vec"+i:6===i&&(t="samplerCube")}}return t}function j(e){var t=e._strict,r=e._template.materials;for(var n in r)if(r.hasOwnProperty(n)){var o=new R({strict:t,fabric:r[n],count:e._count});e._count=o._count,e._uniforms=i(e._uniforms,o._uniforms,!0),e.materials[n]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);var a="czm_getMaterial",s=a+"_"+e._count++;q(o,a,s),e.shaderSource=o.shaderSource+e.shaderSource;var l=s+"(materialInput)";q(e,n,l)}}function q(e,t,r,i){i=o(i,!0);var n=0,a="([\\w])?",s="([\\w"+(i?".":"")+"])?",l=new RegExp(s+t+a,"g");return e.shaderSource=e.shaderSource.replace(l,function(e,t,i){return t||i?e:(n+=1,r)}),n}function Y(e,t,r){return q(e,t,t,r)}R._uniformList={},R.fromType=function(e,t){var r=new R({fabric:{type:e}});if(a(t))for(var i in t)t.hasOwnProperty(i)&&(r.uniforms[i]=t[i]);return r},R.prototype.isTranslucent=function(){if(a(this.translucent))return"function"==typeof this.translucent?this.translucent():this.translucent;for(var e=!0,t=this._translucentFunctions,r=t.length,i=0;i<r;++i){var n=t[i];if(e="function"==typeof n?e&&n():e&&n,!e)break}return e},R.prototype.update=function(e){var t,r,i=this._loadedImages,n=i.length;for(t=0;t<n;++t){var o=i[t];r=o.id;var s,l=o.image;s=new _(a(l.internalFormat)?{context:e,pixelFormat:l.internalFormat,width:l.width,height:l.height,source:{arrayBufferView:l.bufferView}}:{context:e,source:l}),this._textures[r]=s;var u=r+"Dimensions";if(this.uniforms.hasOwnProperty(u)){var c=this.uniforms[u];c.x=s._width,c.y=s._height}}i.length=0;var d=this._loadedCubeMaps;for(n=d.length,t=0;t<n;++t){var h=d[t];r=h.id;var p=h.images,f=new v({context:e,source:{positiveX:p[0],negativeX:p[1],positiveY:p[2],negativeY:p[3],positiveZ:p[4],negativeZ:p[5]}});this._textures[r]=f}d.length=0;var m=this._updateFunctions;for(n=m.length,t=0;t<n;++t)m[t](this,e);var g=this.materials;for(var y in g)g.hasOwnProperty(y)&&g[y].update(e)},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){var e=this._textures;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];r!==this._defaultTexture&&r.destroy()}var i=this.materials;for(var n in i)i.hasOwnProperty(n)&&i[n].destroy();return l(this)};var X=["type","materials","uniforms","components","source"],Q=["diffuse","specular","shininess","normal","emission","alpha"],Z={mat2:f,mat3:m,mat4:g},K=/\.ktx$/i,J=/\.crn$/i;return R._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}},R.DefaultImageId="czm_defaultImage",R.DefaultCubeMapId="czm_defaultCubeMap",R.ColorType="Color",R._materialCache.addMaterial(R.ColorType,{fabric:{type:R.ColorType,uniforms:{color:new r(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),R.ImageType="Image",R._materialCache.addMaterial(R.ImageType,{fabric:{type:R.ImageType,uniforms:{image:R.DefaultImageId,repeat:new e(1,1),color:new r(1,1,1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture2D(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}}),R.DiffuseMapType="DiffuseMap",R._materialCache.addMaterial(R.DiffuseMapType,{fabric:{type:R.DiffuseMapType,uniforms:{image:R.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{diffuse:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),R.AlphaMapType="AlphaMap",R._materialCache.addMaterial(R.AlphaMapType,{fabric:{type:R.AlphaMapType,uniforms:{image:R.DefaultImageId,channel:"a",repeat:new e(1,1)},components:{alpha:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!0}),R.SpecularMapType="SpecularMap",R._materialCache.addMaterial(R.SpecularMapType,{fabric:{type:R.SpecularMapType,uniforms:{image:R.DefaultImageId,channel:"r",repeat:new e(1,1)},components:{specular:"texture2D(image, fract(repeat * materialInput.st)).channel"}},translucent:!1}),R.EmissionMapType="EmissionMap",R._materialCache.addMaterial(R.EmissionMapType,{fabric:{type:R.EmissionMapType,uniforms:{image:R.DefaultImageId,channels:"rgb",repeat:new e(1,1)},components:{emission:"texture2D(image, fract(repeat * materialInput.st)).channels"}},translucent:!1}),R.BumpMapType="BumpMap",R._materialCache.addMaterial(R.BumpMapType,{fabric:{type:R.BumpMapType,uniforms:{image:R.DefaultImageId,channel:"r",strength:.8,repeat:new e(1,1)},source:y},translucent:!1}),R.NormalMapType="NormalMap",R._materialCache.addMaterial(R.NormalMapType,{fabric:{type:R.NormalMapType,uniforms:{image:R.DefaultImageId,channels:"rgb",strength:.8,repeat:new e(1,1)},source:E},translucent:!1}),R.GridType="Grid",R._materialCache.addMaterial(R.GridType,{fabric:{type:R.GridType,uniforms:{color:new r(0,1,0,1),cellAlpha:.1,lineCount:new e(8,8),lineThickness:new e(1,1),lineOffset:new e(0,0)},source:S},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}}),R.StripeType="Stripe",R._materialCache.addMaterial(R.StripeType,{fabric:{type:R.StripeType,uniforms:{horizontal:!0,evenColor:new r(1,1,1,.5),oddColor:new r(0,0,1,.5),offset:0,repeat:5},source:I},translucent:function(e){var t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}}),R.CheckerboardType="Checkerboard",R._materialCache.addMaterial(R.CheckerboardType,{fabric:{type:R.CheckerboardType,uniforms:{lightColor:new r(1,1,1,.5),darkColor:new r(0,0,0,.5),repeat:new e(5,5)},source:b},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),R.DotType="Dot",R._materialCache.addMaterial(R.DotType,{fabric:{type:R.DotType,uniforms:{lightColor:new r(1,1,0,.75),darkColor:new r(0,1,1,.75),repeat:new e(5,5)},source:C},translucent:function(e){var t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}}),R.WaterType="Water",R._materialCache.addMaterial(R.WaterType,{fabric:{type:R.WaterType,uniforms:{baseWaterColor:new r(.2,.3,.6,1),blendColor:new r(0,1,.699,1),specularMap:R.DefaultImageId,normalMap:R.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:M},translucent:function(e){var t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}}),R.RimLightingType="RimLighting",R._materialCache.addMaterial(R.RimLightingType,{fabric:{type:R.RimLightingType,uniforms:{color:new r(1,0,0,.7),rimColor:new r(1,1,1,.4),width:.3},source:D},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}}),R.FadeType="Fade",R._materialCache.addMaterial(R.FadeType,{fabric:{type:R.FadeType,uniforms:{fadeInColor:new r(1,0,0,1),fadeOutColor:new r(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new e(.5,.5)},source:w},translucent:function(e){var t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}}),R.PolylineArrowType="PolylineArrow",R._materialCache.addMaterial(R.PolylineArrowType,{fabric:{type:R.PolylineArrowType,uniforms:{color:new r(1,1,1,1)},source:T},translucent:!0}),R.PolylineDashType="PolylineDash",R._materialCache.addMaterial(R.PolylineDashType,{fabric:{type:R.PolylineDashType,uniforms:{color:new r(1,0,1,1),gapColor:new r(0,0,0,0),dashLength:16,dashPattern:255},source:x},translucent:!0}),R.PolylineGlowType="PolylineGlow",R._materialCache.addMaterial(R.PolylineGlowType,{fabric:{type:R.PolylineGlowType,uniforms:{color:new r(0,.5,1,1),glowPower:.25},source:P},translucent:!0}),R.PolylineOutlineType="PolylineOutline",R._materialCache.addMaterial(R.PolylineOutlineType,{fabric:{type:R.PolylineOutlineType,uniforms:{color:new r(1,1,1,1),outlineColor:new r(1,0,0,1),outlineWidth:1},source:A},translucent:function(e){var t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}}),R}),define("Scene/MaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/freezeObject","../Core/VertexFormat","../Shaders/Appearances/AllMaterialAppearanceFS","../Shaders/Appearances/AllMaterialAppearanceVS","../Shaders/Appearances/BasicMaterialAppearanceFS","../Shaders/Appearances/BasicMaterialAppearanceVS","../Shaders/Appearances/TexturedMaterialAppearanceFS","../Shaders/Appearances/TexturedMaterialAppearanceVS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),n=e(r.closed,!1),o=e(r.materialSupport,p.MaterialSupport.TEXTURED);this.material=t(r.material)?r.material:h.fromType(h.ColorType),this.translucent=i,this._vertexShaderSource=e(r.vertexShaderSource,o.vertexShaderSource),this._fragmentShaderSource=e(r.fragmentShaderSource,o.fragmentShaderSource),this._renderState=d.getDefaultRenderState(i,n,r.renderState),this._closed=n,this._materialSupport=o,this._vertexFormat=o.vertexFormat,this._flat=e(r.flat,!1),this._faceForward=e(r.faceForward,!n)}return r(p.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}}}),p.prototype.getFragmentShaderSource=d.prototype.getFragmentShaderSource,p.prototype.isTranslucent=d.prototype.isTranslucent,p.prototype.getRenderState=d.prototype.getRenderState,p.MaterialSupport={BASIC:i({vertexFormat:n.POSITION_AND_NORMAL,vertexShaderSource:l,fragmentShaderSource:s}),TEXTURED:i({vertexFormat:n.POSITION_NORMAL_AND_ST,vertexShaderSource:c,fragmentShaderSource:u}),ALL:i({vertexFormat:n.ALL,vertexShaderSource:a,fragmentShaderSource:o})},p}),define("Shaders/Appearances/PerInstanceColorAppearanceFS",[],function(){"use strict";return"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\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = v_color.rgb;\nmaterial.alpha = v_color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n}\n"}),define("Shaders/Appearances/PerInstanceColorAppearanceVS",[],function(){"use strict";return"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"}),define("Shaders/Appearances/PerInstanceFlatColorAppearanceFS",[],function(){"use strict";return"varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\n}\n"}),define("Shaders/Appearances/PerInstanceFlatColorAppearanceVS",[],function(){"use strict";return"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"; +}),define("Scene/PerInstanceColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceColorAppearanceFS","../Shaders/Appearances/PerInstanceColorAppearanceVS","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Appearance"],function(e,t,r,i,n,o,a,s){"use strict";function l(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.translucent,!0),u=e(t.closed,!1),c=e(t.flat,!1),d=c?a:n,h=c?o:i,p=c?l.FLAT_VERTEX_FORMAT:l.VERTEX_FORMAT;this.material=void 0,this.translucent=r,this._vertexShaderSource=e(t.vertexShaderSource,d),this._fragmentShaderSource=e(t.fragmentShaderSource,h),this._renderState=s.getDefaultRenderState(r,u,t.renderState),this._closed=u,this._vertexFormat=p,this._flat=c,this._faceForward=e(t.faceForward,!u)}return t(l.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}}}),l.VERTEX_FORMAT=r.POSITION_AND_NORMAL,l.FLAT_VERTEX_FORMAT=r.POSITION_ONLY,l.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,l.prototype.isTranslucent=s.prototype.isTranslucent,l.prototype.getRenderState=s.prototype.getRenderState,l}),define("Renderer/BufferUsage",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={STREAM_DRAW:t.STREAM_DRAW,STATIC_DRAW:t.STATIC_DRAW,DYNAMIC_DRAW:t.DYNAMIC_DRAW,validate:function(e){return e===r.STREAM_DRAW||e===r.STATIC_DRAW||e===r.DYNAMIC_DRAW}};return e(r)}),define("Renderer/DrawCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/PrimitiveType"],function(e,t,r,i){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._cull=e(t.cull,!0),this._modelMatrix=t.modelMatrix,this._primitiveType=e(t.primitiveType,i.TRIANGLES),this._vertexArray=t.vertexArray,this._count=t.count,this._offset=e(t.offset,0),this._instanceCount=e(t.instanceCount,0),this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._executeInClosestFrustum=e(t.executeInClosestFrustum,!1),this._owner=t.owner,this._debugShowBoundingVolume=e(t.debugShowBoundingVolume,!1),this._debugOverlappingFrustums=0,this._castShadows=e(t.castShadows,!1),this._receiveShadows=e(t.receiveShadows,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}return r(n.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)}},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)}},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)}}}),n.shallowClone=function(e,r){if(t(e))return t(r)||(r=new n),r._boundingVolume=e._boundingVolume,r._orientedBoundingBox=e._orientedBoundingBox,r._cull=e._cull,r._modelMatrix=e._modelMatrix,r._primitiveType=e._primitiveType,r._vertexArray=e._vertexArray,r._count=e._count,r._offset=e._offset,r._instanceCount=e._instanceCount,r._shaderProgram=e._shaderProgram,r._uniformMap=e._uniformMap,r._renderState=e._renderState,r._framebuffer=e._framebuffer,r._pass=e._pass,r._executeInClosestFrustum=e._executeInClosestFrustum,r._owner=e._owner,r._debugShowBoundingVolume=e._debugShowBoundingVolume,r._debugOverlappingFrustums=e._debugOverlappingFrustums,r._castShadows=e._castShadows,r._receiveShadows=e._receiveShadows,r.dirty=!0,r.lastDirtyTime=0,r},n.prototype.execute=function(e,t){e.draw(this,t)},n}),define("Renderer/Pass",["../Core/freezeObject"],function(e){"use strict";var t={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,GROUND:3,OPAQUE:4,TRANSLUCENT:5,OVERLAY:6,NUMBER_OF_PASSES:7};return e(t)}),define("Renderer/RenderState",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/WebGLConstants","../Core/WindingOrder","./ContextLimits"],function(e,t,r,i,n,o,a,s){"use strict";function l(n){var s=r(n,{}),l=r(s.cull,{}),u=r(s.polygonOffset,{}),c=r(s.scissorTest,{}),d=r(c.rectangle,{}),h=r(s.depthRange,{}),p=r(s.depthTest,{}),f=r(s.colorMask,{}),m=r(s.blending,{}),g=r(m.color,{}),v=r(s.stencilTest,{}),_=r(v.frontOperation,{}),y=r(v.backOperation,{}),b=r(s.sampleCoverage,{}),C=s.viewport;this.frontFace=r(s.frontFace,a.COUNTER_CLOCKWISE),this.cull={enabled:r(l.enabled,!1),face:r(l.face,o.BACK)},this.lineWidth=r(s.lineWidth,1),this.polygonOffset={enabled:r(u.enabled,!1),factor:r(u.factor,0),units:r(u.units,0)},this.scissorTest={enabled:r(c.enabled,!1),rectangle:e.clone(d)},this.depthRange={near:r(h.near,0),far:r(h.far,1)},this.depthTest={enabled:r(p.enabled,!1),func:r(p.func,o.LESS)},this.colorMask={red:r(f.red,!0),green:r(f.green,!0),blue:r(f.blue,!0),alpha:r(f.alpha,!0)},this.depthMask=r(s.depthMask,!0),this.stencilMask=r(s.stencilMask,-1),this.blending={enabled:r(m.enabled,!1),color:new t(r(g.red,0),r(g.green,0),r(g.blue,0),r(g.alpha,0)),equationRgb:r(m.equationRgb,o.FUNC_ADD),equationAlpha:r(m.equationAlpha,o.FUNC_ADD),functionSourceRgb:r(m.functionSourceRgb,o.ONE),functionSourceAlpha:r(m.functionSourceAlpha,o.ONE),functionDestinationRgb:r(m.functionDestinationRgb,o.ZERO),functionDestinationAlpha:r(m.functionDestinationAlpha,o.ZERO)},this.stencilTest={enabled:r(v.enabled,!1),frontFunction:r(v.frontFunction,o.ALWAYS),backFunction:r(v.backFunction,o.ALWAYS),reference:r(v.reference,0),mask:r(v.mask,-1),frontOperation:{fail:r(_.fail,o.KEEP),zFail:r(_.zFail,o.KEEP),zPass:r(_.zPass,o.KEEP)},backOperation:{fail:r(y.fail,o.KEEP),zFail:r(y.zFail,o.KEEP),zPass:r(y.zPass,o.KEEP)}},this.sampleCoverage={enabled:r(b.enabled,!1),value:r(b.value,1),invert:r(b.invert,!1)},this.viewport=i(C)?new e(C.x,C.y,C.width,C.height):void 0,this.id=0,this._applyFunctions=[]}function u(e,t,r){r?e.enable(t):e.disable(t)}function c(e,t){e.frontFace(t.frontFace)}function d(e,t){var r=t.cull,i=r.enabled;u(e,e.CULL_FACE,i),i&&e.cullFace(r.face)}function h(e,t){e.lineWidth(t.lineWidth)}function p(e,t){var r=t.polygonOffset,i=r.enabled;u(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(r.factor,r.units)}function f(e,t,r){var n=t.scissorTest,o=i(r.scissorTest)?r.scissorTest.enabled:n.enabled;if(u(e,e.SCISSOR_TEST,o),o){var a=i(r.scissorTest)?r.scissorTest.rectangle:n.rectangle;e.scissor(a.x,a.y,a.width,a.height)}}function m(e,t){var r=t.depthRange;e.depthRange(r.near,r.far)}function g(e,t){var r=t.depthTest,i=r.enabled;u(e,e.DEPTH_TEST,i),i&&e.depthFunc(r.func)}function v(e,t){var r=t.colorMask;e.colorMask(r.red,r.green,r.blue,r.alpha)}function _(e,t){e.depthMask(t.depthMask)}function y(e,t){e.stencilMask(t.stencilMask)}function b(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function C(e,t,r){var n=t.blending,o=i(r.blendingEnabled)?r.blendingEnabled:n.enabled;u(e,e.BLEND,o),o&&(b(e,n.color),e.blendEquationSeparate(n.equationRgb,n.equationAlpha),e.blendFuncSeparate(n.functionSourceRgb,n.functionDestinationRgb,n.functionSourceAlpha,n.functionDestinationAlpha))}function w(e,t){var r=t.stencilTest,i=r.enabled;if(u(e,e.STENCIL_TEST,i),i){var n=r.frontFunction,o=r.backFunction,a=r.reference,s=r.mask;e.stencilFunc(n,a,s),e.stencilFuncSeparate(e.BACK,o,a,s),e.stencilFuncSeparate(e.FRONT,n,a,s);var l=r.frontOperation,c=l.fail,d=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,c,d,h);var p=r.backOperation,f=p.fail,m=p.zFail,g=p.zPass;e.stencilOpSeparate(e.BACK,f,m,g)}}function S(e,t){var r=t.sampleCoverage,i=r.enabled;u(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(r.value,r.invert)}function E(e,t,n){var o=r(t.viewport,n.viewport);i(o)||(o=A,o.width=n.context.drawingBufferWidth,o.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=o,e.viewport(o.x,o.y,o.width,o.height)}function T(e,t){var r=[];return e.frontFace!==t.frontFace&&r.push(c),e.cull.enabled===t.cull.enabled&&e.cull.face===t.cull.face||r.push(d),e.lineWidth!==t.lineWidth&&r.push(h),e.polygonOffset.enabled===t.polygonOffset.enabled&&e.polygonOffset.factor===t.polygonOffset.factor&&e.polygonOffset.units===t.polygonOffset.units||r.push(p),e.depthRange.near===t.depthRange.near&&e.depthRange.far===t.depthRange.far||r.push(m),e.depthTest.enabled===t.depthTest.enabled&&e.depthTest.func===t.depthTest.func||r.push(g),e.colorMask.red===t.colorMask.red&&e.colorMask.green===t.colorMask.green&&e.colorMask.blue===t.colorMask.blue&&e.colorMask.alpha===t.colorMask.alpha||r.push(v),e.depthMask!==t.depthMask&&r.push(_),e.stencilMask!==t.stencilMask&&r.push(y),e.stencilTest.enabled===t.stencilTest.enabled&&e.stencilTest.frontFunction===t.stencilTest.frontFunction&&e.stencilTest.backFunction===t.stencilTest.backFunction&&e.stencilTest.reference===t.stencilTest.reference&&e.stencilTest.mask===t.stencilTest.mask&&e.stencilTest.frontOperation.fail===t.stencilTest.frontOperation.fail&&e.stencilTest.frontOperation.zFail===t.stencilTest.frontOperation.zFail&&e.stencilTest.backOperation.fail===t.stencilTest.backOperation.fail&&e.stencilTest.backOperation.zFail===t.stencilTest.backOperation.zFail&&e.stencilTest.backOperation.zPass===t.stencilTest.backOperation.zPass||r.push(w),e.sampleCoverage.enabled===t.sampleCoverage.enabled&&e.sampleCoverage.value===t.sampleCoverage.value&&e.sampleCoverage.invert===t.sampleCoverage.invert||r.push(S),r}var x=0,P={};l.fromCache=function(e){var t=JSON.stringify(e),r=P[t];if(i(r))return++r.referenceCount,r.state;var n=new l(e),o=JSON.stringify(n);return r=P[o],i(r)||(n.id=x++,r={referenceCount:0,state:n},P[o]=r),++r.referenceCount,P[t]={referenceCount:1,state:r.state},r.state},l.removeFromCache=function(e){var t=new l(e),r=JSON.stringify(t),n=P[r],o=JSON.stringify(e),a=P[o];i(a)&&(--a.referenceCount,0===a.referenceCount&&(delete P[o],i(n)&&--n.referenceCount)),i(n)&&0===n.referenceCount&&delete P[r]},l.getCache=function(){return P},l.clearCache=function(){P={}};var A=new e;return l.apply=function(e,t,r){c(e,t),d(e,t),h(e,t),p(e,t),m(e,t),g(e,t),v(e,t),_(e,t),y(e,t),w(e,t),S(e,t),f(e,t,r),C(e,t,r),E(e,t,r)},l.partialApply=function(e,t,r,n,o,a){if(t!==r){var s=r._applyFunctions[t.id];i(s)||(s=T(t,r),r._applyFunctions[t.id]=s);for(var l=s.length,u=0;u<l;++u)s[u](e,r)}var c=i(n.scissorTest)?n.scissorTest:t.scissorTest,d=i(o.scissorTest)?o.scissorTest:r.scissorTest;(c!==d||a)&&f(e,r,o);var h=i(n.blendingEnabled)?n.blendingEnabled:t.blending.enabled,p=i(o.blendingEnabled)?o.blendingEnabled:r.blending.enabled;(h!==p||p&&t.blending!==r.blending)&&C(e,r,o),t===r&&n===o&&n.context===o.context||E(e,r,o)},l.getState=function(r){return{frontFace:r.frontFace,cull:{enabled:r.cull.enabled,face:r.cull.face},lineWidth:r.lineWidth,polygonOffset:{enabled:r.polygonOffset.enabled,factor:r.polygonOffset.factor,units:r.polygonOffset.units},scissorTest:{enabled:r.scissorTest.enabled,rectangle:e.clone(r.scissorTest.rectangle)},depthRange:{near:r.depthRange.near,far:r.depthRange.far},depthTest:{enabled:r.depthTest.enabled,func:r.depthTest.func},colorMask:{red:r.colorMask.red,green:r.colorMask.green,blue:r.colorMask.blue,alpha:r.colorMask.alpha},depthMask:r.depthMask,stencilMask:r.stencilMask,blending:{enabled:r.blending.enabled,color:t.clone(r.blending.color),equationRgb:r.blending.equationRgb,equationAlpha:r.blending.equationAlpha,functionSourceRgb:r.blending.functionSourceRgb,functionSourceAlpha:r.blending.functionSourceAlpha,functionDestinationRgb:r.blending.functionDestinationRgb,functionDestinationAlpha:r.blending.functionDestinationAlpha},stencilTest:{enabled:r.stencilTest.enabled,frontFunction:r.stencilTest.frontFunction,backFunction:r.stencilTest.backFunction,reference:r.stencilTest.reference,mask:r.stencilTest.mask,frontOperation:{fail:r.stencilTest.frontOperation.fail,zFail:r.stencilTest.frontOperation.zFail,zPass:r.stencilTest.frontOperation.zPass},backOperation:{fail:r.stencilTest.backOperation.fail,zFail:r.stencilTest.backOperation.zFail,zPass:r.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:r.sampleCoverage.enabled,value:r.sampleCoverage.value,invert:r.sampleCoverage.invert},viewport:i(r.viewport)?e.clone(r.viewport):void 0}},l}),define("Renderer/AutomaticUniforms",["../Core/Cartesian3","../Core/Matrix4","../Core/WebGLConstants"],function(e,t,r){"use strict";function i(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var n=new e;if("undefined"==typeof WebGLRenderingContext)return{};var o={};o[r.FLOAT]="float",o[r.FLOAT_VEC2]="vec2",o[r.FLOAT_VEC3]="vec3",o[r.FLOAT_VEC4]="vec4",o[r.INT]="int",o[r.INT_VEC2]="ivec2",o[r.INT_VEC3]="ivec3",o[r.INT_VEC4]="ivec4",o[r.BOOL]="bool",o[r.BOOL_VEC2]="bvec2",o[r.BOOL_VEC3]="bvec3",o[r.BOOL_VEC4]="bvec4",o[r.FLOAT_MAT2]="mat2",o[r.FLOAT_MAT3]="mat3",o[r.FLOAT_MAT4]="mat4",o[r.SAMPLER_2D]="sampler2D",o[r.SAMPLER_CUBE]="samplerCube",i.prototype.getDeclaration=function(e){var t="uniform "+o[this._datatype]+" "+e,r=this._size;return t+=1===r?";":"["+r.toString()+"];"};var a={czm_viewport:new i({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new i({size:1,datatype:r.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new i({size:1,datatype:r.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_normal:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight2D:new i({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_entireFrustum:new i({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new i({size:1,datatype:r.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new i({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_sunPositionWC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_encodedCameraPositionMCHigh:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new i({size:1,datatype:r.FLOAT_VEC3,getValue:function(e){return t.getTranslation(e.inverseView,n)}}),czm_frameNumber:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new i({size:1,datatype:r.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_temeToPseudoFixed:new i({size:1,datatype:r.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_resolutionScale:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.resolutionScale}}),czm_fogDensity:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.fogDensity}}),czm_imagerySplitPosition:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.imagerySplitPosition}}),czm_geometricToleranceOverMeter:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new i({size:1,datatype:r.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}})};return a}),define("Renderer/createUniform",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r,i){switch(t.type){case e.FLOAT:return new d(e,t,r,i);case e.FLOAT_VEC2:return new h(e,t,r,i);case e.FLOAT_VEC3:return new p(e,t,r,i);case e.FLOAT_VEC4:return new f(e,t,r,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new m(e,t,r,i);case e.INT:case e.BOOL:return new g(e,t,r,i);case e.INT_VEC2:case e.BOOL_VEC2:return new v(e,t,r,i);case e.INT_VEC3:case e.BOOL_VEC3:return new _(e,t,r,i);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,r,i);case e.FLOAT_MAT2:return new b(e,t,r,i);case e.FLOAT_MAT3:return new C(e,t,r,i);case e.FLOAT_MAT4:return new w(e,t,r,i);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+r+'".')}}function d(e,t,r,i){this.name=r,this.value=void 0,this._value=0,this._gl=e,this._location=i}function h(t,r,i,n){this.name=i,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function p(e,t,r,i){this.name=r,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}function f(e,t,r,i){this.name=r,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}function m(e,t,r,i){this.name=r,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}function g(e,t,r,i){this.name=r,this.value=void 0,this._value=0,this._gl=e,this._location=i}function v(t,r,i,n){this.name=i,this.value=void 0,this._value=new e,this._gl=t,this._location=n}function _(e,r,i,n){this.name=i,this.value=void 0,this._value=new t,this._gl=e,this._location=n}function y(e,t,i,n){this.name=i,this.value=void 0,this._value=new r,this._gl=e,this._location=n}function b(e,t,r,i){this.name=r,this.value=void 0,this._value=new Float32Array(4),this._gl=e,this._location=i}function C(e,t,r,i){this.name=r,this.value=void 0,this._value=new Float32Array(9),this._gl=e,this._location=i}function w(e,t,r,i){this.name=r,this.value=void 0,this._value=new Float32Array(16),this._gl=e,this._location=i}return d.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))},h.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))},p.prototype.set=function(){var e=this.value;n(e.red)?i.equals(e,this._value)||(this._value=i.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):n(e.x)&&(t.equals(e,this._value)||(this._value=t.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z)))},f.prototype.set=function(){var e=this.value;n(e.red)?i.equals(e,this._value)||(this._value=i.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):n(e.x)&&(r.equals(e,this._value)||(this._value=r.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))},m.prototype.set=function(){var e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);var t=this.value;e.bindTexture(t._target,t._texture)},m.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1},g.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))},v.prototype.set=function(){var t=this.value;e.equals(t,this._value)||(e.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))},_.prototype.set=function(){var e=this.value;t.equals(e,this._value)||(t.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))},y.prototype.set=function(){var e=this.value;r.equals(e,this._value)||(r.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))},b.prototype.set=function(){a.equalsArray(this.value,this._value,0)||(a.toArray(this.value,this._value),this._gl.uniformMatrix2fv(this._location,!1,this._value))},C.prototype.set=function(){s.equalsArray(this.value,this._value,0)||(s.toArray(this.value,this._value),this._gl.uniformMatrix3fv(this._location,!1,this._value))},w.prototype.set=function(){l.equalsArray(this.value,this._value,0)||(l.toArray(this.value,this._value),this._gl.uniformMatrix4fv(this._location,!1,this._value))},c}),define("Renderer/createUniformArray",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defined","../Core/DeveloperError","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/RuntimeError"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,t,r,i){switch(t.type){case e.FLOAT:return new d(e,t,r,i);case e.FLOAT_VEC2:return new h(e,t,r,i);case e.FLOAT_VEC3:return new p(e,t,r,i);case e.FLOAT_VEC4:return new f(e,t,r,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new m(e,t,r,i);case e.INT:case e.BOOL:return new g(e,t,r,i);case e.INT_VEC2:case e.BOOL_VEC2:return new v(e,t,r,i);case e.INT_VEC3:case e.BOOL_VEC3:return new _(e,t,r,i);case e.INT_VEC4:case e.BOOL_VEC4:return new y(e,t,r,i);case e.FLOAT_MAT2:return new b(e,t,r,i);case e.FLOAT_MAT3:return new C(e,t,r,i);case e.FLOAT_MAT4:return new w(e,t,r,i);default:throw new u("Unrecognized uniform type: "+t.type+' for uniform "'+r+'".')}}function d(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._location=i[0]}function h(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(2*n),this._gl=e,this._location=i[0]}function p(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(3*n),this._gl=e,this._location=i[0]}function f(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=i[0]}function m(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(n),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}function g(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(n),this._gl=e,this._location=i[0]}function v(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(2*n),this._gl=e,this._location=i[0]}function _(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(3*n),this._gl=e,this._location=i[0]}function y(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Int32Array(4*n),this._gl=e,this._location=i[0]}function b(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(4*n),this._gl=e,this._location=i[0]}function C(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(9*n),this._gl=e,this._location=i[0]}function w(e,t,r,i){var n=i.length;this.name=r,this.value=new Array(n),this._value=new Float32Array(16*n),this._gl=e,this._location=i[0]}return d.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0;n<t;++n){var o=e[n];o!==r[n]&&(r[n]=o,i=!0)}i&&this._gl.uniform1fv(this._location,r)},h.prototype.set=function(){for(var t=this.value,r=t.length,i=this._value,n=!1,o=0,a=0;a<r;++a){var s=t[a];e.equalsArray(s,i,o)||(e.pack(s,i,o),n=!0),o+=2}n&&this._gl.uniform2fv(this._location,i)},p.prototype.set=function(){for(var e=this.value,r=e.length,i=this._value,o=!1,a=0,s=0;s<r;++s){var l=e[s];n(l.red)?l.red===i[a]&&l.green===i[a+1]&&l.blue===i[a+2]||(i[a]=l.red,i[a+1]=l.green,i[a+2]=l.blue,o=!0):n(l.x)&&(t.equalsArray(l,i,a)||(t.pack(l,i,a),o=!0)),a+=3}o&&this._gl.uniform3fv(this._location,i)},f.prototype.set=function(){for(var e=this.value,t=e.length,o=this._value,a=!1,s=0,l=0;l<t;++l){var u=e[l];n(u.red)?i.equalsArray(u,o,s)||(i.pack(u,o,s),a=!0):n(u.x)&&(r.equalsArray(u,o,s)||(r.pack(u,o,s),a=!0)),s+=4}a&&this._gl.uniform4fv(this._location,o)},m.prototype.set=function(){for(var e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,r=this.value,i=r.length,n=0;n<i;++n){var o=r[n];e.activeTexture(t+n),e.bindTexture(o._target,o._texture)}},m.prototype._setSampler=function(e){this.textureUnitIndex=e;for(var t=this._locations,r=t.length,i=0;i<r;++i){var n=e+i;this._gl.uniform1i(t[i],n)}return e+r},g.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0;n<t;++n){var o=e[n];o!==r[n]&&(r[n]=o,i=!0)}i&&this._gl.uniform1iv(this._location,r)},v.prototype.set=function(){for(var t=this.value,r=t.length,i=this._value,n=!1,o=0,a=0;a<r;++a){var s=t[a];e.equalsArray(s,i,o)||(e.pack(s,i,o),n=!0),o+=2}n&&this._gl.uniform2iv(this._location,i)},_.prototype.set=function(){for(var e=this.value,r=e.length,i=this._value,n=!1,o=0,a=0;a<r;++a){var s=e[a];t.equalsArray(s,i,o)||(t.pack(s,i,o),n=!0),o+=3}n&&this._gl.uniform3iv(this._location,i)},y.prototype.set=function(){for(var e=this.value,t=e.length,i=this._value,n=!1,o=0,a=0;a<t;++a){var s=e[a];r.equalsArray(s,i,o)||(r.pack(s,i,o),n=!0),o+=4}n&&this._gl.uniform4iv(this._location,i)},b.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0,o=0;o<t;++o){var s=e[o];a.equalsArray(s,r,n)||(a.pack(s,r,n),i=!0),n+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,r)},C.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0,o=0;o<t;++o){var a=e[o];s.equalsArray(a,r,n)||(s.pack(a,r,n),i=!0),n+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,r)},w.prototype.set=function(){for(var e=this.value,t=e.length,r=this._value,i=!1,n=0,o=0;o<t;++o){var a=e[o];l.equalsArray(a,r,n)||(l.pack(a,r,n),i=!0),n+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,r)},c}),define("Renderer/ShaderProgram",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/RuntimeError","./AutomaticUniforms","./ContextLimits","./createUniform","./createUniformArray"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){var t=h(e.vertexShaderText,e.fragmentShaderText);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=t.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=t.fragmentShaderText, +this.id=y++}function d(e){var r=[],i=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(t(i))for(var n=i.length,o=0;o<n;o++){var a=i[o].trim(),s=a.slice(a.lastIndexOf(" ")+1);r.push(s)}return r}function h(e,t){var r={};if(!s.highpFloatSupported||!s.highpIntSupported){var i,n,o,a,l=d(e),u=d(t),c=l.length,h=u.length;for(i=0;i<c;i++)for(n=0;n<h;n++)if(l[i]===u[n]){o=l[i],a="czm_mediump_"+o;var p=new RegExp(o+"\\b","g");t=t.replace(p,a),r[a]=o}}return{fragmentShaderText:t,duplicateUniformNames:r}}function p(e,r){var i=r._vertexShaderText,n=r._fragmentShaderText,a=e.createShader(e.VERTEX_SHADER);e.shaderSource(a,i),e.compileShader(a);var s=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(s,n),e.compileShader(s);var l=e.createProgram();e.attachShader(l,a),e.attachShader(l,s),e.deleteShader(a),e.deleteShader(s);var u=r._attributeLocations;if(t(u))for(var c in u)u.hasOwnProperty(c)&&e.bindAttribLocation(l,u[c],c);e.linkProgram(l);var d;if(!e.getProgramParameter(l,e.LINK_STATUS)){var h=r._debugShaders;if(!e.getShaderParameter(s,e.COMPILE_STATUS)){if(d=e.getShaderInfoLog(s),console.error(b+"Fragment shader compile log: "+d),t(h)){var p=h.getTranslatedShaderSource(s);""!==p?console.error(b+"Translated fragment shader source:\n"+p):console.error(b+"Fragment shader translation failed.")}throw e.deleteProgram(l),new o("Fragment shader failed to compile. Compile log: "+d)}if(!e.getShaderParameter(a,e.COMPILE_STATUS)){if(d=e.getShaderInfoLog(a),console.error(b+"Vertex shader compile log: "+d),t(h)){var f=h.getTranslatedShaderSource(a);""!==f?console.error(b+"Translated vertex shader source:\n"+f):console.error(b+"Vertex shader translation failed.")}throw e.deleteProgram(l),new o("Vertex shader failed to compile. Compile log: "+d)}throw d=e.getProgramInfoLog(l),console.error(b+"Shader program link log: "+d),t(h)&&(console.error(b+"Translated vertex shader source:\n"+h.getTranslatedShaderSource(a)),console.error(b+"Translated fragment shader source:\n"+h.getTranslatedShaderSource(s))),e.deleteProgram(l),new o("Program failed to link. Link log: "+d)}var m=r._logShaderCompilation;return m&&(d=e.getShaderInfoLog(a),t(d)&&d.length>0&&console.log(b+"Vertex shader compile log: "+d)),m&&(d=e.getShaderInfoLog(s),t(d)&&d.length>0&&console.log(b+"Fragment shader compile log: "+d)),m&&(d=e.getProgramInfoLog(l),t(d)&&d.length>0&&console.log(b+"Shader program link log: "+d)),l}function f(e,t,r){for(var i={},n=0;n<r;++n){var o=e.getActiveAttrib(t,n),a=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:a}}return i}function m(e,r){for(var i={},n=[],o=[],a=e.getProgramParameter(r,e.ACTIVE_UNIFORMS),s=0;s<a;++s){var c=e.getActiveUniform(r,s),d="[0]",h=c.name.indexOf(d,c.name.length-d.length)!==-1?c.name.slice(0,c.name.length-3):c.name;if(0!==h.indexOf("gl_"))if(c.name.indexOf("[")<0){var p=e.getUniformLocation(r,h);if(null!==p){var f=l(e,c,h,p);i[h]=f,n.push(f),f._setSampler&&o.push(f)}}else{var m,g,v,_,y=h.indexOf("[");if(y>=0){if(m=i[h.slice(0,y)],!t(m))continue;g=m._locations,g.length<=1&&(v=m.value,_=e.getUniformLocation(r,h),null!==_&&(g.push(_),v.push(e.getUniform(r,_))))}else{g=[];for(var b=0;b<c.size;++b)_=e.getUniformLocation(r,h+"["+b+"]"),null!==_&&g.push(_);m=u(e,c,h,g),i[h]=m,n.push(m),m._setSampler&&o.push(m)}}}return{uniformsByName:i,uniforms:n,samplerUniforms:o}}function g(e,r){var i=[],n=[];for(var o in r)if(r.hasOwnProperty(o)){var s=r[o],l=o,u=e._duplicateUniformNames[l];t(u)&&(s.name=u,l=u);var c=a[l];t(c)?i.push({uniform:s,automaticUniform:c}):n.push(s)}return{automaticUniforms:i,manualUniforms:n}}function v(e,t,r){e.useProgram(t);for(var i=0,n=r.length,o=0;o<n;++o)i=r[o]._setSampler(i);return e.useProgram(null),i}function _(e){if(!t(e._program)){var r=e._gl,i=p(r,e,e._debugShaders),n=r.getProgramParameter(i,r.ACTIVE_ATTRIBUTES),o=m(r,i),a=g(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=n,e._vertexAttributes=f(r,i,n),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=v(r,i,o.samplerUniforms)}}var y=0;c.fromCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.getShaderProgram(t)},c.replaceCache=function(t){return t=e(t,e.EMPTY_OBJECT),t.context.shaderCache.replaceShaderProgram(t)},r(c.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return _(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return _(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return _(this),this._uniformsByName}}});var b="[Cesium WebGL] ";return c.prototype._bind=function(){_(this),this._gl.useProgram(this._program)},c.prototype._setUniforms=function(e,r,i){var n,o;if(t(e)){var a=this._manualUniforms;for(n=a.length,o=0;o<n;++o){var s=a[o];s.value=e[s.name]()}}var l=this._automaticUniforms;for(n=l.length,o=0;o<n;++o){var u=l[o];u.uniform.value=u.automaticUniform.getValue(r)}var c=this._uniforms;for(n=c.length,o=0;o<n;++o)c[o].set();if(i){var d=this._gl,h=this._program;d.validateProgram(h)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)},c.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),i(this)},c}),define("Shaders/Builtin/Constants/degreesPerRadian",[],function(){"use strict";return"const float czm_degreesPerRadian = 57.29577951308232;\n"}),define("Shaders/Builtin/Constants/depthRange",[],function(){"use strict";return"const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);\n"}),define("Shaders/Builtin/Constants/epsilon1",[],function(){"use strict";return"const float czm_epsilon1 = 0.1;\n"}),define("Shaders/Builtin/Constants/epsilon2",[],function(){"use strict";return"const float czm_epsilon2 = 0.01;\n"}),define("Shaders/Builtin/Constants/epsilon3",[],function(){"use strict";return"const float czm_epsilon3 = 0.001;\n"}),define("Shaders/Builtin/Constants/epsilon4",[],function(){"use strict";return"const float czm_epsilon4 = 0.0001;\n"}),define("Shaders/Builtin/Constants/epsilon5",[],function(){"use strict";return"const float czm_epsilon5 = 0.00001;\n"}),define("Shaders/Builtin/Constants/epsilon6",[],function(){"use strict";return"const float czm_epsilon6 = 0.000001;\n"}),define("Shaders/Builtin/Constants/epsilon7",[],function(){"use strict";return"const float czm_epsilon7 = 0.0000001;\n"}),define("Shaders/Builtin/Constants/infinity",[],function(){"use strict";return"const float czm_infinity = 5906376272000.0;\n"}),define("Shaders/Builtin/Constants/oneOverPi",[],function(){"use strict";return"const float czm_oneOverPi = 0.3183098861837907;\n"}),define("Shaders/Builtin/Constants/oneOverTwoPi",[],function(){"use strict";return"const float czm_oneOverTwoPi = 0.15915494309189535;\n"}),define("Shaders/Builtin/Constants/passCompute",[],function(){"use strict";return"const float czm_passCompute = 1.0;\n"}),define("Shaders/Builtin/Constants/passEnvironment",[],function(){"use strict";return"const float czm_passEnvironment = 0.0;\n"}),define("Shaders/Builtin/Constants/passGlobe",[],function(){"use strict";return"const float czm_passGlobe = 2.0;\n"}),define("Shaders/Builtin/Constants/passGround",[],function(){"use strict";return"const float czm_passGround = 3.0;\n"}),define("Shaders/Builtin/Constants/passOpaque",[],function(){"use strict";return"const float czm_passOpaque = 4.0;\n"}),define("Shaders/Builtin/Constants/passOverlay",[],function(){"use strict";return"const float czm_passOverlay = 6.0;\n"}),define("Shaders/Builtin/Constants/passTranslucent",[],function(){"use strict";return"const float czm_passTranslucent = 5.0;\n"}),define("Shaders/Builtin/Constants/pi",[],function(){"use strict";return"const float czm_pi = 3.141592653589793;\n"}),define("Shaders/Builtin/Constants/piOverFour",[],function(){"use strict";return"const float czm_piOverFour = 0.7853981633974483;\n"}),define("Shaders/Builtin/Constants/piOverSix",[],function(){"use strict";return"const float czm_piOverSix = 0.5235987755982988;\n"}),define("Shaders/Builtin/Constants/piOverThree",[],function(){"use strict";return"const float czm_piOverThree = 1.0471975511965976;\n"}),define("Shaders/Builtin/Constants/piOverTwo",[],function(){"use strict";return"const float czm_piOverTwo = 1.5707963267948966;\n"}),define("Shaders/Builtin/Constants/radiansPerDegree",[],function(){"use strict";return"const float czm_radiansPerDegree = 0.017453292519943295;\n"}),define("Shaders/Builtin/Constants/sceneMode2D",[],function(){"use strict";return"const float czm_sceneMode2D = 2.0;\n"}),define("Shaders/Builtin/Constants/sceneMode3D",[],function(){"use strict";return"const float czm_sceneMode3D = 3.0;\n"}),define("Shaders/Builtin/Constants/sceneModeColumbusView",[],function(){"use strict";return"const float czm_sceneModeColumbusView = 1.0;\n"}),define("Shaders/Builtin/Constants/sceneModeMorphing",[],function(){"use strict";return"const float czm_sceneModeMorphing = 0.0;\n"}),define("Shaders/Builtin/Constants/solarRadius",[],function(){"use strict";return"const float czm_solarRadius = 695500000.0;\n"}),define("Shaders/Builtin/Constants/threePiOver2",[],function(){"use strict";return"const float czm_threePiOver2 = 4.71238898038469;\n"}),define("Shaders/Builtin/Constants/twoPi",[],function(){"use strict";return"const float czm_twoPi = 6.283185307179586;\n"}),define("Shaders/Builtin/Constants/webMercatorMaxLatitude",[],function(){"use strict";return"const float czm_webMercatorMaxLatitude = 1.4844222297453324;\n"}),define("Shaders/Builtin/Structs/depthRangeStruct",[],function(){"use strict";return"struct czm_depthRangeStruct\n{\nfloat near;\nfloat far;\n};\n"}),define("Shaders/Builtin/Structs/ellipsoid",[],function(){"use strict";return"struct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n"}),define("Shaders/Builtin/Structs/material",[],function(){"use strict";return"struct czm_material\n{\nvec3 diffuse;\nfloat specular;\nfloat shininess;\nvec3 normal;\nvec3 emission;\nfloat alpha;\n};\n"}),define("Shaders/Builtin/Structs/materialInput",[],function(){"use strict";return"struct czm_materialInput\n{\nfloat s;\nvec2 st;\nvec3 str;\nvec3 normalEC;\nmat3 tangentToEyeMatrix;\nvec3 positionToEyeEC;\n};\n"}),define("Shaders/Builtin/Structs/ray",[],function(){"use strict";return"struct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\n"}),define("Shaders/Builtin/Structs/raySegment",[],function(){"use strict";return"struct czm_raySegment\n{\nfloat start;\nfloat stop;\n};\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\n"}),define("Shaders/Builtin/Structs/shadowParameters",[],function(){"use strict";return"struct czm_shadowParameters\n{\n#ifdef USE_CUBE_MAP_SHADOW\nvec3 texCoords;\n#else\nvec2 texCoords;\n#endif\nfloat depthBias;\nfloat depth;\nfloat nDotL;\nvec2 texelStepSize;\nfloat normalShadingSmooth;\nfloat darkness;\n};\n"}),define("Shaders/Builtin/Functions/alphaWeight",[],function(){"use strict";return"float czm_alphaWeight(float a)\n{\nfloat x = 2.0 * (gl_FragCoord.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (gl_FragCoord.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 0.0);\nq /= gl_FragCoord.w;\nif (czm_inverseProjection != mat4(0.0)) {\nq = czm_inverseProjection * q;\n} else {\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nq.x = (q.x * (right - left) + left + right) * 0.5;\nq.y = (q.y * (top - bottom) + bottom + top) * 0.5;\nq.z = (q.z * (near - far) - near - far) * 0.5;\nq.w = 1.0;\n}\nreturn pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 100.0 / (1e-5 + pow(abs(z) / 10.0, 3.0) + pow(abs(z) / 200.0, 6.0))));\n}\n"}),define("Shaders/Builtin/Functions/antialias",[],function(){"use strict";return"vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\nfloat val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\nfloat val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\nval1 = val1 * (1.0 - val2);\nval1 = val1 * val1 * (3.0 - (2.0 * val1));\nval1 = pow(val1, 0.5);\nvec4 midColor = (color1 + color2) * 0.5;\nreturn mix(midColor, currentColor, val1);\n}\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\nreturn czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n"}),define("Shaders/Builtin/Functions/cascadeColor",[],function(){"use strict";return"vec4 czm_cascadeColor(vec4 weights)\n{\nreturn vec4(1.0, 0.0, 0.0, 1.0) * weights.x +\nvec4(0.0, 1.0, 0.0, 1.0) * weights.y +\nvec4(0.0, 0.0, 1.0, 1.0) * weights.z +\nvec4(1.0, 0.0, 1.0, 1.0) * weights.w;\n}\n"}),define("Shaders/Builtin/Functions/cascadeDistance",[],function(){"use strict";return"uniform vec4 shadowMap_cascadeDistances;\nfloat czm_cascadeDistance(vec4 weights)\n{\nreturn dot(shadowMap_cascadeDistances, weights);\n}\n"}),define("Shaders/Builtin/Functions/cascadeMatrix",[],function(){"use strict";return"uniform mat4 shadowMap_cascadeMatrices[4];\nmat4 czm_cascadeMatrix(vec4 weights)\n{\nreturn shadowMap_cascadeMatrices[0] * weights.x +\nshadowMap_cascadeMatrices[1] * weights.y +\nshadowMap_cascadeMatrices[2] * weights.z +\nshadowMap_cascadeMatrices[3] * weights.w;\n}\n"}),define("Shaders/Builtin/Functions/cascadeWeights",[],function(){"use strict";return"uniform vec4 shadowMap_cascadeSplits[2];\nvec4 czm_cascadeWeights(float depthEye)\n{\nvec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));\nvec4 far = step(depthEye, shadowMap_cascadeSplits[1]);\nreturn near * far;\n}\n"}),define("Shaders/Builtin/Functions/columbusViewMorph",[],function(){"use strict";return"vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\nvec3 p = mix(position2D.xyz, position3D.xyz, time);\nreturn vec4(p, 1.0);\n}\n"}),define("Shaders/Builtin/Functions/computePosition",[],function(){"use strict";return"vec4 czm_computePosition();\n"}),define("Shaders/Builtin/Functions/cosineAndSine",[],function(){"use strict";return"vec2 cordic(float angle)\n{\nvec2 vector = vec2(6.0725293500888267e-1, 0.0);\nfloat sense = (angle < 0.0) ? -1.0 : 1.0;\nmat2 rotation = mat2(1.0, sense, -sense, 1.0);\nvector = rotation * vector;\nangle -= sense * 7.8539816339744828e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfloat factor = sense * 5.0e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.6364760900080609e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.5e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4497866312686414e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.25e-1;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2435499454676144e-1;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.25e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.2418809995957350e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.125e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.1239833430268277e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.5625e-2;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5623728620476831e-2;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.8125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.8123410601011111e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.90625e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.9062301319669718e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.953125e-3;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9531225164788188e-3;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.765625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.7656218955931946e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.8828125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.8828121119489829e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.44140625e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.4414062014936177e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.220703125e-4;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.2207031189367021e-4;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 6.103515625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 6.1035156174208773e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.0517578125e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.0517578115526096e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.52587890625e-5;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.5258789061315762e-5;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 7.62939453125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 7.6293945311019700e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 3.814697265625e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 3.8146972656064961e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.9073486328125e-6;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 1.9073486328101870e-6;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 9.5367431640625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 9.5367431640596084e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 4.76837158203125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 4.7683715820308884e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 2.384185791015625e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nangle -= sense * 2.3841857910155797e-7;\nsense = (angle < 0.0) ? -1.0 : 1.0;\nfactor = sense * 1.1920928955078125e-7;\nrotation[0][1] = factor;\nrotation[1][0] = -factor;\nvector = rotation * vector;\nreturn vector;\n}\nvec2 czm_cosineAndSine(float angle)\n{\nif (angle < -czm_piOverTwo || angle > czm_piOverTwo)\n{\nif (angle < 0.0)\n{\nreturn -cordic(angle + czm_pi);\n}\nelse\n{\nreturn -cordic(angle - czm_pi);\n}\n}\nelse\n{\nreturn cordic(angle);\n}\n}\n"}),define("Shaders/Builtin/Functions/decompressTextureCoordinates",[],function(){"use strict";return"vec2 czm_decompressTextureCoordinates(float encoded)\n{\nfloat temp = encoded / 4096.0;\nfloat xZeroTo4095 = floor(temp);\nfloat stx = xZeroTo4095 / 4095.0;\nfloat sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;\nreturn vec2(stx, sty);\n}\n"}),define("Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates",[],function(){"use strict";return"mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n"}),define("Shaders/Builtin/Functions/ellipsoidContainsPoint",[],function(){"use strict";return"bool czm_ellipsoidContainsPoint(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n"}),define("Shaders/Builtin/Functions/ellipsoidNew",[],function(){"use strict";return"czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),define("Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates",[],function(){"use strict";return"vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n"}),define("Shaders/Builtin/Functions/equalsEpsilon",[],function(){"use strict";return"bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n"}),define("Shaders/Builtin/Functions/eyeOffset",[],function(){"use strict";return"vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n"}),define("Shaders/Builtin/Functions/eyeToWindowCoordinates",[],function(){"use strict";return"vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),define("Shaders/Builtin/Functions/fog",[],function(){"use strict";return"vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)\n{\nfloat scalar = distanceToCamera * czm_fogDensity;\nfloat fog = 1.0 - exp(-(scalar * scalar));\nreturn mix(color, fogColor, fog);\n}\n"}),define("Shaders/Builtin/Functions/geodeticSurfaceNormal",[],function(){"use strict";return"vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n"}),define("Shaders/Builtin/Functions/getDefaultMaterial",[],function(){"use strict";return"czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n"}),define("Shaders/Builtin/Functions/getLambertDiffuse",[],function(){"use strict";return"float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\n"}),define("Shaders/Builtin/Functions/getSpecular",[],function(){"use strict";return"float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, max(shininess, czm_epsilon2));\n}\n"}),define("Shaders/Builtin/Functions/getWaterNoise",[],function(){"use strict";return"vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n"}),define("Shaders/Builtin/Functions/getWgs84EllipsoidEC",[],function(){"use strict";return"czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6356752.314245);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n"}),define("Shaders/Builtin/Functions/HSBToRGB",[],function(){"use strict";return"const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);\nvec3 czm_HSBToRGB(vec3 hsb)\n{\nvec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);\nreturn hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);\n}\n"}),define("Shaders/Builtin/Functions/HSLToRGB",[],function(){"use strict";return"vec3 hueToRGB(float hue)\n{\nfloat r = abs(hue * 6.0 - 3.0) - 1.0;\nfloat g = 2.0 - abs(hue * 6.0 - 2.0);\nfloat b = 2.0 - abs(hue * 6.0 - 4.0);\nreturn clamp(vec3(r, g, b), 0.0, 1.0);\n}\nvec3 czm_HSLToRGB(vec3 hsl)\n{\nvec3 rgb = hueToRGB(hsl.x);\nfloat c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;\nreturn (rgb - 0.5) * c + hsl.z;\n}\n"}),define("Shaders/Builtin/Functions/hue",[],function(){"use strict";return"vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n"}),define("Shaders/Builtin/Functions/isEmpty",[],function(){"use strict";return"bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n"}),define("Shaders/Builtin/Functions/isFull",[],function(){"use strict";return"bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n"}),define("Shaders/Builtin/Functions/latitudeToWebMercatorFraction",[],function(){"use strict";return"float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nreturn (mercatorY - southMercatorY) * oneOverMercatorHeight;\n}\n"}),define("Shaders/Builtin/Functions/luminance",[],function(){"use strict";return"float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n"}),define("Shaders/Builtin/Functions/metersPerPixel",[],function(){"use strict";return"float czm_metersPerPixel(vec4 positionEC)\n{\nfloat width = czm_viewport.z;\nfloat height = czm_viewport.w;\nfloat pixelWidth;\nfloat pixelHeight;\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nfloat frustumWidth = right - left;\nfloat frustumHeight = top - bottom;\npixelWidth = frustumWidth / width;\npixelHeight = frustumHeight / height;\n}\nelse\n{\nfloat distanceToPixel = -positionEC.z;\nfloat inverseNear = 1.0 / czm_currentFrustum.x;\nfloat tanTheta = top * inverseNear;\npixelHeight = 2.0 * distanceToPixel * tanTheta / height;\ntanTheta = right * inverseNear;\npixelWidth = 2.0 * distanceToPixel * tanTheta / width;\n}\nreturn max(pixelWidth, pixelHeight);\n}\n"}),define("Shaders/Builtin/Functions/modelToWindowCoordinates",[],function(){"use strict";return"vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n"}),define("Shaders/Builtin/Functions/multiplyWithColorBalance",[],function(){"use strict";return"vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n"}),define("Shaders/Builtin/Functions/nearFarScalar",[],function(){"use strict";return"float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)\n{\nfloat valueAtMin = nearFarScalar.y;\nfloat valueAtMax = nearFarScalar.w;\nfloat nearDistanceSq = nearFarScalar.x * nearFarScalar.x;\nfloat farDistanceSq = nearFarScalar.z * nearFarScalar.z;\nfloat t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(clamp(t, 0.0, 1.0), 0.2);\nreturn mix(valueAtMin, valueAtMax, t);\n}\n"}),define("Shaders/Builtin/Functions/octDecode",[],function(){"use strict";return"vec3 czm_octDecode(vec2 encoded, float range)\n{\nif (encoded.x == 0.0 && encoded.y == 0.0) {\nreturn vec3(0.0, 0.0, 0.0);\n}\nencoded = encoded / range * 2.0 - 1.0;\nvec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));\nif (v.z < 0.0)\n{\nv.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);\n}\nreturn normalize(v);\n}\nvec3 czm_octDecode(vec2 encoded)\n{\nreturn czm_octDecode(encoded, 255.0);\n}\nvec3 czm_octDecode(float encoded)\n{\nfloat temp = encoded / 256.0;\nfloat x = floor(temp);\nfloat y = (temp - x) * 256.0;\nreturn czm_octDecode(vec2(x, y));\n}\nvoid czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)\n{\nfloat temp = encoded.x / 65536.0;\nfloat x = floor(temp);\nfloat encodedFloat1 = (temp - x) * 65536.0;\ntemp = encoded.y / 65536.0;\nfloat y = floor(temp);\nfloat encodedFloat2 = (temp - y) * 65536.0;\nvector1 = czm_octDecode(encodedFloat1);\nvector2 = czm_octDecode(encodedFloat2);\nvector3 = czm_octDecode(vec2(x, y));\n}\n"}),define("Shaders/Builtin/Functions/packDepth",[],function(){"use strict";return"vec4 czm_packDepth(float depth)\n{\nvec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\nenc = fract(enc);\nenc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\nreturn enc;\n}\n"}),define("Shaders/Builtin/Functions/phong",[],function(){"use strict";return"float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn czm_getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\n}\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\nvec4 czm_private_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_private_getLambertDiffuseOfMaterial(czm_sunDirectionEC, material);\nfloat specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"; +}),define("Shaders/Builtin/Functions/pointAlongRay",[],function(){"use strict";return"vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n"}),define("Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval",[],function(){"use strict";return"czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, czm_ellipsoid ellipsoid)\n{\nvec3 q = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ellipsoid.center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n"}),define("Shaders/Builtin/Functions/RGBToHSB",[],function(){"use strict";return"const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);\nvec3 czm_RGBToHSB(vec3 rgb)\n{\nvec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));\nvec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));\nfloat d = q.x - min(q.w, q.y);\nreturn vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);\n}\n"}),define("Shaders/Builtin/Functions/RGBToHSL",[],function(){"use strict";return"vec3 RGBtoHCV(vec3 rgb)\n{\nvec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);\nvec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);\nfloat c = q.x - min(q.w, q.y);\nfloat h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);\nreturn vec3(h, c, q.x);\n}\nvec3 czm_RGBToHSL(vec3 rgb)\n{\nvec3 hcv = RGBtoHCV(rgb);\nfloat l = hcv.z - hcv.y * 0.5;\nfloat s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);\nreturn vec3(hcv.x, s, l);\n}\n"}),define("Shaders/Builtin/Functions/RGBToXYZ",[],function(){"use strict";return"vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n"}),define("Shaders/Builtin/Functions/saturation",[],function(){"use strict";return"vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n"}),define("Shaders/Builtin/Functions/shadowDepthCompare",[],function(){"use strict";return"float czm_sampleShadowMap(samplerCube shadowMap, vec3 d)\n{\nreturn czm_unpackDepth(textureCube(shadowMap, d));\n}\nfloat czm_sampleShadowMap(sampler2D shadowMap, vec2 uv)\n{\n#ifdef USE_SHADOW_DEPTH_TEXTURE\nreturn texture2D(shadowMap, uv).r;\n#else\nreturn czm_unpackDepth(texture2D(shadowMap, uv));\n#endif\n}\nfloat czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\nfloat czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)\n{\nreturn step(depth, czm_sampleShadowMap(shadowMap, uv));\n}\n"}),define("Shaders/Builtin/Functions/shadowVisibility",[],function(){"use strict";return"float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)\n{\n#ifdef USE_NORMAL_SHADING\n#ifdef USE_NORMAL_SHADING_SMOOTH\nfloat strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);\n#else\nfloat strength = step(0.0, nDotL);\n#endif\nvisibility *= strength;\n#endif\nvisibility = max(visibility, darkness);\nreturn visibility;\n}\n#ifdef USE_CUBE_MAP_SHADOW\nfloat czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec3 uvw = shadowParameters.texCoords;\ndepth -= depthBias;\nfloat visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#else\nfloat czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)\n{\nfloat depthBias = shadowParameters.depthBias;\nfloat depth = shadowParameters.depth;\nfloat nDotL = shadowParameters.nDotL;\nfloat normalShadingSmooth = shadowParameters.normalShadingSmooth;\nfloat darkness = shadowParameters.darkness;\nvec2 uv = shadowParameters.texCoords;\ndepth -= depthBias;\n#ifdef USE_SOFT_SHADOWS\nvec2 texelStepSize = shadowParameters.texelStepSize;\nfloat radius = 1.0;\nfloat dx0 = -texelStepSize.x * radius;\nfloat dy0 = -texelStepSize.y * radius;\nfloat dx1 = texelStepSize.x * radius;\nfloat dy1 = texelStepSize.y * radius;\nfloat visibility = (\nczm_shadowDepthCompare(shadowMap, uv, depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +\nczm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)\n) * (1.0 / 9.0);\n#else\nfloat visibility = czm_shadowDepthCompare(shadowMap, uv, depth);\n#endif\nreturn czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);\n}\n#endif\n"}),define("Shaders/Builtin/Functions/signNotZero",[],function(){"use strict";return"float czm_signNotZero(float value)\n{\nreturn value >= 0.0 ? 1.0 : -1.0;\n}\nvec2 czm_signNotZero(vec2 value)\n{\nreturn vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));\n}\nvec3 czm_signNotZero(vec3 value)\n{\nreturn vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));\n}\nvec4 czm_signNotZero(vec4 value)\n{\nreturn vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));\n}\n"}),define("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix",[],function(){"use strict";return"mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 bitangent = normalize(bitangentEC);\nreturn mat3(tangent.x , tangent.y , tangent.z,\nbitangent.x, bitangent.y, bitangent.z,\nnormal.x , normal.y , normal.z);\n}\n"}),define("Shaders/Builtin/Functions/translateRelativeToEye",[],function(){"use strict";return"vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n"}),define("Shaders/Builtin/Functions/translucentPhong",[],function(){"use strict";return"vec4 czm_translucentPhong(vec3 toEye, czm_material material)\n{\nfloat diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);\nif (czm_sceneMode == czm_sceneMode3D) {\ndiffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);\n}\ndiffuse = clamp(diffuse, 0.0, 1.0);\nfloat specular = czm_getSpecular(czm_sunDirectionEC, toEye, material.normal, material.shininess);\nspecular += czm_getSpecular(czm_moonDirectionEC, toEye, material.normal, material.shininess);\nvec3 materialDiffuse = material.diffuse * 0.5;\nvec3 ambient = materialDiffuse;\nvec3 color = ambient + material.emission;\ncolor += materialDiffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n"}),define("Shaders/Builtin/Functions/transpose",[],function(){"use strict";return"mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n"}),define("Shaders/Builtin/Functions/unpackDepth",[],function(){"use strict";return"float czm_unpackDepth(vec4 packedDepth)\n{\nreturn dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));\n}\n"}),define("Shaders/Builtin/Functions/windowToEyeCoordinates",[],function(){"use strict";return"vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nif (czm_inverseProjection != mat4(0.0)) {\nq = czm_inverseProjection * q;\n} else {\nfloat top = czm_frustumPlanes.x;\nfloat bottom = czm_frustumPlanes.y;\nfloat left = czm_frustumPlanes.z;\nfloat right = czm_frustumPlanes.w;\nfloat near = czm_currentFrustum.x;\nfloat far = czm_currentFrustum.y;\nq.x = (q.x * (right - left) + left + right) * 0.5;\nq.y = (q.y * (top - bottom) + bottom + top) * 0.5;\nq.z = (q.z * (near - far) - near - far) * 0.5;\nq.w = 1.0;\n}\nreturn q;\n}\n"}),define("Shaders/Builtin/Functions/XYZToRGB",[],function(){"use strict";return"vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n"}),define("Shaders/Builtin/CzmBuiltins",["./Constants/degreesPerRadian","./Constants/depthRange","./Constants/epsilon1","./Constants/epsilon2","./Constants/epsilon3","./Constants/epsilon4","./Constants/epsilon5","./Constants/epsilon6","./Constants/epsilon7","./Constants/infinity","./Constants/oneOverPi","./Constants/oneOverTwoPi","./Constants/passCompute","./Constants/passEnvironment","./Constants/passGlobe","./Constants/passGround","./Constants/passOpaque","./Constants/passOverlay","./Constants/passTranslucent","./Constants/pi","./Constants/piOverFour","./Constants/piOverSix","./Constants/piOverThree","./Constants/piOverTwo","./Constants/radiansPerDegree","./Constants/sceneMode2D","./Constants/sceneMode3D","./Constants/sceneModeColumbusView","./Constants/sceneModeMorphing","./Constants/solarRadius","./Constants/threePiOver2","./Constants/twoPi","./Constants/webMercatorMaxLatitude","./Structs/depthRangeStruct","./Structs/ellipsoid","./Structs/material","./Structs/materialInput","./Structs/ray","./Structs/raySegment","./Structs/shadowParameters","./Functions/alphaWeight","./Functions/antialias","./Functions/cascadeColor","./Functions/cascadeDistance","./Functions/cascadeMatrix","./Functions/cascadeWeights","./Functions/columbusViewMorph","./Functions/computePosition","./Functions/cosineAndSine","./Functions/decompressTextureCoordinates","./Functions/eastNorthUpToEyeCoordinates","./Functions/ellipsoidContainsPoint","./Functions/ellipsoidNew","./Functions/ellipsoidWgs84TextureCoordinates","./Functions/equalsEpsilon","./Functions/eyeOffset","./Functions/eyeToWindowCoordinates","./Functions/fog","./Functions/geodeticSurfaceNormal","./Functions/getDefaultMaterial","./Functions/getLambertDiffuse","./Functions/getSpecular","./Functions/getWaterNoise","./Functions/getWgs84EllipsoidEC","./Functions/HSBToRGB","./Functions/HSLToRGB","./Functions/hue","./Functions/isEmpty","./Functions/isFull","./Functions/latitudeToWebMercatorFraction","./Functions/luminance","./Functions/metersPerPixel","./Functions/modelToWindowCoordinates","./Functions/multiplyWithColorBalance","./Functions/nearFarScalar","./Functions/octDecode","./Functions/packDepth","./Functions/phong","./Functions/pointAlongRay","./Functions/rayEllipsoidIntersectionInterval","./Functions/RGBToHSB","./Functions/RGBToHSL","./Functions/RGBToXYZ","./Functions/saturation","./Functions/shadowDepthCompare","./Functions/shadowVisibility","./Functions/signNotZero","./Functions/tangentToEyeSpaceMatrix","./Functions/translateRelativeToEye","./Functions/translucentPhong","./Functions/transpose","./Functions/unpackDepth","./Functions/windowToEyeCoordinates","./Functions/XYZToRGB"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R,N,k,L,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,ge,ve,_e,ye,be,Ce,we,Se,Ee,Te,xe,Pe,Ae,De,Ie,Me,Oe,Re,Ne,ke,Le,Fe,Be,Ue){"use strict";return{czm_degreesPerRadian:e,czm_depthRange:t,czm_epsilon1:r,czm_epsilon2:i,czm_epsilon3:n,czm_epsilon4:o,czm_epsilon5:a,czm_epsilon6:s,czm_epsilon7:l,czm_infinity:u,czm_oneOverPi:c,czm_oneOverTwoPi:d,czm_passCompute:h,czm_passEnvironment:p,czm_passGlobe:f,czm_passGround:m,czm_passOpaque:g,czm_passOverlay:v,czm_passTranslucent:_,czm_pi:y,czm_piOverFour:b,czm_piOverSix:C,czm_piOverThree:w,czm_piOverTwo:S,czm_radiansPerDegree:E,czm_sceneMode2D:T,czm_sceneMode3D:x,czm_sceneModeColumbusView:P,czm_sceneModeMorphing:A,czm_solarRadius:D,czm_threePiOver2:I,czm_twoPi:M,czm_webMercatorMaxLatitude:O,czm_depthRangeStruct:R,czm_ellipsoid:N,czm_material:k,czm_materialInput:L,czm_ray:F,czm_raySegment:B,czm_shadowParameters:U,czm_alphaWeight:V,czm_antialias:z,czm_cascadeColor:G,czm_cascadeDistance:H,czm_cascadeMatrix:W,czm_cascadeWeights:j,czm_columbusViewMorph:q,czm_computePosition:Y,czm_cosineAndSine:X,czm_decompressTextureCoordinates:Q,czm_eastNorthUpToEyeCoordinates:Z,czm_ellipsoidContainsPoint:K,czm_ellipsoidNew:J,czm_ellipsoidWgs84TextureCoordinates:$,czm_equalsEpsilon:ee,czm_eyeOffset:te,czm_eyeToWindowCoordinates:re,czm_fog:ie,czm_geodeticSurfaceNormal:ne,czm_getDefaultMaterial:oe,czm_getLambertDiffuse:ae,czm_getSpecular:se,czm_getWaterNoise:le,czm_getWgs84EllipsoidEC:ue,czm_HSBToRGB:ce,czm_HSLToRGB:de,czm_hue:he,czm_isEmpty:pe,czm_isFull:fe,czm_latitudeToWebMercatorFraction:me,czm_luminance:ge,czm_metersPerPixel:ve,czm_modelToWindowCoordinates:_e,czm_multiplyWithColorBalance:ye,czm_nearFarScalar:be,czm_octDecode:Ce,czm_packDepth:we,czm_phong:Se,czm_pointAlongRay:Ee,czm_rayEllipsoidIntersectionInterval:Te,czm_RGBToHSB:xe,czm_RGBToHSL:Pe,czm_RGBToXYZ:Ae,czm_saturation:De,czm_shadowDepthCompare:Ie,czm_shadowVisibility:Me,czm_signNotZero:Oe,czm_tangentToEyeSpaceMatrix:Re,czm_translateRelativeToEye:Ne,czm_translucentPhong:ke,czm_transpose:Le,czm_unpackDepth:Fe,czm_windowToEyeCoordinates:Be,czm_XYZToRGB:Ue}}),define("Renderer/ShaderSource",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Shaders/Builtin/CzmBuiltins","./AutomaticUniforms"],function(e,t,r,i,n){"use strict";function o(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(e){for(var t=e.match(/\n/gm).length,r="",i=0;i<t;++i)r+="\n";return r})}function a(e,r,i){for(var n,a=0;a<i.length;++a)i[a].name===e&&(n=i[a]);return t(n)||(r=o(r),n={name:e,glslSource:r,dependsOn:[],requiredBy:[],evaluated:!1},i.push(n)),n}function s(e,r){if(!e.evaluated){e.evaluated=!0;var i=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);t(i)&&null!==i&&(i=i.filter(function(e,t){return i.indexOf(e)===t}),i.forEach(function(t){if(t!==e.name&&d._czmBuiltinsAndUniforms.hasOwnProperty(t)){var i=a(t,d._czmBuiltinsAndUniforms[t],r);e.dependsOn.push(i),i.requiredBy.push(e),s(i,r)}}))}}function l(e){for(var t=[],r=[];e.length>0;){var i=e.pop();r.push(i),0===i.requiredBy.length&&t.push(i)}for(;t.length>0;){var n=t.shift();e.push(n);for(var o=0;o<n.dependsOn.length;++o){var a=n.dependsOn[o],s=a.requiredBy.indexOf(n);a.requiredBy.splice(s,1),0===a.requiredBy.length&&t.push(a)}}for(var l=[],u=0;u<r.length;++u)0!==r[u].requiredBy.length&&l.push(r[u])}function u(e){var t=[],r=a("main",e,t);s(r,t),l(t);for(var i="",n=t.length-1;n>=0;--n)i=i+t[n].glslSource+"\n";return i.replace(r.glslSource,"")}function c(e,r){var i,n,a="",s=e.sources;if(t(s))for(i=0,n=s.length;i<n;++i)a+="\n#line 0\n"+s[i];a=o(a);var l;a=a.replace(/#version\s+(.*?)\n/gm,function(e,t){return l=t,"\n"}),a=a.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");var c=e.pickColorQualifier;t(c)&&(a=d.createPickFragmentShaderSource(a,c));var h="";t(l)&&(h="#version "+l),r&&(h+="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n#else\n precision mediump float;\n#endif\n\n");var p=e.defines;if(t(p))for(i=0,n=p.length;i<n;++i){var f=p[i];0!==f.length&&(h+="#define "+f+"\n")}return e.includeBuiltIns&&(h+=u(a)),h+="\n#line 0\n",h+=a}function d(r){r=e(r,e.EMPTY_OBJECT);var i=r.pickColorQualifier;this.defines=t(r.defines)?r.defines.slice(0):[],this.sources=t(r.sources)?r.sources.slice(0):[],this.pickColorQualifier=i,this.includeBuiltIns=e(r.includeBuiltIns,!0)}d.prototype.clone=function(){return new d({sources:this.sources,defines:this.defines,pickColorQuantifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})},d.replaceMain=function(e,t){return t="void "+t+"()",e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)},d.prototype.createCombinedVertexShader=function(){return c(this,!1)},d.prototype.createCombinedFragmentShader=function(){return c(this,!0)},d._czmBuiltinsAndUniforms={};for(var h in i)i.hasOwnProperty(h)&&(d._czmBuiltinsAndUniforms[h]=i[h]);for(var p in n)if(n.hasOwnProperty(p)){var f=n[p];"function"==typeof f.getDeclaration&&(d._czmBuiltinsAndUniforms[p]=f.getDeclaration(p))}d.createPickVertexShaderSource=function(e){var t=d.replaceMain(e,"czm_old_main"),r="attribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}";return t+"\n"+r},d.createPickFragmentShaderSource=function(e,t){var r=d.replaceMain(e,"czm_old_main"),i=t+" vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n if (gl_FragColor.a == 0.0) { \n discard; \n } \n gl_FragColor = czm_pickColor; \n}";return r+"\n"+i},d.findVarying=function(e,t){for(var r=e.sources,i=t.length,n=0;n<i;++n)for(var o=t[n],a=r.length,s=0;s<a;++s)if(r[s].indexOf(o)!==-1)return o};var m=["v_normalEC","v_normal"];d.findNormalVarying=function(e){return d.findVarying(e,m)};var g=["v_positionEC"];return d.findPositionVarying=function(e){return d.findVarying(e,g)},d}),define("Renderer/Buffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/IndexDatatype","../Core/WebGLConstants","./BufferUsage"],function(e,t,r,i,n,o,a,s){"use strict";function l(r){r=e(r,e.EMPTY_OBJECT);var i=r.context._gl,n=r.bufferTarget,o=r.typedArray,a=r.sizeInBytes,s=r.usage,l=t(o);l&&(a=o.byteLength);var u=i.createBuffer();i.bindBuffer(n,u),i.bufferData(n,l?o:a,s),i.bindBuffer(n,null),this._gl=i,this._bufferTarget=n,this._sizeInBytes=a,this._usage=s,this._buffer=u,this.vertexArrayDestroyable=!0}return l.createVertexBuffer=function(e){return new l({context:e.context,bufferTarget:a.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})},l.createIndexBuffer=function(e){var t=e.context,i=e.indexDatatype,n=o.getSizeInBytes(i),s=new l({context:t,bufferTarget:a.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),u=s.sizeInBytes/n;return r(s,{indexDatatype:{get:function(){return i}},bytesPerIndex:{get:function(){return n}},numberOfIndices:{get:function(){return u}}}),s},r(l.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}}),l.prototype._getBuffer=function(){return this._buffer},l.prototype.copyFromArrayView=function(t,r){r=e(r,0);var i=this._gl,n=this._bufferTarget;i.bindBuffer(n,this._buffer),i.bufferSubData(n,r,t),i.bindBuffer(n,null)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),i(this)},l}),define("Renderer/VertexArray",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/IndexDatatype","../Core/Math","../Core/RuntimeError","./Buffer","./BufferUsage","./ContextLimits"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(i,n,o,a){var s=r(n.vertexBuffer),l=r(n.value),u=n.value?n.value.length:n.componentsPerAttribute,c={index:t(n.index,o),enabled:t(n.enabled,!0),vertexBuffer:n.vertexBuffer,value:l?n.value.slice(0):void 0,componentsPerAttribute:u,componentDatatype:t(n.componentDatatype,e.FLOAT),normalize:t(n.normalize,!1),offsetInBytes:t(n.offsetInBytes,0),strideInBytes:t(n.strideInBytes,0),instanceDivisor:t(n.instanceDivisor,0)};if(s)c.vertexAttrib=function(e){var t=this.index;e.bindBuffer(e.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),e.vertexAttribPointer(t,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),e.enableVertexAttribArray(t),this.instanceDivisor>0&&(a.glVertexAttribDivisor(t,this.instanceDivisor),a._vertexAttribDivisors[t]=this.instanceDivisor,a._previousDrawInstanced=!0)},c.disableVertexAttribArray=function(e){e.disableVertexAttribArray(this.index),this.instanceDivisor>0&&a.glVertexAttribDivisor(o,0)};else{switch(c.componentsPerAttribute){case 1:c.vertexAttrib=function(e){e.vertexAttrib1fv(this.index,this.value)};break;case 2:c.vertexAttrib=function(e){e.vertexAttrib2fv(this.index,this.value)};break;case 3:c.vertexAttrib=function(e){e.vertexAttrib3fv(this.index,this.value)};break;case 4:c.vertexAttrib=function(e){e.vertexAttrib4fv(this.index,this.value)}}c.disableVertexAttribArray=function(e){}}i.push(c)}function f(e,t,i){for(var n=0;n<t.length;++n){var o=t[n];o.enabled&&o.vertexAttrib(e)}r(i)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i._getBuffer())}function m(i){i=t(i,t.EMPTY_OBJECT);var n,o=i.context,a=o._gl,s=i.attributes,l=i.indexBuffer,u=[],c=1,d=!1,h=!1,m=s.length;for(n=0;n<m;++n)p(u,s[n],n,o);for(m=u.length,n=0;n<m;++n){var g=u[n];if(r(g.vertexBuffer)&&0===g.instanceDivisor){var v=g.strideInBytes||g.componentsPerAttribute*e.getSizeInBytes(g.componentDatatype);c=g.vertexBuffer.sizeInBytes/v;break}}for(n=0;n<m;++n)u[n].instanceDivisor>0&&(d=!0),r(u[n].value)&&(h=!0);var _;o.vertexArrayObject&&(_=o.glCreateVertexArray(),o.glBindVertexArray(_),f(a,u,l),o.glBindVertexArray(null)),this._numberOfVertices=c,this._hasInstancedAttributes=d,this._hasConstantAttributes=h,this._context=o,this._gl=a,this._vao=_,this._attributes=u,this._indexBuffer=l}function g(e){return e.values.length/e.componentsPerAttribute}function v(t){return e.getSizeInBytes(t.componentDatatype)*t.componentsPerAttribute}function _(t){var i,n,o,a=[];for(n in t)t.hasOwnProperty(n)&&r(t[n])&&r(t[n].values)&&(a.push(n),t[n].componentDatatype===e.DOUBLE&&(t[n].componentDatatype=e.FLOAT,t[n].values=e.createTypedArray(e.FLOAT,t[n].values)));var s,l=a.length;if(l>0)for(s=g(t[a[0]]),i=1;i<l;++i){var c=g(t[a[i]]);if(c!==s)throw new u("Each attribute list must have the same number of vertices. Attribute "+a[i]+" has a different number of vertices ("+c.toString()+") than attribute "+a[0]+" ("+s.toString()+").")}a.sort(function(r,i){return e.getSizeInBytes(t[i].componentDatatype)-e.getSizeInBytes(t[r].componentDatatype)});var d=0,h={};for(i=0;i<l;++i)n=a[i],o=t[n],h[n]=d,d+=v(o);if(d>0){var p=e.getSizeInBytes(t[a[0]].componentDatatype),f=d%p;0!==f&&(d+=p-f);var m=s*d,_=new ArrayBuffer(m),y={};for(i=0;i<l;++i){n=a[i];var b=e.getSizeInBytes(t[n].componentDatatype);y[n]={pointer:e.createTypedArray(t[n].componentDatatype,_),index:h[n]/b,strideInComponentType:d/b}}for(i=0;i<s;++i)for(var C=0;C<l;++C){n=a[C],o=t[n];for(var w=o.values,S=y[n],E=S.pointer,T=o.componentsPerAttribute,x=0;x<T;++x)E[S.index+x]=w[i*T+x];S.index+=S.strideInComponentType}return{buffer:_,offsetsInBytes:h,vertexSizeInBytes:d}}}function y(e){var t=e._context,r=e._hasInstancedAttributes;if(r||t._previousDrawInstanced){t._previousDrawInstanced=r;var i,n=t._vertexAttribDivisors,o=e._attributes,a=h.maximumVertexAttributes;if(r){var s=o.length;for(i=0;i<s;++i){var l=o[i];if(l.enabled){var u=l.instanceDivisor,c=l.index;u!==n[c]&&(t.glVertexAttribDivisor(c,u),n[c]=u)}}}else for(i=0;i<a;++i)n[i]>0&&(t.glVertexAttribDivisor(i,0),n[i]=0)}}function b(e,t){for(var i=e._attributes,n=i.length,o=0;o<n;++o){var a=i[o];a.enabled&&r(a.value)&&a.vertexAttrib(t)}}return m.fromGeometry=function(i){i=t(i,t.EMPTY_OBJECT);var n,o,u,h=i.context,p=t(i.geometry,t.EMPTY_OBJECT),f=t(i.bufferUsage,d.DYNAMIC_DRAW),g=t(i.attributeLocations,t.EMPTY_OBJECT),v=t(i.interleave,!1),y=i.vertexArrayAttributes,b=r(y)?y:[],C=p.attributes;if(v){var w=_(C);if(r(w)){u=c.createVertexBuffer({context:h,typedArray:w.buffer,usage:f});var S=w.offsetsInBytes,E=w.vertexSizeInBytes;for(n in C)C.hasOwnProperty(n)&&r(C[n])&&(o=C[n],r(o.values)?b.push({index:g[n],vertexBuffer:u,componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,offsetInBytes:S[n],strideInBytes:E}):b.push({index:g[n],value:o.value,componentDatatype:o.componentDatatype,normalize:o.normalize}))}}else for(n in C)if(C.hasOwnProperty(n)&&r(C[n])){o=C[n];var T=o.componentDatatype;T===e.DOUBLE&&(T=e.FLOAT),u=void 0,r(o.values)&&(u=c.createVertexBuffer({context:h,typedArray:e.createTypedArray(T,o.values),usage:f})),b.push({index:g[n],vertexBuffer:u,value:o.value,componentDatatype:T,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize})}var x,P=p.indices;return r(P)&&(x=a.computeNumberOfVertices(p)>=l.SIXTY_FOUR_KILOBYTES&&h.elementIndexUint?c.createIndexBuffer({context:h,typedArray:new Uint32Array(P),usage:f,indexDatatype:s.UNSIGNED_INT}):c.createIndexBuffer({context:h,typedArray:new Uint16Array(P),usage:f,indexDatatype:s.UNSIGNED_SHORT})),new m({context:h,attributes:b,indexBuffer:x})},i(m.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}}),m.prototype.getAttribute=function(e){return this._attributes[e]},m.prototype._bind=function(){r(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&y(this),this._hasConstantAttributes&&b(this,this._gl)):f(this._gl,this._attributes,this._indexBuffer)},m.prototype._unBind=function(){if(r(this._vao))this._context.glBindVertexArray(null);else{for(var e=this._attributes,t=this._gl,i=0;i<e.length;++i){var n=e[i];n.enabled&&n.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){for(var e=this._attributes,t=0;t<e.length;++t){var i=e[t].vertexBuffer;r(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}var o=this._indexBuffer;return r(o)&&!o.isDestroyed()&&o.vertexArrayDestroyable&&o.destroy(),r(this._vao)&&this._context.glDeleteVertexArray(this._vao),n(this)},m}),define("Scene/BatchTable",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/combine","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/Math","../Core/PixelFormat","../Renderer/ContextLimits","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(t,i,n){if(this._attributes=i,this._numberOfInstances=n,0!==i.length){var o=y(i),a=t.floatingPointTexture,s=o===p.FLOAT&&!a,l=C(i,s),u=w(l,i,s),c=Math.floor(h.maximumTextureSize/u),d=Math.min(n,c),f=u*d,m=Math.ceil(n/d),g=1/f,v=.5*g,_=1/m,b=.5*_;this._textureDimensions=new e(f,m),this._textureStep=new r(g,v,_,b),this._pixelDatatype=s?p.UNSIGNED_BYTE:o,this._packFloats=s,this._offsets=l,this._stride=u,this._texture=void 0;var S=4*f*m;this._batchValues=o!==p.FLOAT||s?new Uint8Array(S):new Float32Array(S),this._batchValuesDirty=!1}}function y(e){for(var t=!1,r=e.length,i=0;i<r;++i)if(e[i].componentDatatype!==n.UNSIGNED_BYTE){t=!0;break}return t?p.FLOAT:p.UNSIGNED_BYTE}function b(i,n){var o=i[n].componentsPerAttribute;return 2===o?e:3===o?t:4===o?r:Number}function C(e,t){for(var r=new Array(e.length),i=0,o=e.length,a=0;a<o;++a){var s=e[a],l=s.componentDatatype;r[a]=i,l!==n.UNSIGNED_BYTE&&t?i+=4:++i}return r}function w(e,t,r){var i=e.length,o=e[i-1],a=t[i-1],s=a.componentDatatype;return s!==n.UNSIGNED_BYTE&&r?o+4:o+1}function S(e){var t=e.w/2,r=Math.floor(t),i=2*(t-r);if(r-=z,i=2*i-1,i=-i,r>=z)return i<0?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY;var n=i*e.x*B;return n+=i*e.y*U,n+=i*e.z*V,n*Math.pow(10,r)}function E(e,t,i){var n=r.unpack(e,t,N),o=S(n);n=r.unpack(e,t+4,N);var a=S(n);n=r.unpack(e,t+8,N);var s=S(n);n=r.unpack(e,t+12,N);var l=S(n);return r.fromElements(o,a,s,l,i)}function T(e,t){if(G[0]=e,e=G[0],0===e)return r.clone(r.ZERO,t);var i,n=e<0?1:0;isFinite(e)?(e=Math.abs(e),i=Math.floor(c.logBase(e,10))+1,e/=Math.pow(10,i)):(e=.1,i=z);var o=e*k;return t.x=Math.floor(o),o=(o-t.x)*k,t.y=Math.floor(o),o=(o-t.y)*k,t.z=Math.floor(o),t.w=2*(i+z)+n,t}function x(e,t,i){var n=T(e.x,N);r.pack(n,t,i),n=T(e.y,n),r.pack(n,t,i+4),n=T(e.z,n),r.pack(n,t,i+8),n=T(e.w,n),r.pack(n,t,i+12)}function P(e,t){var r=e._textureDimensions;e._texture=new m({context:t,pixelFormat:d.RGBA,pixelDatatype:e._pixelDatatype,width:r.x,height:r.y,sampler:new f({minificationFilter:v.NEAREST,magnificationFilter:g.NEAREST})})}function A(e){var t=e._textureDimensions;e._texture.copyFrom({width:t.x,height:t.y,arrayBufferView:e._batchValues})}function D(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), 1.0 - (centerY + (yId * stepY))); \n} \n"}function I(e){return e._packFloats?"float unpackFloat(vec4 value) \n{ \n value *= 255.0; \n float temp = value.w / 2.0; \n float exponent = floor(temp); \n float sign = (temp - exponent) * 2.0; \n exponent = exponent - float("+z+"); \n sign = sign * 2.0 - 1.0; \n sign = -sign; \n float unpacked = sign * value.x * float("+B+"); \n unpacked += sign * value.y * float("+U+"); \n unpacked += sign * value.z * float("+V+"); \n return unpacked * pow(10.0, exponent); \n} \n":""; +}function M(e){return 1===e?"float":"vec"+e}function O(e){return 1===e?".x":2===e?".xy":3===e?".xyz":""}function R(e,t){var r=e._attributes,i=r[t],o=i.componentsPerAttribute,a=i.functionName,s=M(o),l=O(o),u=e._offsets[t],c=s+" "+a+"(float batchId) \n{ \n vec2 st = computeSt(batchId); \n st.x += batchTextureStep.x * float("+u+"); \n";return c+=e._packFloats&&i.componentDatatype!==p.UNSIGNED_BYTE?"vec4 textureValue; \ntextureValue.x = unpackFloat(texture2D(batchTexture, st)); \ntextureValue.y = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x, 0.0))); \ntextureValue.z = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0))); \ntextureValue.w = unpackFloat(texture2D(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0))); \n":" vec4 textureValue = texture2D(batchTexture, st); \n",c+=" "+s+" value = textureValue"+l+"; \n",e._pixelDatatype!==p.UNSIGNED_BYTE||i.componentDatatype!==n.UNSIGNED_BYTE||i.normalize?e._pixelDatatype===p.FLOAT&&i.componentDatatype===n.UNSIGNED_BYTE&&i.normalize&&(c+="value /= 255.0; \n"):c+="value *= 255.0; \n",c+=" return value; \n} \n"}a(_.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});var N=new r,k=256,L=65536,F=16777216,B=1/k,U=1/L,V=1/F,z=38;if(u.supportsTypedArrays()){var G=new Float32Array(1),H=new r;_.prototype.getBatchedAttribute=function(e,t,i){var n,a=this._attributes,s=this._offsets[t],l=this._stride,u=4*l*e+4*s;n=this._packFloats&&a[t].componentDatatype!==p.UNSIGNED_BYTE?E(this._batchValues,u,H):r.unpack(this._batchValues,u,H);var c=b(a,t);return o(c.fromCartesian4)?c.fromCartesian4(n,i):o(c.clone)?c.clone(n,i):n.x};var W=[void 0,void 0,new e,new t,new r],j=new r;return _.prototype.setBatchedAttribute=function(e,t,i){var n=this._attributes,a=W[n[t].componentsPerAttribute],s=this.getBatchedAttribute(e,t,a),l=b(this._attributes,t),u=o(l.equals)?l.equals(s,i):s===i;if(!u){var c=j;c.x=o(i.x)?i.x:i,c.y=o(i.y)?i.y:0,c.z=o(i.z)?i.z:0,c.w=o(i.w)?i.w:0;var d=this._offsets[t],h=this._stride,f=4*h*e+4*d;this._packFloats&&n[t].componentDatatype!==p.UNSIGNED_BYTE?x(c,this._batchValues,f):r.pack(c,this._batchValues,f),this._batchValuesDirty=!0}},_.prototype.update=function(e){o(this._texture)&&!this._batchValuesDirty||0===this._attributes.length||(this._batchValuesDirty=!1,o(this._texture)||P(this,e.context),A(this))},_.prototype.getUniformMapCallback=function(){var e=this;return function(t){if(0===e._attributes.length)return t;var r={batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}};return i(t,r)}},_.prototype.getVertexShaderCallback=function(){var e=this._attributes;if(0===e.length)return function(e){return e};var t="uniform sampler2D batchTexture; \n";t+=D(this)+"\n",t+=I(this)+"\n";for(var r=e.length,i=0;i<r;++i)t+=R(this,i);return function(e){var r=e.indexOf("void main"),i=e.substring(0,r),n=e.substring(r);return i+"\n"+t+"\n"+n}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),s(this)},_}}),define("Scene/DepthFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS};return e(r)}),define("Shaders/Appearances/PolylineMaterialAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec2 st;\nattribute float batchId;\nvarying float v_width;\nvarying vec2 v_st;\nvarying float v_angle;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_width = width;\nv_st = st;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, v_angle);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"});define("Shaders/PolylineCommon",[],function(){"use strict";return"void clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance = -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) {\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * position;\nvec4 prevEC = czm_modelViewRelativeToEye * previous;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nvec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);\nvec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);\nvec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);\n#ifdef POLYLINE_DASH\nvec2 lineDir;\nif (usePrevious) {\nlineDir = normalize(positionWindow.xy - previousWindow.xy);\n}\nelse {\nlineDir = normalize(nextWindow.xy - positionWindow.xy);\n}\nangle = atan(lineDir.x, lineDir.y) - 1.570796327;\nangle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;\n#endif\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\nreturn vec4(0.0, 0.0, 0.0, 1.0);\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(previous.xyz - position.xyz, vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(next.xyz - position.xyz, vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDirection * expandWidth * czm_resolutionScale;\nreturn vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\n}\n"});define("Shaders/PolylineFS",[],function(){"use strict";return"varying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n"}),define("Scene/PolylineMaterialAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PolylineMaterialAppearanceVS","../Shaders/PolylineCommon","../Shaders/PolylineFS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),n=!1,o=u.VERTEX_FORMAT;this.material=t(r.material)?r.material:l.fromType(l.ColorType),this.translucent=i,this._vertexShaderSource=e(r.vertexShaderSource,c),this._fragmentShaderSource=e(r.fragmentShaderSource,d),this._renderState=s.getDefaultRenderState(i,n,r.renderState),this._closed=n,this._vertexFormat=o}var c=o+"\n"+n,d=a;return r(u.prototype,{vertexShaderSource:{get:function(){var e=this._vertexShaderSource;return this.material.shaderSource.search(/varying\s+float\s+v_angle;/g)!==-1&&(e="#define POLYLINE_DASH\n"+e),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),u.VERTEX_FORMAT=i.POSITION_AND_ST,u.prototype.getFragmentShaderSource=s.prototype.getFragmentShaderSource,u.prototype.isTranslucent=s.prototype.isTranslucent,u.prototype.getRenderState=s.prototype.getRenderState,u}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t,i){var n,o=!i,a=e.length;if(!o&&a>1){var s=e[0].modelMatrix;for(n=1;n<a;++n)if(!h.equals(s,e[n].modelMatrix)){o=!0;break}}if(o)for(n=0;n<a;++n)r(e[n].geometry)&&c.transformToWorldCoordinates(e[n]);else h.multiplyTransformation(t,e[0].modelMatrix,t)}function m(e,r){var i=e.attributes,n=i.position,o=n.values.length/n.componentsPerAttribute;i.batchId=new l({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});for(var a=i.batchId.values,s=0;s<o;++s)a[s]=r}function g(e){for(var t=e.length,i=0;i<t;++i){var n=e[i];r(n.geometry)?m(n.geometry,i):r(n.westHemisphereGeometry)&&r(n.eastHemisphereGeometry)&&(m(n.westHemisphereGeometry,i),m(n.eastHemisphereGeometry,i))}}function v(i){var n,o,a,s=i.instances,l=i.projection,u=i.elementIndexUintSupported,d=i.scene3DOnly,h=i.vertexCacheOptimize,p=i.compressVertices,m=i.modelMatrix,v=s.length;for(n=0;n<v;++n)if(r(s[n].geometry)){a=s[n].geometry.primitiveType;break}if(f(s,m,d),!d)for(n=0;n<v;++n)r(s[n].geometry)&&c.splitLongitude(s[n]);if(g(s),h)for(n=0;n<v;++n){var _=s[n];r(_.geometry)?(c.reorderForPostVertexCache(_.geometry),c.reorderForPreVertexCache(_.geometry)):r(_.westHemisphereGeometry)&&r(_.eastHemisphereGeometry)&&(c.reorderForPostVertexCache(_.westHemisphereGeometry),c.reorderForPreVertexCache(_.westHemisphereGeometry),c.reorderForPostVertexCache(_.eastHemisphereGeometry),c.reorderForPreVertexCache(_.eastHemisphereGeometry))}var y=c.combineInstances(s);for(v=y.length,n=0;n<v;++n){o=y[n];var b,C=o.attributes;if(d)for(b in C)C.hasOwnProperty(b)&&C[b].componentDatatype===t.DOUBLE&&c.encodeAttribute(o,b,b+"3DHigh",b+"3DLow");else for(b in C)if(C.hasOwnProperty(b)&&C[b].componentDatatype===t.DOUBLE){var w=b+"3D",S=b+"2D";c.projectTo2D(o,b,w,S,l),r(o.boundingSphere)&&"position"===b&&(o.boundingSphereCV=e.fromVertices(o.attributes.position2D.values)),c.encodeAttribute(o,w,w+"High",w+"Low"),c.encodeAttribute(o,S,S+"High",S+"Low")}p&&c.compressVertices(o)}if(!u){var E=[];for(v=y.length,n=0;n<v;++n)o=y[n],E=E.concat(c.fitToUnsignedShortIndices(o));y=E}return y}function _(e,t,i,n){var o,a,s,l=n.length-1;if(l>=0){var u=n[l];o=u.offset+u.count,s=u.index,a=i[s].indices.length}else o=0,s=0,a=i[s].indices.length;for(var c=e.length,d=0;d<c;++d){var h=e[d],p=h[t];if(r(p)){var f=p.indices.length;o+f>a&&(o=0,a=i[++s].indices.length),n.push({index:s,offset:o,count:f}),o+=f}}}function y(e,t){var r=[];return _(e,"geometry",t,r),_(e,"westHemisphereGeometry",t,r),_(e,"eastHemisphereGeometry",t,r),r}function b(e,t){var i=e.attributes;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];r(o)&&r(o.values)&&t.push(o.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function C(e,t){for(var r=e.length,i=0;i<r;++i)b(e[i],t)}function w(t){for(var i=1,n=t.length,o=0;o<n;o++){var a=t[o];if(++i,r(a)){var s=a.attributes;i+=6+2*e.packedLength+(r(a.indices)?a.indices.length:0);for(var l in s)if(s.hasOwnProperty(l)&&r(s[l])){var u=s[l];i+=5+u.values.length}}}return i}function S(e,t){var r=e.length,i=new Float64Array(1+16*r),n=0;i[n++]=r;for(var o=0;o<r;o++){var a=e[o];h.pack(a.modelMatrix,i,n),n+=h.packedLength}return t.push(i.buffer),i}function E(e){for(var t=e,r=new Array(t[0]),i=0,n=1;n<t.length;){var o=h.unpack(t,n);n+=h.packedLength,r[i++]={modelMatrix:o}}return r}function T(t){var i=t.length,n=1+(e.packedLength+1)*i,o=new Float32Array(n),a=0;o[a++]=i;for(var s=0;s<i;++s){var l=t[s];r(l)?(o[a++]=1,e.pack(t[s],o,a)):o[a++]=0,a+=e.packedLength}return o}function x(t){for(var r=new Array(t[0]),i=0,n=1;n<t.length;)1===t[n++]&&(r[i]=e.unpack(t,n)),++i,n+=e.packedLength;return r}if(!o.supportsTypedArrays())return{};var P={};return P.combineGeometry=function(t){var i,n,o=t.instances,a=o.length;a>0&&(i=v(t),i.length>0&&(n=c.createAttributeLocations(i[0])));var s;t.createPickOffsets&&i.length>0&&(s=y(o,i));for(var l=new Array(a),u=new Array(a),d=0;d<a;++d){var h=o[d],p=h.geometry;r(p)&&(l[d]=p.boundingSphere,u[d]=p.boundingSphereCV);var f=h.eastHemisphereGeometry,m=h.westHemisphereGeometry;r(f)&&r(m)&&(r(f.boundingSphere)&&r(m.boundingSphere)&&(l[d]=e.union(f.boundingSphere,m.boundingSphere)),r(f.boundingSphereCV)&&r(m.boundingSphereCV)&&(u[d]=e.union(f.boundingSphereCV,m.boundingSphereCV)))}return{geometries:i,modelMatrix:t.modelMatrix,attributeLocations:n,pickOffsets:s,boundingSpheres:l,boundingSpheresCV:u}},P.packCreateGeometryResults=function(t,i){var n=new Float64Array(w(t)),o=[],a={},s=t.length,l=0;n[l++]=s;for(var u=0;u<s;u++){var c=t[u],d=r(c);if(n[l++]=d?1:0,d){n[l++]=c.primitiveType,n[l++]=c.geometryType;var h=r(c.boundingSphere)?1:0;n[l++]=h,h&&e.pack(c.boundingSphere,n,l),l+=e.packedLength;var p=r(c.boundingSphereCV)?1:0;n[l++]=p,p&&e.pack(c.boundingSphereCV,n,l),l+=e.packedLength;var f=c.attributes,m=[];for(var g in f)f.hasOwnProperty(g)&&r(f[g])&&(m.push(g),r(a[g])||(a[g]=o.length,o.push(g)));n[l++]=m.length;for(var v=0;v<m.length;v++){var _=m[v],y=f[_];n[l++]=a[_],n[l++]=y.componentDatatype,n[l++]=y.componentsPerAttribute,n[l++]=y.normalize?1:0,n[l++]=y.values.length,n.set(y.values,l),l+=y.values.length}var b=r(c.indices)?c.indices.length:0;n[l++]=b,b>0&&(n.set(c.indices,l),l+=b)}}return i.push(n.buffer),{stringTable:o,packedData:n}},P.unpackCreateGeometryResults=function(r){for(var i,n=r.stringTable,o=r.packedData,a=new Array(o[0]),c=0,h=1;h<o.length;){var p=1===o[h++];if(p){var f,m,g=o[h++],v=o[h++],_=1===o[h++];_&&(f=e.unpack(o,h)),h+=e.packedLength;var y=1===o[h++];y&&(m=e.unpack(o,h)),h+=e.packedLength;var b,C,w,S=new u,E=o[h++];for(i=0;i<E;i++){var T=n[o[h++]],x=o[h++];w=o[h++];var P=0!==o[h++];b=o[h++],C=t.createTypedArray(x,b);for(var A=0;A<b;A++)C[A]=o[h++];S[T]=new l({componentDatatype:x,componentsPerAttribute:w,normalize:P,values:C})}var D;if(b=o[h++],b>0){var I=C.length/w;for(D=d.createTypedArray(I,b),i=0;i<b;i++)D[i]=o[h++]}a[c++]=new s({primitiveType:g,geometryType:v,boundingSphere:f,boundingSphereCV:m,indices:D,attributes:S})}else a[c++]=void 0}return a},P.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,i=r.length,n=0;n<i;n++)t.push(r[n].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:S(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},P.unpackCombineGeometryParameters=function(e){for(var t=E(e.packedInstances),r=e.createGeometryResults,i=r.length,o=0,s=0;s<i;s++)for(var l=P.unpackCreateGeometryResults(r[s]),u=l.length,c=0;c<u;c++){var d=l[c],f=t[o];f.geometry=d,++o}var m=n.clone(e.ellipsoid),g=e.isGeographic?new a(m):new p(m);return{instances:t,ellipsoid:m,projection:g,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:h.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},P.packCombineGeometryResults=function(e,t){r(e.geometries)&&C(e.geometries,t);var i=T(e.boundingSpheres),n=T(e.boundingSpheresCV);return t.push(i.buffer,n.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:i,boundingSpheresCV:n}},P.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:x(e.boundingSpheres),boundingSpheresCV:x(e.boundingSpheresCV)}},P}),define("Scene/PrimitiveState",["../Core/freezeObject"],function(e){"use strict";var t={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};return e(t)}),define("Scene/SceneMode",["../Core/freezeObject"],function(e){"use strict";var t={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};return t.getMorphTime=function(e){if(e===t.SCENE3D)return 1;if(e!==t.MORPHING)return 0},e(t)}),define("Scene/ShadowMode",["../Core/freezeObject"],function(e){"use strict";var t={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3,NUMBER_OF_SHADOW_MODES:4};return t.castShadows=function(e){return e===t.ENABLED||e===t.CAST_ONLY},t.receiveShadows=function(e){return e===t.ENABLED||e===t.RECEIVE_ONLY},t.fromCastReceive=function(e,r){return e&&r?t.ENABLED:e?t.CAST_ONLY:r?t.RECEIVE_ONLY:t.DISABLED},e(t)}),define("Scene/Primitive",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/combine","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/isArray","../Core/Matrix4","../Core/RuntimeError","../Core/subdivideArray","../Core/TaskProcessor","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../ThirdParty/when","./BatchTable","./CullFace","./DepthFunction","./Material","./PolylineMaterialAppearance","./PrimitivePipeline","./PrimitiveState","./SceneMode","./ShadowMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R,N,k,L,F,B,U,V,z){"use strict";function G(e){e=u(e,u.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=b.clone(u(e.modelMatrix,b.IDENTITY)),this._modelMatrix=new b,this.show=u(e.show,!0),this._vertexCacheOptimize=u(e.vertexCacheOptimize,!1),this._interleave=u(e.interleave,!1),this._releaseGeometryInstances=u(e.releaseGeometryInstances,!0),this._allowPicking=u(e.allowPicking,!0),this._asynchronous=u(e.asynchronous,!0),this._compressVertices=u(e.compressVertices,!0),this.cull=u(e.cull,!0),this.debugShowBoundingVolume=u(e.debugShowBoundingVolume,!1),this.rtcCenter=e.rtcCenter,this.shadows=u(e.shadows,z.DISABLED),this._translucent=void 0,this._state=U.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._pickRS=void 0,this._pickSP=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._readOnlyInstanceAttributes=e._readOnlyInstanceAttributes,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=O.defer(),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}function H(e){var t,r=e.length,i=[],n=e[0].attributes;for(t in n)if(n.hasOwnProperty(t)){for(var o=n[t],a=!0,s=1;s<r;++s){var l=e[s].attributes[t];if(!c(l)||o.componentDatatype!==l.componentDatatype||o.componentsPerAttribute!==l.componentsPerAttribute||o.normalize!==l.normalize){a=!1;break}}a&&i.push(t)}return i}function W(e){var n=e.length;return 1===n?e[0]:2===n?t.unpack(e,0,fe):3===n?r.unpack(e,0,me):4===n?i.unpack(e,0,ge):void 0}function j(e,t){var r=e.geometryInstances,i=y(r)?r:[r],n=i.length;if(0!==n){var o,s,d,h=H(i),p=h.length,f=e.allowPicking,m=[],g={},v={},_=i[0],b=_.attributes;for(o=0;o<p;++o)s=h[o],d=b[s],g[s]=o,m.push({functionName:"czm_batchTable_"+s,componentDatatype:d.componentDatatype,componentsPerAttribute:d.componentsPerAttribute,normalize:d.normalize});h.indexOf("distanceDisplayCondition")!==-1&&(m.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:l.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:l.FLOAT,componentsPerAttribute:1}),v.center3DHigh=m.length-5,v.center3DLow=m.length-4,v.center2DHigh=m.length-3,v.center2DLow=m.length-2,v.radius=m.length-1),f&&m.push({functionName:"czm_batchTable_pickColor",componentDatatype:l.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});var C=m.length,w=new R(t,m,n);for(o=0;o<n;++o){var S=i[o];b=S.attributes;for(var E=0;E<p;++E){s=h[E],d=b[s];var T=W(d.value),x=g[s];w.setBatchedAttribute(o,x,T)}if(f){var P={primitive:u(S.pickPrimitive,e)};c(S.id)&&(P.id=S.id);var A=t.createPickId(P);e._pickIds.push(A);var D=A.color,I=ge;I.x=a.floatToByte(D.red),I.y=a.floatToByte(D.green),I.z=a.floatToByte(D.blue),I.w=a.floatToByte(D.alpha),w.setBatchedAttribute(o,C-1,I)}}e._batchTable=w,e._batchTableAttributeIndices=g,e._batchTableBoundingSphereAttributeIndices=v}}function q(e){var t;return t=y(e.values)?e.values.slice(0):new e.values.constructor(e.values),new v({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function Y(t){var r=t.attributes,i=new _;for(var n in r)r.hasOwnProperty(n)&&c(r[n])&&(i[n]=q(r[n]));var o;if(c(t.indices)){var a=t.indices;o=y(a)?a.slice(0):new a.constructor(a)}return new g({attributes:i,indices:o,primitiveType:t.primitiveType,boundingSphere:e.clone(t.boundingSphere)})}function X(e,t){return{geometry:t,modelMatrix:b.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}function Q(e,t){if(!e.compressVertices)return t;var r=t.search(/attribute\s+vec3\s+normal;/g)!==-1,i=t.search(/attribute\s+vec2\s+st;/g)!==-1;if(!r&&!i)return t;var n=t.search(/attribute\s+vec3\s+tangent;/g)!==-1,o=t.search(/attribute\s+vec3\s+bitangent;/g)!==-1,a=i&&r?2:1;a+=n||o?1:0;var s=a>1?"vec"+a:"float",l="compressedAttributes",u="attribute "+s+" "+l+";",c="",d="";if(i){c+="vec2 st;\n";var h=a>1?l+".x":l;d+=" st = czm_decompressTextureCoordinates("+h+");\n"}r&&n&&o?(c+="vec3 normal;\nvec3 tangent;\nvec3 bitangent;\n",d+=" czm_octDecode("+l+"."+(i?"yz":"xy")+", normal, tangent, bitangent);\n"):(r&&(c+="vec3 normal;\n",d+=" normal = czm_octDecode("+l+(a>1?"."+(i?"y":"x"):"")+");\n"),n&&(c+="vec3 tangent;\n",d+=" tangent = czm_octDecode("+l+"."+(i&&r?"z":"y")+");\n"),o&&(c+="vec3 bitangent;\n",d+=" bitangent = czm_octDecode("+l+"."+(i&&r?"z":"y")+");\n"));var p=t;p=p.replace(/attribute\s+vec3\s+normal;/g,""),p=p.replace(/attribute\s+vec2\s+st;/g,""),p=p.replace(/attribute\s+vec3\s+tangent;/g,""),p=p.replace(/attribute\s+vec3\s+bitangent;/g,""),p=I.replaceMain(p,"czm_non_compressed_main");var f="void main() \n{ \n"+d+" czm_non_compressed_main(); \n}";return[u,c,p,f].join("\n")}function Z(e){var t=I.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"}function K(e){var t=I.replaceMain(e,"czm_non_depth_clamp_main");return t+="varying float v_WindowZ;\nvoid main() {\n czm_non_depth_clamp_main();\n#ifdef GL_EXT_frag_depth\n gl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n#endif\n}\n",t="#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\n"+t}function J(e,t){e.vertexAttributes}function $(e,t){return function(){return e[t]}}function ee(e,t){var r,i,n,o,a=e._instanceIds;if(e._state===U.READY){r=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var s=e._numberOfInstances=r.length,l=[],d=[];for(n=0;n<s;++n)i=r[n].geometry,a.push(r[n].id),d.push({moduleName:i._workerName,geometry:i});if(!c(_e))for(_e=new Array(ye),n=0;n<ye;n++)_e[n]=new S("createGeometry",Number.POSITIVE_INFINITY);var h;for(d=w(d,ye),n=0;n<d.length;n++){var p=0,f=d[n],m=f.length;for(o=0;o<m;++o)h=f[o],i=h.geometry,c(i.constructor.pack)&&(h.offset=p,p+=u(i.constructor.packedLength,i.packedLength));var g;if(p>0){var v=new Float64Array(p);for(g=[v.buffer],o=0;o<m;++o)h=f[o],i=h.geometry,c(i.constructor.pack)&&(i.constructor.pack(i,v,h.offset),h.geometry=v)}l.push(_e[n].scheduleTask({subTasks:d[n]},g))}e._state=U.CREATING,O.all(l,function(t){e._createGeometryResults=t,e._state=U.CREATED}).otherwise(function(r){pe(e,t,U.FAILED,r)})}else if(e._state===U.CREATED){var _=[];r=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];var C=t.scene3DOnly,E=t.mapProjection,T=be.scheduleTask(B.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:r,ellipsoid:E.ellipsoid,projection:E,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:C,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},_),_);e._createGeometryResults=void 0,e._state=U.COMBINING,O(T,function(r){var i=B.unpackCombineGeometryResults(r);e._geometries=i.geometries,e._attributeLocations=i.attributeLocations,e.modelMatrix=b.clone(i.modelMatrix,e.modelMatrix),e._pickOffsets=i.pickOffsets,e._instanceBoundingSpheres=i.boundingSpheres,e._instanceBoundingSpheresCV=i.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?e._state=U.COMBINED:pe(e,t,U.FAILED,void 0)}).otherwise(function(r){pe(e,t,U.FAILED,r)})}}function te(e,t){var r,i,n=y(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],o=e._numberOfInstances=n.length,a=new Array(o),s=e._instanceIds,l=0;for(i=0;i<o;i++){r=n[i];var u,d=r.geometry;u=c(d.attributes)&&c(d.primitiveType)?Y(d):d.constructor.createGeometry(d),a[l++]=X(r,u),s.push(r.id)}a.length=l;var h=t.scene3DOnly,p=t.mapProjection,f=B.combineGeometry({instances:a,ellipsoid:p.ellipsoid,projection:p,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:h,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=f.geometries,e._attributeLocations=f.attributeLocations,e.modelMatrix=b.clone(f.modelMatrix,e.modelMatrix),e._pickOffsets=f.pickOffsets,e._instanceBoundingSpheres=f.boundingSpheres,e._instanceBoundingSpheresCV=f.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?e._state=U.COMBINED:pe(e,t,U.FAILED,void 0)}function re(t,r){var i=c(t._batchTableAttributeIndices.distanceDisplayCondition);if(i&&!t._batchTableBoundingSpheresUpdated){for(var n=t._batchTableBoundingSphereAttributeIndices,o=n.center3DHigh,a=n.center3DLow,s=n.center2DHigh,l=n.center2DLow,u=n.radius,d=r.mapProjection,h=d.ellipsoid,p=t._batchTable,m=t._instanceBoundingSpheres,g=m.length,v=0;v<g;++v){var _=m[v];if(c(_)){var y=t.modelMatrix;c(y)&&(_=e.transform(_,y,Ee));var b=_.center,C=_.radius,w=f.fromCartesian(b,Ce);p.setBatchedAttribute(v,o,w.high),p.setBatchedAttribute(v,a,w.low);var S=h.cartesianToCartographic(b,we),E=d.project(S,Se);w=f.fromCartesian(E,Ce),p.setBatchedAttribute(v,s,w.high),p.setBatchedAttribute(v,l,w.low),p.setBatchedAttribute(v,u,C)}}t._batchTableBoundingSpheresUpdated=!0}}function ie(t,r){for(var i=t._attributeLocations,n=t._geometries,o=r.scene3DOnly,a=r.context,s=[],l=n.length,u=0;u<l;++u){var d=n[u];if(s.push(M.fromGeometry({context:a,geometry:d,attributeLocations:i,bufferUsage:E.STATIC_DRAW,interleave:t._interleave})),c(t._createBoundingVolumeFunction))t._createBoundingVolumeFunction(r,d);else if(t._boundingSpheres.push(e.clone(d.boundingSphere)),t._boundingSphereWC.push(new e),!o){var h=d.boundingSphereCV.center,p=h.x,f=h.y,m=h.z;h.x=m,h.y=p,h.z=f,t._boundingSphereCV.push(e.clone(d.boundingSphereCV)),t._boundingSphere2D.push(new e),t._boundingSphereMorph.push(new e)}}t._va=s,t._primitiveType=n[0].primitiveType,t.releaseGeometryInstances&&(t.geometryInstances=void 0),t._geometries=void 0,pe(t,r,U.COMPLETE,void 0)}function ne(e,t,r,i){var n,a=r.getRenderState();i?(n=o(a,!1),n.cull={enabled:!0,face:N.BACK},e._frontFaceRS=A.fromCache(n),n.cull.face=N.FRONT,e._backFaceRS=A.fromCache(n)):(e._frontFaceRS=A.fromCache(a),e._backFaceRS=e._frontFaceRS),n=o(a,!1),c(e._depthFailAppearance)&&(n.depthTest.enabled=!1),e.allowPicking?i?(n.cull={enabled:!1},e._pickRS=A.fromCache(n)):e._pickRS=A.fromCache(n):(n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i?(n.cull={enabled:!1},e._pickRS=A.fromCache(n)):e._pickRS=A.fromCache(n)),c(e._depthFailAppearance)&&(a=e._depthFailAppearance.getRenderState(),n=o(a,!1),n.depthTest.func=k.GREATER,i?(n.cull={enabled:!0,face:N.BACK},e._frontFaceDepthFailRS=A.fromCache(n),n.cull.face=N.FRONT,e._backFaceDepthFailRS=A.fromCache(n)):(e._frontFaceDepthFailRS=A.fromCache(n),e._backFaceDepthFailRS=e._frontFaceRS))}function oe(e,t,r){var i=t.context,n=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(r.vertexShaderSource);o=G._appendShowToShader(e,o),o=G._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=G._updateColorAttribute(e,o,!1),o=Q(e,o),o=G._modifyShaderPosition(e,o,t.scene3DOnly);var a=r.getFragmentShaderSource();if(e.allowPicking){var s=I.createPickVertexShaderSource(o);s=G._updatePickColorAttribute(s),e._pickSP=D.replaceCache({context:i,shaderProgram:e._pickSP,vertexShaderSource:s,fragmentShaderSource:I.createPickFragmentShaderSource(a,"varying"),attributeLocations:n})}else e._pickSP=D.fromCache({context:i,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n});J(e._pickSP,n),e._sp=D.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n}),J(e._sp,n),c(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource), +o=G._appendShowToShader(e,o),o=G._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=G._updateColorAttribute(e,o,!0),o=Q(e,o),o=G._modifyShaderPosition(e,o,t.scene3DOnly),o=Z(o),a=K(e._depthFailAppearance.getFragmentShaderSource()),e._spDepthFail=D.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:n}),J(e._spDepthFail,n))}function ae(e,t,r,i){var n=c(r)?r._uniforms:void 0,o={},a=t.uniforms;if(c(a))for(var l in a)a.hasOwnProperty(l)&&(o[l]=$(a,l));var u=s(o,n);return u=e._batchTable.getUniformMapCallback()(u),c(e.rtcCenter)&&(u.u_modifiedModelView=function(){var t=i.context.uniformState.view;return b.multiply(t,e._modelMatrix,Te),b.multiplyByPoint(Te,e.rtcCenter,xe),b.setTranslation(Te,xe,Te),Te}),u}function se(e,t,r,i,n,o,a,s){var l,u=ae(e,t,r,s);c(e._depthFailAppearance)&&(l=ae(e,e._depthFailAppearance,e._depthFailAppearance.material,s));var d=i?P.TRANSLUCENT:P.OPAQUE,h=n?2:1;h*=c(e._depthFailAppearance)?2:1,o.length=e._va.length*h,a.length=e._va.length;for(var p=o.length,f=0,m=0,g=0;g<p;++g){var v;n&&(v=o[g],c(v)||(v=o[g]=new x({owner:e,primitiveType:e._primitiveType})),v.vertexArray=e._va[m],v.renderState=e._backFaceRS,v.shaderProgram=e._sp,v.uniformMap=u,v.pass=d,++g),v=o[g],c(v)||(v=o[g]=new x({owner:e,primitiveType:e._primitiveType})),v.vertexArray=e._va[m],v.renderState=e._frontFaceRS,v.shaderProgram=e._sp,v.uniformMap=u,v.pass=d,c(e._depthFailAppearance)&&(n&&(++g,v=o[g],c(v)||(v=o[g]=new x({owner:e,primitiveType:e._primitiveType})),v.vertexArray=e._va[m],v.renderState=e._backFaceDepthFailRS,v.shaderProgram=e._spDepthFail,v.uniformMap=l,v.pass=d),++g,v=o[g],c(v)||(v=o[g]=new x({owner:e,primitiveType:e._primitiveType})),v.vertexArray=e._va[m],v.renderState=e._frontFaceDepthFailRS,v.shaderProgram=e._spDepthFail,v.uniformMap=l,v.pass=d);var _=a[f];c(_)||(_=a[f]=new x({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[m],_.renderState=e._pickRS,_.shaderProgram=e._pickSP,_.uniformMap=u,_.pass=d,++f,++m}}function le(e,t){var r=e.appearance.pixelSize;if(c(r))for(var i=e._boundingSpheres.length,n=0;n<i;++n){var o=e._boundingSpheres[n],a=e._boundingSphereWC[n],s=t.camera.getPixelSize(o,t.context.drawingBufferWidth,t.context.drawingBufferHeight),l=s*r;a.radius=o.radius+l}}function ue(t,r,i,n,o,a,s,l){if(le(t,r),!b.equals(o,t._modelMatrix)){b.clone(o,t._modelMatrix);for(var u=t._boundingSpheres.length,d=0;d<u;++d){var h=t._boundingSpheres[d];c(h)&&(t._boundingSphereWC[d]=e.transform(h,o,t._boundingSphereWC[d]),r.scene3DOnly||(t._boundingSphere2D[d]=e.clone(t._boundingSphereCV[d],t._boundingSphere2D[d]),t._boundingSphere2D[d].center.x=0,t._boundingSphereMorph[d]=e.union(t._boundingSphereWC[d],t._boundingSphereCV[d])))}}var p;r.mode===V.SCENE3D?p=t._boundingSphereWC:r.mode===V.COLUMBUS_VIEW?p=t._boundingSphereCV:r.mode===V.SCENE2D&&c(t._boundingSphere2D)?p=t._boundingSphere2D:c(t._boundingSphereMorph)&&(p=t._boundingSphereMorph);var f=r.commandList,m=r.passes;if(m.render){var g=z.castShadows(t.shadows),v=z.receiveShadows(t.shadows),_=i.length,y=l?2:1;y*=c(t._depthFailAppearance)?2:1;for(var C=0;C<_;++C){var w=Math.floor(C/y),S=i[C];S.modelMatrix=o,S.boundingVolume=p[w],S.cull=a,S.debugShowBoundingVolume=s,S.castShadows=g,S.receiveShadows=v,f.push(S)}}if(m.pick)for(var E=n.length,T=0;T<E;++T){var x=n[T];x.modelMatrix=o,x.boundingVolume=p[T],x.cull=a,f.push(x)}}function ce(e,t,r){return function(){var i=e.getBatchedAttribute(t,r),n=e.attributes[r],o=n.componentsPerAttribute,a=l.createTypedArray(n.componentDatatype,o);return c(i.constructor.pack)?i.constructor.pack(i,a,0):a[0]=i,a}}function de(e,t,r){return function(i){var n=W(i);e.setBatchedAttribute(t,r,n)}}function he(t,r,i){r.boundingSphere={get:function(){var r=t._instanceBoundingSpheres[i],n=t.modelMatrix;return c(n)&&c(r)&&(r=e.transform(r,n)),r}},r.boundingSphereCV={get:function(){return t._instanceBoundingSpheresCV[i]}}}function pe(e,t,r,i){e._error=i,e._state=r,t.afterRender.push(function(){e._ready=e._state===U.COMPLETE||e._state===U.FAILED,c(i)?e._readyPromise.reject(i):e._readyPromise.resolve(e)})}d(G.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 fe=new t,me=new r,ge=new i,ve=/attribute\s+vec(?:3|4)\s+(.*)3DHigh;/g;G._modifyShaderPosition=function(e,t,r){for(var i,n="",o="",a="";null!==(i=ve.exec(t));){var s=i[1],l="vec4 czm_compute"+s[0].toUpperCase()+s.substr(1)+"()";"vec4 czm_computePosition()"!==l&&(n+=l+";\n"),c(e.rtcCenter)?(t=t.replace(/attribute\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/attribute\s+vec(?:3|4)\s+position3DLow;/g,""),n+="uniform mat4 u_modifiedModelView;\n",o+="attribute vec4 position;\n",a+=l+"\n{\n return u_modifiedModelView * position;\n}\n\n",t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):r?a+=l+"\n{\n return czm_translateRelativeToEye("+s+"3DHigh, "+s+"3DLow);\n}\n\n":(o+="attribute vec3 "+s+"2DHigh;\nattribute vec3 "+s+"2DLow;\n",a+=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,o,t,a].join("\n")},G._appendShowToShader=function(e,t){if(!c(e._batchTableAttributeIndices.show))return t;var r=I.replaceMain(t,"czm_non_show_main"),i="void main() \n{ \n czm_non_show_main(); \n gl_Position *= czm_batchTable_show(batchId); \n}";return r+"\n"+i},G._updateColorAttribute=function(e,t,r){if(!c(e._batchTableAttributeIndices.color)&&!c(e._batchTableAttributeIndices.depthFailColor))return t;if(t.search(/attribute\s+vec4\s+color;/g)===-1)return t;var i=t;return i=i.replace(/attribute\s+vec4\s+color;/g,""),i=r?i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2")},G._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")},G._appendDistanceDisplayConditionToShader=function(e,t,r){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition))return t;var i=I.replaceMain(t,"czm_non_distanceDisplayCondition_main"),n="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 vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);\n vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);\n float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);\n";return n+=r?" vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);\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",n+=" 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}",i+"\n"+n};var _e,ye=Math.max(m.hardwareConcurrency-1,1),be=new S("combineGeometry",Number.POSITIVE_INFINITY),Ce=new f,we=new n,Se=new r,Ee=new e,Te=new b,xe=new r;return G.prototype.update=function(e){if(!(!c(this.geometryInstances)&&0===this._va.length||c(this.geometryInstances)&&y(this.geometryInstances)&&0===this.geometryInstances.length||!c(this.appearance)||e.mode!==V.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)){if(c(this._error))throw this._error;if(this._state!==U.FAILED){var t=e.context;if(c(this._batchTable)||j(this,t),this._batchTable.attributes.length>0){if(0===T.maximumVertexTextureImageUnits)throw new C("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!==U.COMPLETE&&this._state!==U.COMBINED&&(this.asynchronous?ee(this,e):te(this,e)),this._state===U.COMBINED&&(re(this,e),ie(this,e)),this.show&&this._state===U.COMPLETE){var r=this.appearance,i=r.material,n=!1,o=!1;this._appearance!==r?(this._appearance=r,this._material=i,n=!0,o=!0):this._material!==i&&(this._material=i,o=!0);var a=this.depthFailAppearance,s=c(a)?a.material:void 0;this._depthFailAppearance!==a?(this._depthFailAppearance=a,this._depthFailMaterial=s,n=!0,o=!0):this._depthFailMaterial!==s&&(this._depthFailMaterial=s,o=!0);var l=this._appearance.isTranslucent();this._translucent!==l&&(this._translucent=l,n=!0),c(this._material)&&this._material.update(t);var d=r.closed&&l;if(n){var h=u(this._createRenderStatesFunction,ne);h(this,t,r,d)}if(o){var p=u(this._createShaderProgramFunction,oe);p(this,e,r)}if(n||o){var f=u(this._createCommandsFunction,se);f(this,r,i,l,d,this._colorCommands,this._pickCommands,e)}var m=u(this._updateAndQueueCommandsFunction,ue);m(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)}}}},G.prototype.getGeometryInstanceAttributes=function(e){for(var t=-1,r=this._lastPerInstanceAttributeIndex,i=this._instanceIds,n=i.length,o=0;o<n;++o){var a=(r+o)%n;if(e===i[a]){t=a;break}}if(t!==-1){var s=this._perInstanceAttributeCache[t];if(c(s))return s;var l=this._batchTable,u=this._batchTableAttributeIndices;s={};var h={};for(var p in u)if(u.hasOwnProperty(p)){var f=u[p];h[p]={get:ce(l,t,f)};var m=!0,g=this._readOnlyInstanceAttributes;if(m&&c(g)){n=g.length;for(var v=0;v<n;++v)if(p===g[v]){m=!1;break}}m&&(h[p].set=de(l,t,f))}return he(this,h,t),d(s,h),this._lastPerInstanceAttributeIndex=t,this._perInstanceAttributeCache[t]=s,s}},G.prototype.isDestroyed=function(){return!1},G.prototype.destroy=function(){var e,t;this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy();var r=this._va;for(e=r.length,t=0;t<e;++t)r[t].destroy();this._va=void 0;var i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[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,h(this)},G}),define("DataSources/ColorMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o){"use strict";function a(e){this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this.color=e}return r(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"Color"},a.prototype.getValue=function(r,i){return t(i)||(i={}),i.color=o.getValueOrClonedDefault(this._color,r,e.WHITE,i.color),i},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),define("DataSources/dynamicGeometryGetBoundingSphere",["../Core/BoundingSphere","../Core/defined","../Core/DeveloperError","./BoundingSphereState"],function(e,t,r,i){"use strict";function n(r,n,o,a){var s;return t(n)&&n.show&&n.ready&&(s=n.getGeometryInstanceAttributes(r),t(s)&&t(s.boundingSphere))?(e.clone(s.boundingSphere,a),i.DONE):t(o)&&o.show&&o.ready&&(s=o.getGeometryInstanceAttributes(r),t(s)&&t(s.boundingSphere))?(e.clone(s.boundingSphere,a),i.DONE):t(n)&&!n.ready||t(o)&&!o.ready?i.PENDING:i.FAILED}return n}),define("DataSources/MaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Scene/Material"],function(e,t,r,i,n){"use strict";function o(){i.throwInstantiationError()}return r(o.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError}}),o.prototype.getType=i.throwInstantiationError,o.prototype.getValue=i.throwInstantiationError,o.prototype.equals=i.throwInstantiationError,o.getValue=function(r,i,o){var a;return t(i)&&(a=i.getType(r),t(a))?(t(o)&&o.type===a||(o=n.fromType(a)),i.getValue(r,o.uniforms),o):(t(o)&&o.type===n.ColorType||(o=n.fromType(n.ColorType)),e.clone(e.WHITE,o.uniforms.color),o)},o}),define("DataSources/BoxGeometryUpdater",["../Core/BoxGeometry","../Core/BoxOutlineGeometry","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S){"use strict";function E(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new E(e),this._onEntityPropertyChanged(e,"box",e.box,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var P=new y(r.WHITE),A=new b(!0),D=new b(!0),I=new b(!1),M=new b(r.BLACK),O=new b(_.DISABLED),R=new b(new u),N=new r;return a(T,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:m}}),a(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&S.isConstant(this._showProperty)&&S.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(t){var n,a,s=this._entity,l=s.isAvailable(t),u=new f(l&&s.isShowing&&this._showProperty.getValue(t)&&this._fillProperty.getValue(t)),d=this._distanceDisplayConditionProperty.getValue(t),m=c.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var g=r.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(g=this._materialProperty.color.getValue(t)),a=i.fromColor(g),n={show:u,distanceDisplayCondition:m,color:a}}else n={show:u,distanceDisplayCondition:m};return new h({id:s,geometry:e.fromDimensions(this._options),modelMatrix:s._getModelMatrix(p.MINIMUM_VALUE),attributes:n})},T.prototype.createOutlineGeometryInstance=function(e){var n=this._entity,o=n.isAvailable(e),a=S.getValueOrDefault(this._outlineColorProperty,e,r.BLACK),s=this._distanceDisplayConditionProperty.getValue(e);return new h({id:n,geometry:t.fromDimensions(this._options),modelMatrix:n._getModelMatrix(p.MINIMUM_VALUE),attributes:{show:new f(o&&n.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:i.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),s(this)},T.prototype._onEntityPropertyChanged=function(e,t,r,i){if("availability"===t||"position"===t||"orientation"===t||"box"===t){var a=this._entity.box;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.dimensions,h=e.position,f=a.show;if(!o(d)||!o(h)||o(f)&&f.isConstant&&!f.getValue(p.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var v=n(a.material,P),_=v instanceof y;this._materialProperty=v,this._fillProperty=n(s,D),this._showProperty=n(f,A),this._showOutlineProperty=n(a.outline,I),this._outlineColorProperty=c?n(a.outlineColor,M):void 0,this._shadowsProperty=n(a.shadows,O),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,R);var b=a.outlineWidth;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&S.isConstant(e.orientation)&&d.isConstant&&S.isConstant(b)){var C=this._options;C.vertexFormat=_?g.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,C.dimensions=d.getValue(p.MINIMUM_VALUE,C.dimensions),this._outlineWidth=o(b)?b.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.box;if(l.isShowing&&l.isAvailable(n)&&S.getValueOrDefault(u.show,n,!0)){var d=this._options,p=l._getModelMatrix(n),f=S.getValueOrUndefined(u.dimensions,n,d.dimensions);if(o(p)&&o(f)){d.dimensions=f;var _=this._geometryUpdater.shadowsProperty.getValue(n),y=this._geometryUpdater.distanceDisplayConditionProperty,b=y.getValue(n),C=c.fromDistanceDisplayCondition(b);if(S.getValueOrDefault(u.fill,n,!0)){var E=w.getValue(n,s.fillMaterialProperty,this._material);this._material=E;var T=new m({material:E,translucent:E.isTranslucent(),closed:!0});d.vertexFormat=T.vertexFormat,this._primitive=a.add(new v({geometryInstances:new h({id:l,geometry:e.fromDimensions(d),modelMatrix:p,attributes:{distanceDisplayCondition:C}}),appearance:T,asynchronous:!1,shadows:_}))}if(S.getValueOrDefault(u.outline,n,!1)){d.vertexFormat=g.VERTEX_FORMAT;var x=S.getValueOrClonedDefault(u.outlineColor,n,r.BLACK,N),P=S.getValueOrDefault(u.outlineWidth,n,1),A=1!==x.alpha;this._outlinePrimitive=a.add(new v({geometryInstances:new h({id:l,geometry:t.fromDimensions(d),modelMatrix:p,attributes:{color:i.fromColor(x),distanceDisplayCondition:C}}),appearance:new g({flat:!0,translucent:A,renderState:{lineWidth:s._scene.clampLineWidth(P)}}),asynchronous:!1,shadows:_}))}}}},x.prototype.getBoundingSphere=function(e,t){return C(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},T}),define("DataSources/ImageMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.EMPTY_OBJECT),this._definitionChanged=new o,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}var u=new e(1,1),c=!1,d=t.WHITE;return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._image)&&s.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:a("image"),repeat:a("repeat"),color:a("color"),transparent:a("transparent")}),l.prototype.getType=function(e){return"Image"},l.prototype.getValue=function(e,t){return i(t)||(t={}),t.image=s.getValueOrUndefined(this._image,e),t.repeat=s.getValueOrClonedDefault(this._repeat,e,u,t.repeat),t.color=s.getValueOrClonedDefault(this._color,e,d,t.color),s.getValueOrDefault(this._transparent,e,c)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._image,e._image)&&s.equals(this._color,e._color)&&s.equals(this._transparent,e._transparent)&&s.equals(this._repeat,e._repeat)},l}),define("DataSources/createMaterialPropertyDescriptor",["../Core/Color","../Core/DeveloperError","./ColorMaterialProperty","./createPropertyDescriptor","./ImageMaterialProperty"],function(e,t,r,i,n){"use strict";function o(t){if(t instanceof e)return new r(t);if("string"==typeof t||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){var i=new n;return i.image=t,i}}function a(e,t){return i(e,t,o)}return a}),define("DataSources/BoxGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._dimensions=void 0,this._dimensionsSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._fill=void 0,this._fillSubscription=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 n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),dimensions:a("dimensions"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.dimensions=this.dimensions,e.show=this.show,e.material=this.material,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):new s(this)},s.prototype.merge=function(t){this.dimensions=e(this.dimensions,t.dimensions),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/CallbackProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event"],function(e,t,r,i){"use strict";function n(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new i,this.setCallback(e,t)}return t(n.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),n.prototype.getValue=function(e,t){return this._callback(e,t)},n.prototype.setCallback=function(e,t){var r=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,r&&this._definitionChanged.raiseEvent(this)},n.prototype.equals=function(e){return this===e||e instanceof n&&this._callback===e._callback&&this._isConstant===e._isConstant},n}),define("DataSources/CheckerboardMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.EMPTY_OBJECT),this._definitionChanged=new o,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}var u=t.WHITE,c=t.BLACK,d=new e(2,2);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._evenColor)&&s.isConstant(this._oddColor)&&s.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:a("evenColor"),oddColor:a("oddColor"),repeat:a("repeat")}),l.prototype.getType=function(e){return"Checkerboard"},l.prototype.getValue=function(e,t){return i(t)||(t={}),t.lightColor=s.getValueOrClonedDefault(this._evenColor,e,u,t.lightColor),t.darkColor=s.getValueOrClonedDefault(this._oddColor,e,c,t.darkColor),t.repeat=s.getValueOrDefault(this._repeat,e,d),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._evenColor,e._evenColor)&&s.equals(this._oddColor,e._oddColor)&&s.equals(this._repeat,e._repeat)},l}),define("DataSources/PositionProperty",["../Core/Cartesian3","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix3","../Core/ReferenceFrame","../Core/Transforms"],function(e,t,r,i,n,o,a){"use strict";function s(){i.throwInstantiationError()}r(s.prototype,{isConstant:{get:i.throwInstantiationError},definitionChanged:{get:i.throwInstantiationError},referenceFrame:{get:i.throwInstantiationError}}),s.prototype.getValue=i.throwInstantiationError,s.prototype.getValueInReferenceFrame=i.throwInstantiationError,s.prototype.equals=i.throwInstantiationError;var l=new n;return s.convertToReferenceFrame=function(r,i,s,u,c){if(!t(i))return i;if(t(c)||(c=new e),s===u)return e.clone(i,c);var d=a.computeIcrfToFixedMatrix(r,l);return t(d)||(d=a.computeTemeToPseudoFixedMatrix(r,l)),s===o.INERTIAL?n.multiplyByVector(d,i,c):s===o.FIXED?n.multiplyByVector(n.transpose(d,l),i,c):void 0},s}),define("DataSources/ConstantPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty"],function(e,t,r,i,n,o,a,s){"use strict";function l(r,i){this._definitionChanged=new o,this._value=e.clone(r),this._referenceFrame=t(i,a.FIXED)}return i(l.prototype,{isConstant:{get:function(){return!r(this._value)||this._referenceFrame===a.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.setValue=function(t,i){var n=!1;e.equals(this._value,t)||(n=!0,this._value=e.clone(t)),r(i)&&this._referenceFrame!==i&&(n=!0,this._referenceFrame=i),n&&this._definitionChanged.raiseEvent(this)},l.prototype.getValueInReferenceFrame=function(e,t,r){return s.convertToReferenceFrame(e,this._value,this._referenceFrame,t,r)},l.prototype.equals=function(t){return this===t||t instanceof l&&e.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame},l}),define("DataSources/CorridorGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=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 n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),width:a("width"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.width=this.width,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this); +},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.width=e(this.width,t.width),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/createRawPropertyDescriptor",["./createPropertyDescriptor"],function(e){"use strict";function t(e){return e}function r(r,i){return e(r,i,t)}return r}),define("DataSources/CylinderGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._fill=void 0,this._fillSubscription=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 n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},length:a("length"),topRadius:a("topRadius"),bottomRadius:a("bottomRadius"),numberOfVerticalLines:a("numberOfVerticalLines"),slices:a("slices"),show:a("show"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.bottomRadius=this.bottomRadius,e.length=this.length,e.topRadius=this.topRadius,e.show=this.show,e.material=this.material,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,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):new s(this)},s.prototype.merge=function(t){this.bottomRadius=e(this.bottomRadius,t.bottomRadius),this.length=e(this.length,t.length),this.topRadius=e(this.topRadius,t.topRadius),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines),this.slices=e(this.slices,t.slices),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/EllipseGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._fill=void 0,this._fillSubscription=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._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},semiMajorAxis:a("semiMajorAxis"),semiMinorAxis:a("semiMinorAxis"),rotation:a("rotation"),show:a("show"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),numberOfVerticalLines:a("numberOfVerticalLines"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.rotation=this.rotation,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.show=this.show,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.rotation=e(this.rotation,t.rotation),this.semiMajorAxis=e(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=e(this.semiMinorAxis,t.semiMinorAxis),this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=e(this.numberOfVerticalLines,t.numberOfVerticalLines),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/EllipsoidGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._fill=void 0,this._fillSubscription=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 n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),radii:a("radii"),material:o("material"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),stackPartitions:a("stackPartitions"),slicePartitions:a("slicePartitions"),subdivisions:a("subdivisions"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.radii=this.radii,e.material=this.material,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.radii=e(this.radii,t.radii),this.material=e(this.material,t.material),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.stackPartitions=e(this.stackPartitions,t.stackPartitions),this.slicePartitions=e(this.slicePartitions,t.slicePartitions),this.subdivisions=e(this.subdivisions,t.subdivisions),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/LabelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";function a(t){this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},text:o("text"),font:o("font"),style:o("style"),fillColor:o("fillColor"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),horizontalOrigin:o("horizontalOrigin"),verticalOrigin:o("verticalOrigin"),eyeOffset:o("eyeOffset"),heightReference:o("heightReference"),pixelOffset:o("pixelOffset"),scale:o("scale"),show:o("show"),showBackground:o("showBackground"),backgroundColor:o("backgroundColor"),backgroundPadding:o("backgroundPadding"),translucencyByDistance:o("translucencyByDistance"),pixelOffsetScaleByDistance:o("pixelOffsetScaleByDistance"),scaleByDistance:o("scaleByDistance"),distanceDisplayCondition:o("distanceDisplayCondition"),disableDepthTestDistance:o("disableDepthTestDistance")}),a.prototype.clone=function(e){return t(e)?(e.text=this.text,e.font=this.font,e.show=this.show,e.style=this.style,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.scale=this.scale,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.eyeOffset=this.eyeOffset,e.heightReference=this.heightReference,e.pixelOffset=this.pixelOffset,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new a(this)},a.prototype.merge=function(t){this.text=e(this.text,t.text),this.font=e(this.font,t.font),this.show=e(this.show,t.show),this.style=e(this.style,t.style),this.fillColor=e(this.fillColor,t.fillColor),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.showBackground=e(this.showBackground,t.showBackground),this.backgroundColor=e(this.backgroundColor,t.backgroundColor),this.backgroundPadding=e(this.backgroundPadding,t.backgroundPadding),this.scale=e(this.scale,t.scale),this.horizontalOrigin=e(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=e(this.verticalOrigin,t.verticalOrigin),this.eyeOffset=e(this.eyeOffset,t.eyeOffset),this.heightReference=e(this.heightReference,t.heightReference),this.pixelOffset=e(this.pixelOffset,t.pixelOffset),this.translucencyByDistance=e(this.translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=e(this.pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=e(this.disableDepthTestDistance,t.disableDepthTestDistance)},a}),define("DataSources/NodeTransformationProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/TranslationRotationScale","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";var s=new n,l=function(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new i,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=t.translation,this.rotation=t.rotation,this.scale=t.scale};return r(l.prototype,{isConstant:{get:function(){return a.isConstant(this._translation)&&a.isConstant(this._rotation)&&a.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:o("translation"),rotation:o("rotation"),scale:o("scale")}),l.prototype.getValue=function(e,r){return t(r)||(r=new n),r.translation=a.getValueOrClonedDefault(this._translation,e,s.translation,r.translation),r.rotation=a.getValueOrClonedDefault(this._rotation,e,s.rotation,r.rotation),r.scale=a.getValueOrClonedDefault(this._scale,e,s.scale,r.scale),r},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._translation,e._translation)&&a.equals(this._rotation,e._rotation)&&a.equals(this._scale,e._scale)},l}),define("DataSources/PropertyBag",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./ConstantProperty","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){return new o(e)}function u(e,t){var r=e._propertyNames,i=t._propertyNames,n=r.length;if(n!==i.length)return!1;for(var o=0;o<n;++o){var a=r[o],l=i.indexOf(a);if(l===-1)return!1;if(!s.equals(e[a],t[a]))return!1}return!0}var c=function(e,r){this._propertyNames=[],this._definitionChanged=new n,t(e)&&this.merge(e,r)};return r(c.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){for(var e=this._propertyNames,t=0,r=e.length;t<r;t++)if(!s.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),c.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1},c.prototype.addProperty=function(r,i,n){var o=this._propertyNames;o.push(r),Object.defineProperty(this,r,a(r,!0,e(n,l))),t(i)&&(this[r]=i),this._definitionChanged.raiseEvent(this)},c.prototype.removeProperty=function(e){var t=this._propertyNames,r=t.indexOf(e);this._propertyNames.splice(r,1),delete this[e],this._definitionChanged.raiseEvent(this)},c.prototype.getValue=function(e,r){t(r)||(r={});for(var i=this._propertyNames,n=0,o=i.length;n<o;n++){var a=i[n];r[a]=s.getValueOrUndefined(this[a],e,r[a])}return r},c.prototype.merge=function(e,r){for(var i=this._propertyNames,n=t(e._propertyNames)?e._propertyNames:Object.keys(e),o=0,a=n.length;o<a;o++){var s=n[o],l=this[s],u=e[s];void 0===l&&i.indexOf(s)===-1&&this.addProperty(s,void 0,r),void 0!==u&&(void 0!==l?t(l)&&t(l.merge)&&l.merge(u):t(u)&&t(u.merge)&&t(u.clone)?this[s]=u.clone():this[s]=u)}},c.prototype.equals=function(e){return this===e||e instanceof c&&u(this,e)},c}),define("DataSources/ModelGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor","./NodeTransformationProperty","./PropertyBag"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){return new a(e)}function u(e){return new s(e,l)}function c(t){this._show=void 0,this._showSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(c.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:o("show"),scale:o("scale"),minimumPixelSize:o("minimumPixelSize"),maximumScale:o("maximumScale"),incrementallyLoadTextures:o("incrementallyLoadTextures"),shadows:o("shadows"),uri:o("uri"),runAnimations:o("runAnimations"),nodeTransformations:o("nodeTransformations",void 0,u),heightReference:o("heightReference"),distanceDisplayCondition:o("distanceDisplayCondition"),silhouetteColor:o("silhouetteColor"),silhouetteSize:o("silhouetteSize"),color:o("color"),colorBlendMode:o("colorBlendMode"),colorBlendAmount:o("colorBlendAmount")}),c.prototype.clone=function(e){return t(e)?(e.show=this.show,e.scale=this.scale,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.shadows=this.shadows,e.uri=this.uri,e.runAnimations=this.runAnimations,e.nodeTransformations=this.nodeTransformations,e.heightReference=this._heightReference,e.distanceDisplayCondition=this.distanceDisplayCondition,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e):new c(this)},c.prototype.merge=function(r){this.show=e(this.show,r.show),this.scale=e(this.scale,r.scale),this.minimumPixelSize=e(this.minimumPixelSize,r.minimumPixelSize),this.maximumScale=e(this.maximumScale,r.maximumScale),this.incrementallyLoadTextures=e(this.incrementallyLoadTextures,r.incrementallyLoadTextures),this.shadows=e(this.shadows,r.shadows),this.uri=e(this.uri,r.uri),this.runAnimations=e(this.runAnimations,r.runAnimations),this.heightReference=e(this.heightReference,r.heightReference),this.distanceDisplayCondition=e(this.distanceDisplayCondition,r.distanceDisplayCondition),this.silhouetteColor=e(this.silhouetteColor,r.silhouetteColor),this.silhouetteSize=e(this.silhouetteSize,r.silhouetteSize),this.color=e(this.color,r.color),this.colorBlendMode=e(this.colorBlendMode,r.colorBlendMode),this.colorBlendAmount=e(this.colorBlendAmount,r.colorBlendAmount);var i=r.nodeTransformations;if(t(i)){var n=this.nodeTransformations;t(n)?n.merge(i):this.nodeTransformations=new s(i,l)}},c}),define("DataSources/PathGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._material=void 0,this._materialSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),width:a("width"),resolution:a("resolution"),leadTime:a("leadTime"),trailTime:a("trailTime"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.material=this.material,e.width=this.width,e.resolution=this.resolution,e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.material=e(this.material,t.material),this.width=e(this.width,t.width),this.resolution=e(this.resolution,t.resolution),this.show=e(this.show,t.show),this.leadTime=e(this.leadTime,t.leadTime),this.trailTime=e(this.trailTime,t.trailTime),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/PointGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createPropertyDescriptor"],function(e,t,r,i,n,o){"use strict";function a(t){this._color=void 0,this._colorSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(a.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),pixelSize:o("pixelSize"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth"),show:o("show"),scaleByDistance:o("scaleByDistance"),translucencyByDistance:o("translucencyByDistance"),heightReference:o("heightReference"),distanceDisplayCondition:o("distanceDisplayCondition"),disableDepthTestDistance:o("disableDepthTestDistance")}),a.prototype.clone=function(e){return t(e)?(e.color=this.color,e.pixelSize=this.pixelSize,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.show=this.show,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.heightReference=this.heightReference,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new a(this)},a.prototype.merge=function(t){this.color=e(this.color,t.color),this.pixelSize=e(this.pixelSize,t.pixelSize),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.show=e(this.show,t.show),this.scaleByDistance=e(this.scaleByDistance,t.scaleByDistance),this.translucencyByDistance=e(this._translucencyByDistance,t.translucencyByDistance),this.heightReference=e(this.heightReference,t.heightReference),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=e(this.disableDepthTestDistance,t.disableDepthTestDistance)},a}),define("DataSources/PolygonGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=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._fill=void 0,this._fillSubscription=void 0,this._definitionChanged=new n,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),hierarchy:a("hierarchy"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),perPositionHeight:a("perPositionHeight"),closeTop:a("closeTop"),closeBottom:a("closeBottom"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.hierarchy=this.hierarchy,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.hierarchy=e(this.hierarchy,t.hierarchy),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.perPositionHeight=e(this.perPositionHeight,t.perPositionHeight),this.closeTop=e(this.closeTop,t.closeTop),this.closeBottom=e(this.closeBottom,t.closeBottom),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/PolylineGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._followSurface=void 0,this._followSurfaceSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._widthSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),depthFailMaterial:o("depthFailMaterial"),positions:a("positions"),width:a("width"),followSurface:a("followSurface"),granularity:a("granularity"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.positions=this.positions,e.width=this.width,e.followSurface=this.followSurface,e.granularity=this.granularity,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.depthFailMaterial=e(this.depthFailMaterial,t.depthFailMaterial),this.positions=e(this.positions,t.positions),this.width=e(this.width,t.width),this.followSurface=e(this.followSurface,t.followSurface),this.granularity=e(this.granularity,t.granularity),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/PolylineVolumeGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._fill=void 0,this._fillSubscription=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._distanceDisplayConditionSubsription=void 0,this._definitionChanged=new n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),shape:a("shape"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),cornerType:a("cornerType"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.shape=this.shape,e.granularity=this.granularity,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.cornerType=this.cornerType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show), +this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.shape=e(this.shape,t.shape),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.cornerType=e(this.cornerType,t.cornerType),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/RectangleGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._fill=void 0,this._fillSubscription=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 n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),coordinates:a("coordinates"),material:o("material"),height:a("height"),extrudedHeight:a("extrudedHeight"),granularity:a("granularity"),stRotation:a("stRotation"),rotation:a("rotation"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),closeTop:a("closeTop"),closeBottom:a("closeBottom"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.coordinates=this.coordinates,e.material=this.material,e.height=this.height,e.extrudedHeight=this.extrudedHeight,e.granularity=this.granularity,e.stRotation=this.stRotation,e.rotation=this.rotation,e.fill=this.fill,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.coordinates=e(this.coordinates,t.coordinates),this.material=e(this.material,t.material),this.height=e(this.height,t.height),this.extrudedHeight=e(this.extrudedHeight,t.extrudedHeight),this.granularity=e(this.granularity,t.granularity),this.stRotation=e(this.stRotation,t.stRotation),this.rotation=e(this.rotation,t.rotation),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.closeTop=e(this.closeTop,t.closeTop),this.closeBottom=e(this.closeBottom,t.closeBottom),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/WallGraphics",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./createMaterialPropertyDescriptor","./createPropertyDescriptor"],function(e,t,r,i,n,o,a){"use strict";function s(t){this._show=void 0,this._showSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=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 n,this.merge(e(t,e.EMPTY_OBJECT))}return r(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),material:o("material"),positions:a("positions"),minimumHeights:a("minimumHeights"),maximumHeights:a("maximumHeights"),granularity:a("granularity"),fill:a("fill"),outline:a("outline"),outlineColor:a("outlineColor"),outlineWidth:a("outlineWidth"),shadows:a("shadows"),distanceDisplayCondition:a("distanceDisplayCondition")}),s.prototype.clone=function(e){return t(e)?(e.show=this.show,e.material=this.material,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,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):new s(this)},s.prototype.merge=function(t){this.show=e(this.show,t.show),this.material=e(this.material,t.material),this.positions=e(this.positions,t.positions),this.minimumHeights=e(this.minimumHeights,t.minimumHeights),this.maximumHeights=e(this.maximumHeights,t.maximumHeights),this.granularity=e(this.granularity,t.granularity),this.fill=e(this.fill,t.fill),this.outline=e(this.outline,t.outline),this.outlineColor=e(this.outlineColor,t.outlineColor),this.outlineWidth=e(this.outlineWidth,t.outlineWidth),this.shadows=e(this.shadows,t.shadows),this.distanceDisplayCondition=e(this.distanceDisplayCondition,t.distanceDisplayCondition)},s}),define("DataSources/Entity",["../Core/Cartesian3","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Transforms","./BillboardGraphics","./BoxGraphics","./ConstantPositionProperty","./CorridorGraphics","./createPropertyDescriptor","./createRawPropertyDescriptor","./CylinderGraphics","./EllipseGraphics","./EllipsoidGraphics","./LabelGraphics","./ModelGraphics","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineGraphics","./PolylineVolumeGraphics","./Property","./PropertyBag","./RectangleGraphics","./WallGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I){"use strict";function M(e){return new p(e)}function O(e){return m(e,void 0,M)}function R(e,t){return m(e,void 0,function(e){return e instanceof t?e:new t(e)})}function N(e){e=r(e,r.EMPTY_OBJECT);var n=e.id;i(n)||(n=t()),this._availability=void 0,this._id=n,this._definitionChanged=new a,this._name=e.name,this._show=r(e.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","orientation","path","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall"],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function k(e,t,r){for(var i=t.length,n=0;n<i;n++){var o=t[n],a=o._show,s=!r&&a,l=r&&a;s!==l&&k(o,o._children,r)}e._definitionChanged.raiseEvent(e,"isShowing",r,!r)}n(N.prototype,{availability:g("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:g("name"),show:{get:function(){return this._show},set:function(e){if(e!==this._show){var t=this.isShowing;this._show=e;var r=this.isShowing;t!==r&&k(this,this._children,r),this._definitionChanged.raiseEvent(this,"show",e,!e)}}},isShowing:{get:function(){return this._show&&(!i(this.entityCollection)||this.entityCollection.show)&&(!i(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){var t=this._parent;if(t!==e){var r=this.isShowing;if(i(t)){var n=t._children.indexOf(this);t._children.splice(n,1)}this._parent=e,i(e)&&e._children.push(this);var o=this.isShowing;r!==o&&k(this,this._children,o),this._definitionChanged.raiseEvent(this,"parent",e,t)}}},propertyNames:{get:function(){return this._propertyNames}},billboard:R("billboard",d),box:R("box",h),corridor:R("corridor",f),cylinder:R("cylinder",v),description:m("description"),ellipse:R("ellipse",_),ellipsoid:R("ellipsoid",y),label:R("label",b),model:R("model",C),orientation:m("orientation"),path:R("path",w),point:R("point",S),polygon:R("polygon",E),polyline:R("polyline",T),polylineVolume:R("polylineVolume",x),properties:R("properties",A),position:O("position"),rectangle:R("rectangle",D),viewFrom:m("viewFrom"),wall:R("wall",I)}),N.prototype.isAvailable=function(e){var t=this._availability;return!i(t)||t.contains(e)},N.prototype.addProperty=function(e){var t=this._propertyNames;t.push(e),Object.defineProperty(this,e,g(e,!0))},N.prototype.removeProperty=function(e){var t=this._propertyNames,r=t.indexOf(e);this._propertyNames.splice(r,1),delete this[e]},N.prototype.merge=function(e){this.name=r(this.name,e.name),this.availability=r(e.availability,this.availability);for(var t=this._propertyNames,n=i(e._propertyNames)?e._propertyNames:Object.keys(e),o=n.length,a=0;a<o;a++){var s=n[a];if("parent"!==s){var l=this[s],u=e[s];i(l)||t.indexOf(s)!==-1||this.addProperty(s),i(u)&&(i(l)?i(l.merge)&&l.merge(u):i(u.merge)&&i(u.clone)?this[s]=u.clone():this[s]=u)}}};var L=new s,F=new e,B=new u;return N.prototype._getModelMatrix=function(e,t){var r=P.getValueOrUndefined(this._position,e,F);if(i(r)){var n=P.getValueOrUndefined(this._orientation,e,B);return t=i(n)?l.fromRotationTranslation(s.fromQuaternion(n,L),r,t):c.eastNorthUpToFixedFrame(r,void 0,t)}},N}),define("DataSources/EntityCollection",["../Core/AssociativeArray","../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/Iso8601","../Core/JulianDate","../Core/RuntimeError","../Core/TimeInterval","./Entity"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e){if(e._firing)return void(e._refire=!0);if(0===e._suspendCount){var t=e._addedEntities,r=e._removedEntities,i=e._changedEntities;if(0!==i.length||0!==t.length||0!==r.length){e._firing=!0;do{e._refire=!1;var n=t.values.slice(0),o=r.values.slice(0),a=i.values.slice(0);t.removeAll(),r.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,n,o,a)}while(e._refire);e._firing=!1}}}function h(r){this._owner=r,this._entities=new e,this._addedEntities=new e,this._removedEntities=new e,this._changedEntities=new e,this._suspendCount=0,this._collectionChanged=new o,this._id=t(),this._show=!0,this._firing=!1,this._refire=!1}var p={id:void 0};return h.prototype.suspendEvents=function(){this._suspendCount++},h.prototype.resumeEvents=function(){this._suspendCount--,d(this)},h.collectionChangedEventCallback=void 0,i(h.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e!==this._show){this.suspendEvents();var t,r=[],i=this._entities.values,n=i.length;for(t=0;t<n;t++)r.push(i[t].isShowing);for(this._show=e,t=0;t<n;t++){var o=r[t],a=i[t];o!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,o)}this.resumeEvents()}}},owner:{get:function(){return this._owner}}}),h.prototype.computeAvailability=function(){for(var e=a.MAXIMUM_VALUE,t=a.MINIMUM_VALUE,i=this._entities.values,n=0,o=i.length;n<o;n++){var l=i[n],c=l.availability;if(r(c)){var d=c.start,h=c.stop;s.lessThan(d,e)&&!d.equals(a.MINIMUM_VALUE)&&(e=d),s.greaterThan(h,t)&&!h.equals(a.MAXIMUM_VALUE)&&(t=h)}}return a.MAXIMUM_VALUE.equals(e)&&(e=a.MINIMUM_VALUE),a.MINIMUM_VALUE.equals(t)&&(t=a.MAXIMUM_VALUE),new u({start:e,stop:t})},h.prototype.add=function(e){e instanceof c||(e=new c(e));var t=e.id,r=this._entities;if(r.contains(t))throw new l("An entity with id "+t+" already exists in this collection.");return e.entityCollection=this,r.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(h.prototype._onEntityDefinitionChanged,this),d(this),e},h.prototype.remove=function(e){return!!r(e)&&this.removeById(e.id)},h.prototype.contains=function(e){return this._entities.get(e.id)===e},h.prototype.removeById=function(e){if(!r(e))return!1;var t=this._entities,i=t.get(e);return!!this._entities.remove(e)&&(this._addedEntities.remove(e)||(this._removedEntities.set(e,i),this._changedEntities.remove(e)),this._entities.remove(e),i.definitionChanged.removeEventListener(h.prototype._onEntityDefinitionChanged,this),d(this),!0)},h.prototype.removeAll=function(){for(var e=this._entities,t=e.length,i=e.values,n=this._addedEntities,o=this._removedEntities,a=0;a<t;a++){var s=i[a],l=s.id,u=n.get(l);r(u)||(s.definitionChanged.removeEventListener(h.prototype._onEntityDefinitionChanged,this),o.set(l,s))}e.removeAll(),n.removeAll(),this._changedEntities.removeAll(),d(this)},h.prototype.getById=function(e){return this._entities.get(e)},h.prototype.getOrCreateEntity=function(e){var t=this._entities.get(e);return r(t)||(p.id=e,t=new c(p),this.add(t)),t},h.prototype._onEntityDefinitionChanged=function(e){var t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),d(this)},h}),define("DataSources/CompositeEntityCollection",["../Core/createGuid","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Math","./Entity","./EntityCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e){for(var t=e.propertyNames,r=t.length,i=0;i<r;i++)e[t[i]]=void 0}function l(e,t,r,i){m[0]=r,m[1]=i.id,t[JSON.stringify(m)]=i.definitionChanged.addEventListener(d.prototype._onDefinitionChanged,e)}function u(e,t,r,i){m[0]=r,m[1]=i.id;var n=JSON.stringify(m);t[n](),t[n]=void 0}function c(e){if(e._shouldRecomposite=!0,0===e._suspendCount){var r,i,n,c,h,p,m=e._collections,g=m.length,v=e._collectionsCopy,_=v.length,y=e._composite,b=new a(e),C=e._eventHash;for(r=0;r<_;r++)for(h=v[r],h.collectionChanged.removeEventListener(d.prototype._onCollectionChanged,e),n=h.values,p=h.id,c=n.length-1;c>-1;c--)i=n[c],u(e,C,p,i);for(r=g-1;r>=0;r--)for(h=m[r],h.collectionChanged.addEventListener(d.prototype._onCollectionChanged,e),n=h.values,p=h.id,c=n.length-1;c>-1;c--){i=n[c],l(e,C,p,i);var w=b.getById(i.id);t(w)||(w=y.getById(i.id),t(w)?s(w):(f.id=i.id,w=new o(f)),b.add(w)),w.merge(i)}e._collectionsCopy=m.slice(0),y.suspendEvents(),y.removeAll();var S=b.values;for(r=0;r<S.length;r++)y.add(S[r]);y.resumeEvents()}}function d(r,i){this._owner=i,this._composite=new a(this),this._suspendCount=0,this._collections=t(r)?r.slice():[],this._collectionsCopy=[],this._id=e(),this._eventHash={},c(this),this._shouldRecomposite=!1}function h(e,t){var r=e.indexOf(t);return r}function p(e,t,r){var i=e._collections;if(t=n.clamp(t,0,i.length-1),r=n.clamp(r,0,i.length-1),t!==r){var o=i[t];i[t]=i[r],i[r]=o,c(e)}}var f={id:void 0},m=new Array(2);return r(d.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}}}),d.prototype.addCollection=function(e,r){var i=t(r);i?this._collections.splice(r,0,e):(r=this._collections.length,this._collections.push(e)),c(this)},d.prototype.removeCollection=function(e){var t=this._collections.indexOf(e);return t!==-1&&(this._collections.splice(t,1),c(this),!0)},d.prototype.removeAllCollections=function(){this._collections.length=0,c(this)},d.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1},d.prototype.contains=function(e){return this._composite.contains(e)},d.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)},d.prototype.getCollection=function(e){return this._collections[e]},d.prototype.getCollectionsLength=function(){return this._collections.length},d.prototype.raiseCollection=function(e){var t=h(this._collections,e);p(this,t,t+1)},d.prototype.lowerCollection=function(e){var t=h(this._collections,e);p(this,t,t-1)},d.prototype.raiseCollectionToTop=function(e){var t=h(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),c(this))},d.prototype.lowerCollectionToBottom=function(e){var t=h(this._collections,e);0!==t&&(this._collections.splice(t,1),this._collections.splice(0,0,e),c(this))},d.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()},d.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&0===this._suspendCount&&(c(this),this._shouldRecomposite=!1),this._composite.resumeEvents()},d.prototype.computeAvailability=function(){return this._composite.computeAvailability()},d.prototype.getById=function(e){return this._composite.getById(e)},d.prototype._onCollectionChanged=function(e,r,i){var n=this._collectionsCopy,a=n.length,c=this._composite;c.suspendEvents();var d,h,p,m,g=i.length,v=this._eventHash,_=e.id;for(d=0;d<g;d++){var y=i[d];u(this,v,_,y);var b=y.id;for(h=a-1;h>=0;h--)p=n[h].getById(b),t(p)&&(t(m)||(m=c.getById(b),s(m)),m.merge(p));t(m)||c.removeById(b),m=void 0}var C=r.length;for(d=0;d<C;d++){var w=r[d];l(this,v,_,w);var S=w.id;for(h=a-1;h>=0;h--)p=n[h].getById(S),t(p)&&(t(m)||(m=c.getById(S),t(m)?s(m):(f.id=S,m=new o(f),c.add(m))),m.merge(p));m=void 0}c.resumeEvents()},d.prototype._onDefinitionChanged=function(e,r,i,n){for(var o=this._collections,a=this._composite,s=o.length,l=e.id,u=a.getById(l),c=u[r],d=!t(c),h=!0,p=s-1;p>=0;p--){var f=o[p].getById(e.id);if(t(f)){var m=f[r];if(t(m)){if(h){if(h=!1,!t(m.merge)||!t(m.clone)){c=m;break}c=m.clone(c)}c.merge(m)}}}d&&u.propertyNames.indexOf(r)===-1&&u.addProperty(r),u[r]=c},d}),define("DataSources/CompositeProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(t,r,i,n){function o(){i.raiseEvent(t)}var a=[];r.removeAll();for(var s=n.length,l=0;l<s;l++){var u=n.get(l);e(u.data)&&a.indexOf(u.data)===-1&&r.add(u.data.definitionChanged,o)}}function l(){this._eventHelper=new n,this._definitionChanged=new i,this._intervals=new o,this._intervals.changedEvent.addEventListener(l.prototype._intervalsChanged,this)}return t(l.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),l.prototype.getValue=function(t,r){var i=this._intervals.findDataForIntervalContainingDate(t);if(e(i))return i.getValue(t,r)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._intervals.equals(e._intervals,a.equals)},l.prototype._intervalsChanged=function(){s(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)},l}),define("DataSources/CompositeMaterialProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./CompositeProperty","./Property"],function(e,t,r,i,n,o){"use strict";function a(){this._definitionChanged=new i,this._composite=new n,this._composite.definitionChanged.addEventListener(a.prototype._raiseDefinitionChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}}),a.prototype.getType=function(t){var r=this._composite._intervals.findDataForIntervalContainingDate(t);if(e(r))return r.getType(t)},a.prototype.getValue=function(t,r){var i=this._composite._intervals.findDataForIntervalContainingDate(t);if(e(i))return i.getValue(t,r)},a.prototype.equals=function(e){return this===e||e instanceof a&&this._composite.equals(e._composite,o.equals)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),define("DataSources/CompositePositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./CompositeProperty","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(t){this._referenceFrame=e(t,o.FIXED),this._definitionChanged=new n,this._composite=new a,this._composite.definitionChanged.addEventListener(l.prototype._raiseDefinitionChanged,this)}return r(l.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}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,r,i){var n=this._composite._intervals.findDataForIntervalContainingDate(e);if(t(n))return n.getValueInReferenceFrame(e,r,i)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,s.equals)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),define("Shaders/ShadowVolumeFS",[],function(){"use strict";return"#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n#endif\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvoid writeDepthClampedToFarPlane()\n{\n#ifdef GL_EXT_frag_depth\ngl_FragDepthEXT = min(v_WindowZ * gl_FragCoord.w, 1.0);\n#endif\n}\nvoid main(void)\n{\ngl_FragColor = v_color;\nwriteDepthClampedToFarPlane();\n}\n"}),define("Shaders/ShadowVolumeVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 extrudeDirection;\nattribute vec4 color;\nattribute float batchId;\nuniform float u_globeMinimumAltitude;\nvarying float v_WindowZ;\nvarying vec4 v_color;\nvec4 depthClampFarPlane(vec4 vertexInClipCoordinates)\n{\nv_WindowZ = (0.5 * (vertexInClipCoordinates.z / vertexInClipCoordinates.w) + 0.5) * vertexInClipCoordinates.w;\nvertexInClipCoordinates.z = min(vertexInClipCoordinates.z, vertexInClipCoordinates.w);\nreturn vertexInClipCoordinates;\n}\nvoid main()\n{\nv_color = color;\nvec4 position = czm_computePosition();\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);\ngl_Position = depthClampFarPlane(czm_modelViewProjectionRelativeToEye * position);\n}\n"}),define("Scene/StencilFunction",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={NEVER:t.NEVER,LESS:t.LESS,EQUAL:t.EQUAL,LESS_OR_EQUAL:t.LEQUAL,GREATER:t.GREATER,NOT_EQUAL:t.NOTEQUAL,GREATER_OR_EQUAL:t.GEQUAL,ALWAYS:t.ALWAYS};return e(r)}),define("Scene/StencilOperation",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={ZERO:t.ZERO,KEEP:t.KEEP,REPLACE:t.REPLACE,INCREMENT:t.INCR,DECREMENT:t.DECR,INVERT:t.INVERT,INCREMENT_WRAP:t.INCR_WRAP,DECREMENT_WRAP:t.DECR_WRAP};return e(r)}),define("Scene/GroundPrimitive",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/GeometryInstance","../Core/isArray","../Core/loadJson","../Core/Math","../Core/OrientedBoundingBox","../Core/Rectangle","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Shaders/ShadowVolumeFS","../Shaders/ShadowVolumeVS","../ThirdParty/when","./BlendingState","./DepthFunction","./PerInstanceColorAppearance","./Primitive","./SceneMode","./StencilFunction","./StencilOperation"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O){"use strict";function R(e){e=a(e,a.EMPTY_OBJECT),this.geometryInstances=e.geometryInstances,this.show=a(e.show,!0),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.debugShowShadowVolume=a(e.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._sp=void 0,this._spPick=void 0,this._rsStencilPreloadPass=void 0,this._rsStencilDepthPass=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._uniformMap={u_globeMinimumAltitude:function(){return 55e3}},this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._readyPromise=T.defer(),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=R._defaultMaxTerrainHeight,this._minTerrainHeight=R._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[];var t,r=new A({flat:!0});s(this.geometryInstances)&&p(this.geometryInstances)&&this.geometryInstances.length>1&&(t=K),this._primitiveOptions={geometryInstances:void 0,appearance:r,vertexCacheOptimize:a(e.vertexCacheOptimize,!1),interleave:a(e.interleave,!1),releaseGeometryInstances:a(e.releaseGeometryInstances,!0),allowPicking:a(e.allowPicking,!0),asynchronous:a(e.asynchronous,!0),compressVertices:a(e.compressVertices,!0),_readOnlyInstanceAttributes:t,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_createPickOffsets:!0}}function N(e){return function(t,r){var i=r.maximumRadius,n=i/Math.cos(.5*t)-i;return e._maxHeight+n}}function k(e){return function(t,r){return e._minHeight}}function L(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:M.ALWAYS,frontOperation:{fail:O.KEEP,zFail:O.DECREMENT_WRAP,zPass:O.DECREMENT_WRAP},backFunction:M.ALWAYS,backOperation:{fail:O.KEEP,zFail:O.INCREMENT_WRAP,zPass:O.INCREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1}}function F(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:M.ALWAYS,frontOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.INCREMENT_WRAP},backFunction:M.ALWAYS,backOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!0,func:P.LESS_OR_EQUAL},depthMask:!1}}function B(e){return{stencilTest:{enabled:e,frontFunction:M.NOT_EQUAL,frontOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.DECREMENT_WRAP},backFunction:M.NOT_EQUAL,backOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1,blending:x.ALPHA_BLEND}}function U(e,t){var r=e.mapProjection.ellipsoid;{if(s(t.attributes)&&s(t.attributes.position3DHigh)){for(var n=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,a=n.length,l=Number.POSITIVE_INFINITY,u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,d=Number.NEGATIVE_INFINITY,h=0;h<a;h+=3){var p=i.unpack(n,h,$),f=i.unpack(o,h,ee),m=i.add(p,f,te),g=r.cartesianToCartographic(m,re),v=g.latitude,_=g.longitude;l=Math.min(l,v),u=Math.min(u,_),c=Math.max(c,v),d=Math.max(d,_)}var y=ie;return y.north=c,y.south=l,y.east=d,y.west=u,y}if(s(t.rectangle))return t.rectangle}}function V(e){n.fromRadians(e.east,e.north,0,oe[0]),n.fromRadians(e.west,e.north,0,oe[1]),n.fromRadians(e.east,e.south,0,oe[2]),n.fromRadians(e.west,e.south,0,oe[3]);for(var t=0,r=0,i=0,o=0,a=R._terrainHeightsMaxLevel,s=0;s<=a;++s){for(var l=!1,u=0;u<4;++u){var c=oe[u];if(ne.positionToTileXY(c,s,ae),0===u)i=ae.x,o=ae.y;else if(i!==ae.x||o!==ae.y){l=!0;break}}if(l)break;t=i,r=o}if(0!==s)return{x:t,y:r,level:s>a?a:s-1}}function z(e,t,r){var n=V(t),o=R._defaultMinTerrainHeight,a=R._defaultMaxTerrainHeight;if(s(n)){var l=n.level+"-"+n.x+"-"+n.y,u=R._terrainHeights[l];s(u)&&(o=u[0],a=u[1]),r.cartographicToCartesian(v.northeast(t,ue),se),r.cartographicToCartesian(v.southwest(t,ue),le),i.subtract(le,se,ce),i.add(se,i.multiplyByScalar(ce,.5,ce),ce);var c=r.scaleToGeodeticSurface(ce,de);if(s(c)){var d=i.distance(ce,c);o=Math.min(o,-d)}else o=R._defaultMinTerrainHeight}e._minTerrainHeight=Math.max(R._defaultMinTerrainHeight,o),e._maxTerrainHeight=a}function G(t,r){var i=V(t),n=R._defaultMaxTerrainHeight;if(s(i)){var o=i.level+"-"+i.x+"-"+i.y,a=R._terrainHeights[o];s(a)&&(n=a[1])}var l=e.fromRectangle3D(t,r,0);return e.fromRectangle3D(t,r,n,he),e.union(l,he,l)}function H(t,r,n){var o=r.mapProjection.ellipsoid,a=U(r,n);if(a.width<m.PI){var s=g.fromRectangle(a,t._maxHeight,t._minHeight,o);t._boundingVolumes.push(s)}else{var l=n.attributes.position3DHigh.values,u=n.attributes.position3DLow.values;t._boundingVolumes.push(e.fromEncodedCartesianVertices(l,u))}if(!r.scene3DOnly){var c=r.mapProjection,d=e.fromRectangleWithHeights2D(a,c,t._maxHeight,t._minHeight);i.fromElements(d.center.z,d.center.x,d.center.y,d.center),t._boundingVolumes2D.push(d)}}function W(e,t,r,i){if(!s(e._rsStencilPreloadPass)){var n=!e.debugShowShadowVolume;e._rsStencilPreloadPass=b.fromCache(L(n)),e._rsStencilDepthPass=b.fromCache(F(n)),e._rsColorPass=b.fromCache(B(n)),e._rsPickPass=b.fromCache(J)}}function j(e,t){if(!e.compressVertices)return t;if(t.search(/attribute\s+vec3\s+extrudeDirection;/g)!==-1){var r="compressedAttributes",i="attribute vec2 "+r+";",n="vec3 extrudeDirection;\n",o=" extrudeDirection = czm_octDecode("+r+", 65535.0);\n",a=t;a=a.replace(/attribute\s+vec3\s+extrudeDirection;/g,""),a=w.replaceMain(a,"czm_non_compressed_main");var s="void main() \n{ \n"+o+" czm_non_compressed_main(); \n}";return[i,n,a,s].join("\n")}}function q(e,t,r){if(!s(e._sp)){var i=t.context,n=e._primitive,o=E;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=D._appendShowToShader(n,o),o=D._appendDistanceDisplayConditionToShader(n,o),o=D._modifyShaderPosition(e,o,t.scene3DOnly),o=D._updateColorAttribute(n,o),o=j(n,o);var a=S,l=e._primitive._attributeLocations;if(e._sp=C.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:l}),e._primitive.allowPicking){var u=w.createPickVertexShaderSource(o);u=D._updatePickColorAttribute(u);var c=new w({sources:[a],pickColorQualifier:"varying"});e._spPick=C.replaceCache({context:i,shaderProgram:e._spPick,vertexShaderSource:u,fragmentShaderSource:c,attributeLocations:l})}else e._spPick=C.fromCache({context:i,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:l}); +}}function Y(e,t){var r=e._primitive,i=3*r._va.length;t.length=i;for(var n=0,o=r._batchTable.getUniformMapCallback()(e._uniformMap),a=0;a<i;a+=3){var l=r._va[n++],u=t[a];s(u)||(u=t[a]=new _({owner:e,primitiveType:r._primitiveType})),u.vertexArray=l,u.renderState=e._rsStencilPreloadPass,u.shaderProgram=e._sp,u.uniformMap=o,u.pass=y.GROUND,u=t[a+1],s(u)||(u=t[a+1]=new _({owner:e,primitiveType:r._primitiveType})),u.vertexArray=l,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=o,u.pass=y.GROUND,u=t[a+2],s(u)||(u=t[a+2]=new _({owner:e,primitiveType:r._primitiveType})),u.vertexArray=l,u.renderState=e._rsColorPass,u.shaderProgram=e._sp,u.uniformMap=o,u.pass=y.GROUND}}function X(e,t){var r=e._primitive,i=r._pickOffsets,n=3*i.length;t.length=n;for(var o=0,a=r._batchTable.getUniformMapCallback()(e._uniformMap),l=0;l<n;l+=3){var u=i[o++],c=u.offset,d=u.count,h=r._va[u.index],p=t[l];s(p)||(p=t[l]=new _({owner:e,primitiveType:r._primitiveType})),p.vertexArray=h,p.offset=c,p.count=d,p.renderState=e._rsStencilPreloadPass,p.shaderProgram=e._sp,p.uniformMap=a,p.pass=y.GROUND,p=t[l+1],s(p)||(p=t[l+1]=new _({owner:e,primitiveType:r._primitiveType})),p.vertexArray=h,p.offset=c,p.count=d,p.renderState=e._rsStencilDepthPass,p.shaderProgram=e._sp,p.uniformMap=a,p.pass=y.GROUND,p=t[l+2],s(p)||(p=t[l+2]=new _({owner:e,primitiveType:r._primitiveType})),p.vertexArray=h,p.offset=c,p.count=d,p.renderState=e._rsPickPass,p.shaderProgram=e._spPick,p.uniformMap=a,p.pass=y.GROUND}}function Q(e,t,r,i,n,o,a){Y(e,o),X(e,a)}function Z(e,t,r,i,n,o,a,l){var u;t.mode===I.SCENE3D?u=e._boundingVolumes:t.mode!==I.SCENE3D&&s(e._boundingVolumes2D)&&(u=e._boundingVolumes2D);var c=t.commandList,d=t.passes;if(d.render)for(var h=r.length,p=0;p<h;++p)r[p].modelMatrix=n,r[p].boundingVolume=u[Math.floor(p/3)],r[p].cull=o,r[p].debugShowBoundingVolume=a,c.push(r[p]);if(d.pick){var f=e._primitive,m=f._pickOffsets,g=3*m.length;i.length=g;for(var v=0,_=0;_<g;_+=3){var y=m[v++],b=u[y.index];i[_].modelMatrix=n,i[_].boundingVolume=b,i[_].cull=o,i[_+1].modelMatrix=n,i[_+1].boundingVolume=b,i[_+1].cull=o,i[_+2].modelMatrix=n,i[_+2].boundingVolume=b,i[_+2].cull=o,c.push(i[_],i[_+1],i[_+2])}}}var K=["color"];l(R.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}}}),R.isSupported=function(e){return e.context.stencilBuffer},R._defaultMaxTerrainHeight=9e3,R._defaultMinTerrainHeight=-1e5,R._terrainHeights=void 0,R._terrainHeightsMaxLevel=6;var J={stencilTest:{enabled:!0,frontFunction:M.NOT_EQUAL,frontOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.DECREMENT_WRAP},backFunction:M.NOT_EQUAL,backOperation:{fail:O.KEEP,zFail:O.KEEP,zPass:O.DECREMENT_WRAP},reference:0,mask:-1},depthTest:{enabled:!1},depthMask:!1},$=new i,ee=new i,te=new i,re=new n,ie=new v,ne=new d,oe=[new n,new n,new n,new n],ae=new r,se=new i,le=new i,ue=new n,ce=new i,de=new i,he=new e;return R._initialized=!1,R._initPromise=void 0,R.initializeTerrainHeights=function(){var e=R._initPromise;return s(e)?e:(R._initPromise=f(t("Assets/approximateTerrainHeights.json")).then(function(e){R._initialized=!0,R._terrainHeights=e}),R._initPromise)},R.prototype.update=function(e){if(this.show&&(s(this._primitive)||s(this.geometryInstances))){if(!R._initialized)return void R.initializeTerrainHeights();var t=this,r=this._primitiveOptions;if(!s(this._primitive)){var i,n,o,a,l,u=e.mapProjection.ellipsoid,c=p(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],d=c.length,f=new Array(d);for(a=0;a<d;++a){i=c[a],n=i.geometry;var m=U(e,n);s(l)?s(m)&&v.union(l,m,l):l=m;var g=i.id;if(s(g)&&s(m)){var _=G(m,u);this._boundingSpheresKeys.push(g),this._boundingSpheres.push(_)}if(o=n.constructor,s(o)&&s(o.createShadowVolume)){i.attributes}}z(this,l,e.mapProjection.ellipsoid);var y=e.terrainExaggeration;for(this._minHeight=this._minTerrainHeight*y,this._maxHeight=this._maxTerrainHeight*y,a=0;a<d;++a)i=c[a],n=i.geometry,o=n.constructor,f[a]=new h({geometry:o.createShadowVolume(n,k(this),N(this)),attributes:i.attributes,id:i.id,pickPrimitive:this});r.geometryInstances=f,r._createBoundingVolumeFunction=function(e,r){H(t,e,r)},r._createRenderStatesFunction=function(e,r,i,n){W(t,r)},r._createShaderProgramFunction=function(e,r,i){q(t,r)},r._createCommandsFunction=function(e,r,i,n,o,a,s){Q(t,void 0,void 0,!0,!1,a,s)},r._updateAndQueueCommandsFunction=function(e,r,i,n,o,a,s,l){Z(t,r,i,n,o,a,s,l)},this._primitive=new D(r),this._primitive.readyPromise.then(function(e){t._ready=!0,t.releaseGeometryInstances&&(t.geometryInstances=void 0);var r=e._error;s(r)?t._readyPromise.reject(r):t._readyPromise.resolve(t)})}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilPreloadPass=b.fromCache(L(!1)),this._rsStencilDepthPass=b.fromCache(F(!1)),this._rsColorPass=b.fromCache(B(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilPreloadPass=b.fromCache(L(!0)),this._rsStencilDepthPass=b.fromCache(F(!0)),this._rsColorPass=b.fromCache(B(!0))),this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e)}},R.prototype.getBoundingSphere=function(e){var t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]},R.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)},R.prototype.isDestroyed=function(){return!1},R.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),u(this)},R}),define("DataSources/CorridorGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CorridorGeometry","../Core/CorridorOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T){"use strict";function x(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}function P(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(P.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}function A(e,t,r){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=r,this._options=new x(r._entity)}var D=new C(e.WHITE),I=new w(!0),M=new w(!0),O=new w(!1),R=new w(e.BLACK),N=new w(b.DISABLED),k=new w(new u),L=new e;return a(P,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:v}}),a(P.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&T.isConstant(this._showProperty)&&T.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._distanceDisplayCondition}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),P.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},P.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},P.prototype.createFillGeometryInstance=function(i){var n,a,s=this._entity,l=s.isAvailable(i),u=new m(l&&s.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=c.fromDistanceDisplayCondition(this._distanceDisplayCondition.getValue(i));if(this._materialProperty instanceof C){var p=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(p=this._materialProperty.color.getValue(i)),a=t.fromColor(p),n={show:u,distanceDisplayCondition:d,color:a}}else n={show:u,distanceDisplayCondition:d};return new h({id:s,geometry:new r(this._options),attributes:n})},P.prototype.createOutlineGeometryInstance=function(r){var n=this._entity,o=n.isAvailable(r),a=T.getValueOrDefault(this._outlineColorProperty,r,e.BLACK);return new h({id:n,geometry:new i(this._options),attributes:{show:new m(o&&n.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(this._distanceDisplayCondition.getValue(r))}})},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._entitySubscription(),s(this)},P.prototype._onEntityPropertyChanged=function(e,t,r,i){if("availability"===t||"corridor"===t){var a=this._entity.corridor;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=a.positions,h=a.show;if(o(h)&&h.isConstant&&!h.getValue(p.MINIMUM_VALUE)||!o(d))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=n(a.material,D),y=m instanceof C;this._materialProperty=m,this._fillProperty=n(s,M),this._showProperty=n(h,I),this._showOutlineProperty=n(a.outline,O),this._outlineColorProperty=c?n(a.outlineColor,R):void 0,this._shadowsProperty=n(a.shadows,N),this._distanceDisplayCondition=n(a.distanceDisplayCondition,k);var b=a.height,w=a.extrudedHeight,S=a.granularity,E=a.width,x=a.outlineWidth,P=a.cornerType,A=l&&!o(b)&&!o(w)&&y&&g.isSupported(this._scene);if(c&&A&&(f(f.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=A,this._isClosed=o(w)||A,this._outlineEnabled=c,d.isConstant&&T.isConstant(b)&&T.isConstant(w)&&T.isConstant(S)&&T.isConstant(E)&&T.isConstant(x)&&T.isConstant(P)&&(!A||T.isConstant(m))){var L=this._options;L.vertexFormat=y?_.VERTEX_FORMAT:v.MaterialSupport.TEXTURED.vertexFormat,L.positions=d.getValue(p.MINIMUM_VALUE,L.positions),L.height=o(b)?b.getValue(p.MINIMUM_VALUE):void 0,L.extrudedHeight=o(w)?w.getValue(p.MINIMUM_VALUE):void 0,L.granularity=o(S)?S.getValue(p.MINIMUM_VALUE):void 0,L.width=o(E)?E.getValue(p.MINIMUM_VALUE):void 0,L.cornerType=o(P)?P.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(x)?x.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},P.prototype.createDynamicUpdater=function(e,t){return new A(e,t,this)},A.prototype.update=function(n){var a=this._geometryUpdater,s=a._onTerrain,l=this._primitives,u=this._groundPrimitives;s?u.removeAndDestroy(this._primitive):(l.removeAndDestroy(this._primitive),l.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var d=a._entity,p=d.corridor;if(d.isShowing&&d.isAvailable(n)&&T.getValueOrDefault(p.show,n,!0)){var f=this._options,m=T.getValueOrUndefined(p.positions,n,f.positions),b=T.getValueOrUndefined(p.width,n);if(o(m)&&o(b)){f.positions=m,f.width=b,f.height=T.getValueOrUndefined(p.height,n),f.extrudedHeight=T.getValueOrUndefined(p.extrudedHeight,n),f.granularity=T.getValueOrUndefined(p.granularity,n),f.cornerType=T.getValueOrUndefined(p.cornerType,n);var C=this._geometryUpdater.shadowsProperty.getValue(n),w=this._geometryUpdater.distanceDisplayConditionProperty.getValue(n),S=c.fromDistanceDisplayCondition(w);if(!o(p.fill)||p.fill.getValue(n)){var x=a.fillMaterialProperty,P=E.getValue(n,x,this._material);if(this._material=P,s){var A=e.WHITE;o(x.color)&&(A=x.color.getValue(n)),this._primitive=u.add(new g({geometryInstances:new h({id:d,geometry:new r(f),attributes:{color:t.fromColor(A),distanceDisplayCondition:S}}),asynchronous:!1,shadows:C}))}else{var D=new v({material:P,translucent:P.isTranslucent(),closed:o(f.extrudedHeight)});f.vertexFormat=D.vertexFormat,this._primitive=l.add(new y({geometryInstances:new h({id:d,geometry:new r(f),attributes:{distanceDisplayCondition:S}}),appearance:D,asynchronous:!1,shadows:C}))}}if(!s&&o(p.outline)&&p.outline.getValue(n)){f.vertexFormat=_.VERTEX_FORMAT;var I=T.getValueOrClonedDefault(p.outlineColor,n,e.BLACK,L),M=T.getValueOrDefault(p.outlineWidth,n,1),O=1!==I.alpha;this._outlinePrimitive=l.add(new y({geometryInstances:new h({id:d,geometry:new i(f),attributes:{color:t.fromColor(I),distanceDisplayCondition:S}}),appearance:new _({flat:!0,translucent:O,renderState:{lineWidth:a._scene.clampLineWidth(M)}}),asynchronous:!1,shadows:C}))}}}},A.prototype.getBoundingSphere=function(e,t){return S(e,this._primitive,this._outlinePrimitive,t)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},P}),define("DataSources/DataSource",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function r(){t.throwInstantiationError()}return e(r.prototype,{name:{get:t.throwInstantiationError},clock:{get:t.throwInstantiationError},entities:{get:t.throwInstantiationError},isLoading:{get:t.throwInstantiationError},changedEvent:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError},loadingEvent:{get:t.throwInstantiationError},show:{get:t.throwInstantiationError},clustering:{get:t.throwInstantiationError}}),r.prototype.update=t.throwInstantiationError,r.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))},r}),define("Scene/CullingVolume",["../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Intersect","../Core/Plane"],function(e,t,r,i,n,o,a){"use strict";function s(e){this.planes=r(e,[])}var l=[new e,new e,new e];e.clone(e.UNIT_X,l[0]),e.clone(e.UNIT_Y,l[1]),e.clone(e.UNIT_Z,l[2]);var u=new e,c=new e,d=new a(new e(1,0,0),0);return s.fromBoundingSphere=function(r,n){i(n)||(n=new s);var o=l.length,a=n.planes;a.length=2*o;for(var d=r.center,h=r.radius,p=0,f=0;f<o;++f){var m=l[f],g=a[p],v=a[p+1];i(g)||(g=a[p]=new t),i(v)||(v=a[p+1]=new t),e.multiplyByScalar(m,-h,u),e.add(d,u,u),g.x=m.x,g.y=m.y,g.z=m.z,g.w=-e.dot(m,u),e.multiplyByScalar(m,h,u),e.add(d,u,u),v.x=-m.x,v.y=-m.y,v.z=-m.z,v.w=-e.dot(e.negate(m,c),u),p+=2}return n},s.prototype.computeVisibility=function(e){for(var t=this.planes,r=!1,i=0,n=t.length;i<n;++i){var s=e.intersectPlane(a.fromCartesian4(t[i],d));if(s===o.OUTSIDE)return o.OUTSIDE;s===o.INTERSECTING&&(r=!0)}return r?o.INTERSECTING:o.INSIDE},s.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===s.MASK_OUTSIDE||t===s.MASK_INSIDE)return t;for(var r=s.MASK_INSIDE,i=this.planes,n=0,l=i.length;n<l;++n){var u=n<31?1<<n:0;if(!(n<31&&0===(t&u))){var c=e.intersectPlane(a.fromCartesian4(i[n],d));if(c===o.OUTSIDE)return s.MASK_OUTSIDE;c===o.INTERSECTING&&(r|=u)}}return r},s.MASK_OUTSIDE=4294967295,s.MASK_INSIDE=0,s.MASK_INDETERMINATE=2147483647,s}),define("Scene/OrthographicOffCenterFrustum",["../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,r,i,n,o,a){"use strict";function s(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new a,this._orthographicMatrix=new o}function l(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=o.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}i(s.prototype,{projectionMatrix:{get:function(){return l(this),this._orthographicMatrix}}});var u=new e,c=new e,d=new e,h=new e;return s.prototype.computeCullingVolume=function(i,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,p=this.right,f=this.left,m=this.near,g=this.far,v=e.cross(n,o,u);e.normalize(v,v);var _=c;e.multiplyByScalar(n,m,_),e.add(i,_,_);var y=d;e.multiplyByScalar(v,f,y),e.add(_,y,y);var b=a[0];return r(b)||(b=a[0]=new t),b.x=v.x,b.y=v.y,b.z=v.z,b.w=-e.dot(v,y),e.multiplyByScalar(v,p,y),e.add(_,y,y),b=a[1],r(b)||(b=a[1]=new t),b.x=-v.x,b.y=-v.y,b.z=-v.z,b.w=-e.dot(e.negate(v,h),y),e.multiplyByScalar(o,l,y),e.add(_,y,y),b=a[2],r(b)||(b=a[2]=new t),b.x=o.x,b.y=o.y,b.z=o.z,b.w=-e.dot(o,y),e.multiplyByScalar(o,s,y),e.add(_,y,y),b=a[3],r(b)||(b=a[3]=new t),b.x=-o.x,b.y=-o.y,b.z=-o.z,b.w=-e.dot(e.negate(o,h),y),b=a[4],r(b)||(b=a[4]=new t),b.x=n.x,b.y=n.y,b.z=n.z,b.w=-e.dot(n,_),e.multiplyByScalar(n,g,y),e.add(i,y,y),b=a[5],r(b)||(b=a[5]=new t),b.x=-n.x,b.y=-n.y,b.z=-n.z,b.w=-e.dot(e.negate(n,h),y),this._cullingVolume},s.prototype.getPixelDimensions=function(e,t,r,i){l(this);var n=this.right-this.left,o=this.top-this.bottom,a=n/e,s=o/t;return i.x=a,i.y=s,i},s.prototype.clone=function(e){return r(e)||(e=new s),e.left=this.left,e.right=this.right,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},s.prototype.equals=function(e){return r(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},s}),define("Scene/OrthographicFrustum",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","./OrthographicOffCenterFrustum"],function(e,t,r,i){"use strict";function n(){this._offCenterFrustum=new i,this.width=void 0,this._width=void 0,this.aspectRatio=void 0,this._aspectRatio=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far}function o(e){var t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;var r=1/e.aspectRatio;t.right=.5*e.width,t.left=-t.right,t.top=r*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}return t(n.prototype,{projectionMatrix:{get:function(){return o(this),this._offCenterFrustum.projectionMatrix}}}),n.prototype.computeCullingVolume=function(e,t,r){return o(this),this._offCenterFrustum.computeCullingVolume(e,t,r)},n.prototype.getPixelDimensions=function(e,t,r,i){return o(this),this._offCenterFrustum.getPixelDimensions(e,t,r,i)},n.prototype.clone=function(t){return e(t)||(t=new n),t.aspectRatio=this.aspectRatio,t.width=this.width,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._width=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},n.prototype.equals=function(t){return!!e(t)&&(o(this),o(t),this.width===t.width&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum))},n}),define("Scene/SceneTransforms",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/Math","../Core/Matrix4","../Core/Transforms","./OrthographicFrustum","./OrthographicOffCenterFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e,t,n,o){var a=n.viewMatrix,s=l.multiplyByVector(a,i.fromElements(e.x,e.y,e.z,1,b),b),u=r.multiplyComponents(t,r.normalize(s,C),C);return s.x+=t.x+u.x,s.y+=t.y+u.y,s.z+=u.z,l.multiplyByVector(n.frustum.projectionMatrix,s,o)}var f={},m=new i(0,0,0,1),g=new i,v=new e,_=new t,y=new t;f.wgs84ToWindowCoordinates=function(e,t,i){return f.wgs84WithEyeOffsetToWindowCoordinates(e,t,r.ZERO,i)};var b=new i,C=new r,w=new n(Math.PI,s.PI_OVER_TWO),S=new r,E=new r;f.wgs84WithEyeOffsetToWindowCoordinates=function(e,i,n,a){var b=e.frameState,C=f.computeActualWgs84Position(b,i,m);if(o(C)){var T=e.canvas,x=v;x.x=0,x.y=0,x.width=T.clientWidth,x.height=T.clientHeight;var P=e.camera,A=!1;if(b.mode===h.SCENE2D){var D=e.mapProjection,I=w,M=D.project(I,S),O=r.clone(P.position,E),R=P.frustum.clone(),N=l.computeViewportTransformation(x,0,1,new l),k=P.frustum.projectionMatrix,L=P.positionWC.y,F=r.fromElements(s.sign(L)*M.x-L,0,-P.positionWC.x),B=u.pointToGLWindowCoordinates(k,N,F);if(0===L||B.x<=0||B.x>=T.clientWidth)A=!0;else{if(B.x>.5*T.clientWidth){x.width=B.x,P.frustum.right=M.x-L,g=p(C,n,P,g),f.clipToGLWindowCoordinates(x,g,_),x.x+=B.x,P.position.x=-P.position.x;var U=P.frustum.right;P.frustum.right=-P.frustum.left,P.frustum.left=-U,g=p(C,n,P,g),f.clipToGLWindowCoordinates(x,g,y)}else{x.x+=B.x,x.width-=B.x,P.frustum.left=-M.x-L,g=p(C,n,P,g),f.clipToGLWindowCoordinates(x,g,_),x.x=x.x-x.width,P.position.x=-P.position.x;var V=P.frustum.left;P.frustum.left=-P.frustum.right,P.frustum.right=-V,g=p(C,n,P,g),f.clipToGLWindowCoordinates(x,g,y)}r.clone(O,P.position),P.frustum=R.clone(),a=t.clone(_,a),(a.x<0||a.x>T.clientWidth)&&(a.x=y.x)}}if(b.mode!==h.SCENE2D||A){if(g=p(C,n,P,g),g.z<0&&!(P.frustum instanceof c)&&!(P.frustum instanceof d))return;a=f.clipToGLWindowCoordinates(x,g,a)}return a.y=T.clientHeight-a.y,a}},f.wgs84ToDrawingBufferCoordinates=function(e,t,r){if(r=f.wgs84ToWindowCoordinates(e,t,r),o(r))return f.transformWindowToDrawingBuffer(e,r,r)};var T=new r,x=new n;f.computeActualWgs84Position=function(e,t,i){var n=e.mode;if(n===h.SCENE3D)return r.clone(t,i);var a=e.mapProjection,l=a.ellipsoid.cartesianToCartographic(t,x);if(o(l)){if(a.project(l,T),n===h.COLUMBUS_VIEW)return r.fromElements(T.z,T.x,T.y,i);if(n===h.SCENE2D)return r.fromElements(0,T.x,T.y,i);var u=e.morphTime;return r.fromElements(s.lerp(T.z,t.x,u),s.lerp(T.x,t.y,u),s.lerp(T.y,t.z,u),i)}};var P=new r,A=new r,D=new l;f.clipToGLWindowCoordinates=function(e,i,n){return r.divideByScalar(i,i.w,P),l.computeViewportTransformation(e,0,1,D),l.multiplyByPoint(D,P,A),t.fromCartesian3(A,n)},f.transformWindowToDrawingBuffer=function(e,r,i){var n=e.canvas,o=e.drawingBufferWidth/n.clientWidth,a=e.drawingBufferHeight/n.clientHeight;return t.fromElements(r.x*o,r.y*a,i)};var I=new i,M=new i;return f.drawingBufferToWgs84Coordinates=function(e,t,n,a){var s=e.context,u=s.uniformState,c=e._passState.viewport,d=i.clone(i.UNIT_W,I);d.x=(t.x-c.x)/c.width*2-1,d.y=(t.y-c.y)/c.height*2-1,d.z=2*n-1,d.w=1;var h,p=e.camera.frustum;if(o(p.fovy)){h=l.multiplyByVector(u.inverseViewProjection,d,M);var f=1/h.w;r.multiplyByScalar(h,f,h)}else{o(p._offCenterFrustum)&&(p=p._offCenterFrustum);var m=u.currentFrustum;h=M,h.x=.5*(d.x*(p.right-p.left)+p.left+p.right),h.y=.5*(d.y*(p.top-p.bottom)+p.bottom+p.top),h.z=.5*(d.z*(m.x-m.y)-m.x-m.y),h.w=1,h=l.multiplyByVector(u.inverseView,h,h)}return r.fromCartesian4(h,a)},f}),define("Scene/Billboard",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./HeightReference","./HorizontalOrigin","./SceneMode","./SceneTransforms","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_){"use strict";function y(e,i){e=s(e,s.EMPTY_OBJECT),this._show=s(e.show,!0),this._position=r.clone(s(e.position,r.ZERO)),this._actualPosition=r.clone(this._position),this._pixelOffset=t.clone(s(e.pixelOffset,t.ZERO)),this._translate=new t(0,0),this._eyeOffset=r.clone(s(e.eyeOffset,r.ZERO)),this._heightReference=s(e.heightReference,f.NONE),this._verticalOrigin=s(e.verticalOrigin,_.CENTER),this._horizontalOrigin=s(e.horizontalOrigin,m.CENTER),this._scale=s(e.scale,1),this._color=o.clone(s(e.color,o.WHITE)),this._rotation=s(e.rotation,0),this._alignedAxis=r.clone(s(e.alignedAxis,r.ZERO)),this._width=e.width,this._height=e.height,this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._sizeInMeters=s(e.sizeInMeters,!1),this._distanceDisplayCondition=e.distanceDisplayCondition,this._disableDepthTestDistance=s(e.disableDepthTestDistance,0),this._id=e.id,this._collection=s(e.collection,i),this._pickId=void 0,this._pickPrimitive=s(e._pickPrimitive,this),this._billboardCollection=i,this._dirty=!1,this._index=-1,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;var n=e.image,u=e.imageId;l(n)&&(l(u)||(u="string"==typeof n?n:l(n.src)?n.src:a()),this._imageId=u,this._image=n),l(e.imageSubRegion)&&(this._imageId=u,this._imageSubRegion=e.imageSubRegion),l(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=g.SCENE3D,this._clusterShow=!0,this._updateClamping()}function b(e,t){var r=e._billboardCollection;l(r)&&(r._updateBillboard(e,t),e._dirty=!0)}var C=y.SHOW_INDEX=0,w=y.POSITION_INDEX=1,S=y.PIXEL_OFFSET_INDEX=2,E=y.EYE_OFFSET_INDEX=3,T=y.HORIZONTAL_ORIGIN_INDEX=4,x=y.VERTICAL_ORIGIN_INDEX=5,P=y.SCALE_INDEX=6,A=y.IMAGE_INDEX_INDEX=7,D=y.COLOR_INDEX=8,I=y.ROTATION_INDEX=9,M=y.ALIGNED_AXIS_INDEX=10,O=y.SCALE_BY_DISTANCE_INDEX=11,R=y.TRANSLUCENCY_BY_DISTANCE_INDEX=12,N=y.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,k=y.DISTANCE_DISPLAY_CONDITION=14,L=y.DISABLE_DEPTH_DISTANCE=15;y.NUMBER_OF_PROPERTIES=16,u(y.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,b(this,C))}},position:{get:function(){return this._position},set:function(e){var t=this._position;r.equals(t,e)||(r.clone(e,t),r.clone(e,this._actualPosition),this._updateClamping(),b(this,w))}},heightReference:{get:function(){return this._heightReference},set:function(e){var t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),b(this,w))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var r=this._pixelOffset;t.equals(r,e)||(t.clone(e,r),b(this,S))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;p.equals(t,e)||(this._scaleByDistance=p.clone(e,t),b(this,O))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;p.equals(t,e)||(this._translucencyByDistance=p.clone(e,t),b(this,R))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;p.equals(t,e)||(this._pixelOffsetScaleByDistance=p.clone(e,t),b(this,N))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;r.equals(t,e)||(r.clone(e,t),b(this,E))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,b(this,T))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,b(this,x))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,b(this,P))}},color:{get:function(){return this._color},set:function(e){var t=this._color;o.equals(t,e)||(o.clone(e,t),b(this,D))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,b(this,I))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){var t=this._alignedAxis;r.equals(t,e)||(r.clone(e,t),b(this,M))}},width:{get:function(){return s(this._width,this._imageWidth)},set:function(e){this._width!==e&&(this._width=e,b(this,A))}},height:{get:function(){return s(this._height,this._imageHeight)},set:function(e){this._height!==e&&(this._height=e,b(this,A))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,b(this,D))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){d.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=d.clone(e,this._distanceDisplayCondition),b(this,k))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,b(this,L))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},image:{get:function(){return this._imageId},set:function(e){l(e)?"string"==typeof e?this.setImage(e,e):l(e.src)?this.setImage(e.src,e):this.setImage(a(),e):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,b(this,A))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=r.clone(e,this._actualClampedPosition),b(this,w)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,b(this,C))}}}),y.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId},y.prototype._updateClamping=function(){y._updateClamping(this._billboardCollection,this)};var F=new n,B=new r;y._updateClamping=function(e,t){function i(e){if(t._heightReference===f.RELATIVE_TO_GROUND)if(t._mode===g.SCENE3D){ +var i=s.cartesianToCartographic(e,F);i.height+=h.height,s.cartographicToCartesian(i,e)}else e.x+=h.height;t._clampedPosition=r.clone(e,t._clampedPosition)}var o=e._scene;if(l(o)){var a=o.globe,s=a.ellipsoid,u=a._surface,c=o.frameState.mode,d=c!==t._mode;if(t._mode=c,(t._heightReference===f.NONE||d)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference!==f.NONE&&l(t._position)){var h=s.cartesianToCartographic(t._position);if(!l(h))return void(t._actualClampedPosition=void 0);l(t._removeCallbackFunc)&&t._removeCallbackFunc(),t._removeCallbackFunc=u.updateHeight(h,i),n.clone(h,F);var p=a.getHeight(h);l(p)&&(F.height=p),s.cartographicToCartesian(F,B),i(B)}}},y.prototype._loadImage=function(){var t,r=this._billboardCollection._textureAtlas,i=this._imageId,n=this._image,o=this._imageSubRegion;if(l(n)&&(t=r.addImage(i,n)),l(o)&&(t=r.addSubRegion(i,o)),this._imageIndexPromise=t,l(t)){var a=this;t.then(function(t){if(a._imageId===i&&a._image===n&&e.equals(a._imageSubRegion,o)){var s=r.textureCoordinates[t];a._imageWidth=r.texture.width*s.width,a._imageHeight=r.texture.height*s.height,a._imageIndex=t,a._ready=!0,a._image=void 0,a._imageIndexPromise=void 0,b(a,A)}}).otherwise(function(e){console.error("Error loading image for billboard: "+e),a._imageIndexPromise=void 0})}},y.prototype.setImage=function(e,t){this._imageId!==e&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=e,this._image=t,l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype.setImageSubRegion=function(t,r){this._imageId===t&&e.equals(this._imageSubRegion,r)||(this._imageIndex=-1,this._imageId=t,this._imageSubRegion=e.clone(r),l(this._billboardCollection._textureAtlas)&&this._loadImage())},y.prototype._setTranslate=function(e){var r=this._translate;t.equals(r,e)||(t.clone(e,r),b(this,S))},y.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition},y.prototype._setActualPosition=function(e){l(this._clampedPosition)||r.clone(e,this._actualPosition),b(this,w)};var U=new i;y._computeActualPosition=function(e,t,r,i){return l(e._clampedPosition)?(r.mode!==e._mode&&e._updateClamping(),e._clampedPosition):r.mode===g.SCENE3D?t:(h.multiplyByPoint(i,t,U),v.computeActualWgs84Position(r,U))};var V=new r;y._computeScreenSpacePosition=function(e,r,i,n,o,a){var s=h.multiplyByPoint(e,r,V),u=v.wgs84WithEyeOffsetToWindowCoordinates(o,s,i,a);if(l(u))return t.add(u,n,u),u};var z=new t(0,0);return y.prototype.computeScreenSpacePosition=function(e,r){var i=this._billboardCollection;l(r)||(r=new t),t.clone(this._pixelOffset,z),t.add(z,this._translate,z);var n=i.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==g.SCENE3D)){var a=e.mapProjection,s=a.ellipsoid,u=a.unproject(o,F);o=s.cartographicToCartesian(u,V),n=h.IDENTITY}var c=y._computeScreenSpacePosition(n,o,this._eyeOffset,z,e,r);return c},y.getScreenSpaceBoundingBox=function(t,r,i){var n=t.width,o=t.height,a=t.scale;n*=a,o*=a;var s=r.x;t.horizontalOrigin===m.RIGHT?s-=n:t.horizontalOrigin===m.CENTER&&(s-=.5*n);var u=r.y;return t.verticalOrigin===_.BOTTOM||t.verticalOrigin===_.BASELINE?u-=o:t.verticalOrigin===_.CENTER&&(u-=.5*o),l(i)||(i=new e),i.x=s,i.y=u,i.width=n,i.height=o,i},y.prototype.equals=function(i){return this===i||l(i)&&this._id===i._id&&r.equals(this._position,i._position)&&this._imageId===i._imageId&&this._show===i._show&&this._scale===i._scale&&this._verticalOrigin===i._verticalOrigin&&this._horizontalOrigin===i._horizontalOrigin&&this._heightReference===i._heightReference&&e.equals(this._imageSubRegion,i._imageSubRegion)&&o.equals(this._color,i._color)&&t.equals(this._pixelOffset,i._pixelOffset)&&t.equals(this._translate,i._translate)&&r.equals(this._eyeOffset,i._eyeOffset)&&p.equals(this._scaleByDistance,i._scaleByDistance)&&p.equals(this._translucencyByDistance,i._translucencyByDistance)&&p.equals(this._pixelOffsetScaleByDistance,i._pixelOffsetScaleByDistance)&&d.equals(this._distanceDisplayCondition,i._distanceDisplayCondition)&&this._disableDepthTestDistance===i._disableDepthTestDistance},y.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0},y}),define("Renderer/VertexArrayFacade",["../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","./Buffer","./BufferUsage","./VertexArray"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(i,n,o,a){function s(t,r){return e.getSizeInBytes(r.componentDatatype)-e.getSizeInBytes(t.componentDatatype)}var l=u._verifyAttributes(n);o=t(o,0);for(var c,d,h=[],p={},f=l.length,m=0;m<f;++m){var g=l[m];g.vertexBuffer?h.push(g):(d=g.usage,c=p[d],r(c)||(c=p[d]=[]),c.push(g))}this._allBuffers=[];for(d in p)if(p.hasOwnProperty(d)){c=p[d],c.sort(s);var v=u._vertexSizeInBytes(c),_=c[0].usage,y={vertexSizeInBytes:v,vertexBuffer:void 0,usage:_,needsCommit:!1,arrayBuffer:void 0,arrayViews:u._createArrayViews(c,v)};this._allBuffers.push(y)}this._size=0,this._instanced=t(a,!1),this._precreated=h,this._context=i,this.writers=void 0,this.va=void 0,this.resize(o)}function c(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;var i=t.vertexBuffer,n=e._size*t.vertexSizeInBytes,o=r(i);if(!o||i.sizeInBytes<n)return o&&i.destroy(),t.vertexBuffer=a.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}function d(e,t,r){if(e.needsCommit&&e.vertexSizeInBytes>0){var i=e.vertexSizeInBytes*t,n=e.vertexSizeInBytes*r;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,n),i)}}function h(e){var t=e.va;if(r(t)){for(var i=t.length,n=0;n<i;++n)t[n].va.destroy();e.va=void 0}}u._verifyAttributes=function(r){for(var i=[],n=0;n<r.length;++n){var o=r[n],a={index:t(o.index,n),enabled:t(o.enabled,!0),componentsPerAttribute:o.componentsPerAttribute,componentDatatype:t(o.componentDatatype,e.FLOAT),normalize:t(o.normalize,!1),vertexBuffer:o.vertexBuffer,usage:t(o.usage,s.STATIC_DRAW)};i.push(a)}for(var l=new Array(i.length),u=0;u<i.length;++u){var c=i[u],d=c.index;l[d]=!0}return i},u._vertexSizeInBytes=function(t){for(var r=0,i=t.length,n=0;n<i;++n){var o=t[n];r+=o.componentsPerAttribute*e.getSizeInBytes(o.componentDatatype)}var a=i>0?e.getSizeInBytes(t[0].componentDatatype):0,s=a>0?r%a:0,l=0===s?0:a-s;return r+=l},u._createArrayViews=function(t,r){for(var i=[],n=0,o=t.length,a=0;a<o;++a){var s=t[a],l=s.componentDatatype;i.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:l,normalize:s.normalize,offsetInBytes:n,vertexSizeInComponentType:r/e.getSizeInBytes(l),view:void 0}),n+=s.componentsPerAttribute*e.getSizeInBytes(l)}return i},u.prototype.resize=function(e){this._size=e;var t=this._allBuffers;this.writers=[];for(var r=0,i=t.length;r<i;++r){var n=t[r];u._resize(n,this._size),u._appendWriters(this.writers,n)}h(this)},u._resize=function(t,i){if(t.vertexSizeInBytes>0){var n=new ArrayBuffer(i*t.vertexSizeInBytes);if(r(t.arrayBuffer))for(var o=new Uint8Array(n),a=new Uint8Array(t.arrayBuffer),s=a.length,l=0;l<s;++l)o[l]=a[l];for(var u=t.arrayViews,c=u.length,d=0;d<c;++d){var h=u[d];h.view=e.createArrayBufferView(h.componentDatatype,n,h.offsetInBytes)}t.arrayBuffer=n}};var p=[function(e,t,r){return function(i,n){t[i*r]=n,e.needsCommit=!0}},function(e,t,r){return function(i,n,o){var a=i*r;t[a]=n,t[a+1]=o,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a){var s=i*r;t[s]=n,t[s+1]=o,t[s+2]=a,e.needsCommit=!0}},function(e,t,r){return function(i,n,o,a,s){var l=i*r;t[l]=n,t[l+1]=o,t[l+2]=a,t[l+3]=s,e.needsCommit=!0}}];return u._appendWriters=function(e,t){for(var r=t.arrayViews,i=r.length,n=0;n<i;++n){var o=r[n];e[o.index]=p[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}},u.prototype.commit=function(e){var t,i,n,a=!1,s=this._allBuffers;for(i=0,n=s.length;i<n;++i)t=s[i],a=c(this,t)||a;if(a||!r(this.va)){h(this);for(var d=this.va=[],p=r(e)?Math.ceil(this._size/(o.SIXTY_FOUR_KILOBYTES-1)):1,f=0;f<p;++f){var m=[];for(i=0,n=s.length;i<n;++i){t=s[i];var g=f*(t.vertexSizeInBytes*(o.SIXTY_FOUR_KILOBYTES-1));u._appendAttributes(m,t,g,this._instanced)}m=m.concat(this._precreated),d.push({va:new l({context:this._context,attributes:m,indexBuffer:e}),indicesCount:1.5*(f!==p-1?o.SIXTY_FOUR_KILOBYTES-1:this._size%(o.SIXTY_FOUR_KILOBYTES-1))})}}},u._appendAttributes=function(e,t,r,i){for(var n=t.arrayViews,o=n.length,a=0;a<o;++a){var s=n[a];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:r+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}},u.prototype.subCommit=function(e,t){for(var r=this._allBuffers,i=0,n=r.length;i<n;++i)d(r[i],e,t)},u.prototype.endSubCommits=function(){for(var e=this._allBuffers,t=0,r=e.length;t<r;++t)e[t].needsCommit=!1},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){for(var e=this._allBuffers,t=0,r=e.length;t<r;++t){var n=e[t];n.vertexBuffer=n.vertexBuffer&&n.vertexBuffer.destroy()}return h(this),i(this)},u}),define("Shaders/BillboardCollectionFS",[],function(){"use strict";return"uniform sampler2D u_atlas;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef RENDER_FOR_PICK\nvec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);\n#else\nvec4 vertexColor = v_color;\n#endif\nvec4 color = texture2D(u_atlas, v_textureCoordinates) * vertexColor;\n#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),define("Shaders/BillboardCollectionVS",[],function(){"use strict";return"#ifdef INSTANCED\nattribute vec2 direction;\n#endif\nattribute vec4 positionHighAndScale;\nattribute vec4 positionLowAndRotation;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 compressedAttribute2;\nattribute vec4 eyeOffset;\nattribute vec4 scaleByDistance;\nattribute vec4 pixelOffsetScaleByDistance;\nattribute vec3 distanceDisplayConditionAndDisableDepth;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nconst float UPPER_BOUND = 32768.0;\nconst float SHIFT_LEFT16 = 65536.0;\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_LEFT7 = 128.0;\nconst float SHIFT_LEFT5 = 32.0;\nconst float SHIFT_LEFT3 = 8.0;\nconst float SHIFT_LEFT2 = 4.0;\nconst float SHIFT_LEFT1 = 2.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nconst float SHIFT_RIGHT7 = 1.0 / 128.0;\nconst float SHIFT_RIGHT5 = 1.0 / 32.0;\nconst float SHIFT_RIGHT3 = 1.0 / 8.0;\nconst float SHIFT_RIGHT2 = 1.0 / 4.0;\nconst float SHIFT_RIGHT1 = 1.0 / 2.0;\nvec4 computePositionWindowCoordinates(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters)\n{\nvec2 halfSize = imageSize * scale * czm_resolutionScale * 0.5;\nhalfSize *= ((direction * 2.0) - 1.0);\nvec2 originTranslate = origin * abs(halfSize);\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nif (validAlignedAxis || rotation != 0.0)\n{\nfloat angle = rotation;\nif (validAlignedAxis)\n{\nvec4 projectedAlignedAxis = czm_modelViewProjection * vec4(alignedAxis, 0.0);\nangle += sign(-projectedAlignedAxis.x) * acos( sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /\n(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y) );\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\nif (sizeInMeters)\n{\npositionEC.xy += halfSize;\n}\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nif (sizeInMeters)\n{\noriginTranslate /= czm_metersPerPixel(positionEC);\n}\npositionWC.xy += originTranslate;\nif (!sizeInMeters)\n{\npositionWC.xy += halfSize;\n}\npositionWC.xy += translate;\npositionWC.xy += (pixelOffset * czm_resolutionScale);\nreturn positionWC;\n}\nvoid main()\n{\nvec3 positionHigh = positionHighAndScale.xyz;\nvec3 positionLow = positionLowAndRotation.xyz;\nfloat scale = positionHighAndScale.w;\n#if defined(ROTATION) || defined(ALIGNED_AXIS)\nfloat rotation = positionLowAndRotation.w;\n#else\nfloat rotation = 0.0;\n#endif\nfloat compressed = compressedAttribute0.x;\nvec2 pixelOffset;\npixelOffset.x = floor(compressed * SHIFT_RIGHT7);\ncompressed -= pixelOffset.x * SHIFT_LEFT7;\npixelOffset.x -= UPPER_BOUND;\nvec2 origin;\norigin.x = floor(compressed * SHIFT_RIGHT5);\ncompressed -= origin.x * SHIFT_LEFT5;\norigin.y = floor(compressed * SHIFT_RIGHT3);\ncompressed -= origin.y * SHIFT_LEFT3;\norigin -= vec2(1.0);\nfloat show = floor(compressed * SHIFT_RIGHT2);\ncompressed -= show * SHIFT_LEFT2;\n#ifdef INSTANCED\nvec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);\nvec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);\nvec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;\n#else\nvec2 direction;\ndirection.x = floor(compressed * SHIFT_RIGHT1);\ndirection.y = compressed - direction.x * SHIFT_LEFT1;\nvec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);\n#endif\nfloat temp = compressedAttribute0.y * SHIFT_RIGHT8;\npixelOffset.y = -(floor(temp) - UPPER_BOUND);\nvec2 translate;\ntranslate.y = (temp - floor(temp)) * SHIFT_LEFT16;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\ntranslate.x = floor(temp) - UPPER_BOUND;\ntranslate.y += (temp - floor(temp)) * SHIFT_LEFT8;\ntranslate.y -= UPPER_BOUND;\ntemp = compressedAttribute1.x * SHIFT_RIGHT8;\nvec2 imageSize = vec2(floor(temp), compressedAttribute2.w);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\n#ifdef ALIGNED_AXIS\nvec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));\ntemp = compressedAttribute2.z * SHIFT_RIGHT5;\nbool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;\n#else\nvec3 alignedAxis = vec3(0.0);\nbool validAlignedAxis = false;\n#endif\n#ifdef RENDER_FOR_PICK\ntemp = compressedAttribute2.y;\n#else\ntemp = compressedAttribute2.x;\n#endif\nvec4 color;\ntemp = temp * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute2.z * SHIFT_RIGHT8;\nbool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;\ntemp = floor(temp) * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\ncolor.a = (temp - floor(temp)) * SHIFT_LEFT8;\nvec4 pickColor = color / 255.0;\n#else\ncolor.a = floor(temp);\ncolor /= 255.0;\n#endif\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\nfloat distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);\nscale *= distanceScale;\ntranslate *= distanceScale;\nif (scale == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency == 0.0)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef EYE_DISTANCE_PIXEL_OFFSET\nfloat pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);\npixelOffset *= pixelOffsetScale;\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayConditionAndDisableDepth.x;\nfloat farSq = distanceDisplayConditionAndDisableDepth.y;\nif (lengthSq < nearSq || lengthSq > farSq)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = computePositionWindowCoordinates(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\ngl_Position.z = min(gl_Position.z, gl_Position.w);\nbool clipped = gl_Position.z < -gl_Position.w || gl_Position.z > gl_Position.w;\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n{\ngl_Position.z = -gl_Position.w;\n}\n}\n#endif\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\nv_color.a *= translucency;\n#endif\n}\n"}),define("Scene/BlendOption",["../Core/freezeObject"],function(e){"use strict";var t={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};return e(t)}),define("Renderer/Framebuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/PixelFormat","./ContextLimits"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){var i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,r._target,r._texture,0)}function l(e,t,r){var i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,r._getRenderbuffer())}function u(r){r=e(r,e.EMPTY_OBJECT);var i=r.context._gl;a.maximumColorAttachments;this._gl=i,this._framebuffer=i.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e(r.destroyAttachments,!0);t(r.depthTexture)||t(r.depthRenderbuffer),t(r.depthStencilTexture)||t(r.depthStencilRenderbuffer);this._bind();var n,o,u,c,d;if(t(r.colorTextures)){var h=r.colorTextures;for(c=this._colorTextures.length=this._activeColorAttachments.length=h.length,u=0;u<c;++u)n=h[u],d=this._gl.COLOR_ATTACHMENT0+u,s(this,d,n),this._activeColorAttachments[u]=d,this._colorTextures[u]=n}if(t(r.colorRenderbuffers)){var p=r.colorRenderbuffers;for(c=this._colorRenderbuffers.length=this._activeColorAttachments.length=p.length,u=0;u<c;++u)o=p[u],d=this._gl.COLOR_ATTACHMENT0+u,l(this,d,o),this._activeColorAttachments[u]=d,this._colorRenderbuffers[u]=o}t(r.depthTexture)&&(n=r.depthTexture,s(this,this._gl.DEPTH_ATTACHMENT,n),this._depthTexture=n),t(r.depthRenderbuffer)&&(o=r.depthRenderbuffer,l(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o),t(r.stencilRenderbuffer)&&(o=r.stencilRenderbuffer,l(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o),t(r.depthStencilTexture)&&(n=r.depthStencilTexture,s(this,this._gl.DEPTH_STENCIL_ATTACHMENT,n),this._depthStencilTexture=n),t(r.depthStencilRenderbuffer)&&(o=r.depthStencilRenderbuffer,l(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o),this._unBind()}return r(u.prototype,{status:{get:function(){this._bind();var e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}}),u.prototype._bind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)},u.prototype._unBind=function(){var e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},u.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments},u.prototype.getColorTexture=function(e){return this._colorTextures[e]},u.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]},u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){if(this.destroyAttachments){for(var e=0,r=this._colorTextures,n=r.length;e<n;++e){var o=r[e];t(o)&&o.destroy()}var a=this._colorRenderbuffers;for(n=a.length,e=0;e<n;++e){var s=a[e];t(s)&&s.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),i(this)},u}),define("Scene/TextureAtlas",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/loadImage","../Core/PixelFormat","../Core/RuntimeError","../Renderer/Framebuffer","../Renderer/Texture","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,r,n,o,a){this.bottomLeft=i(e,t.ZERO),this.topRight=i(r,t.ZERO),this.childNode1=n,this.childNode2=o,this.imageIndex=a}function m(e){e=i(e,i.EMPTY_OBJECT);var t=i(e.borderWidthInPixels,1),n=i(e.initialSize,y);this._context=e.context,this._pixelFormat=i(e.pixelFormat,u.RGBA),this._borderWidthInPixels=t,this._textureCoordinates=[],this._guid=r(),this._idHash={},this._initialSize=n,this._root=void 0}function g(e,r){var i=e._context,o=e.numberOfImages,a=2,s=e._borderWidthInPixels;if(o>0){for(var l=e._texture.width,u=e._texture.height,c=a*(l+r.width+s),p=a*(u+r.height+s),m=l/c,g=u/p,v=new f(new t(l+s,s),new t(c,u)),_=new f(new t,new t(c,u),e._root,v),y=new f(new t(s,u+s),new t(c,p)),b=new f(new t,new t(c,p),_,y),C=0;C<e._textureCoordinates.length;C++){var w=e._textureCoordinates[C];n(w)&&(w.x*=m,w.y*=g,w.width*=m,w.height*=g)}var S=new h({context:e._context,width:c,height:p,pixelFormat:e._pixelFormat}),E=new d({context:i,colorTextures:[e._texture],destroyAttachments:!1});E._bind(),S.copyFromFramebuffer(0,0,0,0,c,p),E._unBind(),E.destroy(),e._texture=e._texture&&e._texture.destroy(),e._texture=S,e._root=b}else{var T=a*(r.width+2*s),x=a*(r.height+2*s);T<e._initialSize.x&&(T=e._initialSize.x),x<e._initialSize.y&&(x=e._initialSize.y),e._texture=e._texture&&e._texture.destroy(),e._texture=new h({context:e._context,width:T,height:x,pixelFormat:e._pixelFormat}),e._root=new f(new t(s,s),new t(T,x))}}function v(e,r,i){if(n(r)){if(!n(r.childNode1)&&!n(r.childNode2)){if(n(r.imageIndex))return;var o=r.topRight.x-r.bottomLeft.x,a=r.topRight.y-r.bottomLeft.y,s=o-i.width,l=a-i.height;if(s<0||l<0)return;if(0===s&&0===l)return r;if(s>l){r.childNode1=new f(new t(r.bottomLeft.x,r.bottomLeft.y),new t(r.bottomLeft.x+i.width,r.topRight.y));var u=r.bottomLeft.x+i.width+e._borderWidthInPixels;u<r.topRight.x&&(r.childNode2=new f(new t(u,r.bottomLeft.y),new t(r.topRight.x,r.topRight.y)))}else{r.childNode1=new f(new t(r.bottomLeft.x,r.bottomLeft.y),new t(r.topRight.x,r.bottomLeft.y+i.height));var c=r.bottomLeft.y+i.height+e._borderWidthInPixels;c<r.topRight.y&&(r.childNode2=new f(new t(r.bottomLeft.x,c),new t(r.topRight.x,r.topRight.y)))}return v(e,r.childNode1,i)}return v(e,r.childNode1,i)||v(e,r.childNode2,i)}}function _(t,i,o){var a=v(t,t._root,i);if(n(a)){a.imageIndex=o;var s=t._texture.width,l=t._texture.height,u=a.topRight.x-a.bottomLeft.x,c=a.topRight.y-a.bottomLeft.y,d=a.bottomLeft.x/s,h=a.bottomLeft.y/l,p=u/s,f=c/l;t._textureCoordinates[o]=new e(d,h,p,f),t._texture.copyFrom(i,a.bottomLeft.x,a.bottomLeft.y)}else g(t,i),_(t,i,o);t._guid=r()}var y=new t(16,16);return o(m.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},textureCoordinates:{get:function(){return this._textureCoordinates}},texture:{get:function(){return n(this._texture)||(this._texture=new h({context:this._context,width:this._initialSize.x,height:this._initialSize.y,pixelFormat:this._pixelFormat})),this._texture}},numberOfImages:{get:function(){return this._textureCoordinates.length}},guid:{get:function(){return this._guid}}}),m.prototype.addImage=function(e,t){var r=this._idHash[e];if(n(r))return r;"function"==typeof t?t=t(e):"string"==typeof t&&(t=l(t));var i=this;return r=p(t,function(e){if(i.isDestroyed())return-1;var t=i.numberOfImages;return _(i,e,t),t}),this._idHash[e]=r,r},m.prototype.addSubRegion=function(t,i){var o=this._idHash[t];if(!n(o))throw new c('image with id "'+t+'" not found in the atlas.');var a=this;return p(o,function(t){if(t===-1)return-1;var n=a._texture.width,o=a._texture.height,s=a.numberOfImages,l=a._textureCoordinates[t],u=l.x+i.x/n,c=l.y+i.y/o,d=i.width/n,h=i.height/o;return a._textureCoordinates.push(new e(u,c,d,h)),a._guid=r(),s})},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),a(this)},m}),define("Scene/BillboardCollection",["../Core/AttributeCompression","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/WebGLConstants","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/BillboardCollectionFS","../Shaders/BillboardCollectionVS","./Billboard","./BlendingState","./BlendOption","./HeightReference","./HorizontalOrigin","./SceneMode","./TextureAtlas","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R){"use strict";function N(e){e=a(e,a.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._textureAtlasGUID=void 0,this._destroyTextureAtlas=!0,this._sp=void 0,this._spTranslucent=void 0,this._spPick=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._compiledShaderRotationPick=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._compiledShaderAlignedAxisPick=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistancePick=!1,this._propertiesChanged=new Uint32Array(ge),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new t,this._baseVolumeWC=new t,this._baseVolume2D=new t,this._boundingVolume=new t,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=f.clone(a(e.modelMatrix,f.IDENTITY)),this._modelMatrix=f.clone(f.IDENTITY),this.debugShowBoundingVolume=a(e.debugShowBoundingVolume,!1),this.blendOption=a(e.blendOption,A.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=M.SCENE3D,this._buffersUsage=[v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW,v.STATIC_DRAW];var r=this;this._uniforms={u_atlas:function(){return r._textureAtlas.texture}};var i=this._scene;s(i)&&(this._removeCallbackFunc=i.terrainProviderChanged.addEventListener(function(){for(var e=this._billboards,t=e.length,r=0;r<t;++r)e[r]._updateClamping()},this))}function k(e){for(var t=e.length,r=0;r<t;++r)e[r]&&e[r]._destroy()}function L(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;for(var t=[],r=e._billboards,i=r.length,n=0,o=0;n<i;++n){var a=r[n];a&&(a._index=o++,t.push(a))}e._billboards=t}}function F(e){var t=16384,r=e.cache.billboardCollection_indexBufferBatched;if(s(r))return r;for(var i=6*t-6,n=new Uint16Array(i),o=0,a=0;o<i;o+=6,a+=4)n[o]=a,n[o+1]=a+1,n[o+2]=a+2,n[o+3]=a+0,n[o+4]=a+2,n[o+5]=a+3;return r=g.createIndexBuffer({context:e,typedArray:n,usage:v.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT}),r.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=r,r}function B(e){var t=e.cache.billboardCollection_indexBufferInstanced;return s(t)?t:(t=g.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:v.STATIC_DRAW,indexDatatype:h.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t,t)}function U(e){var t=e.cache.billboardCollection_vertexBufferInstanced;return s(t)?t:(t=g.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:v.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t,t)}function V(e,t,r,i){var n=[{index:$.positionHighAndScale,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[te]},{index:$.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[te]},{index:$.compressedAttribute0,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[re]},{index:$.compressedAttribute1,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[he]},{index:$.compressedAttribute2,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[le]},{index:$.eyeOffset,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[ie]},{index:$.scaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[de]},{index:$.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:o.FLOAT,usage:r[pe]},{index:$.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:o.FLOAT, +usage:r[fe]}];i&&n.push({index:$.direction,componentsPerAttribute:2,componentDatatype:o.FLOAT,vertexBuffer:U(e)});var a=i?t:4*t;return new S(e,n,a,i)}function z(e,r,i,n,o){var a,s=n[$.positionHighAndScale],l=n[$.positionLowAndRotation],u=o._getActualPosition();e._mode===M.SCENE3D&&(t.expand(e._baseVolume,u,e._baseVolume),e._boundingVolumeDirty=!0),d.fromCartesian(u,be);var c=o.scale,h=o.rotation;0!==h&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,c);var p=be.high,f=be.low;e._instanced?(a=o._index,s(a,p.x,p.y,p.z,c),l(a,f.x,f.y,f.z,h)):(a=4*o._index,s(a+0,p.x,p.y,p.z,c),s(a+1,p.x,p.y,p.z,c),s(a+2,p.x,p.y,p.z,c),s(a+3,p.x,p.y,p.z,c),l(a+0,f.x,f.y,f.z,h),l(a+1,f.x,f.y,f.z,h),l(a+2,f.x,f.y,f.z,h),l(a+3,f.x,f.y,f.z,h))}function G(t,r,i,n,o){var a,s=n[$.compressedAttribute0],l=o.pixelOffset,u=l.x,c=l.y,d=o._translate,h=d.x,f=d.y;t._maxPixelOffset=Math.max(t._maxPixelOffset,Math.abs(u+h),Math.abs(-c+f));var m=o.horizontalOrigin,g=o._verticalOrigin,v=o.show&&o.clusterShow;0===o.color.alpha&&(v=!1),g===R.BASELINE&&(g=R.BOTTOM),t._allHorizontalCenter=t._allHorizontalCenter&&m===I.CENTER,t._allVerticalCenter=t._allVerticalCenter&&g===R.CENTER;var _=0,y=0,b=0,C=0,w=o._imageIndex;if(w!==-1){var S=i[w];_=S.x,y=S.y,b=S.width,C=S.height}var E=_+b,T=y+C,x=Math.floor(p.clamp(u,-we,we)+we)*Te;x+=(m+1)*xe,x+=(g+1)*Pe,x+=(v?1:0)*Ae;var P=Math.floor(p.clamp(c,-we,we)+we)*Ee,A=Math.floor(p.clamp(h,-we,we)+we)*Ee,D=(p.clamp(f,-we,we)+we)*De,M=Math.floor(D),O=Math.floor((D-M)*Ee);P+=M,A+=O,Ce.x=_,Ce.y=y;var N=e.compressTextureCoordinates(Ce);Ce.x=E;var k=e.compressTextureCoordinates(Ce);Ce.y=T;var L=e.compressTextureCoordinates(Ce);Ce.x=_;var F=e.compressTextureCoordinates(Ce);t._instanced?(a=o._index,s(a,x,P,A,N)):(a=4*o._index,s(a+0,x+Ie,P,A,N),s(a+1,x+Me,P,A,k),s(a+2,x+Oe,P,A,L),s(a+3,x+Re,P,A,F))}function H(t,r,n,o,l){var u,c=o[$.compressedAttribute1],d=l.alignedAxis;i.equals(d,i.ZERO)||(t._shaderAlignedAxis=!0);var h=0,f=1,m=1,g=1,v=l.translucencyByDistance;s(v)&&(h=v.near,f=v.nearValue,m=v.far,g=v.farValue,1===f&&1===g||(t._shaderTranslucencyByDistance=!0));var _=0,y=l._imageIndex;if(y!==-1){var b=n[y];_=b.width}var C=t._textureAtlas.texture.width,w=Math.round(a(l.width,C*_));t._maxSize=Math.max(t._maxSize,w);var S=p.clamp(w,0,Se),E=0;Math.abs(i.magnitudeSquared(d)-1)<p.EPSILON6&&(E=e.octEncodeFloat(d)),f=p.clamp(f,0,1),f=1===f?255:255*f|0,S=S*Ee+f,g=p.clamp(g,0,1),g=1===g?255:255*g|0,E=E*Ee+g,t._instanced?(u=l._index,c(u,S,E,h,m)):(u=4*l._index,c(u+0,S,E,h,m),c(u+1,S,E,h,m),c(u+2,S,E,h,m),c(u+3,S,E,h,m))}function W(e,t,r,o,s){var l,u=o[$.compressedAttribute2],c=s.color,d=s.getPickId(t).color,h=s.sizeInMeters?1:0,f=Math.abs(i.magnitudeSquared(s.alignedAxis)-1)<p.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&1===h;var m=0,g=s._imageIndex;if(g!==-1){var v=r[g];m=v.height}var _=e._textureAtlas.texture.dimensions,y=Math.round(a(s.height,_.y*m));e._maxSize=Math.max(e._maxSize,y);var b=n.floatToByte(c.red),C=n.floatToByte(c.green),w=n.floatToByte(c.blue),S=b*Se+C*Ee+w;b=n.floatToByte(d.red),C=n.floatToByte(d.green),w=n.floatToByte(d.blue);var E=b*Se+C*Ee+w,T=n.floatToByte(c.alpha)*Se+n.floatToByte(d.alpha)*Ee;T+=2*h+f,e._instanced?(l=s._index,u(l,S,E,T,y)):(l=4*s._index,u(l+0,S,E,T,y),u(l+1,S,E,T,y),u(l+2,S,E,T,y),u(l+3,S,E,T,y))}function j(t,r,i,n,o){var a,s=n[$.eyeOffset],l=o.eyeOffset,u=l.z;if(o._heightReference!==D.NONE&&(u*=1.005),t._maxEyeOffset=Math.max(t._maxEyeOffset,Math.abs(l.x),Math.abs(l.y),Math.abs(u)),t._instanced){var c=0,d=0,h=o._imageIndex;if(h!==-1){var p=i[h];c=p.width,d=p.height}Ce.x=c,Ce.y=d;var f=e.compressTextureCoordinates(Ce);a=o._index,s(a,l.x,l.y,u,f)}else a=4*o._index,s(a+0,l.x,l.y,u,0),s(a+1,l.x,l.y,u,0),s(a+2,l.x,l.y,u,0),s(a+3,l.x,l.y,u,0)}function q(e,t,r,i,n){var o,a=i[$.scaleByDistance],l=0,u=1,c=1,d=1,h=n.scaleByDistance;s(h)&&(l=h.near,u=h.nearValue,c=h.far,d=h.farValue,1===u&&1===d||(e._shaderScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,d)):(o=4*n._index,a(o+0,l,u,c,d),a(o+1,l,u,c,d),a(o+2,l,u,c,d),a(o+3,l,u,c,d))}function Y(e,t,r,i,n){var o,a=i[$.pixelOffsetScaleByDistance],l=0,u=1,c=1,d=1,h=n.pixelOffsetScaleByDistance;s(h)&&(l=h.near,u=h.nearValue,c=h.far,d=h.farValue,1===u&&1===d||(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=n._index,a(o,l,u,c,d)):(o=4*n._index,a(o+0,l,u,c,d),a(o+1,l,u,c,d),a(o+2,l,u,c,d),a(o+3,l,u,c,d))}function X(e,t,r,i,n){var o,a=i[$.distanceDisplayConditionAndDisableDepth],l=0,u=Number.MAX_VALUE,c=n.distanceDisplayCondition;s(c)&&(l=c.near,u=c.far,l*=l,u*=u,e._shaderDistanceDisplayCondition=!0);var d=n.disableDepthTestDistance;d*=d,d>0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1)),e._instanced?(o=n._index,a(o,l,u,d)):(o=4*n._index,a(o+0,l,u,d),a(o+1,l,u,d),a(o+2,l,u,d),a(o+3,l,u,d))}function Q(e,t,r,i,n){z(e,t,r,i,n),G(e,t,r,i,n),H(e,t,r,i,n),W(e,t,r,i,n),j(e,t,r,i,n),q(e,t,r,i,n),Y(e,t,r,i,n),X(e,t,r,i,n)}function Z(e,r,i,n,o,a){var l;n.mode===M.SCENE3D?(l=e._baseVolume,e._boundingVolumeDirty=!0):l=e._baseVolume2D;for(var u=[],c=0;c<i;++c){var d=r[c],h=d.position,p=x._computeActualPosition(d,h,n,o);s(p)&&(d._setActualPosition(p),a?u.push(p):t.expand(l,p,l))}a&&t.fromPoints(u,l)}function K(e,t){var r=t.mode,i=e._billboards,n=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==r||r!==M.SCENE3D&&!f.equals(o,e.modelMatrix)?(e._mode=r,f.clone(e.modelMatrix,o),e._createVertexArray=!0,r!==M.SCENE3D&&r!==M.SCENE2D&&r!==M.COLUMBUS_VIEW||Z(e,i,i.length,t,o,!0)):r===M.MORPHING?Z(e,i,i.length,t,o,!0):r!==M.SCENE2D&&r!==M.COLUMBUS_VIEW||Z(e,n,e._billboardsToUpdateIndex,t,o,!1)}function J(e,t,r){var i=1;e._allSizedInMeters&&0===e._maxPixelOffset||(i=t.camera.getPixelSize(r,t.context.drawingBufferWidth,t.context.drawingBufferHeight));var n=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(n*=.5);var o=i*e._maxPixelOffset+e._maxEyeOffset;r.radius+=n+o}var $,ee=x.SHOW_INDEX,te=x.POSITION_INDEX,re=x.PIXEL_OFFSET_INDEX,ie=x.EYE_OFFSET_INDEX,ne=x.HORIZONTAL_ORIGIN_INDEX,oe=x.VERTICAL_ORIGIN_INDEX,ae=x.SCALE_INDEX,se=x.IMAGE_INDEX_INDEX,le=x.COLOR_INDEX,ue=x.ROTATION_INDEX,ce=x.ALIGNED_AXIS_INDEX,de=x.SCALE_BY_DISTANCE_INDEX,he=x.TRANSLUCENCY_BY_DISTANCE_INDEX,pe=x.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,fe=x.DISTANCE_DISPLAY_CONDITION_INDEX,me=x.DISABLE_DEPTH_DISTANCE,ge=x.NUMBER_OF_PROPERTIES,ve={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,distanceDisplayConditionAndDisableDepth:8},_e={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,distanceDisplayConditionAndDisableDepth:9};l(N.prototype,{length:{get:function(){return L(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e,this._createVertexArray=!0)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}}}),N.prototype.add=function(e){var t=new x(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t},N.prototype.remove=function(e){return!!this.contains(e)&&(this._billboards[e._index]=null,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},N.prototype.removeAll=function(){k(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0},N.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]},N.prototype.contains=function(e){return s(e)&&e._billboardCollection===this},N.prototype.get=function(e){return L(this),this._billboards[e]};var ye;N.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,r=this._propertiesChanged,i=0;i<ge;++i){var n=0===r[i]?v.STATIC_DRAW:v.STREAM_DRAW;t=t||e[i]!==n,e[i]=n}return t};var be=new d,Ce=new r,we=32768,Se=65536,Ee=256,Te=128,xe=32,Pe=8,Ae=4,De=1/256,Ie=0,Me=2,Oe=3,Re=1,Ne=[];return N.prototype.update=function(e){L(this);var r=this._billboards,i=r.length,n=e.context;this._instanced=n.instancedArrays,$=this._instanced?_e:ve,ye=this._instanced?B:F;var o=this._textureAtlas;if(!s(o)){o=this._textureAtlas=new O({context:n});for(var a=0;a<i;++a)r[a]._loadImage()}var l=o.textureCoordinates;if(0!==l.length){K(this,e),r=this._billboards,i=r.length;var u=this._billboardsToUpdate,c=this._billboardsToUpdateIndex,d=this._propertiesChanged,h=o.guid,p=this._createVertexArray||this._textureAtlasGUID!==h;this._textureAtlasGUID=h;var g,v=e.passes,S=v.pick;if(p||!S&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var x=0;x<ge;++x)d[x]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=V(n,i,this._buffersUsage,this._instanced),g=this._vaf.writers;for(var D=0;D<i;++D){var I=this._billboards[D];I._dirty=!1,Q(this,n,l,g,I)}this._vaf.commit(ye(n))}this._billboardsToUpdateIndex=0}else if(c>0){var R=Ne;R.length=0,(d[te]||d[ue]||d[ae])&&R.push(z),(d[se]||d[re]||d[ne]||d[oe]||d[ee])&&(R.push(G),this._instanced&&R.push(j)),(d[se]||d[ce]||d[he])&&(R.push(H),R.push(W)),(d[se]||d[le])&&R.push(W),d[ie]&&R.push(j),d[de]&&R.push(q),d[pe]&&R.push(Y),(d[fe]||d[me])&&R.push(X);var N=R.length;if(g=this._vaf.writers,c/i>.1){for(var k=0;k<c;++k){var U=u[k];U._dirty=!1;for(var Z=0;Z<N;++Z)R[Z](this,n,l,g,U)}this._vaf.commit(ye(n))}else{for(var be=0;be<c;++be){var Ce=u[be];Ce._dirty=!1;for(var we=0;we<N;++we)R[we](this,n,l,g,Ce);this._instanced?this._vaf.subCommit(Ce._index,1):this._vaf.subCommit(4*Ce._index,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(c>1.5*i&&(u.length=i),s(this._vaf)&&s(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,t.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var Se,Ee=f.IDENTITY;e.mode===M.SCENE3D?(Ee=this.modelMatrix,Se=t.clone(this._baseVolumeWC,this._boundingVolume)):Se=t.clone(this._baseVolume2D,this._boundingVolume),J(this,e,Se);var Te=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,Te){this._blendOption===A.OPAQUE||this._blendOption===A.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=b.fromCache({depthTest:{enabled:!0,func:m.LESS},depthMask:!0}):this._rsOpaque=void 0;var xe=this._blendOption===A.TRANSLUCENT;this._blendOption===A.TRANSLUCENT||this._blendOption===A.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=b.fromCache({depthTest:{enabled:!0,func:xe?m.LEQUAL:m.LESS},depthMask:xe,blending:P.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==e.minimumDisableDepthTestDistance,(Te||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(Ie=new w({sources:[T]}),this._instanced&&Ie.defines.push("INSTANCED"),this._shaderRotation&&Ie.defines.push("ROTATION"),this._shaderAlignedAxis&&Ie.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Ie.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Ie.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Ie.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Ie.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&Ie.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===A.OPAQUE_AND_TRANSLUCENT&&(Me=new w({defines:["OPAQUE"],sources:[E]}),this._sp=C.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:Ie,fragmentShaderSource:Me,attributeLocations:$}),Me=new w({defines:["TRANSLUCENT"],sources:[E]}),this._spTranslucent=C.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:Ie,fragmentShaderSource:Me,attributeLocations:$})),this._blendOption===A.OPAQUE&&(Me=new w({sources:[E]}),this._sp=C.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:Ie,fragmentShaderSource:Me,attributeLocations:$})),this._blendOption===A.TRANSLUCENT&&(Me=new w({sources:[E]}),this._spTranslucent=C.replaceCache({context:n,shaderProgram:this._spTranslucent,vertexShaderSource:Ie,fragmentShaderSource:Me,attributeLocations:$})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance),s(this._spPick)&&this._shaderRotation===this._compiledShaderRotationPick&&this._shaderAlignedAxis===this._compiledShaderAlignedAxisPick&&this._shaderScaleByDistance===this._compiledShaderScaleByDistancePick&&this._shaderTranslucencyByDistance===this._compiledShaderTranslucencyByDistancePick&&this._shaderPixelOffsetScaleByDistance===this._compiledShaderPixelOffsetScaleByDistancePick&&this._shaderDistanceDisplayCondition===this._compiledShaderDistanceDisplayConditionPick&&this._shaderDisableDepthDistance===this._compiledShaderDisableDepthDistancePick||(Ie=new w({defines:["RENDER_FOR_PICK"],sources:[T]}),this._instanced&&Ie.defines.push("INSTANCED"),this._shaderRotation&&Ie.defines.push("ROTATION"),this._shaderAlignedAxis&&Ie.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&Ie.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&Ie.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&Ie.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&Ie.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&Ie.defines.push("DISABLE_DEPTH_DISTANCE"),Me=new w({defines:["RENDER_FOR_PICK"],sources:[E]}),this._spPick=C.replaceCache({context:n,shaderProgram:this._spPick,vertexShaderSource:Ie,fragmentShaderSource:Me,attributeLocations:$}),this._compiledShaderRotationPick=this._shaderRotation,this._compiledShaderAlignedAxisPick=this._shaderAlignedAxis,this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistancePick=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistancePick=this._shaderDisableDepthDistance);var Pe,Ae,De,Ie,Me,Oe,Re=e.commandList;if(v.render){var ke=this._colorCommands,Le=this._blendOption===A.OPAQUE,Fe=this._blendOption===A.OPAQUE_AND_TRANSLUCENT;Pe=this._vaf.va,Ae=Pe.length,ke.length=Ae;var Be=Fe?2*Ae:Ae;for(Oe=0;Oe<Be;++Oe){De=ke[Oe],s(De)||(De=ke[Oe]=new _);var Ue=Le||Fe&&Oe%2===0;De.pass=Ue||!Fe?y.OPAQUE:y.TRANSLUCENT,De.owner=this;var Ve=Fe?Math.floor(Oe/2):Oe;De.boundingVolume=Se,De.modelMatrix=Ee,De.count=Pe[Ve].indicesCount,De.shaderProgram=Ue?this._sp:this._spTranslucent,De.uniformMap=this._uniforms,De.vertexArray=Pe[Ve].va,De.renderState=Ue?this._rsOpaque:this._rsTranslucent,De.debugShowBoundingVolume=this.debugShowBoundingVolume,this._instanced&&(De.count=6,De.instanceCount=i),Re.push(De)}}if(S){var ze=this._pickCommands;for(Pe=this._vaf.va,Ae=Pe.length,ze.length=Ae,Oe=0;Oe<Ae;++Oe)De=ze[Oe],s(De)||(De=ze[Oe]=new _({pass:y.OPAQUE,owner:this})),De.boundingVolume=Se,De.modelMatrix=Ee,De.count=Pe[Oe].indicesCount,De.shaderProgram=this._spPick,De.uniformMap=this._uniforms,De.vertexArray=Pe[Oe].va,De.renderState=this._rsOpaque,this._instanced&&(De.count=6,De.instanceCount=i),Re.push(De)}}}},N.prototype.isDestroyed=function(){return!1},N.prototype.destroy=function(){return s(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),k(this._billboards),u(this)},N}),define("Scene/LabelStyle",["../Core/freezeObject"],function(e){"use strict";var t={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};return e(t)}),define("Scene/Label",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","./Billboard","./HeightReference","./HorizontalOrigin","./LabelStyle","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f){"use strict";function m(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function g(e){e._rebindAllGlyphs||e._repositionAllGlyphs||e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function v(e,o){e=n(e,n.EMPTY_OBJECT),this._text=n(e.text,""),this._show=n(e.show,!0),this._font=n(e.font,"30px sans-serif"),this._fillColor=i.clone(n(e.fillColor,i.WHITE)),this._outlineColor=i.clone(n(e.outlineColor,i.BLACK)),this._outlineWidth=n(e.outlineWidth,1),this._showBackground=n(e.showBackground,!1),this._backgroundColor=n(e.backgroundColor,new i(.165,.165,.165,.8)),this._backgroundPadding=n(e.backgroundPadding,new t(7,5)),this._style=n(e.style,p.FILL),this._verticalOrigin=n(e.verticalOrigin,f.BASELINE),this._horizontalOrigin=n(e.horizontalOrigin,h.LEFT),this._pixelOffset=t.clone(n(e.pixelOffset,t.ZERO)),this._eyeOffset=r.clone(n(e.eyeOffset,r.ZERO)),this._position=r.clone(n(e.position,r.ZERO)),this._scale=n(e.scale,1),this._id=e.id,this._translucencyByDistance=e.translucencyByDistance,this._pixelOffsetScaleByDistance=e.pixelOffsetScaleByDistance,this._scaleByDistance=e.scaleByDistance,this._heightReference=n(e.heightReference,d.NONE),this._distanceDisplayCondition=e.distanceDisplayCondition,this._disableDepthTestDistance=n(e.disableDepthTestDistance,0),this._labelCollection=o,this._glyphs=[],this._backgroundBillboard=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this._updateClamping()}return a(v.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r].billboard;o(n)&&(n.show=e)}var a=this._backgroundBillboard;o(a)&&(a.show=e)}}},position:{get:function(){return this._position},set:function(e){var t=this._position;if(!r.equals(t,e)){r.clone(e,t);for(var i=this._glyphs,n=0,a=i.length;n<a;n++){var s=i[n].billboard;o(s)&&(s.position=e)}var l=this._backgroundBillboard;o(l)&&(l.position=e),this._heightReference!==d.NONE&&this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r].billboard;o(n)&&(n.heightReference=e)}var a=this._backgroundBillboard;o(a)&&(a.heightReference=e),g(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){this._text!==e&&(this._text=e,m(this))}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,m(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){var t=this._fillColor;i.equals(t,e)||(i.clone(e,t),m(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;i.equals(t,e)||(i.clone(e,t),m(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,m(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,m(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){var t=this._backgroundColor;if(!i.equals(t,e)){i.clone(e,t);var r=this._backgroundBillboard;o(r)&&(r.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){var r=this._backgroundPadding;t.equals(r,e)||(t.clone(e,r),g(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,m(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){var r=this._pixelOffset;if(!t.equals(r,e)){t.clone(e,r);for(var i=this._glyphs,n=0,a=i.length;n<a;n++){var s=i[n];o(s.billboard)&&(s.billboard.pixelOffset=e)}var l=this._backgroundBillboard;o(l)&&(l.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;if(!u.equals(t,e)){this._translucencyByDistance=u.clone(e,t);for(var r=this._glyphs,i=0,n=r.length;i<n;i++){var a=r[i];o(a.billboard)&&(a.billboard.translucencyByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){var t=this._pixelOffsetScaleByDistance;if(!u.equals(t,e)){this._pixelOffsetScaleByDistance=u.clone(e,t);for(var r=this._glyphs,i=0,n=r.length;i<n;i++){var a=r[i];o(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;if(!u.equals(t,e)){this._scaleByDistance=u.clone(e,t);for(var r=this._glyphs,i=0,n=r.length;i<n;i++){var a=r[i];o(a.billboard)&&(a.billboard.scaleByDistance=e)}var s=this._backgroundBillboard;o(s)&&(s.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){var t=this._eyeOffset;if(!r.equals(t,e)){r.clone(e,t);for(var i=this._glyphs,n=0,a=i.length;n<a;n++){var s=i[n];o(s.billboard)&&(s.billboard.eyeOffset=e)}var l=this._backgroundBillboard;o(l)&&(l.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,g(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.verticalOrigin=e)}var a=this._backgroundBillboard;o(a)&&(a.verticalOrigin=e),g(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.scale=e)}var a=this._backgroundBillboard;o(a)&&(a.scale=e),g(this)}}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!l.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition);for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.distanceDisplayCondition=e)}var a=this._backgroundBillboard;o(a)&&(a.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.disableDepthTestDistance=e)}var a=this._backgroundBillboard;o(a)&&(a.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.id=e)}var a=this._backgroundBillboard;o(a)&&(a.id=e)}}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=r.clone(e,this._actualClampedPosition);var t=this._glyphs;e=n(e,this._position);for(var i=0,a=t.length;i<a;i++){var s=t[i];o(s.billboard)&&(s.billboard._clampedPosition=e,r.clone(e,s.billboard._position),r.clone(e,s.billboard._actualPosition))}var l=this._backgroundBillboard;o(l)&&(l._clampedPosition=e,r.clone(e,l._position),r.clone(e,l._actualPosition))}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;for(var t=this._glyphs,r=0,i=t.length;r<i;r++){var n=t[r];o(n.billboard)&&(n.billboard.clusterShow=e)}var a=this._backgroundBillboard;o(a)&&(a.clusterShow=e)}}}}),v.prototype._updateClamping=function(){c._updateClamping(this._labelCollection,this)},v.prototype.computeScreenSpacePosition=function(e,r){o(r)||(r=new t);var i=this._labelCollection,n=i.modelMatrix,a=o(this._actualClampedPosition)?this._actualClampedPosition:this._position,s=c._computeScreenSpacePosition(n,a,this._eyeOffset,this._pixelOffset,e,r);return s},v.getScreenSpaceBoundingBox=function(t,r,i){var n=0,a=0,s=0,l=0,u=t.scale,c=t._labelCollection._resolutionScale,d=t._backgroundBillboard;if(o(d))n=r.x+d._translate.x/c,a=r.y-d._translate.y/c,s=d.width*u,l=d.height*u,t.verticalOrigin===f.BOTTOM||t.verticalOrigin===f.BASELINE?a-=l:t.verticalOrigin===f.CENTER&&(a-=.5*l);else{n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(var h=0,p=0,m=t._glyphs,g=m.length,v=0;v<g;++v){var _=m[v],y=_.billboard;if(o(y)){var b=r.x+y._translate.x/c,C=r.y-y._translate.y/c,w=y.width*u,S=y.height*u;t.verticalOrigin===f.BOTTOM||t.verticalOrigin===f.BASELINE?C-=S:t.verticalOrigin===f.CENTER&&(C-=.5*S),n=Math.min(n,b),a=Math.min(a,C),h=Math.max(h,b+w),p=Math.max(p,C+S)}}s=h-n,l=p-a}return o(i)||(i=new e),i.x=n,i.y=a,i.width=s,i.height=l,i},v.prototype.equals=function(e){return this===e||o(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._text===e._text&&this._font===e._font&&r.equals(this._position,e._position)&&i.equals(this._fillColor,e._fillColor)&&i.equals(this._outlineColor,e._outlineColor)&&i.equals(this._backgroundColor,e._backgroundColor)&&t.equals(this._backgroundPadding,e._backgroundPadding)&&t.equals(this._pixelOffset,e._pixelOffset)&&r.equals(this._eyeOffset,e._eyeOffset)&&u.equals(this._translucencyByDistance,e._translucencyByDistance)&&u.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&u.equals(this._scaleByDistance,e._scaleByDistance)&&l.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id},v.prototype.isDestroyed=function(){return!1},v}),define("Scene/LabelCollection",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/writeTextToCanvas","./BillboardCollection","./BlendOption","./HorizontalOrigin","./Label","./LabelStyle","./TextureAtlas","./VerticalOrigin"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(){this.textureInfo=void 0,this.dimensions=void 0,this.billboard=void 0}function v(e,t,r){this.labelCollection=e,this.index=t,this.dimensions=r}function _(e,t){var r=document.createElement("canvas");r.width=D.x,r.height=D.y;var i=r.getContext("2d");i.fillStyle="#fff",i.fillRect(0,0,r.width,r.height),e.addImage(A,r).then(function(e){t._whitePixelIndex=e})}function y(e,t,r,i,n,o,a){return M.font=t,M.fillColor=r,M.strokeColor=i,M.strokeWidth=n,a===m.CENTER?M.textBaseline="middle":a===m.TOP?M.textBaseline="top":M.textBaseline="bottom",M.fill=o===p.FILL||o===p.FILL_AND_OUTLINE,M.stroke=o===p.OUTLINE||o===p.FILL_AND_OUTLINE,l(e,M)}function b(e,t){t.textureInfo=void 0,t.dimensions=void 0;var r=t.billboard;i(r)&&(r.show=!1,r.image=void 0,e._spareBillboards.push(r),t.billboard=void 0)}function C(e,t,r,i){e.addImage(t,r).then(function(e,t){i.index=e})}function w(e,t){var r,n,o,a=t._text,s=a.length,l=t._glyphs,u=l.length;if(s<u)for(n=s;n<u;++n)b(e,l[n]);l.length=s;var c=t._showBackground&&a.split("\n").join("").length>0,h=t._backgroundBillboard,p=e._backgroundBillboardCollection;c?(i(h)||(h=p.add({collection:e,image:A,imageSubRegion:I}),t._backgroundBillboard=h),h.color=t._backgroundColor,h.show=t._show,h.position=t._position,h.eyeOffset=t._eyeOffset,h.pixelOffset=t._pixelOffset,h.horizontalOrigin=d.LEFT,h.verticalOrigin=t._verticalOrigin,h.heightReference=t._heightReference,h.scale=t._scale,h.pickPrimitive=t,h.id=t._id,h.translucencyByDistance=t._translucencyByDistance,h.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,h.scaleByDistance=t._scaleByDistance,h.distanceDisplayCondition=t._distanceDisplayCondition,h.disableDepthTestDistance=t._disableDepthTestDistance):i(h)&&(p.remove(h),t._backgroundBillboard=h=void 0);var f=e._glyphTextureCache;for(o=0;o<s;++o){var m=a.charAt(o),_=t._font,w=t._fillColor,S=t._outlineColor,E=t._outlineWidth,T=t._style,x=t._verticalOrigin,P=JSON.stringify([m,_,w.toRgba(),S.toRgba(),E,+T,+x]),D=f[P];if(!i(D)){var M=y(m,_,w,S,E,T,x);D=new v(e,-1,M.dimensions),f[P]=D,M.width>0&&M.height>0&&C(e._textureAtlas,P,M,D)}if(r=l[o],i(r)?D.index===-1?b(e,r):i(r.textureInfo)&&(r.textureInfo=void 0):(r=new g,l[o]=r),r.textureInfo=D,r.dimensions=D.dimensions,D.index!==-1){var O=r.billboard,R=e._spareBillboards;i(O)||(O=R.length>0?R.pop():e._billboardCollection.add({collection:e}),r.billboard=O),O.show=t._show,O.position=t._position,O.eyeOffset=t._eyeOffset,O.pixelOffset=t._pixelOffset,O.horizontalOrigin=d.LEFT,O.verticalOrigin=t._verticalOrigin,O.heightReference=t._heightReference,O.scale=t._scale,O.pickPrimitive=t,O.id=t._id,O.image=P,O.translucencyByDistance=t._translucencyByDistance,O.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,O.scaleByDistance=t._scaleByDistance,O.distanceDisplayCondition=t._distanceDisplayCondition,O.disableDepthTestDistance=t._disableDepthTestDistance}}t._repositionAllGlyphs=!0}function S(e,t,r){return t===d.CENTER?-e/2:t===d.RIGHT?-(e+r.x):r.x}function E(e,r){var n,o,a=e._glyphs,s=e._text,l=0,u=0,c=[],h=Number.NEGATIVE_INFINITY,p=0,f=1,g=0,v=a.length,_=e._backgroundBillboard,y=R;for(t.clone(i(_)?e._backgroundPadding:t.ZERO,y),g=0;g<v;++g)"\n"===s.charAt(g)?(c.push(l),++f,l=0):(n=a[g],o=n.dimensions,p=Math.max(p,o.height-o.descent),h=Math.max(h,o.descent),l+=o.width-o.bounds.minx,g<v-1&&(l+=a[g+1].dimensions.bounds.minx),u=Math.max(u,l));c.push(l);var b=p+h,C=e._scale,w=e._horizontalOrigin,E=e._verticalOrigin,T=0,x=c[T],A=S(x,w,y),D=P*b,I=D*(f-1);O.x=A*C*r,O.y=0;var M=0;for(g=0;g<v;++g)if("\n"===s.charAt(g))++T,M+=D,x=c[T],A=S(x,w,y),O.x=A*C*r;else if(n=a[g],o=n.dimensions,E===m.TOP?O.y=o.height-p-y.y:E===m.CENTER?O.y=(I+o.height-p)/2:E===m.BASELINE?O.y=I:O.y=I+h+y.y,O.y=(O.y-o.descent-M)*C*r,i(n.billboard)&&n.billboard._setTranslate(O),g<v-1){var N=a[g+1];O.x+=(o.width-o.bounds.minx+N.dimensions.bounds.minx)*C*r}i(_)&&s.split("\n").join("").length>0&&(A=w===d.CENTER?-u/2-y.x:w===d.RIGHT?-(u+2*y.x):0,O.x=A*C*r,E===m.TOP?O.y=b-p-h:E===m.CENTER?O.y=(b-p)/2-h:E===m.BASELINE?O.y=-y.y-h:O.y=0,O.y=O.y*C*r,_.width=u+2*y.x,_.height=b+I+2*y.y,_._setTranslate(O))}function T(e,t){for(var r=t._glyphs,n=0,a=r.length;n<a;++n)b(e,r[n]);i(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0, +i(t._removeCallbackFunc)&&t._removeCallbackFunc(),o(t)}function x(e){e=r(e,r.EMPTY_OBJECT),this._scene=e.scene,this._textureAtlas=void 0,this._backgroundTextureAtlas=void 0,this._whitePixelIndex=void 0,this._backgroundBillboardCollection=new u({scene:this._scene}),this._backgroundBillboardCollection.destroyTextureAtlas=!1,this._billboardCollection=new u({scene:this._scene}),this._billboardCollection.destroyTextureAtlas=!1,this._spareBillboards=[],this._glyphTextureCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._resolutionScale=void 0,this.modelMatrix=s.clone(r(e.modelMatrix,s.IDENTITY)),this.debugShowBoundingVolume=r(e.debugShowBoundingVolume,!1),this.blendOption=r(e.blendOption,c.OPAQUE_AND_TRANSLUCENT)}var P=1.2,A="ID_WHITE_PIXEL",D=new t(4,4),I=new e(1,1,1,1),M={},O=new t,R=new t;return n(x.prototype,{length:{get:function(){return this._labels.length}}}),x.prototype.add=function(e){var t=new h(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t},x.prototype.remove=function(e){if(i(e)&&e._labelCollection===this){var t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),T(this,e),!0}return!1},x.prototype.removeAll=function(){for(var e=this._labels,t=0,r=e.length;t<r;++t)T(this,e[t]);e.length=0},x.prototype.contains=function(e){return i(e)&&e._labelCollection===this},x.prototype.get=function(e){return this._labels[e]},x.prototype.update=function(e){var t=this._billboardCollection,r=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,r.modelMatrix=this.modelMatrix,r.debugShowBoundingVolume=this.debugShowBoundingVolume;var n=e.context;i(this._textureAtlas)||(this._textureAtlas=new f({context:n}),t.textureAtlas=this._textureAtlas),i(this._backgroundTextureAtlas)||(this._backgroundTextureAtlas=new f({context:n,initialSize:D}),r.textureAtlas=this._backgroundTextureAtlas,_(this._backgroundTextureAtlas,this));var o=n.uniformState,a=o.resolutionScale,s=this._resolutionScale!==a;this._resolutionScale=a;var l;l=s?this._labels:this._labelsToUpdate;for(var u=l.length,d=0;d<u;++d){var h=l[d];if(!h.isDestroyed()){var p=h._glyphs.length;h._rebindAllGlyphs&&(w(this,h),h._rebindAllGlyphs=!1),(s||h._repositionAllGlyphs)&&(E(h,a),h._repositionAllGlyphs=!1);var m=h._glyphs.length-p;this._totalGlyphCount+=m}}var g=r.length>0?c.TRANSLUCENT:this.blendOption;t.blendOption=g,r.blendOption=g,this._labelsToUpdate.length=0,r.update(e),t.update(e)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),o(this)},x}),define("Scene/PointPrimitive",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/NearFarScalar","./SceneMode","./SceneTransforms"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(e,t){e=o(e,o.EMPTY_OBJECT),this._show=o(e.show,!0),this._position=r.clone(o(e.position,r.ZERO)),this._actualPosition=r.clone(this._position),this._color=n.clone(o(e.color,n.WHITE)),this._outlineColor=n.clone(o(e.outlineColor,n.TRANSPARENT)),this._outlineWidth=o(e.outlineWidth,0),this._pixelSize=o(e.pixelSize,10),this._scaleByDistance=e.scaleByDistance,this._translucencyByDistance=e.translucencyByDistance,this._distanceDisplayCondition=e.distanceDisplayCondition,this._disableDepthTestDistance=o(e.disableDepthTestDistance,0),this._id=e.id,this._collection=o(e.collection,t),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1}function m(e,t){var r=e._pointPrimitiveCollection;a(r)&&(r._updatePointPrimitive(e,t),e._dirty=!0)}var g=f.SHOW_INDEX=0,v=f.POSITION_INDEX=1,_=f.COLOR_INDEX=2,y=f.OUTLINE_COLOR_INDEX=3,b=f.OUTLINE_WIDTH_INDEX=4,C=f.PIXEL_SIZE_INDEX=5,w=f.SCALE_BY_DISTANCE_INDEX=6,S=f.TRANSLUCENCY_BY_DISTANCE_INDEX=7,E=f.DISTANCE_DISPLAY_CONDITION_INDEX=8,T=f.DISABLE_DEPTH_DISTANCE_INDEX=9;f.NUMBER_OF_PROPERTIES=10,s(f.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,m(this,g))}},position:{get:function(){return this._position},set:function(e){var t=this._position;r.equals(t,e)||(r.clone(e,t),r.clone(e,this._actualPosition),m(this,v))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){var t=this._scaleByDistance;d.equals(t,e)||(this._scaleByDistance=d.clone(e,t),m(this,w))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){var t=this._translucencyByDistance;d.equals(t,e)||(this._translucencyByDistance=d.clone(e,t),m(this,S))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,m(this,C))}},color:{get:function(){return this._color},set:function(e){var t=this._color;n.equals(t,e)||(n.clone(e,t),m(this,_))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){var t=this._outlineColor;n.equals(t,e)||(n.clone(e,t),m(this,y))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,m(this,b))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){u.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=u.clone(e,this._distanceDisplayCondition),m(this,E))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,m(this,T))}},id:{get:function(){return this._id},set:function(e){this._id=e,a(this._pickId)&&(this._pickId.object.id=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,m(this,g))}}}),f.prototype.getPickId=function(e){return a(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId},f.prototype._getActualPosition=function(){return this._actualPosition},f.prototype._setActualPosition=function(e){r.clone(e,this._actualPosition),m(this,v)};var x=new i;f._computeActualPosition=function(e,t,r){return t.mode===h.SCENE3D?e:(c.multiplyByPoint(r,e,x),p.computeActualWgs84Position(t,x))};var P=new i;return f._computeScreenSpacePosition=function(e,t,r,n){var o=c.multiplyByVector(e,i.fromElements(t.x,t.y,t.z,1,P),P),a=p.wgs84ToWindowCoordinates(r,o,n);return a},f.prototype.computeScreenSpacePosition=function(e,r){var i=this._pointPrimitiveCollection;a(r)||(r=new t);var n=i.modelMatrix,o=f._computeScreenSpacePosition(n,this._actualPosition,e,r);if(a(o))return o.y=e.canvas.clientHeight-o.y,o},f.getScreenSpaceBoundingBox=function(t,r,i){var n=t.pixelSize,o=.5*n,s=r.x-o,l=r.y-o,u=n,c=n;return a(i)||(i=new e),i.x=s,i.y=l,i.width=u,i.height=c,i},f.prototype.equals=function(e){return this===e||a(e)&&this._id===e._id&&r.equals(this._position,e._position)&&n.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&n.equals(this._outlineColor,e._outlineColor)&&d.equals(this._scaleByDistance,e._scaleByDistance)&&d.equals(this._translucencyByDistance,e._translucencyByDistance)&&u.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance},f.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0},f}),define("Shaders/PointPrimitiveCollectionFS",[],function(){"use strict";return"varying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nvoid main()\n{\nfloat distanceToCenter = length(gl_PointCoord - vec2(0.5));\nfloat maxDistance = max(0.0, 0.5 - v_pixelDistance);\nfloat wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);\nfloat innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);\nvec4 color = mix(v_outlineColor, v_color, innerAlpha);\ncolor.a *= wholeAlpha;\n#if defined(RENDER_FOR_PICK) || (!defined(OPAQUE) && !defined(TRANSLUCENT))\nif (color.a < 0.005)\n{\ndiscard;\n}\n#else\n#ifdef OPAQUE\nif (color.a < 0.995)\n{\ndiscard;\n}\n#else\nif (color.a >= 0.995)\n{\ndiscard;\n}\n#endif\n#endif\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n"}),define("Shaders/PointPrimitiveCollectionVS",[],function(){"use strict";return"uniform float u_maxTotalPointSize;\nattribute vec4 positionHighAndSize;\nattribute vec4 positionLowAndOutline;\nattribute vec4 compressedAttribute0;\nattribute vec4 compressedAttribute1;\nattribute vec4 scaleByDistance;\nattribute vec3 distanceDisplayConditionAndDisableDepth;\nvarying vec4 v_color;\nvarying vec4 v_outlineColor;\nvarying float v_innerPercent;\nvarying float v_pixelDistance;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#endif\nconst float SHIFT_LEFT8 = 256.0;\nconst float SHIFT_RIGHT8 = 1.0 / 256.0;\nvoid main()\n{\nvec3 positionHigh = positionHighAndSize.xyz;\nvec3 positionLow = positionLowAndOutline.xyz;\nfloat outlineWidthBothSides = 2.0 * positionLowAndOutline.w;\nfloat totalSize = positionHighAndSize.w + outlineWidthBothSides;\nfloat outlinePercent = outlineWidthBothSides / totalSize;\ntotalSize *= czm_resolutionScale;\ntotalSize += 3.0;\nfloat temp = compressedAttribute1.x * SHIFT_RIGHT8;\nfloat show = floor(temp);\n#ifdef EYE_DISTANCE_TRANSLUCENCY\nvec4 translucencyByDistance;\ntranslucencyByDistance.x = compressedAttribute1.z;\ntranslucencyByDistance.z = compressedAttribute1.w;\ntranslucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\ntemp = compressedAttribute1.y * SHIFT_RIGHT8;\ntranslucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;\n#endif\nvec4 color;\nvec4 outlineColor;\n#ifdef RENDER_FOR_PICK\ncolor = vec4(0.0);\noutlineColor = vec4(0.0);\nvec4 pickColor;\ntemp = compressedAttribute0.z * SHIFT_RIGHT8;\npickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\npickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor.r = floor(temp);\n#else\ntemp = compressedAttribute0.x * SHIFT_RIGHT8;\ncolor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\ncolor.g = (temp - floor(temp)) * SHIFT_LEFT8;\ncolor.r = floor(temp);\ntemp = compressedAttribute0.y * SHIFT_RIGHT8;\noutlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor.r = floor(temp);\n#endif\ntemp = compressedAttribute0.w * SHIFT_RIGHT8;\n#ifdef RENDER_FOR_PICK\npickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\npickColor = pickColor / 255.0;\n#endif\ntemp = floor(temp) * SHIFT_RIGHT8;\noutlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;\noutlineColor /= 255.0;\ncolor.a = floor(temp);\ncolor /= 255.0;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC.xyz *= show;\n#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\n#endif\n#ifdef EYE_DISTANCE_SCALING\ntotalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);\n#endif\ntotalSize = min(totalSize, u_maxTotalPointSize);\nif (totalSize < 1.0)\n{\npositionEC.xyz = vec3(0.0);\ntotalSize = 1.0;\n}\nfloat translucency = 1.0;\n#ifdef EYE_DISTANCE_TRANSLUCENCY\ntranslucency = czm_nearFarScalar(translucencyByDistance, lengthSq);\nif (translucency < 0.004)\n{\npositionEC.xyz = vec3(0.0);\n}\n#endif\n#ifdef DISTANCE_DISPLAY_CONDITION\nfloat nearSq = distanceDisplayConditionAndDisableDepth.x;\nfloat farSq = distanceDisplayConditionAndDisableDepth.y;\nif (lengthSq < nearSq || lengthSq > farSq) {\npositionEC.xyz = vec3(0.0);\n}\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\n#ifdef DISABLE_DEPTH_DISTANCE\nfloat disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z;\nif (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)\n{\ndisableDepthTestDistance = czm_minimumDisableDepthTestDistance;\n}\nif (disableDepthTestDistance != 0.0)\n{\ngl_Position.z = min(gl_Position.z, gl_Position.w);\nbool clipped = gl_Position.z < -gl_Position.w || gl_Position.z > gl_Position.w;\nif (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))\n{\ngl_Position.z = -gl_Position.w;\n}\n}\n#endif\nv_color = color;\nv_color.a *= translucency;\nv_outlineColor = outlineColor;\nv_outlineColor.a *= translucency;\nv_innerPercent = 1.0 - outlinePercent;\nv_pixelDistance = 2.0 / totalSize;\ngl_PointSize = totalSize;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#endif\n}\n"}),define("Scene/PointPrimitiveCollection",["../Core/BoundingSphere","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix4","../Core/PrimitiveType","../Core/WebGLConstants","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArrayFacade","../Shaders/PointPrimitiveCollectionFS","../Shaders/PointPrimitiveCollectionVS","./BlendingState","./BlendOption","./PointPrimitive","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x){"use strict";function P(t){t=i(t,i.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._spPick=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._compiledShaderScaleByDistancePick=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistancePick=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayConditionPick=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistancePick=!1,this._propertiesChanged=new Uint32Array(Z),this._maxPixelSize=1,this._baseVolume=new e,this._baseVolumeWC=new e,this._baseVolume2D=new e,this._boundingVolume=new e,this._boundingVolumeDirty=!1,this._colorCommands=[],this._pickCommands=[],this.modelMatrix=c.clone(i(t.modelMatrix,c.IDENTITY)),this._modelMatrix=c.clone(c.IDENTITY),this.debugShowBoundingVolume=i(t.debugShowBoundingVolume,!1),this.blendOption=i(t.blendOption,E.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=x.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW,p.STATIC_DRAW];var r=this;this._uniforms={u_maxTotalPointSize:function(){return r._maxTotalPointSize}}}function A(e){for(var t=e.length,r=0;r<t;++r)e[r]&&e[r]._destroy()}function D(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;for(var t=[],r=e._pointPrimitives,i=r.length,n=0,o=0;n<i;++n){var a=r[n];a&&(a._index=o++,t.push(a))}e._pointPrimitives=t}}function I(e,t,i){return new b(e,[{index:K.positionHighAndSize,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[z]},{index:K.positionLowAndShow,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[z]},{index:K.compressedAttribute0,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[G]},{index:K.compressedAttribute1,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[Y]},{index:K.scaleByDistance,componentsPerAttribute:4,componentDatatype:r.FLOAT,usage:i[q]},{index:K.distanceDisplayConditionAndDisableDepth,componentsPerAttribute:3,componentDatatype:r.FLOAT,usage:i[X]}],t)}function M(t,r,i,n){var o=n._index,a=n._getActualPosition();t._mode===x.SCENE3D&&(e.expand(t._baseVolume,a,t._baseVolume),t._boundingVolumeDirty=!0),l.fromCartesian(a,J);var s=n.pixelSize,u=n.outlineWidth;t._maxPixelSize=Math.max(t._maxPixelSize,s+u);var c=i[K.positionHighAndSize],d=J.high;c(o,d.x,d.y,d.z,s);var h=i[K.positionLowAndOutline],p=J.low;h(o,p.x,p.y,p.z,u)}function O(e,r,i,n){var o=n._index,a=n.color,s=n.getPickId(r).color,l=n.outlineColor,u=t.floatToByte(a.red),c=t.floatToByte(a.green),d=t.floatToByte(a.blue),h=u*$+c*ee+d;u=t.floatToByte(l.red),c=t.floatToByte(l.green),d=t.floatToByte(l.blue);var p=u*$+c*ee+d;u=t.floatToByte(s.red),c=t.floatToByte(s.green),d=t.floatToByte(s.blue);var f=u*$+c*ee+d,m=t.floatToByte(a.alpha)*$+t.floatToByte(l.alpha)*ee+t.floatToByte(s.alpha),g=i[K.compressedAttribute0];g(o,h,p,f,m)}function R(e,t,r,i){var o=i._index,a=0,s=1,l=1,c=1,d=i.translucencyByDistance;n(d)&&(a=d.near,s=d.nearValue,l=d.far,c=d.farValue,1===s&&1===c||(e._shaderTranslucencyByDistance=!0));var h=i.show&&i.clusterShow;0===i.color.alpha&&0===i.outlineColor.alpha&&(h=!1),s=u.clamp(s,0,1),s=1===s?255:255*s|0;var p=(h?1:0)*ee+s;c=u.clamp(c,0,1),c=1===c?255:255*c|0;var f=c,m=r[K.compressedAttribute1];m(o,p,f,a,l)}function N(e,t,r,i){var o=i._index,a=r[K.scaleByDistance],s=0,l=1,u=1,c=1,d=i.scaleByDistance;n(d)&&(s=d.near,l=d.nearValue,u=d.far,c=d.farValue,1===l&&1===c||(e._shaderScaleByDistance=!0)),a(o,s,l,u,c)}function k(e,t,r,i){var o=i._index,a=r[K.distanceDisplayConditionAndDisableDepth],s=0,l=Number.MAX_VALUE,u=i.distanceDisplayCondition;n(u)&&(s=u.near,l=u.far,s*=s,l*=l,e._shaderDistanceDisplayCondition=!0);var c=i.disableDepthTestDistance;c*=c,c>0&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1)),a(o,s,l,c)}function L(e,t,r,i){M(e,t,r,i),O(e,t,r,i),R(e,t,r,i),N(e,t,r,i),k(e,t,r,i)}function F(t,r,i,o,a,s){var l;o.mode===x.SCENE3D?(l=t._baseVolume,t._boundingVolumeDirty=!0):l=t._baseVolume2D;for(var u=[],c=0;c<i;++c){var d=r[c],h=d.position,p=T._computeActualPosition(h,o,a);n(p)&&(d._setActualPosition(p),s?u.push(p):e.expand(l,p,l))}s&&e.fromPoints(u,l)}function B(e,t){var r=t.mode,i=e._pointPrimitives,n=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==r||r!==x.SCENE3D&&!c.equals(o,e.modelMatrix)?(e._mode=r,c.clone(e.modelMatrix,o),e._createVertexArray=!0,r!==x.SCENE3D&&r!==x.SCENE2D&&r!==x.COLUMBUS_VIEW||F(e,i,i.length,t,o,!0)):r===x.MORPHING?F(e,i,i.length,t,o,!0):r!==x.SCENE2D&&r!==x.COLUMBUS_VIEW||F(e,n,e._pointPrimitivesToUpdateIndex,t,o,!1)}function U(e,t,r){var i=t.camera.getPixelSize(r,t.context.drawingBufferWidth,t.context.drawingBufferHeight),n=i*e._maxPixelSize;r.radius+=n}var V=T.SHOW_INDEX,z=T.POSITION_INDEX,G=T.COLOR_INDEX,H=T.OUTLINE_COLOR_INDEX,W=T.OUTLINE_WIDTH_INDEX,j=T.PIXEL_SIZE_INDEX,q=T.SCALE_BY_DISTANCE_INDEX,Y=T.TRANSLUCENCY_BY_DISTANCE_INDEX,X=T.DISTANCE_DISPLAY_CONDITION_INDEX,Q=T.DISABLE_DEPTH_DISTANCE_INDEX,Z=T.NUMBER_OF_PROPERTIES,K={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};o(P.prototype,{length:{get:function(){return D(this),this._pointPrimitives.length}}}),P.prototype.add=function(e){var t=new T(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t},P.prototype.remove=function(e){return!!this.contains(e)&&(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0)},P.prototype.removeAll=function(){A(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0},P.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]},P.prototype.contains=function(e){return n(e)&&e._pointPrimitiveCollection===this},P.prototype.get=function(e){return D(this),this._pointPrimitives[e]},P.prototype.computeNewBuffersUsage=function(){for(var e=this._buffersUsage,t=!1,r=this._propertiesChanged,i=0;i<Z;++i){var n=0===r[i]?p.STATIC_DRAW:p.STREAM_DRAW;t=t||e[i]!==n,e[i]=n}return t};var J=new l,$=65536,ee=256,te=[];return P.prototype.update=function(t){D(this),this._maxTotalPointSize=f.maximumAliasedPointSize,B(this,t);var r,i=this._pointPrimitives,o=i.length,a=this._pointPrimitivesToUpdate,s=this._pointPrimitivesToUpdateIndex,l=this._propertiesChanged,u=this._createVertexArray,p=t.context,b=t.passes,T=b.pick;if(u||!T&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(var P=0;P<Z;++P)l[P]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),o>0){this._vaf=I(p,o,this._buffersUsage),r=this._vaf.writers;for(var A=0;A<o;++A){var F=this._pointPrimitives[A];F._dirty=!1,L(this,p,r,F)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(s>0){var J=te;J.length=0,(l[z]||l[W]||l[j])&&J.push(M),(l[G]||l[H])&&J.push(O),(l[V]||l[Y])&&J.push(R),l[q]&&J.push(N),(l[X]||l[Q])&&J.push(k);var $=J.length;if(r=this._vaf.writers,s/o>.1){for(var ee=0;ee<s;++ee){var re=a[ee];re._dirty=!1;for(var ie=0;ie<$;++ie)J[ie](this,p,r,re)}this._vaf.commit()}else{for(var ne=0;ne<s;++ne){var oe=a[ne];oe._dirty=!1;for(var ae=0;ae<$;++ae)J[ae](this,p,r,oe);this._vaf.subCommit(oe._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(s>1.5*o&&(a.length=o),n(this._vaf)&&n(this._vaf.va)){this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,e.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));var se,le=c.IDENTITY;t.mode===x.SCENE3D?(le=this.modelMatrix,se=e.clone(this._baseVolumeWC,this._boundingVolume)):se=e.clone(this._baseVolume2D,this._boundingVolume),U(this,t,se);var ue=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,ue&&(this._blendOption===E.OPAQUE||this._blendOption===E.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=v.fromCache({depthTest:{enabled:!0,func:h.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===E.TRANSLUCENT||this._blendOption===E.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=v.fromCache({depthTest:{enabled:!0,func:h.LEQUAL},depthMask:!1,blending:S.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||0!==t.minimumDisableDepthTestDistance,(ue||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(fe=new y({sources:[w]}),this._shaderScaleByDistance&&fe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&fe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&fe.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&fe.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===E.OPAQUE_AND_TRANSLUCENT&&(me=new y({defines:["OPAQUE"],sources:[C]}),this._sp=_.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:fe,fragmentShaderSource:me,attributeLocations:K}),me=new y({defines:["TRANSLUCENT"],sources:[C]}),this._spTranslucent=_.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:fe,fragmentShaderSource:me,attributeLocations:K})),this._blendOption===E.OPAQUE&&(me=new y({sources:[C]}),this._sp=_.replaceCache({context:p,shaderProgram:this._sp,vertexShaderSource:fe,fragmentShaderSource:me,attributeLocations:K})),this._blendOption===E.TRANSLUCENT&&(me=new y({sources:[C]}),this._spTranslucent=_.replaceCache({context:p,shaderProgram:this._spTranslucent,vertexShaderSource:fe,fragmentShaderSource:me,attributeLocations:K})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance),(!n(this._spPick)||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistancePick||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistancePick||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayConditionPick||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistancePick)&&(fe=new y({defines:["RENDER_FOR_PICK"],sources:[w]}),this._shaderScaleByDistance&&fe.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&fe.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&fe.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&fe.defines.push("DISABLE_DEPTH_DISTANCE"),me=new y({defines:["RENDER_FOR_PICK"],sources:[C]}),this._spPick=_.replaceCache({context:p,shaderProgram:this._spPick,vertexShaderSource:fe,fragmentShaderSource:me,attributeLocations:K}),this._compiledShaderScaleByDistancePick=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistancePick=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayConditionPick=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistancePick=this._shaderDisableDepthDistance);var ce,de,he,pe,fe,me,ge=t.commandList;if(b.render){var ve=this._colorCommands,_e=this._blendOption===E.OPAQUE,ye=this._blendOption===E.OPAQUE_AND_TRANSLUCENT;ce=this._vaf.va,de=ce.length,ve.length=de;var be=ye?2*de:de;for(pe=0;pe<be;++pe){var Ce=_e||ye&&pe%2===0;he=ve[pe],n(he)||(he=ve[pe]=new m),he.primitiveType=d.POINTS,he.pass=Ce||!ye?g.OPAQUE:g.TRANSLUCENT,he.owner=this;var we=ye?Math.floor(pe/2):pe;he.boundingVolume=se,he.modelMatrix=le,he.shaderProgram=Ce?this._sp:this._spTranslucent,he.uniformMap=this._uniforms,he.vertexArray=ce[we].va,he.renderState=Ce?this._rsOpaque:this._rsTranslucent,he.debugShowBoundingVolume=this.debugShowBoundingVolume,ge.push(he)}}if(T){var Se=this._pickCommands;for(ce=this._vaf.va,de=ce.length,Se.length=de,pe=0;pe<de;++pe)he=Se[pe],n(he)||(he=Se[pe]=new m({primitiveType:d.POINTS,pass:g.OPAQUE,owner:this})),he.boundingVolume=se,he.modelMatrix=le,he.shaderProgram=this._spPick,he.uniformMap=this._uniforms,he.vertexArray=ce[pe].va,he.renderState=this._rsOpaque,ge.push(he)}}},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),A(this._pointPrimitives),a(this)},P}),define("ThirdParty/kdbush",[],function(){"use strict";function e(e,r,i,n,o){return new t(e,r,i,n,o)}function t(e,t,n,a,s){t=t||r,n=n||i,s=s||Array,this.nodeSize=a||64,this.points=e,this.ids=new s(e.length),this.coords=new s(2*e.length);for(var l=0;l<e.length;l++)this.ids[l]=l,this.coords[2*l]=t(e[l]),this.coords[2*l+1]=n(e[l]);o(this.ids,this.coords,this.nodeSize,0,this.ids.length-1,0)}function r(e){return e[0]}function i(e){return e[1]}function n(e,t,r,i,n,o,a){for(var s,l,u=[0,e.length-1,0],c=[];u.length;){var d=u.pop(),h=u.pop(),p=u.pop();if(h-p<=a)for(var f=p;f<=h;f++)s=t[2*f],l=t[2*f+1],s>=r&&s<=n&&l>=i&&l<=o&&c.push(e[f]);else{var m=Math.floor((p+h)/2);s=t[2*m],l=t[2*m+1],s>=r&&s<=n&&l>=i&&l<=o&&c.push(e[m]);var g=(d+1)%2;(0===d?r<=s:i<=l)&&(u.push(p),u.push(m-1),u.push(g)),(0===d?n>=s:o>=l)&&(u.push(m+1),u.push(h),u.push(g))}}return c}function o(e,t,r,i,n,s){if(!(n-i<=r)){var l=Math.floor((i+n)/2);a(e,t,l,i,n,s%2),o(e,t,r,i,l-1,s+1),o(e,t,r,l+1,n,s+1)}}function a(e,t,r,i,n,o){for(;n>i;){if(n-i>600){var l=n-i+1,u=r-i+1,c=Math.log(l),d=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*d*(l-d)/l)*(u-l/2<0?-1:1),p=Math.max(i,Math.floor(r-u*d/l+h)),f=Math.min(n,Math.floor(r+(l-u)*d/l+h));a(e,t,r,p,f,o)}var m=t[2*r+o],g=i,v=n;for(s(e,t,i,r),t[2*n+o]>m&&s(e,t,i,n);g<v;){for(s(e,t,g,v),g++,v--;t[2*g+o]<m;)g++;for(;t[2*v+o]>m;)v--}t[2*i+o]===m?s(e,t,i,v):(v++,s(e,t,v,n)),v<=r&&(i=v+1),r<=v&&(n=v-1)}}function s(e,t,r,i){l(e,r,i),l(t,2*r,2*i),l(t,2*r+1,2*i+1)}function l(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function u(e,t,r,i,n,o){for(var a=[0,e.length-1,0],s=[],l=n*n;a.length;){var u=a.pop(),d=a.pop(),h=a.pop();if(d-h<=o)for(var p=h;p<=d;p++)c(t[2*p],t[2*p+1],r,i)<=l&&s.push(e[p]);else{var f=Math.floor((h+d)/2),m=t[2*f],g=t[2*f+1];c(m,g,r,i)<=l&&s.push(e[f]);var v=(u+1)%2;(0===u?r-n<=m:i-n<=g)&&(a.push(h),a.push(f-1),a.push(v)),(0===u?r+n>=m:i+n>=g)&&(a.push(f+1),a.push(d),a.push(v))}}return s}function c(e,t,r,i){var n=e-r,o=t-i;return n*n+o*o}return t.prototype={range:function(e,t,r,i){return n(this.ids,this.coords,e,t,r,i,this.nodeSize)},within:function(e,t,r){return u(this.ids,this.coords,e,t,r,this.nodeSize)}},e}),define("DataSources/EntityCluster",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/EllipsoidalOccluder","../Core/Event","../Core/Matrix4","../Scene/Billboard","../Scene/BillboardCollection","../Scene/Label","../Scene/LabelCollection","../Scene/PointPrimitive","../Scene/PointPrimitiveCollection","../Scene/SceneMode","../ThirdParty/kdbush"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e){e=i(e,i.EMPTY_OBJECT),this._enabled=i(e.enabled,!1),this._pixelRange=i(e.pixelRange,80),this._minimumClusterSize=i(e.minimumClusterSize,2),this._clusterBillboards=i(e.clusterBillboards,!0),this._clusterLabels=i(e.clusterLabels,!0),this._clusterPoints=i(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 s}function _(e){return e.coord.x}function y(e){return e.coord.y}function b(e,t){e.x-=t,e.y-=t,e.width+=2*t,e.height+=2*t}function C(t,r,i,o,a){if(n(t._labelCollection)&&o._clusterLabels?a=d.getScreenSpaceBoundingBox(t,r,a):n(t._billboardCollection)&&o._clusterBillboards?a=u.getScreenSpaceBoundingBox(t,r,a):n(t._pointPrimitiveCollection)&&o._clusterPoints&&(a=p.getScreenSpaceBoundingBox(t,r,a)),b(a,i),o._clusterLabels&&!n(t._labelCollection)&&n(t.id)&&E(o,t.id)&&n(t.id._label)){var s=o._collectionIndicesByEntity[t.id],l=o._labelCollection.get(s),c=d.getScreenSpaceBoundingBox(l,r,M);b(c,i),a=e.union(a,c,a)}return a}function w(e,t){if(e.clusterShow=!0,!n(e._labelCollection)&&n(e.id)&&E(t,e.id)&&n(e.id._label)){var r=t._collectionIndicesByEntity[e.id],i=t._labelCollection.get(r);i.clusterShow=!0}}function S(e,t,r,i){var n={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};n.billboard.show=!1,n.point.show=!1,n.label.show=!0,n.label.text=t.toLocaleString(),n.billboard.position=n.label.position=n.point.position=e,i._clusterEvent.raiseEvent(r,n)}function E(e,t){return n(e)&&n(e._collectionIndicesByEntity[t])&&n(e._collectionIndicesByEntity[t].labelIndex); +}function T(e,t,r,i,o){if(n(e))for(var a=e.length,s=0;s<a;++s){var l=e.get(s);if(l.clusterShow=!1,l.show&&(o._scene.mode!==m.SCENE3D||i.isPointVisible(l.position))){var u=o._clusterLabels&&n(l._labelCollection),c=o._clusterBillboards&&n(l.id._billboard),d=o._clusterPoints&&n(l.id._point);if(!u||!d&&!c){var h=l.computeScreenSpacePosition(r);n(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}}}function x(i){return function(o){if(!(n(o)&&o<.05)&&i.enabled){var s=i._scene,d=i._labelCollection,p=i._billboardCollection,m=i._pointCollection;if((n(d)||n(p)||n(m))&&(i._clusterBillboards||i._clusterLabels||i._clusterPoints)){var v=i._clusterLabelCollection,b=i._clusterBillboardCollection,E=i._clusterPointCollection;n(v)?v.removeAll():v=i._clusterLabelCollection=new h({scene:s}),n(b)?b.removeAll():b=i._clusterBillboardCollection=new c({scene:s}),n(E)?E.removeAll():E=i._clusterPointCollection=new f;var x=i._pixelRange,P=i._minimumClusterSize,A=i._previousClusters,D=[],I=i._previousHeight,M=s.camera.positionCartographic.height,k=s.mapProjection.ellipsoid,L=s.camera.positionWC,F=new a(k,L),B=[];i._clusterLabels&&T(d,B,s,F,i),i._clusterBillboards&&T(p,B,s,F,i),i._clusterPoints&&T(m,B,s,F,i);var U,V,z,G,H,W,j,q,Y,X,Q,Z,K=g(B,_,y,64,Int32Array);if(M<I)for(z=A.length,U=0;U<z;++U){var J=A[U];if(F.isPointVisible(J.position)){var $=u._computeScreenSpacePosition(l.IDENTITY,J.position,r.ZERO,t.ZERO,s);if(n($)){var ee=1-M/I,te=J.width=J.width*ee,re=J.height=J.height*ee;te=Math.max(te,J.minimumWidth),re=Math.max(re,J.minimumHeight);var ie=$.x-.5*te,ne=$.y-.5*re,oe=$.x+te,ae=$.y+re;for(H=K.range(ie,ne,oe,ae),W=H.length,X=0,Y=[],V=0;V<W;++V)j=H[V],q=B[j],q.clustered||(++X,Q=q.collection,Z=q.index,Y.push(Q.get(Z).id));if(X>=P)for(S(J.position,X,Y,i),D.push(J),V=0;V<W;++V)B[H[V]].clustered=!0}}}for(z=B.length,U=0;U<z;++U){var se=B[U];if(!se.clustered){se.clustered=!0,Q=se.collection,Z=se.index;var le=Q.get(Z);G=C(le,se.coord,x,i,O);var ue=e.clone(G,R);H=K.range(G.x,G.y,G.x+G.width,G.y+G.height),W=H.length;var ce=r.clone(le.position);for(X=1,Y=[le.id],V=0;V<W;++V)if(j=H[V],q=B[j],!q.clustered){var de=q.collection.get(q.index),he=C(de,q.coord,x,i,N);r.add(de.position,ce,ce),e.union(ue,he,ue),++X,Y.push(de.id)}if(X>=P){var pe=r.multiplyByScalar(ce,1/X,ce);for(S(pe,X,Y,i),D.push({position:pe,width:ue.width,height:ue.height,minimumWidth:G.width,minimumHeight:G.height}),V=0;V<W;++V)B[H[V]].clustered=!0}else w(le,i)}}0===v.length&&(v.destroy(),i._clusterLabelCollection=void 0),0===b.length&&(b.destroy(),i._clusterBillboardCollection=void 0),0===E.length&&(E.destroy(),i._clusterPointCollection=void 0),i._previousClusters=D,i._previousHeight=M}}}}function P(e,t,r,i){return function(o){var a=this[e];n(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});var s=this._collectionIndicesByEntity[o.id];if(n(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),n(a)&&n(s[i]))return a.get(s[i]);n(a)||(a=this[e]=new t({scene:this._scene}));var l,u,c=this[r];return c.length>0?(l=c.pop(),u=a.get(l)):(u=a.add(),l=a.length-1),s[i]=l,this._clusterDirty=!0,u}}function A(e,t){var r=e._collectionIndicesByEntity[t];n(r.billboardIndex)||n(r.labelIndex)||n(r.pointIndex)||delete e._collectionIndicesByEntity[t]}function D(e){if(n(e))for(var t=e.length,r=0;r<t;++r)e.get(r).clusterShow=!0}function I(e){e.enabled||(n(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),n(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),n(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,D(e._labelCollection),D(e._billboardCollection),D(e._pointCollection))}var M=new e,O=new e,R=new e,N=new e;return v.prototype._initialize=function(e){this._scene=e;var t=x(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)},o(v.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}}}),v.prototype.getLabel=P("_labelCollection",h,"_unusedLabelIndices","labelIndex"),v.prototype.removeLabel=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._labelCollection)&&n(t)&&n(t.labelIndex)){var r=t.labelIndex;t.labelIndex=void 0,A(this,e.id);var i=this._labelCollection.get(r);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(r),this._clusterDirty=!0}},v.prototype.getBillboard=P("_billboardCollection",c,"_unusedBillboardIndices","billboardIndex"),v.prototype.removeBillboard=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._billboardCollection)&&n(t)&&n(t.billboardIndex)){var r=t.billboardIndex;t.billboardIndex=void 0,A(this,e.id);var i=this._billboardCollection.get(r);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(r),this._clusterDirty=!0}},v.prototype.getPoint=P("_pointCollection",f,"_unusedPointIndices","pointIndex"),v.prototype.removePoint=function(e){var t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(n(this._pointCollection)&&n(t)&&n(t.pointIndex)){var r=t.pointIndex;t.pointIndex=void 0,A(this,e.id);var i=this._pointCollection.get(r);i.show=!1,i.id=void 0,this._unusedPointIndices.push(r),this._clusterDirty=!0}},v.prototype.update=function(e){var t;n(this._labelCollection)&&this._labelCollection.length>0&&0===this._labelCollection.get(0)._glyphs.length&&(t=e.commandList,e.commandList=[],this._labelCollection.update(e),e.commandList=t),n(this._billboardCollection)&&this._billboardCollection.length>0&&!n(this._billboardCollection.get(0).width)&&(t=e.commandList,e.commandList=[],this._billboardCollection.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,I(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),n(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),n(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),n(this._clusterPointCollection)&&this._clusterPointCollection.update(e),n(this._labelCollection)&&this._labelCollection.update(e),n(this._billboardCollection)&&this._billboardCollection.update(e),n(this._pointCollection)&&this._pointCollection.update(e)},v.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),n(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 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=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1},v}),define("DataSources/CustomDataSource",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","./DataSource","./EntityCluster","./EntityCollection"],function(e,t,r,i,n,o,a){"use strict";function s(e){this._name=e,this._clock=void 0,this._changed=new i,this._error=new i,this._isLoading=!1,this._loading=new i,this._entityCollection=new a(this),this._entityCluster=new o}return t(s.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},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){n.setLoading(this,e)}},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}}}),s}),define("DataSources/CylinderGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/CylinderGeometry","../Core/CylinderOutlineGeometry","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S){"use strict";function E(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}function T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new E(e),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var P=new y(e.WHITE),A=new b(!0),D=new b(!0),I=new b(!1),M=new b(e.BLACK),O=new b(_.DISABLED),R=new b(new u),N=new e;return a(T,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:m}}),a(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!o(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!o(this._entity.availability)&&S.isConstant(this._showProperty)&&S.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(i){var n,a,s=this._entity,l=s.isAvailable(i),u=new f(l&&s.isShowing&&this._showProperty.getValue(i)&&this._fillProperty.getValue(i)),d=this._distanceDisplayConditionProperty.getValue(i),m=c.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var g=e.WHITE;o(this._materialProperty.color)&&(this._materialProperty.color.isConstant||l)&&(g=this._materialProperty.color.getValue(i)),a=t.fromColor(g),n={show:u,distanceDisplayCondition:m,color:a}}else n={show:u,distanceDisplayCondition:m};return new h({id:s,geometry:new r(this._options),modelMatrix:s._getModelMatrix(p.MINIMUM_VALUE),attributes:n})},T.prototype.createOutlineGeometryInstance=function(r){var n=this._entity,o=n.isAvailable(r),a=S.getValueOrDefault(this._outlineColorProperty,r,e.BLACK),s=this._distanceDisplayConditionProperty.getValue(r);return new h({id:n,geometry:new i(this._options),modelMatrix:n._getModelMatrix(p.MINIMUM_VALUE),attributes:{show:new f(o&&n.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(a),distanceDisplayCondition:c.fromDistanceDisplayCondition(s)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),s(this)},T.prototype._onEntityPropertyChanged=function(e,t,r,i){if("availability"===t||"position"===t||"orientation"===t||"cylinder"===t){var a=e.cylinder;if(!o(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!o(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=o(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=e.position,h=a.length,f=a.topRadius,v=a.bottomRadius,_=a.show;if(o(_)&&_.isConstant&&!_.getValue(p.MINIMUM_VALUE)||!o(d)||!o(h)||!o(f)||!o(v))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var b=n(a.material,P),C=b instanceof y;this._materialProperty=b,this._fillProperty=n(s,D),this._showProperty=n(_,A),this._showOutlineProperty=n(a.outline,I),this._outlineColorProperty=c?n(a.outlineColor,M):void 0,this._shadowsProperty=n(a.shadows,O),this._distanceDisplayConditionProperty=n(a.distanceDisplayCondition,R);var w=a.slices,E=a.outlineWidth,T=a.numberOfVerticalLines;if(this._fillEnabled=l,this._outlineEnabled=c,d.isConstant&&S.isConstant(e.orientation)&&h.isConstant&&f.isConstant&&v.isConstant&&S.isConstant(w)&&S.isConstant(E)&&S.isConstant(T)){var x=this._options;x.vertexFormat=C?g.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,x.length=h.getValue(p.MINIMUM_VALUE),x.topRadius=f.getValue(p.MINIMUM_VALUE),x.bottomRadius=v.getValue(p.MINIMUM_VALUE),x.slices=o(w)?w.getValue(p.MINIMUM_VALUE):void 0,x.numberOfVerticalLines=o(T)?T.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=o(E)?E.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(n){var a=this._primitives;a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var s=this._geometryUpdater,l=s._entity,u=l.cylinder;if(l.isShowing&&l.isAvailable(n)&&S.getValueOrDefault(u.show,n,!0)){var d=this._options,p=l._getModelMatrix(n),f=S.getValueOrUndefined(u.length,n),_=S.getValueOrUndefined(u.topRadius,n),y=S.getValueOrUndefined(u.bottomRadius,n);if(o(p)&&o(f)&&o(_)&&o(y)){d.length=f,d.topRadius=_,d.bottomRadius=y,d.slices=S.getValueOrUndefined(u.slices,n),d.numberOfVerticalLines=S.getValueOrUndefined(u.numberOfVerticalLines,n);var b=this._geometryUpdater.shadowsProperty.getValue(n),C=this._geometryUpdater.distanceDisplayConditionProperty,E=C.getValue(n),T=c.fromDistanceDisplayCondition(E);if(S.getValueOrDefault(u.fill,n,!0)){var x=w.getValue(n,s.fillMaterialProperty,this._material);this._material=x;var P=new m({material:x,translucent:x.isTranslucent(),closed:!0});d.vertexFormat=P.vertexFormat,this._primitive=a.add(new v({geometryInstances:new h({id:l,geometry:new r(d),modelMatrix:p,attributes:{distanceDisplayCondition:T}}),appearance:P,asynchronous:!1,shadows:b}))}if(S.getValueOrDefault(u.outline,n,!1)){d.vertexFormat=g.VERTEX_FORMAT;var A=S.getValueOrClonedDefault(u.outlineColor,n,e.BLACK,N),D=S.getValueOrDefault(u.outlineWidth,n,1),I=1!==A.alpha;this._outlinePrimitive=a.add(new v({geometryInstances:new h({id:l,geometry:new i(d),modelMatrix:p,attributes:{color:t.fromColor(A),distanceDisplayCondition:T}}),appearance:new g({flat:!0,translucent:I,renderState:{lineWidth:s._scene.clampLineWidth(D)}}),asynchronous:!1,shadows:b}))}}}},x.prototype.getBoundingSphere=function(e,t){return C(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),s(this)},T}),define("Scene/ColorBlendMode",["../Core/freezeObject","../Core/Math"],function(e,t){"use strict";var r={HIGHLIGHT:0,REPLACE:1,MIX:2};return r.getColorBlend=function(e,i){return e===r.HIGHLIGHT?0:e===r.REPLACE?1:e===r.MIX?t.clamp(i,t.EPSILON4,1):void 0},e(r)}),define("DataSources/DataSourceClock",["../Core/Clock","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./createRawPropertyDescriptor"],function(e,t,r,i,n,o,a,s){"use strict";function l(){this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0,this._definitionChanged=new o}return i(l.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:s("startTime"),stopTime:s("stopTime"),currentTime:s("currentTime"),clockRange:s("clockRange"),clockStep:s("clockStep"),multiplier:s("multiplier")}),l.prototype.clone=function(e){return r(e)||(e=new l),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},l.prototype.equals=function(e){return this===e||r(e)&&a.equals(this.startTime,e.startTime)&&a.equals(this.stopTime,e.stopTime)&&a.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier},l.prototype.merge=function(e){this.startTime=t(this.startTime,e.startTime),this.stopTime=t(this.stopTime,e.stopTime),this.currentTime=t(this.currentTime,e.currentTime),this.clockRange=t(this.clockRange,e.clockRange),this.clockStep=t(this.clockStep,e.clockStep),this.multiplier=t(this.multiplier,e.multiplier)},l.prototype.getValue=function(i){return r(i)||(i=new e),i.startTime=t(this.startTime,i.startTime),i.stopTime=t(this.stopTime,i.stopTime),i.currentTime=t(this.currentTime,i.currentTime),i.clockRange=t(this.clockRange,i.clockRange),i.multiplier=t(this.multiplier,i.multiplier),i.clockStep=t(this.clockStep,i.clockStep),i},l}),define("DataSources/GridMaterialProperty",["../Core/Cartesian2","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=r(e,r.EMPTY_OBJECT),this._definitionChanged=new o,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}var u=t.WHITE,c=.1,d=new e(8,8),h=new e(0,0),p=new e(1,1);return n(l.prototype,{isConstant:{get:function(){return s.isConstant(this._color)&&s.isConstant(this._cellAlpha)&&s.isConstant(this._lineCount)&&s.isConstant(this._lineThickness)&&s.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color"),cellAlpha:a("cellAlpha"),lineCount:a("lineCount"),lineThickness:a("lineThickness"),lineOffset:a("lineOffset")}),l.prototype.getType=function(e){return"Grid"},l.prototype.getValue=function(e,t){return i(t)||(t={}),t.color=s.getValueOrClonedDefault(this._color,e,u,t.color),t.cellAlpha=s.getValueOrDefault(this._cellAlpha,e,c),t.lineCount=s.getValueOrClonedDefault(this._lineCount,e,d,t.lineCount),t.lineThickness=s.getValueOrClonedDefault(this._lineThickness,e,p,t.lineThickness),t.lineOffset=s.getValueOrClonedDefault(this._lineOffset,e,h,t.lineOffset),t},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._color,e._color)&&s.equals(this._cellAlpha,e._cellAlpha)&&s.equals(this._lineCount,e._lineCount)&&s.equals(this._lineThickness,e._lineThickness)&&s.equals(this._lineOffset,e._lineOffset)},l}),define("DataSources/PolylineArrowMaterialProperty",["../Core/Color","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o){"use strict";function a(e){this._definitionChanged=new i,this._color=void 0,this._colorSubscription=void 0,this.color=e}return r(a.prototype,{isConstant:{get:function(){return o.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:n("color")}),a.prototype.getType=function(e){return"PolylineArrow"},a.prototype.getValue=function(r,i){return t(i)||(i={}),i.color=o.getValueOrClonedDefault(this._color,r,e.WHITE,i.color),i},a.prototype.equals=function(e){return this===e||e instanceof a&&o.equals(this._color,e._color)},a}),define("DataSources/PolylineDashMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,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}var l=e.WHITE,u=e.TRANSPARENT,c=16,d=255;return i(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._gapColor)&&a.isConstant(this._dashLength)&&a.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),gapColor:o("gapColor"),dashLength:o("dashLength"),dashPattern:o("dashPattern")}),s.prototype.getType=function(e){return"PolylineDash"},s.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.gapColor=a.getValueOrClonedDefault(this._gapColor,e,u,t.gapColor),t.dashLength=a.getValueOrDefault(this._dashLength,e,c,t.dashLength),t.dashPattern=a.getValueOrDefault(this._dashPattern,e,d,t.dashPattern),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._gapColor,e._gapColor)&&a.equals(this._dashLength,e._dashLength)&&a.equals(this._dashPattern,e._dashPattern)},s}),define("DataSources/PolylineGlowMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower}var l=e.WHITE,u=.25;return i(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),glowPower:o("glowPower")}),s.prototype.getType=function(e){return"PolylineGlow"},s.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.glowPower=a.getValueOrDefault(this._glowPower,e,u,t.glowPower),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._glowPower,e._glowPower)},s}),define("DataSources/PolylineOutlineMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,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}var l=e.WHITE,u=e.BLACK,c=1;return i(s.prototype,{isConstant:{get:function(){return a.isConstant(this._color)&&a.isConstant(this._outlineColor)&&a.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color"),outlineColor:o("outlineColor"),outlineWidth:o("outlineWidth")}),s.prototype.getType=function(e){return"PolylineOutline"},s.prototype.getValue=function(e,t){return r(t)||(t={}),t.color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.outlineColor=a.getValueOrClonedDefault(this._outlineColor,e,u,t.outlineColor),t.outlineWidth=a.getValueOrDefault(this._outlineWidth,e,c),t},s.prototype.equals=function(e){return this===e||e instanceof s&&a.equals(this._color,e._color)&&a.equals(this._outlineColor,e._outlineColor)&&a.equals(this._outlineWidth,e._outlineWidth)},s}),define("DataSources/PositionPropertyArray",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","../Core/ReferenceFrame","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(t,r){this._value=void 0,this._definitionChanged=new n,this._eventHelper=new o,this._referenceFrame=e(r,a.FIXED),this.setValue(t)}return r(l.prototype,{isConstant:{get:function(){var e=this._value;if(!t(e))return!0;for(var r=e.length,i=0;i<r;i++)if(!s.isConstant(e[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),l.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},l.prototype.getValueInReferenceFrame=function(e,r,i){var n=this._value;if(t(n)){var o=n.length;t(i)||(i=new Array(o));for(var a=0,s=0;a<o;){var l=n[a],u=l.getValueInReferenceFrame(e,r,i[a]);t(u)&&(i[s]=u,s++),a++}return i.length=s,i}},l.prototype.setValue=function(e){var r=this._eventHelper;if(r.removeAll(),t(e)){this._value=e.slice();for(var i=e.length,n=0;n<i;n++){var o=e[n];t(o)&&r.add(o.definitionChanged,l.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},l.prototype.equals=function(e){return this===e||e instanceof l&&this._referenceFrame===e._referenceFrame&&s.arrayEquals(this._value,e._value)},l.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},l}),define("DataSources/PropertyArray",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/EventHelper","./Property"],function(e,t,r,i,n,o){"use strict";function a(e){this._value=void 0,this._definitionChanged=new i,this._eventHelper=new n,this.setValue(e)}return t(a.prototype,{isConstant:{get:function(){var t=this._value;if(!e(t))return!0;for(var r=t.length,i=0;i<r;i++)if(!o.isConstant(t[i]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getValue=function(t,r){var i=this._value;if(e(i)){var n=i.length;e(r)||(r=new Array(n));for(var o=0,a=0;o<n;){var s=this._value[o],l=s.getValue(t,r[o]);e(l)&&(r[a]=l,a++),o++}return r.length=a,r}},a.prototype.setValue=function(t){var r=this._eventHelper;if(r.removeAll(),e(t)){this._value=t.slice();for(var i=t.length,n=0;n<i;n++){var o=t[n];e(o)&&r.add(o.definitionChanged,a.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)},a.prototype.equals=function(e){return this===e||e instanceof a&&o.arrayEquals(this._value,e._value)},a.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},a}),define("DataSources/ReferenceProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/RuntimeError","./Property"],function(e,t,r,i,n,o){"use strict";function a(t){var r=!0;if(t._resolveEntity){var i=t._targetCollection.getById(t._targetId);if(e(i)?(i.definitionChanged.addEventListener(l.prototype._onTargetEntityDefinitionChanged,t),t._targetEntity=i,t._resolveEntity=!1):(i=t._targetEntity,r=!1),!e(i))throw new n('target entity "'+t._targetId+'" could not be resolved.')}return r}function s(t){var r=t._targetProperty;if(t._resolveProperty){var i=a(t),o=t._targetPropertyNames;r=t._targetEntity;for(var s=o.length,l=0;l<s&&e(r);l++)r=r[o[l]];if(e(r))t._targetProperty=r,t._resolveProperty=!i;else if(!e(t._targetProperty))throw new n('targetProperty "'+t._targetId+"."+o.join(".")+'" could not be resolved.')}return r}function l(e,t,r){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=r,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new i,this._resolveEntity=!0,this._resolveProperty=!0,e.collectionChanged.addEventListener(l.prototype._onCollectionChanged,this)}return t(l.prototype,{isConstant:{get:function(){return o.isConstant(s(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return s(this).referenceFrame}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return s(this)}}}),l.fromString=function(e,t){for(var r,i=[],n=!0,o=!1,a="",s=0;s<t.length;++s){var u=t.charAt(s);o?(a+=u,o=!1):"\\"===u?o=!0:n&&"#"===u?(r=a,n=!1,a=""):n||"."!==u?a+=u:(i.push(a),a="")}return i.push(a),new l(e,r,i)},l.prototype.getValue=function(e,t){return s(this).getValue(e,t)},l.prototype.getValueInReferenceFrame=function(e,t,r){return s(this).getValueInReferenceFrame(e,t,r)},l.prototype.getType=function(e){return s(this).getType(e)},l.prototype.equals=function(e){if(this===e)return!0;var t=this._targetPropertyNames,r=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==r.length)return!1;for(var i=this._targetPropertyNames.length,n=0;n<i;n++)if(t[n]!==r[n])return!1;return!0},l.prototype._onTargetEntityDefinitionChanged=function(e,t,r,i){ +this._targetPropertyNames[0]===t&&(this._resolveProperty=!0,this._definitionChanged.raiseEvent(this))},l.prototype._onCollectionChanged=function(t,r,i){var n=this._targetEntity;e(n)&&(i.indexOf(n)!==-1?(n.definitionChanged.removeEventListener(l.prototype._onTargetEntityDefinitionChanged,this),this._resolveEntity=!0,this._resolveProperty=!0):this._resolveEntity&&(s(this),this._resolveEntity||this._definitionChanged.raiseEvent(this)))},l}),define("DataSources/Rotation",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/Math"],function(e,t,r,i){"use strict";var n={packedLength:1,pack:function(t,r,i){return i=e(i,0),r[i]=t,r},unpack:function(t,r,i){return r=e(r,0),t[r]},convertPackedArrayForInterpolation:function(t,r,n,o){r=e(r,0),n=e(n,t.length);for(var a,s=0,l=n-r+1;s<l;s++){var u=t[r+s];0===s||Math.abs(a-u)<Math.PI?o[s]=u:o[s]=u-i.TWO_PI,a=u}},unpackInterpolationResult:function(e,t,r,n,o){return o=e[0],o<0?o+i.TWO_PI:o}};return n}),define("DataSources/SampledProperty",["../Core/binarySearch","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ExtrapolationType","../Core/JulianDate","../Core/LinearApproximation"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(e,t,r){var i,n=e.length,o=r.length,a=n+o;if(e.length=a,n!==t){var s=n-1;for(i=a-1;i>=t;i--)e[i]=e[s--]}for(i=0;i<o;i++)e[t++]=r[i]}function c(e,t){return e instanceof s?e:"string"==typeof e?s.fromIso8601(e):s.addSeconds(t,e,new s)}function d(t,i,n,o,a){for(var l,d,h,p,g,v,_=0;_<o.length;){g=c(o[_],t),h=e(i,g,s.compare);var y=0,b=0;if(h<0){for(h=~h,p=h*a,d=void 0,v=i[h];_<o.length&&(g=c(o[_],t),!(r(d)&&s.compare(d,g)>=0||r(v)&&s.compare(g,v)>=0));){for(f[y++]=g,_+=1,l=0;l<a;l++)m[b++]=o[_],_+=1;d=g}y>0&&(m.length=b,u(n,p,m),f.length=y,u(i,h,f))}else{for(l=0;l<a;l++)_++,n[h*a+l]=o[_];_++}}}function h(e,i){var n=e;n===Number&&(n=p);var s,u=n.packedLength,c=t(n.packedInterpolationLength,u),d=0;if(r(i)){var h=i.length;s=new Array(h);for(var f=0;f<h;f++){var m=i[f];m===Number&&(m=p);var g=m.packedLength;u+=g,c+=t(m.packedInterpolationLength,g),s[f]=m}d=h}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=l,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=u,this._packedInterpolationLength=c,this._updateTableLength=!0,this._interpolationResult=new Array(c),this._definitionChanged=new o,this._derivativeTypes=i,this._innerDerivativeTypes=s,this._inputOrder=d,this._forwardExtrapolationType=a.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=a.NONE,this._backwardExtrapolationDuration=0}var p={packedLength:1,pack:function(e,r,i){i=t(i,0),r[i]=e},unpack:function(e,r,i){return r=t(r,0),e[r]}},f=[],m=[];return i(h.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))}}}),h.prototype.getValue=function(t,i){var n=this._times,o=n.length;if(0!==o){var l,u=this._innerType,c=this._values,d=e(n,t,s.compare);if(d<0){if(d=~d,0===d){var h=n[d];if(l=this._backwardExtrapolationDuration,this._backwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(h,t)>l)return;if(this._backwardExtrapolationType===a.HOLD)return u.unpack(c,0,i)}if(d>=o){d=o-1;var p=n[d];if(l=this._forwardExtrapolationDuration,this._forwardExtrapolationType===a.NONE||0!==l&&s.secondsDifference(t,p)>l)return;if(this._forwardExtrapolationType===a.HOLD)return d=o-1,u.unpack(c,d*u.packedLength,i)}var f=this._xTable,m=this._yTable,g=this._interpolationAlgorithm,v=this._packedInterpolationLength,_=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;var y=Math.min(g.getRequiredDataPoints(this._interpolationDegree,_),o);y!==this._numberOfPoints&&(this._numberOfPoints=y,f.length=y,m.length=y*v)}var b=this._numberOfPoints-1;if(b<1)return;var C=0,w=o-1,S=w-C+1;if(S>=b+1){var E=d-(b/2|0)-1;E<C&&(E=C);var T=E+b;T>w&&(T=w,E=T-b,E<C&&(E=C)),C=E,w=T}for(var x=w-C+1,P=0;P<x;++P)f[P]=s.secondsDifference(n[C+P],n[w]);if(r(u.convertPackedArrayForInterpolation))u.convertPackedArrayForInterpolation(c,C,w,m);else for(var A=0,D=this._packedLength,I=C*D,M=(w+1)*D;I<M;)m[A]=c[I],I++,A++;var O,R=s.secondsDifference(t,n[w]);if(0!==_&&r(g.interpolate)){var N=Math.floor(v/(_+1));O=g.interpolate(R,f,m,N,_,_,this._interpolationResult)}else O=g.interpolateOrderZero(R,f,m,v,this._interpolationResult);return r(u.unpackInterpolationResult)?u.unpackInterpolationResult(O,c,C,w,i):u.unpack(O,0,i)}return u.unpack(c,d*this._packedLength,i)}},h.prototype.setInterpolationOptions=function(e){if(r(e)){var t=!1,i=e.interpolationAlgorithm,n=e.interpolationDegree;r(i)&&this._interpolationAlgorithm!==i&&(this._interpolationAlgorithm=i,t=!0),r(n)&&this._interpolationDegree!==n&&(this._interpolationDegree=n,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))}},h.prototype.addSample=function(e,t,i){var n=this._innerDerivativeTypes,o=r(n),a=this._innerType,s=[];if(s.push(e),a.pack(t,s,s.length),o)for(var l=n.length,u=0;u<l;u++)n[u].pack(i[u],s,s.length);d(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},h.prototype.addSamples=function(e,t,i){for(var n=this._innerDerivativeTypes,o=r(n),a=this._innerType,s=e.length,l=[],u=0;u<s;u++)if(l.push(e[u]),a.pack(t[u],l,l.length),o)for(var c=i[u],h=n.length,p=0;p<h;p++)n[p].pack(c[p],l,l.length);d(void 0,this._times,this._values,l,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},h.prototype.addSamplesPackedArray=function(e,t){d(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)},h.prototype.equals=function(e){if(this===e)return!0;if(!r(e))return!1;if(this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;var t=this._derivativeTypes,i=r(t),n=e._derivativeTypes,o=r(n);if(i!==o)return!1;var a,l;if(i){if(l=t.length,l!==n.length)return!1;for(a=0;a<l;a++)if(t[a]!==n[a])return!1}var u=this._times,c=e._times;if(l=u.length,l!==c.length)return!1;for(a=0;a<l;a++)if(!s.equals(u[a],c[a]))return!1;var d=this._values,h=e._values;for(a=0;a<l;a++)if(d[a]!==h[a])return!1;return!0},h._mergeNewSamples=d,h}),define("DataSources/SampledPositionProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","./PositionProperty","./Property","./SampledProperty"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(r,i){i=t(i,0);var n;if(i>0){n=new Array(i);for(var s=0;s<i;s++)n[s]=e}this._numberOfDerivatives=i,this._property=new u(e,n),this._definitionChanged=new o,this._referenceFrame=t(r,a.FIXED),this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}return i(c.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}}}),c.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,a.FIXED,t)},c.prototype.getValueInReferenceFrame=function(e,t,i){if(i=this._property.getValue(e,i),r(i))return s.convertToReferenceFrame(e,i,this._referenceFrame,t,i)},c.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)},c.prototype.addSample=function(e,t,r){this._numberOfDerivatives;this._property.addSample(e,t,r)},c.prototype.addSamples=function(e,t,r){this._property.addSamples(e,t,r)},c.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)},c.prototype.equals=function(e){return this===e||e instanceof c&&l.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame},c}),define("DataSources/StripeOrientation",["../Core/freezeObject"],function(e){"use strict";var t={HORIZONTAL:0,VERTICAL:1};return e(t)}),define("DataSources/StripeMaterialProperty",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","./createPropertyDescriptor","./Property","./StripeOrientation"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,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}var u=s.HORIZONTAL,c=e.WHITE,d=e.BLACK,h=0,p=1;return i(l.prototype,{isConstant:{get:function(){return a.isConstant(this._orientation)&&a.isConstant(this._evenColor)&&a.isConstant(this._oddColor)&&a.isConstant(this._offset)&&a.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:o("orientation"),evenColor:o("evenColor"),oddColor:o("oddColor"),offset:o("offset"),repeat:o("repeat")}),l.prototype.getType=function(e){return"Stripe"},l.prototype.getValue=function(e,t){return r(t)||(t={}),t.horizontal=a.getValueOrDefault(this._orientation,e,u)===s.HORIZONTAL,t.evenColor=a.getValueOrClonedDefault(this._evenColor,e,c,t.evenColor),t.oddColor=a.getValueOrClonedDefault(this._oddColor,e,d,t.oddColor),t.offset=a.getValueOrDefault(this._offset,e,h),t.repeat=a.getValueOrDefault(this._repeat,e,p),t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._orientation,e._orientation)&&a.equals(this._evenColor,e._evenColor)&&a.equals(this._oddColor,e._oddColor)&&a.equals(this._offset,e._offset)&&a.equals(this._repeat,e._repeat)},l}),define("DataSources/TimeIntervalCollectionPositionProperty",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/ReferenceFrame","../Core/TimeIntervalCollection","./PositionProperty","./Property"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t){this._definitionChanged=new n,this._intervals=new a,this._intervals.changedEvent.addEventListener(u.prototype._intervalsChanged,this),this._referenceFrame=e(t,o.FIXED)}return r(u.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}}}),u.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},u.prototype.getValueInReferenceFrame=function(e,r,i){var n=this._intervals.findDataForIntervalContainingDate(e);if(t(n))return s.convertToReferenceFrame(e,n,this._referenceFrame,r,i)},u.prototype.equals=function(e){return this===e||e instanceof u&&this._intervals.equals(e._intervals,l.equals)&&this._referenceFrame===e._referenceFrame},u.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},u}),define("DataSources/TimeIntervalCollectionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/TimeIntervalCollection","./Property"],function(e,t,r,i,n,o){"use strict";function a(){this._definitionChanged=new i,this._intervals=new n,this._intervals.changedEvent.addEventListener(a.prototype._intervalsChanged,this)}return t(a.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}}),a.prototype.getValue=function(t,r){var i=this._intervals.findDataForIntervalContainingDate(t);return e(i)&&"function"==typeof i.clone?i.clone(r):i},a.prototype.equals=function(e){return this===e||e instanceof a&&this._intervals.equals(e._intervals,o.equals)},a.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)},a}),define("DataSources/VelocityVectorProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","./Property"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,r){this._position=void 0,this._subscription=void 0,this._definitionChanged=new o,this._normalize=t(r,!0),this.position=e}i(l.prototype,{isConstant:{get:function(){return s.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){var t=this._position;t!==e&&(r(t)&&this._subscription(),this._position=e,r(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 u=new e,c=new e,d=new a,h=1/60;return l.prototype.getValue=function(e,t){return this._getValue(e,t)},l.prototype._getValue=function(t,i,n){r(i)||(i=new e);var o=this._position;if(s.isConstant(o))return this._normalize?void 0:e.clone(e.ZERO,i);var l=o.getValue(t,u),p=o.getValue(a.addSeconds(t,h,d),c);if(r(l)&&(r(p)||(p=l,l=o.getValue(a.addSeconds(t,-h,d),c),r(l)))){if(e.equals(l,p))return this._normalize?void 0:e.clone(e.ZERO,i);r(n)&&l.clone(n);var f=e.subtract(p,l,i);return this._normalize?e.normalize(f,i):e.divideByScalar(f,h,i)}},l.prototype.equals=function(e){return this===e||e instanceof l&&s.equals(this._position,e._position)},l}),define("DataSources/CzmlDataSource",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/CornerType","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ExtrapolationType","../Core/getAbsoluteUri","../Core/getFilenameFromUri","../Core/HermitePolynomialApproximation","../Core/isArray","../Core/Iso8601","../Core/JulianDate","../Core/LagrangePolynomialApproximation","../Core/LinearApproximation","../Core/loadJson","../Core/Math","../Core/NearFarScalar","../Core/Quaternion","../Core/Rectangle","../Core/ReferenceFrame","../Core/RuntimeError","../Core/Spherical","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/ColorBlendMode","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/ShadowMode","../Scene/VerticalOrigin","../ThirdParty/Uri","../ThirdParty/when","./BillboardGraphics","./BoxGraphics","./ColorMaterialProperty","./CompositeMaterialProperty","./CompositePositionProperty","./CompositeProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./CylinderGraphics","./DataSource","./DataSourceClock","./EllipseGraphics","./EllipsoidGraphics","./EntityCluster","./EntityCollection","./GridMaterialProperty","./ImageMaterialProperty","./LabelGraphics","./ModelGraphics","./NodeTransformationProperty","./PathGraphics","./PointGraphics","./PolygonGraphics","./PolylineArrowMaterialProperty","./PolylineDashMaterialProperty","./PolylineGlowMaterialProperty","./PolylineGraphics","./PolylineOutlineMaterialProperty","./PositionPropertyArray","./PropertyArray","./PropertyBag","./RectangleGraphics","./ReferenceProperty","./Rotation","./SampledPositionProperty","./SampledProperty","./StripeMaterialProperty","./StripeOrientation","./TimeIntervalCollectionPositionProperty","./TimeIntervalCollectionProperty","./VelocityVectorProperty","./WallGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R,N,k,L,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,ge,ve,_e,ye,be,Ce,we,Se,Ee,Te,xe,Pe,Ae,De,Ie){"use strict";function Me(e,t){return"#"===t[0]&&(t=Mt+t),Ce.fromString(e,t)}function Oe(e){var t=e.rgbaf;if(c(t))return t;var r=e.rgba;if(c(r)){var i=r.length;if(i===a.packedLength)return[a.byteToFloat(r[0]),a.byteToFloat(r[1]),a.byteToFloat(r[2]),a.byteToFloat(r[3])];t=new Array(i);for(var n=0;n<i;n+=5)t[n]=r[n],t[n+1]=a.byteToFloat(r[n+1]),t[n+2]=a.byteToFloat(r[n+2]),t[n+3]=a.byteToFloat(r[n+3]),t[n+4]=a.byteToFloat(r[n+4]);return t}}function Re(e,t){var r=u(e.uri,e);return c(t)&&(r=g(r,g(t))),r}function Ne(e){var t=e.wsen;if(c(t))return t;var r=e.wsenDegrees;if(c(r)){var i=r.length;if(i===A.packedLength)return[T.toRadians(r[0]),T.toRadians(r[1]),T.toRadians(r[2]),T.toRadians(r[3])];t=new Array(i);for(var n=0;n<i;n+=5)t[n]=r[n],t[n+1]=T.toRadians(r[n+1]),t[n+2]=T.toRadians(r[n+2]),t[n+3]=T.toRadians(r[n+3]),t[n+4]=T.toRadians(r[n+4]);return t}}function ke(e){var t=e.length;if(Rt.magnitude=1,2===t)return Rt.clock=e[0],Rt.cone=e[1],r.fromSpherical(Rt,Ot),[Ot.x,Ot.y,Ot.z];for(var i=new Array(t/3*4),n=0,o=0;n<t;n+=3,o+=4)i[o]=e[n],Rt.clock=e[n+1],Rt.cone=e[n+2],r.fromSpherical(Rt,Ot),i[o+1]=Ot.x,i[o+2]=Ot.y,i[o+3]=Ot.z;return i}function Le(e){var t=e.length;if(3===t)return Rt.clock=e[0],Rt.cone=e[1],Rt.magnitude=e[2],r.fromSpherical(Rt,Ot),[Ot.x,Ot.y,Ot.z];for(var i=new Array(t),n=0;n<t;n+=4)i[n]=e[n],Rt.clock=e[n+1],Rt.cone=e[n+2],Rt.magnitude=e[n+3],r.fromSpherical(Rt,Ot),i[n+1]=Ot.x,i[n+2]=Ot.y,i[n+3]=Ot.z;return i}function Fe(e){var t=e.length;if(3===t)return Nt.longitude=e[0],Nt.latitude=e[1],Nt.height=e[2],p.WGS84.cartographicToCartesian(Nt,Ot),[Ot.x,Ot.y,Ot.z];for(var r=new Array(t),i=0;i<t;i+=4)r[i]=e[i],Nt.longitude=e[i+1],Nt.latitude=e[i+2],Nt.height=e[i+3],p.WGS84.cartographicToCartesian(Nt,Ot),r[i+1]=Ot.x,r[i+2]=Ot.y,r[i+3]=Ot.z;return r}function Be(e){var t=e.length;if(3===t)return Nt.longitude=T.toRadians(e[0]),Nt.latitude=T.toRadians(e[1]),Nt.height=e[2],p.WGS84.cartographicToCartesian(Nt,Ot),[Ot.x,Ot.y,Ot.z];for(var r=new Array(t),i=0;i<t;i+=4)r[i]=e[i],Nt.longitude=T.toRadians(e[i+1]),Nt.latitude=T.toRadians(e[i+2]),Nt.height=e[i+3],p.WGS84.cartographicToCartesian(Nt,Ot),r[i+1]=Ot.x,r[i+2]=Ot.y,r[i+3]=Ot.z;return r}function Ue(e){var t=e.cartesian;if(c(t))return t;var r=e.cartesianVelocity;if(c(r))return r;var i=e.unitCartesian;if(c(i))return i;var n=e.unitSpherical;if(c(n))return ke(n);var o=e.spherical;if(c(o))return Le(o);var a=e.cartographicRadians;if(c(a))return Fe(a);var s=e.cartographicDegrees;if(c(s))return Be(s);throw new I(JSON.stringify(e)+" is not a valid CZML interval.")}function Ve(e,t){var r=e[t],i=e[t+1],n=e[t+2],o=e[t+3],a=1/Math.sqrt(r*r+i*i+n*n+o*o);e[t]=r*a,e[t+1]=i*a,e[t+2]=n*a,e[t+3]=o*a}function ze(e){var t=e.unitQuaternion;if(c(t)){if(4===t.length)return Ve(t,0),t;for(var r=1;r<t.length;r+=5)Ve(t,r)}return t}function Ge(i){return"boolean"==typeof i?Boolean:"number"==typeof i?Number:"string"==typeof i?String:i.hasOwnProperty("array")?Array:i.hasOwnProperty("boolean")?Boolean:i.hasOwnProperty("boundingRectangle")?e:i.hasOwnProperty("cartesian2")?t:i.hasOwnProperty("cartesian")||i.hasOwnProperty("unitCartesian")||i.hasOwnProperty("unitSpherical")||i.hasOwnProperty("spherical")||i.hasOwnProperty("cartographicRadians")||i.hasOwnProperty("cartographicDegrees")?r:i.hasOwnProperty("rgba")||i.hasOwnProperty("rgbaf")?a:i.hasOwnProperty("colorBlendMode")?N:i.hasOwnProperty("cornerType")?s:i.hasOwnProperty("heightReference")?k:i.hasOwnProperty("horizontalOrigin")?L:i.hasOwnProperty("date")?C:i.hasOwnProperty("labelStyle")?F:i.hasOwnProperty("number")?Number:i.hasOwnProperty("nearFarScalar")?x:i.hasOwnProperty("object")||i.hasOwnProperty("value")?Object:i.hasOwnProperty("unitQuaternion")?P:i.hasOwnProperty("shadowMode")?B:i.hasOwnProperty("string")?String:i.hasOwnProperty("stripeOrientation")?xe:i.hasOwnProperty("wsen")||i.hasOwnProperty("wsenDegrees")?A:i.hasOwnProperty("uri")?V:i.hasOwnProperty("verticalOrigin")?U:Object}function He(i,n,o){switch(i){case Array:return n.array;case Boolean:return u(n.boolean,n);case e:return n.boundingRectangle;case t:return n.cartesian2;case r:return Ue(n);case a:return Oe(n);case N:return N[u(n.colorBlendMode,n)];case s:return s[u(n.cornerType,n)];case k:return k[u(n.heightReference,n)];case L:return L[u(n.horizontalOrigin,n)];case Image:return Re(n,o);case C:return C.fromIso8601(u(n.date,n));case F:return F[u(n.labelStyle,n)];case Number:return u(n.number,n);case x:return n.nearFarScalar;case Object:return u(u(n.object,n.value),n);case P:return ze(n);case we:return u(n.number,n);case B:return B[u(u(n.shadowMode,n.shadows),n)];case String:return u(n.string,n);case xe:return xe[u(n.stripeOrientation,n)];case A:return Ne(n);case V:return Re(n,o);case U:return U[u(n.verticalOrigin,n)];default:throw new I(i)}}function We(e,t){var r=e.interpolationAlgorithm;(c(r)||c(e.interpolationDegree))&&t.setInterpolationOptions({interpolationAlgorithm:Lt[r],interpolationDegree:e.interpolationDegree});var i=e.forwardExtrapolationType;c(i)&&(t.forwardExtrapolationType=m[i]);var n=e.forwardExtrapolationDuration;c(n)&&(t.forwardExtrapolationDuration=n);var o=e.backwardExtrapolationType;c(o)&&(t.backwardExtrapolationType=m[o]);var a=e.backwardExtrapolationDuration;c(a)&&(t.backwardExtrapolationDuration=a)}function je(e,t,r,i,n,o,a){var s,l=i.interval;c(l)?(Ft.iso8601=l,s=O.fromIso8601(Ft),c(n)&&(s=O.intersect(s,n,kt))):c(n)&&(s=n);var d,h,p,f,m=c(i.reference),g=c(s)&&!s.equals(b.MAXIMUM_INTERVAL);m||(p=He(e,i,o),d=u(e.packedLength,1),f=u(p.length,1),h=!c(i.array)&&"string"!=typeof p&&f>d&&e!==Object);var v="function"==typeof e.unpack&&e!==we;if(!h&&!g)return void(m?t[r]=Me(a,i.reference):v?t[r]=new Q(e.unpack(p,0)):t[r]=new Q(p));var _,y=t[r],w=i.epoch;if(c(w)&&(_=C.fromIso8601(w)),h&&!g)return y instanceof Ee||(y=new Ee(e),t[r]=y),y.addSamplesPackedArray(p,_),void We(i,y);var S;if(!h&&g)return s=s.clone(),m?s.data=Me(a,i.reference):v?s.data=e.unpack(p,0):s.data=p,c(y)||(y=m?new Y:new Ae,t[r]=y),void(!m&&y instanceof Ae?y.intervals.addInterval(s):y instanceof Y?(s.data=m?s.data:new Q(s.data),y.intervals.addInterval(s)):(S=b.MAXIMUM_INTERVAL.clone(),S.data=y,y=new Y,t[r]=y,y.intervals.addInterval(S),s.data=m?s.data:new Q(s.data),y.intervals.addInterval(s)));c(y)||(y=new Y,t[r]=y),y instanceof Y||(S=b.MAXIMUM_INTERVAL.clone(),S.data=y,y=new Y,t[r]=y,y.intervals.addInterval(S));var E=y.intervals;S=E.findInterval(s),c(S)&&S.data instanceof Ee||(S=s.clone(),S.data=new Ee(e),E.addInterval(S)),S.data.addSamplesPackedArray(p,_),We(i,S.data)}function qe(e,t,r,i,n,o,a){if(c(i))if(y(i))for(var s=0,l=i.length;s<l;s++)je(e,t,r,i[s],n,o,a);else je(e,t,r,i,n,o,a)}function Ye(e,t,i,n,o,a){var s,l=i.interval;c(l)?(Ft.iso8601=l,s=O.fromIso8601(Ft),c(n)&&(s=O.intersect(s,n,kt))):c(n)&&(s=n);var d,h,p,f=!1,m=c(i.cartesianVelocity)?1:0,g=r.packedLength*(m+1),v=c(i.reference),_=c(s)&&!s.equals(b.MAXIMUM_INTERVAL);if(v||(c(i.referenceFrame)&&(d=D[i.referenceFrame]),d=u(d,D.FIXED),h=Ue(i),p=u(h.length,1),f=p>g),!f&&!_)return void(v?e[t]=Me(a,i.reference):e[t]=new X(r.unpack(h),d));var y,w=e[t],S=i.epoch;if(c(S)&&(y=C.fromIso8601(S)),f&&!_)return w instanceof Se&&(!c(d)||w.referenceFrame===d)||(w=new Se(d,m),e[t]=w),w.addSamplesPackedArray(h,y),void We(i,w);var E;if(!f&&_)return s=s.clone(),v?s.data=Me(a,i.reference):s.data=r.unpack(h),c(w)||(w=v?new q(d):new Pe(d),e[t]=w),void(!v&&w instanceof Pe&&c(d)&&w.referenceFrame===d?w.intervals.addInterval(s):w instanceof q?(s.data=v?s.data:new X(s.data,d),w.intervals.addInterval(s)):(E=b.MAXIMUM_INTERVAL.clone(),E.data=w,w=new q(w.referenceFrame),e[t]=w,w.intervals.addInterval(E),s.data=v?s.data:new X(s.data,d),w.intervals.addInterval(s)));c(w)?w instanceof q||(E=b.MAXIMUM_INTERVAL.clone(),E.data=w,w=new q(w.referenceFrame),e[t]=w,w.intervals.addInterval(E)):(w=new q(d),e[t]=w);var T=w.intervals;E=T.findInterval(s),c(E)&&E.data instanceof Se&&(!c(d)||E.data.referenceFrame===d)||(E=s.clone(),E.data=new Se(d,m),T.addInterval(E)),E.data.addSamplesPackedArray(h,y),We(i,E.data)}function Xe(e,t,r,i,n,o){if(c(r))if(y(r))for(var a=0,s=r.length;a<s;a++)Ye(e,t,r[a],i,n,o);else Ye(e,t,r,i,n,o)}function Qe(e,r,i,n,o,s){var l,u=i.interval;c(u)?(Ft.iso8601=u,l=O.fromIso8601(Ft),c(n)&&(l=O.intersect(l,n,kt))):c(n)&&(l=n);var d,h,p=e[r];if(c(l)){p instanceof j||(p=new j,e[r]=p);var f=p.intervals;h=f.findInterval({start:l.start,stop:l.stop}),c(h)?d=h.data:(h=l.clone(),f.addInterval(h))}else d=p;var m;c(i.solidColor)?(d instanceof W||(d=new W),m=i.solidColor,qe(a,d,"color",m.color,void 0,void 0,s)):c(i.grid)?(d instanceof ne||(d=new ne),m=i.grid,qe(a,d,"color",m.color,void 0,o,s),qe(Number,d,"cellAlpha",m.cellAlpha,void 0,o,s),qe(t,d,"lineCount",m.lineCount,void 0,o,s),qe(t,d,"lineThickness",m.lineThickness,void 0,o,s),qe(t,d,"lineOffset",m.lineOffset,void 0,o,s)):c(i.image)?(d instanceof oe||(d=new oe),m=i.image,qe(Image,d,"image",m.image,void 0,o,s),qe(t,d,"repeat",m.repeat,void 0,o,s),qe(a,d,"color",m.color,void 0,o,s),qe(Boolean,d,"transparent",m.transparent,void 0,o,s)):c(i.stripe)?(d instanceof Te||(d=new Te),m=i.stripe,qe(xe,d,"orientation",m.orientation,void 0,o,s),qe(a,d,"evenColor",m.evenColor,void 0,o,s),qe(a,d,"oddColor",m.oddColor,void 0,o,s),qe(Number,d,"offset",m.offset,void 0,o,s),qe(Number,d,"repeat",m.repeat,void 0,o,s)):c(i.polylineOutline)?(d instanceof ge||(d=new ge),m=i.polylineOutline,qe(a,d,"color",m.color,void 0,o,s),qe(a,d,"outlineColor",m.outlineColor,void 0,o,s),qe(Number,d,"outlineWidth",m.outlineWidth,void 0,o,s)):c(i.polylineGlow)?(d instanceof fe||(d=new fe),m=i.polylineGlow,qe(a,d,"color",m.color,void 0,o,s),qe(Number,d,"glowPower",m.glowPower,void 0,o,s)):c(i.polylineArrow)?(d instanceof he||(d=new he),m=i.polylineArrow,qe(a,d,"color",m.color,void 0,void 0,s)):c(i.polylineDash)&&(d instanceof pe||(d=new pe),m=i.polylineDash,qe(a,d,"color",m.color,void 0,void 0,s),qe(a,d,"gapColor",m.gapColor,void 0,void 0,s),qe(Number,d,"dashLength",m.dashLength,void 0,o,s),qe(Number,d,"dashPattern",m.dashPattern,void 0,o,s)),c(h)?h.data=d:e[r]=d}function Ze(e,t,r,i,n,o){if(c(r))if(y(r))for(var a=0,s=r.length;a<s;a++)Qe(e,t,r[a],i,n,o);else Qe(e,t,r,i,n,o)}function Ke(e,t,r,i){e.name=u(t.name,e.name)}function Je(e,t,r,i){var n=t.description;c(n)&&qe(String,e,"description",n,void 0,i,r)}function $e(e,t,r,i){var n=t.position;c(n)&&Xe(e,"position",n,void 0,i,r)}function et(e,t,i,n){var o=t.viewFrom;c(o)&&qe(r,e,"viewFrom",o,void 0,n,i)}function tt(e,t,r,i){var n=t.orientation;c(n)&&qe(P,e,"orientation",n,void 0,i,r)}function rt(e,t,r,i){var n=t.properties;if(c(n)){c(e.properties)||(e.properties=new ye);for(var o in n)if(n.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);var a=n[o];if(y(a))for(var s=0,l=a.length;s<l;s++)je(Ge(a[s]),e.properties,o,a[s],void 0,i,r);else je(Ge(a),e.properties,o,a,void 0,i,r)}}}function it(e,t,r,i){var n=r.references;if(c(n)){var o=n.map(function(e){return Me(i,e)}),a=r.interval;if(c(a)){if(a=O.fromIso8601(a),!(e[t]instanceof q)){a.data=new _e(o);var s=new Y;s.intervals.addInterval(a),e[t]=s}}else e[t]=new _e(o)}else qe(Array,e,t,r,void 0,void 0,i)}function nt(e,t,r,i){if(c(r))if(y(r))for(var n=0,o=r.length;n<o;++n)it(e,t,r[n],i);else it(e,t,r,i)}function ot(e,t,i,n){if(c(i.references)){var o=i.references.map(function(e){return Me(n,e)}),a=i.interval;if(c(a)){if(a=O.fromIso8601(a),!(e[t]instanceof q)){a.data=new ve(o);var s=new q;s.intervals.addInterval(a),e[t]=s}}else e[t]=new ve(o)}else c(i.cartesian)?i.array=r.unpackArray(i.cartesian):c(i.cartographicRadians)?i.array=r.fromRadiansArrayHeights(i.cartographicRadians):c(i.cartographicDegrees)&&(i.array=r.fromDegreesArrayHeights(i.cartographicDegrees)),c(i.array)&&qe(Array,e,t,i,void 0,void 0,n)}function at(e,t,r,i){if(c(r))if(y(r))for(var n=0,o=r.length;n<o;n++)ot(e,t,r[n],i);else ot(e,t,r,i)}function st(e,t,r,i){var n,o=t.availability;if(c(o)){var a;if(y(o))for(var s=o.length,l=0;l<s;l++)c(a)||(a=new R),Ft.iso8601=o[l],n=O.fromIso8601(Ft),a.addInterval(n);else Ft.iso8601=o,n=O.fromIso8601(Ft),a=new R,a.addInterval(n);e.availability=a}}function lt(e,t,i,n,o){c(t)&&(c(t.velocityReference)?e.alignedAxis=new De(Me(o,t.velocityReference),!0):qe(r,e,"alignedAxis",t,i,n,o))}function ut(i,n,o,s){var l=n.billboard;if(c(l)){var u,d=l.interval;c(d)&&(Ft.iso8601=d,u=O.fromIso8601(Ft));var h=i.billboard;c(h)||(i.billboard=h=new G),qe(Boolean,h,"show",l.show,u,s,o),qe(Image,h,"image",l.image,u,s,o),qe(Number,h,"scale",l.scale,u,s,o),qe(t,h,"pixelOffset",l.pixelOffset,u,s,o),qe(r,h,"eyeOffset",l.eyeOffset,u,s,o),qe(L,h,"horizontalOrigin",l.horizontalOrigin,u,s,o),qe(U,h,"verticalOrigin",l.verticalOrigin,u,s,o),qe(k,h,"heightReference",l.heightReference,u,s,o),qe(a,h,"color",l.color,u,s,o),qe(we,h,"rotation",l.rotation,u,s,o),lt(h,l.alignedAxis,u,s,o),qe(Boolean,h,"sizeInMeters",l.sizeInMeters,u,s,o),qe(Number,h,"width",l.width,u,s,o),qe(Number,h,"height",l.height,u,s,o),qe(x,h,"scaleByDistance",l.scaleByDistance,u,s,o),qe(x,h,"translucencyByDistance",l.translucencyByDistance,u,s,o),qe(x,h,"pixelOffsetScaleByDistance",l.pixelOffsetScaleByDistance,u,s,o),qe(e,h,"imageSubRegion",l.imageSubRegion,u,s,o)}}function ct(e,t,i,n){var o=t.box;if(c(o)){var s,l=o.interval;c(l)&&(Ft.iso8601=l,s=O.fromIso8601(Ft));var u=e.box;c(u)||(e.box=u=new H),qe(Boolean,u,"show",o.show,s,n,i),qe(r,u,"dimensions",o.dimensions,s,n,i),qe(Boolean,u,"fill",o.fill,s,n,i),Ze(u,"material",o.material,s,n,i),qe(Boolean,u,"outline",o.outline,s,n,i),qe(a,u,"outlineColor",o.outlineColor,s,n,i),qe(Number,u,"outlineWidth",o.outlineWidth,s,n,i),qe(B,u,"shadows",o.shadows,s,n,i)}}function dt(e,t,r,i){var n=t.corridor;if(c(n)){var o,l=n.interval;c(l)&&(Ft.iso8601=l,o=O.fromIso8601(Ft));var u=e.corridor;c(u)||(e.corridor=u=new Z),qe(Boolean,u,"show",n.show,o,i,r),at(u,"positions",n.positions,r),qe(Number,u,"width",n.width,o,i,r),qe(Number,u,"height",n.height,o,i,r),qe(Number,u,"extrudedHeight",n.extrudedHeight,o,i,r),qe(s,u,"cornerType",n.cornerType,o,i,r),qe(Number,u,"granularity",n.granularity,o,i,r),qe(Boolean,u,"fill",n.fill,o,i,r),Ze(u,"material",n.material,o,i,r), +qe(Boolean,u,"outline",n.outline,o,i,r),qe(a,u,"outlineColor",n.outlineColor,o,i,r),qe(Number,u,"outlineWidth",n.outlineWidth,o,i,r),qe(B,u,"shadows",n.shadows,o,i,r)}}function ht(e,t,r,i){var n=t.cylinder;if(c(n)){var o,s=n.interval;c(s)&&(Ft.iso8601=s,o=O.fromIso8601(Ft));var l=e.cylinder;c(l)||(e.cylinder=l=new K),qe(Boolean,l,"show",n.show,o,i,r),qe(Number,l,"length",n.length,o,i,r),qe(Number,l,"topRadius",n.topRadius,o,i,r),qe(Number,l,"bottomRadius",n.bottomRadius,o,i,r),qe(Boolean,l,"fill",n.fill,o,i,r),Ze(l,"material",n.material,o,i,r),qe(Boolean,l,"outline",n.outline,o,i,r),qe(a,l,"outlineColor",n.outlineColor,o,i,r),qe(Number,l,"outlineWidth",n.outlineWidth,o,i,r),qe(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,i,r),qe(Number,l,"slices",n.slices,o,i,r),qe(B,l,"shadows",n.shadows,o,i,r)}}function pt(e,t){var r=e.version;if(c(r)&&"string"==typeof r){var i=r.split(".");if(2===i.length){if("1"!==i[0])throw new I("Cesium only supports CZML version 1.");t._version=r}}if(!c(t._version))throw new I("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;c(e.name)&&(n.name=e.name);var o=e.clock;if(c(o)){var a=n.clock;c(a)?(a.interval=u(o.interval,a.interval),a.currentTime=u(o.currentTime,a.currentTime),a.range=u(o.range,a.range),a.step=u(o.step,a.step),a.multiplier=u(o.multiplier,a.multiplier)):n.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function ft(e,t,r,i){var n=t.ellipse;if(c(n)){var o,s=n.interval;c(s)&&(Ft.iso8601=s,o=O.fromIso8601(Ft));var l=e.ellipse;c(l)||(e.ellipse=l=new ee),qe(Boolean,l,"show",n.show,o,i,r),qe(Number,l,"semiMajorAxis",n.semiMajorAxis,o,i,r),qe(Number,l,"semiMinorAxis",n.semiMinorAxis,o,i,r),qe(Number,l,"height",n.height,o,i,r),qe(Number,l,"extrudedHeight",n.extrudedHeight,o,i,r),qe(we,l,"rotation",n.rotation,o,i,r),qe(we,l,"stRotation",n.stRotation,o,i,r),qe(Number,l,"granularity",n.granularity,o,i,r),qe(Boolean,l,"fill",n.fill,o,i,r),Ze(l,"material",n.material,o,i,r),qe(Boolean,l,"outline",n.outline,o,i,r),qe(a,l,"outlineColor",n.outlineColor,o,i,r),qe(Number,l,"outlineWidth",n.outlineWidth,o,i,r),qe(Number,l,"numberOfVerticalLines",n.numberOfVerticalLines,o,i,r),qe(B,l,"shadows",n.shadows,o,i,r)}}function mt(e,t,i,n){var o=t.ellipsoid;if(c(o)){var s,l=o.interval;c(l)&&(Ft.iso8601=l,s=O.fromIso8601(Ft));var u=e.ellipsoid;c(u)||(e.ellipsoid=u=new te),qe(Boolean,u,"show",o.show,s,n,i),qe(r,u,"radii",o.radii,s,n,i),qe(Boolean,u,"fill",o.fill,s,n,i),Ze(u,"material",o.material,s,n,i),qe(Boolean,u,"outline",o.outline,s,n,i),qe(a,u,"outlineColor",o.outlineColor,s,n,i),qe(Number,u,"outlineWidth",o.outlineWidth,s,n,i),qe(Number,u,"stackPartitions",o.stackPartitions,s,n,i),qe(Number,u,"slicePartitions",o.slicePartitions,s,n,i),qe(Number,u,"subdivisions",o.subdivisions,s,n,i),qe(B,u,"shadows",o.shadows,s,n,i)}}function gt(e,i,n,o){var s=i.label;if(c(s)){var l,u=s.interval;c(u)&&(Ft.iso8601=u,l=O.fromIso8601(Ft));var d=e.label;c(d)||(e.label=d=new ae),qe(Boolean,d,"show",s.show,l,o,n),qe(String,d,"text",s.text,l,o,n),qe(String,d,"font",s.font,l,o,n),qe(F,d,"style",s.style,l,o,n),qe(Number,d,"scale",s.scale,l,o,n),qe(Boolean,d,"showBackground",s.showBackground,l,o,n),qe(a,d,"backgroundColor",s.backgroundColor,l,o,n),qe(t,d,"backgroundPadding",s.backgroundPadding,l,o,n),qe(t,d,"pixelOffset",s.pixelOffset,l,o,n),qe(r,d,"eyeOffset",s.eyeOffset,l,o,n),qe(L,d,"horizontalOrigin",s.horizontalOrigin,l,o,n),qe(U,d,"verticalOrigin",s.verticalOrigin,l,o,n),qe(k,d,"heightReference",s.heightReference,l,o,n),qe(a,d,"fillColor",s.fillColor,l,o,n),qe(a,d,"outlineColor",s.outlineColor,l,o,n),qe(Number,d,"outlineWidth",s.outlineWidth,l,o,n),qe(x,d,"translucencyByDistance",s.translucencyByDistance,l,o,n),qe(x,d,"pixelOffsetScaleByDistance",s.pixelOffsetScaleByDistance,l,o,n)}}function vt(e,t,r,i){var n=t.model;if(c(n)){var o,s=n.interval;c(s)&&(Ft.iso8601=s,o=O.fromIso8601(Ft));var l=e.model;c(l)||(e.model=l=new se),qe(Boolean,l,"show",n.show,o,i,r),qe(V,l,"uri",n.gltf,o,i,r),qe(Number,l,"scale",n.scale,o,i,r),qe(Number,l,"minimumPixelSize",n.minimumPixelSize,o,i,r),qe(Number,l,"maximumScale",n.maximumScale,o,i,r),qe(Boolean,l,"incrementallyLoadTextures",n.incrementallyLoadTextures,o,i,r),qe(Boolean,l,"runAnimations",n.runAnimations,o,i,r),qe(B,l,"shadows",n.shadows,o,i,r),qe(k,l,"heightReference",n.heightReference,o,i,r),qe(a,l,"silhouetteColor",n.silhouetteColor,o,i,r),qe(Number,l,"silhouetteSize",n.silhouetteSize,o,i,r),qe(a,l,"color",n.color,o,i,r),qe(N,l,"colorBlendMode",n.colorBlendMode,o,i,r),qe(Number,l,"colorBlendAmount",n.colorBlendAmount,o,i,r);var u=n.nodeTransformations;if(c(u))if(y(u))for(var d=0,h=u.length;d<h;d++)_t(l,u[d],o,i,r);else _t(l,u,o,i,r)}}function _t(e,t,i,n,o){var a,s=t.interval;c(s)?(Ft.iso8601=s,a=O.fromIso8601(Ft),c(i)&&(a=O.intersect(a,i,kt))):c(i)&&(a=i);for(var l=e.nodeTransformations,u=Object.keys(t),d=0,h=u.length;d<h;++d){var p=u[d];if("interval"!==p){var f=t[p];if(c(f)){c(l)||(e.nodeTransformations=l=new ye),l.hasProperty(p)||l.addProperty(p);var m=l[p];c(m)||(l[p]=m=new le),qe(r,m,"translation",f.translation,a,n,o),qe(P,m,"rotation",f.rotation,a,n,o),qe(r,m,"scale",f.scale,a,n,o)}}}}function yt(e,t,r,i){var n=t.path;if(c(n)){var o,a=n.interval;c(a)&&(Ft.iso8601=a,o=O.fromIso8601(Ft));var s=e.path;c(s)||(e.path=s=new ue),qe(Boolean,s,"show",n.show,o,i,r),qe(Number,s,"width",n.width,o,i,r),qe(Number,s,"resolution",n.resolution,o,i,r),qe(Number,s,"leadTime",n.leadTime,o,i,r),qe(Number,s,"trailTime",n.trailTime,o,i,r),Ze(s,"material",n.material,o,i,r)}}function bt(e,t,r,i){var n=t.point;if(c(n)){var o,s=n.interval;c(s)&&(Ft.iso8601=s,o=O.fromIso8601(Ft));var l=e.point;c(l)||(e.point=l=new ce),qe(Boolean,l,"show",n.show,o,i,r),qe(Number,l,"pixelSize",n.pixelSize,o,i,r),qe(k,l,"heightReference",n.heightReference,o,i,r),qe(a,l,"color",n.color,o,i,r),qe(a,l,"outlineColor",n.outlineColor,o,i,r),qe(Number,l,"outlineWidth",n.outlineWidth,o,i,r),qe(x,l,"scaleByDistance",n.scaleByDistance,o,i,r),qe(x,l,"translucencyByDistance",n.translucencyByDistance,o,i,r)}}function Ct(e,t,r,i){var n=t.polygon;if(c(n)){var o,s=n.interval;c(s)&&(Ft.iso8601=s,o=O.fromIso8601(Ft));var l=e.polygon;c(l)||(e.polygon=l=new de),qe(Boolean,l,"show",n.show,o,i,r),at(l,"hierarchy",n.positions,r),qe(Number,l,"height",n.height,o,i,r),qe(Number,l,"extrudedHeight",n.extrudedHeight,o,i,r),qe(we,l,"stRotation",n.stRotation,o,i,r),qe(Number,l,"granularity",n.granularity,o,i,r),qe(Boolean,l,"fill",n.fill,o,i,r),Ze(l,"material",n.material,o,i,r),qe(Boolean,l,"outline",n.outline,o,i,r),qe(a,l,"outlineColor",n.outlineColor,o,i,r),qe(Number,l,"outlineWidth",n.outlineWidth,o,i,r),qe(Boolean,l,"perPositionHeight",n.perPositionHeight,o,i,r),qe(Boolean,l,"closeTop",n.closeTop,o,i,r),qe(Boolean,l,"closeBottom",n.closeBottom,o,i,r),qe(B,l,"shadows",n.shadows,o,i,r)}}function wt(e,t,r,i){var n=t.polyline;if(c(n)){var o,a=n.interval;c(a)&&(Ft.iso8601=a,o=O.fromIso8601(Ft));var s=e.polyline;c(s)||(e.polyline=s=new me),qe(Boolean,s,"show",n.show,o,i,r),at(s,"positions",n.positions,r),qe(Number,s,"width",n.width,o,i,r),qe(Number,s,"granularity",n.granularity,o,i,r),Ze(s,"material",n.material,o,i,r),qe(Boolean,s,"followSurface",n.followSurface,o,i,r),qe(B,s,"shadows",n.shadows,o,i,r)}}function St(e,t,r,i){var n=t.rectangle;if(c(n)){var o,s=n.interval;c(s)&&(Ft.iso8601=s,o=O.fromIso8601(Ft));var l=e.rectangle;c(l)||(e.rectangle=l=new be),qe(Boolean,l,"show",n.show,o,i,r),qe(A,l,"coordinates",n.coordinates,o,i,r),qe(Number,l,"height",n.height,o,i,r),qe(Number,l,"extrudedHeight",n.extrudedHeight,o,i,r),qe(we,l,"rotation",n.rotation,o,i,r),qe(we,l,"stRotation",n.stRotation,o,i,r),qe(Number,l,"granularity",n.granularity,o,i,r),qe(Boolean,l,"fill",n.fill,o,i,r),Ze(l,"material",n.material,o,i,r),qe(Boolean,l,"outline",n.outline,o,i,r),qe(a,l,"outlineColor",n.outlineColor,o,i,r),qe(Number,l,"outlineWidth",n.outlineWidth,o,i,r),qe(Boolean,l,"closeTop",n.closeTop,o,i,r),qe(Boolean,l,"closeBottom",n.closeBottom,o,i,r),qe(B,l,"shadows",n.shadows,o,i,r)}}function Et(e,t,r,i){var n=t.wall;if(c(n)){var o,s=n.interval;c(s)&&(Ft.iso8601=s,o=O.fromIso8601(Ft));var l=e.wall;c(l)||(e.wall=l=new Ie),qe(Boolean,l,"show",n.show,o,i,r),at(l,"positions",n.positions,r),nt(l,"minimumHeights",n.minimumHeights,r),nt(l,"maximumHeights",n.maximumHeights,r),qe(Number,l,"granularity",n.granularity,o,i,r),qe(Boolean,l,"fill",n.fill,o,i,r),Ze(l,"material",n.material,o,i,r),qe(Boolean,l,"outline",n.outline,o,i,r),qe(a,l,"outlineColor",n.outlineColor,o,i,r),qe(Number,l,"outlineWidth",n.outlineWidth,o,i,r),qe(B,l,"shadows",n.shadows,o,i,r)}}function Tt(e,t,r,i,n){var o=e.id;if(c(o)||(o=l()),Mt=o,!c(n._version)&&"document"!==o)throw new I("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if("document"===o)pt(e,n);else{var a=t.getOrCreateEntity(o),s=e.parent;c(s)&&(a.parent=t.getOrCreateEntity(s));for(var u=r.length-1;u>-1;u--)r[u](a,e,t,i)}Mt=void 0}function xt(e){var t,r=e._documentPacket.clock;if(!c(r)){if(!c(e._clock)){var i=e._entityCollection.computeAvailability();if(!i.start.equals(b.MINIMUM_VALUE)){var a=i.start,s=i.stop,l=C.secondsDifference(s,a),d=Math.round(l/120);return t=new $,t.startTime=C.clone(a),t.stopTime=C.clone(s),t.clockRange=n.LOOP_STOP,t.multiplier=d,t.currentTime=C.clone(a),t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}if(c(e._clock)?t=e._clock.clone():(t=new $,t.startTime=b.MINIMUM_VALUE.clone(),t.stopTime=b.MAXIMUM_VALUE.clone(),t.currentTime=b.MINIMUM_VALUE.clone(),t.clockRange=n.LOOP_STOP,t.clockStep=o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1),c(r.interval)){Ft.iso8601=r.interval;var h=O.fromIso8601(Ft);t.startTime=h.start,t.stopTime=h.stop}return c(r.currentTime)&&(t.currentTime=C.fromIso8601(r.currentTime)),c(r.range)&&(t.clockRange=u(n[r.range],n.LOOP_STOP)),c(r.step)&&(t.clockStep=u(o[r.step],o.SYSTEM_CLOCK_MULTIPLIER)),c(r.multiplier)&&(t.multiplier=r.multiplier),!t.equals(e._clock)&&(e._clock=t.clone(e._clock),!0)}function Pt(e,t,r,i){r=u(r,u.EMPTY_OBJECT);var n=t,o=r.sourceUri;return"string"==typeof t&&(n=E(t),o=u(o,t)),J.setLoading(e,!0),z(n,function(t){return At(e,t,o,i)}).otherwise(function(t){return J.setLoading(e,!1),e._error.raiseEvent(e,t),console.log(t),z.reject(t)})}function At(e,t,r,i){J.setLoading(e,!0);var n=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new Dt,n.removeAll()),It._processCzml(t,n,r,void 0,e);var o=xt(e),a=e._documentPacket;return c(a.name)&&e._name!==a.name?(e._name=a.name,o=!0):!c(e._name)&&c(r)&&(e._name=v(r),o=!0),J.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function Dt(){this.name=void 0,this.clock=void 0}function It(e){this._name=e,this._changed=new f,this._error=new f,this._isLoading=!1,this._loading=new f,this._clock=void 0,this._documentPacket=new Dt,this._version=void 0,this._entityCollection=new ie(this),this._entityCluster=new re}var Mt,Ot=new r,Rt=new M,Nt=new i,kt=new O,Lt={HERMITE:_,LAGRANGE:w,LINEAR:S},Ft={iso8601:void 0};return It.load=function(e,t){return(new It).load(e,t)},d(It.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}}}),It.updaters=[ut,ct,dt,ht,ft,mt,gt,vt,Ke,Je,yt,bt,Ct,wt,rt,St,$e,et,Et,tt,st],It.prototype.process=function(e,t){return Pt(this,e,t,!1)},It.prototype.load=function(e,t){return Pt(this,e,t,!0)},It.processPacketData=qe,It.processPositionPacketData=Xe,It.processMaterialPacketData=Ze,It._processCzml=function(e,t,r,i,n){if(i=c(i)?i:It.updaters,y(e))for(var o=0,a=e.length;o<a;o++)Tt(e[o],t,i,r,n);else Tt(e,t,i,r,n)},It}),define("DataSources/DataSourceCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../ThirdParty/when"],function(e,t,r,i,n,o,a){"use strict";function s(){this._dataSources=[],this._dataSourceAdded=new o,this._dataSourceRemoved=new o}return r(s.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}}}),s.prototype.add=function(e){var t=this,r=this._dataSources;return a(e,function(e){return r===t._dataSources&&(t._dataSources.push(e),t._dataSourceAdded.raiseEvent(t,e)),e})},s.prototype.remove=function(t,r){r=e(r,!1);var i=this._dataSources.indexOf(t);return i!==-1&&(this._dataSources.splice(i,1),this._dataSourceRemoved.raiseEvent(this,t),r&&"function"==typeof t.destroy&&t.destroy(),!0)},s.prototype.removeAll=function(t){t=e(t,!1);for(var r=this._dataSources,i=0,n=r.length;i<n;++i){var o=r[i];this._dataSourceRemoved.raiseEvent(this,o),t&&"function"==typeof o.destroy&&o.destroy()}this._dataSources=[]},s.prototype.contains=function(e){return this.indexOf(e)!==-1},s.prototype.indexOf=function(e){return this._dataSources.indexOf(e)},s.prototype.get=function(e){return this._dataSources[e]},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this.removeAll(!0),i(this)},s}),define("DataSources/EllipseGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipseGeometry","../Core/EllipseOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T){"use strict";function x(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}function P(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(P.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new d,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}function A(e,t,r){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=r,this._options=new x(r._entity)}var D=new C(e.WHITE),I=new w(!0),M=new w(!0),O=new w(!1),R=new w(e.BLACK),N=new w(b.DISABLED),k=new w(new s),L=new e;return n(P,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:v}}),n(P.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&T.isConstant(this._showProperty)&&T.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),P.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},P.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},P.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),c=new m(s&&a.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=this._distanceDisplayConditionProperty.getValue(r),p=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof C){var f=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(r)),o=t.fromColor(f),n={show:c,distanceDisplayCondition:p,color:o}}else n={show:c,distanceDisplayCondition:p};return new h({id:a,geometry:new u(this._options),attributes:n})},P.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=T.getValueOrDefault(this._outlineColorProperty,r,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(r);return new h({id:i,geometry:new c(this._options),attributes:{show:new m(n&&i.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._entitySubscription(),o(this)},P.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"position"===t||"ellipse"===t){var a=this._entity.ellipse;if(!i(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!i(s)||!s.isConstant||s.getValue(p.MINIMUM_VALUE),u=a.outline,c=i(u);if(c&&u.isConstant&&(c=u.getValue(p.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=this._entity.position,h=a.semiMajorAxis,m=a.semiMinorAxis,y=a.show;if(i(y)&&y.isConstant&&!y.getValue(p.MINIMUM_VALUE)||!i(d)||!i(h)||!i(m))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var b=r(a.material,D),w=b instanceof C;this._materialProperty=b,this._fillProperty=r(s,M),this._showProperty=r(y,I),this._showOutlineProperty=r(a.outline,O),this._outlineColorProperty=c?r(a.outlineColor,R):void 0,this._shadowsProperty=r(a.shadows,N),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,k);var S=a.rotation,E=a.height,x=a.extrudedHeight,P=a.granularity,A=a.stRotation,L=a.outlineWidth,F=a.numberOfVerticalLines,B=l&&!i(E)&&!i(x)&&w&&g.isSupported(this._scene);if(c&&B&&(f(f.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=B,this._isClosed=i(x)||B,this._outlineEnabled=c,d.isConstant&&h.isConstant&&m.isConstant&&T.isConstant(S)&&T.isConstant(E)&&T.isConstant(x)&&T.isConstant(P)&&T.isConstant(A)&&T.isConstant(L)&&T.isConstant(F)&&(!B||T.isConstant(b))){var U=this._options;U.vertexFormat=w?_.VERTEX_FORMAT:v.MaterialSupport.TEXTURED.vertexFormat,U.center=d.getValue(p.MINIMUM_VALUE,U.center),U.semiMajorAxis=h.getValue(p.MINIMUM_VALUE,U.semiMajorAxis),U.semiMinorAxis=m.getValue(p.MINIMUM_VALUE,U.semiMinorAxis),U.rotation=i(S)?S.getValue(p.MINIMUM_VALUE):void 0,U.height=i(E)?E.getValue(p.MINIMUM_VALUE):void 0,U.extrudedHeight=i(x)?x.getValue(p.MINIMUM_VALUE):void 0,U.granularity=i(P)?P.getValue(p.MINIMUM_VALUE):void 0,U.stRotation=i(A)?A.getValue(p.MINIMUM_VALUE):void 0,U.numberOfVerticalLines=i(F)?F.getValue(p.MINIMUM_VALUE):void 0,this._outlineWidth=i(L)?L.getValue(p.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},P.prototype.createDynamicUpdater=function(e,t){return new A(e,t,this)},A.prototype.update=function(r){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var d=n._entity,p=d.ellipse;if(d.isShowing&&d.isAvailable(r)&&T.getValueOrDefault(p.show,r,!0)){var f=this._options,m=T.getValueOrUndefined(d.position,r,f.center),b=T.getValueOrUndefined(p.semiMajorAxis,r),C=T.getValueOrUndefined(p.semiMinorAxis,r);if(i(m)&&i(b)&&i(C)){f.center=m,f.semiMajorAxis=b,f.semiMinorAxis=C,f.rotation=T.getValueOrUndefined(p.rotation,r),f.height=T.getValueOrUndefined(p.height,r),f.extrudedHeight=T.getValueOrUndefined(p.extrudedHeight,r),f.granularity=T.getValueOrUndefined(p.granularity,r),f.stRotation=T.getValueOrUndefined(p.stRotation,r),f.numberOfVerticalLines=T.getValueOrUndefined(p.numberOfVerticalLines,r);var w=this._geometryUpdater.shadowsProperty.getValue(r),S=this._geometryUpdater.distanceDisplayConditionProperty,x=S.getValue(r),P=l.fromDistanceDisplayCondition(x);if(T.getValueOrDefault(p.fill,r,!0)){var A=n.fillMaterialProperty,D=E.getValue(r,A,this._material);if(this._material=D,o){var I=e.WHITE;i(A.color)&&(I=A.color.getValue(r)),this._primitive=s.add(new g({geometryInstances:new h({id:d,geometry:new u(f),attributes:{color:t.fromColor(I),distanceDisplayCondition:P}}),asynchronous:!1,shadows:w}))}else{var M=new v({material:D,translucent:D.isTranslucent(),closed:i(f.extrudedHeight)});f.vertexFormat=M.vertexFormat,this._primitive=a.add(new y({geometryInstances:new h({id:d,geometry:new u(f)}),attributes:{distanceDisplayCondition:P},appearance:M,asynchronous:!1,shadows:w}))}}if(!o&&T.getValueOrDefault(p.outline,r,!1)){f.vertexFormat=_.VERTEX_FORMAT;var O=T.getValueOrClonedDefault(p.outlineColor,r,e.BLACK,L),R=T.getValueOrDefault(p.outlineWidth,r,1),N=1!==O.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new h({id:d,geometry:new c(f),attributes:{color:t.fromColor(O),distanceDisplayCondition:P}}),appearance:new _({flat:!0,translucent:N,renderState:{lineWidth:n._scene.clampLineWidth(R)}}),asynchronous:!1,shadows:w}))}}}},A.prototype.getBoundingSphere=function(e,t){return S(e,this._primitive,this._outlinePrimitive,t)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},P}),define("DataSources/EllipsoidGeometryUpdater",["../Core/Cartesian3","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/EllipsoidGeometry","../Core/EllipsoidOutlineGeometry","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/Matrix4","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/SceneMode","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x){"use strict";function P(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0}function A(e,t){this._scene=t,this._entity=e,this._entitySubscription=e.definitionChanged.addEventListener(A.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new h,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new P(e),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}function D(e,t){this._entity=t._entity,this._scene=t._scene,this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new P(t._entity),this._modelMatrix=new m,this._material=void 0,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}var I=new w(t.WHITE),M=new S(!0),O=new S(!0),R=new S(!1),N=new S(t.BLACK),k=new S(C.DISABLED),L=new S(new l),F=new e,B=new t,U=new e(1,1,1);return o(A,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:v}}),o(A.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&x.isConstant(this._showProperty)&&x.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!n(this._entity.availability)&&x.isConstant(this._showProperty)&&x.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),A.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},A.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},A.prototype.createFillGeometryInstance=function(e){var i,o,a=this._entity,s=a.isAvailable(e),l=new g(s&&a.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),d=this._distanceDisplayConditionProperty.getValue(e),h=u.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof w){var m=t.WHITE;n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(e)),o=r.fromColor(m),i={show:l,distanceDisplayCondition:h,color:o}}else i={show:l,distanceDisplayCondition:h};return new p({id:a,geometry:new c(this._options),modelMatrix:a._getModelMatrix(f.MINIMUM_VALUE),attributes:i})},A.prototype.createOutlineGeometryInstance=function(e){var i=this._entity,n=i.isAvailable(e),o=x.getValueOrDefault(this._outlineColorProperty,e,t.BLACK),a=this._distanceDisplayConditionProperty.getValue(e);return new p({id:i,geometry:new d(this._options),modelMatrix:i._getModelMatrix(f.MINIMUM_VALUE),attributes:{show:new g(n&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:r.fromColor(o),distanceDisplayCondition:u.fromDistanceDisplayCondition(a)}})},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._entitySubscription(),a(this)},A.prototype._onEntityPropertyChanged=function(e,t,r,o){if("availability"===t||"position"===t||"orientation"===t||"ellipsoid"===t){var a=e.ellipsoid;if(!n(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!n(s)||!s.isConstant||s.getValue(f.MINIMUM_VALUE),u=a.outline,c=n(u);if(c&&u.isConstant&&(c=u.getValue(f.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var d=e.position,h=a.radii,p=a.show;if(n(p)&&p.isConstant&&!p.getValue(f.MINIMUM_VALUE)||!n(d)||!n(h))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=i(a.material,I),g=m instanceof w;this._materialProperty=m,this._fillProperty=i(s,O),this._showProperty=i(p,M),this._showOutlineProperty=i(a.outline,R),this._outlineColorProperty=c?i(a.outlineColor,N):void 0,this._shadowsProperty=i(a.shadows,k),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,L),this._fillEnabled=l,this._outlineEnabled=c;var y=a.stackPartitions,b=a.slicePartitions,C=a.outlineWidth,S=a.subdivisions;if(d.isConstant&&x.isConstant(e.orientation)&&h.isConstant&&x.isConstant(y)&&x.isConstant(b)&&x.isConstant(C)&&x.isConstant(S)){var E=this._options;E.vertexFormat=g?_.VERTEX_FORMAT:v.MaterialSupport.TEXTURED.vertexFormat,E.radii=h.getValue(f.MINIMUM_VALUE,E.radii),E.stackPartitions=n(y)?y.getValue(f.MINIMUM_VALUE):void 0,E.slicePartitions=n(b)?b.getValue(f.MINIMUM_VALUE):void 0,E.subdivisions=n(S)?S.getValue(f.MINIMUM_VALUE):void 0,this._outlineWidth=n(C)?C.getValue(f.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},A.prototype.createDynamicUpdater=function(e){return new D(e,this)},D.prototype.update=function(e){var o=this._entity,a=o.ellipsoid;if(!o.isShowing||!o.isAvailable(e)||!x.getValueOrDefault(a.show,e,!0))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var s=x.getValueOrUndefined(a.radii,e,F),h=o._getModelMatrix(e,this._modelMatrix);if(!n(h)||!n(s))return n(this._primitive)&&(this._primitive.show=!1),void(n(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1));var f,C=x.getValueOrDefault(a.fill,e,!0),w=x.getValueOrDefault(a.outline,e,!1),S=x.getValueOrClonedDefault(a.outlineColor,e,t.BLACK,B),E=T.getValue(e,i(a.material,I),this._material);this._material=E;var P=x.getValueOrUndefined(a.stackPartitions,e),A=x.getValueOrUndefined(a.slicePartitions,e),D=x.getValueOrUndefined(a.subdivisions,e),M=x.getValueOrDefault(a.outlineWidth,e,1),O=this._scene.mode,R=O===b.SCENE3D,N=this._options,k=this._geometryUpdater.shadowsProperty.getValue(e),L=this._geometryUpdater.distanceDisplayConditionProperty,V=L.getValue(e),z=u.fromDistanceDisplayCondition(V),G=!R||this._lastSceneMode!==O||!n(this._primitive)||N.stackPartitions!==P||N.slicePartitions!==A||N.subdivisions!==D||this._lastOutlineWidth!==M;if(G){var H=this._primitives;H.removeAndDestroy(this._primitive),H.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=O,this._lastOutlineWidth=M,N.stackPartitions=P,N.slicePartitions=A,N.subdivisions=D,N.radii=R?U:s,f=new v({material:E,translucent:E.isTranslucent(),closed:!0}),N.vertexFormat=f.vertexFormat,this._primitive=H.add(new y({geometryInstances:new p({id:o,geometry:new c(N),modelMatrix:R?void 0:h,attributes:{show:new g(C),distanceDisplayCondition:z}}),appearance:f,asynchronous:!1,shadows:k})),N.vertexFormat=_.VERTEX_FORMAT,this._outlinePrimitive=H.add(new y({geometryInstances:new p({id:o,geometry:new d(N), +modelMatrix:R?void 0:h,attributes:{show:new g(w),color:r.fromColor(S),distanceDisplayCondition:z}}),appearance:new _({flat:!0,translucent:1!==S.alpha,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(M)}}),asynchronous:!1,shadows:k})),this._lastShow=C,this._lastOutlineShow=w,this._lastOutlineColor=t.clone(S,this._lastOutlineColor),this._lastDistanceDisplayCondition=V}else if(this._primitive.ready){var W=this._primitive,j=this._outlinePrimitive;W.show=!0,j.show=!0,f=W.appearance,f.material=E;var q=this._attributes;n(q)||(q=W.getGeometryInstanceAttributes(o),this._attributes=q),C!==this._lastShow&&(q.show=g.toValue(C,q.show),this._lastShow=C);var Y=this._outlineAttributes;n(Y)||(Y=j.getGeometryInstanceAttributes(o),this._outlineAttributes=Y),w!==this._lastOutlineShow&&(Y.show=g.toValue(w,Y.show),this._lastOutlineShow=w),t.equals(S,this._lastOutlineColor)||(Y.color=r.toValue(S,Y.color),t.clone(S,this._lastOutlineColor)),l.equals(V,this._lastDistanceDisplayCondition)||(q.distanceDisplayCondition=u.toValue(V,q.distanceDisplayCondition),Y.distanceDisplayCondition=u.toValue(V,Y.distanceDisplayCondition),l.clone(V,this._lastDistanceDisplayCondition))}R&&(s.x=Math.max(s.x,.001),s.y=Math.max(s.y,.001),s.z=Math.max(s.z,.001),h=m.multiplyByScale(h,s,h),this._primitive.modelMatrix=h,this._outlinePrimitive.modelMatrix=h)},D.prototype.getBoundingSphere=function(e,t){return E(e,this._primitive,this._outlinePrimitive,t)},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),a(this)},A}),define("DataSources/StaticGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r,n,o,a,s,l){this.translucent=r,this.appearanceType=n,this.depthFailAppearanceType=o,this.depthFailMaterialProperty=a,this.depthFailMaterial=void 0,this.closed=s,this.shadows=l,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[],this.invalidated=!1;var u;i(a)&&(u=a.definitionChanged.addEventListener(h.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=u}function p(e,t,r,i,n){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=r,this._closed=i,this._shadows=n}function f(e,t){for(var r=e.length,i=r-1;i>=0;i--){var n=e[i];if(n.remove(t)&&0===n.updaters.length)return e.splice(i,1),n.destroy(),!0}return!1}function m(e,t,r){for(var i=!1,n=t.length,o=0;o<n;++o){var a=t[o],s=a.itemsToRemove,l=s.length;if(l>0)for(o=0;o<l;o++){var u=s[o];a.remove(u),e.add(r,u),i=!0}}return i}function g(e,t,r,i){var n=t.length;for(u=n-1;u>=0;u--){var o=t[u];if(o.invalidated){t.splice(u,1);for(var a=o.updaters.values,s=a.length,l=0;l<s;l++)e.add(r,a[l]);o.destroy()}}n=t.length;for(var u=0;u<n;++u)i=t[u].update(r)&&i;return i}function v(e,t,r){for(var i=e.length,n=0;n<i;n++){var o=e[n];if(o.contains(t))return o.getBoundingSphere(t,r)}return l.FAILED}function _(e){for(var t=e.length,r=0;r<t;r++)e[r].destroy();e.length=0}var y=new t,b=new n;return h.prototype.onMaterialChanged=function(){this.invalidated=!0},h.prototype.isMaterial=function(e){var t=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;return r===t||!!i(t)&&t.equals(r)},h.prototype.add=function(e,t){var r=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&d.isConstant(e.distanceDisplayConditionProperty)){var i=this;this.subscriptions.set(r,e.entity.definitionChanged.addEventListener(function(t,r,n,o){"isShowing"===r&&i.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(r,e)},h.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);i(r)&&(r(),this.subscriptions.remove(t))}},h.prototype.update=function(e){var l,h,p=!0,f=0,m=this.primitive,g=this.primitives;if(this.createPrimitive){var v=this.geometry.values,_=v.length;if(_>0){for(i(m)&&(i(this.oldPrimitive)?g.remove(m):this.oldPrimitive=m),h=0;h<_;h++){var C=v[h],w=C.attributes;l=this.attributes.get(C.id.id),i(l)&&(i(w.show)&&(w.show.value=l.show),i(w.color)&&(w.color.value=l.color),i(w.depthFailColor)&&(w.depthFailColor.value=l.depthFailColor))}var S;i(this.depthFailAppearanceType)&&(i(this.depthFailMaterialProperty)&&(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),S=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),m=new s({asynchronous:!0,geometryInstances:v,appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:S,shadows:this.shadows}),g.add(m),p=!1}else{i(m)&&(g.remove(m),m=void 0);var E=this.oldPrimitive;i(E)&&(g.remove(E),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(i(m)&&m.ready){i(this.oldPrimitive)&&(g.remove(this.oldPrimitive),this.oldPrimitive=void 0),!i(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof u||(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);var T=this.updatersWithAttributes.values,x=T.length,P=this.waitingOnCreate;for(h=0;h<x;h++){var A=T[h],D=this.geometry.get(A.entity.id);if(l=this.attributes.get(D.id.id),i(l)||(l=m.getGeometryInstanceAttributes(D.id),this.attributes.set(D.id.id,l)),!A.fillMaterialProperty.isConstant||P){var I=A.fillMaterialProperty.color;I.getValue(e,y),t.equals(l._lastColor,y)||(l._lastColor=t.clone(y,l._lastColor),l.color=r.toValue(y,l.color),(this.translucent&&255===l.color[3]||!this.translucent&&255!==l.color[3])&&(this.itemsToRemove[f++]=A))}if(i(this.depthFailAppearanceType)&&this.depthFailAppearanceType instanceof u&&(!A.depthFailMaterialProperty.isConstant||P)){var M=A.depthFailMaterialProperty.color;M.getValue(e,y),t.equals(l._lastDepthFailColor,y)||(l._lastDepthFailColor=t.clone(y,l._lastDepthFailColor),l.depthFailColor=r.toValue(y,l.depthFailColor))}var O=A.entity.isShowing&&(A.hasConstantFill||A.isFilled(e)),R=1===l.show[0];O!==R&&(l.show=a.toValue(O,l.show));var N=A.distanceDisplayConditionProperty;if(!d.isConstant(N)){var k=N.getValue(e,b);n.equals(k,l._lastDistanceDisplayCondition)||(l._lastDistanceDisplayCondition=n.clone(k,l._lastDistanceDisplayCondition),l.distanceDisplayCondition=o.toValue(k,l.distanceDisplayCondition))}}this.updateShows(m),this.waitingOnCreate=!1}else i(m)&&!m.ready&&(p=!1);return this.itemsToRemove.length=f,p},h.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var o=t[n],s=this.geometry.get(o.entity.id),l=this.attributes.get(s.id.id);i(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=o.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=a.toValue(u,l.show))}this.showsUpdated.removeAll()},h.prototype.contains=function(e){return this.updaters.contains(e.id)},h.prototype.getBoundingSphere=function(e,t){var r=this.primitive;if(!r.ready)return l.PENDING;var n=r.getGeometryInstanceAttributes(e);return!i(n)||!i(n.boundingSphere)||i(n.show)&&0===n.show[0]?l.FAILED:(n.boundingSphere.clone(t),l.DONE)},h.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;i(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var r=this.oldPrimitive;i(r)&&(e.remove(r),this.oldPrimitive=void 0)},h.prototype.destroy=function(){var e=this.primitive,t=this.primitives;i(e)&&t.remove(e);var r=this.oldPrimitive;i(r)&&t.remove(r),i(this.removeMaterialSubscription)&&this.removeMaterialSubscription()},p.prototype.add=function(e,t){var r,i,n=t.createFillGeometryInstance(e);255===n.attributes.color.value[3]?(r=this._solidItems,i=!1):(r=this._translucentItems,i=!0);for(var o=r.length,a=0;a<o;a++){var s=r[a];if(s.isMaterial(t))return void s.add(t,n)}var l=new h(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);l.add(t,n),r.push(l)},p.prototype.remove=function(e){f(this._solidItems,e)||f(this._translucentItems,e)},p.prototype.update=function(e){var t=g(this,this._solidItems,e,!0);t=g(this,this._translucentItems,e,t)&&t;var r=m(this,this._solidItems,e),i=m(this,this._translucentItems,e);return(r||i)&&(t=g(this,this._solidItems,e,t)&&t,t=g(this,this._translucentItems,e,t)&&t),t},p.prototype.getBoundingSphere=function(e,t){var r=v(this._solidItems,e,t);return r===l.FAILED?v(this._translucentItems,e,t):r},p.prototype.removeAllPrimitives=function(){_(this._solidItems),_(this._translucentItems)},p}),define("DataSources/StaticGeometryPerMaterialBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/Primitive","./BoundingSphereState","./ColorMaterialProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r,i,n,o,a,s){this.primitives=t,this.appearanceType=r,this.materialProperty=i,this.depthFailAppearanceType=n,this.depthFailMaterialProperty=o,this.closed=a,this.shadows=s,this.updaters=new e,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new e,this.attributes=new e,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(h.prototype.onMaterialChanged,this),this.subscriptions=new e,this.showsUpdated=new e}function p(e,t,r,i,n){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=r,this._closed=i,this._shadows=n}var f=new n;h.prototype.onMaterialChanged=function(){this.invalidated=!0},h.prototype.isMaterial=function(e){var t=this.materialProperty,r=e.fillMaterialProperty,n=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(r===t&&o===n)return!0;var a=i(t)&&t.equals(r);return a=(!i(n)&&!i(o)||i(n)&&n.equals(o))&&a},h.prototype.add=function(e,t){var r=t.entity.id;if(this.updaters.set(r,t),this.geometry.set(r,t.createFillGeometryInstance(e)),t.hasConstantFill&&t.fillMaterialProperty.isConstant&&d.isConstant(t.distanceDisplayConditionProperty)){var i=this;this.subscriptions.set(r,t.entity.definitionChanged.addEventListener(function(e,r,n,o){"isShowing"===r&&i.showsUpdated.set(e.id,t)}))}else this.updatersWithAttributes.set(r,t);this.createPrimitive=!0},h.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);i(r)&&(r(),this.subscriptions.remove(t))}return this.createPrimitive};var m=new t;return h.prototype.update=function(e){var l,h,p=!0,g=this.primitive,v=this.primitives,_=this.geometry.values;if(this.createPrimitive){var y=_.length;if(y>0){for(i(g)&&(i(this.oldPrimitive)?v.remove(g):this.oldPrimitive=g),h=0;h<y;h++){var b=_[h],C=b.attributes;l=this.attributes.get(b.id.id),i(l)&&(i(C.show)&&(C.show.value=l.show),i(C.color)&&(C.color.value=l.color),i(C.depthFailColor)&&(C.depthFailColor.value=l.depthFailColor))}this.material=c.getValue(e,this.materialProperty,this.material);var w;if(i(this.depthFailMaterialProperty)){var S;this.depthFailMaterialProperty instanceof c?(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),S=this.depthFailMaterial.isTranslucent()):S=this.material.isTranslucent(),w=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:S,closed:this.closed})}g=new s({asynchronous:!0,geometryInstances:_,appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:w,shadows:this.shadows}),v.add(g),p=!1}else{i(g)&&(v.remove(g),g=void 0);var E=this.oldPrimitive;i(E)&&(v.remove(E),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=g,this.createPrimitive=!1}else if(i(g)&&g.ready){i(this.oldPrimitive)&&(v.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=c.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,!i(this.depthFailAppearanceType)||this.depthFailMaterialProperty instanceof u||(this.depthFailMaterial=c.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);var T=this.updatersWithAttributes.values,x=T.length;for(h=0;h<x;h++){var P=T[h],A=P.entity,D=this.geometry.get(A.id);if(l=this.attributes.get(D.id.id),i(l)||(l=g.getGeometryInstanceAttributes(D.id),this.attributes.set(D.id.id,l)),i(this.depthFailAppearanceType)&&this.depthFailAppearanceType instanceof u&&!P.depthFailMaterialProperty.isConstant){var I=P.depthFailMaterialProperty.color;I.getValue(e,m),t.equals(l._lastDepthFailColor,m)||(l._lastDepthFailColor=t.clone(m,l._lastDepthFailColor),l.depthFailColor=r.toValue(m,l.depthFailColor))}var M=A.isShowing&&(P.hasConstantFill||P.isFilled(e)),O=1===l.show[0];M!==O&&(l.show=a.toValue(M,l.show));var R=P.distanceDisplayConditionProperty;if(!d.isConstant(R)){var N=R.getValue(e,f);n.equals(N,l._lastDistanceDisplayCondition)||(l._lastDistanceDisplayCondition=n.clone(N,l._lastDistanceDisplayCondition),l.distanceDisplayCondition=o.toValue(N,l.distanceDisplayCondition))}}this.updateShows(g)}else i(g)&&!g.ready&&(p=!1);return p},h.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var o=t[n],s=o.entity,l=this.geometry.get(s.id),u=this.attributes.get(l.id.id);i(u)||(u=e.getGeometryInstanceAttributes(l.id),this.attributes.set(l.id.id,u));var c=s.isShowing,d=1===u.show[0];c!==d&&(u.show=a.toValue(c,u.show))}this.showsUpdated.removeAll()},h.prototype.contains=function(e){return this.updaters.contains(e.id)},h.prototype.getBoundingSphere=function(e,t){var r=this.primitive;if(!r.ready)return l.PENDING;var n=r.getGeometryInstanceAttributes(e);return!i(n)||!i(n.boundingSphere)||i(n.show)&&0===n.show[0]?l.FAILED:(n.boundingSphere.clone(t),l.DONE)},h.prototype.destroy=function(){var e=this.primitive,t=this.primitives;i(e)&&t.remove(e);var r=this.oldPrimitive;i(r)&&t.remove(r),this.removeMaterialSubscription()},p.prototype.add=function(e,t){for(var r=this._items,i=r.length,n=0;n<i;n++){var o=r[n];if(o.isMaterial(t))return void o.add(e,t)}var a=new h(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);a.add(e,t),r.push(a)},p.prototype.remove=function(e){for(var t=this._items,r=t.length,i=r-1;i>=0;i--){var n=t[i];if(n.remove(e)){0===n.updaters.length&&(t.splice(i,1),n.destroy());break}}},p.prototype.update=function(e){var t,r=this._items,i=r.length;for(t=i-1;t>=0;t--){var n=r[t];if(n.invalidated){r.splice(t,1);for(var o=n.updaters.values,a=o.length,s=0;s<a;s++)this.add(e,o[s]);n.destroy()}}var l=!0;for(t=0;t<i;t++)l=r[t].update(e)&&l;return l},p.prototype.getBoundingSphere=function(e,t){for(var r=this._items,i=r.length,n=0;n<i;n++){var o=r[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return l.FAILED},p.prototype.removeAllPrimitives=function(){for(var e=this._items,t=e.length,r=0;r<t;r++)e[r].destroy();this._items.length=0},p}),define("DataSources/StaticGroundGeometryColorBatch",["../Core/AssociativeArray","../Core/Color","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t,r,i){this.primitives=t,this.color=r,this.key=i,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.subscriptions=new e,this.showsUpdated=new e,this.itemsToRemove=[],this.isDirty=!1}function c(t){this._batches=new e,this._primitives=t}var d=new t,h=new i;u.prototype.add=function(e,t){var r=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantFill&&e.fillMaterialProperty.isConstant&&l.isConstant(e.distanceDisplayConditionProperty)){var i=this;this.subscriptions.set(r,e.entity.definitionChanged.addEventListener(function(t,r,n,o){"isShowing"===r&&i.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(r,e)},u.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var i=this.subscriptions.get(t);r(i)&&(i(),this.subscriptions.remove(t))}};var p=new Array(4);return u.prototype.update=function(e){var s,u,c=!0,f=0,m=this.primitive,g=this.primitives;if(this.createPrimitive){var v=this.geometry.values,_=v.length;if(_>0){for(r(m)&&(r(this.oldPrimitive)?g.remove(m):this.oldPrimitive=m),u=0;u<_;u++){var y=v[u],b=y.attributes;s=this.attributes.get(y.id.id),r(s)&&(r(b.show)&&(b.show.value=s.show),r(b.color)&&(b.color.value=s.color))}m=new a({asynchronous:!0,geometryInstances:v}),g.add(m),c=!1}else{r(m)&&(g.remove(m),m=void 0);var C=this.oldPrimitive;r(C)&&(g.remove(C),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(r(m)&&m.ready){r(this.oldPrimitive)&&(g.remove(this.oldPrimitive),this.oldPrimitive=void 0);var w=this.updatersWithAttributes.values,S=w.length,E=this.waitingOnCreate;for(u=0;u<S;u++){var T=w[u],x=this.geometry.get(T.entity.id);if(s=this.attributes.get(x.id.id),r(s)||(s=m.getGeometryInstanceAttributes(x.id),this.attributes.set(x.id.id,s)),!T.fillMaterialProperty.isConstant||E){var P=T.fillMaterialProperty.color;if(P.getValue(e,d),!t.equals(s._lastColor,d)){s._lastColor=t.clone(d,s._lastColor);var A=this.color,D=d.toBytes(p);A[0]===D[0]&&A[1]===D[1]&&A[2]===D[2]&&A[3]===D[3]||(this.itemsToRemove[f++]=T)}}var I=T.entity.isShowing&&(T.hasConstantFill||T.isFilled(e)),M=1===s.show[0];I!==M&&(s.show=o.toValue(I,s.show));var O=T.distanceDisplayConditionProperty;if(!l.isConstant(O)){var R=O.getValue(e,h);i.equals(R,s._lastDistanceDisplayCondition)||(s._lastDistanceDisplayCondition=i.clone(R,s._lastDistanceDisplayCondition),s.distanceDisplayCondition=n.toValue(R,s.distanceDisplayCondition))}}this.updateShows(m),this.waitingOnCreate=!1}else r(m)&&!m.ready&&(c=!1);return this.itemsToRemove.length=f,c},u.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,i=t.length,n=0;n<i;n++){var a=t[n],s=this.geometry.get(a.entity.id),l=this.attributes.get(s.id.id);r(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=a.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=o.toValue(u,l.show))}this.showsUpdated.removeAll()},u.prototype.contains=function(e){return this.updaters.contains(e.id)},u.prototype.getBoundingSphere=function(e,t){var i=this.primitive;if(!i.ready)return s.PENDING;var n=i.getBoundingSphere(e);return r(n)?(n.clone(t),s.DONE):s.FAILED},u.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;r(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var i=this.oldPrimitive;r(i)&&(e.remove(i),this.oldPrimitive=void 0)},c.prototype.add=function(e,t){var r,i=t.createFillGeometryInstance(e),n=this._batches,o=new Uint32Array(i.attributes.color.value.buffer)[0];return n.contains(o)?r=n.get(o):(r=new u(this._primitives,i.attributes.color.value,o),n.set(o,r)),r.add(t,i),r},c.prototype.remove=function(e){for(var t=this._batches.values,r=t.length,i=0;i<r;++i)if(t[i].remove(e))return},c.prototype.update=function(e){var t,r,i=!0,n=this._batches,o=n.values,a=o.length;for(t=0;t<a;++t)i=o[t].update(e)&&i;for(t=0;t<a;++t)for(var s=o[t],l=s.itemsToRemove,u=l.length,c=0;c<u;c++){r=l[c],s.remove(r);var d=this.add(e,r);s.isDirty=!0,d.isDirty=!0}var h=o.slice(),p=h.length;for(t=0;t<p;++t){var f=h[t];f.isDirty&&(i=h[t].update(e)&&i,f.isDirty=!1),0===f.geometry.length&&n.remove(f.key)}return i},c.prototype.getBoundingSphere=function(e,t){for(var r=this._batches.values,i=r.length,n=0;n<i;++n){var o=r[n];if(o.contains(e))return o.getBoundingSphere(e,t)}return s.FAILED},c.prototype.removeAllPrimitives=function(){for(var e=this._batches.values,t=e.length,r=0;r<t;++r)e[r].removeAllPrimitives()},c}),define("DataSources/StaticOutlineGeometryBatch",["../Core/AssociativeArray","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/ShowGeometryInstanceAttribute","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(t,r,i,n){this.translucent=r,this.width=i,this.shadows=n,this.primitives=t,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new e,this.updaters=new e,this.updatersWithAttributes=new e,this.attributes=new e,this.itemsToRemove=[],this.subscriptions=new e,this.showsUpdated=new e}function h(t,r,i){this._primitives=t,this._scene=r,this._shadows=i,this._solidBatches=new e,this._translucentBatches=new e}d.prototype.add=function(e,t){var r=e.entity.id;if(this.createPrimitive=!0,this.geometry.set(r,t),this.updaters.set(r,e),e.hasConstantOutline&&e.outlineColorProperty.isConstant&&c.isConstant(e.distanceDisplayConditionProperty)){var i=this;this.subscriptions.set(r,e.entity.definitionChanged.addEventListener(function(t,r,n,o){"isShowing"===r&&i.showsUpdated.set(t.id,e)}))}else this.updatersWithAttributes.set(r,e)},d.prototype.remove=function(e){var t=e.entity.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);var r=this.subscriptions.get(t);i(r)&&(r(),this.subscriptions.remove(t))}};var p=new t,f=new n;return d.prototype.update=function(e){var u,d,h=!0,m=0,g=this.primitive,v=this.primitives;if(this.createPrimitive){var _=this.geometry.values,y=_.length;if(y>0){for(i(g)&&(i(this.oldPrimitive)?v.remove(g):this.oldPrimitive=g),d=0;d<y;d++){var b=_[d],C=b.attributes;u=this.attributes.get(b.id.id),i(u)&&(i(C.show)&&(C.show.value=u.show),i(C.color)&&(C.color.value=u.color))}g=new l({asynchronous:!0,geometryInstances:_,appearance:new s({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),v.add(g),h=!1}else{i(g)&&(v.remove(g),g=void 0);var w=this.oldPrimitive;i(w)&&(v.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=g,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(i(g)&&g.ready){i(this.oldPrimitive)&&(v.remove(this.oldPrimitive),this.oldPrimitive=void 0);var S=this.updatersWithAttributes.values,E=S.length,T=this.waitingOnCreate;for(d=0;d<E;d++){var x=S[d],P=this.geometry.get(x.entity.id);if(u=this.attributes.get(P.id.id),i(u)||(u=g.getGeometryInstanceAttributes(P.id),this.attributes.set(P.id.id,u)),!x.outlineColorProperty.isConstant||T){var A=x.outlineColorProperty;A.getValue(e,p),t.equals(u._lastColor,p)||(u._lastColor=t.clone(p,u._lastColor),u.color=r.toValue(p,u.color),(this.translucent&&255===u.color[3]||!this.translucent&&255!==u.color[3])&&(this.itemsToRemove[m++]=x))}var D=x.entity.isShowing&&(x.hasConstantOutline||x.isOutlineVisible(e)),I=1===u.show[0];D!==I&&(u.show=a.toValue(D,u.show));var M=x.distanceDisplayConditionProperty;if(!c.isConstant(M)){var O=M.getValue(e,f);n.equals(O,u._lastDistanceDisplayCondition)||(u._lastDistanceDisplayCondition=n.clone(O,u._lastDistanceDisplayCondition),u.distanceDisplayCondition=o.toValue(O,u.distanceDisplayCondition))}}this.updateShows(g),this.waitingOnCreate=!1}else i(g)&&!g.ready&&(h=!1);return this.itemsToRemove.length=m,h},d.prototype.updateShows=function(e){for(var t=this.showsUpdated.values,r=t.length,n=0;n<r;n++){var o=t[n],s=this.geometry.get(o.entity.id),l=this.attributes.get(s.id.id);i(l)||(l=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,l));var u=o.entity.isShowing,c=1===l.show[0];u!==c&&(l.show=a.toValue(u,l.show))}this.showsUpdated.removeAll()},d.prototype.contains=function(e){return this.updaters.contains(e.id)},d.prototype.getBoundingSphere=function(e,t){var r=this.primitive;if(!r.ready)return u.PENDING;var n=r.getGeometryInstanceAttributes(e);return!i(n)||!i(n.boundingSphere)||i(n.show)&&0===n.show[0]?u.FAILED:(n.boundingSphere.clone(t),u.DONE)},d.prototype.removeAllPrimitives=function(){var e=this.primitives,t=this.primitive;i(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());var r=this.oldPrimitive;i(r)&&(e.remove(r),this.oldPrimitive=void 0)},h.prototype.add=function(e,t){var r,n,o=t.createOutlineGeometryInstance(e),a=this._scene.clampLineWidth(t.outlineWidth);255===o.attributes.color.value[3]?(r=this._solidBatches,n=r.get(a),i(n)||(n=new d(this._primitives,!1,a,this._shadows),r.set(a,n)),n.add(t,o)):(r=this._translucentBatches,n=r.get(a),i(n)||(n=new d(this._primitives,!0,a,this._shadows),r.set(a,n)),n.add(t,o))},h.prototype.remove=function(e){var t,r=this._solidBatches.values,i=r.length;for(t=0;t<i;t++)if(r[t].remove(e))return;var n=this._translucentBatches.values,o=n.length;for(t=0;t<o;t++)if(n[t].remove(e))return},h.prototype.update=function(e){var t,r,i,n,o,a=this._solidBatches.values,s=a.length,l=this._translucentBatches.values,u=l.length,c=!0,d=!1;do{for(d=!1,r=0;r<s;r++){n=a[r],c=n.update(e),o=n.itemsToRemove;var h=o.length;if(h>0)for(d=!0,t=0;t<h;t++)i=o[t],n.remove(i),this.add(e,i)}for(r=0;r<u;r++){n=l[r],c=n.update(e),o=n.itemsToRemove;var p=o.length;if(p>0)for(d=!0,t=0;t<p;t++)i=o[t],n.remove(i),this.add(e,i)}}while(d);return c},h.prototype.getBoundingSphere=function(e,t){var r,i=this._solidBatches.values,n=i.length;for(r=0;r<n;r++){var o=i[r];if(o.contains(e))return o.getBoundingSphere(e,t)}var a=this._translucentBatches.values,s=a.length;for(r=0;r<s;r++){var l=a[r];if(l.contains(e))return l.getBoundingSphere(e,t)}return u.FAILED},h.prototype.removeAllPrimitives=function(){var e,t=this._solidBatches.values,r=t.length;for(e=0;e<r;e++)t[e].removeAllPrimitives();var i=this._translucentBatches.values,n=i.length;for(e=0;e<n;e++)i[e].removeAllPrimitives()},h}),define("DataSources/GeometryVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./StaticGeometryColorBatch","./StaticGeometryPerMaterialBatch","./StaticGroundGeometryColorBatch","./StaticOutlineGeometryBatch"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t,r){this._primitives=t,this._groundPrimitives=r,this._dynamicUpdaters=new e}function p(e,t){for(var r=e._batches,i=r.length,n=0;n<i;n++)r[n].remove(t)}function f(e,t,i){if(i.isDynamic)return void e._dynamicBatch.add(t,i);var n;(i.outlineEnabled||i.fillEnabled)&&(n=i.shadowsProperty.getValue(t)),i.outlineEnabled&&e._outlineBatches[n].add(t,i);var a=0;r(i.depthFailMaterialProperty)&&(a=i.depthFailMaterialProperty instanceof s?1:2);var l;r(n)&&(l=n+a*o.NUMBER_OF_SHADOW_MODES),i.fillEnabled&&(i.onTerrain?e._groundColorBatch.add(t,i):i.isClosed?i.fillMaterialProperty instanceof s?e._closedColorBatches[l].add(t,i):e._closedMaterialBatches[l].add(t,i):i.fillMaterialProperty instanceof s?e._openColorBatches[l].add(t,i):e._openMaterialBatches[l].add(t,i))}function m(t,r,i){this._type=t;var n=r.primitives,a=r.groundPrimitives;this._scene=r,this._primitives=n,this._groundPrimitives=a,this._entityCollection=void 0,this._addedObjects=new e,this._removedObjects=new e,this._changedObjects=new e;var s=o.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(s),this._closedColorBatches=new Array(3*s),this._closedMaterialBatches=new Array(3*s),this._openColorBatches=new Array(3*s),this._openMaterialBatches=new Array(3*s);for(var p=0;p<s;++p)this._outlineBatches[p]=new d(n,r,p),this._closedColorBatches[p]=new l(n,t.perInstanceColorAppearanceType,void 0,!0,p),this._closedMaterialBatches[p]=new u(n,t.materialAppearanceType,void 0,!0,p),this._openColorBatches[p]=new l(n,t.perInstanceColorAppearanceType,void 0,!1,p),this._openMaterialBatches[p]=new u(n,t.materialAppearanceType,void 0,!1,p),this._closedColorBatches[p+s]=new l(n,t.perInstanceColorAppearanceType,t.perInstanceColorAppearanceType,!0,p),this._closedMaterialBatches[p+s]=new u(n,t.materialAppearanceType,t.perInstanceColorAppearanceType,!0,p),this._openColorBatches[p+s]=new l(n,t.perInstanceColorAppearanceType,t.perInstanceColorAppearanceType,!1,p),this._openMaterialBatches[p+s]=new u(n,t.materialAppearanceType,t.perInstanceColorAppearanceType,!1,p),this._closedColorBatches[p+2*s]=new l(n,t.perInstanceColorAppearanceType,t.materialAppearanceType,!0,p),this._closedMaterialBatches[p+2*s]=new u(n,t.materialAppearanceType,t.materialAppearanceType,!0,p),this._openColorBatches[p+2*s]=new l(n,t.perInstanceColorAppearanceType,t.materialAppearanceType,!1,p),this._openMaterialBatches[p+2*s]=new u(n,t.materialAppearanceType,t.materialAppearanceType,!1,p);this._groundColorBatch=new c(a),this._dynamicBatch=new h(n,a),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatch,this._dynamicBatch),this._subscriptions=new e,this._updaters=new e,this._entityCollection=i,i.collectionChanged.addEventListener(m.prototype._onCollectionChanged,this),this._onCollectionChanged(i,i.values,g)}var g=[];h.prototype.add=function(e,t){this._dynamicUpdaters.set(t.entity.id,t.createDynamicUpdater(this._primitives,this._groundPrimitives))},h.prototype.remove=function(e){var t=e.entity.id,i=this._dynamicUpdaters.get(t);r(i)&&(this._dynamicUpdaters.remove(t),i.destroy())},h.prototype.update=function(e){for(var t=this._dynamicUpdaters.values,r=0,i=t.length;r<i;r++)t[r].update(e);return!0},h.prototype.removeAllPrimitives=function(){for(var e=this._dynamicUpdaters.values,t=0,r=e.length;t<r;t++)e[t].destroy();this._dynamicUpdaters.removeAll()},h.prototype.getBoundingSphere=function(e,t){var i=this._dynamicUpdaters.get(e.id);return r(i)&&r(i.getBoundingSphere)?i.getBoundingSphere(e,t):a.FAILED},m.prototype.update=function(e){var t,r,i,n,o=this._addedObjects,a=o.values,s=this._removedObjects,l=s.values,u=this._changedObjects,c=u.values;for(t=c.length-1;t>-1;t--)r=c[t],i=r.id,n=this._updaters.get(i),n.entity===r?(p(this,n),f(this,e,n)):(l.push(r),a.push(r));for(t=l.length-1;t>-1;t--)r=l[t],i=r.id,n=this._updaters.get(i),p(this,n),n.destroy(),this._updaters.remove(i),this._subscriptions.get(i)(),this._subscriptions.remove(i);for(t=a.length-1;t>-1;t--)r=a[t],i=r.id,n=new this._type(r,this._scene),this._updaters.set(i,n),f(this,e,n),this._subscriptions.set(i,n.geometryChanged.addEventListener(m._onGeometryChanged,this));o.removeAll(),s.removeAll(),u.removeAll();var d=!0,h=this._batches,g=h.length;for(t=0;t<g;t++)d=h[t].update(e)&&d;return d};var v=[],_=new t;return m.prototype.getBoundingSphere=function(e,r){ +for(var i=v,n=_,o=0,s=a.DONE,l=this._batches,u=l.length,c=0;c<u;c++){if(s=l[c].getBoundingSphere(e,n),s===a.PENDING)return a.PENDING;s===a.DONE&&(i[o]=t.clone(n,i[o]),o++)}return 0===o?a.FAILED:(i.length=o,t.fromBoundingSpheres(i,r),a.DONE)},m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(m.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();var e,t=this._batches,r=t.length;for(e=0;e<r;e++)t[e].removeAllPrimitives();var n=this._subscriptions.values;for(r=n.length,e=0;e<r;e++)n[e]();return this._subscriptions.removeAll(),i(this)},m._onGeometryChanged=function(e){var t=this._removedObjects,i=this._changedObjects,n=e.entity,o=n.id;r(t.get(o))||r(i.get(o))||i.set(o,n)},m.prototype._onCollectionChanged=function(e,t,r){var i,n,o,a=this._addedObjects,s=this._removedObjects,l=this._changedObjects;for(i=r.length-1;i>-1;i--)o=r[i],n=o.id,a.remove(n)||(s.set(n,o),l.remove(n));for(i=t.length-1;i>-1;i--)o=t[i],n=o.id,s.remove(n)?l.set(n,o):a.set(n,o)},m}),define("DataSources/LabelVisualizer",["../Core/AssociativeArray","../Core/Cartesian2","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/VerticalOrigin","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e){this.entity=e,this.label=void 0,this.index=void 0}function v(t,r){r.collectionChanged.addEventListener(v.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}function _(e,t,r){o(e)&&(e.label=void 0,r.removeLabel(t))}var y=1,b="30px sans-serif",C=h.FILL,w=i.WHITE,S=i.BLACK,E=1,T=!1,x=new i(.165,.165,.165,.8),P=new t(7,5),A=t.ZERO,D=r.ZERO,I=c.NONE,M=d.CENTER,O=p.CENTER,R=0,N=new r,k=new i,L=new i,F=new i,B=new t,U=new r,V=new t,z=new u,G=new u,H=new u,W=new l;return v.prototype.update=function(e){for(var t=this._items.values,r=this._cluster,i=0,n=t.length;i<n;i++){var a,s=t[i],l=s.entity,u=l._label,c=s.label,d=l.isShowing&&l.isAvailable(e)&&m.getValueOrDefault(u._show,e,!0);d&&(N=m.getValueOrUndefined(l._position,e,N),a=m.getValueOrUndefined(u._text,e),d=o(N)&&o(a)),d?(m.isConstant(l._position)||(r._clusterDirty=!0),o(c)||(c=r.getLabel(l),c.id=l,s.label=c),c.show=!0,c.position=N,c.text=a,c.scale=m.getValueOrDefault(u._scale,e,y),c.font=m.getValueOrDefault(u._font,e,b),c.style=m.getValueOrDefault(u._style,e,C),c.fillColor=m.getValueOrDefault(u._fillColor,e,w,k),c.outlineColor=m.getValueOrDefault(u._outlineColor,e,S,L),c.outlineWidth=m.getValueOrDefault(u._outlineWidth,e,E),c.showBackground=m.getValueOrDefault(u._showBackground,e,T),c.backgroundColor=m.getValueOrDefault(u._backgroundColor,e,x,F),c.backgroundPadding=m.getValueOrDefault(u._backgroundPadding,e,P,B),c.pixelOffset=m.getValueOrDefault(u._pixelOffset,e,A,V),c.eyeOffset=m.getValueOrDefault(u._eyeOffset,e,D,U),c.heightReference=m.getValueOrDefault(u._heightReference,e,I),c.horizontalOrigin=m.getValueOrDefault(u._horizontalOrigin,e,M),c.verticalOrigin=m.getValueOrDefault(u._verticalOrigin,e,O),c.translucencyByDistance=m.getValueOrUndefined(u._translucencyByDistance,e,z),c.pixelOffsetScaleByDistance=m.getValueOrUndefined(u._pixelOffsetScaleByDistance,e,G),c.scaleByDistance=m.getValueOrUndefined(u._scaleByDistance,e,H),c.distanceDisplayCondition=m.getValueOrUndefined(u._distanceDisplayCondition,e,W),c.disableDepthTestDistance=m.getValueOrDefault(u._disableDepthTestDistance,e,R)):_(s,l,r)}return!0},v.prototype.getBoundingSphere=function(e,t){var i=this._items.get(e.id);if(!o(i)||!o(i.label))return f.FAILED;var a=i.label;return t.center=r.clone(n(a._clampedPosition,a.position),t.center),t.radius=0,f.DONE},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(v.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return a(this)},v.prototype._onCollectionChanged=function(e,t,r,i){var n,a,s=this._items,l=this._cluster;for(n=t.length-1;n>-1;n--)a=t[n],o(a._label)&&o(a._position)&&s.set(a.id,new g(a));for(n=i.length-1;n>-1;n--)a=i[n],o(a._label)&&o(a._position)?s.contains(a.id)||s.set(a.id,new g(a)):(_(s.get(a.id),a,l),s.remove(a.id));for(n=r.length-1;n>-1;n--)a=r[n],_(s.get(a.id),a,l),s.remove(a.id)},v}),define("ThirdParty/gltfDefaults",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/Quaternion","../Core/WebGLConstants"],function(e,t,r,i,n){"use strict";function o(e){r(e.accessors)||(e.accessors={});var i=e.accessors;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];o.byteStride=t(o.byteStride,0)}}function a(e){r(e.animations)||(e.animations={});var i=e.animations;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];r(o.channels)||(o.channels=[]),r(o.parameters)||(o.parameters={}),r(o.samplers)||(o.samplers={});var a=i.samplers;for(var s in a)if(a.hasOwnProperty(s)){var l=a[s];l.interpolation=t(l.interpolation,"LINEAR")}}}function s(e){r(e.asset)||(e.asset={});var i=e.asset;r(i.profile)&&"string"!=typeof i.profile||(i.profile={});var n=i.profile;i.premultipliedAlpha=t(i.premultipliedAlpha,!1),n.api=t(n.api,"WebGL"),n.version=t(n.version,"1.0.2"),r(e.version)&&(i.version=t(i.version,e.version),delete e.version),"number"==typeof i.version&&(i.version=i.version.toFixed(1).toString())}function l(e){r(e.buffers)||(e.buffers={});var i=e.buffers;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];o.type=t(o.type,"arraybuffer")}}function u(e){r(e.bufferViews)||(e.bufferViews={})}function c(e){r(e.cameras)||(e.cameras={})}function d(e){r(e.images)||(e.images={})}function h(e){r(e.extensions)||(e.extensions={});var i=e.extensions;r(i.KHR_materials_common)||(i.KHR_materials_common={});var n=i.KHR_materials_common;r(e.lights)?(n.lights=e.lights,delete e.lights):r(n.lights)||(n.lights={});var o=n.lights;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if("ambient"===s.type){r(s.ambient)||(s.ambient={});var l=s.ambient;r(l.color)||(l.color=[1,1,1])}else if("directional"===s.type){r(s.directional)||(s.directional={});var u=s.directional;r(u.color)||(u.color=[1,1,1])}else if("point"===s.type){r(s.point)||(s.point={});var c=s.point;r(c.color)||(c.color=[1,1,1]),c.constantAttenuation=t(c.constantAttenuation,1),c.linearAttenuation=t(c.linearAttenuation,0),c.quadraticAttenuation=t(c.quadraticAttenuation,0)}else if("spot"===s.type){r(s.spot)||(s.spot={});var d=s.spot;r(d.color)||(d.color=[1,1,1]),d.constantAttenuation=t(d.constantAttenuation,1),d.fallOffAngle=t(d.fallOffAngle,3.14159265),d.fallOffExponent=t(d.fallOffExponent,0),d.linearAttenuation=t(d.linearAttenuation,0),d.quadraticAttenuation=t(d.quadraticAttenuation,0)}}}function p(e){r(e.materials)||(e.materials={});var t=e.materials;for(var i in t)if(t.hasOwnProperty(i)){var o=t[i],a=o.instanceTechnique;if(r(a)&&(o.technique=a.technique,o.values=a.values,delete o.instanceTechnique),!r(o.extensions))if(r(o.technique))r(o.values)||(o.values={});else{delete o.values,o.extensions={KHR_materials_common:{technique:"CONSTANT",transparent:!1,values:{emission:{type:n.FLOAT_VEC4,value:[.5,.5,.5,1]}}}},r(e.extensionsUsed)||(e.extensionsUsed=[]);var s=e.extensionsUsed;s.indexOf("KHR_materials_common")===-1&&s.push("KHR_materials_common")}}}function f(e){r(e.meshes)||(e.meshes={});var i=e.meshes;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];r(a.primitives)||(a.primitives=[]);for(var s=a.primitives.length,l=s.length,u=0;u<l;++u){var c=s[u];r(c.attributes)||(c.attributes={});var d=t(c.primitive,n.TRIANGLES);c.mode=t(c.mode,d)}}}function m(t){r(t.nodes)||(t.nodes={});var n=t.nodes,o=parseFloat(t.asset.version)<1,a=new e,s=new i;for(var l in n)if(n.hasOwnProperty(l)){var u=n[l];if(r(u.children)||(u.children=[]),o&&r(u.rotation)){var c=u.rotation;e.fromArray(c,0,a),i.fromAxisAngle(a,c[3],s),u.rotation=[s.x,s.y,s.z,s.w]}r(u.matrix)||(r(u.translation)||r(u.rotation)||r(u.scale)?(r(u.translation)||(u.translation=[0,0,0]),r(u.rotation)||(u.rotation=[0,0,0,1]),r(u.scale)||(u.scale=[1,1,1])):u.matrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);var d=u.instanceSkin;r(d)&&(u.skeletons=d.skeletons,u.skin=d.skin,u.meshes=d.meshes,delete u.instanceSkin)}}function g(e){r(e.programs)||(e.programs={});var t=e.programs;for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];r(n.attributes)||(n.attributes=[])}}function v(e){r(e.samplers)||(e.samplers={});var i=e.samplers;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];a.magFilter=t(a.magFilter,n.LINEAR),a.minFilter=t(a.minFilter,n.NEAREST_MIPMAP_LINEAR),a.wrapS=t(a.wrapS,n.REPEAT),a.wrapT=t(a.wrapT,n.REPEAT)}}function _(e){r(e.scenes)||(e.scenes={});var t=e.scenes;for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];r(n.node)||(n.node=[])}}function y(e){r(e.shaders)||(e.shaders={})}function b(e){r(e.skins)||(e.skins={});var t=e.skins;for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];r(n.bindShapeMatrix)||(n.bindShapeMatrix=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}}function C(e){r(e.enable)||(e.enable=[]),r(e.disable)||(e.disable=[])}function w(e){r(e.techniques)||(e.techniques={});var i=e.techniques;for(var n in i)if(i.hasOwnProperty(n)){var o=i[n];r(o.parameters)||(o.parameters={});var a=o.parameters;for(var s in a){var l=a[s];l.node=t(l.node,l.source),l.source=void 0}var u=o.passes;if(r(u)){var c=t(o.pass,"defaultPass");if(u.hasOwnProperty(c)){var d=u[c],h=d.instanceProgram;o.attributes=t(o.attributes,h.attributes),o.program=t(o.program,h.program),o.uniforms=t(o.uniforms,h.uniforms),o.states=t(o.states,d.states)}o.passes=void 0,o.pass=void 0}r(o.attributes)||(o.attributes={}),r(o.uniforms)||(o.uniforms={}),r(o.states)||(o.states={}),C(o.states)}}function S(e){r(e.textures)||(e.textures={});var i=e.textures;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];a.format=t(a.format,n.RGBA),a.internalFormat=t(a.internalFormat,a.format),a.target=t(a.target,n.TEXTURE_2D),a.type=t(a.type,n.UNSIGNED_BYTE)}}var E=function(e){if(r(e))return r(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,e.allExtensions=void 0),e.extensionsUsed=t(e.extensionsUsed,[]),o(e),a(e),s(e),l(e),u(e),c(e),d(e),h(e),p(e),f(e),m(e),g(e),v(e),_(e),y(e),b(e),w(e),S(e),e};return E}),define("Scene/Axis",["../Core/Check","../Core/freezeObject","../Core/Math","../Core/Matrix3","../Core/Matrix4"],function(e,t,r,i,n){"use strict";var o={X:0,Y:1,Z:2,Y_UP_TO_Z_UP:n.fromRotationTranslation(i.fromRotationX(r.PI_OVER_TWO)),Z_UP_TO_Y_UP:n.fromRotationTranslation(i.fromRotationX(-r.PI_OVER_TWO)),X_UP_TO_Z_UP:n.fromRotationTranslation(i.fromRotationY(-r.PI_OVER_TWO)),Z_UP_TO_X_UP:n.fromRotationTranslation(i.fromRotationY(r.PI_OVER_TWO)),X_UP_TO_Y_UP:n.fromRotationTranslation(i.fromRotationZ(r.PI_OVER_TWO)),Y_UP_TO_X_UP:n.fromRotationTranslation(i.fromRotationZ(-r.PI_OVER_TWO)),fromName:function(e){return o[e]}};return t(o)}),define("Scene/getAttributeOrUniformBySemantic",[],function(){"use strict";function e(e,t){var r=e.techniques;for(var i in r)if(r.hasOwnProperty(i)){var n=r[i],o=n.parameters,a=n.attributes,s=n.uniforms;for(var l in a)if(a.hasOwnProperty(l)&&o[a[l]].semantic===t)return l;for(var u in s)if(s.hasOwnProperty(u)&&o[s[u]].semantic===t)return u}}return e}),define("Scene/getBinaryAccessor",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4"],function(e,t,r,i,n,o,a){"use strict";function s(e){var t,r=e.componentType;t="string"==typeof r?i.fromName(r):r;var n=l[e.type],o=u[e.type];return{componentsPerAttribute:n,classType:o,createArrayBufferView:function(e,r,o){return i.createArrayBufferView(t,e,r,n*o)}}}var l={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},u={SCALAR:void 0,VEC2:e,VEC3:t,VEC4:r,MAT2:n,MAT3:o,MAT4:a};return s}),define("Scene/JobType",["../Core/freezeObject"],function(e){"use strict";var t={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};return e(t)}),define("Scene/ModelAnimationCache",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/LinearSpline","../Core/Matrix4","../Core/Quaternion","../Core/QuaternionSpline","../Core/WebGLConstants","./getBinaryAccessor"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(){}function c(e,t){var r=e.gltf,i=r.buffers,n=r.bufferViews,o=n[t.bufferView],a=i[o.buffer],s=o.byteOffset+t.byteOffset,u=t.count*l(t).componentsPerAttribute,c=p.test(a.uri)?"":a.uri;return e.cacheKey+"//"+c+"/"+s+"/"+u}function d(e,t,r){return e.cacheKey+"//"+t+"/"+r}function h(e){this._value=e}var p=/^data\:/i,f={},m=new e;u.getAnimationParameterValues=function(t,i){var n=c(t,i),a=f[n];if(!r(a)){var u,d=t._loadResources,h=t.gltf,p=parseFloat(h.asset.version)<1,g=h.bufferViews,v=g[i.bufferView],_=i.componentType,y=i.type,b=i.count,C=d.getBuffer(v),w=l(i).createArrayBufferView(C.buffer,C.byteOffset+i.byteOffset,b);if(_===s.FLOAT&&"SCALAR"===y)a=w;else if(_===s.FLOAT&&"VEC3"===y)for(a=new Array(b),u=0;u<b;++u)a[u]=e.fromArray(w,3*u);else if(_===s.FLOAT&&"VEC4"===y)for(a=new Array(b),u=0;u<b;++u){var S=4*u;p?a[u]=o.fromAxisAngle(e.fromArray(w,S,m),w[S+3]):a[u]=o.unpack(w,S)}r(t.cacheKey)&&(f[n]=a)}return a};var g={};h.prototype.evaluate=function(e,t){return this._value},u.getAnimationSpline=function(e,t,n,o,l,u){var c=d(e,t,o),p=g[c];if(!r(p)){var f=u[l.input],m=e.gltf.accessors[n.parameters[l.output]],v=u[l.output];if(1===f.length&&1===v.length)p=new h(v[0]);else{var _=m.componentType,y=m.type;"LINEAR"===l.interpolation&&(_===s.FLOAT&&"VEC3"===y?p=new i({times:f,points:v}):_===s.FLOAT&&"VEC4"===y&&(p=new a({times:f,points:v})))}r(e.cacheKey)&&(g[c]=p)}return p};var v={};return u.getSkinInverseBindMatrices=function(e,t){var i=c(e,t),o=v[i];if(!r(o)){var a=e._loadResources,u=e.gltf,d=u.bufferViews,h=d[t.bufferView],p=t.componentType,f=t.type,m=t.count,g=a.getBuffer(h),_=l(t).createArrayBufferView(g.buffer,g.byteOffset+t.byteOffset,m);if(o=new Array(m),p===s.FLOAT&&"MAT4"===f)for(var y=0;y<m;++y)o[y]=n.fromArray(_,16*y);v[i]=o}return o},u}),define("Scene/ModelAnimationLoop",["../Core/freezeObject"],function(e){"use strict";var t={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};return e(t)}),define("Scene/ModelAnimationState",["../Core/freezeObject"],function(e){"use strict";return e({STOPPED:0,ANIMATING:1})}),define("Scene/ModelAnimation",["../Core/defaultValue","../Core/defineProperties","../Core/Event","../Core/JulianDate","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,r,i,n,o){"use strict";function a(t,a,s){this._name=t.name,this._startTime=i.clone(t.startTime),this._delay=e(t.delay,0),this._stopTime=t.stopTime,this.removeOnStop=e(t.removeOnStop,!1),this._speedup=e(t.speedup,1),this._reverse=e(t.reverse,!1),this._loop=e(t.loop,n.NONE),this.start=new r,this.update=new r,this.stop=new r,this._state=o.STOPPED,this._runtimeAnimation=s,this._computedStartTime=void 0,this._duration=void 0;var l=this;this._raiseStartEvent=function(){l.start.raiseEvent(a,l)},this._updateEventTime=0,this._raiseUpdateEvent=function(){l.update.raiseEvent(a,l,l._updateEventTime)},this._raiseStopEvent=function(){l.stop.raiseEvent(a,l)}}return t(a.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}},speedup:{get:function(){return this._speedup}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}}}),a}),define("Scene/ModelAnimationCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/JulianDate","../Core/Math","./ModelAnimation","./ModelAnimationLoop","./ModelAnimationState"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e){this.animationAdded=new o,this.animationRemoved=new o,this._model=e,this._scheduledAnimations=[],this._previousTime=void 0}function h(e,t){for(var r=e.channelEvaluators,i=r.length,n=0;n<i;++n)r[n](t)}function p(e,t,r){return function(){e.animationRemoved.raiseEvent(t,r)}}i(d.prototype,{length:{get:function(){return this._scheduledAnimations.length}}}),d.prototype.add=function(e){e=t(e,t.EMPTY_OBJECT);var r=this._model,i=r._runtime.animations,n=i[e.name],o=new l(e,r,n);return this._scheduledAnimations.push(o),this.animationAdded.raiseEvent(r,o),o},d.prototype.addAll=function(r){r=t(r,t.EMPTY_OBJECT),r=e(r);for(var i=[],n=this._model._animationIds,o=n.length,a=0;a<o;++a)r.name=n[a],i.push(this.add(r));return i},d.prototype.remove=function(e){if(r(e)){var t=this._scheduledAnimations,i=t.indexOf(e);if(i!==-1)return t.splice(i,1),this.animationRemoved.raiseEvent(this._model,e),!0}return!1},d.prototype.removeAll=function(){var e=this._model,t=this._scheduledAnimations,r=t.length;this._scheduledAnimations=[];for(var i=0;i<r;++i)this.animationRemoved.raiseEvent(e,t[i])},d.prototype.contains=function(e){return!!r(e)&&this._scheduledAnimations.indexOf(e)!==-1},d.prototype.get=function(e){return this._scheduledAnimations[e]};var f=[];return d.prototype.update=function(e){var i=this._scheduledAnimations,n=i.length;if(0===n)return this._previousTime=void 0,!1;if(a.equals(e.time,this._previousTime))return!1;this._previousTime=a.clone(e.time,this._previousTime);for(var o=!1,l=e.time,d=this._model,m=0;m<n;++m){var g=i[m],v=g._runtimeAnimation;r(g._computedStartTime)||(g._computedStartTime=a.addSeconds(t(g.startTime,l),g.delay,new a)),r(g._duration)||(g._duration=v.stopTime*(1/g.speedup));var _=g._computedStartTime,y=g._duration,b=g.stopTime,C=0!==y?a.secondsDifference(l,_)/y:0,w=C>=0,S=g.loop===u.REPEAT||g.loop===u.MIRRORED_REPEAT,E=(w||S&&!r(g.startTime))&&(C<=1||S)&&(!r(b)||a.lessThanOrEquals(l,b));if(E){if(g._state===c.STOPPED&&(g._state=c.ANIMATING,g.start.numberOfListeners>0&&e.afterRender.push(g._raiseStartEvent)),g.loop===u.REPEAT)C-=Math.floor(C);else if(g.loop===u.MIRRORED_REPEAT){var T=Math.floor(C),x=C-T;C=T%2===1?1-x:x}g.reverse&&(C=1-C);var P=C*y*g.speedup;P=s.clamp(P,v.startTime,v.stopTime),h(v,P),g.update.numberOfListeners>0&&(g._updateEventTime=P,e.afterRender.push(g._raiseUpdateEvent)),o=!0}else w&&g._state===c.ANIMATING&&(g._state=c.STOPPED,g.stop.numberOfListeners>0&&e.afterRender.push(g._raiseStopEvent),g.removeOnStop&&f.push(g))}n=f.length;for(var A=0;A<n;++A){var D=f[A];i.splice(i.indexOf(D),1),e.afterRender.push(p(this,d,D))}return f.length=0,o},d}),define("Scene/ModelMaterial",["../Core/defined","../Core/defineProperties","../Core/DeveloperError"],function(e,t,r){"use strict";function i(e,t,r){this._name=t.name,this._id=r,this._uniformMap=e._uniformMaps[r]}return t(i.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}}}),i.prototype.setValue=function(e,t){var r=this._uniformMap.values[e];r.value=r.clone(t,r.value)},i.prototype.getValue=function(t){var r=this._uniformMap.values[t];if(e(r))return r.value},i}),define("Scene/modelMaterialsCommon",["../Core/defaultValue","../Core/defined","../Core/WebGLConstants"],function(e,t,r){"use strict";function i(e){switch(e){case r.FLOAT:return"float";case r.FLOAT_VEC2:return"vec2";case r.FLOAT_VEC3:return"vec3";case r.FLOAT_VEC4:return"vec4";case r.FLOAT_MAT2:return"mat2";case r.FLOAT_MAT3:return"mat3";case r.FLOAT_MAT4:return"mat4";case r.SAMPLER_2D:return"sampler2D"}}function n(e){var i,n={};if(t(e.extensions)&&t(e.extensions.KHR_materials_common)&&(i=e.extensions.KHR_materials_common.lights),t(i)){var o=e.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if(t(s.extensions)&&t(s.extensions.KHR_materials_common)){var l=s.extensions.KHR_materials_common.light;t(l)&&t(i[l])&&(i[l].node=a),delete s.extensions.KHR_materials_common}}var u=0;for(var c in i)if(i.hasOwnProperty(c)){var d=i[c],h=d.type;if("ambient"!==h&&!t(d.node)){delete i[c];continue}var p="light"+u.toString();switch(d.baseName=p,h){case"ambient":var f=d.ambient;n[p+"Color"]={type:r.FLOAT_VEC3,value:f.color};break;case"directional":var m=d.directional;n[p+"Color"]={type:r.FLOAT_VEC3,value:m.color},t(d.node)&&(n[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:r.FLOAT_MAT4});break;case"point":var g=d.point;n[p+"Color"]={type:r.FLOAT_VEC3,value:g.color},t(d.node)&&(n[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:r.FLOAT_MAT4}),n[p+"Attenuation"]={type:r.FLOAT_VEC3,value:[g.constantAttenuation,g.linearAttenuation,g.quadraticAttenuation]};break;case"spot":var v=d.spot;n[p+"Color"]={type:r.FLOAT_VEC3,value:v.color},t(d.node)&&(n[p+"Transform"]={node:d.node,semantic:"MODELVIEW",type:r.FLOAT_MAT4},n[p+"InverseTransform"]={node:d.node,semantic:"MODELVIEWINVERSE",type:r.FLOAT_MAT4,useInFragment:!0}),n[p+"Attenuation"]={type:r.FLOAT_VEC3,value:[v.constantAttenuation,v.linearAttenuation,v.quadraticAttenuation]},n[p+"FallOff"]={type:r.FLOAT_VEC2,value:[v.fallOffAngle,v.fallOffExponent]}}++u}}return n}function o(r,i,n){var o,a=e(n,0);do o=i+(a++).toString();while(t(r[o]));return o}function a(n,a,l,u){var f,m=n.techniques,g=n.shaders,v=n.programs,_=a.technique.toUpperCase();t(n.extensions)&&t(n.extensions.KHR_materials_common)&&(f=n.extensions.KHR_materials_common.lights);var y=e(a.jointCount,0),b=y>0,C=a.values,w="precision highp float;\n",S="precision highp float;\n",E=o(m,"technique",c),T=o(g,"vertexShader",d),x=o(g,"fragmentShader",h),P=o(v,"program",p),A="CONSTANT"!==_,D={modelViewMatrix:{semantic:u.useCesiumRTCMatrixInShaders?"CESIUM_RTC_MODELVIEW":"MODELVIEW",type:r.FLOAT_MAT4},projectionMatrix:{semantic:"PROJECTION",type:r.FLOAT_MAT4}};A&&(D.normalMatrix={semantic:"MODELVIEWINVERSETRANSPOSE",type:r.FLOAT_MAT3}),b&&(D.jointMatrix={count:y,semantic:"JOINTMATRIX",type:r.FLOAT_MAT4});var I,M=!1;for(var O in C)if(C.hasOwnProperty(O)&&"transparent"!==O&&"doubleSided"!==O){var R=s(O,C[O]);I=O.toLowerCase(),M||R!==r.SAMPLER_2D||(M=!0),D[I]={type:R}}if(t(l))for(var N in l)l.hasOwnProperty(N)&&(D[N]=l[N]);var k={};for(var L in D)if(D.hasOwnProperty(L)){var F=D[L];k["u_"+L]=L;var B=t(F.count)?"["+F.count+"]":"";F.type!==r.FLOAT_MAT3&&F.type!==r.FLOAT_MAT4||F.useInFragment?(S+="uniform "+i(F.type)+" u_"+L+B+";\n",delete F.useInFragment):w+="uniform "+i(F.type)+" u_"+L+B+";\n"}var U="";b&&(U+=" mat4 skinMat = a_weight.x * u_jointMatrix[int(a_joint.x)];\n",U+=" skinMat += a_weight.y * u_jointMatrix[int(a_joint.y)];\n",U+=" skinMat += a_weight.z * u_jointMatrix[int(a_joint.z)];\n",U+=" skinMat += a_weight.w * u_jointMatrix[int(a_joint.w)];\n");var V={a_position:"position"};D.position={semantic:"POSITION",type:r.FLOAT_VEC3},w+="attribute vec3 a_position;\n",w+="varying vec3 v_positionEC;\n",U+=b?" vec4 pos = u_modelViewMatrix * skinMat * vec4(a_position,1.0);\n":" vec4 pos = u_modelViewMatrix * vec4(a_position,1.0);\n",U+=" v_positionEC = pos.xyz;\n",U+=" gl_Position = u_projectionMatrix * pos;\n",S+="varying vec3 v_positionEC;\n",A&&(V.a_normal="normal",D.normal={semantic:"NORMAL",type:r.FLOAT_VEC3},w+="attribute vec3 a_normal;\n",w+="varying vec3 v_normal;\n",U+=b?" v_normal = u_normalMatrix * mat3(skinMat) * a_normal;\n":" v_normal = u_normalMatrix * a_normal;\n",S+="varying vec3 v_normal;\n");var z;M&&(V.a_texcoord_0="texcoord_0",D.texcoord_0={semantic:"TEXCOORD_0",type:r.FLOAT_VEC2},z="v_texcoord_0",w+="attribute vec2 a_texcoord_0;\n",w+="varying vec2 "+z+";\n",U+=" "+z+" = a_texcoord_0;\n",S+="varying vec2 "+z+";\n"),b&&(V.a_joint="joint",D.joint={semantic:"JOINT",type:r.FLOAT_VEC4},V.a_weight="weight",D.weight={semantic:"WEIGHT",type:r.FLOAT_VEC4},w+="attribute vec4 a_joint;\n",w+="attribute vec4 a_weight;\n");var G=A&&("BLINN"===_||"PHONG"===_)&&t(D.specular)&&t(D.shininess),H=!1,W=!1,j="";for(var q in f)if(f.hasOwnProperty(q)){var Y=f[q],X=Y.type.toLowerCase(),Q=Y.baseName;j+=" {\n";var Z,K,J="u_"+Q+"Color";"ambient"===X?(W=!0,j+=" ambientLight += "+J+";\n"):A&&(H=!0,Z="v_"+Q+"Direction",K="v_"+Q+"Position","point"!==X&&(w+="varying vec3 "+Z+";\n",S+="varying vec3 "+Z+";\n",U+=" "+Z+" = mat3(u_"+Q+"Transform) * vec3(0.,0.,1.);\n","directional"===X&&(j+=" vec3 l = normalize("+Z+");\n")),"directional"!==X?(w+="varying vec3 "+K+";\n",S+="varying vec3 "+K+";\n",U+=" "+K+" = u_"+Q+"Transform[3].xyz;\n",j+=" vec3 VP = "+K+" - v_positionEC;\n",j+=" vec3 l = normalize(VP);\n",j+=" float range = length(VP);\n",j+=" float attenuation = 1.0 / (u_"+Q+"Attenuation.x + ",j+="(u_"+Q+"Attenuation.y * range) + ",j+="(u_"+Q+"Attenuation.z * range * range));\n"):j+=" float attenuation = 1.0;\n","spot"===X&&(j+=" float spotDot = dot(l, normalize("+Z+"));\n",j+=" if (spotDot < cos(u_"+Q+"FallOff.x * 0.5))\n",j+=" {\n",j+=" attenuation = 0.0;\n",j+=" }\n",j+=" else\n",j+=" {\n",j+=" attenuation *= max(0.0, pow(spotDot, u_"+Q+"FallOff.y));\n",j+=" }\n"),j+=" diffuseLight += "+J+"* max(dot(normal,l), 0.) * attenuation;\n",G&&("BLINN"===_?(j+=" vec3 h = normalize(l + viewDir);\n",j+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess)) * attenuation;\n"):(j+=" vec3 reflectDir = reflect(-l, normal);\n",j+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess)) * attenuation;\n"),j+=" specularLight += "+J+" * specularIntensity;\n")),j+=" }\n"}W||(j+=" ambientLight += vec3(0.2, 0.2, 0.2);\n"),H||"CONSTANT"===_||(j+=" vec3 l = normalize(czm_sunDirectionEC);\n",j+=" diffuseLight += vec3(1.0, 1.0, 1.0) * max(dot(normal,l), 0.);\n",G&&("BLINN"===_?(j+=" vec3 h = normalize(l + viewDir);\n",j+=" float specularIntensity = max(0., pow(max(dot(normal, h), 0.), u_shininess));\n"):(j+=" vec3 reflectDir = reflect(-l, normal);\n",j+=" float specularIntensity = max(0., pow(max(dot(reflectDir, viewDir), 0.), u_shininess));\n"),j+=" specularLight += vec3(1.0, 1.0, 1.0) * specularIntensity;\n")),w+="void main(void) {\n",w+=U,w+="}\n",S+="void main(void) {\n";var $=" vec3 color = vec3(0.0, 0.0, 0.0);\n";A&&(S+=" vec3 normal = normalize(v_normal);\n",a.doubleSided&&(S+=" if (gl_FrontFacing == false)\n",S+=" {\n",S+=" normal = -normal;\n",S+=" }\n"));var ee;"CONSTANT"!==_?(t(D.diffuse)&&(S+=D.diffuse.type===r.SAMPLER_2D?" vec4 diffuse = texture2D(u_diffuse, "+z+");\n":" vec4 diffuse = u_diffuse;\n",S+=" vec3 diffuseLight = vec3(0.0, 0.0, 0.0);\n",$+=" color += diffuse.rgb * diffuseLight;\n"),G&&(S+=D.specular.type===r.SAMPLER_2D?" vec3 specular = texture2D(u_specular, "+z+").rgb;\n":" vec3 specular = u_specular.rgb;\n",S+=" vec3 specularLight = vec3(0.0, 0.0, 0.0);\n",$+=" color += specular * specularLight;\n"),ee=t(D.transparency)?" gl_FragColor = vec4(color * diffuse.a, diffuse.a * u_transparency);\n":" gl_FragColor = vec4(color * diffuse.a, diffuse.a);\n"):ee=t(D.transparency)?" gl_FragColor = vec4(color, u_transparency);\n":" gl_FragColor = vec4(color, 1.0);\n",t(D.emission)&&(S+=D.emission.type===r.SAMPLER_2D?" vec3 emission = texture2D(u_emission, "+z+").rgb;\n":" vec3 emission = u_emission.rgb;\n",$+=" color += emission;\n"),(t(D.ambient)||"CONSTANT"!==_)&&(S+=t(D.ambient)?D.ambient.type===r.SAMPLER_2D?" vec3 ambient = texture2D(u_ambient, "+z+").rgb;\n":" vec3 ambient = u_ambient.rgb;\n":" vec3 ambient = diffuse.rgb;\n",$+=" color += ambient * ambientLight;\n"),S+=" vec3 viewDir = -normalize(v_positionEC);\n",S+=" vec3 ambientLight = vec3(0.0, 0.0, 0.0);\n",S+=j,S+=$,S+=ee,S+="}\n";var te;te=a.transparent?{enable:[r.DEPTH_TEST,r.BLEND],depthMask:!1,functions:{blendEquationSeparate:[r.FUNC_ADD,r.FUNC_ADD],blendFuncSeparate:[r.ONE,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA]}}:a.doubleSided?{enable:[r.DEPTH_TEST]}:{enable:[r.CULL_FACE,r.DEPTH_TEST]},m[E]={attributes:V,parameters:D,program:P,states:te,uniforms:k},g[T]={type:r.VERTEX_SHADER,uri:"",extras:{source:w}},g[x]={type:r.FRAGMENT_SHADER,uri:"",extras:{source:S}};var re=Object.keys(V);return v[P]={attributes:re,fragmentShader:x,vertexShader:T},E}function s(e,i){var n;switch(n=t(i.value)?i.value:i,e){case"ambient":return n instanceof String||"string"==typeof n?r.SAMPLER_2D:r.FLOAT_VEC4;case"diffuse":return n instanceof String||"string"==typeof n?r.SAMPLER_2D:r.FLOAT_VEC4;case"emission":return n instanceof String||"string"==typeof n?r.SAMPLER_2D:r.FLOAT_VEC4;case"specular":return n instanceof String||"string"==typeof n?r.SAMPLER_2D:r.FLOAT_VEC4;case"shininess":return r.FLOAT;case"transparency":return r.FLOAT;case"transparent":return r.BOOL;case"doubleSided":return r.BOOL}}function l(t){var r="";r+="technique:"+t.technique+";";for(var i=t.values,n=Object.keys(i).sort(),o=n.length,a=0;a<o;++a){var l=n[a];i.hasOwnProperty(l)&&"transparent"!==l&&"doubleSided"!==l&&(r+=l+":"+s(l,i[l]),r+=";")}var u=e(t.doubleSided,!1);r+=u.toString()+";";var c=e(t.transparent,!1);r+=c.toString()+";";var d=e(t.jointCount,0);return r+=d.toString()+";"}function u(r,i){if(t(r)){i=e(i,e.EMPTY_OBJECT);var o=!1,s=r.extensionsUsed;if(t(s))for(var u=s.length,c=0;c<u;++c)if("KHR_materials_common"===s[c]){o=!0,s.splice(c,1);break}if(o){t(r.programs)||(r.programs={}),t(r.shaders)||(r.shaders={}),t(r.techniques)||(r.techniques={});var d=n(r),h=t(r.extensions)&&t(r.extensions.CESIUM_RTC),p={},f=r.materials;for(var m in f)if(f.hasOwnProperty(m)){var g=f[m];if(t(g.extensions)&&t(g.extensions.KHR_materials_common)){var v=g.extensions.KHR_materials_common,_=l(v),y=p[_];t(y)||(y=a(r,v,d,{useCesiumRTCMatrixInShaders:h}),p[_]=y),g.values={};var b=v.values;for(var C in b)if(b.hasOwnProperty(C)){var w=b[C];t(w.value)?g.values[C]=w.value:g.values[C]=w}g.technique=y,delete g.extensions.KHR_materials_common}}t(r.extensions)&&delete r.extensions.KHR_materials_common}return r}}var c=0,d=0,h=0,p=0;return u}),define("Scene/ModelMesh",["../Core/defineProperties"],function(e){"use strict";function t(e,t,r){for(var i=[],n=e.primitives,o=n.length,a=0;a<o;++a){var s=n[a];i[a]=t[s.material]}this._name=e.name,this._materials=i,this._id=r}return e(t.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},materials:{get:function(){return this._materials}}}),t}),define("Scene/ModelNode",["../Core/defineProperties","../Core/Matrix4"],function(e,t){"use strict";function r(e,r,i,n,o){this._model=e,this._runtimeNode=i,this._name=r.name,this._id=n,this.useMatrix=!1,this._show=!0,this._matrix=t.clone(o)}return e(r.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=t.clone(e,this._matrix),this.useMatrix=!0;var r=this._model;r._cesiumAnimationsDirty=!0,this._runtimeNode.dirtyNumber=r._maxDirtyNumber}}}),r.prototype.setMatrix=function(e){t.clone(e,this._matrix)},r}),define("Scene/Model",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/FeatureDetection","../Core/getAbsoluteUri","../Core/getBaseUri","../Core/getMagic","../Core/getStringFromTypedArray","../Core/IndexDatatype","../Core/joinUrls","../Core/loadArrayBuffer","../Core/loadCRN","../Core/loadImage","../Core/loadImageFromTypedArray","../Core/loadKTX","../Core/loadText","../Core/Math","../Core/Matrix2","../Core/Matrix3","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Core/Quaternion","../Core/Queue","../Core/RuntimeError","../Core/Transforms","../Core/WebGLConstants","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../ThirdParty/gltfDefaults","../ThirdParty/Uri","../ThirdParty/when","./Axis","./BlendingState","./ColorBlendMode","./getAttributeOrUniformBySemantic","./getBinaryAccessor","./HeightReference","./JobType","./ModelAnimationCache","./ModelAnimationCollection","./ModelMaterial","./modelMaterialsCommon","./ModelMesh","./ModelNode","./SceneMode","./ShadowMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R,N,k,L,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe){ +"use strict";function fe(){this.vertexBuffersToCreate=new N,this.indexBuffersToCreate=new N,this.buffers={},this.pendingBufferLoads=0,this.programsToCreate=new N,this.shaders={},this.pendingShaderLoads=0,this.texturesToCreate=new N,this.pendingTextureLoads=0,this.texturesToCreateFromBufferView=new N,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.skinnedNodesIds=[]}function me(e,t){e._cachedGltf=t,e._animationIds=ve(t)}function ge(e){this._gltf=ue(Z(e.gltf)),this._bgltf=e.bgltf,this.ready=e.ready,this.modelsToLoad=[],this.count=0}function ve(e){var t=[];if(u(e)&&u(e.gltf)){var r=e.gltf.animations;for(var i in r)r.hasOwnProperty(i)&&t.push(i)}return t}function _e(t){t=l(t,l.EMPTY_OBJECT);var r=t.cacheKey;this._cacheKey=r,this._cachedGltf=void 0,this._releaseGltfJson=l(t.releaseGltfJson,!1),this._animationIds=void 0;var i;if(u(r)&&u(wr[r])&&wr[r].ready)i=wr[r],++i.count;else{var n=t.gltf;if(u(n)){if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),n instanceof Uint8Array){var o=we(n);0!==o.binaryOffset&&(n=n.subarray(o.binaryOffset)),i=new ge({gltf:o.glTF,bgltf:n,ready:!0})}else i=new ge({gltf:t.gltf,ready:!0});i.count=1,u(r)&&(wr[r]=i)}}me(this,i),this._basePath=l(t.basePath,"");var s=g(document.location.href);this._baseUri=b(s,this._basePath),this.show=l(t.show,!0),this.silhouetteColor=l(t.silhouetteColor,a.RED),this._silhouetteColor=new a,this._silhouetteColorPreviousAlpha=1,this._normalAttributeName=void 0,this.silhouetteSize=l(t.silhouetteSize,0),this.modelMatrix=I.clone(l(t.modelMatrix,I.IDENTITY)),this._modelMatrix=I.clone(this.modelMatrix),this._clampedModelMatrix=void 0,this.scale=l(t.scale,1),this._scale=this.scale,this.minimumPixelSize=l(t.minimumPixelSize,0),this._minimumPixelSize=this.minimumPixelSize,this.maximumScale=t.maximumScale,this._maximumScale=this.maximumScale,this.id=t.id,this._id=t.id,this.heightReference=l(t.heightReference,ne.NONE),this._heightReference=this.heightReference,this._heightChanged=!1,this._removeUpdateHeightCallback=void 0;var c=t.scene;this._scene=c,u(c)&&c.terrainProviderChanged.addEventListener(function(){this._heightChanged=!0},this),this.pickPrimitive=t.pickPrimitive,this._allowPicking=l(t.allowPicking,!0),this._ready=!1,this._readyPromise=J.defer(),this.activeAnimations=new se(this),this._defaultTexture=void 0,this._incrementallyLoadTextures=l(t.incrementallyLoadTextures,!0),this._asynchronous=l(t.asynchronous,!0),this.shadows=l(t.shadows,pe.ENABLED),this._shadows=this.shadows,this.color=l(t.color,a.WHITE),this._color=new a,this._colorPreviousAlpha=1,this.colorBlendMode=l(t.colorBlendMode,te.HIGHLIGHT),this.colorBlendAmount=l(t.colorBlendAmount,.5),this.debugShowBoundingVolume=l(t.debugShowBoundingVolume,!1),this._debugShowBoundingVolume=!1,this.debugWireframe=l(t.debugWireframe,!1),this._debugWireframe=!1,this._distanceDisplayCondition=t.distanceDisplayCondition,this._precreatedAttributes=t.precreatedAttributes,this._vertexShaderLoaded=t.vertexShaderLoaded,this._fragmentShaderLoaded=t.fragmentShaderLoaded,this._uniformMapLoaded=t.uniformMapLoaded,this._pickVertexShaderLoaded=t.pickVertexShaderLoaded,this._pickFragmentShaderLoaded=t.pickFragmentShaderLoaded,this._pickUniformMapLoaded=t.pickUniformMapLoaded,this._ignoreCommands=l(t.ignoreCommands,!1),this._upAxis=l(t.upAxis,$.Y),this.cull=l(t.cull,!0),this._computedModelMatrix=new I,this._initialRadius=void 0,this._boundingSphere=void 0,this._scaledBoundingSphere=new e,this._state=br.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,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._quantizedUniforms={},this._programPrimitives={},this._rendererResources={buffers:{},vertexArrays:{},programs:{},pickPrograms:{},silhouettePrograms:{},textures:{},samplers:{},renderStates:{}},this._cachedRendererResources=void 0,this._loadRendererResourcesFromCache=!1,this._cachedVertexMemorySizeInBytes=0,this._cachedTextureMemorySizeInBytes=0,this._vertexMemorySizeInBytes=0,this._textureMemorySizeInBytes=0,this._trianglesLength=0,this._nodeCommands=[],this._pickIds=[],this._rtcCenter=void 0,this._rtcCenterEye=void 0,this._rtcCenter3D=void 0,this._rtcCenter2D=void 0}function ye(e){return e.stencilBuffer}function be(e,t,r){return e.subarray(t,t+r)}function Ce(e){var t=v(e);return"glTF"===t}function we(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),r=0;r+=Sr,r+=Sr,r+=Sr;var i=t.getUint32(r,!0);r+=Sr+Sr;var n=r,o=n+i,a=_(e,n,i);return{glTF:JSON.parse(a),binaryOffset:o}}function Se(e,t,r){return e._runtime[t][r]}function Ee(e,t){var r=e.accessors[t],i=r.extensions,n=r.min,o=r.max;if(u(i)){var a=i.WEB3D_quantized_attributes;u(a)&&(n=a.decodedMin,o=a.decodedMax)}return{min:n,max:o}}function Te(t,i){for(var n=i.nodes,o=i.meshes,a=i.scenes[i.scene].nodes,s=a.length,l=[],c=new r(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),d=new r(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),h=0;h<s;++h){var p=n[a[h]];for(p._transformToRoot=ke(p),l.push(p);l.length>0;){p=l.pop();var f=p._transformToRoot,m=p.meshes;if(u(m))for(var g=m.length,v=0;v<g;++v)for(var _=o[m[v]].primitives,y=_.length,b=0;b<y;++b){var C=_[b].attributes.POSITION;if(u(C)){var w=Ee(i,C),S=r.fromArray(w.min,0,Er),E=r.fromArray(w.max,0,Tr);u(c)&&u(d)&&(I.multiplyByPoint(f,S,S),I.multiplyByPoint(f,E,E),r.minimumByComponent(c,S,c),r.maximumByComponent(d,E,d))}}for(var T=p.children,x=T.length,P=0;P<x;++P){var A=n[T[P]];A._transformToRoot=ke(A),I.multiplyTransformation(f,A._transformToRoot,A._transformToRoot),l.push(A)}delete p._transformToRoot}}var D=e.fromCornerPoints(c,d);return t._upAxis===$.Y?e.transformWithoutScale(D,$.Y_UP_TO_Z_UP,D):t._upAxis===$.X&&e.transformWithoutScale(D,$.X_UP_TO_Z_UP,D),D}function xe(e,t,r){return function(){e._state=br.FAILED,e._readyPromise.reject(new k("Failed to load "+t+": "+r))}}function Pe(e,t){return function(r){var i=e._loadResources;i.buffers[t]=new Uint8Array(r),--i.pendingBufferLoads}}function Ae(e){var t=e.gltf.buffers;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if("binary_glTF"===r||"KHR_binary_glTF"===r){var n=e._loadResources;n.buffers[r]=e._cachedGltf.bgltf}else if("arraybuffer"===i.type){++e._loadResources.pendingBufferLoads;var o=b(e._baseUri,i.uri);C(o).then(Pe(e,r)).otherwise(xe(e,"buffer",o))}}}function De(e){var t,r=e.gltf.bufferViews,i=e._loadResources.vertexBuffersToCreate;for(t in r)r.hasOwnProperty(t)&&r[t].target===F.ARRAY_BUFFER&&i.enqueue(t);var n=e._loadResources.indexBuffersToCreate,o={},a=e.gltf.accessors;for(t in a)if(a.hasOwnProperty(t)){var s=a[t],l=s.bufferView,c=r[l];c.target!==F.ELEMENT_ARRAY_BUFFER||u(o[l])||(o[l]=!0,n.enqueue({id:l,componentType:s.componentType}))}}function Ie(e,t,r){return function(i){var n=e._loadResources;n.shaders[r]={source:i,type:t,bufferView:void 0},--n.pendingShaderLoads}}function Me(e){var t=e.gltf.shaders;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(u(i.extras)&&u(i.extras.source))e._loadResources.shaders[r]={source:i.extras.source,bufferView:void 0};else if(u(i.extensions)&&u(i.extensions.KHR_binary_glTF)){var n=i.extensions.KHR_binary_glTF;e._loadResources.shaders[r]={source:void 0,bufferView:n.bufferView}}else{++e._loadResources.pendingShaderLoads;var o=b(e._baseUri,i.uri);x(o).then(Ie(e,i.type,r)).otherwise(xe(e,"shader",o))}}}function Oe(e){var t=e.gltf.programs;for(var r in t)t.hasOwnProperty(r)&&e._loadResources.programsToCreate.enqueue(r)}function Re(e,t){return function(r){var i=e._loadResources;--i.pendingTextureLoads,i.texturesToCreate.enqueue({id:t,image:r,bufferView:r.bufferView,width:r.width,height:r.height,internalFormat:r.internalFormat})}}function Ne(e,t){var r=e.gltf.images,i=e.gltf.textures;for(var n in i)if(i.hasOwnProperty(n)){var o=r[i[n].source],a=o.extras,s=void 0,l=void 0;if(u(a)&&u(a.compressedImage3DTiles)){var c=a.compressedImage3DTiles.crunch,d=a.compressedImage3DTiles.s3tc,h=a.compressedImage3DTiles.pvrtc1,p=a.compressedImage3DTiles.etc1;t.s3tc&&u(c)?u(c.extensions)&&u(c.extensions.KHR_binary_glTF)?s=c.extensions.KHR_binary_glTF:l=c.uri:t.s3tc&&u(d)?u(d.extensions)&&u(d.extensions.KHR_binary_glTF)?s=d.extensions.KHR_binary_glTF:l=d.uri:t.pvrtc&&u(h)?u(h.extensions)&&u(h.extensions.KHR_binary_glTF)?s=h.extensions.KHR_binary_glTF:l=h.uri:t.etc1&&u(p)&&(u(p.extensions)&&u(p.extensions.KHR_binary_glTF)?s=p.extensions.KHR_binary_glTF:l=p.uri)}if(u(s)||u(l)||(u(o.extensions)&&u(o.extensions.KHR_binary_glTF)?s=o.extensions.KHR_binary_glTF:l=new K(o.uri)),u(s))e._loadResources.texturesToCreateFromBufferView.enqueue({id:n,image:void 0,bufferView:s.bufferView,mimeType:s.mimeType});else{++e._loadResources.pendingTextureLoads;var f,m=b(e._baseUri,o.uri);f=xr.test(m)?T(m):Pr.test(m)?w(m):S(m),f.then(Re(e,n)).otherwise(xe(e,"image",m))}}}function ke(e){return u(e.matrix)?I.fromArray(e.matrix):I.fromTranslationQuaternionRotationScale(r.fromArray(e.translation,0,Ar),R.unpack(e.rotation,0,Dr),r.fromArray(e.scale,0,Ir))}function Le(e){var t={},r={},i=[],n=e._loadResources.skinnedNodesIds,o=e.gltf.nodes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a],l={matrix:void 0,translation:void 0,rotation:void 0,scale:void 0,computedShow:!0,transformToRoot:new I,computedMatrix:new I,dirtyNumber:0,commands:[],inverseBindMatrices:void 0,bindShapeMatrix:void 0,joints:[],computedJointMatrices:[],jointName:s.jointName,children:[],parents:[],publicNode:void 0};l.publicNode=new de(e,s,l,a,ke(s)),t[a]=l,r[s.name]=l,u(s.skin)&&(n.push(a),i.push(l))}e._runtime.nodes=t,e._runtime.nodesByName=r,e._runtime.skinnedNodes=i}function Fe(e){var t={},r={},i=e.gltf.materials,n=e._uniformMaps;for(var o in i)if(i.hasOwnProperty(o)){n[o]={uniformMap:void 0,values:void 0,jointMatrixUniformName:void 0};var a=i[o],s=new le(e,a,o);t[a.name]=s,r[o]=s}e._runtime.materialsByName=t,e._runtime.materialsById=r}function Be(e){var t={},r=e._runtime.materialsById,i=e.gltf.meshes,n=Ve(e,"WEB3D_quantized_attributes");for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];if(t[a.name]=new ce(a,r,o),n)for(var s=a.primitives,l=s.length,c=0;c<l;c++){var d=s[c],h=Ye(e,d),p=e._programPrimitives[h];u(p)||(p=[],e._programPrimitives[h]=p),p.push(d)}}e._runtime.meshesByName=t}function Ue(e,t){e._loadRendererResourcesFromCache||(Ae(e),De(e),Me(e),Oe(e),Ne(e,t)),Fe(e),Be(e),Le(e)}function Ve(e,t){var r=e._extensionsUsed;if(!u(r)){var i=e.gltf.extensionsUsed;r={};for(var n=i.length,o=0;o<n;o++)r[i[o]]=!0}return u(r[t])}function ze(e,t,r){var i=t._loadResources,n=t.gltf.bufferViews,o=n[e],a=B.createVertexBuffer({context:r,typedArray:i.getBuffer(o),usage:U.STATIC_DRAW});a.vertexArrayDestroyable=!1,t._rendererResources.buffers[e]=a,t._vertexMemorySizeInBytes+=a.sizeInBytes}function Ge(e,t,r,i){var n=r._loadResources,o=r.gltf.bufferViews,a=o[e],s=B.createIndexBuffer({context:i,typedArray:n.getBuffer(a),usage:U.STATIC_DRAW,indexDatatype:t});s.vertexArrayDestroyable=!1,r._rendererResources.buffers[e]=s,r._vertexMemorySizeInBytes+=s.sizeInBytes}function He(e,t){var r=e._loadResources;if(0===r.pendingBufferLoads){var i,n=t.context,o=r.vertexBuffersToCreate,a=r.indexBuffersToCreate;if(e.asynchronous){for(;o.length>0&&(Rr.set(o.peek(),e,n),t.jobScheduler.execute(Rr,oe.BUFFER));)o.dequeue();for(;a.length>0&&(i=a.peek(),Nr.set(i.id,i.componentType,e,n),t.jobScheduler.execute(Nr,oe.BUFFER));)a.dequeue()}else{for(;o.length>0;)ze(o.dequeue(),e,n);for(;a.length>0;)i=a.dequeue(),Ge(i.id,i.componentType,e,n)}}}function We(e,t){var r,i={},n=t.length;for(r=1;r<n;++r){var o=t[r];if(/pos/i.test(o)){t[r]=t[0],t[0]=o;break}}for(r=0;r<n;++r)i[t[r]]=r;return i}function je(e,t){if(u(t.source))return t.source;var r=e._loadResources,i=e.gltf,n=i.bufferViews[t.bufferView];return _(r.getBuffer(n))}function qe(e,t,r){var i=e.indexOf(t);return e.replace(new RegExp(t,"g"),function(e,t,n){return i===t?e:r})}function Ye(e,t){var r=e.gltf,i=t.material,n=r.materials[i],o=n.technique,a=r.techniques[o];return a.program}function Xe(e,t){var r=e.gltf,i=r.accessors[t],n=i.extensions;if(u(n))return n.WEB3D_quantized_attributes}function Qe(e,t,r){var i=e.gltf,n=t.material,o=i.materials[n],a=o.technique,s=i.techniques[a];for(var l in s.parameters)if(s.parameters.hasOwnProperty(l)){var u=s.parameters[l].semantic;if(u===r){var c=s.attributes;for(var d in c)if(c.hasOwnProperty(d)){var h=c[d];if(h===l)return d}}}}function Ze(e,t,r,i){var n={};r._quantizedUniforms[t]=n;for(var o=r._programPrimitives[t],a=0;a<o.length;a++){var s=o[a];if(Ye(r,s)===t)for(var l in s.attributes)if(s.attributes.hasOwnProperty(l)){var c="gltf_u_dec_"+l.toLowerCase(),d=c+"_scale",h=c+"_translate";if(!u(n[c])&&!u(n[d])){var p=s.attributes[l],f=Xe(r,p);if(u(f)){var m=Qe(r,s,l),g=f.decodeMatrix,v="gltf_decoded_"+l,_=m.replace("a_","gltf_a_dec_"),y=Math.floor(Math.sqrt(g.length));e=qe(e,m,_);var b;b=y>2?"vec"+(y-1):"float",e=b+" "+_+";\n"+e;var C="";5===y?(e="uniform mat4 "+d+";\n"+e,e="uniform vec4 "+h+";\n"+e,C="\nvoid main() {\n "+_+" = "+d+" * "+m+" + "+h+";\n "+v+"();\n}\n",n[d]={mat:4},n[h]={vec:4}):(e="uniform mat"+y+" "+c+";\n"+e,C="\nvoid main() {\n "+_+" = "+b+"("+c+" * vec"+y+"("+m+",1.0));\n "+v+"();\n}\n",n[c]={mat:y}),e=j.replaceMain(e,v),e+=C}}}}return r._programPrimitives[t]=void 0,e}function Ke(e){var t=e.gltf;return!!u(t.asset)&&l(t.asset.premultipliedAlpha,!1)}function Je(e,t){return e=j.replaceMain(e,"gltf_blend_main"),e+="uniform vec4 gltf_color; \nuniform float gltf_colorBlend; \nvoid main() \n{ \n gltf_blend_main(); \n",t&&(e+=" float alpha = 1.0 - ceil(gl_FragColor.a) + gl_FragColor.a; \n gl_FragColor.rgb /= alpha; \n"),e+=" 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 $e(e,t,r){return u(r)&&(e=r(e,t)),e}function et(e,t,r){var i=t.gltf.programs,n=t._loadResources.shaders,o=i[e],a=We(t,o.attributes),s=je(t,n[o.vertexShader]),l=je(t,n[o.fragmentShader]),c=o.attributes.length,d=t._precreatedAttributes;if(u(d))for(var h in d)d.hasOwnProperty(h)&&(a[h]=c++);Ve(t,"WEB3D_quantized_attributes")&&(s=Ze(s,e,t,r));var p=Ke(t),f=Je(l,p),m=$e(s,e,t._vertexShaderLoaded),g=$e(f,e,t._fragmentShaderLoaded);if(t._rendererResources.programs[e]=W.fromCache({context:r,vertexShaderSource:m,fragmentShaderSource:g,attributeLocations:a}),t.allowPicking){var v=$e(s,e,t._pickVertexShaderLoaded),_=$e(l,e,t._pickFragmentShaderLoaded);t._pickFragmentShaderLoaded||(_=j.createPickFragmentShaderSource(l,"uniform")),t._rendererResources.pickPrograms[e]=W.fromCache({context:r,vertexShaderSource:v,fragmentShaderSource:_,attributeLocations:a})}}function tt(e,t){var r=e._loadResources,i=r.programsToCreate;if(0===r.pendingShaderLoads&&0===r.pendingBufferLoads){var n=t.context;if(e.asynchronous)for(;i.length>0&&(Lr.set(i.peek(),e,n),t.jobScheduler.execute(Lr,oe.PROGRAM));)i.dequeue();else for(;i.length>0;)et(i.dequeue(),e,n)}}function rt(e,t){return function(r){e.texturesToCreate.enqueue({id:t.id,image:r,bufferView:void 0}),--e.pendingBufferViewToImage}}function it(e){var t=e._loadResources;if(0===t.pendingBufferLoads)for(;t.texturesToCreateFromBufferView.length>0;){var r=t.texturesToCreateFromBufferView.dequeue(),i=e.gltf,n=i.bufferViews[r.bufferView],o=xe(e,"image","id: "+r.id+", bufferView: "+r.bufferView);if("image/ktx"===r.mimeType)T(t.getBuffer(n)).then(Re(e,r.id)).otherwise(o),++e._loadResources.pendingTextureLoads;else if("image/crn"===r.mimeType)w(t.getBuffer(n)).then(Re(e,r.id)).otherwise(o),++e._loadResources.pendingTextureLoads;else{var a=rt(t,r);E(t.getBuffer(n),r.mimeType).then(a).otherwise(o),++t.pendingBufferViewToImage}}}function nt(e,t){var r=e._loadResources;if(r.createSamplers){r.createSamplers=!1;var i=e._rendererResources.samplers,n=e.gltf.samplers;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];i[o]=new H({wrapS:a.wrapS,wrapT:a.wrapT,minificationFilter:a.minFilter,magnificationFilter:a.magFilter})}}}function ot(e,t,r){var i,n=t.gltf.textures,o=n[e.id],a=t._rendererResources.samplers,s=a[o.sampler],l=e.internalFormat,c=!(u(l)&&M.isCompressedFormat(l)||s.minificationFilter!==Y.NEAREST_MIPMAP_NEAREST&&s.minificationFilter!==Y.NEAREST_MIPMAP_LINEAR&&s.minificationFilter!==Y.LINEAR_MIPMAP_NEAREST&&s.minificationFilter!==Y.LINEAR_MIPMAP_LINEAR),d=c||s.wrapS===X.REPEAT||s.wrapS===X.MIRRORED_REPEAT||s.wrapT===X.REPEAT||s.wrapT===X.MIRRORED_REPEAT,h=e.image;if(u(l)&&o.target===F.TEXTURE_2D)i=new q({context:r,source:{arrayBufferView:e.bufferView},width:e.width,height:e.height,pixelFormat:l,sampler:s});else if(u(h)){var p=!P.isPowerOfTwo(h.width)||!P.isPowerOfTwo(h.height);if(d&&p){var f=document.createElement("canvas");f.width=P.nextPowerOfTwo(h.width),f.height=P.nextPowerOfTwo(h.height);var m=f.getContext("2d");m.drawImage(h,0,0,h.width,h.height,0,0,f.width,f.height),h=f}o.target===F.TEXTURE_2D&&(i=new q({context:r,source:h,pixelFormat:o.internalFormat,pixelDatatype:o.type,sampler:s,flipY:!1})),c&&i.generateMipmap()}t._rendererResources.textures[e.id]=i,t._textureMemorySizeInBytes+=i.sizeInBytes}function at(e,t){var r=t.context,i=e._loadResources.texturesToCreate;if(e.asynchronous)for(;i.length>0&&(Br.set(i.peek(),e,r),t.jobScheduler.execute(Br,oe.TEXTURE));)i.dequeue();else for(;i.length>0;)ot(i.dequeue(),e,r)}function st(e,t){var r,i,n=e.gltf,o=n.techniques,a=n.materials,s={},l=o[a[t.material].technique],c=l.parameters,d=l.attributes,h=e._rendererResources.programs[l.program],p=h.vertexAttributes,f=h._attributeLocations;for(r in p)if(p.hasOwnProperty(r)){var m=d[r];if(i=p[r].index,u(m)){var g=c[m];s[g.semantic]=i}}var v=e._precreatedAttributes;if(u(v))for(r in v)v.hasOwnProperty(r)&&(i=f[r],s[r]=i);return s}function lt(e,t,r){for(var i=e.length,n=0;n<i;++n)for(var o=[e[n]];o.length>0;){var a=o.pop(),s=r[a];if(s.jointName===t)return a;for(var l=s.children,u=l.length,c=0;c<u;++c)o.push(l[c])}}function ut(e,t){for(var r=e.gltf,i=r.skins,n=r.nodes,o=e._runtime.nodes,a=e._loadResources.skinnedNodesIds,s=a.length,l=0;l<s;++l){var u=a[l],c=o[u],d=n[u],h=t[d.skin];c.inverseBindMatrices=h.inverseBindMatrices,c.bindShapeMatrix=h.bindShapeMatrix;for(var p=[],f=d.skeletons,m=f.length,g=0;g<m;++g)p.push(f[g]);for(var v=i[d.skin].jointNames,_=v.length,y=0;y<_;++y){var b=v[y],C=o[lt(p,b,n)];c.joints.push(C)}}}function ct(e){var t=e._loadResources;if(0===t.pendingBufferLoads&&t.createSkins){t.createSkins=!1;var r=e.gltf,i=r.accessors,n=r.skins,o={};for(var a in n)if(n.hasOwnProperty(a)){var s,l=n[a],u=i[l.inverseBindMatrices];I.equals(l.bindShapeMatrix,I.IDENTITY)||(s=I.clone(l.bindShapeMatrix)),o[a]={inverseBindMatrices:ae.getSkinInverseBindMatrices(e,u),bindShapeMatrix:s}}ut(e,o)}}function dt(e,t,r,i){return function(n){t[r]=i.evaluate(n,t[r]),t.dirtyNumber=e._maxDirtyNumber}}function ht(e){var t=e._loadResources;if(t.finishedPendingBufferLoads()&&t.createRuntimeAnimations){t.createRuntimeAnimations=!1,e._runtime.animations={};var r=e._runtime.nodes,i=e.gltf.animations,n=e.gltf.accessors;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o],s=a.channels,l=a.parameters,u=a.samplers,c={};for(var d in l)l.hasOwnProperty(d)&&(c[d]=ae.getAnimationParameterValues(e,n[l[d]]));for(var h=Number.MAX_VALUE,p=-Number.MAX_VALUE,f=s.length,m=new Array(f),g=0;g<f;++g){var v=s[g],_=v.target,y=u[v.sampler],b=c[y.input];h=Math.min(h,b[0]),p=Math.max(p,b[b.length-1]);var C=ae.getAnimationSpline(e,o,a,v.sampler,y,c);m[g]=dt(e,r[_.id],_.path,C)}e._runtime.animations[o]={startTime:h,stopTime:p,channelEvaluators:m}}}}function pt(e,t){var r=e._loadResources;if(r.finishedBuffersCreation()&&r.finishedProgramCreation()&&r.createVertexArrays){r.createVertexArrays=!1;var i=e._rendererResources.buffers,n=e._rendererResources.vertexArrays,o=e.gltf,a=o.accessors,s=o.meshes;for(var l in s)if(s.hasOwnProperty(l))for(var c=s[l].primitives,d=c.length,h=0;h<d;++h){var p,f,m,g=c[h],v=st(e,g),_=[],y=g.attributes;for(p in y)if(y.hasOwnProperty(p)&&(f=v[p],u(f))){var b=a[y[p]];_.push({index:f,vertexBuffer:i[b.bufferView],componentsPerAttribute:ie(b).componentsPerAttribute,componentDatatype:b.componentType,normalize:!1,offsetInBytes:b.byteOffset,strideInBytes:b.byteStride})}var C=e._precreatedAttributes;if(u(C))for(p in C)C.hasOwnProperty(p)&&(f=v[p],u(f)&&(m=C[p],m.index=f,_.push(m)));var w;if(u(g.indices)){var S=a[g.indices];w=i[S.bufferView]}n[l+".primitive."+h]=new Q({context:t,attributes:_,indexBuffer:w})}}}function ft(e){var t={};t[F.BLEND]=!1,t[F.CULL_FACE]=!1,t[F.DEPTH_TEST]=!1,t[F.POLYGON_OFFSET_FILL]=!1,t[F.SCISSOR_TEST]=!1;var r,i=e.enable,n=i.length;for(r=0;r<n;++r)t[i[r]]=!0;return t}function mt(e,t){var r=e._loadResources,i=e.gltf.techniques;if(r.createRenderStates){r.createRenderStates=!1;for(var n in i)i.hasOwnProperty(n)&>(e,n,t)}}function gt(e,t,r){var i=e._rendererResources.renderStates,n=e.gltf.techniques,o=n[t],a=o.states,s=ft(a),c=l(a.functions,l.EMPTY_OBJECT),d=l(c.blendColor,[0,0,0,0]),h=l(c.blendEquationSeparate,[F.FUNC_ADD,F.FUNC_ADD]),p=l(c.blendFuncSeparate,[F.ONE,F.ZERO,F.ONE,F.ZERO]),f=l(c.colorMask,[!0,!0,!0,!0]),m=l(c.depthRange,[0,1]),g=l(c.polygonOffset,[0,0]),v=l(c.scissor,[0,0,0,0]);s[F.BLEND]&&Ke(e)&&p[0]===F.ONE&&p[1]===F.ONE_MINUS_SRC_ALPHA&&(p[0]=F.SRC_ALPHA,p[1]=F.ONE_MINUS_SRC_ALPHA,p[2]=F.SRC_ALPHA,p[3]=F.ONE_MINUS_SRC_ALPHA),i[t]=G.fromCache({frontFace:u(c.frontFace)?c.frontFace[0]:F.CCW,cull:{enabled:s[F.CULL_FACE],face:u(c.cullFace)?c.cullFace[0]:F.BACK},lineWidth:u(c.lineWidth)?c.lineWidth[0]:1,polygonOffset:{enabled:s[F.POLYGON_OFFSET_FILL],factor:g[0],units:g[1]},scissorTest:{enabled:s[F.SCISSOR_TEST],rectangle:{x:v[0],y:v[1],width:v[2],height:v[3]}},depthRange:{near:m[0],far:m[1]},depthTest:{enabled:s[F.DEPTH_TEST],func:u(c.depthFunc)?c.depthFunc[0]:F.LESS},colorMask:{red:f[0],green:f[1],blue:f[2],alpha:f[3]},depthMask:!u(c.depthMask)||c.depthMask[0],blending:{enabled:s[F.BLEND],color:{red:d[0],green:d[1],blue:d[2],alpha:d[3]},equationRgb:h[0],equationAlpha:h[1],functionSourceRgb:p[0],functionDestinationRgb:p[1],functionSourceAlpha:p[2],functionDestinationAlpha:p[3]}})}function vt(e,t){var r={value:e,clone:function(e,t){return e},func:function(){return r.value}};return r}function _t(e,r){var i={value:t.fromArray(e),clone:t.clone,func:function(){return i.value}};return i}function yt(e,t){var i={value:r.fromArray(e),clone:r.clone,func:function(){return i.value}};return i}function bt(e,t){var r={value:i.fromArray(e),clone:i.clone,func:function(){return r.value}};return r}function Ct(e,t){var r={value:A.fromColumnMajorArray(e),clone:A.clone,func:function(){return r.value}};return r}function wt(e,t){var r={value:D.fromColumnMajorArray(e),clone:D.clone,func:function(){return r.value}};return r}function St(e,t){var r={value:I.fromColumnMajorArray(e),clone:I.clone,func:function(){return r.value}};return r}function Et(e,t){this._value=void 0,this._textureId=e,this._model=t}function Tt(e,t){var r=new Et(e,t);return r.func=function(){return r.value},r}function xt(e,t,r,i){var n=t._runtime.nodes[e];return Gr[r](i,t,n)}function Pt(e,t){var r=e._loadResources;if(r.finishedProgramCreation()&&r.createUniformMaps){r.createUniformMaps=!1;var i=e.gltf,n=i.materials,o=i.techniques,a=e._uniformMaps;for(var s in n)if(n.hasOwnProperty(s)){var l,c=n[s],d=c.values,h=o[c.technique],p=h.parameters,f=h.uniforms,m={},g={};for(var v in f)if(f.hasOwnProperty(v)){var _=f[v],y=p[_];if(u(d[_])){var b=zr[y.type](d[_],e);m[v]=b.func,g[_]=b}else if(u(y.node))m[v]=xt(y.node,e,y.semantic,t.uniformState);else if(u(y.semantic))"JOINTMATRIX"!==y.semantic?m[v]=Vr[y.semantic](t.uniformState,e):l=v;else if(u(y.value)){var C=zr[y.type](y.value,e);m[v]=C.func,g[_]=C}}var w=a[s];w.uniformMap=m,w.values=g,w.jointMatrixUniformName=l}}}function At(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 Dt(e){return[e[20],e[21],e[22],e[23]]}function It(e,t,r){var i=e.gltf,n=i.accessors,o=Ye(e,t),a=e._quantizedUniforms[o],s={},l={};for(var c in t.attributes)if(t.attributes.hasOwnProperty(c)){var d=t.attributes[c],h=n[d],p=h.extensions;if(u(p)){var f=p.WEB3D_quantized_attributes;if(u(f)){var m=f.decodeMatrix,g="gltf_u_dec_"+c.toLowerCase();switch(h.type){case"SCALAR":l[g]=Ct(m,e).func,s[g]=!0;break;case"VEC2":l[g]=wt(m,e).func,s[g]=!0;break;case"VEC3":l[g]=St(m,e).func,s[g]=!0;break;case"VEC4":var v=g+"_scale",_=g+"_translate";l[v]=St(At(m),e).func,l[_]=bt(Dt(m),e).func,s[v]=!0,s[_]=!0}}}}for(var y in a)if(a.hasOwnProperty(y)&&!s[y]){var b=a[y];u(b.mat)&&(2===b.mat?l[y]=Ct(A.IDENTITY,e).func:3===b.mat?l[y]=wt(D.IDENTITY,e).func:4===b.mat&&(l[y]=St(I.IDENTITY,e).func)),u(b.vec)&&4===b.vec&&(l[y]=bt([0,0,0,0],e).func)}return l}function Mt(e){return function(){return e}}function Ot(e){return function(){return e.computedJointMatrices}}function Rt(e){return function(){return e.silhouetteColor}}function Nt(e){return function(){return e.silhouetteSize}}function kt(e){return function(){return e.color}}function Lt(e){return function(){return te.getColorBlend(e.colorBlendMode,e.colorBlendAmount)}}function Ft(e,t){switch(e.mode){case O.TRIANGLES:return t/3;case O.TRIANGLE_STRIP:case O.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Bt(t,i,n,o,a){for(var c=t._nodeCommands,d=t._pickIds,h=t.allowPicking,p=t._runtime.meshesByName,f=t._rendererResources,m=f.vertexArrays,g=f.programs,v=f.pickPrograms,_=f.renderStates,b=t._uniformMaps,C=t.gltf,w=C.accessors,S=C.meshes,E=C.techniques,T=C.materials,x=i.meshes,P=x.length,A=0;A<P;++A)for(var D=x[A],M=S[D],O=M.primitives,R=O.length,N=0;N<R;++N){var k,L=O[N],F=w[L.indices],B=T[L.material],U=E[B.technique],G=U.program,H=L.attributes.POSITION;if(u(H)){var W=Ee(C,H);k=e.fromCornerPoints(r.fromArray(W.min),r.fromArray(W.max))}var j,q,Y=m[D+".primitive."+N];if(u(F))q=F.count,j=F.byteOffset/y.getSizeInBytes(F.componentType);else{var X=w[L.attributes.POSITION];q=X.count,j=0}t._trianglesLength+=Ft(L,q);var Q=b[L.material],Z=Q.uniformMap;if(u(Q.jointMatrixUniformName)){var K={};K[Q.jointMatrixUniformName]=Ot(n),Z=s(Z,K)}if(Z=s(Z,{gltf_color:kt(t),gltf_colorBlend:Lt(t)}),u(t._uniformMapLoaded)&&(Z=t._uniformMapLoaded(Z,G,n)),Ve(t,"WEB3D_quantized_attributes")){var J=It(t,L,o);Z=s(Z,J)}var $,ee=_[B.technique],te=ee.blending.enabled,re={primitive:l(t.pickPrimitive,t),id:t.id,node:n.publicNode,mesh:p[M.name]},ie=pe.castShadows(t._shadows),ne=pe.receiveShadows(t._shadows),oe=new V({boundingVolume:new e,cull:t.cull,modelMatrix:new I,primitiveType:L.mode,vertexArray:Y,count:q,offset:j,shaderProgram:g[U.program],castShadows:ie,receiveShadows:ne,uniformMap:Z,renderState:ee,owner:re,pass:te?z.TRANSLUCENT:z.OPAQUE});if(h){var ae;if(u(t._pickFragmentShaderLoaded))ae=u(t._pickUniformMapLoaded)?t._pickUniformMapLoaded(Z):s(Z);else{var se=o.createPickId(re);d.push(se);var le={czm_pickColor:Mt(se.color)};ae=s(Z,le)}$=new V({boundingVolume:new e,cull:t.cull,modelMatrix:new I,primitiveType:L.mode,vertexArray:Y,count:q,offset:j,shaderProgram:v[U.program],uniformMap:ae,renderState:ee,owner:re,pass:te?z.TRANSLUCENT:z.OPAQUE})}var ue,ce;a||(ue=V.shallowClone(oe),ue.boundingVolume=new e,ue.modelMatrix=new I,h&&(ce=V.shallowClone($),ce.boundingVolume=new e,ce.modelMatrix=new I));var de={show:!0,boundingSphere:k,command:oe,pickCommand:$,command2D:ue,pickCommand2D:ce,silhouetteModelCommand:void 0,silhouetteModelCommand2D:void 0,silhouetteColorCommand:void 0,silhouetteColorCommand2D:void 0,translucentCommand:void 0,translucentCommand2D:void 0};n.commands.push(de),c.push(de)}}function Ut(e,t,i){var n=e._loadResources;if(n.finishedEverythingButTextureCreation()&&n.createRuntimeNodes){n.createRuntimeNodes=!1;for(var o=[],a=e._runtime.nodes,s=e.gltf,l=s.nodes,c=s.scenes[s.scene],d=c.nodes,h=d.length,p=[],f=0;f<h;++f)for(p.push({parentRuntimeNode:void 0,gltfNode:l[d[f]],id:d[f]});p.length>0;){var m=p.pop(),g=m.parentRuntimeNode,v=m.gltfNode,_=a[m.id];if(0===_.parents.length)if(u(v.matrix))_.matrix=I.fromColumnMajorArray(v.matrix);else{var y=v.rotation;_.translation=r.fromArray(v.translation),_.rotation=R.unpack(y),_.scale=r.fromArray(v.scale)}u(g)?(g.children.push(_),_.parents.push(g)):o.push(_),u(v.meshes)&&Bt(e,v,_,t,i);for(var b=v.children,C=b.length,w=0;w<C;++w)p.push({parentRuntimeNode:_,gltfNode:l[b[w]],id:b[w]})}e._runtime.rootNodes=o,e._runtime.nodes=a}}function Vt(e){var t=0;for(var r in e)e.hasOwnProperty(r)&&(t+=e[r].sizeInBytes);return t}function zt(e){var t=0;for(var r in e)e.hasOwnProperty(r)&&(t+=e[r].sizeInBytes);return t}function Gt(e,t){var r=t.context,i=t.scene3DOnly;if(e._loadRendererResourcesFromCache){var n=e._rendererResources,o=e._cachedRendererResources;n.buffers=o.buffers,n.vertexArrays=o.vertexArrays,n.programs=o.programs,n.pickPrograms=o.pickPrograms,n.silhouettePrograms=o.silhouettePrograms,n.textures=o.textures,n.samplers=o.samplers,n.renderStates=o.renderStates,u(e._precreatedAttributes)&&pt(e,r),e._cachedVertexMemorySizeInBytes+=Vt(o.buffers),e._cachedTextureMemorySizeInBytes+=zt(o.textures)}else He(e,t),tt(e,t),nt(e,r),it(e),at(e,t);ct(e),ht(e),e._loadRendererResourcesFromCache||(pt(e,r),mt(e,r)),Pt(e,r),Ut(e,r,i)}function Ht(e,t){var r=e.publicNode,i=r.matrix;r.useMatrix&&u(i)?I.clone(i,t):u(e.matrix)?I.clone(e.matrix,t):(I.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t),r.setMatrix(t))}function Wt(t,n,o,a){var s=t._maxDirtyNumber,l=t.allowPicking,c=t._runtime.rootNodes,d=c.length,h=Hr,p=t._computedModelMatrix;if(t._mode!==he.SCENE3D&&!t._ignoreCommands){var f=I.getColumn(p,3,Wr);if(i.equals(f,i.UNIT_W)){var m=t.boundingSphere.center,g=L.wgs84To2DModelMatrix(a,m,jr);p=I.multiply(g,p,jr),u(t._rtcCenter)&&(I.setTranslation(p,i.UNIT_W,p),t._rtcCenter=t._rtcCenter2D)}else p=L.basisTo2D(a,p,jr),t._rtcCenter=t._rtcCenter3D}for(var v=0;v<d;++v){var _=c[v];for(Ht(_,_.transformToRoot),h.push(_);h.length>0;){_=h.pop();var y=_.transformToRoot,b=_.commands;if(_.dirtyNumber===s||n||o){var C=I.multiplyTransformation(p,y,_.computedMatrix),w=b.length;if(w>0)for(var S=0;S<w;++S){var E=b[S],T=E.command;if(I.clone(C,T.modelMatrix),e.transform(E.boundingSphere,T.modelMatrix,T.boundingVolume),u(t._rtcCenter)&&r.add(t._rtcCenter,T.boundingVolume.center,T.boundingVolume.center),l){var x=E.pickCommand;I.clone(T.modelMatrix,x.modelMatrix),e.clone(T.boundingVolume,x.boundingVolume)}if(T=E.command2D,u(T)&&t._mode===he.SCENE2D&&(I.clone(C,T.modelMatrix),T.modelMatrix[13]-=2*P.sign(T.modelMatrix[13])*P.PI*a.ellipsoid.maximumRadius,e.transform(E.boundingSphere,T.modelMatrix,T.boundingVolume),l)){var A=E.pickCommand2D;I.clone(T.modelMatrix,A.modelMatrix),e.clone(T.boundingVolume,A.boundingVolume)}}}for(var D=_.children,M=D.length,O=0;O<M;++O){var R=D[O];R.dirtyNumber=Math.max(R.dirtyNumber,_.dirtyNumber),(R.dirtyNumber===s||o)&&(Ht(R,R.transformToRoot),I.multiplyTransformation(y,R.transformToRoot,R.transformToRoot)),h.push(R)}}}++t._maxDirtyNumber}function jt(e){for(var t=e._runtime.skinnedNodes,r=t.length,i=0;i<r;++i){var n=t[i];qr=I.inverseTransformation(n.transformToRoot,qr);for(var o=n.computedJointMatrices,a=n.joints,s=n.bindShapeMatrix,l=n.inverseBindMatrices,c=l.length,d=0;d<c;++d)u(o[d])||(o[d]=new I),o[d]=I.multiplyTransformation(qr,a[d].transformToRoot,o[d]),o[d]=I.multiplyTransformation(o[d],l[d],o[d]),u(s)&&(o[d]=I.multiplyTransformation(o[d],s,o[d]))}}function qt(e){for(var t=e._runtime.rootNodes,r=t.length,i=Hr,n=0;n<r;++n){var o=t[n];for(o.computedShow=o.publicNode.show,i.push(o);i.length>0;){o=i.pop();for(var a=o.computedShow,s=o.commands,l=s.length,u=0;u<l;++u)s[u].show=a;for(var c=o.children,d=c.length,h=0;h<d;++h){var p=c[h];p.computedShow=a&&p.publicNode.show,i.push(p)}}}}function Yt(e,t){var r=e.id;if(e._id!==r){e._id=r;for(var i=e._pickIds,n=i.length,o=0;o<n;++o)i[o].object.id=r; +}}function Xt(e){if(e._debugWireframe!==e.debugWireframe){e._debugWireframe=e.debugWireframe;for(var t=e.debugWireframe?O.LINES:O.TRIANGLES,r=e._nodeCommands,i=r.length,n=0;n<i;++n)r[n].command.primitiveType=t}}function Qt(e){if(e.debugShowBoundingVolume!==e._debugShowBoundingVolume){e._debugShowBoundingVolume=e.debugShowBoundingVolume;for(var t=e.debugShowBoundingVolume,r=e._nodeCommands,i=r.length,n=0;n<i;++n)r[n].command.debugShowBoundingVolume=t}}function Zt(e){if(e.shadows!==e._shadows){e._shadows=e.shadows;for(var t=pe.castShadows(e.shadows),r=pe.receiveShadows(e.shadows),i=e._nodeCommands,n=i.length,o=0;o<n;o++){var a=i[o];a.command.castShadows=t,a.command.receiveShadows=r}}}function Kt(e){var t=o(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=ee.ALPHA_BLEND,G.fromCache(t)}function Jt(e){var t=V.shallowClone(e);return t.pass=z.TRANSLUCENT,t.renderState=Kt(e.renderState),t}function $t(e,t){var r=t.scene3DOnly,i=e.color.alpha;if(i>0&&i<1){var n=e._nodeCommands,o=n.length;if(!u(n[0].translucentCommand))for(var a=0;a<o;++a){var s=n[a],l=s.command;if(s.translucentCommand=Jt(l),!r){var c=s.command2D;s.translucentCommand2D=Jt(c)}}}}function er(e,t){var r=e._rendererResources.programs;for(var i in r)if(r.hasOwnProperty(i)&&r[i]===t)return i}function tr(e,t,r){var i=t.vertexShaderSource.sources[0],n=t._attributeLocations,o=e._normalAttributeName;i=j.replaceMain(i,"gltf_silhouette_main"),i+="uniform float gltf_silhouetteSize; \nvoid main() \n{ \n gltf_silhouette_main(); \n vec3 n = normalize(czm_normal3D * "+o+"); \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_viewport.z; \n gl_Position = clip; \n}";var a="uniform vec4 gltf_silhouetteColor; \nvoid main() \n{ \n gl_FragColor = gltf_silhouetteColor; \n}";return W.fromCache({context:r.context,vertexShaderSource:i,fragmentShaderSource:a,attributeLocations:n})}function rr(e,t){return ye(t.context)&&e.silhouetteSize>0&&e.silhouetteColor.alpha>0&&u(e._normalAttributeName)}function ir(e){for(var t=e._nodeCommands,r=t.length,i=0;i<r;++i){var n=t[i],o=n.command;if(o.pass===z.TRANSLUCENT)return!0}return!1}function nr(e){return e.color.alpha>0&&e.color.alpha<1}function or(e){return 0===e.color.alpha}function ar(e,t){return Math.floor(e)!==Math.floor(t)||Math.ceil(e)!==Math.ceil(t)}function sr(e,t){for(var r=++Yr%255,i=ir(e)||nr(e)||e.silhouetteColor.alpha<1,n=e._rendererResources.silhouettePrograms,a=t.scene3DOnly,l=e._nodeCommands,c=l.length,d=0;d<c;++d){var h=l[d],p=h.command,f=nr(e)?h.translucentCommand:p,m=V.shallowClone(f),g=o(f.renderState);g.stencilTest={enabled:!0,frontFunction:F.ALWAYS,backFunction:F.ALWAYS,reference:r,mask:-1,frontOperation:{fail:F.KEEP,zFail:F.KEEP,zPass:F.REPLACE},backOperation:{fail:F.KEEP,zFail:F.KEEP,zPass:F.REPLACE}},or(e)&&(g.colorMask={red:!1,green:!1,blue:!1,alpha:!1},g.depthMask=!1),g=G.fromCache(g),m.renderState=g,h.silhouetteModelCommand=m;var v=V.shallowClone(p);g=o(p.renderState,!0),g.depthTest.enabled=!0,g.cull.enabled=!1,i&&(v.pass=z.TRANSLUCENT,g.depthMask=!1,g.blending=ee.ALPHA_BLEND),g.stencilTest={enabled:!0,frontFunction:F.NOTEQUAL,backFunction:F.NOTEQUAL,reference:r,mask:-1,frontOperation:{fail:F.KEEP,zFail:F.KEEP,zPass:F.KEEP},backOperation:{fail:F.KEEP,zFail:F.KEEP,zPass:F.KEEP}},g=G.fromCache(g);var _=p.shaderProgram,y=er(e,_),b=n[y];u(b)||(b=tr(e,_,t),n[y]=b);var C=s(p.uniformMap,{gltf_silhouetteColor:Rt(e),gltf_silhouetteSize:Nt(e)});if(v.renderState=g,v.shaderProgram=b,v.uniformMap=C,v.castShadows=!1,v.receiveShadows=!1,h.silhouetteColorCommand=v,!a){var w=h.command2D,S=V.shallowClone(m);S.boundingVolume=w.boundingVolume,S.modelMatrix=w.modelMatrix,h.silhouetteModelCommand2D=S;var E=V.shallowClone(v);S.boundingVolume=w.boundingVolume,S.modelMatrix=w.modelMatrix,h.silhouetteColorCommand2D=E}}}function lr(e,t){if(rr(e,t)){var r=e._nodeCommands,i=ar(e.color.alpha,e._colorPreviousAlpha)||ar(e.silhouetteColor.alpha,e._silhouetteColorPreviousAlpha)||!u(r[0].silhouetteModelCommand);e._colorPreviousAlpha=e.color.alpha,e._silhouetteColorPreviousAlpha=e.silhouetteColor.alpha,i&&sr(e,t)}}function ur(e,t,r){return Xr.center=e,Xr.radius=t,r.camera.getPixelSize(Xr,r.context.drawingBufferWidth,r.context.drawingBufferHeight)}function cr(e,t){var i=e.scale;if(0!==e.minimumPixelSize){var n=t.context,o=Math.max(n.drawingBufferWidth,n.drawingBufferHeight),a=u(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;if(Qr.x=a[12],Qr.y=a[13],Qr.z=a[14],u(e._rtcCenter)&&r.add(e._rtcCenter,Qr,Qr),e._mode!==he.SCENE3D){var s=t.mapProjection,l=s.ellipsoid.cartesianToCartographic(Qr,Zr);s.project(l,Qr),r.fromElements(Qr.z,Qr.x,Qr.y,Qr)}var c=e.boundingSphere.radius,d=ur(Qr,c,t),h=1/d,p=Math.min(h*(2*c),o);p<e.minimumPixelSize&&(i=e.minimumPixelSize*d/(2*e._initialRadius))}return u(e.maximumScale)?Math.min(e.maximumScale,i):i}function dr(e){u(e._cacheKey)&&u(e._cachedGltf)&&0===--e._cachedGltf.count&&delete wr[e._cacheKey],e._cachedGltf=void 0}function hr(e){var t=e.gltf.extensionsUsed;if(u(t))for(var r=t.length,i=0;i<r;++i){var n=t[i];if("CESIUM_RTC"!==n&&"KHR_binary_glTF"!==n&&"KHR_materials_common"!==n&&"WEB3D_quantized_attributes"!==n)throw new k("Unsupported glTF Extension: "+n)}}function pr(e,t){this.buffers=void 0,this.vertexArrays=void 0,this.programs=void 0,this.pickPrograms=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 fr(e){for(var t in e)e.hasOwnProperty(t)&&e[t].destroy()}function mr(e){fr(e.buffers),fr(e.vertexArrays),fr(e.programs),fr(e.pickPrograms),fr(e.silhouettePrograms),fr(e.textures)}function gr(e,t,r){return function(i){if(e.heightReference===ne.RELATIVE_TO_GROUND){var n=t.cartesianToCartographic(i,Zr);n.height+=r.height,t.cartographicToCartesian(n,i)}var o=e._clampedModelMatrix;I.clone(e.modelMatrix,o),o[12]=i.x,o[13]=i.y,o[14]=i.z,e._heightChanged=!0}}function vr(e){u(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);var t=e._scene;if(!u(t)||e.heightReference===ne.NONE)return void(e._clampedModelMatrix=void 0);var r=t.globe,i=r.ellipsoid,o=e.modelMatrix;Qr.x=o[12],Qr.y=o[13],Qr.z=o[14];var a=i.cartesianToCartographic(Qr);u(e._clampedModelMatrix)||(e._clampedModelMatrix=I.clone(o,new I));var s=r._surface;e._removeUpdateHeightCallback=s.updateHeight(a,gr(e,i,a));var l=r.getHeight(a);if(u(l)){var c=gr(e,i,a);n.clone(a,Zr),Zr.height=l,i.cartographicToCartesian(Zr,Qr),c(Qr)}}function _r(e,t){var i,n=e.distanceDisplayCondition,o=n.near*n.near,a=n.far*n.far;if(t.mode===he.SCENE2D){var s=t.camera.frustum.right-t.camera.frustum.left;i=.5*s,i*=i}else{var l=I.getTranslation(e.modelMatrix,Kr);if(t.mode===he.COLUMBUS_VIEW){var u=t.mapProjection,c=u.ellipsoid,d=c.cartesianToCartographic(l,Jr);l=u.project(d,l),r.fromElements(l.z,l.x,l.y,l)}i=r.distanceSquared(l,t.camera.positionWC)}return i>=o&&i<=a}if(!f.supportsTypedArrays())return{};var yr=new r,br={NEEDS_LOAD:0,LOADING:1,LOADED:2,FAILED:3},Cr="model/vnd.gltf.binary,model/vnd.gltf+json,model/gltf.binary,model/gltf+json;q=0.8,application/json;q=0.2,*/*;q=0.01";fe.prototype.getBuffer=function(e){return be(this.buffers[e.buffer],e.byteOffset,e.byteLength)},fe.prototype.finishedPendingBufferLoads=function(){return 0===this.pendingBufferLoads},fe.prototype.finishedBuffersCreation=function(){return 0===this.pendingBufferLoads&&0===this.vertexBuffersToCreate.length&&0===this.indexBuffersToCreate.length},fe.prototype.finishedProgramCreation=function(){return 0===this.pendingShaderLoads&&0===this.programsToCreate.length},fe.prototype.finishedTextureCreation=function(){var e=0===this.pendingTextureLoads,t=0===this.texturesToCreate.length&&0===this.texturesToCreateFromBufferView.length;return e&&t},fe.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 e&&t},fe.prototype.finished=function(){return this.finishedTextureCreation()&&this.finishedEverythingButTextureCreation()},c(ge.prototype,{gltf:{set:function(e){this._gltf=ue(Z(e))},get:function(){return this._gltf}},bgltf:{get:function(){return this._bgltf}}}),ge.prototype.makeReady=function(e,t){this.gltf=e,this._bgltf=t;for(var r=this.modelsToLoad,i=r.length,n=0;n<i;++n){var o=r[n];o.isDestroyed()||me(o,this)}this.modelsToLoad=void 0,this.ready=!0};var wr={};c(_e.prototype,{gltf:{get:function(){return u(this._cachedGltf)?this._cachedGltf.gltf:void 0}},releaseGltfJson:{get:function(){return this._releaseGltfJson}},cacheKey:{get:function(){return this._cacheKey}},basePath:{get:function(){return this._basePath}},boundingSphere:{get:function(){var e=this.modelMatrix;this.heightReference!==ne.NONE&&this._clampedModelMatrix&&(e=this._clampedModelMatrix);var t=I.getScale(e,yr),i=u(this.maximumScale)?Math.min(this.maximumScale,this.scale):this.scale;r.multiplyByScalar(t,i,t);var n=this._scaledBoundingSphere;return n.center=r.multiplyComponents(this._boundingSphere.center,t,n.center),n.radius=r.maximumComponent(t)*this._initialRadius,u(this._rtcCenter)&&r.add(this._rtcCenter,n.center,n.center),n}},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 u(this._loadResources)?this._loadResources.pendingTextureLoads:0}},dirty:{get:function(){return this._dirty}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=p.clone(e,this._distanceDisplayCondition)}},upAxis:{get:function(){return this._upAxis}},trianglesLength:{get:function(){return this._trianglesLength}},vertexMemorySizeInBytes:{get:function(){return this._vertexMemorySizeInBytes}},textureMemorySizeInBytes:{get:function(){return this._textureMemorySizeInBytes}},cachedVertexMemorySizeInBytes:{get:function(){return this._cachedVertexMemorySizeInBytes}},cachedTextureMemorySizeInBytes:{get:function(){return this._cachedTextureMemorySizeInBytes}}});var Sr=Uint32Array.BYTES_PER_ELEMENT;_e.silhouetteSupported=function(e){return ye(e.context)},_e.fromGltf=function(e){var t=e.url,r=l(e.cacheKey,m(t));e=o(e),e.basePath=g(t,!0),e.cacheKey=r;var i=new _e(e);e.headers=u(e.headers)?o(e.headers):{},u(e.headers.Accept)||(e.headers.Accept=Cr);var n=wr[r];return u(n)?n.ready||(++n.count,n.modelsToLoad.push(i)):(n=new ge({ready:!1}),n.count=1,n.modelsToLoad.push(i),me(i,n),wr[r]=n,C(t,e.headers).then(function(e){var t=new Uint8Array(e);if(Ce(t)){var r=we(t);0!==r.binaryOffset&&(t=t.subarray(r.binaryOffset)),n.makeReady(r.glTF,t)}else{var i=_(t);n.makeReady(JSON.parse(i))}}).otherwise(xe(i,"model",t))),i},_e._gltfCache=wr,_e.prototype.getNode=function(e){var t=Se(this,"nodesByName",e);return u(t)?t.publicNode:void 0},_e.prototype.getMesh=function(e){return Se(this,"meshesByName",e)},_e.prototype.getMaterial=function(e){return Se(this,"materialsByName",e)};var Er=new r,Tr=new r,xr=/(^data:image\/ktx)|(\.ktx$)/i,Pr=/(^data:image\/crn)|(\.crn$)/i,Ar=new r,Dr=new R,Ir=new r,Mr=function(){this.id=void 0,this.model=void 0,this.context=void 0};Mr.prototype.set=function(e,t,r){this.id=e,this.model=t,this.context=r},Mr.prototype.execute=function(){ze(this.id,this.model,this.context)};var Or=function(){this.id=void 0,this.componentType=void 0,this.model=void 0,this.context=void 0};Or.prototype.set=function(e,t,r,i){this.id=e,this.componentType=t,this.model=r,this.context=i},Or.prototype.execute=function(){Ge(this.id,this.componentType,this.model,this.context)};var Rr=new Mr,Nr=new Or,kr=function(){this.id=void 0,this.model=void 0,this.context=void 0};kr.prototype.set=function(e,t,r){this.id=e,this.model=t,this.context=r},kr.prototype.execute=function(){et(this.id,this.model,this.context)};var Lr=new kr,Fr=function(){this.gltfTexture=void 0,this.model=void 0,this.context=void 0};Fr.prototype.set=function(e,t,r){this.gltfTexture=e,this.model=t,this.context=r},Fr.prototype.execute=function(){ot(this.gltfTexture,this.model,this.context)};var Br=new Fr,Ur=new r,Vr={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 I;return function(){return u(t._rtcCenter)?(I.getTranslation(e.model,Ur),r.add(Ur,t._rtcCenter,Ur),I.multiplyByPoint(e.view,Ur,Ur),I.setTranslation(e.modelView,Ur,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}}};c(Et.prototype,{value:{get:function(){if(!u(this._value)){var e=this._model._rendererResources.textures[this._textureId];if(!u(e))return this._model._defaultTexture;this._value=e}return this._value},set:function(e){this._value=e}}}),Et.prototype.clone=function(e,t){return e},Et.prototype.func=void 0;var zr={};zr[F.FLOAT]=vt,zr[F.FLOAT_VEC2]=_t,zr[F.FLOAT_VEC3]=yt,zr[F.FLOAT_VEC4]=bt,zr[F.INT]=vt,zr[F.INT_VEC2]=_t,zr[F.INT_VEC3]=yt,zr[F.INT_VEC4]=bt,zr[F.BOOL]=vt,zr[F.BOOL_VEC2]=_t,zr[F.BOOL_VEC3]=yt,zr[F.BOOL_VEC4]=bt,zr[F.FLOAT_MAT2]=Ct,zr[F.FLOAT_MAT3]=wt,zr[F.FLOAT_MAT4]=St,zr[F.SAMPLER_2D]=Tt;var Gr={MODEL:function(e,t,r){return function(){return r.computedMatrix}},VIEW:function(e,t,r){return function(){return e.view}},PROJECTION:function(e,t,r){return function(){return e.projection}},MODELVIEW:function(e,t,r){var i=new I;return function(){return I.multiplyTransformation(e.view,r.computedMatrix,i)}},CESIUM_RTC_MODELVIEW:function(e,t,r){var i=new I;return function(){return I.multiplyTransformation(e.view,r.computedMatrix,i),I.setTranslation(i,t._rtcCenterEye,i)}},MODELVIEWPROJECTION:function(e,t,r){var i=new I;return function(){return I.multiplyTransformation(e.view,r.computedMatrix,i),I.multiply(e._projection,i,i)}},MODELINVERSE:function(e,t,r){var i=new I;return function(){return I.inverse(r.computedMatrix,i)}},VIEWINVERSE:function(e,t){return function(){return e.inverseView}},PROJECTIONINVERSE:function(e,t,r){return function(){return e.inverseProjection}},MODELVIEWINVERSE:function(e,t,r){var i=new I,n=new I;return function(){return I.multiplyTransformation(e.view,r.computedMatrix,i),I.inverse(i,n)}},MODELVIEWPROJECTIONINVERSE:function(e,t,r){var i=new I,n=new I;return function(){return I.multiplyTransformation(e.view,r.computedMatrix,i),I.multiply(e._projection,i,i),I.inverse(i,n)}},MODELINVERSETRANSPOSE:function(e,t,r){var i=new I,n=new D;return function(){return I.inverse(r.computedMatrix,i),I.getRotation(i,n),D.transpose(n,n)}},MODELVIEWINVERSETRANSPOSE:function(e,t,r){var i=new I,n=new I,o=new D;return function(){return I.multiplyTransformation(e.view,r.computedMatrix,i),I.inverse(i,n),I.getRotation(n,o),D.transpose(o,o)}},VIEWPORT:function(e,t,r){return function(){return e.viewportCartesian4}}},Hr=[],Wr=new i,jr=new I,qr=new I,Yr=0,Xr=new e,Qr=new r,Zr=new n;pr.prototype.release=function(){if(0===--this.count)return u(this.cacheKey)&&delete this.context.cache.modelRendererResourceCache[this.cacheKey],mr(this),d(this)};var Kr=new r,Jr=new n;return _e.prototype.update=function(e){if(e.mode!==he.MORPHING){var t=e.context;if(this._defaultTexture=t.defaultTexture,this._state===br.NEEDS_LOAD&&u(this.gltf)){var i,n=this.cacheKey;if(u(n)){t.cache.modelRendererResourceCache=l(t.cache.modelRendererResourceCache,{});var o=t.cache.modelRendererResourceCache;if(i=o[this.cacheKey],u(i)){if(!i.ready)return;++i.count,this._loadRendererResourcesFromCache=!0}else i=new pr(t,n),i.count=1,o[this.cacheKey]=i;this._cachedRendererResources=i}else i=new pr(t),i.count=1,this._cachedRendererResources=i;if(this._state=br.LOADING,this._boundingSphere=Te(this,this.gltf),this._initialRadius=this._boundingSphere.radius,hr(this),this._state!==br.FAILED){var a=this.gltf.extensions;if(u(a)&&u(a.CESIUM_RTC)){var s=r.fromArray(a.CESIUM_RTC.center);if(!r.equals(s,r.ZERO)){this._rtcCenter3D=s;var c=e.mapProjection,d=c.ellipsoid,h=d.cartesianToCartographic(this._rtcCenter3D),p=c.project(h);r.fromElements(p.z,p.x,p.y,p),this._rtcCenter2D=p,this._rtcCenterEye=new r,this._rtcCenter=this._rtcCenter3D}}this._loadResources=new fe,Ue(this,t)}}var f=this._loadResources,m=this._incrementallyLoadTextures,g=!1;if(this._state===br.LOADING&&(Gt(this,e),(f.finished()||m&&f.finishedEverythingButTextureCreation())&&(this._state=br.LOADED,g=!0)),u(f)&&this._state===br.LOADED&&(m&&!g&&Gt(this,e),f.finished())){this._loadResources=void 0;var v=this._rendererResources,_=this._cachedRendererResources;_.buffers=v.buffers,_.vertexArrays=v.vertexArrays,_.programs=v.programs,_.pickPrograms=v.pickPrograms,_.silhouettePrograms=v.silhouettePrograms,_.textures=v.textures,_.samplers=v.samplers,_.renderStates=v.renderStates,_.ready=!0,this._normalAttributeName=re(this.gltf,"NORMAL"),u(this._precreatedAttributes)&&(_.vertexArrays={}),this.releaseGltfJson&&dr(this)}var y=rr(this,e),b=nr(this),C=or(this),w=!u(this.distanceDisplayCondition)||_r(this,e),S=this.show&&w&&0!==this.scale&&(!C||y);if(S&&this._state===br.LOADED||g){var E=this.activeAnimations.update(e)||this._cesiumAnimationsDirty;this._cesiumAnimationsDirty=!1,this._dirty=!1;var T=this.modelMatrix,x=e.mode!==this._mode;this._mode=e.mode;var A=!I.equals(this._modelMatrix,T)||this._scale!==this.scale||this._minimumPixelSize!==this.minimumPixelSize||0!==this.minimumPixelSize||this._maximumScale!==this.maximumScale||this._heightReference!==this.heightReference||this._heightChanged||x;if(A||g){I.clone(T,this._modelMatrix),vr(this),u(this._clampedModelMatrix)&&(T=this._clampedModelMatrix),this._scale=this.scale,this._minimumPixelSize=this.minimumPixelSize,this._maximumScale=this.maximumScale,this._heightReference=this.heightReference,this._heightChanged=!1;var D=cr(this,e),M=this._computedModelMatrix;I.multiplyByUniformScale(T,D,M),this._upAxis===$.Y?I.multiplyTransformation(M,$.Y_UP_TO_Z_UP,M):this._upAxis===$.X&&I.multiplyTransformation(M,$.X_UP_TO_Z_UP,M)}(E||A||g)&&(Wt(this,A,g,e.mapProjection),this._dirty=!0,(E||g)&&jt(this)),this._perNodeShowDirty&&(this._perNodeShowDirty=!1,qt(this)),Yt(this,t),Xt(this),Qt(this),Zt(this),$t(this,e),lr(this,e)}if(g){var O=this;return void e.afterRender.push(function(){O._ready=!0,O._readyPromise.resolve(O)})}if(S&&!this._ignoreCommands){var R,N,k,L=e.passes,F=this._nodeCommands,B=F.length,U=e.mapProjection.ellipsoid.maximumRadius*P.PI;if(L.render){for(R=0;R<B;++R)if(N=F[R],N.show){var V=b?N.translucentCommand:N.command;if(V=y?N.silhouetteModelCommand:V,e.addCommand(V),k=N.command.boundingVolume,e.mode===he.SCENE2D&&(k.center.y+k.radius>U||k.center.y-k.radius<U)){var z=b?N.translucentCommand2D:N.command2D;z=y?N.silhouetteModelCommand2D:z,e.addCommand(z)}}if(y)for(R=0;R<B;++R)N=F[R],N.show&&(e.addCommand(N.silhouetteColorCommand),k=N.command.boundingVolume,e.mode===he.SCENE2D&&(k.center.y+k.radius>U||k.center.y-k.radius<U)&&e.addCommand(N.silhouetteColorCommand2D))}if(L.pick&&this.allowPicking)for(R=0;R<B;++R)if(N=F[R],N.show){var G=N.pickCommand;e.addCommand(G),k=G.boundingVolume,e.mode===he.SCENE2D&&(k.center.y+k.radius>U||k.center.y-k.radius<U)&&e.addCommand(N.pickCommand2D)}}}},_e.prototype.isDestroyed=function(){return!1},_e.prototype.destroy=function(){u(this._precreatedAttributes)&&fr(this._rendererResources.vertexArrays),this._rendererResources=void 0,this._cachedRendererResources=this._cachedRendererResources&&this._cachedRendererResources.release();for(var e=this._pickIds,t=e.length,r=0;r<t;++r)e[r].destroy();return dr(this),d(this)},_e}),define("DataSources/ModelVisualizer",["../Core/AssociativeArray","../Core/BoundingSphere","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Scene/ColorBlendMode","../Scene/HeightReference","../Scene/Model","../Scene/ModelAnimationLoop","../Scene/ShadowMode","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t,r){r.collectionChanged.addEventListener(f.prototype._onCollectionChanged,this),this._scene=t,this._primitives=t.primitives,this._entityCollection=r,this._modelHash={},this._entitiesToVisualize=new e,this._onCollectionChanged(r,r.values,[],[])}function m(e,t,r,n){var o=r[t.id];i(o)&&(n.removeAndDestroy(o.modelPrimitive),delete r[t.id])}function g(e,t){var r=t[e.id];i(r)&&(r.nodeTransformationsScratch={})}function v(e){console.error(e)}var _=1,y=0,b=!0,C=d.ENABLED,w=l.NONE,S=r.RED,E=0,T=r.WHITE,x=s.HIGHLIGHT,P=.5,A=new a,D=new a;return f.prototype.update=function(e){for(var t=this._entitiesToVisualize.values,r=this._modelHash,n=this._primitives,o=0,s=t.length;o<s;o++){var l,d,h=t[o],f=h._model,m=r[h.id],g=h.isShowing&&h.isAvailable(e)&&p.getValueOrDefault(f._show,e,!0);if(g&&(d=h._getModelMatrix(e,A),l=p.getValueOrUndefined(f._uri,e),g=i(d)&&i(l)),g){var I=i(m)?m.modelPrimitive:void 0;if(i(I)&&l===m.uri||(i(I)&&(n.removeAndDestroy(I),delete r[h.id]),I=u.fromGltf({url:l,incrementallyLoadTextures:p.getValueOrDefault(f._incrementallyLoadTextures,e,b),scene:this._scene}),I.readyPromise.otherwise(v),I.id=h,n.add(I),m={modelPrimitive:I,uri:l,animationsRunning:!1,nodeTransformationsScratch:{},originalNodeMatrixHash:{}},r[h.id]=m),I.show=!0,I.scale=p.getValueOrDefault(f._scale,e,_),I.minimumPixelSize=p.getValueOrDefault(f._minimumPixelSize,e,y),I.maximumScale=p.getValueOrUndefined(f._maximumScale,e),I.modelMatrix=a.clone(d,I.modelMatrix),I.shadows=p.getValueOrDefault(f._shadows,e,C),I.heightReference=p.getValueOrDefault(f._heightReference,e,w),I.distanceDisplayCondition=p.getValueOrUndefined(f._distanceDisplayCondition,e),I.silhouetteColor=p.getValueOrDefault(f._silhouetteColor,e,S,I._silhouetteColor),I.silhouetteSize=p.getValueOrDefault(f._silhouetteSize,e,E),I.color=p.getValueOrDefault(f._color,e,T,I._color),I.colorBlendMode=p.getValueOrDefault(f._colorBlendMode,e,x),I.colorBlendAmount=p.getValueOrDefault(f._colorBlendAmount,e,P),I.ready){var M=p.getValueOrDefault(f._runAnimations,e,!0);m.animationsRunning!==M&&(M?I.activeAnimations.addAll({loop:c.REPEAT}):I.activeAnimations.removeAll(),m.animationsRunning=M);var O=p.getValueOrUndefined(f._nodeTransformations,e,m.nodeTransformationsScratch);if(i(O))for(var R=m.originalNodeMatrixHash,N=Object.keys(O),k=0,L=N.length;k<L;++k){var F=N[k],B=O[F];if(i(B)){var U=I.getNode(F);if(i(U)){var V=R[F];i(V)||(V=U.matrix.clone(),R[F]=V);var z=a.fromTranslationRotationScale(B,D);U.matrix=a.multiply(V,z,z)}}}}}else i(m)&&(m.modelPrimitive.show=!1)}return!0},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(f.prototype._onCollectionChanged,this);for(var e=this._entitiesToVisualize.values,t=this._modelHash,r=this._primitives,i=e.length-1;i>-1;i--)m(this,e[i],t,r);return n(this)},f.prototype.getBoundingSphere=function(e,r){var n=this._modelHash[e.id];if(!i(n))return h.FAILED;var o=n.modelPrimitive;if(!i(o)||!o.show)return h.FAILED;if(!o.ready)return h.PENDING;if(o.heightReference===l.NONE)t.transform(o.boundingSphere,o.modelMatrix,r);else{if(!i(o._clampedModelMatrix))return h.PENDING;t.transform(o.boundingSphere,o._clampedModelMatrix,r)}return h.DONE},f.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s=this._entitiesToVisualize,l=this._modelHash,u=this._primitives;for(o=t.length-1;o>-1;o--)a=t[o],i(a._model)&&i(a._position)&&s.set(a.id,a);for(o=n.length-1;o>-1;o--)a=n[o],i(a._model)&&i(a._position)?(g(a,l),s.set(a.id,a)):(m(this,a,l,u),s.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],m(this,a,l,u),s.remove(a.id)},f}),define("Shaders/PolylineVS",[],function(){"use strict";return"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 czm_pickColor;\nvarying float v_angle;\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}\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_angle);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_st = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n"}),define("Scene/Polyline",["../Core/arrayRemoveDuplicates","../Core/BoundingSphere","../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/Matrix4","../Core/PolylinePipeline","./Material"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(a,s){a=n(a,n.EMPTY_OBJECT),this._show=n(a.show,!0),this._width=n(a.width,1),this._loop=n(a.loop,!1),this._distanceDisplayCondition=a.distanceDisplayCondition,this._material=a.material,o(this._material)||(this._material=d.fromType(d.ColorType,{color:new i(1,1,1,1)}));var l=a.positions;o(l)||(l=[]),this._positions=l,this._actualPositions=e(l,r.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=l.slice()),this._actualPositions.push(r.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=a.id;var h;o(s)&&(h=u.clone(s.modelMatrix)),this._modelMatrix=h,this._segments=c.wrapLongitude(this._actualPositions,h),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(b),this._polylineCollection=s,this._dirty=!1,this._pickId=void 0,this._boundingVolume=t.fromPoints(this._actualPositions),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new t}function p(e,t){++e._propertiesChanged[t];var r=e._polylineCollection;o(r)&&(r._updatePolyline(e,t),e._dirty=!0)}var f=h.POSITION_INDEX=0,m=h.SHOW_INDEX=1,g=h.WIDTH_INDEX=2,v=h.MATERIAL_INDEX=3,_=h.POSITION_SIZE_INDEX=4,y=h.DISTANCE_DISPLAY_CONDITION=5,b=h.NUMBER_OF_PROPERTIES=6;return a(h.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,p(this,m))}},positions:{get:function(){return this._positions},set:function(i){var n=e(i,r.equalsEpsilon);this._loop&&n.length>2&&(n===i&&(n=i.slice()),n.push(r.clone(n[0]))),this._actualPositions.length===n.length&&this._actualPositions.length===this._length||p(this,_),this._positions=i,this._actualPositions=n,this._length=n.length,this._boundingVolume=t.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=t.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),p(this,f),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,p(this,v))}},width:{get:function(){return this._width},set:function(e){var t=this._width;e!==t&&(this._width=e,p(this,g))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){var t=this._actualPositions;e?t.length>2&&!r.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(r.clone(t[0]))):t.length>2&&r.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,p(this,_)}}},id:{get:function(){return this._id},set:function(e){this._id=e,o(this._pickId)&&(this._pickId.object.id=e)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){l.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=l.clone(e,this._distanceDisplayCondition),p(this,y))}}}),h.prototype.update=function(){var e=u.IDENTITY;o(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);var r=this._segments.positions.length,i=this._segments.lengths,n=this._propertiesChanged[f]>0||this._propertiesChanged[_]>0;if(u.equals(e,this._modelMatrix)&&!n||(this._segments=c.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=t.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=u.clone(e,this._modelMatrix),this._segments.positions.length!==r)p(this,_);else for(var a=i.length,s=0;s<a;++s)if(i[s]!==this._segments.lengths[s]){p(this,_);break}},h.prototype.getPickId=function(e){return o(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId},h.prototype._clean=function(){this._dirty=!1;for(var e=this._propertiesChanged,t=0;t<b-1;++t)e[t]=0; +},h.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0},h}),define("Scene/PolylineCollection",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EncodedCartesian3","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/Plane","../Core/RuntimeError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/PolylineCommon","../Shaders/PolylineFS","../Shaders/PolylineVS","./BatchTable","./BlendingState","./Material","./Polyline","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R,N,k){"use strict";function L(e){e=s(e,s.EMPTY_OBJECT),this.modelMatrix=g.clone(s(e.modelMatrix,g.IDENTITY)),this._modelMatrix=g.clone(g.IDENTITY),this.debugShowBoundingVolume=s(e.debugShowBoundingVolume,!1),this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._pickCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(ie),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:b.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}function F(e,t){l(e._batchTable)&&e._batchTable.destroy();var r=[{functionName:"batchTable_getWidthAndShow",componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:a.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:a.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:a.FLOAT,componentsPerAttribute:2}];e._batchTable=new M(t,r,e._polylines.length)}function B(t,r,i,n,o){for(var a=r.context,s=r.commandList,u=i.length,c=0,d=!0,h=t._vertexArrays,p=t.debugShowBoundingVolume,f=t._batchTable,m=f.getUniformMapCallback(),g=h.length,v=0;v<g;++v)for(var _=h[v],y=_.buckets,b=y.length,C=0;C<b;++C){for(var E,T,x,P=y[C],A=P.offset,D=o?P.bucket.shaderProgram:P.bucket.pickShaderProgram,I=P.bucket.polylines,M=I.length,O=0,R=0;R<M;++R){var N=I[R],L=z(N._material);if(L!==E){if(l(E)&&O>0){var F=T.isTranslucent();c>=u?(x=new w({owner:t}),i.push(x)):x=i[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=_.va,x.renderState=F?t._translucentRS:t._opaqueRS,x.pass=F?S.TRANSLUCENT:S.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=m(T._uniforms),x.count=O,x.offset=A,A+=O,O=0,d=!0,s.push(x)}T=N._material,T.update(a),E=L}for(var B=N._locatorBuckets,U=B.length,V=0;V<U;++V){var G=B[V];G.locator===P&&(O+=G.count)}var H;r.mode===k.SCENE3D?H=N._boundingVolumeWC:r.mode===k.COLUMBUS_VIEW?H=N._boundingVolume2D:r.mode===k.SCENE2D?l(N._boundingVolume2D)&&(H=e.clone(N._boundingVolume2D,ue),H.center.x=0):l(N._boundingVolumeWC)&&l(N._boundingVolume2D)&&(H=e.union(N._boundingVolumeWC,N._boundingVolume2D,ue)),d?(d=!1,e.clone(H,le)):e.union(H,le,le)}l(E)&&O>0&&(c>=u?(x=new w({owner:t}),i.push(x)):x=i[c],++c,x.boundingVolume=e.clone(le,x.boundingVolume),x.modelMatrix=n,x.shaderProgram=D,x.vertexArray=_.va,x.renderState=T.isTranslucent()?t._translucentRS:t._opaqueRS,x.pass=T.isTranslucent()?S.TRANSLUCENT:S.OPAQUE,x.debugShowBoundingVolume=!!o&&p,x.uniformMap=m(T._uniforms),x.count=O,x.offset=A,d=!0,s.push(x)),E=void 0}i.length=c}function U(e){var t=!1,r=e._propertiesChanged,i=e._positionBufferUsage;return r[$]?i.bufferUsage!==b.STREAM_DRAW?(t=!0,i.bufferUsage=b.STREAM_DRAW,i.frameCount=100):i.frameCount=100:i.bufferUsage!==b.STATIC_DRAW&&(0===i.frameCount?(t=!0,i.bufferUsage=b.STATIC_DRAW):i.frameCount--),t}function V(e,t,r){e._createVertexArray=!1,j(e),q(e),G(e);var i,n,o=[[]],s=o[0],u=e._batchTable,c=[0],d=0,h=[[]],f=0,g=e._polylineBuckets;for(i in g)g.hasOwnProperty(i)&&(n=g[i],n.updateShader(t,u),f+=n.lengthOfPositions);if(f>0){var v,_=e._mode,C=new Float32Array(6*f*3),w=new Float32Array(4*f),S=0,E=0,T=0;for(i in g)if(g.hasOwnProperty(i)){n=g[i],n.write(C,w,S,E,T,u,t,r),_===k.MORPHING&&(l(v)||(v=new Float32Array(6*f*3)),n.writeForMorph(v,S));var x=n.lengthOfPositions;S+=6*x*3,E+=4*x,T+=4*x,d=n.updateIndices(o,c,h,d)}var A=e._positionBufferUsage.bufferUsage,D=b.STATIC_DRAW;e._positionBuffer=y.createVertexBuffer({context:t,typedArray:C,usage:A});var I;l(v)&&(I=y.createVertexBuffer({context:t,typedArray:v,usage:A})),e._texCoordExpandAndBatchIndexBuffer=y.createVertexBuffer({context:t,typedArray:w,usage:D});for(var M=3*Float32Array.BYTES_PER_ELEMENT,O=4*Float32Array.BYTES_PER_ELEMENT,R=0,N=o.length,L=0;L<N;++L)if(s=o[L],s.length>0){var F=new Uint16Array(s),B=y.createIndexBuffer({context:t,typedArray:F,usage:b.STATIC_DRAW,indexDatatype:p.UNSIGNED_SHORT});R+=c[L];var U,V,z,H,W=6*(L*(M*m.SIXTY_FOUR_KILOBYTES)-R*M),Y=M+W,X=M+Y,Q=M+X,Z=M+Q,K=M+Z,J=L*(O*m.SIXTY_FOUR_KILOBYTES)-R*O,$=[{index:ne.position3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:W,strideInBytes:6*M},{index:ne.position3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*M},{index:ne.position2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:W,strideInBytes:6*M},{index:ne.position2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Y,strideInBytes:6*M},{index:ne.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*M},{index:ne.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*M},{index:ne.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:X,strideInBytes:6*M},{index:ne.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Q,strideInBytes:6*M},{index:ne.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*M},{index:ne.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*M},{index:ne.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:Z,strideInBytes:6*M},{index:ne.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:a.FLOAT,offsetInBytes:K,strideInBytes:6*M},{index:ne.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:a.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:J}];_===k.SCENE3D?(U=e._positionBuffer,V="vertexBuffer",z=ce,H="value"):_===k.SCENE2D||_===k.COLUMBUS_VIEW?(U=ce,V="value",z=e._positionBuffer,H="vertexBuffer"):(U=I,V="vertexBuffer",z=e._positionBuffer,H="vertexBuffer"),$[0][V]=U,$[1][V]=U,$[2][H]=z,$[3][H]=z,$[4][V]=U,$[5][V]=U,$[6][H]=z,$[7][H]=z,$[8][V]=U,$[9][V]=U,$[10][H]=z,$[11][H]=z;var ee=new P({context:t,attributes:$,indexBuffer:B});e._vertexArrays.push({va:ee,buckets:h[L]})}}}function z(e){var t=R._uniformList[e.type],r=t.length;de.length=2*r;for(var i=0,n=0;n<r;++n){var o=t[n];de[i]=o,de[i+1]=e._uniforms[o](),i+=2}return e.type+":"+JSON.stringify(de)}function G(e){for(var t=e._mode,r=e._modelMatrix,i=e._polylineBuckets={},n=e._polylines,o=n.length,a=0;a<o;++a){var s=n[a];if(s._actualPositions.length>1){s.update();var u=s.material,c=i[u.type];l(c)||(c=i[u.type]=new Q(u,t,r)),c.addPolyline(s)}}}function H(e,t){var r=t.mode;e._mode===r&&g.equals(e._modelMatrix,e.modelMatrix)||(e._mode=r,e._modelMatrix=g.clone(e.modelMatrix),e._createVertexArray=!0)}function W(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;for(var t=[],r=e._polylines.length,i=0,n=0;i<r;++i){var o=e._polylines[i];l(o)&&(o._index=n++,t.push(o))}e._polylines=t}}function j(e){for(var t=e._polylines,r=t.length,i=0;i<r;++i)if(l(t[i])){var n=t[i]._bucket;l(n)&&(n.shaderProgram=n.shaderProgram&&n.shaderProgram.destroy())}}function q(e){for(var t=e._vertexArrays.length,r=0;r<t;++r)e._vertexArrays[r].va.destroy();e._vertexArrays.length=0}function Y(e){for(var t=e._polylines,r=t.length,i=0;i<r;++i)l(t[i])&&t[i]._destroy()}function X(e,t,r){this.count=e,this.offset=t,this.bucket=r}function Q(e,t,r){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.pickShaderProgram=void 0,this.mode=t,this.modelMatrix=r}function Z(e){return r.dot(r.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(v.ORIGIN_ZX_PLANE)===f.INTERSECTING}var K=N.SHOW_INDEX,J=N.WIDTH_INDEX,$=N.POSITION_INDEX,ee=N.MATERIAL_INDEX,te=N.POSITION_SIZE_INDEX,re=N.DISTANCE_DISPLAY_CONDITION,ie=N.NUMBER_OF_PROPERTIES,ne={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};u(L.prototype,{length:{get:function(){return W(this),this._polylines.length}}}),L.prototype.add=function(e){var t=new N(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t},L.prototype.remove=function(e){if(this.contains(e)){if(this._polylines[e._index]=void 0,this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){var t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),t.pickShaderProgram=t.pickShaderProgram&&t.pickShaderProgram.destroy()}return e._destroy(),!0}return!1},L.prototype.removeAll=function(){j(this),Y(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0},L.prototype.contains=function(e){return l(e)&&e._polylineCollection===this},L.prototype.get=function(e){return W(this),this._polylines[e]};var oe=new h,ae=new i,se=new t;L.prototype.update=function(e){if(W(this),0!==this._polylines.length){H(this,e);var r,n=e.context,o=e.mapProjection,a=this._propertiesChanged;if(this._createBatchTable){if(0===C.maximumVertexTextureImageUnits)throw new _("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");F(this,n),this._createBatchTable=!1}if(this._createVertexArray||U(this))V(this,n,o);else if(this._polylinesUpdated){var s=this._polylinesToUpdate;if(this._mode!==k.SCENE3D)for(var u=s.length,c=0;c<u;++c)r=s[c],r.update();if(a[te]||a[ee])V(this,n,o);else for(var d=s.length,p=this._polylineBuckets,f=0;f<d;++f){r=s[f],a=r._propertiesChanged;var m=r._bucket,v=0;for(var y in p)if(p.hasOwnProperty(y)){if(p[y]===m){a[$]&&m.writeUpdate(v,r,this._positionBuffer,o);break}v+=p[y].lengthOfPositions}if((a[K]||a[J])&&this._batchTable.setBatchedAttribute(r._index,0,new t(r._width,r._show)),this._batchTable.attributes.length>2){if(a[$]||a[te]){var b=e.mode===k.SCENE2D?r._boundingVolume2D:r._boundingVolumeWC,w=h.fromCartesian(b.center,oe),S=i.fromElements(w.low.x,w.low.y,w.low.z,b.radius,ae);this._batchTable.setBatchedAttribute(r._index,2,w.high),this._batchTable.setBatchedAttribute(r._index,3,S)}if(a[re]){var T=se;T.x=0,T.y=Number.MAX_VALUE;var x=r.distanceDisplayCondition;l(x)&&(T.x=x.near,T.y=x.far),this._batchTable.setBatchedAttribute(r._index,4,T)}}r._clean()}s.length=0,this._polylinesUpdated=!1}a=this._propertiesChanged;for(var P=0;P<ie;++P)a[P]=0;var A=g.IDENTITY;e.mode===k.SCENE3D&&(A=this.modelMatrix);var D=e.passes,I=0!==e.morphTime;if(l(this._opaqueRS)&&this._opaqueRS.depthTest.enabled===I||(this._opaqueRS=E.fromCache({depthMask:I,depthTest:{enabled:I}})),l(this._translucentRS)&&this._translucentRS.depthTest.enabled===I||(this._translucentRS=E.fromCache({blending:O.ALPHA_BLEND,depthMask:!I,depthTest:{enabled:I}})),this._batchTable.update(e),D.render){var M=this._colorCommands;B(this,e,M,A,!0)}if(D.pick){var R=this._pickCommands;B(this,e,R,A,!1)}}};var le=new e,ue=new e;L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){return q(this),j(this),Y(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),c(this)};var ce=[0,0,0],de=[];L.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,this._polylinesToUpdate.push(e),++this._propertiesChanged[t]},Q.prototype.addPolyline=function(e){var t=this.polylines;t.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this},Q.prototype.updateShader=function(e,t){if(!l(this.shaderProgram)){var r=["DISTANCE_DISPLAY_CONDITION"],i=t.getVertexShaderCallback()(I),n=new x({defines:r,sources:[A,i]}),o=new x({sources:[this.material.shaderSource,D]}),a=new x({sources:o.sources,pickColorQualifier:"varying"});this.shaderProgram=T.fromCache({context:e,vertexShaderSource:n,fragmentShaderSource:o,attributeLocations:ne}),this.pickShaderProgram=T.fromCache({context:e,vertexShaderSource:n,fragmentShaderSource:a,attributeLocations:ne})}},Q.prototype.getPolylinePositionsLength=function(e){var t;if(this.mode===k.SCENE3D||!Z(e))return t=e._actualPositions.length,4*t-4;var r=0,i=e._segments.lengths;t=i.length;for(var n=0;n<t;++n)r+=4*i[n]-4;return r};var he=new r,pe=new r,fe=new r,me=new r,ge=new i,ve=new t;Q.prototype.write=function(e,t,n,a,s,u,c,d){for(var p=this.mode,f=d.ellipsoid.maximumRadius*m.PI,g=this.polylines,v=g.length,_=0;_<v;++_){for(var y,b=g[_],C=b.width,w=b.show&&C>0,S=b._index,E=this.getSegments(b,d),T=E.positions,x=E.lengths,P=T.length,A=b.getPickId(c).color,D=0,I=0,M=0;M<P;++M){0===M?b._loop?y=T[P-2]:(y=me,r.subtract(T[0],T[1],y),r.add(T[0],y,y)):y=T[M-1],r.clone(y,pe),r.clone(T[M],he),M===P-1?b._loop?y=T[1]:(y=me,r.subtract(T[P-1],T[P-2],y),r.add(T[P-1],y,y)):y=T[M+1],r.clone(y,fe);var O=x[D];M===I+O&&(I+=O,++D);var R=M-I===0,N=M===I+x[D]-1;p===k.SCENE2D&&(pe.z=0,he.z=0,fe.z=0),p!==k.SCENE2D&&p!==k.MORPHING||(R||N)&&f-Math.abs(he.x)<1&&((he.x<0&&pe.x>0||he.x>0&&pe.x<0)&&r.clone(he,pe),(he.x<0&&fe.x>0||he.x>0&&fe.x<0)&&r.clone(he,fe));for(var L=R?2:0,F=N?2:4,B=L;B<F;++B){h.writeElements(he,e,n),h.writeElements(pe,e,n+6),h.writeElements(fe,e,n+12);var U=B-2<0?-1:1;t[s]=M/(P-1),t[s+1]=2*(B%2)-1,t[s+2]=U,t[s+3]=S,n+=18,s+=4}}var V=ge;V.x=o.floatToByte(A.red),V.y=o.floatToByte(A.green),V.z=o.floatToByte(A.blue),V.w=o.floatToByte(A.alpha);var z=ve;z.x=C,z.y=w?1:0;var G=p===k.SCENE2D?b._boundingVolume2D:b._boundingVolumeWC,H=h.fromCartesian(G.center,oe),W=H.high,j=i.fromElements(H.low.x,H.low.y,H.low.z,G.radius,ae),q=se;q.x=0,q.y=Number.MAX_VALUE;var Y=b.distanceDisplayCondition;l(Y)&&(q.x=Y.near,q.y=Y.far),u.setBatchedAttribute(S,0,z),u.setBatchedAttribute(S,1,V),u.attributes.length>2&&(u.setBatchedAttribute(S,2,W),u.setBatchedAttribute(S,3,j),u.setBatchedAttribute(S,4,q))}};var _e=new r,ye=new r,be=new r,Ce=new r;Q.prototype.writeForMorph=function(e,t){for(var i=this.modelMatrix,n=this.polylines,o=n.length,a=0;a<o;++a)for(var s=n[a],l=s._segments.positions,u=s._segments.lengths,c=l.length,d=0,p=0,f=0;f<c;++f){var m;0===f?s._loop?m=l[c-2]:(m=Ce,r.subtract(l[0],l[1],m),r.add(l[0],m,m)):m=l[f-1],m=g.multiplyByPoint(i,m,ye);var v,_=g.multiplyByPoint(i,l[f],_e);f===c-1?s._loop?v=l[1]:(v=Ce,r.subtract(l[c-1],l[c-2],v),r.add(l[c-1],v,v)):v=l[f+1],v=g.multiplyByPoint(i,v,be);var y=u[d];f===p+y&&(p+=y,++d);for(var b=f-p===0,C=f===p+u[d]-1,w=b?2:0,S=C?2:4,E=w;E<S;++E)h.writeElements(_,e,t),h.writeElements(m,e,t+6),h.writeElements(v,e,t+12),t+=18}};var we=new Array(1);Q.prototype.updateIndices=function(e,t,r,i){var n=r.length-1,o=new X(0,i,this);r[n].push(o);var a=0,s=e[e.length-1],l=0;s.length>0&&(l=s[s.length-1]+1);for(var u=this.polylines,c=u.length,d=0;d<c;++d){var h=u[d];h._locatorBuckets=[];var p;if(this.mode===k.SCENE3D){p=we;var f=h._actualPositions.length;if(!(f>0))continue;p[0]=f}else p=h._segments.lengths;var g=p.length;if(g>0){for(var v=0,_=0;_<g;++_)for(var y=p[_]-1,b=0;b<y;++b)l+4>=m.SIXTY_FOUR_KILOBYTES-2&&(h._locatorBuckets.push({locator:o,count:v}),v=0,t.push(4),s=[],e.push(s),l=0,o.count=a,a=0,i=0,o=new X(0,0,this),r[++n]=[o]),s.push(l,l+2,l+1),s.push(l+1,l+2,l+3),v+=6,a+=6,i+=6,l+=4;h._locatorBuckets.push({locator:o,count:v}),l+4>=m.SIXTY_FOUR_KILOBYTES-2&&(t.push(0),s=[],e.push(s),l=0,o.count=a,i=0,a=0,o=new X(0,0,this),r[++n]=[o])}h._clean()}return o.count=a,i},Q.prototype.getPolylineStartIndex=function(e){for(var t=this.polylines,r=0,i=t.length,n=0;n<i;++n){var o=t[n];if(o===e)break;r+=o._actualLength}return r};var Se={positions:void 0,lengths:void 0},Ee=new Array(1),Te=new r,xe=new n;Q.prototype.getSegments=function(t,i){var n=t._actualPositions;if(this.mode===k.SCENE3D)return Ee[0]=n.length,Se.positions=n,Se.lengths=Ee,Se;Z(t)&&(n=t._segments.positions);for(var o,a=i.ellipsoid,s=[],l=this.modelMatrix,u=n.length,c=Te,d=0;d<u;++d)o=n[d],c=g.multiplyByPoint(l,o,c),s.push(i.project(a.cartesianToCartographic(c,xe)));if(s.length>0){t._boundingVolume2D=e.fromPoints(s,t._boundingVolume2D);var h=t._boundingVolume2D.center;t._boundingVolume2D.center=new r(h.z,h.x,h.y)}return Se.positions=s,Se.lengths=t._segments.lengths,Se};var Pe;return Q.prototype.writeUpdate=function(e,t,i,n){var o=this.mode,a=n.ellipsoid.maximumRadius*m.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);var u=Pe,c=6*s*3;!l(u)||u.length<c?u=Pe=new Float32Array(c):u.length>c&&(u=new Float32Array(u.buffer,0,c));var d,p=this.getSegments(t,n),f=p.positions,g=p.lengths,v=0,_=0,y=0;s=f.length;for(var b=0;b<s;++b){0===b?t._loop?d=f[s-2]:(d=me,r.subtract(f[0],f[1],d),r.add(f[0],d,d)):d=f[b-1],r.clone(d,pe),r.clone(f[b],he),b===s-1?t._loop?d=f[1]:(d=me,r.subtract(f[s-1],f[s-2],d),r.add(f[s-1],d,d)):d=f[b+1],r.clone(d,fe);var C=g[_];b===y+C&&(y+=C,++_);var w=b-y===0,S=b===y+g[_]-1;o===k.SCENE2D&&(pe.z=0,he.z=0,fe.z=0),o!==k.SCENE2D&&o!==k.MORPHING||(w||S)&&a-Math.abs(he.x)<1&&((he.x<0&&pe.x>0||he.x>0&&pe.x<0)&&r.clone(he,pe),(he.x<0&&fe.x>0||he.x>0&&fe.x<0)&&r.clone(he,fe));for(var E=w?2:0,T=S?2:4,x=E;x<T;++x)h.writeElements(he,u,v),h.writeElements(pe,u,v+6),h.writeElements(fe,u,v+12),v+=18}i.copyFromArrayView(u,18*Float32Array.BYTES_PER_ELEMENT*e)}},L}),define("DataSources/ScaledPositionProperty",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/ReferenceFrame","./Property"],function(e,t,r,i,n,o,a){"use strict";function s(e){this._definitionChanged=new n,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}return t(s.prototype,{isConstant:{get:function(){return a.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return e(this._value)?this._value.referenceFrame:o.FIXED}}}),s.prototype.getValue=function(e,t){return this.getValueInReferenceFrame(e,o.FIXED,t)},s.prototype.setValue=function(t){this._value!==t&&(this._value=t,e(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),e(t)&&(this._removeSubscription=t.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))},s.prototype.getValueInReferenceFrame=function(t,r,n){if(e(this._value))return n=this._value.getValueInReferenceFrame(t,r,n),e(n)?i.WGS84.scaleToGeodeticSurface(n,n):void 0},s.prototype.equals=function(e){return this===e||e instanceof s&&this._value===e._value},s.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)},s}),define("DataSources/PathVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/JulianDate","../Core/Matrix3","../Core/Matrix4","../Core/ReferenceFrame","../Core/TimeInterval","../Core/Transforms","../Scene/PolylineCollection","../Scene/SceneMode","./CompositePositionProperty","./ConstantPositionProperty","./MaterialProperty","./Property","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionPositionProperty"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b){"use strict";function C(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function w(e,t,i,n,a,s,l,u,c){var d,h=u;d=e.getValueInReferenceFrame(t,s,c[h]),r(d)&&(c[h++]=d);for(var p,f,m,g=!r(a)||o.lessThanOrEquals(a,t)||o.greaterThanOrEquals(a,i),v=0,_=n.length,y=n[v],b=i,C=!1;v<_;){if(!g&&o.greaterThanOrEquals(y,a)&&(d=e.getValueInReferenceFrame(a,s,c[h]),r(d)&&(c[h++]=d),g=!0),o.greaterThan(y,t)&&o.lessThan(y,b)&&!y.equals(a)&&(d=e.getValueInReferenceFrame(y,s,c[h]),r(d)&&(c[h++]=d)),v<_-1){if(l>0&&!C){var w=n[v+1],S=o.secondsDifference(w,y);C=S>l,C&&(p=Math.ceil(S/l),f=0,m=S/Math.max(p,2),p=Math.max(p-1,1))}if(C&&f<p){y=o.addSeconds(y,m,new o),f++;continue}}C=!1,v++,y=n[v]}return d=e.getValueInReferenceFrame(i,s,c[h]),r(d)&&(c[h++]=d),h}function S(e,t,i,n,a,s,l,u){for(var c,d=0,h=l,p=t,f=Math.max(s,60),m=!r(n)||o.lessThanOrEquals(n,t)||o.greaterThanOrEquals(n,i);o.lessThan(p,i);)!m&&o.greaterThanOrEquals(p,n)&&(m=!0,c=e.getValueInReferenceFrame(n,a,u[h]),r(c)&&(u[h]=c,h++)),c=e.getValueInReferenceFrame(p,a,u[h]),r(c)&&(u[h]=c,h++),d++,p=o.addSeconds(t,f*d,new o);return c=e.getValueInReferenceFrame(i,a,u[h]),r(c)&&(u[h]=c,h++),h}function E(e,t,i,n,a,s,l,c){k.start=t,k.stop=i;for(var d=l,h=e.intervals,p=0;p<h.length;p++){var f=h.get(p);if(!u.intersect(f,k,R).isEmpty){var m=f.start;f.isStartIncluded||(m=f.isStopIncluded?f.stop:o.addSeconds(f.start,o.secondsDifference(f.stop,f.start)/2,new o));var g=e.getValueInReferenceFrame(m,a,c[d]);r(g)&&(c[d]=g,d++)}}return d}function T(e,t,i,n,o,a,s,l){var u=e.getValueInReferenceFrame(t,o,l[s]);return r(u)&&(l[s++]=u),s}function x(e,t,r,i,n,a,s,l){N.start=t,N.stop=r;for(var c=s,d=e.intervals,h=0;h<d.length;h++){var p=d.get(h);if(!u.intersect(p,N,R).isEmpty){var f=p.start,m=p.stop,g=t;o.greaterThan(f,g)&&(g=f);var v=r;o.lessThan(m,v)&&(v=m),c=P(p.data,g,v,i,n,a,c,l)}}return c}function P(e,t,r,i,n,o,a,s){for(;e instanceof v;)e=e.resolvedProperty;if(e instanceof _){var l=e._property._times;a=w(e,t,r,l,i,n,o,a,s)}else a=e instanceof p?x(e,t,r,i,n,o,a,s):e instanceof b?E(e,t,r,i,n,o,a,s):e instanceof f||e instanceof y&&g.isConstant(e)?T(e,t,r,i,n,o,a,s):S(e,t,r,i,n,o,a,s);return a}function A(e,t,i,n,o,a,s){r(s)||(s=[]);var l=P(e,t,i,n,o,a,0,s);return s.length=l,s}function D(e,t){this._unusedIndexes=[],this._polylineCollection=new d,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}function I(t,r){r.collectionChanged.addEventListener(I.prototype._onCollectionChanged,this),this._scene=t,this._updaters={},this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}var M=60,O=1,R=new u,N=new u,k=new u,L=new a;return D.prototype.update=function(e){if(this._referenceFrame===l.INERTIAL){var i=c.computeIcrfToFixedMatrix(e,L);r(i)||(i=c.computeTemeToPseudoFixedMatrix(e,L)),s.fromRotationTranslation(i,t.ZERO,this._polylineCollection.modelMatrix)}},D.prototype.updateObject=function(e,t){var i,n,a=t.entity,s=a._path,l=a._position,u=s._show,c=t.polyline,d=a.isShowing&&(!r(u)||u.getValue(e));if(d){var h=g.getValueOrUndefined(s._leadTime,e),p=g.getValueOrUndefined(s._trailTime,e),f=a._availability,v=r(f),_=r(h),y=r(p);if(d=v||_&&y){if(y&&(i=o.addSeconds(e,-p,new o)),_&&(n=o.addSeconds(e,h,new o)),v){var b=f.start,C=f.stop;y&&!o.greaterThan(b,i)||(i=b),_&&!o.lessThan(C,n)||(n=C)}d=o.lessThan(i,n)}}if(!d)return void(r(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0));if(!r(c)){var w=this._unusedIndexes,S=w.length;if(S>0){var E=w.pop();c=this._polylineCollection.get(E),t.index=E}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=a,t.polyline=c}var T=g.getValueOrDefault(s._resolution,e,M);c.show=!0,c.positions=A(l,i,n,e,this._referenceFrame,T,c.positions.slice()),c.material=m.getValue(e,s._material,c.material),c.width=g.getValueOrDefault(s._width,e,O),c.distanceDisplayCondition=g.getValueOrUndefined(s._distanceDisplayCondition,e,c.distanceDisplayCondition)},D.prototype.removeObject=function(e){var t=e.polyline;r(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)},D.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),i(this)},I.prototype.update=function(e){var t=this._updaters;for(var i in t)t.hasOwnProperty(i)&&t[i].update(e);for(var n=this._items.values,o=0,a=n.length;o<a;o++){var s=n[o],u=s.entity,c=u._position,d=s.updater,p=l.FIXED;this._scene.mode===h.SCENE3D&&(p=c.referenceFrame);var f=this._updaters[p];d===f&&r(f)?f.updateObject(e,s):(r(d)&&d.removeObject(s),r(f)||(f=new D(this._scene,p),f.update(e),this._updaters[p]=f),s.updater=f,r(f)&&f.updateObject(e,s))}return!0},I.prototype.isDestroyed=function(){return!1},I.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(I.prototype._onCollectionChanged,this);var e=this._updaters;for(var t in e)e.hasOwnProperty(t)&&e[t].destroy();return i(this)},I.prototype._onCollectionChanged=function(e,t,i,n){var o,a,s,l=this._items;for(o=t.length-1;o>-1;o--)a=t[o],r(a._path)&&r(a._position)&&l.set(a.id,new C(a));for(o=n.length-1;o>-1;o--)a=n[o],r(a._path)&&r(a._position)?l.contains(a.id)||l.set(a.id,new C(a)):(s=l.get(a.id),r(s)&&(s.updater.removeObject(s),l.remove(a.id)));for(o=i.length-1;o>-1;o--)a=i[o],s=l.get(a.id),r(s)&&(r(s.updater)&&s.updater.removeObject(s),l.remove(a.id))},I._subSample=A,I}),define("DataSources/PointVisualizer",["../Core/AssociativeArray","../Core/Cartesian3","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/NearFarScalar","../Scene/HeightReference","./BoundingSphereState","./Property"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(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 h(t,r){r.collectionChanged.addEventListener(h.prototype._onCollectionChanged,this),this._cluster=t,this._entityCollection=r,this._items=new e,this._onCollectionChanged(r,r.values,[],[])}function p(e,t,r){if(i(e)){var n=e.pointPrimitive;if(i(n))return e.pointPrimitive=void 0,void r.removePoint(t);var o=e.billboard;i(o)&&(e.billboard=void 0,r.removeBillboard(t))}}function f(e,t,r,i,n){return function(o){var a=document.createElement("canvas"),s=n+2*i;a.height=a.width=s;var l=a.getContext("2d");return l.clearRect(0,0,s,s),0!==i&&(l.beginPath(),l.arc(s/2,s/2,s/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=r,l.fill(),e<1&&(l.save(),l.globalCompositeOperation="destination-out",l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle="black",l.fill(),l.restore())),l.beginPath(),l.arc(s/2,s/2,n/2,0,2*Math.PI,!0),l.closePath(),l.fillStyle=t,l.fill(),a}}var m=r.WHITE,g=r.BLACK,v=0,_=1,y=0,b=new r,C=new t,w=new r,S=new s,E=new s,T=new a;return h.prototype.update=function(e){for(var t=this._items.values,n=this._cluster,o=0,a=t.length;o<a;o++){var s=t[o],u=s.entity,d=u._point,h=s.pointPrimitive,x=s.billboard,P=c.getValueOrDefault(d._heightReference,e,l.NONE),A=u.isShowing&&u.isAvailable(e)&&c.getValueOrDefault(d._show,e,!0);if(A&&(C=c.getValueOrUndefined(u._position,e,C),A=i(C)),A){c.isConstant(u._position)||(n._clusterDirty=!0);var D=!1;if(P===l.NONE||i(x)?P!==l.NONE||i(h)||(i(x)&&(p(s,u,n),x=void 0),h=n.getPoint(u),h.id=u,s.pointPrimitive=h):(i(h)&&(p(s,u,n),h=void 0),x=n.getBillboard(u),x.id=u,x.image=void 0,s.billboard=x,D=!0),i(h))h.show=!0,h.position=C,h.scaleByDistance=c.getValueOrUndefined(d._scaleByDistance,e,S),h.translucencyByDistance=c.getValueOrUndefined(d._translucencyByDistance,e,E),h.color=c.getValueOrDefault(d._color,e,m,b),h.outlineColor=c.getValueOrDefault(d._outlineColor,e,g,w),h.outlineWidth=c.getValueOrDefault(d._outlineWidth,e,v),h.pixelSize=c.getValueOrDefault(d._pixelSize,e,_),h.distanceDisplayCondition=c.getValueOrUndefined(d._distanceDisplayCondition,e,T),h.disableDepthTestDistance=c.getValueOrDefault(d._disableDepthTestDistance,e,y);else{x.show=!0,x.position=C,x.scaleByDistance=c.getValueOrUndefined(d._scaleByDistance,e,S),x.translucencyByDistance=c.getValueOrUndefined(d._translucencyByDistance,e,E),x.distanceDisplayCondition=c.getValueOrUndefined(d._distanceDisplayCondition,e,T),x.disableDepthTestDistance=c.getValueOrDefault(d._disableDepthTestDistance,e,y),x.heightReference=P;var I=c.getValueOrDefault(d._color,e,m,b),M=c.getValueOrDefault(d._outlineColor,e,g,w),O=Math.round(c.getValueOrDefault(d._outlineWidth,e,v)),R=Math.max(1,Math.round(c.getValueOrDefault(d._pixelSize,e,_)));if(O>0?(x.scale=1,D=D||O!==s.outlineWidth||R!==s.pixelSize||!r.equals(I,s.color)||!r.equals(M,s.outlineColor)):(x.scale=R/50,R=50,D=D||O!==s.outlineWidth||!r.equals(I,s.color)||!r.equals(M,s.outlineColor)),D){s.color=r.clone(I,s.color),s.outlineColor=r.clone(M,s.outlineColor),s.pixelSize=R,s.outlineWidth=O;var N=I.alpha,k=I.toCssColorString(),L=M.toCssColorString(),F=JSON.stringify([k,R,L,O]);x.setImage(F,f(N,k,L,O,R))}}}else p(s,u,n)}return!0},h.prototype.getBoundingSphere=function(e,r){var n=this._items.get(e.id);if(!i(n)||!i(n.pointPrimitive)&&!i(n.billboard))return u.FAILED;if(i(n.pointPrimitive))r.center=t.clone(n.pointPrimitive.position,r.center);else{var o=n.billboard;if(!i(o._clampedPosition))return u.PENDING;r.center=t.clone(o._clampedPosition,r.center)}return r.radius=0,u.DONE},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(h.prototype._onCollectionChanged,this);for(var e=this._entityCollection.values,t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return n(this)},h.prototype._onCollectionChanged=function(e,t,r,n){var o,a,s=this._items,l=this._cluster;for(o=t.length-1;o>-1;o--)a=t[o],i(a._point)&&i(a._position)&&s.set(a.id,new d(a));for(o=n.length-1;o>-1;o--)a=n[o],i(a._point)&&i(a._position)?s.contains(a.id)||s.set(a.id,new d(a)):(p(s.get(a.id),a,l),s.remove(a.id));for(o=r.length-1;o>-1;o--)a=r[o],p(s.get(a.id),a,l),s.remove(a.id)},h}),define("DataSources/PolygonGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/isArray","../Core/Iso8601","../Core/oneTimeWarning","../Core/PolygonGeometry","../Core/PolygonHierarchy","../Core/PolygonOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P){"use strict";function A(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}function D(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(D.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0, +this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new A(e),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}function I(e,t,r){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=r,this._options=new A(r._entity)}var M=new S(e.WHITE),O=new E(!0),R=new E(!0),N=new E(!1),k=new E(e.BLACK),L=new E(w.DISABLED),F=new E(new s),B=new e;return n(D,{perInstanceColorAppearanceType:{value:b},materialAppearanceType:{value:y}}),n(D.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&P.isConstant(this._showProperty)&&P.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&P.isConstant(this._showProperty)&&P.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),D.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},D.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},D.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),u=new v(s&&a.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=this._distanceDisplayConditionProperty.getValue(r),h=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof S){var p=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(p=this._materialProperty.color.getValue(r)),o=t.fromColor(p),n={show:u,distanceDisplayCondition:h,color:o}}else n={show:u,distanceDisplayCondition:h};return new c({id:a,geometry:new f(this._options),attributes:n})},D.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=P.getValueOrDefault(this._outlineColorProperty,r,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(r);return new c({id:i,geometry:new g(this._options),attributes:{show:new v(n&&i.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},D.prototype.isDestroyed=function(){return!1},D.prototype.destroy=function(){this._entitySubscription(),o(this)},D.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polygon"===t){var a=this._entity.polygon;if(!i(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!i(s)||!s.isConstant||s.getValue(h.MINIMUM_VALUE),u=a.perPositionHeight,c=i(u)&&(!u.isConstant||u.getValue(h.MINIMUM_VALUE)),f=a.outline,g=i(f);if(g&&f.isConstant&&(g=f.getValue(h.MINIMUM_VALUE)),!l&&!g)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var v=a.hierarchy,C=a.show;if(i(C)&&C.isConstant&&!C.getValue(h.MINIMUM_VALUE)||!i(v))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var w=r(a.material,M),E=w instanceof S;this._materialProperty=w,this._fillProperty=r(s,R),this._showProperty=r(C,O),this._showOutlineProperty=r(a.outline,N),this._outlineColorProperty=g?r(a.outlineColor,k):void 0,this._shadowsProperty=r(a.shadows,L),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,F);var T=a.height,x=a.extrudedHeight,A=a.granularity,D=a.stRotation,I=a.outlineWidth,B=l&&!i(T)&&!i(x)&&E&&!c&&_.isSupported(this._scene);g&&B&&(p(p.geometryOutlines),g=!1);var U=a.perPositionHeight,V=a.closeTop,z=a.closeBottom;if(this._fillEnabled=l,this._onTerrain=B,this._outlineEnabled=g,v.isConstant&&P.isConstant(T)&&P.isConstant(x)&&P.isConstant(A)&&P.isConstant(D)&&P.isConstant(I)&&P.isConstant(u)&&P.isConstant(U)&&P.isConstant(V)&&P.isConstant(z)&&(!B||P.isConstant(w))){var G=this._options;G.vertexFormat=E?b.VERTEX_FORMAT:y.MaterialSupport.TEXTURED.vertexFormat;var H=v.getValue(h.MINIMUM_VALUE);d(H)&&(H=new m(H));var W=P.getValueOrUndefined(T,h.MINIMUM_VALUE),j=P.getValueOrDefault(V,h.MINIMUM_VALUE,!0),q=P.getValueOrDefault(z,h.MINIMUM_VALUE,!0),Y=P.getValueOrUndefined(x,h.MINIMUM_VALUE);G.polygonHierarchy=H,G.height=W,G.extrudedHeight=Y,G.granularity=P.getValueOrUndefined(A,h.MINIMUM_VALUE),G.stRotation=P.getValueOrUndefined(D,h.MINIMUM_VALUE),G.perPositionHeight=P.getValueOrUndefined(U,h.MINIMUM_VALUE),G.closeTop=j,G.closeBottom=q,this._outlineWidth=P.getValueOrDefault(I,h.MINIMUM_VALUE,1),this._isClosed=i(Y)&&Y!==W&&j&&q,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},D.prototype.createDynamicUpdater=function(e,t){return new I(e,t,this)},I.prototype.update=function(r){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.polygon;if(l.isShowing&&l.isAvailable(r)&&P.getValueOrDefault(u.show,r,!0)){var h=this._options,p=P.getValueOrUndefined(u.hierarchy,r);if(i(p)){d(p)?h.polygonHierarchy=new m(p):h.polygonHierarchy=p;var v=P.getValueOrDefault(u.closeTop,r,!0),w=P.getValueOrDefault(u.closeBottom,r,!0);h.height=P.getValueOrUndefined(u.height,r),h.extrudedHeight=P.getValueOrUndefined(u.extrudedHeight,r),h.granularity=P.getValueOrUndefined(u.granularity,r),h.stRotation=P.getValueOrUndefined(u.stRotation,r),h.perPositionHeight=P.getValueOrUndefined(u.perPositionHeight,r),h.closeTop=v,h.closeBottom=w;var S=this._geometryUpdater.shadowsProperty.getValue(r);if(P.getValueOrDefault(u.fill,r,!0)){var E=n.fillMaterialProperty,T=x.getValue(r,E,this._material);if(this._material=T,o){var A=e.WHITE;i(E.color)&&(A=E.color.getValue(r)),this._primitive=s.add(new _({geometryInstances:new c({id:l,geometry:new f(h),attributes:{color:t.fromColor(A)}}),asynchronous:!1,shadows:S}))}else{var D=new y({material:T,translucent:T.isTranslucent(),closed:i(h.extrudedHeight)&&h.extrudedHeight!==h.height&&v&&w});h.vertexFormat=D.vertexFormat,this._primitive=a.add(new C({geometryInstances:new c({id:l,geometry:new f(h)}),appearance:D,asynchronous:!1,shadows:S}))}}if(!o&&P.getValueOrDefault(u.outline,r,!1)){h.vertexFormat=b.VERTEX_FORMAT;var I=P.getValueOrClonedDefault(u.outlineColor,r,e.BLACK,B),M=P.getValueOrDefault(u.outlineWidth,r,1),O=1!==I.alpha;this._outlinePrimitive=a.add(new C({geometryInstances:new c({id:l,geometry:new g(h),attributes:{color:t.fromColor(I)}}),appearance:new b({flat:!0,translucent:O,renderState:{lineWidth:n._scene.clampLineWidth(M)}}),asynchronous:!1,shadows:S}))}}}},I.prototype.getBoundingSphere=function(e,t){return T(e,this._primitive,this._outlinePrimitive,t)},I.prototype.isDestroyed=function(){return!1},I.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},D}),define("Shaders/Appearances/PolylineColorAppearanceVS",[],function(){"use strict";return"attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec2 expandAndWidth;\nattribute vec4 color;\nattribute float batchId;\nvarying vec4 v_color;\nvoid main()\n{\nfloat expandDir = expandAndWidth.x;\nfloat width = abs(expandAndWidth.y) + 0.5;\nbool usePrev = expandAndWidth.y < 0.0;\nvec4 p = czm_computePosition();\nvec4 prev = czm_computePrevPosition();\nvec4 next = czm_computeNextPosition();\nv_color = color;\nfloat angle;\nvec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);\ngl_Position = czm_viewportOrthographic * positionWC;\n}\n"}),define("Scene/PolylineColorAppearance",["../Core/defaultValue","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/PerInstanceFlatColorAppearanceFS","../Shaders/Appearances/PolylineColorAppearanceVS","../Shaders/PolylineCommon","./Appearance"],function(e,t,r,i,n,o,a){"use strict";function s(t){t=e(t,e.EMPTY_OBJECT);var r=e(t.translucent,!0),i=!1,n=s.VERTEX_FORMAT;this.material=void 0,this.translucent=r,this._vertexShaderSource=e(t.vertexShaderSource,l),this._fragmentShaderSource=e(t.fragmentShaderSource,u),this._renderState=a.getDefaultRenderState(r,i,t.renderState),this._closed=i,this._vertexFormat=n}var l=o+"\n"+n,u=i;return t(s.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}}}),s.VERTEX_FORMAT=r.POSITION_ONLY,s.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,s.prototype.isTranslucent=a.prototype.isTranslucent,s.prototype.getRenderState=a.prototype.getRenderState,s}),define("DataSources/PolylineGeometryUpdater",["../Core/BoundingSphere","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineGeometry","../Core/PolylinePipeline","../Core/ShowGeometryInstanceAttribute","../Scene/PolylineCollection","../Scene/PolylineColorAppearance","../Scene/PolylineMaterialAppearance","../Scene/ShadowMode","./BoundingSphereState","./ColorMaterialProperty","./ConstantProperty","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E){"use strict";function T(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.followSurface=void 0,this.granularity=void 0}function x(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(x.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new c,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._depthFailMaterialProperty=void 0,this._options=new T(e),this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}function P(e,t){var r=t._scene.id,i=A[r];!n(i)||i.isDestroyed()?(i=new g,A[r]=i,e.add(i)):e.contains(i)||e.add(i);var o=i.add();o.id=t._entity,this._line=o,this._primitives=e,this._geometryUpdater=t,this._positions=[],R.ellipsoid=t._scene.globe.ellipsoid}var A={},D=new C(t.WHITE),I=new w(!0),M=new w(y.DISABLED),O=new w(new l);o(x,{perInstanceColorAppearanceType:{value:v},materialAppearanceType:{value:_}}),o(x.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!n(this._entity.availability)&&E.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}}}),x.prototype.isOutlineVisible=function(e){return!1},x.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)},x.prototype.createFillGeometryInstance=function(e){var i,o=this._entity,a=o.isAvailable(e),s=new m(a&&o.isShowing&&this._showProperty.getValue(e)),l=this._distanceDisplayConditionProperty.getValue(e),c=u.fromDistanceDisplayCondition(l),h={show:s,distanceDisplayCondition:c};return this._materialProperty instanceof C&&(i=t.WHITE,n(this._materialProperty.color)&&(this._materialProperty.color.isConstant||a)&&(i=this._materialProperty.color.getValue(e)),h.color=r.fromColor(i)),n(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof C&&(i=t.WHITE,n(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||a)&&(i=this._depthFailMaterialProperty.color.getValue(e)),h.depthFailColor=r.fromColor(i)),new d({id:o,geometry:new p(this._options),attributes:h})},x.prototype.createOutlineGeometryInstance=function(e){},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._entitySubscription(),a(this)},x.prototype._onEntityPropertyChanged=function(e,t,r,o){if("availability"===t||"polyline"===t){var a=this._entity.polyline;if(!n(a))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.positions,l=a.show;if(n(l)&&l.isConstant&&!l.getValue(h.MINIMUM_VALUE)||!n(s))return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var u=i(a.material,D),c=u instanceof C;this._materialProperty=u,this._depthFailMaterialProperty=a.depthFailMaterial,this._showProperty=i(l,I),this._shadowsProperty=i(a.shadows,M),this._distanceDisplayConditionProperty=i(a.distanceDisplayCondition,O),this._fillEnabled=!0;var d=a.width,p=a.followSurface,f=a.granularity;if(s.isConstant&&E.isConstant(d)&&E.isConstant(p)&&E.isConstant(f)){var m=this._options,g=s.getValue(h.MINIMUM_VALUE,m.positions);if(!n(g)||g.length<2)return void(this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this)));var y;y=c&&(!n(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof C)?v.VERTEX_FORMAT:_.VERTEX_FORMAT,m.vertexFormat=y,m.positions=g,m.width=n(d)?d.getValue(h.MINIMUM_VALUE):void 0,m.followSurface=n(p)?p.getValue(h.MINIMUM_VALUE):void 0,m.granularity=n(f)?f.getValue(h.MINIMUM_VALUE):void 0,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},x.prototype.createDynamicUpdater=function(e){return new P(e,this)};var R={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};return P.prototype.update=function(e){var t=this._geometryUpdater,r=t._entity,i=r.polyline,o=this._line;if(!r.isShowing||!r.isAvailable(e)||!E.getValueOrDefault(i._show,e,!0))return void(o.show=!1);var a=i.positions,s=E.getValueOrUndefined(a,e,this._positions);if(!n(s)||s.length<2)return void(o.show=!1);var l=E.getValueOrDefault(i._followSurface,e,!0);l&&(R.positions=s,R.granularity=E.getValueOrUndefined(i._granularity,e),R.height=f.extractHeights(s,this._geometryUpdater._scene.globe.ellipsoid),s=f.generateCartesianArc(R)),o.show=!0,o.positions=s.slice(),o.material=S.getValue(e,t.fillMaterialProperty,o.material),o.width=E.getValueOrDefault(i._width,e,1),o.distanceDisplayCondition=E.getValueOrUndefined(i._distanceDisplayCondition,e,o.distanceDisplayCondition)},P.prototype.getBoundingSphere=function(t,r){var i=this._line;return i.show&&i.positions.length>0?(e.fromPoints(i.positions,r),b.DONE):b.FAILED},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){var e=this._geometryUpdater,t=e._scene.id,r=A[t];r.remove(this._line),0===r.length&&(this._primitives.removeAndDestroy(r),delete A[t]),a(this)},x}),define("DataSources/PolylineVolumeGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/PolylineVolumeGeometry","../Core/PolylineVolumeOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S){"use strict";function E(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 T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new E(e),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var P=new y(e.WHITE),A=new b(!0),D=new b(!0),I=new b(!1),M=new b(e.BLACK),O=new b(_.DISABLED),R=new b(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:m}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&S.isConstant(this._showProperty)&&S.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!0},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),u=new f(s&&a.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=this._distanceDisplayConditionProperty.getValue(r),p=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var m=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(r)),o=t.fromColor(m),n={show:u,distanceDisplayCondition:p,color:o}}else n={show:u,distanceDisplayCondition:p};return new c({id:a,geometry:new h(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=S.getValueOrDefault(this._outlineColorProperty,r,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(r);return new c({id:i,geometry:new p(this._options),attributes:{show:new f(n&&i.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"polylineVolume"===t){var a=this._entity.polylineVolume;if(!i(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!i(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.outline,c=i(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=a.positions,p=a.shape,f=a.show;if(!i(h)||!i(p)||i(f)&&f.isConstant&&!f.getValue(d.MINIMUM_VALUE))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var v=r(a.material,P),_=v instanceof y;this._materialProperty=v,this._fillProperty=r(s,D),this._showProperty=r(f,A),this._showOutlineProperty=r(a.outline,I),this._outlineColorProperty=c?r(a.outlineColor,M):void 0,this._shadowsProperty=r(a.shadows,O),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,R);var b=a.granularity,C=a.outlineWidth,w=a.cornerType;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&p.isConstant&&S.isConstant(b)&&S.isConstant(C)&&S.isConstant(w)){var E=this._options;E.vertexFormat=_?g.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,E.polylinePositions=h.getValue(d.MINIMUM_VALUE,E.polylinePositions),E.shapePositions=p.getValue(d.MINIMUM_VALUE,E.shape),E.granularity=i(b)?b.getValue(d.MINIMUM_VALUE):void 0,E.cornerType=i(w)?w.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=i(C)?C.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(r){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.polylineVolume;if(a.isShowing&&a.isAvailable(r)&&S.getValueOrDefault(s.show,r,!0)){var l=this._options,u=S.getValueOrUndefined(s.positions,r,l.polylinePositions),d=S.getValueOrUndefined(s.shape,r);if(i(u)&&i(d)){l.polylinePositions=u,l.shapePositions=d,l.granularity=S.getValueOrUndefined(s.granularity,r),l.cornerType=S.getValueOrUndefined(s.cornerType,r);var f=this._geometryUpdater.shadowsProperty.getValue(r);if(!i(s.fill)||s.fill.getValue(r)){var _=w.getValue(r,o.fillMaterialProperty,this._material);this._material=_;var y=new m({material:_,translucent:_.isTranslucent(),closed:!0});l.vertexFormat=y.vertexFormat,this._primitive=n.add(new v({geometryInstances:new c({id:a,geometry:new h(l)}),appearance:y,asynchronous:!1,shadows:f}))}if(i(s.outline)&&s.outline.getValue(r)){l.vertexFormat=g.VERTEX_FORMAT;var b=S.getValueOrClonedDefault(s.outlineColor,r,e.BLACK,N),C=S.getValueOrDefault(s.outlineWidth,r,1),E=1!==b.alpha;this._outlinePrimitive=n.add(new v({geometryInstances:new c({id:a,geometry:new p(l),attributes:{color:t.fromColor(b)}}),appearance:new g({flat:!0,translucent:E,renderState:{lineWidth:o._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:f}))}}}},x.prototype.getBoundingSphere=function(e,t){return C(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),define("DataSources/RectangleGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/oneTimeWarning","../Core/RectangleGeometry","../Core/RectangleOutlineGeometry","../Core/ShowGeometryInstanceAttribute","../Scene/GroundPrimitive","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T){"use strict";function x(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.closeBottom=void 0,this.closeTop=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0}function P(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(P.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._isClosed=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._onTerrain=!1,this._options=new x(e),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}function A(e,t,r){this._primitives=e,this._groundPrimitives=t,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=r,this._options=new x(r._entity)}var D=new C(e.WHITE),I=new w(!0),M=new w(!0),O=new w(!1),R=new w(e.BLACK),N=new w(b.DISABLED),k=new w(new s),L=new e;return n(P,{perInstanceColorAppearanceType:{value:_},materialAppearanceType:{value:v}}),n(P.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&T.isConstant(this._showProperty)&&T.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&T.isConstant(this._showProperty)&&T.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}}),P.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},P.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},P.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),u=new m(s&&a.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=this._distanceDisplayConditionProperty.getValue(r),h=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof C){var f=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(f=this._materialProperty.color.getValue(r)),o=t.fromColor(f),n={show:u,distanceDisplayCondition:h,color:o}}else n={show:u,distanceDisplayCondition:h};return new c({id:a,geometry:new p(this._options),attributes:n})},P.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=T.getValueOrDefault(this._outlineColorProperty,r,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(r);return new c({id:i,geometry:new f(this._options),attributes:{show:new m(n&&i.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},P.prototype.isDestroyed=function(){return!1},P.prototype.destroy=function(){this._entitySubscription(),o(this)},P.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"rectangle"===t){var a=this._entity.rectangle;if(!i(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!i(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.outline,c=i(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var p=a.coordinates,f=a.show;if(i(f)&&f.isConstant&&!f.getValue(d.MINIMUM_VALUE)||!i(p))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var m=r(a.material,D),y=m instanceof C;this._materialProperty=m,this._fillProperty=r(s,M),this._showProperty=r(f,I),this._showOutlineProperty=r(a.outline,O),this._outlineColorProperty=c?r(a.outlineColor,R):void 0,this._shadowsProperty=r(a.shadows,N),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,k);var b=a.height,w=a.extrudedHeight,S=a.granularity,E=a.stRotation,x=a.rotation,P=a.outlineWidth,A=a.closeBottom,L=a.closeTop,F=l&&!i(b)&&!i(w)&&y&&g.isSupported(this._scene);if(c&&F&&(h(h.geometryOutlines),c=!1),this._fillEnabled=l,this._onTerrain=F,this._outlineEnabled=c,p.isConstant&&T.isConstant(b)&&T.isConstant(w)&&T.isConstant(S)&&T.isConstant(E)&&T.isConstant(x)&&T.isConstant(P)&&T.isConstant(A)&&T.isConstant(L)&&(!F||T.isConstant(m))){var B=this._options;B.vertexFormat=y?_.VERTEX_FORMAT:v.MaterialSupport.TEXTURED.vertexFormat,B.rectangle=p.getValue(d.MINIMUM_VALUE,B.rectangle),B.height=i(b)?b.getValue(d.MINIMUM_VALUE):void 0,B.extrudedHeight=i(w)?w.getValue(d.MINIMUM_VALUE):void 0,B.granularity=i(S)?S.getValue(d.MINIMUM_VALUE):void 0,B.stRotation=i(E)?E.getValue(d.MINIMUM_VALUE):void 0,B.rotation=i(x)?x.getValue(d.MINIMUM_VALUE):void 0,B.closeBottom=i(A)?A.getValue(d.MINIMUM_VALUE):void 0,B.closeTop=i(L)?L.getValue(d.MINIMUM_VALUE):void 0,this._isClosed=i(w)&&i(B.closeTop)&&i(B.closeBottom)&&B.closeTop&&B.closeBottom,this._outlineWidth=i(P)?P.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},P.prototype.createDynamicUpdater=function(e,t){return new A(e,t,this)},A.prototype.update=function(r){var n=this._geometryUpdater,o=n._onTerrain,a=this._primitives,s=this._groundPrimitives;o?s.removeAndDestroy(this._primitive):(a.removeAndDestroy(this._primitive),a.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;var l=n._entity,u=l.rectangle;if(l.isShowing&&l.isAvailable(r)&&T.getValueOrDefault(u.show,r,!0)){var d=this._options,h=T.getValueOrUndefined(u.coordinates,r,d.rectangle); +if(i(h)){d.rectangle=h,d.height=T.getValueOrUndefined(u.height,r),d.extrudedHeight=T.getValueOrUndefined(u.extrudedHeight,r),d.granularity=T.getValueOrUndefined(u.granularity,r),d.stRotation=T.getValueOrUndefined(u.stRotation,r),d.rotation=T.getValueOrUndefined(u.rotation,r),d.closeBottom=T.getValueOrUndefined(u.closeBottom,r),d.closeTop=T.getValueOrUndefined(u.closeTop,r);var m=this._geometryUpdater.shadowsProperty.getValue(r);if(T.getValueOrDefault(u.fill,r,!0)){var b=n.fillMaterialProperty,C=E.getValue(r,b,this._material);if(this._material=C,o){var w=e.WHITE;i(b.color)&&(w=b.color.getValue(r)),this._primitive=s.add(new g({geometryInstances:new c({id:l,geometry:new p(d),attributes:{color:t.fromColor(w)}}),asynchronous:!1,shadows:m}))}else{var S=new v({material:C,translucent:C.isTranslucent(),closed:i(d.extrudedHeight)});d.vertexFormat=S.vertexFormat,this._primitive=a.add(new y({geometryInstances:new c({id:l,geometry:new p(d)}),appearance:S,asynchronous:!1,shadows:m}))}}if(!o&&T.getValueOrDefault(u.outline,r,!1)){d.vertexFormat=_.VERTEX_FORMAT;var x=T.getValueOrClonedDefault(u.outlineColor,r,e.BLACK,L),P=T.getValueOrDefault(u.outlineWidth,r,1),A=1!==x.alpha;this._outlinePrimitive=a.add(new y({geometryInstances:new c({id:l,geometry:new f(d),attributes:{color:t.fromColor(x)}}),appearance:new _({flat:!0,translucent:A,renderState:{lineWidth:n._scene.clampLineWidth(P)}}),asynchronous:!1,shadows:m}))}}}},A.prototype.getBoundingSphere=function(e,t){return S(e,this._primitive,this._outlinePrimitive,t)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){var e=this._primitives,t=this._groundPrimitives;this._geometryUpdater._onTerrain?t.removeAndDestroy(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},P}),define("DataSources/WallGeometryUpdater",["../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/DistanceDisplayCondition","../Core/DistanceDisplayConditionGeometryInstanceAttribute","../Core/Event","../Core/GeometryInstance","../Core/Iso8601","../Core/ShowGeometryInstanceAttribute","../Core/WallGeometry","../Core/WallOutlineGeometry","../Scene/MaterialAppearance","../Scene/PerInstanceColorAppearance","../Scene/Primitive","../Scene/ShadowMode","./ColorMaterialProperty","./ConstantProperty","./dynamicGeometryGetBoundingSphere","./MaterialProperty","./Property"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S){"use strict";function E(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 T(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(T.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new u,this._showProperty=void 0,this._materialProperty=void 0,this._hasConstantOutline=!0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._options=new E(e),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}function x(e,t){this._primitives=e,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=t,this._options=new E(t._entity)}var P=new y(e.WHITE),A=new b(!0),D=new b(!0),I=new b(!1),M=new b(e.BLACK),O=new b(_.DISABLED),R=new b(new s),N=new e;return n(T,{perInstanceColorAppearanceType:{value:g},materialAppearanceType:{value:m}}),n(T.prototype,{entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!i(this._entity.availability)&&S.isConstant(this._showProperty)&&S.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!i(this._entity.availability)&&S.isConstant(this._showProperty)&&S.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}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return!1}},geometryChanged:{get:function(){return this._geometryChanged}}}),T.prototype.isOutlineVisible=function(e){var t=this._entity;return this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)},T.prototype.isFilled=function(e){var t=this._entity;return this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)},T.prototype.createFillGeometryInstance=function(r){var n,o,a=this._entity,s=a.isAvailable(r),u=new h(s&&a.isShowing&&this._showProperty.getValue(r)&&this._fillProperty.getValue(r)),d=this._distanceDisplayConditionProperty.getValue(r),f=l.fromDistanceDisplayCondition(d);if(this._materialProperty instanceof y){var m=e.WHITE;i(this._materialProperty.color)&&(this._materialProperty.color.isConstant||s)&&(m=this._materialProperty.color.getValue(r)),o=t.fromColor(m),n={show:u,distanceDisplayCondition:f,color:o}}else n={show:u,distanceDisplayCondition:f};return new c({id:a,geometry:new p(this._options),attributes:n})},T.prototype.createOutlineGeometryInstance=function(r){var i=this._entity,n=i.isAvailable(r),o=S.getValueOrDefault(this._outlineColorProperty,r,e.BLACK),a=this._distanceDisplayConditionProperty.getValue(r);return new c({id:i,geometry:new f(this._options),attributes:{show:new h(n&&i.isShowing&&this._showProperty.getValue(r)&&this._showOutlineProperty.getValue(r)),color:t.fromColor(o),distanceDisplayCondition:l.fromDistanceDisplayCondition(a)}})},T.prototype.isDestroyed=function(){return!1},T.prototype.destroy=function(){this._entitySubscription(),o(this)},T.prototype._onEntityPropertyChanged=function(e,t,n,o){if("availability"===t||"wall"===t){var a=this._entity.wall;if(!i(a))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var s=a.fill,l=!i(s)||!s.isConstant||s.getValue(d.MINIMUM_VALUE),u=a.outline,c=i(u);if(c&&u.isConstant&&(c=u.getValue(d.MINIMUM_VALUE)),!l&&!c)return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var h=a.positions,p=a.show;if(i(p)&&p.isConstant&&!p.getValue(d.MINIMUM_VALUE)||!i(h))return void((this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this)));var f=r(a.material,P),v=f instanceof y;this._materialProperty=f,this._fillProperty=r(s,D),this._showProperty=r(p,A),this._showOutlineProperty=r(a.outline,I),this._outlineColorProperty=c?r(a.outlineColor,M):void 0,this._shadowsProperty=r(a.shadows,O),this._distanceDisplayConditionProperty=r(a.distanceDisplayCondition,R);var _=a.minimumHeights,b=a.maximumHeights,C=a.outlineWidth,w=a.granularity;if(this._fillEnabled=l,this._outlineEnabled=c,h.isConstant&&S.isConstant(_)&&S.isConstant(b)&&S.isConstant(C)&&S.isConstant(w)){var E=this._options;E.vertexFormat=v?g.VERTEX_FORMAT:m.MaterialSupport.TEXTURED.vertexFormat,E.positions=h.getValue(d.MINIMUM_VALUE,E.positions),E.minimumHeights=i(_)?_.getValue(d.MINIMUM_VALUE,E.minimumHeights):void 0,E.maximumHeights=i(b)?b.getValue(d.MINIMUM_VALUE,E.maximumHeights):void 0,E.granularity=i(w)?w.getValue(d.MINIMUM_VALUE):void 0,this._outlineWidth=i(C)?C.getValue(d.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}else this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this))}},T.prototype.createDynamicUpdater=function(e){return new x(e,this)},x.prototype.update=function(r){var n=this._primitives;n.removeAndDestroy(this._primitive),n.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0;var o=this._geometryUpdater,a=o._entity,s=a.wall;if(a.isShowing&&a.isAvailable(r)&&S.getValueOrDefault(s.show,r,!0)){var l=this._options,u=S.getValueOrUndefined(s.positions,r,l.positions);if(i(u)){l.positions=u,l.minimumHeights=S.getValueOrUndefined(s.minimumHeights,r,l.minimumHeights),l.maximumHeights=S.getValueOrUndefined(s.maximumHeights,r,l.maximumHeights),l.granularity=S.getValueOrUndefined(s.granularity,r);var d=this._geometryUpdater.shadowsProperty.getValue(r);if(S.getValueOrDefault(s.fill,r,!0)){var h=w.getValue(r,o.fillMaterialProperty,this._material);this._material=h;var _=new m({material:h,translucent:h.isTranslucent(),closed:i(l.extrudedHeight)});l.vertexFormat=_.vertexFormat,this._primitive=n.add(new v({geometryInstances:new c({id:a,geometry:new p(l)}),appearance:_,asynchronous:!1,shadows:d}))}if(S.getValueOrDefault(s.outline,r,!1)){l.vertexFormat=g.VERTEX_FORMAT;var y=S.getValueOrClonedDefault(s.outlineColor,r,e.BLACK,N),b=S.getValueOrDefault(s.outlineWidth,r,1),C=1!==y.alpha;this._outlinePrimitive=n.add(new v({geometryInstances:new c({id:a,geometry:new f(l),attributes:{color:t.fromColor(y)}}),appearance:new g({flat:!0,translucent:C,renderState:{lineWidth:o._scene.clampLineWidth(b)}}),asynchronous:!1,shadows:d}))}}}},x.prototype.getBoundingSphere=function(e,t){return C(e,this._primitive,this._outlinePrimitive,t)},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){var e=this._primitives;e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),o(this)},T}),define("DataSources/DataSourceDisplay",["../Core/BoundingSphere","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EventHelper","../Scene/GroundPrimitive","./BillboardVisualizer","./BoundingSphereState","./BoxGeometryUpdater","./CorridorGeometryUpdater","./CustomDataSource","./CylinderGeometryUpdater","./EllipseGeometryUpdater","./EllipsoidGeometryUpdater","./GeometryVisualizer","./LabelVisualizer","./ModelVisualizer","./PathVisualizer","./PointVisualizer","./PolygonGeometryUpdater","./PolylineGeometryUpdater","./PolylineVolumeGeometryUpdater","./RectangleGeometryUpdater","./WallGeometryUpdater"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T){"use strict";function x(e){s.initializeTerrainHeights();var r=e.scene,i=e.dataSourceCollection;this._eventHelper=new a,this._eventHelper.add(i.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(i.dataSourceRemoved,this._onDataSourceRemoved,this),this._dataSourceCollection=i,this._scene=r,this._visualizersCallback=t(e.visualizersCallback,x.defaultVisualizersCallback);for(var n=0,o=i.length;n<o;n++)this._onDataSourceAdded(i,i.get(n));var l=new h;this._onDataSourceAdded(void 0,l),this._defaultDataSource=l,this._ready=!1}x.defaultVisualizersCallback=function(e,t,r){var i=r.entities;return[new l(t,i),new g(c,e,i),new g(p,e,i),new g(d,e,i),new g(f,e,i),new g(m,e,i),new g(C,e,i),new g(w,e,i),new g(S,e,i),new g(E,e,i),new g(T,e,i),new v(t,i),new _(e,i),new b(t,i),new y(e,i)]},i(x.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}}}),x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){this._eventHelper.removeAll();for(var e=this._dataSourceCollection,t=0,r=e.length;t<r;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),n(this)},x.prototype.update=function(e){if(!s._initialized)return this._ready=!1,!1;var t,i,n,o,a=!0,l=this._dataSourceCollection,u=l.length;for(t=0;t<u;t++){var c=l.get(t);for(r(c.update)&&(a=c.update(e)&&a),n=c._visualizers,o=n.length,i=0;i<o;i++)a=n[i].update(e)&&a}for(n=this._defaultDataSource._visualizers,o=n.length,i=0;i<o;i++)a=n[i].update(e)&&a;return this._ready=a,a};var P=[],A=new e;return x.prototype.getBoundingSphere=function(t,i,n){if(!this._ready)return u.PENDING;var o,a,s=this._defaultDataSource;if(!s.entities.contains(t)){s=void 0;var l=this._dataSourceCollection;for(a=l.length,o=0;o<a;o++){var c=l.get(o);if(c.entities.contains(t)){s=c;break}}}if(!r(s))return u.FAILED;var d=P,h=A,p=0,f=u.DONE,m=s._visualizers,g=m.length;for(o=0;o<g;o++){var v=m[o];if(r(v.getBoundingSphere)){if(f=m[o].getBoundingSphere(t,h),!i&&f===u.PENDING)return u.PENDING;f===u.DONE&&(d[p]=e.clone(h,d[p]),p++)}}return 0===p?u.FAILED:(d.length=p,e.fromBoundingSpheres(d,n),u.DONE)},x.prototype._onDataSourceAdded=function(e,t){var r=this._scene,i=t.clustering;i._initialize(r),r.primitives.add(i),t._visualizers=this._visualizersCallback(r,i,t)},x.prototype._onDataSourceRemoved=function(e,t){var r=this._scene,i=t.clustering;r.primitives.remove(i);for(var n=t._visualizers,o=n.length,a=0;a<o;a++)n[a].destroy();t._visualizers=void 0},x}),define("DataSources/DynamicGeometryUpdater",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),define("DataSources/EntityView",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/HeadingPitchRange","../Core/JulianDate","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Transforms","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(t,i,n,o,a,c,p){var f=t.scene.mode,P=a.getValue(c,t._lastCartesian);if(r(P)){var A,D,I,M=!1,O=!1;if(f===h.SCENE3D){s.addSeconds(c,.001,T);var R=a.getValue(T,y);if(r(R)||(s.addSeconds(c,-.001,T),R=a.getValue(T,y),O=!0),r(R)){var N,k=d.computeFixedToIcrfMatrix(c,m),L=d.computeFixedToIcrfMatrix(T,g);r(k)&&r(L)?N=u.transpose(k,v):(N=d.computeTemeToPseudoFixedMatrix(c,v),k=u.transpose(N,m),L=d.computeTemeToPseudoFixedMatrix(T,g),u.transpose(L,L));var F=u.multiplyByVector(k,P,S),B=u.multiplyByVector(L,R,E);e.subtract(F,B,w);var U=1e3*e.magnitude(w),V=3986004418e5,z=-V/(U*U-2*V/e.magnitude(F));z<0||z>x*p.maximumRadius?(A=b,e.normalize(P,A),e.negate(A,A),I=e.clone(e.UNIT_Z,C),D=e.cross(I,A,y),e.magnitude(D)>l.EPSILON7&&(e.normalize(A,A),e.normalize(D,D),I=e.cross(A,D,C),e.normalize(I,I),M=!0)):e.equalsEpsilon(P,R,l.EPSILON7)||(I=b,e.normalize(F,I),e.normalize(B,B),D=e.cross(I,B,C),O&&(D=e.multiplyByScalar(D,-1,D)),e.equalsEpsilon(D,e.ZERO,l.EPSILON7)||(A=e.cross(D,I,y),u.multiplyByVector(N,A,A),u.multiplyByVector(N,D,D),u.multiplyByVector(N,I,I),e.normalize(A,A),e.normalize(D,D),e.normalize(I,I),M=!0))}}r(t.boundingSphere)&&(P=t.boundingSphere.center);var G,H,W;o&&(G=e.clone(i.position,w),H=e.clone(i.direction,S),W=e.clone(i.up,E));var j=_;M?(j[0]=A.x,j[1]=A.y,j[2]=A.z,j[3]=0,j[4]=D.x,j[5]=D.y,j[6]=D.z,j[7]=0,j[8]=I.x,j[9]=I.y,j[10]=I.z,j[11]=0,j[12]=P.x,j[13]=P.y,j[14]=P.z,j[15]=0):d.eastNorthUpToFixedFrame(P,p,j),i._setTransform(j),o&&(e.clone(G,i.position),e.clone(H,i.direction),e.clone(W,i.up),e.cross(H,W,i.right))}if(n){var q=f===h.SCENE2D||e.equals(t._offset3D,e.ZERO)?void 0:t._offset3D;i.lookAtTransform(i.transform,q)}}function f(r,i,n){this.entity=r,this.scene=i,this.ellipsoid=t(n,o.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new e,this._defaultOffset3D=void 0,this._offset3D=new e}var m=new u,g=new u,v=new u,_=new c,y=new e,b=new e,C=new e,w=new e,S=new e,E=new e,T=new s,x=1.25;i(f,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(t){this._defaultOffset3D=e.clone(t,new e)}}}),f.defaultOffset3D=new e(-14e3,3500,3500);var P=new a,A=new e;return f.prototype.update=function(t,i){var n=this.scene,o=this.entity,a=this.ellipsoid,s=n.mode;if(s!==h.MORPHING){var u=o.position,c=o!==this._lastEntity,d=s!==this._mode,m=this._offset3D,g=n.camera,v=c||d,_=!0;if(c){var y=o.viewFrom,b=r(y);if(!b&&r(i)){var C=n.screenSpaceCameraController;C.minimumZoomDistance=Math.min(C.minimumZoomDistance,.5*i.radius),P.pitch=-l.PI_OVER_FOUR,P.range=0;var w=u.getValue(t,A);if(r(w)){var S=2-1/Math.max(1,e.magnitude(w)/a.maximumRadius);P.pitch*=S}g.viewBoundingSphere(i,P),this.boundingSphere=i,v=!1,_=!1}else b&&r(y.getValue(t,m))||e.clone(f._defaultOffset3D,m)}else d||n.mode===h.MORPHING||this._mode===h.SCENE2D||e.clone(g.position,m);this._lastEntity=o,this._mode=n.mode!==h.MORPHING?n.mode:this._mode,n.mode!==h.MORPHING&&p(this,g,v,_,u,t,a)}},f}),!function(){function e(e,t){function r(t){var r,i=e.arcs[t<0?~t:t],n=i[0];return e.transform?(r=[0,0],i.forEach(function(e){r[0]+=e[0],r[1]+=e[1]})):r=i[i.length-1],t<0?[r,n]:[n,r]}function i(e,t){for(var r in e){var i=e[r];delete t[i.start],delete i.start,delete i.end,i.forEach(function(e){n[e<0?~e:e]=1}),s.push(i)}}var n={},o={},a={},s=[],l=-1;return t.forEach(function(r,i){var n,o=e.arcs[r<0?~r:r];o.length<3&&!o[1][0]&&!o[1][1]&&(n=t[++l],t[l]=r,t[i]=n)}),t.forEach(function(e){var t,i,n=r(e),s=n[0],l=n[1];if(t=a[s])if(delete a[t.end],t.push(e),t.end=l,i=o[l]){delete o[i.start];var u=i===t?t:t.concat(i);o[u.start=t.start]=a[u.end=i.end]=u}else o[t.start]=a[t.end]=t;else if(t=o[l])if(delete o[t.start],t.unshift(e),t.start=s,i=a[s]){delete a[i.end];var c=i===t?t:i.concat(t);o[c.start=i.start]=a[c.end=t.end]=c}else o[t.start]=a[t.end]=t;else t=[e],o[t.start=s]=a[t.end=l]=t}),i(a,o),i(o,a),t.forEach(function(e){n[e<0?~e:e]||s.push([e])}),s}function t(t,r,i){function n(e){var t=e<0?~e:e;(c[t]||(c[t]=[])).push({i:e,g:u})}function o(e){e.forEach(n)}function a(e){e.forEach(o)}function s(e){"GeometryCollection"===e.type?e.geometries.forEach(s):e.type in d&&(u=e,d[e.type](e.arcs))}var l=[];if(arguments.length>1){var u,c=[],d={LineString:o,MultiLineString:a,Polygon:a,MultiPolygon:function(e){e.forEach(a)}};s(r),c.forEach(arguments.length<3?function(e){l.push(e[0].i)}:function(e){i(e[0].g,e[e.length-1].g)&&l.push(e[0].i)})}else for(var h=0,p=t.arcs.length;h<p;++h)l.push(h);return{type:"MultiLineString",arcs:e(t,l)}}function r(t,r){function i(e){e.forEach(function(t){t.forEach(function(t){(s[t=t<0?~t:t]||(s[t]=[])).push(e)})}),l.push(e)}function o(e){return d(a(t,{type:"Polygon",arcs:[e]}).coordinates[0])>0}var s={},l=[],u=[];return r.forEach(function(e){"Polygon"===e.type?i(e.arcs):"MultiPolygon"===e.type&&e.arcs.forEach(i)}),l.forEach(function(e){if(!e._){var t=[],r=[e];for(e._=1,u.push(t);e=r.pop();)t.push(e),e.forEach(function(e){e.forEach(function(e){s[e<0?~e:e].forEach(function(e){e._||(e._=1,r.push(e))})})})}}),l.forEach(function(e){delete e._}),{type:"MultiPolygon",arcs:u.map(function(r){var i=[];if(r.forEach(function(e){e.forEach(function(e){e.forEach(function(e){s[e<0?~e:e].length<2&&i.push(e)})})}),i=e(t,i),(n=i.length)>1)for(var a,l=o(r[0][0]),u=0;u<n;++u)if(l===o(i[u])){a=i[0],i[0]=i[u],i[u]=a;break}return i})}}function i(e,t){return"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map(function(t){return o(e,t)})}:o(e,t)}function o(e,t){var r={type:"Feature",id:t.id,properties:t.properties||{},geometry:a(e,t)};return null==t.id&&delete r.id,r}function a(e,t){function r(e,t){t.length&&t.pop();for(var r,i=c[e<0?~e:e],n=0,o=i.length;n<o;++n)t.push(r=i[n].slice()),u(r,n);e<0&&s(t,o)}function i(e){return e=e.slice(),u(e,0),e}function n(e){for(var t=[],i=0,n=e.length;i<n;++i)r(e[i],t);return t.length<2&&t.push(t[0].slice()),t}function o(e){for(var t=n(e);t.length<4;)t.push(t[0].slice());return t}function a(e){return e.map(o)}function l(e){var t=e.type;return"GeometryCollection"===t?{type:t,geometries:e.geometries.map(l)}:t in d?{type:t,coordinates:d[t](e)}:null}var u=m(e.transform),c=e.arcs,d={Point:function(e){return i(e.coordinates)},MultiPoint:function(e){return e.coordinates.map(i)},LineString:function(e){return n(e.arcs)},MultiLineString:function(e){return e.arcs.map(n)},Polygon:function(e){return a(e.arcs)},MultiPolygon:function(e){return e.arcs.map(a)}};return l(t)}function s(e,t){for(var r,i=e.length,n=i-t;n<--i;)r=e[n],e[n++]=e[i],e[i]=r}function l(e,t){for(var r=0,i=e.length;r<i;){var n=r+i>>>1;e[n]<t?r=n+1:i=n}return r}function u(e){function t(e,t){e.forEach(function(e){e<0&&(e=~e);var r=n[e];r?r.push(t):n[e]=[t]})}function r(e,r){e.forEach(function(e){t(e,r)})}function i(e,t){"GeometryCollection"===e.type?e.geometries.forEach(function(e){i(e,t)}):e.type in a&&a[e.type](e.arcs,t)}var n={},o=e.map(function(){return[]}),a={LineString:t,MultiLineString:r,Polygon:r,MultiPolygon:function(e,t){e.forEach(function(e){r(e,t)})}};e.forEach(i);for(var s in n)for(var u=n[s],c=u.length,d=0;d<c;++d)for(var h=d+1;h<c;++h){var p,f=u[d],m=u[h];(p=o[f])[s=l(p,m)]!==m&&p.splice(s,0,m),(p=o[m])[s=l(p,f)]!==f&&p.splice(s,0,f)}return o}function c(e,t){function r(e){o.remove(e),e[1][2]=t(e),o.push(e)}var i=m(e.transform),n=g(e.transform),o=f();return t||(t=h),e.arcs.forEach(function(e){for(var a,s,l=[],u=0,c=0,d=e.length;c<d;++c)s=e[c],i(e[c]=[s[0],s[1],1/0],c);for(var c=1,d=e.length-1;c<d;++c)a=e.slice(c-1,c+2),a[1][2]=t(a),l.push(a),o.push(a);for(var c=0,d=l.length;c<d;++c)a=l[c],a.previous=l[c-1],a.next=l[c+1];for(;a=o.pop();){var h=a.previous,p=a.next;a[1][2]<u?a[1][2]=u:u=a[1][2],h&&(h.next=p,h[2]=a[2],r(h)),p&&(p.previous=h,p[0]=a[0],r(p))}e.forEach(n)}),e}function d(e){for(var t,r=-1,i=e.length,n=e[i-1],o=0;++r<i;)t=n,n=e[r],o+=t[0]*n[1]-t[1]*n[0];return.5*o}function h(e){var t=e[0],r=e[1],i=e[2];return Math.abs((t[0]-i[0])*(r[1]-t[1])-(t[0]-r[0])*(i[1]-t[1]))}function p(e,t){return e[1][2]-t[1][2]}function f(){function e(e,t){for(;t>0;){var r=(t+1>>1)-1,n=i[r];if(p(e,n)>=0)break;i[n._=t]=n,i[e._=t=r]=e}}function t(e,t){for(;;){var r=t+1<<1,o=r-1,a=t,s=i[a];if(o<n&&p(i[o],s)<0&&(s=i[a=o]),r<n&&p(i[r],s)<0&&(s=i[a=r]),a===t)break;i[s._=t]=s,i[e._=t=a]=e}}var r={},i=[],n=0;return r.push=function(t){return e(i[t._=n]=t,n++),n},r.pop=function(){if(!(n<=0)){var e,r=i[0];return--n>0&&(e=i[n],t(i[e._=0]=e,0)),r}},r.remove=function(r){var o,a=r._;if(i[a]===r)return a!==--n&&(o=i[n],(p(o,r)<0?e:t)(i[o._=a]=o,a)),a},r}function m(e){if(!e)return v;var t,r,i=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=r=0),e[0]=(t+=e[0])*i+o,e[1]=(r+=e[1])*n+a}}function g(e){if(!e)return v;var t,r,i=e.scale[0],n=e.scale[1],o=e.translate[0],a=e.translate[1];return function(e,s){s||(t=r=0);var l=(e[0]-o)/i|0,u=(e[1]-a)/n|0;e[0]=l-t,e[1]=u-r,t=l,r=u}}function v(){}var _={version:"1.6.18",mesh:function(e){return a(e,t.apply(this,arguments))},meshArcs:t,merge:function(e){return a(e,r.apply(this,arguments))},mergeArcs:r,feature:i,neighbors:u,presimplify:c};"function"==typeof define&&define.amd?define("ThirdParty/topojson",_):"object"==typeof module&&module.exports?module.exports=_:this.topojson=_}(),define("DataSources/GeoJsonDataSource",["../Core/Cartesian3","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getFilenameFromUri","../Core/loadJson","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/RuntimeError","../Scene/HeightReference","../Scene/VerticalOrigin","../ThirdParty/topojson","../ThirdParty/when","./BillboardGraphics","./CallbackProperty","./ColorMaterialProperty","./ConstantPositionProperty","./ConstantProperty","./CorridorGraphics","./DataSource","./EntityCluster","./EntityCollection","./PolygonGraphics","./PolylineGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P){"use strict";function A(t){return e.fromDegrees(t[0],t[1],t[2])}function D(e,t){var r="";for(var i in e)if(e.hasOwnProperty(i)){if(i===t||ae.indexOf(i)!==-1)continue;var o=e[i];n(o)&&(r+="object"==typeof o?"<tr><th>"+i+"</th><td>"+D(o)+"</td></tr>":"<tr><th>"+i+"</th><td>"+o+"</td></tr>")}return r.length>0&&(r='<table class="cesium-infoBox-defaultTable"><tbody>'+r+"</tbody></table>"),r}function I(e,t,r){var i;return function(o,a){return n(i)||(i=e(t,r)),i}}function M(e,t){return new _(I(D,e,t),!0)}function O(e,t,i){var o=e.id;if(n(o)&&"Feature"===e.type){for(var a=2,s=o;n(t.getById(s));)s=o+"_"+a,a++;o=s}else o=r();var l=t.getOrCreateEntity(o),u=e.properties;if(n(u)){l.properties=u;var c,d=u.title;if(n(d))l.name=d,c="title";else{var h=Number.MAX_VALUE;for(var p in u)if(u.hasOwnProperty(p)&&u[p]){var f=p.toLowerCase();if(h>1&&"title"===f){h=1,c=p;break}h>2&&"name"===f?(h=2,c=p):h>3&&/title/i.test(p)?(h=3,c=p):h>4&&/name/i.test(p)&&(h=4,c=p)}n(c)&&(l.name=u[c])}var m=u.description;null!==m&&(l.description=n(m)?new C(m):i(u,c))}return l}function R(e,t){for(var r=new Array(e.length),i=0;i<e.length;i++)r[i]=t(e[i]);return r}function N(e,t,r,i,o){if(null===t.geometry)return void O(t,e._entityCollection,o.describe);if(!n(t.geometry))throw new h("feature.geometry is required.");var a=t.geometry.type,s=le[a];if(!n(s))throw new h("Unknown geometry type: "+a);s(e,t,t.geometry,i,o)}function k(e,t,r,i,n){for(var o=t.features,a=0,s=o.length;a<s;a++)N(e,o[a],void 0,i,n)}function L(e,t,r,i,o){for(var a=r.geometries,s=0,l=a.length;s<l;s++){var u=a[s],c=u.type,d=le[c];if(!n(d))throw new h("Unknown geometry type: "+c);d(e,t,u,i,o)}}function F(e,r,o,a,s){var l=s.markerSymbol,u=s.markerColor,c=s.markerSize,d=r.properties;if(n(d)){var h=d["marker-color"];n(h)&&(u=t.fromCssColorString(h)),c=i(oe[d["marker-size"]],c);var m=d["marker-symbol"];n(m)&&(l=m)}var _;_=n(l)?1===l.length?e._pinBuilder.fromText(l.toUpperCase(),u,c):e._pinBuilder.fromMakiIconId(l,u,c):e._pinBuilder.fromColor(u,c);var y=new v;y.verticalOrigin=new C(f.BOTTOM),2===a.length&&s.clampToGround&&(y.heightReference=p.CLAMP_TO_GROUND);var w=O(r,e._entityCollection,s.describe);w.billboard=y,w.position=new b(o(a));var S=g(_).then(function(e){y.image=new C(e)}).otherwise(function(){y.image=new C(e._pinBuilder.fromColor(u,c))});e._promises.push(S)}function B(e,t,r,i,n){F(e,t,i,r.coordinates,n)}function U(e,t,r,i,n){for(var o=r.coordinates,a=0;a<o.length;a++)F(e,t,i,o[a],n)}function V(e,r,i,o,a){var s=a.strokeMaterialProperty,l=a.strokeWidthProperty,u=r.properties;if(n(u)){var c=u["stroke-width"];n(c)&&(l=new C(c));var d,h=u.stroke;n(h)&&(d=t.fromCssColorString(h));var p=u["stroke-opacity"];n(p)&&1!==p&&(n(d)||(d=s.color.clone()),d.alpha=p),n(d)&&(s=new y(d))}var f,m=O(r,e._entityCollection,a.describe);a.clampToGround?(f=new w,m.corridor=f):(f=new P,m.polyline=f),f.material=s,f.width=l,f.positions=new C(R(o,i))}function z(e,t,r,i,n){V(e,t,i,r.coordinates,n)}function G(e,t,r,i,n){for(var o=r.coordinates,a=0;a<o.length;a++)V(e,t,i,o[a],n)}function H(e,r,i,o,a){if(0!==o.length&&0!==o[0].length){var s=a.strokeMaterialProperty.color,l=a.fillMaterialProperty,u=a.strokeWidthProperty,c=r.properties;if(n(c)){var h=c["stroke-width"];n(h)&&(u=new C(h));var p,f=c.stroke;n(f)&&(p=t.fromCssColorString(f));var m=c["stroke-opacity"];n(m)&&1!==m&&(n(p)||(p=a.strokeMaterialProperty.color.clone()),p.alpha=m),n(p)&&(s=new C(p));var g,v=c.fill;n(v)&&(g=t.fromCssColorString(v),g.alpha=l.color.alpha),m=c["fill-opacity"],n(m)&&m!==l.color.alpha&&(n(g)||(g=l.color.clone()),g.alpha=m),n(g)&&(l=new y(g))}var _=new x;_.outline=new C(!0),_.outlineColor=s,_.outlineWidth=u,_.material=l;for(var b=[],w=1,S=o.length;w<S;w++)b.push(new d(R(o[w],i)));var E=o[0];_.hierarchy=new C(new d(R(E,i),b)),E[0].length>2?_.perPositionHeight=new C(!0):a.clampToGround||(_.height=0);var T=O(r,e._entityCollection,a.describe);T.polygon=_}}function W(e,t,r,i,n){H(e,t,i,r.coordinates,n)}function j(e,t,r,i,n){for(var o=r.coordinates,a=0;a<o.length;a++)H(e,t,i,o[a],n)}function q(e,t,r,i,n){for(var o in r.objects)if(r.objects.hasOwnProperty(o)){var a=m.feature(r,r.objects[o]),s=se[a.type];s(e,a,a,i,n)}}function Y(e){this._name=e,this._changed=new s,this._error=new s,this._isLoading=!1,this._loading=new s,this._entityCollection=new T(this),this._promises=[],this._pinBuilder=new c,this._entityCluster=new E}function X(e,t,r,i){var o;n(i)&&(o=l(i)),n(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));var a=se[t.type];if(!n(a))throw new h("Unsupported GeoJSON object type: "+t.type);var s=t.crs,u=null!==s?A:null;if(n(s)){if(!n(s.properties))throw new h("crs.properties is undefined.");var c=s.properties;if("name"===s.type){if(u=Z[c.name],!n(u))throw new h("Unknown crs name: "+c.name)}else if("link"===s.type){var d=K[c.href];if(n(d)||(d=J[c.type]),!n(d))throw new h("Unable to resolve crs link: "+JSON.stringify(c));u=d(c)}else{if("EPSG"!==s.type)throw new h("Unknown crs type: "+s.type);if(u=Z["EPSG:"+c.code],!n(u))throw new h("Unknown crs EPSG code: "+c.code)}}return g(u,function(i){return e._entityCollection.removeAll(),null!==i&&a(e,t,t,i,r),g.all(e._promises,function(){return e._promises.length=0,S.setLoading(e,!1),e})})}var Q,Z={"urn:ogc:def:crs:OGC:1.3:CRS84":A,"EPSG:4326":A,"urn:ogc:def:crs:EPSG::4326":A},K={},J={},$=48,ee=t.ROYALBLUE,te=t.YELLOW,re=2,ie=t.fromBytes(255,255,0,100),ne=!1,oe={small:24,medium:48,large:64},ae=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"],se={Feature:N,FeatureCollection:k,GeometryCollection:L,LineString:z,MultiLineString:G,MultiPoint:U,MultiPolygon:j,Point:B,Polygon:W,Topology:q},le={GeometryCollection:L,LineString:z,MultiLineString:G,MultiPoint:U,MultiPolygon:j,Point:B,Polygon:W,Topology:q};return Y.load=function(e,t){return(new Y).load(e,t)},o(Y,{markerSize:{get:function(){return $},set:function(e){$=e}},markerSymbol:{get:function(){return Q},set:function(e){Q=e}},markerColor:{get:function(){return ee},set:function(e){ee=e}},stroke:{get:function(){return te},set:function(e){te=e}},strokeWidth:{get:function(){return re},set:function(e){re=e}},fill:{get:function(){return ie},set:function(e){ie=e}},clampToGround:{get:function(){return ne},set:function(e){ne=e}},crsNames:{get:function(){return Z}},crsLinkHrefs:{get:function(){return K}},crsLinkTypes:{get:function(){return J}}}),o(Y.prototype,{name:{get:function(){return this._name}},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}}}),Y.prototype.load=function(e,t){S.setLoading(this,!0);var r=e;t=i(t,i.EMPTY_OBJECT);var o=t.sourceUri;"string"==typeof e&&(n(o)||(o=e),r=u(e)),t={describe:i(t.describe,M),markerSize:i(t.markerSize,$),markerSymbol:i(t.markerSymbol,Q),markerColor:i(t.markerColor,ee),strokeWidthProperty:new C(i(t.strokeWidth,re)),strokeMaterialProperty:new y(i(t.stroke,te)),fillMaterialProperty:new y(i(t.fill,ie)),clampToGround:i(t.clampToGround,ne)};var a=this;return g(r,function(e){return X(a,e,t,o)}).otherwise(function(e){return S.setLoading(a,!1),a._error.raiseEvent(a,e),console.log(e),g.reject(e)})},Y}),define("DataSources/GeometryUpdater",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function r(e,r){t.throwInstantiationError()}return e(r,{perInstanceColorAppearanceType:{get:t.throwInstantiationError},materialAppearanceType:{get:t.throwInstantiationError}}),e(r.prototype,{entity:{get:t.throwInstantiationError},fillEnabled:{get:t.throwInstantiationError},hasConstantFill:{get:t.throwInstantiationError},fillMaterialProperty:{get:t.throwInstantiationError},outlineEnabled:{get:t.throwInstantiationError},hasConstantOutline:{get:t.throwInstantiationError},outlineColorProperty:{get:t.throwInstantiationError}, +outlineWidth:{get:t.throwInstantiationError},isDynamic:{get:t.throwInstantiationError},isClosed:{get:t.throwInstantiationError},geometryChanged:{get:t.throwInstantiationError}}),r.prototype.isOutlineVisible=t.throwInstantiationError,r.prototype.isFilled=t.throwInstantiationError,r.prototype.createFillGeometryInstance=t.throwInstantiationError,r.prototype.createOutlineGeometryInstance=t.throwInstantiationError,r.prototype.isDestroyed=t.throwInstantiationError,r.prototype.destroy=t.throwInstantiationError,r.prototype.createDynamicUpdater=t.throwInstantiationError,r}),function(e,t){"function"==typeof define&&define.amd?define("ThirdParty/Autolinker",[],function(){return e.Autolinker=t()}):"object"==typeof exports?module.exports=t():e.Autolinker=t()}(this,function(){var e=function(t){e.Util.assign(this,t);var r=this.hashtag;if(r!==!1&&"twitter"!==r&&"facebook"!==r)throw new Error("invalid `hashtag` cfg - see docs")};return e.prototype={constructor:e,urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,newWindow:!0,stripPrefix:!0,truncate:void 0,className:"",htmlParser:void 0,matchParser:void 0,tagBuilder:void 0,link:function(e){for(var t=this.getHtmlParser(),r=t.parse(e),i=0,n=[],o=0,a=r.length;o<a;o++){var s=r[o],l=s.getType(),u=s.getText();if("element"===l)"a"===s.getTagName()&&(s.isClosing()?i=Math.max(i-1,0):i++),n.push(u);else if("entity"===l||"comment"===l)n.push(u);else if(0===i){var c=this.linkifyStr(u);n.push(c)}else n.push(u)}return n.join("")},linkifyStr:function(e){return this.getMatchParser().replace(e,this.createMatchReturnVal,this)},createMatchReturnVal:function(t){var r;if(this.replaceFn&&(r=this.replaceFn.call(this,this,t)),"string"==typeof r)return r;if(r===!1)return t.getMatchedText();if(r instanceof e.HtmlTag)return r.toAnchorString();var i=this.getTagBuilder(),n=i.build(t);return n.toAnchorString()},getHtmlParser:function(){var t=this.htmlParser;return t||(t=this.htmlParser=new e.htmlParser.HtmlParser),t},getMatchParser:function(){var t=this.matchParser;return t||(t=this.matchParser=new e.matchParser.MatchParser({urls:this.urls,email:this.email,twitter:this.twitter,phone:this.phone,hashtag:this.hashtag,stripPrefix:this.stripPrefix})),t},getTagBuilder:function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new e.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t}},e.link=function(t,r){var i=new e(r);return i.link(t)},e.match={},e.htmlParser={},e.matchParser={},e.Util={abstractMethod:function(){throw"abstract"},trimRegex:/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,assign:function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e},extend:function(t,r){var i=t.prototype,n=function(){};n.prototype=i;var o;o=r.hasOwnProperty("constructor")?r.constructor:function(){i.constructor.apply(this,arguments)};var a=o.prototype=new n;return a.constructor=o,a.superclass=i,delete r.constructor,e.Util.assign(a,r),o},ellipsis:function(e,t,r){return e.length>t&&(r=null==r?"..":r,e=e.substring(0,t-r.length)+r),e},indexOf:function(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1},splitAndCapture:function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var r,i=[],n=0;r=t.exec(e);)i.push(e.substring(n,r.index)),i.push(r[0]),n=r.index+r[0].length;return i.push(e.substring(n)),i},trim:function(e){return e.replace(this.trimRegex,"")}},e.HtmlTag=e.Util.extend(Object,{whitespaceRegex:/\s+/,constructor:function(t){e.Util.assign(this,t),this.innerHtml=this.innerHtml||this.innerHTML},setTagName:function(e){return this.tagName=e,this},getTagName:function(){return this.tagName||""},setAttr:function(e,t){var r=this.getAttrs();return r[e]=t,this},getAttr:function(e){return this.getAttrs()[e]},setAttrs:function(t){var r=this.getAttrs();return e.Util.assign(r,t),this},getAttrs:function(){return this.attrs||(this.attrs={})},setClass:function(e){return this.setAttr("class",e)},addClass:function(t){for(var r,i=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=i?i.split(n):[],s=t.split(n);r=s.shift();)o(a,r)===-1&&a.push(r);return this.getAttrs().class=a.join(" "),this},removeClass:function(t){for(var r,i=this.getClass(),n=this.whitespaceRegex,o=e.Util.indexOf,a=i?i.split(n):[],s=t.split(n);a.length&&(r=s.shift());){var l=o(a,r);l!==-1&&a.splice(l,1)}return this.getAttrs().class=a.join(" "),this},getClass:function(){return this.getAttrs().class||""},hasClass:function(e){return(" "+this.getClass()+" ").indexOf(" "+e+" ")!==-1},setInnerHtml:function(e){return this.innerHtml=e,this},getInnerHtml:function(){return this.innerHtml||""},toAnchorString:function(){var e=this.getTagName(),t=this.buildAttrsStr();return t=t?" "+t:"",["<",e,t,">",this.getInnerHtml(),"</",e,">"].join("")},buildAttrsStr:function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")}}),e.AnchorTagBuilder=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},build:function(t){var r=new e.HtmlTag({tagName:"a",attrs:this.createAttrs(t.getType(),t.getAnchorHref()),innerHtml:this.processAnchorText(t.getAnchorText())});return r},createAttrs:function(e,t){var r={href:t},i=this.createCssClass(e);return i&&(r.class=i),this.newWindow&&(r.target="_blank"),r},createCssClass:function(e){var t=this.className;return t?t+" "+t+"-"+e:""},processAnchorText:function(e){return e=this.doTruncate(e)},doTruncate:function(t){return e.Util.ellipsis(t,this.truncate||Number.POSITIVE_INFINITY)}}),e.htmlParser.HtmlParser=e.Util.extend(Object,{htmlRegex:function(){var e=/!--([\s\S]+?)--/,t=/[0-9a-zA-Z][0-9a-zA-Z:]*/,r=/[^\s\0"'>\/=\x01-\x1F\x7F]+/,i=/(?:"[^"]*?"|'[^']*?'|[^'"=<>`\s]+)/,n=r.source+"(?:\\s*=\\s*"+i.source+")?";return new RegExp(["(?:","<(!DOCTYPE)","(?:","\\s+","(?:",n,"|",i.source+")",")*",">",")","|","(?:","<(/)?","(?:",e.source,"|","(?:","("+t.source+")","(?:","\\s+",n,")*","\\s*/?",")",")",">",")"].join(""),"gi")}(),htmlCharacterEntitiesRegex:/( | |<|<|>|>|"|"|')/gi,parse:function(e){for(var t,r,i=this.htmlRegex,n=0,o=[];null!==(t=i.exec(e));){var a=t[0],s=t[3],l=t[1]||t[4],u=!!t[2],c=e.substring(n,t.index);c&&(r=this.parseTextAndEntityNodes(c),o.push.apply(o,r)),s?o.push(this.createCommentNode(a,s)):o.push(this.createElementNode(a,l,u)),n=t.index+a.length}if(n<e.length){var d=e.substring(n);d&&(r=this.parseTextAndEntityNodes(d),o.push.apply(o,r))}return o},parseTextAndEntityNodes:function(t){for(var r=[],i=e.Util.splitAndCapture(t,this.htmlCharacterEntitiesRegex),n=0,o=i.length;n<o;n+=2){var a=i[n],s=i[n+1];a&&r.push(this.createTextNode(a)),s&&r.push(this.createEntityNode(s))}return r},createCommentNode:function(t,r){return new e.htmlParser.CommentNode({text:t,comment:e.Util.trim(r)})},createElementNode:function(t,r,i){return new e.htmlParser.ElementNode({text:t,tagName:r.toLowerCase(),closing:i})},createEntityNode:function(t){return new e.htmlParser.EntityNode({text:t})},createTextNode:function(t){return new e.htmlParser.TextNode({text:t})}}),e.htmlParser.HtmlNode=e.Util.extend(Object,{text:"",constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getText:function(){return this.text}}),e.htmlParser.CommentNode=e.Util.extend(e.htmlParser.HtmlNode,{comment:"",getType:function(){return"comment"},getComment:function(){return this.comment}}),e.htmlParser.ElementNode=e.Util.extend(e.htmlParser.HtmlNode,{tagName:"",closing:!1,getType:function(){return"element"},getTagName:function(){return this.tagName},isClosing:function(){return this.closing}}),e.htmlParser.EntityNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"entity"}}),e.htmlParser.TextNode=e.Util.extend(e.htmlParser.HtmlNode,{getType:function(){return"text"}}),e.matchParser.MatchParser=e.Util.extend(Object,{urls:!0,email:!0,twitter:!0,phone:!0,hashtag:!1,stripPrefix:!0,matcherRegex:function(){var e=/(^|[^\w])@(\w{1,15})/,t=/(^|[^\w])#(\w{1,15})/,r=/(?:[\-;:&=\+\$,\w\.]+@)/,i=/(?:\+?\d{1,3}[-\s.])?\(?\d{3}\)?[-\s.]?\d{3}[-\s.]\d{4}/,n=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,o=/(?:www\.)/,a=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,s=/\.(?:international|construction|contractors|enterprises|photography|productions|foundation|immobilien|industries|management|properties|technology|christmas|community|directory|education|equipment|institute|marketing|solutions|vacations|bargains|boutique|builders|catering|cleaning|clothing|computer|democrat|diamonds|graphics|holdings|lighting|partners|plumbing|supplies|training|ventures|academy|careers|company|cruises|domains|exposed|flights|florist|gallery|guitars|holiday|kitchen|neustar|okinawa|recipes|rentals|reviews|shiksha|singles|support|systems|agency|berlin|camera|center|coffee|condos|dating|estate|events|expert|futbol|kaufen|luxury|maison|monash|museum|nagoya|photos|repair|report|social|supply|tattoo|tienda|travel|viajes|villas|vision|voting|voyage|actor|build|cards|cheap|codes|dance|email|glass|house|mango|ninja|parts|photo|shoes|solar|today|tokyo|tools|watch|works|aero|arpa|asia|best|bike|blue|buzz|camp|club|cool|coop|farm|fish|gift|guru|info|jobs|kiwi|kred|land|limo|link|menu|mobi|moda|name|pics|pink|post|qpon|rich|ruhr|sexy|tips|vote|voto|wang|wien|wiki|zone|bar|bid|biz|cab|cat|ceo|com|edu|gov|int|kim|mil|net|onl|org|pro|pub|red|tel|uno|wed|xxx|xyz|ac|ad|ae|af|ag|ai|al|am|an|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|tp|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)\b/,l=/[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]?!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|'$*\[\]]/;return new RegExp(["(",e.source,")","|","(",r.source,a.source,s.source,")","|","(","(?:","(",n.source,a.source,")","|","(?:","(.?//)?",o.source,a.source,")","|","(?:","(.?//)?",a.source,s.source,")",")","(?:"+l.source+")?",")","|","(",i.source,")","|","(",t.source,")"].join(""),"gi")}(),charBeforeProtocolRelMatchRegex:/^(.)?\/\//,constructor:function(t){e.Util.assign(this,t),this.matchValidator=new e.MatchValidator},replace:function(e,t,r){var i=this;return e.replace(this.matcherRegex,function(e,n,o,a,s,l,u,c,d,h,p,f,m){var g=i.processCandidateMatch(e,n,o,a,s,l,u,c,d,h,p,f,m);if(g){var v=t.call(r,g.match);return g.prefixStr+v+g.suffixStr}return e})},processCandidateMatch:function(t,r,i,n,o,a,s,l,u,c,d,h,p){var f,m=l||u,g="",v="";if(a&&!this.urls||o&&!this.email||c&&!this.phone||r&&!this.twitter||d&&!this.hashtag||!this.matchValidator.isValidMatch(a,s,m))return null;if(this.matchHasUnbalancedClosingParen(t)&&(t=t.substr(0,t.length-1),v=")"),o)f=new e.match.Email({matchedText:t,email:o});else if(r)i&&(g=i,t=t.slice(1)),f=new e.match.Twitter({matchedText:t,twitterHandle:n});else if(c){var _=t.replace(/\D/g,"");f=new e.match.Phone({matchedText:t,number:_})}else if(d)h&&(g=h,t=t.slice(1)),f=new e.match.Hashtag({matchedText:t,serviceName:this.hashtag,hashtag:p});else{if(m){var y=m.match(this.charBeforeProtocolRelMatchRegex)[1]||"";y&&(g=y,t=t.slice(1))}f=new e.match.Url({matchedText:t,url:t,protocolUrlMatch:!!s,protocolRelativeMatch:!!m,stripPrefix:this.stripPrefix})}return{prefixStr:g,suffixStr:v,match:f}},matchHasUnbalancedClosingParen:function(e){var t=e.charAt(e.length-1);if(")"===t){var r=e.match(/\(/g),i=e.match(/\)/g),n=r&&r.length||0,o=i&&i.length||0;if(n<o)return!0}return!1}}),e.MatchValidator=e.Util.extend(Object,{invalidProtocolRelMatchRegex:/^[\w]\/\//,hasFullProtocolRegex:/^[A-Za-z][-.+A-Za-z0-9]+:\/\//,uriSchemeRegex:/^[A-Za-z][-.+A-Za-z0-9]+:/,hasWordCharAfterProtocolRegex:/:[^\s]*?[A-Za-z]/,isValidMatch:function(e,t,r){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)||this.isInvalidProtocolRelativeMatch(r))},isValidUriScheme:function(e){var t=e.match(this.uriSchemeRegex)[0].toLowerCase();return"javascript:"!==t&&"vbscript:"!==t},urlMatchDoesNotHaveProtocolOrDot:function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||e.indexOf(".")!==-1)},urlMatchDoesNotHaveAtLeastOneWordChar:function(e,t){return!(!e||!t)&&!this.hasWordCharAfterProtocolRegex.test(e)},isInvalidProtocolRelativeMatch:function(e){return!!e&&this.invalidProtocolRelMatchRegex.test(e)}}),e.match.Match=e.Util.extend(Object,{constructor:function(t){e.Util.assign(this,t)},getType:e.Util.abstractMethod,getMatchedText:function(){return this.matchedText},getAnchorHref:e.Util.abstractMethod,getAnchorText:e.Util.abstractMethod}),e.match.Email=e.Util.extend(e.match.Match,{getType:function(){return"email"},getEmail:function(){return this.email},getAnchorHref:function(){return"mailto:"+this.email},getAnchorText:function(){return this.email}}),e.match.Hashtag=e.Util.extend(e.match.Match,{getType:function(){return"hashtag"},getHashtag:function(){return this.hashtag},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;default:throw new Error("Unknown service name to point hashtag to: ",e)}},getAnchorText:function(){return"#"+this.hashtag}}),e.match.Phone=e.Util.extend(e.match.Match,{getType:function(){return"phone"},getNumber:function(){return this.number},getAnchorHref:function(){return"tel:"+this.number},getAnchorText:function(){return this.matchedText}}),e.match.Twitter=e.Util.extend(e.match.Match,{getType:function(){return"twitter"},getTwitterHandle:function(){return this.twitterHandle},getAnchorHref:function(){return"https://twitter.com/"+this.twitterHandle},getAnchorText:function(){return"@"+this.twitterHandle}}),e.match.Url=e.Util.extend(e.match.Match,{urlPrefixRegex:/^(https?:\/\/)?(www\.)?/i,protocolRelativeRegex:/^\/\//,protocolPrepended:!1,getType:function(){return"url"},getUrl:function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},getAnchorHref:function(){var e=this.getUrl();return e.replace(/&/g,"&")},getAnchorText:function(){var e=this.getUrl();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix&&(e=this.stripUrlPrefix(e)),e=this.removeTrailingSlash(e)},stripUrlPrefix:function(e){return e.replace(this.urlPrefixRegex,"")},stripProtocolRelativePrefix:function(e){return e.replace(this.protocolRelativeRegex,"")},removeTrailingSlash:function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e}}),e}),define("ThirdParty/zip",["../Core/buildModuleUrl","../Core/defineProperties"],function(e,t){var r={};return function(r){function i(){var e=-1,t=this;t.append=function(r){var i,n=t.table;for(i=0;i<r.length;i++)e=e>>>8^n[255&(e^r[i])]},t.get=function(){return~e}}function n(e,t,r){return e.slice?e.slice(t,t+r):e.webkitSlice?e.webkitSlice(t,t+r):e.mozSlice?e.mozSlice(t,t+r):e.msSlice?e.msSlice(t,t+r):void 0}function o(e,t){var r,i;return r=new ArrayBuffer(e),i=new Uint8Array(r),t&&i.set(t,0),{buffer:r,array:i,view:new DataView(r)}}function a(){}function s(e){function t(t,r){var o=new Blob([e],{type:V});i=new u(o),i.init(function(){n.size=i.size,t()},r)}function r(e,t,r,n){i.readUint8Array(e,t,r,n)}var i,n=this;n.size=0,n.init=t,n.readUint8Array=r}function l(e){function t(t){for(var r=e.length;"="==e.charAt(r-1);)r--;i=e.indexOf(",")+1,n.size=Math.floor(.75*(r-i)),t()}function r(t,r,n){var a,s=o(r),l=4*Math.floor(t/3),u=4*Math.ceil((t+r)/3),c=window.atob(e.substring(l+i,u+i)),d=t-3*Math.floor(l/4);for(a=d;a<d+r;a++)s.array[a-d]=c.charCodeAt(a);n(s.array)}var i,n=this;n.size=0,n.init=t,n.readUint8Array=r}function u(e){function t(t){this.size=e.size,t()}function r(t,r,i,o){var a=new FileReader;a.onload=function(e){i(new Uint8Array(e.target.result))},a.onerror=o,a.readAsArrayBuffer(n(e,t,r))}var i=this;i.size=0,i.init=t,i.readUint8Array=r}function c(){}function d(e){function t(e){n=new Blob([],{type:V}),e()}function r(e,t){n=new Blob([n,A?e:e.buffer],{type:V}),t()}function i(t,r){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=r,i.readAsText(n,e)}var n,o=this;o.init=t,o.writeUint8Array=r,o.getData=i}function h(e){function t(t){o+="data:"+(e||"")+";base64,",t()}function r(e,t){var r,i=a.length,n=a;for(a="",r=0;r<3*Math.floor((i+e.length)/3)-i;r++)n+=String.fromCharCode(e[r]);for(;r<e.length;r++)a+=String.fromCharCode(e[r]);n.length>2?o+=window.btoa(n):a=n,t()}function i(e){e(o+window.btoa(a))}var n=this,o="",a="";n.init=t,n.writeUint8Array=r,n.getData=i}function p(e){function t(t){n=new Blob([],{type:e}),t()}function r(t,r){n=new Blob([n,A?t:t.buffer],{type:e}),r()}function i(e){e(n)}var n,o=this;o.init=t,o.writeUint8Array=r,o.getData=i}function f(e,t,r,i,n,o,a,s,l,u){function c(){e.removeEventListener(z,d,!1),s(f)}function d(e){var t=e.data,i=t.data;t.onappend&&(f+=i.length,r.writeUint8Array(i,function(){o(!1,i),h()},u)),t.onflush&&(i?(f+=i.length,r.writeUint8Array(i,function(){o(!1,i),c()},u)):c()),t.progress&&a&&a(p+t.current,n)}function h(){p=m*F,p<n?t.readUint8Array(i+p,Math.min(F,n-p),function(t){e.postMessage({append:!0,data:t}),m++,a&&a(p,n),o(!0,t)},l):e.postMessage({flush:!0})}var p,f,m=0;f=0,e.addEventListener(z,d,!1),h()}function m(e,t,r,i,n,o,a,s,l,u){function c(){var f;d=h*F,d<n?t.readUint8Array(i+d,Math.min(F,n-d),function(t){var s=e.append(t,function(){a&&a(i+d,n)});p+=s.length,o(!0,t),r.writeUint8Array(s,function(){o(!1,s),h++,setTimeout(c,1)},u),a&&a(d,n)},l):(f=e.flush(),f?(p+=f.length,r.writeUint8Array(f,function(){o(!1,f),s(p)},u)):s(p))}var d,h=0,p=0;c()}function g(e,t,n,o,a,s,l,u,c){function d(e,t){a&&!e&&g.append(t)}function h(e){s(e,g.get())}var p,g=new i;return r.zip.useWebWorkers?(p=new Worker(r.zip.workerScriptsPath+B),f(p,e,t,n,o,d,l,h,u,c)):m(new r.zip.Inflater,e,t,n,o,d,l,h,u,c),p}function v(e,t,n,o,a,s,l){function u(e,t){e&&p.append(t)}function c(e){o(e,p.get())}function d(){h.removeEventListener(z,d,!1),f(h,e,t,0,e.size,u,a,c,s,l)}var h,p=new i;return r.zip.useWebWorkers?(h=new Worker(r.zip.workerScriptsPath+U),h.addEventListener(z,d,!1),h.postMessage({init:!0,level:n})):m(new r.zip.Deflater,e,t,0,e.size,u,a,c,s,l),h}function _(e,t,r,n,o,a,s,l,u){function c(){var i=d*F;i<n?e.readUint8Array(r+i,Math.min(F,n-i),function(e){o&&h.append(e),s&&s(i,n,e),t.writeUint8Array(e,function(){d++,c()},u)},l):a(n,h.get())}var d=0,h=new i;c()}function y(e){var t,r,i="",n=["Ç","ü","é","â","ä","à","å","ç","ê","ë","è","ï","î","ì","Ä","Å","É","æ","Æ","ô","ö","ò","û","ù","ÿ","Ö","Ü","ø","£","Ø","×","ƒ","á","í","ó","ú","ñ","Ñ","ª","º","¿","®","¬","½","¼","¡","«","»","_","_","_","¦","¦","Á","Â","À","©","¦","¦","+","+","¢","¥","+","+","-","-","+","-","+","ã","Ã","+","+","-","-","¦","-","+","¤","ð","Ð","Ê","Ë","È","i","Í","Î","Ï","+","+","_","_","¦","Ì","_","Ó","ß","Ô","Ò","õ","Õ","µ","þ","Þ","Ú","Û","Ù","ý","Ý","¯","´","­","±","_","¾","¶","§","÷","¸","°","¨","·","¹","³","²","_"," "];for(t=0;t<e.length;t++)r=255&e.charCodeAt(t),i+=r>127?n[r-128]:String.fromCharCode(r);return i}function b(e){return decodeURIComponent(escape(e))}function C(e){var t,r="";for(t=0;t<e.length;t++)r+=String.fromCharCode(e[t]);return r}function w(e){var t=(4294901760&e)>>16,r=65535&e;try{return new Date(1980+((65024&t)>>9),((480&t)>>5)-1,31&t,(63488&r)>>11,(2016&r)>>5,2*(31&r),0)}catch(e){}}function S(e,t,r,i,n){return e.version=t.view.getUint16(r,!0),e.bitFlag=t.view.getUint16(r+2,!0),e.compressionMethod=t.view.getUint16(r+4,!0),e.lastModDateRaw=t.view.getUint32(r+6,!0),e.lastModDate=w(e.lastModDateRaw),1===(1&e.bitFlag)?void n(I):((i||8!=(8&e.bitFlag))&&(e.crc32=t.view.getUint32(r+10,!0),e.compressedSize=t.view.getUint32(r+14,!0),e.uncompressedSize=t.view.getUint32(r+18,!0)),4294967295===e.compressedSize||4294967295===e.uncompressedSize?void n(M):(e.filenameLength=t.view.getUint16(r+22,!0),void(e.extraFieldLength=t.view.getUint16(r+24,!0))))}function E(e,t){function r(){}function i(r,n){e.readUint8Array(e.size-r,r,function(e){var t=o(e.length,e).view;1347093766!=t.getUint32(0)?i(r+1,n):n(t)},function(){t(O)})}return r.prototype.getData=function(r,i,n,a){function s(e,t){h&&h.terminate(),h=null,e&&e(t)}function l(e){var t=o(4);return t.view.setUint32(0,e),p.crc32==t.view.getUint32(0)}function u(e,t){a&&!l(t)?c():r.getData(function(e){s(i,e)})}function c(){s(t,k)}function d(){s(t,N)}var h,p=this;e.readUint8Array(p.offset,30,function(i){var s,l=o(i.length,i);return 1347093252!=l.view.getUint32(0)?void t(D):(S(p,l,4,!1,t),s=p.offset+30+p.filenameLength+p.extraFieldLength,void r.init(function(){0===p.compressionMethod?_(e,r,s,p.compressedSize,a,u,n,c,d):h=g(e,r,s,p.compressedSize,a,u,n,c,d)},d))},c)},{getEntries:function(n){return e.size<22?void t(D):void i(22,function(i){var a,s;a=i.getUint32(16,!0),s=i.getUint16(8,!0),e.readUint8Array(a,e.size-a,function(e){var i,a,l,u,c=0,d=[],h=o(e.length,e);for(i=0;i<s;i++){if(a=new r,1347092738!=h.view.getUint32(c))return void t(D);S(a,h,c+6,!0,t),a.commentLength=h.view.getUint16(c+32,!0),a.directory=16==(16&h.view.getUint8(c+38)),a.offset=h.view.getUint32(c+42,!0),l=C(h.array.subarray(c+46,c+46+a.filenameLength)),a.filename=2048===(2048&a.bitFlag)?b(l):y(l),a.directory||"/"!=a.filename.charAt(a.filename.length-1)||(a.directory=!0),u=C(h.array.subarray(c+46+a.filenameLength+a.extraFieldLength,c+46+a.filenameLength+a.extraFieldLength+a.commentLength)),a.comment=2048===(2048&a.bitFlag)?b(u):y(u),d.push(a),c+=46+a.filenameLength+a.extraFieldLength+a.commentLength}n(d)},function(){t(O)})})},close:function(e){e&&e()}}}function T(e){return unescape(encodeURIComponent(e))}function x(e){var t,r=[];for(t=0;t<e.length;t++)r.push(e.charCodeAt(t));return r}function P(e,t,r){function i(e,t){s&&s.terminate(),s=null,e&&e(t)}function n(){i(t,R)}function a(){i(t,k)}var s,l={},u=[],c=0;return{add:function(d,h,p,f,m){function g(t){var i;S=m.lastModDate||new Date,C=o(26),l[d]={headerArray:C.array,directory:m.directory,filename:w,offset:c,comment:x(T(m.comment||""))},C.view.setUint32(0,335546376),m.version&&C.view.setUint8(0,m.version),r||0===m.level||m.directory||C.view.setUint16(4,2048),C.view.setUint16(6,(S.getHours()<<6|S.getMinutes())<<5|S.getSeconds()/2,!0),C.view.setUint16(8,(S.getFullYear()-1980<<4|S.getMonth()+1)<<5|S.getDate(),!0),C.view.setUint16(22,w.length,!0),i=o(30+w.length),i.view.setUint32(0,1347093252),i.array.set(C.array,4),i.array.set(w,30),c+=i.array.length,e.writeUint8Array(i.array,t,n)}function y(t,r){var a=o(16);c+=t||0,a.view.setUint32(0,1347094280),"undefined"!=typeof r&&(C.view.setUint32(10,r,!0),a.view.setUint32(4,r,!0)),h&&(a.view.setUint32(8,t,!0),C.view.setUint32(14,t,!0),a.view.setUint32(12,h.size,!0),C.view.setUint32(18,h.size,!0)),e.writeUint8Array(a.array,function(){c+=16,i(p)},n)}function b(){return m=m||{},d=d.trim(),m.directory&&"/"!=d.charAt(d.length-1)&&(d+="/"),l.hasOwnProperty(d)?void t(L):(w=x(T(d)),u.push(d),void g(function(){h?r||0===m.level?_(h,e,0,h.size,!0,y,f,a,n):s=v(h,e,m.level,y,f,a,n):y()},n))}var C,w,S;h?h.init(b,a):b()},close:function(t){var r,a,s,d=0,h=0;for(a=0;a<u.length;a++)s=l[u[a]],d+=46+s.filename.length+s.comment.length;for(r=o(d+22),a=0;a<u.length;a++)s=l[u[a]],r.view.setUint32(h,1347092738),r.view.setUint16(h+4,5120),r.array.set(s.headerArray,h+6),r.view.setUint16(h+32,s.comment.length,!0),s.directory&&r.view.setUint8(h+38,16),r.view.setUint32(h+42,s.offset,!0),r.array.set(s.filename,h+46),r.array.set(s.comment,h+46+s.filename.length),h+=46+s.filename.length+s.comment.length;r.view.setUint32(h,1347093766),r.view.setUint16(h+8,u.length,!0),r.view.setUint16(h+10,u.length,!0),r.view.setUint32(h+12,d,!0),r.view.setUint32(h+16,c,!0),e.writeUint8Array(r.array,function(){i(function(){e.getData(t)})},n)}}}var A,D="File format is not recognized.",I="File contains encrypted entry.",M="File is using Zip64 (4gb+ file size).",O="Error while reading zip file.",R="Error while writing zip file.",N="Error while writing file data.",k="Error while reading file data.",L="File already exists.",F=524288,B="inflate.js",U="deflate.js",V="text/plain",z="message";try{A=0===new Blob([new DataView(new ArrayBuffer(0))]).size}catch(e){}i.prototype.table=function(){var e,t,r,i=[];for(e=0;e<256;e++){for(r=e,t=0;t<8;t++)1&r?r=r>>>1^3988292384:r>>>=1;i[e]=r}return i}(),s.prototype=new a,s.prototype.constructor=s,l.prototype=new a,l.prototype.constructor=l,u.prototype=new a,u.prototype.constructor=u,c.prototype.getData=function(e){e(this.data)},d.prototype=new c,d.prototype.constructor=d,h.prototype=new c,h.prototype.constructor=h,p.prototype=new c,p.prototype.constructor=p,r.zip={Reader:a,Writer:c,BlobReader:u,Data64URIReader:l,TextReader:s,BlobWriter:p,Data64URIWriter:h,TextWriter:d,createReader:function(e,t,r){e.init(function(){t(E(e,r))},r)},createWriter:function(e,t,r,i){e.init(function(){t(P(e,r,i))},r)},useWebWorkers:!0};var G;t(r.zip,{workerScriptsPath:{get:function(){return"undefined"==typeof G&&(G=e("ThirdParty/Workers/")),G}}})}(r),r.zip}),define("DataSources/KmlDataSource",["../Core/AssociativeArray","../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/ClockRange","../Core/ClockStep","../Core/Color","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Ellipsoid","../Core/Event","../Core/getAbsoluteUri","../Core/getExtensionFromUri","../Core/getFilenameFromUri","../Core/Iso8601","../Core/joinUrls","../Core/JulianDate","../Core/loadBlob","../Core/loadXML","../Core/Math","../Core/NearFarScalar","../Core/PinBuilder","../Core/PolygonHierarchy","../Core/Rectangle","../Core/RuntimeError","../Core/TimeInterval","../Core/TimeIntervalCollection","../Scene/HeightReference","../Scene/HorizontalOrigin","../Scene/LabelStyle","../Scene/SceneMode","../ThirdParty/Autolinker","../ThirdParty/Uri","../ThirdParty/when","../ThirdParty/zip","./BillboardGraphics","./CompositePositionProperty","./CorridorGraphics","./DataSource","./DataSourceClock","./Entity","./EntityCluster","./EntityCollection","./LabelGraphics","./PathGraphics","./PolygonGraphics","./PolylineGraphics","./PositionPropertyArray","./RectangleGraphics","./ReferenceProperty","./SampledPositionProperty","./ScaledPositionProperty","./TimeIntervalCollectionProperty","./WallGraphics"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R,N,k,L,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie){"use strict";function ne(e){var t=e.slice(0,Math.min(4,e.size)),r=F.defer(),i=new FileReader;return i.addEventListener("load",function(){r.resolve(1347093252===new DataView(i.result).getUint32(0,!1))}),i.addEventListener("error",function(){r.reject(i.error)}),i.readAsArrayBuffer(t),r.promise}function oe(e){var t=F.defer(),r=new FileReader;return r.addEventListener("load",function(){t.resolve(r.result)}),r.addEventListener("error",function(){t.reject(r.error)}),r.readAsText(e),t.promise}function ae(e,t,r,i){t.getData(new B.TextWriter,function(e){r.kml=_t.parseFromString(e,"application/xml"),i.resolve()})}function se(e,t,r,i){var n=u(vt.detectFromFilename(t.filename),"application/octet-stream");t.getData(new B.Data64URIWriter(n),function(e){r[t.filename]=e,i.resolve()})}function le(e,t,r,i){for(var n=i.keys,o=new L("."),a=e.querySelectorAll(t),s=0;s<a.length;s++){var l=a[s],u=l.getAttribute(r),c=new L(u).resolve(o).toString(),d=n.indexOf(c);if(d!==-1){var h=n[d];l.setAttribute(r,i[h]),"a"===t&&null===l.getAttribute("download")&&l.setAttribute("download",h)}}}function ue(e,t,r,i,n){for(var o=e.querySelectorAll(t),a=0;a<o.length;a++){var s=o[a],l=s.getAttribute(r),u=Se(l,i,n);s.setAttribute(r,u)}}function ce(e,t){return c(t)&&new L(e).isAbsolute()&&(e=t.getURL(e)),e}function de(e,t,r){var i=ge(e,"id");i=c(i)&&0!==i.length?i:l(),c(r)&&(i=r+i);var n=t.getById(i);return c(n)&&(i=l(),c(r)&&(i=r+i)),n=t.add(new W({id:i})),c(n.kml)||(n.addProperty("kml"),n.kml=new gt),n}function he(e,t){return"absolute"===e||"relativeToGround"===e||"relativeToSeaFloor"===t}function pe(e){if(!c(e))return i.fromDegrees(0,0,0);var t=e.match(/[^\s,\n]+/g);if(!c(t))return i.fromDegrees(0,0,0);var r=parseFloat(t[0]),n=parseFloat(t[1]),o=parseFloat(t[2]);return r=isNaN(r)?0:r,n=isNaN(n)?0:n,o=isNaN(o)?0:o,i.fromDegrees(r,n,o)}function fe(e){if(c(e)){var t=e.textContent.match(/[^\s\n]+/g);if(c(t)){for(var r=t.length,i=new Array(r),n=0,o=0;o<r;o++)i[n++]=pe(t[o]);return i}}}function me(e,t){if(c(e)){var r=e.getAttribute(t);if(null!==r){var i=parseFloat(r);return isNaN(i)?void 0:i}}}function ge(e,t){if(c(e)){var r=e.getAttribute(t);return null!==r?r:void 0}}function ve(e,t,r){if(c(e))for(var i=e.childNodes,n=i.length,o=0;o<n;o++){var a=i[o];if(a.localName===t&&r.indexOf(a.namespaceURI)!==-1)return a}}function _e(e,t,r){if(c(e)){for(var i=[],n=e.getElementsByTagNameNS("*",t),o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&r.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}}function ye(e,t,r){if(!c(e))return[];for(var i=[],n=e.childNodes,o=n.length,a=0;a<o;a++){var s=n[a];s.localName===t&&r.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function be(e,t,r){var i=ve(e,t,r);if(c(i)){var n=parseFloat(i.textContent);return isNaN(n)?void 0:n}}function Ce(e,t,r){var i=ve(e,t,r);if(c(i))return i.textContent.trim()}function we(e,t,r){var i=ve(e,t,r);if(c(i)){var n=i.textContent.trim();return"1"===n||/^true$/i.test(n)}}function Se(e,t,r,i){if(c(e)){var n=!1;if(c(i)){var o=i[e];if(c(o))n=!0,e=o;else{var a=m(e,r);o=i[a],c(o)&&(n=!0,e=o)}}return!n&&c(r)&&(e=m(e,m(r)),e=ce(e,t)),e}}function Ee(e,t){if(c(e)&&!/^\s*$/gm.test(e)){"#"===e[0]&&(e=e.substring(1));var r=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?Dt.maximumRed=o:Dt.red=0,n>0?Dt.maximumGreen=n:Dt.green=0,i>0?Dt.maximumBlue=i:Dt.blue=0,Dt.alpha=r,s.fromRandom(Dt)):new s(o,n,i,r)}}function Te(e,t,r){var i=Ce(e,t,r);if(c(i))return Ee(i,"random"===Ce(e,"colorMode",r))}function xe(e){var t=ve(e,"TimeStamp",At.kmlgx),r=Ce(t,"when",At.kmlgx);if(c(t)&&c(r)&&0!==r.length){var i=b.fromIso8601(r),n=new I;return n.addInterval(new D({start:i,stop:_.MAXIMUM_VALUE})),n}}function Pe(e){var t=ve(e,"TimeSpan",At.kmlgx);if(c(t)){var r,i=ve(t,"begin",At.kmlgx),n=c(i)?b.fromIso8601(i.textContent):void 0,o=ve(t,"end",At.kmlgx),a=c(o)?b.fromIso8601(o.textContent):void 0;if(c(n)&&c(a)){if(b.lessThan(a,n)){var s=n;n=a,a=s}r=new I,r.addInterval(new D({start:n,stop:a}))}else c(n)?(r=new I,r.addInterval(new D({start:n,stop:_.MAXIMUM_VALUE}))):c(a)&&(r=new I,r.addInterval(new D({start:_.MINIMUM_VALUE,stop:a})));return r}}function Ae(){var e=new U;return e.width=bt,e.height=bt,e.scaleByDistance=new E(Ct,wt,St,Et),e.pixelOffsetScaleByDistance=new E(Ct,wt,St,Et),e}function De(){var e=new Q;return e.outline=!0,e.outlineColor=s.WHITE,e}function Ie(){var e=new Y;return e.translucencyByDistance=new E(3e6,1,5e6,0),e.pixelOffset=new r(17,0),e.horizontalOrigin=O.LEFT,e.font="16px sans-serif",e.style=R.FILL_AND_OUTLINE,e}function Me(e,t,r,i,n){var o=Ce(e,"href",At.kml);if(c(o)&&0!==o.length){if(0===o.indexOf("root://icons/palette-")){var a=o.charAt(21),s=u(be(e,"x",At.gx),0),l=u(be(e,"y",At.gx),0);s=Math.min(s/32,7),l=7-Math.min(l/32,7);var d=8*l+s;o="https://maps.google.com/mapfiles/kml/pal"+a+"/icon"+d+".png"}if(o=Se(o,t._proxy,r,i),n){var h=Ce(e,"refreshMode",At.kml),p=Ce(e,"viewRefreshMode",At.kml);"onInterval"===h||"onExpire"===h?console.log("KML - Unsupported Icon refreshMode: "+h):"onStop"!==p&&"onRegion"!==p||console.log("KML - Unsupported Icon viewRefreshMode: "+p); +var f=u(Ce(e,"viewBoundScale",At.kml),1),m="onStop"===p?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",g=u(Ce(e,"viewFormat",At.kml),m),v=Ce(e,"httpQuery",At.kml),_=at(g,v),b=y(o,_,!1);return st(t._camera,t._canvas,b,f,t._lastCameraView.bbox)}return o}}function Oe(e,n,o,a,s){var l=be(n,"scale",At.kml),d=be(n,"heading",At.kml),h=Te(n,"color",At.kml),p=ve(n,"Icon",At.kml),f=Me(p,e,a,s,!1),m=be(p,"x",At.gx),g=be(p,"y",At.gx),v=be(p,"w",At.gx),_=be(p,"h",At.gx),y=ve(n,"hotSpot",At.kml),b=me(y,"x"),C=me(y,"y"),w=ge(y,"xunits"),E=ge(y,"yunits"),T=o.billboard;c(T)||(T=Ae(),o.billboard=T),T.image=f,T.scale=l,T.color=h,(c(m)||c(g)||c(v)||c(_))&&(T.imageSubRegion=new t(m,g,v,_)),c(d)&&0!==d&&(T.rotation=S.toRadians(-d),T.alignedAxis=i.UNIT_Z),l=u(l,1);var x,P;c(b)&&("pixels"===w?x=-b*l:"insetPixels"===w?x=(b-bt)*l:"fraction"===w&&(x=-b*bt*l),x+=.5*bt*l),c(C)&&("pixels"===E?P=C*l:"insetPixels"===E?P=(-C+bt)*l:"fraction"===E&&(P=C*bt*l),P-=.5*bt*l),(c(x)||c(P))&&(T.pixelOffset=new r(x,P))}function Re(e,t,r,i,n){for(var o=0,a=t.childNodes.length;o<a;o++){var l=t.childNodes.item(o);if("IconStyle"===l.localName)Oe(e,l,r,i,n);else if("LabelStyle"===l.localName){var d=r.label;c(d)||(d=Ie(),r.label=d),d.scale=u(be(l,"scale",At.kml),d.scale),d.fillColor=u(Te(l,"color",At.kml),d.fillColor),d.text=r.name}else if("LineStyle"===l.localName){var h=r.polyline;c(h)||(h=new Z,r.polyline=h),h.width=be(l,"width",At.kml),h.material=Te(l,"color",At.kml),c(Te(l,"outerColor",At.gx))&&console.log("KML - gx:outerColor is not supported in a LineStyle"),c(be(l,"outerWidth",At.gx))&&console.log("KML - gx:outerWidth is not supported in a LineStyle"),c(be(l,"physicalWidth",At.gx))&&console.log("KML - gx:physicalWidth is not supported in a LineStyle"),c(we(l,"labelVisibility",At.gx))&&console.log("KML - gx:labelVisibility is not supported in a LineStyle")}else if("PolyStyle"===l.localName){var p=r.polygon;c(p)||(p=De(),r.polygon=p),p.material=u(Te(l,"color",At.kml),p.material),p.fill=u(we(l,"fill",At.kml),p.fill),p.outline=u(we(l,"outline",At.kml),p.outline)}else if("BalloonStyle"===l.localName){var f=u(Ee(Ce(l,"bgColor",At.kml)),s.WHITE),m=u(Ee(Ce(l,"textColor",At.kml)),s.BLACK),g=Ce(l,"text",At.kml);r.addProperty("balloonStyle"),r.balloonStyle={bgColor:f,textColor:m,text:g}}else if("ListStyle"===l.localName){var v=Ce(l,"listItemType",At.kml);"radioFolder"!==v&&"checkOffOnly"!==v||console.log("KML - Unsupported ListStyle with listItemType: "+v)}}}function Ne(e,t,r,i,n,o){for(var a,s=new W,l=-1,u=r.childNodes,d=u.length,h=0;h<d;h++){var p=u[h];"Style"!==p.localName&&"StyleMap"!==p.localName||(l=h)}if(l!==-1){var f=u[l];if("Style"===f.localName)Re(t,f,s,n,o);else for(var g=ye(f,"Pair",At.kml),v=0;v<g.length;v++){var _=g[v],y=Ce(_,"key",At.kml);if("normal"===y){var b=Ce(_,"styleUrl",At.kml);if(c(b))a=i.getById(b),c(a)||(a=i.getById("#"+b)),c(a)&&s.merge(a);else{var C=ve(_,"Style",At.kml);Re(t,C,s,n,o)}}else console.log("KML - Unsupported StyleMap key: "+y)}}var w=Ce(r,"styleUrl",At.kml);if(c(w)){var S=w;if("#"!==w[0]&&w.indexOf("#")!==-1){var E=w.split("#"),T=E[0];c(n)&&(T=m(T,m(n))),S=T+"#"+E[1]}a=i.getById(S),c(a)||(a=i.getById("#"+S)),c(a)&&s.merge(a)}return s}function ke(e,t,r){return w(ce(t,e._proxy)).then(function(i){return Le(e,i,r,t,!0)})}function Le(e,t,r,i,n,o){var a,s,l,u,d=_e(t,"Style",At.kml);if(c(d)){var h=d.length;for(a=0;a<h;a++)u=d[a],s=ge(u,"id"),c(s)&&(s="#"+s,n&&c(i)&&(s=i+s),c(r.getById(s))||(l=new W({id:s}),r.add(l),Re(e,u,l,i,o)))}var p=_e(t,"StyleMap",At.kml);if(c(p)){var f=p.length;for(a=0;a<f;a++){var g=p[a];if(s=ge(g,"id"),c(s))for(var v=ye(g,"Pair",At.kml),_=0;_<v.length;_++){var y=v[_],b=Ce(y,"key",At.kml);if("normal"===b){if(s="#"+s,n&&c(i)&&(s=i+s),!c(r.getById(s))){l=r.getOrCreateEntity(s);var C=Ce(y,"styleUrl",At.kml);if(c(C)){"#"!==C[0]&&(C="#"+C),n&&c(i)&&(C=i+C);var w=r.getById(C);c(w)&&l.merge(w)}else u=ve(y,"Style",At.kml),Re(e,u,l,i,o)}}else console.log("KML - Unsupported StyleMap key: "+b)}}}var S={},E=[],T=t.getElementsByTagName("styleUrl"),x=T.length;for(a=0;a<x;a++){var P=T[a].textContent;if("#"!==P[0]){var A=P.split("#");if(2===A.length){var D=A[0];c(S[D])||(c(i)&&(D=m(D,m(i))),E.push(ke(e,D,r,i)))}}}return E}function Fe(e,t,r){var i=new $(e,t.id,["position"]),n=new te(t.position);t.polyline=c(r.polyline)?r.polyline.clone():new Z,t.polyline.positions=new K([i,n])}function Be(e,t){return!c(e)&&!c(t)||"clampToGround"===e?M.CLAMP_TO_GROUND:"relativeToGround"===e?M.RELATIVE_TO_GROUND:"absolute"===e?M.NONE:"clampToSeaFloor"===t?(console.log("KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),M.CLAMP_TO_GROUND):"relativeToSeaFloor"===t?(console.log("KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),M.RELATIVE_TO_GROUND):(c(e)?console.log("KML - Unknown <kml:altitudeMode>:"+e+", using <kml:altitudeMode>:CLAMP_TO_GROUND."):console.log("KML - Unknown <gx:altitudeMode>:"+t+", using <kml:altitudeMode>:CLAMP_TO_GROUND."),M.CLAMP_TO_GROUND)}function Ue(e,t,r){return"relativeToSeaFloor"===r||"absolute"===t||"relativeToGround"===t?e:((c(t)&&"clampToGround"!==t||c(r)&&"clampToSeaFloor"!==r)&&console.log("KML - Unknown altitudeMode: "+u(t,r)),new te(e))}function Ve(e,t,r){if(c(e)){if("relativeToSeaFloor"===r||"absolute"===t||"relativeToGround"===t)return e;(c(t)&&"clampToGround"!==t||c(r)&&"clampToSeaFloor"!==r)&&console.log("KML - Unknown altitudeMode: "+u(t,r));for(var i=e.length,n=0;n<i;n++){var o=e[n];p.WGS84.scaleToGeodeticSurface(o,o)}return e}}function ze(e,t,i,n){var o=t.label;c(o)||(o=c(i.label)?i.label.clone():Ie(),t.label=o),o.text=t.name;var a=t.billboard;c(a)||(a=c(i.billboard)?i.billboard.clone():Ae(),t.billboard=a),c(a.image)||(a.image=e._pinBuilder.fromColor(s.YELLOW,64));var l=1;c(a.scale)&&(l=a.scale.getValue(),0!==l?o.pixelOffset=new r(16*l+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),c(n)&&e._clampToGround&&(a.heightReference=n,o.heightReference=n)}function Ge(e,t,r){var i=t.path;c(i)||(i=new X,i.leadTime=0,t.path=i);var n=r.polyline;c(n)&&(i.material=n.material,i.width=n.width)}function He(e,t,r,i,n){var o=Ce(r,"coordinates",At.kml),a=Ce(r,"altitudeMode",At.kml),s=Ce(r,"altitudeMode",At.gx),l=we(r,"extrude",At.kml),u=pe(o);return i.position=u,ze(e,i,n,Be(a,s)),l&&he(a,s)&&Fe(t,i,n),!0}function We(e,t,r,i,n){var o=ve(r,"coordinates",At.kml),a=Ce(r,"altitudeMode",At.kml),l=Ce(r,"altitudeMode",At.gx),d=we(r,"extrude",At.kml),h=we(r,"tessellate",At.kml),p=he(a,l);c(be(r,"drawOrder",At.gx))&&console.log("KML - gx:drawOrder is not supported in LineStrings");var f=fe(o),m=n.polyline;if(p&&d){var g=new ie;i.wall=g,g.positions=f;var v=n.polygon;c(v)&&(g.fill=v.fill,g.material=v.material),g.outline=!0,c(m)?(g.outlineColor=c(m.material)?m.material.color:s.WHITE,g.outlineWidth=m.width):c(v)&&(g.outlineColor=c(v.material)?v.material.color:s.WHITE)}else if(e._clampToGround&&!p&&h){var y=new z;i.corridor=y,y.positions=f,c(m)?(y.material=c(m.material)?m.material.color.getValue(_.MINIMUM_VALUE):s.WHITE,y.width=u(m.width,1)):(y.material=s.WHITE,y.width=1)}else m=c(m)?m.clone():new Z,i.polyline=m,m.positions=Ve(f,a,l),h&&!p||(m.followSurface=!1);return!0}function je(e,t,r,i,n){var o=ve(r,"outerBoundaryIs",At.kml),a=ve(o,"LinearRing",At.kml),l=ve(a,"coordinates",At.kml),u=fe(l),d=we(r,"extrude",At.kml),h=Ce(r,"altitudeMode",At.kml),p=Ce(r,"altitudeMode",At.gx),f=he(h,p),m=c(n.polygon)?n.polygon.clone():De(),g=n.polyline;if(c(g)&&(m.outlineColor=c(g.material)?g.material.color:s.WHITE,m.outlineWidth=g.width),i.polygon=m,f?(m.perPositionHeight=!0,m.extrudedHeight=d?0:void 0):e._clampToGround||(m.height=0),c(u)){for(var v=new x(u),_=ye(r,"innerBoundaryIs",At.kml),y=0;y<_.length;y++){a=ye(_[y],"LinearRing",At.kml);for(var b=0;b<a.length;b++)l=ve(a[b],"coordinates",At.kml),u=fe(l),c(u)&&v.holes.push(new x(u))}m.hierarchy=v}return!0}function qe(e,t,r,i,n){var o=Ce(r,"altitudeMode",At.kml),a=Ce(r,"altitudeMode",At.gx),s=ye(r,"coord",At.gx),l=ye(r,"angles",At.gx),u=ye(r,"when",At.kml),c=we(r,"extrude",At.kml),d=he(o,a);l.length>0&&console.log("KML - gx:angles are not supported in gx:Tracks");for(var h=Math.min(s.length,u.length),p=[],f=[],m=0;m<h;m++){var g=pe(s[m].textContent);p.push(g),f.push(b.fromIso8601(u[m].textContent))}var v=new ee;return v.addSamples(f,p),i.position=v,ze(e,i,n,Be(o,a)),Ge(e,i,n),i.availability=new I,u.length>0&&i.availability.addInterval(new D({start:f[0],stop:f[f.length-1]})),d&&c&&Fe(t,i,n),!0}function Ye(e,t,r,i,n,o,a,s,l){var u=e[0],c=e[e.length-1],d=new ee;d.addSamples(e,t),r.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:Ue(d,a,s)})),i.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l})),n.intervals.addInterval(new D({start:u,stop:c,isStartIncluded:l,isStopIncluded:l,data:o}))}function Xe(e,t,r,i,n){for(var o,a,s,l=we(r,"interpolate",At.gx),u=ye(r,"Track",At.gx),d=!1,h=new re,p=new I,f=new V,m=0,g=u.length;m<g;m++){var v=u[m],_=ye(v,"when",At.kml),y=ye(v,"coord",At.gx),C=Ce(v,"altitudeMode",At.kml),w=Ce(v,"altitudeMode",At.gx),S=he(C,w),E=we(v,"extrude",At.kml),T=Math.min(y.length,_.length),x=[];o=[];for(var P=0;P<T;P++){var A=pe(y[P].textContent);x.push(A),o.push(b.fromIso8601(_[P].textContent))}l&&(c(a)&&Ye([a,o[0]],[s,x[0]],f,p,h,!1,"absolute",void 0,!1),a=o[T-1],s=x[x.length-1]),Ye(o,x,f,p,h,S&&E,C,w,!0),d=d||S&&E}return i.availability=p,i.position=f,ze(e,i,n),Ge(e,i,n),d&&(Fe(t,i,n),i.polyline.show=h),!0}function Qe(e,t,r,i,n,o){for(var a=r.childNodes,s=!1,l=0,u=a.length;l<u;l++){var d=a.item(l),h=Mt[d.localName];if(c(h)){var p=de(d,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,d,p,n)&&(s=!0)}}return s}function Ze(e,t,r,i,n){return console.log("KML - Unsupported geometry: "+r.localName),!1}function Ke(e,t){var r=ve(e,"ExtendedData",At.kml);if(c(r)){c(ve(r,"SchemaData",At.kml))&&console.log("KML - SchemaData is unsupported"),c(ge(r,"xmlns:prefix"))&&console.log("KML - ExtendedData with xmlns:prefix is unsupported");var i={},n=ye(r,"Data",At.kml);if(c(n))for(var o=n.length,a=0;a<o;a++){var s=n[a],l=ge(s,"name");c(l)&&(i[l]={displayName:Ce(s,"displayName",At.kml),value:Ce(s,"value",At.kml)})}t.kml.extendedData=i}}function Je(e,t,r,i,n,o){var a,l,d,h=t.kml,p=h.extendedData,f=Ce(e,"description",At.kml),m=u(t.balloonStyle,r.balloonStyle),g=s.WHITE,v=s.BLACK,_=f;c(m)&&(g=u(m.bgColor,s.WHITE),v=u(m.textColor,s.BLACK),_=u(m.text,f));var y;if(c(_)){if(_=_.replace("$[name]",u(t.name,"")),_=_.replace("$[description]",u(f,"")),_=_.replace("$[address]",u(h.address,"")),_=_.replace("$[Snippet]",u(h.snippet,"")),_=_.replace("$[id]",t.id),_=_.replace("$[geDirections]",""),c(p)){var b=_.match(/\$\[.+?\]/g);if(null!==b)for(a=0;a<b.length;a++){var C=b[a],w=C.substr(2,C.length-3),S=/\/displayName$/.test(w);w=w.replace(/\/displayName$/,""),y=p[w],c(y)&&(y=S?y.displayName:y.value),c(y)&&(_=_.replace(C,u(y,"")))}}}else if(c(p)&&(d=Object.keys(p),d.length>0)){for(_='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',a=0;a<d.length;a++)l=d[a],y=p[l],_+="<tr><th>"+u(y.displayName,l)+"</th><td>"+u(y.value,"")+"</td></tr>";_+="</tbody></table>"}if(c(_)){_=yt.link(_),It.innerHTML=_;var E=It.querySelectorAll("a");for(a=0;a<E.length;a++)E[a].setAttribute("target","_blank");c(i)&&i.keys.length>1&&(le(It,"a","href",i),le(It,"img","src",i)),ue(It,"a","href",n,o),ue(It,"img","src",n,o);var T='<div class="cesium-infoBox-description-lighter" style="';T+="overflow:auto;",T+="word-wrap:break-word;",T+="background-color:"+g.toCssColorString()+";",T+="color:"+v.toCssColorString()+";",T+='">',T+=It.innerHTML+"</div>",It.innerHTML="",t.description=T}}function $e(e,t,r,i,n,o,a,s,l){function d(e){return!e||e.show&&d(e.parent)}var h=de(r,i,l),p=h.kml,f=Ne(h,e,r,n,o,a),m=Ce(r,"name",At.kml);h.name=m,h.parent=t;var g=Pe(r);c(g)||(g=xe(r)),h.availability=g,ft(h);var v=we(r,"visibility",At.kml);h.show=d(t)&&u(v,!0);var _=ve(r,"author",At.atom),y=p.author;y.name=Ce(_,"name",At.atom),y.uri=Ce(_,"uri",At.atom),y.email=Ce(_,"email",At.atom);var b=ve(r,"link",At.atom),C=p.link;return C.href=ge(b,"href"),C.hreflang=ge(b,"hreflang"),C.rel=ge(b,"rel"),C.type=ge(b,"type"),C.title=ge(b,"title"),C.length=ge(b,"length"),p.address=Ce(r,"address",At.kml),p.phoneNumber=Ce(r,"phoneNumber",At.kml),p.snippet=Ce(r,"Snippet",At.kml),Ke(r,h),Je(r,h,f,a,e._proxy,o),c(ve(r,"Camera",At.kml))&&console.log("KML - Unsupported view: Camera"),c(ve(r,"LookAt",At.kml))&&console.log("KML - Unsupported view: LookAt"),c(ve(r,"Region",At.kml))&&console.log("KML - Placemark Regions are unsupported"),{entity:h,styleEntity:f}}function et(e,t,r,i,n,o,a,s,l){for(var u=Object.keys(Ft),c=u.length,d=0;d<c;d++)for(var h=u[d],p=Ft[h],f=r.childNodes,m=f.length,g=0;g<m;g++){var v=f[g];v.localName!==h||At.kml.indexOf(v.namespaceURI)===-1&&At.gx.indexOf(v.namespaceURI)===-1||p(e,t,v,i,n,o,a,s,l)}}function tt(e,t,r,i,n,o,a,s,l){var u=$e(e,t,r,i,n,o,a,s,l);et(e,u.entity,r,i,n,o,a,s,l)}function rt(e,t,r,i,n,o,a,s,l){for(var u=$e(e,t,r,i,n,o,a,s,l),d=u.entity,h=u.styleEntity,p=!1,f=r.childNodes,m=0,g=f.length;m<g&&!p;m++){var v=f.item(m),_=Mt[v.localName];c(_)&&(_(e,i,v,d,h,d.id),p=!0)}p||(d.merge(h),ze(e,d,h))}function it(e,t,r,i,n,o,a,s,l){var u,d=$e(e,t,r,i,n,o,a,s,l),h=d.entity,p=!1,f=fe(ve(r,"LatLonQuad",At.gx));if(c(f))u=De(),u.hierarchy=new x(f),h.polygon=u,p=!0;else{u=new J,h.rectangle=u;var m=ve(r,"LatLonBox",At.kml);if(c(m)){var g=be(m,"west",At.kml),v=be(m,"south",At.kml),_=be(m,"east",At.kml),y=be(m,"north",At.kml);c(g)&&(g=S.negativePiToPi(S.toRadians(g))),c(v)&&(v=S.clampToLatitudeRange(S.toRadians(v))),c(_)&&(_=S.negativePiToPi(S.toRadians(_))),c(y)&&(y=S.clampToLatitudeRange(S.toRadians(y))),u.coordinates=new P(g,v,_,y);var b=be(m,"rotation",At.kml);c(b)&&(u.rotation=S.toRadians(b))}}var C=ve(r,"Icon",At.kml),w=Me(C,e,o,a,!0);if(c(w)){p&&console.log("KML - gx:LatLonQuad Icon does not support texture projection.");var E=be(C,"x",At.gx),T=be(C,"y",At.gx),A=be(C,"w",At.gx),D=be(C,"h",At.gx);(c(E)||c(T)||c(A)||c(D))&&console.log("KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),u.material=w,u.material.color=Te(r,"color",At.kml),u.material.transparent=!0}else u.material=Te(r,"color",At.kml);var I=Ce(r,"altitudeMode",At.kml);c(I)?"absolute"===I?u.height=be(r,"altitude",At.kml):"clampToGround"!==I&&console.log("KML - Unknown altitudeMode: "+I):(I=Ce(r,"altitudeMode",At.gx),"relativeToSeaFloor"===I?(console.log("KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),u.height=be(r,"altitude",At.kml)):"clampToSeaFloor"===I?console.log("KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):c(I)&&console.log("KML - Unknown altitudeMode: "+I))}function nt(e,t,r,i,n,o,a,s,l){e._unsupportedNode.raiseEvent(e,t,r,i,n,o,a),console.log("KML - Unsupported feature: "+r.localName)}function ot(e){if(!c(e)||0===e.length)return"";var t=e[0];return"&"===t&&e.splice(0,1),"?"!==t&&(e="?"+e),e}function at(e,t){var r="";return(c(e)&&e.length>0||c(t)&&t.length>0)&&(r+=y(ot(e),ot(t),!1)),r}function st(e,t,r,n,o){function a(e){return e<-S.PI_OVER_TWO?-S.PI_OVER_TWO:e>S.PI_OVER_TWO?S.PI_OVER_TWO:e}function s(e){return e>S.PI?e-S.TWO_PI:e<-S.PI?e+S.TWO_PI:e}if(c(e)&&e._mode!==N.MORPHING){var l,d,h=p.WGS84;if(o=u(o,Rt),c(t)&&(kt.x=.5*t.clientWidth,kt.y=.5*t.clientHeight,l=e.pickEllipsoid(kt,h,Lt)),c(l)?d=h.cartesianToCartographic(l,Nt):(d=P.center(o,Nt),l=h.cartographicToCartesian(d)),c(n)&&!S.equalsEpsilon(n,1,S.EPSILON9)){var f=o.width*n*.5,m=o.height*n*.5;o=new P(s(d.longitude-f),a(d.latitude-m),s(d.longitude+f),a(d.latitude+m))}r=r.replace("[bboxWest]",S.toDegrees(o.west).toString()),r=r.replace("[bboxSouth]",S.toDegrees(o.south).toString()),r=r.replace("[bboxEast]",S.toDegrees(o.east).toString()),r=r.replace("[bboxNorth]",S.toDegrees(o.north).toString());var g=S.toDegrees(d.longitude).toString(),v=S.toDegrees(d.latitude).toString();r=r.replace("[lookatLon]",g),r=r.replace("[lookatLat]",v),r=r.replace("[lookatTilt]",S.toDegrees(e.pitch).toString()),r=r.replace("[lookatHeading]",S.toDegrees(e.heading).toString()),r=r.replace("[lookatRange]",i.distance(e.positionWC,l)),r=r.replace("[lookatTerrainLon]",g),r=r.replace("[lookatTerrainLat]",v),r=r.replace("[lookatTerrainAlt]",d.height.toString()),h.cartesianToCartographic(e.positionWC,Nt),r=r.replace("[cameraLon]",S.toDegrees(Nt.longitude).toString()),r=r.replace("[cameraLat]",S.toDegrees(Nt.latitude).toString()),r=r.replace("[cameraAlt]",S.toDegrees(Nt.height).toString());var _=e.frustum,y=_.aspectRatio,b="",C="";if(c(y)){var w=S.toDegrees(_.fov);y>1?(b=w,C=w/y):(C=w,b=w*y)}r=r.replace("[horizFov]",b.toString()),r=r.replace("[vertFov]",C.toString())}else r=r.replace("[bboxWest]","-180"),r=r.replace("[bboxSouth]","-90"),r=r.replace("[bboxEast]","180"),r=r.replace("[bboxNorth]","90"),r=r.replace("[lookatLon]",""),r=r.replace("[lookatLat]",""),r=r.replace("[lookatRange]",""),r=r.replace("[lookatTilt]",""),r=r.replace("[lookatHeading]",""),r=r.replace("[lookatTerrainLon]",""),r=r.replace("[lookatTerrainLat]",""),r=r.replace("[lookatTerrainAlt]",""),r=r.replace("[cameraLon]",""),r=r.replace("[cameraLat]",""),r=r.replace("[cameraAlt]",""),r=r.replace("[horizFov]",""),r=r.replace("[vertFov]","");return c(t)?(r=r.replace("[horizPixels]",t.clientWidth),r=r.replace("[vertPixels]",t.clientHeight)):(r=r.replace("[horizPixels]",""),r=r.replace("[vertPixels]","")),r=r.replace("[terrainEnabled]","1"),r=r.replace("[clientVersion]","1"),r=r.replace("[kmlVersion]","2.2"),r=r.replace("[clientName]","Cesium"),r=r.replace("[language]","English")}function lt(e,t,r,i,n,o,a,s,d){var h=$e(e,t,r,i,n,o,a,s,d),p=h.entity,f=ve(r,"Link",At.kml);if(c(f)||(f=ve(r,"Url",At.kml)),c(f)){var g=Ce(f,"href",At.kml);if(c(g)){var v=g;g=Se(g,void 0,o,a);var _;if(/^data:/.test(g))_=g,/\.kmz/i.test(o)||(v=m(v,o));else{v=g;var C=Ce(f,"viewRefreshMode",At.kml),w=u(Ce(f,"viewBoundScale",At.kml),1),S="onStop"===C?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",E=u(Ce(f,"viewFormat",At.kml),S),T=Ce(f,"httpQuery",At.kml),x=at(E,T);_=st(e._camera,e._canvas,y(g,x,!1),w,e._lastCameraView.bbox)}var P={sourceUri:v,uriResolver:a,context:p.id},A=new q,D=ht(e,A,_,P).then(function(t){var r=e._entityCollection,i=A.values;r.suspendEvents();for(var n=0;n<i.length;n++){var o=i[n];c(o.parent)||(o.parent=p,ft(o)),r.add(o)}r.resumeEvents();var a=Ce(f,"refreshMode",At.kml),s=u(be(f,"refreshInterval",At.kml),0);if("onInterval"===a&&s>0||"onExpire"===a||"onStop"===C){var d=ve(t,"NetworkLinkControl",At.kml),h=c(d),m=b.now(),v={id:l(),href:g,cookie:"",queryString:x,lastUpdated:m,updating:!1,entity:p,viewBoundScale:w,needsUpdate:!1,cameraUpdateTime:m},_=0;if(h&&(v.cookie=u(Ce(d,"cookie",At.kml),""),_=u(be(d,"minRefreshPeriod",At.kml),0)),"onInterval"===a)h&&(s=Math.max(_,s)),v.refreshMode=Ot.INTERVAL,v.time=s;else if("onExpire"===a){var y;if(h&&(y=Ce(d,"expires",At.kml)),c(y))try{var S=b.fromIso8601(y),E=b.secondsDifference(S,m);E>0&&E<_&&b.addSeconds(m,_,S),v.refreshMode=Ot.EXPIRE,v.time=S}catch(e){console.log("KML - NetworkLinkControl expires is not a valid date")}else console.log("KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else e._camera?(v.refreshMode=Ot.STOP,v.time=u(be(f,"viewRefreshTime",At.kml),0)):console.log("A NetworkLink with viewRefreshMode=onStop requires a camera be passed in when creating the KmlDataSource");c(v.refreshMode)&&e._networkLinks.set(v.id,v)}else"onRegion"===C&&console.log("KML - Unsupported viewRefreshMode: onRegion")});s.push(D)}}}function ut(e,t,r,i,n,o,a,s,l){var u=Ft[t.localName];c(u)?u(e,r,t,i,n,o,a,s,l):nt(e,r,t,i,n,o,a,s,l)}function ct(e,t,r,i,n,o){t.removeAll();var a=[],s=r.documentElement,l="Document"===s.localName?s:ve(s,"Document",At.kml),u=Ce(l,"name",At.kml);!c(u)&&c(i)&&(u=v(i)),c(e._name)||(e._name=u);var d=new q(e);return F.all(Le(e,r,d,i,!1,n,o)).then(function(){var s=r.documentElement;if("kml"===s.localName)for(var l=s.childNodes,u=0;u<l.length;u++){var h=l[u];if(c(Ft[h.localName])){s=h;break}}return t.suspendEvents(),ut(e,s,void 0,t,d,i,n,a,o),t.resumeEvents(),F.all(a).then(function(){return r.documentElement})})}function dt(e,t,r,i){var n=F.defer();return B.createReader(new B.BlobReader(r),function(r){r.getEntries(function(o){for(var a,s,l=[],u={},d=0;d<o.length;d++){var h=o[d];if(!h.directory){var p=F.defer();l.push(p.promise),/\.kml$/i.test(h.filename)?c(a)&&/\//i.test(h.filename)?se(r,h,u,p):(c(a)&&se(r,a,u,s),a=h,s=p):se(r,h,u,p)}}c(a)&&ae(r,a,u,s),F.all(l).then(function(){return r.close(),c(u.kml)?(u.keys=Object.keys(u),ct(e,t,u.kml,i,u)):void n.reject(new A("KMZ file does not contain a KML document."))}).then(n.resolve).otherwise(n.reject)})},function(e){n.reject(e)}),n.promise}function ht(e,t,r,i){i=u(i,u.EMPTY_OBJECT);var n=i.sourceUri,o=i.uriResolver,a=i.context,s=r;return"string"==typeof r&&(s=C(ce(r,e._proxy)),n=u(n,r)),F(s).then(function(r){return r instanceof Blob?ne(r).then(function(i){return i?dt(e,t,r,n):oe(r).then(function(r){var i,s;try{i=_t.parseFromString(r,"application/xml")}catch(e){s=e.toString()}if(c(s)||i.body||"parsererror"===i.documentElement.tagName){var l=c(s)?s:i.documentElement.firstChild.nodeValue;throw l||(l=i.body.innerText),new A(l)}return ct(e,t,i,n,o,a)})}):ct(e,t,r,n,o,a)}).otherwise(function(t){return e._error.raiseEvent(e,t),console.log(t),F.reject(t)})}function pt(t){t=u(t,{});var r=t.camera,n=t.canvas;this._changed=new f,this._error=new f,this._loading=new f,this._refresh=new f,this._unsupportedNode=new f,this._clock=void 0,this._entityCollection=new q(this),this._name=void 0,this._isLoading=!1,this._proxy=t.proxy,this._pinBuilder=new T,this._networkLinks=new e,this._entityCluster=new j,this._canvas=n,this._camera=r,this._lastCameraView={position:c(r)?i.clone(r.positionWC):void 0,direction:c(r)?i.clone(r.directionWC):void 0,up:c(r)?i.clone(r.upWC):void 0,bbox:c(r)?r.computeViewRectangle():P.clone(P.MAX_VALUE)}}function ft(e){var t=e.parent;if(c(t)){var r=t.availability;if(c(r)){var i=e.availability;c(i)?i.intersect(r):e.availability=r}}}function mt(e,t,r,i,n){return function(o){function a(e){C.remove(e);for(var t=e._children,r=t.length,i=0;i<r;++i)a(t[i])}if(i.contains(t.id)){var s=!1,l=ve(o,"NetworkLinkControl",At.kml),d=c(l),h=0;if(d){if(c(ve(l,"Update",At.kml)))return console.log("KML - NetworkLinkControl updates aren't supported."),t.updating=!1,void i.remove(t.id);t.cookie=u(Ce(l,"cookie",At.kml),""),h=u(be(l,"minRefreshPeriod",At.kml),0)}var p=b.now(),f=t.refreshMode;if(f===Ot.INTERVAL)c(l)&&(t.time=Math.max(h,t.time));else if(f===Ot.EXPIRE){var m;if(c(l)&&(m=Ce(l,"expires",At.kml)),c(m))try{var g=b.fromIso8601(m),v=b.secondsDifference(g,p);v>0&&v<h&&b.addSeconds(p,h,g),t.time=g}catch(e){console.log("KML - NetworkLinkControl expires is not a valid date"),s=!0}else console.log("KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}var y=t.entity,C=e._entityCollection,w=r.values;C.suspendEvents();for(var S=C.values.slice(),E=0;E<S.length;++E){var T=S[E];T.parent===y&&(T.parent=void 0,a(T))}for(C.resumeEvents(),C.suspendEvents(),E=0;E<w.length;E++){var x=w[E];c(x.parent)||(x.parent=y,ft(x)),C.add(x)}C.resumeEvents(),s?i.remove(t.id):t.lastUpdated=p;var P=C.computeAvailability(),A=P.start,D=P.stop,I=b.equals(A,_.MINIMUM_VALUE),M=b.equals(D,_.MAXIMUM_VALUE);if(!I||!M){var O=e._clock;O.startTime===A&&O.stopTime===D||(O.startTime=A,O.stopTime=D,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,n)}}}function gt(){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}if("undefined"==typeof DOMParser)return{};var vt={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=g(t),vt[t]}},_t=new DOMParser,yt=new k({stripPrefix:!1,twitter:!1,email:!1,replaceFn:function(e,t){if(!t.protocolUrlMatch)return!1}}),bt=32,Ct=2414016,wt=1,St=16093e3,Et=.1,Tt=[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"],xt=["http://www.google.com/kml/ext/2.2"],Pt=["http://www.w3.org/2005/Atom"],At={kml:Tt,gx:xt,atom:Pt,kmlgx:Tt.concat(xt)},Dt={},It=document.createElement("div"),Mt={Point:He,LineString:We,LinearRing:We,Polygon:je,Track:qe,MultiTrack:Xe,MultiGeometry:Qe,Model:Ze},Ot={INTERVAL:0,EXPIRE:1,STOP:2},Rt=new P,Nt=new n,kt=new r,Lt=new i,Ft={Document:et,Folder:tt,Placemark:rt,NetworkLink:lt,GroundOverlay:it,PhotoOverlay:nt,ScreenOverlay:nt,Tour:nt};pt.load=function(e,t){t=u(t,u.EMPTY_OBJECT);var r=new pt(t);return r.load(e,t)},d(pt.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}},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}}}),pt.prototype.load=function(e,t){t=u(t,{}),G.setLoading(this,!0);var r=this._name;this._name=void 0,this._clampToGround=u(t.clampToGround,!1);var i=this;return ht(this,this._entityCollection,e,t).then(function(){var e,t=i._entityCollection.computeAvailability(),n=t.start,s=t.stop,l=b.equals(n,_.MINIMUM_VALUE),u=b.equals(s,_.MAXIMUM_VALUE);if(!l||!u){var c;l&&(c=new Date,c.setHours(0,0,0,0),n=b.fromDate(c)),u&&(c=new Date,c.setHours(24,0,0,0),s=b.fromDate(c)),e=new H,e.startTime=n,e.stopTime=s,e.currentTime=b.clone(n),e.clockRange=o.LOOP_STOP,e.clockStep=a.SYSTEM_CLOCK_MULTIPLIER,e.multiplier=Math.round(Math.min(Math.max(b.secondsDifference(s,n)/60,1),31556900))}var d=!1;return e!==i._clock&&(i._clock=e,d=!0),r!==i._name&&(d=!0),d&&i._changed.raiseEvent(i),G.setLoading(i,!1),i}).otherwise(function(e){return G.setLoading(i,!1),i._error.raiseEvent(i,e),console.log(e),F.reject(e)})};var Bt=new e;return pt.prototype.update=function(t){function r(e){for(var t=e._children,i=t.length,n=0;n<i;++n){var o=t[n];Bt.set(o.id,o),r(o)}}var n=this._networkLinks;if(0===n.length)return!0;var o=b.now(),a=this;Bt.removeAll();var s=!1,l=this._lastCameraView,u=this._camera;!c(u)||u.positionWC.equalsEpsilon(l.position,S.EPSILON7)&&u.directionWC.equalsEpsilon(l.direction,S.EPSILON7)&&u.upWC.equalsEpsilon(l.up,S.EPSILON7)||(l.position=i.clone(u.positionWC),l.direction=i.clone(u.directionWC),l.up=i.clone(u.upWC),l.bbox=u.computeViewRectangle(),s=!0);var d=new e,h=!1;return n.values.forEach(function(e){var t=e.entity;if(!Bt.contains(t.id)){if(!e.updating){var i=!1;if(e.refreshMode===Ot.INTERVAL?b.secondsDifference(o,e.lastUpdated)>e.time&&(i=!0):e.refreshMode===Ot.EXPIRE?b.greaterThan(o,e.time)&&(i=!0):e.refreshMode===Ot.STOP&&(s&&(e.needsUpdate=!0,e.cameraUpdateTime=o),e.needsUpdate&&b.secondsDifference(o,e.cameraUpdateTime)>=e.time&&(i=!0)),i){r(t),e.updating=!0;var n=new q,u=y(e.href,at(e.cookie,e.queryString),!1);u=st(a._camera,a._canvas,u,e.viewBoundScale,l.bbox),ht(a,n,u,{context:t.id}).then(mt(a,e,n,d,u)).otherwise(function(t){var r="NetworkLink "+e.href+" refresh failed: "+t;console.log(r),a._error.raiseEvent(a,r)}),h=!0}}d.set(e.id,e)}}),h&&(this._networkLinks=d,this._changed.raiseEvent(this)),!0},pt}),define("DataSources/VelocityOrientationProperty",["../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Ellipsoid","../Core/Event","../Core/Matrix3","../Core/Quaternion","../Core/Transforms","./Property","./VelocityVectorProperty"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e,r){this._velocityVectorProperty=new c(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new o,this.ellipsoid=t(r,n.WGS84);var i=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){i._definitionChanged.raiseEvent(i)})}i(d.prototype,{isConstant:{get:function(){return u.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){var t=this._ellipsoid;t!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var h=new e,p=new e,f=new a;return d.prototype.getValue=function(e,t){var i=this._velocityVectorProperty._getValue(e,p,h);if(r(i))return l.rotationMatrixFromPositionVelocity(h,i,this._ellipsoid,f),s.fromRotationMatrix(f,t)},d.prototype.equals=function(e){return this===e||e instanceof d&&u.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))},d}),define("DataSources/Visualizer",["../Core/DeveloperError"],function(e){"use strict";function t(){e.throwInstantiationError()}return t.prototype.update=e.throwInstantiationError,t.prototype.getBoundingSphere=e.throwInstantiationError,t.prototype.isDestroyed=e.throwInstantiationError,t.prototype.destroy=e.throwInstantiationError,t}),define("Renderer/ClearCommand",["../Core/Color","../Core/defaultValue","../Core/freezeObject"],function(e,t,r){"use strict";function i(e){e=t(e,t.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}return i.ALL=r(new i({color:new e(0,0,0,0),depth:1,stencil:0})),i.prototype.execute=function(e,t){e.clear(this,t)},i}),define("Renderer/ComputeCommand",["../Core/defaultValue","./Pass"],function(e,t){"use strict";function r(r){r=e(r,e.EMPTY_OBJECT),this.vertexArray=r.vertexArray,this.fragmentShaderSource=r.fragmentShaderSource,this.shaderProgram=r.shaderProgram,this.uniformMap=r.uniformMap,this.outputTexture=r.outputTexture,this.preExecute=r.preExecute,this.postExecute=r.postExecute,this.persists=e(r.persists,!1),this.pass=t.COMPUTE,this.owner=r.owner}return r.prototype.execute=function(e){e.execute(this)},r}),define("Shaders/ViewportQuadVS",[],function(){"use strict";return"attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n"}),define("Renderer/ComputeEngine",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/PrimitiveType","../Shaders/ViewportQuadVS","./ClearCommand","./DrawCommand","./Framebuffer","./RenderState","./ShaderProgram"],function(e,t,r,i,n,o,a,s,l,u,c,d){ +"use strict";function h(e){this._context=e}function p(e,t){return new u({context:e,colorTextures:[t],destroyAttachments:!1})}function f(e,t){return d.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function m(t,i){return r(g)&&g.viewport.width===t&&g.viewport.height===i||(g=c.fromCache({viewport:new e(0,0,t,i)})),g}var g,v=new l({primitiveType:o.TRIANGLES}),_=new s({color:new t(0,0,0,0)});return h.prototype.execute=function(e){r(e.preExecute)&&e.preExecute(e);var t=e.outputTexture,i=t.width,n=t.height,o=this._context,a=r(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=r(e.shaderProgram)?e.shaderProgram:f(o,e.fragmentShaderSource),l=p(o,t),u=m(i,n),c=e.uniformMap,d=_;d.framebuffer=l,d.renderState=u,d.execute(o);var h=v;h.vertexArray=a,h.renderState=u,h.shaderProgram=s,h.uniformMap=c,h.framebuffer=l,h.execute(o),l.destroy(),e.persists||(s.destroy(),r(e.vertexArray)&&a.destroy()),r(e.postExecute)&&e.postExecute(t)},h.prototype.isDestroyed=function(){return!1},h.prototype.destroy=function(){return i(this)},h}),define("Renderer/PassState",[],function(){"use strict";function e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}return e}),define("Renderer/RenderbufferFormat",["../Core/freezeObject","../Core/WebGLConstants"],function(e,t){"use strict";var r={RGBA4:t.RGBA4,RGB5_A1:t.RGB5_A1,RGB565:t.RGB565,DEPTH_COMPONENT16:t.DEPTH_COMPONENT16,STENCIL_INDEX8:t.STENCIL_INDEX8,DEPTH_STENCIL:t.DEPTH_STENCIL,validate:function(e){return e===r.RGBA4||e===r.RGB5_A1||e===r.RGB565||e===r.DEPTH_COMPONENT16||e===r.STENCIL_INDEX8||e===r.DEPTH_STENCIL}};return e(r)}),define("Renderer/Renderbuffer",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","./ContextLimits","./RenderbufferFormat"],function(e,t,r,i,n,o,a){"use strict";function s(r){r=e(r,e.EMPTY_OBJECT);var i=r.context,n=i._gl,s=(o.maximumRenderbufferSize,e(r.format,a.RGBA4)),l=t(r.width)?r.width:n.drawingBufferWidth,u=t(r.height)?r.height:n.drawingBufferHeight;this._gl=n,this._format=s,this._width=l,this._height=u,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),n.renderbufferStorage(n.RENDERBUFFER,s,l,u),n.bindRenderbuffer(n.RENDERBUFFER,null)}return r(s.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}}),s.prototype._getRenderbuffer=function(){return this._renderbuffer},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),i(this)},s}),define("Renderer/PickFramebuffer",["../Core/BoundingRectangle","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","./Framebuffer","./PassState","./Renderbuffer","./RenderbufferFormat","./Texture"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t){var r=new a(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new e},r.viewport=new e,this._context=t,this._fb=void 0,this._passState=r,this._width=0,this._height=0}c.prototype.begin=function(t){var r=this._context,n=r.drawingBufferWidth,a=r.drawingBufferHeight;return e.clone(t,this._passState.scissorTest.rectangle),i(this._fb)&&this._width===n&&this._height===a||(this._width=n,this._height=a,this._fb=this._fb&&this._fb.destroy(),this._fb=new o({context:r,colorTextures:[new u({context:r,width:n,height:a})],depthStencilRenderbuffer:new s({context:r,format:l.DEPTH_STENCIL})}),this._passState.framebuffer=this._fb),this._passState.viewport.width=n,this._passState.viewport.height=a,this._passState};var d=new t;return c.prototype.end=function(e){for(var n=r(e.width,1),o=r(e.height,1),a=this._context,s=a.readPixels({x:e.x,y:e.y,width:n,height:o,framebuffer:this._fb}),l=Math.max(n,o),u=l*l,c=Math.floor(.5*n),h=Math.floor(.5*o),p=0,f=0,m=0,g=-1,v=0;v<u;++v){if(-c<=p&&p<=c&&-h<=f&&f<=h){var _=4*((h-f)*n+p+c);d.red=t.byteToFloat(s[_]),d.green=t.byteToFloat(s[_+1]),d.blue=t.byteToFloat(s[_+2]),d.alpha=t.byteToFloat(s[_+3]);var y=a.getObjectByPickColor(d);if(i(y))return y}if(p===f||p<0&&-p===f||p>0&&p===1-f){var b=m;m=-g,g=b}p+=m,f+=g}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._fb=this._fb&&this._fb.destroy(),n(this)},c}),define("Renderer/ShaderCache",["../Core/defined","../Core/defineProperties","../Core/destroyObject","./ShaderProgram","./ShaderSource"],function(e,t,r,i,n){"use strict";function o(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}function a(e,t){for(var r=t.derivedKeywords,i=r.length,n=0;n<i;++n){var o=r[n]+t.keyword,s=e._shaders[o];a(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}return t(o.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}}),o.prototype.replaceShaderProgram=function(t){return e(t.shaderProgram)&&t.shaderProgram.destroy(),this.getShaderProgram(t)},o.prototype.getShaderProgram=function(t){var r=t.vertexShaderSource,o=t.fragmentShaderSource,a=t.attributeLocations;"string"==typeof r&&(r=new n({sources:[r]})),"string"==typeof o&&(o=new n({sources:[o]}));var s,l=r.createCombinedVertexShader(),u=o.createCombinedFragmentShader(),c=l+u+JSON.stringify(a);if(e(this._shaders[c]))s=this._shaders[c],delete this._shadersToRelease[c];else{var d=this._context,h=new i({gl:d._gl,logShaderCompilation:d.logShaderCompilation,debugShaders:d.debugShaders,vertexShaderSource:r,vertexShaderText:l,fragmentShaderSource:o,fragmentShaderText:u,attributeLocations:a});s={cache:this,shaderProgram:h,keyword:c,derivedKeywords:[],count:0},h._cachedShader=s,this._shaders[c]=s,++this._numberOfShaders}return++s.count,s.shaderProgram},o.prototype.getDerivedShaderProgram=function(t,r){var i=t._cachedShader,n=r+i.keyword,o=this._shaders[n];if(e(o))return o.shaderProgram},o.prototype.createDerivedShaderProgram=function(e,t,r){var o=e._cachedShader,a=t+o.keyword,s=r.vertexShaderSource,l=r.fragmentShaderSource,u=r.attributeLocations;"string"==typeof s&&(s=new n({sources:[s]})),"string"==typeof l&&(l=new n({sources:[l]}));var c=s.createCombinedVertexShader(),d=l.createCombinedFragmentShader(),h=this._context,p=new i({gl:h._gl,logShaderCompilation:h.logShaderCompilation,debugShaders:h.debugShaders,vertexShaderSource:s,vertexShaderText:c,fragmentShaderSource:l,fragmentShaderText:d,attributeLocations:u}),f={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0};return o.derivedKeywords.push(t),p._cachedShader=f,this._shaders[a]=f,p},o.prototype.destroyReleasedShaderPrograms=function(){var e=this._shadersToRelease;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];a(this,r),--this._numberOfShaders}this._shadersToRelease={}},o.prototype.releaseShaderProgram=function(t){if(e(t)){var r=t._cachedShader;r&&0===--r.count&&(this._shadersToRelease[r.keyword]=r)}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){var e=this._shaders;for(var t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return r(this)},o}),define("Renderer/UniformState",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/defined","../Core/defineProperties","../Core/EncodedCartesian3","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","../Scene/OrthographicFrustum","../Scene/SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(){this.globeDepthTexture=void 0,this._viewport=new e,this._viewportCartesian4=new i,this._viewportDirty=!1,this._viewportOrthographicMatrix=d.clone(d.IDENTITY),this._viewportTransformation=d.clone(d.IDENTITY),this._model=d.clone(d.IDENTITY),this._view=d.clone(d.IDENTITY),this._inverseView=d.clone(d.IDENTITY),this._projection=d.clone(d.IDENTITY),this._infiniteProjection=d.clone(d.IDENTITY),this._entireFrustum=new t,this._currentFrustum=new t,this._frustumPlanes=new i,this._frameState=void 0,this._temeToPseudoFixed=c.clone(d.IDENTITY),this._view3DDirty=!0,this._view3D=new d,this._inverseView3DDirty=!0,this._inverseView3D=new d,this._inverseModelDirty=!0,this._inverseModel=new d,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new c,this._viewRotation=new c,this._inverseViewRotation=new c,this._viewRotation3D=new c,this._inverseViewRotation3D=new c,this._inverseProjectionDirty=!0,this._inverseProjection=new d,this._modelViewDirty=!0,this._modelView=new d,this._modelView3DDirty=!0,this._modelView3D=new d,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new d,this._inverseModelViewDirty=!0,this._inverseModelView=new d,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new d,this._viewProjectionDirty=!0,this._viewProjection=new d,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new d,this._modelViewProjectionDirty=!0,this._modelViewProjection=new d,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new d,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new d,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new d,this._normalDirty=!0,this._normal=new c,this._normal3DDirty=!0,this._normal3D=new c,this._inverseNormalDirty=!0,this._inverseNormal=new c,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new c,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new l,this._cameraPosition=new r,this._sunPositionWC=new r,this._sunPositionColumbusView=new r,this._sunDirectionWC=new r,this._sunDirectionEC=new r,this._moonDirectionEC=new r,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._cameraDirection=new r,this._cameraRight=new r,this._cameraUp=new r,this._frustum2DWidth=0,this._eyeHeight2D=new t,this._resolutionScale=1,this._orthographicIn3D=!1,this._backgroundColor=new o,this._fogDensity=void 0,this._imagerySplitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}function v(e,t){d.clone(t,e._view),d.getRotation(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 _(e,t){d.clone(t,e._inverseView),d.getRotation(t,e._inverseViewRotation)}function y(e,t){d.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function b(e,t){d.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}function C(e,t){r.clone(t.positionWC,e._cameraPosition),r.clone(t.directionWC,e._cameraDirection),r.clone(t.rightWC,e._cameraRight),r.clone(t.upWC,e._cameraUp),e._encodedCameraPositionMCDirty=!0}function w(e,t){a(p.computeIcrfToFixedMatrix(t.time,W))||(W=p.computeTemeToPseudoFixedMatrix(t.time,W));var i=h.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);c.multiplyByVector(W,i,i),r.normalize(i,e._sunDirectionWC),i=c.multiplyByVector(e.viewRotation3D,i,e._sunDirectionEC),r.normalize(i,i),i=h.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),c.multiplyByVector(W,i,i),c.multiplyByVector(e.viewRotation3D,i,i),r.normalize(i,i);var n=t.mapProjection,o=n.ellipsoid,s=o.cartesianToCartographic(e._sunPositionWC,j);n.project(s,e._sunPositionColumbusView)}function S(e){if(e._viewportDirty){var t=e._viewport;d.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),d.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function E(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode===m.SCENE2D||e._mode===m.MORPHING||e._orthographicIn3D?d.clone(d.ZERO,e._inverseProjection):d.inverse(e._projection,e._inverseProjection))}function T(e){e._modelViewDirty&&(e._modelViewDirty=!1,d.multiplyTransformation(e._view,e._model,e._modelView))}function x(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,d.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function P(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,d.inverse(e.modelView,e._inverseModelView))}function A(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,d.inverse(e.modelView3D,e._inverseModelView3D))}function D(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,d.multiply(e._projection,e._view,e._viewProjection))}function I(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,d.inverse(e.viewProjection,e._inverseViewProjection))}function M(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,d.multiply(e._projection,e.modelView,e._modelViewProjection))}function O(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;var t=e.modelView,r=e._modelViewRelativeToEye;r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=0,r[13]=0,r[14]=0,r[15]=t[15]}}function R(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,d.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function N(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,d.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function k(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,d.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function L(e){if(e._normalDirty){e._normalDirty=!1;var t=e._normal;d.getRotation(e.inverseModelView,t),c.transpose(t,t)}}function F(e){if(e._normal3DDirty){e._normal3DDirty=!1;var t=e._normal3D;d.getRotation(e.inverseModelView3D,t),c.transpose(t,t)}}function B(e){e._inverseNormalDirty&&(e._inverseNormalDirty=!1,d.getRotation(e.inverseModelView,e._inverseNormal))}function U(e){e._inverseNormal3DDirty&&(e._inverseNormal3DDirty=!1,d.getRotation(e.inverseModelView3D,e._inverseNormal3D))}function V(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,d.multiplyByPoint(e.inverseModel,e._cameraPosition,q),l.fromCartesian(q,e._encodedCameraPositionMC))}function z(e,t,i,n,o,s,l,c){var h=Y;h.x=e.y,h.y=e.z,h.z=e.x;var f=X;f.x=i.y,f.y=i.z,f.z=i.x;var g=Q;g.x=n.y,g.y=n.z,g.z=n.x;var v=Z;v.x=t.y,v.y=t.z,v.z=t.x,s===m.SCENE2D&&(h.z=.5*o);var _=l.unproject(h,K);_.longitude=u.clamp(_.longitude,-Math.PI,Math.PI),_.latitude=u.clamp(_.latitude,-u.PI_OVER_TWO,u.PI_OVER_TWO);var y=l.ellipsoid,b=y.cartographicToCartesian(_,J),C=p.eastNorthUpToFixedFrame(b,y,$);return d.multiplyByPointAsVector(C,f,f),d.multiplyByPointAsVector(C,g,g),d.multiplyByPointAsVector(C,v,v),a(c)||(c=new d),c[0]=f.x,c[1]=g.x,c[2]=-v.x,c[3]=0,c[4]=f.y,c[5]=g.y,c[6]=-v.y,c[7]=0,c[8]=f.z,c[9]=g.z,c[10]=-v.z,c[11]=0,c[12]=-r.dot(f,b),c[13]=-r.dot(g,b),c[14]=r.dot(v,b),c[15]=1,c}function G(e){e._view3DDirty&&(e._mode===m.SCENE3D?d.clone(e._view,e._view3D):z(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),d.getRotation(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function H(e){e._inverseView3DDirty&&(d.inverseTransformation(e.view3D,e._inverseView3D),d.getRotation(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}s(g.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(t){if(!e.equals(t,this._viewport)){e.clone(t,this._viewport);var r=this._viewport,i=this._viewportCartesian4;i.x=r.x,i.y=r.y,i.z=r.width,i.w=r.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return S(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return S(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){d.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,d.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){var e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,d.getRotation(this.inverseModel,e),c.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return G(this),this._view3D}},viewRotation:{get:function(){return G(this),this._viewRotation}},viewRotation3D:{get:function(){return G(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return H(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return H(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return E(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return T(this),this._modelView}},modelView3D:{get:function(){return x(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return O(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return P(this),this._inverseModelView}},inverseModelView3D:{get:function(){return A(this),this._inverseModelView3D}},viewProjection:{get:function(){return D(this),this._viewProjection}},inverseViewProjection:{get:function(){return I(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return M(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return R(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return N(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return k(this),this._modelViewInfiniteProjection}},normal:{get:function(){return L(this),this._normal}},normal3D:{get:function(){return F(this),this._normal3D}},inverseNormal:{get:function(){return B(this),this._inverseNormal}},inverseNormal3D:{get:function(){return U(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},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}},encodedCameraPositionMCHigh:{get:function(){return V(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return V(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},resolutionScale:{get:function(){return this._resolutionScale}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},imagerySplitPosition:{get:function(){return this._imagerySplitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}}});var W=new c,j=new n;g.prototype.updateCamera=function(e){v(this,e.viewMatrix),_(this,e.inverseViewMatrix),C(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==m.SCENE2D&&e.frustum instanceof f},g.prototype.updateFrustum=function(e){y(this,e.projectionMatrix),a(e.infiniteProjectionMatrix)&&b(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,a(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},g.prototype.updatePass=function(e){this._pass=e},g.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection;var t=e.context._canvas;this._resolutionScale=t.width/t.clientWidth;var r=e.camera;this.updateCamera(r),e.mode===m.SCENE2D?(this._frustum2DWidth=r.frustum.right-r.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),w(this,e),this._fogDensity=e.fog.density,this._frameState=e,this._temeToPseudoFixed=p.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._imagerySplitPosition=e.imagerySplitPosition*t.clientWidth;var i,n=r.frustum.fov,a=this._viewport;i=a.height>a.width?2*Math.tan(.5*n)/a.height:2*Math.tan(.5*n)/a.width,this._geometricToleranceOverMeter=i*e.maximumScreenSpaceError,o.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};var q=new r,Y=new r,X=new r,Q=new r,Z=new r,K=new n,J=new r,$=new d;return g}),define("Renderer/Context",["../Core/clone","../Core/Color","../Core/ComponentDatatype","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Geometry","../Core/GeometryAttribute","../Core/Matrix4","../Core/PrimitiveType","../Core/RuntimeError","../Core/WebGLConstants","../Shaders/ViewportQuadVS","./BufferUsage","./ClearCommand","./ContextLimits","./CubeMap","./DrawCommand","./PassState","./PickFramebuffer","./RenderState","./ShaderCache","./ShaderProgram","./Texture","./UniformState","./VertexArray"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A){"use strict";function D(e,t){var r="WebGL Error: ";switch(t){case e.INVALID_ENUM:r+="INVALID_ENUM";break;case e.INVALID_VALUE:r+="INVALID_VALUE";break;case e.INVALID_OPERATION:r+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:r+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:r+="CONTEXT_LOST_WEBGL lost";break;default:r+="Unknown ("+t+")"}return r}function I(e,t,r,i){for(var n=D(e,i)+": "+t.name+"(",o=0;o<r.length;++o)0!==o&&(n+=", "),n+=r[o];return n+=");"}function M(e,t,r){var i=e.getError();if(i!==e.NO_ERROR)throw new p(I(e,t,r,i))}function O(e,t,r){return{get:function(){var i=e[t];return r(e,"get: "+t,i),e[t]},set:function(i){e[t]=i,r(e,"set: "+t,i)}}}function R(e,t){function r(r){return function(){var i=r.apply(e,arguments);return t(e,r,arguments),i}}if(!o(t))return e;var i={};for(var n in e){var a=e[n];a instanceof Function?i[n]=r(a):Object.defineProperty(i,n,O(e,n,t))}return i}function N(e,t){for(var r=t.length,i=0;i<r;++i){var n=e.getExtension(t[i]);if(n)return n}}function k(r,a){if("undefined"==typeof WebGLRenderingContext)throw new p("The browser does not support WebGL. Visit http://get.webgl.org.");this._canvas=r,a=e(a,!0),a=n(a,{}),a.allowTextureFilterAnisotropic=n(a.allowTextureFilterAnisotropic,!0);var s=n(a.webgl,{});s.alpha=n(s.alpha,!1),s.stencil=n(s.stencil,!0);var l,u=!1,c=u&&"undefined"!=typeof WebGL2RenderingContext,d=!1,h=a.getWebGLStub;if(o(h))l=h(r,s);else if(c&&(l=r.getContext("webgl2",s)||r.getContext("experimental-webgl2",s)||void 0,o(l)&&(d=!0)),o(l)||(l=r.getContext("webgl",s)||r.getContext("experimental-webgl",s)||void 0),!o(l))throw new p("The browser supports WebGL, but initialization failed.");this._originalGLContext=l,this._gl=l,this._webgl2=d,this._id=i(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new E(this);var m=l;this._stencilBits=m.getParameter(m.STENCIL_BITS),_._maximumCombinedTextureImageUnits=m.getParameter(m.MAX_COMBINED_TEXTURE_IMAGE_UNITS),_._maximumCubeMapSize=m.getParameter(m.MAX_CUBE_MAP_TEXTURE_SIZE),_._maximumFragmentUniformVectors=m.getParameter(m.MAX_FRAGMENT_UNIFORM_VECTORS),_._maximumTextureImageUnits=m.getParameter(m.MAX_TEXTURE_IMAGE_UNITS),_._maximumRenderbufferSize=m.getParameter(m.MAX_RENDERBUFFER_SIZE),_._maximumTextureSize=m.getParameter(m.MAX_TEXTURE_SIZE),_._maximumVaryingVectors=m.getParameter(m.MAX_VARYING_VECTORS),_._maximumVertexAttributes=m.getParameter(m.MAX_VERTEX_ATTRIBS),_._maximumVertexTextureImageUnits=m.getParameter(m.MAX_VERTEX_TEXTURE_IMAGE_UNITS),_._maximumVertexUniformVectors=m.getParameter(m.MAX_VERTEX_UNIFORM_VECTORS);var g=m.getParameter(m.ALIASED_LINE_WIDTH_RANGE);_._minimumAliasedLineWidth=g[0],_._maximumAliasedLineWidth=g[1];var v=m.getParameter(m.ALIASED_POINT_SIZE_RANGE);_._minimumAliasedPointSize=v[0],_._maximumAliasedPointSize=v[1];var y=m.getParameter(m.MAX_VIEWPORT_DIMS);_._maximumViewportWidth=y[0],_._maximumViewportHeight=y[1];var b=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_FLOAT);_._highpFloatSupported=0!==b.precision;var w=m.getShaderPrecisionFormat(m.FRAGMENT_SHADER,m.HIGH_INT);_._highpIntSupported=0!==w.rangeMax,this._antialias=m.getContextAttributes().antialias,this._standardDerivatives=!!N(m,["OES_standard_derivatives"]),this._elementIndexUint=!!N(m,["OES_element_index_uint"]),this._depthTexture=!!N(m,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._textureFloat=!!N(m,["OES_texture_float"]),this._fragDepth=!!N(m,["EXT_frag_depth"]),this._debugShaders=N(m,["WEBGL_debug_shaders"]),this._s3tc=!!N(m,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!N(m,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._etc1=!!N(m,["WEBGL_compressed_texture_etc1"]);var T=a.allowTextureFilterAnisotropic?N(m,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=T,_._maximumTextureFilterAnisotropy=o(T)?m.getParameter(T.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;var x,A,D,I,M,O,R,k,L,F;if(d){var B=this;x=function(){return B._gl.createVertexArray()},A=function(e){B._gl.bindVertexArray(e)},D=function(e){B._gl.deleteVertexArray(e)},I=function(e,t,r,i,n){m.drawElementsInstanced(e,t,r,i,n)},M=function(e,t,r,i){m.drawArraysInstanced(e,t,r,i)},O=function(e,t){m.vertexAttribDivisor(e,t)},R=function(e){m.drawBuffers(e)}}else k=N(m,["OES_vertex_array_object"]),o(k)&&(x=function(){return k.createVertexArrayOES()},A=function(e){k.bindVertexArrayOES(e)},D=function(e){k.deleteVertexArrayOES(e)}),L=N(m,["ANGLE_instanced_arrays"]),o(L)&&(I=function(e,t,r,i,n){L.drawElementsInstancedANGLE(e,t,r,i,n)},M=function(e,t,r,i){L.drawArraysInstancedANGLE(e,t,r,i)},O=function(e,t){L.vertexAttribDivisorANGLE(e,t)}),F=N(m,["WEBGL_draw_buffers"]),o(F)&&(R=function(e){F.drawBuffersWEBGL(e)});this.glCreateVertexArray=x,this.glBindVertexArray=A,this.glDeleteVertexArray=D,this.glDrawElementsInstanced=I,this.glDrawArraysInstanced=M,this.glVertexAttribDivisor=O,this.glDrawBuffers=R,this._vertexArrayObject=!!k,this._instancedArrays=!!L,this._drawBuffers=!!F,_._maximumDrawBuffers=this.drawBuffers?m.getParameter(f.MAX_DRAW_BUFFERS):1,_._maximumColorAttachments=this.drawBuffers?m.getParameter(f.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new t(0,0,0,0),this._clearDepth=1,this._clearStencil=0;var U=new P,V=new C(this),z=S.fromCache();this._defaultPassState=V,this._defaultRenderState=z,this._defaultTexture=void 0,this._defaultCubeMap=void 0,this._us=U,this._currentRenderState=z,this._currentPassState=V,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(var G=0;G<_._maximumVertexAttributes;G++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options=a,this.cache={},S.apply(m,z,V)}function L(e){}function F(e,t,r,i){var n=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=r,S.partialApply(e._gl,n,t,o,r,i)}function B(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;var r=H;if(o(t))t._bind(),L(e),r=t._getActiveColorAttachments();else{var i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(r)}}function U(e,t,r,i){var o=n(r._renderState,e._defaultRenderState);B(e,t),F(e,o,i,!1);var a=r._shaderProgram;a._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,a.maximumTextureUnitIndex)}function V(e,t){var r=t._primitiveType,i=t._vertexArray,a=t._offset,s=t._count,l=t.instanceCount;e._us.model=n(t._modelMatrix,d.IDENTITY),t._shaderProgram._setUniforms(t._uniformMap,e._us,e.validateShaderProgram),i._bind();var u=i.indexBuffer;o(u)?(a*=u.bytesPerIndex,s=n(s,u.numberOfIndices),0===l?e._gl.drawElements(r,s,u.indexDatatype,a):e.glDrawElementsInstanced(r,s,u.indexDatatype,a,l)):(s=n(s,i.numberOfVertices),0===l?e._gl.drawArrays(r,a,s):e.glDrawArraysInstanced(r,a,s,l)),i._unBind()}function z(e,t,r){this._pickObjects=e,this.key=t,this.color=r}var G={};a(k.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}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},standardDerivatives:{get:function(){return this._standardDerivatives}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture}},floatingPointTexture:{get:function(){return this._textureFloat}},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}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},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=R(this._originalGLContext,e?M:void 0)}},defaultTexture:{get:function(){return void 0===this._defaultTexture&&(this._defaultTexture=new x({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])}})),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 y({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e}})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight; +}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return G}}});var H;"undefined"!=typeof WebGLRenderingContext&&(H=[f.BACK]);var W=new v;k.prototype.clear=function(e,r){e=n(e,W),r=n(r,this._defaultPassState);var i=this._gl,a=0,s=e.color,l=e.depth,u=e.stencil;o(s)&&(t.equals(this._clearColor,s)||(t.clone(s,this._clearColor),i.clearColor(s.red,s.green,s.blue,s.alpha)),a|=i.COLOR_BUFFER_BIT),o(l)&&(l!==this._clearDepth&&(this._clearDepth=l,i.clearDepth(l)),a|=i.DEPTH_BUFFER_BIT),o(u)&&(u!==this._clearStencil&&(this._clearStencil=u,i.clearStencil(u)),a|=i.STENCIL_BUFFER_BIT);var c=n(e.renderState,this._defaultRenderState);F(this,c,r,!0);var d=n(e.framebuffer,r.framebuffer);B(this,d),i.clear(a)},k.prototype.draw=function(e,t){t=n(t,this._defaultPassState);var r=n(e._framebuffer,t.framebuffer);U(this,r,e,t),V(this,e)},k.prototype.endFrame=function(){var e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);var t=H;this.drawBuffers&&this.glDrawBuffers(t);var r=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(var i=0;i<r;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)},k.prototype.readPixels=function(e){var t=this._gl;e=e||{};var r=Math.max(e.x||0,0),i=Math.max(e.y||0,0),n=e.width||t.drawingBufferWidth,o=e.height||t.drawingBufferHeight,a=e.framebuffer,s=new Uint8Array(4*n*o);return B(this,a),t.readPixels(r,i,n,o,t.RGBA,t.UNSIGNED_BYTE,s),s};var j={position:0,textureCoordinates:1};return k.prototype.getViewportQuadVertexArray=function(){var e=this.cache.viewportQuad_vertexArray;if(!o(e)){var t=new u({attributes:{position:new c({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new c({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:h.TRIANGLES});e=A.fromGeometry({context:this,geometry:t,attributeLocations:j,bufferUsage:g.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e},k.prototype.createViewportQuadCommand=function(e,t){return t=n(t,n.EMPTY_OBJECT),new b({vertexArray:this.getViewportQuadVertexArray(),primitiveType:h.TRIANGLES,renderState:t.renderState,shaderProgram:T.fromCache({context:this,vertexShaderSource:m,fragmentShaderSource:e,attributeLocations:j}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer})},k.prototype.createPickFramebuffer=function(){return new w(this)},k.prototype.getObjectByPickColor=function(e){return this._pickObjects[e.toRgba()]},a(z.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}}),z.prototype.destroy=function(){delete this._pickObjects[this.key]},k.prototype.createPickId=function(e){++this._nextPickColor[0];var r=this._nextPickColor[0];if(0===r)throw new p("Out of unique Pick IDs.");return this._pickObjects[r]=e,new z(this._pickObjects,r,t.fromRgba(r))},k.prototype.isDestroyed=function(){return!1},k.prototype.destroy=function(){var e=this.cache;for(var t in e)if(e.hasOwnProperty(t)){var r=e[t];o(r.destroy)&&r.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),s(this)},k}),define("Renderer/loadCubeMap",["../Core/defined","../Core/DeveloperError","../Core/loadImage","../ThirdParty/when","./CubeMap"],function(e,t,r,i,n){"use strict";function o(e,t,o){var a=[r(t.positiveX,o),r(t.negativeX,o),r(t.positiveY,o),r(t.negativeY,o),r(t.positiveZ,o),r(t.negativeZ,o)];return i.all(a,function(t){return new n({context:e,source:{positiveX:t[0],negativeX:t[1],positiveY:t[2],negativeY:t[3],positiveZ:t[4],negativeZ:t[5]}})})}return o}),define("Scene/DiscardMissingTileImagePolicy",["../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/getImagePixels","../Core/loadImageViaBlob","../ThirdParty/when"],function(e,t,r,i,n,o){"use strict";function a(r){function a(e){t(e.blob)&&(l._missingImageByteLength=e.blob.size);var n=i(e);if(r.disableCheckIfAllPixelsAreTransparent){for(var o=!0,a=e.width,s=r.pixelsToCheck,u=0,c=s.length;o&&u<c;++u){var d=s[u],h=4*d.x+d.y*a,p=n[h+3];p>0&&(o=!1)}o&&(n=void 0)}l._missingImagePixels=n,l._isReady=!0}function s(){l._missingImagePixels=void 0,l._isReady=!0}r=e(r,e.EMPTY_OBJECT),this._pixelsToCheck=r.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;var l=this;o(n(r.missingImageUrl),a,s)}return a.prototype.isReady=function(){return this._isReady},a.prototype.shouldDiscardImage=function(e){var r=this._pixelsToCheck,n=this._missingImagePixels;if(!t(n))return!1;if(t(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;for(var o=i(e),a=e.width,s=0,l=r.length;s<l;++s)for(var u=r[s],c=4*u.x+u.y*a,d=0;d<4;++d){var h=c+d;if(o[h]!==n[h])return!1}return!0},a}),define("Scene/ImageryLayerFeatureInfo",["../Core/defined"],function(e){"use strict";function t(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}return t.prototype.configureNameFromProperties=function(t){var r,i=10;for(var n in t)if(t.hasOwnProperty(n)&&t[n]){var o=n.toLowerCase();i>1&&"name"===o?(i=1,r=n):i>2&&"title"===o?(i=2,r=n):i>3&&/name/i.test(n)?(i=3,r=n):i>4&&/title/i.test(n)&&(i=4,r=n)}e(r)&&(this.name=t[r])},t.prototype.configureDescriptionFromProperties=function(t){function r(t){var i='<table class="cesium-infoBox-defaultTable">';for(var n in t)if(t.hasOwnProperty(n)){var o=t[n];e(o)&&(i+="object"==typeof o?"<tr><td>"+n+"</td><td>"+r(o)+"</td></tr>":"<tr><td>"+n+"</td><td>"+o+"</td></tr>")}return i+="</table>"}this.description=r(t)},t}),define("Scene/ImageryProvider",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/loadCRN","../Core/loadImage","../Core/loadImageViaBlob","../Core/loadKTX","../Core/throttleRequestByServer"],function(e,t,r,i,n,o,a,s){"use strict";function l(){this.defaultAlpha=void 0,this.defaultBrightness=void 0,this.defaultContrast=void 0,this.defaultHue=void 0,this.defaultSaturation=void 0,this.defaultGamma=void 0,r.throwInstantiationError()}t(l.prototype,{ready:{get:r.throwInstantiationError},readyPromise:{get:r.throwInstantiationError},rectangle:{get:r.throwInstantiationError},tileWidth:{get:r.throwInstantiationError},tileHeight:{get:r.throwInstantiationError},maximumLevel:{get:r.throwInstantiationError},minimumLevel:{get:r.throwInstantiationError},tilingScheme:{get:r.throwInstantiationError},tileDiscardPolicy:{get:r.throwInstantiationError},errorEvent:{get:r.throwInstantiationError},credit:{get:r.throwInstantiationError},proxy:{get:r.throwInstantiationError},hasAlphaChannel:{get:r.throwInstantiationError}}),l.prototype.getTileCredits=r.throwInstantiationError,l.prototype.requestImage=r.throwInstantiationError,l.prototype.pickFeatures=r.throwInstantiationError;var u=/\.ktx$/i,c=/\.crn$/i;return l.loadImage=function(t,r){return u.test(r)?s(r,a):c.test(r)?s(r,i):e(t.tileDiscardPolicy)?s(r,o):s(r,n)},l}),define("Scene/ArcGisMapServerImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadJson","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../ThirdParty/when","./DiscardMissingTileImagePolicy","./ImageryLayerFeatureInfo","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C){"use strict";function w(r){function a(n){var a=n.tileInfo;if(o(a)){if(b._tileWidth=a.rows,b._tileHeight=a.cols,102100===a.spatialReference.wkid||102113===a.spatialReference.wkid)b._tilingScheme=new v({ellipsoid:r.ellipsoid});else{if(4326!==n.tileInfo.spatialReference.wkid){var s="Tile spatial reference WKID "+n.tileInfo.spatialReference.wkid+" is not supported.";return void(h=m.handleError(h,b,b._errorEvent,s,void 0,void 0,void 0,c))}b._tilingScheme=new u({ellipsoid:r.ellipsoid})}if(b._maximumLevel=n.tileInfo.lods.length-1,o(n.fullExtent)){if(o(n.fullExtent.spatialReference)&&o(n.fullExtent.spatialReference.wkid))if(102100===n.fullExtent.spatialReference.wkid||102113===n.fullExtent.spatialReference.wkid){var l=new g,d=n.fullExtent,f=l.unproject(new t(Math.max(d.xmin,-b._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(d.ymin,-b._tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),_=l.unproject(new t(Math.min(d.xmax,b._tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(d.ymax,b._tilingScheme.ellipsoid.maximumRadius*Math.PI),0));b._rectangle=new p(f.longitude,f.latitude,_.longitude,_.latitude)}else{if(4326!==n.fullExtent.spatialReference.wkid){var C="fullExtent.spatialReference WKID "+n.fullExtent.spatialReference.wkid+" is not supported.";return void(h=m.handleError(h,b,b._errorEvent,C,void 0,void 0,void 0,c))}b._rectangle=p.fromDegrees(n.fullExtent.xmin,n.fullExtent.ymin,n.fullExtent.xmax,n.fullExtent.ymax)}}else b._rectangle=b._tilingScheme.rectangle;o(b._tileDiscardPolicy)||(b._tileDiscardPolicy=new y({missingImageUrl:S(b,0,0,b._maximumLevel),pixelsToCheck:[new e(0,0),new e(200,20),new e(20,200),new e(80,110),new e(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),b._useTiles=!0}else b._useTiles=!1;o(n.copyrightText)&&n.copyrightText.length>0&&(b._credit=new i(n.copyrightText)),b._ready=!0,b._readyPromise.resolve(!0),m.handleSuccess(h)}function s(e){var t="An error occurred while accessing "+b._url+".";h=m.handleError(h,b,b._errorEvent,t,void 0,void 0,void 0,c),b._readyPromise.reject(new f(t))}function c(){var e={f:"json"};o(b._token)&&(e.token=b._token);var t=d(b._url,{parameters:e,proxy:b._proxy});_(t,a,s)}r=n(r,{}),this._url=r.url,this._token=r.token,this._tileDiscardPolicy=r.tileDiscardPolicy,this._proxy=r.proxy,this._tileWidth=n(r.tileWidth,256),this._tileHeight=n(r.tileHeight,256),this._maximumLevel=r.maximumLevel,this._tilingScheme=n(r.tilingScheme,new u({ellipsoid:r.ellipsoid})),this._credit=void 0,this._useTiles=n(r.usePreCachedTilesIfAvailable,!0),this._rectangle=n(r.rectangle,this._tilingScheme.rectangle),this._layers=r.layers,this.enablePickFeatures=n(r.enablePickFeatures,!0),this._errorEvent=new l,this._ready=!1,this._readyPromise=_.defer();var h,b=this;this._useTiles?c():(this._ready=!0,this._readyPromise.resolve(!0))}function S(e,t,r,i){var n;if(e._useTiles)n=e._url+"/tile/"+i+"/"+r+"/"+t;else{var a=e._tilingScheme.tileXYToNativeRectangle(t,r,i),s=a.west+"%2C"+a.south+"%2C"+a.east+"%2C"+a.north;n=e._url+"/export?",n+="bbox="+s,n+=e._tilingScheme instanceof u?"&bboxSR=4326&imageSR=4326":"&bboxSR=3857&imageSR=3857",n+="&size="+e._tileWidth+"%2C"+e._tileHeight,n+="&format=png&transparent=true&f=image",e.layers&&(n+="&layers=show:"+e.layers)}var l=e._token;o(l)&&(n.indexOf("?")===-1&&(n+="?"),"?"!==n[n.length-1]&&(n+="&"),n+="token="+l);var c=e._proxy;return o(c)&&(n=c.getURL(n)),n}return a(w.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._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}}}),w.prototype.getTileCredits=function(e,t,r){},w.prototype.requestImage=function(e,t,r){var i=S(this,e,t,r);return C.loadImage(this,i)},w.prototype.pickFeatures=function(e,i,n,a,s){if(this.enablePickFeatures){var l,d,p,f=this._tilingScheme.tileXYToNativeRectangle(e,i,n);if(this._tilingScheme instanceof u)l=h.toDegrees(a),d=h.toDegrees(s),p="4326";else{var m=this._tilingScheme.projection.project(new r(a,s,0));l=m.x,d=m.y,p="3857"}var v=this._url+"/identify?f=json&tolerance=2&geometryType=esriGeometryPoint";return v+="&geometry="+l+","+d,v+="&mapExtent="+f.west+","+f.south+","+f.east+","+f.north,v+="&imageDisplay="+this._tileWidth+","+this._tileHeight+",96",v+="&sr="+p,v+="&layers=visible",o(this._layers)&&(v+=":"+this._layers),o(this._token)&&(v+="&token="+this._token),o(this._proxy)&&(v=this._proxy.getURL(v)),c(v).then(function(e){var i=[],n=e.results;if(!o(n))return i;for(var a=0;a<n.length;++a){var s=n[a],l=new b;if(l.data=s,l.name=s.value,l.properties=s.attributes,l.configureDescriptionFromProperties(s.attributes),"esriGeometryPoint"===s.geometryType&&s.geometry){var u=s.geometry.spatialReference&&s.geometry.spatialReference.wkid?s.geometry.spatialReference.wkid:4326;if(4326===u||4283===u)l.position=r.fromDegrees(s.geometry.x,s.geometry.y,s.geometry.z);else if(102100===u||900913===u||3857===u){var c=new g;l.position=c.unproject(new t(s.geometry.x,s.geometry.y,s.geometry.z))}}i.push(l)}return i})}},w}),define("Scene/BingMapsStyle",["../Core/freezeObject"],function(e){"use strict";var t={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",ROAD:"Road",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"};return e(t)}),define("Scene/BingMapsImageryProvider",["../Core/BingMapsApi","../Core/Cartesian2","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/loadJsonp","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./BingMapsStyle","./DiscardMissingTileImagePolicy","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(o){function a(e){var i=e.resourceSets[0].resources[0];S._tileWidth=i.imageWidth,S._tileHeight=i.imageHeight,S._maximumLevel=i.zoomMax-1,S._imageUrlSubdomains=i.imageUrlSubdomains,S._imageUrlTemplate=i.imageUrl.replace("{culture}",S._culture);var o=S._tileProtocol;if(!n(o)){var a=document.location.protocol;o=/^http/.test(a)?a:"http:"}S._imageUrlTemplate=S._imageUrlTemplate.replace(/^http:/,o),n(S._tileDiscardPolicy)||(S._tileDiscardPolicy=new g({missingImageUrl:y(S,0,0,S._maximumLevel),pixelsToCheck:[new t(0,0),new t(120,140),new t(130,160),new t(200,50),new t(200,200)],disableCheckIfAllPixelsAreTransparent:!0}));var s=S._attributionList=i.imageryProviders;s||(s=S._attributionList=[]);for(var l=0,d=s.length;l<d;++l){var p=s[l];p.credit=new r(p.attribution);for(var f=p.coverageAreas,m=0,v=p.coverageAreas.length;m<v;++m){var _=f[m],b=_.bbox;_.bbox=new c(u.toRadians(b[1]),u.toRadians(b[0]),u.toRadians(b[3]),u.toRadians(b[2]))}}S._ready=!0,S._readyPromise.resolve(!0),h.handleSuccess(C)}function v(e){var t="An error occurred while accessing "+w+".";C=h.handleError(C,S,S._errorEvent,t,void 0,void 0,void 0,b),S._readyPromise.reject(new d(t))}function b(){var e=l(w,{callbackParameterName:"jsonp",proxy:S._proxy});f(e,a,v)}o=i(o,{}),this._key=e.getKey(o.key),this._keyErrorCredit=e.getErrorCredit(o.key),this._url=o.url,this._tileProtocol=o.tileProtocol,this._mapStyle=i(o.mapStyle,m.AERIAL),this._culture=i(o.culture,""),this._tileDiscardPolicy=o.tileDiscardPolicy,this._proxy=o.proxy,this._credit=new r("Bing Imagery",_._logoData,"http://www.bing.com"),this.defaultGamma=1,this._tilingScheme=new p({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:o.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._errorEvent=new s,this._ready=!1,this._readyPromise=f.defer();var C,w=this._url+"/REST/v1/Imagery/Metadata/"+this._mapStyle+"?incl=ImageryProviders&key="+this._key,S=this;b()}function y(e,t,r,i){var o=e._imageUrlTemplate,a=_.tileXYToQuadKey(t,r,i);o=o.replace("{quadkey}",a);var s=e._imageUrlSubdomains,l=(t+r+i)%s.length;o=o.replace("{subdomain}",s[l]);var u=e._proxy;return n(u)&&(o=u.getURL(o)),o}function b(e,t,r){++t;for(var i=[],o=0,a=e.length;o<a;++o){for(var s=e[o],l=s.coverageAreas,u=!1,d=0,h=s.coverageAreas.length;!u&&d<h;++d){var p=l[d];if(t>=p.zoomMin&&t<=p.zoomMax){var f=c.intersection(r,p.bbox,w);n(f)&&(u=!0)}}u&&i.push(s.credit)}return i}o(_.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._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 C=new c;_.prototype.getTileCredits=function(e,t,r){var i=this._tilingScheme.tileXYToRectangle(e,t,r,C),o=b(this._attributionList,r,i);return n(this._keyErrorCredit)&&o.push(this._keyErrorCredit),o},_.prototype.requestImage=function(e,t,r){var i=y(this,e,t,r);return v.loadImage(this,i)},_.prototype.pickFeatures=function(e,t,r,i,n){},_._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD0AAAAaCAYAAAAEy1RnAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH3gIDEgcPTMnXOQAAClZJREFUWMPdWGtsFNcV/u689uH1+sXaONhlWQzBENtxiUFBpBSLd60IpXHSNig4URtSYQUkRJNSi0igViVVVBJBaBsiAgKRQJSG8AgEHCCWU4iBCprY2MSgXfOI16y9D3s9Mzsztz9yB12WNU2i9Ecy0tHOzN4793zn3POdcy7BnRfJ8I7iB3SRDPeEExswLz8Y0DZIAYDIRGAgLQAm+7Xle31J3L3Anp1MZPY+BUBjorN332vgYhpgV1FRUd6TTz45ubq6OtDV1SXpuu5g//Oept9wNwlMyAi8IXDjyF245TsDTdivDMATCATGNDU1/WbhwoWPTZs2bWx1dXWhx+Oxrl+/PqTrus5t9W8KWEzjinTAYhro/xuBStwiIgBnJBLxKIoy1u/3V/r9/krDMMz3339/Z3t7e38ikUgCMDLEt8W+Q0cAI3McYTDDmZxh7DESG5Ni43jg9Gsa+X+OsxWxPSJTSj3JZFK5ZRVJErOzs8e6XC4fgGwALhbzDgAKU1hK28KEA6PMmTMn56233qpevnz5PQDcbJ7EzVUAuMrLy3MBeABkcWOEDELSyFe4y7iMoHkriZZlKYZh8ASHZDKpJJPJHAC5APIA5APIAeBlCjo5TwlpXnbOmTPHP3fu3KZVq1atZKBcDJQ9x7V48WJfc3Pzhp6enj+tXLnyR8w4MjdG4gyVDk7KICMClzKlLUrpbQMNw5AkScppbGz8cWdn57WjR4/2caw+DEBlYjO8wX1foZQWuN3uKZIklQD4G+fhlG0Yl8uVm5WVVW6app6dne0D0G8vnxbjJntHubCUOK/badZICyWanrJuAaeUknTQpmlKkUhEWbx48U8LCwtHhUKha+fPn+85fPhwV0tLyzUACSZx9jvMFhIByNFoVDEMw/qKB5HPvJfkUqBr9+7deklJyZ/j8bi5ffv2OAslieMLsG+m2DybT2QuzEQOsF5SUqJfvXo1yc2l6Xn6rgSRSCSEc+fOhVeuXLmwoqJixvTp0wcWLFgQ7unpudHR0dF97ty5z/fu3XseQJh5adjeerquy5ZlCalUivh8Pt8HH3ywzOPxyD09PZ81NjZ+2NnZaQEQx40b54vFYqaqquEVK1b4a2tr/WvWrDn18ssv144fP36SqqoD69ev371nz57rDLwAwHHkyJGfjRs3rtowDOv06dOnu7q6rs6bN2/s7Nmz9zIjDKenWoFZKg/AlMLCwl82Nzf/m3LX22+/fXb06NF/ALC8u7u7m6ZdkUhksL29/UpLS0vzunXrVgAoBzAaQBGAiY2NjUui0ei1RCLRFwwG/9PX19cVi8WCqqoOdHd3HysrK6sDMCccDl8IBoOtiqIsOnbs2D+i0eiV3t7ez8Ph8GeRSKRT07TB/v7+i1OnTp0HYBqABzs7O/+paVo0Fot1RyKRi/F4/Gp/f39XIpHoZnoUMn6wU+ZtRDaymwmxZFk2AWjvvvvuJ/F4PMn/n5+fn1VeXu6fOXNmbU1NzUOM4Bz8QqIoyg6HwxuLxfq3bdu2a+vWrW/09/dfKy0tffDVV199BEC20+n0ud3uQgBup9Pp83g8JYqieE+ePPnxxo0bt33xxRen8/Ly7n3hhRcWASh47bXX5pWVldWFw+GuXbt27XjzzTd3BoPBDq/XG1AUZRRHmAKPVfqaoKkgCCkA+oYNG84Eg0FHTU1N5ezZs8eWlJQ4CSF8/LvZYhJPQoQQpFKpwcrKyo1su9HBwUF99erVv588eXINgOOmacIwDEopdaZSKUIpxYkTJz6sr68/BMBav379RcMwZk2aNOl+AP+qq6t7xDTNVEVFxR+j0WgSAJk4ceKlTz/9tNzpdHpZvIvpjVW6pykhhBJCbkvwgiAQQogEQL558ybdtGlTsLm5OWJZdxZmlmWll5OUEEJN0zSGhob6GcOrALSzZ8/2apqWcLlc2axGACNRkRAimqaph0Kh68xIwwB0y7IMSZKcABz5+fkl8Xj8y2g0apOb5na7rYGBgS/JV54Q0qpAAoBKaS0jBWClg1ZVFeFw2AlgVF1dXeDpp5+eWVFRUVpcXOzgvQwAbrcbDJhdudlGpKZpGtx6JCcnRxIEQbQsS2PjbjM+AMvlchnMSBaXkr7ymCCIhmEYfMoVRVESBEHI0CaTTNubssUsQRBuubCtra33pZdeCk6YMCGwZs2aipqaGn9paWmuJEl3JP0bN258eeTIkRMABrm0YomiaImiKGVlZeWxLecAgBkzZvgdDkfWjRs3ggA0bpfpoiiahBCqKEqKAy2yULMA6MlkMp6Xl3cP1x2SWCwmFhQU+CmlFhfHNFOevpX4LcvSJUkyAeDQoUOh119//fpTTz01Zf78+UWBQCBHUZQ7yE/TNGPfvn0n33vvvSP79+//BECMeZsCMGRZNgRBgNPpHHXx4sVVDQ0Nf1+wYMGYJ554YikAevDgwUMA4oIgQJZlSggZdDqdBiGEZGdn6ww0tQlJURTT4/EMHz9+/MCjjz7622AwuHbZsmVbiouLvWvXrm1wOp3ZqVRqaKQTIInf1gAMl8ulU0q1CxcuBGOxmL5u3bryQCDgycrKEjORXGtra8eOHTsOHz169OyVK1cuA+hlRYrGlNRkWR7UNO2mYRiaz+cb3dLS8gYhhOi6Hj116tSOVatWHQNALcsaME0zLghClBDSZ9+zQsZ2SoJS2udwOKLPPffcvsrKyrJAIPDQ/v37txiGofX19V3r7e29UlBQMHqEVpjwnrYA6PF4PK6q6s2qqqqpZWVlitvtljOB7enpiWzbtu3wgQMHTre1tV0E0MeKkkGuIhMAqHv37u30er3Px+NxlyiKygMPPOAnhFiXLl0Kbd68uYPNsXbu3Lk6mUwaqqr2btmyZUdtbe3hd955pwvAEFNcO3jw4K/b2tqiqqpGIpGI4/HHH/9rQ0PDCa/XOyoSidDLly8PNTU1PcZ4QuNK1ju6NYHFRAGASXPnzv1Fa2vrxzTDpapqateuXR/Nnz+/SVGUhwFMBzCBFSLZLF75DsrJGpXRAH4EIABgPIBxAEoBFAPwARjFif1sNzZ25+VlOhaxufcCqAFQC+BhAPVLliz5XSqVUkOhUAuAKWnFyR3dlsw+fg+A+8eMGfPzTZs2bY9GozEb8JkzZ9qXLl36l+Li4l8B+AmAyQDGsGrOzfXNPGPawG2l85jksmcPm+vihH+2W1iF3bvZPN+sWbPuGx4eDrW3t+85fvz41o6OjmZN04Y0TYvV19cvYIbN5QqUjG2mwj5YAqDK4XDMe+aZZ55vbW09+sorr2yuqqpqYFatAuBn3uB7XzJCY297XeaUd2RoGzOJmHb6IjFj5D777LP3DQwMfDw8PBxSVbUvkUj0hEKhj1588cXH2O7zMSPdplumoxveMx5Zlj3jx4/39vb26gMDA4MsvgYZo+p8Pr7LqQX5Ds/U7d0jFxUVZS1atKg4Nzc317Isp67rZldXV6y5ufkmI78hFtcmrx8ZweMit6XsUs4+6kmlgbW+peLf9gyMZNCR374G0y/FxEzX8b/8+bkXEBxKFwAAAABJRU5ErkJggg==",_.tileXYToQuadKey=function(e,t,r){for(var i="",n=r;n>=0;--n){var o=1<<n,a=0;0!==(e&o)&&(a|=1),0!==(t&o)&&(a|=2),i+=a}return i},_.quadKeyToTileXY=function(e){for(var t=0,r=0,i=e.length-1,n=i;n>=0;--n){var o=1<<n,a=+e[i-n];0!==(1&a)&&(t|=o),0!==(2&a)&&(r|=o)}return{x:t,y:r,level:i}};var w=new c;return _}),define("Scene/PerspectiveOffCenterFrustum",["../Core/Cartesian3","../Core/Cartesian4","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Matrix4","./CullingVolume"],function(e,t,r,i,n,o,a){"use strict";function s(){this.left=void 0,this._left=void 0,this.right=void 0,this._right=void 0,this.top=void 0,this._top=void 0,this.bottom=void 0,this._bottom=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this._cullingVolume=new a,this._perspectiveMatrix=new o,this._infinitePerspective=new o}function l(e){var t=e.top,r=e.bottom,i=e.right,n=e.left,a=e.near,s=e.far;t===e._top&&r===e._bottom&&n===e._left&&i===e._right&&a===e._near&&s===e._far||(e._left=n,e._right=i,e._top=t,e._bottom=r,e._near=a,e._far=s,e._perspectiveMatrix=o.computePerspectiveOffCenter(n,i,r,t,a,s,e._perspectiveMatrix),e._infinitePerspective=o.computeInfinitePerspectiveOffCenter(n,i,r,t,a,e._infinitePerspective))}i(s.prototype,{projectionMatrix:{get:function(){return l(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return l(this),this._infinitePerspective}}});var u=new e,c=new e,d=new e,h=new e;return s.prototype.computeCullingVolume=function(i,n,o){var a=this._cullingVolume.planes,s=this.top,l=this.bottom,p=this.right,f=this.left,m=this.near,g=this.far,v=e.cross(n,o,u),_=c;e.multiplyByScalar(n,m,_),e.add(i,_,_);var y=d;e.multiplyByScalar(n,g,y),e.add(i,y,y);var b=h;e.multiplyByScalar(v,f,b),e.add(_,b,b),e.subtract(b,i,b),e.normalize(b,b),e.cross(b,o,b),e.normalize(b,b);var C=a[0];return r(C)||(C=a[0]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,i),e.multiplyByScalar(v,p,b),e.add(_,b,b),e.subtract(b,i,b),e.cross(o,b,b),e.normalize(b,b),C=a[1],r(C)||(C=a[1]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,i),e.multiplyByScalar(o,l,b),e.add(_,b,b),e.subtract(b,i,b),e.cross(v,b,b),e.normalize(b,b),C=a[2],r(C)||(C=a[2]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,i),e.multiplyByScalar(o,s,b),e.add(_,b,b),e.subtract(b,i,b),e.cross(b,v,b),e.normalize(b,b),C=a[3],r(C)||(C=a[3]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,i),C=a[4],r(C)||(C=a[4]=new t),C.x=n.x,C.y=n.y,C.z=n.z,C.w=-e.dot(n,_),e.negate(n,b),C=a[5],r(C)||(C=a[5]=new t),C.x=b.x,C.y=b.y,C.z=b.z,C.w=-e.dot(b,y),this._cullingVolume},s.prototype.getPixelDimensions=function(e,t,r,i){l(this);var n=1/this.near,o=this.top*n,a=2*r*o/t;o=this.right*n;var s=2*r*o/e;return i.x=s,i.y=a,i},s.prototype.clone=function(e){return r(e)||(e=new s),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},s.prototype.equals=function(e){return r(e)&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far},s}),define("Scene/PerspectiveFrustum",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","./PerspectiveOffCenterFrustum"],function(e,t,r,i){"use strict";function n(){this._offCenterFrustum=new i,this.fov=void 0,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=void 0,this._aspectRatio=void 0,this.near=1,this._near=this.near,this.far=5e8,this._far=this.far,this.xOffset=0,this._xOffset=this.xOffset,this.yOffset=0,this._yOffset=this.yOffset}function o(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)}return t(n.prototype,{projectionMatrix:{get:function(){return o(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return o(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return o(this),this._fovy}},sseDenominator:{get:function(){return o(this),this._sseDenominator}}}),n.prototype.computeCullingVolume=function(e,t,r){return o(this),this._offCenterFrustum.computeCullingVolume(e,t,r)},n.prototype.getPixelDimensions=function(e,t,r,i){return o(this),this._offCenterFrustum.getPixelDimensions(e,t,r,i)},n.prototype.clone=function(t){return e(t)||(t=new n),t.aspectRatio=this.aspectRatio,t.fov=this.fov,t.near=this.near,t.far=this.far,t._aspectRatio=void 0,t._fov=void 0,t._near=void 0,t._far=void 0,this._offCenterFrustum.clone(t._offCenterFrustum),t},n.prototype.equals=function(t){return!!e(t)&&(o(this),o(t),this.fov===t.fov&&this.aspectRatio===t.aspectRatio&&this.near===t.near&&this.far===t.far&&this._offCenterFrustum.equals(t._offCenterFrustum))},n}),define("Scene/CameraFlightPath",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e,t,r){var i,n,o;if(e instanceof l){var a=Math.tan(.5*e.fovy);return i=e.near,n=e.near*a,o=e.aspectRatio*n,Math.max(t*i/o,r*i/n)}return e instanceof u?(i=e.near,n=e.top,o=e.right,Math.max(t*i/o,r*i/n)):Math.max(t,r)}function h(e,t,r,i){if(n(i)&&r(.5)>i){var o=r(0),a=r(1),l=r(.5),u=l-o,c=l-a;return function(i){var n=r(i);if(i<=.5){var l=(n-o)/u;return s.lerp(e,-s.PI_OVER_TWO,l)}var d=(n-a)/c;return s.lerp(-s.PI_OVER_TWO,t,1-d)}}return function(r){return s.lerp(e,t,r)}}function p(e,r,i,o,a){var l=a,u=Math.max(i,o);if(!n(l)){var c=e.position,h=r,p=e.up,f=e.right,m=e.frustum,g=t.subtract(c,h,S),v=t.magnitude(t.multiplyByScalar(p,t.dot(g,p),E)),_=t.magnitude(t.multiplyByScalar(f,t.dot(g,f),E));l=Math.min(.2*d(m,v,_),1e9)}if(u<l){var y=8,b=1e6,C=-Math.pow((l-i)*b,1/y),w=Math.pow((l-o)*b,1/y);return function(e){var t=e*(w-C)+C;return-Math.pow(t,y)/b+l}}return function(e){return s.lerp(i,o,e)}}function f(e,t){return s.equalsEpsilon(e,s.TWO_PI,s.EPSILON11)&&(e=0),t>e+Math.PI?e+=s.TWO_PI:t<e-Math.PI&&(e-=s.TWO_PI),e}function m(r,i,n,o,a,l,u){function c(t){var r=t.time/i;d.setView({orientation:{heading:s.lerp(g,o,r),pitch:s.lerp(m,a,r),roll:s.lerp(v,l,r)}}),e.lerp(h,n,r,d.position),d.position.z=_(r)}var d=r.camera,h=t.clone(d.position,T),m=d.pitch,g=f(d.heading,o),v=f(d.roll,l),_=p(d,n,h.z,n.z,u);return c}function g(e,t){e.longitude<t.longitude?e.longitude+=s.TWO_PI:t.longitude+=s.TWO_PI}function v(e,t){var r=e.longitude-t.longitude;r<-s.PI?e.longitude+=s.TWO_PI:r>s.PI&&(t.longitude+=s.TWO_PI)}function _(e,i,o,a,l,u,c,d,m,_){function y(){var e=S.longitude,r=D.longitude,n=S.latitude,o=D.latitude;return function(l){var c=l.time/i,d=t.fromRadians(s.lerp(e,r,c),s.lerp(n,o,c),U(c));b.setView({destination:d,orientation:{heading:s.lerp(T,a,c),pitch:V(c),roll:s.lerp(A,u,c)}})}}var b=e.camera,C=e.mapProjection,w=C.ellipsoid,S=r.clone(b.positionCartographic,x),E=b.pitch,T=f(b.heading,a),A=f(b.roll,u),D=w.cartesianToCartographic(o,P);S.longitude=s.zeroToTwoPi(S.longitude),D.longitude=s.zeroToTwoPi(D.longitude);var I=!1;if(n(d)){var M=s.zeroToTwoPi(d),O=Math.min(S.longitude,D.longitude),R=Math.max(S.longitude,D.longitude),N=M>=O&&M<=R;if(n(m)){var k=Math.abs(S.longitude-D.longitude),L=s.TWO_PI-k,F=N?k:L,B=N?L:k;F<B*m&&!N&&(I=!0)}else N||(I=!0)}I?g(S,D):v(S,D);var U=p(b,o,S.height,D.height,c),V=h(E,l,U,_);return y()}function y(r,i,n,o,a,l,u){function c(t){var r=t.time/i;d.setView({orientation:{heading:s.lerp(m,o,r)}}),e.lerp(h,n,r,d.position);var a=v(r),l=d.frustum,u=l.top/l.right,c=.5*(a-(l.right-l.left));l.right+=c,l.left-=c,l.top=u*l.right,l.bottom=-l.top}var d=r.camera,h=t.clone(d.position,T),m=f(d.heading,o),g=d.frustum.right-d.frustum.left,v=p(d,n,g,n.z,u);return c}function b(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function C(e,t){function r(){"function"==typeof t&&t(),e.enableInputs=!0}return r}var w={},S=new t,E=new t,T=new t,x=new r,P=new r,A=new r,D=new t;return w.createTween=function(r,o){o=i(o,i.EMPTY_OBJECT);var l=o.destination,u=r.mode;if(u===c.MORPHING)return b();var d=i(o.convert,!0),h=r.mapProjection,p=h.ellipsoid,f=o.maximumHeight,g=o.flyOverLongitude,v=o.flyOverLongitudeWeight,w=o.pitchAdjustHeight,S=o.easingFunction;d&&u!==c.SCENE3D&&(p.cartesianToCartographic(l,A),l=h.project(A,D));var E=r.camera,T=o.endTransform;n(T)&&E._setTransform(T);var x=o.duration;n(x)||(x=Math.ceil(t.distance(E.position,l)/1e6)+2,x=Math.min(x,3));var P=i(o.heading,0),I=i(o.pitch,-s.PI_OVER_TWO),M=i(o.roll,0),O=r.screenSpaceCameraController;O.enableInputs=!1;var R=C(O,o.complete),N=C(O,o.cancel),k=E.frustum,L=r.mode===c.SCENE2D;if(L=L&&e.equalsEpsilon(E.position,l,s.EPSILON6),L=L&&s.equalsEpsilon(Math.max(k.right-k.left,k.top-k.bottom),l.z,s.EPSILON6),L=L||r.mode!==c.SCENE2D&&t.equalsEpsilon(l,E.position,s.EPSILON10),L=L&&s.equalsEpsilon(s.negativePiToPi(P),s.negativePiToPi(E.heading),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(I),s.negativePiToPi(E.pitch),s.EPSILON10)&&s.equalsEpsilon(s.negativePiToPi(M),s.negativePiToPi(E.roll),s.EPSILON10))return b(R,N);var F=new Array(4);if(F[c.SCENE2D]=y,F[c.SCENE3D]=_,F[c.COLUMBUS_VIEW]=m,x<=0){var B=function(){var e=F[u](r,1,l,P,I,M,f,g,v,w);e({time:1}),"function"==typeof R&&R()};return b(B,N)}var U=F[u](r,x,l,P,I,M,f,g,v,w);if(!n(S)){var V=E.positionCartographic.height,z=u===c.SCENE3D?p.cartesianToCartographic(l).height:l.z;S=V>z&&V>11500?a.CUBIC_OUT:a.QUINTIC_IN_OUT}return{duration:x,easingFunction:S,startObject:{time:0},stopObject:{time:x},update:U,complete:R,cancel:N}},w}),define("Scene/MapMode2D",["../Core/freezeObject"],function(e){"use strict";var t={ROTATE:0,INFINITE_SCROLL:1};return e(t)}),define("Scene/Camera",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/Ellipsoid","../Core/EllipsoidGeodesic","../Core/Event","../Core/HeadingPitchRange","../Core/HeadingPitchRoll","../Core/Intersect","../Core/IntersectionTests","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Quaternion","../Core/Ray","../Core/Rectangle","../Core/Transforms","./CameraFlightPath","./MapMode2D","./OrthographicFrustum","./OrthographicOffCenterFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D){ +"use strict";function I(e){this._scene=e,this._transform=y.clone(y.IDENTITY),this._invTransform=y.clone(y.IDENTITY),this._actualTransform=y.clone(y.IDENTITY),this._actualInvTransform=y.clone(y.IDENTITY),this._transformChanged=!1,this.position=new r,this._position=new r,this._positionWC=new r,this._positionCartographic=new n,this.direction=new r,this._direction=new r,this._directionWC=new r,this.up=new r,this._up=new r,this._upWC=new r,this.right=new r,this._right=new r,this._rightWC=new r,this.frustum=new A,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=v.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 h,this._moveEnd=new h,this._changed=new h,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this.percentageChanged=.5,this._viewMatrix=new y,this._invViewMatrix=new y,M(this),this._mode=D.SCENE3D,this._modeChanged=!0;var t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new n(Math.PI,v.PI_OVER_TWO)),this._max2Dfrustum=void 0,this._suspendTerrainAdjustment=!1,Q(this,I.DEFAULT_VIEW_RECTANGLE,this.position,!0);var i=r.magnitude(this.position);i+=i*I.DEFAULT_VIEW_FACTOR,r.normalize(this.position,this.position),r.multiplyByScalar(this.position,i,this.position)}function M(e){y.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),y.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),y.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function O(e){S.basisTo2D(e._projection,e._transform,e._actualTransform)}function R(e){var t=e._projection,n=t.ellipsoid,o=y.getColumn(e._transform,3,me),a=n.cartesianToCartographic(o,he),s=t.project(a,pe),l=ge;l.x=s.z,l.y=s.x,l.z=s.y,l.w=1;var u=i.clone(i.UNIT_X,ye),c=i.add(y.getColumn(e._transform,0,fe),o,fe);n.cartesianToCartographic(c,a),t.project(a,s);var d=ve;d.x=s.z,d.y=s.x,d.z=s.y,d.w=0,r.subtract(d,l,d),d.x=0;var h=_e;if(r.magnitudeSquared(d)>v.EPSILON10)r.cross(u,d,h);else{var p=i.add(y.getColumn(e._transform,1,fe),o,fe);n.cartesianToCartographic(p,a),t.project(a,s),h.x=s.z,h.y=s.x,h.z=s.y,h.w=0,r.subtract(h,l,h),h.x=0,r.magnitudeSquared(h)<v.EPSILON10&&(i.clone(i.UNIT_Y,d),i.clone(i.UNIT_Z,h))}r.cross(h,u,d),r.normalize(d,d),r.cross(u,d,h),r.normalize(h,h),y.setColumn(e._actualTransform,0,d,e._actualTransform),y.setColumn(e._actualTransform,1,h,e._actualTransform),y.setColumn(e._actualTransform,2,u,e._actualTransform),y.setColumn(e._actualTransform,3,l,e._actualTransform)}function N(e){var t=e._mode,i=!1,n=0;t===D.SCENE2D&&(n=e.frustum.right-e.frustum.left,i=n!==e._positionCartographic.height);var o=e._position,a=!r.equals(o,e.position)||i;a&&(o=r.clone(e.position,e._position));var s=e._direction,l=!r.equals(s,e.direction);l&&(r.normalize(e.direction,e.direction),s=r.clone(e.direction,e._direction));var u=e._up,c=!r.equals(u,e.up);c&&(r.normalize(e.up,e.up),u=r.clone(e.up,e._up));var d=e._right,h=!r.equals(d,e.right);h&&(r.normalize(e.right,e.right),d=r.clone(e.right,e._right));var p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(y.inverseTransformation(e._transform,e._invTransform),e._mode===D.COLUMBUS_VIEW||e._mode===D.SCENE2D?y.equals(y.IDENTITY,e._transform)?y.clone(I.TRANSFORM_2D,e._actualTransform):e._mode===D.COLUMBUS_VIEW?O(e):R(e):y.clone(e._transform,e._actualTransform),y.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);var f=e._actualTransform;if(a||p)if(e._positionWC=y.multiplyByPoint(f,o,e._positionWC),t===D.SCENE3D||t===D.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{var m=be;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===D.SCENE2D&&(m.z=n),e._projection.unproject(m,e._positionCartographic)}if(l||c||h){var g=r.dot(s,r.cross(u,d,be));if(Math.abs(1-g)>v.EPSILON2){var _=1/r.magnitudeSquared(u),b=r.dot(u,s)*_,C=r.multiplyByScalar(s,b,be);u=r.normalize(r.subtract(u,C,e._up),e._up),r.clone(u,e.up),d=r.cross(s,u,e._right),r.clone(d,e.right)}}(l||p)&&(e._directionWC=y.multiplyByPointAsVector(f,s,e._directionWC)),(c||p)&&(e._upWC=y.multiplyByPointAsVector(f,u,e._upWC)),(h||p)&&(e._rightWC=y.multiplyByPointAsVector(f,d,e._rightWC)),(a||l||c||h||p)&&M(e)}function k(e,t){var r;return r=v.equalsEpsilon(Math.abs(e.z),1,v.EPSILON3)?Math.atan2(t.y,t.x)-v.PI_OVER_TWO:Math.atan2(e.y,e.x)-v.PI_OVER_TWO,v.TWO_PI-v.zeroToTwoPi(r)}function L(e){return v.PI_OVER_TWO-v.acosClamped(e.z)}function F(e,t,r){var i=0;return v.equalsEpsilon(Math.abs(e.z),1,v.EPSILON3)||(i=Math.atan2(-r.z,t.z),i=v.zeroToTwoPi(i+v.TWO_PI)),i}function B(e,t,i){var n=y.clone(e.transform,Me),o=S.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,Oe);e._setTransform(o),r.clone(r.ZERO,e.position),i.heading=i.heading-v.PI_OVER_TWO;var a=b.fromHeadingPitchRoll(i,Re),s=_.fromQuaternion(a,Ne);_.getColumn(s,0,e.direction),_.getColumn(s,2,e.up),r.cross(e.direction,e.up,e.right),e._setTransform(n),e._adjustOrthographicFrustum(!0)}function U(e,t,i,n){var o=y.clone(e.transform,Me);if(e._setTransform(y.IDENTITY),!r.equals(t,e.positionWC)){if(n){var a=e._projection,s=a.ellipsoid.cartesianToCartographic(t,ke);t=a.project(s,Ie)}r.clone(t,e.position)}i.heading=i.heading-v.PI_OVER_TWO;var l=b.fromHeadingPitchRoll(i,Re),u=_.fromQuaternion(l,Ne);_.getColumn(u,0,e.direction),_.getColumn(u,2,e.up),r.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function V(e,i,n,o){var a=y.clone(e.transform,Me);if(e._setTransform(y.IDENTITY),!r.equals(i,e.positionWC)){if(o){var s=e._projection,l=s.ellipsoid.cartesianToCartographic(i,ke);i=s.project(l,Ie)}t.clone(i,e.position);var u=.5*-i.z,c=-u,d=e.frustum;if(c>u){var h=d.top/d.right;d.right=c,d.left=u,d.top=d.right*h,d.bottom=-d.top}}if(e._scene.mapMode2D===T.ROTATE){n.heading=n.heading-v.PI_OVER_TWO,n.pitch=-v.PI_OVER_TWO,n.roll=0;var p=b.fromHeadingPitchRoll(n,Re),f=_.fromQuaternion(p,Ne);_.getColumn(f,2,e.up),r.cross(e.direction,e.up,e.right)}e._setTransform(a)}function z(e,t,i,n){var o=r.clone(i.direction,Le),a=r.clone(i.up,Fe);if(e._scene.mode===D.SCENE3D){var s=e._projection.ellipsoid,l=S.eastNorthUpToFixedFrame(t,s,Ce),u=y.inverseTransformation(l,we);y.multiplyByPointAsVector(u,o,o),y.multiplyByPointAsVector(u,a,a)}var c=r.cross(o,a,Be);return n.heading=k(o,a),n.pitch=L(o),n.roll=F(o,a,c),n}function G(e,t){var r,i,n=e._scene.mapMode2D===T.ROTATE,o=e._maxCoord.x,a=e._maxCoord.y;n?(i=o,r=-i):(i=t.x-2*o,r=t.x+2*o),t.x>o&&(t.x=i),t.x<-o&&(t.x=r),t.y>a&&(t.y=a),t.y<-a&&(t.y=-a)}function H(e,t){var i=e.position,n=r.normalize(i,Ye);if(a(e.constrainedAxis)){var o=r.equalsEpsilon(n,e.constrainedAxis,v.EPSILON2),s=r.equalsEpsilon(n,r.negate(e.constrainedAxis,Ze),v.EPSILON2);if(o||s)(o&&t<0||s&&t>0)&&e.rotate(e.right,t);else{var l=r.normalize(e.constrainedAxis,Xe),u=r.dot(n,l),c=v.acosClamped(u);t>0&&t>c&&(t=c-v.EPSILON4),u=r.dot(n,r.negate(l,Ze)),c=v.acosClamped(u),t<0&&-t>c&&(t=-c+v.EPSILON4);var d=r.cross(l,n,Qe);e.rotate(d,t)}}else e.rotate(e.right,t)}function W(e,t){a(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function j(e,t){var r=e.frustum;t*=.5;var i=r.right-t,n=r.left+t,o=e._maxCoord.x;e._scene.mapMode2D===T.ROTATE&&(o*=e.maximumZoomFactor),i>o&&(i=o,n=-o),i<=n&&(i=1,n=-1);var a=r.top/r.right;r.right=i,r.left=n,r.top=r.right*a,r.bottom=-r.top}function q(e,t){e.move(e.direction,t)}function Y(e,t,i){t=v.clamp(t,-v.PI_OVER_TWO,v.PI_OVER_TWO),e=v.zeroToTwoPi(e)-v.PI_OVER_TWO;var n=b.fromAxisAngle(r.UNIT_Y,-t,$e),o=b.fromAxisAngle(r.UNIT_Z,-e,et),a=b.multiply(o,n,o),s=_.fromQuaternion(a,tt),l=r.clone(r.UNIT_X,Je);return _.multiplyByVector(s,l,l),r.negate(l,l),r.multiplyByScalar(l,i,l),l}function X(e,t,i,n){var o=Math.abs(r.dot(t,i));return o/n-r.dot(e,i)}function Q(e,t,i,n){var o=e._projection.ellipsoid,s=n?e:pt,l=t.north,u=t.south,c=t.east,h=t.west;h>c&&(c+=v.TWO_PI);var p,f=.5*(h+c);if(u<-v.PI_OVER_TWO+v.RADIANS_PER_DEGREE&&l>v.PI_OVER_TWO-v.RADIANS_PER_DEGREE)p=0;else{var m=it;m.longitude=f,m.latitude=l,m.height=0;var g=nt;g.longitude=f,g.latitude=u,g.height=0;var _=rt;a(_)&&_.ellipsoid===o||(rt=_=new d(void 0,void 0,o)),_.setEndPoints(m,g),p=_.interpolateUsingFraction(.5,it).latitude}var y=it;y.longitude=f,y.latitude=p,y.height=0;var b=o.cartographicToCartesian(y,dt),C=it;C.longitude=c,C.latitude=l;var w=o.cartographicToCartesian(C,ot);C.longitude=h;var S=o.cartographicToCartesian(C,st);C.longitude=f;var E=o.cartographicToCartesian(C,ut);C.latitude=u;var T=o.cartographicToCartesian(C,ct);C.longitude=c;var P=o.cartographicToCartesian(C,lt);C.longitude=h;var A=o.cartographicToCartesian(C,at);r.subtract(S,b,S),r.subtract(P,b,P),r.subtract(w,b,w),r.subtract(A,b,A),r.subtract(E,b,E),r.subtract(T,b,T);var D=o.geodeticSurfaceNormal(b,s.direction);r.negate(D,D);var I=r.cross(D,r.UNIT_Z,s.right);r.normalize(I,I);var M,O=r.cross(I,D,s.up);if(e.frustum instanceof x){var R,N,k=Math.max(r.distance(w,S),r.distance(P,A)),L=Math.max(r.distance(w,P),r.distance(S,A)),F=e.frustum._offCenterFrustum.right/e.frustum._offCenterFrustum.top,B=L*F;k>B?(R=k,N=R/F):(N=L,R=B),M=Math.max(R,N)}else{var U=Math.tan(.5*e.frustum.fovy),V=e.frustum.aspectRatio*U;if(M=Math.max(X(D,O,S,U),X(D,O,P,U),X(D,O,w,U),X(D,O,A,U),X(D,O,E,U),X(D,O,T,U),X(D,I,S,V),X(D,I,P,V),X(D,I,w,V),X(D,I,A,V),X(D,I,E,V),X(D,I,T,V)),u<0&&l>0){var z=it;z.longitude=h,z.latitude=0,z.height=0;var G=o.cartographicToCartesian(z,ht);r.subtract(G,b,G),M=Math.max(M,X(D,O,G,U),X(D,I,G,V)),z.longitude=c,G=o.cartographicToCartesian(z,ht),r.subtract(G,b,G),M=Math.max(M,X(D,O,G,U),X(D,I,G,V))}}return r.add(b,r.multiplyByScalar(D,-M,ht),i)}function Z(e,t,r){var i=e._projection;t.west>t.east&&(t=w.MAX_VALUE);var n=e._actualTransform,o=e._actualInvTransform,s=ft;s.longitude=t.east,s.latitude=t.north;var l=i.project(s,mt);y.multiplyByPoint(n,l,l),y.multiplyByPoint(o,l,l),s.longitude=t.west,s.latitude=t.south;var u=i.project(s,gt);if(y.multiplyByPoint(n,u,u),y.multiplyByPoint(o,u,u),r.x=.5*(l.x-u.x)+u.x,r.y=.5*(l.y-u.y)+u.y,a(e.frustum.fovy)){var c=Math.tan(.5*e.frustum.fovy),d=e.frustum.aspectRatio*c;r.z=.5*Math.max((l.x-u.x)/d,(l.y-u.y)/c)}else{var h=l.x-u.x,p=l.y-u.y;r.z=Math.max(h,p)}return r}function K(e,t,r){var i=e._projection;t.west>t.east&&(t=w.MAX_VALUE);var n=vt;n.longitude=t.east,n.latitude=t.north;var o=i.project(n,_t);n.longitude=t.west,n.latitude=t.south;var a,s,l=i.project(n,yt),u=.5*Math.abs(o.x-l.x),c=.5*Math.abs(o.y-l.y),d=e.frustum.right/e.frustum.top,h=c*d;return u>h?(a=u,s=a/d):(s=c,a=h),c=Math.max(2*a,2*s),r.x=.5*(o.x-l.x)+l.x,r.y=.5*(o.y-l.y)+l.y,n=i.unproject(r,n),n.height=c,r=i.project(n,r)}function J(e,t,r,i){r=o(r,c.WGS84);var n=e.getPickRay(t,bt),a=g.rayEllipsoid(n,r);if(a){var s=a.start>0?a.start:a.stop;return C.getPoint(n,s,i)}}function $(e,t,r,i){var n=e.getPickRay(t,Ct),o=n.origin;o.z=0;var a=r.unproject(o);if(!(a.latitude<-v.PI_OVER_TWO||a.latitude>v.PI_OVER_TWO))return r.ellipsoid.cartographicToCartesian(a,i)}function ee(e,t,i,n){var o=e.getPickRay(t,wt),a=-o.origin.x/o.direction.x;C.getPoint(o,a,n);var s=i.unproject(new r(n.y,n.z,0));if(!(s.latitude<-v.PI_OVER_TWO||s.latitude>v.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return i.ellipsoid.cartographicToCartesian(s,n)}function te(e,t,i){var n=e._scene.canvas,o=n.clientWidth,a=n.clientHeight,s=Math.tan(.5*e.frustum.fovy),l=e.frustum.aspectRatio*s,u=e.frustum.near,c=2/o*t.x-1,d=2/a*(a-t.y)-1,h=e.positionWC;r.clone(h,i.origin);var p=r.multiplyByScalar(e.directionWC,u,St);r.add(h,p,p);var f=r.multiplyByScalar(e.rightWC,c*u*l,Et),m=r.multiplyByScalar(e.upWC,d*u*s,Tt),g=r.add(p,f,i.direction);return r.add(g,m,g),r.subtract(g,h,g),r.normalize(g,g),i}function re(e,t,i){var n=e._scene.canvas,o=n.clientWidth,s=n.clientHeight,l=e.frustum;a(l._offCenterFrustum)&&(l=l._offCenterFrustum);var u=2/o*t.x-1;u*=.5*(l.right-l.left);var c=2/s*(s-t.y)-1;c*=.5*(l.top-l.bottom);var d=i.origin;return r.clone(e.position,d),r.multiplyByScalar(e.right,u,xt),r.add(xt,d,d),r.multiplyByScalar(e.up,c,xt),r.add(xt,d,d),r.clone(e.directionWC,i.direction),e._mode===D.COLUMBUS_VIEW&&r.fromElements(i.origin.z,i.origin.x,i.origin.y,i.origin),i}function ie(e,t,i,n,o,a){function s(i){var n=r.lerp(t,l,i.time,new r);e.worldToCameraCoordinatesPoint(n,e.position)}var l=r.clone(t);return i.y>n?l.y-=i.y-n:i.y<-n&&(l.y+=-n-i.y),i.z>o?l.z-=i.z-o:i.z<-o&&(l.z+=-o-i.z),{easingFunction:u.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:a,update:s}}function ne(e,t){var i=e.position,n=e.direction,o=e.worldToCameraCoordinatesVector(r.UNIT_X,It),a=-r.dot(o,i)/r.dot(o,n),s=r.add(i,r.multiplyByScalar(n,a,Mt),Mt);e.cameraToWorldCoordinatesPoint(s,s),i=e.cameraToWorldCoordinatesPoint(e.position,Ot);var l=Math.tan(.5*e.frustum.fovy),u=e.frustum.aspectRatio*l,c=r.magnitude(r.subtract(i,s,Rt)),d=u*c,h=l*c,p=e._maxCoord.x,f=e._maxCoord.y,m=Math.max(d-p,p),g=Math.max(h-f,f);if(i.z<-m||i.z>m||i.y<-g||i.y>g){var v=s.y<-m||s.y>m,_=s.z<-g||s.z>g;if(v||_)return ie(e,i,s,m,g,t)}}function oe(e,t){var r=e.frustum,i=Math.tan(.5*r.fovy),n=r.aspectRatio*i;return Math.max(t/n,t/i)}function ae(e,t){var r=e.frustum;a(r._offCenterFrustum)&&(r=r._offCenterFrustum);var i,n,o=r.right/r.top,s=t*o;return t>s?(i=t,n=i/o):(n=t,i=s),1.5*Math.max(i,n)}function se(e,t,r){a(r)||(r=p.clone(I.DEFAULT_OFFSET));var i=r.range;if(!a(i)||0===i){var n=t.radius;0===n?r.range=Lt:e.frustum instanceof x||e._mode===D.SCENE2D?r.range=ae(e,n):r.range=oe(e,n)}return r}function le(e,t){var i,n,o=t.radii,a=e.positionWC,s=r.multiplyComponents(t.oneOverRadii,a,jt),l=r.magnitude(s),u=r.normalize(s,qt);r.equalsEpsilon(u,r.UNIT_Z,v.EPSILON10)?(i=new r(0,1,0),n=new r(0,0,1)):(i=r.normalize(r.cross(r.UNIT_Z,u,Yt),Yt),n=r.normalize(r.cross(u,i,Xt),Xt));var c=Math.sqrt(r.magnitudeSquared(s)-1),d=r.multiplyByScalar(u,1/l,jt),h=c/l,p=r.multiplyByScalar(i,h,qt),f=r.multiplyByScalar(n,h,Yt),m=r.add(d,f,Qt[0]);r.subtract(m,p,m),r.multiplyComponents(o,m,m);var g=r.subtract(d,f,Qt[1]);r.subtract(g,p,g),r.multiplyComponents(o,g,g);var _=r.subtract(d,f,Qt[2]);r.add(_,p,_),r.multiplyComponents(o,_,_);var y=r.add(d,f,Qt[3]);return r.add(y,p,y),r.multiplyComponents(o,y,y),Qt}function ue(e,t,r,i,n,o){Zt.x=e,Zt.y=t;var s=i.pickEllipsoid(Zt,n,Kt);return a(s)?(Jt[r]=n.cartesianToCartographic(s,Jt[r]),1):(Jt[r]=n.cartesianToCartographic(o[r],Jt[r]),0)}I.TRANSFORM_2D=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),I.TRANSFORM_2D_INVERSE=y.inverseTransformation(I.TRANSFORM_2D,new y),I.DEFAULT_VIEW_RECTANGLE=w.fromDegrees(-95,-20,-70,90),I.DEFAULT_VIEW_FACTOR=.5,I.DEFAULT_OFFSET=new p(0,-v.PI_OVER_FOUR,0),I.prototype._updateCameraChanged=function(){var e=this;if(0!==e._changed.numberOfListeners){var t=e.percentageChanged;if(e._mode===D.SCENE2D){if(!a(e._changedFrustum))return e._changedPosition=r.clone(e.position,e._changedPosition),void(e._changedFrustum=e.frustum.clone());var i,n=e.position,o=e._changedPosition,s=e.frustum,l=e._changedFrustum,u=n.x+s.left,c=n.x+s.right,d=o.x+l.left,h=o.x+l.right,p=n.y+s.bottom,f=n.y+s.top,m=o.y+l.bottom,g=o.y+l.top,_=Math.max(u,d),y=Math.min(c,h),b=Math.max(p,m),C=Math.min(f,g);if(_>=y||b>=f)i=1;else{var w=l;u<d&&c>h&&p<m&&f>g&&(w=s),i=1-(y-_)*(C-b)/((w.right-w.left)*(w.top-w.bottom))}return void(i>t&&(e._changed.raiseEvent(i),e._changedPosition=r.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum)))}if(!a(e._changedDirection))return e._changedPosition=r.clone(e.positionWC,e._changedPosition),void(e._changedDirection=r.clone(e.directionWC,e._changedDirection));var S,E=v.acosClamped(r.dot(e.directionWC,e._changedDirection));S=a(e.frustum.fovy)?E/(.5*e.frustum.fovy):E;var T=r.distance(e.positionWC,e._changedPosition),x=T/e.positionCartographic.height;(S>t||x>t)&&(e._changed.raiseEvent(Math.max(S,x)),e._changedPosition=r.clone(e.positionWC,e._changedPosition),e._changedDirection=r.clone(e.directionWC,e._changedDirection))}};var ce=new y,de=new n;I.prototype._adjustHeightForTerrain=function(){var e=this._scene,t=e.screenSpaceCameraController,i=t.enableCollisionDetection,n=t.minimumCollisionTerrainHeight,o=t.minimumZoomDistance;if(!this._suspendTerrainAdjustment&&i){var s=this._mode,l=e.globe;if(a(l)&&s!==D.SCENE2D&&s!==D.MORPHING){var u,c,d=l.ellipsoid,h=e.mapProjection;y.equals(this.transform,y.IDENTITY)||(u=y.clone(this.transform,ce),c=r.magnitude(this.position),this._setTransform(y.IDENTITY));var p=de;s===D.SCENE3D?d.cartesianToCartographic(this.position,p):h.unproject(this.position,p);var f=!1;if(p.height<n){var m=l.getHeight(p);a(m)&&(m+=o,p.height<m&&(p.height=m,s===D.SCENE3D?d.cartographicToCartesian(p,this.position):h.project(p,this.position),f=!0))}a(u)&&(this._setTransform(u),f&&(r.normalize(this.position,this.position),r.negate(this.position,this.direction),r.multiplyByScalar(this.position,Math.max(c,o),this.position),r.normalize(this.direction,this.direction),r.cross(this.direction,this.up,this.right),r.cross(this.right,this.direction,this.up)))}}};var he=new n,pe=new r,fe=new r,me=new i,ge=new i,ve=new i,_e=new i,ye=new i,be=new r,Ce=new y,we=new y;s(I.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return N(this),this._invTransform}},viewMatrix:{get:function(){return N(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return N(this),this._invViewMatrix}},positionCartographic:{get:function(){return N(this),this._positionCartographic}},positionWC:{get:function(){return N(this),this._positionWC}},directionWC:{get:function(){return N(this),this._directionWC}},upWC:{get:function(){return N(this),this._upWC}},rightWC:{get:function(){return N(this),this._rightWC}},heading:{get:function(){if(this._mode!==D.MORPHING){var e=this._projection.ellipsoid,t=y.clone(this._transform,Ce),r=S.eastNorthUpToFixedFrame(this.positionWC,e,we);this._setTransform(r);var i=k(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==D.MORPHING){var e=this._projection.ellipsoid,t=y.clone(this._transform,Ce),r=S.eastNorthUpToFixedFrame(this.positionWC,e,we);this._setTransform(r);var i=L(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==D.MORPHING){var e=this._projection.ellipsoid,t=y.clone(this._transform,Ce),r=S.eastNorthUpToFixedFrame(this.positionWC,e,we);this._setTransform(r);var i=F(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}}),I.prototype.update=function(e){var t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==D.MORPHING,t=this._mode===D.SCENE2D),t){var r=this._max2Dfrustum=this.frustum.clone(),i=2,n=r.top/r.right;r.right=this._maxCoord.x*i,r.left=-r.right,r.top=n*r.right,r.bottom=-r.top}this._mode===D.SCENE2D&&G(this,this.position);var o=this._scene.globe,s=!a(o)||o._surface.tileProvider.ready&&0===o._surface._tileLoadQueueHigh.length&&0===o._surface._tileLoadQueueMedium.length&&0===o._surface._tileLoadQueueLow.length&&0===o._surface._debug.tilesWaitingForChildren;this._suspendTerrainAdjustment&&(this._suspendTerrainAdjustment=!s),this._adjustHeightForTerrain()};var Se=new r,Ee=new r,Te=new r;I.prototype._setTransform=function(e){var t=r.clone(this.positionWC,Se),i=r.clone(this.upWC,Ee),n=r.clone(this.directionWC,Te);y.clone(e,this._transform),this._transformChanged=!0,N(this);var o=this._actualInvTransform;y.multiplyByPoint(o,t,this.position),y.multiplyByPointAsVector(o,n,this.direction),y.multiplyByPointAsVector(o,i,this.up),r.cross(this.direction,this.up,this.right),N(this)};var xe=new t,Pe=new C,Ae=new r,De=new r;I.prototype._adjustOrthographicFrustum=function(e){if(this.frustum instanceof x&&(e||!(this._positionCartographic.height<15e4))){if(!y.equals(y.IDENTITY,this.transform))return void(this.frustum.width=r.magnitude(this.position));var t,i,n=this._scene,o=n._globe;if(a(o)){var s=xe;s.x=n.drawingBufferWidth/2,s.y=n.drawingBufferHeight/2;var l=this.getPickRay(s,Pe);if(t=o.pick(l,n,Ae),n.pickPositionSupported&&(i=n.pickPositionWorldCoordinates(s,De)),a(t)&&a(i)){var u=a(i)?r.distance(i,this.positionWC):Number.POSITIVE_INFINITY,c=a(t)?r.distance(t,this.positionWC):Number.POSITIVE_INFINITY;this.frustum.width=Math.min(u,c)}else a(i)?this.frustum.width=r.distance(i,this.positionWC):a(t)&&(this.frustum.width=r.distance(t,this.positionWC))}if(!a(o)||!a(t)&&!a(i)){var d=Math.max(this.positionCartographic.height,0);this.frustum.width=d}}};var Ie=new r,Me=new y,Oe=new y,Re=new b,Ne=new _,ke=new n,Le=new r,Fe=new r,Be=new r,Ue={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},Ve=new f;I.prototype.setView=function(e){e=o(e,o.EMPTY_OBJECT);var t=o(e.orientation,o.EMPTY_OBJECT),i=this._mode;if(i!==D.MORPHING){a(e.endTransform)&&this._setTransform(e.endTransform);var n=o(e.convert,!0),s=o(e.destination,r.clone(this.positionWC,Ie));a(s)&&a(s.west)&&(s=this.getRectangleCameraCoordinates(s,Ie),n=!1),a(t.direction)&&(t=z(this,s,t,Ue.orientation)),Ve.heading=o(t.heading,0),Ve.pitch=o(t.pitch,-v.PI_OVER_TWO),Ve.roll=o(t.roll,0),this._suspendTerrainAdjustment=!0,i===D.SCENE3D?B(this,s,Ve):i===D.SCENE2D?V(this,s,Ve,n):U(this,s,Ve,n)}};var ze=new r;I.prototype.flyHome=function(e){var t=this._mode;if(t===D.MORPHING&&this._scene.completeMorph(),t===D.SCENE2D)this.flyTo({destination:w.MAX_VALUE,duration:e,endTransform:y.IDENTITY});else if(t===D.SCENE3D){var i=this.getRectangleCameraCoordinates(I.DEFAULT_VIEW_RECTANGLE),n=r.magnitude(i);n+=n*I.DEFAULT_VIEW_FACTOR,r.normalize(i,i),r.multiplyByScalar(i,n,i),this.flyTo({destination:i,duration:e,endTransform:y.IDENTITY})}else if(t===D.COLUMBUS_VIEW){var o=this._projection.ellipsoid.maximumRadius,a=new r(0,-1,1);a=r.multiplyByScalar(r.normalize(a,a),5*o,a),this.flyTo({destination:a,duration:e,orientation:{heading:0,pitch:-Math.acos(r.normalize(a,ze).z),roll:0},endTransform:y.IDENTITY,convert:!1})}},I.prototype.worldToCameraCoordinates=function(e,t){return a(t)||(t=new i),N(this),y.multiplyByVector(this._actualInvTransform,e,t)},I.prototype.worldToCameraCoordinatesPoint=function(e,t){return a(t)||(t=new r),N(this),y.multiplyByPoint(this._actualInvTransform,e,t)},I.prototype.worldToCameraCoordinatesVector=function(e,t){return a(t)||(t=new r),N(this),y.multiplyByPointAsVector(this._actualInvTransform,e,t)},I.prototype.cameraToWorldCoordinates=function(e,t){return a(t)||(t=new i),N(this),y.multiplyByVector(this._actualTransform,e,t)},I.prototype.cameraToWorldCoordinatesPoint=function(e,t){return a(t)||(t=new r),N(this),y.multiplyByPoint(this._actualTransform,e,t)},I.prototype.cameraToWorldCoordinatesVector=function(e,t){return a(t)||(t=new r),N(this),y.multiplyByPointAsVector(this._actualTransform,e,t)};var Ge=new r;I.prototype.move=function(e,t){var i=this.position;r.multiplyByScalar(e,t,Ge),r.add(i,Ge,i),this._mode===D.SCENE2D&&G(this,i),this._adjustOrthographicFrustum(!0)},I.prototype.moveForward=function(e){e=o(e,this.defaultMoveAmount),this.move(this.direction,e)},I.prototype.moveBackward=function(e){e=o(e,this.defaultMoveAmount),this.move(this.direction,-e)},I.prototype.moveUp=function(e){e=o(e,this.defaultMoveAmount),this.move(this.up,e)},I.prototype.moveDown=function(e){e=o(e,this.defaultMoveAmount),this.move(this.up,-e)},I.prototype.moveRight=function(e){e=o(e,this.defaultMoveAmount),this.move(this.right,e)},I.prototype.moveLeft=function(e){e=o(e,this.defaultMoveAmount),this.move(this.right,-e)},I.prototype.lookLeft=function(e){e=o(e,this.defaultLookAmount),this.look(this.up,-e)},I.prototype.lookRight=function(e){e=o(e,this.defaultLookAmount),this.look(this.up,e)},I.prototype.lookUp=function(e){e=o(e,this.defaultLookAmount),this.look(this.right,-e)},I.prototype.lookDown=function(e){e=o(e,this.defaultLookAmount),this.look(this.right,e)};var He=new b,We=new _;I.prototype.look=function(e,t){var r=o(t,this.defaultLookAmount),i=b.fromAxisAngle(e,-r,He),n=_.fromQuaternion(i,We),a=this.direction,s=this.up,l=this.right;_.multiplyByVector(n,a,a),_.multiplyByVector(n,s,s),_.multiplyByVector(n,l,l)},I.prototype.twistLeft=function(e){e=o(e,this.defaultLookAmount),this.look(this.direction,e)},I.prototype.twistRight=function(e){e=o(e,this.defaultLookAmount),this.look(this.direction,-e)};var je=new b,qe=new _;I.prototype.rotate=function(e,t){var i=o(t,this.defaultRotateAmount),n=b.fromAxisAngle(e,-i,je),a=_.fromQuaternion(n,qe);_.multiplyByVector(a,this.position,this.position),_.multiplyByVector(a,this.direction,this.direction),_.multiplyByVector(a,this.up,this.up),r.cross(this.direction,this.up,this.right),r.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)},I.prototype.rotateDown=function(e){e=o(e,this.defaultRotateAmount),H(this,e)},I.prototype.rotateUp=function(e){e=o(e,this.defaultRotateAmount),H(this,-e)};var Ye=new r,Xe=new r,Qe=new r,Ze=new r;I.prototype.rotateRight=function(e){e=o(e,this.defaultRotateAmount),W(this,-e)},I.prototype.rotateLeft=function(e){e=o(e,this.defaultRotateAmount),W(this,e)},I.prototype.zoomIn=function(e){e=o(e,this.defaultZoomAmount),this._mode===D.SCENE2D?j(this,e):q(this,e)},I.prototype.zoomOut=function(e){e=o(e,this.defaultZoomAmount),this._mode===D.SCENE2D?j(this,-e):q(this,-e)},I.prototype.getMagnitude=function(){return this._mode===D.SCENE3D?r.magnitude(this.position):this._mode===D.COLUMBUS_VIEW?Math.abs(this.position.z):this._mode===D.SCENE2D?Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom):void 0};var Ke=new y;I.prototype.lookAt=function(e,t){var r=S.eastNorthUpToFixedFrame(e,c.WGS84,Ke);this.lookAtTransform(r,t)};var Je=new r,$e=new b,et=new b,tt=new _;I.prototype.lookAtTransform=function(e,i){if(this._setTransform(e),a(i)){var n;if(n=a(i.heading)?Y(i.heading,i.pitch,i.range):i,this._mode===D.SCENE2D){t.clone(t.ZERO,this.position),r.negate(n,this.up),this.up.z=0,r.magnitudeSquared(this.up)<v.EPSILON10&&r.clone(r.UNIT_Y,this.up),r.normalize(this.up,this.up),this._setTransform(y.IDENTITY),r.negate(r.UNIT_Z,this.direction),r.cross(this.direction,this.up,this.right),r.normalize(this.right,this.right);var o=this.frustum,s=o.top/o.right;return o.right=.5*r.magnitude(n),o.left=-o.right,o.top=s*o.right,o.bottom=-o.top,void this._setTransform(e)}r.clone(n,this.position),r.negate(this.position,this.direction),r.normalize(this.direction,this.direction),r.cross(this.direction,r.UNIT_Z,this.right),r.magnitudeSquared(this.right)<v.EPSILON10&&r.clone(r.UNIT_X,this.right),r.normalize(this.right,this.right),r.cross(this.right,this.direction,this.up),r.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)}};var rt,it=new n,nt=new n,ot=new r,at=new r,st=new r,lt=new r,ut=new r,ct=new r,dt=new r,ht=new r,pt={direction:new r,right:new r,up:new r},ft=new n,mt=new r,gt=new r,vt=new n,_t=new r,yt=new r;I.prototype.getRectangleCameraCoordinates=function(e,t){var i=this._mode;return a(t)||(t=new r),i===D.SCENE3D?Q(this,e,t):i===D.COLUMBUS_VIEW?Z(this,e,t):i===D.SCENE2D?K(this,e,t):void 0};var bt=new C,Ct=new C,wt=new C;I.prototype.pickEllipsoid=function(e,t,i){var n=this._scene.canvas;if(0!==n.clientWidth&&0!==n.clientHeight){if(a(i)||(i=new r),t=o(t,c.WGS84),this._mode===D.SCENE3D)i=J(this,e,t,i);else if(this._mode===D.SCENE2D)i=$(this,e,this._projection,i);else{if(this._mode!==D.COLUMBUS_VIEW)return;i=ee(this,e,this._projection,i)}return i}};var St=new r,Et=new r,Tt=new r,xt=new r;I.prototype.getPickRay=function(e,t){a(t)||(t=new C);var r=this.frustum;return a(r.aspectRatio)&&a(r.fov)&&a(r.near)?te(this,e,t):re(this,e,t)};var Pt=new r,At=new r;I.prototype.distanceToBoundingSphere=function(e){var t=r.subtract(this.positionWC,e.center,Pt),i=r.multiplyByScalar(this.directionWC,r.dot(t,this.directionWC),At);return Math.max(0,r.magnitude(i)-e.radius)};var Dt=new t;I.prototype.getPixelSize=function(e,t,r){var i=this.distanceToBoundingSphere(e),n=this.frustum.getPixelDimensions(t,r,i,Dt);return Math.max(n.x,n.y)};var It=new r,Mt=new r,Ot=new r,Rt=new r;I.prototype.createCorrectPositionTween=function(e){if(this._mode===D.COLUMBUS_VIEW)return ne(this,e)};var Nt=new r,kt={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};I.prototype.cancelFlight=function(){a(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)},I.prototype.flyTo=function(e){e=o(e,o.EMPTY_OBJECT);var t=e.destination,r=this._mode;if(r!==D.MORPHING){this.cancelFlight();var i=o(e.orientation,o.EMPTY_OBJECT);if(a(i.direction)&&(i=z(this,t,i,Ue.orientation)),a(e.duration)&&e.duration<=0){var n=Ue;return n.destination=e.destination,n.orientation.heading=i.heading,n.orientation.pitch=i.pitch,n.orientation.roll=i.roll,n.convert=e.convert,n.endTransform=e.endTransform,this.setView(n),void("function"==typeof e.complete&&e.complete())}var s=a(t.west);s&&(t=this.getRectangleCameraCoordinates(t,Nt));var l,u=this;kt.destination=t,kt.heading=i.heading,kt.pitch=i.pitch,kt.roll=i.roll,kt.duration=e.duration,kt.complete=function(){l===u._currentFlight&&(u._currentFlight=void 0),a(e.complete)&&e.complete()},kt.cancel=e.cancel,kt.endTransform=e.endTransform,kt.convert=!s&&e.convert,kt.maximumHeight=e.maximumHeight,kt.pitchAdjustHeight=e.pitchAdjustHeight,kt.flyOverLongitude=e.flyOverLongitude,kt.flyOverLongitudeWeight=e.flyOverLongitudeWeight,kt.easingFunction=e.easingFunction;var c=this._scene;l=c.tweens.add(E.createTween(c,kt)),this._currentFlight=l}};var Lt=100;I.prototype.viewBoundingSphere=function(e,t){t=se(this,e,t),this.lookAt(e.center,t)};var Ft=new y,Bt=new r,Ut=new r,Vt=new r,zt=new r,Gt=new i,Ht=new b,Wt=new _;I.prototype.flyToBoundingSphere=function(e,t){t=o(t,o.EMPTY_OBJECT);var i=this._mode===D.SCENE2D||this._mode===D.COLUMBUS_VIEW;this._setTransform(y.IDENTITY);var n,a=se(this,e,t.offset);n=i?r.multiplyByScalar(r.UNIT_Z,a.range,Bt):Y(a.heading,a.pitch,a.range);var s=S.eastNorthUpToFixedFrame(e.center,c.WGS84,Ft);y.multiplyByPoint(s,n,n);var l,u;if(!i){if(l=r.subtract(e.center,n,Ut),r.normalize(l,l),u=y.multiplyByPointAsVector(s,r.UNIT_Z,Vt),1-Math.abs(r.dot(l,u))<v.EPSILON6){var d=b.fromAxisAngle(l,a.heading,Ht),h=_.fromQuaternion(d,Wt);r.fromCartesian4(y.getColumn(s,1,Gt),u),_.multiplyByVector(h,u,u)}var p=r.cross(l,u,zt);r.cross(p,l,u),r.normalize(u,u)}this.flyTo({destination:n,orientation:{direction:l,up:u},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 jt=new r,qt=new r,Yt=new r,Xt=new r,Qt=[new r,new r,new r,new r],Zt=new t,Kt=new r,Jt=[new n,new n,new n,new n];return I.prototype.computeViewRectangle=function(t,i){t=o(t,c.WGS84);var n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),a=new e(r.ZERO,t.maximumRadius),s=n.computeVisibility(a);if(s!==m.OUTSIDE){var l=this._scene.canvas,u=l.clientWidth,d=l.clientHeight,h=0,p=le(this,t);if(h+=ue(0,0,0,this,t,p),h+=ue(0,d,1,this,t,p),h+=ue(u,d,2,this,t,p),h+=ue(u,0,3,this,t,p),h<2)return w.MAX_VALUE;i=w.fromCartographicArray(Jt,i);for(var f=0,g=Jt[3].longitude,_=0;_<4;++_){var y=Jt[_].longitude,b=Math.abs(y-g);f+=b>v.PI?v.TWO_PI-b:b,g=y}return v.equalsEpsilon(Math.abs(f),v.TWO_PI,v.EPSILON9)&&(i.west=-v.PI,i.east=v.PI,Jt[0].latitude>=0?i.north=v.PI_OVER_TWO:i.south=-v.PI_OVER_TWO),i}},I.prototype.switchToPerspectiveFrustum=function(){if(!(this._mode===D.SCENE2D||this.frustum instanceof A)){var e=this._scene;this.frustum=new A,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=v.toRadians(60)}},I.prototype.switchToOrthographicFrustum=function(){if(!(this._mode===D.SCENE2D||this.frustum instanceof x)){var e=this._scene;this.frustum=new x, +this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.width=r.magnitude(this.position);var t=this.frustum.projectionMatrix;a(t)&&this._adjustOrthographicFrustum(!0)}},I.clone=function(e,t){return a(t)||(t=new I(e._scene)),r.clone(e.position,t.position),r.clone(e.direction,t.direction),r.clone(e.up,t.up),r.clone(e.right,t.right),y.clone(e._transform,t.transform),t._transformChanged=!0,t},I}),define("Scene/CameraEventType",["../Core/freezeObject"],function(e){"use strict";var t={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};return e(t)}),define("Scene/CameraEventAggregator",["../Core/Cartesian2","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/KeyboardEventModifier","../Core/Math","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","./CameraEventType"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e,r){var i=e;return t(r)&&(i+="+"+r),i}function d(t,r){e.clone(t.distance.startPosition,r.distance.startPosition),e.clone(t.distance.endPosition,r.distance.endPosition),e.clone(t.angleAndHeight.startPosition,r.angleAndHeight.startPosition),e.clone(t.angleAndHeight.endPosition,r.angleAndHeight.endPosition)}function h(r,i,n){var o=c(u.PINCH,i),a=r._update,s=r._isDown,h=r._eventStartPosition,p=r._pressTime,f=r._releaseTime;a[o]=!0,s[o]=!1,h[o]=new e;var m=r._movement[o];t(m)||(m=r._movement[o]={}),m.distance={startPosition:new e,endPosition:new e},m.angleAndHeight={startPosition:new e,endPosition:new e},m.prevAngle=0,r._eventHandler.setInputAction(function(t){r._buttonsDown++,s[o]=!0,p[o]=new Date,e.lerp(t.position1,t.position2,.5,h[o])},l.PINCH_START,i),r._eventHandler.setInputAction(function(){r._buttonsDown=Math.max(r._buttonsDown-1,0),s[o]=!1,f[o]=new Date},l.PINCH_END,i),r._eventHandler.setInputAction(function(t){if(s[o]){a[o]?(d(t,m),a[o]=!1,m.prevAngle=m.angleAndHeight.startPosition.x):(e.clone(t.distance.endPosition,m.distance.endPosition),e.clone(t.angleAndHeight.endPosition,m.angleAndHeight.endPosition));for(var r=m.angleAndHeight.endPosition.x,i=m.prevAngle,l=2*Math.PI;r>=i+Math.PI;)r-=l;for(;r<i-Math.PI;)r+=l;m.angleAndHeight.endPosition.x=-r*n.clientWidth/12,m.angleAndHeight.startPosition.x=-i*n.clientWidth/12}},l.PINCH_MOVE,i)}function p(r,i){var n=c(u.WHEEL,i),o=r._update;o[n]=!0;var s=r._movement[n];t(s)||(s=r._movement[n]={}),s.startPosition=new e,s.endPosition=new e,r._eventHandler.setInputAction(function(t){var r=15*a.toRadians(t);o[n]?(e.clone(e.ZERO,s.startPosition),s.endPosition.x=0,s.endPosition.y=r,o[n]=!1):s.endPosition.y=s.endPosition.y+r},l.WHEEL,i)}function f(r,i,n){var o=c(n,i),a=r._isDown,s=r._eventStartPosition,d=r._pressTime,h=r._releaseTime;a[o]=!1,s[o]=new e;var p=r._lastMovement[o];t(p)||(p=r._lastMovement[o]={startPosition:new e,endPosition:new e,valid:!1});var f,m;n===u.LEFT_DRAG?(f=l.LEFT_DOWN,m=l.LEFT_UP):n===u.RIGHT_DRAG?(f=l.RIGHT_DOWN,m=l.RIGHT_UP):n===u.MIDDLE_DRAG&&(f=l.MIDDLE_DOWN,m=l.MIDDLE_UP),r._eventHandler.setInputAction(function(t){r._buttonsDown++,p.valid=!1,a[o]=!0,d[o]=new Date,e.clone(t.position,s[o])},f,i),r._eventHandler.setInputAction(function(){r._buttonsDown=Math.max(r._buttonsDown-1,0),a[o]=!1,h[o]=new Date},m,i)}function m(t,r){e.clone(t.startPosition,r.startPosition),e.clone(t.endPosition,r.endPosition)}function g(r,i){var n=r._update,o=r._movement,a=r._lastMovement,s=r._isDown;for(var d in u)if(u.hasOwnProperty(d)){var h=u[d];if(t(h)){var p=c(h,i);n[p]=!0,t(r._lastMovement[p])||(r._lastMovement[p]={startPosition:new e,endPosition:new e,valid:!1}),t(r._movement[p])||(r._movement[p]={startPosition:new e,endPosition:new e})}}r._eventHandler.setInputAction(function(l){for(var d in u)if(u.hasOwnProperty(d)){var h=u[d];if(t(h)){var p=c(h,i);s[p]&&(n[p]?(m(o[p],a[p]),a[p].valid=!0,m(l,o[p]),n[p]=!1):e.clone(l.endPosition,o[p].endPosition))}}e.clone(l.endPosition,r._currentMousePosition)},l.MOUSE_MOVE,i)}function v(r){this._eventHandler=new s(r,!0),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new e,p(this,void 0),h(this,void 0,r),f(this,void 0,u.LEFT_DRAG),f(this,void 0,u.RIGHT_DRAG),f(this,void 0,u.MIDDLE_DRAG),g(this,void 0);for(var i in o)if(o.hasOwnProperty(i)){var n=o[i];t(n)&&(p(this,n),h(this,n,r),f(this,n,u.LEFT_DRAG),f(this,n,u.RIGHT_DRAG),f(this,n,u.MIDDLE_DRAG),g(this,n))}}return r(v.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){var e=!(this._update[c(u.WHEEL)]&&this._update[c(u.WHEEL,o.SHIFT)]&&this._update[c(u.WHEEL,o.CTRL)]&&this._update[c(u.WHEEL,o.ALT)]);return this._buttonsDown>0||e}}}),v.prototype.isMoving=function(e,t){var r=c(e,t);return!this._update[r]},v.prototype.getMovement=function(e,t){var r=c(e,t),i=this._movement[r];return i},v.prototype.getLastMovement=function(e,t){var r=c(e,t),i=this._lastMovement[r];if(i.valid)return i},v.prototype.isButtonDown=function(e,t){var r=c(e,t);return this._isDown[r]},v.prototype.getStartMousePosition=function(e,t){if(e===u.WHEEL)return this._currentMousePosition;var r=c(e,t);return this._eventStartPosition[r]},v.prototype.getButtonPressTime=function(e,t){var r=c(e,t);return this._pressTime[r]},v.prototype.getButtonReleaseTime=function(e,t){var r=c(e,t);return this._releaseTime[r]},v.prototype.reset=function(){for(var e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),i(this)},v}),define("Scene/UrlTemplateImageryProvider",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/isArray","../Core/loadJson","../Core/loadText","../Core/loadWithXhr","../Core/loadXML","../Core/Math","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b){"use strict";function C(e){this._errorEvent=new u,this._url=void 0,this._urlSchemeZeroPadding=void 0,this._pickFeaturesUrl=void 0,this._proxy=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.enablePickFeatures=!0,this.reinitialize(e)}function w(e,t,r,i){return ie=!1,oe=!1,E(e,e._urlParts,function(n){return n(e,t,r,i)})}function S(e,t,r,i,n,o,a){return ie=!1,oe=!1,se=!1,ce=!1,E(e,e._pickFeaturesUrlParts,function(s){return s(e,t,r,i,n,o,a)})}function E(e,t,r){for(var i="",n=0;n<t.length;++n){var o=t[n];i+="string"==typeof o?o:encodeURIComponent(r(o))}var s=e._proxy;return a(s)&&(i=s.getURL(i)),i}function T(e,t){if(a(e)){for(var r,i,n=[],o=0,s=Object.keys(t);o<e.length;){r=Number.MAX_VALUE,i=void 0;for(var l=0;l<s.length;++l){var u=e.indexOf(s[l],o);u>=0&&u<r&&(r=u,i=s[l])}a(i)?(o<r&&n.push(e.substring(o,r)),n.push(t[i]),o=r+i.length):(n.push(e.substring(o)),o=e.length)}return n}}function x(e,t,r){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){var i=e.urlSchemeZeroPadding[t];if("string"==typeof i){var n=i.length;n>1&&(r=r.length>=n?r:new Array(n-r.toString().length+1).join("0")+r)}}return r}function P(e,t,r,i){return x(e,"{x}",t)}function A(e,t,r,i){var n=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return x(e,"{reverseX}",n)}function D(e,t,r,i){return x(e,"{y}",r)}function I(e,t,r,i){var n=e.tilingScheme.getNumberOfYTilesAtLevel(i)-r-1;return x(e,"{reverseY}",n)}function M(e,t,r,i){var n=e.maximumLevel,o=a(n)&&i<n?n-i-1:i;return x(e,"{reverseZ}",o)}function O(e,t,r,i){return x(e,"{z}",i)}function R(e,t,r,i){var n=(t+r+i)%e._subdomains.length;return e._subdomains[n]}function N(e,t,r,i){ie||(e.tilingScheme.tileXYToRectangle(t,r,i,ne),ne.west=g.toDegrees(ne.west),ne.south=g.toDegrees(ne.south),ne.east=g.toDegrees(ne.east),ne.north=g.toDegrees(ne.north),ie=!0)}function k(e,t,r,i){return N(e,t,r,i),ne.west}function L(e,t,r,i){return N(e,t,r,i),ne.south}function F(e,t,r,i){return N(e,t,r,i),ne.east}function B(e,t,r,i){return N(e,t,r,i),ne.north}function U(e,t,r,i){oe||(e.tilingScheme.tileXYToNativeRectangle(t,r,i,ae),oe=!0)}function V(e,t,r,i){return U(e,t,r,i),ae.west}function z(e,t,r,i){return U(e,t,r,i),ae.south}function G(e,t,r,i){return U(e,t,r,i),ae.east}function H(e,t,r,i){return U(e,t,r,i),ae.north}function W(e,t,r,i){return e.tileWidth}function j(e,t,r,i){return e.tileHeight}function q(e,t,r,i,n,o,a){return Z(e,t,r,i,n,o),le.x}function Y(e,t,r,i,n,o,a){return Z(e,t,r,i,n,o),le.y}function X(e,t,r,i,n,o,a){return Z(e,t,r,i,n,o),e.tileWidth-le.x-1}function Q(e,t,r,i,n,o,a){return Z(e,t,r,i,n,o),e.tileHeight-le.y-1}function Z(e,t,r,i,n,o,a){if(!se){te(e,t,r,i,n,o);var s=de,l=e.tilingScheme.tileXYToNativeRectangle(t,r,i,ue);le.x=e.tileWidth*(s.x-l.west)/l.width|0,le.y=e.tileHeight*(l.north-s.y)/l.height|0,se=!0}}function K(e,t,r,i,n,o,a){return g.toDegrees(n)}function J(e,t,r,i,n,o,a){return g.toDegrees(o)}function $(e,t,r,i,n,o,a){return te(e,t,r,i,n,o),de.x}function ee(e,t,r,i,n,o,a){return te(e,t,r,i,n,o),de.y}function te(e,t,r,i,n,o,a){if(!ce){if(e.tilingScheme instanceof c)de.x=g.toDegrees(n),de.y=g.toDegrees(o);else{var s=he;s.longitude=n,s.latitude=o,e.tilingScheme.projection.project(s,de)}ce=!0}}function re(e,t,r,i,n,o,a){return a}s(C.prototype,{url:{get:function(){return this._url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesUrl}},proxy:{get:function(){return this._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 a(this._urlParts)}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}}),C.prototype.reinitialize=function(e){var t=this;t._readyPromise=y(e).then(function(e){t.enablePickFeatures=o(e.enablePickFeatures,t.enablePickFeatures),t._url=e.url,t._urlSchemeZeroPadding=o(e.urlSchemeZeroPadding,t.urlSchemeZeroPadding),t._pickFeaturesUrl=e.pickFeaturesUrl,t._proxy=e.proxy,t._tileDiscardPolicy=e.tileDiscardPolicy,t._getFeatureInfoFormats=e.getFeatureInfoFormats,t._subdomains=e.subdomains,d(t._subdomains)?t._subdomains=t._subdomains.slice():a(t._subdomains)&&t._subdomains.length>0?t._subdomains=t._subdomains.split(""):t._subdomains=["a","b","c"],t._tileWidth=o(e.tileWidth,256),t._tileHeight=o(e.tileHeight,256),t._minimumLevel=o(e.minimumLevel,0),t._maximumLevel=e.maximumLevel,t._tilingScheme=o(e.tilingScheme,new _({ellipsoid:e.ellipsoid})),t._rectangle=o(e.rectangle,t._tilingScheme.rectangle),t._rectangle=v.intersection(t._rectangle,t._tilingScheme.rectangle),t._hasAlphaChannel=o(e.hasAlphaChannel,!0);var r=e.credit;return"string"==typeof r&&(r=new n(r)),t._credit=r,t._urlParts=T(t._url,pe),t._pickFeaturesUrlParts=T(t._pickFeaturesUrl,fe),!0})},C.prototype.getTileCredits=function(e,t,r){},C.prototype.requestImage=function(e,t,r){var i=w(this,e,t,r);return b.loadImage(this,i)},C.prototype.pickFeatures=function(e,t,r,i,n){function o(e,t){return e.callback(t)}function s(){if(l>=u._getFeatureInfoFormats.length)return y([]);var a=u._getFeatureInfoFormats[l],c=S(u,e,t,r,i,n,a.format);return++l,"json"===a.type?h(c).then(a.callback).otherwise(s):"xml"===a.type?m(c).then(a.callback).otherwise(s):"text"===a.type||"html"===a.type?p(c).then(a.callback).otherwise(s):f({url:c,responseType:a.format}).then(o.bind(void 0,a)).otherwise(s)}if(this.enablePickFeatures&&a(this._pickFeaturesUrl)&&0!==this._getFeatureInfoFormats.length){var l=0,u=this;return s()}};var ie=!1,ne=new v,oe=!1,ae=new v,se=!1,le=new e,ue=new v,ce=!1,de=new t,he=new r,pe={"{x}":P,"{y}":D,"{z}":O,"{s}":R,"{reverseX}":A,"{reverseY}":I,"{reverseZ}":M,"{westDegrees}":k,"{southDegrees}":L,"{eastDegrees}":F,"{northDegrees}":B,"{westProjected}":V,"{southProjected}":z,"{eastProjected}":G,"{northProjected}":H,"{width}":W,"{height}":j},fe=i(pe,{"{i}":q,"{j}":Y,"{reverseI}":X,"{reverseJ}":Q,"{longitudeDegrees}":K,"{latitudeDegrees}":J,"{longitudeProjected}":$,"{latitudeProjected}":ee,"{format}":re});return C}),define("Scene/createOpenStreetMapImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/DeveloperError","../Core/Rectangle","../Core/WebMercatorTilingScheme","./UrlTemplateImageryProvider"],function(e,t,r,i,n,o){"use strict";function a(r){r=t(r,{});var a=t(r.url,"https://a.tile.openstreetmap.org/");s.test(a)||(a+="/");var u=t(r.fileExtension,"png"),c=new n({ellipsoid:r.ellipsoid}),d=256,h=256,p=t(r.minimumLevel,0),f=r.maximumLevel,m=t(r.rectangle,c.rectangle),g=c.positionToTileXY(i.southwest(m),p),v=c.positionToTileXY(i.northeast(m),p),_=((Math.abs(v.x-g.x)+1)*(Math.abs(v.y-g.y)+1),t(r.credit,l));"string"==typeof _&&(_=new e(_));var y=a+"{z}/{x}/{y}."+u;return new o({url:y,proxy:r.proxy,credit:_,tilingScheme:c,tileWidth:d,tileHeight:h,minimumLevel:p,maximumLevel:f,rectangle:m})}var s=/\/$/,l=new e("MapQuest, Open Street Map and contributors, CC-BY-SA");return a}),define("Scene/createTangentSpaceDebugPrimitive",["../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/Matrix4","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(i){i=t(i,t.EMPTY_OBJECT);var u=[],c=i.geometry;r(c.attributes)&&r(c.primitiveType)||(c=c.constructor.createGeometry(c));var d=c.attributes,h=a.clone(t(i.modelMatrix,a.IDENTITY)),p=t(i.length,1e4);if(r(d.normal)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"normal",p),attributes:{color:new e(1,0,0,1)},modelMatrix:h})),r(d.tangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"tangent",p),attributes:{color:new e(0,1,0,1)},modelMatrix:h})),r(d.bitangent)&&u.push(new n({geometry:o.createLineSegmentsForVectors(c,"bitangent",p),attributes:{color:new e(0,0,1,1)},modelMatrix:h})),u.length>0)return new l({asynchronous:!1,geometryInstances:u,appearance:new s({flat:!0,translucent:!1})})}return u}),define("Scene/createTileMapServiceImageryProvider",["../Core/Cartesian2","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/DeveloperError","../Core/GeographicTilingScheme","../Core/joinUrls","../Core/loadXML","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./UrlTemplateImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(n){function f(s){for(var h,p,f,m=/tileformat/i,C=/tileset/i,w=/tilesets/i,S=/boundingbox/i,E=[],T=s.childNodes[0].childNodes,x=0;x<T.length;x++)if(m.test(T.item(x).nodeName))h=T.item(x);else if(w.test(T.item(x).nodeName)){f=T.item(x);for(var P=T.item(x).childNodes,A=0;A<P.length;A++)C.test(P.item(A).nodeName)&&E.push(P.item(A))}else S.test(T.item(x).nodeName)&&(p=T.item(x));var D=r(n.fileExtension,h.getAttribute("extension")),I=r(n.tileWidth,parseInt(h.getAttribute("width"),10)),M=r(n.tileHeight,parseInt(h.getAttribute("height"),10)),O=r(n.minimumLevel,parseInt(E[0].getAttribute("order"),10)),R=r(n.maximumLevel,parseInt(E[E.length-1].getAttribute("order"),10)),N=f.getAttribute("profile"),k=n.tilingScheme;if(!i(k))if("geodetic"===N||"global-geodetic"===N)k=new o({ellipsoid:n.ellipsoid});else{if("mercator"!==N&&"global-mercator"!==N){var L=a(_,"tilemapresource.xml")+"specifies an unsupported profile attribute, "+N+".";return v=c.handleError(v,b,b.errorEvent,L,void 0,void 0,void 0,g),void(v.retry||y.reject(new u(L)))}k=new d({ellipsoid:n.ellipsoid})}var F=l.clone(n.rectangle);if(!i(F)){var B,U,V,z,G=r(n.flipXY,!1);G?(V=new e(parseFloat(p.getAttribute("miny")),parseFloat(p.getAttribute("minx"))),z=new e(parseFloat(p.getAttribute("maxy")),parseFloat(p.getAttribute("maxx")))):(V=new e(parseFloat(p.getAttribute("minx")),parseFloat(p.getAttribute("miny"))),z=new e(parseFloat(p.getAttribute("maxx")),parseFloat(p.getAttribute("maxy"))));var H="geodetic"===N||"mercator"===N;if(k instanceof o||H)B=t.fromDegrees(V.x,V.y),U=t.fromDegrees(z.x,z.y);else{var W=k.projection;B=W.unproject(V),U=W.unproject(z)}F=new l(B.longitude,B.latitude,U.longitude,U.latitude)}F.west<k.rectangle.west&&(F.west=k.rectangle.west),F.east>k.rectangle.east&&(F.east=k.rectangle.east),F.south<k.rectangle.south&&(F.south=k.rectangle.south),F.north>k.rectangle.north&&(F.north=k.rectangle.north);var j=k.positionToTileXY(l.southwest(F),O),q=k.positionToTileXY(l.northeast(F),O),Y=(Math.abs(q.x-j.x)+1)*(Math.abs(q.y-j.y)+1);Y>4&&(O=0);var X=a(_,"{z}/{x}/{reverseY}."+D);y.resolve({url:X,tilingScheme:k,rectangle:F,tileWidth:I,tileHeight:M,minimumLevel:O,maximumLevel:R,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function m(e){var t=r(n.fileExtension,"png"),o=r(n.tileWidth,256),s=r(n.tileHeight,256),l=r(n.minimumLevel,0),u=n.maximumLevel,c=i(n.tilingScheme)?n.tilingScheme:new d({ellipsoid:n.ellipsoid}),h=r(n.rectangle,c.rectangle),p=a(_,"{z}/{x}/{reverseY}."+t);y.resolve({url:p,tilingScheme:c,rectangle:h,tileWidth:o,tileHeight:s,minimumLevel:l,maximumLevel:u,proxy:n.proxy,tileDiscardPolicy:n.tileDiscardPolicy,credit:n.credit})}function g(){var e=a(_,"tilemapresource.xml"),t=n.proxy;i(t)&&(e=t.getURL(e)),s(e).then(f).otherwise(m)}n=r(n,{});var v,_=n.url,y=h.defer(),b=new p(y.promise);return g(),b}return f}),define("Scene/CreditDisplay",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r,i,n){"use strict";function o(e,t,i){if(!r(e.element)){var n=e.text,o=e.link,a=document.createElement("span");if(e.hasLink()){var s=document.createElement("a");s.textContent=n,s.href=o,s.target="_blank",a.appendChild(s)}else a.textContent=n;a.className="cesium-credit-text",e.element=a}if(t.hasChildNodes()){var l=document.createElement("span");l.textContent=i,l.className="cesium-credit-delimiter",t.appendChild(l)}t.appendChild(e.element)}function a(e,t){if(!r(e.element)){var i=e.text,n=e.link,o=document.createElement("span"),a=document.createElement("img");if(a.src=e.imageUrl,a.style["vertical-align"]="bottom",r(i)&&(a.alt=i,a.title=i),e.hasLink()){var s=document.createElement("a");s.appendChild(a),s.href=n,s.target="_blank",o.appendChild(s)}else o.appendChild(a);o.className="cesium-credit-image",e.element=o}t.appendChild(e.element)}function s(t,r){for(var i=t.length,n=0;n<i;n++){var o=t[n];if(e.equals(o,r))return!0}return!1}function l(e){var t=e.element;if(r(t)){var i=t.parentNode;if(!e.hasImage()){var n=t.previousSibling;null===n&&(n=t.nextSibling),null!==n&&i.removeChild(n)}i.removeChild(t)}}function u(e,t){var i,n,a,s=e._displayedCredits.textCredits;for(i=0;i<t.length;i++)a=t[i],r(a)&&(n=s.indexOf(a),n===-1?o(a,e._textContainer,e._delimiter):s.splice(n,1));for(i=0;i<s.length;i++)a=s[i],r(a)&&l(a)}function c(e,t){var i,n,o,s=e._displayedCredits.imageCredits;for(i=0;i<t.length;i++)o=t[i],r(o)&&(n=s.indexOf(o),n===-1?a(o,e._imageContainer):s.splice(n,1));for(i=0;i<s.length;i++)o=s[i],r(o)&&l(o)}function d(e,r){var i=document.createElement("span");i.className="cesium-credit-imageContainer";var n=document.createElement("span");n.className="cesium-credit-textContainer",e.appendChild(i),e.appendChild(n),this._delimiter=t(r," • "),this._textContainer=n,this._imageContainer=i,this._defaultImageCredits=[],this._defaultTextCredits=[],this._displayedCredits={imageCredits:[],textCredits:[]},this._currentFrameCredits={imageCredits:[],textCredits:[]},this.container=e}return d.prototype.addCredit=function(e){if(e.hasImage()){var t=this._currentFrameCredits.imageCredits;s(this._defaultImageCredits,e)||(t[e.id]=e)}else{var r=this._currentFrameCredits.textCredits;s(this._defaultTextCredits,e)||(r[e.id]=e)}},d.prototype.addDefaultCredit=function(e){if(e.hasImage()){var t=this._defaultImageCredits;s(t,e)||t.push(e)}else{var r=this._defaultTextCredits;s(r,e)||r.push(e)}},d.prototype.removeDefaultCredit=function(e){var t;e.hasImage()?(t=this._defaultImageCredits.indexOf(e),t!==-1&&this._defaultImageCredits.splice(t,1)):(t=this._defaultTextCredits.indexOf(e),t!==-1&&this._defaultTextCredits.splice(t,1))},d.prototype.beginFrame=function(){this._currentFrameCredits.imageCredits.length=0,this._currentFrameCredits.textCredits.length=0},d.prototype.endFrame=function(){var e=this._defaultTextCredits.concat(this._currentFrameCredits.textCredits),t=this._defaultImageCredits.concat(this._currentFrameCredits.imageCredits);u(this,e),c(this,t),this._displayedCredits.textCredits=e,this._displayedCredits.imageCredits=t},d.prototype.destroy=function(){return this.container.removeChild(this._textContainer),this.container.removeChild(this._imageContainer),i(this)},d.prototype.isDestroyed=function(){return!1},d}),define("Scene/DebugAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","./Appearance"],function(e,t,r,i,n){"use strict";function o(r){r=e(r,e.EMPTY_OBJECT);var i=r.attributeName,o=r.perInstanceAttribute;t(o)||(o=!1);var a,s=e(r.glslDatatype,"vec3"),l="v_"+i;if("normal"===i||"tangent"===i||"bitangent"===i)a="vec4 getColor() { return vec4(("+l+" + vec3(1.0)) * 0.5, 1.0); }\n";else switch("st"===i&&(s="vec2"),s){case"float":a="vec4 getColor() { return vec4(vec3("+l+"), 1.0); }\n";break;case"vec2":a="vec4 getColor() { return vec4("+l+", 0.0, 1.0); }\n";break;case"vec3":a="vec4 getColor() { return vec4("+l+", 1.0); }\n";break;case"vec4":a="vec4 getColor() { return "+l+"; }\n"}var u="attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute float batchId;\n"+(o?"":"attribute "+s+" "+i+";\n")+"varying "+s+" "+l+";\nvoid main()\n{\nvec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n"+(o?l+" = czm_batchTable_"+i+"(batchId);\n":l+" = "+i+";\n")+"gl_Position = czm_modelViewProjectionRelativeToEye * p;\n}",c="varying "+s+" "+l+";\n"+a+"\nvoid main()\n{\ngl_FragColor = getColor();\n}";this.material=void 0,this.translucent=e(r.translucent,!1),this._vertexShaderSource=e(r.vertexShaderSource,u),this._fragmentShaderSource=e(r.fragmentShaderSource,c),this._renderState=n.getDefaultRenderState(!1,!1,r.renderState),this._closed=e(r.closed,!1),this._attributeName=i,this._glslDatatype=s}return r(o.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}}}),o.prototype.getFragmentShaderSource=n.prototype.getFragmentShaderSource,o.prototype.isTranslucent=n.prototype.isTranslucent,o.prototype.getRenderState=n.prototype.getRenderState,o}),define("Scene/DebugCameraPrimitive",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/ComponentDatatype","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryInstance","../Core/Matrix4","../Core/PrimitiveType","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e){e=a(e,a.EMPTY_OBJECT),this._camera=e.camera,this._color=a(e.color,i.CYAN),this._updateOnChange=a(e.updateOnChange,!0),this.show=a(e.show,!0),this.id=e.id,this._id=void 0,this._outlinePrimitive=void 0,this._planesPrimitive=void 0}var _=new Array(4);_[0]=new r(-1,-1,1,1),_[1]=new r(1,-1,1,1),_[2]=new r(1,1,1,1),_[3]=new r(-1,1,1,1);for(var y=new p,b=new Array(4),C=0;C<4;++C)b[C]=new r;var w=new i,S=[1,1e5];return v.prototype.update=function(a){if(this.show){if(this._updateOnChange&&(this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive=this._planesPrimitive&&this._planesPrimitive.destroy()),!s(this._outlinePrimitive)){var l=this._camera,u=l.frustum,v=a.frustumSplits,C=v.length-1;C<=0&&(v=S,v[0]=this._camera.frustum.near,v[1]=this._camera.frustum.far,C=1);var E,T,x=this._camera.viewMatrix;if(s(l.frustum.fovy)){var P=this._camera.frustum.projectionMatrix,A=p.multiply(P,x,y);T=p.inverse(A,y)}else E=p.inverseTransformation(x,y);var D,I=new Float64Array(12*(C+1));for(D=0;D<C+1;++D)for(var M=0;M<4;++M){var O=r.clone(_[M],b[M]);if(s(T)){O=p.multiplyByVector(T,O,O);var R=1/O.w;t.multiplyByScalar(O,R,O),t.subtract(O,this._camera.positionWC,O),t.normalize(O,O);var N=t.dot(this._camera.directionWC,O);t.multiplyByScalar(O,v[D]/N,O),t.add(O,this._camera.positionWC,O)}else{s(u._offCenterFrustum)&&(u=u._offCenterFrustum);var k,L;D===C?(k=v[D-1],L=v[D]):(k=v[D],L=v[D+1]),O.x=.5*(O.x*(u.right-u.left)+u.left+u.right),O.y=.5*(O.y*(u.top-u.bottom)+u.bottom+u.top),O.z=.5*(O.z*(k-L)-k-L),O.w=1,p.multiplyByVector(E,O,O)}I[12*D+3*M]=O.x,I[12*D+3*M+1]=O.y,I[12*D+3*M+2]=O.z}var F=new e.fromVertices(I),B=new d;B.position=new c({componentDatatype:o.DOUBLE,componentsPerAttribute:3,values:I});var U,V,z=new Uint16Array(8*(2*C+1));for(D=0;D<C+1;++D)U=8*D,V=4*D,z[U]=V,z[U+1]=V+1,z[U+2]=V+1,z[U+3]=V+2,z[U+4]=V+2,z[U+5]=V+3,z[U+6]=V+3,z[U+7]=V;for(D=0;D<C;++D)U=8*(C+1+D),V=4*D,z[U]=V,z[U+1]=V+4,z[U+2]=V+1,z[U+3]=V+5,z[U+4]=V+2,z[U+5]=V+6,z[U+6]=V+3,z[U+7]=V+7;this._outlinePrimitive=new g({geometryInstances:new h({geometry:{attributes:B,indices:z,primitiveType:f.LINES,boundingSphere:F},attributes:{color:n.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new m({translucent:!1,flat:!0}),asynchronous:!1});var G=new Uint16Array(6*(5*C+1));for(D=0;D<C+1;++D)U=6*D,V=4*D,G[U]=V,G[U+1]=V+1,G[U+2]=V+2,G[U+3]=V,G[U+4]=V+2,G[U+5]=V+3;for(D=0;D<C;++D)U=6*(C+1+4*D),V=4*D,G[U]=V+4,G[U+1]=V,G[U+2]=V+3,G[U+3]=V+4,G[U+4]=V+3,G[U+5]=V+7,G[U+6]=V+4,G[U+7]=V,G[U+8]=V+1,G[U+9]=V+4,G[U+10]=V+1,G[U+11]=V+5,G[U+12]=V+7,G[U+13]=V+3,G[U+14]=V+2,G[U+15]=V+7,G[U+16]=V+2,G[U+17]=V+6,G[U+18]=V+6,G[U+19]=V+2,G[U+20]=V+1,G[U+21]=V+6,G[U+22]=V+1,G[U+23]=V+5;this._planesPrimitive=new g({geometryInstances:new h({geometry:{attributes:B,indices:G,primitiveType:f.TRIANGLES,boundingSphere:F},attributes:{color:n.fromColor(i.fromAlpha(this._color,.1,w))},id:this.id,pickPrimitive:this}),appearance:new m({translucent:!0,flat:!0}),asynchronous:!1})}this._outlinePrimitive.update(a),this._planesPrimitive.update(a)}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive=this._planesPrimitive&&this._planesPrimitive.destroy(),l(this)},v}),define("Scene/DebugModelMatrixPrimitive",["../Core/Cartesian3","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/GeometryInstance","../Core/Matrix4","../Core/PolylineGeometry","./PolylineColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT),this.length=r(e.length,1e7),this._length=void 0,this.width=r(e.width,2),this._width=void 0,this.show=r(e.show,!0),this.modelMatrix=a.clone(r(e.modelMatrix,a.IDENTITY)),this._modelMatrix=new a,this.id=e.id,this._id=void 0,this._primitive=void 0}return c.prototype.update=function(r){if(this.show){if(!i(this._primitive)||!a.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=a.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,i(this._primitive)&&this._primitive.destroy(),0===this.modelMatrix[12]&&0===this.modelMatrix[13]&&0===this.modelMatrix[14]&&(this.modelMatrix[14]=.01);var n=new o({geometry:new s({positions:[e.ZERO,e.UNIT_X],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.RED,t.RED],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),c=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Y],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.GREEN,t.GREEN],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this}),d=new o({geometry:new s({positions:[e.ZERO,e.UNIT_Z],width:this.width,vertexFormat:l.VERTEX_FORMAT,colors:[t.BLUE,t.BLUE],followSurface:!1}),modelMatrix:a.multiplyByUniformScale(this.modelMatrix,this.length,new a),id:this.id,pickPrimitive:this});this._primitive=new u({geometryInstances:[n,c,d],appearance:new l,asynchronous:!1})}this._primitive.update(r)}},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),n(this)},c}),define("Shaders/DepthPlaneFS",[],function(){"use strict";return"varying vec4 positionEC;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(positionEC.xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n"}),define("Shaders/DepthPlaneVS",[],function(){"use strict";return"attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\n}\n"}),define("Scene/DepthPlane",["../Core/BoundingSphere","../Core/Cartesian3","../Core/ComponentDatatype","../Core/defined","../Core/FeatureDetection","../Core/Geometry","../Core/GeometryAttribute","../Core/PrimitiveType","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/DepthPlaneFS","../Shaders/DepthPlaneVS","./DepthFunction","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0}function y(e,r){var i=e.radii,n=r.camera.positionWC,o=t.multiplyComponents(e.oneOverRadii,n,C),a=t.magnitude(o),s=t.normalize(o,w),l=t.normalize(t.cross(t.UNIT_Z,o,S),S),u=t.normalize(t.cross(s,l,E),E),c=Math.sqrt(t.magnitudeSquared(o)-1),d=t.multiplyByScalar(s,1/a,C),h=c/a,p=t.multiplyByScalar(l,h,w),f=t.multiplyByScalar(u,h,S),m=t.add(d,f,E);t.subtract(m,p,m),t.multiplyComponents(i,m,m),t.pack(m,b,0);var g=t.subtract(d,f,E);t.subtract(g,p,g),t.multiplyComponents(i,g,g),t.pack(g,b,3);var v=t.add(d,f,E);t.add(v,p,v),t.multiplyComponents(i,v,v),t.pack(v,b,6);var _=t.subtract(d,f,E);return t.add(_,p,_),t.multiplyComponents(i,_,_),t.pack(_,b,9),b}var b=n.supportsTypedArrays()?new Float32Array(12):[],C=new t,w=new t,S=new t,E=new t;return _.prototype.update=function(n){if(this._mode=n.mode,n.mode===v.SCENE3D){var _=n.context,b=n.mapProjection.ellipsoid;i(this._command)||(this._rs=d.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:g.ALWAYS},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._sp=h.fromCache({context:_,vertexShaderSource:m,fragmentShaderSource:f,attributeLocations:{position:0}}),this._command=new u({renderState:this._rs,shaderProgram:this._sp,boundingVolume:new e(t.ZERO,b.maximumRadius),pass:c.OPAQUE,owner:this}));var C=y(b,n);if(i(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(C);else{ +var w=new o({attributes:{position:new a({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:C})},indices:[0,1,2,2,1,3],primitiveType:s.TRIANGLES});this._va=p.fromGeometry({context:_,geometry:w,attributeLocations:{position:0},bufferUsage:l.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}},_.prototype.execute=function(e,t){this._mode===v.SCENE3D&&this._command.execute(e,t)},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()},_}),define("Scene/DeviceOrientationCameraController",["../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Math","../Core/Matrix3","../Core/Quaternion"],function(e,t,r,i,n,o){"use strict";function a(t){function r(t){var r=t.alpha;return e(r)?(n._alpha=i.toRadians(r),n._beta=i.toRadians(t.beta),void(n._gamma=i.toRadians(t.gamma))):(n._alpha=void 0,n._beta=void 0,void(n._gamma=void 0))}this._scene=t,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 n=this;window.addEventListener("deviceorientation",r,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",r,!1)}}function s(e,t,r,i){var a=e.direction,s=e.right,d=e.up,h=o.fromAxisAngle(a,r,u),p=o.fromAxisAngle(s,i,l),f=o.multiply(p,h,p),m=o.fromAxisAngle(d,t,u);o.multiply(m,f,f);var g=n.fromQuaternion(f,c);n.multiplyByVector(g,s,s),n.multiplyByVector(g,d,d),n.multiplyByVector(g,a,a)}var l=new o,u=new o,c=new n;return a.prototype.update=function(){if(e(this._alpha)){e(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);var t=this._lastAlpha-this._alpha,r=this._lastBeta-this._beta,i=this._lastGamma-this._gamma;s(this._scene.camera,-t,r,i),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this._removeListener(),t(this)},a}),define("Shaders/EllipsoidFS",[],function(){"use strict";return"#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);\n#else\nreturn czm_phong(normalize(positionToEyeEC), material);\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_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\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);\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}\n"}),define("Shaders/EllipsoidVS",[],function(){"use strict";return"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);\n}\n"}),define("Scene/EllipsoidPrimitive",["../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian3","../Core/combine","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/EllipsoidFS","../Shaders/EllipsoidVS","./BlendingState","./CullFace","./Material","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w){"use strict";function S(t){t=n(t,n.EMPTY_OBJECT),this.center=r.clone(n(t.center,r.ZERO)),this._center=new r,this.radii=r.clone(t.radii),this._radii=new r,this._oneOverEllipsoidRadiiSquared=new r,this._boundingSphere=new e,this.modelMatrix=l.clone(n(t.modelMatrix,l.IDENTITY)),this._modelMatrix=new l,this._computedModelMatrix=new l,this.show=n(t.show,!0),this.material=n(t.material,C.fromType(C.ColorType)),this._material=void 0,this._translucent=void 0,this.id=t.id,this._id=void 0,this.debugShowBoundingVolume=n(t.debugShowBoundingVolume,!1),this.onlySunLighting=n(t.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=n(t.depthTestEnabled,!0),this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new d({owner:n(t._owner,this)}),this._pickCommand=new d({owner:n(t._owner,this)});var i=this;this._uniforms={u_radii:function(){return i.radii},u_oneOverEllipsoidRadiiSquared:function(){return i._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return i._pickId.color}}}function E(e){var i=e.cache.ellipsoidPrimitive_vertexArray;if(o(i))return i;var n=t.createGeometry(t.fromDimensions({dimensions:new r(2,2,2),vertexFormat:u.POSITION_ONLY}));return i=g.fromGeometry({context:e,geometry:n,attributeLocations:T,bufferUsage:c.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=i,i}var T={position:0};return S.prototype.update=function(t){if(this.show&&t.mode===w.SCENE3D&&o(this.center)&&o(this.radii)){var n=t.context,a=this.material.isTranslucent(),s=this._translucent!==a;o(this._rs)&&!s||(this._translucent=a,this._rs=p.fromCache({cull:{enabled:!0,face:b.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!a&&n.fragmentDepth,blending:a?y.ALPHA_BLEND:void 0})),o(this._va)||(this._va=E(n));var u=!1,c=this.radii;if(!r.equals(this._radii,c)){r.clone(c,this._radii);var d=this._oneOverEllipsoidRadiiSquared;d.x=1/(c.x*c.x),d.y=1/(c.y*c.y),d.z=1/(c.z*c.z),u=!0}l.equals(this.modelMatrix,this._modelMatrix)&&r.equals(this.center,this._center)||(l.clone(this.modelMatrix,this._modelMatrix),r.clone(this.center,this._center),l.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),u=!0),u&&(r.clone(r.ZERO,this._boundingSphere.center),this._boundingSphere.radius=r.maximumComponent(c),e.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));var g=this._material!==this.material;this._material=this.material,this._material.update(n);var C=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;var S,x=this._colorCommand;(g||C||s)&&(S=new m({sources:[this.material.shaderSource,v]}),this.onlySunLighting&&S.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&S.defines.push("WRITE_DEPTH"),this._sp=f.replaceCache({context:n,shaderProgram:this._sp,vertexShaderSource:_,fragmentShaderSource:S,attributeLocations:T}),x.vertexArray=this._va,x.renderState=this._rs,x.shaderProgram=this._sp,x.uniformMap=i(this._uniforms,this.material._uniforms),x.executeInClosestFrustum=a);var P=t.commandList,A=t.passes;if(A.render&&(x.boundingVolume=this._boundingSphere,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.modelMatrix=this._computedModelMatrix,x.pass=a?h.TRANSLUCENT:h.OPAQUE,P.push(x)),A.pick){var D=this._pickCommand;o(this._pickId)&&this._id===this.id||(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=n.createPickId({primitive:this,id:this.id})),(g||C||!o(this._pickSP))&&(S=new m({sources:[this.material.shaderSource,v],pickColorQualifier:"uniform"}),this.onlySunLighting&&S.defines.push("ONLY_SUN_LIGHTING"),!a&&n.fragmentDepth&&S.defines.push("WRITE_DEPTH"),this._pickSP=f.replaceCache({context:n,shaderProgram:this._pickSP,vertexShaderSource:_,fragmentShaderSource:S,attributeLocations:T}),D.vertexArray=this._va,D.renderState=this._rs,D.shaderProgram=this._pickSP,D.uniformMap=i(i(this._uniforms,this._pickUniforms),this.material._uniforms),D.executeInClosestFrustum=a),D.boundingVolume=this._boundingSphere,D.modelMatrix=this._computedModelMatrix,D.pass=a?h.TRANSLUCENT:h.OPAQUE,P.push(D)}}},S.prototype.isDestroyed=function(){return!1},S.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(),a(this)},S}),define("Shaders/Appearances/EllipsoidSurfaceAppearanceFS",[],function(){"use strict";return"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);\n#endif\n}\n"}),define("Shaders/Appearances/EllipsoidSurfaceAppearanceVS",[],function(){"use strict";return"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"}),define("Scene/EllipsoidSurfaceAppearance",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/VertexFormat","../Shaders/Appearances/EllipsoidSurfaceAppearanceFS","../Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Appearance","./Material"],function(e,t,r,i,n,o,a,s){"use strict";function l(r){r=e(r,e.EMPTY_OBJECT);var i=e(r.translucent,!0),l=e(r.aboveGround,!1);this.material=t(r.material)?r.material:s.fromType(s.ColorType),this.translucent=e(r.translucent,!0),this._vertexShaderSource=e(r.vertexShaderSource,o),this._fragmentShaderSource=e(r.fragmentShaderSource,n),this._renderState=a.getDefaultRenderState(i,!l,r.renderState),this._closed=!1,this._flat=e(r.flat,!1),this._faceForward=e(r.faceForward,l),this._aboveGround=l}return r(l.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 l.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}}),l.VERTEX_FORMAT=i.POSITION_AND_ST,l.prototype.getFragmentShaderSource=a.prototype.getFragmentShaderSource,l.prototype.isTranslucent=a.prototype.isTranslucent,l.prototype.getRenderState=a.prototype.getRenderState,l}),define("Scene/Fog",["../Core/Cartesian3","../Core/defined","../Core/Math","./SceneMode"],function(e,t,r,i){"use strict";function n(){this.enabled=!0,this.density=2e-4,this.screenSpaceErrorFactor=2}function o(e){var t=a,r=t.length;if(e<t[0])return h=0;if(e>t[r-1])return h=r-2;if(e>=t[h]){if(h+1<r&&e<t[h+1])return h;if(h+2<r&&e<t[h+2])return++h,h}else if(h-1>=0&&e>=t[h-1])return--h,h;var i;for(i=0;i<r-2&&!(e>=t[i]&&e<t[i+1]);++i);return h=i}for(var a=[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],s=[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],l=0;l<s.length;++l)s[l]*=1e6;for(var u=s[1],c=s[s.length-1],d=0;d<s.length;++d)s[d]=(s[d]-c)/(u-c);var h=0,p=new e;return n.prototype.update=function(n){var l=n.fog.enabled=this.enabled;if(l){var d=n.camera,h=d.positionCartographic;if(!t(h)||h.height>8e5||n.mode!==i.SCENE3D)return void(n.fog.enabled=!1);var f=h.height,m=o(f),g=r.clamp((f-a[m])/(a[m+1]-a[m]),0,1),v=r.lerp(s[m],s[m+1],g),_=1e6*this.density,y=_/u*c;v=v*(_-y)*1e-6;var b=e.normalize(d.positionWC,p),C=Math.abs(e.dot(d.directionWC,b));v*=1-C,n.fog.density=v,n.fog.sse=this.screenSpaceErrorFactor}},n}),define("Scene/FrameRateMonitor",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/TimeConstants"],function(e,t,r,i,n,o,a,s){"use strict";function l(r){function i(){c(n)}this._scene=r.scene,this.samplingWindow=e(r.samplingWindow,l.defaultSettings.samplingWindow),this.quietPeriod=e(r.quietPeriod,l.defaultSettings.quietPeriod),this.warmupPeriod=e(r.warmupPeriod,l.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=e(r.minimumFrameRateDuringWarmup,l.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=e(r.minimumFrameRateAfterWarmup,l.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new o,this._nominalFrameRate=new o,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;var n=this;this._preRenderRemoveListener=this._scene.preRender.addEventListener(function(e,t){u(n,t)}),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 a=void 0!==document.hidden?"visibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.webkitHidden?"webkitvisibilitychange":void 0;this._visibilityChangeRemoveListener=void 0,t(a)&&(document.addEventListener(a,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(a,i,!1)})}function u(e,t){if(!(e._pauseCount>0)){var r=a();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=r+e.quietPeriod/s.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/s.SECONDS_PER_MILLISECOND;else if(r>=e._quietPeriodEndTime){e._frameTimes.push(r);var i=r-e.samplingWindow/s.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();var n=(r-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/n;var o=1e3/(r>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);n>o?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 c(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}return l.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8},l.fromScene=function(e){return t(e._frameRateMonitor)&&!e._frameRateMonitor.isDestroyed()||(e._frameRateMonitor=new l({scene:e})),e._frameRateMonitor},r(l.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}}}),l.prototype.pause=function(){++this._pauseCount,1===this._pauseCount&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)},l.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._preRenderRemoveListener(),t(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),i(this)},l}),define("Scene/FrameState",["./SceneMode"],function(e){"use strict";function t(t,r,i){this.context=t,this.commandList=[],this.shadowMaps=[],this.mode=e.SCENE3D,this.morphTime=e.getMorphTime(e.SCENE3D),this.frameNumber=0,this.time=void 0,this.jobScheduler=i,this.mapProjection=void 0,this.camera=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.passes={render:!1,pick:!1,depth:!1},this.creditDisplay=r,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0},this.terrainExaggeration=1,this.shadowHints={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.imagerySplitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.minimumDisableDepthTestDistance=void 0}return t.prototype.addCommand=function(e){this.commandList.push(e)},t}),define("Scene/FrustumCommands",["../Core/defaultValue","../Renderer/Pass"],function(e,t){"use strict";function r(r,i){this.near=e(r,0),this.far=e(i,0);for(var n=t.NUMBER_OF_PASSES,o=new Array(n),a=new Array(n),s=0;s<n;++s)o[s]=[],a[s]=0;this.commands=o,this.indices=a}return r}),define("Shaders/PostProcessFilters/FXAA",[],function(){"use strict";return"varying vec2 v_textureCoordinates;\nuniform sampler2D u_texture;\nuniform vec2 u_fxaaQualityRcpFrame;\nconst float fxaaQualitySubpix = 0.5;\nconst float fxaaQualityEdgeThreshold = 0.125;\nconst float fxaaQualityEdgeThresholdMin = 0.0833;\nvoid main()\n{\nvec4 color = FxaaPixelShader(\nv_textureCoordinates,\nu_texture,\nu_fxaaQualityRcpFrame,\nfxaaQualitySubpix,\nfxaaQualityEdgeThreshold,\nfxaaQualityEdgeThresholdMin);\nfloat alpha = texture2D(u_texture, v_textureCoordinates).a;\ngl_FragColor = vec4(color.rgb, alpha);\n}\n"}),define("ThirdParty/Shaders/FXAA3_11",[],function(){"use strict";return"#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"; +}),define("Scene/FXAA",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Shaders/PostProcessFilters/FXAA","../ThirdParty/Shaders/FXAA3_11"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_){"use strict";function y(){this._texture=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=void 0,this._command=void 0,this._viewport=new e,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0;var t=new a({color:new r(0,0,0,0),depth:1,owner:this});this._clearCommand=t,this._qualityPreset=39}function b(e){e._fbo=e._fbo&&e._fbo.destroy(),e._texture=e._texture&&e._texture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&e._depthStencilTexture.destroy(),e._depthStencilRenderbuffer=e._depthStencilRenderbuffer&&e._depthStencilRenderbuffer.destroy(),e._fbo=void 0,e._texture=void 0,e._depthStencilTexture=void 0,e._depthStencilRenderbuffer=void 0,i(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0)}return y.prototype.update=function(r,n){var a=r.drawingBufferWidth,y=r.drawingBufferHeight,b=this._texture,C=!i(b)||b.width!==a||b.height!==y;if(C&&(this._texture=this._texture&&this._texture.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),this._texture=new p({context:r,width:a,height:y,pixelFormat:o.RGBA,pixelDatatype:l.UNSIGNED_BYTE,sampler:new h({wrapS:g.CLAMP_TO_EDGE,wrapT:g.CLAMP_TO_EDGE,minificationFilter:m.LINEAR,magnificationFilter:f.LINEAR})}),r.depthTexture?this._depthStencilTexture=new p({context:r,width:a,height:y,pixelFormat:o.DEPTH_STENCIL,pixelDatatype:l.UNSIGNED_INT_24_8}):this._depthStencilRenderbuffer=new u({context:r,width:a,height:y,format:c.DEPTH_STENCIL})),i(this._fbo)&&!C||(this._fbo=this._fbo&&this._fbo.destroy(),this._fbo=new s({context:r,colorTextures:[this._texture],depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})),!i(this._command)){var w="#define FXAA_QUALITY_PRESET "+this._qualityPreset+"\n"+_+"\n"+v;this._command=r.createViewportQuadCommand(w,{owner:this})}this._viewport.width=a,this._viewport.height=y;var S=!e.equals(this._viewport,n.viewport),E=S!==this._useScissorTest;if(this._useScissorTest=S,e.equals(this._scissorRectangle,n.viewport)||(this._scissorRectangle=e.clone(n.viewport,this._scissorRectangle),E=!0),i(this._rs)&&e.equals(this._rs.viewport,this._viewport)&&!E||(this._rs=d.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),this._command.renderState=this._rs,C){var T=this,x=new t(1/this._texture.width,1/this._texture.height);this._command.uniformMap={u_texture:function(){return T._texture},u_fxaaQualityRcpFrame:function(){return x}}}},y.prototype.execute=function(e,t){this._command.execute(e,t)},y.prototype.clear=function(e,t,i){var n=t.framebuffer;t.framebuffer=this._fbo,r.clone(i,this._clearCommand.color),this._clearCommand.execute(e,t),t.framebuffer=n},y.prototype.getColorFramebuffer=function(){return this._fbo},y.prototype.isDestroyed=function(){return!1},y.prototype.destroy=function(){return b(this),n(this)},y}),define("Scene/GetFeatureInfoFormat",["../Core/Cartographic","../Core/defined","../Core/DeveloperError","../Core/RuntimeError","./ImageryLayerFeatureInfo"],function(e,t,r,i,n){"use strict";function o(e,r,i){this.type=e,t(r)||("json"===e?r="application/json":"xml"===e?r="text/xml":"html"===e?r="text/html":"text"===e&&(r="text/plain")),this.format=r,t(i)||("json"===e?i=a:"xml"===e?i=s:"html"===e?i=m:"text"===e&&(i=m)),this.callback=i}function a(r){for(var i=[],o=r.features,a=0;a<o.length;++a){var s=o[a],l=new n;if(l.data=s,l.properties=s.properties,l.configureNameFromProperties(s.properties),l.configureDescriptionFromProperties(s.properties),t(s.geometry)&&"Point"===s.geometry.type){var u=s.geometry.coordinates[0],c=s.geometry.coordinates[1];l.position=e.fromDegrees(u,c)}i.push(l)}return i}function s(e){var t=e.documentElement;if("MultiFeatureCollection"===t.localName&&t.namespaceURI===g)return l(e);if("FeatureInfoResponse"===t.localName&&t.namespaceURI===v)return u(e);if("FeatureCollection"===t.localName&&t.namespaceURI===_)return c(e);if("ServiceExceptionReport"===t.localName)throw new i((new XMLSerializer).serializeToString(t));return"msGMLOutput"===t.localName?d(e):f(e)}function l(e){for(var t=[],r=e.documentElement,i=r.getElementsByTagNameNS(g,"Feature"),o=0;o<i.length;++o){for(var a=i[o],s={},l=a.getElementsByTagNameNS(g,"Val"),u=0;u<l.length;++u){var c=l[u];if(c.hasAttribute("ref")){var d=c.getAttribute("ref"),h=c.textContent.trim();s[d]=h}}var p=new n;p.data=a,p.properties=s,p.configureNameFromProperties(s),p.configureDescriptionFromProperties(s),t.push(p)}return t}function u(e){var t,r=e.documentElement,i=[],n=r.getElementsByTagNameNS("*","FIELDS");if(n.length>0)for(var o=0;o<n.length;++o){var a=n[o];t={};for(var s=a.attributes,l=0;l<s.length;++l){var u=s[l];t[u.name]=u.value}i.push(p(a,t))}else for(var c=r.getElementsByTagNameNS("*","FeatureInfo"),d=0;d<c.length;++d){var h=c[d];t={};for(var f=h.childNodes,m=0;m<f.length;++m){var g=f[m];g.nodeType===Node.ELEMENT_NODE&&(t[g.localName]=g.textContent)}i.push(p(h,t))}return i}function c(e){for(var t=[],r=e.documentElement,i=r.getElementsByTagNameNS(y,"featureMember"),n=0;n<i.length;++n){var o=i[n],a={};h(o,a),t.push(p(o,a))}return t}function d(e){for(var t,r=[],i=e.documentElement.childNodes,n=0;n<i.length;n++)if(i[n].nodeType===Node.ELEMENT_NODE){t=i[n];break}for(var o=t.childNodes,a=0;a<o.length;++a){var s=o[a];if(s.nodeType===Node.ELEMENT_NODE){var l={};h(s,l),r.push(p(s,l))}}return r}function h(e,t){for(var r=!0,i=0;i<e.childNodes.length;++i){var n=e.childNodes[i];n.nodeType===Node.ELEMENT_NODE&&(r=!1),"Point"!==n.localName&&"LineString"!==n.localName&&"Polygon"!==n.localName&&"boundedBy"!==n.localName&&n.hasChildNodes()&&h(n,t)&&(t[n.localName]=n.textContent)}return r}function p(e,t){var r=new n;return r.data=e,r.properties=t,r.configureNameFromProperties(t),r.configureDescriptionFromProperties(t),r}function f(e){var t=(new XMLSerializer).serializeToString(e),r=document.createElement("div"),i=document.createElement("pre");i.textContent=t,r.appendChild(i);var o=new n;return o.data=e,o.description=r.innerHTML,[o]}function m(e){if(!b.test(e)&&!C.test(e)){var t,r=w.exec(e);r&&r.length>1&&(t=r[1]);var i=new n;return i.name=t,i.description=e,i.data=e,[i]}}var g="http://www.mapinfo.com/mxp",v="http://www.esri.com/wms",_="http://www.opengis.net/wfs",y="http://www.opengis.net/gml",b=/<body>\s*<\/body>/im,C=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,w=/<title>([\s\S]*)<\/title>/im;return o}),define("Shaders/GlobeFS",[],function(){"use strict";return"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\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#ifdef ENABLE_DAYNIGHT_SHADING\nuniform vec2 u_lightingFadeDistance;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec3 v_textureCoordinates;\nvarying vec3 v_normalMC;\nvarying vec3 v_normalEC;\n#ifdef FOG\nvarying float v_distance;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\n#endif\nvec4 sampleAndBlend(\nvec4 previousColor,\nsampler2D texture,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateRectangle,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma,\nfloat split)\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(texture, textureCoordinates);\nvec3 color = value.rgb;\nfloat alpha = value.a;\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\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nfloat sourceAlpha = alpha * textureAlpha;\nfloat outAlpha = mix(previousColor.a, 1.0, sourceAlpha);\nvec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;\nreturn vec4(outColor, outAlpha);\n}\nvec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue);\nvoid main()\n{\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)\nvec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\nvec3 normalEC = czm_normal3D * normalMC;\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;\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);\n}\n#endif\n#ifdef ENABLE_VERTEX_LIGHTING\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalize(v_normalEC)) * 0.9 + 0.3, 0.0, 1.0);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#elif defined(ENABLE_DAYNIGHT_SHADING)\nfloat diffuseIntensity = clamp(czm_getLambertDiffuse(czm_sunDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);\nfloat cameraDist = length(czm_view[3]);\nfloat fadeOutDist = u_lightingFadeDistance.x;\nfloat fadeInDist = u_lightingFadeDistance.y;\nfloat t = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);\ndiffuseIntensity = mix(1.0, diffuseIntensity, t);\nvec4 finalColor = vec4(color.rgb * diffuseIntensity, color.a);\n#else\nvec4 finalColor = color;\n#endif\n#ifdef FOG\nconst float fExposure = 2.0;\nvec3 fogColor = v_mieColor + finalColor.rgb * v_rayleighColor;\nfogColor = vec3(1.0) - exp(-fExposure * fogColor);\ngl_FragColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor), finalColor.a);\n#else\ngl_FragColor = finalColor;\n#endif\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)\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_sunDirectionEC, normalEC) * maskValue;\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\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_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * czm_getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular, imageryColor.a);\n}\n#endif // #ifdef SHOW_REFLECTIVE_OCEAN\n"}),define("Shaders/GlobeVS",[],function(){"use strict";return"#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 FOG\nvarying float v_distance;\nvarying vec3 v_mieColor;\nvarying vec3 v_rayleighColor;\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(INCLUDE_WEB_MERCATOR_Y)\nfloat webMercatorT = textureCoordAndEncodedNormals.z;\nfloat encodedNormal = textureCoordAndEncodedNormals.w;\n#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)\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)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\nv_normalMC = czm_octDecode(encodedNormal);\nv_normalEC = czm_normal3D * v_normalMC;\n#elif defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(GENERATE_POSITION)\nv_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\n#ifdef FOG\nAtmosphereColor atmosColor = computeGroundAtmosphereFromSpace(position3DWC);\nv_mieColor = atmosColor.mie;\nv_rayleighColor = atmosColor.rayleigh;\nv_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);\n#endif\n}\n"}),define("Shaders/GroundAtmosphere",[],function(){"use strict";return"const float fInnerRadius = 6378137.0;\nconst float fOuterRadius = 6378137.0 * 1.025;\nconst float fOuterRadius2 = fOuterRadius * fOuterRadius;\nconst 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 float fScale = 1.0 / (fOuterRadius - fInnerRadius);\nconst float fScaleDepth = 0.25;\nconst float fScaleOverScaleDepth = fScale / fScaleDepth;\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)\n{\nvec3 v3InvWavelength = vec3(1.0 / pow(0.650, 4.0), 1.0 / pow(0.570, 4.0), 1.0 / pow(0.475, 4.0));\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 = 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"}),define("Scene/GlobeSurfaceShaderSet",["../Core/defined","../Core/destroyObject","../Core/TerrainQuantization","../Renderer/ShaderProgram","../Scene/SceneMode"],function(e,t,r,i,n){"use strict";function o(e,t,r){this.numberOfDayTextures=e,this.flags=t,this.shaderProgram=r}function a(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this._pickShaderPrograms=[]}function s(e){var t,r="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",o="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }";switch(e){case n.SCENE3D:t=r;break;case n.SCENE2D:case n.COLUMBUS_VIEW:t=i;break;case n.MORPHING:t=o}return t}function l(e){var t="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }",r="float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }";return e?r:t}return a.prototype.getShaderProgram=function(t,n,a,u,c,d,h,p,f,m,g,v,_,y,b,C){var w=0,S="",E=n.pickTerrain.mesh.encoding,T=E.quantization;T===r.BITS12&&(w=1,S="QUANTIZATION_BITS12");var x=t.mode,P=x|u<<2|c<<3|d<<4|h<<5|p<<6|f<<7|g<<8|v<<9|_<<10|y<<11|b<<12|C<<13|w<<14|m<<15,A=n.surfaceShader;if(e(A)&&A.numberOfDayTextures===a&&A.flags===P)return A.shaderProgram;var D=this._shadersByTexturesFlags[a];if(e(D)||(D=this._shadersByTexturesFlags[a]=[]),A=D[P],!e(A)){var I=this.baseVertexShaderSource.clone(),M=this.baseFragmentShaderSource.clone();I.defines.push(S),M.defines.push("TEXTURE_UNITS "+a),u&&M.defines.push("APPLY_BRIGHTNESS"),c&&M.defines.push("APPLY_CONTRAST"),d&&M.defines.push("APPLY_HUE"),h&&M.defines.push("APPLY_SATURATION"),p&&M.defines.push("APPLY_GAMMA"),f&&M.defines.push("APPLY_ALPHA"),g&&(M.defines.push("SHOW_REFLECTIVE_OCEAN"),I.defines.push("SHOW_REFLECTIVE_OCEAN")),v&&M.defines.push("SHOW_OCEAN_WAVES"),_&&(y?(I.defines.push("ENABLE_VERTEX_LIGHTING"),M.defines.push("ENABLE_VERTEX_LIGHTING")):(I.defines.push("ENABLE_DAYNIGHT_SHADING"),M.defines.push("ENABLE_DAYNIGHT_SHADING"))),I.defines.push("INCLUDE_WEB_MERCATOR_Y"),M.defines.push("INCLUDE_WEB_MERCATOR_Y"),C&&(I.defines.push("FOG"),M.defines.push("FOG")),m&&M.defines.push("APPLY_SPLIT");for(var O=" vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates)\n {\n vec4 color = initialColor;\n",R=0;R<a;++R)O+=" color = sampleAndBlend(\n color,\n u_dayTextures["+R+"],\n u_dayTextureUseWebMercatorT["+R+"] ? textureCoordinates.xz : textureCoordinates.xy,\n u_dayTextureTexCoordsRectangle["+R+"],\n u_dayTextureTranslationAndScale["+R+"],\n "+(f?"u_dayTextureAlpha["+R+"]":"1.0")+",\n "+(u?"u_dayTextureBrightness["+R+"]":"0.0")+",\n "+(c?"u_dayTextureContrast["+R+"]":"0.0")+",\n "+(d?"u_dayTextureHue["+R+"]":"0.0")+",\n "+(h?"u_dayTextureSaturation["+R+"]":"0.0")+",\n "+(p?"u_dayTextureOneOverGamma["+R+"]":"0.0")+",\n "+(m?"u_dayTextureSplit["+R+"]":"0.0")+"\n );\n";O+=" return color;\n }",M.sources.push(O),I.sources.push(s(x)),I.sources.push(l(b));var N=i.fromCache({context:t.context,vertexShaderSource:I,fragmentShaderSource:M,attributeLocations:E.getAttributeLocations()});A=D[P]=new o(a,P,N)}return n.surfaceShader=A,A.shaderProgram},a.prototype.getPickShaderProgram=function(t,n,o){var a=0,u="",c=n.pickTerrain.mesh.encoding,d=c.quantization;d===r.BITS12&&(a=1,u="QUANTIZATION_BITS12");var h=t.mode,p=h|o<<2|a<<3,f=this._pickShaderPrograms[p];if(!e(f)){var m=this.baseVertexShaderSource.clone();m.defines.push(u),m.sources.push(s(h)),m.sources.push(l(o));var g="void main()\n{\n gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\n";f=this._pickShaderPrograms[p]=i.fromCache({context:t.context,vertexShaderSource:m,fragmentShaderSource:g,attributeLocations:c.getAttributeLocations()})}return f},a.prototype.destroy=function(){var r,i,n=this._shadersByTexturesFlags;for(var o in n)if(n.hasOwnProperty(o)){var a=n[o];if(!e(a))continue;for(r in a)a.hasOwnProperty(r)&&(i=a[r],e(i)&&i.shaderProgram.destroy())}var s=this._pickShaderPrograms;for(r in s)s.hasOwnProperty(r)&&(i=s[r],i.destroy());return t(this)},a}),define("Scene/ImageryState",["../Core/freezeObject"],function(e){"use strict";var t={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};return e(t)}),define("Scene/QuadtreeTileLoadState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,DONE:2,FAILED:3};return e(t)}),define("Scene/TerrainState",["../Core/freezeObject"],function(e){"use strict";var t={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};return e(t)}),define("Scene/TileBoundingRegion",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartographic","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Ellipsoid","../Core/GeometryInstance","../Core/IntersectionTests","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/Plane","../Core/Ray","../Core/Rectangle","../Core/RectangleOutlineGeometry","./PerInstanceColorAppearance","./Primitive","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y){"use strict";function b(r){this.rectangle=m.clone(r.rectangle),this.minimumHeight=o(r.minimumHeight,0),this.maximumHeight=o(r.maximumHeight,0),this.southwestCornerCartesian=new t,this.northeastCornerCartesian=new t,this.westNormal=new t,this.southNormal=new t,this.eastNormal=new t,this.northNormal=new t;var i=o(r.ellipsoid,l.WGS84);C(this,r.rectangle,i),this._orientedBoundingBox=h.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,i),this._boundingSphere=e.fromOrientedBoundingBox(this._orientedBoundingBox)}function C(e,r,i){i.cartographicToCartesian(m.southwest(r),e.southwestCornerCartesian),i.cartographicToCartesian(m.northeast(r),e.northeastCornerCartesian),A.longitude=r.west,A.latitude=.5*(r.south+r.north),A.height=0;var n=i.cartographicToCartesian(A,x),o=t.cross(n,t.UNIT_Z,w);t.normalize(o,e.westNormal),A.longitude=r.east;var a=i.cartographicToCartesian(A,P),s=t.cross(t.UNIT_Z,a,w);t.normalize(s,e.eastNormal);var l,u=t.subtract(n,a,w),d=t.normalize(u,T),h=r.south;if(h>0){A.longitude=.5*(r.west+r.east),A.latitude=h;var f=i.cartographicToCartesian(A,I.origin);t.clone(d,I.direction);var g=p.fromPointNormal(e.southwestCornerCartesian,e.westNormal,D);c.rayPlane(I,g,e.southwestCornerCartesian),l=i.geodeticSurfaceNormal(f,S)}else l=i.geodeticSurfaceNormalCartographic(m.southeast(r),S);var v=t.cross(l,u,E);t.normalize(v,e.southNormal);var _,y=r.north;if(y<0){A.longitude=.5*(r.west+r.east),A.latitude=y;var b=i.cartographicToCartesian(A,I.origin);t.negate(d,I.direction);var C=p.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,D);c.rayPlane(I,C,e.northeastCornerCartesian),_=i.geodeticSurfaceNormal(b,S)}else _=i.geodeticSurfaceNormalCartographic(m.northwest(r),S);var M=t.cross(u,_,E);t.normalize(M,e.northNormal)}s(b.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){ +return this._boundingSphere}}});var w=new t,S=new t,E=new t,T=new t,x=new t,P=new t,A=new r,D=new p(t.UNIT_X,0),I=new f,M=new t,O=new t,R=new t(0,-1,0),N=new t(0,0,-1),k=new t;return b.prototype.distanceToCamera=function(e){var r=e.camera,i=r.positionWC,n=r.positionCartographic,o=0;if(!m.contains(this.rectangle,n)){var a=this.southwestCornerCartesian,s=this.northeastCornerCartesian,l=this.westNormal,u=this.southNormal,c=this.eastNormal,d=this.northNormal;e.mode!==y.SCENE3D&&(a=e.mapProjection.project(m.southwest(this.rectangle),M),a.z=a.y,a.y=a.x,a.x=0,s=e.mapProjection.project(m.northeast(this.rectangle),O),s.z=s.y,s.y=s.x,s.x=0,l=R,c=t.UNIT_Y,u=N,d=t.UNIT_Z);var h=t.subtract(i,a,k),p=t.dot(h,l),f=t.dot(h,u),g=t.subtract(i,s,k),v=t.dot(g,c),_=t.dot(g,d);p>0?o+=p*p:v>0&&(o+=v*v),f>0?o+=f*f:_>0&&(o+=_*_)}var b;b=e.mode===y.SCENE3D?n.height:i.x;var C=e.mode===y.SCENE3D?this.maximumHeight:0,w=b-C;return w>0&&(o+=w*w),Math.sqrt(o)},b.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)},b.prototype.createDebugVolume=function(e){var t=new d.clone(d.IDENTITY),r=new g({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new u({geometry:r,modelMatrix:t,attributes:{color:n.fromColor(e)}});return new _({geometryInstances:i,appearance:new v({translucent:!1,flat:!0}),asynchronous:!1})},b}),define("Scene/TileTerrain",["../Core/BoundingSphere","../Core/Cartesian3","../Core/defined","../Core/DeveloperError","../Core/IndexDatatype","../Core/OrientedBoundingBox","../Core/TileProviderError","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/VertexArray","../ThirdParty/when","./TerrainState","./TileBoundingRegion"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(e){this.state=d.UNLOADED,this.data=void 0,this.mesh=void 0,this.vertexArray=void 0,this.upsampleDetails=e}function f(e,t,i,n,o){function s(t){e.data=t,e.state=d.RECEIVED}function l(){e.state=d.FAILED;var r="Failed to obtain terrain tile X: "+i+" Y: "+n+" Level: "+o+".";t._requestError=a.handleError(t._requestError,t,t.errorEvent,r,i,n,o,u)}function u(){e.data=t.requestTileGeometry(i,n,o),r(e.data)?(e.state=d.RECEIVING,c(e.data,s,l)):e.state=d.UNLOADED}u()}function m(e,t,i,n,o,a){var s=i.tilingScheme,l=e.data,u=l.createMesh(s,n,o,a,t.terrainExaggeration);r(u)&&(e.state=d.TRANSFORMING,c(u,function(t){e.mesh=t,e.state=d.TRANSFORMED},function(){e.state=d.FAILED}))}function g(e,t,i,o,a,c){var h=e.mesh.vertices,p=s.createVertexBuffer({context:t,typedArray:h,usage:l.STATIC_DRAW}),f=e.mesh.encoding.getAttributes(p),m=e.mesh.indices.indexBuffers||{},g=m[t.id];if(!r(g)||g.isDestroyed()){var v=e.mesh.indices,_=2===v.BYTES_PER_ELEMENT?n.UNSIGNED_SHORT:n.UNSIGNED_INT;g=s.createIndexBuffer({context:t,typedArray:v,usage:l.STATIC_DRAW,indexDatatype:_}),g.vertexArrayDestroyable=!1,g.referenceCount=1,m[t.id]=g,e.mesh.indices.indexBuffers=m}else++g.referenceCount;e.vertexArray=new u({context:t,attributes:f,indexBuffer:g}),e.state=d.READY}return p.prototype.freeResources=function(){if(this.state=d.UNLOADED,this.data=void 0,this.mesh=void 0,r(this.vertexArray)){var e=this.vertexArray.indexBuffer;this.vertexArray.destroy(),this.vertexArray=void 0,!e.isDestroyed()&&r(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())}},p.prototype.publishToTile=function(r){var i=r.data,n=this.mesh;t.clone(n.center,i.center),i.minimumHeight=n.minimumHeight,i.maximumHeight=n.maximumHeight,i.boundingSphere3D=e.clone(n.boundingSphere3D,i.boundingSphere3D),i.orientedBoundingBox=o.clone(n.orientedBoundingBox,i.orientedBoundingBox),i.tileBoundingRegion=new h({rectangle:r.rectangle,minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,ellipsoid:r.tilingScheme.ellipsoid}),r.data.occludeePointInScaledSpace=t.clone(n.occludeePointInScaledSpace,i.occludeePointInScaledSpace)},p.prototype.processLoadStateMachine=function(e,t,r,i,n){this.state===d.UNLOADED&&f(this,t,r,i,n),this.state===d.RECEIVED&&m(this,e,t,r,i,n),this.state===d.TRANSFORMED&&g(this,e.context,t,r,i,n)},p.prototype.processUpsampleStateMachine=function(e,t,i,n,o){if(this.state===d.UNLOADED){var a=this.upsampleDetails,s=a.data,l=a.x,u=a.y,h=a.level;if(this.data=s.upsample(t.tilingScheme,l,u,h,i,n,o),!r(this.data))return;this.state=d.RECEIVING;var p=this;c(this.data,function(e){p.data=e,p.state=d.RECEIVED},function(){p.state=d.FAILED})}this.state===d.RECEIVED&&m(this,e,t,i,n,o),this.state===d.TRANSFORMED&&g(this,e.context,t,i,n,o)},p}),define("Scene/GlobeSurfaceTile",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/IntersectionTests","../Core/PixelFormat","../Renderer/PixelDatatype","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./ImageryState","./QuadtreeTileLoadState","./SceneMode","./TerrainState","./TileBoundingRegion","./TileTerrain"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y){"use strict";function b(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new r(0,0,1,1),this.terrainData=void 0,this.center=new t,this.vertexArray=void 0,this.minimumHeight=0,this.maximumHeight=0,this.boundingSphere3D=new e,this.boundingSphere2D=new e,this.orientedBoundingBox=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new t,this.loadedTerrain=void 0,this.upsampledTerrain=void 0,this.pickBoundingSphere=new e,this.pickTerrain=void 0,this.surfaceShader=void 0}function C(e,r,i,o,a,s){if(e.decodePosition(o,a,s),n(r)&&r!==g.SCENE3D){var l=i.ellipsoid,u=l.cartesianToCartographic(s);i.project(u,s),t.fromElements(s.z,s.x,s.y,s)}return s}function w(e,t,r){var i=e.data,o=E(e);n(o)&&(i.upsampledTerrain=new y(o)),D(e,t)&&(i.loadedTerrain=new y);for(var a=0,s=r.length;a<s;++a){var l=r.get(a);l.show&&l._createTileImagerySkeletons(e,t)}}function S(e,t,r,o){var a=e.data,s=a.loadedTerrain,l=a.upsampledTerrain,u=!1;n(s)&&(s.processLoadStateMachine(t,r,e.x,e.y,e.level),s.state>=v.RECEIVED&&(a.terrainData!==s.data&&(a.terrainData=s.data,M(t.context,a),P(e)),u=!0),s.state===v.READY?(s.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=s.vertexArray,s.vertexArray=void 0,a.pickTerrain=i(a.loadedTerrain,a.upsampledTerrain),a.loadedTerrain=void 0,a.upsampledTerrain=void 0):s.state===v.FAILED&&(a.loadedTerrain=void 0)),!u&&n(l)&&(l.processUpsampleStateMachine(t,r,e.x,e.y,e.level),l.state>=v.RECEIVED&&a.terrainData!==l.data&&(a.terrainData=l.data,r.hasWaterMask&&O(e),T(e)),l.state===v.READY?(l.publishToTile(e),n(e.data.vertexArray)&&o.push(e.data.vertexArray),e.data.vertexArray=l.vertexArray,l.vertexArray=void 0,a.pickTerrain=a.upsampledTerrain,a.upsampledTerrain=void 0):l.state===v.FAILED&&(a.upsampledTerrain=void 0))}function E(e){for(var t=e.parent;n(t)&&n(t.data)&&!n(t.data.terrainData);)t=t.parent;if(n(t)&&n(t.data))return{data:t.data.terrainData,x:t.x,y:t.y,level:t.level}}function T(e){x(e,e._southwestChild),x(e,e._southeastChild),x(e,e._northwestChild),x(e,e._northeastChild)}function x(e,t){if(n(t)&&t.state!==m.START){var r=t.data;if(n(r.terrainData)&&!r.terrainData.wasCreatedByUpsampling())return;n(r.upsampledTerrain)&&r.upsampledTerrain.freeResources(),r.upsampledTerrain=new y({data:e.data.terrainData,x:e.x,y:e.y,level:e.level}),t.state=m.LOADING}}function P(e){var t=e.data;A(e,t,e.southwestChild),A(e,t,e.southeastChild),A(e,t,e.northwestChild),A(e,t,e.northeastChild)}function A(e,t,r){if(r.state!==m.START){var i=r.data;if(n(i.terrainData)&&!i.terrainData.wasCreatedByUpsampling())return;n(i.upsampledTerrain)&&i.upsampledTerrain.freeResources(),i.upsampledTerrain=new y({data:t.terrainData,x:e.x,y:e.y,level:e.level}),t.terrainData.isChildAvailable(e.x,e.y,r.x,r.y)&&(n(i.loadedTerrain)||(i.loadedTerrain=new y)),r.state=m.LOADING}}function D(e,t){var r=t.getTileDataAvailable(e.x,e.y,e.level);if(n(r))return r;var i=e.parent;return!n(i)||!(!n(i.data)||!n(i.data.terrainData))&&i.data.terrainData.isChildAvailable(i.x,i.y,e.x,e.y)}function I(e){var t=e.cache.tile_waterMaskData;if(!n(t)){var r=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});r.referenceCount=1;var i=new u({wrapS:p.CLAMP_TO_EDGE,wrapT:p.CLAMP_TO_EDGE,minificationFilter:h.LINEAR,magnificationFilter:d.LINEAR});t={allWaterTexture:r,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function M(e,t){var i=t.waterMaskTexture;n(i)&&(--i.referenceCount,0===i.referenceCount&&i.destroy(),t.waterMaskTexture=void 0);var o=t.terrainData.waterMask;if(n(o)){var a,u=I(e),d=o.length;if(1===d){if(0===o[0])return;a=u.allWaterTexture}else{var h=Math.sqrt(d);a=new c({context:e,pixelFormat:s.LUMINANCE,pixelDatatype:l.UNSIGNED_BYTE,source:{width:h,height:h,arrayBufferView:o},sampler:u.sampler}),a.referenceCount=0}++a.referenceCount,t.waterMaskTexture=a,r.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}}function O(e){for(var t=e.data,r=e.parent;n(r)&&!n(r.data.terrainData)||r.data.terrainData.wasCreatedByUpsampling();)r=r.parent;if(n(r)&&n(r.data.waterMaskTexture)){t.waterMaskTexture=r.data.waterMaskTexture,++t.waterMaskTexture.referenceCount;var i=r.rectangle,o=e.rectangle,a=o.width,s=o.height,l=a/i.width,u=s/i.height;t.waterMaskTranslationAndScale.x=l*(o.west-i.west)/a,t.waterMaskTranslationAndScale.y=u*(o.south-i.south)/s,t.waterMaskTranslationAndScale.z=l,t.waterMaskTranslationAndScale.w=u}}o(b.prototype,{eligibleForUnloading:{get:function(){for(var e=this.loadedTerrain,t=n(e)&&(e.state===v.RECEIVING||e.state===v.TRANSFORMING),r=this.upsampledTerrain,i=n(r)&&(r.state===v.RECEIVING||r.state===v.TRANSFORMING),o=!t&&!i,a=this.imagery,s=0,l=a.length;o&&s<l;++s){var u=a[s];o=!n(u.loadingImagery)||u.loadingImagery.state!==f.TRANSITIONING}return o}}});var R=new t,N=new t,k=new t,L=new t;return b.prototype.pick=function(e,r,i,o,s){var l=this.pickTerrain;if(n(l)){var u=l.mesh;if(n(u))for(var c=u.vertices,d=u.indices,h=u.encoding,p=d.length,f=0;f<p;f+=3){var m=d[f],g=d[f+1],v=d[f+2],_=C(h,r,i,c,m,R),y=C(h,r,i,c,g,N),b=C(h,r,i,c,v,k),w=a.rayTriangle(e,_,y,b,o,L);if(n(w))return t.clone(w,s)}}},b.prototype.freeResources=function(){n(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,0===this.waterMaskTexture.referenceCount&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,n(this.loadedTerrain)&&(this.loadedTerrain.freeResources(),this.loadedTerrain=void 0),n(this.upsampledTerrain)&&(this.upsampledTerrain.freeResources(),this.upsampledTerrain=void 0),n(this.pickTerrain)&&(this.pickTerrain.freeResources(),this.pickTerrain=void 0);var e,t,r=this.imagery;for(e=0,t=r.length;e<t;++e)r[e].freeResources();this.imagery.length=0,this.freeVertexArray()},b.prototype.freeVertexArray=function(){var e;n(this.vertexArray)&&(e=this.vertexArray.indexBuffer,this.vertexArray=this.vertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy())),n(this.wireframeVertexArray)&&(e=this.wireframeVertexArray.indexBuffer,this.wireframeVertexArray=this.wireframeVertexArray.destroy(),!e.isDestroyed()&&n(e.referenceCount)&&(--e.referenceCount,0===e.referenceCount&&e.destroy()))},b.processStateMachine=function(e,t,r,i,o){var a=e.data;n(a)||(a=e.data=new b),e.state===m.START&&(w(e,r,i),e.state=m.LOADING),e.state===m.LOADING&&S(e,t,r,o);for(var s=n(a.vertexArray),l=!n(a.loadedTerrain)&&!n(a.upsampledTerrain),u=n(a.terrainData)&&a.terrainData.wasCreatedByUpsampling(),c=a.imagery,d=0,h=c.length;d<h;++d){var p=c[d];if(n(p.loadingImagery)){if(p.loadingImagery.state===f.PLACEHOLDER){var g=p.loadingImagery.imageryLayer;if(g.imageryProvider.ready){p.freeResources(),c.splice(d,1),g._createTileImagerySkeletons(e,r,d),--d,h=c.length;continue}u=!1}var v=p.processStateMachine(e,t);l=l&&v,s=s&&(v||n(p.readyImagery)),u=u&&n(p.loadingImagery)&&(p.loadingImagery.state===f.FAILED||p.loadingImagery.state===f.INVALID)}else u=!1}e.upsampledFromParent=u,d===h&&(s&&(e.renderable=!0),l&&(e.state=m.DONE))},b}),define("Shaders/ReprojectWebMercatorFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"});define("Shaders/ReprojectWebMercatorVS",[],function(){"use strict";return"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"});define("Scene/Imagery",["../Core/defined","../Core/destroyObject","./ImageryState"],function(e,t,r){"use strict";function i(t,i,n,o,a){if(this.imageryLayer=t,this.x=i,this.y=n,this.level=o,0!==o){var s=i/2|0,l=n/2|0,u=o-1;this.parent=t.getImageryFromCache(s,l,u)}if(this.state=r.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!e(a)&&t.imageryProvider.ready){var c=t.imageryProvider.tilingScheme;a=c.tileXYToRectangle(i,n,o)}this.rectangle=a}return i.createPlaceholder=function(e){var t=new i(e,0,0,0);return t.addReference(),t.state=r.PLACEHOLDER,t},i.prototype.addReference=function(){++this.referenceCount},i.prototype.releaseReference=function(){return--this.referenceCount,0===this.referenceCount?(this.imageryLayer.removeImageryFromCache(this),e(this.parent)&&this.parent.releaseReference(),e(this.image)&&e(this.image.destroy)&&this.image.destroy(),e(this.texture)&&this.texture.destroy(),e(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),t(this),0):this.referenceCount},i.prototype.processStateMachine=function(e,t){this.state===r.UNLOADED&&(this.state=r.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===r.RECEIVED&&(this.state=r.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));var i=this.state===r.READY&&t&&!this.texture;(this.state===r.TEXTURE_LOADED||i)&&(this.state=r.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))},i}),define("Scene/ImagerySplitDirection",["../Core/freezeObject"],function(e){"use strict";var t={LEFT:-1,NONE:0,RIGHT:1};return e(t)}),define("Scene/TileImagery",["../Core/defined","./ImageryState"],function(e,t){"use strict";function r(e,t,r){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=r}return r.prototype.freeResources=function(){e(this.readyImagery)&&this.readyImagery.releaseReference(),e(this.loadingImagery)&&this.loadingImagery.releaseReference()},r.prototype.processStateMachine=function(r,i){var n=this.loadingImagery,o=n.imageryLayer;if(n.processStateMachine(i,!this.useWebMercatorT),n.state===t.READY)return e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(r,this),!0;for(var a,s=n.parent;e(s)&&(s.state!==t.READY||!this.useWebMercatorT&&!e(s.texture));)s.state!==t.FAILED&&s.state!==t.INVALID&&(a=a||s),s=s.parent;return this.readyImagery!==s&&(e(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=s,e(s)&&(s.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(r,this))),(n.state===t.FAILED||n.state===t.INVALID)&&(!e(a)||(a.processStateMachine(i,!this.useWebMercatorT),!1))},r}),define("Scene/ImageryLayer",["../Core/Cartesian2","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/FeatureDetection","../Core/GeographicTilingScheme","../Core/IndexDatatype","../Core/Math","../Core/PixelFormat","../Core/Rectangle","../Core/TerrainProvider","../Core/TileProviderError","../Core/WebMercatorProjection","../Core/WebMercatorTilingScheme","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/ContextLimits","../Renderer/MipmapHint","../Renderer/Sampler","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","../Renderer/VertexArray","../Shaders/ReprojectWebMercatorFS","../Shaders/ReprojectWebMercatorVS","../ThirdParty/when","./Imagery","./ImagerySplitDirection","./ImageryState","./TileImagery"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R,N,k){"use strict";function L(e,t){this._imageryProvider=e,t=r(t,{}),this.alpha=r(t.alpha,r(e.defaultAlpha,1)),this.brightness=r(t.brightness,r(e.defaultBrightness,L.DEFAULT_BRIGHTNESS)),this.contrast=r(t.contrast,r(e.defaultContrast,L.DEFAULT_CONTRAST)),this.hue=r(t.hue,r(e.defaultHue,L.DEFAULT_HUE)),this.saturation=r(t.saturation,r(e.defaultSaturation,L.DEFAULT_SATURATION)),this.gamma=r(t.gamma,r(e.defaultGamma,L.DEFAULT_GAMMA)),this.splitDirection=r(t.splitDirection,r(e.defaultSplit,L.DEFAULT_SPLIT)),this.show=r(t.show,!0),this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=r(t.rectangle,d.MAX_VALUE),this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new k(O.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[]}function F(e,t,n,o){if(!c.isCompressedFormat(o.pixelFormat)&&u.isPowerOfTwo(o.width)&&u.isPowerOfTwo(o.height)){var a=t.cache.imageryLayer_mipmapSampler;if(!i(a)){var s=y.maximumTextureFilterAnisotropy;a=t.cache.imageryLayer_mipmapSampler=new C({wrapS:P.CLAMP_TO_EDGE,wrapT:P.CLAMP_TO_EDGE,minificationFilter:x.LINEAR_MIPMAP_LINEAR,magnificationFilter:T.LINEAR,maximumAnisotropy:Math.min(s,r(e._maximumAnisotropy,s))})}o.generateMipmap(b.NICEST),o.sampler=a}else{var l=t.cache.imageryLayer_nonMipmapSampler;i(l)||(l=t.cache.imageryLayer_nonMipmapSampler=new C({wrapS:P.CLAMP_TO_EDGE,wrapT:P.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})),o.sampler=l}n.state=N.READY}function B(e,t,r){return JSON.stringify([e,t,r])}function U(e,t,r,n){var o=t.cache.imageryLayer_reproject;if(!i(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){i(this.framebuffer)&&this.framebuffer.destroy(),i(this.vertexArray)&&this.vertexArray.destroy(),i(this.shaderProgram)&&this.shaderProgram.destroy()}};for(var a=new Float32Array(256),s=0,c=0;c<64;++c){var d=c/63;a[s++]=0,a[s++]=d,a[s++]=1,a[s++]=d}var p={position:0,webMercatorT:1},f=h.getRegularGridIndices(2,64),m=g.createIndexBuffer({context:t,typedArray:f,usage:v.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});o.vertexArray=new A({context:t,attributes:[{index:p.position,vertexBuffer:g.createVertexBuffer({context:t,typedArray:a,usage:v.STATIC_DRAW}),componentsPerAttribute:2},{index:p.webMercatorT,vertexBuffer:g.createVertexBuffer({context:t,sizeInBytes:512,usage:v.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:m});var _=new S({sources:[I]});o.shaderProgram=w.fromCache({context:t,vertexShaderSource:_,fragmentShaderSource:D,attributeLocations:p}),o.sampler=new C({wrapS:P.CLAMP_TO_EDGE,wrapT:P.CLAMP_TO_EDGE,minificationFilter:x.LINEAR,magnificationFilter:T.LINEAR})}r.sampler=o.sampler;var y=r.width,M=r.height;j.textureDimensions.x=y,j.textureDimensions.y=M,j.texture=r;var O=Math.sin(n.south),R=.5*Math.log((1+O)/(1-O));O=Math.sin(n.north);var N=.5*Math.log((1+O)/(1-O)),k=1/(N-R),L=new E({context:t,width:y,height:M,pixelFormat:r.pixelFormat,pixelDatatype:r.pixelDatatype,preMultiplyAlpha:r.preMultiplyAlpha});u.isPowerOfTwo(y)&&u.isPowerOfTwo(M)&&L.generateMipmap(b.NICEST);for(var F=n.south,B=n.north,U=q,V=0,z=0;z<64;++z){var G=z/63,H=u.lerp(F,B,G);O=Math.sin(H);var W=.5*Math.log((1+O)/(1-O)),Y=(W-R)*k;U[V++]=Y,U[V++]=Y}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(U),e.shaderProgram=o.shaderProgram,e.outputTexture=L,e.uniformMap=j,e.vertexArray=o.vertexArray}function V(e,t,r){var i=e._imageryProvider,n=i.tilingScheme,o=n.ellipsoid,a=e._imageryProvider.tilingScheme instanceof s?1:Math.cos(r),l=n.rectangle,u=o.maximumRadius*l.width*a/(i.tileWidth*n.getNumberOfXTilesAtLevel(0)),c=u/t,d=Math.log(c)/Math.log(2),h=Math.round(d);return 0|h}n(L.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},rectangle:{get:function(){return this._rectangle}}}),L.DEFAULT_BRIGHTNESS=1,L.DEFAULT_CONTRAST=1,L.DEFAULT_HUE=0,L.DEFAULT_SATURATION=1,L.DEFAULT_GAMMA=1,L.DEFAULT_SPLIT=R.NONE,L.prototype.isBaseLayer=function(){return this._isBaseLayer},L.prototype.isDestroyed=function(){return!1},L.prototype.destroy=function(){return o(this)};var z=new d,G=new d,H=new d,W=new d;L.prototype.getViewableRectangle=function(){var e=this._imageryProvider,t=this._rectangle;return e.readyPromise.then(function(){return d.intersection(e.rectangle,t)})},L.prototype._createTileImagerySkeletons=function(e,r,n){var o=e.data;if(i(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return!1;if(i(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;var a=this._imageryProvider;if(i(n)||(n=o.imagery.length),!a.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),o.imagery.splice(n,0,this._skeletonPlaceholder),!0;var s=a.tilingScheme instanceof m&&e.rectangle.north<f.MaximumLatitude&&e.rectangle.south>-f.MaximumLatitude,l=d.intersection(a.rectangle,this._rectangle,z),u=d.intersection(e.rectangle,l,G);if(!i(u)){if(!this.isBaseLayer())return!1;var c=l,h=e.rectangle;u=G,h.south>=c.north?u.north=u.south=c.north:h.north<=c.south?u.north=u.south=c.south:(u.south=Math.max(h.south,c.south),u.north=Math.min(h.north,c.north)),h.west>=c.east?u.west=u.east=c.east:h.east<=c.west?u.west=u.east=c.west:(u.west=Math.max(h.west,c.west),u.east=Math.min(h.east,c.east))}var p=0;u.south>0?p=u.south:u.north<0&&(p=u.north);var g=1,v=g*r.getLevelMaximumGeometricError(e.level),_=V(this,v,p);_=Math.max(0,_);var y=a.maximumLevel;if(_>y&&(_=y),i(a.minimumLevel)){var b=a.minimumLevel;_<b&&(_=b)}var C=a.tilingScheme,w=C.positionToTileXY(d.northwest(u),_),S=C.positionToTileXY(d.southeast(u),_),E=e.rectangle.width/512,T=e.rectangle.height/512,x=C.tileXYToRectangle(w.x,w.y,_);Math.abs(x.south-e.rectangle.north)<T&&w.y<S.y&&++w.y,Math.abs(x.east-e.rectangle.west)<E&&w.x<S.x&&++w.x;var P=C.tileXYToRectangle(S.x,S.y,_);Math.abs(P.north-e.rectangle.south)<T&&S.y>w.y&&--S.y,Math.abs(P.west-e.rectangle.east)<E&&S.x>w.x&&--S.x;var A,D=d.clone(e.rectangle,W),I=C.tileXYToRectangle(w.x,w.y,_),M=d.intersection(I,l,H);s?(C.rectangleToNativeRectangle(D,D),C.rectangleToNativeRectangle(I,I),C.rectangleToNativeRectangle(M,M),C.rectangleToNativeRectangle(l,l),A=C.tileXYToNativeRectangle.bind(C),E=D.width/512,T=D.height/512):A=C.tileXYToRectangle.bind(C);var O,R,N=0,L=1;!this.isBaseLayer()&&Math.abs(M.west-D.west)>=E&&(N=Math.min(1,(M.west-D.west)/D.width)),!this.isBaseLayer()&&Math.abs(M.north-D.north)>=T&&(L=Math.max(0,(M.north-D.south)/D.height));for(var F=L,B=w.x;B<=S.x;B++)if(O=N,I=A(B,w.y,_),M=d.simpleIntersection(I,l,H),i(M)){N=Math.min(1,(M.east-D.west)/D.width),B===S.x&&(this.isBaseLayer()||Math.abs(M.east-D.east)<E)&&(N=1),L=F;for(var U=w.y;U<=S.y;U++)if(R=L,I=A(B,U,_),M=d.simpleIntersection(I,l,H),i(M)){L=Math.max(0,(M.south-D.south)/D.height),U===S.y&&(this.isBaseLayer()||Math.abs(M.south-D.south)<T)&&(L=0);var j=new t(O,L,N,R),q=this.getImageryFromCache(B,U,_);o.imagery.splice(n,0,new k(q,j,s)),++n}}return!0},L.prototype._calculateTextureTranslationAndScale=function(e,r){var i=r.readyImagery.rectangle,n=e.rectangle;if(r.useWebMercatorT){var o=r.readyImagery.imageryLayer.imageryProvider.tilingScheme;i=o.rectangleToNativeRectangle(i,z),n=o.rectangleToNativeRectangle(n,W)}var a=n.width,s=n.height,l=a/i.width,u=s/i.height;return new t(l*(n.west-i.west)/a,u*(n.south-i.south)/s,l,u)},L.prototype._requestImagery=function(e){function t(t){return i(t)?(e.image=t,e.state=N.RECEIVED,void p.handleSuccess(a._requestImageError)):r()}function r(t){e.state=N.FAILED;var r="Failed to obtain image tile X: "+e.x+" Y: "+e.y+" Level: "+e.level+".";a._requestImageError=p.handleError(a._requestImageError,o,o.errorEvent,r,e.x,e.y,e.level,n,t)}function n(){e.state=N.TRANSITIONING;var n=o.requestImage(e.x,e.y,e.level);return i(n)?(i(o.getTileCredits)&&(e.credits=o.getTileCredits(e.x,e.y,e.level)),void M(n,t,r)):void(e.state=N.UNLOADED)}var o=this._imageryProvider,a=this;n()},L.prototype._createTexture=function(e,t){var r=this._imageryProvider,n=t.image;if(i(r.tileDiscardPolicy)){var o=r.tileDiscardPolicy;if(i(o)){if(!o.isReady())return void(t.state=N.RECEIVED);if(o.shouldDiscardImage(n))return void(t.state=N.INVALID)}}var a;a=new E(i(n.internalFormat)?{context:e,pixelFormat:n.internalFormat,width:n.width,height:n.height,source:{arrayBufferView:n.bufferView}}:{context:e,source:n,pixelFormat:r.hasAlphaChannel?c.RGBA:c.RGB}),r.tilingScheme instanceof m?t.textureWebMercator=a:t.texture=a,t.image=void 0,t.state=N.TEXTURE_LOADED},L.prototype._reprojectTexture=function(e,t,i){var n=t.textureWebMercator||t.texture,o=t.rectangle,a=e.context;if(i=r(i,!0),i&&!(this._imageryProvider.tilingScheme instanceof s)&&o.width/n.width>1e-5){var l=this;t.addReference();var u=new _({persists:!0,owner:this,preExecute:function(e){U(e,a,n,t.rectangle)},postExecute:function(e){t.texture=e,F(l,a,t,e),t.releaseReference()}});this._reprojectComputeCommands.push(u)}else i&&(t.texture=n),F(this,a,t,n)},L.prototype.queueReprojectionCommands=function(e){for(var t=this._reprojectComputeCommands,r=t.length,i=0;i<r;++i)e.commandList.push(t[i]);t.length=0},L.prototype.cancelReprojections=function(){this._reprojectComputeCommands.length=0},L.prototype.getImageryFromCache=function(e,t,r,n){var o=B(e,t,r),a=this._imageryCache[o];return i(a)||(a=new O(this,e,t,r,n),this._imageryCache[o]=a),a.addReference(),a},L.prototype.removeImageryFromCache=function(e){var t=B(e.x,e.y,e.level);delete this._imageryCache[t]};var j={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new e,texture:void 0},q=a.supportsTypedArrays()?new Float32Array(128):void 0;return L}),define("Scene/GlobeSurfaceTileProvider",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/PrimitiveType","../Core/Rectangle","../Core/SphereOutlineGeometry","../Core/TerrainQuantization","../Core/Visibility","../Core/WebMercatorProjection","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Pass","../Renderer/RenderState","../Renderer/VertexArray","../Scene/BlendingState","../Scene/DepthFunction","../Scene/PerInstanceColorAppearance","../Scene/Primitive","./GlobeSurfaceTile","./ImageryLayer","./OrthographicFrustum","./QuadtreeTileLoadState","./SceneMode","./ShadowMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R,N,k,L,F,B,U,V,z,G){"use strict";function H(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.shadows=G.RECEIVE_ONLY,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._pickRenderState=void 0,this._errorEvent=new h,this._imageryLayers.layerAdded.addEventListener(H.prototype._onLayerAdded,this),this._imageryLayers.layerRemoved.addEventListener(H.prototype._onLayerRemoved,this),this._imageryLayers.layerMoved.addEventListener(H.prototype._onLayerMoved,this),this._imageryLayers.layerShownOrHidden.addEventListener(H.prototype._onLayerShownOrHidden,this),this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._pickCommands=[],this._usedDrawCommands=0,this._usedPickCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new o(0,0,.5,1)}function W(e,t){var r=e.loadingImagery;l(r)||(r=e.readyImagery);var i=t.loadingImagery;return l(i)||(i=t.readyImagery),r.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function j(e){var t=e.indexBuffer;e.destroy(),!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,0===t.referenceCount&&t.destroy())}function q(e){var t={u_initialColor:function(){return this.properties.initialColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_center3D:function(){return this.properties.center3D},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){var t=e.context.uniformState.view,r=_.multiplyByPoint(t,this.properties.rtc,re);return _.setTranslation(t,r,J),J},u_modifiedModelViewProjection:function(){var t=e.context.uniformState.view,r=e.context.uniformState.projection,i=_.multiplyByPoint(t,this.properties.rtc,re);return _.setTranslation(t,i,$),_.multiply(r,$,$),$},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},properties:{initialColor:new n(0,0,.5,1),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new r(65e5,9e6),center3D:void 0,rtc:new i,modifiedModelView:new _,tileRectangle:new n,dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayIntensity:0,southAndNorthLatitude:new r,southMercatorYAndOneOverHeight:new r,waterMask:void 0,waterMaskTranslationAndScale:new n,minMaxHeight:new r,scaleAndBias:new _}};return t}function Y(e,t,r){var i=r.data;l(i.wireframeVertexArray)||l(i.terrainData)&&l(i.terrainData._mesh)&&(i.wireframeVertexArray=X(e,i.vertexArray,i.terrainData._mesh)); +}function X(e,t,r){var i={indices:r.indices,primitiveType:b.TRIANGLES};f.toWireframe(i);var n=i.indices,o=x.createIndexBuffer({context:e,typedArray:n,usage:P.STATIC_DRAW,indexDatatype:m.UNSIGNED_SHORT});return new O({context:e,attributes:t._attributes,indexBuffer:o})}function Q(t,r,a){var s=r.data,u=a.creditDisplay,c=s.terrainData;if(l(c)&&l(c.credits))for(var d=c.credits,h=0,p=d.length;h<p;++h)u.addCredit(d[h]);var f=A.maximumTextureImageUnits,m=s.waterMaskTexture,g=t.hasWaterMask&&l(m),w=t.oceanNormalMap,E=g&&l(w),x=t.terrainProvider.ready&&t.terrainProvider.hasVertexNormals,P=a.fog.enabled,M=G.castShadows(t.shadows),O=G.receiveShadows(t.shadows);g&&--f,E&&--f;var R=s.center,N=s.pickTerrain.mesh.encoding,k=ee,L=0,F=0,U=0,V=0,H=!1;if(a.mode!==z.SCENE3D){var W=a.mapProjection,j=W.project(C.southwest(r.rectangle),ie),X=W.project(C.northeast(r.rectangle),ne);if(k.x=j.x,k.y=j.y,k.z=X.x,k.w=X.y,a.mode!==z.MORPHING&&(R=te,R.x=0,R.y=.5*(k.z+k.x),R.z=.5*(k.w+k.y),k.x-=R.y,k.y-=R.z,k.z-=R.y,k.w-=R.z),a.mode===z.SCENE2D&&N.quantization===S.BITS12){var Q=1/(Math.pow(2,12)-1)*.5,Z=(k.z-k.x)*Q,K=(k.w-k.y)*Q;k.x-=Z,k.y-=K,k.z+=Z,k.w+=K}W instanceof T&&(L=r.rectangle.south,F=r.rectangle.north,U=T.geodeticLatitudeToMercatorAngle(L),V=1/(T.geodeticLatitudeToMercatorAngle(F)-U),H=!0)}var J=s.imagery,$=0,re=J.length,ue=t._renderState,ce=t._blendRenderState,de=ue,he=t._firstPassInitialColor,pe=a.context;l(t._debug.boundingSphereTile)||se();do{var fe,me,ge=0;t._drawCommands.length<=t._usedDrawCommands?(fe=new D,fe.owner=r,fe.cull=!1,fe.boundingVolume=new e,fe.orientedBoundingBox=void 0,me=q(a),t._drawCommands.push(fe),t._uniformMaps.push(me)):(fe=t._drawCommands[t._usedDrawCommands],me=t._uniformMaps[t._usedDrawCommands]),fe.owner=r,++t._usedDrawCommands,r===t._debug.boundingSphereTile&&(l(s.orientedBoundingBox)?oe(s.orientedBoundingBox,o.RED).update(a):l(s.boundingSphere3D)&&ae(s.boundingSphere3D,o.RED).update(a));var ve=me.properties;n.clone(he,ve.initialColor),ve.oceanNormalMap=w,ve.lightingFadeDistance.x=t.lightingFadeOutDistance,ve.lightingFadeDistance.y=t.lightingFadeInDistance,ve.zoomedOutOceanSpecularIntensity=t.zoomedOutOceanSpecularIntensity,ve.center3D=s.center,i.clone(R,ve.rtc),n.clone(k,ve.tileRectangle),ve.southAndNorthLatitude.x=L,ve.southAndNorthLatitude.y=F,ve.southMercatorYAndOneOverHeight.x=U,ve.southMercatorYAndOneOverHeight.y=V;for(var _e=P&&v.fog(r._distance,a.fog.density)>v.EPSILON3,ye=!1,be=!1,Ce=!1,we=!1,Se=!1,Ee=!1,Te=!1;ge<f&&$<re;){var xe=J[$],Pe=xe.readyImagery;if(++$,l(Pe)&&0!==Pe.imageryLayer.alpha){var Ae=xe.useWebMercatorT?Pe.textureWebMercator:Pe.texture,De=Pe.imageryLayer;if(l(xe.textureTranslationAndScale)||(xe.textureTranslationAndScale=De._calculateTextureTranslationAndScale(r,xe)),ve.dayTextures[ge]=Ae,ve.dayTextureTranslationAndScale[ge]=xe.textureTranslationAndScale,ve.dayTextureTexCoordsRectangle[ge]=xe.textureCoordinateRectangle,ve.dayTextureUseWebMercatorT[ge]=xe.useWebMercatorT,ve.dayTextureAlpha[ge]=De.alpha,Ee=Ee||1!==ve.dayTextureAlpha[ge],ve.dayTextureBrightness[ge]=De.brightness,ye=ye||ve.dayTextureBrightness[ge]!==B.DEFAULT_BRIGHTNESS,ve.dayTextureContrast[ge]=De.contrast,be=be||ve.dayTextureContrast[ge]!==B.DEFAULT_CONTRAST,ve.dayTextureHue[ge]=De.hue,Ce=Ce||ve.dayTextureHue[ge]!==B.DEFAULT_HUE,ve.dayTextureSaturation[ge]=De.saturation,we=we||ve.dayTextureSaturation[ge]!==B.DEFAULT_SATURATION,ve.dayTextureOneOverGamma[ge]=1/De.gamma,Se=Se||ve.dayTextureOneOverGamma[ge]!==1/B.DEFAULT_GAMMA,ve.dayTextureSplit[ge]=De.splitDirection,Te=Te||0!==ve.dayTextureSplit[ge],l(Pe.credits))for(var Ie=Pe.credits,Me=0,Oe=Ie.length;Me<Oe;++Me)u.addCredit(Ie[Me]);++ge}}ve.dayTextures.length=ge,ve.waterMask=m,n.clone(s.waterMaskTranslationAndScale,ve.waterMaskTranslationAndScale),ve.minMaxHeight.x=N.minimumHeight,ve.minMaxHeight.y=N.maximumHeight,_.clone(N.matrix,ve.scaleAndBias),fe.shaderProgram=t._surfaceShaderSet.getShaderProgram(a,s,ge,ye,be,Ce,we,Se,Ee,Te,g,E,t.enableLighting,x,H,_e),fe.castShadows=M,fe.receiveShadows=O,fe.renderState=de,fe.primitiveType=b.TRIANGLES,fe.vertexArray=s.vertexArray,fe.uniformMap=me,fe.pass=I.GLOBE,t._debug.wireframe&&(Y(pe,t,r),l(s.wireframeVertexArray)&&(fe.vertexArray=s.wireframeVertexArray,fe.primitiveType=b.LINES));var Re=fe.boundingVolume,Ne=fe.orientedBoundingBox;a.mode!==z.SCENE3D?(e.fromRectangleWithHeights2D(r.rectangle,a.mapProjection,s.minimumHeight,s.maximumHeight,Re),i.fromElements(Re.center.z,Re.center.x,Re.center.y,Re.center),a.mode===z.MORPHING&&(Re=e.union(s.boundingSphere3D,Re,Re))):(fe.boundingVolume=e.clone(s.boundingSphere3D,Re),fe.orientedBoundingBox=y.clone(s.orientedBoundingBox,Ne)),a.commandList.push(fe),de=ce,he=le}while($<re)}function Z(e,t,r){var i;e._pickCommands.length<=e._usedPickCommands?(i=new D,i.cull=!1,e._pickCommands.push(i)):i=e._pickCommands[e._usedPickCommands],++e._usedPickCommands;var n=t.owner.data,o=r.projection instanceof T;i.shaderProgram=e._surfaceShaderSet.getPickShaderProgram(r,n,o),i.renderState=e._pickRenderState,i.owner=t.owner,i.primitiveType=t.primitiveType,i.vertexArray=t.vertexArray,i.uniformMap=t.uniformMap,i.boundingVolume=t.boundingVolume,i.orientedBoundingBox=t.orientedBoundingBox,i.pass=t.pass,r.commandList.push(i)}u(H.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=n.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}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}}}),H.prototype.initialize=function(e){var t=this._imageryLayers;t._update(),t.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(e){e.data.imagery.sort(W)}));var r=e.creditDisplay;this._terrainProvider.ready&&l(this._terrainProvider.credit)&&r.addCredit(this._terrainProvider.credit);for(var i=0,n=t.length;i<n;++i){var o=t.get(i).imageryProvider;o.ready&&l(o.credit)&&r.addCredit(o.credit)}for(var a=this._vertexArraysToDestroy,s=a.length,u=0;u<s;++u)j(a[u]);a.length=0},H.prototype.beginUpdate=function(e){for(var t=this._tilesToRenderByTextureCount,r=0,i=t.length;r<i;++r){var n=t[r];l(n)&&(n.length=0)}this._usedDrawCommands=0},H.prototype.endUpdate=function(e){l(this._renderState)||(this._renderState=M.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS}}),this._blendRenderState=M.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:N.LESS_OR_EQUAL},blending:R.ALPHA_BLEND}));for(var t=this._tilesToRenderByTextureCount,r=0,i=t.length;r<i;++r){var n=t[r];if(l(n))for(var o=0,a=n.length;o<a;++o)Q(this,n[o],e)}},H.prototype.updateForPick=function(e){l(this._pickRenderState)||(this._pickRenderState=M.fromCache({colorMask:{red:!1,green:!1,blue:!1,alpha:!1},depthTest:{enabled:!0}})),this._usedPickCommands=0;for(var t=this._drawCommands,r=0,i=this._usedDrawCommands;r<i;++r)Z(this,t[r],e)},H.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()},H.prototype.getLevelMaximumGeometricError=function(e){return this._terrainProvider.getLevelMaximumGeometricError(e)},H.prototype.loadTile=function(e,t){F.processStateMachine(t,e,this._terrainProvider,this._imageryLayers,this._vertexArraysToDestroy)};var K=new e;H.prototype.computeTileVisibility=function(t,r,n){var o=this.computeDistanceToTile(t,r);if(t._distance=o,r.fog.enabled&&v.fog(o,r.fog.density)>=1)return E.NONE;var a=t.data,u=r.cullingVolume,c=s(a.orientedBoundingBox,a.boundingSphere3D);r.mode!==z.SCENE3D&&(c=K,e.fromRectangleWithHeights2D(t.rectangle,r.mapProjection,a.minimumHeight,a.maximumHeight,c),i.fromElements(c.center.z,c.center.x,c.center.y,c.center),r.mode===z.MORPHING&&(c=e.union(a.boundingSphere3D,c,c)));var d=u.computeVisibility(c);if(d===g.OUTSIDE)return E.NONE;var h=r.mode===z.SCENE3D&&r.camera.frustum instanceof U;if(r.mode===z.SCENE3D&&!h){var p=a.occludeePointInScaledSpace;return l(p)?n.ellipsoid.isScaledSpacePointVisible(p)?d:E.NONE:d}return d};var J=new _,$=new _,ee=new n,te=new i,re=new i,ie=new i,ne=new i;H.prototype.showTileThisFrame=function(e,t){for(var r=0,i=e.data.imagery,n=0,o=i.length;n<o;++n){var a=i[n];l(a.readyImagery)&&0!==a.readyImagery.imageryLayer.alpha&&++r}var s=this._tilesToRenderByTextureCount[r];l(s)||(s=[],this._tilesToRenderByTextureCount[r]=s),s.push(e);var u=this._debug;++u.tilesRendered,u.texturesRendered+=r},H.prototype.computeDistanceToTile=function(e,t){var r=e.data,i=r.tileBoundingRegion;return i.distanceToCamera(t)},H.prototype.isDestroyed=function(){return!1},H.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),c(this)},H.prototype._onLayerAdded=function(e,t){if(e.show){var r=this._terrainProvider;this._quadtree.forEachLoadedTile(function(t){e._createTileImagerySkeletons(t,r)&&(t.state=V.LOADING)}),this._layerOrderChanged=!0}},H.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(t){for(var r=t.data.imagery,i=-1,n=0,o=0,a=r.length;o<a;++o){var s=r[o],u=s.loadingImagery;if(l(u)||(u=s.readyImagery),u.imageryLayer===e)i===-1&&(i=o),s.freeResources(),++n;else if(i!==-1)break}i!==-1&&r.splice(i,n)})},H.prototype._onLayerMoved=function(e,t,r){this._layerOrderChanged=!0},H.prototype._onLayerShownOrHidden=function(e,t,r){r?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var oe,ae,se;!function(){function e(e){return new L({geometryInstances:e,appearance:new k({translucent:!1,flat:!0}),asynchronous:!1})}var r,n,o=new p({geometry:t.fromDimensions({dimensions:new i(2,2,2)})}),s=new p({geometry:new w({radius:1})}),u=new _;oe=function(t,i){return t===r?n:(se(),r=t,u=_.fromRotationTranslation(t.halfAxes,t.center,u),o.modelMatrix=u,o.attributes.color=a.fromColor(i),n=e(o))},ae=function(t,i){return t===r?n:(se(),r=t,u=_.fromTranslation(t.center,u),u=_.multiplyByUniformScale(u,t.radius,u),s.modelMatrix=u,s.attributes.color=a.fromColor(i),n=e(s))},se=function(){l(n)&&(n.destroy(),n=void 0,r=void 0)}}();var le=new n(0,0,0,0);return H}),define("Scene/ImageryLayerCollection",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Event","../Core/Math","../Core/Rectangle","../ThirdParty/when","./ImageryLayer"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(){this._layers=[],this.layerAdded=new o,this.layerRemoved=new o,this.layerMoved=new o,this.layerShownOrHidden=new o}function d(e,t){var r=e.indexOf(t);return r}function h(e,t,r){var i=e._layers;if(t=a.clamp(t,0,i.length-1),r=a.clamp(r,0,i.length-1),t!==r){var n=i[t];i[t]=i[r],i[r]=n,e._update(),e.layerMoved.raiseEvent(n,r,t)}}r(c.prototype,{length:{get:function(){return this._layers.length}}}),c.prototype.add=function(e,r){var i=t(r);i?this._layers.splice(r,0,e):(r=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,r)},c.prototype.addImageryProvider=function(e,t){var r=new u(e);return this.add(r,t),r},c.prototype.remove=function(t,r){r=e(r,!0);var i=this._layers.indexOf(t);return i!==-1&&(this._layers.splice(i,1),this._update(),this.layerRemoved.raiseEvent(t,i),r&&t.destroy(),!0)},c.prototype.removeAll=function(t){t=e(t,!0);for(var r=this._layers,i=0,n=r.length;i<n;i++){var o=r[i];this.layerRemoved.raiseEvent(o,i),t&&o.destroy()}this._layers=[]},c.prototype.contains=function(e){return this.indexOf(e)!==-1},c.prototype.indexOf=function(e){return this._layers.indexOf(e)},c.prototype.get=function(e){return this._layers[e]},c.prototype.raise=function(e){var t=d(this._layers,e);h(this,t,t+1)},c.prototype.lower=function(e){var t=d(this._layers,e);h(this,t,t-1)},c.prototype.raiseToTop=function(e){var t=d(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))},c.prototype.lowerToBottom=function(e){var t=d(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 p=new s;return c.prototype.pickImageryLayerFeatures=function(e,r){var i=r.globe.pick(e,r);if(t(i)){for(var n,o=r.globe.ellipsoid.cartesianToCartographic(i),u=r.globe._surface._tilesToRender,c=0;!t(n)&&c<u.length;++c){var d=u[c];s.contains(d.rectangle,o)&&(n=d)}if(t(n)){for(var h=n.data.imagery,f=[],m=[],g=h.length-1;g>=0;--g){var v=h[g],_=v.readyImagery;if(t(_)){var y=_.imageryLayer.imageryProvider;if(t(y.pickFeatures)&&s.contains(_.rectangle,o)){var b=p,C=1/1024;if(b.west=a.lerp(n.rectangle.west,n.rectangle.east,v.textureCoordinateRectangle.x-C),b.east=a.lerp(n.rectangle.west,n.rectangle.east,v.textureCoordinateRectangle.z+C),b.south=a.lerp(n.rectangle.south,n.rectangle.north,v.textureCoordinateRectangle.y-C),b.north=a.lerp(n.rectangle.south,n.rectangle.north,v.textureCoordinateRectangle.w+C),s.contains(b,o)){var w=y.pickFeatures(_.x,_.y,_.level,o.longitude,o.latitude);t(w)&&(f.push(w),m.push(_.imageryLayer))}}}}if(0!==f.length)return l.all(f,function(e){for(var r=[],i=0;i<e.length;++i){var n=e[i],a=m[i];if(t(n)&&n.length>0)for(var s=0;s<n.length;++s){var l=n[s];l.imageryLayer=a,t(l.position)||(l.position=o),r.push(l)}}return r})}}},c.prototype.queueReprojectionCommands=function(e){for(var t=this._layers,r=0,i=t.length;r<i;++r)t[r].queueReprojectionCommands(e)},c.prototype.cancelReprojections=function(){for(var e=this._layers,t=0,r=e.length;t<r;++t)e[t].cancelReprojections()},c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return this.removeAll(!0),i(this)},c.prototype._update=function(){for(var e,r,i=!0,n=this._layers,o=0,a=n.length;o<a;++o)r=n[o],r._layerIndex=o,r.show?(r._isBaseLayer=i,i=!1):r._isBaseLayer=!1,r.show!==r._show&&(t(r._show)&&(t(e)||(e=[]),e.push(r)),r._show=r.show);if(t(e))for(o=0,a=e.length;o<a;++o)r=e[o],this.layerShownOrHidden.raiseEvent(r,r._layerIndex,r.show)},c}),define("Scene/QuadtreeOccluders",["../Core/Cartesian3","../Core/defineProperties","../Core/EllipsoidalOccluder"],function(e,t,r){"use strict";function i(t){this._ellipsoid=new r(t.ellipsoid,e.ZERO)}return t(i.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),i}),define("Scene/QuadtreeTile",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Rectangle","./QuadtreeTileLoadState"],function(e,t,r,i,n){"use strict";function o(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._customData=[],this._frameUpdated=void 0,this._frameRendered=void 0,this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}function a(t){e(t)&&t.freeResources()}return o.createLevelZeroTiles=function(e){for(var t=e.getNumberOfXTilesAtLevel(0),r=e.getNumberOfYTilesAtLevel(0),i=new Array(t*r),n=0,a=0;a<r;++a)for(var s=0;s<t;++s)i[n++]=new o({tilingScheme:e,x:s,y:a,level:0});return i},o.prototype._updateCustomData=function(t,r,n){var o,a,s,l=this.customData;if(e(r)&&e(n)){for(l=l.filter(function(e){return n.indexOf(e)===-1}),this._customData=l,s=this._rectangle,o=0;o<r.length;++o)a=r[o],i.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=t}else{var u=this._parent;if(e(u)&&this._frameUpdated!==u._frameUpdated){l.length=0,s=this._rectangle;var c=u.customData;for(o=0;o<c.length;++o)a=c[o],i.contains(s,a.positionCartographic)&&l.push(a);this._frameUpdated=u._frameUpdated}}},t(o.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 e(this._southwestChild)||(this._southwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return e(this._southeastChild)||(this._southeastChild=new o({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 e(this._northwestChild)||(this._northwestChild=new o({tilingScheme:this.tilingScheme,x:2*this.x,y:2*this.y,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return e(this._northeastChild)||(this._northeastChild=new o({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<n.DONE}},eligibleForUnloading:{get:function(){var t=!0;return e(this.data)&&(t=this.data.eligibleForUnloading,e(t)||(t=!0)),t}}}),o.prototype.freeResources=function(){this.state=n.START,this.renderable=!1,this.upsampledFromParent=!1,e(this.data)&&e(this.data.freeResources)&&this.data.freeResources(),a(this._southwestChild),this._southwestChild=void 0,a(this._southeastChild),this._southeastChild=void 0,a(this._northwestChild),this._northwestChild=void 0,a(this._northeastChild),this._northeastChild=void 0},o}),define("Scene/TileReplacementQueue",["../Core/defined"],function(e){"use strict";function t(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}function r(e,t){var r=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:r.replacementNext=i,t===e.tail?e.tail=r:i.replacementPrevious=r,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}return t.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head},t.prototype.trimTiles=function(t){for(var i=this.tail,n=!0;n&&e(this._lastBeforeStartOfFrame)&&this.count>t&&e(i);){n=i!==this._lastBeforeStartOfFrame;var o=i.replacementPrevious;i.eligibleForUnloading&&(i.freeResources(),r(this,i)),i=o}},t.prototype.markTileRendered=function(t){var i=this.head;return i===t?void(t===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=t.replacementNext)):(++this.count,e(i)?((e(t.replacementPrevious)||e(t.replacementNext))&&r(this,t),t.replacementPrevious=void 0,t.replacementNext=i,i.replacementPrevious=t,void(this.head=t)):(t.replacementPrevious=void 0,t.replacementNext=void 0,this.head=t,void(this.tail=t)))},t}),define("Scene/QuadtreePrimitive",["../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/getTimestamp","../Core/Math","../Core/Ray","../Core/Rectangle","../Core/Visibility","./OrthographicFrustum","./QuadtreeOccluders","./QuadtreeTile","./QuadtreeTileLoadState","./SceneMode","./TileReplacementQueue"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};var t=this._tileProvider.tilingScheme,i=t.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new v,this._levelZeroTiles=void 0,this._levelZeroTilesReady=!1,this._loadQueueTimeSlice=5,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this.maximumScreenSpaceError=r(e.maximumScreenSpaceError,2),this.tileCacheSize=r(e.tileCacheSize,100),this._occluders=new p({ellipsoid:i}),this._tileLoadProgressEvent=new a,this._lastTileLoadQueueLength=0}function y(e,t){var r=c.center(e.rectangle,L),i=r.longitude-k.longitude,n=r.latitude-k.latitude;r=c.center(t.rectangle,L);var o=r.longitude-k.longitude,a=r.latitude-k.latitude;return i*i+n*n-(o*o+a*a)}function b(e,t){var r=e._debug;if(!r.suspendLodUpdate){var n,o,a=e._tilesToRender;if(a.length=0,!i(e._levelZeroTiles)){if(!e._tileProvider.ready)return;var s=e._tileProvider.tilingScheme;e._levelZeroTiles=f.createLevelZeroTiles(s)}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;var l,u=e._tileProvider,c=e._occluders,h=e._levelZeroTiles;k=t.camera.positionCartographic,h.sort(y);var p=e._addHeightCallbacks,m=e._removeHeightCallbacks,g=t.frameNumber;if(p.length>0||m.length>0){for(n=0,o=h.length;n<o;++n)l=h[n],l._updateCustomData(g,p,m);p.length=0,m.length=0}for(n=0,o=h.length;n<o;++n)l=h[n],e._tileReplacementQueue.markTileRendered(l),l.renderable?u.computeTileVisibility(l,t,c)!==d.NONE?w(e,t,l):(l.needsLoading&&e._tileLoadQueueLow.push(l),++r.tilesCulled):(l.needsLoading&&e._tileLoadQueueHigh.push(l),++r.tilesWaitingForChildren);t.afterRender.push(C(e))}}function C(e){return function(){P(e)}}function w(e,t,r){var i=e._debug;if(++i.tilesVisited,e._tileReplacementQueue.markTileRendered(r),r._updateCustomData(t.frameNumber),r.level>i.maxDepth&&(i.maxDepth=r.level),A(e,t,r)<e.maximumScreenSpaceError)return r.needsLoading&&e._tileLoadQueueMedium.push(r),void I(e,r);var n=r.southwestChild,o=r.southeastChild,a=r.northwestChild,s=r.northeastChild,l=n.renderable&&o.renderable&&a.renderable&&s.renderable,u=n.upsampledFromParent&&o.upsampledFromParent&&a.upsampledFromParent&&s.upsampledFromParent;l?u?(I(e,r),S(e,t.camera.positionCartographic,n,o,a,s),r.needsLoading&&e._tileLoadQueueMedium.push(r)):(T(e,n,o,a,s,t),r.needsLoading&&e._tileLoadQueueLow.push(r)):(S(e,t.camera.positionCartographic,n,o,a,s),I(e,r),r.needsLoading&&e._tileLoadQueueLow.push(r))}function S(e,t,r,i,n,o){t.longitude<r.east?t.latitude<r.north?(E(e,r),E(e,i),E(e,n),E(e,o)):(E(e,n),E(e,r),E(e,o),E(e,i)):t.latitude<r.north?(E(e,i),E(e,r),E(e,o),E(e,n)):(E(e,o),E(e,n),E(e,i),E(e,r))}function E(e,t){e._tileReplacementQueue.markTileRendered(t),t.needsLoading&&(t.renderable?e._tileLoadQueueLow.push(t):e._tileLoadQueueHigh.push(t))}function T(e,t,r,i,n,o){var a=o.camera.positionCartographic,s=e._tileProvider,l=e._occluders;a.longitude<t.rectangle.east?a.latitude<t.rectangle.north?(x(e,t,s,o,l),x(e,r,s,o,l),x(e,i,s,o,l),x(e,n,s,o,l)):(x(e,i,s,o,l),x(e,t,s,o,l),x(e,n,s,o,l),x(e,r,s,o,l)):a.latitude<t.rectangle.north?(x(e,r,s,o,l),x(e,t,s,o,l),x(e,n,s,o,l),x(e,i,s,o,l)):(x(e,n,s,o,l),x(e,i,s,o,l),x(e,r,s,o,l),x(e,t,s,o,l))}function x(e,t,r,i,n){r.computeTileVisibility(t,i,n)!==d.NONE?w(e,i,t):(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t))}function P(e){var t=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;t!==e._lastTileLoadQueueLength&&(e._tileLoadProgressEvent.raiseEvent(t),e._lastTileLoadQueueLength=t)}function A(e,t,r){if(t.mode===g.SCENE2D||t.camera.frustum instanceof h)return D(e,t,r);var i=e._tileProvider.getLevelMaximumGeometricError(r.level),n=r._distance,o=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=i*o/(n*a);return t.fog.enabled&&(s-=l.fog(n,t.fog.density)*t.fog.sse),s}function D(e,t,r){var n=t.camera,o=n.frustum;i(o._offCenterFrustum)&&(o=o._offCenterFrustum);var a=t.context,s=a.drawingBufferWidth,u=a.drawingBufferHeight,c=e._tileProvider.getLevelMaximumGeometricError(r.level),d=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(s,u),h=c/d;return t.fog.enabled&&t.mode!==g.SCENE2D&&(h-=l.fog(r._distance,t.fog.density)*t.fog.sse),h}function I(e,t){e._tilesToRender.push(t),++e._debug.tilesRendered}function M(e,t){var r=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,n=e._tileLoadQueueLow,o=e._tileProvider;if(0!==r.length||0!==i.length||0!==n.length){e._tileReplacementQueue.trimTiles(e.tileCacheSize);var a=s()+e._loadQueueTimeSlice;O(e,t,o,a,r),O(e,t,o,a,i),O(e,t,o,a,n)}}function O(e,t,r,i,n){for(var o=0,a=n.length;o<a&&s()<i;++o){var l=n[o];e._tileReplacementQueue.markTileRendered(l),r.loadTile(t,l)}}function R(n,o){for(var a=n._tileToUpdateHeights,l=n._tileProvider.terrainProvider,u=s(),d=n._updateHeightsTimeSlice,h=u+d,p=o.mode,f=o.mapProjection,m=f.ellipsoid;a.length>0;){for(var v=a[0],_=v.customData,y=_.length,b=!1,C=n._lastTileIndex;C<y;++C){var w=_[C];if(v.level>w.level){if(i(w.positionOnEllipsoidSurface)||(w.positionOnEllipsoidSurface=e.fromRadians(w.positionCartographic.longitude,w.positionCartographic.latitude,0,m)),p===g.SCENE3D){var S=m.geodeticSurfaceNormal(w.positionOnEllipsoidSurface,F.direction),E=m.getSurfaceNormalIntersectionWithZAxis(w.positionOnEllipsoidSurface,11500,F.origin);if(!i(E)){var T=Math.min(r(v.data.minimumHeight,0),-11500),x=e.multiplyByScalar(S,Math.abs(T)+1,U);e.subtract(w.positionOnEllipsoidSurface,x,F.origin)}}else t.clone(w.positionCartographic,B),B.height=-11500,f.project(B,U),e.fromElements(U.z,U.x,U.y,U),e.clone(U,F.origin),e.clone(e.UNIT_X,F.direction);var P=v.data.pick(F,p,f,!1,U);i(P)&&w.callback(P),w.level=v.level}else if(v.level===w.level){for(var A,D=v.children,I=D.length,M=0;M<I&&(A=D[M],!c.contains(A.rectangle,w.positionCartographic));++M);var O=l.getTileDataAvailable(A.x,A.y,A.level),R=v.parent;(i(O)&&!O||i(R)&&i(R.data)&&i(R.data.terrainData)&&!R.data.terrainData.isChildAvailable(R.x,R.y,A.x,A.y))&&w.removeFunc()}if(s()>=h){b=!0;break}}if(b){n._lastTileIndex=C;break}n._lastTileIndex=0,a.shift()}}function N(e,t){for(var r=e._tileProvider,i=e._tilesToRender,n=e._tileToUpdateHeights,o=0,a=i.length;o<a;++o){var s=i[o];r.showTileThisFrame(s,t),s._frameRendered!==t.frameNumber-1&&n.push(s),s._frameRendered=t.frameNumber}}n(_.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}}}),_.prototype.invalidateAllTiles=function(){var e=this._tileReplacementQueue;e.head=void 0,e.tail=void 0,e.count=0;var t=this._levelZeroTiles;if(i(t))for(var r=0;r<t.length;++r){for(var n=t[r],o=n.customData,a=o.length,s=0;s<a;++s){var l=o[s];l.level=0,this._addHeightCallbacks.push(l)}t[r].freeResources()}this._levelZeroTiles=void 0,this._tileProvider.cancelReprojections()},_.prototype.forEachLoadedTile=function(e){for(var t=this._tileReplacementQueue.head;i(t);)t.state!==m.START&&e(t),t=t.replacementNext},_.prototype.forEachRenderedTile=function(e){for(var t=this._tilesToRender,r=0,i=t.length;r<i;++r)e(t[r])},_.prototype.updateHeight=function(e,t){var r=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){for(var e=r._addHeightCallbacks,t=e.length,n=0;n<t;++n)if(e[n]===i){e.splice(n,1);break}r._removeHeightCallbacks.push(i)},r._addHeightCallbacks.push(i),i.removeFunc},_.prototype.beginFrame=function(e){var t=e.passes;if(t.render){this._tileProvider.initialize(e);var r=this._debug;r.suspendLodUpdate||(r.maxDepth=0,r.tilesVisited=0,r.tilesCulled=0,r.tilesRendered=0,r.tilesWaitingForChildren=0,this._tileLoadQueueHigh.length=0,this._tileLoadQueueMedium.length=0,this._tileLoadQueueLow.length=0,this._tileReplacementQueue.markStartOfRenderFrame())}},_.prototype.update=function(e){var t=e.passes;t.render&&(this._tileProvider.beginUpdate(e),b(this,e),N(this,e),this._tileProvider.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&this._tileProvider.updateForPick(e)},_.prototype.endFrame=function(e){var t=e.passes;if(t.render&&e.mode!==g.MORPHING){M(this,e),R(this,e);var r=this._debug;r.suspendLodUpdate||r.enableDebugOutput&&(r.tilesVisited===r.lastTilesVisited&&r.tilesRendered===r.lastTilesRendered&&r.tilesCulled===r.lastTilesCulled&&r.maxDepth===r.lastMaxDepth&&r.tilesWaitingForChildren===r.lastTilesWaitingForChildren||(console.log("Visited "+r.tilesVisited+", Rendered: "+r.tilesRendered+", Culled: "+r.tilesCulled+", Max Depth: "+r.maxDepth+", 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))}},_.prototype.isDestroyed=function(){return!1},_.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var k,L=new t,F=new u,B=new t,U=new e;return _}),define("Scene/Globe",["../Core/BoundingSphere","../Core/buildModuleUrl","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/EllipsoidTerrainProvider","../Core/Event","../Core/IntersectionTests","../Core/loadImage","../Core/Ray","../Core/Rectangle","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/GlobeFS","../Shaders/GlobeVS","../Shaders/GroundAtmosphere","../ThirdParty/when","./GlobeSurfaceShaderSet","./GlobeSurfaceTileProvider","./ImageryLayerCollection","./QuadtreePrimitive","./SceneMode","./ShadowMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P){"use strict";function A(e){e=n(e,u.WGS84);var r=new c({ellipsoid:e}),i=new E;this._ellipsoid=e,this._imageryLayerCollection=i,this._surfaceShaderSet=new w,this._surfaceShaderSet.baseVertexShaderSource=new g({sources:[b,y]}),this._surfaceShaderSet.baseFragmentShaderSource=new g({sources:[_]}),this._surface=new T({tileProvider:new S({terrainProvider:r,imageryLayers:i,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=r,this._terrainProviderChanged=new d,this.show=!0,this.oceanNormalMapUrl=t("Assets/Textures/waterNormalsSmall.jpg"),this._oceanNormalMapUrl=void 0,this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.enableLighting=!1,this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=P.RECEIVE_ONLY,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=.5}function D(t){return function(r,i){var n=e.distanceSquaredTo(r.pickBoundingSphere,t),o=e.distanceSquaredTo(i.pickBoundingSphere,t);return n-o}}function I(e,t){return m.contains(e.rectangle,t)?e:void 0}a(A.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}}});var M=[],O={start:0,stop:0};A.prototype.pick=function(t,i,n){var a=i.mode,s=i.mapProjection,l=M;l.length=0;var u,c,d=this._surface._tilesToRender,p=d.length;for(c=0;c<p;++c){u=d[c];var f=u.data;if(o(f)){var m=f.pickBoundingSphere;a!==x.SCENE3D?(e.fromRectangleWithHeights2D(u.rectangle,s,f.minimumHeight,f.maximumHeight,m),r.fromElements(m.center.z,m.center.x,m.center.y,m.center)):e.clone(f.boundingSphere3D,m);var g=h.raySphere(t,m,O);o(g)&&l.push(f)}}l.sort(D(t.origin));var v;for(p=l.length,c=0;c<p&&(v=l[c].pick(t,i.mode,i.mapProjection,!0,n),!o(v));++c);return v};var R=new r,N=new r,k=new i,L=new f;return A.prototype.getHeight=function(e){var t=this._surface._levelZeroTiles;if(o(t)){var i,a,s=t.length;for(a=0;a<s&&(i=t[a],!m.contains(i.rectangle,e));++a);if(o(i)&&m.contains(i.rectangle,e)){for(;i.renderable;)i=I(i.southwestChild,e)||I(i.southeastChild,e)||I(i.northwestChild,e)||i.northeastChild; +for(;o(i)&&(!o(i.data)||!o(i.data.pickTerrain));)i=i.parent;if(o(i)){var l=this._surface._tileProvider.tilingScheme.ellipsoid,u=r.fromRadians(e.longitude,e.latitude,0,l,R),c=L,d=l.geodeticSurfaceNormal(u,c.direction),h=l.getSurfaceNormalIntersectionWithZAxis(u,11500,c.origin);if(!o(h)){var p=Math.min(n(i.data.minimumHeight,0),-11500),f=r.multiplyByScalar(d,Math.abs(p)+1,N);r.subtract(u,f,c.origin)}var g=i.data.pick(c,void 0,void 0,!1,N);if(o(g))return l.cartesianToCartographic(g,k).height}}}},A.prototype.beginFrame=function(e){if(this.show){var t=this._surface,r=t.tileProvider,i=this.terrainProvider,n=this.showWaterEffect&&i.ready&&i.hasWaterMask;if(n&&this.oceanNormalMapUrl!==this._oceanNormalMapUrl){var a=this.oceanNormalMapUrl;if(this._oceanNormalMapUrl=a,o(a)){var s=this;C(p(a),function(t){a===s.oceanNormalMapUrl&&(s._oceanNormalMap=s._oceanNormalMap&&s._oceanNormalMap.destroy(),s._oceanNormalMap=new v({context:e.context,source:t}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}var l=e.mode,u=e.passes;u.render&&(l===x.SCENE3D?this._zoomedOutOceanSpecularIntensity=.5:this._zoomedOutOceanSpecularIntensity=0,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,r.terrainProvider=this.terrainProvider,r.lightingFadeOutDistance=this.lightingFadeOutDistance,r.lightingFadeInDistance=this.lightingFadeInDistance,r.zoomedOutOceanSpecularIntensity=this._zoomedOutOceanSpecularIntensity,r.hasWaterMask=n,r.oceanNormalMap=this._oceanNormalMap,r.enableLighting=this.enableLighting,r.shadows=this.shadows,t.beginFrame(e))}},A.prototype.update=function(e){if(this.show){var t=this._surface,r=e.passes;r.render&&t.update(e),r.pick&&t.update(e)}},A.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)},A.prototype.isDestroyed=function(){return!1},A.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(),s(this)},A}),define("Shaders/PostProcessFilters/PassThrough",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),define("Scene/GlobeDepth",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/PassThrough"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(){this._colorTexture=void 0,this._depthStencilTexture=void 0,this._globeDepthTexture=void 0,this.framebuffer=void 0,this._copyDepthFramebuffer=void 0,this._clearColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._viewport=new e,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._debugGlobeDepthViewportCommand=void 0}function h(e,t,i){if(!r(e._debugGlobeDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\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_texture:function(){return e._globeDepthTexture}},owner:e})}e._debugGlobeDepthViewportCommand.execute(t,i)}function p(e){e._colorTexture=e._colorTexture&&!e._colorTexture.isDestroyed()&&e._colorTexture.destroy(),e._depthStencilTexture=e._depthStencilTexture&&!e._depthStencilTexture.isDestroyed()&&e._depthStencilTexture.destroy(),e._globeDepthTexture=e._globeDepthTexture&&!e._globeDepthTexture.isDestroyed()&&e._globeDepthTexture.destroy()}function f(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy(),e._copyDepthFramebuffer=e._copyDepthFramebuffer&&!e._copyDepthFramebuffer.isDestroyed()&&e._copyDepthFramebuffer.destroy()}function m(e,t,r,i){e._colorTexture=new u({context:t,width:r,height:i,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE}),e._depthStencilTexture=new u({context:t,width:r,height:i,pixelFormat:n.DEPTH_STENCIL,pixelDatatype:s.UNSIGNED_INT_24_8}),e._globeDepthTexture=new u({context:t,width:r,height:i,pixelFormat:n.RGBA,pixelDatatype:s.UNSIGNED_BYTE})}function g(e,t){e.framebuffer=new a({context:t,colorTextures:[e._colorTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._copyDepthFramebuffer=new a({context:t,colorTextures:[e._globeDepthTexture],destroyAttachments:!1})}function v(e,t,i,n){var o=e._colorTexture,a=!r(o)||o.width!==i||o.height!==n;r(e.framebuffer)&&!a||(p(e),f(e),m(e,t,i,n),g(e,t))}function _(i,n,a,s,u){i._viewport.width=a,i._viewport.height=s;var d=!e.equals(i._viewport,u.viewport),h=d!==i._useScissorTest;if(i._useScissorTest=d,e.equals(i._scissorRectangle,u.viewport)||(i._scissorRectangle=e.clone(u.viewport,i._scissorRectangle),h=!0),r(i._rs)&&e.equals(i._viewport,i._rs.viewport)&&!h||(i._rs=l.fromCache({viewport:i._viewport,scissorTest:{enabled:i._useScissorTest,rectangle:i._scissorRectangle}})),!r(i._copyDepthCommand)){var p="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";i._copyDepthCommand=n.createViewportQuadCommand(p,{uniformMap:{u_texture:function(){return i._depthStencilTexture}},owner:i})}i._copyDepthCommand.framebuffer=i._copyDepthFramebuffer,r(i._copyColorCommand)||(i._copyColorCommand=n.createViewportQuadCommand(c,{uniformMap:{u_texture:function(){return i._colorTexture}},owner:i})),i._copyDepthCommand.renderState=i._rs,i._copyColorCommand.renderState=i._rs,r(i._clearColorCommand)||(i._clearColorCommand=new o({color:new t(0,0,0,0),stencil:0,owner:i})),i._clearColorCommand.framebuffer=i.framebuffer}return d.prototype.executeDebugGlobeDepth=function(e,t){h(this,e,t)},d.prototype.update=function(e,t){var r=e.drawingBufferWidth,i=e.drawingBufferHeight;v(this,e,r,i),_(this,e,r,i,t),e.uniformState.globeDepthTexture=void 0},d.prototype.executeCopyDepth=function(e,t){r(this._copyDepthCommand)&&(this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._globeDepthTexture)},d.prototype.executeCopyColor=function(e,t){r(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)},d.prototype.clear=function(e,i,n){var o=this._clearColorCommand;r(o)&&(t.clone(n,o.color),o.execute(e,i))},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){p(this),f(this),r(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),r(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy());var e=this._debugGlobeDepthViewportCommand;return r(e)&&(e.shaderProgram=e.shaderProgram.destroy()),i(this)},d}),define("Scene/GoogleEarthEnterpriseImageryProvider",["../Core/Credit","../Core/decodeGoogleEarthEnterpriseData","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/GoogleEarthEnterpriseMetadata","../Core/loadArrayBuffer","../Core/loadImageFromTypedArray","../Core/Math","../Core/Rectangle","../Core/RuntimeError","../Core/throttleRequestByServer","../Core/TileProviderError","../ThirdParty/protobuf-minimal","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v){"use strict";function _(){this._image=new Image}function y(t){t=r(t,r.EMPTY_OBJECT);var n;n=i(t.metadata)?this._metadata=t.metadata:this._metadata=new l({url:t.url,proxy:t.proxy}),this._tileDiscardPolicy=t.tileDiscardPolicy,this._proxy=r(t.proxy,this._metadata.proxy),this._tilingScheme=new s({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new h(-d.PI,-d.PI,d.PI,d.PI),ellipsoid:t.ellipsoid});var o=t.credit;"string"==typeof o&&(o=new e(o)),this._credit=o,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,i(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new _),this._errorEvent=new a,this._ready=!1;var u,c=this;this._readyPromise=n.readyPromise.then(function(e){if(!n.imageryPresent){var t=new p("The server "+n.url+" doesn't have imagery");return u=m.handleError(u,c,c._errorEvent,t.message,void 0,void 0,void 0,t),v.reject(t)}return m.handleSuccess(u),c._ready=e,e}).otherwise(function(e){return u=m.handleError(u,c,c._errorEvent,e.message,void 0,void 0,void 0,e),v.reject(e)})}function b(e,t,r,n,o){var a=l.tileXYToQuadKey(r,n,o),s=t.imageryVersion;s=i(s)&&s>0?s:1;var u=e.url+"flatfile?f1-0"+a+"-i."+s.toString(),c=e._proxy;return i(c)&&(u=c.getURL(u)),u}function C(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";var r="PNG";return e[1]===r.charCodeAt(0)&&e[2]===r.charCodeAt(1)&&e[3]===r.charCodeAt(2)?"image/png":void 0}function w(e){for(var t=g.Reader.create(e),r=t.len,n={};t.pos<r;){var o=t.uint32();switch(o>>>3){case 1:n.imageType=t.uint32();break;case 2:n.imageData=t.bytes();break;case 3:n.alphaType=t.uint32();break;case 4:n.imageAlpha=t.bytes();break;case 5:var a=n.copyrightIds;if(i(a)||(a=n.copyrightIds=[]),2===(7&o))for(var s=t.uint32()+t.pos;t.pos<s;)a.push(t.uint32());else a.push(t.uint32());break;default:t.skipType(7&o)}}var l=n.imageType;if(i(l))switch(l){case 0:n.imageType="image/jpeg";break;case 4:n.imageType="image/png";break;default:throw new p("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}var u=n.alphaType;return i(u)&&0!==u&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete n.alphaType,delete n.imageAlpha),n}return _.prototype.isReady=function(){return!0},_.prototype.shouldDiscardImage=function(e){return e===this._image},n(y.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._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}}}),y.prototype.getTileCredits=function(e,t,r){var n=this._metadata,o=n.getTileInformation(e,t,r);if(i(o)){var a=n.providers[o.imageryProvider];if(i(a))return[a]}},y.prototype.requestImage=function(e,r,n){var o=this._tileDiscardPolicy._image,a=this._metadata,s=l.tileXYToQuadKey(e,r,n),d=a.getTileInformation(e,r,n);if(!i(d))return a.isValid(s)?void a.populateSubtree(e,r,n):o;if(!d.hasImagery())return o;var h=b(this,d,e,r,n),p=f(h,u);return i(p)?p.then(function(e){t(a.key,e);var r,n=new Uint8Array(e),s=a.protoImagery;if(i(s)&&s||(r=C(n)),!i(r)&&(!i(s)||s)){var l=w(n);r=l.imageType,n=l.imageData}return i(r)&&i(n)?c(n,r):o}):void 0},y.prototype.pickFeatures=function(e,t,r,i,n){},y}),define("Scene/GoogleEarthImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadText","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../Core/WebMercatorTilingScheme","../ThirdParty/when","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(i){function n(e){var t;try{t=JSON.parse(e)}catch(r){t=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}for(var n,o=0;o<t.layers.length;o++)if(t.layers[o].id===_._channel){n=t.layers[o];break}var s;if(!r(n))throw s="Could not find layer with channel (id) of "+_._channel+".",g=c.handleError(g,_,_._errorEvent,s,void 0,void 0,void 0,m),new u(s);if(!r(n.version))throw s="Could not find a version in channel (id) "+_._channel+".",g=c.handleError(g,_,_._errorEvent,s,void 0,void 0,void 0,m),new u(s);if(_._version=n.version,r(t.projection)&&"flat"===t.projection)_._tilingScheme=new a({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new l(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:i.ellipsoid});else{if(r(t.projection)&&"mercator"!==t.projection)throw s="Unsupported projection "+t.projection+".",g=c.handleError(g,_,_._errorEvent,s,void 0,void 0,void 0,m),new u(s);_._tilingScheme=new d({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:i.ellipsoid})}_._imageUrlTemplate=_._imageUrlTemplate.replace("{request}",_._requestType).replace("{channel}",_._channel).replace("{version}",_._version),_._ready=!0,_._readyPromise.resolve(!0),c.handleSuccess(g)}function p(e){var t="An error occurred while accessing "+v+".";g=c.handleError(g,_,_._errorEvent,t,void 0,void 0,void 0,m),_._readyPromise.reject(new u(t))}function m(){var e=r(_._proxy)?_._proxy.getURL(v):v,t=s(e);h(t,n,p)}i=t(i,{}),this._url=i.url,this._path=t(i.path,"/default_map"),this._tileDiscardPolicy=i.tileDiscardPolicy,this._proxy=i.proxy,this._channel=i.channel,this._requestType="ImageryMaps",this._credit=new e("Google Imagery",f._logoData,"http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"),this.defaultGamma=1.9,this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=i.maximumLevel,this._imageUrlTemplate=this._url+this._path+"/query?request={request}&channel={channel}&version={version}&x={x}&y={y}&z={zoom}",this._errorEvent=new o,this._ready=!1,this._readyPromise=h.defer();var g,v=this._url+this._path+"/query?request=Json&vars=geeServerDefs&is2d=t",_=this;m()}function m(e,t,i,n){var o=e._imageUrlTemplate;o=o.replace("{x}",t),o=o.replace("{y}",i),o=o.replace("{zoom}",n+1);var a=e._proxy;return r(a)&&(o=a.getURL(o)),o}return i(f.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._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}}}),f.prototype.getTileCredits=function(e,t,r){},f.prototype.requestImage=function(e,t,r){var i=m(this,e,t,r);return p.loadImage(this,i)},f.prototype.pickFeatures=function(e,t,r,i,n){},f._logoData="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAnCAYAAACmP2LfAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsIAAA7CARUoSoAAAAAHdElNRQfcDB4TJDr1mp5kAAAAGnRFWHRTb2Z0d2FyZQBQYWludC5ORVQgdjMuNS4xMDD0cqEAAB1zSURBVHhe7ZwHeFTFFsf/u+l9N70npOxuSAKEFFIhCSH0qhEQUHkgKCgWUFGBB6IoCAoo0ntooaRvEkIIBBBpoYSa3nvvfd+5u4sQUigPfMX8v2/Y3Tkzs3fv/d0z58zcgF69Ql1SY+MM1wQJem44ZeiJk8beEOqPwG6uC7ZqyElb9eo/JZEIkH2nRQkBIlNMauuPCS3uGN/kjkmNDghoskBAgzrZ2NLmf1+JwIKQpYsoxdmIV9+N07onCegzBPM9bOdmYKnazF6g/1N6UySPqSJzvCaaiLHtP8G/Phq+FRfgU5ogKWUXMLT6Mvzqr2BE40mMadqO8c3zMabBC6PqDDC8SlY60t9HByCLVTKu+ERmHr5TWI9wjVxEaOZivWo1pil8D1tZeWnLXv1l8iZ3PF2kjymiWRgvCoJv5U243IyAXcQq8A9Mg9W+4bDe6wv+kVGwCZkL+4Sf4ZR+BZ5VGQR3EkbWn8Hopm3wq54Lz2JD6ah/P21XGopQ9Qoc16jGSqVyTJWbQbUsibFXf42mihTwZpsvAtp3k0dOhFOSEH1+ngaDefrgjFCgFkxY8fCisCBvKgODzxRh9qslBFGfYmDGLbiV5mBwRRo8KtPhVBgPu8teMP7u73chD6kMRYRGBY5xqrFKqQwz5SdTbS/Qf5mmUYw8rf01CjHC4VP7AHZxO6E3qy9ZZCQNnio2rE/4o9/tkxiQUYp+KRXgx8XC5FsXcLz/hkCrDUU4pxLHuDVYpdwL9F+qqSJZKlPwenskfOoI5tN7YPCJGVme7wKYr5EBXzgYfW+mwTI0Gjrznaj2WW+I/y8dVPdDGLcKRzXrsEqlHO8oTKHaXqAZWe9hQXCi63NhHWYI3ilfWIW/YLjqL2JRiOFBJRz+LffhcPs09D+0J8vzn3zXdBnYnp8Mi6NboTWzH9X8fVc+DhDQodxqAroe36lU9AJNWr4cEAjNwI8OAC9cT1rbUfzwGeCfKiL7dGnNc+q1NiO80b4BY1oT4V6WDcsdc6j2xbyq4wMWrA9rQmeWFn36ey/jBaoPQ4hmLYI0G/AtAf22fC/QDols8ITrIYi/Bl6knbS2o3gRbxHQxQQ0k0S/gCa2v4OJovPwacqAQ1ICjL40klr+UrWoQbFBETo18jCpZsOoFODkvuCNJYoHW3QKXFEM7ETRcKfiQe8d6NVIFImXvg4skhY40mxnQYVRIIeA1qrHEc1GrFSpxFtP99AiFbDbNKDZpAzzGkVYVcvBuBJQEo/9/6C+dyjPitwLwak74D8V6Bfw0P5VShjXFoTR7TfhUZkL29M/wfATJan1lauWC3aDOgyaVDCuTgbf1bFkfmtkye1ogsK2asivLYfCglIoD8qCknI2NHuG4QSVGMgQyMbt0fioRYh9VYcRU7QX55uDcaHtFOJEsThMtmWtQgxsDodsWaC0c3ea3MzGBJEqxrfbYmzr6xjfPAeTmt5HQPO7eK1xDibUz8eY+k8xtHYJPCtXwvHOu7AXMrMTsF/TH8HajTis1YwVqpWY0TXQDKy1OpBr5EJA52Fukxx+bmKxtjWx2DuaWawNlZD5qhzyo9KhpHAbKpJO/6t65UCPbPHA2PYrGNacgkElabCJJDev/MpDhUKKnuq44LRoYEK1IiswkS1zYCfk5y+F0qjvoTwqBOof34dGeAnUL1ZCLboEnJ9zoe0QD/Nuj00UBVXRabzVLETM3S0ICfwA8yc7Y6C3ANYbZsA7aQ1W1xzEfZEQ6dT2BkG9pP4ouo7jGE1u42JS20QMrzkCr4xwuN4+AM+cYII3EaNar2J86zmMrP8DHulCON4NhU3YWuhOYy6SZENpH9cfx7WacFC7BSvUqjBDsRPQIiugURvazeqYVaqAw6dYrJ9WQy7gayj4nYDy3HtQOVQGpYRqKEWXQf2HdGha/AFdae9Xr4czz0ubISRA75ECbSut7agegO75OLxpahze8j5GtifBpzEDLiV30Dd2mNT6StWiCbVmLt5rUkBQCEt2zWzIMSA8HgrIBkLD+Sp0jhHISYXQ/KMYukfvQ3fQxq68XCTBHId/tMTg7LV1CFs4BszJ6hBarBgHlcRv8H7tbuSKQpFPYGe0BmND+nZ0npECaPKf0r4UIxsuoF/IMpitsAVnrA4s15uh3x8fwLXkLobUZGJIXTqcUzbDaJE5FAVq0t4S7dEcjqMEc6B2K5arVWN6Z6AbdOmm5mJelQKOHWSxF44Cy4CqxW0s6RwchCovFRohdGNfLgX3WiZ0N4aD++y7jfwYJUrAPCle/ZjKV+BFTSegrGAZIm3QjXhBytTWB3zhByzryMUU986jz16wD+96ijCNUIAgmkc3tS6G7GERjCbgR82B4OTbEESqIiCIcqsIYzoGGyrBEMSmgh8xBoIIAR2fAHZhj8Z9DOhl9FHeKkSDvn809fuc+iyCddRYaiOZBTvIt1YJfs0b4N+WDO+GHPLQN2Ab7S61vjJV60C9SRPvNSqzTpxlyQfS1dGUmjppK7gW16B/LhN6abnQu5cDwzO3YNhhqqK4WJY887sEdGzWFpxfOxmDpKZOOvgWFB8sx9L6nShvP4FyUQjKGg5gScpGKEqbUE7RxiGYv6QQ4zIG/r4D2m88sjEy/EIW/a6+TQ4gHe5VhXCvy4JL7gLYnesI2i6t4Tii04r92u1YKt767gB0ozrkGzmY26zEOh7Hkt+kAKhLTX9qOVVdg9aoNOjcToR+wUVKLYKgN0Zq7l7884wn9CKgr4AfWw/B6SwqKQRKOdXVghe9CpbherASSjtIpGpxRIHFjwygNreoXy0lb+lU7lHJBP9kPcGXQnBNghUB/Lh44fbUp5JA+5Hs71LbPPLCVRDEJZDNGIJgeQI6mG6KegKzldq1U7tGKjQmHR8vwl86kgRoAQN0xBw6ztn0nQ/ocxEdQ7L4d/BjG6g+m8aZTL/xsXPuW82Fb8t+DG1Ox5D6XAwqvQ67OA+p9ZWoUQPsei78mjSwNU9GLmEzVGZJTd3qFPTn3YZhXgYMMjNhlHsDxms/hNWfoUdrNPgEc2h7BG5d/Bo7Blt0BuNxXf4MVmXrkdRyEHWiY6hr2oc7mevRX2wc18gioEeI1+N9a+/CNnImVAZ0mhEoNOPAJT8MHjUF8KTiWhqHgbfMpVaJdhLQh3XasU9bJAZ6ekeg6zQwgEKuLSWysmd3QGmatLqD8qDNug3dCX/AIPk4jGr2wDB/JXTmkan70IvmZTY/rB9BdZlKLkG0lG0d5klAObKsw1+jzyFiWPnRawiaDrMYwTyMwMwh220WP2IWFVfqN4CKO8E3n0C6R/ZUej9Y2kUiMdDRFTRePH3nA3q/m7xpAEtAXl0QrkTwscnmS/3eptdzNEYevZLnZ5booqk8tuYs9tAny+n1LL1mghezlcULH0VtHamOZhvhIvoNOXQsd2EZIbluYnlWaMO75TCFG9kYXJ8H14o76H/10Z3yClSrCm6jGtbWK7LC7kIlYRfUmY2XHnUa+mbXYRSfCuNCptyE6b1jMBD/EPKwchQPLxGdxOWWI8iKXYBPqLozgI8pfA5YBWvxbfMeNLUfRmPTLjRnr8YKsdGvRQ5j2zZTSSRQ78H+7GhxfScFAINypsG9ukDspZ0LKKE+O0pqlGi71ggcIqD3dga6RhFKjSqYT+VEFkvu/E9Q+HNWKaE2VVDgVkPFqwAaay5CN3En9M59BM2vfKDs7AvljjPGE5LlharQdL+LoCmhOHU0rIUyD+NgVTOa+q2iVQiIcAKpHtbhXuJOjPqeVCRYThNE6VTvKNs3hM3cHGIxntxKyCbP7Erj1lHZJbVIJAG6iiCroZCAPGukvOyASJbvCgoaAoKoAQ1kHcGC7nmZDkmhBR2PfSQLtkcl4zCSAE2eO6qExYuYxrE4KqdvelBiM4+ncYQy1IY8d0wbhUSLJAZGbsUceNYdwJCGPAyuy4NbZToG3JoO1Qk9AvHvqF4ejo0KCKlisyl04Jw+AE1ma71HRUJP+QqM1t2HcVEyTEoSYVYQCuN3HenCt4XDhGA+KorAnYZ9KIj5ELOl3XpU/k/wrt+OmraDaG7cjpacbxFvYAAZDG5Vw/DWCxjRdp+ATsWAS6+D69H1+XDNsoVb1T06b0VwzCmBIOYdqUWibTojcFBH1CXQctBtUcA6Oh/RmVC4sBmKA5j6erC1qqE4sRpqG25A43QIOHuXgvOmP5R4ZH6m5UY2L9SSLjZ5sKjjsI/o8olH8ngjCZoSgmw9DMIl3t42Up0g+pq89/sEjLK47knZhSkSuDepJP4JOyNJyEFAR8VQKMOR1nbWM69yxNJYwh+VLE90ffPyxLE3EwL9Jq0huWQqwL1iA7zq8+FVl0+epgBO6T+gb2TH+OglqgastxtZrNNlkLt8E5oJx6HZdab7mFZBk3UZRjMewCT7HkzLfodZxREYr5sBjiIBPYiAPt8ehvSGPSg5vwjzpd16VNkmmDTswp22QDTXbkJrxhJkzHGDFoUQmvBpvo2hrZl0TnLhlLIYfUO7nt7dSg3hURcP1/JiDEgphuXBqVKLRFsfA3oJAf3mI6Cr2OjTwGYdqWGzzmZD6WoYVCfehdqsZKjuuwS1oB1Q+5piHac3oaxBzZ9vLZ4nHEeesoXg6niDPSYWP9yUgD5PHu48eKE64krHcErchHIEuRysTpAXjObQWIYEHiV4EQYEojp5aEoyY+IIpOQugKYYOnIdJXrdJ63PtWwXMQM6m6SVT4gfZkbHV0XHsVtaQ3K8yoJr0YfwoHDDq5ZiQSqDik/B4Q9taYtn18gyNia1qGJsmTrGlUjK2FJ1jCjRwOASDnkxDvN95ZD/og5yl0qgfCMJ2leDoeksHaFHXYOJVyrMkm/DrPwMzGr2wmjnLGipthyHL0W7t9pDkduwF2U3lmGFtvbTdyirt0OreT+iWwPRUrUBbSkLkT/fCUZwKVYikBMwpDlPXNzLwuAQ2rWX8KzUh2dDDJyLSmB7/S5Mf3WRWiR6CPSezkCXQs6qBnLCKsheyoXqnTCoL9oOFd9/Qtl9KJT6UJMX3/zhCz8iuCjhiviSYtMx3ZTJBN8lCE7eIRgF0p6krRRaRBDskTTGySBKws5SuUjJHYUiMQdpzCUE0Q3y5MnSDhJJQg5JUvjSgO5hHZofaioGmvc40IycMgbRtJktjgOZ5Ma9irzSg46xYHcaVEZevkgBHqUWGFK+FENKQ+BdGAq/wiMYWbwHI6h4FwTDOes0BMKFMHxPNg9qn1dANakYanfuQSs5FJoTpaP1qBswsSGgb9+EeUU0Af0LDH4dBhXlmv3wajuOpPYQFDcEojxtNQ6sn9ZzUsiofjfUWg/iYOt+tJatRtvN95DqZgxNuKTKwLV4Jdyqc8Wz1uCGTLjmDIVDQqewQ8anwpJi6GsYkF4Ey2O/QvsfXKlJIgboAwT07s5AZ0G1TylUIsuhdKMI6vcuQ3PVAqg+9UZ8JvGEywiuNoIwD4IzaV2X+HSa1otgE3+NwJImVkycG0kx8snfyUZJW+QFApeSu+hN9BpIn6n+ZBp9bqDv+C8Fum+8IpzzJNOmR3UhTaGFcC07iAHXmamuZw28C/S/aIt+CcthF7+ToN0EQdhqOFzcBu/Sm/ApvAGX3DzYXIiF9jtWTJf74L6ZC83UfGg8SId2xnloSZKxp+gWjC0J6KSrMK8KhmnlSugtInpkCzaBV78Hl5oPoaLpECrLt+Bi4jfgS7t1q+YDUGsPwj5KDFsLlqD97JuIpmpZmP+TftM1ezjlxsOllM4H3eReDWHwKrOBW84jqMeK5OBTv4Bu6HxxgqU1s/N3MkAHSoH+ioCe+gjoJHB0s8ENLID6/UJo3E+GVlwoNEwY278tXhR50RhmeexzgmM8JXjdF36MHwEoiXn70Csv6gxBm8PiRc6gJFD1HDzFpq1cP0omo5QJZAfqQzH0f6uHZjQgeR4cC/IJZCnUtSkYVPAWBiX2/CdU/S7Ql+9TgtFCTaiP0qAEXA2yRsqwuzECziWZcM4tgv2DSljF7ID+l+JNh9+hY38HuvcYmLOhk5EEnVPfQOmpW+33YGaXhj53E2BWuxvGebOh5cPUX/sWSgXrsa9mB2qaDqCK4C7I2IA3jn8u7tat2g6D034MIbWb0fZgHlr2DscXUhNNuYdkYRPrg/7JiXDMLYBrZS6GNEZgVJM/JjWY4I16G4xr/BCDq2nKjjoAvY+Zpwo7eXBskQK9Swr0lEdAn4a2wk3o/DMNWmn54KYUQIuZsebGQuXFQ42H4kfNk4QckSOkNZ1lGkGAUoInOKkAm2jJsVtH+om9Nj9ytZxNcNdhljXByo+JJXj/i4G2u2xM02YInPJLxFB7VudTPH0ZHkWu0hbPpwHpfnAszoFDVgVsb1fDMmoL9L8S7wTFQE/1AvR33oB+QSp0czKgl34B2iO9uwJCKib5SGaZjbqLPlkhMG1YDr1gQyioSs24vQTDitagsnIL6loCUVu9C2EJK9FjYtsWBNP2Q7hb9A155zdwY5mTeGexo0w32hEcy2F7JQaOqZfgk38KY6rDMKFBiGHNt+iGPgCNYd0/s/sbAb2fgN5JQC9Wq8bkR0AzioOOx3Xo30mGbnY+tNMKoJOQCm03qfnFxRf6E1yUFAqZJcyuZRWuQmB+TWHJcgJfkjPxImcSSIUsXviMx/O9DvqfALrPDjb6nhuBAWkZ5JFKKTYuIqhz4FUdAo9CGwzO7Ra2LjUg0w9OxdlwyKxAXzHQm8lDi4HeAT1WMPSHnYXR7aswKE6Gfl4K9PdfgZ6+uG8XSmMbKyXD/LsEmFduglH2NHA7rA3Hvg+Ve1/gYO4KNFRvQUPLQVRU7MG4yn1dJ4eiULAo3JhW9xsa77+Hml8GY8FQ425uAM5wRRivNoPlTjs4XhoH35oLGFZ/S/wglyDkbWmrrsUAvY+A3kHlSwJ6ihKzCvLnuQyElmIs9LdfhmHxA+jn5kI3jcrRFOjxU6DTbTx9DybsOBh0f034EeYEVyaFD0IYhnQ9y1pTIsiPvU5AnKYkUBL78yKmQhDLgDRPSWtPp/HFkFtHqFCfRBr73wX67qsD+qFsEubCnqKBAZllcCkkT12RjSHVMfApH0bJXfcH+aQGZg6FU1EWeeoK2NwgoMM3Q++zP/fq/Smf2g392ZEwzk2Acfl9GBHURmuSYPyn132oHBizH8B8wjX0SadQI2cWtOZZQbHTdEgRn8XN93EiczFayn5GU3Mg7lJMPab5SEeoCWZZ0TF4Ne/A/ZSPUbXdDz9Qdddrrk/KtcwR7jX34VXDzGCFGFT0GzyLu922x069kdiv145tOu34jlOHBWoz4arUAZQt0LYOhmFcHJ2H6zAsYnZDc2FwKhv60+m9UQrLUJ4hSYQAVhpM1O6jj30EDD33Q6frZyoY8cMVaWZZR560kuB5V9H6iVUas+Py5L1/IHsT2ZldR4nEkMdkUd8Y8tYd43mLIMhYhenDWvgjQSQiGFOkiEv0rEAzK2u8yG10M2WwBWFdb6q9NKDNd6rCOuYD9L2VI/57QMfcEniU5cCnJgG+lR9haAnz4MzT5ZjmA4e8HBqnGtYXamF+nK7bpx0uwHxoqGyE3sKD5HHjYVJ1C6Z5qTD5Ph2G1hnQEV/0LBhxU2E+4yYsbgTCJGsuNBfYQrnjA0CPxDo2CRYJ0xGesgD1ZWvQ3LQbKeSJ54uC0UcUDVVRGExFR/FB2y7cSf4C+Zv9sXSUeQ9P2z2pQdnmBHQsPKqKqFCyWJsM75o1GMw8O/iEhFZs/KK9CD9wRfhCTYTP1dqwnBOHrQYz8IuuH5ZxxI/MLQZH5kfoeu6D4cVQGNecgXHFbRgXZsD4Xg5MjqfDeE0KTBbRDLXsLiwOR8HkxCJoOs+Eavdr08ZBBGdYP7rYzAZILsH3LYUYtgSsAXlYRwLqW0r8Ksl2id4/Onaz47IE+kayUfwddYhsgwkqXRrLgOpHEuyhVF9B7ytoTAL//qNjeFagGfGEi5nvYPEifqOx/ek4p1J/8aKBWC8N6Icy2+oL6zOhECTmw46SuoHZpXBn/pK7/DK8K1bCp3Q0vAv7wqfIBD55OuS9teFVYASPfAFccseThw+E4Ho5LOMqYB6ZCeOdK6H1bleJH2sOOPZradqlC3otDqY5F2GafQmmCZdgFnMBZteEML2yCnprh0CZWVp66gbDuD5Q2uSLUacm43jSB0gq+h55JeuRX7wRqUUbkJL8DS4GTcPqCdZgduZ6XiZjgvcp9fIY3aAH/yY+3KvcMDBjLSXQBXDML4VbaQG8a9PgUxcOzyIneKY/Or6FHDO8q7INY+RiMFJaJijE4i2VeEylej/FDs99TAPH8Dvofv8bDK/vhVHxMRhX0W+vOgXTijiY5UXANGkNnYeRUGN2VrsPNx6XVaQNgRNM03sBgUjeOKJJ/Cr+LNzFsg61YB5/elyKtic0qM031CaZAG0gqJnVEuYBIoI49gy9D6DXrQR3GoU2j3YE+WE2FI9TGBG1FLywnhNbPt1Y/OhY+o5iGqsGNmdLaVxfqZUB+g0Iztwi2AOkNZ3FCzOm30bHeHK9tKYHKfPZMFhlAtM9c2EpjALv93zY3qlE/8xyOOUVUTiSBrfy83CvDIdbRZC4uJSGwzHzd0qgkmEVfRnGW/dC79vPobtkFLRmm0HDpVt43MnrzoOm/dfQeeOf0P3wB+guJogXrIDuhHfAsdOFbKdQ5GkaYQbNNYNht2c8/AOnYNKB6Ri//Q14zRwIuohdPC76pCbWKGFCkx9GNC7B0NZD8CiJh8Odi7A59zud7EuwvU4hVUYZBhUXwqsqA56V0RiUM1Dam36UoiyFuprQhc6fRZuKKhV5+rcLKD2hrPQ+NPsvgNb0j6C9eCG0v/kU2l9/BK0ZM8EdRJQ833noG8Qib6lDkA0lYD6i8GIJlffZ/IhhbJtQjW4TP164EiWWztTnH9T+a4L/MxpjAn02hWWYDAQnefSZzm7Io7zDOpiSzGh3grwPwd3zDccPZdH4phBEkXcWBrD4wlE07qObw5pmBUGsK43T/YPfgmAFWEe5U2EeCXhGcV5nQ3u2KrTf6w+jdTNhtud7mB/ZC4vg43QAwbAMDYLF0e3os+8HGP80D7oLx0F9dD+oj9AGZ4Y85K0Yj/Vs3kQiFgeybFPIySiDzdwAz9O3JzHjPNtYk8gjv948FOOatlGodR0Dk07Bau9n0F8wFBp+luBO1CXeuDD51Q3830PRP7UIzgUlcC0vhHPRSdic6eI53ecT3W0sKyjI2EFRxhzyz3sOO8voBkEUTclYhAyshCwr642PR79diwlbBOEs8vLMFjgbbuelhpeoz5rEDxsNNl/+9ON5RWJOLsXCysQdh5IhWWbzhUmoel6v/l/RxGpZTKgbh3EtEZQMp5AX2ASd2f3AVu7695ky/7nOuc2U/BZSCFIGp+I82F/rfprsVa/+Mk0sZ2F0tTvGNZ+gRO8B7C/HQ92beWine+/IDWDBbJUmbBN/hUNOGRyyStH34vfQeP3ZV4R61atXIu9Kefg1rIB/XRJciwso9nymLXmxbP+wxcCsVAxIKwfv1AZoDH96jN6rXr1SuVeowKsuFINrs+BSXATbc59JLU/XwCwdDMw7B/vUEpgHfQYZ7v9HCNar/2E55ynDpSwYrhXF4uKUeQiY0/Oy3kM555nCITcJgmvp0F30Yo8L9KpXL1X9E2XhkPoVBuYWwbmolKDOhmv+WHiXyGNkgbTRE1pOublXkRycCz+AfUoRzPdsgKJN1w/19KpXf7n6xlnCPikE/SkWdswrozDkNoZUfIWhFTYYWaPy4a6NkgSR2XAZXSOLIWUWcCv7FP1T7sH8wFZwp7ycxz971auXIm4AG+b77MFLEKLv7ULJMy0FefCsPAOv0t0YUrIMg0s+gVfxYrgVbIJLUSzsrl2F2ZZl4L7J/Pdp/956ca969UrEna0O41/HwSJ4F3in42Fz5Trsbt5Bv3u30e9uImyvnoV15GGY/LIA6kOZP1966pZ8r3r1n5eqhwZ0F/aB4ToHGK9zh/FPHjD60RE6H1tDaaA2cdy7mvFfI+BffksPNrEksu0AAAAASUVORK5CYII=",f}),define("Scene/GridImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,r,i,n,o,a){"use strict";function s(e){e=t(e,t.EMPTY_OBJECT),this._tilingScheme=r(e.tilingScheme)?e.tilingScheme:new o({ellipsoid:e.ellipsoid}),this._cells=t(e.cells,8),this._color=t(e.color,l),this._glowColor=t(e.glowColor,u),this._glowWidth=t(e.glowWidth,6),this._backgroundColor=t(e.backgroundColor,c),this._errorEvent=new n,this._tileWidth=t(e.tileWidth,256),this._tileHeight=t(e.tileHeight,256),this._canvasSize=t(e.canvasSize,256),this._canvas=this._createGridCanvas(),this._readyPromise=a.resolve(!0)}var l=new e(1,1,1,.4),u=new e(0,1,0,.05),c=new e(0,.5,0,.2);return i(s.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}}}),s.prototype._drawGrid=function(e){for(var t=0,r=this._canvasSize,i=0;i<=this._cells;++i){var n=i/this._cells,o=1+n*(r-1);e.moveTo(o,t),e.lineTo(o,r),e.moveTo(t,o),e.lineTo(r,o)}e.stroke()},s.prototype._createGridCanvas=function(){var e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;var t=0,r=this._canvasSize,i=e.getContext("2d"),n=this._backgroundColor.toCssColorString();i.fillStyle=n,i.fillRect(t,t,r,r);var o=this._glowColor.toCssColorString();i.strokeStyle=o,i.lineWidth=this._glowWidth,i.strokeRect(t,t,r,r),this._drawGrid(i),i.lineWidth=.5*this._glowWidth,i.strokeRect(t,t,r,r),this._drawGrid(i);var a=this._color.toCssColorString();return i.strokeStyle=a,i.lineWidth=2,i.strokeRect(t,t,r,r),i.lineWidth=1,this._drawGrid(i),e},s.prototype.getTileCredits=function(e,t,r){},s.prototype.requestImage=function(e,t,r){return this._canvas},s.prototype.pickFeatures=function(e,t,r,i,n){},s}),define("Scene/JobScheduler",["../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/getTimestamp","./JobType"],function(e,t,r,i,n){"use strict";function o(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}function a(t){var r=new Array(n.NUMBER_OF_JOB_TYPES);r[n.TEXTURE]=new o(e(t)?t[n.TEXTURE]:10),r[n.PROGRAM]=new o(e(t)?t[n.PROGRAM]:10),r[n.BUFFER]=new o(e(t)?t[n.BUFFER]:30);var i,a=r.length,s=0;for(i=0;i<a;++i)s+=r[i].total;var l=new Array(a);for(i=0;i<a;++i)l[i]=!1;this._totalBudget=s,this._totalUsedThisFrame=0,this._budgets=r,this._executedThisFrame=l}return t(o.prototype,{total:{get:function(){return this._total}}}),a.getTimestamp=i,t(a.prototype,{totalBudget:{get:function(){return this._totalBudget}}}),a.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget},a.prototype.resetBudgets=function(){for(var e=this._budgets,t=e.length,r=0;r<t;++r){var i=e[r];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0},a.prototype.execute=function(e,t){var r=this._budgets,i=r[t],n=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&n)return i.starvedThisFrame=!0,!1;var o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){for(var s=r.length,l=0;l<s&&(o=r[l],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total)||o.starvedLastFrame);++l);if(l===s&&n)return!1;n&&(i.starvedThisFrame=!0)}var u=a.getTimestamp();e.execute();var c=a.getTimestamp()-u;return this._totalUsedThisFrame+=c,o?o.stolenFromMeThisFrame+=c:i.usedThisFrame+=c,this._executedThisFrame[t]=!0,!0},a}),define("Scene/MapboxImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/MapboxApi","./UrlTemplateImageryProvider"],function(e,t,r,i,n,o,a){"use strict";function s(i){i=t(i,t.EMPTY_OBJECT);var n=i.mapId,s=t(i.url,"https://api.mapbox.com/v4/");this._url=s,this._mapId=n,this._accessToken=o.getAccessToken(i.accessToken),this._accessTokenErrorCredit=o.getErrorCredit(i.accessToken);var d=t(i.format,"png");/\./.test(d)||(d="."+d),this._format=d;var h=s;if(l.test(s)||(h+="/"),h+=n+"/{z}/{x}/{y}"+this._format,r(this._accessToken)&&(h+="?access_token="+this._accessToken),r(i.credit)){var p=i.credit;"string"==typeof p&&(p=new e(p)),u=p,c.length=0}this._imageryProvider=new a({url:h,proxy:i.proxy,credit:u,ellipsoid:i.ellipsoid,minimumLevel:i.minimumLevel,maximumLevel:i.maximumLevel,rectangle:i.rectangle})}var l=/\/$/,u=new e("© Mapbox © OpenStreetMap",void 0,"https://www.mapbox.com/about/maps/"),c=[new e("Improve this map",void 0,"https://www.mapbox.com/map-feedback/")];return i(s.prototype,{url:{get:function(){return this._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}}}),s.prototype.getTileCredits=function(e,t,i){var n=c.slice();return r(this._accessTokenErrorCredit)&&n.push(this._accessTokenErrorCredit),n},s.prototype.requestImage=function(e,t,r){return this._imageryProvider.requestImage(e,t,r); +},s.prototype.pickFeatures=function(e,t,r,i,n){return this._imageryProvider.pickFeatures(e,t,r,i,n)},s}),define("Scene/Moon",["../Core/buildModuleUrl","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/IauOrientationAxes","../Core/Matrix3","../Core/Matrix4","../Core/Simon1994PlanetaryPositions","../Core/Transforms","./EllipsoidPrimitive","./Material"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t){t=r(t,r.EMPTY_OBJECT);var n=t.textureUrl;i(n)||(n=e("Assets/Textures/moonSmall.jpg")),this.show=r(t.show,!0),this.textureUrl=n,this._ellipsoid=r(t.ellipsoid,a.MOON),this.onlySunLighting=r(t.onlySunLighting,!0),this._ellipsoidPrimitive=new h({radii:this.ellipsoid.radii,material:p.fromType(p.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new s}n(f.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var m=new l,g=new l,v=new t,_=[];return f.prototype.update=function(e){if(this.show){var t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;var r=e.time;i(d.computeIcrfToFixedMatrix(r,m))||d.computeTemeToPseudoFixedMatrix(r,m);var n=this._axes.evaluate(r,g);l.transpose(n,n),l.multiply(m,n,n);var o=c.computeMoonPositionInEarthInertialFrame(r,v);l.multiplyByVector(m,o,o),u.fromRotationTranslation(n,o,t.modelMatrix);var a=e.commandList;return e.commandList=_,_.length=0,t.update(e),e.commandList=a,1===_.length?_[0]:void 0}},f.prototype.isDestroyed=function(){return!1},f.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),o(this)},f}),define("Scene/NeverTileDiscardPolicy",[],function(){"use strict";function e(e){}return e.prototype.isReady=function(){return!0},e.prototype.shouldDiscardImage=function(e){return!1},e}),define("Shaders/AdjustTranslucentFS",[],function(){"use strict";return"#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"}),define("Shaders/CompositeOITFS",[],function(){"use strict";return"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"}),define("Scene/OIT",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderSource","../Renderer/Texture","../Shaders/AdjustTranslucentFS","../Shaders/CompositeOITFS","./BlendEquation","./BlendFunction"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(r){this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;var i=r.floatingPointTexture&&r.depthTexture;this._translucentMRTSupport=r.drawBuffers&&i,this._translucentMultipassSupport=!this._translucentMRTSupport&&i,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 a({color:new t(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new a({color:new t(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new a({color:new t(0,0,0,0),owner:this}),this._alphaClearCommand=new a({color:new t(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 e,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0}function _(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function y(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 b(e){_(e),y(e)}function C(e,t,r,i){_(e);var o=new Float32Array(r*i*4);e._accumulationTexture=new h({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:r,height:i}}),e._revealageTexture=new h({context:t,pixelFormat:n.RGBA,pixelDatatype:u.FLOAT,source:{arrayBufferView:o,width:r,height:i}})}function w(e,t){y(e);var r=o.FRAMEBUFFER_COMPLETE,i=!0;if(e._translucentMRTSupport&&(e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture,e._revealageTexture],destroyAttachments:!1}),e._translucentFBO.status===r&&e._adjustTranslucentFBO.status===r||(y(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._alphaFBO=new l({context:t,colorTextures:[e._revealageTexture],depthStencilTexture:e._depthStencilTexture,destroyAttachments:!1}),e._adjustTranslucentFBO=new l({context:t,colorTextures:[e._accumulationTexture],destroyAttachments:!1}),e._adjustAlphaFBO=new l({context:t,colorTextures:[e._revealageTexture],destroyAttachments:!1});var n=e._translucentFBO.status===r,a=e._alphaFBO.status===r,s=e._adjustTranslucentFBO.status===r,u=e._adjustAlphaFBO.status===r;n&&a&&s&&u||(b(e),e._translucentMultipassSupport=!1,i=!1)}return i}function S(e,t,i,n){var o=i[n.id];if(!r(o)){var a=c.getState(n);a.depthMask=!1,a.blending=t,o=c.fromCache(a),i[n.id]=o}return o}function E(e,t,r){return S(t,R,e._translucentRenderStateCache,r)}function T(e,t,r){return S(t,N,e._translucentRenderStateCache,r)}function x(e,t,r){return S(t,k,e._alphaRenderStateCache,r)}function P(e,t,i,n){var o=e.shaderCache.getDerivedShaderProgram(t,i);if(!r(o)){var a=t._attributeLocations,s=t.fragmentShaderSource.clone();s.sources=s.sources.map(function(e){return e=d.replaceMain(e,"czm_translucent_main"),e=e.replace(/gl_FragColor/g,"czm_gl_FragColor"),e=e.replace(/\bdiscard\b/g,"czm_discard = true"),e=e.replace(/czm_phong/g,"czm_translucentPhong")}),s.sources.splice(0,0,(n.indexOf("gl_FragData")!==-1?"#extension GL_EXT_draw_buffers : enable \n":"")+"vec4 czm_gl_FragColor;\nbool czm_discard = false;\n"),s.sources.push("void main()\n{\n czm_translucent_main();\n if (czm_discard)\n {\n discard;\n }\n"+n+"}\n"),o=e.shaderCache.createDerivedShaderProgram(t,i,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:s,attributeLocations:a})}return o}function A(e,t){return P(e,t,"translucentMRT",L)}function D(e,t){return P(e,t,"translucentMultipass",F)}function I(e,t){return P(e,t,"alphaMultipass",B)}function M(e,t,r,i,n){var o,a,s,l=t.context,u=i.framebuffer,c=n.length,d=t.frameState.shadowHints.shadowsEnabled;i.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(l,i),i.framebuffer=e._adjustAlphaFBO,e._adjustAlphaCommand.execute(l,i);var h=e._opaqueFBO;for(i.framebuffer=e._translucentFBO,s=0;s<c;++s)o=n[s],a=d&&o.receiveShadows?o.derivedCommands.oit.shadows.translucentCommand:o.derivedCommands.oit.translucentCommand,r(a,t,l,i,h);for(i.framebuffer=e._alphaFBO,s=0;s<c;++s)o=n[s],a=d&&o.receiveShadows?o.derivedCommands.oit.shadows.alphaCommand:o.derivedCommands.oit.alphaCommand,r(a,t,l,i,h);i.framebuffer=u}function O(e,t,r,i,n){var o=t.context,a=i.framebuffer,s=n.length,l=t.frameState.shadowHints.shadowsEnabled;i.framebuffer=e._adjustTranslucentFBO,e._adjustTranslucentCommand.execute(o,i);var u=e._opaqueFBO;i.framebuffer=e._translucentFBO;for(var c=0;c<s;++c){var d=n[c],h=l&&d.receiveShadows?d.derivedCommands.oit.shadows.translucentCommand:d.derivedCommands.oit.translucentCommand;r(h,t,o,i,u)}i.framebuffer=a}v.prototype.update=function(t,i,n){if(this.isSupported()){this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.depthStencilTexture;var o=this._opaqueTexture.width,a=this._opaqueTexture.height,s=this._accumulationTexture,l=!r(s)||s.width!==o||s.height!==a;if(l&&C(this,t,o,a),r(this._translucentFBO)&&!l||w(this,t)){var u,h,m=this;r(this._compositeCommand)||(u=new d({sources:[f]}),this._translucentMRTSupport&&u.defines.push("MRT"),h={u_opaque:function(){return m._opaqueTexture},u_accumulation:function(){return m._accumulationTexture},u_revealage:function(){return m._revealageTexture}},this._compositeCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this})),r(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(u=new d({defines:["MRT"],sources:[p]}),h={u_bgColor:function(){return m._translucentMRTClearCommand.color},u_depthTexture:function(){return m._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this})):this._translucentMultipassSupport&&(u=new d({sources:[p]}),h={u_bgColor:function(){return m._translucentMultipassClearCommand.color},u_depthTexture:function(){return m._depthStencilTexture}},this._adjustTranslucentCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this}),h={u_bgColor:function(){return m._alphaClearCommand.color},u_depthTexture:function(){return m._depthStencilTexture}},this._adjustAlphaCommand=t.createViewportQuadCommand(u,{uniformMap:h,owner:this}))),this._viewport.width=o,this._viewport.height=a;var g=!e.equals(this._viewport,i.viewport),v=g!==this._useScissorTest;this._useScissorTest=g,e.equals(this._scissorRectangle,i.viewport)||(this._scissorRectangle=e.clone(i.viewport,this._scissorRectangle),v=!0),r(this._rs)&&e.equals(this._viewport,this._rs.viewport)&&!v||(this._rs=c.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),r(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),r(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)}}};var R={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},N={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:g.ONE,functionDestinationRgb:g.ONE,functionSourceAlpha:g.ONE,functionDestinationAlpha:g.ONE},k={enabled:!0,color:new t(0,0,0,0),equationRgb:m.ADD,equationAlpha:m.ADD,functionSourceRgb:g.ZERO,functionDestinationRgb:g.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:g.ZERO,functionDestinationAlpha:g.ONE_MINUS_SOURCE_ALPHA},L=" 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",F=" 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",B=" float ai = czm_gl_FragColor.a;\n gl_FragColor = vec4(ai);\n";return v.prototype.createDerivedCommands=function(e,t,i){if(r(i)||(i={}),this._translucentMRTSupport){var n,o;r(i.translucentCommand)&&(n=i.translucentCommand.shaderProgram,o=i.translucentCommand.renderState),i.translucentCommand=s.shallowClone(e,i.translucentCommand),r(n)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=n,i.translucentCommand.renderState=o):(i.translucentCommand.shaderProgram=A(t,e.shaderProgram),i.translucentCommand.renderState=E(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)}else{var a,l,u,c;r(i.translucentCommand)&&(a=i.translucentCommand.shaderProgram,l=i.translucentCommand.renderState,u=i.alphaCommand.shaderProgram,c=i.alphaCommand.renderState),i.translucentCommand=s.shallowClone(e,i.translucentCommand),i.alphaCommand=s.shallowClone(e,i.alphaCommand),r(a)&&i.shaderProgramId===e.shaderProgram.id?(i.translucentCommand.shaderProgram=a,i.translucentCommand.renderState=l,i.alphaCommand.shaderProgram=u,i.alphaCommand.renderState=c):(i.translucentCommand.shaderProgram=D(t,e.shaderProgram),i.translucentCommand.renderState=T(this,t,e.renderState),i.alphaCommand.shaderProgram=I(t,e.shaderProgram),i.alphaCommand.renderState=x(this,t,e.renderState),i.shaderProgramId=e.shaderProgram.id)}return i},v.prototype.executeCommands=function(e,t,r,i){return this._translucentMRTSupport?void O(this,e,t,r,i):void M(this,e,t,r,i)},v.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)},v.prototype.clear=function(e,r,i){var n=r.framebuffer;r.framebuffer=this._opaqueFBO,t.clone(i,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,r),r.framebuffer=this._translucentFBO;var o=this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand;o.execute(e,r),this._translucentMultipassSupport&&(r.framebuffer=this._alphaFBO,this._alphaClearCommand.execute(e,r)),r.framebuffer=n},v.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return b(this),r(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),r(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),r(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),i(this)},v}),define("Widgets/getElement",["../Core/DeveloperError"],function(e){"use strict";function t(e){if("string"==typeof e){var t=document.getElementById(e);e=t}return e}return t}),define("Scene/PerformanceDisplay",["../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/getTimestamp","../Widgets/getElement"],function(e,t,r,i,n,o){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT);var r=o(t.container);this._container=r;var i=document.createElement("div");i.className="cesium-performanceDisplay";var a=document.createElement("div");a.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),a.appendChild(this._fpsText);var s=document.createElement("div");s.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),s.appendChild(this._msText),i.appendChild(s),i.appendChild(a),this._container.appendChild(i),this._lastFpsSampleTime=n(),this._lastMsSampleTime=n(),this._fpsFrameCount=0,this._msFrameCount=0}return a.prototype.update=function(){var e=n();this._fpsFrameCount++;var t=e-this._lastFpsSampleTime;if(t>1e3){var r=1e3*this._fpsFrameCount/t|0;this._fpsText.nodeValue=r+" FPS",this._lastFpsSampleTime=e,this._fpsFrameCount=0}this._msFrameCount++;var i=e-this._lastMsSampleTime;i>200&&(this._msText.nodeValue=(i/this._msFrameCount).toFixed(2)+" MS",this._lastMsSampleTime=e,this._msFrameCount=0)},a.prototype.destroy=function(){return r(this)},a}),define("Scene/PickDepth",["../Core/defined","../Core/destroyObject","../Core/PixelFormat","../Renderer/Framebuffer","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/Texture"],function(e,t,r,i,n,o,a){"use strict";function s(){this.framebuffer=void 0,this._depthTexture=void 0,this._textureToCopy=void 0,this._copyDepthCommand=void 0,this._debugPickDepthViewportCommand=void 0}function l(t,r,i){if(!e(t._debugPickDepthViewportCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n float z_window = czm_unpackDepth(texture2D(u_texture, v_textureCoordinates));\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";t._debugPickDepthViewportCommand=r.createViewportQuadCommand(n,{uniformMap:{u_texture:function(){return t._depthTexture}},owner:t})}t._debugPickDepthViewportCommand.execute(r,i)}function u(e){e._depthTexture=e._depthTexture&&!e._depthTexture.isDestroyed()&&e._depthTexture.destroy()}function c(e){e.framebuffer=e.framebuffer&&!e.framebuffer.isDestroyed()&&e.framebuffer.destroy()}function d(e,t,i,o){e._depthTexture=new a({context:t,width:i,height:o,pixelFormat:r.RGBA,pixelDatatype:n.UNSIGNED_BYTE})}function h(e,t,r,n){u(e),c(e),d(e,t,r,n),e.framebuffer=new i({context:t,colorTextures:[e._depthTexture],destroyAttachments:!1})}function p(t,r,i){var n=i.width,o=i.height,a=t._depthTexture,s=!e(a)||a.width!==n||a.height!==o;e(t.framebuffer)&&!s||h(t,r,n,o)}function f(t,r,i){if(!e(t._copyDepthCommand)){var n="uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\n gl_FragColor = czm_packDepth(texture2D(u_texture, v_textureCoordinates).r);\n}\n";t._copyDepthCommand=r.createViewportQuadCommand(n,{renderState:o.fromCache(),uniformMap:{u_texture:function(){return t._textureToCopy}},owner:t})}t._textureToCopy=i,t._copyDepthCommand.framebuffer=t.framebuffer}return s.prototype.executeDebugPickDepth=function(e,t){l(this,e,t)},s.prototype.update=function(e,t){p(this,e,t),f(this,e,t)},s.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return u(this),c(this),this._copyDepthCommand.shaderProgram=e(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy(),t(this)},s}),define("Scene/PrimitiveCollection",["../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError"],function(e,t,r,i,n,o){"use strict";function a(r){r=t(r,t.EMPTY_OBJECT),this._primitives=[],this._guid=e(),this.show=t(r.show,!0),this.destroyPrimitives=t(r.destroyPrimitives,!0)}function s(e,t){return e._primitives.indexOf(t)}return i(a.prototype,{length:{get:function(){return this._primitives.length}}}),a.prototype.add=function(e){var t=e._external=e._external||{},r=t._composites=t._composites||{};return r[this._guid]={collection:this},this._primitives.push(e),e},a.prototype.remove=function(e){if(this.contains(e)){var t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),!0}return!1},a.prototype.removeAndDestroy=function(e){var t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t},a.prototype.removeAll=function(){if(this.destroyPrimitives)for(var e=this._primitives,t=e.length,r=0;r<t;++r)e[r].destroy();this._primitives=[]},a.prototype.contains=function(e){return!!(r(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])},a.prototype.raise=function(e){if(r(e)){var t=s(this,e),i=this._primitives;if(t!==i.length-1){var n=i[t];i[t]=i[t+1],i[t+1]=n}}},a.prototype.raiseToTop=function(e){if(r(e)){var t=s(this,e),i=this._primitives;t!==i.length-1&&(i.splice(t,1),i.push(e))}},a.prototype.lower=function(e){if(r(e)){var t=s(this,e),i=this._primitives;if(0!==t){var n=i[t];i[t]=i[t-1],i[t-1]=n}}},a.prototype.lowerToBottom=function(e){if(r(e)){var t=s(this,e),i=this._primitives;0!==t&&(i.splice(t,1),i.unshift(e))}},a.prototype.get=function(e){return this._primitives[e]},a.prototype.update=function(e){if(this.show)for(var t=this._primitives,r=0;r<t.length;++r)t[r].update(e)},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){return this.removeAll(),n(this)},a}),define("Scene/QuadtreeTileProvider",["../Core/defineProperties","../Core/DeveloperError"],function(e,t){"use strict";function r(){t.throwInstantiationError()}return r.computeDefaultLevelZeroMaximumGeometricError=function(e){return 2*e.ellipsoid.maximumRadius*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))},e(r.prototype,{quadtree:{get:t.throwInstantiationError,set:t.throwInstantiationError},ready:{get:t.throwInstantiationError},tilingScheme:{get:t.throwInstantiationError},errorEvent:{get:t.throwInstantiationError}}),r.prototype.beginUpdate=t.throwInstantiationError,r.prototype.endUpdate=t.throwInstantiationError,r.prototype.getLevelMaximumGeometricError=t.throwInstantiationError,r.prototype.loadTile=t.throwInstantiationError,r.prototype.computeTileVisibility=t.throwInstantiationError,r.prototype.showTileThisFrame=t.throwInstantiationError,r.prototype.computeDistanceToTile=t.throwInstantiationError,r.prototype.isDestroyed=t.throwInstantiationError,r.prototype.destroy=t.throwInstantiationError,r}),define("Scene/SceneTransitioner",["../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/EasingFunction","../Core/Math","../Core/Matrix4","../Core/Ray","../Core/ScreenSpaceEventHandler","../Core/ScreenSpaceEventType","../Core/Transforms","./Camera","./OrthographicFrustum","./OrthographicOffCenterFrustum","./PerspectiveFrustum","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g){"use strict";function v(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}function _(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new u(e._scene.canvas,!1);var r=function(){e._morphCancelled=!0,t(e)};e._completeMorph=r,e._morphHandler.setInputAction(r,c.LEFT_DOWN),e._morphHandler.setInputAction(r,c.MIDDLE_DOWN),e._morphHandler.setInputAction(r,c.RIGHT_DOWN),e._morphHandler.setInputAction(r,c.WHEEL)}}function y(e){for(var t=e._currentTweens,r=0;r<t.length;++r)t[r].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}function b(e,t){var r=e._scene,i=r.camera,n=Q,o=n.position,a=n.direction,l=n.up,u=r.mapProjection.unproject(i.position,q);t.cartographicToCartesian(u,o);var c=t.scaleToGeodeticSurface(o,Y),h=d.eastNorthUpToFixedFrame(c,t,X);return s.multiplyByPointAsVector(h,i.direction,a),s.multiplyByPointAsVector(h,i.up,l),n}function C(t,r,i,n){function a(t){S(c,f,t.time,u.position),S(d,m,t.time,u.direction),S(p,g,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right)}r*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,Z),d=e.clone(u.direction,K),p=e.clone(u.up,J),f=s.multiplyByPoint(h.TRANSFORM_2D_INVERSE,i.position,$),m=s.multiplyByPointAsVector(h.TRANSFORM_2D_INVERSE,i.direction,ee),g=s.multiplyByPointAsVector(h.TRANSFORM_2D_INVERSE,i.up,te),v=l.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){I(t,l,0,1,r,n)}});t._currentTweens.push(v)}function w(t,r,i){function n(t){S(p,v,t.time,u.position),S(f,y,t.time,u.direction),S(m,w,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right);var r=u.frustum;r.right=a.lerp(E,T,t.time),r.left=-r.right,r.top=r.right*(l.drawingBufferHeight/l.drawingBufferWidth),r.bottom=-r.top,u.position.z=2*l.mapProjection.ellipsoid.maximumRadius}r/=3;var s,l=t._scene,u=l.camera;r>0?(s=Q,e.fromDegrees(0,0,5*i.maximumRadius,i,s.position),e.negate(s.position,s.direction),e.normalize(s.direction,s.direction),e.clone(e.UNIT_Z,s.up)):(u.position.z=u.frustum.right-u.frustum.left,s=b(t,i));var c;t._morphToOrthographic?(c=ie,c.aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight,c.width=u.frustum.right-u.frustum.left):(c=re,c.aspectRatio=l.drawingBufferWidth/l.drawingBufferHeight,c.fov=a.toRadians(60)),s.frustum=c;var d=M(s);_(t,d);var h,p=e.clone(u.position,Ce),f=e.clone(u.direction,we),m=e.clone(u.up,Se),v=e.fromElements(0,0,5*i.maximumRadius,Ee),y=e.negate(e.UNIT_Z,Te),w=e.clone(e.UNIT_Y,xe),E=u.frustum.right,T=.5*v.z;if(h=t._morphToOrthographic?function(){C(t,r,s,d)}:function(){P(t,r,s,function(){C(t,r,s,d)})},r>0){var x=l.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){l._mode=g.MORPHING,h()}});t._currentTweens.push(x)}else h()}function S(t,r,i,n){return e.lerp(t,r,i,n)}function E(e,t,r,i,n){function s(e){u.frustum.fov=a.lerp(c,d,e.time);var t=h/Math.tan(.5*u.frustum.fov);i(u,t)}var l=e._scene,u=l.camera;if(!(u.frustum instanceof p)){var c=u.frustum.fov,d=.5*a.RADIANS_PER_DEGREE,h=r.position.z*Math.tan(.5*c);u.frustum.far=h/Math.tan(.5*d)+1e7;var f=l.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:s,complete:function(){u.frustum=r.frustum.clone(),n(e)}});e._currentTweens.push(f)}}function T(t,i){function n(t){S(c,g,t.time,u.position),S(d,f,t.time,u.direction),S(p,m,t.time,u.up),e.cross(u.direction,u.up,u.right),e.normalize(u.right,u.right),u._adjustOrthographicFrustum(!0)}function a(e,t){e.position.z=t}i*=.5;var l=t._scene,u=l.camera,c=e.clone(u.position,ne),d=e.clone(u.direction,oe),p=e.clone(u.up,ae),f=e.negate(e.UNIT_Z,le),m=e.clone(e.UNIT_Y,ue),g=se;if(i>0)e.clone(e.ZERO,se),g.z=5*l.mapProjection.ellipsoid.maximumRadius;else{e.clone(c,se);var v=de;s.multiplyByPoint(h.TRANSFORM_2D,c,v.origin),s.multiplyByPointAsVector(h.TRANSFORM_2D,d,v.direction);var y=l.globe;if(r(y)){var b=y.pick(v,l,he);r(b)&&(s.multiplyByPoint(h.TRANSFORM_2D_INVERSE,b,g),g.z+=e.distance(c,g))}}var C=ce;C.right=.5*g.z,C.left=-C.right,C.top=C.right*(l.drawingBufferHeight/l.drawingBufferWidth),C.bottom=-C.top;var w=pe;w.position=g,w.direction=f,w.up=m,w.frustum=C;var T=O(w);_(t,T);var x=l.tweens.add({duration:i,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){E(t,i,w,a,T)}});t._currentTweens.push(x)}function x(t,i,n){function o(e,t){e.position.x=t}function a(){E(t,i,c,o,S)}i*=.5;var l=t._scene,u=l.camera,c=me;if(i>0)e.clone(e.ZERO,c.position),c.position.z=5*n.maximumRadius,e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);else{n.cartesianToCartographic(u.positionWC,fe),l.mapProjection.project(fe,c.position),e.negate(e.UNIT_Z,c.direction),e.clone(e.UNIT_Y,c.up);var p=_e;e.clone(c.position2D,p.origin);var f=e.clone(u.directionWC,p.direction),m=n.scaleToGeodeticSurface(u.positionWC,be),g=d.eastNorthUpToFixedFrame(m,n,ye);s.inverseTransformation(g,g),s.multiplyByPointAsVector(g,f,f),s.multiplyByPointAsVector(h.TRANSFORM_2D,f,f);var v=l.globe;if(r(v)){var y=v.pick(p,l,ve);if(r(y)){var b=e.distance(c.position2D,y);y.x+=b,e.clone(y,c.position2D)}}}s.multiplyByPoint(h.TRANSFORM_2D,c.position,c.position2D),s.multiplyByPointAsVector(h.TRANSFORM_2D,c.direction,c.direction2D),s.multiplyByPointAsVector(h.TRANSFORM_2D,c.up,c.up2D);var C=c.frustum;C.right=.5*c.position.z,C.left=-C.right,C.top=C.right*(l.drawingBufferHeight/l.drawingBufferWidth),C.bottom=-C.top;var w=ge;s.multiplyByPoint(h.TRANSFORM_2D_INVERSE,c.position2D,w.position),e.clone(c.direction,w.direction),e.clone(c.up,w.up),w.frustum=C;var S=O(w);_(t,S),D(t,i,c,a)}function P(e,t,r,i){function n(e){l.frustum.fov=a.lerp(d,c,e.time),l.position.z=h/Math.tan(.5*l.frustum.fov)}var s=e._scene,l=s.camera,u=l.frustum.right-l.frustum.left;l.frustum=r.frustum.clone();var c=l.frustum.fov,d=.5*a.RADIANS_PER_DEGREE,h=u*Math.tan(.5*c);l.frustum.far=h/Math.tan(.5*d)+1e7,l.frustum.fov=d;var p=s.tweens.add({duration:t,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:n,complete:function(){i(e)}});e._currentTweens.push(p)}function A(t,r,i,n){function a(){function a(t){S(h,u,t.time,l.position),S(p,c,t.time,l.direction),S(f,d,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right)}l.frustum=i.frustum.clone();var h=e.clone(l.position,Ce),p=e.clone(l.direction,we),f=e.clone(l.up,Se);h.z=u.z;var m=s.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){n(t)}});t._currentTweens.push(m)}r*=.5;var s=t._scene,l=s.camera,u=e.clone(i.position,Ee),c=e.clone(i.direction,Te),d=e.clone(i.up,xe);s._mode=g.MORPHING,t._morphToOrthographic?a():P(t,0,i,a)}function D(t,r,i,n){function a(t){S(u,h,t.time,l.position),S(c,p,t.time,l.direction),S(d,f,t.time,l.up),e.cross(l.direction,l.up,l.right),e.normalize(l.right,l.right),l._adjustOrthographicFrustum(!0)}var s=t._scene,l=s.camera,u=e.clone(l.position,Ce),c=e.clone(l.direction,we),d=e.clone(l.up,Se),h=e.clone(i.position2D,Ee),p=e.clone(i.direction2D,Te),f=e.clone(i.up2D,xe),m=s.tweens.add({duration:r,easingFunction:o.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:a,complete:function(){I(t,s,1,0,r,n)}});t._currentTweens.push(m)}function I(e,t,i,n,a,s){var l={object:t,property:"morphTime",startValue:i,stopValue:n,duration:a,easingFunction:o.QUARTIC_OUT};r(s)&&(l.complete=function(){s(e)});var u=t.tweens.addProperty(l);e._currentTweens.push(u)}function M(t){return function(i){var n=i._scene;if(n._mode=g.SCENE3D,n.morphTime=g.getMorphTime(g.SCENE3D),y(i),i._previousMode!==g.MORPHING||i._morphCancelled){i._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),o.frustum=t.frustum.clone()}var a=r(i._completeMorph);i._completeMorph=void 0,n.camera.update(n.mode),i._scene.morphComplete.raiseEvent(i,i._previousMode,g.SCENE3D,a)}}function O(t){return function(i){var n=i._scene;n._mode=g.SCENE2D,n.morphTime=g.getMorphTime(g.SCENE2D),y(i);var o=n.camera;e.clone(t.position,o.position),o.position.z=2*n.mapProjection.ellipsoid.maximumRadius,e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right),o.frustum=t.frustum.clone();var a=r(i._completeMorph);i._completeMorph=void 0,n.camera.update(n.mode),i._scene.morphComplete.raiseEvent(i,i._previousMode,g.SCENE2D,a)}}function R(t){return function(i){var n=i._scene;if(n._mode=g.COLUMBUS_VIEW,n.morphTime=g.getMorphTime(g.COLUMBUS_VIEW),y(i),i._previousModeMode!==g.MORPHING||i._morphCancelled){i._morphCancelled=!1;var o=n.camera;e.clone(t.position,o.position),e.clone(t.direction,o.direction),e.clone(t.up,o.up),e.cross(o.direction,o.up,o.right),e.normalize(o.right,o.right)}var a=r(i._completeMorph);i._completeMorph=void 0,n.camera.update(n.mode),i._scene.morphComplete.raiseEvent(i,i._previousMode,g.COLUMBUS_VIEW,a)}}v.prototype.completeMorph=function(){r(this._completeMorph)&&this._completeMorph()},v.prototype.morphTo2D=function(e,t){r(this._completeMorph)&&this._completeMorph();var i=this._scene;this._previousMode=i.mode,this._morphToOrthographic=i.camera.frustum instanceof p,this._previousMode!==g.SCENE2D&&this._previousMode!==g.MORPHING&&(this._scene.morphStart.raiseEvent(this,this._previousMode,g.SCENE2D,!0),i._mode=g.MORPHING,i.camera._setTransform(s.IDENTITY),this._previousMode===g.COLUMBUS_VIEW?T(this,e):x(this,e,t), +0===e&&r(this._completeMorph)&&this._completeMorph())};var N=new e,k=new e,L=new e,F=new e,B=new e,U=new e,V=new e,z=new t,G=new s,H=new m,W=new p,j={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};v.prototype.morphToColumbusView=function(t,i){r(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==g.COLUMBUS_VIEW&&this._previousMode!==g.MORPHING){this._scene.morphStart.raiseEvent(this,this._previousMode,g.COLUMBUS_VIEW,!0),n.camera._setTransform(s.IDENTITY);var o=N,l=k,u=L;if(t>0)o.x=0,o.y=-1,o.z=1,o=e.multiplyByScalar(e.normalize(o,o),5*i.maximumRadius,o),e.negate(e.normalize(o,l),l),e.cross(e.UNIT_X,l,u);else{var c=n.camera;if(this._previousMode===g.SCENE2D)e.clone(c.position,o),o.z=c.frustum.right-c.frustum.left,e.negate(e.UNIT_Z,l),e.clone(e.UNIT_Y,u);else{e.clone(c.positionWC,o),e.clone(c.directionWC,l),e.clone(c.upWC,u);var p=i.scaleToGeodeticSurface(o,V),f=d.eastNorthUpToFixedFrame(p,i,G);s.inverseTransformation(f,f),n.mapProjection.project(i.cartesianToCartographic(o,z),o),s.multiplyByPointAsVector(f,l,l),s.multiplyByPointAsVector(f,u,u)}}var m;this._morphToOrthographic?(m=W,m.width=n.camera.frustum.right-n.camera.frustum.left,m.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(m=H,m.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,m.fov=a.toRadians(60));var v=j;v.position=o,v.direction=l,v.up=u,v.frustum=m;var y=R(v);_(this,y),this._previousMode===g.SCENE2D?A(this,t,v,y):(v.position2D=s.multiplyByPoint(h.TRANSFORM_2D,o,F),v.direction2D=s.multiplyByPointAsVector(h.TRANSFORM_2D,l,B),v.up2D=s.multiplyByPointAsVector(h.TRANSFORM_2D,u,U),n._mode=g.MORPHING,D(this,t,v,y)),0===t&&r(this._completeMorph)&&this._completeMorph()}},v.prototype.morphTo3D=function(t,i){r(this._completeMorph)&&this._completeMorph();var n=this._scene;if(this._previousMode=n.mode,this._previousMode!==g.SCENE3D&&this._previousMode!==g.MORPHING){if(this._scene.morphStart.raiseEvent(this,this._previousMode,g.SCENE3D,!0),n._mode=g.MORPHING,n.camera._setTransform(s.IDENTITY),this._previousMode===g.SCENE2D)w(this,t,i);else{var o;t>0?(o=Q,e.fromDegrees(0,0,5*i.maximumRadius,i,o.position),e.negate(o.position,o.direction),e.normalize(o.direction,o.direction),e.clone(e.UNIT_Z,o.up)):o=b(this,i);var l,u=n.camera;u.frustum instanceof p?l=u.frustum.clone():(l=re,l.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,l.fov=a.toRadians(60)),o.frustum=l;var c=M(o);_(this,c),C(this,t,o,c)}0===t&&r(this._completeMorph)&&this._completeMorph()}},v.prototype.isDestroyed=function(){return!1},v.prototype.destroy=function(){return y(this),i(this)};var q=new t,Y=new e,X=new s,Q={position:new e,direction:new e,up:new e,frustum:void 0},Z=new e,K=new e,J=new e,$=new e,ee=new e,te=new e,re=new m,ie=new p,ne=new e,oe=new e,ae=new e,se=new e,le=new e,ue=new e,ce=new f,de=new l,he=new e,pe={position:void 0,direction:void 0,up:void 0,frustum:void 0},fe=new t,me={position:new e,direction:new e,up:new e,position2D:new e,direction2D:new e,up2D:new e,frustum:new f},ge={position:new e,direction:new e,up:new e,frustum:void 0},ve=new e,_e=new l,ye=new s,be=new e,Ce=new e,we=new e,Se=new e,Ee=new e,Te=new e,xe=new e;return v}),define("Scene/TweenCollection",["../Core/clone","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/EasingFunction","../Core/getTimestamp","../Core/TimeConstants","../ThirdParty/Tween"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t,r,i,n,o,a,s,l,u,c){this._tweens=t,this._tweenjs=r,this._startObject=e(i),this._stopObject=e(n),this._duration=o,this._delay=a,this._easingFunction=s,this._update=l,this._complete=u,this.cancel=c,this.needsStart=!0}function c(){this._tweens=[]}return i(u.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}}}),u.prototype.cancelTween=function(){this._tweens.remove(this)},i(c.prototype,{length:{get:function(){return this._tweens.length}}}),c.prototype.add=function(i){if(i=t(i,t.EMPTY_OBJECT),0===i.duration)return r(i.complete)&&i.complete(),new u(this);var n=i.duration/s.SECONDS_PER_MILLISECOND,a=t(i.delay,0),c=a/s.SECONDS_PER_MILLISECOND,d=t(i.easingFunction,o.LINEAR_NONE),h=i.startObject,p=new l.Tween(h);p.to(e(i.stopObject),n),p.delay(c),p.easing(d),r(i.update)&&p.onUpdate(function(){i.update(h)}),p.onComplete(t(i.complete,null)),p.repeat(t(i._repeat,0));var f=new u(this,p,i.startObject,i.stopObject,i.duration,a,d,i.update,i.complete,i.cancel);return this._tweens.push(f),f},c.prototype.addProperty=function(e){function r(e){i[n]=e.value}e=t(e,t.EMPTY_OBJECT);var i=e.object,n=e.property,o=e.startValue,a=e.stopValue;return this.add({startObject:{value:o},stopObject:{value:a},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})},c.prototype.addAlpha=function(e){function i(e){for(var t=o.length,r=0;r<t;++r)n.uniforms[o[r]].alpha=e.alpha}e=t(e,t.EMPTY_OBJECT);var n=e.material,o=[];for(var a in n.uniforms)n.uniforms.hasOwnProperty(a)&&r(n.uniforms[a])&&r(n.uniforms[a].alpha)&&o.push(a);return this.add({startObject:{alpha:t(e.startValue,0)},stopObject:{alpha:t(e.stopValue,1)},duration:t(e.duration,3),delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})},c.prototype.addOffsetIncrement=function(e){e=t(e,t.EMPTY_OBJECT);var r=e.material,i=r.uniforms;return this.addProperty({object:i,property:"offset",startValue:i.offset,stopValue:i.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})},c.prototype.remove=function(e){if(!r(e))return!1;var t=this._tweens.indexOf(e);return t!==-1&&(e.tweenjs.stop(),r(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0)},c.prototype.removeAll=function(){for(var e=this._tweens,t=0;t<e.length;++t){var i=e[t];i.tweenjs.stop(),r(i.cancel)&&i.cancel()}e.length=0},c.prototype.contains=function(e){return r(e)&&this._tweens.indexOf(e)!==-1},c.prototype.get=function(e){return this._tweens[e]},c.prototype.update=function(e){var t=this._tweens,i=0;for(e=r(e)?e/s.SECONDS_PER_MILLISECOND:a();i<t.length;){var n=t[i],o=n.tweenjs;n.needsStart?(n.needsStart=!1,o.start(e)):o.update(e)?i++:(o.stop(),t.splice(i,1))}},c}),define("Scene/ScreenSpaceCameraController",["../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/Ellipsoid","../Core/IntersectionTests","../Core/isArray","../Core/KeyboardEventModifier","../Core/Math","../Core/Matrix3","../Core/Matrix4","../Core/Plane","../Core/Quaternion","../Core/Ray","../Core/Transforms","./CameraEventAggregator","./CameraEventType","./MapMode2D","./OrthographicFrustum","./SceneMode","./SceneTransforms","./TweenCollection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T){"use strict";function x(r){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=b.LEFT_DRAG,this.zoomEventTypes=[b.RIGHT_DRAG,b.WHEEL,b.PINCH],this.rotateEventTypes=b.LEFT_DRAG,this.tiltEventTypes=[b.MIDDLE_DRAG,b.PINCH,{eventType:b.LEFT_DRAG,modifier:d.CTRL},{eventType:b.RIGHT_DRAG,modifier:d.CTRL}],this.lookEventTypes={eventType:b.LEFT_DRAG,modifier:d.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._scene=r,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new y(r.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._tweens=new T,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new e(-1,-1),this._tiltCenter=new t,this._rotateMousePosition=new e(-1,-1),this._rotateStartPosition=new t,this._strafeStartPosition=new t,this._zoomMouseStart=new e(-1,-1),this._zoomWorldPosition=new t,this._useZoomWorldPosition=!1,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._rotatingZoom=!1;var n=r.mapProjection;this._maxCoord=n.project(new i(Math.PI,h.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 P(e,t){if(e<0)return 0;var r=25*(1-t);return Math.exp(-r*e)}function A(t){return e.equalsEpsilon(t.startPosition,t.endPosition,h.EPSILON14)}function D(t,r,i,n,a,s,l){var u=s[l];o(u)||(u=s[l]={startPosition:new e,endPosition:new e,motion:new e,active:!1});var c=t.getButtonPressTime(r,i),d=t.getButtonReleaseTime(r,i),h=c&&d&&(d.getTime()-c.getTime())/1e3,p=new Date,f=d&&(p.getTime()-d.getTime())/1e3;if(c&&d&&h<ee){var m=P(f,n);if(u.active)u.startPosition=e.clone(u.endPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,m,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.motion=e.clone(e.ZERO,u.motion);else{var g=t.getLastMovement(r,i);if(!o(g)||A(g))return;u.motion.x=.5*(g.endPosition.x-g.startPosition.x),u.motion.y=.5*(g.endPosition.y-g.startPosition.y),u.startPosition=e.clone(g.startPosition,u.startPosition),u.endPosition=e.multiplyByScalar(u.motion,m,u.endPosition),u.endPosition=e.add(u.startPosition,u.endPosition,u.endPosition),u.active=!0}if(isNaN(u.endPosition.x)||isNaN(u.endPosition.y)||e.distance(u.startPosition,u.endPosition)<.5)return void(u.active=!1);if(!t.isButtonDown(r,i)){var v=t.getStartMousePosition(r,i);a(s,v,u)}}else u.active=!1}function I(e,t,r,i,n,a){if(o(r)){var s=e._aggregator;c(r)||(te[0]=r,r=te);for(var l=r.length,u=0;u<l;++u){var d=r[u],h=o(d.eventType)?d.eventType:d,p=d.modifier,f=s.isMoving(h,p)&&s.getMovement(h,p),m=s.getStartMousePosition(h,p);e.enableInputs&&t&&(f?i(e,m,f):n<1&&D(s,h,p,n,i,e,a))}}}function M(r,i,n,a,s,l){var u=1;o(l)&&(u=h.clamp(Math.abs(l),.25,1));var c=r.minimumZoomDistance*u,d=r.maximumZoomDistance,p=s-c,f=a*p;f=h.clamp(f,r._minimumZoomRate,r._maximumZoomRate);var m=n.endPosition.y-n.startPosition.y,g=m/r._scene.canvas.clientHeight;g=Math.min(g,r.maximumMovementRatio);var v=f*g;if(!(v>0&&Math.abs(s-c)<1||v<0&&Math.abs(s-d)<1)){s-v<c?v=s-c-1:s-v>d&&(v=s-d);var _=r._scene,y=_.camera,b=_.mode;if(y.frustum instanceof w)return void(Math.abs(v)>0&&(y.zoomIn(v),y._adjustOrthographicFrustum()));var C,T=e.equals(i,r._zoomMouseStart),x=r._zoomingOnVector,P=r._rotatingZoom;if(T||(r._zoomMouseStart=e.clone(i,r._zoomMouseStart),o(r._globe)&&(C=b!==S.SCENE2D?F(r,i,ie):y.getPickRay(i,re).origin),o(C)?(r._useZoomWorldPosition=!0,r._zoomWorldPosition=t.clone(C,r._zoomWorldPosition)):r._useZoomWorldPosition=!1,x=r._zoomingOnVector=!1,P=r._rotatingZoom=!1),!r._useZoomWorldPosition)return void y.zoomIn(v);var A=b===S.COLUMBUS_VIEW;if(y.positionCartographic.height<2e6&&(P=!0),!T||P){if(b===S.SCENE2D){var D=r._zoomWorldPosition,I=y.position;if(!t.equals(D,I)&&y.positionCartographic.height<2*r._maxCoord.x){var M=y.position.x,O=t.subtract(D,I,oe);t.normalize(O,O);var R=t.distance(D,I)*v/(.5*y.getMagnitude());y.move(O,.5*R),(y.position.x<0&&M>0||y.position.x>0&&M<0)&&(C=y.getPickRay(i,re).origin,r._zoomWorldPosition=t.clone(C,r._zoomWorldPosition))}}else if(b===S.SCENE3D){var N=t.normalize(y.position,de);if(y.positionCartographic.height<3e3&&Math.abs(t.dot(y.direction,N))<.6)A=!0;else{var k=_.canvas,L=ae;L.x=k.clientWidth/2,L.y=k.clientHeight/2;var B=F(r,L,se);if(o(B)&&y.positionCartographic.height<1e6){var U=pe;t.clone(y.position,U);var V=r._zoomWorldPosition,z=he;if(z=t.normalize(V,z),t.dot(z,N)<0)return;var G=Ce,H=ge;t.clone(y.direction,H),t.add(U,t.multiplyByScalar(H,1e3,we),G);var W=ve,j=_e;t.subtract(V,U,W),t.normalize(W,j);var q=t.dot(N,j);if(q>=0)return void(r._zoomMouseStart.x=-1);var Y=Math.acos(-q),X=t.magnitude(U),Q=t.magnitude(V),Z=X-v,K=t.magnitude(W),J=Math.asin(h.clamp(K/Q*Math.sin(Y),-1,1)),$=Math.asin(h.clamp(Z/Q*Math.sin(Y),-1,1)),ee=J-$+Y,te=fe;t.normalize(U,te);var Te=me;Te=t.cross(j,te,Te),Te=t.normalize(Te,Te),t.normalize(t.cross(te,Te,we),H),t.multiplyByScalar(t.normalize(G,we),t.magnitude(G)-v,G),t.normalize(U,U),t.multiplyByScalar(U,Z,U);var xe=ye;t.multiplyByScalar(t.add(t.multiplyByScalar(te,Math.cos(ee)-1,Se),t.multiplyByScalar(H,Math.sin(ee),Ee),we),Z,xe),t.add(U,xe,U),t.normalize(G,te),t.normalize(t.cross(te,Te,we),H);var Pe=be;return t.multiplyByScalar(t.add(t.multiplyByScalar(te,Math.cos(ee)-1,Se),t.multiplyByScalar(H,Math.sin(ee),Ee),we),t.magnitude(G),Pe),t.add(G,Pe,G),t.clone(U,y.position),t.normalize(t.subtract(G,U,we),y.direction),t.clone(y.direction,y.direction),t.cross(y.direction,y.up,y.right),void t.cross(y.right,y.direction,y.up)}if(o(B)){var Ae=t.normalize(B,le),De=t.normalize(r._zoomWorldPosition,ue),Ie=t.dot(De,Ae);if(Ie>0&&Ie<1){var Me=h.acosClamped(Ie),Oe=t.cross(De,Ae,ce),Re=Math.abs(Me)>h.toRadians(20)?.75*y.positionCartographic.height:y.positionCartographic.height-v,Ne=v/Re;y.rotate(Oe,Me*Ne)}}else A=!0}}r._rotatingZoom=!A}if(!T&&A||x){var ke,Le=E.wgs84ToWindowCoordinates(_,r._zoomWorldPosition,ne);ke=b!==S.COLUMBUS_VIEW&&e.equals(i,r._zoomMouseStart)&&o(Le)?y.getPickRay(Le,re):y.getPickRay(i,re);var Fe=ke.direction;b===S.COLUMBUS_VIEW&&t.fromElements(Fe.y,Fe.z,Fe.x,Fe),y.move(Fe,v),r._zoomingOnVector=!0}else y.zoomIn(v)}}function O(e,r,i){var n=e._scene,o=n.camera,a=o.getPickRay(i.startPosition,Te).origin,s=o.getPickRay(i.endPosition,xe).origin,l=t.subtract(a,s,Pe),u=t.magnitude(l);u>0&&(t.normalize(l,l),o.move(l,u))}function R(e,t,r){o(r.distance)&&(r=r.distance);var i=e._scene,n=i.camera;M(e,t,r,e._zoomFactor,n.getMagnitude())}function N(t,r,i){if(o(i.angleAndHeight))return void k(t,r,i.angleAndHeight);var n=t._scene,a=n.camera,s=n.canvas,l=s.clientWidth,u=s.clientHeight,c=Ae;c.x=2/l*i.startPosition.x-1,c.y=2/u*(u-i.startPosition.y)-1,c=e.normalize(c,c);var d=De;d.x=2/l*i.endPosition.x-1,d.y=2/u*(u-i.endPosition.y)-1,d=e.normalize(d,d);var p=h.acosClamped(c.x);c.y<0&&(p=h.TWO_PI-p);var f=h.acosClamped(d.x);d.y<0&&(f=h.TWO_PI-f);var m=f-p;a.twistRight(m)}function k(e,t,r){var i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);var n=e._scene,o=n.camera,a=n.canvas,s=(r.endPosition.x-r.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);var l=i*s*Math.PI*4;o.twistRight(l)}function L(e){var t=e._scene.mapMode2D===C.ROTATE;f.equals(f.IDENTITY,e._scene.camera.transform)?(I(e,e.enableTranslate,e.translateEventTypes,O,e.inertiaTranslate,"_lastInertiaTranslateMovement"),I(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&I(e,e.enableRotate,e.tiltEventTypes,N,e.inertiaSpin,"_lastInertiaTiltMovement")):(I(e,e.enableZoom,e.zoomEventTypes,R,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&I(e,e.enableRotate,e.translateEventTypes,N,e.inertiaSpin,"_lastInertiaSpinMovement"))}function F(e,r,i){var n=e._scene,a=e._globe,s=n.camera;if(o(a)){var l;n.pickPositionSupported&&(l=n.pickPositionWorldCoordinates(r,Me));var u=s.getPickRay(r,Ie),c=a.pick(u,n,Oe),d=o(l)?t.distance(l,s.positionWC):Number.POSITIVE_INFINITY,h=o(c)?t.distance(c,s.positionWC):Number.POSITIVE_INFINITY;return d<h?t.clone(l,i):t.clone(c,i)}}function B(r,i,n){if(t.equals(i,r._translateMousePosition)||(r._looking=!1),t.equals(i,r._strafeMousePosition)||(r._strafing=!1),r._looking)return void J(r,i,n);if(r._strafing)return void W(r,i,n);var a,s=r._scene,l=s.camera,c=e.clone(n.startPosition,Ve),d=e.clone(n.endPosition,ze),p=l.getPickRay(c,Re),f=t.clone(t.ZERO,Be),g=t.UNIT_X;if(l.position.z<r._minimumPickingTerrainHeight&&(a=F(r,c,ke),o(a)&&(f.x=a.x)),f.x>l.position.z&&o(a))return t.clone(a,r._strafeStartPosition),r._strafing=!0,W(r,i,n),void(r._strafeMousePosition=e.clone(i,r._strafeMousePosition));var v=m.fromPointNormal(f,g,Ue);p=l.getPickRay(c,Re);var _=u.rayPlane(p,v,ke),y=l.getPickRay(d,Ne),b=u.rayPlane(y,v,Le);if(!o(_)||!o(b))return r._looking=!0,J(r,i,n),void e.clone(i,r._translateMousePosition);var C=t.subtract(_,b,Fe),w=C.x;C.x=C.y,C.y=C.z,C.z=w;var S=t.magnitude(C);S>h.EPSILON6&&(t.normalize(C,C),l.move(C,S))}function U(t,r,i){if(o(i.angleAndHeight)&&(i=i.angleAndHeight),e.equals(r,t._tiltCenterMousePosition)||(t._tiltCVOffMap=!1,t._looking=!1),t._looking)return void J(t,r,i);var n=t._scene,a=n.camera,s=t._maxCoord,l=Math.abs(a.position.x)-s.x<0&&Math.abs(a.position.y)-s.y<0;t._tiltCVOffMap||!l||a.position.z>t._minimumPickingTerrainHeight?(t._tiltCVOffMap=!0,V(t,r,i)):z(t,r,i)}function V(r,i,n){var a=r._scene,s=a.camera,u=a.canvas,c=Ge;c.x=u.clientWidth/2,c.y=u.clientHeight/2;var d,p=s.getPickRay(c,He),m=t.UNIT_X,g=p.origin,v=p.direction,y=t.dot(m,v);if(Math.abs(y)>h.EPSILON6&&(d=-t.dot(m,g)/y),!o(d)||d<=0)return r._looking=!0,J(r,i,n),void e.clone(i,r._tiltCenterMousePosition);var b=t.multiplyByScalar(v,d,We);t.add(g,b,b);var C=a.mapProjection,w=C.ellipsoid;t.fromElements(b.y,b.z,b.x,b);var S=C.unproject(b,Ke);w.cartographicToCartesian(S,b);var E=_.eastNorthUpToFixedFrame(b,w,qe),T=r._globe,x=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var P=f.clone(s.transform,Je);s._setTransform(E),q(r,i,n,t.UNIT_Z),s._setTransform(P),r._globe=T,r._ellipsoid=x;var A=x.maximumRadius;r._rotateFactor=1/A,r._rotateRateRangeAdjustment=A}function z(r,i,n){var a,s,c=r._scene,d=c.camera,v=t.UNIT_X;if(e.equals(i,r._tiltCenterMousePosition))a=t.clone(r._tiltCenter,We);else{if(d.position.z<r._minimumPickingTerrainHeight&&(a=F(r,i,We)),!o(a)){s=d.getPickRay(i,He);var y,b=s.origin,C=s.direction,w=t.dot(v,C);if(Math.abs(w)>h.EPSILON6&&(y=-t.dot(v,b)/w),!o(y)||y<=0)return r._looking=!0,J(r,i,n),void e.clone(i,r._tiltCenterMousePosition);a=t.multiplyByScalar(C,y,We),t.add(b,a,a)}e.clone(i,r._tiltCenterMousePosition),t.clone(a,r._tiltCenter)}var S=c.canvas,E=Ge;E.x=S.clientWidth/2,E.y=r._tiltCenterMousePosition.y,s=d.getPickRay(E,He);var T=t.clone(t.ZERO,Xe);T.x=a.x;var x=m.fromPointNormal(T,v,Qe),P=u.rayPlane(s,x,je),A=d._projection,D=A.ellipsoid;t.fromElements(a.y,a.z,a.x,a);var I=A.unproject(a,Ke);D.cartographicToCartesian(I,a);var M,O=_.eastNorthUpToFixedFrame(a,D,qe);o(P)?(t.fromElements(P.y,P.z,P.x,P),I=A.unproject(P,Ke),D.cartographicToCartesian(I,P),M=_.eastNorthUpToFixedFrame(P,D,Ye)):M=O;var R=r._globe,N=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var k=t.UNIT_Z,L=f.clone(d.transform,Je);d._setTransform(O);var B=t.cross(t.UNIT_Z,t.normalize(d.position,Ze),Ze),U=t.dot(d.right,B);if(q(r,i,n,k,!1,!0),d._setTransform(M),U<0){n.startPosition.y>n.endPosition.y&&(k=void 0);var V=d.constrainedAxis;d.constrainedAxis=void 0,q(r,i,n,k,!0,!1),d.constrainedAxis=V}else q(r,i,n,k,!0,!1);if(o(d.constrainedAxis)){var z=t.cross(d.direction,d.constrainedAxis,It);t.equalsEpsilon(z,t.ZERO,h.EPSILON6)||(t.dot(z,d.right)<0&&t.negate(z,z),t.cross(z,d.direction,d.up),t.cross(d.direction,d.up,d.right),t.normalize(d.up,d.up),t.normalize(d.right,d.right))}d._setTransform(L),r._globe=R,r._ellipsoid=N;var G=N.maximumRadius;r._rotateFactor=1/G,r._rotateRateRangeAdjustment=G;var H=t.clone(d.positionWC,Ze);if(d._adjustHeightForTerrain(),!t.equals(d.positionWC,H)){d._setTransform(M),d.worldToCameraCoordinatesPoint(H,H);var W=t.magnitudeSquared(H);t.magnitudeSquared(d.position)>W&&(t.normalize(d.position,d.position),t.multiplyByScalar(d.position,Math.sqrt(W),d.position));var j=t.angleBetween(H,d.position),Y=t.cross(H,d.position,H);t.normalize(Y,Y);var X=g.fromAxisAngle(Y,j,$e),Q=p.fromQuaternion(X,et);p.multiplyByVector(Q,d.direction,d.direction),p.multiplyByVector(Q,d.up,d.up),t.cross(d.direction,d.up,d.right),t.cross(d.right,d.direction,d.up),d._setTransform(L)}}function G(e,r,i){o(i.distance)&&(i=i.distance);var n=e._scene,a=n.camera,s=n.canvas,l=tt;l.x=s.clientWidth/2,l.y=s.clientHeight/2;var u,c=a.getPickRay(l,rt);a.position.z<e._minimumPickingTerrainHeight&&(u=F(e,l,it));var d;if(o(u))d=t.distance(c.origin,u);else{var h=t.UNIT_X,p=c.origin,f=c.direction;d=-t.dot(h,p)/t.dot(h,f)}M(e,r,i,e._zoomFactor,d)}function H(e){var t=e._scene,r=t.camera;if(f.equals(f.IDENTITY,r.transform)){var i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),I(e,e.enableTilt,e.tiltEventTypes,U,e.inertiaSpin,"_lastInertiaTiltMovement"),I(e,e.enableTranslate,e.translateEventTypes,B,e.inertiaTranslate,"_lastInertiaTranslateMovement"),I(e,e.enableZoom,e.zoomEventTypes,G,e.inertiaZoom,"_lastInertiaZoomMovement"),I(e,e.enableLook,e.lookEventTypes,J),!(e._aggregator.anyButtonDown||o(e._lastInertiaZoomMovement)&&e._lastInertiaZoomMovement.active||o(e._lastInertiaTranslateMovement)&&e._lastInertiaTranslateMovement.active||i.contains(e._tween))){var n=r.createCorrectPositionTween(e.bounceAnimationTime);o(n)&&(e._tween=i.add(n))}i.update()}else I(e,e.enableRotate,e.rotateEventTypes,q,e.inertiaSpin,"_lastInertiaSpinMovement"),I(e,e.enableZoom,e.zoomEventTypes,X,e.inertiaZoom,"_lastInertiaZoomMovement")}function W(e,r,i){var n=e._scene,a=n.camera,s=F(e,i.startPosition,ct);if(o(s)){var l=i.endPosition,c=a.getPickRay(l,nt),d=t.clone(a.direction,st);n.mode===S.COLUMBUS_VIEW&&t.fromElements(d.z,d.x,d.y,d);var h=m.fromPointNormal(s,d,ot),p=u.rayPlane(c,h,at);o(p)&&(d=t.subtract(s,p,d),n.mode===S.COLUMBUS_VIEW&&t.fromElements(d.y,d.z,d.x,d),t.add(a.position,d,a.position))}}function j(r,i,n){var a=r._scene,s=a.camera;if(!f.equals(s.transform,f.IDENTITY))return void q(r,i,n);var u,c,d,h,p=r._ellipsoid.geodeticSurfaceNormal(s.position,pt),m=r._ellipsoid.cartesianToCartographic(s.positionWC,ut).height,g=r._globe,v=!1;if(o(g)&&m<r._minimumPickingTerrainHeight&&(h=F(r,n.startPosition,ct),o(h))){var _=s.getPickRay(n.startPosition,Ie),y=r._ellipsoid.geodeticSurfaceNormal(h);v=Math.abs(t.dot(_.direction,y))<.05,v&&!r._looking&&(r._rotating=!1,r._strafing=!0)}return e.equals(i,r._rotateMousePosition)?void(r._looking?J(r,i,n,p):r._rotating?q(r,i,n):r._strafing?(t.clone(h,r._strafeStartPosition),W(r,i,n)):(u=t.magnitude(r._rotateStartPosition),c=dt,c.x=c.y=c.z=u,d=l.fromCartesian3(c,ht),Y(r,i,n,d))):(r._looking=!1,r._rotating=!1,r._strafing=!1,o(g)&&m<r._minimumPickingTerrainHeight?o(h)?t.magnitude(s.position)<t.magnitude(h)?(t.clone(h,r._strafeStartPosition),r._strafing=!0,W(r,i,n)):(u=t.magnitude(h),c=dt,c.x=c.y=c.z=u,d=l.fromCartesian3(c,ht),Y(r,i,n,d),t.clone(h,r._rotateStartPosition)):(r._looking=!0,J(r,i,n,p)):o(s.pickEllipsoid(n.startPosition,r._ellipsoid,lt))?(Y(r,i,n,r._ellipsoid),t.clone(lt,r._rotateStartPosition)):m>r._minimumTrackBallHeight?(r._rotating=!0,q(r,i,n)):(r._looking=!0,J(r,i,n,p)),void e.clone(i,r._rotateMousePosition))}function q(e,r,i,a,s,l){s=n(s,!1),l=n(l,!1);var u=e._scene,c=u.camera,d=u.canvas,h=c.constrainedAxis;o(a)&&(c.constrainedAxis=a);var p=t.magnitude(c.position),f=e._rotateFactor*(p-e._rotateRateRangeAdjustment);f>e._maximumRotateRate&&(f=e._maximumRotateRate),f<e._minimumRotateRate&&(f=e._minimumRotateRate);var m=(i.startPosition.x-i.endPosition.x)/d.clientWidth,g=(i.startPosition.y-i.endPosition.y)/d.clientHeight;m=Math.min(m,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);var v=f*m*Math.PI*2,_=f*g*Math.PI;s||c.rotateRight(v),l||c.rotateUp(_),c.constrainedAxis=h}function Y(r,i,n,a){var s=r._scene,l=s.camera,u=e.clone(n.startPosition,bt),c=e.clone(n.endPosition,Ct),d=l.pickEllipsoid(u,a,ft),p=l.pickEllipsoid(c,a,mt);if(!o(d)||!o(p))return r._rotating=!0,void q(r,i,n);if(d=l.worldToCameraCoordinates(d,d),p=l.worldToCameraCoordinates(p,p),o(l.constrainedAxis)){var f=l.constrainedAxis,m=t.mostOrthogonalAxis(f,gt);t.cross(m,f,m),t.normalize(m,m);var g=t.cross(f,m,vt),v=t.magnitude(d),_=t.dot(f,d),y=Math.acos(_/v),b=t.multiplyByScalar(f,_,_t);t.subtract(d,b,b),t.normalize(b,b);var C=t.magnitude(p),w=t.dot(f,p),S=Math.acos(w/C),E=t.multiplyByScalar(f,w,yt);t.subtract(p,E,E),t.normalize(E,E);var T=Math.acos(t.dot(b,m));t.dot(b,g)<0&&(T=h.TWO_PI-T);var x=Math.acos(t.dot(E,m));t.dot(E,g)<0&&(x=h.TWO_PI-x);var P,A=T-x;P=t.equalsEpsilon(f,l.position,h.EPSILON2)?l.right:t.cross(f,l.position,gt);var D,I=t.cross(f,P,gt),M=t.dot(I,t.subtract(d,f,vt)),O=t.dot(I,t.subtract(p,f,vt));D=M>0&&O>0?S-y:M>0&&O<=0?t.dot(l.position,f)>0?-y-S:y+S:y-S,l.rotateRight(A),l.rotateUp(D)}else{t.normalize(d,d),t.normalize(p,p);var R=t.dot(d,p),N=t.cross(d,p,gt);if(R<1&&!t.equalsEpsilon(N,t.ZERO,h.EPSILON14)){var k=Math.acos(R);l.rotate(N,k)}}}function X(e,r,i){o(i.distance)&&(i=i.distance);var n=e._ellipsoid,a=e._scene,s=a.camera,l=a.canvas,u=tt;u.x=l.clientWidth/2,u.y=l.clientHeight/2;var c,d=s.getPickRay(u,rt),h=n.cartesianToCartographic(s.position,St).height;h<e._minimumPickingTerrainHeight&&(c=F(e,u,it));var p;p=o(c)?t.distance(d.origin,c):h;var f=t.normalize(s.position,wt);M(e,r,i,e._zoomFactor,p,t.dot(f,s.direction))}function Q(t,r,i){var n=t._scene,a=n.camera;if(f.equals(a.transform,f.IDENTITY)){if(o(i.angleAndHeight)&&(i=i.angleAndHeight),e.equals(r,t._tiltCenterMousePosition)||(t._tiltOnEllipsoid=!1,t._looking=!1),t._looking){var s=t._ellipsoid.geodeticSurfaceNormal(a.position,kt);return void J(t,r,i,s)}var l=t._ellipsoid,u=l.cartesianToCartographic(a.position,Nt);t._tiltOnEllipsoid||u.height>t._minimumCollisionTerrainHeight?(t._tiltOnEllipsoid=!0,Z(t,r,i)):K(t,r,i)}}function Z(r,i,n){var a=r._ellipsoid,s=r._scene,c=s.camera,d=.25*r.minimumZoomDistance,p=a.cartesianToCartographic(c.positionWC,Lt).height;if(!(p-d-1<h.EPSILON3&&n.endPosition.y-n.startPosition.y<0)){var m=s.canvas,g=Et;g.x=m.clientWidth/2,g.y=m.clientHeight/2;var y,b=c.getPickRay(g,Tt),C=u.rayEllipsoid(b,a);if(o(C))y=v.getPoint(b,C.start,xt);else{if(!(p>r._minimumTrackBallHeight)){r._looking=!0;var w=r._ellipsoid.geodeticSurfaceNormal(c.position,kt);return J(r,i,n,w),void e.clone(i,r._tiltCenterMousePosition)}var S=u.grazingAltitudeLocation(b,a);if(!o(S))return;var E=a.cartesianToCartographic(S,Nt);E.height=0,y=a.cartographicToCartesian(E,xt)}var T=_.eastNorthUpToFixedFrame(y,a,At),x=r._globe,P=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var A=f.clone(c.transform,Mt);c._setTransform(T),q(r,i,n,t.UNIT_Z),c._setTransform(A),r._globe=x,r._ellipsoid=P;var D=P.maximumRadius;r._rotateFactor=1/D,r._rotateRateRangeAdjustment=D}}function K(r,i,n){var a,s,c,d=r._ellipsoid,m=r._scene,y=m.camera;if(e.equals(i,r._tiltCenterMousePosition))a=t.clone(r._tiltCenter,xt);else{if(a=F(r,i,xt),!o(a)){if(s=y.getPickRay(i,Tt),c=u.rayEllipsoid(s,d),!o(c)){var b=d.cartesianToCartographic(y.position,Nt);if(b.height<=r._minimumTrackBallHeight){r._looking=!0;var C=r._ellipsoid.geodeticSurfaceNormal(y.position,kt);J(r,i,n,C),e.clone(i,r._tiltCenterMousePosition)}return}a=v.getPoint(s,c.start,xt)}e.clone(i,r._tiltCenterMousePosition),t.clone(a,r._tiltCenter)}var w=m.canvas,S=Et;S.x=w.clientWidth/2,S.y=r._tiltCenterMousePosition.y,s=y.getPickRay(S,Tt);var E=t.magnitude(a),T=t.fromElements(E,E,E,dt),x=l.fromCartesian3(T,ht);if(c=u.rayEllipsoid(s,x),o(c)){var P=t.magnitude(s.origin)>E?c.start:c.stop,A=v.getPoint(s,P,Pt),D=_.eastNorthUpToFixedFrame(a,d,At),I=_.eastNorthUpToFixedFrame(A,x,Dt),M=r._globe,O=r._ellipsoid;r._globe=void 0,r._ellipsoid=l.UNIT_SPHERE,r._rotateFactor=1,r._rotateRateRangeAdjustment=1;var R=t.UNIT_Z,N=f.clone(y.transform,Mt);y._setTransform(D);var k=t.cross(A,y.positionWC,It),L=t.dot(y.rightWC,k);if(q(r,i,n,R,!1,!0),y._setTransform(I),L<0){n.startPosition.y>n.endPosition.y&&(R=void 0);var B=y.constrainedAxis;y.constrainedAxis=void 0,q(r,i,n,R,!0,!1),y.constrainedAxis=B}else q(r,i,n,R,!0,!1);if(o(y.constrainedAxis)){var U=t.cross(y.direction,y.constrainedAxis,It);t.equalsEpsilon(U,t.ZERO,h.EPSILON6)||(t.dot(U,y.right)<0&&t.negate(U,U),t.cross(U,y.direction,y.up),t.cross(y.direction,y.up,y.right),t.normalize(y.up,y.up),t.normalize(y.right,y.right))}y._setTransform(N),r._globe=M,r._ellipsoid=O;var V=O.maximumRadius;r._rotateFactor=1/V,r._rotateRateRangeAdjustment=V;var z=t.clone(y.positionWC,It);if(y._adjustHeightForTerrain(),!t.equals(y.positionWC,z)){y._setTransform(I),y.worldToCameraCoordinatesPoint(z,z);var G=t.magnitudeSquared(z);t.magnitudeSquared(y.position)>G&&(t.normalize(y.position,y.position),t.multiplyByScalar(y.position,Math.sqrt(G),y.position));var H=t.angleBetween(z,y.position),W=t.cross(z,y.position,z);t.normalize(W,W);var j=g.fromAxisAngle(W,H,Ot),Y=p.fromQuaternion(j,Rt);p.multiplyByVector(Y,y.direction,y.direction),p.multiplyByVector(Y,y.up,y.up),t.cross(y.direction,y.up,y.right),t.cross(y.right,y.direction,y.up),y._setTransform(N)}}}function J(e,r,i,a){var s=e._scene,l=s.camera,u=Ft;u.x=i.startPosition.x,u.y=0;var c=Bt;c.x=i.endPosition.x,c.y=0;var d,p,f=l.getPickRay(u,Ut),m=l.getPickRay(c,Vt),g=0;l.frustum instanceof w?(d=f.origin,p=m.origin,t.add(l.direction,d,d),t.add(l.direction,p,p),t.subtract(d,l.position,d),t.subtract(p,l.position,p),t.normalize(d,d),t.normalize(p,p)):(d=f.direction,p=m.direction);var v=t.dot(d,p);v<1&&(g=Math.acos(v)),g=i.startPosition.x>i.endPosition.x?-g:g;var _=e._horizontalRotationAxis;if(o(a)?l.look(a,-g):o(_)?l.look(_,-g):l.lookLeft(g),u.x=0,u.y=i.startPosition.y,c.x=0,c.y=i.endPosition.y,f=l.getPickRay(u,Ut),m=l.getPickRay(c,Vt),g=0,l.frustum instanceof w?(d=f.origin,p=m.origin,t.add(l.direction,d,d),t.add(l.direction,p,p),t.subtract(d,l.position,d),t.subtract(p,l.position,p),t.normalize(d,d),t.normalize(p,p)):(d=f.direction,p=m.direction),v=t.dot(d,p),v<1&&(g=Math.acos(v)),g=i.startPosition.y>i.endPosition.y?-g:g,a=n(a,_),o(a)){var y=l.direction,b=t.negate(a,zt),C=t.equalsEpsilon(y,a,h.EPSILON2),S=t.equalsEpsilon(y,b,h.EPSILON2);if(C||S)(C&&g<0||S&&g>0)&&l.look(l.right,-g);else{v=t.dot(y,a);var E=h.acosClamped(v);g>0&&g>E&&(g=E-h.EPSILON4),v=t.dot(y,b),E=h.acosClamped(v),g<0&&-g>E&&(g=-E+h.EPSILON4);var T=t.cross(a,y,Gt);l.look(T,g)}}else l.lookUp(g)}function $(e){I(e,e.enableRotate,e.rotateEventTypes,j,e.inertiaSpin,"_lastInertiaSpinMovement"),I(e,e.enableZoom,e.zoomEventTypes,X,e.inertiaZoom,"_lastInertiaZoomMovement"),I(e,e.enableTilt,e.tiltEventTypes,Q,e.inertiaSpin,"_lastInertiaTiltMovement"),I(e,e.enableLook,e.lookEventTypes,J)}var ee=.4,te=[],re=new v,ie=new t,ne=new e,oe=new t,ae=new e,se=new t,le=new t,ue=new t,ce=new t,de=new t,he=new t,pe=new t,fe=new t,me=new t,ge=new t,ve=new t,_e=new t,ye=new t,be=new t,Ce=new t,we=new t,Se=new t,Ee=new t,Te=new v,xe=new v,Pe=new t,Ae=new e,De=new e,Ie=new v,Me=new t,Oe=new t,Re=new v,Ne=new v,ke=new t,Le=new t,Fe=new t,Be=new t,Ue=new m(t.UNIT_X,0),Ve=new e,ze=new e,Ge=new e,He=new v,We=new t,je=new t,qe=new f,Ye=new f,Xe=new t,Qe=new m(t.UNIT_X,0),Ze=new t,Ke=new i,Je=new f,$e=new g,et=new p,tt=new e,rt=new v,it=new t,nt=new v,ot=new m(t.UNIT_X,0),at=new t,st=new t,lt=new t,ut=new i,ct=new t,dt=new t,ht=new l,pt=new t,ft=r.clone(r.UNIT_W),mt=r.clone(r.UNIT_W),gt=new t,vt=new t,_t=new t,yt=new t,bt=new e,Ct=new e,wt=new t,St=new i,Et=new e,Tt=new v,xt=new t,Pt=new t,At=new f,Dt=new f,It=new t,Mt=new f,Ot=new g,Rt=new p,Nt=new i,kt=new t,Lt=new i,Ft=new e,Bt=new e,Ut=new v,Vt=new v,zt=new t,Gt=new t;return x.prototype.update=function(){f.equals(this._scene.camera.transform,f.IDENTITY)?(this._globe=this._scene.globe,this._ellipsoid=o(this._globe)?this._globe.ellipsoid:this._scene.mapProjection.ellipsoid):(this._globe=void 0, +this._ellipsoid=l.UNIT_SPHERE),this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight*this._scene.terrainExaggeration,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight*this._scene.terrainExaggeration,this._minimumTrackBallHeight=this.minimumTrackBallHeight*this._scene.terrainExaggeration;var e=this._ellipsoid.maximumRadius;this._rotateFactor=1/e,this._rotateRateRangeAdjustment=e;var r=this._scene,i=r.mode;i===S.SCENE2D?L(this):i===S.COLUMBUS_VIEW?(this._horizontalRotationAxis=t.UNIT_Z,H(this)):i===S.SCENE3D&&(this._horizontalRotationAxis=void 0,$(this)),this._aggregator.reset()},x.prototype.isDestroyed=function(){return!1},x.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),a(this)},x}),define("Scene/ShadowMapShader",["../Core/defined","../Renderer/ShaderSource"],function(e,t){"use strict";function r(){}return r.getShadowCastShaderKeyword=function(e,t,r,i){return"castShadow "+e+" "+t+" "+r+" "+i},r.createShadowCastVertexShader=function(r,i,n){var o=r.defines.slice(0),a=r.sources.slice(0);n&&o.push("GENERATE_POSITION");var s=t.findPositionVarying(r),l=e(s);if(i&&!l){for(var u=a.length,c=0;c<u;++c)a[c]=t.replaceMain(a[c],"czm_shadow_cast_main");var d="varying vec3 v_positionEC; \nvoid main() \n{ \n czm_shadow_cast_main(); \n v_positionEC = (czm_inverseProjection * gl_Position).xyz; \n}";a.push(d)}return new t({defines:o,sources:a})},r.createShadowCastFragmentShader=function(r,i,n,o){var a=r.defines.slice(0),s=r.sources.slice(0),l=t.findPositionVarying(r),u=e(l);u||(l="v_positionEC");for(var c=s.length,d=0;d<c;++d)s[d]=t.replaceMain(s[d],"czm_shadow_cast_main");var h="";return i&&(u||(h+="varying vec3 v_positionEC; \n"),h+="uniform vec4 shadowMap_lightPositionEC; \n"),h+=o?"void main() \n{ \n":"void main() \n{ \n czm_shadow_cast_main(); \n if (gl_FragColor.a == 0.0) \n { \n discard; \n } \n",h+=i?"float distance = length("+l+"); \ndistance /= shadowMap_lightPositionEC.w; // radius \ngl_FragColor = czm_packDepth(distance); \n":n?"gl_FragColor = vec4(1.0); \n":"gl_FragColor = czm_packDepth(gl_FragCoord.z); \n",h+="} \n",s.push(h),new t({defines:a,sources:s})},r.getShadowReceiveShaderKeyword=function(e,t,r,i){var n=e._usesDepthTexture,o=e._polygonOffsetSupported,a=e._isPointLight,s=e._isSpotLight,l=e._numberOfCascades>1,u=e.debugCascadeColors,c=e.softShadows;return"receiveShadow "+n+o+a+s+l+u+c+t+r+i},r.createShadowReceiveVertexShader=function(e,r,i){var n=e.defines.slice(0),o=e.sources.slice(0);return r&&(i?n.push("GENERATE_POSITION_AND_NORMAL"):n.push("GENERATE_POSITION")),new t({defines:n,sources:o})},r.createShadowReceiveFragmentShader=function(r,i,n,o,a){for(var s=t.findNormalVarying(r),l=!o&&e(s)||o&&a,u=t.findPositionVarying(r),c=e(u),d=i._usesDepthTexture,h=i._polygonOffsetSupported,p=i._isPointLight,f=i._isSpotLight,m=i._numberOfCascades>1,g=i.debugCascadeColors,v=i.softShadows,_=p?i._pointBias:o?i._terrainBias:i._primitiveBias,y=r.defines.slice(0),b=r.sources.slice(0),C=b.length,w=0;w<C;++w)b[w]=t.replaceMain(b[w],"czm_shadow_receive_main");p?y.push("USE_CUBE_MAP_SHADOW"):d&&y.push("USE_SHADOW_DEPTH_TEXTURE"),v&&!p&&y.push("USE_SOFT_SHADOWS"),m&&n&&o&&(l?y.push("ENABLE_VERTEX_LIGHTING"):y.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&l&&(y.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&y.push("USE_NORMAL_SHADING_SMOOTH"));var S="";return S+=p?"uniform samplerCube shadowMap_textureCube; \n":"uniform sampler2D shadowMap_texture; \n",S+="uniform mat4 shadowMap_matrix; \nuniform vec3 shadowMap_lightDirectionEC; \nuniform vec4 shadowMap_lightPositionEC; \nuniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; \nuniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; \nvec4 getPositionEC() \n{ \n"+(c?" return vec4("+u+", 1.0); \n":" return czm_windowToEyeCoordinates(gl_FragCoord); \n")+"} \nvec3 getNormalEC() \n{ \n"+(l?" return normalize("+s+"); \n":" return vec3(1.0); \n")+"} \nvoid applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) \n{ \n"+(_.normalOffset&&l?" float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; \n float normalOffsetScale = 1.0 - nDotL; \n vec3 offset = normalOffset * normalOffsetScale * normalEC; \n positionEC.xyz += offset; \n":"")+"} \n",S+="void main() \n{ \n czm_shadow_receive_main(); \n vec4 positionEC = getPositionEC(); \n vec3 normalEC = getNormalEC(); \n float depth = -positionEC.z; \n",S+=" 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",o?S+=" shadowParameters.depthBias *= max(depth * 0.01, 1.0); \n":h||(S+=" shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); \n"),S+=p?" 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":f?" 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":m?" 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"+(g?" // 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",S+=" gl_FragColor.rgb *= visibility; \n} \n",b.push(S),new t({defines:y,sources:b})},r}),define("Scene/ShadowMap",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/clone","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/FeatureDetection","../Core/GeometryInstance","../Core/Intersect","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Quaternion","../Core/SphereOutlineGeometry","../Core/WebGLConstants","../Renderer/ClearCommand","../Renderer/ContextLimits","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Sampler","../Renderer/Texture","../Renderer/TextureMagnificationFilter","../Renderer/TextureMinificationFilter","../Renderer/TextureWrap","./Camera","./CullFace","./CullingVolume","./DebugCameraPrimitive","./OrthographicOffCenterFrustum","./PerInstanceColorAppearance","./PerspectiveFrustum","./Primitive","./ShadowMapShader"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R,N,k,L,F,B,U,V,z,G,H,W,j,q,Y,X,Q){"use strict";function Z(e){e=d(e,d.EMPTY_OBJECT);var r=e.context;this._enabled=d(e.enabled,!0),this._softShadows=d(e.softShadows,!1),this._normalOffset=d(e.normalOffset,!0),this.dirty=!0,this.fromLightSource=d(e.fromLightSource,!0),this.darkness=d(e.darkness,.3),this._darkness=this.darkness,this.maximumDistance=d(e.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;var a=!0;(g.isInternetExplorer()||g.isEdge()||(g.isChrome()||g.isFirefox())&&g.isWindows()&&!r.depthTexture)&&(a=!1),this._polygonOffsetSupported=a,this._terrainBias={polygonOffset:a,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:a,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 b,this._shadowMapTexture=void 0,this._lightDirectionEC=new n,this._lightPositionEC=new o,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new fe,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new t,this._isPointLight=d(e.isPointLight,!1),this._pointLightRadius=d(e.pointLightRadius,100),this._cascadesEnabled=!this._isPointLight&&d(e.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?d(e.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new i,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new j:h(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new o,new o],this._cascadeMatrices=[new b,new b,new b,new b],this._cascadeDistances=new o;var s;s=this._isPointLight?6:this._cascadesEnabled?this._numberOfCascades:1,this._passes=new Array(s);for(var u=0;u<s;++u)this._passes[u]=new K(r);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=r.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,$(this),this._clearCommand=new T({depth:1,color:new l}),this._clearPassState=new M(r),this._size=d(e.size,2048),this.size=this._size}function K(e){this.camera=new fe,this.passState=new M(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function J(e,t){return k.fromCache({cull:{enabled:!0,face:G.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 $(e){var t=!e._usesDepthTexture;e._primitiveRenderState=J(t,e._primitiveBias),e._terrainRenderState=J(t,e._terrainBias),e._pointRenderState=J(t,e._pointBias)}function ee(e){for(var t=e._passes.length,r=0;r<t;++r){var i=e._passes[r],n=i.framebuffer;h(n)&&!n.isDestroyed()&&n.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function te(){return new L({wrapS:V.CLAMP_TO_EDGE,wrapT:V.CLAMP_TO_EDGE,minificationFilter:U.NEAREST,magnificationFilter:B.NEAREST})}function re(e,t){for(var r=new R({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),i=new F({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:C.RGBA,pixelDatatype:O.UNSIGNED_BYTE,sampler:te()}),n=new D({context:t,depthRenderbuffer:r,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length,a=0;a<o;++a){var s=e._passes[a];s.framebuffer=n,s.passState.framebuffer=n}e._shadowMapTexture=i,e._depthAttachment=r,e._colorAttachment=i}function ie(e,t){for(var r=new F({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:C.DEPTH_STENCIL,pixelDatatype:O.UNSIGNED_INT_24_8,sampler:te()}),i=new D({context:t,depthStencilTexture:r,destroyAttachments:!1}),n=e._passes.length,o=0;o<n;++o){var a=e._passes[o];a.framebuffer=i,a.passState.framebuffer=i}e._shadowMapTexture=r,e._depthAttachment=r}function ne(e,t){for(var r=new R({context:t,width:e._textureSize.x,height:e._textureSize.y,format:N.DEPTH_COMPONENT16}),i=new P({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:C.RGBA,pixelDatatype:O.UNSIGNED_BYTE,sampler:te()}),n=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ],o=0;o<6;++o){var a=new D({context:t,depthRenderbuffer:r,colorTextures:[n[o]],destroyAttachments:!1}),s=e._passes[o];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=i,e._depthAttachment=r,e._colorAttachment=i}function oe(e,t){e._isPointLight?ne(e,t):e._usesDepthTexture?ie(e,t):re(e,t)}function ae(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==E.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,$(e),ee(e),oe(e,t))}function se(e,t){h(e._passes[0].framebuffer)&&e._shadowMapTexture.width===e._textureSize.x||(ee(e),oe(e,t),ae(e,t),le(e,t))}function le(e,t,r){r=d(r,0),(e._isPointLight||0===r)&&(e._clearCommand.framebuffer=e._passes[r].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function ue(t,r){t._size=r;var i=t._passes,n=i.length,o=t._textureSize;if(t._isPointLight){r=x.maximumCubeMapSize>=r?r:x.maximumCubeMapSize,o.x=r,o.y=r;var a=new e(0,0,r,r);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===n?(r=x.maximumTextureSize>=r?r:x.maximumTextureSize,o.x=r,o.y=r,i[0].passState.viewport=new e(0,0,r,r)):4===n&&(r=x.maximumTextureSize>=2*r?r:x.maximumTextureSize/2,o.x=2*r,o.y=2*r,i[0].passState.viewport=new e(0,0,r,r),i[1].passState.viewport=new e(r,0,r,r),i[2].passState.viewport=new e(0,r,r,r),i[3].passState.viewport=new e(r,r,r,r));t._clearPassState.viewport=new e(0,0,o.x,o.y);for(var s=0;s<n;++s){var l=i[s],u=l.passState.viewport,c=u.x/o.x,d=u.y/o.y,h=u.width/o.x,p=u.height/o.y;l.textureOffsets=new b(h,0,0,c,0,p,0,d,0,0,1,0,0,0,0,1)}}function ce(e,t){var r;r=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 i=t.createViewportQuadCommand(r,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=I.OVERLAY,i}function de(t,r){var i=r.context,n=r.context.drawingBufferWidth,o=r.context.drawingBufferHeight,a=.3*Math.min(n,o),s=we;s.x=n-a,s.y=0,s.width=a,s.height=a;var l=t._debugShadowViewCommand;h(l)||(l=ce(t,i),t._debugShadowViewCommand=l),h(l.renderState)&&e.equals(l.renderState.viewport,s)||(l.renderState=k.fromCache({viewport:e.clone(s)})),r.commandList.push(t._debugShadowViewCommand)}function he(e,t){var i=new v({geometry:new r({minimum:new n(-.5,-.5,-.5),maximum:new n(.5,.5,.5)}),attributes:{color:u.fromColor(t)}}),o=new v({geometry:new S({radius:.5}),attributes:{color:u.fromColor(t)}});return new X({geometryInstances:[i,o],appearance:new q({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}function pe(e,t){de(e,t);var r=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(r&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new W({camera:e._sceneCamera,color:l.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){r&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new W({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(var i=0;i<e._numberOfCascades;++i)r&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new W({camera:e._passes[i].camera,color:Pe[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!h(e._debugLightFrustum)||e._needsUpdate){var o=e._shadowMapCamera.positionWC,a=w.IDENTITY,s=2*e._pointLightRadius,u=n.fromElements(s,s,s,Ae),c=b.fromTranslationQuaternionRotationScale(o,a,u,Ee);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=he(c,l.YELLOW)}e._debugLightFrustum.update(t)}else h(e._debugLightFrustum)&&!e._needsUpdate||(e._debugLightFrustum=new W({camera:e._shadowMapCamera,color:l.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function fe(){this.viewMatrix=new b,this.inverseViewMatrix=new b,this.frustum=void 0,this.positionCartographic=new a,this.positionWC=new n,this.directionWC=n.clone(n.UNIT_Z),this.upWC=n.clone(n.UNIT_Y),this.rightWC=n.clone(n.UNIT_X),this.viewProjectionMatrix=new b}function me(e,t){var r,i=e._shadowMapCamera,a=e._sceneCamera,s=a.frustum.near,l=a.frustum.far,u=e._numberOfCascades,c=l-s,d=l/s,h=.9,p=!1;t.shadowHints.closestObjectSize<200&&(p=!0,h=.9);var f=Oe,m=Ie;for(m[0]=s,m[u]=l,r=0;r<u;++r){var g=(r+1)/u,v=s*Math.pow(d,g),_=s+c*g,C=y.lerp(_,v,h);m[r+1]=C,f[r]=C-m[r]}if(p){for(r=0;r<u;++r)f[r]=Math.min(f[r],e._maximumCascadeDistances[r]);var w=m[0];for(r=0;r<u-1;++r)w+=f[r],m[r+1]=w}o.unpack(m,0,e._cascadeSplits[0]),o.unpack(m,1,e._cascadeSplits[1]),o.unpack(f,0,e._cascadeDistances);var S=i.frustum,E=S.left,T=S.right,x=S.bottom,P=S.top,A=S.near,D=S.far,I=i.positionWC,M=i.directionWC,O=i.upWC,R=a.frustum.clone(Me),N=i.getViewProjection();for(r=0;r<u;++r){R.near=m[r],R.far=m[r+1];for(var k=b.multiply(R.projectionMatrix,a.viewMatrix,Ee),L=b.inverse(k,Ee),F=b.multiply(N,L,Ee),B=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Le),U=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Fe),V=0;V<8;++V){var z=o.clone(Se[V],Te[V]);b.multiplyByVector(F,z,z),n.divideByScalar(z,z.w,z),n.minimumByComponent(z,B,B),n.maximumByComponent(z,U,U)}B.x=Math.max(B.x,0),B.y=Math.max(B.y,0),B.z=0,U.x=Math.min(U.x,1),U.y=Math.min(U.y,1),U.z=Math.min(U.z,1);var G=e._passes[r],H=G.camera;H.clone(i);var W=H.frustum;W.left=E+B.x*(T-E),W.right=E+U.x*(T-E),W.bottom=x+B.y*(P-x),W.top=x+U.y*(P-x),W.near=A+B.z*(D-A),W.far=A+U.z*(D-A),G.cullingVolume=H.frustum.computeCullingVolume(I,M,O);var j=e._cascadeMatrices[r];b.multiply(H.getViewProjection(),a.inverseViewMatrix,j),b.multiply(G.textureOffsets,j,j)}}function ge(e,t){var r=e._shadowMapCamera,i=e._sceneCamera,a=b.multiply(i.frustum.projectionMatrix,i.viewMatrix,Ee),s=b.inverse(a,Ee),l=r.directionWC,u=i.directionWC,c=n.cross(l,u,Ne);u=n.cross(c,l,ke),n.normalize(u,u),n.normalize(c,c);for(var d=n.fromElements(0,0,0,Be),h=b.computeView(d,l,u,c,Re),p=b.multiply(h,s,Ee),f=n.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Le),m=n.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Fe),g=0;g<8;++g){var v=o.clone(Se[g],Te[g]);b.multiplyByVector(p,v,v),n.divideByScalar(v,v.w,v),n.minimumByComponent(v,f,f),n.maximumByComponent(v,m,m)}m.z+=1e3,f.z-=10;var _=Be;_.x=-(.5*(f.x+m.x)),_.y=-(.5*(f.y+m.y)),_.z=-m.z;var y=b.fromTranslation(_,Ee);h=b.multiply(y,h,h);var C=.5*(m.x-f.x),w=.5*(m.y-f.y),S=m.z-f.z,E=r.frustum;E.left=-C,E.right=C,E.bottom=-w,E.top=w,E.near=.01,E.far=S,b.clone(h,r.viewMatrix),b.inverse(h,r.inverseViewMatrix),b.getTranslation(r.inverseViewMatrix,r.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),n.clone(l,r.directionWC),n.clone(u,r.upWC),n.clone(c,r.rightWC)}function ve(e,t){var r=new Y;r.fov=y.PI_OVER_TWO,r.near=1,r.far=e._pointLightRadius,r.aspectRatio=1;for(var i=0;i<6;++i){var n=e._passes[i].camera;n.positionWC=e._shadowMapCamera.positionWC,n.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),n.directionWC=Ue[i],n.upWC=Ve[i],n.rightWC=ze[i],b.computeView(n.positionWC,n.directionWC,n.upWC,n.rightWC,n.viewMatrix),b.inverse(n.viewMatrix,n.inverseViewMatrix),n.frustum=r}}function _e(e,r){var i=e._sceneCamera,o=e._shadowMapCamera,a=We;if(e._cascadesEnabled){if(i.frustum.near>=e.maximumDistance)return e._outOfView=!0,void(e._needsUpdate=!1);var s=r.mapProjection.ellipsoid.geodeticSurfaceNormal(i.positionWC,Ge),l=n.negate(o.directionWC,He),u=n.dot(s,l),c=y.clamp(u/.1,0,1);if(e._darkness=y.lerp(1,e.darkness,c),u<0)return e._outOfView=!0,void(e._needsUpdate=!1);e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)a.center=o.positionWC,a.radius=e._pointLightRadius,e._outOfView=r.cullingVolume.computeVisibility(a)===_.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere);else{var d=o.frustum.far/2,h=n.add(o.positionWC,n.multiplyByScalar(o.directionWC,d,je),je);a.center=h,a.radius=d,e._outOfView=r.cullingVolume.computeVisibility(a)===_.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(a),t.clone(a,e._boundingSphere)}}function ye(e,t){var r=t.camera,i=e._lightCamera,o=e._sceneCamera,a=e._shadowMapCamera;e._cascadesEnabled?n.clone(i.directionWC,a.directionWC):e._isPointLight?n.clone(i.positionWC,a.positionWC):a.clone(i);var s=e._lightDirectionEC;b.multiplyByPointAsVector(r.viewMatrix,a.directionWC,s),n.normalize(s,s),n.negate(s,s),b.multiplyByPoint(r.viewMatrix,a.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;var l,u;e._fitNearFar?(l=Math.min(t.shadowHints.nearPlane,e.maximumDistance),u=Math.min(t.shadowHints.farPlane,e.maximumDistance+1)):(l=r.frustum.near,u=e.maximumDistance),e._sceneCamera=z.clone(r,o),r.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=l,e._sceneCamera.frustum.far=u,e._distance=u-l,_e(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}function be(e,t,r){var i=e._isPointLight?e._pointBias:r?e._terrainBias:e._primitiveBias,n={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){var t=qe;return t.x=1/e._textureSize.x,t.y=1/e._textureSize.y,o.fromElements(t.x,t.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return o.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new o,combinedUniforms2:new o};return c(t,n,!1)}function Ce(e,t,r,i,n,o){var a,l,u;if(h(o)&&(a=o.shaderProgram,l=o.renderState,u=o.uniformMap),o=A.shallowClone(r,o),o.castShadows=!0,o.receiveShadows=!1,!h(a)||n!==r.shaderProgram.id||t){var c=r.shaderProgram,d=r.pass===I.GLOBE,p=r.pass!==I.TRANSLUCENT,f=e._isPointLight,m=e._usesDepthTexture,g=Q.getShadowCastShaderKeyword(f,d,m,p);if(a=i.shaderCache.getDerivedShaderProgram(c,g),!h(a)){var v=c.vertexShaderSource,_=c.fragmentShaderSource,y=Q.createShadowCastVertexShader(v,f,d),b=Q.createShadowCastFragmentShader(_,f,m,p);a=i.shaderCache.createDerivedShaderProgram(c,g,{vertexShaderSource:y,fragmentShaderSource:b,attributeLocations:c._attributeLocations})}l=e._primitiveRenderState,f?l=e._pointRenderState:d&&(l=e._terrainRenderState);var C=r.renderState.cull.enabled;C||(l=s(l,!1),l.cull.enabled=!1,l=k.fromCache(l)),u=be(e,r.uniformMap,d)}return o.shaderProgram=a,o.renderState=l,o.uniformMap=u,o}Z.MAXIMUM_DISTANCE=2e4,Z.prototype.debugCreateRenderStates=function(){$(this)},p(Z.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){ue(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 we=new e,Se=new Array(8);Se[0]=new o(-1,-1,-1,1),Se[1]=new o(1,-1,-1,1),Se[2]=new o(1,1,-1,1),Se[3]=new o(-1,1,-1,1),Se[4]=new o(-1,-1,1,1),Se[5]=new o(1,-1,1,1),Se[6]=new o(1,1,1,1),Se[7]=new o(-1,1,1,1);for(var Ee=new b,Te=new Array(8),xe=0;xe<8;++xe)Te[xe]=new o;var Pe=[l.RED,l.GREEN,l.BLUE,l.MAGENTA],Ae=new n;fe.prototype.clone=function(e){b.clone(e.viewMatrix,this.viewMatrix),b.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),a.clone(e.positionCartographic,this.positionCartographic),n.clone(e.positionWC,this.positionWC),n.clone(e.directionWC,this.directionWC),n.clone(e.upWC,this.upWC),n.clone(e.rightWC,this.rightWC)};var De=new b(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);fe.prototype.getViewProjection=function(){var e=this.viewMatrix,t=this.frustum.projectionMatrix;return b.multiply(t,e,this.viewProjectionMatrix),b.multiply(De,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Ie=new Array(5),Me=new Y,Oe=new Array(4),Re=new b,Ne=new n,ke=new n,Le=new n,Fe=new n,Be=new n,Ue=[new n(-1,0,0),new n(0,-1,0),new n(0,0,-1),new n(1,0,0),new n(0,1,0),new n(0,0,1)],Ve=[new n(0,-1,0),new n(0,0,-1),new n(0,-1,0),new n(0,-1,0),new n(0,0,1),new n(0,-1,0)],ze=[new n(0,0,1),new n(1,0,0),new n(-1,0,0),new n(0,0,-1),new n(1,0,0),new n(1,0,0)],Ge=new n,He=new n,We=new t,je=We.center;Z.prototype.update=function(e){if(ye(this,e),this._needsUpdate)if(se(this,e.context),this._isPointLight&&ve(this,e),this._cascadesEnabled&&(ge(this,e),this._numberOfCascades>1&&me(this,e)),this._isPointLight)this._shadowMapCullingVolume=H.fromBoundingSphere(this._boundingSphere);else{var t=this._shadowMapCamera,r=t.positionWC,i=t.directionWC,n=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(r,i,n),1===this._passes.length&&this._passes[0].camera.clone(t)}if(1===this._passes.length){var o=this._sceneCamera.inverseViewMatrix;b.multiply(this._shadowMapCamera.getViewProjection(),o,this._shadowMapMatrix)}this.debugShow&&pe(this,e)},Z.prototype.updatePass=function(e,t){le(this,e,t)};var qe=new i;return Z.createDerivedCommands=function(e,t,r,i,n,o){h(o)||(o={});var a=t.length>0,s=r.shaderProgram,l=s.vertexShaderSource,u=s.fragmentShaderSource,c=r.pass===I.GLOBE,d=!1;if(c&&(d=r.owner.data.pickTerrain.mesh.encoding.hasVertexNormals),r.castShadows){var p=o.castCommands;h(p)||(p=o.castCommands=[]);var f=o.castShaderProgramId,m=e.length;p.length=m;for(var g=0;g<m;++g)p[g]=Ce(e[g],i,r,n,f,p[g]);o.castShaderProgramId=r.shaderProgram.id}if(r.receiveShadows&&a){var v,_;h(o.receiveCommand)&&(v=o.receiveCommand.shaderProgram,_=o.receiveCommand.uniformMap),o.receiveCommand=A.shallowClone(r,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;var y=o.receiveShaderCastShadows!==r.castShadows,b=o.receiveShaderProgramId!==r.shaderProgram.id;if(!h(v)||b||i||y){var C=Q.getShadowReceiveShaderKeyword(t[0],r.castShadows,c,d);if(v=n.shaderCache.getDerivedShaderProgram(s,C),!h(v)){var w=Q.createShadowReceiveVertexShader(l,c,d),S=Q.createShadowReceiveFragmentShader(u,t[0],r.castShadows,c,d);v=n.shaderCache.createDerivedShaderProgram(s,C,{vertexShaderSource:w,fragmentShaderSource:S,attributeLocations:s._attributeLocations})}_=be(t[0],r.uniformMap,c)}o.receiveCommand.shaderProgram=v,o.receiveCommand.uniformMap=_,o.receiveShaderProgramId=r.shaderProgram.id,o.receiveShaderCastShadows=r.castShadows}return o},Z.prototype.isDestroyed=function(){return!1},Z.prototype.destroy=function(){ee(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 f(this)},Z}),define("Shaders/PostProcessFilters/AdditiveBlend",[],function(){"use strict";return"uniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\nuniform vec2 u_center;\nuniform float u_radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\nvec4 color1 = texture2D(u_texture1, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - u_center) / u_radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color0, t);\n}\n"}),define("Shaders/PostProcessFilters/BrightPass",[],function(){"use strict";return"uniform sampler2D u_texture;\nuniform float u_avgLuminance;\nuniform float u_threshold;\nuniform float u_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(u_texture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(u_avgLuminance) * luminance / u_avgLuminance;\nfloat brightLum = max(scaledLum - u_threshold, 0.0);\nfloat brightness = brightLum / (u_offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n"}),define("Shaders/PostProcessFilters/GaussianBlur1D",[],function(){"use strict";return"#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\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(u_texture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n"}),define("Scene/SunPostProcess",["../Core/BoundingRectangle","../Core/Cartesian2","../Core/Cartesian4","../Core/Color","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/Transforms","../Renderer/ClearCommand","../Renderer/Framebuffer","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/Renderbuffer","../Renderer/RenderbufferFormat","../Renderer/RenderState","../Renderer/Texture","../Shaders/PostProcessFilters/AdditiveBlend","../Shaders/PostProcessFilters/BrightPass","../Shaders/PostProcessFilters/GaussianBlur1D","../Shaders/PostProcessFilters/PassThrough"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w){"use strict";function S(){this._fbo=void 0,this._downSampleFBO1=void 0,this._downSampleFBO2=void 0,this._clearFBO1Command=void 0,this._clearFBO2Command=void 0,this._downSampleCommand=void 0,this._brightPassCommand=void 0,this._blurXCommand=void 0,this._blurYCommand=void 0,this._blendCommand=void 0,this._fullScreenCommand=void 0,this._downSamplePassState=new p,this._downSamplePassState.scissorTest={enable:!0,rectangle:new e},this._upSamplePassState=new p,this._upSamplePassState.scissorTest={enabled:!0,rectangle:new e},this._uCenter=new t,this._uRadius=void 0,this._blurStep=new t}S.prototype.clear=function(e,t){var r=this._clearFBO1Command;i.clone(n(t,i.BLACK),r.color),r.execute(e),r=this._clearFBO2Command,i.clone(n(t,i.BLACK),r.color),r.execute(e)},S.prototype.execute=function(e,t){this._downSampleCommand.execute(e,this._downSamplePassState),this._brightPassCommand.execute(e,this._downSamplePassState),this._blurXCommand.execute(e,this._downSamplePassState),this._blurYCommand.execute(e,this._downSamplePassState),this._fullScreenCommand.framebuffer=t,this._blendCommand.framebuffer=t,this._fullScreenCommand.execute(e),this._blendCommand.execute(e,this._upSamplePassState)};var E=new e,T=new e,x=new r,P=new t,A=new t,D=new l;return S.prototype.update=function(e){var r=e.context,n=e.viewport,a=r.drawingBufferWidth,p=r.drawingBufferHeight,S=this;if(!o(this._downSampleCommand)){this._clearFBO1Command=new d({color:new i}),this._clearFBO2Command=new d({color:new i});var I={};this._downSampleCommand=r.createViewportQuadCommand(w,{uniformMap:I,owner:this}),I={u_avgLuminance:function(){return.5},u_threshold:function(){return.25},u_offset:function(){return.1}},this._brightPassCommand=r.createViewportQuadCommand(b,{uniformMap:I,owner:this});var M=1,O=2;I={delta:function(){return M},sigma:function(){return O},direction:function(){return 0}},this._blurXCommand=r.createViewportQuadCommand(C,{uniformMap:I,owner:this}),I={delta:function(){return M},sigma:function(){return O},direction:function(){return 1}},this._blurYCommand=r.createViewportQuadCommand(C,{uniformMap:I,owner:this}),I={u_center:function(){return S._uCenter},u_radius:function(){return S._uRadius}},this._blendCommand=r.createViewportQuadCommand(y,{uniformMap:I,owner:this}),I={},this._fullScreenCommand=r.createViewportQuadCommand(w,{uniformMap:I,owner:this})}var R=Math.pow(2,Math.ceil(Math.log(a)/Math.log(2))-2),N=Math.pow(2,Math.ceil(Math.log(p)/Math.log(2))-2),k=Math.max(1,R,N),L=T;L.width=k,L.height=k;var F=this._fbo,B=o(F)&&F.getColorTexture(0)||void 0;if(!o(B)||B.width!==a||B.height!==p){F=F&&F.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._blurStep.x=this._blurStep.y=1/k;var U=[new _({context:r,width:a,height:p})];F=r.depthTexture?this._fbo=new h({context:r,colorTextures:U,depthTexture:new _({context:r,width:a,height:p,pixelFormat:u.DEPTH_COMPONENT,pixelDatatype:f.UNSIGNED_SHORT})}):this._fbo=new h({context:r,colorTextures:U,depthRenderbuffer:new m({context:r,format:g.DEPTH_COMPONENT16})}),this._downSampleFBO1=new h({context:r,colorTextures:[new _({context:r,width:k,height:k})]}),this._downSampleFBO2=new h({context:r,colorTextures:[new _({context:r,width:k,height:k})]}),this._clearFBO1Command.framebuffer=this._downSampleFBO1,this._clearFBO2Command.framebuffer=this._downSampleFBO2,this._downSampleCommand.framebuffer=this._downSampleFBO1,this._brightPassCommand.framebuffer=this._downSampleFBO2,this._blurXCommand.framebuffer=this._downSampleFBO1,this._blurYCommand.framebuffer=this._downSampleFBO2;var V=v.fromCache({viewport:L});this._downSampleCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._downSampleCommand.renderState=V,this._brightPassCommand.uniformMap.u_texture=function(){return S._downSampleFBO1.getColorTexture(0)},this._brightPassCommand.renderState=V,this._blurXCommand.uniformMap.u_texture=function(){return S._downSampleFBO2.getColorTexture(0)},this._blurXCommand.uniformMap.u_step=function(){return S._blurStep},this._blurXCommand.renderState=V,this._blurYCommand.uniformMap.u_texture=function(){return S._downSampleFBO1.getColorTexture(0)},this._blurYCommand.uniformMap.u_step=function(){return S._blurStep},this._blurYCommand.renderState=V;var z=E;z.width=a,z.height=p;var G=v.fromCache({viewport:z});this._blendCommand.uniformMap.u_texture0=function(){return F.getColorTexture(0)},this._blendCommand.uniformMap.u_texture1=function(){return S._downSampleFBO2.getColorTexture(0)},this._blendCommand.renderState=G,this._fullScreenCommand.uniformMap.u_texture=function(){return F.getColorTexture(0)},this._fullScreenCommand.renderState=G}var H=r.uniformState,W=H.sunPositionWC,j=H.view,q=H.viewProjection,Y=H.projection,X=l.computeViewportTransformation(n,0,1,D),Q=l.multiplyByPoint(j,W,x),Z=c.pointToGLWindowCoordinates(q,X,W,P);Q.x+=s.SOLAR_RADIUS;var K=c.pointToGLWindowCoordinates(Y,X,Q,Q),J=30*t.magnitude(t.subtract(K,Z,K))*2,$=A;$.x=J,$.y=J;var ee=this._upSamplePassState.scissorTest.rectangle;return ee.x=Math.max(Z.x-.5*$.x,0),ee.y=Math.max(Z.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._uCenter=t.clone(Z,this._uCenter),this._uRadius=.5*Math.max($.x,$.y),X=l.computeViewportTransformation(L,0,1,D),Z=c.pointToGLWindowCoordinates(q,X,W,P),$.x*=R/a,$.y*=N/p,ee=this._downSamplePassState.scissorTest.rectangle,ee.x=Math.max(Z.x-.5*$.x,0),ee.y=Math.max(Z.y-.5*$.y,0),ee.width=Math.min($.x,a),ee.height=Math.min($.y,p),this._downSamplePassState.context=r,this._upSamplePassState.context=r,this._fbo},S.prototype.isDestroyed=function(){return!1},S.prototype.destroy=function(){return this._fbo=this._fbo&&this._fbo.destroy(),this._downSampleFBO1=this._downSampleFBO1&&this._downSampleFBO1.destroy(),this._downSampleFBO2=this._downSampleFBO2&&this._downSampleFBO2.destroy(),this._downSampleCommand=this._downSampleCommand&&this._downSampleCommand.shaderProgram&&this._downSampleCommand.shaderProgram.destroy(),this._brightPassCommand=this._brightPassCommand&&this._brightPassCommand.shaderProgram&&this._brightPassCommand.shaderProgram.destroy(),this._blurXCommand=this._blurXCommand&&this._blurXCommand.shaderProgram&&this._blurXCommand.shaderProgram.destroy(),this._blurYCommand=this._blurYCommand&&this._blurYCommand.shaderProgram&&this._blurYCommand.shaderProgram.destroy(),this._blendCommand=this._blendCommand&&this._blendCommand.shaderProgram&&this._blendCommand.shaderProgram.destroy(),this._fullScreenCommand=this._fullScreenCommand&&this._fullScreenCommand.shaderProgram&&this._fullScreenCommand.shaderProgram.destroy(),a(this)},S}),define("Scene/Scene",["../Core/BoundingRectangle","../Core/BoundingSphere","../Core/BoxGeometry","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/Cartographic","../Core/Color","../Core/ColorGeometryInstanceAttribute","../Core/createGuid","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/DeveloperError","../Core/EllipsoidGeometry","../Core/Event","../Core/GeographicProjection","../Core/GeometryInstance","../Core/GeometryPipeline","../Core/getTimestamp","../Core/Intersect","../Core/Interval","../Core/JulianDate","../Core/Math","../Core/Matrix4","../Core/mergeSort","../Core/Occluder","../Core/PixelFormat","../Core/ShowGeometryInstanceAttribute","../Core/Transforms","../Renderer/ClearCommand","../Renderer/ComputeEngine","../Renderer/Context","../Renderer/ContextLimits","../Renderer/DrawCommand","../Renderer/Framebuffer","../Renderer/Pass","../Renderer/PassState","../Renderer/PixelDatatype","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/Texture","./Camera","./CreditDisplay","./CullingVolume","./DebugCameraPrimitive","./DepthPlane","./DeviceOrientationCameraController","./Fog","./FrameState","./FrustumCommands","./FXAA","./GlobeDepth","./JobScheduler","./MapMode2D","./OIT","./OrthographicFrustum","./OrthographicOffCenterFrustum","./PerformanceDisplay","./PerInstanceColorAppearance","./PerspectiveFrustum","./PerspectiveOffCenterFrustum","./PickDepth","./Primitive","./PrimitiveCollection","./SceneMode","./SceneTransforms","./SceneTransitioner","./ScreenSpaceCameraController","./ShadowMap","./SunPostProcess","./TweenCollection"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R,N,k,L,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,ge,ve,_e,ye){"use strict";function be(t){t=c(t,c.EMPTY_OBJECT);var r=t.canvas,i=t.contextOptions,n=t.creditContainer,o=new R(r,i);d(n)||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",r.parentNode.appendChild(n)),this._id=u(),this._jobScheduler=new te,this._frameState=new K(o,new j(n),this._jobScheduler),this._frameState.scene3DOnly=c(t.scene3DOnly,!1);var a=new B(o);a.viewport=new e,a.viewport.x=0,a.viewport.y=0,a.viewport.width=o.drawingBufferWidth,a.viewport.height=o.drawingBufferHeight,this._passState=a,this._canvas=r,this._context=o,this._computeEngine=new O(o),this._globe=void 0,this._primitives=new he,this._groundPrimitives=new he,this._tweens=new ye,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._frustumCommandsList=[],this._overlayCommandList=[],this._pickFramebuffer=void 0,this._useOIT=c(t.orderIndependentTranslucency,!0),this._executeOITFunction=void 0;var l;o.depthTexture&&(l=new ee);var h;this._useOIT&&d(l)&&(h=new ie(o)),this._globeDepth=l,this._depthPlane=new X,this._oit=h,this._fxaa=new $,this._clearColorCommand=new M({color:new s,stencil:0,owner:this}),this._depthClearCommand=new M({depth:1,owner:this}),this._stencilClearCommand=new M({stencil:0}),this._pickDepths=[],this._debugGlobeDepths=[],this._pickDepthPassState=void 0,this._pickDepthFramebuffer=void 0,this._pickDepthFramebufferWidth=void 0,this._pickDepthFramebufferHeight=void 0,this._depthOnlyRenderStateCache={},this._transitioner=new me(this),this._renderError=new g,this._preRender=new g,this._postRender=new g,this._cameraStartFired=!1,this._cameraMovedTime=void 0,this._pickPositionCache={},this._pickPositionCacheDirty=!1,this._minimumDisableDepthTestDistance=0,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new g,this.morphComplete=new g,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=s.clone(s.BLACK),this._mode=pe.SCENE3D,this._mapProjection=d(t.mapProjection)?t.mapProjection:new v,this.morphTime=1,this.farToNearRatio=1e3,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this._debugFrustumStatistics=void 0,this.debugShowFramesPerSecond=!1,this.debugShowGlobeDepth=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.fxaa=!0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.copyGlobeDepth=!1,this.fog=new Z,this._sunCamera=new W(this),this.shadowMap=new ve({context:o,lightCamera:this._sunCamera,enabled:c(t.shadows,!1)}),this._terrainExaggeration=c(t.terrainExaggeration,1),this._performanceDisplay=void 0,this._debugVolume=void 0;var p=new W(this);this._camera=p,this._cameraClone=W.clone(p),this._screenSpaceCameraController=new ge(this),this._mapMode2D=c(t.mapMode2D,re.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,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useFXAA:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0;var f=p.frustum.near,m=p.frustum.far,_=Math.ceil(Math.log(m/f)/Math.log(this.farToNearRatio));Pe(f,m,this.farToNearRatio,_,this._frustumCommandsList,!1,void 0),xe(this,0,S.now()),this.initializeFrame()}function Ce(e,t){var r=Math.max(Math.abs(e.x),Math.abs(t.x)),i=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(r,i),n)}function we(e,t,r){var i=1/Math.max(1,Ce(e.position,t.position));return n.multiplyByScalar(e.position,i,ct),n.multiplyByScalar(t.position,i,dt),n.equalsEpsilon(ct,dt,r)&&n.equalsEpsilon(e.direction,t.direction,r)&&n.equalsEpsilon(e.up,t.up,r)&&n.equalsEpsilon(e.right,t.right,r)&&T.equalsEpsilon(e.transform,t.transform,r)}function Se(e,t){var r=e.frameState,i=e._context,n=r.shadowHints.shadowsEnabled,o=r.shadowHints.shadowMaps,a=r.shadowHints.lightShadowMaps,s=n&&a.length>0,l=!1,u=r.shadowHints.lastDirtyTime;t.lastDirtyTime!==u&&(t.lastDirtyTime=u,t.dirty=!0,l=!0);var c=t.derivedCommands;if(t.dirty&&d(c)){t.dirty=!1,n&&(t.receiveShadows||t.castShadows)&&(c.shadows=ve.createDerivedCommands(o,a,t,l,i,c.shadows));var h=e._oit;t.pass===F.TRANSLUCENT&&d(h)&&h.isSupported()&&(s&&t.receiveShadows?(c.oit=d(c.oit)?c.oit:{},c.oit.shadows=h.createDerivedCommands(t.derivedCommands.shadows.receiveCommand,i,c.oit.shadows)):c.oit=h.createDerivedCommands(t,i,c.oit)),c.depth=at(e,t,i,c.depth)}}function Ee(e){var t=e.globe;if(e._mode===pe.SCENE3D&&d(t)){var r=t.ellipsoid;return ht.radius=r.minimumRadius,ut=P.fromBoundingSphere(ht,e._camera.positionWC,ut)}}function Te(e){e.render=!1,e.pick=!1,e.depth=!1}function xe(e,t,r){var i=e._camera,n=e._frameState;n.commandList.length=0,n.shadowMaps.length=0,n.mode=e._mode,n.morphTime=e.morphTime,n.mapProjection=e.mapProjection,n.frameNumber=t,n.time=S.clone(r,n.time),n.camera=i,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),n.occluder=Ee(e),n.terrainExaggeration=e._terrainExaggeration,n.minimumDisableDepthTestDistance=e._minimumDisableDepthTestDistance,d(e.globe)?n.maximumScreenSpaceError=e.globe.maximumScreenSpaceError:n.maximumScreenSpaceError=2,Te(n.passes)}function Pe(e,t,r,i,n,o,a){n.length=i;for(var s=0;s<i;++s){var l,u;o?(l=Math.min(t-a,e+s*a),u=Math.min(t,l+a)):(l=Math.max(e,Math.pow(r,s)*e),u=Math.min(t,r*l));var c=n[s];d(c)?(c.near=l,c.far=u):c=n[s]=new J(l,u)}}function Ae(e,t,r){e.debugShowFrustums&&(t.debugOverlappingFrustums=0),e.frameState.passes.pick||Se(e,t);for(var i=e._frustumCommandsList,n=i.length,o=0;o<n;++o){var a=i[o],s=a.near,l=a.far;if(!(r.start>l)){if(r.stop<s)break;var u=t.pass,c=a.indices[u]++;if(a.commands[u][c]=t,e.debugShowFrustums&&(t.debugOverlappingFrustums|=1<<o),t.executeInClosestFrustum)break}}if(e.debugShowFrustums){var h=e._debugFrustumStatistics.commandsInFrustums;h[t.debugOverlappingFrustums]=d(h[t.debugOverlappingFrustums])?h[t.debugOverlappingFrustums]+1:1,++e._debugFrustumStatistics.totalCommands}}function De(e,t,r){return d(e)&&(!d(e.boundingVolume)||!e.cull||t.computeVisibility(e.boundingVolume)!==C.OUTSIDE&&(!d(r)||!e.boundingVolume.isOccluded(r)))}function Ie(e){var t=e._frameState,r=t.camera,i=r.directionWC,n=r.positionWC,o=e._computeCommandList,a=e._overlayCommandList,s=t.commandList;e.debugShowFrustums&&(e._debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});for(var l=e._frustumCommandsList,u=l.length,c=F.NUMBER_OF_PASSES,h=0;h<u;++h)for(var p=0;p<c;++p)l[h].indices[p]=0;o.length=0,a.length=0;for(var f=Number.MAX_VALUE,m=-Number.MAX_VALUE,g=!1,v=t.shadowHints.shadowsEnabled,_=Number.MAX_VALUE,y=-Number.MAX_VALUE,b=Number.MAX_VALUE,C=t.mode===pe.SCENE3D?t.occluder:void 0,w=t.cullingVolume,S=pt.planes,T=0;T<5;++T)S[T]=w.planes[T];w=pt;for(var x=s.length,P=0;P<x;++P){var A=s[P],D=A.pass;if(D===F.COMPUTE)o.push(A);else if(D===F.OVERLAY)a.push(A);else{var I=A.boundingVolume;if(d(I)){if(!De(A,w,C))continue;if(ft=I.computePlaneDistances(n,i,ft),f=Math.min(f,ft.start),m=Math.max(m,ft.stop),v&&A.receiveShadows&&ft.start<ve.MAXIMUM_DISTANCE&&!(D===F.GLOBE&&ft.start<-100&&ft.stop>100)){var O=ft.stop-ft.start;D!==F.GLOBE&&ft.start<100&&(b=Math.min(b,O)),_=Math.min(_,ft.start),y=Math.max(y,ft.stop)}}else ft.start=r.frustum.near,ft.stop=r.frustum.far,g=!(A instanceof M);Ae(e,A,ft)}}g?(f=r.frustum.near,m=r.frustum.far):(f=Math.min(Math.max(f,r.frustum.near),r.frustum.far),m=Math.max(Math.min(m,r.frustum.far),f),v&&(_=Math.min(Math.max(_,r.frustum.near),r.frustum.far),y=Math.max(Math.min(y,r.frustum.far),_))),v&&(t.shadowHints.nearPlane=_,t.shadowHints.farPlane=y,t.shadowHints.closestObjectSize=b);var R,N=e.mode===pe.SCENE2D,k=e.farToNearRatio;N?(m=Math.min(m,r.position.z+e.nearToFarDistance2D),f=Math.min(f,m),R=Math.ceil(Math.max(1,m-f)/e.nearToFarDistance2D)):R=Math.ceil(Math.log(m/f)/Math.log(k)),f!==Number.MAX_VALUE&&(R!==u||0!==l.length&&(f<l[0].near||m>l[u-1].far&&!E.equalsEpsilon(m,l[u-1].far,E.EPSILON8)))&&(Pe(f,m,k,R,l,N,e.nearToFarDistance2D),Ie(e));var L=t.frustumSplits;L.length=R+1;for(var B=0;B<R;++B)L[B]=l[B].near,B===R-1&&(L[B+1]=l[B].far)}function Me(e){var t={},r=e.vertexAttributes;for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i].index);return t}function Oe(e,t,r){var i=t.context,n=c(r,e.shaderProgram),o=n.fragmentShaderSource.clone(),a=[];o.sources=o.sources.map(function(e){e=G.replaceMain(e,"czm_Debug_main");for(var t,r=/gl_FragData\[(\d+)\]/g;null!==(t=r.exec(e));)a.indexOf(t[1])===-1&&a.push(t[1]);return e});var l,u=a.length,h="void main() \n{ \n czm_Debug_main(); \n";if(t.debugShowCommands){d(e._debugColor)||(e._debugColor=s.fromRandom());var p=e._debugColor;if(u>0)for(l=0;l<u;++l)h+=" gl_FragData["+a[l]+"].rgb *= vec3("+p.red+", "+p.green+", "+p.blue+"); \n";else h+=" gl_FragColor.rgb *= vec3("+p.red+", "+p.green+", "+p.blue+"); \n"}if(t.debugShowFrustums){var f=1&e.debugOverlappingFrustums?"1.0":"0.0",m=2&e.debugOverlappingFrustums?"1.0":"0.0",g=4&e.debugOverlappingFrustums?"1.0":"0.0";if(u>0)for(l=0;l<u;++l)h+=" gl_FragData["+a[l]+"].rgb *= vec3("+f+", "+m+", "+g+"); \n";else h+=" gl_FragColor.rgb *= vec3("+f+", "+m+", "+g+"); \n"}h+="}",o.sources.push(h);var v=Me(n);return z.fromCache({context:i,vertexShaderSource:n.vertexShaderSource,fragmentShaderSource:o,attributeLocations:v})}function Re(e,t,r){var i=k.shallowClone(e);i.shaderProgram=Oe(e,t),i.execute(t.context,r),i.shaderProgram.destroy()}function Ne(e,t,i,o,a){if(!d(t.debugCommandFilter)||t.debugCommandFilter(e)){var s=t.frameState.shadowHints.shadowsEnabled,u=s&&t.frameState.shadowHints.lightShadowMaps.length>0;if(t.debugShowCommands||t.debugShowFrustums?Re(e,t,o):u&&e.receiveShadows&&d(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(i,o):t.frameState.passes.depth&&d(e.derivedCommands.depth)?e.derivedCommands.depth.depthOnlyCommand.execute(i,o):e.execute(i,o),e.debugShowBoundingVolume&&d(e.boundingVolume)){var c=t._frameState,h=e.boundingVolume;d(t._debugVolume)&&t._debugVolume.destroy();var p,f=n.clone(h.center);if(c.mode!==pe.SCENE3D){f=T.multiplyByPoint(mt,f,f);var g=c.mapProjection,v=g.unproject(f);f=g.ellipsoid.cartographicToCartesian(v)}if(d(h.radius)){var b=h.radius;p=y.toWireframe(m.createGeometry(new m({radii:new n(b,b,b),vertexFormat:se.FLAT_VERTEX_FORMAT}))),t._debugVolume=new de({geometryInstances:new _({geometry:p,modelMatrix:T.fromTranslation(f),attributes:{color:new l(1,0,0,1)}}),appearance:new se({flat:!0,translucent:!1}),asynchronous:!1})}else{var C=h.halfAxes;p=y.toWireframe(r.createGeometry(r.fromDimensions({dimensions:new n(2,2,2),vertexFormat:se.FLAT_VERTEX_FORMAT}))),t._debugVolume=new de({geometryInstances:new _({geometry:p,modelMatrix:T.fromRotationTranslation(C,f,new T),attributes:{color:new l(1,0,0,1)}}),appearance:new se({flat:!0,translucent:!1}),asynchronous:!1})}var w=c.commandList,S=c.commandList=[];t._debugVolume.update(c);var E;d(a)&&(E=o.framebuffer,o.framebuffer=a),S[0].execute(i,o),d(E)&&(o.framebuffer=E),c.commandList=w}}}function ke(e,t,r){return t.boundingVolume.distanceSquaredTo(r)-e.boundingVolume.distanceSquaredTo(r)}function Le(e,t,r,i){var n=e.context;x(i,ke,e._camera.positionWC);for(var o=i.length,a=0;a<o;++a)t(i[a],e,n,r)}function Fe(e,t){var r=e._debugGlobeDepths[t];return!d(r)&&e.context.depthTexture&&(r=new ee,e._debugGlobeDepths[t]=r),r}function Be(e,t){var r=e._pickDepths[t];return d(r)||(r=new ce,e._pickDepths[t]=r),r}function Ue(e,t){var r=e._camera,i=e.context,n=i.uniformState;n.updateCamera(r);var o;o=d(r.frustum.fov)?r.frustum.clone(gt):d(r.frustum.infiniteProjectionMatrix)?r.frustum.clone(vt):d(r.frustum.width)?r.frustum.clone(_t):r.frustum.clone(yt),o.near=r.frustum.near,o.far=r.frustum.far,n.updateFrustum(o),n.updatePass(F.ENVIRONMENT);var a=e._useWebVR&&e.mode!==pe.SCENE2D,s=e._frameState.passes,l=s.pick,u=s.depth,c=e._environmentState;if(!l){var h=c.skyBoxCommand;if(d(h)&&Ne(h,e,i,t),c.isSkyAtmosphereVisible&&Ne(c.skyAtmosphereCommand,e,i,t),c.isSunVisible&&(c.sunDrawCommand.execute(i,t),e.sunBloom&&!a)){var p;p=c.useGlobeDepthFramebuffer?e._globeDepth.framebuffer:c.useFXAA?e._fxaa.getColorFramebuffer():c.originalFramebuffer,e._sunPostProcess.execute(i,p),t.framebuffer=p}c.isMoonVisible&&c.moonCommand.execute(i,t)}var f;c.useOIT?(d(e._executeOITFunction)||(e._executeOITFunction=function(e,t,r,i){e._oit.executeCommands(e,t,r,i)}),f=e._executeOITFunction):f=Le;for(var m,g=c.clearGlobeDepth,v=c.useDepthPlane,_=e._depthClearCommand,y=e._depthPlane,b=r.position.z,C=e._frustumCommandsList,w=C.length,S=0;S<w;++S){var E=w-S-1,T=C[E];e.mode===pe.SCENE2D?(r.position.z=b-T.near+1,o.far=Math.max(1,T.far-T.near),o.near=1,n.update(e.frameState),n.updateFrustum(o)):(o.near=0!==E?T.near*lt:T.near,o.far=T.far,n.updateFrustum(o));var x,P=e.debugShowGlobeDepth?Fe(e,E):e._globeDepth;e.debugShowGlobeDepth&&d(P)&&c.useGlobeDepthFramebuffer&&(x=t.framebuffer,t.framebuffer=P.framebuffer),_.execute(i,t),n.updatePass(F.GLOBE);var A=T.commands[F.GLOBE],D=T.indices[F.GLOBE];for(m=0;m<D;++m)Ne(A[m],e,i,t);for(d(P)&&c.useGlobeDepthFramebuffer&&(e.copyGlobeDepth||e.debugShowGlobeDepth)&&(P.update(i,t),P.executeCopyDepth(i,t)),e.debugShowGlobeDepth&&d(P)&&c.useGlobeDepthFramebuffer&&(t.framebuffer=x),n.updatePass(F.GROUND),A=T.commands[F.GROUND],D=T.indices[F.GROUND],m=0;m<D;++m)Ne(A[m],e,i,t);D>0&&i.stencilBuffer&&e._stencilClearCommand.execute(i,t),g&&(_.execute(i,t),v&&y.execute(i,t));for(var I=F.GROUND+1,M=F.TRANSLUCENT,O=I;O<M;++O)for(n.updatePass(O),A=T.commands[O],D=T.indices[O],m=0;m<D;++m)Ne(A[m],e,i,t);if(0!==E&&e.mode!==pe.SCENE2D&&(o.near=T.near,n.updateFrustum(o)),n.updatePass(F.TRANSLUCENT),A=T.commands[F.TRANSLUCENT],A.length=T.indices[F.TRANSLUCENT],f(e,Ne,t,A),d(P)&&(c.useGlobeDepthFramebuffer||u)&&e.useDepthPicking){var R=u?t.framebuffer.depthStencilTexture:P.framebuffer.depthStencilTexture,N=Be(e,E);N.update(i,R),N.executeCopyDepth(i,t)}}}function Ve(e){var t=e.context.uniformState;t.updatePass(F.COMPUTE);var r=e._environmentState.sunComputeCommand;d(r)&&r.execute(e._computeEngine);for(var i=e._computeCommandList,n=i.length,o=0;o<n;++o)i[o].execute(e._computeEngine)}function ze(e,t){var r=e.context.uniformState;r.updatePass(F.OVERLAY);for(var i=e.context,n=e._overlayCommandList,o=n.length,a=0;a<o;++a)n[a].execute(i,t)}function Ge(e,t,r){for(var i=r.shadowMapCullingVolume,n=r.isPointLight,o=r.passes,a=o.length,s=t.length,l=0;l<s;++l){var u=t[l];if(Se(e,u),u.castShadows&&(u.pass===F.GLOBE||u.pass===F.OPAQUE||u.pass===F.TRANSLUCENT)&&De(u,i))if(n)for(var c=0;c<a;++c)o[c].commandList.push(u);else if(1===a)o[0].commandList.push(u);else for(var d=!1,h=a-1;h>=0;--h){var p=o[h].cullingVolume;if(De(u,p))o[h].commandList.push(u),d=!0;else if(d)break}}}function He(e){var t=e.frameState,r=t.shadowHints.shadowMaps,i=r.length;if(t.shadowHints.shadowsEnabled)for(var n=e.context,o=n.uniformState,a=0;a<i;++a){var s=r[a];if(!s.outOfView){var l,u=s.passes,c=u.length;for(l=0;l<c;++l)u[l].commandList.length=0;var d=e.frameState.commandList;for(Ge(e,d,s),l=0;l<c;++l){var h=s.passes[l];o.updateCamera(h.camera),s.updatePass(n,l);for(var p=h.commandList.length,f=0;f<p;++f){var m=h.commandList[f];o.updatePass(m.pass),Ne(m.derivedCommands.shadows.castCommands[a],e,n,h.passState)}}}}}function We(e,t,r){var i=e._context,o=t.viewport;o.x=0,o.y=0,o.width=i.drawingBufferWidth,o.height=i.drawingBufferHeight;var a=e._frameState,s=a.camera,l=a.mode,u=a.passes.depth;if(e._useWebVR&&l!==pe.SCENE2D){Ke(e,t,r),u||Ze(e),Ie(e),u||(Ve(e),He(e)),o.x=0,o.y=0,o.width=.5*i.drawingBufferWidth,o.height=i.drawingBufferHeight;var c=W.clone(s,e._cameraVR),d=s.frustum.near,h=5*d,p=h/30,f=n.multiplyByScalar(c.right,.5*p,At);s.frustum.aspectRatio=o.width/o.height;var m=.5*p*d/h;n.add(c.position,f,s.position),s.frustum.xOffset=m,Ue(e,t),o.x=t.viewport.width,n.subtract(c.position,f,s.position),s.frustum.xOffset=-m,Ue(e,t),W.clone(c,s)}else Ke(e,t,r),l!==pe.SCENE2D||e._mapMode2D===re.ROTATE?qe(!0,e,t):je(e,t)}function je(t,r){var i=t.context,o=t.frameState,a=t.camera,s=r.viewport,l=e.clone(s,Pt);r.viewport=l;var u=bt,c=Ct,d=t.mapProjection;d.project(u,c);var h=n.clone(a.position,wt),p=T.clone(a.transform,Et),f=a.frustum.clone();a._setTransform(T.IDENTITY);var m=T.computeViewportTransformation(l,0,1,St),g=a.frustum.projectionMatrix,v=a.positionWC.y,_=n.fromElements(E.sign(v)*c.x-v,0,-a.positionWC.x,Tt),y=I.pointToGLWindowCoordinates(g,m,_,xt);y.x=Math.floor(y.x);var b=l.x,C=l.width;if(0===v||y.x<=b||y.x>=b+C)qe(!0,t,r);else if(Math.abs(b+.5*C-y.x)<1)l.width=y.x-l.x,a.position.x*=E.sign(a.position.x),a.frustum.right=0,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(o),qe(!0,t,r),l.x=y.x,a.position.x=-a.position.x,a.frustum.right=-a.frustum.left,a.frustum.left=0,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(o),qe(!1,t,r);else if(y.x>b+.5*C){l.width=y.x-b;var w=a.frustum.right;a.frustum.right=c.x-v,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(o),qe(!0,t,r),l.x=y.x,l.width=b+C-y.x,a.position.x=-a.position.x,a.frustum.left=-a.frustum.right,a.frustum.right=w-2*a.frustum.right,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(o),qe(!1,t,r)}else{l.x=y.x,l.width=b+C-y.x;var S=a.frustum.left;a.frustum.left=-c.x-v,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(o),qe(!0,t,r),l.x=b,l.width=y.x-b,a.position.x=-a.position.x,a.frustum.right=-a.frustum.left,a.frustum.left=S-2*a.frustum.left,o.cullingVolume=a.frustum.computeCullingVolume(a.positionWC,a.directionWC,a.upWC),i.uniformState.update(o),qe(!1,t,r)}a._setTransform(p),n.clone(h,a.position),a.frustum=f.clone(),r.viewport=s}function qe(e,t,r){var i=t.frameState.passes.depth;e||i||(t.frameState.commandList.length=0),i||Ze(t),Ie(t),e&&!i&&(Ve(t),He(t)),Ue(t,r)}function Ye(e,t){var r=e._frameState,i=e._environmentState,n=r.passes.render,o=e.skyAtmosphere,a=e.globe;if(!n||e._mode!==pe.SCENE2D&&r.camera.frustum instanceof ne)i.skyAtmosphereCommand=void 0,i.skyBoxCommand=void 0,i.sunDrawCommand=void 0,i.sunComputeCommand=void 0,i.moonCommand=void 0;else{d(o)&&d(a)&&(o.setDynamicAtmosphereColor(a.enableLighting),i.isReadyForAtmosphere=i.isReadyForAtmosphere||a._surface._tilesToRender.length>0),i.skyAtmosphereCommand=d(o)?o.update(r):void 0,i.skyBoxCommand=d(e.skyBox)?e.skyBox.update(r):void 0;var s=d(e.sun)?e.sun.update(r,t):void 0;i.sunDrawCommand=d(s)?s.drawCommand:void 0,i.sunComputeCommand=d(s)?s.computeCommand:void 0,i.moonCommand=d(e.moon)?e.moon.update(r):void 0}var l=i.clearGlobeDepth=d(a)&&(!a.depthTestAgainstTerrain||e.mode===pe.SCENE2D),u=i.useDepthPlane=l&&e.mode===pe.SCENE3D;u&&e._depthPlane.update(r);for(var c=r.mode===pe.SCENE3D?r.occluder:void 0,h=r.cullingVolume,p=pt.planes,f=0;f<5;++f)p[f]=h.planes[f];h=pt,i.isSkyAtmosphereVisible=d(i.skyAtmosphereCommand)&&i.isReadyForAtmosphere,i.isSunVisible=De(i.sunDrawCommand,h,c),i.isMoonVisible=De(i.moonCommand,h,c)}function Xe(e){var t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new Y({camera:e.camera,updateOnChange:!1}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),d(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Qe(e){var t=e._frameState,r=t.shadowMaps,i=r.length,n=i>0&&!t.passes.pick&&e.mode===pe.SCENE3D;if(n!==t.shadowHints.shadowsEnabled&&(++t.shadowHints.lastDirtyTime,t.shadowHints.shadowsEnabled=n),n){for(var o=0;o<i;++o)if(r[o]!==t.shadowHints.shadowMaps[o]){++t.shadowHints.lastDirtyTime;break}t.shadowHints.shadowMaps.length=0,t.shadowHints.lightShadowMaps.length=0;for(var a=0;a<i;++a){var s=r[a];s.update(t),t.shadowHints.shadowMaps.push(s),s.fromLightSource&&t.shadowHints.lightShadowMaps.push(s),s.dirty&&(++t.shadowHints.lastDirtyTime,s.dirty=!1)}}}function Ze(e){ +var t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),Xe(e),Qe(e),e._globe&&e._globe.update(t)}function Ke(e,t,r){var i=e._context,n=e._environmentState,o=e._frameState.passes,a=o.pick,l=e._useWebVR&&e.mode!==pe.SCENE2D;n.originalFramebuffer=t.framebuffer,d(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!l?e._sunPostProcess=new _e:d(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!d(e.sun)&&d(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);var u=e._clearColorCommand;s.clone(r,u.color),u.execute(i,t);var c=n.useGlobeDepthFramebuffer=!a&&d(e._globeDepth);c&&(e._globeDepth.update(i,t),e._globeDepth.clear(i,t,r));var h=n.useOIT=!a&&d(e._oit)&&e._oit.isSupported();h&&(e._oit.update(i,t,e._globeDepth.framebuffer),e._oit.clear(i,t,r),n.useOIT=e._oit.isSupported());var p=n.useFXAA=!a&&e.fxaa;p&&(e._fxaa.update(i,t),e._fxaa.clear(i,t,r)),n.isSunVisible&&e.sunBloom&&!l?t.framebuffer=e._sunPostProcess.update(t):c?t.framebuffer=e._globeDepth.framebuffer:p&&(t.framebuffer=e._fxaa.getColorFramebuffer()),d(t.framebuffer)&&u.execute(i,t)}function Je(e,t){var r=e._context,i=e._environmentState,n=i.useGlobeDepthFramebuffer;if(e.debugShowGlobeDepth&&n){var o=Fe(e,e.debugShowDepthFrustum-1);o.executeDebugGlobeDepth(r,t)}if(e.debugShowPickDepth&&n){var a=Be(e,e.debugShowDepthFrustum-1);a.executeDebugPickDepth(r,t)}var s=i.useOIT,l=i.useFXAA;s&&(t.framebuffer=l?e._fxaa.getColorFramebuffer():void 0,e._oit.execute(r,t)),l&&(!s&&n&&(t.framebuffer=e._fxaa.getColorFramebuffer(),e._globeDepth.executeCopyColor(r,t)),t.framebuffer=i.originalFramebuffer,e._fxaa.execute(r,t)),s||l||!n||(t.framebuffer=i.originalFramebuffer,e._globeDepth.executeCopyColor(r,t))}function $e(e){for(var t=e.afterRender,r=0,i=t.length;r<i;++r)t[r]();t.length=0}function et(e,t){e._pickPositionCacheDirty=!0,d(t)||(t=S.now());var r=e._camera;we(r,e._cameraClone,E.EPSILON6)?e._cameraStartFired&&b()-e._cameraMovedTime>e.cameraEventWaitTime&&(r.moveEnd.raiseEvent(),e._cameraStartFired=!1):(e._cameraStartFired||(r.moveStart.raiseEvent(),e._cameraStartFired=!0),e._cameraMovedTime=b(),W.clone(r,e._cameraClone)),e._preRender.raiseEvent(e,t),e._jobScheduler.resetBudgets();var i=e.context,o=i.uniformState,a=e._frameState,l=E.incrementWrap(a.frameNumber,15e6,1);xe(e,l,t),a.passes.render=!0;var u=c(e.backgroundColor,s.BLACK);a.backgroundColor=u,a.creditDisplay.beginFrame(),e.fog.update(a),o.update(a);var h=e.shadowMap;d(h)&&h.enabled&&(n.negate(o.sunDirectionWC,e._sunCamera.direction),a.shadowMaps.push(h)),e._computeCommandList.length=0,e._overlayCommandList.length=0;var p=e._passState;if(p.framebuffer=void 0,p.blendingEnabled=void 0,p.scissorTest=void 0,d(e.globe)&&e.globe.beginFrame(a),Ye(e,p),We(e,p,u),Je(e,p),ze(e,p),d(e.globe)&&e.globe.endFrame(a),a.creditDisplay.endFrame(),e.debugShowFramesPerSecond){if(!d(e._performanceDisplay)){var f=document.createElement("div");f.className="cesium-performanceDisplay-defaultContainer";var m=e._canvas.parentNode;m.appendChild(f);var g=new ae({container:f});e._performanceDisplay=g,e._performanceContainer=f}e._performanceDisplay.update()}else d(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer));i.endFrame(),$e(a),e._postRender.raiseEvent(e,t)}function tt(e,t,r,i){var o=e._camera,a=o.frustum;d(a._offCenterFrustum)&&(a=a._offCenterFrustum);var s=e._passState.viewport,l=2*(t.x-s.x)/s.width-1;l*=.5*(a.right-a.left);var u=2*(s.height-t.y-s.y)/s.height-1;u*=.5*(a.top-a.bottom);var c=T.clone(o.transform,Rt);o._setTransform(T.IDENTITY);var h=n.clone(o.position,It);n.multiplyByScalar(o.right,l,Mt),n.add(Mt,h,h),n.multiplyByScalar(o.up,u,Mt),n.add(Mt,h,h),o._setTransform(c),e.mode===pe.SCENE2D&&n.fromElements(h.z,h.x,h.y,h);var p=a.getPixelDimensions(s.width,s.height,1,Ot),f=Dt;return f.right=.5*p.x,f.left=-f.right,f.top=.5*p.y,f.bottom=-f.top,f.near=a.near,f.far=a.far,f.computeCullingVolume(h,o.directionWC,o.upWC)}function rt(e,t,r,i){var n=e._camera,o=n.frustum,a=o.near,s=Math.tan(.5*o.fovy),l=o.aspectRatio*s,u=e._passState.viewport,c=2*(t.x-u.x)/u.width-1,d=2*(u.height-t.y-u.y)/u.height-1,h=c*a*l,p=d*a*s,f=o.getPixelDimensions(u.width,u.height,1,Ot),m=f.x*r*.5,g=f.y*i*.5,v=Nt;return v.top=p+g,v.bottom=p-g,v.right=h+m,v.left=h-m,v.near=a,v.far=o.far,v.computeCullingVolume(n.positionWC,n.directionWC,n.upWC)}function it(e,t,r,i){var n=e.camera.frustum;return n instanceof ne||n instanceof oe?tt(e,t,r,i):rt(e,t,r,i)}function nt(e,t){var r=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(!d(r)){for(var i=t._attributeLocations,n=t.fragmentShaderSource,o=!1,a=n.sources,s=a.length,l=0;l<s;++l)if(Vt.test(a[l])||zt.test(a[l])){o=!0;break}o||(n=new G({sources:["void main() { gl_FragColor = vec4(1.0); }"]})),r=e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:n,attributeLocations:i})}return r}function ot(e,t){var r=e._depthOnlyRenderStateCache,i=r[t.id];if(!d(i)){var n=V.getState(t);n.depthMask=!0,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i=V.fromCache(n),r[t.id]=i}return i}function at(e,t,r,i){d(i)||(i={});var n,o;return d(i.depthOnlyCommand)&&(n=i.depthOnlyCommand.shaderProgram,o=i.depthOnlyCommand.renderState),i.depthOnlyCommand=k.shallowClone(t,i.depthOnlyCommand),d(n)&&i.shaderProgramId===t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=n,i.depthOnlyCommand.renderState=o):(i.depthOnlyCommand.shaderProgram=nt(r,t.shaderProgram),i.depthOnlyCommand.renderState=ot(e,t.renderState),i.shaderProgramId=t.shaderProgram.id),i}function st(t,r){var i=t._context,n=t._frameState;Te(n.passes),n.passes.pick=!0,n.passes.depth=!0,n.cullingVolume=it(t,r,1,1);var o=t._pickDepthPassState;d(o)||(o=t._pickDepthPassState=new B(i),o.scissorTest={enabled:!0,rectangle:new e},o.viewport=new e);var a=i.drawingBufferWidth,s=i.drawingBufferHeight,l=t._pickDepthFramebuffer,u=t._pickDepthFramebufferWidth,c=t._pickDepthFramebufferHeight;d(l)&&u===a&&c===s||(t._pickDepthFramebuffer=t._pickDepthFramebuffer&&t._pickDepthFramebuffer.destroy(),l=t._pickDepthFramebuffer=new L({context:i,depthStencilTexture:new H({context:i,width:a,height:s,pixelFormat:A.DEPTH_STENCIL,pixelDatatype:U.UNSIGNED_INT_24_8})}),t._pickDepthFramebufferWidth=a,t._pickDepthFramebufferHeight=s),o.framebuffer=l,o.viewport.width=a,o.viewport.height=s,o.scissorTest.rectangle.x=r.x,o.scissorTest.rectangle.y=s-r.y,o.scissorTest.rectangle.width=1,o.scissorTest.rectangle.height=1,We(t,o,Bt),Je(t,o),i.endFrame()}var lt=.9999;h(be.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 N.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return N.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._camera}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},frameState:{get:function(){return this._frameState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){return this.globe.imageryLayers}},terrainProvider:{get:function(){return this.globe.terrainProvider},set:function(e){this.globe.terrainProvider=e}},terrainProviderChanged:{get:function(){return this.globe.terrainProviderChanged}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return d(this._oit)}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===pe.SCENE2D?this.morphTo2D(0):e===pe.SCENE3D?this.morphTo3D(0):e===pe.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},numberOfFrustums:{get:function(){return this._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 W(this),d(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Q(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}}}),be.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};var ut,ct=new n,dt=new n,ht=new t,pt=new q,ft=new w,mt=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);mt=T.inverseTransformation(mt,mt);var gt=new le,vt=new ue,_t=new ne,yt=new oe,bt=new a(Math.PI,E.PI_OVER_TWO),Ct=new n,wt=new n,St=new T,Et=new T,Tt=new n,xt=new n,Pt=new e;be.prototype.initializeFrame=function(){120===this._shaderFrameCount++&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms()),this._tweens.update(),this._screenSpaceCameraController.update(),d(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this._camera.update(this._mode),this._camera._updateCameraChanged()};var At=new n;be.prototype.render=function(e){try{et(this,e)}catch(e){if(this._renderError.raiseEvent(this,e),this.rethrowRenderErrors)throw e}},be.prototype.clampLineWidth=function(e){return Math.max(N.minimumAliasedLineWidth,Math.min(e,N.maximumAliasedLineWidth))};var Dt=new oe,It=new n,Mt=new n,Ot=new i,Rt=new T,Nt=new ue,kt=3,Lt=3,Ft=new e(0,0,kt,Lt),Bt=new s(0,0,0,0),Ut=new i;be.prototype.pick=function(e){var t=this._context,r=t.uniformState,i=this._frameState,n=fe.transformWindowToDrawingBuffer(this,e,Ut);d(this._pickFramebuffer)||(this._pickFramebuffer=t.createPickFramebuffer()),this._jobScheduler.disableThisFrame(),xe(this,i.frameNumber,i.time),i.cullingVolume=it(this,n,kt,Lt),i.passes.pick=!0,r.update(i),Ft.x=n.x-.5*(kt-1),Ft.y=this.drawingBufferHeight-n.y-.5*(Lt-1);var o=this._pickFramebuffer.begin(Ft);We(this,o,Bt),Je(this,o);var a=this._pickFramebuffer.end(Ft);return t.endFrame(),$e(i),a};var Vt=/\bgl_FragDepthEXT\b/,zt=/\bdiscard\b/,Gt=new o,Ht=new o(1,1/255,1/65025,1/16581375);be.prototype.pickPositionWorldCoordinates=function(e,t){if(this.useDepthPicking){var r=e.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(r))return n.clone(this._pickPositionCache[r],t);var i=this._context,a=i.uniformState,s=fe.transformWindowToDrawingBuffer(this,e,Ut);this.pickTranslucentDepth&&st(this,s),s.y=this.drawingBufferHeight-s.y;var l,u=this._camera;l=d(u.frustum.fov)?u.frustum.clone(gt):d(u.frustum.infiniteProjectionMatrix)?u.frustum.clone(vt):d(u.frustum.width)?u.frustum.clone(_t):u.frustum.clone(yt);for(var c=this.numberOfFrustums,h=0;h<c;++h){var p=Be(this,h),f=i.readPixels({x:s.x,y:s.y,width:1,height:1,framebuffer:p.framebuffer}),m=o.unpack(f,0,Gt);o.divideByScalar(m,255,m);var g=o.dot(m,Ht);if(g>0&&g<1){var v,_=this._frustumCommandsList[h];return this.mode===pe.SCENE2D?(v=u.position.z,u.position.z=v-_.near+1,l.far=Math.max(1,_.far-_.near),l.near=1,a.update(this.frameState),a.updateFrustum(l)):(l.near=_.near*(0!==h?lt:1),l.far=_.far,a.updateFrustum(l)),t=fe.drawingBufferToWgs84Coordinates(this,s,g,t),this.mode===pe.SCENE2D&&(u.position.z=v,a.update(this.frameState)),this._pickPositionCache[r]=n.clone(t),t}}this._pickPositionCache[r]=void 0}};var Wt=new a;return be.prototype.pickPosition=function(e,t){if(t=this.pickPositionWorldCoordinates(e,t),d(t)&&this.mode!==pe.SCENE3D){n.fromElements(t.y,t.z,t.x,t);var r=this.mapProjection,i=r.ellipsoid,o=r.unproject(t,Wt);i.cartographicToCartesian(o,t)}return t},be.prototype.drillPick=function(e,t){var r,i,n=[],o=[],a=[];d(t)||(t=Number.MAX_VALUE);for(var s=this.pick(e);d(s)&&d(s.primitive)&&(n.push(s),!(0>=--t));){var l=s.primitive,u=!1;"function"==typeof l.getGeometryInstanceAttributes&&d(s.id)&&(i=l.getGeometryInstanceAttributes(s.id),d(i)&&d(i.show)&&(u=!0,i.show=D.toValue(!1,i.show),a.push(i))),u||(l.show=!1,o.push(l)),s=this.pick(e)}for(r=0;r<o.length;++r)o[r].show=!0;for(r=0;r<a.length;++r)i=a[r],i.show=D.toValue(!0,i.show);return n},be.prototype.completeMorph=function(){this._transitioner.completeMorph()},be.prototype.morphTo2D=function(e){var t,r=this.globe;t=d(r)?r.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo2D(e,t)},be.prototype.morphToColumbusView=function(e){var t,r=this.globe;t=d(r)?r.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphToColumbusView(e,t)},be.prototype.morphTo3D=function(e){var t,r=this.globe;t=d(r)?r.ellipsoid:this.mapProjection.ellipsoid,e=c(e,2),this._transitioner.morphTo3D(e,t)},be.prototype.isDestroyed=function(){return!1},be.prototype.destroy=function(){return 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._pickFramebuffer=this._pickFramebuffer&&this._pickFramebuffer.destroy(),this._pickDepthFramebuffer=this._pickDepthFramebuffer&&this._pickDepthFramebuffer.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.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),d(this._globeDepth)&&this._globeDepth.destroy(),d(this._oit)&&this._oit.destroy(),this._fxaa.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay.destroy(),d(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),p(this)},be.prototype.cartesianToCanvasCoordinates=function(e,t){return fe.wgs84ToWindowCoordinates(this,e,t)},be}),define("Scene/SingleTileImageryProvider",["../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/GeographicTilingScheme","../Core/loadImage","../Core/Rectangle","../Core/RuntimeError","../Core/TileProviderError","../ThirdParty/when"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(i){function n(e){C._image=e,C._tileWidth=e.width,C._tileHeight=e.height,C._ready=!0,C._readyPromise.resolve(!0),c.handleSuccess(C._errorEvent)}function h(e){var t="Failed to load image "+_+".";b=c.handleError(b,C,C._errorEvent,t,0,0,0,p,e),C._readyPromise.reject(new u(t))}function p(){d(s(_),n,h)}i=t(i,{});var f=i.url;this._url=f;var m=i.proxy;this._proxy=m;var g=t(i.rectangle,l.MAX_VALUE),v=new a({rectangle:g,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:i.ellipsoid});this._tilingScheme=v,this._image=void 0,this._texture=void 0,this._tileWidth=0,this._tileHeight=0,this._errorEvent=new o,this._ready=!1,this._readyPromise=d.defer();var _=f;r(m)&&(_=m.getURL(_));var y=i.credit;"string"==typeof y&&(y=new e(y)),this._credit=y;var b,C=this;p()}return i(h.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._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}}}),h.prototype.getTileCredits=function(e,t,r){},h.prototype.requestImage=function(e,t,r){return this._image},h.prototype.pickFeatures=function(e,t,r,i,n){},h}),define("Shaders/SkyAtmosphereFS",[],function(){"use strict";return"#ifdef COLOR_CORRECT\nuniform vec3 u_hsbShift;\n#endif\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 cosAngle = dot(czm_sunDirectionWC, 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);\nconst float exposure = 2.0;\nvec3 rgb = rayleighPhase * v_rayleighColor + miePhase * v_mieColor;\nrgb = vec3(1.0) - exp(-exposure * rgb);\nfloat l = czm_luminance(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);\nl = min(l, czm_luminance(rgb));\n#endif\ngl_FragColor = vec4(rgb, min(smoothstep(0.0, 0.1, l), 1.0) * smoothstep(0.0, 1.0, czm_morphTime));\n}\n"}),define("Shaders/SkyAtmosphereVS",[],function(){"use strict";return"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 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);\nvec3 lightDir = (u_cameraAndRadiiAndDynamicAtmosphereColor.w > 0.0) ? czm_sunPositionWC - czm_viewerPositionWC : czm_viewerPositionWC;\nlightDir = normalize(lightDir);\nfor(int i=0; i<nSamples; i++)\n{\nfloat height = length(samplePoint);\nfloat depth = exp((atmosphereScale / rayleighScaleDepth ) * (innerRadius - height));\nfloat fLightAngle = dot(lightDir, 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"}),define("Scene/SkyAtmosphere",["../Core/Cartesian3","../Core/Cartesian4","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/Ellipsoid","../Core/EllipsoidGeometry","../Core/GeometryPipeline","../Core/Math","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/ShaderSource","../Renderer/VertexArray","../Shaders/SkyAtmosphereFS","../Shaders/SkyAtmosphereVS","./BlendingState","./CullFace","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C){"use strict";function w(i){i=r(i,a.WGS84),this.show=!0,this._ellipsoid=i,this._command=new h({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 e;var n=new t;n.w=0,n.y=e.maximumComponent(e.multiplyByScalar(i.radii,1.025,new e)),n.z=i.maximumRadius,this._cameraAndRadiiAndDynamicAtmosphereColor=n;var o=this;this._command.uniformMap={u_cameraAndRadiiAndDynamicAtmosphereColor:function(){return o._cameraAndRadiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness}}}function S(e){return!(u.equalsEpsilon(e.hueShift,0,u.EPSILON7)&&u.equalsEpsilon(e.saturationShift,0,u.EPSILON7)&&u.equalsEpsilon(e.brightnessShift,0,u.EPSILON7))}return n(w.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),w.prototype.setDynamicAtmosphereColor=function(e){this._cameraAndRadiiAndDynamicAtmosphereColor.w=e?1:0},w.prototype.update=function(t){if(this.show){var r=t.mode;if((r===C.SCENE3D||r===C.MORPHING)&&t.passes.render){var n=this._command;if(!i(n.vertexArray)){var o=t.context,a=s.createGeometry(new s({radii:e.multiplyByScalar(this._ellipsoid.radii,1.025,new e),slicePartitions:256,stackPartitions:256,vertexFormat:c.POSITION_ONLY}));n.vertexArray=g.fromGeometry({context:o,geometry:a,attributeLocations:l.createAttributeLocations(a),bufferUsage:d.STATIC_DRAW}),n.renderState=p.fromCache({cull:{enabled:!0,face:b.FRONT},blending:y.ALPHA_BLEND});var u=new m({defines:["SKY_FROM_SPACE"],sources:[_]});this._spSkyFromSpace=f.fromCache({context:o,vertexShaderSource:u,fragmentShaderSource:v}),u=new m({defines:["SKY_FROM_ATMOSPHERE"],sources:[_]}),this._spSkyFromAtmosphere=f.fromCache({context:o,vertexShaderSource:u,fragmentShaderSource:v})}var h=S(this);if(h&&(!i(this._spSkyFromSpaceColorCorrect)||!i(this._spSkyFromAtmosphereColorCorrect))){var w=t.context,E=new m({defines:["SKY_FROM_SPACE"],sources:[_]}),T=new m({defines:["COLOR_CORRECT"],sources:[v]});this._spSkyFromSpaceColorCorrect=f.fromCache({context:w,vertexShaderSource:E,fragmentShaderSource:T}),E=new m({defines:["SKY_FROM_ATMOSPHERE"],sources:[_]}),this._spSkyFromAtmosphereColorCorrect=f.fromCache({context:w,vertexShaderSource:E,fragmentShaderSource:T})}var x=t.camera.positionWC,P=e.magnitude(x);return this._cameraAndRadiiAndDynamicAtmosphereColor.x=P,P>this._cameraAndRadiiAndDynamicAtmosphereColor.y?n.shaderProgram=h?this._spSkyFromSpaceColorCorrect:this._spSkyFromSpace:n.shaderProgram=h?this._spSkyFromAtmosphereColorCorrect:this._spSkyFromAtmosphere,n}}},w.prototype.isDestroyed=function(){return!1},w.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(),o(this)},w}),define("Shaders/SkyBoxFS",[],function(){"use strict";return"uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 rgb = textureCube(u_cubeMap, normalize(v_texCoord)).rgb;\ngl_FragColor = vec4(rgb, czm_morphTime);\n}\n"}),define("Shaders/SkyBoxVS",[],function(){"use strict";return"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"}),define("Scene/SkyBox",["../Core/BoxGeometry","../Core/Cartesian3","../Core/defaultValue","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Core/GeometryPipeline","../Core/Matrix4","../Core/VertexFormat","../Renderer/BufferUsage","../Renderer/CubeMap","../Renderer/DrawCommand","../Renderer/loadCubeMap","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/VertexArray","../Shaders/SkyBoxFS","../Shaders/SkyBoxVS","./BlendingState","./SceneMode"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y){"use strict";function b(e){this.sources=e.sources,this._sources=void 0,this.show=r(e.show,!0),this._command=new d({modelMatrix:s.clone(s.IDENTITY),owner:this}),this._cubeMap=void 0}return b.prototype.update=function(r){if(this.show&&(r.mode===y.SCENE3D||r.mode===y.MORPHING)&&r.passes.render){var n=r.context;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;"string"==typeof o.positiveX?h(n,this._sources).then(function(e){d._cubeMap=d._cubeMap&&d._cubeMap.destroy(),d._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new c({context:n,source:o}))}var s=this._command;if(!i(s.vertexArray)){var d=this;s.uniformMap={u_cubeMap:function(){return d._cubeMap}};var b=e.createGeometry(e.fromDimensions({dimensions:new t(2,2,2),vertexFormat:l.POSITION_ONLY})),C=a.createAttributeLocations(b);s.vertexArray=m.fromGeometry({context:n,geometry:b,attributeLocations:C,bufferUsage:u.STATIC_DRAW}),s.shaderProgram=f.fromCache({context:n,vertexShaderSource:v,fragmentShaderSource:g,attributeLocations:C}),s.renderState=p.fromCache({blending:_.ALPHA_BLEND})}if(i(this._cubeMap))return s}},b.prototype.isDestroyed=function(){return!1},b.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(),n(this)},b}),define("Shaders/SunFS",[],function(){"use strict";return"uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n"}),define("Shaders/SunTextureFS",[],function(){"use strict";return"uniform float u_glowLengthTS;\nuniform 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)\n{\nvec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);\nfloat radius = length(rotatedPosition);\nfloat burst = 1.0 - smoothstep(0.0, 0.55, radius);\nreturn vec4(burst);\n}\nvoid main()\n{\nvec2 position = v_textureCoordinates - vec2(0.5);\nfloat radius = length(position);\nfloat surface = step(radius, u_radiusTS);\nvec4 color = vec4(1.0, 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));\nburst += 0.4 * addBurst(position, vec2(0.99235, 0.12348));\nburst += 0.4 * addBurst(position, vec2(0.60327, -0.79754));\nburst += 0.3 * addBurst(position, vec2(0.31457, 0.94924));\nburst += 0.3 * addBurst(position, vec2(0.97931, 0.20239));\nburst += 0.3 * addBurst(position, vec2(0.66507, -0.74678));\ncolor += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;\ngl_FragColor = clamp(color, vec4(0.0), vec4(1.0));\n}\n"}),define("Shaders/SunVS",[],function(){"use strict";return"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"}),define("Scene/Sun",["../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartesian4","../Core/ComponentDatatype","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/PixelFormat","../Core/PrimitiveType","../Renderer/Buffer","../Renderer/BufferUsage","../Renderer/ComputeCommand","../Renderer/DrawCommand","../Renderer/RenderState","../Renderer/ShaderProgram","../Renderer/Texture","../Renderer/VertexArray","../Shaders/SunFS","../Shaders/SunTextureFS","../Shaders/SunVS","./BlendingState","./SceneMode","./SceneTransforms"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x){"use strict";function P(){this.show=!0,this._drawCommand=new g({primitiveType:h.TRIANGLES,boundingVolume:new e,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new e,this._boundingVolume2D=new e,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;var t=this;this._uniformMap={u_texture:function(){return t._texture},u_size:function(){return t._size}}}a(P.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){ +e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var A=new t,D=new t,I=new i,M=new i;return P.prototype.update=function(i,a){if(this.show){var s=i.mode;if(s!==T.SCENE2D&&s!==T.MORPHING&&i.passes.render){var h=i.context,g=a.viewport.width,P=a.viewport.height;if(!o(this._texture)||g!==this._drawingBufferWidth||P!==this._drawingBufferHeight||this._glowFactorDirty){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=g,this._drawingBufferHeight=P,this._glowFactorDirty=!1;var O=Math.max(g,P);O=Math.pow(2,Math.ceil(Math.log(O)/Math.log(2))-2),O=Math.max(1,O),this._texture=new y({context:h,width:O,height:O,pixelFormat:d.RGBA}),this._glowLengthTS=5*this._glowFactor,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;var R=this,N={u_glowLengthTS:function(){return R._glowLengthTS},u_radiusTS:function(){return R._radiusTS}};this._commands.computeCommand=new m({fragmentShaderSource:w,outputTexture:this._texture,uniformMap:N,persists:!1,owner:this,postExecute:function(){R._commands.computeCommand=void 0}})}var k=this._drawCommand;if(!o(k.vertexArray)){var L={direction:0},F=new Uint8Array(8);F[0]=0,F[1]=0,F[2]=255,F[3]=0,F[4]=255,F[5]=255,F[6]=0,F[7]=255;var B=p.createVertexBuffer({context:h,typedArray:F,usage:f.STATIC_DRAW}),U=[{index:L.direction,vertexBuffer:B,componentsPerAttribute:2,normalize:!0,componentDatatype:n.UNSIGNED_BYTE}],V=p.createIndexBuffer({context:h,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:f.STATIC_DRAW,indexDatatype:l.UNSIGNED_SHORT});k.vertexArray=new b({context:h,attributes:U,indexBuffer:V}),k.shaderProgram=_.fromCache({context:h,vertexShaderSource:S,fragmentShaderSource:C,attributeLocations:L}),k.renderState=v.fromCache({blending:E.ALPHA_BLEND}),k.uniformMap=this._uniformMap}var z=h.uniformState.sunPositionWC,G=h.uniformState.sunPositionColumbusView,H=this._boundingVolume,W=this._boundingVolume2D;r.clone(z,H.center),W.center.x=G.z,W.center.y=G.x,W.center.z=G.y,H.radius=u.SOLAR_RADIUS+u.SOLAR_RADIUS*this._glowLengthTS,W.radius=H.radius,s===T.SCENE3D?e.clone(H,k.boundingVolume):s===T.COLUMBUS_VIEW&&e.clone(W,k.boundingVolume);var j=x.computeActualWgs84Position(i,z,M),q=r.magnitude(r.subtract(j,i.camera.position,M)),Y=h.uniformState.projection,X=I;X.x=0,X.y=0,X.z=-q,X.w=1;var Q=c.multiplyByVector(Y,X,M),Z=x.clipToGLWindowCoordinates(a.viewport,Q,A);X.x=u.SOLAR_RADIUS;var K=c.multiplyByVector(Y,X,M),J=x.clipToGLWindowCoordinates(a.viewport,K,D);return this._size=Math.ceil(t.magnitude(t.subtract(J,Z,M))),this._size=2*this._size*(1+2*this._glowLengthTS),this._commands}}},P.prototype.isDestroyed=function(){return!1},P.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(),s(this)},P}),define("Scene/TileBoundingSphere",["../Core/BoundingSphere","../Core/Cartesian3","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defined","../Core/defineProperties","../Core/GeometryInstance","../Core/Matrix4","../Core/SphereOutlineGeometry","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(t,r){this._boundingSphere=new e(t,r)}return o(d.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}}}),d.prototype.distanceToCamera=function(e){var r=this._boundingSphere;return Math.max(0,t.distance(r.center,e.camera.positionWC)-r.radius)},d.prototype.intersectPlane=function(t){return e.intersectPlane(this._boundingSphere,t)},d.prototype.update=function(e,r){t.clone(e,this._boundingSphere.center),this._boundingSphere.radius=r},d.prototype.createDebugVolume=function(e){var t=new l({radius:this.radius}),r=s.fromTranslation(this.center,new s.clone(s.IDENTITY)),n=new a({geometry:t,modelMatrix:r,attributes:{color:i.fromColor(e)}});return new c({geometryInstances:n,appearance:new u({translucent:!1,flat:!0}),asynchronous:!1})},d}),define("Scene/TileBoundingVolume",["../Core/DeveloperError"],function(e){"use strict";function t(){}return t.prototype.boundingVolume=void 0,t.prototype.boundingSphere=void 0,t.prototype.createDebugVolume=function(t){e.throwInstantiationError()},t.prototype.distanceToCamera=function(t){e.throwInstantiationError()},t.prototype.intersectPlane=function(t){e.throwInstantiationError()},t}),define("Scene/TileCoordinatesImageryProvider",["../Core/Color","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/Event","../Core/GeographicTilingScheme","../ThirdParty/when"],function(e,t,r,i,n,o,a){"use strict";function s(i){i=t(i,t.EMPTY_OBJECT),this._tilingScheme=r(i.tilingScheme)?i.tilingScheme:new o({ellipsoid:i.ellipsoid}),this._color=t(i.color,e.YELLOW),this._errorEvent=new n,this._tileWidth=t(i.tileWidth,256),this._tileHeight=t(i.tileHeight,256),this._readyPromise=a.resolve(!0)}return i(s.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}}}),s.prototype.getTileCredits=function(e,t,r){},s.prototype.requestImage=function(e,t,r){var i=document.createElement("canvas");i.width=256,i.height=256;var n=i.getContext("2d"),o=this._color.toCssColorString();n.strokeStyle=o,n.lineWidth=2,n.strokeRect(1,1,255,255);var a="L"+r+"X"+e+"Y"+t;return n.font="bold 25px Arial",n.textAlign="center",n.fillStyle="black",n.fillText(a,127,127),n.fillStyle=o,n.fillText(a,124,124),i},s.prototype.pickFeatures=function(e,t,r,i,n){},s}),define("Scene/TileDiscardPolicy",["../Core/DeveloperError"],function(e){"use strict";function t(t){e.throwInstantiationError()}return t.prototype.isReady=e.throwInstantiationError,t.prototype.shouldDiscardImage=e.throwInstantiationError,t}),define("Scene/TileOrientedBoundingBox",["../Core/BoundingSphere","../Core/BoxOutlineGeometry","../Core/Cartesian3","../Core/Check","../Core/ColorGeometryInstanceAttribute","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/GeometryInstance","../Core/Matrix3","../Core/Matrix4","../Core/OrientedBoundingBox","./PerInstanceColorAppearance","./Primitive"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p){"use strict";function f(t,r){this._orientedBoundingBox=new d(t,r),this._boundingSphere=e.fromOrientedBoundingBox(this._orientedBoundingBox)}return s(f.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}}),f.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))},f.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)},f.prototype.update=function(t,i){r.clone(t,this._orientedBoundingBox.center),u.clone(i,this._orientedBoundingBox.halfAxes),e.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)},f.prototype.createDebugVolume=function(e){var i=new t({minimum:new r(-1,-1,-1),maximum:new r(1,1,1)}),o=c.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),a=new l({geometry:i,modelMatrix:o,attributes:{color:n.fromColor(e)}});return new p({geometryInstances:a,appearance:new h({translucent:!1,flat:!0}),asynchronous:!1})},f}),define("Scene/TileState",["../Core/freezeObject"],function(e){"use strict";var t={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};return e(t)}),define("Shaders/ViewportQuadFS",[],function(){"use strict";return"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"}),define("Scene/ViewportQuad",["../Core/BoundingRectangle","../Core/Color","../Core/defined","../Core/destroyObject","../Core/DeveloperError","../Renderer/Pass","../Renderer/RenderState","../Renderer/ShaderSource","../Shaders/ViewportQuadFS","./BlendingState","./Material"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(i,n){this.show=!0,r(i)||(i=new e),this.rectangle=e.clone(i),r(n)||(n=c.fromType(c.ColorType,{color:new t(1,1,1,1)})),this.material=n,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}return d.prototype.update=function(t){if(this.show){var i=this._rs;r(i)&&e.equals(i.viewport,this.rectangle)||(this._rs=a.fromCache({blending:u.ALPHA_BLEND,viewport:this.rectangle}));var n=t.passes;if(n.render){var c=t.context;if(this._material!==this.material||!r(this._overlayCommand)){this._material=this.material,r(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var d=new s({sources:[this._material.shaderSource,l]});this._overlayCommand=c.createViewportQuadCommand(d,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=o.OVERLAY}this._material.update(c),this._overlayCommand.uniformMap=this._material._uniforms,t.commandList.push(this._overlayCommand)}}},d.prototype.isDestroyed=function(){return!1},d.prototype.destroy=function(){return r(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),i(this)},d}),define("Scene/WebMapServiceImageryProvider",["../Core/combine","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/freezeObject","../Core/GeographicTilingScheme","../Core/objectToQuery","../Core/queryToObject","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","./GetFeatureInfoFormat","./UrlTemplateImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h){"use strict";function p(i){function n(e,t){r(m[e])||(m[e]=t),r(_)&&!r(_[e])&&(_[e]=t)}i=t(i,t.EMPTY_OBJECT),this._url=i.url,this._layers=i.layers;var o=t(i.getFeatureInfoFormats,p.DefaultGetFeatureInfoFormats),d=new c(i.url),m=l(t(d.query,"")),g=e(f(t(i.parameters,t.EMPTY_OBJECT)),p.DefaultParameters);m=e(g,m);var v,_;v=new c(i.url),_=l(t(v.query,""));var y=e(f(t(i.getFeatureInfoParameters,t.EMPTY_OBJECT)),p.GetFeatureInfoDefaultParameters);_=e(y,_),n("layers",i.layers),parseFloat(g.version)>=1.3?n("crs",i.tilingScheme instanceof u?"EPSG:3857":"CRS:84"):n("srs",i.tilingScheme instanceof u?"EPSG:3857":"EPSG:4326"),n("bbox","{westProjected},{southProjected},{eastProjected},{northProjected}"),n("width","{width}"),n("height","{height}"),d.query=s(m);var b,C=d.toString().replace(/%7B/g,"{").replace(/%7D/g,"}");r(_)&&(r(_.query_layers)||(_.query_layers=i.layers),r(_.x)||(_.x="{i}"),r(_.y)||(_.y="{j}"),r(_.info_format)||(_.info_format="{format}"),v.query=s(_),b=v.toString().replace(/%7B/g,"{").replace(/%7D/g,"}")),this._tileProvider=new h({url:C,pickFeaturesUrl:b,tilingScheme:t(i.tilingScheme,new a({ellipsoid:i.ellipsoid})),rectangle:i.rectangle,tileWidth:i.tileWidth,tileHeight:i.tileHeight,minimumLevel:i.minimumLevel,maximumLevel:i.maximumLevel,proxy:i.proxy,subdomains:i.subdomains,tileDiscardPolicy:i.tileDiscardPolicy,credit:i.credit,getFeatureInfoFormats:o,enablePickFeatures:i.enablePickFeatures})}function f(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[r.toLowerCase()]=e[r]);return t}return i(p.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._tileProvider.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}}}),p.prototype.getTileCredits=function(e,t,r){return this._tileProvider.getTileCredits(e,t,r)},p.prototype.requestImage=function(e,t,r){return this._tileProvider.requestImage(e,t,r)},p.prototype.pickFeatures=function(e,t,r,i,n){return this._tileProvider.pickFeatures(e,t,r,i,n)},p.DefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"}),p.GetFeatureInfoDefaultParameters=o({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"}),p.DefaultGetFeatureInfoFormats=o([o(new d("json","application/json")),o(new d("xml","text/xml")),o(new d("text","text/html"))]),p}),define("Scene/WebMapTileServiceImageryProvider",["../Core/combine","../Core/Credit","../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../Core/freezeObject","../Core/isArray","../Core/objectToQuery","../Core/queryToObject","../Core/Rectangle","../Core/WebMercatorTilingScheme","../ThirdParty/Uri","../ThirdParty/when","./ImageryProvider"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e){e=r(e,r.EMPTY_OBJECT),this._url=e.url,this._layer=e.layer,this._style=e.style,this._tileMatrixSetID=e.tileMatrixSetID,this._tileMatrixLabels=e.tileMatrixLabels,this._format=r(e.format,"image/jpeg"),this._proxy=e.proxy,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=i(e.tilingScheme)?e.tilingScheme:new h({ellipsoid:e.ellipsoid}),this._tileWidth=r(e.tileWidth,256),this._tileHeight=r(e.tileHeight,256),this._minimumLevel=r(e.minimumLevel,0),this._maximumLevel=e.maximumLevel,this._rectangle=r(e.rectangle,this._tilingScheme.rectangle),this._readyPromise=f.resolve(!0);var n=this._tilingScheme.positionToTileXY(d.southwest(this._rectangle),this._minimumLevel),o=this._tilingScheme.positionToTileXY(d.northeast(this._rectangle),this._minimumLevel);(Math.abs(o.x-n.x)+1)*(Math.abs(o.y-n.y)+1);this._errorEvent=new a;var s=e.credit;this._credit="string"==typeof s?new t(s):s,this._subdomains=e.subdomains,l(this._subdomains)?this._subdomains=this._subdomains.slice():i(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function v(t,n,o,a){var s,l=t._tileMatrixLabels,d=i(l)?l[a]:a.toString(),h=t._subdomains;if(t._url.indexOf("{")>=0)s=t._url.replace("{style}",t._style).replace("{Style}",t._style).replace("{TileMatrixSet}",t._tileMatrixSetID).replace("{TileMatrix}",d).replace("{TileRow}",o.toString()).replace("{TileCol}",n.toString()).replace("{s}",h[(n+o+a)%h.length]);else{var f=new p(t._url),m=c(r(f.query,""));m=e(_,m),m.tilematrix=d,m.layer=t._layer,m.style=t._style,m.tilerow=o,m.tilecol=n,m.tilematrixset=t._tileMatrixSetID,m.format=t._format,f.query=u(m),s=f.toString()}var g=t._proxy;return i(g)&&(s=g.getURL(s)),s}var _=s({service:"WMTS",version:"1.0.0",request:"GetTile"});return n(g.prototype,{url:{get:function(){return this._url}},proxy:{get:function(){return this._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}}}),g.prototype.getTileCredits=function(e,t,r){},g.prototype.requestImage=function(e,t,r){var i=v(this,e,t,r);return m.loadImage(this,i)},g.prototype.pickFeatures=function(e,t,r,i,n){},g}),define("ThirdParty/crunch",[],function(){function globalEval(e){eval.call(null,e)}function assert(e,t){e||abort("Assertion failed: "+t)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,t,r,i){switch(r=r||"i8","*"===r.charAt(r.length-1)&&(r="i32"),r){case"i1":HEAP8[e>>0]=t;break;case"i8":HEAP8[e>>0]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;default:abort("invalid type for setValue: "+r)}}function getValue(e,t,r){switch(t=t||"i8","*"===t.charAt(t.length-1)&&(t="i32"),t){case"i1":return HEAP8[e>>0];case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+t)}return null}function allocate(e,t,r,i){var n,o;"number"==typeof e?(n=!0,o=e):(n=!1,o=e.length);var a,s="string"==typeof t?t:null;if(a=r==ALLOC_NONE?i:[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===r?ALLOC_STATIC:r](Math.max(o,s?1:t.length)),n){var l,i=a;for(assert(0==(3&a)),l=a+(o&-4);i<l;i+=4)HEAP32[i>>2]=0;for(l=a+o;i<l;)HEAP8[i++>>0]=0;return a}if("i8"===s)return e.subarray||e.slice?HEAPU8.set(e,a):HEAPU8.set(new Uint8Array(e),a),a;for(var u,c,d,h=0;h<o;){var p=e[h];"function"==typeof p&&(p=Runtime.getFunctionIndex(p)),u=s||t[h],0!==u?("i64"==u&&(u="i32"),setValue(a+h,p,u),d!==u&&(c=Runtime.getNativeTypeSize(u),d=u),h+=c):h++}return a}function getMemory(e){return staticSealed?"undefined"!=typeof _sbrk&&!_sbrk.called||!runtimeInitialized?Runtime.dynamicAlloc(e):_malloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,t){if(0===t||!e)return"";for(var r,i=0,n=0;;){if(r=HEAPU8[e+n>>0],i|=r,0==r&&!t)break;if(n++,t&&n==t)break}t||(t=n);var o="";if(i<128){for(var a,s=1024;t>0;)a=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(t,s))),o=o?o+a:a,e+=s,t-=s;return o}return Module.UTF8ToString(e)}function AsciiToString(e){for(var t="";;){var r=HEAP8[e++>>0];if(!r)return t;t+=String.fromCharCode(r)}}function stringToAscii(e,t){return writeAsciiToMemory(e,t,!1)}function UTF8ArrayToString(e,t){for(var r,i,n,o,a,s,l="";;){if(r=e[t++],!r)return l;if(128&r)if(i=63&e[t++],192!=(224&r))if(n=63&e[t++],224==(240&r)?r=(15&r)<<12|i<<6|n:(o=63&e[t++],240==(248&r)?r=(7&r)<<18|i<<12|n<<6|o:(a=63&e[t++],248==(252&r)?r=(3&r)<<24|i<<18|n<<12|o<<6|a:(s=63&e[t++],r=(1&r)<<30|i<<24|n<<18|o<<12|a<<6|s))),r<65536)l+=String.fromCharCode(r);else{var u=r-65536;l+=String.fromCharCode(55296|u>>10,56320|1023&u)}else l+=String.fromCharCode((31&r)<<6|i);else l+=String.fromCharCode(r)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,t,r,i){if(!(i>0))return 0;for(var n=r,o=r+i-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(r>=o)break;t[r++]=s}else if(s<=2047){if(r+1>=o)break;t[r++]=192|s>>6,t[r++]=128|63&s}else if(s<=65535){if(r+2>=o)break;t[r++]=224|s>>12,t[r++]=128|s>>6&63,t[r++]=128|63&s}else if(s<=2097151){if(r+3>=o)break;t[r++]=240|s>>18,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}else if(s<=67108863){if(r+4>=o)break;t[r++]=248|s>>24,t[r++]=128|s>>18&63,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}else{if(r+5>=o)break;t[r++]=252|s>>30,t[r++]=128|s>>24&63,t[r++]=128|s>>18&63,t[r++]=128|s>>12&63,t[r++]=128|s>>6&63,t[r++]=128|63&s}}return t[r]=0,r-n}function stringToUTF8(e,t,r){return stringToUTF8Array(e,HEAPU8,t,r)}function lengthBytesUTF8(e){for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);i>=55296&&i<=57343&&(i=65536+((1023&i)<<10)|1023&e.charCodeAt(++r)),i<=127?++t:t+=i<=2047?2:i<=65535?3:i<=2097151?4:i<=67108863?5:6}return t}function UTF16ToString(e){for(var t=0,r="";;){var i=HEAP16[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}}function stringToUTF16(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;r-=2;for(var i=t,n=r<2*e.length?r/2:e.length,o=0;o<n;++o){var a=e.charCodeAt(o);HEAP16[t>>1]=a,t+=2}return HEAP16[t>>1]=0,t-i}function lengthBytesUTF16(e){return 2*e.length}function UTF32ToString(e){for(var t=0,r="";;){var i=HEAP32[e+4*t>>2];if(0==i)return r;if(++t,i>=65536){var n=i-65536;r+=String.fromCharCode(55296|n>>10,56320|1023&n)}else r+=String.fromCharCode(i)}}function stringToUTF32(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var i=t,n=i+r-4,o=0;o<e.length;++o){var a=e.charCodeAt(o);if(a>=55296&&a<=57343){var s=e.charCodeAt(++o);a=65536+((1023&a)<<10)|1023&s}if(HEAP32[t>>2]=a,t+=4,t+4>n)break}return HEAP32[t>>2]=0,t-i}function lengthBytesUTF32(e){for(var t=0,r=0;r<e.length;++r){var i=e.charCodeAt(r);i>=55296&&i<=57343&&++r,t+=4}return t}function demangle(e){function t(){s++,"K"===e[s]&&s++;for(var t=[];"E"!==e[s];)if("S"!==e[s])if("C"!==e[s]){var r=parseInt(e.substr(s)),i=r.toString().length;if(!r||!i){s--;break}var n=e.substr(s+i,r);t.push(n),u.push(n),s+=i+r}else t.push(t[t.length-1]),s+=2;else{s++;var o=e.indexOf("_",s),a=e.substring(s,o)||0;t.push(u[a]||"?"),s=o+1}return s++,t}function r(i,n,o){function a(){return"("+h.join(", ")+")"}n=n||1/0;var u,d="",h=[];if("N"===e[s]){if(u=t().join("::"),n--,0===n)return i?[u]:u}else{("K"===e[s]||c&&"L"===e[s])&&s++;var p=parseInt(e.substr(s));if(p){var f=p.toString().length;u=e.substr(s+f,p),s+=f+p}}if(c=!1,"I"===e[s]){s++;var m=r(!0),g=r(!0,1,!0);d+=g[0]+" "+u+"<"+m.join(", ")+">"}else d=u;e:for(;s<e.length&&n-- >0;){var v=e[s++];if(v in l)h.push(l[v]);else switch(v){case"P":h.push(r(!0,1,!0)[0]+"*");break;case"R":h.push(r(!0,1,!0)[0]+"&");break;case"L":s++;var _=e.indexOf("E",s),p=_-s;h.push(e.substr(s,p)),s+=p+2;break;case"A":var p=parseInt(e.substr(s));if(s+=p.toString().length,"_"!==e[s])throw"?";s++,h.push(r(!0,1,!0)[0]+" ["+p+"]");break;case"E":break e;default:d+="?"+v;break e}}return o||1!==h.length||"void"!==h[0]||(h=[]),i?(d&&h.push(d+"?"),h):d+a()}var i=!!Module.___cxa_demangle;if(i)try{var n=_malloc(e.length);writeStringToMemory(e.substr(1),n);var o=_malloc(4),a=Module.___cxa_demangle(n,0,0,o);if(0===getValue(o,"i32")&&a)return Pointer_stringify(a)}catch(e){}finally{n&&_free(n),o&&_free(o),a&&_free(a)}var s=3,l={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},u=[],c=!0,d=e;try{if("Object._main"==e||"_main"==e)return"main()";if("number"==typeof e&&(e=Pointer_stringify(e)),"_"!==e[0])return e;if("_"!==e[1])return e;if("Z"!==e[2])return e;switch(e[3]){case"n":return"operator new()";case"d":return"operator delete()"}d=r()}catch(e){d+="?"}return d.indexOf("?")>=0&&!i&&Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),d}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,function(e){var t=demangle(e);return e===t?e:e+" ["+t+"]"})}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){return demangleAll(jsStackTrace())}function alignMemoryPage(e){return e%4096>0&&(e+=4096-e%4096),e}function enlargeMemory(){var e=Math.pow(2,31);if(DYNAMICTOP>=e)return!1;for(;TOTAL_MEMORY<=DYNAMICTOP;)if(TOTAL_MEMORY<e/2)TOTAL_MEMORY=alignMemoryPage(2*TOTAL_MEMORY);else{var t=TOTAL_MEMORY;if(TOTAL_MEMORY=alignMemoryPage((3*TOTAL_MEMORY+e)/4),TOTAL_MEMORY<=t)return!1}if(TOTAL_MEMORY=Math.max(TOTAL_MEMORY,16777216),TOTAL_MEMORY>=e)return!1;try{if(ArrayBuffer.transfer)buffer=ArrayBuffer.transfer(buffer,TOTAL_MEMORY);else{var r=HEAP8;buffer=new ArrayBuffer(TOTAL_MEMORY)}}catch(e){return!1}var i=_emscripten_replace_memory(buffer);return!!i&&(Module.buffer=buffer,Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer),ArrayBuffer.transfer||HEAP8.set(r),!0)}function callRuntimeCallbacks(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?Runtime.dynCall("v",r):Runtime.dynCall("vi",r,[t.arg]):r(void 0===t.arg?null:t.arg)}else t()}}function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,t,r){var i=r>0?r:lengthBytesUTF8(e)+1,n=new Array(i),o=stringToUTF8Array(e,n,0,n.length);return t&&(n.length=o),n}function intArrayToString(e){for(var t=[],r=0;r<e.length;r++){var i=e[r];i>255&&(i&=255),t.push(String.fromCharCode(i))}return t.join("")}function writeStringToMemory(e,t,r){for(var i=intArrayFromString(e,r),n=0;n<i.length;){var o=i[n];HEAP8[t+n>>0]=o,n+=1}}function writeArrayToMemory(e,t){for(var r=0;r<e.length;r++)HEAP8[t++>>0]=e[r]}function writeAsciiToMemory(e,t,r){for(var i=0;i<e.length;++i)HEAP8[t++>>0]=e.charCodeAt(i);r||(HEAP8[t>>0]=0)}function unSign(e,t,r){return e>=0?e:t<=32?2*Math.abs(1<<t-1)+e:Math.pow(2,t)+e}function reSign(e,t,r){if(e<=0)return e;var i=t<=32?Math.abs(1<<t-1):Math.pow(2,t-1);return e>=i&&(t<=32||e>i)&&(e=-2*i+e),e}function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}function copyTempFloat(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3]}function copyTempDouble(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3],HEAP8[tempDoublePtr+4]=HEAP8[e+4],HEAP8[tempDoublePtr+5]=HEAP8[e+5],HEAP8[tempDoublePtr+6]=HEAP8[e+6],HEAP8[tempDoublePtr+7]=HEAP8[e+7]}function _pthread_cleanup_push(e,t){__ATEXIT__.push(function(){Runtime.dynCall("vi",e,[t])}),_pthread_cleanup_push.level=__ATEXIT__.length}function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!"),__ATEXIT__.pop(),_pthread_cleanup_push.level=__ATEXIT__.length}function _abort(){Module.abort()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}function ___cxa_begin_catch(e){return __ZSt18uncaught_exceptionv.uncaught_exception--,EXCEPTIONS.caught.push(e),EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(e)),e}function _pthread_once(e,t){_pthread_once.seen||(_pthread_once.seen={}),e in _pthread_once.seen||(Runtime.dynCall("v",t),_pthread_once.seen[e]=1)}function _emscripten_memcpy_big(e,t,r){return HEAPU8.set(HEAPU8.subarray(t,t+r),e),e}function ___syscall6(e,t){SYSCALLS.varargs=t;try{var r=SYSCALLS.getStreamFromFD();return FS.close(r),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function _pthread_getspecific(e){return PTHREAD_SPECIFIC[e]||0}function ___setErrNo(e){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=e),e}function _sysconf(e){switch(e){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator?navigator.hardwareConcurrency||1:1}return ___setErrNo(ERRNO_CODES.EINVAL),-1}function _sbrk(e){var t=_sbrk;t.called||(DYNAMICTOP=alignMemoryPage(DYNAMICTOP),t.called=!0,assert(Runtime.dynamicAlloc),t.alloc=Runtime.dynamicAlloc,Runtime.dynamicAlloc=function(){abort("cannot dynamically allocate, sbrk now has control")});var r=DYNAMICTOP;if(0!=e){var i=t.alloc(e);if(!i)return-1>>>0}return r}function _pthread_key_create(e,t){return 0==e?ERRNO_CODES.EINVAL:(HEAP32[e>>2]=PTHREAD_SPECIFIC_NEXT_KEY,PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0,PTHREAD_SPECIFIC_NEXT_KEY++,0)}function _emscripten_set_main_loop_timing(e,t){function r(e){e.source===window&&e.data===n&&(e.stopPropagation(),i.shift()())}if(Browser.mainLoop.timingMode=e,Browser.mainLoop.timingValue=t,!Browser.mainLoop.func)return 1;if(0==e)Browser.mainLoop.scheduler=function(){setTimeout(Browser.mainLoop.runner,t)},Browser.mainLoop.method="timeout";else if(1==e)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(2==e){if(!window.setImmediate){var i=[],n="__emcc"; +window.addEventListener("message",r,!0),window.setImmediate=function(e){i.push(e),window.postMessage(n,"*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(e,t,r,i,n){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=e,Browser.mainLoop.arg=i;var o=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var t=Date.now(),r=Browser.mainLoop.queue.shift();if(r.func(r.arg),Browser.mainLoop.remainingBlockers){var n=Browser.mainLoop.remainingBlockers,a=n%1==0?n-1:Math.floor(n);r.counted?Browser.mainLoop.remainingBlockers=a:(a+=.5,Browser.mainLoop.remainingBlockers=(8*n+a)/9)}return console.log('main loop blocker "'+r.name+'" took '+(Date.now()-t)+" ms"),Browser.mainLoop.updateStatus(),void setTimeout(Browser.mainLoop.runner,0)}if(!(o<Browser.mainLoop.currentlyRunningMainloop)){if(Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0,1==Browser.mainLoop.timingMode&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0)return void Browser.mainLoop.scheduler();"timeout"===Browser.mainLoop.method&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(function(){"undefined"!=typeof i?Runtime.dynCall("vi",e,[i]):Runtime.dynCall("v",e)}),o<Browser.mainLoop.currentlyRunningMainloop||("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Browser.mainLoop.scheduler())}}},n||(t&&t>0?_emscripten_set_main_loop_timing(0,1e3/t):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),r)throw"SimulateInfiniteLoop"}function _pthread_setspecific(e,t){return e in PTHREAD_SPECIFIC?(PTHREAD_SPECIFIC[e]=t,0):ERRNO_CODES.EINVAL}function _time(e){var t=Date.now()/1e3|0;return e&&(HEAP32[e>>2]=t),t}function _pthread_self(){return 0}function ___syscall140(e,t){SYSCALLS.varargs=t;try{var r=SYSCALLS.getStreamFromFD(),i=SYSCALLS.get(),n=SYSCALLS.get(),o=SYSCALLS.get(),a=SYSCALLS.get(),s=n;return assert(0===i),FS.llseek(r,s,a),HEAP32[o>>2]=r.position,r.getdents&&0===s&&0===a&&(r.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,t){SYSCALLS.varargs=t;try{var r=(SYSCALLS.get(),SYSCALLS.get()),i=SYSCALLS.get(),n=0;___syscall146.buffer||(___syscall146.buffer=[]);for(var o=___syscall146.buffer,a=0;a<i;a++){for(var s=HEAP32[r+8*a>>2],l=HEAP32[r+(8*a+4)>>2],u=0;u<l;u++){var c=HEAPU8[s+u];0===c||10===c?(Module.print(UTF8ArrayToString(o,0)),o.length=0):o.push(c)}n+=l}return n}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,t){SYSCALLS.varargs=t;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function invoke_iiii(e,t,r,i){try{return Module.dynCall_iiii(e,t,r,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiiii(e,t,r,i,n,o){try{Module.dynCall_viiiii(e,t,r,i,n,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_vi(e,t){try{Module.dynCall_vi(e,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_ii(e,t){try{return Module.dynCall_ii(e,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viii(e,t,r,i){try{Module.dynCall_viii(e,t,r,i)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_v(e){try{Module.dynCall_v(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiiiii(e,t,r,i,n,o,a){try{Module.dynCall_viiiiii(e,t,r,i,n,o,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiii(e,t,r,i,n){try{Module.dynCall_viiii(e,t,r,i,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function run(e){function t(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),t()},1)):t()))}function exit(e,t){if(!t||!Module.noExitRuntime)throw Module.noExitRuntime||(ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE?(process.stdout.once("drain",function(){process.exit(e)}),console.log(" "),setTimeout(function(){process.exit(e)},500)):ENVIRONMENT_IS_SHELL&&"function"==typeof quit&&quit(e),new ExitStatus(e)}function abort(e){void 0!==e?(Module.print(e),Module.printErr(e),e=JSON.stringify(e)):e="",ABORT=!0,EXITSTATUS=1;var t="\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.",r="abort("+e+") at "+stackTrace()+t;throw abortDecorators&&abortDecorators.forEach(function(t){r=t(r,e)}),r}var Module;Module||(Module=("undefined"!=typeof Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"function"==typeof require&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=function(e){process.stdout.write(e+"\n")}),Module.printErr||(Module.printErr=function(e){process.stderr.write(e+"\n")});var nodeFS=require("fs"),nodePath=require("path");Module.read=function(e,t){e=nodePath.normalize(e);var r=nodeFS.readFileSync(e);return r||e==nodePath.resolve(e)||(e=path.join(__dirname,"..","src",e),r=nodeFS.readFileSync(e)),r&&!t&&(r=r.toString()),r},Module.readBinary=function(e){var t=Module.read(e,!0);return t.buffer||(t=new Uint8Array(t)),assert(t.buffer),t},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available (jsc?)"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var t=read(e,"binary");return assert("object"==typeof t),t},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:"undefined"!=typeof arguments&&(Module.arguments=arguments);else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},"undefined"!=typeof arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.log(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),"undefined"==typeof Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var Runtime={setTempRet0:function(e){tempRet0=e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var t=parseInt(e.substr(1));return assert(t%8===0),t/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4===(7&e)),e+=4):assert(0===(3&e)),e},getAlignSize:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(t,8):8},dynCall:function(e,t,r){return r&&r.length?(r.splice||(r=Array.prototype.slice.call(r)),r.splice(0,0,t),Module["dynCall_"+e].apply(null,r)):Module["dynCall_"+e].call(null,t)},functionPointers:[],addFunction:function(e){for(var t=0;t<Runtime.functionPointers.length;t++)if(!Runtime.functionPointers[t])return Runtime.functionPointers[t]=e,2*(1+t);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(e,t){assert(t),Runtime.funcWrappers[t]||(Runtime.funcWrappers[t]={});var r=Runtime.funcWrappers[t];return r[e]||(r[e]=function(){return Runtime.dynCall(t,e,arguments)}),r[e]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var t=STACKTOP;return STACKTOP=STACKTOP+e|0,STACKTOP=STACKTOP+15&-16,t},staticAlloc:function(e){var t=STATICTOP;return STATICTOP=STATICTOP+e|0,STATICTOP=STATICTOP+15&-16,t},dynamicAlloc:function(e){var t=DYNAMICTOP;if(DYNAMICTOP=DYNAMICTOP+e|0,DYNAMICTOP=DYNAMICTOP+15&-16,DYNAMICTOP>=TOTAL_MEMORY){var r=enlargeMemory();if(!r)return DYNAMICTOP=t,0}return t},alignMemory:function(e,t){var r=e=Math.ceil(e/(t?t:16))*(t?t:16);return r},makeBigInt:function(e,t,r){var i=r?+(e>>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t);return i},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var __THREW__=0,ABORT=!1,EXITSTATUS=0,undef=0,tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat,tempI64,tempI64b,tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9,globalScope=this,cwrap,ccall;!function(){function parseJSFunc(e){var t=e.toString().match(sourceRegex).slice(1);return{arguments:t[0],body:t[1],returnValue:t[2]}}var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var t=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,t),t},stringToC:function(e){var t=0;return null!==e&&void 0!==e&&0!==e&&(t=Runtime.stackAlloc((e.length<<2)+1),writeStringToMemory(e,t)),t}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,t,r,i,n){var o=getCFunc(e),a=[],s=0;if(i)for(var l=0;l<i.length;l++){var u=toC[r[l]];u?(0===s&&(s=Runtime.stackSave()),a[l]=u(i[l])):a[l]=i[l]}var c=o.apply(null,a);if("string"===t&&(c=Pointer_stringify(c)),0!==s){if(n&&n.async)return void EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(s)});Runtime.stackRestore(s)}return c};var sourceRegex=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,JSsource={};for(var fun in JSfuncs)JSfuncs.hasOwnProperty(fun)&&(JSsource[fun]=parseJSFunc(JSfuncs[fun]));cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(e){return"number"===e}),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(e,t){return"$"+t}),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if("number"!==type){var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"="+convertCode.returnValue+";"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+="ret = "+strgfy+"(ret);"}return numericArgs||(funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii,Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.UTF16ToString=UTF16ToString,Module.stringToUTF16=stringToUTF16,Module.lengthBytesUTF16=lengthBytesUTF16,Module.UTF32ToString=UTF32ToString,Module.stringToUTF32=stringToUTF32,Module.lengthBytesUTF32=lengthBytesUTF32,Module.stackTrace=stackTrace;var PAGE_SIZE=4096,HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE=0,STATICTOP=0,staticSealed=!1,STACK_BASE=0,STACKTOP=0,STACK_MAX=0,DYNAMIC_BASE=0,DYNAMICTOP=0,byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(e){byteLength=function(e){return e.byteLength}}for(var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216,totalMemory=65536;totalMemory<TOTAL_MEMORY||totalMemory<2*TOTAL_STACK;)totalMemory<16777216?totalMemory*=2:totalMemory+=16777216;totalMemory=Math.max(totalMemory,16777216),totalMemory!==TOTAL_MEMORY&&(TOTAL_MEMORY=totalMemory),assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"JS engine does not provide full typed array support");var buffer;buffer=new ArrayBuffer(TOTAL_MEMORY),HEAP8=new Int8Array(buffer),HEAP16=new Int16Array(buffer),HEAP32=new Int32Array(buffer),HEAPU8=new Uint8Array(buffer),HEAPU16=new Uint16Array(buffer),HEAPU32=new Uint32Array(buffer),HEAPF32=new Float32Array(buffer),HEAPF64=new Float64Array(buffer),HEAP32[0]=255,assert(255===HEAPU8[0]&&0===HEAPU8[3],"Typed arrays 2 must be run on a little-endian system"),Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&Math.imul(4294967295,5)===-5||(Math.imul=function(e,t){var r=e>>>16,i=65535&e,n=t>>>16,o=65535&t;return i*o+(r*o+i*n<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.clz32=Math.clz32;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_min=Math.min,Math_clz32=Math.clz32,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var memoryInitializer=null,ASM_CONSTS=[];STATIC_BASE=8,STATICTOP=STATIC_BASE+5888,__ATINIT__.push(),allocate([116,0,0,0,86,7,0,0,116,0,0,0,99,7,0,0,156,0,0,0,112,7,0,0,16,0,0,0,0,0,0,0,156,0,0,0,145,7,0,0,24,0,0,0,0,0,0,0,156,0,0,0,215,7,0,0,24,0,0,0,0,0,0,0,156,0,0,0,179,7,0,0,56,0,0,0,0,0,0,0,156,0,0,0,249,7,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,1,0,0,220,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,227,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,219,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,105,110,99,92,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE); +var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0);var _BDtoIHigh=!0;Module._i64Subtract=_i64Subtract,Module._i64Add=_i64Add,Module._memset=_memset;var _BDtoILow=!0;Module._bitshift64Lshr=_bitshift64Lshr,Module._bitshift64Shl=_bitshift64Shl;var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(e){if(!e||EXCEPTIONS.infos[e])return e;for(var t in EXCEPTIONS.infos){var r=EXCEPTIONS.infos[t];if(r.adjusted===e)return t}return e},addRef:function(e){if(e){var t=EXCEPTIONS.infos[e];t.refcount++}},decRef:function(e){if(e){var t=EXCEPTIONS.infos[e];assert(t.refcount>0),t.refcount--,0===t.refcount&&(t.destructor&&Runtime.dynCall("vi",t.destructor,[e]),delete EXCEPTIONS.infos[e],___cxa_free_exception(e))}},clearRef:function(e){if(e){var t=EXCEPTIONS.infos[e];t.refcount=0}}};Module._memcpy=_memcpy;var SYSCALLS={varargs:0,get:function(e){SYSCALLS.varargs+=4;var t=HEAP32[SYSCALLS.varargs-4>>2];return t},getStr:function(){var e=Pointer_stringify(SYSCALLS.get());return e},get64:function(){var e=SYSCALLS.get(),t=SYSCALLS.get();return assert(e>=0?0===t:t===-1),e},getZero:function(){assert(0===SYSCALLS.get())}},PTHREAD_SPECIFIC={},ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86},PTHREAD_SPECIFIC_NEXT_KEY=1,_BItoD=!0,PATH=void 0,Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var e=Browser.mainLoop.timingMode,t=Browser.mainLoop.timingValue,r=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(r,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(e,t),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=Browser.mainLoop.remainingBlockers,r=Browser.mainLoop.expectedBlockers;t?t<r?Module.setStatus(e+" ("+(r-t)+"/"+r+")"):Module.setStatus(e):Module.setStatus("")}},runIter:function(e){if(!ABORT){if(Module.preMainLoop){var t=Module.preMainLoop();if(t===!1)return}try{e()}catch(e){if(e instanceof ExitStatus)return;throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}Module.postMainLoop&&Module.postMainLoop()}}},isFullScreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){function e(){Browser.pointerLock=document.pointerLockElement===i||document.mozPointerLockElement===i||document.webkitPointerLockElement===i||document.msPointerLockElement===i}if(Module.preloadPlugins||(Module.preloadPlugins=[]),!Browser.initted){Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch(e){Browser.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Browser.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),Browser.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,Module.noImageDecoding||"undefined"!=typeof Browser.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),Module.noImageDecoding=!0);var t={};t.canHandle=function(e){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},t.handle=function(e,t,r,i){var n=null;if(Browser.hasBlobConstructor)try{n=new Blob([e],{type:Browser.getMimetype(t)}),n.size!==e.length&&(n=new Blob([new Uint8Array(e).buffer],{type:Browser.getMimetype(t)}))}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!n){var o=new Browser.BlobBuilder;o.append(new Uint8Array(e).buffer),n=o.getBlob()}var a=Browser.URLObject.createObjectURL(n),s=new Image;s.onload=function(){assert(s.complete,"Image "+t+" could not be decoded");var i=document.createElement("canvas");i.width=s.width,i.height=s.height;var n=i.getContext("2d");n.drawImage(s,0,0),Module.preloadedImages[t]=i,Browser.URLObject.revokeObjectURL(a),r&&r(e)},s.onerror=function(e){console.log("Image "+a+" could not be decoded"),i&&i()},s.src=a},Module.preloadPlugins.push(t);var r={};r.canHandle=function(e){return!Module.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},r.handle=function(e,t,r,i){function n(i){a||(a=!0,Module.preloadedAudios[t]=i,r&&r(e))}function o(){a||(a=!0,Module.preloadedAudios[t]=new Audio,i&&i())}var a=!1;if(!Browser.hasBlobConstructor)return o();try{var s=new Blob([e],{type:Browser.getMimetype(t)})}catch(e){return o()}var l=Browser.URLObject.createObjectURL(s),u=new Audio;u.addEventListener("canplaythrough",function(){n(u)},!1),u.onerror=function(r){function i(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="=",i="",n=0,o=0,a=0;a<e.length;a++)for(n=n<<8|e[a],o+=8;o>=6;){var s=n>>o-6&63;o-=6,i+=t[s]}return 2==o?(i+=t[(3&n)<<4],i+=r+r):4==o&&(i+=t[(15&n)<<2],i+=r),i}a||(console.log("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),u.src="data:audio/x-"+t.substr(-3)+";base64,"+i(e),n(u))},u.src=l,Browser.safeSetTimeout(function(){n(u)},1e4)},Module.preloadPlugins.push(r);var i=Module.canvas;i&&(i.requestPointerLock=i.requestPointerLock||i.mozRequestPointerLock||i.webkitRequestPointerLock||i.msRequestPointerLock||function(){},i.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},i.exitPointerLock=i.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),document.addEventListener("mspointerlockchange",e,!1),Module.elementPointerLock&&i.addEventListener("click",function(e){!Browser.pointerLock&&i.requestPointerLock&&(i.requestPointerLock(),e.preventDefault())},!1))}},createContext:function(e,t,r,i){if(t&&Module.ctx&&e==Module.canvas)return Module.ctx;var n,o;if(t){var a={antialias:!1,alpha:!1};if(i)for(var s in i)a[s]=i[s];o=GL.createContext(e,a),o&&(n=GL.getContext(o).GLctx),e.style.backgroundColor="black"}else n=e.getContext("2d");return n?(r&&(t||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=n,t&&GL.makeContextCurrent(o),Module.useWebGL=t,Browser.moduleContextCreatedCallbacks.forEach(function(e){e()}),Browser.init()),n):null},destroyContext:function(e,t,r){},fullScreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullScreen:function(e,t,r){function i(){Browser.isFullScreen=!1;var e=n.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===e?(n.cancelFullScreen=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},n.cancelFullScreen=n.cancelFullScreen.bind(document),Browser.lockPointer&&n.requestPointerLock(),Browser.isFullScreen=!0,Browser.resizeCanvas&&Browser.setFullScreenCanvasSize()):(e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullScreen),Browser.updateCanvasDimensions(n)}Browser.lockPointer=e,Browser.resizeCanvas=t,Browser.vrDevice=r,"undefined"==typeof Browser.lockPointer&&(Browser.lockPointer=!0),"undefined"==typeof Browser.resizeCanvas&&(Browser.resizeCanvas=!1),"undefined"==typeof Browser.vrDevice&&(Browser.vrDevice=null);var n=Module.canvas;Browser.fullScreenHandlersInstalled||(Browser.fullScreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",i,!1),document.addEventListener("mozfullscreenchange",i,!1),document.addEventListener("webkitfullscreenchange",i,!1),document.addEventListener("MSFullscreenChange",i,!1));var o=document.createElement("div");n.parentNode.insertBefore(o,n),o.appendChild(n),o.requestFullScreen=o.requestFullScreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullScreen?function(){o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r?o.requestFullScreen({vrDisplay:r}):o.requestFullScreen()},nextRAF:0,fakeRequestAnimationFrame:function(e){var t=Date.now();if(0===Browser.nextRAF)Browser.nextRAF=t+1e3/60;else for(;t+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var r=Math.max(Browser.nextRAF-t,0);setTimeout(e,r)},requestAnimationFrame:function(e){"undefined"==typeof window?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(e){return function(){if(!ABORT)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var e=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],e.forEach(function(e){e()})}},safeRequestAnimationFrame:function(e){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))})},safeSetTimeout:function(e,t){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))},t)},safeSetInterval:function(e,t){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&e()},t)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var t=0;switch(e.type){case"DOMMouseScroll":t=e.detail;break;case"mousewheel":t=e.wheelDelta;break;case"wheel":t=e.deltaY;break;default:throw"unrecognized mouse wheel event: "+e.type}return t},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(Browser.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),"undefined"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var t=Module.canvas.getBoundingClientRect(),r=Module.canvas.width,i=Module.canvas.height,n="undefined"!=typeof window.scrollX?window.scrollX:window.pageXOffset,o="undefined"!=typeof window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var a=e.touch;if(void 0===a)return;var s=a.pageX-(n+t.left),l=a.pageY-(o+t.top);s*=r/t.width,l*=i/t.height;var u={x:s,y:l};if("touchstart"===e.type)Browser.lastTouches[a.identifier]=u,Browser.touches[a.identifier]=u;else if("touchend"===e.type||"touchmove"===e.type){var c=Browser.touches[a.identifier];c||(c=u),Browser.lastTouches[a.identifier]=c,Browser.touches[a.identifier]=u}return}var d=e.pageX-(n+t.left),h=e.pageY-(o+t.top);d*=r/t.width,h*=i/t.height,Browser.mouseMovementX=d-Browser.mouseX,Browser.mouseMovementY=h-Browser.mouseY,Browser.mouseX=d,Browser.mouseY=h}},xhrLoad:function(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)},asyncLoad:function(e,t,r,i){Browser.xhrLoad(e,function(r){assert(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),i||removeRunDependency("al "+e)},function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()}),i||addRunDependency("al "+e)},resizeListeners:[],updateResizeListeners:function(){var e=Module.canvas;Browser.resizeListeners.forEach(function(t){t(e.width,e.height)})},setCanvasSize:function(e,t,r){var i=Module.canvas;Browser.updateCanvasDimensions(i,e,t),r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},updateCanvasDimensions:function(e,t,r){t&&r?(e.widthNative=t,e.heightNative=r):(t=e.widthNative,r=e.heightNative);var i=t,n=r;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(i/n<Module.forcedAspectRatio?i=Math.round(n*Module.forcedAspectRatio):n=Math.round(i/Module.forcedAspectRatio)),(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var o=Math.min(screen.width/i,screen.height/n);i=Math.round(i*o),n=Math.round(n*o)}Browser.resizeCanvas?(e.width!=i&&(e.width=i),e.height!=n&&(e.height=n),"undefined"!=typeof e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=t&&(e.width=t),e.height!=r&&(e.height=r),"undefined"!=typeof e.style&&(i!=t||n!=r?(e.style.setProperty("width",i+"px","important"),e.style.setProperty("height",n+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var e=Browser.nextWgetRequestHandle;return Browser.nextWgetRequestHandle++,e}};Module.requestFullScreen=function(e,t,r){Browser.requestFullScreen(e,t,r)},Module.requestAnimationFrame=function(e){Browser.requestAnimationFrame(e)},Module.setCanvasSize=function(e,t,r){Browser.setCanvasSize(e,t,r)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},Module.createContext=function(e,t,r,i){return Browser.createContext(e,t,r,i)},STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),staticSealed=!0,STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX),assert(DYNAMIC_BASE<TOTAL_MEMORY,"TOTAL_MEMORY not big enough for stack");var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_DYNAMIC);Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0,byteLength:byteLength},Module.asmLibraryArg={abort:abort,assert:assert,invoke_iiii:invoke_iiii,invoke_viiiii:invoke_viiiii,invoke_vi:invoke_vi,invoke_ii:invoke_ii,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_viiiiii:invoke_viiiiii,invoke_viiii:invoke_viiii,_pthread_cleanup_pop:_pthread_cleanup_pop,_pthread_getspecific:_pthread_getspecific,_pthread_setspecific:_pthread_setspecific,__ZSt18uncaught_exceptionv:__ZSt18uncaught_exceptionv,_emscripten_set_main_loop:_emscripten_set_main_loop,_pthread_self:_pthread_self,_abort:_abort,_pthread_cleanup_push:_pthread_cleanup_push,___syscall6:___syscall6,_sbrk:_sbrk,_time:_time,_pthread_key_create:_pthread_key_create,___setErrNo:___setErrNo,_emscripten_memcpy_big:_emscripten_memcpy_big,___syscall54:___syscall54,___syscall140:___syscall140,_pthread_once:_pthread_once,_emscripten_set_main_loop_timing:_emscripten_set_main_loop_timing,_sysconf:_sysconf,___syscall146:___syscall146,___cxa_begin_catch:___cxa_begin_catch,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,tempDoublePtr:tempDoublePtr,ABORT:ABORT,cttz_i8:cttz_i8};var asm=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var l=e.Uint32Array;var u=e.Float32Array;var c=e.Float64Array;var d=new i(r);var h=new n(r);var p=new o(r);var f=new a(r);var m=new s(r);var g=new l(r);var v=new u(r);var _=new c(r);var y=e.byteLength;var b=t.STACKTOP|0;var C=t.STACK_MAX|0;var w=t.tempDoublePtr|0;var S=t.ABORT|0;var E=t.cttz_i8|0;var T=0;var x=0;var P=0;var A=0;var D=e.NaN,I=e.Infinity;var M=0,O=0,R=0,N=0,k=0,L=0,F=0,B=0,U=0;var V=0;var z=0;var G=0;var H=0;var W=0;var j=0;var q=0;var Y=0;var X=0;var Q=0;var Z=e.Math.floor;var K=e.Math.abs;var J=e.Math.sqrt;var $=e.Math.pow;var ee=e.Math.cos;var te=e.Math.sin;var re=e.Math.tan;var ie=e.Math.acos;var ne=e.Math.asin;var oe=e.Math.atan;var ae=e.Math.atan2;var se=e.Math.exp;var le=e.Math.log;var ue=e.Math.ceil;var ce=e.Math.imul;var de=e.Math.min;var he=e.Math.clz32;var pe=t.abort;var fe=t.assert;var me=t.invoke_iiii;var ge=t.invoke_viiiii;var ve=t.invoke_vi;var _e=t.invoke_ii;var ye=t.invoke_viii;var be=t.invoke_v;var Ce=t.invoke_viiiiii;var we=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t._pthread_getspecific;var Te=t._pthread_setspecific;var xe=t.__ZSt18uncaught_exceptionv;var Pe=t._emscripten_set_main_loop;var Ae=t._pthread_self;var De=t._abort;var Ie=t._pthread_cleanup_push;var Me=t.___syscall6;var Oe=t._sbrk;var Re=t._time;var Ne=t._pthread_key_create;var ke=t.___setErrNo;var Le=t._emscripten_memcpy_big;var Fe=t.___syscall54;var Be=t.___syscall140;var Ue=t._pthread_once;var Ve=t._emscripten_set_main_loop_timing;var ze=t._sysconf;var Ge=t.___syscall146;var He=t.___cxa_begin_catch;var We=0;function je(e){if(y(e)&16777215||y(e)<=16777215||y(e)>2147483648)return false;d=new i(e);h=new n(e);p=new o(e);f=new a(e);m=new s(e);g=new l(e);v=new u(e);_=new c(e);r=e;return true}function qe(e){e=e|0;var t=0;t=b;b=b+e|0;b=b+15&-16;return t|0}function Ye(){return b|0}function Xe(e){e=e|0;b=e}function Qe(e,t){e=e|0;t=t|0;b=e;C=t}function Ze(e,t){e=e|0;t=t|0;if(!T){T=e;x=t}}function Ke(e){e=e|0;d[w>>0]=d[e>>0];d[w+1>>0]=d[e+1>>0];d[w+2>>0]=d[e+2>>0];d[w+3>>0]=d[e+3>>0]}function Je(e){e=e|0;d[w>>0]=d[e>>0];d[w+1>>0]=d[e+1>>0];d[w+2>>0]=d[e+2>>0];d[w+3>>0]=d[e+3>>0];d[w+4>>0]=d[e+4>>0];d[w+5>>0]=d[e+5>>0];d[w+6>>0]=d[e+6>>0];d[w+7>>0]=d[e+7>>0]}function $e(e){e=e|0;V=e}function et(){return V|0}function tt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0;f=b;b=b+576|0;c=f+48|0;s=f+32|0;a=f+16|0;o=f;u=f+64|0;d=f+60|0;l=e+4|0;h=e+8|0;if((p[l>>2]|0)>>>0>(p[h>>2]|0)>>>0){p[o>>2]=1138;p[o+4>>2]=2119;p[o+8>>2]=1117;yr(u,1084,o)|0;_r(u)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){p[a>>2]=1138;p[a+4>>2]=2120;p[a+8>>2]=1157;yr(u,1084,a)|0;_r(u)|0}a=p[h>>2]|0;if(a>>>0>=t>>>0){h=1;b=f;return h|0}do if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10;while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){p[s>>2]=1138;p[s+4>>2]=2129;p[s+8>>2]=1205;yr(u,1084,s)|0;_r(u)|0}r=ce(t,i)|0;do if(!n){o=rt(p[e>>2]|0,r,d,1)|0;if(!o){h=0;b=f;return h|0}else{p[e>>2]=o;break}}else{a=it(r,d)|0;if(!a){h=0;b=f;return h|0}Pi[n&0](a,p[e>>2]|0,p[l>>2]|0);o=p[e>>2]|0;do if(o)if(!(o&7)){ot(o,0,0,1,0)|0;break}else{p[c>>2]=1138;p[c+4>>2]=2502;p[c+8>>2]=1504;yr(u,1084,c)|0;_r(u)|0;break}while(0);p[e>>2]=a}while(0);o=p[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;p[h>>2]=t;h=1;b=f;return h|0}function rt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0;u=b;b=b+560|0;l=u+32|0;o=u+16|0;n=u;s=u+48|0;a=u+44|0;if(e&7){p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1482;yr(s,1084,n)|0;_r(s)|0;l=0;b=u;return l|0}if(t>>>0>2147418112){p[o>>2]=1138;p[o+4>>2]=2502;p[o+8>>2]=1375;yr(s,1084,o)|0;_r(s)|0;l=0;b=u;return l|0}p[a>>2]=t;i=ot(e,t,a,i,0)|0;if(r)p[r>>2]=p[a>>2];if(!(i&7)){l=i;b=u;return l|0}p[l>>2]=1138;p[l+4>>2]=2554;p[l+8>>2]=1428;yr(s,1084,l)|0;_r(s)|0;l=i;b=u;return l|0}function it(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=b;b=b+560|0;s=l+32|0;a=l+16|0;r=l;o=l+48|0;n=l+44|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){p[r>>2]=1138;p[r+4>>2]=2502;p[r+8>>2]=1375;yr(o,1084,r)|0;_r(o)|0;s=0;b=l;return s|0}p[n>>2]=i;r=ot(0,i,n,1,0)|0;e=p[n>>2]|0;if(t)p[t>>2]=e;if((r|0)==0|e>>>0<i>>>0){p[a>>2]=1138;p[a+4>>2]=2502;p[a+8>>2]=1401;yr(o,1084,a)|0;_r(o)|0;s=0;b=l;return s|0}if(!(r&7)){s=r;b=l;return s|0}p[s>>2]=1138;p[s+4>>2]=2529;p[s+8>>2]=1428;yr(o,1084,s)|0;_r(o)|0;s=r;b=l;return s|0}function nt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,E=0,T=0,x=0,P=0,A=0,D=0,I=0,M=0,O=0,R=0,N=0,k=0,L=0,F=0;F=b;b=b+880|0;N=F+144|0;R=F+128|0;O=F+112|0;M=F+96|0;A=F+80|0;w=F+64|0;y=F+48|0;C=F+32|0;g=F+16|0;c=F;I=F+360|0;k=F+296|0;L=F+224|0;_=F+156|0;if((t|0)==0|i>>>0>11){e=0;b=F;return e|0}p[e>>2]=t;n=L;o=n+68|0;do{p[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=d[r+o>>0]|0;if(n<<24>>24){D=L+((n&255)<<2)|0;p[D>>2]=(p[D>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;u=1;a=0;s=-1;l=0;while(1){n=p[L+(u<<2)>>2]|0;if(!n)p[e+28+(u+-1<<2)>>2]=0;else{D=u+-1|0;p[k+(D<<2)>>2]=o;o=n+o|0;P=16-u|0;p[e+28+(D<<2)>>2]=(o+-1<<P|(1<<P)+-1)+1;p[e+96+(D<<2)>>2]=l;p[_+(u<<2)>>2]=l;a=a>>>0>u>>>0?a:u;s=s>>>0<u>>>0?s:u;l=n+l|0}u=u+1|0;if((u|0)==17){D=a;break}else o=o<<1}p[e+4>>2]=l;o=e+172|0;do if(l>>>0>(p[o>>2]|0)>>>0){p[o>>2]=l;if(l){n=l+-1|0;if(n&l)v=14}else{n=-1;v=14}if((v|0)==14){P=n>>>16|n;P=P>>>8|P;P=P>>>4|P;P=P>>>2|P;P=(P>>>1|P)+1|0;p[o>>2]=P>>>0>t>>>0?t:P}a=e+176|0;n=p[a>>2]|0;do if(n){P=p[n+-4>>2]|0;n=n+-8|0;if(!((P|0)!=0?(P|0)==(~p[n>>2]|0):0)){p[c>>2]=1138;p[c+4>>2]=647;p[c+8>>2]=1851;yr(I,1084,c)|0;_r(I)|0}if(!(n&7)){ot(n,0,0,1,0)|0;break}else{p[g>>2]=1138;p[g+4>>2]=2502;p[g+8>>2]=1504;yr(I,1084,g)|0;_r(I)|0;break}}while(0);o=p[o>>2]|0;o=(o|0)!=0?o:1;n=it((o<<1)+8|0,0)|0;if(!n){p[a>>2]=0;n=0;break}else{p[n+4>>2]=o;p[n>>2]=~o;p[a>>2]=n+8;v=25;break}}else v=25;while(0);e:do if((v|0)==25){P=e+24|0;d[P>>0]=s;d[e+25>>0]=D;o=e+176|0;a=0;do{x=d[r+a>>0]|0;n=x&255;if(x<<24>>24){if(!(p[L+(n<<2)>>2]|0)){p[C>>2]=1138;p[C+4>>2]=2272;p[C+8>>2]=1249;yr(I,1084,C)|0;_r(I)|0}x=_+(n<<2)|0;n=p[x>>2]|0;p[x>>2]=n+1;if(n>>>0>=l>>>0){p[y>>2]=1138;p[y+4>>2]=2276;p[y+8>>2]=1262;yr(I,1084,y)|0;_r(I)|0}h[(p[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=d[P>>0]|0;T=(n&255)>>>0<i>>>0?i:0;x=e+8|0;p[x>>2]=T;E=(T|0)!=0;if(E){S=1<<T;n=e+164|0;do if(S>>>0>(p[n>>2]|0)>>>0){p[n>>2]=S;a=e+168|0;n=p[a>>2]|0;do if(n){C=p[n+-4>>2]|0;n=n+-8|0;if(!((C|0)!=0?(C|0)==(~p[n>>2]|0):0)){p[w>>2]=1138;p[w+4>>2]=647;p[w+8>>2]=1851;yr(I,1084,w)|0;_r(I)|0}if(!(n&7)){ot(n,0,0,1,0)|0;break}else{p[A>>2]=1138;p[A+4>>2]=2502;p[A+8>>2]=1504;yr(I,1084,A)|0;_r(I)|0;break}}while(0);n=S<<2;o=it(n+8|0,0)|0;if(!o){p[a>>2]=0;n=0;break e}else{A=o+8|0;p[o+4>>2]=S;p[o>>2]=~S;p[a>>2]=A;o=A;break}}else{o=e+168|0;n=S<<2;a=o;o=p[o>>2]|0}while(0);Xr(o|0,-1,n|0)|0;_=e+176|0;w=1;do{if(p[L+(w<<2)>>2]|0){y=T-w|0;C=1<<y;o=w+-1|0;s=p[k+(o<<2)>>2]|0;if(o>>>0>=16){p[M>>2]=1138;p[M+4>>2]=1956;p[M+8>>2]=1725;yr(I,1084,M)|0;_r(I)|0}n=p[e+28+(o<<2)>>2]|0;if(!n)t=-1;else t=(n+-1|0)>>>(16-w|0);if(s>>>0<=t>>>0){g=(p[e+96+(o<<2)>>2]|0)-s|0;v=w<<16;do{n=m[(p[_>>2]|0)+(g+s<<1)>>1]|0;if((f[r+n>>0]|0|0)!=(w|0)){p[O>>2]=1138;p[O+4>>2]=2318;p[O+8>>2]=1291;yr(I,1084,O)|0;_r(I)|0}c=s<<y;o=n|v;u=0;do{l=u+c|0;if(l>>>0>=S>>>0){p[R>>2]=1138;p[R+4>>2]=2324;p[R+8>>2]=1325;yr(I,1084,R)|0;_r(I)|0}n=p[a>>2]|0;if((p[n+(l<<2)>>2]|0)!=-1){p[N>>2]=1138;p[N+4>>2]=2326;p[N+8>>2]=1348;yr(I,1084,N)|0;_r(I)|0;n=p[a>>2]|0}p[n+(l<<2)>>2]=o;u=u+1|0}while(u>>>0<C>>>0);s=s+1|0}while(s>>>0<=t>>>0)}}w=w+1|0}while(T>>>0>=w>>>0);n=d[P>>0]|0}o=e+96|0;p[o>>2]=(p[o>>2]|0)-(p[k>>2]|0);o=e+100|0;p[o>>2]=(p[o>>2]|0)-(p[k+4>>2]|0);o=e+104|0;p[o>>2]=(p[o>>2]|0)-(p[k+8>>2]|0);o=e+108|0;p[o>>2]=(p[o>>2]|0)-(p[k+12>>2]|0);o=e+112|0;p[o>>2]=(p[o>>2]|0)-(p[k+16>>2]|0);o=e+116|0;p[o>>2]=(p[o>>2]|0)-(p[k+20>>2]|0);o=e+120|0;p[o>>2]=(p[o>>2]|0)-(p[k+24>>2]|0);o=e+124|0;p[o>>2]=(p[o>>2]|0)-(p[k+28>>2]|0);o=e+128|0;p[o>>2]=(p[o>>2]|0)-(p[k+32>>2]|0);o=e+132|0;p[o>>2]=(p[o>>2]|0)-(p[k+36>>2]|0);o=e+136|0;p[o>>2]=(p[o>>2]|0)-(p[k+40>>2]|0);o=e+140|0;p[o>>2]=(p[o>>2]|0)-(p[k+44>>2]|0);o=e+144|0;p[o>>2]=(p[o>>2]|0)-(p[k+48>>2]|0);o=e+148|0;p[o>>2]=(p[o>>2]|0)-(p[k+52>>2]|0);o=e+152|0;p[o>>2]=(p[o>>2]|0)-(p[k+56>>2]|0);o=e+156|0;p[o>>2]=(p[o>>2]|0)-(p[k+60>>2]|0);o=e+16|0;p[o>>2]=0;a=e+20|0;p[a>>2]=n&255;t:do if(E){while(1){if(!i)break t;n=i+-1|0;if(!(p[L+(i<<2)>>2]|0))i=n;else break}p[o>>2]=p[e+28+(n<<2)>>2];n=T+1|0;p[a>>2]=n;if(n>>>0<=D>>>0){while(1){if(p[L+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>D>>>0)break t}p[a>>2]=n}}while(0);p[e+92>>2]=-1;p[e+160>>2]=1048575;p[e+12>>2]=32-(p[x>>2]|0);n=1}while(0);e=n;b=F;return e|0}function ot(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;do if(!e){i=Ur(t)|0;if(r){if(!i)e=0;else e=Gr(i)|0;p[r>>2]=e}}else{if(!t){Vr(e);if(!r){i=0;break}p[r>>2]=0;i=0;break}if(i){i=zr(e,t)|0;e=(i|0)==0?e:i}else i=0;if(r){t=Gr(e)|0;p[r>>2]=t}}while(0);return i|0}function at(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((p[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((f[e>>0]|0)<<8|(f[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((f[e+2>>0]|0)<<8|(f[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((f[e+7>>0]|0)<<16|(f[e+6>>0]|0)<<24|(f[e+8>>0]|0)<<8|(f[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}p[r+4>>2]=(f[e+12>>0]|0)<<8|(f[e+13>>0]|0);p[r+8>>2]=(f[e+14>>0]|0)<<8|(f[e+15>>0]|0);p[r+12>>2]=f[e+16>>0];p[r+16>>2]=f[e+17>>0];t=e+18|0;i=r+32|0;p[i>>2]=f[t>>0];p[i+4>>2]=0;t=d[t>>0]|0;p[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;p[r+24>>2]=(f[e+26>>0]|0)<<16|(f[e+25>>0]|0)<<24|(f[e+27>>0]|0)<<8|(f[e+28>>0]|0);p[r+28>>2]=(f[e+30>>0]|0)<<16|(f[e+29>>0]|0)<<24|(f[e+31>>0]|0)<<8|(f[e+32>>0]|0);r=1;return r|0}function st(e){e=e|0;He(e|0)|0;Ut()}function lt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=b;b=b+528|0;n=o;i=o+16|0;t=p[e+20>>2]|0;if(t)ut(t);t=e+4|0;r=p[t>>2]|0;if(!r){n=e+16|0;d[n>>0]=0;b=o;return}if(!(r&7))ot(r,0,0,1,0)|0;else{p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1504;yr(i,1084,n)|0;_r(i)|0}p[t>>2]=0;p[e+8>>2]=0;p[e+12>>2]=0;n=e+16|0;d[n>>0]=0;b=o;return}function ut(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0;l=b;b=b+592|0;a=l+64|0;o=l+48|0;s=l+32|0;i=l+16|0;r=l;n=l+80|0;if(!e){b=l;return}t=p[e+168>>2]|0;do if(t){u=p[t+-4>>2]|0;t=t+-8|0;if(!((u|0)!=0?(u|0)==(~p[t>>2]|0):0)){p[r>>2]=1138;p[r+4>>2]=647;p[r+8>>2]=1851;yr(n,1084,r)|0;_r(n)|0}if(!(t&7)){ot(t,0,0,1,0)|0;break}else{p[i>>2]=1138;p[i+4>>2]=2502;p[i+8>>2]=1504;yr(n,1084,i)|0;_r(n)|0;break}}while(0);t=p[e+176>>2]|0;do if(t){u=p[t+-4>>2]|0;t=t+-8|0;if(!((u|0)!=0?(u|0)==(~p[t>>2]|0):0)){p[s>>2]=1138;p[s+4>>2]=647;p[s+8>>2]=1851;yr(n,1084,s)|0;_r(n)|0}if(!(t&7)){ot(t,0,0,1,0)|0;break}else{p[o>>2]=1138;p[o+4>>2]=2502;p[o+8>>2]=1504;yr(n,1084,o)|0;_r(n)|0;break}}while(0);if(!(e&7)){ot(e,0,0,1,0)|0;b=l;return}else{p[a>>2]=1138;p[a+4>>2]=2502;p[a+8>>2]=1504;yr(n,1084,a)|0;_r(n)|0;b=l;return}}function ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=b;b=b+544|0;a=l+16|0;t=l;o=l+32|0;n=e+8|0;r=p[n>>2]|0;if((r+-1|0)>>>0>=8192){p[t>>2]=1138;p[t+4>>2]=3002;p[t+8>>2]=1529;yr(o,1084,t)|0;_r(o)|0}p[e>>2]=r;i=e+20|0;t=p[i>>2]|0;if(!t){t=it(180,0)|0;if(!t)t=0;else{s=t+164|0;p[s>>2]=0;p[s+4>>2]=0;p[s+8>>2]=0;p[s+12>>2]=0}p[i>>2]=t;s=p[e>>2]|0}else s=r;if(!(p[n>>2]|0)){p[a>>2]=1138;p[a+4>>2]=906;p[a+8>>2]=1769;yr(o,1084,a)|0;_r(o)|0;a=p[e>>2]|0}else a=s;o=p[e+4>>2]|0;if(a>>>0>16){i=a;r=0}else{e=0;e=nt(t,s,o,e)|0;b=l;return e|0}while(1){n=r+1|0;if(i>>>0>3){i=i>>>1;r=n}else{i=n;break}}e=r+2+((i|0)!=32&1<<i>>>0<a>>>0&1)|0;e=e>>>0<11?e&255:11;e=nt(t,s,o,e)|0;b=l;return e|0}function dt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,E=0,T=0,x=0,P=0,A=0,D=0,I=0;I=b;b=b+720|0;T=I+160|0;E=I+144|0;S=I+128|0;w=I+112|0;C=I+96|0;y=I+80|0;_=I+64|0;v=I+48|0;c=I+32|0;s=I+16|0;n=I;A=I+200|0;D=I+176|0;x=ht(e,14)|0;if(!x){p[t>>2]=0;r=t+4|0;i=p[r>>2]|0;if(i){if(!(i&7))ot(i,0,0,1,0)|0;else{p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1504;yr(A,1084,n)|0;_r(A)|0}p[r>>2]=0;p[t+8>>2]=0;p[t+12>>2]=0}d[t+16>>0]=0;r=t+20|0;i=p[r>>2]|0;if(!i){t=1;b=I;return t|0}ut(i);p[r>>2]=0;t=1;b=I;return t|0}m=t+4|0;g=t+8|0;r=p[g>>2]|0;if((r|0)!=(x|0)){if(r>>>0<=x>>>0){do if((p[t+12>>2]|0)>>>0<x>>>0){if(tt(m,x,(r+1|0)==(x|0),1,0)|0){r=p[g>>2]|0;break}d[t+16>>0]=1;t=0;b=I;return t|0}while(0);Xr((p[m>>2]|0)+r|0,0,x-r|0)|0}p[g>>2]=x}Xr(p[m>>2]|0,0,x|0)|0;h=e+20|0;r=p[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=p[o>>2]|0;if((i|0)==(p[a>>2]|0))i=0;else{p[o>>2]=i+1;i=f[i>>0]|0}r=r+8|0;p[h>>2]=r;if((r|0)>=33){p[s>>2]=1138;p[s+4>>2]=3204;p[s+8>>2]=1638;yr(A,1084,s)|0;_r(A)|0;r=p[h>>2]|0}i=i<<32-r|p[n>>2];p[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=p[i>>2]|0}u=i>>>27;p[n>>2]=i<<5;p[h>>2]=r+-5;if((u+-1|0)>>>0>20){t=0;b=I;return t|0}p[D+20>>2]=0;p[D>>2]=0;p[D+4>>2]=0;p[D+8>>2]=0;p[D+12>>2]=0;d[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do if(tt(r,21,0,1,0)|0){s=p[i>>2]|0;l=p[r>>2]|0;Xr(l+s|0,0,21-s|0)|0;p[i>>2]=21;if(u){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=p[h>>2]|0;if((r|0)<3){do{i=p[n>>2]|0;if((i|0)==(p[o>>2]|0))i=0;else{p[n>>2]=i+1;i=f[i>>0]|0}r=r+8|0;p[h>>2]=r;if((r|0)>=33){p[c>>2]=1138;p[c+4>>2]=3204;p[c+8>>2]=1638;yr(A,1084,c)|0;_r(A)|0;r=p[h>>2]|0}i=i<<32-r|p[a>>2];p[a>>2]=i}while((r|0)<3)}else i=p[a>>2]|0;p[a>>2]=i<<3;p[h>>2]=r+-3;d[l+(f[1599+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(u|0))}if(ct(D)|0){u=e+4|0;s=e+8|0;l=e+16|0;i=0;t:while(1){a=x-i|0;r=pt(e,D)|0;r:do if(r>>>0<17){if((p[g>>2]|0)>>>0<=i>>>0){p[v>>2]=1138;p[v+4>>2]=906;p[v+8>>2]=1769; +yr(A,1084,v)|0;_r(A)|0}d[(p[m>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=p[h>>2]|0;if((r|0)<3){do{n=p[u>>2]|0;if((n|0)==(p[s>>2]|0))n=0;else{p[u>>2]=n+1;n=f[n>>0]|0}r=r+8|0;p[h>>2]=r;if((r|0)>=33){p[_>>2]=1138;p[_+4>>2]=3204;p[_+8>>2]=1638;yr(A,1084,_)|0;_r(A)|0;r=p[h>>2]|0}n=n<<32-r|p[l>>2];p[l>>2]=n}while((r|0)<3)}else n=p[l>>2]|0;p[l>>2]=n<<3;p[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=p[h>>2]|0;if((r|0)<7){do{n=p[u>>2]|0;if((n|0)==(p[s>>2]|0))n=0;else{p[u>>2]=n+1;n=f[n>>0]|0}r=r+8|0;p[h>>2]=r;if((r|0)>=33){p[y>>2]=1138;p[y+4>>2]=3204;p[y+8>>2]=1638;yr(A,1084,y)|0;_r(A)|0;r=p[h>>2]|0}n=n<<32-r|p[l>>2];p[l>>2]=n}while((r|0)<7)}else n=p[l>>2]|0;p[l>>2]=n<<7;p[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){P=90;break t}o=p[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=p[u>>2]|0;if((r|0)==(p[s>>2]|0))o=0;else{p[u>>2]=r+1;o=f[r>>0]|0}r=n+8|0;p[h>>2]=r;if((r|0)>=33){p[C>>2]=1138;p[C+4>>2]=3204;p[C+8>>2]=1638;yr(A,1084,C)|0;_r(A)|0;r=p[h>>2]|0}n=o<<32-r|p[l>>2];p[l>>2]=n;if((r|0)<2)n=r;else break}}else{n=p[l>>2]|0;r=o}p[l>>2]=n<<2;p[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=p[u>>2]|0;if((r|0)==(p[s>>2]|0))o=0;else{p[u>>2]=r+1;o=f[r>>0]|0}r=n+8|0;p[h>>2]=r;if((r|0)>=33){p[w>>2]=1138;p[w+4>>2]=3204;p[w+8>>2]=1638;yr(A,1084,w)|0;_r(A)|0;r=p[h>>2]|0}n=o<<32-r|p[l>>2];p[l>>2]=n;if((r|0)<6)n=r;else break}}else{n=p[l>>2]|0;r=o}p[l>>2]=n<<6;p[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((p[g>>2]|0)>>>0<=r>>>0){p[S>>2]=1138;p[S+4>>2]=906;p[S+8>>2]=1769;yr(A,1084,S)|0;_r(A)|0}n=d[(p[m>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((p[g>>2]|0)>>>0<=i>>>0){p[E>>2]=1138;p[E+4>>2]=906;p[E+8>>2]=1769;yr(A,1084,E)|0;_r(A)|0}d[(p[m>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}while(0);if(x>>>0>r>>>0)i=r;else break}if((P|0)==90){p[T>>2]=1138;p[T+4>>2]=3145;p[T+8>>2]=1620;yr(A,1084,T)|0;_r(A)|0;r=0;break}if((x|0)==(r|0))r=ct(t)|0;else r=0}else r=0}else{d[D+16>>0]=1;r=0}while(0);lt(D);t=r;b=I;return t|0}function ht(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0;u=b;b=b+528|0;a=u;o=u+16|0;if(!t){l=0;b=u;return l|0}if(t>>>0<=16){l=ft(e,t)|0;b=u;return l|0}s=ft(e,t+-16|0)|0;l=e+20|0;t=p[l>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=p[i>>2]|0;if((e|0)==(p[n>>2]|0))e=0;else{p[i>>2]=e+1;e=f[e>>0]|0}t=t+8|0;p[l>>2]=t;if((t|0)>=33){p[a>>2]=1138;p[a+4>>2]=3204;p[a+8>>2]=1638;yr(o,1084,a)|0;_r(o)|0;t=p[l>>2]|0}e=e<<32-t|p[r>>2];p[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=p[e>>2]|0}p[r>>2]=e<<16;p[l>>2]=t+-16;l=e>>>16|s<<16;b=u;return l|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,g=0,v=0,_=0;_=b;b=b+576|0;d=_+48|0;c=_+32|0;u=_+16|0;l=_;g=_+64|0;h=p[t+20>>2]|0;v=e+20|0;s=p[v>>2]|0;do if((s|0)<24){a=e+4|0;i=p[a>>2]|0;n=p[e+8>>2]|0;r=i>>>0<n>>>0;if((s|0)>=16){if(r){p[a>>2]=i+1;r=f[i>>0]|0}else r=0;p[v>>2]=s+8;a=e+16|0;o=r<<24-s|p[a>>2];p[a>>2]=o;break}if(r){o=(f[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0<n>>>0){i=f[r>>0]|0;r=r+1|0}else i=0;p[a>>2]=r;p[v>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|p[a>>2];p[a>>2]=o}else{o=e+16|0;a=o;o=p[o>>2]|0}while(0);n=(o>>>16)+1|0;do if(n>>>0<=(p[h+16>>2]|0)>>>0){i=p[(p[h+168>>2]|0)+(o>>>(32-(p[h+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){p[l>>2]=1138;p[l+4>>2]=3249;p[l+8>>2]=1665;yr(g,1084,l)|0;_r(g)|0}r=i&65535;i=i>>>16;if((p[t+8>>2]|0)>>>0<=r>>>0){p[u>>2]=1138;p[u+4>>2]=905;p[u+8>>2]=1769;yr(g,1084,u)|0;_r(g)|0}if((f[(p[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){p[c>>2]=1138;p[c+4>>2]=3253;p[c+8>>2]=1682;yr(g,1084,c)|0;_r(g)|0}}else{i=p[h+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(p[h+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(p[h+96+(r<<2)>>2]|0)|0;if(r>>>0<(p[t>>2]|0)>>>0){r=m[(p[h+176>>2]|0)+(r<<1)>>1]|0;break}p[d>>2]=1138;p[d+4>>2]=3271;p[d+8>>2]=1620;yr(g,1084,d)|0;_r(g)|0;v=0;b=_;return v|0}while(0);p[a>>2]=p[a>>2]<<i;p[v>>2]=(p[v>>2]|0)-i;v=r;b=_;return v|0}function ft(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0;u=b;b=b+544|0;s=u+16|0;r=u;a=u+32|0;if(t>>>0>=33){p[r>>2]=1138;p[r+4>>2]=3195;p[r+8>>2]=1622;yr(a,1084,r)|0;_r(a)|0}l=e+20|0;r=p[l>>2]|0;if((r|0)>=(t|0)){n=e+16|0;o=n;n=p[n>>2]|0;a=r;s=32-t|0;s=n>>>s;n=n<<t;p[o>>2]=n;t=a-t|0;p[l>>2]=t;b=u;return s|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=p[n>>2]|0;if((e|0)==(p[o>>2]|0))e=0;else{p[n>>2]=e+1;e=f[e>>0]|0}r=r+8|0;p[l>>2]=r;if((r|0)>=33){p[s>>2]=1138;p[s+4>>2]=3204;p[s+8>>2]=1638;yr(a,1084,s)|0;_r(a)|0;r=p[l>>2]|0}e=e<<32-r|p[i>>2];p[i>>2]=e}while((r|0)<(t|0));s=32-t|0;s=e>>>s;a=e<<t;p[i>>2]=a;t=r-t|0;p[l>>2]=t;b=u;return s|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,g=0,v=0,_=0;g=b;b=b+528|0;h=g;c=g+16|0;if((e|0)==0|t>>>0<62){m=0;b=g;return m|0}u=it(300,0)|0;if(!u){m=0;b=g;return m|0}p[u>>2]=519686845;r=u+4|0;p[r>>2]=0;i=u+8|0;p[i>>2]=0;l=u+88|0;n=u+136|0;o=u+160|0;a=l;s=a+44|0;do{p[a>>2]=0;a=a+4|0}while((a|0)<(s|0));d[l+44>>0]=0;v=u+184|0;a=u+208|0;s=u+232|0;_=u+252|0;p[_>>2]=0;p[_+4>>2]=0;p[_+8>>2]=0;d[_+12>>0]=0;_=u+268|0;p[_>>2]=0;p[_+4>>2]=0;p[_+8>>2]=0;d[_+12>>0]=0;_=u+284|0;p[_>>2]=0;p[_+4>>2]=0;p[_+8>>2]=0;d[_+12>>0]=0;p[n>>2]=0;p[n+4>>2]=0;p[n+8>>2]=0;p[n+12>>2]=0;p[n+16>>2]=0;d[n+20>>0]=0;p[o>>2]=0;p[o+4>>2]=0;p[o+8>>2]=0;p[o+12>>2]=0;p[o+16>>2]=0;d[o+20>>0]=0;p[v>>2]=0;p[v+4>>2]=0;p[v+8>>2]=0;p[v+12>>2]=0;p[v+16>>2]=0;d[v+20>>0]=0;p[a>>2]=0;p[a+4>>2]=0;p[a+8>>2]=0;p[a+12>>2]=0;p[a+16>>2]=0;d[a+20>>0]=0;p[s>>2]=0;p[s+4>>2]=0;p[s+8>>2]=0;p[s+12>>2]=0;d[s+16>>0]=0;do if(((t>>>0>=74?((f[e>>0]|0)<<8|(f[e+1>>0]|0)|0)==18552:0)?((f[e+2>>0]|0)<<8|(f[e+3>>0]|0))>>>0>=74:0)?((f[e+7>>0]|0)<<16|(f[e+6>>0]|0)<<24|(f[e+8>>0]|0)<<8|(f[e+9>>0]|0))>>>0<=t>>>0:0){p[l>>2]=e;p[r>>2]=e;p[i>>2]=t;if(Tt(u)|0){r=p[l>>2]|0;if((f[r+39>>0]|0)<<8|(f[r+40>>0]|0)){if(!(xt(u)|0))break;if(!(Pt(u)|0))break;r=p[l>>2]|0}if(!((f[r+55>>0]|0)<<8|(f[r+56>>0]|0))){_=u;b=g;return _|0}if(At(u)|0?Dt(u)|0:0){_=u;b=g;return _|0}}}else m=7;while(0);if((m|0)==7)p[l>>2]=0;Nt(u);if(!(u&7)){ot(u,0,0,1,0)|0;_=0;b=g;return _|0}else{p[h>>2]=1138;p[h+4>>2]=2502;p[h+8>>2]=1504;yr(c,1084,h)|0;_r(c)|0;_=0;b=g;return _|0}return 0}function gt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0;c=b;b=b+528|0;u=c;l=c+16|0;o=p[e+88>>2]|0;s=(f[o+70+(n<<2)+1>>0]|0)<<16|(f[o+70+(n<<2)>>0]|0)<<24|(f[o+70+(n<<2)+2>>0]|0)<<8|(f[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(f[o+16>>0]|0)>>>0)o=(f[o+70+(a<<2)+1>>0]|0)<<16|(f[o+70+(a<<2)>>0]|0)<<24|(f[o+70+(a<<2)+2>>0]|0)<<8|(f[o+70+(a<<2)+3>>0]|0);else o=p[e+8>>2]|0;if(o>>>0>s>>>0){l=e+4|0;l=p[l>>2]|0;l=l+s|0;u=o-s|0;u=vt(e,l,u,t,r,i,n)|0;b=c;return u|0}p[u>>2]=1138;p[u+4>>2]=3690;p[u+8>>2]=1780;yr(l,1084,u)|0;_r(l)|0;l=e+4|0;l=p[l>>2]|0;l=l+s|0;u=o-s|0;u=vt(e,l,u,t,r,i,n)|0;b=c;return u|0}function vt(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,l=0,u=0,c=0;c=p[e+88>>2]|0;l=((f[c+12>>0]|0)<<8|(f[c+13>>0]|0))>>>a;u=((f[c+14>>0]|0)<<8|(f[c+15>>0]|0))>>>a;l=l>>>0>1?(l+3|0)>>>2:1;u=u>>>0>1?(u+3|0)>>>2:1;c=c+18|0;a=d[c>>0]|0;a=ce(a<<24>>24==0|a<<24>>24==9?8:16,l)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ce(a,u)|0)>>>0>n>>>0){e=0;return e|0}o=(l+1|0)>>>1;s=(u+1|0)>>>1;if(!r){e=0;return e|0}p[e+92>>2]=t;p[e+96>>2]=t;p[e+104>>2]=r;p[e+100>>2]=t+r;p[e+108>>2]=0;p[e+112>>2]=0;switch(f[c>>0]|0|0){case 0:{It(e,i,n,a,l,u,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Mt(e,i,n,a,l,u,o,s)|0;e=1;return e|0}case 9:{Ot(e,i,n,a,l,u,o,s)|0;e=1;return e|0}case 8:case 7:{Rt(e,i,n,a,l,u,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function _t(e,t){e=e|0;t=t|0;var r=0,i=0;i=b;b=b+48|0;r=i;p[r>>2]=40;at(e,t,r)|0;b=i;return p[r+4>>2]|0}function yt(e,t){e=e|0;t=t|0;var r=0,i=0;i=b;b=b+48|0;r=i;p[r>>2]=40;at(e,t,r)|0;b=i;return p[r+8>>2]|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0;i=b;b=b+48|0;r=i;p[r>>2]=40;at(e,t,r)|0;b=i;return p[r+12>>2]|0}function Ct(e,t){e=e|0;t=t|0;var r=0,i=0;i=b;b=b+48|0;r=i;p[r>>2]=40;at(e,t,r)|0;b=i;return p[r+32>>2]|0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;n=b;b=b+576|0;i=n+40|0;r=n+56|0;o=n;p[o>>2]=40;at(e,t,o)|0;t=o+32|0;e=p[t+4>>2]|0;do switch(p[t>>2]|0){case 0:{if(!e){o=8;b=n;return o|0}else e=14;break}case 1:{if(!e)e=13;else e=14;break}case 2:{if(!e)e=13;else e=14;break}case 3:{if(!e)e=13;else e=14;break}case 4:{if(!e)e=13;else e=14;break}case 5:{if(!e)e=13;else e=14;break}case 6:{if(!e)e=13;else e=14;break}case 7:{if(!e)e=13;else e=14;break}case 8:{if(!e)e=13;else e=14;break}case 9:{if(!e){o=8;b=n;return o|0}else e=14;break}case 10:{if(!e){o=8;b=n;return o|0}else e=14;break}default:e=14}while(0);if((e|0)==13){o=16;b=n;return o|0}else if((e|0)==14){p[i>>2]=1138;p[i+4>>2]=2668;p[i+8>>2]=1523;yr(r,1084,i)|0;_r(r)|0;o=0;b=n;return o|0}return 0}function St(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,l=0;s=b;b=b+576|0;o=s+40|0;n=s+56|0;l=s;p[l>>2]=40;at(e,t,l)|0;i=(((p[l+4>>2]|0)>>>r)+3|0)>>>2;t=(((p[l+8>>2]|0)>>>r)+3|0)>>>2;r=l+32|0;e=p[r+4>>2]|0;do switch(p[r>>2]|0){case 0:{if(!e)e=8;else a=14;break}case 1:{if(!e)a=13;else a=14;break}case 2:{if(!e)a=13;else a=14;break}case 3:{if(!e)a=13;else a=14;break}case 4:{if(!e)a=13;else a=14;break}case 5:{if(!e)a=13;else a=14;break}case 6:{if(!e)a=13;else a=14;break}case 7:{if(!e)a=13;else a=14;break}case 8:{if(!e)a=13;else a=14;break}case 9:{if(!e)e=8;else a=14;break}case 10:{if(!e)e=8;else a=14;break}default:a=14}while(0);if((a|0)==13)e=16;else if((a|0)==14){p[o>>2]=1138;p[o+4>>2]=2668;p[o+8>>2]=1523;yr(n,1084,o)|0;_r(n)|0;e=0}l=ce(ce(t,i)|0,e)|0;b=s;return l|0}function Et(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;var a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,g=0;g=b;b=b+592|0;m=g+56|0;a=g+40|0;h=g+72|0;d=g;f=g+68|0;p[d>>2]=40;at(e,t,d)|0;s=(p[d+4>>2]|0)>>>n;l=(p[d+8>>2]|0)>>>n;d=d+32|0;i=p[d+4>>2]|0;do switch(p[d>>2]|0){case 0:{if(!i)d=8;else u=14;break}case 1:{if(!i)u=13;else u=14;break}case 2:{if(!i)u=13;else u=14;break}case 3:{if(!i)u=13;else u=14;break}case 4:{if(!i)u=13;else u=14;break}case 5:{if(!i)u=13;else u=14;break}case 6:{if(!i)u=13;else u=14;break}case 7:{if(!i)u=13;else u=14;break}case 8:{if(!i)u=13;else u=14;break}case 9:{if(!i)d=8;else u=14;break}case 10:{if(!i)d=8;else u=14;break}default:u=14}while(0);if((u|0)==13)d=16;else if((u|0)==14){p[a>>2]=1138;p[a+4>>2]=2668;p[a+8>>2]=1523;yr(h,1084,a)|0;_r(h)|0;d=0}p[f>>2]=r;c=mt(e,t)|0;t=o+n|0;if(t>>>0>n>>>0){u=(c|0)==0;e=r;while(1){i=ce((s+3|0)>>>2,d)|0;a=ce(i,(l+3|0)>>>2)|0;if(!(n>>>0>15|(u|a>>>0<8))?(p[c>>2]|0)==519686845:0)gt(c,f,a,i,n)|0;e=e+a|0;p[f>>2]=e;n=n+1|0;if((n|0)==(t|0))break;else{l=l>>>1;s=s>>>1}}}if(!c){b=g;return}if((p[c>>2]|0)!=519686845){b=g;return}Nt(c);if(!(c&7)){ot(c,0,0,1,0)|0;b=g;return}else{p[m>>2]=1138;p[m+4>>2]=2502;p[m+8>>2]=1504;yr(h,1084,m)|0;_r(h)|0;b=g;return}}function Tt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=p[e+4>>2]|0;o=e+88|0;n=p[o>>2]|0;t=(f[n+68>>0]|0)<<8|(f[n+67>>0]|0)<<16|(f[n+69>>0]|0);r=i+t|0;n=(f[n+65>>0]|0)<<8|(f[n+66>>0]|0);if(!n){e=0;return e|0}p[a>>2]=r;p[e+96>>2]=r;p[e+104>>2]=n;p[e+100>>2]=i+(n+t);p[e+108>>2]=0;p[e+112>>2]=0;if(!(dt(a,e+116|0)|0)){e=0;return e|0}t=p[o>>2]|0;do if(!((f[t+39>>0]|0)<<8|(f[t+40>>0]|0))){if(!((f[t+55>>0]|0)<<8|(f[t+56>>0]|0))){e=0;return e|0}}else{if(!(dt(a,e+140|0)|0)){e=0;return e|0}if(dt(a,e+188|0)|0){t=p[o>>2]|0;break}else{e=0;return e|0}}while(0);if((f[t+55>>0]|0)<<8|(f[t+56>>0]|0)){if(!(dt(a,e+164|0)|0)){e=0;return e|0}if(!(dt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function xt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,g=0;g=b;b=b+576|0;s=g;a=g+64|0;m=g+16|0;i=e+88|0;t=p[i>>2]|0;h=(f[t+39>>0]|0)<<8|(f[t+40>>0]|0);u=e+236|0;o=e+240|0;r=p[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do if((p[e+244>>2]|0)>>>0<h>>>0){if(tt(u,h,(r+1|0)==(h|0),4,0)|0){t=p[o>>2]|0;break}d[e+248>>0]=1;m=0;b=g;return m|0}else t=r;while(0);Xr((p[u>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=p[i>>2]|0}p[o>>2]=h}l=e+92|0;r=p[e+4>>2]|0;i=(f[t+34>>0]|0)<<8|(f[t+33>>0]|0)<<16|(f[t+35>>0]|0);n=r+i|0;t=(f[t+37>>0]|0)<<8|(f[t+36>>0]|0)<<16|(f[t+38>>0]|0);if(!t){m=0;b=g;return m|0}p[l>>2]=n;p[e+96>>2]=n;p[e+104>>2]=t;p[e+100>>2]=r+(t+i);p[e+108>>2]=0;p[e+112>>2]=0;p[m+20>>2]=0;p[m>>2]=0;p[m+4>>2]=0;p[m+8>>2]=0;p[m+12>>2]=0;d[m+16>>0]=0;e=m+24|0;p[m+44>>2]=0;p[e>>2]=0;p[e+4>>2]=0;p[e+8>>2]=0;p[e+12>>2]=0;d[e+16>>0]=0;if(dt(l,m)|0?(c=m+24|0,dt(l,c)|0):0){if(!(p[o>>2]|0)){p[s>>2]=1138;p[s+4>>2]=906;p[s+8>>2]=1769;yr(a,1084,s)|0;_r(a)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=p[u>>2]|0;while(1){i=(pt(l,m)|0)+i&31;n=(pt(l,c)|0)+n&63;o=(pt(l,m)|0)+o&31;t=(pt(l,m)|0)+t|0;a=(pt(l,c)|0)+a&63;e=(pt(l,m)|0)+e&31;p[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;lt(m+24|0);lt(m);m=t;b=g;return m|0}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,m=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,E=0,T=0,x=0,P=0,A=0,D=0,I=0,M=0;D=b;b=b+1008|0;a=D;o=D+496|0;A=D+472|0;x=D+276|0;P=D+80|0;T=D+16|0;n=p[e+88>>2]|0;E=(f[n+47>>0]|0)<<8|(f[n+48>>0]|0);S=e+92|0;t=p[e+4>>2]|0;r=(f[n+42>>0]|0)<<8|(f[n+41>>0]|0)<<16|(f[n+43>>0]|0);i=t+r|0;n=(f[n+45>>0]|0)<<8|(f[n+44>>0]|0)<<16|(f[n+46>>0]|0);if(!n){A=0;b=D;return A|0}p[S>>2]=i;p[e+96>>2]=i;p[e+104>>2]=n;p[e+100>>2]=t+(n+r);p[e+108>>2]=0;p[e+112>>2]=0;p[A+20>>2]=0;p[A>>2]=0;p[A+4>>2]=0;p[A+8>>2]=0;p[A+12>>2]=0;d[A+16>>0]=0;if(dt(S,A)|0){r=0;i=-3;n=-3;while(1){p[x+(r<<2)>>2]=i;p[P+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=T;r=t+64|0;do{p[t>>2]=0;t=t+4|0}while((t|0)<(r|0));w=e+252|0;r=e+256|0;t=p[r>>2]|0;e:do if((t|0)==(E|0))s=13;else{if(t>>>0<=E>>>0){do if((p[e+260>>2]|0)>>>0<E>>>0)if(tt(w,E,(t+1|0)==(E|0),4,0)|0){t=p[r>>2]|0;break}else{d[e+264>>0]=1;t=0;break e}while(0);Xr((p[w>>2]|0)+(t<<2)|0,0,E-t<<2|0)|0}p[r>>2]=E;s=13}while(0);do if((s|0)==13){if(!E){p[a>>2]=1138;p[a+4>>2]=906;p[a+8>>2]=1769;yr(o,1084,a)|0;_r(o)|0;t=1;break}i=T+4|0;n=T+8|0;e=T+12|0;o=T+16|0;a=T+20|0;s=T+24|0;l=T+28|0;u=T+32|0;c=T+36|0;h=T+40|0;m=T+44|0;g=T+48|0;v=T+52|0;_=T+56|0;y=T+60|0;C=0;r=p[w>>2]|0;while(1){t=0;do{I=pt(S,A)|0;w=t<<1;M=T+(w<<2)|0;p[M>>2]=(p[M>>2]|0)+(p[x+(I<<2)>>2]|0)&3;w=T+((w|1)<<2)|0;p[w>>2]=(p[w>>2]|0)+(p[P+(I<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);p[r>>2]=(f[1713+(p[i>>2]|0)>>0]|0)<<2|(f[1713+(p[T>>2]|0)>>0]|0)|(f[1713+(p[n>>2]|0)>>0]|0)<<4|(f[1713+(p[e>>2]|0)>>0]|0)<<6|(f[1713+(p[o>>2]|0)>>0]|0)<<8|(f[1713+(p[a>>2]|0)>>0]|0)<<10|(f[1713+(p[s>>2]|0)>>0]|0)<<12|(f[1713+(p[l>>2]|0)>>0]|0)<<14|(f[1713+(p[u>>2]|0)>>0]|0)<<16|(f[1713+(p[c>>2]|0)>>0]|0)<<18|(f[1713+(p[h>>2]|0)>>0]|0)<<20|(f[1713+(p[m>>2]|0)>>0]|0)<<22|(f[1713+(p[g>>2]|0)>>0]|0)<<24|(f[1713+(p[v>>2]|0)>>0]|0)<<26|(f[1713+(p[_>>2]|0)>>0]|0)<<28|(f[1713+(p[y>>2]|0)>>0]|0)<<30;C=C+1|0;if((C|0)==(E|0)){t=1;break}else r=r+4|0}}while(0)}else t=0;lt(A);M=t;b=D;return M|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,m=0;m=b;b=b+560|0;s=m;a=m+40|0;c=m+16|0;n=p[e+88>>2]|0;u=(f[n+55>>0]|0)<<8|(f[n+56>>0]|0);l=e+92|0;t=p[e+4>>2]|0;r=(f[n+50>>0]|0)<<8|(f[n+49>>0]|0)<<16|(f[n+51>>0]|0);i=t+r|0;n=(f[n+53>>0]|0)<<8|(f[n+52>>0]|0)<<16|(f[n+54>>0]|0);if(!n){c=0;b=m;return c|0}p[l>>2]=i;p[e+96>>2]=i;p[e+104>>2]=n;p[e+100>>2]=t+(n+r);p[e+108>>2]=0;p[e+112>>2]=0;p[c+20>>2]=0;p[c>>2]=0;p[c+4>>2]=0;p[c+8>>2]=0;p[c+12>>2]=0;d[c+16>>0]=0;e:do if(dt(l,c)|0){o=e+268|0;r=e+272|0;t=p[r>>2]|0;if((t|0)!=(u|0)){if(t>>>0<=u>>>0){do if((p[e+276>>2]|0)>>>0<u>>>0)if(tt(o,u,(t+1|0)==(u|0),2,0)|0){t=p[r>>2]|0;break}else{d[e+280>>0]=1;t=0;break e}while(0);Xr((p[o>>2]|0)+(t<<1)|0,0,u-t<<1|0)|0}p[r>>2]=u}if(!u){p[s>>2]=1138;p[s+4>>2]=906;p[s+8>>2]=1769;yr(a,1084,s)|0;_r(a)|0;t=1;break}r=0;i=0;n=0;t=p[o>>2]|0;while(1){s=pt(l,c)|0;r=s+r&255;i=(pt(l,c)|0)+i&255;h[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(u|0)){t=1;break}else t=t+2|0}}else t=0;while(0);lt(c);c=t;b=m;return c|0}function Dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,m=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,E=0,T=0,x=0,P=0,A=0,D=0,I=0,M=0,O=0;I=b;b=b+2416|0;a=I;o=I+1904|0;D=I+1880|0;P=I+980|0;A=I+80|0;x=I+16|0;n=p[e+88>>2]|0;T=(f[n+63>>0]|0)<<8|(f[n+64>>0]|0);E=e+92|0;t=p[e+4>>2]|0;r=(f[n+58>>0]|0)<<8|(f[n+57>>0]|0)<<16|(f[n+59>>0]|0);i=t+r|0;n=(f[n+61>>0]|0)<<8|(f[n+60>>0]|0)<<16|(f[n+62>>0]|0);if(!n){D=0;b=I;return D|0}p[E>>2]=i;p[e+96>>2]=i;p[e+104>>2]=n;p[e+100>>2]=t+(n+r);p[e+108>>2]=0;p[e+112>>2]=0;p[D+20>>2]=0;p[D>>2]=0;p[D+4>>2]=0;p[D+8>>2]=0;p[D+12>>2]=0;d[D+16>>0]=0;if(dt(E,D)|0){r=0;i=-7;n=-7;while(1){p[P+(r<<2)>>2]=i;p[A+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=x;r=t+64|0;do{p[t>>2]=0;t=t+4|0}while((t|0)<(r|0));S=e+284|0;r=T*3|0;i=e+288|0;t=p[i>>2]|0;e:do if((t|0)==(r|0))s=13;else{if(t>>>0<=r>>>0){do if((p[e+292>>2]|0)>>>0<r>>>0)if(tt(S,r,(t+1|0)==(r|0),2,0)|0){t=p[i>>2]|0;break}else{d[e+296>>0]=1;t=0;break e}while(0);Xr((p[S>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}p[i>>2]=r;s=13}while(0);do if((s|0)==13){if(!T){p[a>>2]=1138;p[a+4>>2]=906;p[a+8>>2]=1769;yr(o,1084,a)|0;_r(o)|0;t=1;break}i=x+4|0;n=x+8|0;e=x+12|0;o=x+16|0;a=x+20|0;s=x+24|0;l=x+28|0;u=x+32|0;c=x+36|0;m=x+40|0;g=x+44|0;v=x+48|0;_=x+52|0;y=x+56|0;C=x+60|0;w=0;r=p[S>>2]|0;while(1){t=0;do{M=pt(E,D)|0;S=t<<1;O=x+(S<<2)|0;p[O>>2]=(p[O>>2]|0)+(p[P+(M<<2)>>2]|0)&7;S=x+((S|1)<<2)|0;p[S>>2]=(p[S>>2]|0)+(p[A+(M<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);M=f[1717+(p[a>>2]|0)>>0]|0;h[r>>1]=(f[1717+(p[i>>2]|0)>>0]|0)<<3|(f[1717+(p[x>>2]|0)>>0]|0)|(f[1717+(p[n>>2]|0)>>0]|0)<<6|(f[1717+(p[e>>2]|0)>>0]|0)<<9|(f[1717+(p[o>>2]|0)>>0]|0)<<12|M<<15;O=f[1717+(p[m>>2]|0)>>0]|0;h[r+2>>1]=(f[1717+(p[s>>2]|0)>>0]|0)<<2|M>>>1|(f[1717+(p[l>>2]|0)>>0]|0)<<5|(f[1717+(p[u>>2]|0)>>0]|0)<<8|(f[1717+(p[c>>2]|0)>>0]|0)<<11|O<<14;h[r+4>>1]=(f[1717+(p[g>>2]|0)>>0]|0)<<1|O>>>2|(f[1717+(p[v>>2]|0)>>0]|0)<<4|(f[1717+(p[_>>2]|0)>>0]|0)<<7|(f[1717+(p[y>>2]|0)>>0]|0)<<10|(f[1717+(p[C>>2]|0)>>0]|0)<<13;w=w+1|0;if((w|0)==(T|0)){t=1;break}else r=r+6|0}}while(0)}else t=0;lt(D);O=t;b=I;return O|0}function It(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,m=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,E=0,T=0,x=0,P=0,A=0,D=0,I=0,M=0,O=0,R=0,N=0,k=0,L=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,le=0;ae=b;b=b+656|0;ne=ae+112|0;re=ae+96|0;te=ae+80|0;ee=ae+64|0;$=ae+48|0;oe=ae+32|0;ie=ae+16|0;J=ae;Z=ae+144|0;K=ae+128|0;H=e+240|0;W=p[H>>2]|0;Y=e+256|0;X=p[Y>>2]|0;r=d[(p[e+88>>2]|0)+17>>0]|0;Q=i>>>2;if(!(r<<24>>24)){b=ae;return 1}j=(s|0)==0;q=s+-1|0;L=(o&1|0)!=0;F=i<<1;B=e+92|0;U=e+116|0;V=e+140|0;z=e+236|0;G=a+-1|0;k=(n&1|0)!=0;N=e+188|0;D=e+252|0;I=Q+1|0;M=Q+2|0;O=Q+3|0;R=G<<4;P=r&255;r=0;o=0;n=1;A=0;do{if(!j){T=p[t+(A<<2)>>2]|0;x=0;while(1){w=x&1;l=(w|0)==0;C=(w<<5^32)+-16|0;w=(w<<1^2)+-1|0;E=l?a:-1;u=l?0:G;e=(x|0)==(q|0);S=L&e;if((u|0)!=(E|0)){y=L&e^1;_=l?T:T+R|0;while(1){if((n|0)==1)n=pt(B,U)|0|512;v=n&7;n=n>>>3;l=f[1811+v>>0]|0;e=0;do{m=(pt(B,V)|0)+o|0;g=m-W|0;o=g>>31;o=o&m|g&~o;if((p[H>>2]|0)>>>0<=o>>>0){p[J>>2]=1138;p[J+4>>2]=906;p[J+8>>2]=1769;yr(Z,1084,J)|0;_r(Z)|0}p[K+(e<<2)>>2]=p[(p[z>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0<l>>>0);g=k&(u|0)==(G|0);if(S|g){m=0;do{c=ce(m,i)|0;e=_+c|0;l=(m|0)==0|y;h=m<<1;le=(pt(B,N)|0)+r|0;se=le-X|0;r=se>>31;r=r&le|se&~r;do if(g){if(!l){se=(pt(B,N)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;break}p[e>>2]=p[K+((f[1819+(v<<2)+h>>0]|0)<<2)>>2];if((p[Y>>2]|0)>>>0<=r>>>0){p[re>>2]=1138;p[re+4>>2]=906;p[re+8>>2]=1769;yr(Z,1084,re)|0;_r(Z)|0}p[_+(c+4)>>2]=p[(p[D>>2]|0)+(r<<2)>>2];se=(pt(B,N)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r}else{if(!l){se=(pt(B,N)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;break}p[e>>2]=p[K+((f[1819+(v<<2)+h>>0]|0)<<2)>>2];if((p[Y>>2]|0)>>>0<=r>>>0){p[te>>2]=1138;p[te+4>>2]=906;p[te+8>>2]=1769;yr(Z,1084,te)|0;_r(Z)|0}p[_+(c+4)>>2]=p[(p[D>>2]|0)+(r<<2)>>2];se=(pt(B,N)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;p[_+(c+8)>>2]=p[K+((f[(h|1)+(1819+(v<<2))>>0]|0)<<2)>>2];if((p[Y>>2]|0)>>>0<=r>>>0){p[ne>>2]=1138;p[ne+4>>2]=906;p[ne+8>>2]=1769;yr(Z,1084,ne)|0;_r(Z)|0}p[_+(c+12)>>2]=p[(p[D>>2]|0)+(r<<2)>>2]}while(0);m=m+1|0}while((m|0)!=2)}else{p[_>>2]=p[K+((f[1819+(v<<2)>>0]|0)<<2)>>2];se=(pt(B,N)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;if((p[Y>>2]|0)>>>0<=r>>>0){p[ie>>2]=1138;p[ie+4>>2]=906;p[ie+8>>2]=1769;yr(Z,1084,ie)|0;_r(Z)|0}p[_+4>>2]=p[(p[D>>2]|0)+(r<<2)>>2];p[_+8>>2]=p[K+((f[1819+(v<<2)+1>>0]|0)<<2)>>2];se=(pt(B,N)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;if((p[Y>>2]|0)>>>0<=r>>>0){p[oe>>2]=1138;p[oe+4>>2]=906;p[oe+8>>2]=1769;yr(Z,1084,oe)|0;_r(Z)|0}p[_+12>>2]=p[(p[D>>2]|0)+(r<<2)>>2];p[_+(Q<<2)>>2]=p[K+((f[1819+(v<<2)+2>>0]|0)<<2)>>2];se=(pt(B,N)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;if((p[Y>>2]|0)>>>0<=r>>>0){p[$>>2]=1138;p[$+4>>2]=906;p[$+8>>2]=1769;yr(Z,1084,$)|0;_r(Z)|0}p[_+(I<<2)>>2]=p[(p[D>>2]|0)+(r<<2)>>2];p[_+(M<<2)>>2]=p[K+((f[1819+(v<<2)+3>>0]|0)<<2)>>2];se=(pt(B,N)|0)+r|0;le=se-X|0;r=le>>31;r=r&se|le&~r;if((p[Y>>2]|0)>>>0<=r>>>0){p[ee>>2]=1138;p[ee+4>>2]=906;p[ee+8>>2]=1769;yr(Z,1084,ee)|0;_r(Z)|0}p[_+(O<<2)>>2]=p[(p[D>>2]|0)+(r<<2)>>2]}u=u+w|0;if((u|0)==(E|0))break;else _=_+C|0}}x=x+1|0;if((x|0)==(s|0))break;else T=T+F|0}}A=A+1|0}while((A|0)!=(P|0));b=ae;return 1}function Mt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,E=0,T=0,x=0,P=0,A=0,D=0,I=0,M=0,O=0,R=0,N=0,k=0,L=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,le=0,ue=0,ce=0,de=0,he=0,pe=0;he=b;b=b+608|0;ue=he+48|0;de=he+32|0;ce=he+16|0;le=he;ae=he+96|0;se=he+80|0;oe=he+64|0;W=e+240|0;j=p[W>>2]|0;X=e+256|0;re=p[X>>2]|0;ie=e+272|0;ne=p[ie>>2]|0;r=p[e+88>>2]|0;q=(f[r+63>>0]|0)<<8|(f[r+64>>0]|0);r=d[r+17>>0]|0;if(!(r<<24>>24)){b=he;return 1}Y=(s|0)==0;Q=s+-1|0;Z=i<<1;K=e+92|0;J=e+116|0;$=a+-1|0;ee=e+212|0;te=e+188|0;H=(n&1|0)==0;G=(o&1|0)==0;L=e+288|0;F=e+284|0;B=e+252|0;U=e+140|0;V=e+236|0;z=e+164|0;N=e+268|0;k=$<<5;O=r&255;r=0;n=0;o=0;e=0;l=1;R=0;do{if(!Y){I=p[t+(R<<2)>>2]|0;M=0;while(1){A=M&1;u=(A|0)==0;P=(A<<6^64)+-32|0;A=(A<<1^2)+-1|0;D=u?a:-1;c=u?0:$;if((c|0)!=(D|0)){x=G|(M|0)!=(Q|0);T=u?I:I+k|0;while(1){if((l|0)==1)l=pt(K,J)|0|512;E=l&7;l=l>>>3;h=f[1811+E>>0]|0;u=0;do{w=(pt(K,z)|0)+n|0;S=w-ne|0;n=S>>31;n=n&w|S&~n;if((p[ie>>2]|0)>>>0<=n>>>0){p[le>>2]=1138;p[le+4>>2]=906;p[le+8>>2]=1769;yr(ae,1084,le)|0;_r(ae)|0}p[oe+(u<<2)>>2]=m[(p[N>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0<h>>>0);u=0;do{w=(pt(K,U)|0)+e|0;S=w-j|0;e=S>>31;e=e&w|S&~e;if((p[W>>2]|0)>>>0<=e>>>0){p[ce>>2]=1138;p[ce+4>>2]=906;p[ce+8>>2]=1769;yr(ae,1084,ce)|0;_r(ae)|0}p[se+(u<<2)>>2]=p[(p[V>>2]|0)+(e<<2)>>2];u=u+1|0}while(u>>>0<h>>>0);S=H|(c|0)!=($|0);C=0;w=T;while(1){y=x|(C|0)==0;_=C<<1;g=0;v=w;while(1){h=(pt(K,ee)|0)+r|0;u=h-q|0;r=u>>31;r=r&h|u&~r;u=(pt(K,te)|0)+o|0;h=u-re|0;o=h>>31;o=o&u|h&~o;if((S|(g|0)==0)&y){u=f[g+_+(1819+(E<<2))>>0]|0;h=r*3|0;if((p[L>>2]|0)>>>0<=h>>>0){p[de>>2]=1138;p[de+4>>2]=906;p[de+8>>2]=1769;yr(ae,1084,de)|0;_r(ae)|0}pe=p[F>>2]|0;p[v>>2]=(m[pe+(h<<1)>>1]|0)<<16|p[oe+(u<<2)>>2];p[v+4>>2]=(m[pe+(h+2<<1)>>1]|0)<<16|(m[pe+(h+1<<1)>>1]|0);p[v+8>>2]=p[se+(u<<2)>>2];if((p[X>>2]|0)>>>0<=o>>>0){p[ue>>2]=1138;p[ue+4>>2]=906;p[ue+8>>2]=1769;yr(ae,1084,ue)|0;_r(ae)|0}p[v+12>>2]=p[(p[B>>2]|0)+(o<<2)>>2]}g=g+1|0;if((g|0)==2)break;else v=v+16|0}C=C+1|0;if((C|0)==2)break;else w=w+i|0}c=c+A|0;if((c|0)==(D|0))break;else T=T+P|0}}M=M+1|0;if((M|0)==(s|0))break;else I=I+Z|0}}R=R+1|0}while((R|0)!=(O|0));b=he;return 1}function Ot(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,E=0,T=0,x=0,P=0,A=0,D=0,I=0,M=0,O=0,R=0,N=0,k=0,L=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0;$=b;b=b+576|0;J=$+32|0;K=$+16|0;Z=$;Q=$+64|0;X=$+48|0;B=e+272|0;U=p[B>>2]|0;r=p[e+88>>2]|0;V=(f[r+63>>0]|0)<<8|(f[r+64>>0]|0);r=d[r+17>>0]|0;if(!(r<<24>>24)){b=$;return 1}z=(s|0)==0;G=s+-1|0;H=i<<1;W=e+92|0;j=e+116|0;q=a+-1|0;Y=e+212|0;F=(o&1|0)==0;N=e+288|0;k=e+284|0;L=e+164|0;O=e+268|0;R=q<<4;M=r&255;I=(n&1|0)!=0;r=0;o=0;e=1;D=0;do{if(!z){P=p[t+(D<<2)>>2]|0;A=0;while(1){T=A&1;n=(T|0)==0;E=(T<<5^32)+-16|0;T=(T<<1^2)+-1|0;x=n?a:-1;l=n?0:q;if((l|0)!=(x|0)){S=F|(A|0)!=(G|0);w=n?P:P+R|0;while(1){if((e|0)==1)e=pt(W,j)|0|512;C=e&7;e=e>>>3;u=f[1811+C>>0]|0;n=0;do{_=(pt(W,L)|0)+o|0;y=_-U|0;o=y>>31;o=o&_|y&~o;if((p[B>>2]|0)>>>0<=o>>>0){p[Z>>2]=1138;p[Z+4>>2]=906;p[Z+8>>2]=1769;yr(Q,1084,Z)|0;_r(Q)|0}p[X+(n<<2)>>2]=m[(p[O>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0<u>>>0);y=(l|0)==(q|0)&I;v=0;_=w;while(1){g=S|(v|0)==0;h=v<<1;n=(pt(W,Y)|0)+r|0;c=n-V|0;u=c>>31;u=u&n|c&~u;if(g){r=f[1819+(C<<2)+h>>0]|0;n=u*3|0;if((p[N>>2]|0)>>>0<=n>>>0){p[K>>2]=1138;p[K+4>>2]=906;p[K+8>>2]=1769;yr(Q,1084,K)|0;_r(Q)|0}c=p[k>>2]|0;p[_>>2]=(m[c+(n<<1)>>1]|0)<<16|p[X+(r<<2)>>2];p[_+4>>2]=(m[c+(n+2<<1)>>1]|0)<<16|(m[c+(n+1<<1)>>1]|0)}c=_+8|0;n=(pt(W,Y)|0)+u|0;u=n-V|0;r=u>>31;r=r&n|u&~r;if(!(y|g^1)){n=f[(h|1)+(1819+(C<<2))>>0]|0;u=r*3|0;if((p[N>>2]|0)>>>0<=u>>>0){p[J>>2]=1138;p[J+4>>2]=906;p[J+8>>2]=1769;yr(Q,1084,J)|0;_r(Q)|0}g=p[k>>2]|0;p[c>>2]=(m[g+(u<<1)>>1]|0)<<16|p[X+(n<<2)>>2];p[_+12>>2]=(m[g+(u+2<<1)>>1]|0)<<16|(m[g+(u+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else _=_+i|0}l=l+T|0;if((l|0)==(x|0))break;else w=w+E|0}}A=A+1|0;if((A|0)==(s|0))break;else P=P+H|0}}D=D+1|0}while((D|0)!=(M|0));b=$;return 1}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var l=0,u=0,c=0,h=0,g=0,v=0,_=0,y=0,C=0,w=0,S=0,E=0,T=0,x=0,P=0,A=0,D=0,I=0,M=0,O=0,R=0,N=0,k=0,L=0,F=0,B=0,U=0,V=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0;se=b;b=b+608|0;ne=se+48|0;ae=se+32|0;oe=se+16|0;ie=se;re=se+96|0;ee=se+80|0;te=se+64|0;W=e+272|0;j=p[W>>2]|0;r=p[e+88>>2]|0;q=(f[r+63>>0]|0)<<8|(f[r+64>>0]|0);r=d[r+17>>0]|0;if(!(r<<24>>24)){b=se;return 1}Y=(s|0)==0;X=s+-1|0;Q=i<<1;Z=e+92|0;K=e+116|0;J=a+-1|0;$=e+212|0;H=(n&1|0)==0;G=(o&1|0)==0;U=e+288|0;V=e+284|0;z=e+164|0;F=e+268|0;B=J<<5;k=r&255;r=0;n=0;o=0;e=0;l=1;L=0;do{if(!Y){R=p[t+(L<<2)>>2]|0;N=0;while(1){M=N&1;u=(M|0)==0;I=(M<<6^64)+-32|0;M=(M<<1^2)+-1|0;O=u?a:-1;c=u?0:J;if((c|0)!=(O|0)){D=G|(N|0)!=(X|0);A=u?R:R+B|0;while(1){if((l|0)==1)l=pt(Z,K)|0|512;P=l&7;l=l>>>3;h=f[1811+P>>0]|0;u=0;do{T=(pt(Z,z)|0)+e|0;x=T-j|0;e=x>>31;e=e&T|x&~e;if((p[W>>2]|0)>>>0<=e>>>0){p[ie>>2]=1138;p[ie+4>>2]=906;p[ie+8>>2]=1769;yr(re,1084,ie)|0;_r(re)|0}p[ee+(u<<2)>>2]=m[(p[F>>2]|0)+(e<<1)>>1];u=u+1|0}while(u>>>0<h>>>0);u=0;do{T=(pt(Z,z)|0)+n|0;x=T-j|0;n=x>>31;n=n&T|x&~n;if((p[W>>2]|0)>>>0<=n>>>0){p[oe>>2]=1138;p[oe+4>>2]=906;p[oe+8>>2]=1769;yr(re,1084,oe)|0;_r(re)|0}p[te+(u<<2)>>2]=m[(p[F>>2]|0)+(n<<1)>>1];u=u+1|0}while(u>>>0<h>>>0);x=H|(c|0)!=(J|0);E=0;T=A;while(1){S=D|(E|0)==0;w=E<<1;y=0;C=T;while(1){_=(pt(Z,$)|0)+o|0;v=_-q|0;o=v>>31;o=o&_|v&~o;v=(pt(Z,$)|0)+r|0;_=v-q|0;r=_>>31;r=r&v|_&~r;if((x|(y|0)==0)&S){v=f[y+w+(1819+(P<<2))>>0]|0;_=o*3|0;u=p[U>>2]|0;if(u>>>0<=_>>>0){p[ae>>2]=1138;p[ae+4>>2]=906;p[ae+8>>2]=1769;yr(re,1084,ae)|0;_r(re)|0;u=p[U>>2]|0}h=p[V>>2]|0;g=r*3|0;if(u>>>0>g>>>0)u=h;else{p[ne>>2]=1138;p[ne+4>>2]=906;p[ne+8>>2]=1769;yr(re,1084,ne)|0;_r(re)|0;u=p[V>>2]|0}p[C>>2]=(m[h+(_<<1)>>1]|0)<<16|p[ee+(v<<2)>>2];p[C+4>>2]=(m[h+(_+2<<1)>>1]|0)<<16|(m[h+(_+1<<1)>>1]|0);p[C+8>>2]=(m[u+(g<<1)>>1]|0)<<16|p[te+(v<<2)>>2];p[C+12>>2]=(m[u+(g+2<<1)>>1]|0)<<16|(m[u+(g+1<<1)>>1]|0)}y=y+1|0;if((y|0)==2)break;else C=C+16|0}E=E+1|0;if((E|0)==2)break;else T=T+i|0}c=c+M|0;if((c|0)==(O|0))break;else A=A+I|0}}N=N+1|0;if((N|0)==(s|0))break;else R=R+Q|0}}L=L+1|0}while((L|0)!=(k|0));b=se;return 1}function Nt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=b;b=b+576|0;s=l+48|0;o=l+32|0;n=l+16|0;i=l;a=l+64|0;p[e>>2]=0;t=e+284|0;r=p[t>>2]|0;if(r){if(!(r&7))ot(r,0,0,1,0)|0;else{p[i>>2]=1138;p[i+4>>2]=2502;p[i+8>>2]=1504;yr(a,1084,i)|0;_r(a)|0}p[t>>2]=0;p[e+288>>2]=0;p[e+292>>2]=0}d[e+296>>0]=0;r=e+268|0;t=p[r>>2]|0;if(t){if(!(t&7))ot(t,0,0,1,0)|0;else{p[n>>2]=1138;p[n+4>>2]=2502;p[n+8>>2]=1504;yr(a,1084,n)|0;_r(a)|0}p[r>>2]=0;p[e+272>>2]=0;p[e+276>>2]=0}d[e+280>>0]=0;t=e+252|0;r=p[t>>2]|0;if(r){if(!(r&7))ot(r,0,0,1,0)|0;else{p[o>>2]=1138;p[o+4>>2]=2502;p[o+8>>2]=1504;yr(a,1084,o)|0;_r(a)|0}p[t>>2]=0;p[e+256>>2]=0;p[e+260>>2]=0}d[e+264>>0]=0;t=e+236|0;r=p[t>>2]|0;if(!r){s=e+248|0;d[s>>0]=0;s=e+212|0;lt(s);s=e+188|0;lt(s);s=e+164|0;lt(s);s=e+140|0;lt(s);s=e+116|0;lt(s);b=l;return}if(!(r&7))ot(r,0,0,1,0)|0;else{p[s>>2]=1138;p[s+4>>2]=2502;p[s+8>>2]=1504;yr(a,1084,s)|0;_r(a)|0}p[t>>2]=0;p[e+240>>2]=0;p[e+244>>2]=0;s=e+248|0;d[s>>0]=0;s=e+212|0;lt(s);s=e+188|0;lt(s);s=e+164|0;lt(s);s=e+140|0;lt(s);s=e+116|0;lt(s);b=l;return}function kt(e,t){e=e|0;t=t|0;var r=0;r=b;b=b+16|0;p[r>>2]=t;t=p[60]|0;br(t,e,r)|0;fr(10,t)|0;De()}function Lt(){var e=0,t=0;e=b;b=b+16|0;if(!(Ue(192,2)|0)){t=Ee(p[47]|0)|0;b=e;return t|0}else kt(2078,e);return 0}function Ft(e){e=e|0;Vr(e);return}function Bt(e){e=e|0;var t=0;t=b;b=b+16|0;Ai[e&3]();kt(2127,t)}function Ut(){var e=0,t=0;e=Lt()|0;if(((e|0)!=0?(t=p[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(p[e>>2]&-256|0)==1126902528?(p[e+4>>2]|0)==1129074247:0):0)Bt(p[t+12>>2]|0);t=p[26]|0;p[26]=t+0;Bt(t)}function Vt(e){e=e|0;return}function zt(e){e=e|0;return}function Gt(e){e=e|0;return}function Ht(e){e=e|0;return}function Wt(e){e=e|0;Ft(e);return}function jt(e){e=e|0;Ft(e);return}function qt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=b;b=b+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Zt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{p[t>>2]=0;t=t+4|0}while((t|0)<(i|0));p[o>>2]=n;p[o+8>>2]=e;p[o+12>>2]=-1;p[o+48>>2]=1;Ii[p[(p[n>>2]|0)+28>>2]&3](n,o,p[r>>2]|0,1);if((p[o+24>>2]|0)==1){p[r>>2]=p[o+16>>2];t=1}else t=0}else t=0;else t=1;b=a;return t|0}function Yt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=p[e>>2]|0;do if(n){if((n|0)!=(r|0)){i=t+36|0;p[i>>2]=(p[i>>2]|0)+1;p[t+24>>2]=2;d[t+54>>0]=1;break}e=t+24|0;if((p[e>>2]|0)==2)p[e>>2]=i}else{p[e>>2]=r;p[t+24>>2]=i;p[t+36>>2]=1}while(0);return}function Xt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(p[t+8>>2]|0))Yt(0,t,r,i);return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(p[t+8>>2]|0))Yt(0,t,r,i);else{e=p[e+8>>2]|0;Ii[p[(p[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0,f=0,m=0,g=0;g=b;b=b+64|0;m=g;f=p[e>>2]|0;c=e+(p[f+-8>>2]|0)|0;f=p[f+-4>>2]|0;p[m>>2]=r;p[m+4>>2]=e;p[m+8>>2]=t;p[m+12>>2]=i;i=m+16|0;e=m+20|0;t=m+24|0;n=m+28|0;o=m+32|0;a=m+40|0;s=(f|0)==(r|0);l=i;u=l+36|0;do{p[l>>2]=0;l=l+4|0}while((l|0)<(u|0));h[i+36>>1]=0;d[i+38>>0]=0;e:do if(s){p[m+48>>2]=1;Di[p[(p[r>>2]|0)+20>>2]&3](r,m,c,c,1,0);i=(p[t>>2]|0)==1?c:0}else{Ei[p[(p[f>>2]|0)+24>>2]&3](f,m,c,1,0);switch(p[m+36>>2]|0){case 0:{i=(p[a>>2]|0)==1&(p[n>>2]|0)==1&(p[o>>2]|0)==1?p[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((p[t>>2]|0)!=1?!((p[a>>2]|0)==0&(p[n>>2]|0)==1&(p[o>>2]|0)==1):0){i=0;break}i=p[i>>2]|0}while(0);b=g;return i|0}function Kt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;d[t+53>>0]=1;do if((p[t+4>>2]|0)==(i|0)){d[t+52>>0]=1;i=t+16|0;e=p[i>>2]|0;if(!e){p[i>>2]=r;p[t+24>>2]=n;p[t+36>>2]=1;if(!((n|0)==1?(p[t+48>>2]|0)==1:0))break;d[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;p[n>>2]=(p[n>>2]|0)+1;d[t+54>>0]=1;break}e=t+24|0;i=p[e>>2]|0;if((i|0)==2){p[e>>2]=n;i=n}if((i|0)==1?(p[t+48>>2]|0)==1:0)d[t+54>>0]=1}while(0);return}function Jt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0;e:do if((e|0)==(p[t+8>>2]|0)){if((p[t+4>>2]|0)==(r|0)?(o=t+28|0,(p[o>>2]|0)!=1):0)p[o>>2]=i}else{if((e|0)!=(p[t>>2]|0)){s=p[e+8>>2]|0;Ei[p[(p[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((p[t+16>>2]|0)!=(r|0)?(a=t+20|0,(p[a>>2]|0)!=(r|0)):0){p[t+32>>2]=i;i=t+44|0;if((p[i>>2]|0)==4)break;o=t+52|0;d[o>>0]=0;l=t+53|0;d[l>>0]=0;e=p[e+8>>2]|0;Di[p[(p[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(d[l>>0]|0){if(!(d[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do if((s|0)==13){p[a>>2]=r;l=t+40|0;p[l>>2]=(p[l>>2]|0)+1;if((p[t+36>>2]|0)==1?(p[t+24>>2]|0)==2:0){d[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;p[i>>2]=4;break e}while(0);p[i>>2]=3;break}if((i|0)==1)p[t+32>>2]=1}while(0);return}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do if((e|0)==(p[t+8>>2]|0)){if((p[t+4>>2]|0)==(r|0)?(a=t+28|0,(p[a>>2]|0)!=1):0)p[a>>2]=i}else if((e|0)==(p[t>>2]|0)){if((p[t+16>>2]|0)!=(r|0)?(o=t+20|0,(p[o>>2]|0)!=(r|0)):0){p[t+32>>2]=i;p[o>>2]=r;n=t+40|0;p[n>>2]=(p[n>>2]|0)+1;if((p[t+36>>2]|0)==1?(p[t+24>>2]|0)==2:0)d[t+54>>0]=1;p[t+44>>2]=4;break; +}if((i|0)==1)p[t+32>>2]=1}while(0);return}function er(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(p[t+8>>2]|0))Kt(0,t,r,i,n);else{e=p[e+8>>2]|0;Di[p[(p[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function tr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(p[t+8>>2]|0))Kt(0,t,r,i,n);return}function rr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=b;b=b+16|0;i=n;p[i>>2]=p[r>>2];e=Si[p[(p[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)p[r>>2]=p[i>>2];b=n;return e&1|0}function ir(e){e=e|0;if(!e)e=0;else e=(Zt(e,24,72,0)|0)!=0;return e&1|0}function nr(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=b;b=b+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Lt()|0;if((e|0)!=0?(i=p[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=p[e>>2]|0;e=p[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){p[r>>2]=2406;kt(2356,r)}if((t|0)==1126902529&(e|0)==1129074247)e=p[i+44>>2]|0;else e=i+80|0;p[n>>2]=e;i=p[i>>2]|0;e=p[i+4>>2]|0;if(Si[p[(p[8>>2]|0)+16>>2]&7](8,i,n)|0){s=p[n>>2]|0;s=xi[p[(p[s>>2]|0)+8>>2]&1](s)|0;p[o>>2]=2406;p[o+4>>2]=e;p[o+8>>2]=s;kt(2270,o)}else{p[s>>2]=2406;p[s+4>>2]=e;kt(2315,s)}}kt(2394,a)}function or(){var e=0;e=b;b=b+16|0;if(!(Ne(188,6)|0)){b=e;return}else kt(2167,e)}function ar(e){e=e|0;var t=0;t=b;b=b+16|0;Vr(e);if(!(Te(p[47]|0,0)|0)){b=t;return}else kt(2217,t)}function sr(e){e=e|0;var t=0,r=0;t=0;while(1){if((f[2415+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2503;r=5;break}}if((r|0)==2)if(!t)e=2503;else{e=2503;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(d[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function lr(){var e=0;if(!0)e=248;else{e=(Ae()|0)+60|0;e=p[e>>2]|0}return e|0}function ur(e){e=e|0;var t=0;if(e>>>0>4294963200){t=lr()|0;p[t>>2]=0-e;e=-1}return e|0}function cr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;_[w>>3]=e;r=p[w>>2]|0;i=p[w+4>>2]|0;n=Qr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0){e=+cr(e*0x10000000000000000,t);r=(p[t>>2]|0)+-64|0}else r=0;p[t>>2]=r;break}case 2047:break;default:{p[t>>2]=n+-1022;p[w>>2]=r;p[w+4>>2]=i&-2146435073|1071644672;e=+_[w>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +cr(e,t)}function hr(e,t,r){e=e|0;t=t|0;r=r|0;do if(e){if(t>>>0<128){d[e>>0]=t;e=1;break}if(t>>>0<2048){d[e>>0]=t>>>6|192;d[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){d[e>>0]=t>>>12|224;d[e+1>>0]=t>>>6&63|128;d[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){d[e>>0]=t>>>18|240;d[e+1>>0]=t>>>12&63|128;d[e+2>>0]=t>>>6&63|128;d[e+3>>0]=t&63|128;e=4;break}else{e=lr()|0;p[e>>2]=84;e=-1;break}}else e=1;while(0);return e|0}function pr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=hr(e,t,0)|0;return e|0}function fr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((p[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((d[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=p[i>>2]|0,n>>>0<(p[t+16>>2]|0)>>>0):0){p[i>>2]=n+1;d[n>>0]=e;r=e&255}else r=Tr(t,e)|0;Er(t)}else a=3;do if((a|0)==3){if((d[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=p[o>>2]|0,r>>>0<(p[t+16>>2]|0)>>>0):0){p[o>>2]=r+1;d[r>>0]=e;r=e&255;break}r=Tr(t,e)|0}while(0);return r|0}function mr(e,t){e=e|0;t=t|0;return(vr(e,Or(e)|0,1,t)|0)+-1|0}function gr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=p[i>>2]|0;if(!n)if(!(Ir(r)|0)){n=p[i>>2]|0;o=4}else i=0;else o=4;e:do if((o|0)==4){a=r+20|0;o=p[a>>2]|0;if((n-o|0)>>>0<t>>>0){i=Si[p[r+36>>2]&7](r,e,t)|0;break}t:do if((d[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((d[e+n>>0]|0)==10)break;else i=n}if((Si[p[r+36>>2]&7](r,e,i)|0)>>>0<i>>>0)break e;t=t-i|0;e=e+i|0;n=p[a>>2]|0}else{n=o;i=0}while(0);Kr(n|0,e|0,t|0)|0;p[a>>2]=(p[a>>2]|0)+t;i=i+t|0}while(0);return i|0}function vr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=ce(r,t)|0;if((p[i+76>>2]|0)>-1){o=(Sr(i)|0)==0;e=gr(e,n,i)|0;if(!o)Er(i)}else e=gr(e,n,i)|0;if((e|0)!=(n|0))r=(e>>>0)/(t>>>0)|0;return r|0}function _r(e){e=e|0;var t=0,r=0,i=0,n=0;i=p[61]|0;if((p[i+76>>2]|0)>-1)n=Sr(i)|0;else n=0;do if((mr(e,i)|0)<0)t=1;else{if((d[i+75>>0]|0)!=10?(t=i+20|0,r=p[t>>2]|0,r>>>0<(p[i+16>>2]|0)>>>0):0){p[t>>2]=r+1;d[r>>0]=10;t=0;break}t=(Tr(i,10)|0)<0}while(0);if(n)Er(i);return t<<31>>31|0}function yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=b;b=b+16|0;n=i;p[n>>2]=r;r=wr(e,t,n)|0;b=i;return r|0}function br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,h=0,f=0,m=0,g=0,v=0;v=b;b=b+224|0;h=v+120|0;g=v+80|0;m=v;f=v+136|0;i=g;n=i+40|0;do{p[i>>2]=0;i=i+4|0}while((i|0)<(n|0));p[h>>2]=p[r>>2];if((Rr(0,t,h,m,g)|0)<0)r=-1;else{if((p[e+76>>2]|0)>-1)u=Sr(e)|0;else u=0;r=p[e>>2]|0;c=r&32;if((d[e+74>>0]|0)<1)p[e>>2]=r&-33;r=e+48|0;if(!(p[r>>2]|0)){n=e+44|0;o=p[n>>2]|0;p[n>>2]=f;a=e+28|0;p[a>>2]=f;s=e+20|0;p[s>>2]=f;p[r>>2]=80;l=e+16|0;p[l>>2]=f+80;i=Rr(e,t,h,m,g)|0;if(o){Si[p[e+36>>2]&7](e,0,0)|0;i=(p[s>>2]|0)==0?-1:i;p[n>>2]=o;p[r>>2]=0;p[l>>2]=0;p[a>>2]=0;p[s>>2]=0}}else i=Rr(e,t,h,m,g)|0;r=p[e>>2]|0;p[e>>2]=r|c;if(u)Er(e);r=(r&32|0)==0?i:-1}b=v;return r|0}function Cr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0,c=0;c=b;b=b+128|0;n=c+112|0;u=c;o=u;a=252;s=o+112|0;do{p[o>>2]=p[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;l=4}else{t=lr()|0;p[t>>2]=75;t=-1}else{n=e;l=4}if((l|0)==4){l=-2-n|0;l=t>>>0>l>>>0?l:t;p[u+48>>2]=l;e=u+20|0;p[e>>2]=n;p[u+44>>2]=n;t=n+l|0;n=u+16|0;p[n>>2]=t;p[u+28>>2]=t;t=br(u,r,i)|0;if(l){r=p[e>>2]|0;d[r+(((r|0)==(p[n>>2]|0))<<31>>31)>>0]=0}}b=c;return t|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;return Cr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Tr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0;l=b;b=b+16|0;s=l;a=t&255;d[s>>0]=a;i=e+16|0;n=p[i>>2]|0;if(!n)if(!(Ir(e)|0)){n=p[i>>2]|0;o=4}else r=-1;else o=4;do if((o|0)==4){i=e+20|0;o=p[i>>2]|0;if(o>>>0<n>>>0?(r=t&255,(r|0)!=(d[e+75>>0]|0)):0){p[i>>2]=o+1;d[o>>0]=a;break}if((Si[p[e+36>>2]&7](e,s,1)|0)==1)r=f[s>>0]|0;else r=-1}while(0);b=l;return r|0}function xr(e){e=e|0;var t=0,r=0;t=b;b=b+16|0;r=t;p[r>>2]=p[e+60>>2];e=ur(Me(6,r|0)|0)|0;b=t;return e|0}function Pr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=b;b=b+32|0;o=n;i=n+20|0;p[o>>2]=p[e+60>>2];p[o+4>>2]=0;p[o+8>>2]=t;p[o+12>>2]=i;p[o+16>>2]=r;if((ur(Be(140,o|0)|0)|0)<0){p[i>>2]=-1;e=-1}else e=p[i>>2]|0;b=n;return e|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0;m=b;b=b+48|0;d=m+16|0;c=m;i=m+32|0;h=e+28|0;n=p[h>>2]|0;p[i>>2]=n;f=e+20|0;n=(p[f>>2]|0)-n|0;p[i+4>>2]=n;p[i+8>>2]=t;p[i+12>>2]=r;l=e+60|0;u=e+44|0;t=2;n=n+r|0;while(1){if(!(p[49]|0)){p[d>>2]=p[l>>2];p[d+4>>2]=i;p[d+8>>2]=t;a=ur(Ge(146,d|0)|0)|0}else{Ie(7,e|0);p[c>>2]=p[l>>2];p[c+4>>2]=i;p[c+8>>2]=t;a=ur(Ge(146,c|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=p[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){p[h>>2]=(p[h>>2]|0)+a;s=o;t=2}else s=o;else{s=p[u>>2]|0;p[h>>2]=s;p[f>>2]=s;s=p[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}p[i>>2]=(p[i>>2]|0)+a;p[i+4>>2]=s-a}if((n|0)==6){d=p[u>>2]|0;p[e+16>>2]=d+(p[e+48>>2]|0);e=d;p[h>>2]=e;p[f>>2]=e}else if((n|0)==8){p[e+16>>2]=0;p[h>>2]=0;p[f>>2]=0;p[e>>2]=p[e>>2]|32;if((t|0)==2)r=0;else r=r-(p[i+4>>2]|0)|0}b=m;return r|0}function Dr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=b;b=b+80|0;i=n;p[e+36>>2]=3;if((p[e>>2]&64|0)==0?(p[i>>2]=p[e+60>>2],p[i+4>>2]=21505,p[i+8>>2]=n+12,(Fe(54,i|0)|0)!=0):0)d[e+75>>0]=-1;i=Ar(e,t,r)|0;b=n;return i|0}function Ir(e){e=e|0;var t=0,r=0;t=e+74|0;r=d[t>>0]|0;d[t>>0]=r+255|r;t=p[e>>2]|0;if(!(t&8)){p[e+8>>2]=0;p[e+4>>2]=0;t=p[e+44>>2]|0;p[e+28>>2]=t;p[e+20>>2]=t;p[e+16>>2]=t+(p[e+48>>2]|0);t=0}else{p[e>>2]=t|32;t=-1}return t|0}function Mr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do if(i&(e&3|0)!=0){n=t&255;while(1){if((d[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5;while(0);if((a|0)==5)if(i)a=6;else r=0;e:do if((a|0)==6){n=t&255;if((d[e>>0]|0)!=n<<24>>24){i=ce(o,16843009)|0;t:do if(r>>>0>3)while(1){o=p[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11;while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((d[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}while(0);return((r|0)!=0?e:0)|0}function Or(e){e=e|0;var t=0,r=0,i=0;i=e;e:do if(!(i&3))r=4;else{t=e;e=i;while(1){if(!(d[t>>0]|0))break e;t=t+1|0;e=t;if(!(e&3)){e=t;r=4;break}}}while(0);if((r|0)==4){while(1){t=p[e>>2]|0;if(!((t&-2139062144^-2139062144)&t+-16843009))e=e+4|0;else break}if((t&255)<<24>>24)do e=e+1|0;while((d[e>>0]|0)!=0)}return e-i|0}function Rr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0,m=0,g=0,v=0,y=0,C=0,S=0,E=0,T=0,x=0,P=0,A=0,D=0,I=0,M=0,O=0,R=0,N=0,k=0,L=0,F=0,B=0,U=0,z=0,G=0,H=0,W=0,j=0,q=0,Y=0,X=0,Q=0,Z=0,K=0,J=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=b;b=b+624|0;te=ae+24|0;ie=ae+16|0;re=ae+588|0;Z=ae+576|0;ee=ae;Y=ae+536|0;oe=ae+8|0;ne=ae+528|0;F=(e|0)!=0;B=Y+40|0;q=B;Y=Y+39|0;X=oe+4|0;Q=Z+12|0;Z=Z+11|0;K=re;J=Q;$=J-K|0;U=-2-K|0;z=J+2|0;G=te+288|0;H=re+9|0;W=H;j=re+8|0;o=0;C=t;a=0;t=0;e:while(1){do if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=lr()|0;p[o>>2]=75;o=-1;break}else{o=a+o|0;break}while(0);a=d[C>>0]|0;if(!(a<<24>>24)){L=245;break}else s=C;t:while(1){switch(a<<24>>24){case 37:{a=s;L=9;break t}case 0:{a=s;break t}default:{}}k=s+1|0;a=d[k>>0]|0;s=k}t:do if((L|0)==9)while(1){L=0;if((d[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((d[a>>0]|0)==37)L=9;else break}while(0);E=s-C|0;if(F?(p[e>>2]&32|0)==0:0)gr(C,E,e)|0;if((s|0)!=(C|0)){C=a;a=E;continue}c=a+1|0;s=d[c>>0]|0;l=(s<<24>>24)+-48|0;if(l>>>0<10){k=(d[a+2>>0]|0)==36;c=k?a+3|0:c;s=d[c>>0]|0;v=k?l:-1;t=k?1:t}else v=-1;a=s<<24>>24;t:do if((a&-32|0)==32){l=0;while(1){if(!(1<<a+-32&75913)){m=l;a=c;break t}l=1<<(s<<24>>24)+-32|l;c=c+1|0;s=d[c>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){m=l;a=c;break}}}else{m=0;a=c}while(0);do if(s<<24>>24==42){l=a+1|0;s=(d[l>>0]|0)+-48|0;if(s>>>0<10?(d[a+2>>0]|0)==36:0){p[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=p[i+((d[l>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!F){S=m;a=l;t=0;k=0;break}t=(p[r>>2]|0)+(4-1)&~(4-1);s=p[t>>2]|0;p[r>>2]=t+4;t=0;a=l}if((s|0)<0){S=m|8192;k=0-s|0}else{S=m;k=s}}else{l=(s<<24>>24)+-48|0;if(l>>>0<10){s=0;do{s=(s*10|0)+l|0;a=a+1|0;l=(d[a>>0]|0)+-48|0}while(l>>>0<10);if((s|0)<0){o=-1;break e}else{S=m;k=s}}else{S=m;k=0}}while(0);t:do if((d[a>>0]|0)==46){l=a+1|0;s=d[l>>0]|0;if(s<<24>>24!=42){c=(s<<24>>24)+-48|0;if(c>>>0<10){a=l;s=0}else{a=l;c=0;break}while(1){s=(s*10|0)+c|0;a=a+1|0;c=(d[a>>0]|0)+-48|0;if(c>>>0>=10){c=s;break t}}}l=a+2|0;s=(d[l>>0]|0)+-48|0;if(s>>>0<10?(d[a+3>>0]|0)==36:0){p[n+(s<<2)>>2]=10;a=a+4|0;c=p[i+((d[l>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(F){a=(p[r>>2]|0)+(4-1)&~(4-1);c=p[a>>2]|0;p[r>>2]=a+4;a=l}else{a=l;c=0}}else c=-1;while(0);g=0;while(1){s=(d[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}l=a+1|0;s=d[5347+(g*58|0)+s>>0]|0;m=s&255;if((m+-1|0)>>>0<8){a=l;g=m}else{N=l;break}}if(!(s<<24>>24)){o=-1;break}l=(v|0)>-1;do if(s<<24>>24==19)if(l){o=-1;break e}else L=52;else{if(l){p[n+(v<<2)>>2]=m;O=i+(v<<3)|0;R=p[O+4>>2]|0;L=ee;p[L>>2]=p[O>>2];p[L+4>>2]=R;L=52;break}if(!F){o=0;break e}Lr(ee,m,r)}while(0);if((L|0)==52?(L=0,!F):0){C=N;a=E;continue}v=d[a>>0]|0;v=(g|0)!=0&(v&15|0)==3?v&-33:v;l=S&-65537;R=(S&8192|0)==0?S:l;t:do switch(v|0){case 110:switch(g|0){case 0:{p[p[ee>>2]>>2]=o;C=N;a=E;continue e}case 1:{p[p[ee>>2]>>2]=o;C=N;a=E;continue e}case 2:{C=p[ee>>2]|0;p[C>>2]=o;p[C+4>>2]=((o|0)<0)<<31>>31;C=N;a=E;continue e}case 3:{h[p[ee>>2]>>1]=o;C=N;a=E;continue e}case 4:{d[p[ee>>2]>>0]=o;C=N;a=E;continue e}case 6:{p[p[ee>>2]>>2]=o;C=N;a=E;continue e}case 7:{C=p[ee>>2]|0;p[C>>2]=o;p[C+4>>2]=((o|0)<0)<<31>>31;C=N;a=E;continue e}default:{C=N;a=E;continue e}}case 112:{g=R|8;c=c>>>0>8?c:8;v=120;L=64;break}case 88:case 120:{g=R;L=64;break}case 111:{l=ee;s=p[l>>2]|0;l=p[l+4>>2]|0;if((s|0)==0&(l|0)==0)a=B;else{a=B;do{a=a+-1|0;d[a>>0]=s&7|48;s=Qr(s|0,l|0,3)|0;l=V}while(!((s|0)==0&(l|0)==0))}if(!(R&8)){s=R;g=0;m=5827;L=77}else{g=q-a+1|0;s=R;c=(c|0)<(g|0)?g:c;g=0;m=5827;L=77}break}case 105:case 100:{s=ee;a=p[s>>2]|0;s=p[s+4>>2]|0;if((s|0)<0){a=qr(0,0,a|0,s|0)|0;s=V;l=ee;p[l>>2]=a;p[l+4>>2]=s;l=1;m=5827;L=76;break t}if(!(R&2048)){m=R&1;l=m;m=(m|0)==0?5827:5829;L=76}else{l=1;m=5828;L=76}break}case 117:{s=ee;a=p[s>>2]|0;s=p[s+4>>2]|0;l=0;m=5827;L=76;break}case 99:{d[Y>>0]=p[ee>>2];C=Y;s=1;g=0;v=5827;a=B;break}case 109:{a=lr()|0;a=sr(p[a>>2]|0)|0;L=82;break}case 115:{a=p[ee>>2]|0;a=(a|0)!=0?a:5837;L=82;break}case 67:{p[oe>>2]=p[ee>>2];p[X>>2]=0;p[ee>>2]=oe;c=-1;L=86;break}case 83:{if(!c){Br(e,32,k,0,R);a=0;L=98}else L=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{u=+_[ee>>3];p[ie>>2]=0;_[w>>3]=u;if((p[w+4>>2]|0)>=0)if(!(R&2048)){O=R&1;M=O;O=(O|0)==0?5845:5850}else{M=1;O=5847}else{u=-u;M=1;O=5844}_[w>>3]=u;I=p[w+4>>2]&2146435072;do if(I>>>0<2146435072|(I|0)==2146435072&0<0){y=+dr(u,ie)*2;s=y!=0;if(s)p[ie>>2]=(p[ie>>2]|0)+-1;A=v|32;if((A|0)==97){C=v&32;E=(C|0)==0?O:O+9|0;S=M|2;a=12-c|0;do if(!(c>>>0>11|(a|0)==0)){u=8;do{a=a+-1|0;u=u*16}while((a|0)!=0);if((d[E>>0]|0)==45){u=-(u+(-y-u));break}else{u=y+u-u;break}}else u=y;while(0);s=p[ie>>2]|0;a=(s|0)<0?0-s|0:s;a=Fr(a,((a|0)<0)<<31>>31,Q)|0;if((a|0)==(Q|0)){d[Z>>0]=48;a=Z}d[a+-1>>0]=(s>>31&2)+43;g=a+-2|0;d[g>>0]=v+15;m=(c|0)<1;l=(R&8|0)==0;s=re;while(1){O=~~u;a=s+1|0;d[s>>0]=f[5811+O>>0]|C;u=(u-+(O|0))*16;do if((a-K|0)==1){if(l&(m&u==0))break;d[a>>0]=46;a=s+2|0}while(0);if(!(u!=0))break;else s=a}c=(c|0)!=0&(U+a|0)<(c|0)?z+c-g|0:$-g+a|0;l=c+S|0;Br(e,32,k,l,R);if(!(p[e>>2]&32))gr(E,S,e)|0;Br(e,48,k,l,R^65536);a=a-K|0;if(!(p[e>>2]&32))gr(re,a,e)|0;s=J-g|0;Br(e,48,c-(a+s)|0,0,0);if(!(p[e>>2]&32))gr(g,s,e)|0;Br(e,32,k,l,R^8192);a=(l|0)<(k|0)?k:l;break}a=(c|0)<0?6:c;if(s){s=(p[ie>>2]|0)+-28|0;p[ie>>2]=s;u=y*268435456}else{u=y;s=p[ie>>2]|0}I=(s|0)<0?te:G;D=I;s=I;do{P=~~u>>>0;p[s>>2]=P;s=s+4|0;u=(u-+(P>>>0))*1e9}while(u!=0);l=s;s=p[ie>>2]|0;if((s|0)>0){m=I;while(1){g=(s|0)>29?29:s;c=l+-4|0;do if(c>>>0<m>>>0)c=m;else{s=0;do{P=Zr(p[c>>2]|0,0,g|0)|0;P=Yr(P|0,V|0,s|0,0)|0;s=V;x=oi(P|0,s|0,1e9,0)|0;p[c>>2]=x;s=ni(P|0,s|0,1e9,0)|0;c=c+-4|0}while(c>>>0>=m>>>0);if(!s){c=m;break}c=m+-4|0;p[c>>2]=s}while(0);while(1){if(l>>>0<=c>>>0)break;s=l+-4|0;if(!(p[s>>2]|0))l=s;else break}s=(p[ie>>2]|0)-g|0;p[ie>>2]=s;if((s|0)>0)m=c;else break}}else c=I;if((s|0)<0){E=((a+25|0)/9|0)+1|0;T=(A|0)==102;C=c;while(1){S=0-s|0;S=(S|0)>9?9:S;do if(C>>>0<l>>>0){s=(1<<S)+-1|0;m=1e9>>>S;c=0;g=C;do{P=p[g>>2]|0;p[g>>2]=(P>>>S)+c;c=ce(P&s,m)|0;g=g+4|0}while(g>>>0<l>>>0);s=(p[C>>2]|0)==0?C+4|0:C;if(!c){c=s;break}p[l>>2]=c;c=s;l=l+4|0}else c=(p[C>>2]|0)==0?C+4|0:C;while(0);s=T?I:c;l=(l-s>>2|0)>(E|0)?s+(E<<2)|0:l;s=(p[ie>>2]|0)+S|0;p[ie>>2]=s;if((s|0)>=0){C=c;break}else C=c}}else C=c;do if(C>>>0<l>>>0){s=(D-C>>2)*9|0;m=p[C>>2]|0;if(m>>>0<10)break;else c=10;do{c=c*10|0;s=s+1|0}while(m>>>0>=c>>>0)}else s=0;while(0);x=(A|0)==103;P=(a|0)!=0;c=a-((A|0)!=102?s:0)+((P&x)<<31>>31)|0;if((c|0)<(((l-D>>2)*9|0)+-9|0)){g=c+9216|0;T=(g|0)/9|0;c=I+(T+-1023<<2)|0;g=((g|0)%9|0)+1|0;if((g|0)<9){m=10;do{m=m*10|0;g=g+1|0}while((g|0)!=9)}else m=10;S=p[c>>2]|0;E=(S>>>0)%(m>>>0)|0;if((E|0)==0?(I+(T+-1022<<2)|0)==(l|0):0)m=C;else L=163;do if((L|0)==163){L=0;y=(((S>>>0)/(m>>>0)|0)&1|0)==0?9007199254740992:9007199254740994;g=(m|0)/2|0;do if(E>>>0<g>>>0)u=.5;else{if((E|0)==(g|0)?(I+(T+-1022<<2)|0)==(l|0):0){u=1;break}u=1.5}while(0);do if(M){if((d[O>>0]|0)!=45)break;y=-y;u=-u}while(0);g=S-E|0;p[c>>2]=g;if(!(y+u!=y)){m=C;break}A=g+m|0;p[c>>2]=A;if(A>>>0>999999999){s=C;while(1){m=c+-4|0;p[c>>2]=0;if(m>>>0<s>>>0){s=s+-4|0;p[s>>2]=0}A=(p[m>>2]|0)+1|0;p[m>>2]=A;if(A>>>0>999999999)c=m;else{C=s;c=m;break}}}s=(D-C>>2)*9|0;g=p[C>>2]|0;if(g>>>0<10){m=C;break}else m=10;do{m=m*10|0;s=s+1|0}while(g>>>0>=m>>>0);m=C}while(0);A=c+4|0;C=m;l=l>>>0>A>>>0?A:l}E=0-s|0;while(1){if(l>>>0<=C>>>0){T=0;A=l;break}c=l+-4|0;if(!(p[c>>2]|0))l=c;else{T=1;A=l;break}}do if(x){a=(P&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){v=v+-1|0;a=a+-1-s|0}else{v=v+-2|0;a=a+-1|0}l=R&8;if(l)break;do if(T){l=p[A+-4>>2]|0;if(!l){c=9;break}if(!((l>>>0)%10|0)){m=10;c=0}else{c=0;break}do{m=m*10|0;c=c+1|0}while(((l>>>0)%(m>>>0)|0|0)==0)}else c=9;while(0);l=((A-D>>2)*9|0)+-9|0;if((v|32|0)==102){l=l-c|0;l=(l|0)<0?0:l;a=(a|0)<(l|0)?a:l;l=0;break}else{l=l+s-c|0;l=(l|0)<0?0:l;a=(a|0)<(l|0)?a:l;l=0;break}}else l=R&8;while(0);S=a|l;m=(S|0)!=0&1;g=(v|32|0)==102;if(g){s=(s|0)>0?s:0;v=0}else{c=(s|0)<0?E:s;c=Fr(c,((c|0)<0)<<31>>31,Q)|0;if((J-c|0)<2)do{c=c+-1|0;d[c>>0]=48}while((J-c|0)<2);d[c+-1>>0]=(s>>31&2)+43;D=c+-2|0;d[D>>0]=v;s=J-D|0;v=D}E=M+1+a+m+s|0;Br(e,32,k,E,R);if(!(p[e>>2]&32))gr(O,M,e)|0;Br(e,48,k,E,R^65536);do if(g){c=C>>>0>I>>>0?I:C;s=c;do{l=Fr(p[s>>2]|0,0,H)|0;do if((s|0)==(c|0)){if((l|0)!=(H|0))break;d[j>>0]=48;l=j}else{if(l>>>0<=re>>>0)break;do{l=l+-1|0;d[l>>0]=48}while(l>>>0>re>>>0)}while(0);if(!(p[e>>2]&32))gr(l,W-l|0,e)|0;s=s+4|0}while(s>>>0<=I>>>0);do if(S){if(p[e>>2]&32)break;gr(5879,1,e)|0}while(0);if((a|0)>0&s>>>0<A>>>0){l=s;while(1){s=Fr(p[l>>2]|0,0,H)|0;if(s>>>0>re>>>0)do{s=s+-1|0;d[s>>0]=48}while(s>>>0>re>>>0);if(!(p[e>>2]&32))gr(s,(a|0)>9?9:a,e)|0;l=l+4|0;s=a+-9|0;if(!((a|0)>9&l>>>0<A>>>0)){a=s;break}else a=s}}Br(e,48,a+9|0,9,0)}else{g=T?A:C+4|0;if((a|0)>-1){m=(l|0)==0;c=C;do{s=Fr(p[c>>2]|0,0,H)|0;if((s|0)==(H|0)){d[j>>0]=48;s=j}do if((c|0)==(C|0)){l=s+1|0;if(!(p[e>>2]&32))gr(s,1,e)|0;if(m&(a|0)<1){s=l;break}if(p[e>>2]&32){s=l;break}gr(5879,1,e)|0;s=l}else{if(s>>>0<=re>>>0)break;do{s=s+-1|0;d[s>>0]=48}while(s>>>0>re>>>0)}while(0);l=W-s|0;if(!(p[e>>2]&32))gr(s,(a|0)>(l|0)?l:a,e)|0;a=a-l|0;c=c+4|0}while(c>>>0<g>>>0&(a|0)>-1)}Br(e,48,a+18|0,18,0);if(p[e>>2]&32)break;gr(v,J-v|0,e)|0}while(0);Br(e,32,k,E,R^8192);a=(E|0)<(k|0)?k:E}else{g=(v&32|0)!=0;m=u!=u|0!=0;s=m?0:M;c=s+3|0;Br(e,32,k,c,l);a=p[e>>2]|0;if(!(a&32)){gr(O,s,e)|0;a=p[e>>2]|0}if(!(a&32))gr(m?g?5871:5875:g?5863:5867,3,e)|0;Br(e,32,k,c,R^8192);a=(c|0)<(k|0)?k:c}while(0);C=N;continue e}default:{l=R;s=c;g=0;v=5827;a=B}}while(0);t:do if((L|0)==64){l=ee;s=p[l>>2]|0;l=p[l+4>>2]|0;m=v&32;if(!((s|0)==0&(l|0)==0)){a=B;do{a=a+-1|0;d[a>>0]=f[5811+(s&15)>>0]|m;s=Qr(s|0,l|0,4)|0;l=V}while(!((s|0)==0&(l|0)==0));L=ee;if((g&8|0)==0|(p[L>>2]|0)==0&(p[L+4>>2]|0)==0){s=g;g=0;m=5827;L=77}else{s=g;g=2;m=5827+(v>>4)|0;L=77}}else{a=B;s=g;g=0;m=5827;L=77}}else if((L|0)==76){a=Fr(a,s,B)|0;s=R;g=l;L=77}else if((L|0)==82){L=0;R=Mr(a,0,c)|0;O=(R|0)==0;C=a;s=O?c:R-a|0;g=0;v=5827;a=O?a+c|0:R}else if((L|0)==86){L=0;s=0;a=0;m=p[ee>>2]|0;while(1){l=p[m>>2]|0;if(!l)break;a=pr(ne,l)|0;if((a|0)<0|a>>>0>(c-s|0)>>>0)break;s=a+s|0;if(c>>>0>s>>>0)m=m+4|0;else break}if((a|0)<0){o=-1;break e}Br(e,32,k,s,R);if(!s){a=0;L=98}else{l=0;c=p[ee>>2]|0;while(1){a=p[c>>2]|0;if(!a){a=s;L=98;break t}a=pr(ne,a)|0;l=a+l|0;if((l|0)>(s|0)){a=s;L=98;break t}if(!(p[e>>2]&32))gr(ne,a,e)|0;if(l>>>0>=s>>>0){a=s;L=98;break}else c=c+4|0}}}while(0);if((L|0)==98){L=0;Br(e,32,k,a,R^8192);C=N;a=(k|0)>(a|0)?k:a;continue}if((L|0)==77){L=0;l=(c|0)>-1?s&-65537:s;s=ee;s=(p[s>>2]|0)!=0|(p[s+4>>2]|0)!=0;if((c|0)!=0|s){s=(s&1^1)+(q-a)|0;C=a;s=(c|0)>(s|0)?c:s;v=m;a=B}else{C=B;s=0;v=m;a=B}}m=a-C|0;s=(s|0)<(m|0)?m:s;c=g+s|0;a=(k|0)<(c|0)?c:k;Br(e,32,a,c,l);if(!(p[e>>2]&32))gr(v,g,e)|0;Br(e,48,a,c,l^65536);Br(e,48,s,m,0);if(!(p[e>>2]&32))gr(C,m,e)|0;Br(e,32,a,c,l^8192);C=N}e:do if((L|0)==245)if(!e)if(t){o=1;while(1){t=p[n+(o<<2)>>2]|0;if(!t)break;Lr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(p[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0;while(0);b=ae;return o|0}function Nr(e){e=e|0;if(!(p[e+68>>2]|0))Er(e);return}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=p[i>>2]|0;e=(p[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Kr(n|0,t|0,e|0)|0;p[i>>2]=(p[i>>2]|0)+e;return r|0}function Lr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;e:do if(t>>>0<=20)do switch(t|0){case 9:{i=(p[r>>2]|0)+(4-1)&~(4-1);t=p[i>>2]|0;p[r>>2]=i+4;p[e>>2]=t;break e}case 10:{i=(p[r>>2]|0)+(4-1)&~(4-1);t=p[i>>2]|0;p[r>>2]=i+4;i=e;p[i>>2]=t;p[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(p[r>>2]|0)+(4-1)&~(4-1);t=p[i>>2]|0;p[r>>2]=i+4;i=e;p[i>>2]=t;p[i+4>>2]=0;break e}case 12:{i=(p[r>>2]|0)+(8-1)&~(8-1);t=i;n=p[t>>2]|0;t=p[t+4>>2]|0;p[r>>2]=i+8;i=e;p[i>>2]=n;p[i+4>>2]=t;break e}case 13:{n=(p[r>>2]|0)+(4-1)&~(4-1);i=p[n>>2]|0;p[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;p[n>>2]=i;p[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(p[r>>2]|0)+(4-1)&~(4-1);i=p[n>>2]|0;p[r>>2]=n+4;n=e;p[n>>2]=i&65535;p[n+4>>2]=0;break e}case 15:{n=(p[r>>2]|0)+(4-1)&~(4-1);i=p[n>>2]|0;p[r>>2]=n+4;i=(i&255)<<24>>24;n=e;p[n>>2]=i;p[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(p[r>>2]|0)+(4-1)&~(4-1);i=p[n>>2]|0;p[r>>2]=n+4;n=e;p[n>>2]=i&255;p[n+4>>2]=0;break e}case 17:{n=(p[r>>2]|0)+(8-1)&~(8-1);o=+_[n>>3];p[r>>2]=n+8;_[e>>3]=o;break e}case 18:{n=(p[r>>2]|0)+(8-1)&~(8-1);o=+_[n>>3];p[r>>2]=n+8;_[e>>3]=o;break e}default:break e}while(0);while(0);return}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=oi(e|0,t|0,10,0)|0;r=r+-1|0;d[r>>0]=i|48;i=ni(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=V}else{e=i;break}}if(e)while(1){r=r+-1|0;d[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Br(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=b;b=b+256|0;a=s;do if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Xr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=p[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){gr(a,256,e)|0;t=p[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;gr(a,n,e)|0}while(0);b=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,g=0,v=0,_=0,y=0,b=0,C=0,w=0,S=0,E=0,T=0,x=0,P=0,A=0,D=0,I=0,M=0,O=0,R=0,N=0,k=0,L=0,F=0,B=0;do if(e>>>0<245){f=e>>>0<11?16:e+11&-8;e=f>>>3;s=p[147]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=628+(i<<2)|0;i=628+(i+2<<2)|0;n=p[i>>2]|0;o=n+8|0;a=p[o>>2]|0;do if((r|0)!=(a|0)){if(a>>>0<(p[151]|0)>>>0)De();t=a+12|0;if((p[t>>2]|0)==(n|0)){p[t>>2]=r;p[i>>2]=a;break}else De()}else p[147]=s&~(1<<e);while(0);B=e<<3;p[n+4>>2]=B|3;B=n+(B|4)|0;p[B>>2]=p[B>>2]|1;B=o;return B|0}a=p[149]|0;if(f>>>0>a>>>0){if(r){i=2<<e;i=r<<e&(i|0-i);i=(i&0-i)+-1|0;l=i>>>12&16;i=i>>>l;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|l|o|r|e)+(i>>>e)|0;i=e<<1;r=628+(i<<2)|0;i=628+(i+2<<2)|0;o=p[i>>2]|0;l=o+8|0;n=p[l>>2]|0;do if((r|0)!=(n|0)){if(n>>>0<(p[151]|0)>>>0)De();t=n+12|0;if((p[t>>2]|0)==(o|0)){p[t>>2]=r;p[i>>2]=n;u=p[149]|0;break}else De()}else{p[147]=s&~(1<<e);u=a}while(0);B=e<<3;a=B-f|0;p[o+4>>2]=f|3;s=o+f|0;p[o+(f|4)>>2]=a|1;p[o+B>>2]=a;if(u){n=p[152]|0;r=u>>>3;t=r<<1;i=628+(t<<2)|0;e=p[147]|0;r=1<<r;if(e&r){e=628+(t+2<<2)|0;t=p[e>>2]|0;if(t>>>0<(p[151]|0)>>>0)De();else{c=e;d=t}}else{p[147]=e|r;c=628+(t+2<<2)|0;d=i}p[c>>2]=n;p[d+12>>2]=n;p[n+8>>2]=d;p[n+12>>2]=i}p[149]=a;p[152]=s;B=l;return B|0}e=p[148]|0;if(e){r=(e&0-e)+-1|0;F=r>>>12&16;r=r>>>F;L=r>>>5&8;r=r>>>L;B=r>>>2&4;r=r>>>B;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=p[892+((L|F|B|e|i)+(r>>>i)<<2)>>2]|0;r=(p[i+4>>2]&-8)-f|0;e=i;while(1){t=p[e+16>>2]|0;if(!t){t=p[e+20>>2]|0;if(!t){l=r;break}}e=(p[t+4>>2]&-8)-f|0;B=e>>>0<r>>>0;r=B?e:r;e=t;i=B?t:i}o=p[151]|0;if(i>>>0<o>>>0)De();s=i+f|0;if(i>>>0>=s>>>0)De();a=p[i+24>>2]|0;r=p[i+12>>2]|0;do if((r|0)==(i|0)){e=i+20|0;t=p[e>>2]|0;if(!t){e=i+16|0;t=p[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=p[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=p[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0<o>>>0)De();else{p[e>>2]=0;h=t;break}}else{n=p[i+8>>2]|0;if(n>>>0<o>>>0)De();t=n+12|0;if((p[t>>2]|0)!=(i|0))De();e=r+8|0;if((p[e>>2]|0)==(i|0)){p[t>>2]=r;p[e>>2]=n;h=r;break}else De()}while(0);do if(a){t=p[i+28>>2]|0;e=892+(t<<2)|0;if((i|0)==(p[e>>2]|0)){p[e>>2]=h;if(!h){p[148]=p[148]&~(1<<t);break}}else{if(a>>>0<(p[151]|0)>>>0)De();t=a+16|0;if((p[t>>2]|0)==(i|0))p[t>>2]=h;else p[a+20>>2]=h;if(!h)break}e=p[151]|0;if(h>>>0<e>>>0)De();p[h+24>>2]=a;t=p[i+16>>2]|0;do if(t)if(t>>>0<e>>>0)De();else{p[h+16>>2]=t;p[t+24>>2]=h;break}while(0);t=p[i+20>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)De();else{p[h+20>>2]=t;p[t+24>>2]=h;break}}while(0);if(l>>>0<16){B=l+f|0;p[i+4>>2]=B|3;B=i+(B+4)|0;p[B>>2]=p[B>>2]|1}else{p[i+4>>2]=f|3;p[i+(f|4)>>2]=l|1;p[i+(l+f)>>2]=l;t=p[149]|0;if(t){o=p[152]|0;r=t>>>3;t=r<<1;n=628+(t<<2)|0;e=p[147]|0;r=1<<r;if(e&r){t=628+(t+2<<2)|0;e=p[t>>2]|0;if(e>>>0<(p[151]|0)>>>0)De();else{m=t;g=e}}else{p[147]=e|r;m=628+(t+2<<2)|0;g=n}p[m>>2]=o;p[g+12>>2]=o;p[o+8>>2]=g;p[o+12>>2]=n}p[149]=l;p[152]=s}B=i+8|0;return B|0}else g=f}else g=f}else if(e>>>0<=4294967231){e=e+11|0;d=e&-8;c=p[148]|0;if(c){r=0-d|0;e=e>>>8;if(e)if(d>>>0>16777215)u=31;else{g=(e+1048320|0)>>>16&8;C=e<<g;m=(C+520192|0)>>>16&4;C=C<<m;u=(C+245760|0)>>>16&2;u=14-(m|g|u)+(C<<u>>>15)|0;u=d>>>(u+7|0)&1|u<<1}else u=0;e=p[892+(u<<2)>>2]|0;e:do if(!e){n=0;e=0;C=86}else{a=r;n=0;s=d<<((u|0)==31?0:25-(u>>>1)|0);l=e;e=0;while(1){o=p[l+4>>2]&-8;r=o-d|0;if(r>>>0<a>>>0)if((o|0)==(d|0)){o=l;e=l;C=90;break e}else e=l;else r=a;C=p[l+20>>2]|0;l=p[l+16+(s>>>31<<2)>>2]|0;n=(C|0)==0|(C|0)==(l|0)?n:C;if(!l){C=86;break}else{a=r;s=s<<1}}}while(0);if((C|0)==86){if((n|0)==0&(e|0)==0){e=2<<u;e=c&(e|0-e);if(!e){g=d;break}e=(e&0-e)+-1|0;h=e>>>12&16;e=e>>>h;c=e>>>5&8;e=e>>>c;m=e>>>2&4;e=e>>>m;g=e>>>1&2;e=e>>>g;n=e>>>1&1;n=p[892+((c|h|m|g|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;l=e}else{o=n;C=90}}if((C|0)==90)while(1){C=0;g=(p[o+4>>2]&-8)-d|0;n=g>>>0<r>>>0;r=n?g:r;e=n?o:e;n=p[o+16>>2]|0;if(n){o=n;C=90;continue}o=p[o+20>>2]|0;if(!o){s=r;l=e;break}else C=90}if((l|0)!=0?s>>>0<((p[149]|0)-d|0)>>>0:0){n=p[151]|0;if(l>>>0<n>>>0)De();a=l+d|0;if(l>>>0>=a>>>0)De();o=p[l+24>>2]|0;r=p[l+12>>2]|0;do if((r|0)==(l|0)){e=l+20|0;t=p[e>>2]|0;if(!t){e=l+16|0;t=p[e>>2]|0;if(!t){f=0;break}}while(1){r=t+20|0;i=p[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=p[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0<n>>>0)De();else{p[e>>2]=0;f=t;break}}else{i=p[l+8>>2]|0;if(i>>>0<n>>>0)De();t=i+12|0;if((p[t>>2]|0)!=(l|0))De();e=r+8|0;if((p[e>>2]|0)==(l|0)){p[t>>2]=r;p[e>>2]=i;f=r;break}else De()}while(0);do if(o){t=p[l+28>>2]|0;e=892+(t<<2)|0;if((l|0)==(p[e>>2]|0)){p[e>>2]=f;if(!f){p[148]=p[148]&~(1<<t);break}}else{if(o>>>0<(p[151]|0)>>>0)De();t=o+16|0;if((p[t>>2]|0)==(l|0))p[t>>2]=f;else p[o+20>>2]=f;if(!f)break}e=p[151]|0;if(f>>>0<e>>>0)De();p[f+24>>2]=o;t=p[l+16>>2]|0;do if(t)if(t>>>0<e>>>0)De();else{p[f+16>>2]=t;p[t+24>>2]=f;break}while(0);t=p[l+20>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)De();else{p[f+20>>2]=t;p[t+24>>2]=f;break}}while(0);e:do if(s>>>0>=16){p[l+4>>2]=d|3;p[l+(d|4)>>2]=s|1;p[l+(s+d)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=628+(e<<2)|0;r=p[147]|0;t=1<<t;if(r&t){t=628+(e+2<<2)|0;e=p[t>>2]|0;if(e>>>0<(p[151]|0)>>>0)De();else{_=t;y=e}}else{p[147]=r|t;_=628+(e+2<<2)|0;y=i}p[_>>2]=a;p[y+12>>2]=a;p[l+(d+8)>>2]=y;p[l+(d+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{F=(t+1048320|0)>>>16&8;B=t<<F;L=(B+520192|0)>>>16&4;B=B<<L;i=(B+245760|0)>>>16&2;i=14-(L|F|i)+(B<<i>>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=892+(i<<2)|0;p[l+(d+28)>>2]=i;p[l+(d+20)>>2]=0;p[l+(d+16)>>2]=0;e=p[148]|0;r=1<<i;if(!(e&r)){p[148]=e|r;p[t>>2]=a;p[l+(d+24)>>2]=t;p[l+(d+12)>>2]=a;p[l+(d+8)>>2]=a;break}t=p[t>>2]|0;t:do if((p[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=p[e>>2]|0;if(!r)break;if((p[r+4>>2]&-8|0)==(s|0)){E=r;break t}else{i=i<<1;t=r}}if(e>>>0<(p[151]|0)>>>0)De();else{p[e>>2]=a;p[l+(d+24)>>2]=t;p[l+(d+12)>>2]=a;p[l+(d+8)>>2]=a;break e}}else E=t;while(0);t=E+8|0;e=p[t>>2]|0;B=p[151]|0;if(e>>>0>=B>>>0&E>>>0>=B>>>0){p[e+12>>2]=a;p[t>>2]=a;p[l+(d+8)>>2]=e;p[l+(d+12)>>2]=E;p[l+(d+24)>>2]=0;break}else De()}else{B=s+d|0;p[l+4>>2]=B|3;B=l+(B+4)|0;p[B>>2]=p[B>>2]|1}while(0);B=l+8|0;return B|0}else g=d}else g=d}else g=-1;while(0);r=p[149]|0;if(r>>>0>=g>>>0){t=r-g|0;e=p[152]|0;if(t>>>0>15){p[152]=e+g;p[149]=t;p[e+(g+4)>>2]=t|1;p[e+r>>2]=t;p[e+4>>2]=g|3}else{p[149]=0;p[152]=0;p[e+4>>2]=r|3;B=e+(r+4)|0;p[B>>2]=p[B>>2]|1}B=e+8|0;return B|0}e=p[150]|0;if(e>>>0>g>>>0){F=e-g|0;p[150]=F;B=p[153]|0;p[153]=B+g;p[B+(g+4)>>2]=F|1;p[B+4>>2]=g|3;B=B+8|0;return B|0}do if(!(p[265]|0)){e=ze(30)|0;if(!(e+-1&e)){p[267]=e;p[266]=e;p[268]=-1;p[269]=-1;p[270]=0;p[258]=0;E=(Re(0)|0)&-16^1431655768;p[265]=E;break}else De()}while(0);l=g+48|0;s=p[267]|0;u=g+47|0;a=s+u|0;s=0-s|0;c=a&s;if(c>>>0<=g>>>0){B=0;return B|0}e=p[257]|0;if((e|0)!=0?(y=p[255]|0,E=y+c|0,E>>>0<=y>>>0|E>>>0>e>>>0):0){B=0;return B|0}e:do if(!(p[258]&4)){e=p[153]|0;t:do if(e){n=1036;while(1){r=p[n>>2]|0;if(r>>>0<=e>>>0?(v=n+4|0,(r+(p[v>>2]|0)|0)>>>0>e>>>0):0){o=n;e=v;break}n=p[n+8>>2]|0;if(!n){C=174;break t}}r=a-(p[150]|0)&s;if(r>>>0<2147483647){n=Oe(r|0)|0;E=(n|0)==((p[o>>2]|0)+(p[e>>2]|0)|0);e=E?r:0;if(E){if((n|0)!=(-1|0)){w=n;m=e;C=194;break e}}else C=184}else e=0}else C=174;while(0);do if((C|0)==174){o=Oe(0)|0;if((o|0)!=(-1|0)){e=o;r=p[266]|0;n=r+-1|0;if(!(n&e))r=c;else r=c-e+(n+e&0-r)|0;e=p[255]|0;n=e+r|0;if(r>>>0>g>>>0&r>>>0<2147483647){E=p[257]|0;if((E|0)!=0?n>>>0<=e>>>0|n>>>0>E>>>0:0){e=0;break}n=Oe(r|0)|0;E=(n|0)==(o|0);e=E?r:0;if(E){w=o;m=e;C=194;break e}else C=184}else e=0}else e=0}while(0);t:do if((C|0)==184){o=0-r|0;do if(l>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(b=p[267]|0,b=u-r+b&0-b,b>>>0<2147483647):0)if((Oe(b|0)|0)==(-1|0)){Oe(o|0)|0;break t}else{r=b+r|0;break}while(0);if((n|0)!=(-1|0)){w=n;m=r;C=194;break e}}while(0);p[258]=p[258]|4;C=191}else{e=0;C=191}while(0);if((((C|0)==191?c>>>0<2147483647:0)?(w=Oe(c|0)|0,S=Oe(0)|0,w>>>0<S>>>0&((w|0)!=(-1|0)&(S|0)!=(-1|0))):0)?(T=S-w|0,x=T>>>0>(g+40|0)>>>0,x):0){m=x?T:e;C=194}if((C|0)==194){e=(p[255]|0)+m|0;p[255]=e;if(e>>>0>(p[256]|0)>>>0)p[256]=e;a=p[153]|0;e:do if(a){o=1036;do{e=p[o>>2]|0;r=o+4|0;n=p[r>>2]|0;if((w|0)==(e+n|0)){P=e;A=r;D=n;I=o;C=204;break}o=p[o+8>>2]|0}while((o|0)!=0);if(((C|0)==204?(p[I+12>>2]&8|0)==0:0)?a>>>0<w>>>0&a>>>0>=P>>>0:0){p[A>>2]=D+m;B=(p[150]|0)+m|0;F=a+8|0;F=(F&7|0)==0?0:0-F&7;L=B-F|0;p[153]=a+F;p[150]=L;p[a+(F+4)>>2]=L|1;p[a+(B+4)>>2]=40;p[154]=p[269];break}e=p[151]|0;if(w>>>0<e>>>0){p[151]=w;e=w}r=w+m|0;o=1036;while(1){if((p[o>>2]|0)==(r|0)){n=o;r=o;C=212;break}o=p[o+8>>2]|0;if(!o){r=1036;break}}if((C|0)==212)if(!(p[r+12>>2]&8)){p[n>>2]=w;h=r+4|0;p[h>>2]=(p[h>>2]|0)+m;h=w+8|0;h=(h&7|0)==0?0:0-h&7;u=w+(m+8)|0;u=(u&7|0)==0?0:0-u&7;t=w+(u+m)|0;d=h+g|0;f=w+d|0;c=t-(w+h)-g|0;p[w+(h+4)>>2]=g|3;t:do if((t|0)!=(a|0)){if((t|0)==(p[152]|0)){B=(p[149]|0)+c|0;p[149]=B;p[152]=f;p[w+(d+4)>>2]=B|1;p[w+(B+d)>>2]=B;break}s=m+4|0;r=p[w+(s+u)>>2]|0;if((r&3|0)==1){l=r&-8;o=r>>>3;r:do if(r>>>0>=256){a=p[w+((u|24)+m)>>2]|0;i=p[w+(m+12+u)>>2]|0;do if((i|0)==(t|0)){n=u|16;i=w+(s+n)|0;r=p[i>>2]|0;if(!r){i=w+(n+m)|0;r=p[i>>2]|0;if(!r){k=0;break}}while(1){n=r+20|0;o=p[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=p[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<e>>>0)De();else{p[i>>2]=0;k=r;break}}else{n=p[w+((u|8)+m)>>2]|0;if(n>>>0<e>>>0)De();e=n+12|0;if((p[e>>2]|0)!=(t|0))De();r=i+8|0;if((p[r>>2]|0)==(t|0)){p[e>>2]=i;p[r>>2]=n;k=i;break}else De()}while(0);if(!a)break;e=p[w+(m+28+u)>>2]|0;r=892+(e<<2)|0;do if((t|0)!=(p[r>>2]|0)){if(a>>>0<(p[151]|0)>>>0)De();e=a+16|0;if((p[e>>2]|0)==(t|0))p[e>>2]=k;else p[a+20>>2]=k;if(!k)break r}else{p[r>>2]=k;if(k)break;p[148]=p[148]&~(1<<e);break r}while(0);r=p[151]|0;if(k>>>0<r>>>0)De();p[k+24>>2]=a;t=u|16;e=p[w+(t+m)>>2]|0;do if(e)if(e>>>0<r>>>0)De();else{p[k+16>>2]=e;p[e+24>>2]=k;break}while(0);t=p[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(p[151]|0)>>>0)De();else{p[k+20>>2]=t;p[t+24>>2]=k;break}}else{i=p[w+((u|8)+m)>>2]|0;n=p[w+(m+12+u)>>2]|0;r=628+(o<<1<<2)|0;do if((i|0)!=(r|0)){if(i>>>0<e>>>0)De();if((p[i+12>>2]|0)==(t|0))break;De()}while(0);if((n|0)==(i|0)){p[147]=p[147]&~(1<<o);break}do if((n|0)==(r|0))M=n+8|0;else{if(n>>>0<e>>>0)De();e=n+8|0;if((p[e>>2]|0)==(t|0)){M=e;break}De()}while(0);p[i+12>>2]=n;p[M>>2]=i}while(0);t=w+((l|u)+m)|0;n=l+c|0}else n=c;t=t+4|0;p[t>>2]=p[t>>2]&-2;p[w+(d+4)>>2]=n|1;p[w+(n+d)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=628+(e<<2)|0;r=p[147]|0;t=1<<t;do if(!(r&t)){p[147]=r|t;L=628+(e+2<<2)|0;F=i}else{t=628+(e+2<<2)|0;e=p[t>>2]|0;if(e>>>0>=(p[151]|0)>>>0){L=t;F=e;break}De()}while(0);p[L>>2]=f;p[F+12>>2]=f;p[w+(d+8)>>2]=F;p[w+(d+12)>>2]=i;break}t=n>>>8;do if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;F=t<<L;k=(F+520192|0)>>>16&4;F=F<<k;i=(F+245760|0)>>>16&2;i=14-(k|L|i)+(F<<i>>>15)|0;i=n>>>(i+7|0)&1|i<<1}while(0);t=892+(i<<2)|0;p[w+(d+28)>>2]=i;p[w+(d+20)>>2]=0;p[w+(d+16)>>2]=0;e=p[148]|0;r=1<<i;if(!(e&r)){p[148]=e|r;p[t>>2]=f; +p[w+(d+24)>>2]=t;p[w+(d+12)>>2]=f;p[w+(d+8)>>2]=f;break}t=p[t>>2]|0;r:do if((p[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=p[e>>2]|0;if(!r)break;if((p[r+4>>2]&-8|0)==(n|0)){B=r;break r}else{i=i<<1;t=r}}if(e>>>0<(p[151]|0)>>>0)De();else{p[e>>2]=f;p[w+(d+24)>>2]=t;p[w+(d+12)>>2]=f;p[w+(d+8)>>2]=f;break t}}else B=t;while(0);t=B+8|0;e=p[t>>2]|0;F=p[151]|0;if(e>>>0>=F>>>0&B>>>0>=F>>>0){p[e+12>>2]=f;p[t>>2]=f;p[w+(d+8)>>2]=e;p[w+(d+12)>>2]=B;p[w+(d+24)>>2]=0;break}else De()}else{B=(p[150]|0)+c|0;p[150]=B;p[153]=f;p[w+(d+4)>>2]=B|1}while(0);B=w+(h|8)|0;return B|0}else r=1036;while(1){e=p[r>>2]|0;if(e>>>0<=a>>>0?(t=p[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=p[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0<n>>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;B=m+-40-r|0;p[153]=w+r;p[150]=B;p[w+(r+4)>>2]=B|1;p[w+(m+-36)>>2]=40;p[154]=p[269];r=e+4|0;p[r>>2]=27;p[t>>2]=p[259];p[t+4>>2]=p[260];p[t+8>>2]=p[261];p[t+12>>2]=p[262];p[259]=w;p[260]=m;p[262]=0;p[261]=t;t=e+28|0;p[t>>2]=7;if((e+32|0)>>>0<i>>>0)do{B=t;t=t+4|0;p[t>>2]=7}while((B+8|0)>>>0<i>>>0);if((e|0)!=(a|0)){o=e-a|0;p[r>>2]=p[r>>2]&-2;p[a+4>>2]=o|1;p[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=628+(e<<2)|0;r=p[147]|0;t=1<<t;if(r&t){t=628+(e+2<<2)|0;e=p[t>>2]|0;if(e>>>0<(p[151]|0)>>>0)De();else{O=t;R=e}}else{p[147]=r|t;O=628+(e+2<<2)|0;R=i}p[O>>2]=a;p[R+12>>2]=a;p[a+8>>2]=R;p[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{F=(t+1048320|0)>>>16&8;B=t<<F;L=(B+520192|0)>>>16&4;B=B<<L;i=(B+245760|0)>>>16&2;i=14-(L|F|i)+(B<<i>>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=892+(i<<2)|0;p[a+28>>2]=i;p[a+20>>2]=0;p[n>>2]=0;t=p[148]|0;e=1<<i;if(!(t&e)){p[148]=t|e;p[r>>2]=a;p[a+24>>2]=r;p[a+12>>2]=a;p[a+8>>2]=a;break}t=p[r>>2]|0;t:do if((p[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=p[e>>2]|0;if(!r)break;if((p[r+4>>2]&-8|0)==(o|0)){N=r;break t}else{i=i<<1;t=r}}if(e>>>0<(p[151]|0)>>>0)De();else{p[e>>2]=a;p[a+24>>2]=t;p[a+12>>2]=a;p[a+8>>2]=a;break e}}else N=t;while(0);t=N+8|0;e=p[t>>2]|0;B=p[151]|0;if(e>>>0>=B>>>0&N>>>0>=B>>>0){p[e+12>>2]=a;p[t>>2]=a;p[a+8>>2]=e;p[a+12>>2]=N;p[a+24>>2]=0;break}else De()}}else{B=p[151]|0;if((B|0)==0|w>>>0<B>>>0)p[151]=w;p[259]=w;p[260]=m;p[262]=0;p[156]=p[265];p[155]=-1;t=0;do{B=t<<1;F=628+(B<<2)|0;p[628+(B+3<<2)>>2]=F;p[628+(B+2<<2)>>2]=F;t=t+1|0}while((t|0)!=32);B=w+8|0;B=(B&7|0)==0?0:0-B&7;F=m+-40-B|0;p[153]=w+B;p[150]=F;p[w+(B+4)>>2]=F|1;p[w+(m+-36)>>2]=40;p[154]=p[269]}while(0);t=p[150]|0;if(t>>>0>g>>>0){F=t-g|0;p[150]=F;B=p[153]|0;p[153]=B+g;p[B+(g+4)>>2]=F|1;p[B+4>>2]=g|3;B=B+8|0;return B|0}}B=lr()|0;p[B>>2]=12;B=0;return B|0}function Vr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,g=0,v=0,_=0,y=0,b=0;if(!e)return;t=e+-8|0;s=p[151]|0;if(t>>>0<s>>>0)De();r=p[e+-4>>2]|0;i=r&3;if((i|0)==1)De();f=r&-8;g=e+(f+-8)|0;do if(!(r&1)){t=p[t>>2]|0;if(!i)return;l=-8-t|0;c=e+l|0;d=t+f|0;if(c>>>0<s>>>0)De();if((c|0)==(p[152]|0)){t=e+(f+-4)|0;r=p[t>>2]|0;if((r&3|0)!=3){b=c;o=d;break}p[149]=d;p[t>>2]=r&-2;p[e+(l+4)>>2]=d|1;p[g>>2]=d;return}n=t>>>3;if(t>>>0<256){i=p[e+(l+8)>>2]|0;r=p[e+(l+12)>>2]|0;t=628+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<s>>>0)De();if((p[i+12>>2]|0)!=(c|0))De()}if((r|0)==(i|0)){p[147]=p[147]&~(1<<n);b=c;o=d;break}if((r|0)!=(t|0)){if(r>>>0<s>>>0)De();t=r+8|0;if((p[t>>2]|0)==(c|0))a=t;else De()}else a=r+8|0;p[i+12>>2]=r;p[a>>2]=i;b=c;o=d;break}a=p[e+(l+24)>>2]|0;i=p[e+(l+12)>>2]|0;do if((i|0)==(c|0)){r=e+(l+20)|0;t=p[r>>2]|0;if(!t){r=e+(l+16)|0;t=p[r>>2]|0;if(!t){u=0;break}}while(1){i=t+20|0;n=p[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=p[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<s>>>0)De();else{p[r>>2]=0;u=t;break}}else{n=p[e+(l+8)>>2]|0;if(n>>>0<s>>>0)De();t=n+12|0;if((p[t>>2]|0)!=(c|0))De();r=i+8|0;if((p[r>>2]|0)==(c|0)){p[t>>2]=i;p[r>>2]=n;u=i;break}else De()}while(0);if(a){t=p[e+(l+28)>>2]|0;r=892+(t<<2)|0;if((c|0)==(p[r>>2]|0)){p[r>>2]=u;if(!u){p[148]=p[148]&~(1<<t);b=c;o=d;break}}else{if(a>>>0<(p[151]|0)>>>0)De();t=a+16|0;if((p[t>>2]|0)==(c|0))p[t>>2]=u;else p[a+20>>2]=u;if(!u){b=c;o=d;break}}r=p[151]|0;if(u>>>0<r>>>0)De();p[u+24>>2]=a;t=p[e+(l+16)>>2]|0;do if(t)if(t>>>0<r>>>0)De();else{p[u+16>>2]=t;p[t+24>>2]=u;break}while(0);t=p[e+(l+20)>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)De();else{p[u+20>>2]=t;p[t+24>>2]=u;b=c;o=d;break}else{b=c;o=d}}else{b=c;o=d}}else{b=t;o=f}while(0);if(b>>>0>=g>>>0)De();t=e+(f+-4)|0;r=p[t>>2]|0;if(!(r&1))De();if(!(r&2)){if((g|0)==(p[153]|0)){y=(p[150]|0)+o|0;p[150]=y;p[153]=b;p[b+4>>2]=y|1;if((b|0)!=(p[152]|0))return;p[152]=0;p[149]=0;return}if((g|0)==(p[152]|0)){y=(p[149]|0)+o|0;p[149]=y;p[152]=b;p[b+4>>2]=y|1;p[b+y>>2]=y;return}o=(r&-8)+o|0;n=r>>>3;do if(r>>>0>=256){a=p[e+(f+16)>>2]|0;t=p[e+(f|4)>>2]|0;do if((t|0)==(g|0)){r=e+(f+12)|0;t=p[r>>2]|0;if(!t){r=e+(f+8)|0;t=p[r>>2]|0;if(!t){m=0;break}}while(1){i=t+20|0;n=p[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=p[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(p[151]|0)>>>0)De();else{p[r>>2]=0;m=t;break}}else{r=p[e+f>>2]|0;if(r>>>0<(p[151]|0)>>>0)De();i=r+12|0;if((p[i>>2]|0)!=(g|0))De();n=t+8|0;if((p[n>>2]|0)==(g|0)){p[i>>2]=t;p[n>>2]=r;m=t;break}else De()}while(0);if(a){t=p[e+(f+20)>>2]|0;r=892+(t<<2)|0;if((g|0)==(p[r>>2]|0)){p[r>>2]=m;if(!m){p[148]=p[148]&~(1<<t);break}}else{if(a>>>0<(p[151]|0)>>>0)De();t=a+16|0;if((p[t>>2]|0)==(g|0))p[t>>2]=m;else p[a+20>>2]=m;if(!m)break}r=p[151]|0;if(m>>>0<r>>>0)De();p[m+24>>2]=a;t=p[e+(f+8)>>2]|0;do if(t)if(t>>>0<r>>>0)De();else{p[m+16>>2]=t;p[t+24>>2]=m;break}while(0);t=p[e+(f+12)>>2]|0;if(t)if(t>>>0<(p[151]|0)>>>0)De();else{p[m+20>>2]=t;p[t+24>>2]=m;break}}}else{i=p[e+f>>2]|0;r=p[e+(f|4)>>2]|0;t=628+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(p[151]|0)>>>0)De();if((p[i+12>>2]|0)!=(g|0))De()}if((r|0)==(i|0)){p[147]=p[147]&~(1<<n);break}if((r|0)!=(t|0)){if(r>>>0<(p[151]|0)>>>0)De();t=r+8|0;if((p[t>>2]|0)==(g|0))h=t;else De()}else h=r+8|0;p[i+12>>2]=r;p[h>>2]=i}while(0);p[b+4>>2]=o|1;p[b+o>>2]=o;if((b|0)==(p[152]|0)){p[149]=o;return}}else{p[t>>2]=r&-2;p[b+4>>2]=o|1;p[b+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=628+(r<<2)|0;i=p[147]|0;t=1<<t;if(i&t){t=628+(r+2<<2)|0;r=p[t>>2]|0;if(r>>>0<(p[151]|0)>>>0)De();else{v=t;_=r}}else{p[147]=i|t;v=628+(r+2<<2)|0;_=n}p[v>>2]=b;p[_+12>>2]=b;p[b+8>>2]=_;p[b+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{v=(t+1048320|0)>>>16&8;_=t<<v;g=(_+520192|0)>>>16&4;_=_<<g;n=(_+245760|0)>>>16&2;n=14-(g|v|n)+(_<<n>>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=892+(n<<2)|0;p[b+28>>2]=n;p[b+20>>2]=0;p[b+16>>2]=0;r=p[148]|0;i=1<<n;e:do if(r&i){t=p[t>>2]|0;t:do if((p[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=p[r>>2]|0;if(!i)break;if((p[i+4>>2]&-8|0)==(o|0)){y=i;break t}else{n=n<<1;t=i}}if(r>>>0<(p[151]|0)>>>0)De();else{p[r>>2]=b;p[b+24>>2]=t;p[b+12>>2]=b;p[b+8>>2]=b;break e}}else y=t;while(0);t=y+8|0;r=p[t>>2]|0;_=p[151]|0;if(r>>>0>=_>>>0&y>>>0>=_>>>0){p[r+12>>2]=b;p[t>>2]=b;p[b+8>>2]=r;p[b+12>>2]=y;p[b+24>>2]=0;break}else De()}else{p[148]=r|i;p[t>>2]=b;p[b+24>>2]=t;p[b+12>>2]=b;p[b+8>>2]=b}while(0);b=(p[155]|0)+-1|0;p[155]=b;if(!b)t=1044;else return;while(1){t=p[t>>2]|0;if(!t)break;else t=t+8|0}p[155]=-1;return}function zr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=lr()|0;p[e>>2]=12;e=0;return e|0}r=Hr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=p[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Kr(r|0,e|0,(i>>>0<t>>>0?i:t)|0)|0;Vr(e);e=r;return e|0}function Gr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=p[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0;f=e+4|0;m=p[f>>2]|0;l=m&-8;c=e+l|0;s=p[151]|0;r=m&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0<c>>>0))De();i=e+(l|4)|0;n=p[i>>2]|0;if(!(n&1))De();if(!r){if(t>>>0<256){e=0;return e|0}if(l>>>0>=(t+4|0)>>>0?(l-t|0)>>>0<=p[267]<<1>>>0:0)return e|0;e=0;return e|0}if(l>>>0>=t>>>0){r=l-t|0;if(r>>>0<=15)return e|0;p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=r|3;p[i>>2]=p[i>>2]|1;Wr(e+t|0,r);return e|0}if((c|0)==(p[153]|0)){r=(p[150]|0)+l|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=h|1;p[153]=e+t;p[150]=h;return e|0}if((c|0)==(p[152]|0)){i=(p[149]|0)+l|0;if(i>>>0<t>>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=r|1;p[e+i>>2]=r;i=e+(i+4)|0;p[i>>2]=p[i>>2]&-2;i=e+t|0}else{p[f>>2]=m&1|i|2;i=e+(i+4)|0;p[i>>2]=p[i>>2]|1;i=0;r=0}p[149]=r;p[152]=i;return e|0}if(n&2){e=0;return e|0}d=(n&-8)+l|0;if(d>>>0<t>>>0){e=0;return e|0}h=d-t|0;o=n>>>3;do if(n>>>0>=256){a=p[e+(l+24)>>2]|0;o=p[e+(l+12)>>2]|0;do if((o|0)==(c|0)){i=e+(l+20)|0;r=p[i>>2]|0;if(!r){i=e+(l+16)|0;r=p[i>>2]|0;if(!r){u=0;break}}while(1){n=r+20|0;o=p[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=p[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<s>>>0)De();else{p[i>>2]=0;u=r;break}}else{n=p[e+(l+8)>>2]|0;if(n>>>0<s>>>0)De();r=n+12|0;if((p[r>>2]|0)!=(c|0))De();i=o+8|0;if((p[i>>2]|0)==(c|0)){p[r>>2]=o;p[i>>2]=n;u=o;break}else De()}while(0);if(a){r=p[e+(l+28)>>2]|0;i=892+(r<<2)|0;if((c|0)==(p[i>>2]|0)){p[i>>2]=u;if(!u){p[148]=p[148]&~(1<<r);break}}else{if(a>>>0<(p[151]|0)>>>0)De();r=a+16|0;if((p[r>>2]|0)==(c|0))p[r>>2]=u;else p[a+20>>2]=u;if(!u)break}i=p[151]|0;if(u>>>0<i>>>0)De();p[u+24>>2]=a;r=p[e+(l+16)>>2]|0;do if(r)if(r>>>0<i>>>0)De();else{p[u+16>>2]=r;p[r+24>>2]=u;break}while(0);r=p[e+(l+20)>>2]|0;if(r)if(r>>>0<(p[151]|0)>>>0)De();else{p[u+20>>2]=r;p[r+24>>2]=u;break}}}else{n=p[e+(l+8)>>2]|0;i=p[e+(l+12)>>2]|0;r=628+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<s>>>0)De();if((p[n+12>>2]|0)!=(c|0))De()}if((i|0)==(n|0)){p[147]=p[147]&~(1<<o);break}if((i|0)!=(r|0)){if(i>>>0<s>>>0)De();r=i+8|0;if((p[r>>2]|0)==(c|0))a=r;else De()}else a=i+8|0;p[n+12>>2]=i;p[a>>2]=n}while(0);if(h>>>0<16){p[f>>2]=d|m&1|2;t=e+(d|4)|0;p[t>>2]=p[t>>2]|1;return e|0}else{p[f>>2]=m&1|t|2;p[e+(t+4)>>2]=h|3;m=e+(d|4)|0;p[m>>2]=p[m>>2]|1;Wr(e+t|0,h);return e|0}return 0}function Wr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0,g=0,v=0,_=0,y=0;g=e+t|0;r=p[e+4>>2]|0;do if(!(r&1)){u=p[e>>2]|0;if(!(r&3))return;h=e+(0-u)|0;d=u+t|0;l=p[151]|0;if(h>>>0<l>>>0)De();if((h|0)==(p[152]|0)){i=e+(t+4)|0;r=p[i>>2]|0;if((r&3|0)!=3){y=h;a=d;break}p[149]=d;p[i>>2]=r&-2;p[e+(4-u)>>2]=d|1;p[g>>2]=d;return}o=u>>>3;if(u>>>0<256){n=p[e+(8-u)>>2]|0;i=p[e+(12-u)>>2]|0;r=628+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<l>>>0)De();if((p[n+12>>2]|0)!=(h|0))De()}if((i|0)==(n|0)){p[147]=p[147]&~(1<<o);y=h;a=d;break}if((i|0)!=(r|0)){if(i>>>0<l>>>0)De();r=i+8|0;if((p[r>>2]|0)==(h|0))s=r;else De()}else s=i+8|0;p[n+12>>2]=i;p[s>>2]=n;y=h;a=d;break}s=p[e+(24-u)>>2]|0;n=p[e+(12-u)>>2]|0;do if((n|0)==(h|0)){n=16-u|0;i=e+(n+4)|0;r=p[i>>2]|0;if(!r){i=e+n|0;r=p[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=p[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=p[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<l>>>0)De();else{p[i>>2]=0;c=r;break}}else{o=p[e+(8-u)>>2]|0;if(o>>>0<l>>>0)De();r=o+12|0;if((p[r>>2]|0)!=(h|0))De();i=n+8|0;if((p[i>>2]|0)==(h|0)){p[r>>2]=n;p[i>>2]=o;c=n;break}else De()}while(0);if(s){r=p[e+(28-u)>>2]|0;i=892+(r<<2)|0;if((h|0)==(p[i>>2]|0)){p[i>>2]=c;if(!c){p[148]=p[148]&~(1<<r);y=h;a=d;break}}else{if(s>>>0<(p[151]|0)>>>0)De();r=s+16|0;if((p[r>>2]|0)==(h|0))p[r>>2]=c;else p[s+20>>2]=c;if(!c){y=h;a=d;break}}n=p[151]|0;if(c>>>0<n>>>0)De();p[c+24>>2]=s;r=16-u|0;i=p[e+r>>2]|0;do if(i)if(i>>>0<n>>>0)De();else{p[c+16>>2]=i;p[i+24>>2]=c;break}while(0);r=p[e+(r+4)>>2]|0;if(r)if(r>>>0<(p[151]|0)>>>0)De();else{p[c+20>>2]=r;p[r+24>>2]=c;y=h;a=d;break}else{y=h;a=d}}else{y=h;a=d}}else{y=e;a=t}while(0);l=p[151]|0;if(g>>>0<l>>>0)De();r=e+(t+4)|0;i=p[r>>2]|0;if(!(i&2)){if((g|0)==(p[153]|0)){_=(p[150]|0)+a|0;p[150]=_;p[153]=y;p[y+4>>2]=_|1;if((y|0)!=(p[152]|0))return;p[152]=0;p[149]=0;return}if((g|0)==(p[152]|0)){_=(p[149]|0)+a|0;p[149]=_;p[152]=y;p[y+4>>2]=_|1;p[y+_>>2]=_;return}a=(i&-8)+a|0;o=i>>>3;do if(i>>>0>=256){s=p[e+(t+24)>>2]|0;n=p[e+(t+12)>>2]|0;do if((n|0)==(g|0)){i=e+(t+20)|0;r=p[i>>2]|0;if(!r){i=e+(t+16)|0;r=p[i>>2]|0;if(!r){m=0;break}}while(1){n=r+20|0;o=p[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=p[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0<l>>>0)De();else{p[i>>2]=0;m=r;break}}else{o=p[e+(t+8)>>2]|0;if(o>>>0<l>>>0)De();r=o+12|0;if((p[r>>2]|0)!=(g|0))De();i=n+8|0;if((p[i>>2]|0)==(g|0)){p[r>>2]=n;p[i>>2]=o;m=n;break}else De()}while(0);if(s){r=p[e+(t+28)>>2]|0;i=892+(r<<2)|0;if((g|0)==(p[i>>2]|0)){p[i>>2]=m;if(!m){p[148]=p[148]&~(1<<r);break}}else{if(s>>>0<(p[151]|0)>>>0)De();r=s+16|0;if((p[r>>2]|0)==(g|0))p[r>>2]=m;else p[s+20>>2]=m;if(!m)break}i=p[151]|0;if(m>>>0<i>>>0)De();p[m+24>>2]=s;r=p[e+(t+16)>>2]|0;do if(r)if(r>>>0<i>>>0)De();else{p[m+16>>2]=r;p[r+24>>2]=m;break}while(0);r=p[e+(t+20)>>2]|0;if(r)if(r>>>0<(p[151]|0)>>>0)De();else{p[m+20>>2]=r;p[r+24>>2]=m;break}}}else{n=p[e+(t+8)>>2]|0;i=p[e+(t+12)>>2]|0;r=628+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<l>>>0)De();if((p[n+12>>2]|0)!=(g|0))De()}if((i|0)==(n|0)){p[147]=p[147]&~(1<<o);break}if((i|0)!=(r|0)){if(i>>>0<l>>>0)De();r=i+8|0;if((p[r>>2]|0)==(g|0))f=r;else De()}else f=i+8|0;p[n+12>>2]=i;p[f>>2]=n}while(0);p[y+4>>2]=a|1;p[y+a>>2]=a;if((y|0)==(p[152]|0)){p[149]=a;return}}else{p[r>>2]=i&-2;p[y+4>>2]=a|1;p[y+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=628+(i<<2)|0;n=p[147]|0;r=1<<r;if(n&r){r=628+(i+2<<2)|0;i=p[r>>2]|0;if(i>>>0<(p[151]|0)>>>0)De();else{v=r;_=i}}else{p[147]=n|r;v=628+(i+2<<2)|0;_=o}p[v>>2]=y;p[_+12>>2]=y;p[y+8>>2]=_;p[y+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{v=(r+1048320|0)>>>16&8;_=r<<v;g=(_+520192|0)>>>16&4;_=_<<g;o=(_+245760|0)>>>16&2;o=14-(g|v|o)+(_<<o>>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=892+(o<<2)|0;p[y+28>>2]=o;p[y+20>>2]=0;p[y+16>>2]=0;i=p[148]|0;n=1<<o;if(!(i&n)){p[148]=i|n;p[r>>2]=y;p[y+24>>2]=r;p[y+12>>2]=y;p[y+8>>2]=y;return}r=p[r>>2]|0;e:do if((p[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=p[i>>2]|0;if(!n)break;if((p[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(p[151]|0)>>>0)De();p[i>>2]=y;p[y+24>>2]=r;p[y+12>>2]=y;p[y+8>>2]=y;return}while(0);i=r+8|0;n=p[i>>2]|0;_=p[151]|0;if(!(n>>>0>=_>>>0&r>>>0>=_>>>0))De();p[n+12>>2]=y;p[i>>2]=y;p[y+8>>2]=n;p[y+12>>2]=r;p[y+24>>2]=0;return}function jr(){}function qr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(V=i,e-r>>>0|0)|0}function Yr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;r=e+r>>>0;return(V=t+i+(r>>>0<e>>>0|0)>>>0,r|0)|0}function Xr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){d[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){p[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){d[e>>0]=t;e=e+1|0}return e-r|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){V=t>>>r;return e>>>r|(t&(1<<r)-1)<<32-r}V=0;return t>>>r-32|0}function Zr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){V=t<<r|(e&(1<<r)-1<<32-r)>>>32-r;return e<<r}V=e<<r-32;return 0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Le(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;d[e>>0]=d[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){p[e>>2]=p[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){d[e>>0]=d[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){V=t>>r;return e>>>r|(t&(1<<r)-1)<<32-r}V=(t|0)<0?-1:0;return t>>r-32|0}function $r(e){e=e|0;var t=0;t=d[E+(e&255)>>0]|0;if((t|0)<8)return t|0;t=d[E+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=d[E+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(d[E+(e>>>24)>>0]|0)+24|0}function ei(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ce(n,o)|0;i=e>>>16;e=(r>>>16)+(ce(n,i)|0)|0;n=t>>>16;t=ce(n,o)|0;return(V=(e>>>16)+(ce(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ti(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0;u=t>>31|((t|0)<0?-1:0)<<1;l=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=qr(u^e,l^t,u,l)|0;a=V;e=o^u;t=n^l;return qr((ai(s,a,qr(o^r,n^i,o,n)|0,V,0)|0)^e,V^t,e,t)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,l=0,u=0;n=b;b=b+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;u=i>>31|((i|0)<0?-1:0)<<1;l=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=qr(a^e,o^t,a,o)|0;t=V;ai(e,t,qr(u^r,l^i,u,l)|0,V,s)|0;i=qr(p[s>>2]^a,p[s+4>>2]^o,a,o)|0;r=V;b=n;return(V=r,i)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ei(n,o)|0;e=V;return(V=(ce(t,o)|0)+(ce(i,n)|0)+e|e&0,r|0|0)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return ai(e,t,r,i,0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=b;b=b+16|0;n=o|0;ai(e,t,r,i,n)|0;b=o;return(V=p[n+4>>2]|0,p[n>>2]|0)|0}function ai(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,l=0,u=0,c=0,d=0,h=0,f=0,m=0;c=e;l=t;u=l;a=r;h=i;s=h;if(!u){o=(n|0)!=0;if(!s){if(o){p[n>>2]=(c>>>0)%(a>>>0);p[n+4>>2]=0}h=0;n=(c>>>0)/(a>>>0)>>>0;return(V=h,n)|0}else{if(!o){h=0;n=0;return(V=h,n)|0}p[n>>2]=e|0;p[n+4>>2]=t&0;h=0;n=0;return(V=h,n)|0}}o=(s|0)==0;do if(a){if(!o){o=(he(s|0)|0)-(he(u|0)|0)|0;if(o>>>0<=31){d=o+1|0;s=31-o|0;t=o-31>>31;a=d;e=c>>>(d>>>0)&t|u<<s;t=u>>>(d>>>0)&t;o=0;s=c<<s;break}if(!n){h=0;n=0;return(V=h,n)|0}p[n>>2]=e|0;p[n+4>>2]=l|t&0;h=0;n=0;return(V=h,n)|0}o=a-1|0;if(o&a){s=(he(a|0)|0)+33-(he(u|0)|0)|0;m=64-s|0;d=32-s|0;l=d>>31;f=s-32|0;t=f>>31;a=s;e=d-1>>31&u>>>(f>>>0)|(u<<d|c>>>(s>>>0))&t;t=t&u>>>(s>>>0);o=c<<m&l;s=(u<<m|c>>>(f>>>0))&l|c<<d&s-33>>31;break}if(n){p[n>>2]=o&c;p[n+4>>2]=0}if((a|0)==1){f=l|t&0;m=e|0|0;return(V=f,m)|0}else{m=$r(a|0)|0;f=u>>>(m>>>0)|0;m=u<<32-m|c>>>(m>>>0)|0;return(V=f,m)|0}}else{if(o){if(n){p[n>>2]=(u>>>0)%(a>>>0);p[n+4>>2]=0}f=0;m=(u>>>0)/(a>>>0)>>>0;return(V=f,m)|0}if(!c){if(n){p[n>>2]=0;p[n+4>>2]=(u>>>0)%(s>>>0)}f=0;m=(u>>>0)/(s>>>0)>>>0;return(V=f,m)|0}o=s-1|0;if(!(o&s)){if(n){p[n>>2]=e|0;p[n+4>>2]=o&u|t&0}f=0;m=u>>>(($r(s|0)|0)>>>0);return(V=f,m)|0}o=(he(s|0)|0)-(he(u|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=u<<s|c>>>(t>>>0);t=u>>>(t>>>0);o=0;s=c<<s;break}if(!n){f=0;m=0;return(V=f,m)|0}p[n>>2]=e|0;p[n+4>>2]=l|t&0;f=0;m=0;return(V=f,m)|0}while(0);if(!a){u=s;l=0;s=0}else{d=r|0|0;c=h|i&0;u=Yr(d|0,c|0,-1,-1)|0;r=V;l=s;s=0;do{i=l;l=o>>>31|l<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;qr(u,r,i,h)|0;m=V;f=m>>31|((m|0)<0?-1:0)<<1;s=f&1;e=qr(i,h,f&d,(((m|0)<0?-1:0)>>31|((m|0)<0?-1:0)<<1)&c)|0;t=V;a=a-1|0}while((a|0)!=0);u=l;l=0}a=0;if(n){p[n>>2]=e;p[n+4>>2]=t}f=(o|0)>>>31|(u|a)<<1|(a<<1|o>>>31)&0|l;m=(o<<1|0>>>31)&-2|s;return(V=f,m)|0}function si(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Si[e&7](t|0,r|0,i|0)|0}function li(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Ei[e&3](t|0,r|0,i|0,n|0,o|0)}function ui(e,t){e=e|0;t=t|0;Ti[e&7](t|0)}function ci(e,t){e=e|0;t=t|0;return xi[e&1](t|0)|0}function di(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;Pi[e&0](t|0,r|0,i|0)}function hi(e){e=e|0;Ai[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Di[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function fi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Ii[e&3](t|0,r|0,i|0,n|0)}function mi(e,t,r){e=e|0;t=t|0;r=r|0;pe(0);return 0}function gi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;pe(1)}function vi(e){e=e|0;pe(2)}function _i(e){e=e|0;pe(3);return 0}function yi(e,t,r){e=e|0;t=t|0;r=r|0;pe(4)}function bi(){pe(5)}function Ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;pe(6)}function wi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;pe(7)}var Si=[mi,qt,kr,Ar,Pr,Dr,mi,mi];var Ei=[gi,$t,Jt,gi];var Ti=[vi,zt,Wt,Gt,Ht,jt,ar,Nr];var xi=[_i,xr];var Pi=[yi];var Ai=[bi,nr,or,bi];var Di=[Ci,tr,er,Ci];var Ii=[wi,Xt,Qt,wi];return{___cxa_can_catch:rr,_crn_get_levels:bt,_crn_get_uncompressed_size:St,_crn_decompress:Et,_i64Add:Yr,_crn_get_width:_t,___cxa_is_pointer_type:ir,_crn_get_bytes_per_block:wt,_memset:Xr,_malloc:Ur,_memcpy:Kr,_i64Subtract:qr,_bitshift64Lshr:Qr,_free:Vr,_bitshift64Shl:Zr,_crn_get_height:yt,_crn_get_dxt_format:Ct,runPostSets:jr,_emscripten_replace_memory:je,stackAlloc:qe,stackSave:Ye,stackRestore:Xe,establishStackSpace:Qe,setThrew:Ze,setTempRet0:$e,getTempRet0:et,dynCall_iiii:si,dynCall_viiiii:li,dynCall_vi:ui,dynCall_ii:ci,dynCall_viii:di,dynCall_v:hi,dynCall_viiiiii:pi,dynCall_viiii:fi}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),___cxa_can_catch=Module.___cxa_can_catch=asm.___cxa_can_catch,_crn_get_levels=Module._crn_get_levels=asm._crn_get_levels,runPostSets=Module.runPostSets=asm.runPostSets,_crn_get_uncompressed_size=Module._crn_get_uncompressed_size=asm._crn_get_uncompressed_size,_crn_decompress=Module._crn_decompress=asm._crn_decompress,_i64Add=Module._i64Add=asm._i64Add,_crn_get_height=Module._crn_get_height=asm._crn_get_height,___cxa_is_pointer_type=Module.___cxa_is_pointer_type=asm.___cxa_is_pointer_type,_crn_get_bytes_per_block=Module._crn_get_bytes_per_block=asm._crn_get_bytes_per_block,_memset=Module._memset=asm._memset,_malloc=Module._malloc=asm._malloc,_memcpy=Module._memcpy=asm._memcpy,_emscripten_replace_memory=Module._emscripten_replace_memory=asm._emscripten_replace_memory,_i64Subtract=Module._i64Subtract=asm._i64Subtract,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_free=Module._free=asm._free,_crn_get_dxt_format=Module._crn_get_dxt_format=asm._crn_get_dxt_format,_crn_get_width=Module._crn_get_width=asm._crn_get_width,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii;Runtime.stackAlloc=asm.stackAlloc,Runtime.stackSave=asm.stackSave,Runtime.stackRestore=asm.stackRestore,Runtime.establishStackSpace=asm.establishStackSpace,Runtime.setTempRet0=asm.setTempRet0,Runtime.getTempRet0=asm.getTempRet0,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop,preloadStartTime=null,calledMain=!1;dependenciesFulfilled=function e(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){function t(){for(var e=0;e<3;e++)i.push(0)}assert(0==runDependencies,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(0==__ATPRERUN__.length,"cannot call main when preRun functions remain to be called"),e=e||[],ensureInitRuntime();var r=e.length+1,i=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];t();for(var n=0;n<r-1;n+=1)i.push(allocate(intArrayFromString(e[n]),"i8",ALLOC_NORMAL)),t();i.push(0),i=allocate(i,"i32",ALLOC_NORMAL);try{var o=Module._main(r,i,0);exit(o,!0)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}finally{calledMain=!0}},Module.run=Module.run=run,Module.exit=Module.exit=exit;var abortDecorators=[];if(Module.abort=Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),Module.noExitRuntime=!0,run(),Module}),function(){!function(e){var t=this||(0,eval)("this"),r=t.document,i=t.navigator,n=t.jQuery,o=t.JSON;!function(e){"function"==typeof define&&define.amd?define("ThirdParty/knockout-3.4.0",["exports","require"],e):e("object"==typeof exports&&"object"==typeof module?module.exports||exports:t.ko={})}(function(a,s){function l(e,t){return(null===e||typeof e in g)&&e===t}function u(t,r){var i;return function(){i||(i=m.a.setTimeout(function(){i=e,t()},r))}}function c(e,t){var r;return function(){clearTimeout(r),r=m.a.setTimeout(e,t)}}function d(e,t){t&&t!==v?"beforeChange"===t?this.Kb(e):this.Ha(e,t):this.Lb(e)}function h(e,t){null!==t&&t.k&&t.k()}function p(e,t){var r=this.Hc,i=r[w];i.R||(this.lb&&this.Ma[t]?(r.Pb(t,e,this.Ma[t]),this.Ma[t]=null,--this.lb):i.r[t]||r.Pb(t,e,i.s?{ia:e}:r.uc(e)))}function f(e,t,r,i){m.d[e]={init:function(e,n,o,a,s){var l,u;return m.m(function(){var o=m.a.c(n()),a=!r!=!o,c=!u;(c||t||a!==l)&&(c&&m.va.Aa()&&(u=m.a.ua(m.f.childNodes(e),!0)),a?(c||m.f.da(e,m.a.ua(u)),m.eb(i?i(s,o):s,e)):m.f.xa(e),l=a)},null,{i:e}),{controlsDescendantBindings:!0}}},m.h.ta[e]=!1,m.f.Z[e]=!0}var m="undefined"!=typeof a?a:{};m.b=function(e,t){for(var r=e.split("."),i=m,n=0;n<r.length-1;n++)i=i[r[n]];i[r[r.length-1]]=t},m.G=function(e,t,r){e[t]=r},m.version="3.4.0",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1},m.a=function(){function a(e,t){for(var r in e)e.hasOwnProperty(r)&&t(r,e[r])}function s(e,t){if(t)for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}function l(e,t){return e.__proto__=t,e}function u(e,t,r,i){var n=e[t].match(v)||[];m.a.q(r.match(v),function(e){m.a.pa(n,e,i)}),e[t]=n.join(" ")}var c={__proto__:[]}instanceof Array,d="function"==typeof Symbol,h={},p={};h[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],h.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),a(h,function(e,t){if(t.length)for(var r=0,i=t.length;r<i;r++)p[t[r]]=e});var f={propertychange:!0},g=r&&function(){for(var t=3,i=r.createElement("div"),n=i.getElementsByTagName("i");i.innerHTML="<!--[if gt IE "+ ++t+"]><i></i><![endif]-->",n[0];);return 4<t?t:e}(),v=/\S+/g;return{cc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],q:function(e,t){for(var r=0,i=e.length;r<i;r++)t(e[r],r)},o:function(e,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(e,t);for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1},Sb:function(e,t,r){for(var i=0,n=e.length;i<n;i++)if(t.call(r,e[i],i))return e[i];return null},La:function(e,t){var r=m.a.o(e,t);0<r?e.splice(r,1):0===r&&e.shift()},Tb:function(e){e=e||[];for(var t=[],r=0,i=e.length;r<i;r++)0>m.a.o(t,e[r])&&t.push(e[r]);return t},fb:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;i<n;i++)r.push(t(e[i],i));return r},Ka:function(e,t){e=e||[];for(var r=[],i=0,n=e.length;i<n;i++)t(e[i],i)&&r.push(e[i]);return r},ra:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var r=0,i=t.length;r<i;r++)e.push(t[r]);return e},pa:function(e,t,r){var i=m.a.o(m.a.zb(e),t);0>i?r&&e.push(t):r||e.splice(i,1)},ka:c,extend:s,Xa:l,Ya:c?l:s,D:a,Ca:function(e,t){if(!e)return e;var r,i={};for(r in e)e.hasOwnProperty(r)&&(i[r]=t(e[r],r,e));return i},ob:function(e){for(;e.firstChild;)m.removeNode(e.firstChild)},jc:function(e){e=m.a.V(e);for(var t=(e[0]&&e[0].ownerDocument||r).createElement("div"),i=0,n=e.length;i<n;i++)t.appendChild(m.$(e[i]));return t},ua:function(e,t){for(var r=0,i=e.length,n=[];r<i;r++){var o=e[r].cloneNode(!0);n.push(t?m.$(o):o)}return n},da:function(e,t){if(m.a.ob(e),t)for(var r=0,i=t.length;r<i;r++)e.appendChild(t[r])},qc:function(e,t){var r=e.nodeType?[e]:e;if(0<r.length){for(var i=r[0],n=i.parentNode,o=0,a=t.length;o<a;o++)n.insertBefore(t[o],i);for(o=0,a=r.length;o<a;o++)m.removeNode(r[o])}},za: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 r=e[0],i=e[e.length-1];for(e.length=0;r!==i;)e.push(r),r=r.nextSibling;e.push(i)}}return e},sc:function(e,t){7>g?e.setAttribute("selected",t):e.selected=t},$a:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},nd:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},Mc:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(3===e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},nb:function(e){return m.a.Mc(e,e.ownerDocument.documentElement)},Qb:function(e){return!!m.a.Sb(e,m.a.nb)},A:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Wb:function(e){return m.onError?function(){try{return e.apply(this,arguments)}catch(e){throw m.onError&&m.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(m.a.Wb(e),t)},$b:function(e){setTimeout(function(){throw m.onError&&m.onError(e),e},0)},p:function(e,t,r){var i=m.a.Wb(r);if(r=g&&f[t],m.options.useOnlyNativeEvents||r||!n)if(r||"function"!=typeof e.addEventListener){if("undefined"==typeof e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var o=function(t){i.call(e,t)},a="on"+t;e.attachEvent(a,o),m.a.F.oa(e,function(){e.detachEvent(a,o)})}else e.addEventListener(t,i,!1);else n(e).bind(t,i)},Da:function(e,i){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var o;if("input"===m.a.A(e)&&e.type&&"click"==i.toLowerCase()?(o=e.type,o="checkbox"==o||"radio"==o):o=!1,m.options.useOnlyNativeEvents||!n||o)if("function"==typeof r.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");o=r.createEvent(p[i]||"HTMLEvents"),o.initEvent(i,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(o)}else if(o&&e.click)e.click();else{if("undefined"==typeof e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+i)}else n(e).trigger(i)},c:function(e){return m.H(e)?e():e},zb:function(e){return m.H(e)?e.t():e},bb:function(e,t,r){var i;t&&("object"==typeof e.classList?(i=e.classList[r?"add":"remove"],m.a.q(t.match(v),function(t){i.call(e.classList,t)})):"string"==typeof e.className.baseVal?u(e.className,"baseVal",t,r):u(e,"className",t,r))},Za:function(t,r){var i=m.a.c(r);null!==i&&i!==e||(i="");var n=m.f.firstChild(t);!n||3!=n.nodeType||m.f.nextSibling(n)?m.f.da(t,[t.ownerDocument.createTextNode(i)]):n.data=i,m.a.Rc(t)},rc:function(e,t){if(e.name=t,7>=g)try{e.mergeAttributes(r.createElement("<input name='"+e.name+"'/>"),!1)}catch(e){}},Rc:function(e){9<=g&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},Nc:function(e){if(g){var t=e.style.width;e.style.width=0,e.style.width=t}},hd:function(e,t){e=m.a.c(e),t=m.a.c(t);for(var r=[],i=e;i<=t;i++)r.push(i);return r},V:function(e){for(var t=[],r=0,i=e.length;r<i;r++)t.push(e[r]);return t},Yb:function(e){return d?Symbol(e):e},rd:6===g,sd:7===g,C:g,ec:function(e,t){for(var r=m.a.V(e.getElementsByTagName("input")).concat(m.a.V(e.getElementsByTagName("textarea"))),i="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},n=[],o=r.length-1;0<=o;o--)i(r[o])&&n.push(r[o]);return n},ed:function(e){return"string"==typeof e&&(e=m.a.$a(e))?o&&o.parse?o.parse(e):new Function("return "+e)():null},Eb:function(e,t,r){if(!o||!o.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 o.stringify(m.a.c(e),t,r)},fd:function(e,t,i){i=i||{};var n=i.params||{},o=i.includeFields||this.cc,s=e;if("object"==typeof e&&"form"===m.a.A(e))for(var s=e.action,l=o.length-1;0<=l;l--)for(var u=m.a.ec(e,o[l]),c=u.length-1;0<=c;c--)n[u[c].name]=u[c].value;t=m.a.c(t);var d=r.createElement("form");d.style.display="none",d.action=s,d.method="post";for(var h in t)e=r.createElement("input"),e.type="hidden",e.name=h,e.value=m.a.Eb(m.a.c(t[h])),d.appendChild(e);a(n,function(e,t){var i=r.createElement("input");i.type="hidden",i.name=e,i.value=t,d.appendChild(i)}),r.body.appendChild(d),i.submitter?i.submitter(d):d.submit(),setTimeout(function(){d.parentNode.removeChild(d)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.q),m.b("utils.arrayFirst",m.a.Sb),m.b("utils.arrayFilter",m.a.Ka),m.b("utils.arrayGetDistinctValues",m.a.Tb),m.b("utils.arrayIndexOf",m.a.o),m.b("utils.arrayMap",m.a.fb),m.b("utils.arrayPushAll",m.a.ra),m.b("utils.arrayRemoveItem",m.a.La),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.cc),m.b("utils.getFormFields",m.a.ec), +m.b("utils.peekObservable",m.a.zb),m.b("utils.postJson",m.a.fd),m.b("utils.parseJson",m.a.ed),m.b("utils.registerEventHandler",m.a.p),m.b("utils.stringifyJson",m.a.Eb),m.b("utils.range",m.a.hd),m.b("utils.toggleDomNodeCssClass",m.a.bb),m.b("utils.triggerEvent",m.a.Da),m.b("utils.unwrapObservable",m.a.c),m.b("utils.objectForEach",m.a.D),m.b("utils.addOrRemoveItem",m.a.pa),m.b("utils.setTextContent",m.a.Za),m.b("unwrap",m.a.c),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var r=Array.prototype.slice.call(arguments,1);return function(){var i=r.slice(0);return i.push.apply(i,arguments),t.apply(e,i)}}),m.a.e=new function(){function t(t,o){var a=t[i];if(!a||"null"===a||!n[a]){if(!o)return e;a=t[i]="ko"+r++,n[a]={}}return n[a]}var r=0,i="__ko__"+(new Date).getTime(),n={};return{get:function(r,i){var n=t(r,!1);return n===e?e:n[i]},set:function(r,i,n){n===e&&t(r,!1)===e||(t(r,!0)[i]=n)},clear:function(e){var t=e[i];return!!t&&(delete n[t],e[i]=null,!0)},I:function(){return r++ +i}}},m.b("utils.domData",m.a.e),m.b("utils.domData.clear",m.a.e.clear),m.a.F=new function(){function t(t,r){var n=m.a.e.get(t,i);return n===e&&r&&(n=[],m.a.e.set(t,i,n)),n}function r(e){var i=t(e,!1);if(i)for(var i=i.slice(0),n=0;n<i.length;n++)i[n](e);if(m.a.e.clear(e),m.a.F.cleanExternalData(e),a[e.nodeType])for(i=e.firstChild;e=i;)i=e.nextSibling,8===e.nodeType&&r(e)}var i=m.a.e.I(),o={1:!0,8:!0,9:!0},a={1:!0,9:!0};return{oa:function(e,r){if("function"!=typeof r)throw Error("Callback must be a function");t(e,!0).push(r)},pc:function(r,n){var o=t(r,!1);o&&(m.a.La(o,n),0==o.length&&m.a.e.set(r,i,e))},$:function(e){if(o[e.nodeType]&&(r(e),a[e.nodeType])){var t=[];m.a.ra(t,e.getElementsByTagName("*"));for(var i=0,n=t.length;i<n;i++)r(t[i])}return e},removeNode:function(e){m.$(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){n&&"function"==typeof n.cleanData&&n.cleanData([e])}}},m.$=m.a.F.$,m.removeNode=m.a.F.removeNode,m.b("cleanNode",m.$),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.F),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.F.oa),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.F.pc),function(){var i=[0,"",""],o=[1,"<table>","</table>"],a=[3,"<table><tbody><tr>","</tr></tbody></table>"],s=[1,"<select multiple='multiple'>","</select>"],l={thead:o,tbody:o,tfoot:o,tr:[2,"<table><tbody>","</tbody></table>"],td:a,th:a,option:s,optgroup:s},u=8>=m.a.C;m.a.ma=function(e,o){var a;if(n){if(n.parseHTML)a=n.parseHTML(e,o)||[];else if((a=n.clean([e],o))&&a[0]){for(var s=a[0];s.parentNode&&11!==s.parentNode.nodeType;)s=s.parentNode;s.parentNode&&s.parentNode.removeChild(s)}}else{(a=o)||(a=r);var c,s=a.parentWindow||a.defaultView||t,d=m.a.$a(e).toLowerCase(),h=a.createElement("div");for(c=(d=d.match(/^<([a-z]+)[ >]/))&&l[d[1]]||i,d=c[0],c="ignored<div>"+c[1]+e+c[2]+"</div>","function"==typeof s.innerShiv?h.appendChild(s.innerShiv(c)):(u&&a.appendChild(h),h.innerHTML=c,u&&h.parentNode.removeChild(h));d--;)h=h.lastChild;a=m.a.V(h.lastChild.childNodes)}return a},m.a.Cb=function(t,r){if(m.a.ob(t),r=m.a.c(r),null!==r&&r!==e)if("string"!=typeof r&&(r=r.toString()),n)n(t).html(r);else for(var i=m.a.ma(r,t.ownerDocument),o=0;o<i.length;o++)t.appendChild(i[o])}}(),m.b("utils.parseHtmlFragment",m.a.ma),m.b("utils.setHtml",m.a.Cb),m.M=function(){function t(e,r){if(e)if(8==e.nodeType){var i=m.M.lc(e.nodeValue);null!=i&&r.push({Lc:e,cd:i})}else if(1==e.nodeType)for(var i=0,n=e.childNodes,o=n.length;i<o;i++)t(n[i],r)}var r={};return{wb: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,"<!--[ko_memo:"+t+"]-->"},xc:function(t,i){var n=r[t];if(n===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return n.apply(null,i||[]),!0}finally{delete r[t]}},yc:function(e,r){var i=[];t(e,i);for(var n=0,o=i.length;n<o;n++){var a=i[n].Lc,s=[a];r&&m.a.ra(s,r),m.M.xc(i[n].cd,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},lc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),m.b("memoization",m.M),m.b("memoization.memoize",m.M.wb),m.b("memoization.unmemoize",m.M.xc),m.b("memoization.parseMemoText",m.M.lc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.M.yc),m.Y=function(){function e(){if(o)for(var e,t=o,r=0;s<o;)if(e=n[s++]){if(s>t){if(5e3<=++r){s=o,m.a.$b(Error("'Too much recursion' after processing "+r+" task groups."));break}t=o}try{e()}catch(e){m.a.$b(e)}}}function i(){e(),s=o=n.length=0}var n=[],o=0,a=1,s=0;return{scheduler:t.MutationObserver?function(e){var t=r.createElement("div");return new MutationObserver(e).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(i):r&&"onreadystatechange"in r.createElement("script")?function(e){var t=r.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,r.documentElement.removeChild(t),t=null,e()},r.documentElement.appendChild(t)}:function(e){setTimeout(e,0)},Wa:function(e){return o||m.Y.scheduler(i),n[o++]=e,a++},cancel:function(e){e-=a-o,e>=s&&e<o&&(n[e]=null)},resetForTesting:function(){var e=o-s;return s=o=n.length=0,e},md:e}}(),m.b("tasks",m.Y),m.b("tasks.schedule",m.Y.Wa),m.b("tasks.runEarly",m.Y.md),m.ya={throttle:function(e,t){e.throttleEvaluation=t;var r=null;return m.B({read:e,write:function(i){clearTimeout(r),r=m.a.setTimeout(function(){e(i)},t)}})},rateLimit:function(e,t){var r,i,n;"number"==typeof t?r=t:(r=t.timeout,i=t.method),e.cb=!1,n="notifyWhenChangesStop"==i?c:u,e.Ta(function(e){return n(e,r)})},deferred:function(t,r){if(!0!==r)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");t.cb||(t.cb=!0,t.Ta(function(r){var i;return function(){m.Y.cancel(i),i=m.Y.Wa(r),t.notifySubscribers(e,"dirty")}}))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var g={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.ya),m.vc=function(e,t,r){this.ia=e,this.gb=t,this.Kc=r,this.R=!1,m.G(this,"dispose",this.k)},m.vc.prototype.k=function(){this.R=!0,this.Kc()},m.J=function(){m.a.Ya(this,_),_.rb(this)};var v="change",_={rb:function(e){e.K={},e.Nb=1},X:function(e,t,r){var i=this;r=r||v;var n=new m.vc(i,t?e.bind(t):e,function(){m.a.La(i.K[r],n),i.Ia&&i.Ia(r)});return i.sa&&i.sa(r),i.K[r]||(i.K[r]=[]),i.K[r].push(n),n},notifySubscribers:function(e,t){if(t=t||v,t===v&&this.zc(),this.Pa(t))try{m.l.Ub();for(var r,i=this.K[t].slice(0),n=0;r=i[n];++n)r.R||r.gb(e)}finally{m.l.end()}},Na:function(){return this.Nb},Uc:function(e){return this.Na()!==e},zc:function(){++this.Nb},Ta:function(e){var t,r,i,n=this,o=m.H(n);n.Ha||(n.Ha=n.notifySubscribers,n.notifySubscribers=d);var a=e(function(){n.Mb=!1,o&&i===n&&(i=n()),t=!1,n.tb(r,i)&&n.Ha(r=i)});n.Lb=function(e){n.Mb=t=!0,i=e,a()},n.Kb=function(e){t||(r=e,n.Ha(e,"beforeChange"))}},Pa:function(e){return this.K[e]&&this.K[e].length},Sc:function(e){if(e)return this.K[e]&&this.K[e].length||0;var t=0;return m.a.D(this.K,function(e,r){"dirty"!==e&&(t+=r.length)}),t},tb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},extend:function(e){var t=this;return e&&m.a.D(e,function(e,r){var i=m.ya[e];"function"==typeof i&&(t=i(t,r)||t)}),t}};m.G(_,"subscribe",_.X),m.G(_,"extend",_.extend),m.G(_,"getSubscriptionsCount",_.Sc),m.a.ka&&m.a.Xa(_,Function.prototype),m.J.fn=_,m.hc=function(e){return null!=e&&"function"==typeof e.X&&"function"==typeof e.notifySubscribers},m.b("subscribable",m.J),m.b("isSubscribable",m.hc),m.va=m.l=function(){function e(e){i.push(r),r=e}function t(){r=i.pop()}var r,i=[],n=0;return{Ub:e,end:t,oc:function(e){if(r){if(!m.hc(e))throw Error("Only subscribable things can act as dependencies");r.gb.call(r.Gc,e,e.Cc||(e.Cc=++n))}},w:function(r,i,n){try{return e(),r.apply(i,n||[])}finally{t()}},Aa:function(){if(r)return r.m.Aa()},Sa:function(){if(r)return r.Sa}}}(),m.b("computedContext",m.va),m.b("computedContext.getDependenciesCount",m.va.Aa),m.b("computedContext.isInitial",m.va.Sa),m.b("ignoreDependencies",m.qd=m.l.w);var y=m.a.Yb("_latestValue");m.N=function(e){function t(){return 0<arguments.length?(t.tb(t[y],arguments[0])&&(t.ga(),t[y]=arguments[0],t.fa()),this):(m.l.oc(t),t[y])}return t[y]=e,m.a.ka||m.a.extend(t,m.J.fn),m.J.fn.rb(t),m.a.Ya(t,b),m.options.deferUpdates&&m.ya.deferred(t,!0),t};var b={equalityComparer:l,t:function(){return this[y]},fa:function(){this.notifySubscribers(this[y])},ga:function(){this.notifySubscribers(this[y],"beforeChange")}};m.a.ka&&m.a.Xa(b,m.J.fn);var C=m.N.gd="__ko_proto__";b[C]=m.N,m.Oa=function(t,r){return null!==t&&t!==e&&t[C]!==e&&(t[C]===r||m.Oa(t[C],r))},m.H=function(e){return m.Oa(e,m.N)},m.Ba=function(e){return!!("function"==typeof e&&e[C]===m.N||"function"==typeof e&&e[C]===m.B&&e.Vc)},m.b("observable",m.N),m.b("isObservable",m.H),m.b("isWriteableObservable",m.Ba),m.b("isWritableObservable",m.Ba),m.b("observable.fn",b),m.G(b,"peek",b.t),m.G(b,"valueHasMutated",b.fa),m.G(b,"valueWillMutate",b.ga),m.la=function(e){if(e=e||[],"object"!=typeof e||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=m.N(e),m.a.Ya(e,m.la.fn),e.extend({trackArrayChanges:!0})},m.la.fn={remove:function(e){for(var t=this.t(),r=[],i="function"!=typeof e||m.H(e)?function(t){return t===e}:e,n=0;n<t.length;n++){var o=t[n];i(o)&&(0===r.length&&this.ga(),r.push(o),t.splice(n,1),n--)}return r.length&&this.fa(),r},removeAll:function(t){if(t===e){var r=this.t(),i=r.slice(0);return this.ga(),r.splice(0,r.length),this.fa(),i}return t?this.remove(function(e){return 0<=m.a.o(t,e)}):[]},destroy:function(e){var t=this.t(),r="function"!=typeof e||m.H(e)?function(t){return t===e}:e;this.ga();for(var i=t.length-1;0<=i;i--)r(t[i])&&(t[i]._destroy=!0);this.fa()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=m.a.o(t,e)}):[]},indexOf:function(e){var t=this();return m.a.o(t,e)},replace:function(e,t){var r=this.indexOf(e);0<=r&&(this.ga(),this.t()[r]=t,this.fa())}},m.a.ka&&m.a.Xa(m.la.fn,m.N.fn),m.a.q("pop push reverse shift sort splice unshift".split(" "),function(e){m.la.fn[e]=function(){var t=this.t();this.ga(),this.Vb(t,e,arguments);var r=t[e].apply(t,arguments);return this.fa(),r===t?this:r}}),m.a.q(["slice"],function(e){m.la.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),m.b("observableArray",m.la),m.ya.trackArrayChanges=function(e,t){function r(){if(!n){n=!0;var t=e.notifySubscribers;e.notifySubscribers=function(e,r){return r&&r!==v||++a,t.apply(this,arguments)};var r=[].concat(e.t()||[]);o=null,i=e.X(function(t){if(t=[].concat(t||[]),e.Pa("arrayChange")){var i;(!o||1<a)&&(o=m.a.ib(r,t,e.hb)),i=o}r=t,o=null,a=0,i&&i.length&&e.notifySubscribers(i,"arrayChange")})}}if(e.hb={},t&&"object"==typeof t&&m.a.extend(e.hb,t),e.hb.sparse=!0,!e.Vb){var i,n=!1,o=null,a=0,s=e.sa,l=e.Ia;e.sa=function(t){s&&s.call(e,t),"arrayChange"===t&&r()},e.Ia=function(t){l&&l.call(e,t),"arrayChange"!==t||e.Pa("arrayChange")||(i.k(),n=!1)},e.Vb=function(e,t,r){function i(e,t,r){return s[s.length]={status:e,value:t,index:r}}if(n&&!a){var s=[],l=e.length,u=r.length,c=0;switch(t){case"push":c=l;case"unshift":for(t=0;t<u;t++)i("added",r[t],c+t);break;case"pop":c=l-1;case"shift":l&&i("deleted",e[c],c);break;case"splice":t=Math.min(Math.max(0,0>r[0]?l+r[0]:r[0]),l);for(var l=1===u?l:Math.min(t+(r[1]||0),l),u=t+u-2,c=Math.max(l,u),d=[],h=[],p=2;t<c;++t,++p)t<l&&h.push(i("deleted",e[t],t)),t<u&&d.push(i("added",r[p],t));m.a.dc(h,d);break;default:return}o=s}}}};var w=m.a.Yb("_state");m.m=m.B=function(t,r,i){function n(){if(0<arguments.length){if("function"!=typeof o)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 o.apply(a.pb,arguments),this}return m.l.oc(n),(a.S||a.s&&n.Qa())&&n.aa(),a.T}if("object"==typeof t?i=t:(i=i||{},t&&(i.read=t)),"function"!=typeof i.read)throw Error("Pass a function that returns the value of the ko.computed");var o=i.write,a={T:e,S:!0,Ra:!1,Fb:!1,R:!1,Va:!1,s:!1,jd:i.read,pb:r||i.owner,i:i.disposeWhenNodeIsRemoved||i.i||null,wa:i.disposeWhen||i.wa,mb:null,r:{},L:0,bc:null};return n[w]=a,n.Vc="function"==typeof o,m.a.ka||m.a.extend(n,m.J.fn),m.J.fn.rb(n),m.a.Ya(n,S),i.pure?(a.Va=!0,a.s=!0,m.a.extend(n,E)):i.deferEvaluation&&m.a.extend(n,T),m.options.deferUpdates&&m.ya.deferred(n,!0),a.i&&(a.Fb=!0,a.i.nodeType||(a.i=null)),a.s||i.deferEvaluation||n.aa(),a.i&&n.ba()&&m.a.F.oa(a.i,a.mb=function(){n.k()}),n};var S={equalityComparer:l,Aa:function(){return this[w].L},Pb:function(e,t,r){if(this[w].Va&&t===this)throw Error("A 'pure' computed must not be called recursively");this[w].r[e]=r,r.Ga=this[w].L++,r.na=t.Na()},Qa:function(){var e,t,r=this[w].r;for(e in r)if(r.hasOwnProperty(e)&&(t=r[e],t.ia.Uc(t.na)))return!0},bd:function(){this.Fa&&!this[w].Ra&&this.Fa()},ba:function(){return this[w].S||0<this[w].L},ld:function(){this.Mb||this.ac()},uc:function(e){if(e.cb&&!this[w].i){var t=e.X(this.bd,this,"dirty"),r=e.X(this.ld,this);return{ia:e,k:function(){t.k(),r.k()}}}return e.X(this.ac,this)},ac:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[w].bc),this[w].bc=m.a.setTimeout(function(){e.aa(!0)},t)):e.Fa?e.Fa():e.aa(!0)},aa:function(e){var t=this[w],r=t.wa;if(!t.Ra&&!t.R){if(t.i&&!m.a.nb(t.i)||r&&r()){if(!t.Fb)return void this.k()}else t.Fb=!1;t.Ra=!0;try{this.Qc(e)}finally{t.Ra=!1}t.L||this.k()}},Qc:function(t){var r=this[w],i=r.Va?e:!r.L,n={Hc:this,Ma:r.r,lb:r.L};m.l.Ub({Gc:n,gb:p,m:this,Sa:i}),r.r={},r.L=0,n=this.Pc(r,n),this.tb(r.T,n)&&(r.s||this.notifySubscribers(r.T,"beforeChange"),r.T=n,r.s?this.zc():t&&this.notifySubscribers(r.T)),i&&this.notifySubscribers(r.T,"awake")},Pc:function(e,t){try{var r=e.jd;return e.pb?r.call(e.pb):r()}finally{m.l.end(),t.lb&&!e.s&&m.a.D(t.Ma,h),e.S=!1}},t:function(){var e=this[w];return(e.S&&!e.L||e.s&&this.Qa())&&this.aa(),e.T},Ta:function(e){m.J.fn.Ta.call(this,e),this.Fa=function(){this.Kb(this[w].T),this[w].S=!0,this.Lb(this)}},k:function(){var e=this[w];!e.s&&e.r&&m.a.D(e.r,function(e,t){t.k&&t.k()}),e.i&&e.mb&&m.a.F.pc(e.i,e.mb),e.r=null,e.L=0,e.R=!0,e.S=!1,e.s=!1,e.i=null}},E={sa:function(e){var t=this,r=t[w];if(!r.R&&r.s&&"change"==e){if(r.s=!1,r.S||t.Qa())r.r=null,r.L=0,r.S=!0,t.aa();else{var i=[];m.a.D(r.r,function(e,t){i[t.Ga]=e}),m.a.q(i,function(e,i){var n=r.r[e],o=t.uc(n.ia);o.Ga=i,o.na=n.na,r.r[e]=o})}r.R||t.notifySubscribers(r.T,"awake")}},Ia:function(t){var r=this[w];r.R||"change"!=t||this.Pa("change")||(m.a.D(r.r,function(e,t){t.k&&(r.r[e]={ia:t.ia,Ga:t.Ga,na:t.na},t.k())}),r.s=!0,this.notifySubscribers(e,"asleep"))},Na:function(){var e=this[w];return e.s&&(e.S||this.Qa())&&this.aa(),m.J.fn.Na.call(this)}},T={sa:function(e){"change"!=e&&"beforeChange"!=e||this.t()}};m.a.ka&&m.a.Xa(S,m.J.fn);var x=m.N.gd;m.m[x]=m.N,S[x]=m.m,m.Xc=function(e){return m.Oa(e,m.m)},m.Yc=function(e){return m.Oa(e,m.m)&&e[w]&&e[w].Va},m.b("computed",m.m),m.b("dependentObservable",m.m),m.b("isComputed",m.Xc),m.b("isPureComputed",m.Yc),m.b("computed.fn",S),m.G(S,"peek",S.t),m.G(S,"dispose",S.k),m.G(S,"isActive",S.ba),m.G(S,"getDependenciesCount",S.Aa),m.nc=function(e,t){return"function"==typeof e?m.m(e,t,{pure:!0}):(e=m.a.extend({},e),e.pure=!0,m.m(e,t))},m.b("pureComputed",m.nc),function(){function t(n,o,a){if(a=a||new i,n=o(n),"object"!=typeof n||null===n||n===e||n instanceof RegExp||n instanceof Date||n instanceof String||n instanceof Number||n instanceof Boolean)return n;var s=n instanceof Array?[]:{};return a.save(n,s),r(n,function(r){var i=o(n[r]);switch(typeof i){case"boolean":case"number":case"string":case"function":s[r]=i;break;case"object":case"undefined":var l=a.get(i);s[r]=l!==e?l:t(i,o,a)}}),s}function r(e,t){if(e instanceof Array){for(var r=0;r<e.length;r++)t(r);"function"==typeof e.toJSON&&t("toJSON")}else for(r in e)t(r)}function i(){this.keys=[],this.Ib=[]}m.wc=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;m.H(e)&&10>t;t++)e=e();return e})},m.toJSON=function(e,t,r){return e=m.wc(e),m.a.Eb(e,t,r)},i.prototype={save:function(e,t){var r=m.a.o(this.keys,e);0<=r?this.Ib[r]=t:(this.keys.push(e),this.Ib.push(t))},get:function(t){return t=m.a.o(this.keys,t),0<=t?this.Ib[t]:e}}}(),m.b("toJS",m.wc),m.b("toJSON",m.toJSON),function(){m.j={u:function(t){switch(m.a.A(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?m.a.e.get(t,m.d.options.xb):7>=m.a.C?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?m.j.u(t.options[t.selectedIndex]):e;default:return t.value}},ha:function(t,r,i){switch(m.a.A(t)){case"option":switch(typeof r){case"string":m.a.e.set(t,m.d.options.xb,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=r;break;default:m.a.e.set(t,m.d.options.xb,r),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof r?r:""}break;case"select":""!==r&&null!==r||(r=e);for(var n,o=-1,a=0,s=t.options.length;a<s;++a)if(n=m.j.u(t.options[a]),n==r||""==n&&r===e){o=a;break}(i||0<=o||r===e&&1<t.size)&&(t.selectedIndex=o);break;default:null!==r&&r!==e||(r=""),t.value=r}}}}(),m.b("selectExtensions",m.j),m.b("selectExtensions.readValue",m.j.u),m.b("selectExtensions.writeValue",m.j.ha),m.h=function(){function e(e){e=m.a.$a(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1));var t,r=[],a=e.match(i),s=[],l=0;if(a){a.push(",");for(var u,c=0;u=a[c];++c){var d=u.charCodeAt(0);if(44===d){if(0>=l){r.push(t&&s.length?{key:t,value:s.join("")}:{unknown:t||s.join("")}),t=l=0,s=[];continue}}else if(58===d){if(!l&&!t&&1===s.length){t=s.pop();continue}}else 47===d&&c&&1<u.length?(d=a[c-1].match(n))&&!o[d[0]]&&(e=e.substr(e.indexOf(u)+1),a=e.match(i),a.push(","),c=-1,u="/"):40===d||123===d||91===d?++l:41===d||125===d||93===d?--l:t||s.length||34!==d&&39!==d||(u=u.slice(1,-1));s.push(u)}}return r}var t=["true","false","null","undefined"],r=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,i=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]","g"),n=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},a={};return{ta:[],ea:a,yb:e,Ua:function(i,n){function o(e,i){var n;if(!c){var d=m.getBindingHandler(e);if(d&&d.preprocess&&!(i=d.preprocess(i,e,o)))return;(d=a[e])&&(n=i,0<=m.a.o(t,n)?n=!1:(d=n.match(r),n=null!==d&&(d[1]?"Object("+d[1]+")"+d[2]:n)),d=n),d&&l.push("'"+e+"':function(_z){"+n+"=_z}")}u&&(i="function(){return "+i+" }"),s.push("'"+e+"':"+i)}n=n||{};var s=[],l=[],u=n.valueAccessors,c=n.bindingParams,d="string"==typeof i?e(i):i;return m.a.q(d,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},ad:function(e,t){for(var r=0;r<e.length;r++)if(e[r].key==t)return!0;return!1},Ea:function(e,t,r,i,n){e&&m.H(e)?!m.Ba(e)||n&&e.t()===i||e(i):(e=t.get("_ko_property_writers"))&&e[r]&&e[r](i)}}}(),m.b("expressionRewriting",m.h),m.b("expressionRewriting.bindingRewriteValidators",m.h.ta),m.b("expressionRewriting.parseObjectLiteral",m.h.yb),m.b("expressionRewriting.preProcessBindings",m.h.Ua),m.b("expressionRewriting._twoWayBindings",m.h.ea),m.b("jsonExpressionRewriting",m.h),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.h.Ua),function(){function e(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function i(r,i){for(var n=r,o=1,a=[];n=n.nextSibling;){if(t(n)&&(o--,0===o))return a;a.push(n),e(n)&&o++}if(!i)throw Error("Cannot find closing comment tag to match: "+r.nodeValue);return null}function n(e,t){var r=i(e,t);return r?0<r.length?r[r.length-1].nextSibling:e.nextSibling:null}var o=r&&"<!--test-->"===r.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0};m.f={Z:{},childNodes:function(t){return e(t)?i(t):t.childNodes},xa:function(t){if(e(t)){t=m.f.childNodes(t);for(var r=0,i=t.length;r<i;r++)m.removeNode(t[r])}else m.a.ob(t)},da:function(t,r){if(e(t)){m.f.xa(t);for(var i=t.nextSibling,n=0,o=r.length;n<o;n++)i.parentNode.insertBefore(r[n],i)}else m.a.da(t,r)},mc:function(t,r){e(t)?t.parentNode.insertBefore(r,t.nextSibling):t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r)},gc:function(t,r,i){i?e(t)?t.parentNode.insertBefore(r,i.nextSibling):i.nextSibling?t.insertBefore(r,i.nextSibling):t.appendChild(r):m.f.mc(t,r)},firstChild:function(r){return e(r)?!r.nextSibling||t(r.nextSibling)?null:r.nextSibling:r.firstChild},nextSibling:function(r){return e(r)&&(r=n(r)),r.nextSibling&&t(r.nextSibling)?null:r.nextSibling},Tc:e,pd:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},kc:function(r){if(l[m.a.A(r)]){var i=r.firstChild;if(i)do if(1===i.nodeType){var o;o=i.firstChild;var a=null;if(o)do if(a)a.push(o);else if(e(o)){var s=n(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o]);while(o=o.nextSibling);if(o=a)for(a=i.nextSibling,s=0;s<o.length;s++)a?r.insertBefore(o[s],a):r.appendChild(o[s])}while(i=i.nextSibling)}}}}(),m.b("virtualElements",m.f),m.b("virtualElements.allowedBindings",m.f.Z),m.b("virtualElements.emptyNode",m.f.xa),m.b("virtualElements.insertAfter",m.f.gc),m.b("virtualElements.prepend",m.f.mc),m.b("virtualElements.setDomNodeChildren",m.f.da),function(){m.Q=function(){this.Fc={}},m.a.extend(m.Q.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||m.g.getComponentNameForNode(e);case 8:return m.f.Tc(e);default:return!1}},getBindings:function(e,t){var r=this.getBindingsString(e,t),r=r?this.parseBindingsString(r,t,e):null;return m.g.Ob(r,e,t,!1)},getBindingAccessors:function(e,t){var r=this.getBindingsString(e,t),r=r?this.parseBindingsString(r,t,e,{valueAccessors:!0}):null;return m.g.Ob(r,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return m.f.pd(e);default:return null}},parseBindingsString:function(e,t,r,i){try{var n,o=this.Fc,a=e+(i&&i.valueAccessors||"");if(!(n=o[a])){var s,l="with($context){with($data||{}){return{"+m.h.Ua(e,i)+"}}}";s=new Function("$context","$element",l),n=o[a]=s}return n(t,r)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),m.Q.instance=new m.Q}(),m.b("bindingProvider",m.Q),function(){function r(e){return function(){return e}}function i(e){return e()}function o(e){return m.a.Ca(m.l.w(e),function(t,r){return function(){return e()[r]}})}function a(e,t,i){return"function"==typeof e?o(e.bind(null,t,i)):m.a.Ca(e,r)}function s(e,t){return o(this.getBindings.bind(this,e,t))}function l(e,t,r){var i,n=m.f.firstChild(t),o=m.Q.instance,a=o.preprocessNode;if(a){for(;i=n;)n=m.f.nextSibling(i),a.call(o,i);n=m.f.firstChild(t)}for(;i=n;)n=m.f.nextSibling(i),u(e,i,r)}function u(e,t,r){var i=!0,n=1===t.nodeType;n&&m.f.kc(t),(n&&r||m.Q.instance.nodeHasBindings(t))&&(i=d(t,null,e,r).shouldBindDescendants),i&&!p[m.a.A(t)]&&l(e,t,!n)}function c(e){var t=[],r={},i=[];return m.a.D(e,function n(o){if(!r[o]){var a=m.getBindingHandler(o);a&&(a.after&&(i.push(o),m.a.q(a.after,function(t){if(e[t]){if(-1!==m.a.o(i,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+i.join(", "));n(t)}}),i.length--),t.push({key:o,fc:a})),r[o]=!0}}),t}function d(t,r,n,o){var a=m.a.e.get(t,f);if(!r){if(a)throw Error("You cannot apply bindings multiple times to the same element.");m.a.e.set(t,f,!0)}!a&&o&&m.tc(t,n);var l;if(r&&"function"!=typeof r)l=r;else{var u=m.Q.instance,d=u.getBindingAccessors||s,h=m.B(function(){return(l=r?r(n,t):d.call(u,t,n))&&n.P&&n.P(),l},null,{i:t});l&&h.ba()||(h=null)}var p;if(l){var g=h?function(e){return function(){return i(h()[e])}}:function(e){return l[e]},v=function(){return m.a.Ca(h?h():l,i)};v.get=function(e){return l[e]&&i(g(e))},v.has=function(e){return e in l},o=c(l),m.a.q(o,function(r){var i=r.fc.init,o=r.fc.update,a=r.key;if(8===t.nodeType&&!m.f.Z[a])throw Error("The binding '"+a+"' cannot be used with virtual elements");try{"function"==typeof i&&m.l.w(function(){var r=i(t,g(a),v,n.$data,n);if(r&&r.controlsDescendantBindings){if(p!==e)throw Error("Multiple bindings ("+p+" and "+a+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");p=a}}),"function"==typeof o&&m.B(function(){o(t,g(a),v,n.$data,n)},null,{i:t})}catch(e){throw e.message='Unable to process binding "'+a+": "+l[a]+'"\nMessage: '+e.message,e}})}return{shouldBindDescendants:p===e}}function h(e){return e&&e instanceof m.U?e:new m.U(e)}m.d={};var p={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(e){return m.d[e]},m.U=function(t,r,i,n){var o,a=this,s="function"==typeof t&&!m.H(t),l=m.B(function(){var e=s?t():t,o=m.a.c(e);return r?(r.P&&r.P(),m.a.extend(a,r),l&&(a.P=l)):(a.$parents=[],a.$root=o,a.ko=m),a.$rawData=e,a.$data=o,i&&(a[i]=o),n&&n(a,r,o),a.$data},null,{wa:function(){return o&&!m.a.Qb(o)},i:!0});l.ba()&&(a.P=l,l.equalityComparer=null,o=[],l.Ac=function(t){o.push(t),m.a.F.oa(t,function(t){m.a.La(o,t),o.length||(l.k(),a.P=l=e)})})},m.U.prototype.createChildContext=function(e,t,r){return new m.U(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),r&&r(e)})},m.U.prototype.extend=function(e){return new m.U(this.P||this.$data,this,null,function(t,r){t.$rawData=r.$rawData,m.a.extend(t,"function"==typeof e?e():e)})};var f=m.a.e.I(),g=m.a.e.I();m.tc=function(e,t){return 2!=arguments.length?m.a.e.get(e,g):(m.a.e.set(e,g,t),void(t.P&&t.P.Ac(e)))},m.Ja=function(e,t,r){return 1===e.nodeType&&m.f.kc(e),d(e,t,h(r),!0)},m.Dc=function(e,t,r){return r=h(r),m.Ja(e,a(t,r,e),r)},m.eb=function(e,t){1!==t.nodeType&&8!==t.nodeType||l(h(e),t,!0)},m.Rb=function(e,r){if(!n&&t.jQuery&&(n=t.jQuery),r&&1!==r.nodeType&&8!==r.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");r=r||t.document.body,u(h(e),r,!0)},m.kb=function(t){switch(t.nodeType){case 1:case 8:var r=m.tc(t);if(r)return r;if(t.parentNode)return m.kb(t.parentNode)}return e},m.Jc=function(t){return(t=m.kb(t))?t.$data:e},m.b("bindingHandlers",m.d),m.b("applyBindings",m.Rb),m.b("applyBindingsToDescendants",m.eb),m.b("applyBindingAccessorsToNode",m.Ja),m.b("applyBindingsToNode",m.Dc),m.b("contextFor",m.kb),m.b("dataFor",m.Jc)}(),function(e){function t(t,i){var a,s=n.hasOwnProperty(t)?n[t]:e;s?s.X(i):(s=n[t]=new m.J,s.X(i),r(t,function(e,r){var i=!(!r||!r.synchronous);o[t]={definition:e,Zc:i},delete n[t],a||i?s.notifySubscribers(e):m.Y.Wa(function(){s.notifySubscribers(e)})}),a=!0)}function r(e,t){i("getConfig",[e],function(r){r?i("loadComponent",[e,r],function(e){t(e,r)}):t(null,null)})}function i(t,r,n,o){o||(o=m.g.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,r.concat(function(e){l?n(null):null!==e?n(e):i(t,r,n,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else i(t,r,n,o)}else n(null)}var n={},o={};m.g={get:function(r,i){var n=o.hasOwnProperty(r)?o[r]:e;n?n.Zc?m.l.w(function(){i(n.definition)}):m.Y.Wa(function(){i(n.definition)}):t(r,i)},Xb:function(e){delete o[e]},Jb:i},m.g.loaders=[],m.b("components",m.g),m.b("components.get",m.g.get),m.b("components.clearCachedDefinition",m.g.Xb)}(),function(){function e(e,t,r,i){function n(){0===--s&&i(o)}var o={},s=2,l=r.template;r=r.viewModel,l?a(t,l,function(t){m.g.Jb("loadTemplate",[e,t],function(e){o.template=e,n()})}):n(),r?a(t,r,function(t){m.g.Jb("loadViewModel",[e,t],function(e){o[c]=e,n()})}):n()}function i(e,t,r){if("function"==typeof t)r(function(e){return new t(e)});else if("function"==typeof t[c])r(t[c]);else if("instance"in t){var n=t.instance;r(function(){return n})}else"viewModel"in t?i(e,t.viewModel,r):e("Unknown viewModel value: "+t)}function n(e){switch(m.a.A(e)){case"script":return m.a.ma(e.text);case"textarea":return m.a.ma(e.value);case"template":if(o(e.content))return m.a.ua(e.content.childNodes)}return m.a.ua(e.childNodes)}function o(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,r,i){"string"==typeof r.require?s||t.require?(s||t.require)([r.require],i):e("Uses require, but no AMD loader is present"):i(r)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var u={};m.g.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(m.g.ub(e))throw Error("Component "+e+" is already registered");u[e]=t},m.g.ub=function(e){return u.hasOwnProperty(e)},m.g.od=function(e){delete u[e],m.g.Xb(e)},m.g.Zb={getConfig:function(e,t){t(u.hasOwnProperty(e)?u[e]:null)},loadComponent:function(t,r,i){var n=l(t);a(n,r,function(r){e(t,n,r,i)})},loadTemplate:function(e,i,a){if(e=l(e),"string"==typeof i)a(m.a.ma(i));else if(i instanceof Array)a(i);else if(o(i))a(m.a.V(i.childNodes));else if(i.element)if(i=i.element,t.HTMLElement?i instanceof HTMLElement:i&&i.tagName&&1===i.nodeType)a(n(i));else if("string"==typeof i){var s=r.getElementById(i);s?a(n(s)):e("Cannot find element with ID "+i)}else e("Unknown element type: "+i);else e("Unknown template value: "+i)},loadViewModel:function(e,t,r){i(l(e),t,r)}};var c="createViewModel";m.b("components.register",m.g.register),m.b("components.isRegistered",m.g.ub),m.b("components.unregister",m.g.od),m.b("components.defaultLoader",m.g.Zb),m.g.loaders.push(m.g.Zb),m.g.Bc=u}(),function(){function e(e,r){var i=e.getAttribute("params");if(i){var i=t.parseBindingsString(i,r,e,{valueAccessors:!0,bindingParams:!0}),i=m.a.Ca(i,function(t){return m.m(t,null,{i:e})}),n=m.a.Ca(i,function(t){var r=t.t();return t.ba()?m.m({read:function(){return m.a.c(t())},write:m.Ba(r)&&function(e){t()(e)},i:e}):r});return n.hasOwnProperty("$raw")||(n.$raw=i),n}return{$raw:{}}}m.g.getComponentNameForNode=function(e){var t=m.a.A(e);if(m.g.ub(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=m.a.C&&e.tagName===t))return t},m.g.Ob=function(t,r,i,n){if(1===r.nodeType){var o=m.g.getComponentNameForNode(r);if(o){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(r,i)};t.component=n?function(){return a}:a}}return t};var t=new m.Q;9>m.a.C&&(m.g.register=function(e){return function(t){return r.createElement(t),e.apply(this,arguments)}}(m.g.register),r.createDocumentFragment=function(e){return function(){var t,r=e(),i=m.g.Bc;for(t in i)i.hasOwnProperty(t)&&r.createElement(t);return r}}(r.createDocumentFragment))}(),function(e){function t(e,t,r){if(t=t.template,!t)throw Error("Component '"+e+"' has no template");e=m.a.ua(t),m.f.da(r,e)}function r(e,t,r,i){var n=e.createViewModel;return n?n.call(e,i,{element:t,templateNodes:r}):i}var i=0;m.d.component={init:function(n,o,a,s,l){function u(){var e=c&&c.dispose;"function"==typeof e&&e.call(c),d=c=null}var c,d,h=m.a.V(m.f.childNodes(n));return m.a.F.oa(n,u),m.m(function(){var a,s,p=m.a.c(o());if("string"==typeof p?a=p:(a=m.a.c(p.name),s=m.a.c(p.params)),!a)throw Error("No component name specified");var f=d=++i;m.g.get(a,function(i){if(d===f){if(u(),!i)throw Error("Unknown component '"+a+"'");t(a,i,n);var o=r(i,n,h,s);i=l.createChildContext(o,e,function(e){e.$component=o,e.$componentTemplateNodes=h}),c=o,m.eb(i,n)}})},null,{i:n}),{controlsDescendantBindings:!0}}},m.f.Z.component=!0}();var P={class:"className",for:"htmlFor"};m.d.attr={update:function(t,r){var i=m.a.c(r())||{};m.a.D(i,function(r,i){i=m.a.c(i); +var n=!1===i||null===i||i===e;n&&t.removeAttribute(r),8>=m.a.C&&r in P?(r=P[r],n?t.removeAttribute(r):t[r]=i):n||t.setAttribute(r,i.toString()),"name"===r&&m.a.rc(t,n?"":i.toString())})}},function(){m.d.checked={after:["value","attr"],init:function(t,r,i){function n(){var e=t.checked,n=p?a():e;if(!m.va.Sa()&&(!l||e)){var o=m.l.w(r);if(c){var s=d?o.t():o;h!==n?(e&&(m.a.pa(s,n,!0),m.a.pa(s,h,!1)),h=n):m.a.pa(s,n,e),d&&m.Ba(o)&&o(s)}else m.h.Ea(o,i,"checked",n,!0)}}function o(){var e=m.a.c(r());t.checked=c?0<=m.a.o(e,a()):s?e:a()===e}var a=m.nc(function(){return i.has("checkedValue")?m.a.c(i.get("checkedValue")):i.has("value")?m.a.c(i.get("value")):t.value}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var u=r(),c=s&&m.a.c(u)instanceof Array,d=!(c&&u.push&&u.splice),h=c?a():e,p=l||c;l&&!t.name&&m.d.uniqueName.init(t,function(){return!0}),m.m(n,null,{i:t}),m.a.p(t,"click",n),m.m(o,null,{i:t}),u=e}}},m.h.ea.checked=!0,m.d.checkedValue={update:function(e,t){e.value=m.a.c(t())}}}(),m.d.css={update:function(e,t){var r=m.a.c(t());null!==r&&"object"==typeof r?m.a.D(r,function(t,r){r=m.a.c(r),m.a.bb(e,t,r)}):(r=m.a.$a(String(r||"")),m.a.bb(e,e.__ko__cssValue,!1),e.__ko__cssValue=r,m.a.bb(e,r,!0))}},m.d.enable={update:function(e,t){var r=m.a.c(t());r&&e.disabled?e.removeAttribute("disabled"):r||e.disabled||(e.disabled=!0)}},m.d.disable={update:function(e,t){m.d.enable.update(e,function(){return!m.a.c(t())})}},m.d.event={init:function(e,t,r,i,n){var o=t()||{};m.a.D(o,function(o){"string"==typeof o&&m.a.p(e,o,function(e){var a,s=t()[o];if(s){try{var l=m.a.V(arguments);i=n.$data,l.unshift(i),a=s.apply(i,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===r.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},m.d.foreach={ic:function(e){return function(){var t=e(),r=m.a.zb(t);return r&&"number"!=typeof r.length?(m.a.c(t),{foreach:r.data,as:r.as,includeDestroyed:r.includeDestroyed,afterAdd:r.afterAdd,beforeRemove:r.beforeRemove,afterRender:r.afterRender,beforeMove:r.beforeMove,afterMove:r.afterMove,templateEngine:m.W.sb}):{foreach:t,templateEngine:m.W.sb}}},init:function(e,t){return m.d.template.init(e,m.d.foreach.ic(t))},update:function(e,t,r,i,n){return m.d.template.update(e,m.d.foreach.ic(t),r,i,n)}},m.h.ta.foreach=!1,m.f.Z.foreach=!0,m.d.hasfocus={init:function(e,t,r){function i(i){e.__ko_hasfocusUpdating=!0;var n=e.ownerDocument;if("activeElement"in n){var o;try{o=n.activeElement}catch(e){o=n.body}i=o===e}n=t(),m.h.Ea(n,r,"hasfocus",i,!0),e.__ko_hasfocusLastValue=i,e.__ko_hasfocusUpdating=!1}var n=i.bind(null,!0),o=i.bind(null,!1);m.a.p(e,"focus",n),m.a.p(e,"focusin",n),m.a.p(e,"blur",o),m.a.p(e,"focusout",o)},update:function(e,t){var r=!!m.a.c(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===r||(r?e.focus():e.blur(),!r&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),m.l.w(m.a.Da,null,[e,r?"focusin":"focusout"]))}},m.h.ea.hasfocus=!0,m.d.hasFocus=m.d.hasfocus,m.h.ea.hasFocus=!0,m.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){m.a.Cb(e,t())}},f("if"),f("ifnot",!1,!0),f("with",!0,!1,function(e,t){return e.createChildContext(t)});var A={};m.d.options={init:function(e){if("select"!==m.a.A(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,r,i){function n(){return m.a.Ka(t.options,function(e){return e.selected})}function o(e,t,r){var i=typeof t;return"function"==i?t(e):"string"==i?e[t]:r}function a(e,r){if(f&&c)m.j.ha(t,m.a.c(i.get("value")),!0);else if(p.length){var n=0<=m.a.o(p,m.j.u(r[0]));m.a.sc(r[0],n),f&&!n&&m.l.w(m.a.Da,null,[t,"change"])}}var s=t.multiple,l=0!=t.length&&s?t.scrollTop:null,u=m.a.c(r()),c=i.get("valueAllowUnset")&&i.has("value"),d=i.get("optionsIncludeDestroyed");r={};var h,p=[];c||(s?p=m.a.fb(n(),m.j.u):0<=t.selectedIndex&&p.push(m.j.u(t.options[t.selectedIndex]))),u&&("undefined"==typeof u.length&&(u=[u]),h=m.a.Ka(u,function(t){return d||t===e||null===t||!m.a.c(t._destroy)}),i.has("optionsCaption")&&(u=m.a.c(i.get("optionsCaption")),null!==u&&u!==e&&h.unshift(A)));var f=!1;r.beforeRemove=function(e){t.removeChild(e)},u=a,i.has("optionsAfterRender")&&"function"==typeof i.get("optionsAfterRender")&&(u=function(t,r){a(0,r),m.l.w(i.get("optionsAfterRender"),null,[r[0],t!==A?t:e])}),m.a.Bb(t,h,function(r,n,a){return a.length&&(p=!c&&a[0].selected?[m.j.u(a[0])]:[],f=!0),n=t.ownerDocument.createElement("option"),r===A?(m.a.Za(n,i.get("optionsCaption")),m.j.ha(n,e)):(a=o(r,i.get("optionsValue"),r),m.j.ha(n,m.a.c(a)),r=o(r,i.get("optionsText"),a),m.a.Za(n,r)),[n]},r,u),m.l.w(function(){c?m.j.ha(t,m.a.c(i.get("value")),!0):(s?p.length&&n().length<p.length:p.length&&0<=t.selectedIndex?m.j.u(t.options[t.selectedIndex])!==p[0]:p.length||0<=t.selectedIndex)&&m.a.Da(t,"change")}),m.a.Nc(t),l&&20<Math.abs(l-t.scrollTop)&&(t.scrollTop=l)}},m.d.options.xb=m.a.e.I(),m.d.selectedOptions={after:["options","foreach"],init:function(e,t,r){m.a.p(e,"change",function(){var i=t(),n=[];m.a.q(e.getElementsByTagName("option"),function(e){e.selected&&n.push(m.j.u(e))}),m.h.Ea(i,r,"selectedOptions",n)})},update:function(e,t){if("select"!=m.a.A(e))throw Error("values binding applies only to SELECT elements");var r=m.a.c(t()),i=e.scrollTop;r&&"number"==typeof r.length&&m.a.q(e.getElementsByTagName("option"),function(e){var t=0<=m.a.o(r,m.j.u(e));e.selected!=t&&m.a.sc(e,t)}),e.scrollTop=i}},m.h.ea.selectedOptions=!0,m.d.style={update:function(t,r){var i=m.a.c(r()||{});m.a.D(i,function(r,i){i=m.a.c(i),null!==i&&i!==e&&!1!==i||(i=""),t.style[r]=i})}},m.d.submit={init:function(e,t,r,i,n){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");m.a.p(e,"submit",function(r){var i,o=t();try{i=o.call(n.$data,e)}finally{!0!==i&&(r.preventDefault?r.preventDefault():r.returnValue=!1)}})}},m.d.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){m.a.Za(e,t())}},m.f.Z.text=!0,function(){if(t&&t.navigator)var r=function(e){if(e)return parseFloat(e[1])},i=t.opera&&t.opera.version&&parseInt(t.opera.version()),n=t.navigator.userAgent,o=r(n.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),a=r(n.match(/Firefox\/([^ ]*)/));if(10>m.a.C)var s=m.a.e.I(),l=m.a.e.I(),u=function(e){var t=this.activeElement;(t=t&&m.a.e.get(t,l))&&t(e)},c=function(e,t){var r=e.ownerDocument;m.a.e.get(r,s)||(m.a.e.set(r,s,!0),m.a.p(r,"selectionchange",u)),m.a.e.set(e,l,t)};m.d.textInput={init:function(t,r,n){function s(e,r){m.a.p(t,e,r)}function l(){var i=m.a.c(r());null!==i&&i!==e||(i=""),p!==e&&i===p?m.a.setTimeout(l,4):t.value!==i&&(f=i,t.value=i)}function u(){h||(p=t.value,h=m.a.setTimeout(d,4))}function d(){clearTimeout(h),p=h=e;var i=t.value;f!==i&&(f=i,m.h.Ea(r(),n,"textInput",i))}var h,p,f=t.value,g=9==m.a.C?u:d;10>m.a.C?(s("propertychange",function(e){"value"===e.propertyName&&g(e)}),8==m.a.C&&(s("keyup",d),s("keydown",d)),8<=m.a.C&&(c(t,g),s("dragend",u))):(s("input",d),5>o&&"textarea"===m.a.A(t)?(s("keydown",u),s("paste",u),s("cut",u)):11>i?s("keydown",u):4>a&&(s("DOMAutoComplete",d),s("dragdrop",d),s("drop",d))),s("change",d),m.m(l,null,{i:t})}},m.h.ea.textInput=!0,m.d.textinput={preprocess:function(e,t,r){r("textInput",e)}}}(),m.d.uniqueName={init:function(e,t){if(t()){var r="ko_unique_"+ ++m.d.uniqueName.Ic;m.a.rc(e,r)}}},m.d.uniqueName.Ic=0,m.d.value={after:["options","foreach"],init:function(e,t,r){if("input"!=e.tagName.toLowerCase()||"checkbox"!=e.type&&"radio"!=e.type){var i=["change"],n=r.get("valueUpdate"),o=!1,a=null;n&&("string"==typeof n&&(n=[n]),m.a.ra(i,n),i=m.a.Tb(i));var s=function(){a=null,o=!1;var i=t(),n=m.j.u(e);m.h.Ea(i,r,"value",n)};!m.a.C||"input"!=e.tagName.toLowerCase()||"text"!=e.type||"off"==e.autocomplete||e.form&&"off"==e.form.autocomplete||-1!=m.a.o(i,"propertychange")||(m.a.p(e,"propertychange",function(){o=!0}),m.a.p(e,"focus",function(){o=!1}),m.a.p(e,"blur",function(){o&&s()})),m.a.q(i,function(t){var r=s;m.a.nd(t,"after")&&(r=function(){a=m.j.u(e),m.a.setTimeout(s,0)},t=t.substring(5)),m.a.p(e,t,r)});var l=function(){var i=m.a.c(t()),n=m.j.u(e);if(null!==a&&i===a)m.a.setTimeout(l,0);else if(i!==n)if("select"===m.a.A(e)){var o=r.get("valueAllowUnset"),n=function(){m.j.ha(e,i,o)};n(),o||i===m.j.u(e)?m.a.setTimeout(n,0):m.l.w(m.a.Da,null,[e,"change"])}else m.j.ha(e,i)};m.m(l,null,{i:e})}else m.Ja(e,{checkedValue:t})},update:function(){}},m.h.ea.value=!0,m.d.visible={update:function(e,t){var r=m.a.c(t()),i="none"!=e.style.display;r&&!i?e.style.display="":!r&&i&&(e.style.display="none")}},function(e){m.d[e]={init:function(t,r,i,n,o){return m.d.event.init.call(this,t,function(){var t={};return t[e]=r(),t},i,n,o)}}}("click"),m.O=function(){},m.O.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.O.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.O.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||r;var i=t.getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new m.v.n(i)}if(1==e.nodeType||8==e.nodeType)return new m.v.qa(e);throw Error("Unknown template type: "+e)},m.O.prototype.renderTemplate=function(e,t,r,i){return e=this.makeTemplateSource(e,i),this.renderTemplateSource(e,t,r,i)},m.O.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},m.O.prototype.rewriteTemplate=function(e,t,r){e=this.makeTemplateSource(e,r),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},m.b("templateEngine",m.O),m.Gb=function(){function e(e,t,r,i){e=m.h.yb(e);for(var n=m.h.ta,o=0;o<e.length;o++){var a=e[o].key;if(n.hasOwnProperty(a)){var s=n[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return r="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.h.Ua(e,{valueAccessors:!0})+" } })()},'"+r.toLowerCase()+"')",i.createJavaScriptEvaluatorBlock(r)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,r=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Oc:function(e,t,r){t.isTemplateRewritten(e,r)||t.rewriteTemplate(e,function(e){return m.Gb.dd(e,t)},r)},dd:function(i,n){return i.replace(t,function(t,r,i,o,a){return e(a,r,i,n)}).replace(r,function(t,r){return e(r,"<!-- ko -->","#comment",n)})},Ec:function(e,t){return m.M.wb(function(r,i){var n=r.nextSibling;n&&n.nodeName.toLowerCase()===t&&m.Ja(n,e,i)})}}}(),m.b("__tr_ambtns",m.Gb.Ec),function(){m.v={},m.v.n=function(e){if(this.n=e){var t=m.a.A(e);this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},m.v.n.prototype.text=function(){var e=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.n[e];var t=arguments[0];"innerHTML"===e?m.a.Cb(this.n,t):this.n[e]=t};var t=m.a.e.I()+"_";m.v.n.prototype.data=function(e){return 1===arguments.length?m.a.e.get(this.n,t+e):void m.a.e.set(this.n,t+e,arguments[1])};var r=m.a.e.I();m.v.n.prototype.nodes=function(){var t=this.n;return 0==arguments.length?(m.a.e.get(t,r)||{}).jb||(3===this.ab?t.content:4===this.ab?t:e):void m.a.e.set(t,r,{jb:arguments[0]})},m.v.qa=function(e){this.n=e},m.v.qa.prototype=new m.v.n,m.v.qa.prototype.text=function(){if(0==arguments.length){var t=m.a.e.get(this.n,r)||{};return t.Hb===e&&t.jb&&(t.Hb=t.jb.innerHTML),t.Hb}m.a.e.set(this.n,r,{Hb:arguments[0]})},m.b("templateSources",m.v),m.b("templateSources.domElement",m.v.n),m.b("templateSources.anonymousTemplate",m.v.qa)}(),function(){function t(e,t,r){var i;for(t=m.f.nextSibling(t);e&&(i=e)!==t;)e=m.f.nextSibling(i),r(i,e)}function r(e,r){if(e.length){var i=e[0],n=e[e.length-1],o=i.parentNode,a=m.Q.instance,s=a.preprocessNode;if(s){if(t(i,n,function(e,t){var r=e.previousSibling,o=s.call(a,e);o&&(e===i&&(i=o[0]||t),e===n&&(n=o[o.length-1]||r))}),e.length=0,!i)return;i===n?e.push(i):(e.push(i,n),m.a.za(e,o))}t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||m.Rb(r,e)}),t(i,n,function(e){1!==e.nodeType&&8!==e.nodeType||m.M.yc(e,[r])}),m.a.za(e,o)}}function i(e){return e.nodeType?e:0<e.length?e[0]:null}function n(e,t,n,o,s){s=s||{};var l=(e&&i(e)||n||{}).ownerDocument,u=s.templateEngine||a;if(m.Gb.Oc(n,u,l),n=u.renderTemplate(n,o,s,l),"number"!=typeof n.length||0<n.length&&"number"!=typeof n[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":m.f.da(e,n),l=!0;break;case"replaceNode":m.a.qc(e,n),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(r(n,o),s.afterRender&&m.l.w(s.afterRender,null,[n,o.$data])),n}function o(e,t,r){return m.H(e)?e():"function"==typeof e?e(t,r):e}var a;m.Db=function(t){if(t!=e&&!(t instanceof m.O))throw Error("templateEngine must inherit from ko.templateEngine");a=t},m.Ab=function(t,r,s,l,u){if(s=s||{},(s.templateEngine||a)==e)throw Error("Set a template engine before calling renderTemplate");if(u=u||"replaceChildren",l){var c=i(l);return m.B(function(){var e=r&&r instanceof m.U?r:new m.U(m.a.c(r)),a=o(t,e.$data,e),e=n(l,u,a,e,s);"replaceNode"==u&&(l=e,c=i(l))},null,{wa:function(){return!c||!m.a.nb(c)},i:c&&"replaceNode"==u?c.parentNode:c})}return m.M.wb(function(e){m.Ab(t,r,s,e,"replaceNode")})},m.kd=function(t,i,a,s,l){function u(e,t){r(t,d),a.afterRender&&a.afterRender(t,e),d=null}function c(e,r){d=l.createChildContext(e,a.as,function(e){e.$index=r});var i=o(t,e,d);return n(null,"ignoreTargetNode",i,d,a)}var d;return m.B(function(){var t=m.a.c(i)||[];"undefined"==typeof t.length&&(t=[t]),t=m.a.Ka(t,function(t){return a.includeDestroyed||t===e||null===t||!m.a.c(t._destroy)}),m.l.w(m.a.Bb,null,[s,t,c,a,u])},null,{i:s})};var s=m.a.e.I();m.d.template={init:function(e,t){var r=m.a.c(t());if("string"==typeof r||r.name)m.f.xa(e);else{if("nodes"in r){if(r=r.nodes||[],m.H(r))throw Error('The "nodes" option must be a plain, non-observable array.')}else r=m.f.childNodes(e);r=m.a.jc(r),new m.v.qa(e).nodes(r)}return{controlsDescendantBindings:!0}},update:function(t,r,i,n,o){var a,l=r();r=m.a.c(l),i=!0,n=null,"string"==typeof r?r={}:(l=r.name,"if"in r&&(i=m.a.c(r.if)),i&&"ifnot"in r&&(i=!m.a.c(r.ifnot)),a=m.a.c(r.data)),"foreach"in r?n=m.kd(l||t,i&&r.foreach||[],r,t,o):i?(o="data"in r?o.createChildContext(a,r.as):o,n=m.Ab(l||t,o,r,t)):m.f.xa(t),o=n,(a=m.a.e.get(t,s))&&"function"==typeof a.k&&a.k(),m.a.e.set(t,s,o&&o.ba()?o:e)}},m.h.ta.template=function(e){return e=m.h.yb(e),1==e.length&&e[0].unknown||m.h.ad(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.f.Z.template=!0}(),m.b("setTemplateEngine",m.Db),m.b("renderTemplate",m.Ab),m.a.dc=function(e,t,r){if(e.length&&t.length){var i,n,o,a,s;for(i=n=0;(!r||i<r)&&(a=e[n]);++n){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),i=o=0;break}i+=o}}},m.a.ib=function(){function e(e,t,r,i,n){var o,a,s,l,u,c=Math.min,d=Math.max,h=[],p=e.length,f=t.length,g=f-p||1,v=p+f+1;for(o=0;o<=p;o++)for(l=s,h.push(s=[]),u=c(f,o+g),a=d(0,o-1);a<=u;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:c(l[a]||v,s[a-1]||v)+1:a+1:o+1;for(c=[],d=[],g=[],o=p,a=f;o||a;)f=h[o][a]-1,a&&f===h[o][a-1]?d.push(c[c.length]={status:r,value:t[--a],index:a}):o&&f===h[o-1][a]?g.push(c[c.length]={status:i,value:e[--o],index:o}):(--a,--o,n.sparse||c.push({status:"retained",value:t[a]}));return m.a.dc(g,d,!n.dontLimitMoves&&10*p),c.reverse()}return function(t,r,i){return i="boolean"==typeof i?{dontLimitMoves:i}:i||{},t=t||[],r=r||[],t.length<r.length?e(t,r,"added","deleted",i):e(r,t,"deleted","added",i)}}(),m.b("utils.compareArrays",m.a.ib),function(){function t(t,r,i,n,o){var a=[],s=m.B(function(){var e=r(i,o,m.a.za(a,t))||[];0<a.length&&(m.a.qc(a,e),n&&m.l.w(n,null,[i,e,o])),a.length=0,m.a.ra(a,e)},null,{i:t,wa:function(){return!m.a.Qb(a)}});return{ca:a,B:s.ba()?s:e}}var r=m.a.e.I(),i=m.a.e.I();m.a.Bb=function(n,o,a,s,l){function u(e,t){C=h[t],_!==t&&(E[e]=C),C.qb(_++),m.a.za(C.ca,n),g.push(C),b.push(C)}function c(e,t){if(e)for(var r=0,i=t.length;r<i;r++)t[r]&&m.a.q(t[r].ca,function(i){e(i,r,t[r].ja)})}o=o||[],s=s||{};var d=m.a.e.get(n,r)===e,h=m.a.e.get(n,r)||[],p=m.a.fb(h,function(e){return e.ja}),f=m.a.ib(p,o,s.dontLimitMoves),g=[],v=0,_=0,y=[],b=[];o=[];for(var C,w,S,E=[],p=[],T=0;w=f[T];T++)switch(S=w.moved,w.status){case"deleted":S===e&&(C=h[v],C.B&&(C.B.k(),C.B=e),m.a.za(C.ca,n).length&&(s.beforeRemove&&(g.push(C),b.push(C),C.ja===i?C=null:o[T]=C),C&&y.push.apply(y,C.ca))),v++;break;case"retained":u(T,v++);break;case"added":S!==e?u(T,S):(C={ja:w.value,qb:m.N(_++)},g.push(C),b.push(C),d||(p[T]=C))}m.a.e.set(n,r,g),c(s.beforeMove,E),m.a.q(y,s.beforeRemove?m.$:m.removeNode);for(var x,T=0,d=m.f.firstChild(n);C=b[T];T++){for(C.ca||m.a.extend(C,t(n,a,C.ja,l,C.qb)),v=0;f=C.ca[v];d=f.nextSibling,x=f,v++)f!==d&&m.f.gc(n,f,x);!C.Wc&&l&&(l(C.ja,C.ca,C.qb),C.Wc=!0)}for(c(s.beforeRemove,o),T=0;T<o.length;++T)o[T]&&(o[T].ja=i);c(s.afterMove,E),c(s.afterAdd,p)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.Bb),m.W=function(){this.allowTemplateRewriting=!1},m.W.prototype=new m.O,m.W.prototype.renderTemplateSource=function(e,t,r,i){return(t=(9>m.a.C?0:e.nodes)?e.nodes():null)?m.a.V(t.cloneNode(!0).childNodes):(e=e.text(),m.a.ma(e,i))},m.W.sb=new m.W,m.Db(m.W.sb),m.b("nativeTemplateEngine",m.W),function(){m.vb=function(){var e=this.$c=function(){if(!n||!n.tmpl)return 0;try{if(0<=n.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,i,o,a){if(a=a||r,o=o||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var s=t.data("precompiled");return s||(s=t.text()||"",s=n.template(null,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),t.data("precompiled",s)),t=[i.$data],i=n.extend({koBindingContext:i},o.templateOptions),i=n.tmpl(s,t,i),i.appendTo(a.createElement("div")),n.fragments={},i},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){r.write("<script type='text/html' id='"+e+"'>"+t+"</script>")},0<e&&(n.tmpl.tag.ko_code={open:"__.push($1 || '');"},n.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.vb.prototype=new m.O;var e=new m.vb;0<e.$c&&m.Db(e),m.b("jqueryTmplTemplateEngine",m.vb)}()})}()}(),define("ThirdParty/knockout-es5",[],function(){"use strict";function e(e,r){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,o=t(e,!0);return r=r||Object.getOwnPropertyNames(e),r.forEach(function(t){if(t!==d&&t!==h&&!(t in o)){var r=e[t],a=r instanceof Array,s=n.isObservable(r)?r:a?n.observableArray(r):n.observable(r);Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),o[t]=s,a&&i(n,s)}}),e}function t(e,t){var r=e[d];return!r&&t&&(r={},Object.defineProperty(e,d,{value:r})),r}function r(t,r,i){var n=this,o={owner:t,deferEvaluation:!0};if("function"==typeof i)o.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".');o.read=i.get,o.write=i.set}return t[r]=n.computed(o),e.call(n,t,[r]),t}function i(e,t){var r=null;e.computed(function(){r&&(r.dispose(),r=null);var i=t();i instanceof Array&&(r=n(e,t,i))})}function n(e,t,r){var i=o(e,r);return i.subscribe(t)}function o(e,t){var r=t[h];if(!r){r=new e.subscribable,Object.defineProperty(t,h,{value:r});var i={};a(t,r,i),s(e,t,r,i)}return r}function a(e,t,r){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var n=e[i];e[i]=function(){var e=n.apply(this,arguments);return r.pause!==!0&&t.notifySubscribers(this),e}})}function s(e,t,r,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(n){Object.defineProperty(t,n,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[n].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return r.notifySubscribers(t),o}})})}function l(e,r){if(!e)return null;var i=t(e,!1);return i&&i[r]||null}function u(e,t){var r=l(e,t);r&&r.valueHasMutated()}function c(t){t.track=e,t.getObservable=l,t.valueHasMutated=u,t.defineProperty=r}var d="__knockoutObservables",h="__knockoutSubscribable";return{attachToKo:c}}),define("Widgets/SvgPathBindingHandler",[],function(){"use strict";var e="http://www.w3.org/2000/svg",t="cesium-svgPath-svg",r={register:function(r){r.bindingHandlers.cesiumSvgPath={init:function(i,n){var o=document.createElementNS(e,"svg:svg");o.setAttribute("class",t);var a=document.createElementNS(e,"path");return o.appendChild(a),r.virtualElements.setDomNodeChildren(i,[o]),r.computed({read:function(){var e=r.unwrap(n());a.setAttribute("d",r.unwrap(e.path));var i=r.unwrap(e.width),s=r.unwrap(e.height);o.setAttribute("width",i),o.setAttribute("height",s),o.setAttribute("viewBox","0 0 "+i+" "+s),e.css&&o.setAttribute("class",t+" "+r.unwrap(e.css))},disposeWhenNodeIsRemoved:i}),{controlsDescendantBindings:!0}}},r.virtualElements.allowedBindings.cesiumSvgPath=!0}};return r}),define("ThirdParty/knockout",["./knockout-3.4.0","./knockout-es5","../Widgets/SvgPathBindingHandler"],function(e,t,r){"use strict";return t.attachToKo(e),r.register(e),e}),define("ThirdParty/NoSleep",[],function(){"use strict";function e(e,t,r){var i=document.createElement("source");i.src=r,i.type="video/"+t,e.appendChild(i)}var t={Android:"undefined"!=typeof navigator&&/Android/gi.test(navigator.userAgent),iOS:"undefined"!=typeof navigator&&/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent)},r={WebM:"data:video/webm;base64,GkXfo0AgQoaBAUL3gQFC8oEEQvOBCEKCQAR3ZWJtQoeBAkKFgQIYU4BnQI0VSalmQCgq17FAAw9CQE2AQAZ3aGFtbXlXQUAGd2hhbW15RIlACECPQAAAAAAAFlSua0AxrkAu14EBY8WBAZyBACK1nEADdW5khkAFVl9WUDglhohAA1ZQOIOBAeBABrCBCLqBCB9DtnVAIueBAKNAHIEAAIAwAQCdASoIAAgAAUAmJaQAA3AA/vz0AAA=",MP4:"data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAAG21kYXQAAAGzABAHAAABthADAowdbb9/AAAC6W1vb3YAAABsbXZoZAAAAAB8JbCAfCWwgAAAA+gAAAAAAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAIVdHJhawAAAFx0a2hkAAAAD3wlsIB8JbCAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAIAAAACAAAAAABsW1kaWEAAAAgbWRoZAAAAAB8JbCAfCWwgAAAA+gAAAAAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAVxtaW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEcc3RibAAAALhzdHNkAAAAAAAAAAEAAACobXA0dgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAIAAgASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAAFJlc2RzAAAAAANEAAEABDwgEQAAAAADDUAAAAAABS0AAAGwAQAAAbWJEwAAAQAAAAEgAMSNiB9FAEQBFGMAAAGyTGF2YzUyLjg3LjQGAQIAAAAYc3R0cwAAAAAAAAABAAAAAQAAAAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAAFHN0c3oAAAAAAAAAEwAAAAEAAAAUc3RjbwAAAAAAAAABAAAALAAAAGB1ZHRhAAAAWG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAK2lsc3QAAAAjqXRvbwAAABtkYXRhAAAAAQAAAABMYXZmNTIuNzguMw=="},i=function(){return t.iOS?this.noSleepTimer=null:t.Android&&(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("loop",""),e(this.noSleepVideo,"webm",r.WebM),e(this.noSleepVideo,"mp4",r.MP4)),this};return i.prototype.enable=function(e){t.iOS?(this.disable(),this.noSleepTimer=window.setInterval(function(){window.location=window.location,window.setTimeout(window.stop,0)},e||15e3)):t.Android&&this.noSleepVideo.play()},i.prototype.disable=function(){t.iOS?this.noSleepTimer&&(window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):t.Android&&this.noSleepVideo.pause()},i}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("ThirdParty/pako_inflate",[],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.pako=e()}}(function(){return function e(t,r,i){function n(a,s){if(!r[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};t[a][0].call(c.exports,function(e){var r=t[a][1][e];return n(r?r:e)},c,c.exports,e,t,r,i)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<i.length;a++)n(i[a]);return n}({1:[function(e,t,r){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}}return e},r.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,r,i,n){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+i),n);for(var o=0;o<i;o++)e[n+o]=t[r+o]},flattenChunks:function(e){var t,r,i,n,o,a;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;for(a=new Uint8Array(i),n=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,n),n+=o.length;return a}},o={arraySet:function(e,t,r,i,n){for(var o=0;o<i;o++)e[n+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,n)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(i)},{}],2:[function(e,t,r){"use strict";function i(e,t){if(t<65537&&(e.subarray&&a||!e.subarray&&o))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",i=0;i<t;i++)r+=String.fromCharCode(e[i]);return r}var n=e("./common"),o=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(e){o=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){a=!1}for(var s=new n.Buf8(256),l=0;l<256;l++)s[l]=l>=252?6:l>=248?5:l>=240?4:l>=224?3:l>=192?2:1;s[254]=s[254]=1,r.string2buf=function(e){var t,r,i,o,a,s=e.length,l=0;for(o=0;o<s;o++)r=e.charCodeAt(o),55296===(64512&r)&&o+1<s&&(i=e.charCodeAt(o+1),56320===(64512&i)&&(r=65536+(r-55296<<10)+(i-56320),o++)),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(l),a=0,o=0;a<l;o++)r=e.charCodeAt(o),55296===(64512&r)&&o+1<s&&(i=e.charCodeAt(o+1),56320===(64512&i)&&(r=65536+(r-55296<<10)+(i-56320),o++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},r.buf2binstring=function(e){return i(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,o,a,l=t||e.length,u=new Array(2*l);for(n=0,r=0;r<l;)if(o=e[r++],o<128)u[n++]=o;else if(a=s[o],a>4)u[n++]=65533,r+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&r<l;)o=o<<6|63&e[r++],a--;a>1?u[n++]=65533:o<65536?u[n++]=o:(o-=65536,u[n++]=55296|o>>10&1023,u[n++]=56320|1023&o)}return i(u,n)},r.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&128===(192&e[r]);)r--;return r<0?t:0===r?t:r+s[e[r]]>t?r:t}},{"./common":1}],3:[function(e,t,r){"use strict";function i(e,t,r,i){for(var n=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){a=r>2e3?2e3:r,r-=a;do n=n+t[i++]|0,o=o+n|0;while(--a);n%=65521,o%=65521}return n|o<<16|0}t.exports=i},{}],4:[function(e,t,r){"use strict";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,r){"use strict";function i(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}function n(e,t,r,i){var n=o,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^n[255&(e^t[s])];return e^-1}var o=i();t.exports=n},{}],6:[function(e,t,r){"use strict";function i(){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}t.exports=i},{}],7:[function(e,t,r){"use strict";var i=30,n=12;t.exports=function(e,t){var r,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A;r=e.state,o=e.next_in,P=e.input,a=o+(e.avail_in-5),s=e.next_out,A=e.output,l=s-(t-e.avail_out),u=s+(e.avail_out-257),c=r.dmax,d=r.wsize,h=r.whave,p=r.wnext,f=r.window,m=r.hold,g=r.bits,v=r.lencode,_=r.distcode,y=(1<<r.lenbits)-1,b=(1<<r.distbits)-1;e:do{g<15&&(m+=P[o++]<<g,g+=8,m+=P[o++]<<g,g+=8),C=v[m&y];t:for(;;){if(w=C>>>24,m>>>=w,g-=w,w=C>>>16&255,0===w)A[s++]=65535&C;else{if(!(16&w)){if(0===(64&w)){C=v[(65535&C)+(m&(1<<w)-1)];continue t}if(32&w){r.mode=n;break e}e.msg="invalid literal/length code",r.mode=i;break e}S=65535&C,w&=15,w&&(g<w&&(m+=P[o++]<<g,g+=8),S+=m&(1<<w)-1,m>>>=w,g-=w),g<15&&(m+=P[o++]<<g,g+=8,m+=P[o++]<<g,g+=8),C=_[m&b];r:for(;;){if(w=C>>>24,m>>>=w,g-=w,w=C>>>16&255,!(16&w)){if(0===(64&w)){C=_[(65535&C)+(m&(1<<w)-1)];continue r}e.msg="invalid distance code",r.mode=i;break e}if(E=65535&C,w&=15,g<w&&(m+=P[o++]<<g,g+=8,g<w&&(m+=P[o++]<<g,g+=8)),E+=m&(1<<w)-1,E>c){e.msg="invalid distance too far back",r.mode=i;break e}if(m>>>=w,g-=w,w=s-l,E>w){if(w=E-w,w>h&&r.sane){e.msg="invalid distance too far back",r.mode=i;break e}if(T=0,x=f,0===p){if(T+=d-w,w<S){S-=w;do A[s++]=f[T++];while(--w);T=s-E,x=A}}else if(p<w){if(T+=d+p-w,w-=p,w<S){S-=w;do A[s++]=f[T++];while(--w);if(T=0,p<S){w=p,S-=w;do A[s++]=f[T++];while(--w);T=s-E,x=A}}}else if(T+=p-w,w<S){S-=w;do A[s++]=f[T++];while(--w);T=s-E,x=A}for(;S>2;)A[s++]=x[T++],A[s++]=x[T++],A[s++]=x[T++],S-=3;S&&(A[s++]=x[T++],S>1&&(A[s++]=x[T++]))}else{T=s-E;do A[s++]=A[T++],A[s++]=A[T++],A[s++]=A[T++],S-=3;while(S>2);S&&(A[s++]=A[T++],S>1&&(A[s++]=A[T++]))}break}}break}}while(o<a&&s<u);S=g>>3,o-=S,g-=S<<3,m&=(1<<g)-1,e.next_in=o,e.next_out=s,e.avail_in=o<a?5+(a-o):5-(o-a),e.avail_out=s<u?257+(u-s):257-(s-u),r.hold=m,r.bits=g}},{}],8:[function(e,t,r){"use strict";function i(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function n(){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 _.Buf16(320),this.work=new _.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 _.Buf32(me),t.distcode=t.distdyn=new _.Buf32(ge),t.sane=1,t.back=-1,D):O}function a(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,o(e)):O}function s(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?O:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,a(e))):O}function l(e,t){var r,i;return e?(i=new n,e.state=i,i.window=null,r=s(e,t),r!==D&&(e.state=null),r):O}function u(e){return l(e,_e)}function c(e){if(ye){var t;for(g=new _.Buf32(512),v=new _.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(w(E,e.lens,0,288,g,0,e.work,{ +bits:9}),t=0;t<32;)e.lens[t++]=5;w(T,e.lens,0,32,v,0,e.work,{bits:5}),ye=!1}e.lencode=g,e.lenbits=9,e.distcode=v,e.distbits=5}function d(e,t,r,i){var n,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new _.Buf8(o.wsize)),i>=o.wsize?(_.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>i&&(n=i),_.arraySet(o.window,t,r-i,n,o.wnext),i-=n,i?(_.arraySet(o.window,t,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0}function h(e,t){var r,n,o,a,s,l,u,h,p,f,m,g,v,me,ge,ve,_e,ye,be,Ce,we,Se,Ee,Te,xe=0,Pe=new _.Buf8(4),Ae=[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 O;r=e.state,r.mode===X&&(r.mode=Q),s=e.next_out,o=e.output,u=e.avail_out,a=e.next_in,n=e.input,l=e.avail_in,h=r.hold,p=r.bits,f=l,m=u,Se=D;e:for(;;)switch(r.mode){case F:if(0===r.wrap){r.mode=Q;break}for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(2&r.wrap&&35615===h){r.check=0,Pe[0]=255&h,Pe[1]=h>>>8&255,r.check=b(r.check,Pe,2,0),h=0,p=0,r.mode=B;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",r.mode=he;break}if((15&h)!==L){e.msg="unknown compression method",r.mode=he;break}if(h>>>=4,p-=4,we=(15&h)+8,0===r.wbits)r.wbits=we;else if(we>r.wbits){e.msg="invalid window size",r.mode=he;break}r.dmax=1<<we,e.adler=r.check=1,r.mode=512&h?q:X,h=0,p=0;break;case B:for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(r.flags=h,(255&r.flags)!==L){e.msg="unknown compression method",r.mode=he;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=he;break}r.head&&(r.head.text=h>>8&1),512&r.flags&&(Pe[0]=255&h,Pe[1]=h>>>8&255,r.check=b(r.check,Pe,2,0)),h=0,p=0,r.mode=U;case U:for(;p<32;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.head&&(r.head.time=h),512&r.flags&&(Pe[0]=255&h,Pe[1]=h>>>8&255,Pe[2]=h>>>16&255,Pe[3]=h>>>24&255,r.check=b(r.check,Pe,4,0)),h=0,p=0,r.mode=V;case V:for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.head&&(r.head.xflags=255&h,r.head.os=h>>8),512&r.flags&&(Pe[0]=255&h,Pe[1]=h>>>8&255,r.check=b(r.check,Pe,2,0)),h=0,p=0,r.mode=z;case z:if(1024&r.flags){for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.length=h,r.head&&(r.head.extra_len=h),512&r.flags&&(Pe[0]=255&h,Pe[1]=h>>>8&255,r.check=b(r.check,Pe,2,0)),h=0,p=0}else r.head&&(r.head.extra=null);r.mode=G;case G:if(1024&r.flags&&(g=r.length,g>l&&(g=l),g&&(r.head&&(we=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),_.arraySet(r.head.extra,n,a,g,we)),512&r.flags&&(r.check=b(r.check,n,g,a)),l-=g,a+=g,r.length-=g),r.length))break e;r.length=0,r.mode=H;case H:if(2048&r.flags){if(0===l)break e;g=0;do we=n[a+g++],r.head&&we&&r.length<65536&&(r.head.name+=String.fromCharCode(we));while(we&&g<l);if(512&r.flags&&(r.check=b(r.check,n,g,a)),l-=g,a+=g,we)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=W;case W:if(4096&r.flags){if(0===l)break e;g=0;do we=n[a+g++],r.head&&we&&r.length<65536&&(r.head.comment+=String.fromCharCode(we));while(we&&g<l);if(512&r.flags&&(r.check=b(r.check,n,g,a)),l-=g,a+=g,we)break e}else r.head&&(r.head.comment=null);r.mode=j;case j:if(512&r.flags){for(;p<16;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(h!==(65535&r.check)){e.msg="header crc mismatch",r.mode=he;break}h=0,p=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=X;break;case q:for(;p<32;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}e.adler=r.check=i(h),h=0,p=0,r.mode=Y;case Y:if(0===r.havedict)return e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=l,r.hold=h,r.bits=p,M;e.adler=r.check=1,r.mode=X;case X:if(t===P||t===A)break e;case Q:if(r.last){h>>>=7&p,p-=7&p,r.mode=ue;break}for(;p<3;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}switch(r.last=1&h,h>>>=1,p-=1,3&h){case 0:r.mode=Z;break;case 1:if(c(r),r.mode=re,t===A){h>>>=2,p-=2;break e}break;case 2:r.mode=$;break;case 3:e.msg="invalid block type",r.mode=he}h>>>=2,p-=2;break;case Z:for(h>>>=7&p,p-=7&p;p<32;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if((65535&h)!==(h>>>16^65535)){e.msg="invalid stored block lengths",r.mode=he;break}if(r.length=65535&h,h=0,p=0,r.mode=K,t===A)break e;case K:r.mode=J;case J:if(g=r.length){if(g>l&&(g=l),g>u&&(g=u),0===g)break e;_.arraySet(o,n,a,g,s),l-=g,a+=g,u-=g,s+=g,r.length-=g;break}r.mode=X;break;case $:for(;p<14;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(r.nlen=(31&h)+257,h>>>=5,p-=5,r.ndist=(31&h)+1,h>>>=5,p-=5,r.ncode=(15&h)+4,h>>>=4,p-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=he;break}r.have=0,r.mode=ee;case ee:for(;r.have<r.ncode;){for(;p<3;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.lens[Ae[r.have++]]=7&h,h>>>=3,p-=3}for(;r.have<19;)r.lens[Ae[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Ee={bits:r.lenbits},Se=w(S,r.lens,0,19,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Se){e.msg="invalid code lengths set",r.mode=he;break}r.have=0,r.mode=te;case te:for(;r.have<r.nlen+r.ndist;){for(;xe=r.lencode[h&(1<<r.lenbits)-1],ge=xe>>>24,ve=xe>>>16&255,_e=65535&xe,!(ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(_e<16)h>>>=ge,p-=ge,r.lens[r.have++]=_e;else{if(16===_e){for(Te=ge+2;p<Te;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(h>>>=ge,p-=ge,0===r.have){e.msg="invalid bit length repeat",r.mode=he;break}we=r.lens[r.have-1],g=3+(3&h),h>>>=2,p-=2}else if(17===_e){for(Te=ge+3;p<Te;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}h>>>=ge,p-=ge,we=0,g=3+(7&h),h>>>=3,p-=3}else{for(Te=ge+7;p<Te;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}h>>>=ge,p-=ge,we=0,g=11+(127&h),h>>>=7,p-=7}if(r.have+g>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=he;break}for(;g--;)r.lens[r.have++]=we}}if(r.mode===he)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=he;break}if(r.lenbits=9,Ee={bits:r.lenbits},Se=w(E,r.lens,0,r.nlen,r.lencode,0,r.work,Ee),r.lenbits=Ee.bits,Se){e.msg="invalid literal/lengths set",r.mode=he;break}if(r.distbits=6,r.distcode=r.distdyn,Ee={bits:r.distbits},Se=w(T,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Ee),r.distbits=Ee.bits,Se){e.msg="invalid distances set",r.mode=he;break}if(r.mode=re,t===A)break e;case re:r.mode=ie;case ie:if(l>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=l,r.hold=h,r.bits=p,C(e,m),s=e.next_out,o=e.output,u=e.avail_out,a=e.next_in,n=e.input,l=e.avail_in,h=r.hold,p=r.bits,r.mode===X&&(r.back=-1);break}for(r.back=0;xe=r.lencode[h&(1<<r.lenbits)-1],ge=xe>>>24,ve=xe>>>16&255,_e=65535&xe,!(ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(ve&&0===(240&ve)){for(ye=ge,be=ve,Ce=_e;xe=r.lencode[Ce+((h&(1<<ye+be)-1)>>ye)],ge=xe>>>24,ve=xe>>>16&255,_e=65535&xe,!(ye+ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}h>>>=ye,p-=ye,r.back+=ye}if(h>>>=ge,p-=ge,r.back+=ge,r.length=_e,0===ve){r.mode=le;break}if(32&ve){r.back=-1,r.mode=X;break}if(64&ve){e.msg="invalid literal/length code",r.mode=he;break}r.extra=15&ve,r.mode=ne;case ne:if(r.extra){for(Te=r.extra;p<Te;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.length+=h&(1<<r.extra)-1,h>>>=r.extra,p-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=oe;case oe:for(;xe=r.distcode[h&(1<<r.distbits)-1],ge=xe>>>24,ve=xe>>>16&255,_e=65535&xe,!(ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(0===(240&ve)){for(ye=ge,be=ve,Ce=_e;xe=r.distcode[Ce+((h&(1<<ye+be)-1)>>ye)],ge=xe>>>24,ve=xe>>>16&255,_e=65535&xe,!(ye+ge<=p);){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}h>>>=ye,p-=ye,r.back+=ye}if(h>>>=ge,p-=ge,r.back+=ge,64&ve){e.msg="invalid distance code",r.mode=he;break}r.offset=_e,r.extra=15&ve,r.mode=ae;case ae:if(r.extra){for(Te=r.extra;p<Te;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}r.offset+=h&(1<<r.extra)-1,h>>>=r.extra,p-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=he;break}r.mode=se;case se:if(0===u)break e;if(g=m-u,r.offset>g){if(g=r.offset-g,g>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=he;break}g>r.wnext?(g-=r.wnext,v=r.wsize-g):v=r.wnext-g,g>r.length&&(g=r.length),me=r.window}else me=o,v=s-r.offset,g=r.length;g>u&&(g=u),u-=g,r.length-=g;do o[s++]=me[v++];while(--g);0===r.length&&(r.mode=ie);break;case le:if(0===u)break e;o[s++]=r.length,u--,r.mode=ie;break;case ue:if(r.wrap){for(;p<32;){if(0===l)break e;l--,h|=n[a++]<<p,p+=8}if(m-=u,e.total_out+=m,r.total+=m,m&&(e.adler=r.check=r.flags?b(r.check,o,m,s-m):y(r.check,o,m,s-m)),m=u,(r.flags?h:i(h))!==r.check){e.msg="incorrect data check",r.mode=he;break}h=0,p=0}r.mode=ce;case ce:if(r.wrap&&r.flags){for(;p<32;){if(0===l)break e;l--,h+=n[a++]<<p,p+=8}if(h!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=he;break}h=0,p=0}r.mode=de;case de:Se=I;break e;case he:Se=R;break e;case pe:return N;case fe:default:return O}return e.next_out=s,e.avail_out=u,e.next_in=a,e.avail_in=l,r.hold=h,r.bits=p,(r.wsize||m!==e.avail_out&&r.mode<he&&(r.mode<ue||t!==x))&&d(e,e.output,e.next_out,m-e.avail_out)?(r.mode=pe,N):(f-=e.avail_in,m-=e.avail_out,e.total_in+=f,e.total_out+=m,r.total+=m,r.wrap&&m&&(e.adler=r.check=r.flags?b(r.check,o,m,e.next_out-m):y(r.check,o,m,e.next_out-m)),e.data_type=r.bits+(r.last?64:0)+(r.mode===X?128:0)+(r.mode===re||r.mode===K?256:0),(0===f&&0===m||t===x)&&Se===D&&(Se=k),Se)}function p(e){if(!e||!e.state)return O;var t=e.state;return t.window&&(t.window=null),e.state=null,D}function f(e,t){var r;return e&&e.state?(r=e.state,0===(2&r.wrap)?O:(r.head=t,t.done=!1,D)):O}function m(e,t){var r,i,n,o=t.length;return e&&e.state?(r=e.state,0!==r.wrap&&r.mode!==Y?O:r.mode===Y&&(i=1,i=y(i,t,o,0),i!==r.check)?R:(n=d(e,t,o,o))?(r.mode=pe,N):(r.havedict=1,D)):O}var g,v,_=e("../utils/common"),y=e("./adler32"),b=e("./crc32"),C=e("./inffast"),w=e("./inftrees"),S=0,E=1,T=2,x=4,P=5,A=6,D=0,I=1,M=2,O=-2,R=-3,N=-4,k=-5,L=8,F=1,B=2,U=3,V=4,z=5,G=6,H=7,W=8,j=9,q=10,Y=11,X=12,Q=13,Z=14,K=15,J=16,$=17,ee=18,te=19,re=20,ie=21,ne=22,oe=23,ae=24,se=25,le=26,ue=27,ce=28,de=29,he=30,pe=31,fe=32,me=852,ge=592,ve=15,_e=ve,ye=!0;r.inflateReset=a,r.inflateReset2=s,r.inflateResetKeep=o,r.inflateInit=u,r.inflateInit2=l,r.inflate=h,r.inflateEnd=p,r.inflateGetHeader=f,r.inflateSetDictionary=m,r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,r){"use strict";var i=e("../utils/common"),n=15,o=852,a=592,s=0,l=1,u=2,c=[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],d=[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],h=[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],p=[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,r,f,m,g,v,_){var y,b,C,w,S,E,T,x,P,A=_.bits,D=0,I=0,M=0,O=0,R=0,N=0,k=0,L=0,F=0,B=0,U=null,V=0,z=new i.Buf16(n+1),G=new i.Buf16(n+1),H=null,W=0;for(D=0;D<=n;D++)z[D]=0;for(I=0;I<f;I++)z[t[r+I]]++;for(R=A,O=n;O>=1&&0===z[O];O--);if(R>O&&(R=O),0===O)return m[g++]=20971520,m[g++]=20971520,_.bits=1,0;for(M=1;M<O&&0===z[M];M++);for(R<M&&(R=M),L=1,D=1;D<=n;D++)if(L<<=1,L-=z[D],L<0)return-1;if(L>0&&(e===s||1!==O))return-1;for(G[1]=0,D=1;D<n;D++)G[D+1]=G[D]+z[D];for(I=0;I<f;I++)0!==t[r+I]&&(v[G[t[r+I]]++]=I);if(e===s?(U=H=v,E=19):e===l?(U=c,V-=257,H=d,W-=257,E=256):(U=h,H=p,E=-1),B=0,I=0,D=M,S=g,N=R,k=0,C=-1,F=1<<R,w=F-1,e===l&&F>o||e===u&&F>a)return 1;for(;;){T=D-k,v[I]<E?(x=0,P=v[I]):v[I]>E?(x=H[W+v[I]],P=U[V+v[I]]):(x=96,P=0),y=1<<D-k,b=1<<N,M=b;do b-=y,m[S+(B>>k)+b]=T<<24|x<<16|P|0;while(0!==b);for(y=1<<D-1;B&y;)y>>=1;if(0!==y?(B&=y-1,B+=y):B=0,I++,0===--z[D]){if(D===O)break;D=t[r+v[I]]}if(D>R&&(B&w)!==C){for(0===k&&(k=R),S+=M,N=D-k,L=1<<N;N+k<O&&(L-=z[N+k],!(L<=0));)N++,L<<=1;if(F+=1<<N,e===l&&F>o||e===u&&F>a)return 1;C=B&w,m[C]=R<<24|N<<16|S-g|0}}return 0!==B&&(m[S+B]=D-k<<24|64<<16|0),_.bits=R,0}},{"../utils/common":1}],10:[function(e,t,r){"use strict";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,r){"use strict";function i(){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}t.exports=i},{}],"/lib/inflate.js":[function(e,t,r){"use strict";function i(e){if(!(this instanceof i))return new i(e);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0===(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==u.Z_OK)throw new Error(c[r]);this.header=new h,a.inflateGetHeader(this.strm,this.header)}function n(e,t){var r=new i(t);if(r.push(e,!0),r.err)throw r.msg||c[r.err];return r.result}function o(e,t){return t=t||{},t.raw=!0,n(e,t)}var a=e("./zlib/inflate"),s=e("./utils/common"),l=e("./utils/strings"),u=e("./zlib/constants"),c=e("./zlib/messages"),d=e("./zlib/zstream"),h=e("./zlib/gzheader"),p=Object.prototype.toString;i.prototype.push=function(e,t){var r,i,n,o,c,d,h=this.strm,f=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;i=t===~~t?t:t===!0?u.Z_FINISH:u.Z_NO_FLUSH,"string"==typeof e?h.input=l.binstring2buf(e):"[object ArrayBuffer]"===p.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new s.Buf8(f),h.next_out=0,h.avail_out=f),r=a.inflate(h,u.Z_NO_FLUSH),r===u.Z_NEED_DICT&&m&&(d="string"==typeof m?l.string2buf(m):"[object ArrayBuffer]"===p.call(m)?new Uint8Array(m):m,r=a.inflateSetDictionary(this.strm,d)),r===u.Z_BUF_ERROR&&g===!0&&(r=u.Z_OK,g=!1),r!==u.Z_STREAM_END&&r!==u.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==u.Z_STREAM_END&&(0!==h.avail_in||i!==u.Z_FINISH&&i!==u.Z_SYNC_FLUSH)||("string"===this.options.to?(n=l.utf8border(h.output,h.next_out),o=h.next_out-n,c=l.buf2string(h.output,n),h.next_out=o,h.avail_out=f-o,o&&s.arraySet(h.output,h.output,n,o,0),this.onData(c)):this.onData(s.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(g=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==u.Z_STREAM_END);return r===u.Z_STREAM_END&&(i=u.Z_FINISH),i===u.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u.Z_OK):i!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),h.avail_out=0,!0)},i.prototype.onData=function(e){this.chunks.push(e)},i.prototype.onEnd=function(e){e===u.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=i,r.inflate=n,r.inflateRaw=o,r.ungzip=n},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")}),define("Widgets/subscribeAndEvaluate",["../ThirdParty/knockout"],function(e){"use strict";function t(t,r,i,n,o){return i.call(n,t[r]),e.getObservable(t,r).subscribe(i,n,o)}return t}),define("Widgets/Animation/Animation",["../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../getElement","../subscribeAndEvaluate"],function(e,t,r,i,n,o,a){"use strict";function s(t){return e.fromCssColorString(window.getComputedStyle(t).getPropertyValue("color"))}function l(e){var t=document.createElementNS(_,e.tagName);for(var r in e)if(e.hasOwnProperty(r)&&"tagName"!==r)if("children"===r){var i,n=e.children.length;for(i=0;i<n;++i)t.appendChild(l(e.children[i]))}else 0===r.indexOf("xlink:")?t.setAttributeNS(y,r.substring(6),e[r]):"textContent"===r?t.textContent=e[r]:t.setAttribute(r,e[r]);return t}function u(e,t,r){var i=document.createElementNS(_,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");var n=document.createElementNS(_,"tspan");return n.textContent=r,i.appendChild(n),i}function c(e,t,r){e.setAttribute("transform","translate(100,100) rotate("+r+")"),t.setAttribute("transform","rotate("+r+")")}function d(e,t){var r=t.alpha,i=1-r;return A.red=e.red*i+t.red*r,A.green=e.green*i+t.green*r,A.blue=e.blue*i+t.blue*r,A.toCssColorString()}function h(e,t,r){var i={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":r},{tagName:"title",textContent:""}]};return l(i)}function p(e,t,r){var i={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":r},{tagName:"title",textContent:""}]};return l(i)}function f(e,t){var r=e._viewModel,i=r.shuttleRingDragging;if(!i||v===e)if("mousedown"===t.type||i&&"mousemove"===t.type||"touchstart"===t.type&&1===t.touches.length||i&&"touchmove"===t.type&&1===t.touches.length){var n,o,a=e._centerX,s=e._centerY,l=e._svgNode,u=l.getBoundingClientRect();if("touchstart"===t.type||"touchmove"===t.type?(n=t.touches[0].clientX,o=t.touches[0].clientY):(n=t.clientX,o=t.clientY),!i&&(n>u.right||n<u.left||o<u.top||o>u.bottom))return;var c=e._shuttleRingPointer.getBoundingClientRect(),d=n-a-u.left,h=o-s-u.top,p=180*Math.atan2(h,d)/Math.PI+90;p>180&&(p-=360);var f=r.shuttleRingAngle;i||n<c.right&&n>c.left&&o>c.top&&o<c.bottom?(v=e,r.shuttleRingDragging=!0,r.shuttleRingAngle=p):p<f?r.slower():p>f&&r.faster(),t.preventDefault()}else e===v&&(v=void 0),r.shuttleRingDragging=!1}function m(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;var r=this;this._clickFunction=function(){var e=r._viewModel.command;e.canExecute&&e()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[a(t,"toggled",this.setToggled,this),a(t,"tooltip",this.setTooltip,this),a(t.command,"canExecute",this.setEnabled,this)]}function g(e,t){function r(e){f(x,e)}e=o(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=document.createElement("style");i.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); }",document.head.insertBefore(i,document.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 s=document.createElementNS(_,"svg:svg");this._svgNode=s,s.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",y);var d=document.createElementNS(_,"g");this._topG=d,this._realtimeSVG=new m(p(3,4,"#animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new m(h(44,99,"#animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new m(h(124,99,"#animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new m(h(84,99,"#animation_pathPause"),t.pauseViewModel);var g=document.createElementNS(_,"g");g.appendChild(this._realtimeSVG.svgElement),g.appendChild(this._playReverseSVG.svgElement),g.appendChild(this._playForwardSVG.svgElement),g.appendChild(this._pauseSVG.svgElement);var v=l({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=v;var b=l({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=b,this._shuttleRingPointer=l({tagName:"use",class:"cesium-animation-shuttleRingPointer","xlink:href":"#animation_pathPointer"});var C=l({tagName:"g",transform:"translate(100,100)"});this._knobOuter=l({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});var w=61,S=l({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:w});this._knobDate=u(0,-24,""),this._knobTime=u(0,-7,""),this._knobStatus=u(0,-41,"");var E=l({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:w}),T=document.createElementNS(_,"g");T.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(n),d.appendChild(T),d.appendChild(C),d.appendChild(g),T.appendChild(v),T.appendChild(b),T.appendChild(this._shuttleRingPointer),C.appendChild(this._knobOuter),C.appendChild(S),C.appendChild(this._knobDate),C.appendChild(this._knobTime),C.appendChild(this._knobStatus),C.appendChild(E),s.appendChild(d),e.appendChild(s);var x=this;this._mouseCallback=r,v.addEventListener("mousedown",r,!0),v.addEventListener("touchstart",r,!0),b.addEventListener("mousedown",r,!0),b.addEventListener("touchstart",r,!0),document.addEventListener("mousemove",r,!0),document.addEventListener("touchmove",r,!0),document.addEventListener("mouseup",r,!0),document.addEventListener("touchend",r,!0),document.addEventListener("touchcancel",r,!0),this._shuttleRingPointer.addEventListener("mousedown",r,!0),this._shuttleRingPointer.addEventListener("touchstart",r,!0),this._knobOuter.addEventListener("mousedown",r,!0),this._knobOuter.addEventListener("touchstart",r,!0);var P,A=this._knobTime.childNodes[0],D=this._knobDate.childNodes[0],I=this._knobStatus.childNodes[0];this._subscriptions=[a(t.pauseViewModel,"toggled",function(e){P!==e&&(P=e,P?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),a(t,"shuttleRingAngle",function(e){c(x._shuttleRingPointer,x._knobOuter,e)}),a(t,"dateLabel",function(e){D.textContent!==e&&(D.textContent=e)}),a(t,"timeLabel",function(e){A.textContent!==e&&(A.textContent=e)}),a(t,"multiplierLabel",function(e){I.textContent!==e&&(I.textContent=e)})],this.applyThemeChanges(),this.resize()}var v,_="http://www.w3.org/2000/svg",y="http://www.w3.org/1999/xlink",b=e.fromCssColorString("rgba(247,250,255,0.384)"),C=e.fromCssColorString("rgba(143,191,255,0.216)"),w=e.fromCssColorString("rgba(153,197,255,0.098)"),S=e.fromCssColorString("rgba(255,255,255,0.086)"),E=e.fromCssColorString("rgba(255,255,255,0.267)"),T=e.fromCssColorString("rgba(255,255,255,0)"),x=e.fromCssColorString("rgba(66,67,68,0.3)"),P=e.fromCssColorString("rgba(0,0,0,0.5)"),A=new e;return m.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);for(var e=this._subscriptions,t=0,r=e.length;t<r;t++)e[t].dispose();i(this)},m.prototype.isDestroyed=function(){return!1},m.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!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")}},m.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")))},m.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e},r(g.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){t(this._observer)&&(this._observer.disconnect(),this._observer=void 0);var e=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",e,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",e,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",e,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",e,!0),document.removeEventListener("mousemove",e,!0),document.removeEventListener("touchmove",e,!0),document.removeEventListener("mouseup",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("touchcancel",e,!0),this._shuttleRingPointer.removeEventListener("mousedown",e,!0),this._shuttleRingPointer.removeEventListener("touchstart",e,!0),this._knobOuter.removeEventListener("mousedown",e,!0),this._knobOuter.removeEventListener("touchstart",e,!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 r=this._subscriptions,n=0,o=r.length;n<o;n++)r[n].dispose();return i(this)},g.prototype.resize=function(){var e=this._container.clientWidth,t=this._container.clientHeight;if(e!==this._lastWidth||t!==this._lastHeight){var r=this._svgNode,i=200,n=132,o=e,a=t;0===e&&0===t?(o=i,a=n):0===e?(a=t,o=i*(t/n)):0===t&&(o=e,a=n*(e/i));var s=o/i,l=a/n;r.style.cssText="width: "+o+"px; height: "+a+"px; position: absolute; bottom: 0; left: 0; overflow: hidden;",r.setAttribute("width",o),r.setAttribute("height",a),r.setAttribute("viewBox","0 0 "+o+" "+a),this._topG.setAttribute("transform","scale("+s+","+l+")"),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t}},g.prototype.applyThemeChanges=function(){if(!document.body.contains(this._container)){if(t(this._observer))return;var e=this;return e._observer=new MutationObserver(function(){document.body.contains(e._container)&&(e._observer.disconnect(),e._observer=void 0,e.applyThemeChanges())}),void e._observer.observe(document,{childList:!0,subtree:!0})}var r=s(this._themeNormal),i=s(this._themeHover),n=s(this._themeSelect),o=s(this._themeDisabled),a=s(this._themeKnob),u=s(this._themePointer),c=s(this._themeSwoosh),h=s(this._themeSwooshHover),p=l({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(r,b)},{tagName:"stop",offset:"12%","stop-color":d(r,C)},{tagName:"stop",offset:"46%","stop-color":d(r,w)},{tagName:"stop",offset:"81%","stop-color":d(r,S)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(i,b)},{tagName:"stop",offset:"12%","stop-color":d(i,C)},{tagName:"stop",offset:"46%","stop-color":d(i,w)},{tagName:"stop",offset:"81%","stop-color":d(i,S)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(n,b)},{tagName:"stop",offset:"12%","stop-color":d(n,C)},{tagName:"stop",offset:"46%","stop-color":d(n,w)},{tagName:"stop",offset:"81%","stop-color":d(n,S)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":d(o,E)},{tagName:"stop",offset:"75%","stop-color":d(o,T)}]},{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":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":h.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":h.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":h.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":u.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":u.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":d(u,P)},{tagName:"stop",offset:"100%","stop-color":d(u,P)}]},{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":d(a,b)},{tagName:"stop",offset:"60%","stop-color":d(a,x)},{tagName:"stop",offset:"85%","stop-color":d(a,C)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":d(a,x)},{tagName:"stop",offset:"60%","stop-color":d(a,b)},{tagName:"stop",offset:"85%","stop-color":d(a,S)}]},{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"}]});t(this._defsElement)?this._svgNode.replaceChild(p,this._defsElement):this._svgNode.appendChild(p),this._defsElement=p},g}),define("Widgets/createCommand",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../Core/Event","../ThirdParty/knockout"],function(e,t,r,i,n,o){"use strict";function a(t,i){function a(){var e,r={args:arguments,cancel:!1};return s.raiseEvent(r),r.cancel||(e=t.apply(null,arguments),l.raiseEvent(e)),e}i=e(i,!0);var s=new n,l=new n;return a.canExecute=i,o.track(a,["canExecute"]),r(a,{beforeExecute:{value:s},afterExecute:{value:l}}),a}return a}),define("Widgets/ToggleButtonViewModel",["../Core/defaultValue","../Core/defined","../Core/defineProperties","../Core/DeveloperError","../ThirdParty/knockout"],function(e,t,r,i,n){"use strict";function o(t,r){this._command=t,r=e(r,e.EMPTY_OBJECT),this.toggled=e(r.toggled,!1),this.tooltip=e(r.tooltip,""),n.track(this,["toggled","tooltip"])}return r(o.prototype,{command:{get:function(){return this._command}}}),o}),define("Widgets/Animation/AnimationViewModel",["../../Core/binarySearch","../../Core/ClockRange","../../Core/ClockStep","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/JulianDate","../../ThirdParty/knockout","../../ThirdParty/sprintf","../createCommand","../ToggleButtonViewModel"],function(e,t,r,i,n,o,a,s,l,u,c){"use strict";function d(e,t){return e-t}function h(t,r){var i=e(r,t,d);return i<0?~i:i}function p(e,t){if(Math.abs(e)<=v)return e/v;var r,i,n=v,o=_,a=0;return e>0?(r=Math.log(t[t.length-1]),i=(r-a)/(o-n),Math.exp(a+i*(e-n))):(r=Math.log(-t[0]),i=(r-a)/(o-n),-Math.exp(a+i*(Math.abs(e)-n)))}function f(e,t,i){if(i.clockStep===r.SYSTEM_CLOCK)return v;if(Math.abs(e)<=1)return e*v;var n=t[t.length-1];e>n?e=n:e<-n&&(e=-n);var o,a,s=v,l=_,u=0;return e>0?(o=Math.log(n),a=(o-u)/(l-s),(Math.log(e)-u)/a+s):(o=Math.log(-t[0]),a=(o-u)/(l-s),-((Math.log(Math.abs(e))-u)/a+s))}function m(e){var i=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=m.defaultDateFormatter,this._timeFormatter=m.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,s.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(m.defaultTicks),this.timeLabel=void 0,s.defineProperty(this,"timeLabel",function(){return i._timeFormatter(i._clockViewModel.currentTime,i)}),this.dateLabel=void 0,s.defineProperty(this,"dateLabel",function(){return i._dateFormatter(i._clockViewModel.currentTime,i)}),this.multiplierLabel=void 0,s.defineProperty(this,"multiplierLabel",function(){var e=i._clockViewModel;if(e.clockStep===r.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,s.defineProperty(this,"shuttleRingAngle",{get:function(){return f(e.multiplier,i._allShuttleRingTicks,e)},set:function(e){e=Math.max(Math.min(e,_),-_);var t=i._allShuttleRingTicks,n=i._clockViewModel;if(n.clockStep=r.SYSTEM_CLOCK_MULTIPLIER,Math.abs(e)===_)return void(n.multiplier=e>0?t[t.length-1]:t[0]);var o=p(e,t);if(i.snapToTicks)o=t[h(o,t)];else if(0!==o){var a=Math.abs(o);if(a>100){var s=a.toFixed(0).length-2,l=Math.pow(10,s);o=Math.round(o/l)*l|0}else a>v?o=Math.round(o):a>1?o=+o.toFixed(1):a>0&&(o=+o.toFixed(2))}n.multiplier=o}}),this._canAnimate=void 0,s.defineProperty(this,"_canAnimate",function(){var e=i._clockViewModel,r=e.clockRange;if(i.shuttleRingDragging||r===t.UNBOUNDED)return!0;var n=e.multiplier,o=e.currentTime,s=e.startTime,l=!1;if(r===t.LOOP_STOP)l=a.greaterThan(o,s)||o.equals(s)&&n>0;else{var u=e.stopTime;l=a.greaterThan(o,s)&&a.lessThan(o,u)||o.equals(s)&&n>0||o.equals(u)&&n<0}return l||(e.shouldAnimate=!1),l}),this._isSystemTimeAvailable=void 0,s.defineProperty(this,"_isSystemTimeAvailable",function(){var e=i._clockViewModel,r=e.clockRange;if(r===t.UNBOUNDED)return!0;var n=e.systemTime;return a.greaterThanOrEquals(n,e.startTime)&&a.lessThanOrEquals(n,e.stopTime)}),this._isAnimating=void 0,s.defineProperty(this,"_isAnimating",function(){return i._clockViewModel.shouldAnimate&&(i._canAnimate||i.shuttleRingDragging)});var n=u(function(){var e=i._clockViewModel;e.shouldAnimate?e.shouldAnimate=!1:i._canAnimate&&(e.shouldAnimate=!0)});this._pauseViewModel=new c(n,{toggled:s.computed(function(){return!i._isAnimating}),tooltip:"Pause"});var o=u(function(){var e=i._clockViewModel,t=e.multiplier;t>0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playReverseViewModel=new c(o,{toggled:s.computed(function(){return i._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});var l=u(function(){var e=i._clockViewModel,t=e.multiplier;t<0&&(e.multiplier=-t),e.shouldAnimate=!0});this._playForwardViewModel=new c(l,{toggled:s.computed(function(){return i._isAnimating&&e.multiplier>0&&e.clockStep!==r.SYSTEM_CLOCK}),tooltip:"Play Forward"});var d=u(function(){i._clockViewModel.clockStep=r.SYSTEM_CLOCK},s.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new c(d,{toggled:s.computed(function(){return e.clockStep===r.SYSTEM_CLOCK}),tooltip:s.computed(function(){return i._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=u(function(){var e=i._clockViewModel,t=i._allShuttleRingTicks,r=e.multiplier,n=h(r,t)-1;n>=0&&(e.multiplier=t[n])}),this._faster=u(function(){var e=i._clockViewModel,t=i._allShuttleRingTicks,r=e.multiplier,n=h(r,t)+1;n<t.length&&(e.multiplier=t[n])})}var g=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],v=15,_=105;return m.defaultDateFormatter=function(e,t){var r=a.toGregorianDate(e);return g[r.month-1]+" "+r.day+" "+r.year},m.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],m.defaultTimeFormatter=function(e,t){var r=a.toGregorianDate(e),i=Math.round(r.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?l("%02d:%02d:%02d.%03d",r.hour,r.minute,r.second,i):l("%02d:%02d:%02d UTC",r.hour,r.minute,r.second)},m.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)},m.prototype.setShuttleRingTicks=function(e){var t,r,i,n={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,r=e.length;t<r;++t)i=e[t],n.hasOwnProperty(i)||(n[i]=!0,o.push(i));o.sort(d);var a=[];for(r=o.length,t=r-1;t>=0;--t)i=o[t],0!==i&&a.push(-i);Array.prototype.push.apply(a,o),this._allShuttleRingTicks=a},n(m.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}}}),m._maxShuttleRingAngle=_,m._realtimeShuttleRingAngle=v,m}),define("Widgets/BaseLayerPicker/BaseLayerPickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EllipsoidTerrainProvider","../../Core/isArray","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s){"use strict";function l(r){r=e(r,e.EMPTY_OBJECT);var i=r.globe,l=e(r.imageryProviderViewModels,[]),u=e(r.terrainProviderViewModels,[]);this._globe=i,this.imageryProviderViewModels=l.slice(0),this.terrainProviderViewModels=u.slice(0),this.dropDownVisible=!1,a.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]),this.buttonTooltip=void 0,a.defineProperty(this,"buttonTooltip",function(){var e=this.selectedImagery,r=this.selectedTerrain,i=t(e)?e.name:void 0,n=t(r)?r.name:void 0;return t(i)&&t(n)?i+"\n"+n:t(i)?i:n}),this.buttonImageUrl=void 0,a.defineProperty(this,"buttonImageUrl",function(){var e=this.selectedImagery;return t(e)?e.iconUrl:void 0}),this.selectedImagery=void 0;var c=a.observable();this._currentImageryProviders=[],a.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(e){if(c()===e)return void(this.dropDownVisible=!1);var r,i=this._currentImageryProviders,n=i.length,a=this._globe.imageryLayers;for(r=0;r<n;r++)for(var s=a.length,l=0;l<s;l++){var u=a.get(l);if(u.imageryProvider===i[r]){a.remove(u);break}}if(t(e)){var d=e.creationCommand();if(o(d)){var h=d.length;for(r=h-1;r>=0;r--)a.addImageryProvider(d[r],0);this._currentImageryProviders=d.slice(0)}else this._currentImageryProviders=[d],a.addImageryProvider(d,0)}c(e),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;var d=a.observable();a.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(e){if(d()===e)return void(this.dropDownVisible=!1);var r;t(e)&&(r=e.creationCommand()),this._globe.depthTestAgainstTerrain=!(r instanceof n),this._globe.terrainProvider=r,d(e),this.dropDownVisible=!1}});var h=this;this._toggleDropDown=s(function(){h.dropDownVisible=!h.dropDownVisible}),this.selectedImagery=e(r.selectedImageryProviderViewModel,l[0]),this.selectedTerrain=e(r.selectedTerrainProviderViewModel,u[0])}return r(l.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}}),l}),define("Widgets/BaseLayerPicker/BaseLayerPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./BaseLayerPickerViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e=a(e);var r=new s(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);var l=document.createElement("img");l.setAttribute("draggable","false"),l.className="cesium-baseLayerPicker-selected",l.setAttribute("data-bind","attr: { src: buttonImageUrl }"),i.appendChild(l);var u=document.createElement("div");u.className="cesium-baseLayerPicker-dropDown",u.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(u);var c=document.createElement("div");c.className="cesium-baseLayerPicker-sectionTitle",c.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),c.innerHTML="Imagery",u.appendChild(c);var d=document.createElement("div");d.className="cesium-baseLayerPicker-choices",d.setAttribute("data-bind","foreach: imageryProviderViewModels"),u.appendChild(d);var h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedImagery = $data; }'),d.appendChild(h);var p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);var f=document.createElement("div");f.className="cesium-baseLayerPicker-itemLabel",f.setAttribute("data-bind","text: name"),h.appendChild(f);var m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",u.appendChild(m);var g=document.createElement("div");g.className="cesium-baseLayerPicker-choices",g.setAttribute("data-bind","foreach: terrainProviderViewModels"),u.appendChild(g);var v=document.createElement("div");v.className="cesium-baseLayerPicker-item",v.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parent.selectedTerrain = $data; }'),g.appendChild(v);var _=document.createElement("img");_.className="cesium-baseLayerPicker-itemIcon",_.setAttribute("data-bind","attr: { src: iconUrl }"),_.setAttribute("draggable","false"),v.appendChild(_);var y=document.createElement("div");y.className="cesium-baseLayerPicker-itemLabel",y.setAttribute("data-bind","text: name"),v.appendChild(y),o.applyBindings(r,i),o.applyBindings(r,u),this._viewModel=r,this._container=e,this._element=i,this._dropPanel=u,this._closeDropDown=function(e){i.contains(e.target)||u.contains(e.target)||(r.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._element),o.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),r(this)},l}),define("Widgets/BaseLayerPicker/ProviderViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n){"use strict";function o(t){var r=t.creationFunction;e(r.canExecute)||(r=n(r)),this._creationCommand=r,this.name=t.name,this.tooltip=t.tooltip,this.iconUrl=t.iconUrl,i.track(this,["name","tooltip","iconUrl"])}return t(o.prototype,{creationCommand:{get:function(){return this._creationCommand}}}),o}),define("Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels",["../../Core/buildModuleUrl","../../Scene/ArcGisMapServerImageryProvider","../../Scene/BingMapsImageryProvider","../../Scene/BingMapsStyle","../../Scene/createOpenStreetMapImageryProvider","../../Scene/createTileMapServiceImageryProvider","../../Scene/MapboxImageryProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(){var l=[];return l.push(new s({name:"Bing Maps Aerial",iconUrl:e("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery \nhttp://www.bing.com/maps",creationFunction:function(){return new r({url:"https://dev.virtualearth.net",mapStyle:i.AERIAL})}})),l.push(new s({name:"Bing Maps Aerial with Labels",iconUrl:e("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps",creationFunction:function(){return new r({url:"https://dev.virtualearth.net",mapStyle:i.AERIAL_WITH_LABELS})}})),l.push(new s({name:"Bing Maps Roads",iconUrl:e("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps\nhttp://www.bing.com/maps",creationFunction:function(){return new r({url:"https://dev.virtualearth.net",mapStyle:i.ROAD})}})),l.push(new s({name:"Mapbox Satellite",tooltip:"Mapbox satellite imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxSatellite.png"),creationFunction:function(){return new a({mapId:"mapbox.satellite"})}})),l.push(new s({name:"Mapbox Streets",tooltip:"Mapbox streets imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxTerrain.png"),creationFunction:function(){return new a({mapId:"mapbox.streets"})}})),l.push(new s({name:"Mapbox Streets Classic",tooltip:"Mapbox streets basic imagery https://www.mapbox.com/maps/",iconUrl:e("Widgets/Images/ImageryProviders/mapboxStreets.png"),creationFunction:function(){return new a({mapId:"mapbox.streets-basic"})}})),l.push(new s({name:"ESRI World Imagery",iconUrl:e("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",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI World Street Map",iconUrl:e("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",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",enablePickFeatures:!1})}})),l.push(new s({name:"ESRI National Geographic",iconUrl:e("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",creationFunction:function(){return new t({url:"https://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/",enablePickFeatures:!1})}})),l.push(new s({name:"Open­Street­Map",iconUrl:e("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",creationFunction:function(){return n({url:"https://a.tile.openstreetmap.org/"})}})),l.push(new s({name:"Stamen Watercolor",iconUrl:e("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",creationFunction:function(){return n({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."})}})),l.push(new s({name:"Stamen Toner",iconUrl:e("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:"A high contrast black and white map.\nhttp://maps.stamen.com",creationFunction:function(){return n({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."})}})),l.push(new s({name:"The Black Marble",iconUrl:e("Widgets/Images/ImageryProviders/blackMarble.png"),tooltip:"The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.",creationFunction:function(){return o({url:"https://cesiumjs.org/blackmarble",flipXY:!0,credit:"Black Marble imagery courtesy NASA Earth Observatory"})}})),l.push(new s({name:"Natural Earth II",iconUrl:e("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:"Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/",creationFunction:function(){return o({url:e("Assets/Textures/NaturalEarthII")})}})),l}return l}),define("Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels",["../../Core/buildModuleUrl","../../Core/CesiumTerrainProvider","../../Core/EllipsoidTerrainProvider","../BaseLayerPicker/ProviderViewModel"],function(e,t,r,i){"use strict";function n(){var n=[];return n.push(new i({name:"WGS84 Ellipsoid",iconUrl:e("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",creationFunction:function(){return new r}})),n.push(new i({name:"STK World Terrain meshes",iconUrl:e("Widgets/Images/TerrainProviders/STK.png"),tooltip:"High-resolution, mesh-based terrain for the entire globe. Free for use on the Internet. Closed-network options are available.\nhttp://www.agi.com",creationFunction:function(){return new t({url:"https://assets.agi.com/stk-terrain/v1/tilesets/world/tiles",requestWaterMask:!0,requestVertexNormals:!0})}})),n}return n}),define("Widgets/CesiumInspector/CesiumInspectorViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Rectangle","../../Core/ScreenSpaceEventHandler","../../Core/ScreenSpaceEventType","../../Scene/DebugModelMatrixPrimitive","../../Scene/PerformanceDisplay","../../Scene/TileCoordinatesImageryProvider","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(t){var r;if(e(t)){r="Command Statistics";var i=t.commandsInFrustums;for(var n in i)if(i.hasOwnProperty(n)){var o,a=parseInt(n,10);if(7===a)o="1, 2 and 3";else{for(var s=[],l=2;l>=0;l--){var u=Math.pow(2,l);a>=u&&(s.push(l+1),a-=u)}o=s.reverse().join(" and ")}r+="<br>    "+i[n]+" in frustum "+o}r+="<br>Total: "+t.totalCommands}return r}function p(e,t,r){var i=Math.min(r,t);return i=Math.max(i,e)}function f(t,r){function i(t){var r=f._scene.pick({x:t.position.x,y:t.position.y});e(r)&&(f.primitive=e(r.collection)?r.collection:r.primitive),f.pickPrimitiveActive=!1}function h(t){var r,i=v.ellipsoid,o=f._scene.camera.pickEllipsoid({x:t.position.x,y:t.position.y},i);if(e(o))for(var a=i.cartesianToCartographic(o),s=v._surface.tileProvider._tilesToRenderByTextureCount,l=0;!r&&l<s.length;++l){var u=s[l];if(e(u))for(var c=0;!r&&c<u.length;++c){var d=u[c];n.contains(d.rectangle,a)&&(r=d)}}f.tile=r,f.pickTileActive=!1}var f=this,m=t.canvas,g=new o(m);this._eventHandler=g,this._scene=t,this._canvas=m,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=r;var v=this._scene.globe;v.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="",this.generalSwitchText=c.pureComputed(function(){return f.generalVisible?"-":"+"}),this.primitivesSwitchText=c.pureComputed(function(){return f.primitivesVisible?"-":"+"}),this.terrainSwitchText=c.pureComputed(function(){return f.terrainVisible?"-":"+"}),c.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=d(function(){f.dropDownVisible=!f.dropDownVisible}),this._toggleGeneral=d(function(){f.generalVisible=!f.generalVisible}),this._togglePrimitives=d(function(){f.primitivesVisible=!f.primitivesVisible}),this._toggleTerrain=d(function(){f.terrainVisible=!f.terrainVisible}),this._frustumsSubscription=c.getObservable(this,"frustums").subscribe(function(e){f._scene.debugShowFrustums=e}),this._frustumPlanesSubscription=c.getObservable(this,"frustumPlanes").subscribe(function(e){f._scene.debugShowFrustumPlanes=e}),this._performanceSubscription=c.getObservable(this,"performance").subscribe(function(e){e?f._performanceDisplay=new l({container:f._performanceContainer}):f._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=d(function(){return f._primitive.debugShowBoundingVolume=f.primitiveBoundingSphere,!0}),this._primitiveBoundingSphereSubscription=c.getObservable(this,"primitiveBoundingSphere").subscribe(function(){f._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=d(function(){if(f.primitiveReferenceFrame){var t=f._primitive.modelMatrix;f._modelMatrixPrimitive=new s({modelMatrix:t}),f._scene.primitives.add(f._modelMatrixPrimitive)}else e(f._modelMatrixPrimitive)&&(f._scene.primitives.remove(f._modelMatrixPrimitive),f._modelMatrixPrimitive=void 0);return!0}),this._primitiveReferenceFrameSubscription=c.getObservable(this,"primitiveReferenceFrame").subscribe(function(){f._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=d(function(){return f.filterPrimitive?f._scene.debugCommandFilter=function(t){return!(!e(f._modelMatrixPrimitive)||t.owner!==f._modelMatrixPrimitive._primitive)||!!e(f._primitive)&&(t.owner===f._primitive||t.owner===f._primitive._billboardCollection||t.owner.primitive===f._primitive)}:f._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=c.getObservable(this,"filterPrimitive").subscribe(function(){f._doFilterPrimitive()}),this._wireframeSubscription=c.getObservable(this,"wireframe").subscribe(function(e){v._surface.tileProvider._debug.wireframe=e}),this._globeDepthSubscription=c.getObservable(this,"globeDepth").subscribe(function(e){f._scene.debugShowGlobeDepth=e}),this._pickDepthSubscription=c.getObservable(this,"pickDepth").subscribe(function(e){f._scene.debugShowPickDepth=e}),this._depthFrustumSubscription=c.getObservable(this,"depthFrustum").subscribe(function(e){f.scene.debugShowDepthFrustum=e}),this._incrementDepthFrustum=d(function(){var e=f.depthFrustum+1;return f.depthFrustum=p(1,f._numberOfFrustums,e),!0}),this._decrementDepthFrustum=d(function(){var e=f.depthFrustum-1;return f.depthFrustum=p(1,f._numberOfFrustums,e),!0}),this._suspendUpdatesSubscription=c.getObservable(this,"suspendUpdates").subscribe(function(e){v._surface._debug.suspendLodUpdate=e,e||(f.filterTile=!1)});var _;this._showTileCoordinates=d(function(){return f.tileCoordinates&&!e(_)?_=t.imageryLayers.addImageryProvider(new u({tilingScheme:t.terrainProvider.tilingScheme})):!f.tileCoordinates&&e(_)&&(t.imageryLayers.remove(_),_=void 0),!0}),this._tileCoordinatesSubscription=c.getObservable(this,"tileCoordinates").subscribe(function(){f._showTileCoordinates()}),this._tileBoundingSphereSubscription=c.getObservable(this,"tileBoundingSphere").subscribe(function(){f._showTileBoundingSphere()}),this._showTileBoundingSphere=d(function(){return f.tileBoundingSphere?v._surface.tileProvider._debug.boundingSphereTile=f._tile:v._surface.tileProvider._debug.boundingSphereTile=void 0,!0}),this._doFilterTile=d(function(){return f.filterTile?(f.suspendUpdates=!0,v._surface._tilesToRender=[],e(f._tile)&&f._tile.renderable&&v._surface._tilesToRender.push(f._tile)):f.suspendUpdates=!1,!0}),this._filterTileSubscription=c.getObservable(this,"filterTile").subscribe(function(){f.doFilterTile()}),this._pickPrimitive=d(function(){f.pickPrimitiveActive=!f.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=c.getObservable(this,"pickPrimitiveActive").subscribe(function(e){e?g.setInputAction(i,a.LEFT_CLICK):g.removeInputAction(a.LEFT_CLICK)}),this._pickTile=d(function(){f.pickTileActive=!f.pickTileActive}),this._pickTileActiveSubscription=c.getObservable(this,"pickTileActive").subscribe(function(e){e?g.setInputAction(h,a.LEFT_CLICK):g.removeInputAction(a.LEFT_CLICK)}),this._removePostRenderEvent=t.postRender.addEventListener(function(){f._update()})}return t(f.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 d(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){var e=this;return d(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){var e=this;return d(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){var e=this;return d(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){var e=this;return d(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(t){var r=this._primitive;t!==r&&(this.hasPickedPrimitive=!0,e(r)&&(r.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,e(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=t,t.show=!1,setTimeout(function(){t.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(t){if(e(t)){this.hasPickedTile=!0;var r=this._tile;if(t!==r){this.tileText="L: "+t.level+" X: "+t.x+" Y: "+t.y,this.tileText+="<br>SW corner: "+t.rectangle.west+", "+t.rectangle.south,this.tileText+="<br>NE corner: "+t.rectangle.east+", "+t.rectangle.north;var i=t.data;e(i)?this.tileText+="<br>Min: "+i.minimumHeight+" Max: "+i.maximumHeight:this.tileText+="<br>(Tile is not loaded)"}this._tile=t,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}}),f.prototype._update=function(){this.frustums&&(this.frustumStatisticText=h(this._scene.debugFrustumStatistics));var e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=p(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},f.prototype.isDestroyed=function(){return!1},f.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(),r(this)},f}),define("Widgets/CesiumInspector/CesiumInspector",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./CesiumInspectorViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){e=o(e);var r=document.createElement("div"),i=new a(t,r);this._viewModel=i,this._container=e;var s=document.createElement("div");this._element=s;var l=document.createElement("div");l.textContent="Cesium Inspector",l.className="cesium-cesiumInspector-button",l.setAttribute("data-bind","click: toggleDropDown"),s.appendChild(l),s.className="cesium-cesiumInspector",s.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);var u=document.createElement("div");this._panel=u,u.className="cesium-cesiumInspector-dropDown",s.appendChild(u);var c=document.createElement("div");c.className="cesium-cesiumInspector-sectionHeader";var d=document.createElement("span");d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: toggleGeneral, text: generalSwitchText"),c.appendChild(d),c.appendChild(document.createTextNode("General")),u.appendChild(c);var h=document.createElement("div");h.className="cesium-cesiumInspector-section",h.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : generalVisible, "cesium-cesiumInspector-hide" : !generalVisible}'),u.appendChild(h);var p=document.createElement("div");h.appendChild(p);var f=document.createElement("div");f.className="cesium-cesiumInspector-frustumStats",f.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : frustums, "cesium-cesiumInspector-hide" : !frustums}, html: frustumStatisticText');var m=document.createElement("input");m.type="checkbox",m.setAttribute("data-bind","checked: frustums"),p.appendChild(m),p.appendChild(document.createTextNode("Show Frustums")),p.appendChild(f);var g=document.createElement("div");h.appendChild(g);var v=document.createElement("input");v.type="checkbox",v.setAttribute("data-bind","checked: frustumPlanes"),g.appendChild(v),g.appendChild(document.createTextNode("Show Frustum Planes"));var _=document.createElement("div");h.appendChild(_);var y=document.createElement("input");y.type="checkbox",y.setAttribute("data-bind","checked: performance"),_.appendChild(y),_.appendChild(document.createTextNode("Performance Display")),r.className="cesium-cesiumInspector-performanceDisplay",h.appendChild(r);var b=document.createElement("div");b.className="cesium-cesiumInspector-shaderCache",b.setAttribute("data-bind","html: shaderCacheText"),h.appendChild(b);var C=document.createElement("div");h.appendChild(C);var w=document.createElement("input");w.type="checkbox",w.setAttribute("data-bind","checked: globeDepth"),C.appendChild(w),C.appendChild(document.createTextNode("Show globe depth"));var S=document.createElement("div");C.appendChild(S);var E=document.createElement("div");h.appendChild(E);var T=document.createElement("input");T.type="checkbox",T.setAttribute("data-bind","checked: pickDepth"),E.appendChild(T),E.appendChild(document.createTextNode("Show pick depth"));var x=document.createElement("div");h.appendChild(x);var P=document.createElement("span");P.setAttribute("data-bind",'html: "     Frustum:"'),x.appendChild(P);var A=document.createElement("span");A.setAttribute("data-bind","text: depthFrustumText"),x.appendChild(A);var D=document.createElement("input");D.type="button",D.value="-",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: decrementDepthFrustum"),x.appendChild(D);var I=document.createElement("input");I.type="button",I.value="+",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: incrementDepthFrustum"),x.appendChild(I);var M=document.createElement("div");M.className="cesium-cesiumInspector-sectionHeader",d=document.createElement("span"),d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: togglePrimitives, text: primitivesSwitchText"),M.appendChild(d),M.appendChild(document.createTextNode("Primitives")),u.appendChild(M);var O=document.createElement("div");O.className="cesium-cesiumInspector-section",O.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : primitivesVisible, "cesium-cesiumInspector-hide" : !primitivesVisible}'),u.appendChild(O);var R=document.createElement("div");R.className="cesium-cesiumInspector-pickSection",O.appendChild(R);var N=document.createElement("input");N.type="button",N.value="Pick a primitive",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');var k=document.createElement("div");k.className="cesium-cesiumInspector-center",k.appendChild(N),R.appendChild(k);var L=document.createElement("div");R.appendChild(L);var F=document.createElement("input");F.type="checkbox",F.setAttribute("data-bind","checked: primitiveBoundingSphere, enable: hasPickedPrimitive"),L.appendChild(F),L.appendChild(document.createTextNode("Show bounding sphere"));var B=document.createElement("div");R.appendChild(B);var U=document.createElement("input");U.type="checkbox",U.setAttribute("data-bind","checked: primitiveReferenceFrame, enable: hasPickedPrimitive"),B.appendChild(U),B.appendChild(document.createTextNode("Show reference frame"));var V=document.createElement("div");this._primitiveOnly=V,R.appendChild(V);var z=document.createElement("input");z.type="checkbox",z.setAttribute("data-bind","checked: filterPrimitive, enable: hasPickedPrimitive"),V.appendChild(z),V.appendChild(document.createTextNode("Show only selected"));var G=document.createElement("div");G.className="cesium-cesiumInspector-sectionHeader",d=document.createElement("span"),d.className="cesium-cesiumInspector-toggleSwitch",d.setAttribute("data-bind","click: toggleTerrain, text: terrainSwitchText"),G.appendChild(d),G.appendChild(document.createTextNode("Terrain")),u.appendChild(G);var H=document.createElement("div");H.className="cesium-cesiumInspector-section",H.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : terrainVisible, "cesium-cesiumInspector-hide" : !terrainVisible}'),u.appendChild(H);var W=document.createElement("div");W.className="cesium-cesiumInspector-pickSection",H.appendChild(W);var j=document.createElement("input");j.type="button",j.value="Pick a tile",j.className="cesium-cesiumInspector-pickButton",j.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),k=document.createElement("div"),k.appendChild(j),k.className="cesium-cesiumInspector-center",W.appendChild(k);var q=document.createElement("div");W.appendChild(q);var Y=document.createElement("input");Y.type="button",Y.value="Parent",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectParent");var X=document.createElement("input");X.type="button",X.value="NW",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectNW");var Q=document.createElement("input");Q.type="button",Q.value="NE",Q.className="cesium-cesiumInspector-pickButton",Q.setAttribute("data-bind","click: selectNE");var Z=document.createElement("input");Z.type="button",Z.value="SW",Z.className="cesium-cesiumInspector-pickButton",Z.setAttribute("data-bind","click: selectSW");var K=document.createElement("input");K.type="button",K.value="SE",K.className="cesium-cesiumInspector-pickButton",K.setAttribute("data-bind","click: selectSE");var J=document.createElement("div");J.className="cesium-cesiumInspector-tileText",q.className="cesium-cesiumInspector-frustumStats",q.appendChild(J),q.setAttribute("data-bind",'css: {"cesium-cesiumInspector-show" : hasPickedTile, "cesium-cesiumInspector-hide" : !hasPickedTile}'),J.setAttribute("data-bind","html: tileText");var $=document.createElement("div");$.className="cesium-cesiumInspector-relativeText",$.textContent="Select relative:",q.appendChild($);var ee=document.createElement("table"),te=document.createElement("tr"),re=document.createElement("tr"),ie=document.createElement("td");ie.appendChild(Y);var ne=document.createElement("td");ne.appendChild(X);var oe=document.createElement("td");oe.appendChild(Q),te.appendChild(ie),te.appendChild(ne),te.appendChild(oe);var ae=document.createElement("td"),se=document.createElement("td");se.appendChild(Z);var le=document.createElement("td");le.appendChild(K),re.appendChild(ae),re.appendChild(se),re.appendChild(le),ee.appendChild(te),ee.appendChild(re),q.appendChild(ee);var ue=document.createElement("div");W.appendChild(ue);var ce=document.createElement("input");ce.type="checkbox",ce.setAttribute("data-bind","checked: tileBoundingSphere, enable: hasPickedTile"),ue.appendChild(ce),ue.appendChild(document.createTextNode("Show bounding volume"));var de=document.createElement("div");W.appendChild(de);var he=document.createElement("input");he.type="checkbox",he.setAttribute("data-bind","checked: filterTile, enable: hasPickedTile"),de.appendChild(he),de.appendChild(document.createTextNode("Show only selected"));var pe=document.createElement("div");H.appendChild(pe);var fe=document.createElement("input");fe.type="checkbox",fe.setAttribute("data-bind","checked: wireframe"),pe.appendChild(fe),pe.appendChild(document.createTextNode("Wireframe"));var me=document.createElement("div");H.appendChild(me);var ge=document.createElement("input");ge.type="checkbox",ge.setAttribute("data-bind","checked: suspendUpdates"),me.appendChild(ge),me.appendChild(document.createTextNode("Suspend LOD update"));var ve=document.createElement("div");H.appendChild(ve);var _e=document.createElement("input");_e.type="checkbox",_e.setAttribute("data-bind","checked: tileCoordinates"),ve.appendChild(_e),ve.appendChild(document.createTextNode("Show tile coordinates")),n.applyBindings(i,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),r(this)},s}),define("Widgets/CesiumWidget/CesiumWidget",["../../Core/buildModuleUrl","../../Core/Cartesian3","../../Core/Clock","../../Core/Credit","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Ellipsoid","../../Core/FeatureDetection","../../Core/formatError","../../Core/requestAnimationFrame","../../Core/ScreenSpaceEventHandler","../../Scene/BingMapsImageryProvider","../../Scene/Globe","../../Scene/Moon","../../Scene/Scene","../../Scene/SceneMode","../../Scene/ShadowMode","../../Scene/SkyAtmosphere","../../Scene/SkyBox","../../Scene/Sun","../getElement"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S){"use strict";function E(t){return e("Assets/Textures/SkyBox/tycho2t3_80_"+t+".jpg")}function T(e){function t(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{var n=e._targetFrameRate;if(o(n)){var a=1e3/n,s=i-r;s>a&&(e.resize(),e.render(),r=i-s%a),h(t)}else e.resize(),e.render(),h(t)}catch(t){if(e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors){var l="An error occurred while rendering. Rendering has stopped.";e.showErrorPanel(l,void 0,t)}}else e._renderLoopRunning=!1}e._renderLoopRunning=!0;var r=0;h(t)}function x(e){var t=e._canvas,r=t.clientWidth,i=t.clientHeight,o=e._resolutionScale;e._supportsImageRenderingPixelated||(o*=n(window.devicePixelRatio,1)),e._canvasWidth=r,e._canvasHeight=i,r*=o,i*=o,t.width=r,t.height=i,e._canRender=0!==r&&0!==i}function P(e){var t=e._canvas,r=t.width,i=t.height;if(0!==r&&0!==i){var n=e._scene.camera.frustum;o(n.aspectRatio)?n.aspectRatio=r/i:(n.top=n.right*(i/r),n.bottom=-n.top)}}function A(e,a){e=S(e),a=n(a,{});var s=document.createElement("div");s.className="cesium-widget",e.appendChild(s);var l=document.createElement("canvas"),d=c.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=d,d&&(l.style.imageRendering=c.imageRenderingValue()),l.oncontextmenu=function(){return!1},l.onselectstart=function(){return!1},s.appendChild(l);var h=document.createElement("div");h.className="cesium-widget-credits";var T=o(a.creditContainer)?S(a.creditContainer):s;T.appendChild(h);var A=n(a.showRenderLoopErrors,!0);this._element=s,this._container=e,this._canvas=l,this._canvasWidth=0,this._canvasHeight=0,this._creditContainer=h,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=A,this._resolutionScale=1,this._forceResize=!1,this._clock=o(a.clock)?a.clock:new r,x(this);try{var I=new v({canvas:l,contextOptions:a.contextOptions,creditContainer:h,mapProjection:a.mapProjection,orderIndependentTranslucency:a.orderIndependentTranslucency,scene3DOnly:n(a.scene3DOnly,!1),terrainExaggeration:a.terrainExaggeration,shadows:a.shadows,mapMode2D:a.mapMode2D});this._scene=I,I.camera.constrainedAxis=t.UNIT_Z,P(this);var M=n(I.mapProjection.ellipsoid,u.WGS84),O=I.frameState.creditDisplay,R=new i("Cesium",D,"http://cesiumjs.org/");O.addDefaultCredit(R);var N=a.globe;o(N)||(N=new m(M)),N!==!1&&(I.globe=N,I.globe.shadows=n(a.terrainShadows,y.RECEIVE_ONLY));var k=a.skyBox;o(k)||(k=new C({sources:{positiveX:E("px"),negativeX:E("mx"),positiveY:E("py"),negativeY:E("my"),positiveZ:E("pz"),negativeZ:E("mz")}})),k!==!1&&(I.skyBox=k,I.sun=new w,I.moon=new g);var L=a.skyAtmosphere;o(L)||(L=new b(M)),L!==!1&&(I.skyAtmosphere=L);var F=a.globe!==!1&&a.imageryProvider;o(F)||(F=new f({url:"https://dev.virtualearth.net"})),F!==!1&&I.imageryLayers.addImageryProvider(F),o(a.terrainProvider)&&a.globe!==!1&&(I.terrainProvider=a.terrainProvider),this._screenSpaceEventHandler=new p(l,!1),o(a.sceneMode)&&(a.sceneMode===_.SCENE2D&&this._scene.morphTo2D(0),a.sceneMode===_.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=n(a.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=a.targetFrameRate;var B=this;I.renderError.addEventListener(function(e,t){if(B._useDefaultRenderLoop=!1,B._renderLoopRunning=!1,B._showRenderLoopErrors){var r="An error occurred while rendering. Rendering has stopped.";B.showErrorPanel(r,void 0,t)}})}catch(e){if(A){var U="Error constructing CesiumWidget.",V='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:';this.showErrorPanel(U,V,e)}throw e}}var D="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAeCAYAAAD5AOomAAAQWUlEQVR42u1beXxOxxpudrEktkbUkriI4lZpq5JbW6pJuFG0qrFeexVRak3TBm3RUgS1hFhrCdKgQWKLrUGQBiVBJMgiq0Qiuyxzn/fzTu74ZPnS9nfrj4zf8/ty5sw7M+c8824zx0svVa3oAfqAAWAIGAHGCoy43oDb6TGqywta9JgsIq4GUAswB+oDDRXU5/ragCm3N6gm+MUkVJ+1kAg1AyyA5oAN8BrQCXiTfzsArwLWgCVQF6jJBOtXk/tikWrMGkiEtgTeAOyBfsAQS0vL8YMHD/aws7ObiuthwAeAA/A20AZozAvCRNHe6vI3k2rCprUp8DoR1qVLF1c/P7+A5OTkhyUlJaKwuETkPSkRBUUlgkpmZmbW2bNnQyZOnLgA7Z2BzkALNtM1qsl9MTSVSLUCugADAwMDTxKZVI7cfCw8DiWK6fselMLtlwSxJyxDPM4vFsXFxSWRkZFRkBsOdAdaAw2qyf37ij77RDMm1a5evXojY2NjH5BW7ruaIab4xotPd8cJV/xO0cKkPXGae97n0kR6TpHIzs7O7d279xdsvoncemwJqn3u/1lbDTnqfYXN6JCUlJS03CfFwt0/4TkiK8IEEBydWiBIy21tbaejr24cWJlpBVT6ShpVFvS10iddZP6MbFkyqpw2Kor6K5P9M33onG1Iv0omsz3Q//79+7HpuUViDsys697KyZy89ynk9Wc/x4u7DwvE48ePs2mRcARtqUTLRjxmDa6rpYWanDqZKHmyzJ+lTFlyUrZGGbIm3GdF49VQcnMjZUwTJW83Ua4NtayQmlEYKW1NlOc11RrLoAxLpqdYUSmnPlOlbk1qa21OZ7ovX758E/lTz1MpOmvp5gvp4qeL6c8sAjLNOQXF4sKFC6Hotw+nSrR46rAfb8hkN+WxVTTlyPplNuNmDArGGgFNgGZloClbHQtua8bj1eW+GnObZspY2nL1WKaOkreraKDk7jXLsEJGXG+u1b4Bz/0VZayyUkO5f2DCc5DvyZL/1inb0ONVU5+1dSBMcHrIvRwNMbqQ6u6fKGSZ4POszFaQDZNc0q9fvzkcjFkzKf/gfJjSo3c40OrBoL+7cvvXeUFYM17l1MuOTbxEV8a/uE8pZ8Ww4bouPJ62bFlyzXmebRg2jLY8jxa8WGopxEiX9jLff1Vp357zfluefyeOPxpp9WHAGl2fn/k1do+Ef/K86lYWs+hzJ7SSbXv06OFGAfAMRLtlBUjkPyfuidMyw3Fi37UM8TMCLFVj6W9qW1BYIg4ePBjEWkukdCTyZsyYMcvX13f7iRMnDv36669B0OxTBKRNx4OCggIPHDiwa+XKld+j7Xv84v/l4+Oz6PLlywHnzp07Su0gdyw4OPgYXQNHzp8/f+TixYuHw8LCDuDeGiaLXqLj6tWrlyLC9ztz5gy1PwEcV3AU89i3detWT2NjYyeWedvLy2va77//7hcREeHfsWPH91HX6/r16/7h4eH+6H+ZVtQvN3ToujXm9wPJYS6+FhYWzggmh4eGhh6hsTHnE/j7eN++fQczWY1Yc6WrIVJb0SLEu9iJ93I0JCTkKMY+PHLkSGe2MLV5TL3ytgxr88pwuHLlyvXY9CcaH6mSR5HwwRuPRWZekTgXnfPcfW0QqfMDk0Qc+nqCnDc+Pj6FNzJoE+PfeDEXhQ6FtD0rKyu9Tp06LpAbBN9/S+hYEJmnck79EazQA5myVTKeyM/Pp7jgI2AAXv4JeW/AgAGzUTdKXj969CiOF04T1jhj/qXrzrgfQ+0KUdq1azdt6tSpntrjxcTEUGroyBrdkLmoy3x0HT9+vIe2zIoVK9y5fT0eU688/2rOJqY/bTRcjsl5hqRPYF5P38nSdJrwMErzezMpX1NfHrELjiQ9fbl56SIjO5leViH6nwwMnjZt2gL5EmWh/Lf4f+U5BtauXbsJshPu3LkTLQl/+PBhVmpqagZ+HxHS0tLSCShpGRkZqXhp12i8RYsWrVP7wr1ctM9E2wy0lch88uRJoWwTFRV1A7JjoVnBss7BwWEJ6ubIa/SRgOt32VybKduvZILtMbd4JraoZcuWC8eMGbNN+7noWTt06DCVXUIL9rtNOdj8uABFW+bbb7/9js34y4o5fo5YI14h7QwNDV1yc3MLAsIfP0PS9kvpmg6Db+wXn6/pKrwOztBcn7mTXWbEPHlPvMguKBFFxYXiq819hZu3k6Y9xpgFjN+xY8cBOcmkpKQ0rh8HDCUieHNjHExgmGwHQomkKbdu3bpP10VFRcU2NjZ7UbcKWATMB74C3IBpSn8jTp48eVb2k5iYSNq4BVjJcl8zFrq5ue3Py8vLB/Kg4USa6+nTp0OkLNwUmfYFckGiTRJZH1YKc3Zp5mye+yQnJydQOyyYImtr65XDhw/3lX2B7BJlgaSxhXiL+6K99z4wwadkG/RRLP/28PBYxpaiES+mcokllW4PczcUz1Twy++ZpSTRrhJtUCSnx4gvNzkL9419xBfevUVIxEHNIEuDUp4j90ZCHjSqUHj+/AnaOmnkmFgyIa6Y8Hk5SScnp6VMwLs82Tc5wOkJv9Tfz89v3f79+73xMPTyJyrEloCI8+PGjTs0adIkX1dXVx+Yuu2ff/75tlmzZm1A+xUDBw6kHHo4/GqQHA8Lt9DT0/OSu7v70SlTpuwdMmTIFhC2tlmzZivQ9geAtOFLgLRoGhbFJSnbrVu3DahbrEXs+4pZrMm/FGj1xaJNlMRaWVmtGTZs2D7ZV3R0dA6sWJG8Riayhd1GNzbNo0nTpWWbP3/+dYXY5fyOLCsjti5Hbh/hwfODbmeVkkS5rCgpFgt2DNaQKjHTy16kZsRpBpp1IKE0uNoSkqapO3llp2YBUFuPLf01Jgf9007UFAQCv8lJmpubf4Y6J478rNgMWfHL6cRBE+1e9SXTKInVpdy7d+8KmbOhQ4d+rasMLRjML5xMLlkSBFShCrEbiXxJLDQymQ8/2rN/lKkJXQ+AdUiSxDZv3nydSuzNmzczQWaEvIZbeESuhhf5mLt375Y+Z0BAQDQW7Dl5PXfu3KW6EGvIfoEisL6Ya+p1aBz5z/N3czQdbQ5w12ieSizhu13DEPHmajYiKDXyPJmiaX8t6pSYs8FB04bM8ObAL2ijIg/9zyCtU4lFBDqJA6p2nE/KPLMVmyRbToGcq0osAq0rrFEu8Eve5IfJhOsiCxN8FXJzjx07FqYQ6426JZJYaGQKu463eO4W/EvXLiqx0Ni1MMV+ig9PR5ut0PosWbd582bKHL50cXHZIOMMGqtJkybrQWZpEDdv3rwfdCHWgCM5yo3s/f39j9G8H2Y/tRKXbgUItw2Oz5EqSfMJWvT0dCefA5PsVPHNTx+VtpkFzb4Ve0ncuHHjLq/I0UhJSv1W27Zt57F/6cpp0Gv8awfz6Lxq1ar5P/7448KxY8eSH/5UNcUffPBBQKdOnTZ37tx5la2t7VI7O7vv33nnnYUwrR6Ojo7TEIm6sFkjckfxwvIAaMyvTE1NPRC4LEFQtAH9+yOVSFYiXvLFC48ePXpF1nXv3n09mWqF2Ie4/oTHeIM19Q2+/iQhISFVIXb1iBEj9irWhCL2pXPmzPlF9aOoW4+gL13W7d69+ywtMASApe1glhez2yqXWJnH1uDVRv5tpMY0PE4Qu4IWlkmoNlb6TRKRcaHiQoS/+Ir9sMTCnYM1q27NmjW+tIqJxMOHDwfISe7bty8YdZ8pZ7r9aZOEruE7F2lFqZ+pwRNI8WG/SGTNZuKm8gIawlrusGDBgi+wsEJ+Q8Fq38W+fg7LkHv4hoKwUaNGlWoFLEwuEatqrL29PQVq86TW5+Tk5LP8aDK9PN4AvnaXPhKBbSEW6bLRo0fvkH3FxsYmcaA3m6JzWR8ZGVlKKmUoHAhORFywSysqfqui4Enbz1JE5nz16tXwrNx0nUh9Gkw5QTPfFbPX93pWo6Hpp6740EqkVOc/lNzTZgM0cKVq9qAdmSlPS5IEHjaN8h7Z5iAKpUt48LsyTYCGPcBc7+L3DvLi2xEREYSbt2/fDkdwci0sLOwwRZfbt29frmhFIdpEgehIkqFfRN9RQAzmkSvbQdvIzLqdOnWqNN+GFaAoeircVYr68rHoohG138KYN+mXji1Rny1NKeKWXDMzM/cJEyZskHIPUMiX0ntp06aNm5riSYsA0+zLpn6Ql5fXRnl/8eLFX7NVsygv3VHNcU3ev+xC23800NlrvqUBUFVBckv3jNZMBNHnSvajr/OEHLDaM3X1lSCjoFGjRmRKhyGoiKziBgWZRWf0kSeqUGbOnOlJmod44Iys+/DDD8kiuMAULlMXXWUFUfkhIhB9LpZ1WBwxHBDSexmIBXFTlcHCeMQuqidh586dK+S91atXu3EkXp83KPQrOt0xZq2loMVh2bJlmmT6+OVt0MT3qkiqk1jsM0LkFWQL0iI2rx2UjXfyo73gPzZCu64iyIhHYJMMJU2RoJ0ikBiOiNBn0KBBY/gB7UNDQ3/B/QTcT1SRmpqaQEA/D3A/HtoXGxcXd07uy3bt2nUQSPKHJkbLthIsnwifGY/5/oZ0gnxwb5ojTPG6jIyMGCySBCz4gTJKnz59+szg4OBAjBEFkuIg+wxQojHXszD983hx9Zw8efI4EBZHgFYHsjnV7JdjfkMw50R+hnikauM4QKJspb23t/dkuAeaR9ySJUuG8Lusw9ZWr7KvEU15N4P2Lt9HZKjZdTkeuk3MRcpSVmT8DKEbe2vaePlPFyX4B8IoHfiYH6AJJ+/m7PRtuL47r9revJfch/92YDK78Hxas0xHDrTeU2R6c8rkWIZcK/5mqx1vondnWUeWUdGL++7EL9SG5Tooc2ihFbH3VPpzVOZgz4ugI6durVjLpNV6lRd5Y/5tx3Puxv3Kzf5G3KaFcpjQvCqfHKmH7Y15An3hqDeRWaZo1+fkIjFjXQ9NKiNNNJFJvpR87JLdI8X95HCNj6CjOtrJ4uituXLUZKwk8pbKCUpr5fSkNZNhxe6hIbeXR3bNFBlttOKX0Izb1mfZhtyXFcu20kFOfmZrwQteHtXJI8AmvKfbUulPLiRrTtvk8WFdPhyw4P4b8DupxZrXgOfXTHnmOvyu5P6x/NxX7nIZVuXA3Yg7asyrxoG+RER4HoMorzj/SY64ijw18OIm4Xd2uTh4fq04f+OASEy7pyGUvrqYPXv2CvYfb/JEzbUOlA342lR5MDNFo+UZam1+MBPlgNuU69X25mXI1lIO6qVsTUXWrAK5GloH49qH3Ophf21l/mZlzL2G1gG9aTkfEJgoHwDU1LpvqIxZ0eG8TuTKM8VWbCKcoYGj1q1btwehegJtPVIuSVEmnd8iQDhtbW3tamxs/CGbs7a8OOooDr68z1QMlQdUH0b7kxX1sxbDSmBQzqcoBpXIGJQjo/1ZSmVzqaivyvozqOB96f+Z78b0lLPFumwabFgDe3K+NpDz0kH8rXEvNrttWUvr6/DRuJ6O+CMyf0a2Ku+pqn390Xt/6QduBopPNFe2zFrJaI2dfmv2XZbsz2op5qL6v3m8oF8vqv9/R/oB+Q1RPf41U3yT0R+x/9Xlryn/BY268qsf3smdAAAAAElFTkSuQmCC";return a(A.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},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,e&&!this._renderLoopRunning&&T(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale=e,this._forceResize=!0}}}),A.prototype.showErrorPanel=function(e,t,r){function i(){u.style.maxHeight=Math.max(Math.round(.9*n.clientHeight-100),30)+"px"}var n=this._element,a=document.createElement("div");a.className="cesium-widget-errorPanel";var s=document.createElement("div");s.className="cesium-widget-errorPanel-content",a.appendChild(s);var l=document.createElement("div");l.className="cesium-widget-errorPanel-header",l.appendChild(document.createTextNode(e)),s.appendChild(l);var u=document.createElement("div");if(u.className="cesium-widget-errorPanel-scroll",s.appendChild(u),i(),o(window.addEventListener)&&window.addEventListener("resize",i,!1),o(t)){var c=document.createElement("div");c.className="cesium-widget-errorPanel-message",c.innerHTML="<p>"+t+"</p>",u.appendChild(c)}var h="(no error details available)";o(r)&&(h=d(r));var p=document.createElement("div");p.className="cesium-widget-errorPanel-message",p.appendChild(document.createTextNode(h)),u.appendChild(p);var f=document.createElement("div");f.className="cesium-widget-errorPanel-buttonPanel",s.appendChild(f);var m=document.createElement("button");m.setAttribute("type","button"),m.className="cesium-button",m.appendChild(document.createTextNode("OK")),m.onclick=function(){o(i)&&o(window.removeEventListener)&&window.removeEventListener("resize",i,!1),n.removeChild(a)},f.appendChild(m),n.appendChild(a),"undefined"!=typeof console&&console.error(e+"\n"+t+"\n"+h)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){this._scene=this._scene&&this._scene.destroy(),this._container.removeChild(this._element),s(this)},A.prototype.resize=function(){var e=this._canvas,t=e.clientWidth,r=e.clientHeight;(this._forceResize||this._canvasWidth!==t||this._canvasHeight!==r)&&(this._forceResize=!1,x(this),P(this))},A.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();var e=this._clock.tick();this._scene.render(e)}else this._clock.tick()},A}),define("Widgets/ClockViewModel",["../Core/Clock","../Core/defined","../Core/defineProperties","../Core/destroyObject","../Core/EventHelper","../Core/JulianDate","../ThirdParty/knockout"],function(e,t,r,i,n,o,a){"use strict";function s(r){t(r)||(r=new e),this._clock=r,this._eventHelper=new n,this._eventHelper.add(r.onTick,this.synchronize,this),this.systemTime=a.observable(o.now()),this.systemTime.equalityComparer=o.equals,this.startTime=a.observable(r.startTime),this.startTime.equalityComparer=o.equals,this.startTime.subscribe(function(e){r.startTime=e,this.synchronize()},this),this.stopTime=a.observable(r.stopTime),this.stopTime.equalityComparer=o.equals,this.stopTime.subscribe(function(e){r.stopTime=e,this.synchronize()},this),this.currentTime=a.observable(r.currentTime),this.currentTime.equalityComparer=o.equals,this.currentTime.subscribe(function(e){r.currentTime=e,this.synchronize()},this),this.multiplier=a.observable(r.multiplier),this.multiplier.subscribe(function(e){r.multiplier=e,this.synchronize()},this),this.clockStep=a.observable(r.clockStep),this.clockStep.subscribe(function(e){r.clockStep=e,this.synchronize()},this),this.clockRange=a.observable(r.clockRange),this.clockRange.subscribe(function(e){r.clockRange=e,this.synchronize()},this),this.canAnimate=a.observable(r.canAnimate),this.canAnimate.subscribe(function(e){r.canAnimate=e,this.synchronize()},this),this.shouldAnimate=a.observable(r.shouldAnimate),this.shouldAnimate.subscribe(function(e){r.shouldAnimate=e,this.synchronize()},this),a.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}return r(s.prototype,{clock:{get:function(){return this._clock}}}),s.prototype.synchronize=function(){var e=this._clock;this.systemTime=o.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},s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){this._eventHelper.removeAll(),i(this)},s}),define("Widgets/Command",["../Core/DeveloperError"],function(e){"use strict";function t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,e.throwInstantiationError()}return t}),define("Widgets/FullscreenButton/FullscreenButtonViewModel",["../../Core/defaultValue","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Fullscreen","../../ThirdParty/knockout","../createCommand","../getElement"],function(e,t,r,i,n,o,a,s){"use strict";function l(t){var r=this,i=o.observable(n.fullscreen),l=o.observable(n.enabled);this.isFullscreen=void 0,o.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,o.defineProperty(this,"isFullscreenEnabled",{get:function(){return l()},set:function(e){l(e&&n.enabled)}}),this.tooltip=void 0,o.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=a(function(){n.fullscreen?n.exitFullscreen():n.requestFullscreen(r._fullscreenElement)},o.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=e(s(t),document.body),this._callback=function(){i(n.fullscreen)},document.addEventListener(n.changeEventName,this._callback)}return t(l.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){document.removeEventListener(n.changeEventName,this._callback),r(this)},l}),define("Widgets/FullscreenButton/FullscreenButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./FullscreenButtonViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){e=o(e);var r=new a(t);r._exitFullScreenPath=u,r._enterFullScreenPath=l;var i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),n.applyBindings(r,i),this._container=e,this._viewModel=r,this._element=i}var l="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",u="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"; +return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),r(this)},s}),define("Widgets/Geocoder/GeocoderViewModel",["../../Core/BingMapsGeocoderService","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/CartographicGeocoderService","../../Core/Matrix4","../../ThirdParty/knockout","../../ThirdParty/when","../createCommand","../getElement"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(i){r(i.geocoderServices)?this._geocoderServices=i.geocoderServices:this._geocoderServices=[new a,new e({scene:i.scene})],this._viewContainer=i.container,this._scene=i.scene,this._flightDuration=i.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._geocodePromise=void 0,this._complete=new o,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._updateCamera=m,this._adjustSuggestionsScroll=_,this._updateSearchSuggestions=w,this._handleArrowDown=f,this._handleArrowUp=p;var n=this;this._suggestionsVisible=l.pureComputed(function(){var e=l.getObservable(n,"_suggestions"),t=e().length>0,r=l.getObservable(n,"_showSuggestions")();return t&&r}),this._searchCommand=c(function(){return n.hideSuggestions(),n._focusTextbox=!1,r(n._selectedSuggestion)?(n.activateSuggestion(n._selectedSuggestion),!1):void(n.isSearchInProgress?y(n):v(n,n._geocoderServices))}),this.deselectSuggestion=function(){n._selectedSuggestion=void 0},this.handleKeyDown=function(e,t){var r="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,i="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode;return(r||i)&&t.preventDefault(),!0},this.handleKeyUp=function(e,t){var r="ArrowDown"===t.key||"Down"===t.key||40===t.keyCode,i="ArrowUp"===t.key||"Up"===t.key||38===t.keyCode,o="Enter"===t.key||13===t.keyCode;return i?p(n):r?f(n):o&&n._searchCommand(),!0},this.activateSuggestion=function(e){n.hideSuggestions(),n._searchText=e.displayName;var t=e.destination;C(n),m(n,t)},this.hideSuggestions=function(){n._showSuggestions=!1,n._selectedSuggestion=void 0},this.showSuggestions=function(){n._showSuggestions=!0},this.handleMouseover=function(e,t){e!==n._selectedSuggestion&&(n._selectedSuggestion=e)},this.keepExpanded=!1,this.autoComplete=t(i.autocomplete,!0),this._focusTextbox=!1,l.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);var s=l.getObservable(this,"_searchText");s.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=s.subscribe(function(){w(n)}),this.isSearchInProgress=void 0,l.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,l.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(e){this._searchText=e}}),this.flightDuration=void 0,l.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(e){this._flightDuration=e}})}function p(e){if(0!==e._suggestions.length){var t,r=e._suggestions.indexOf(e._selectedSuggestion);if(r===-1||0===r)return void(e._selectedSuggestion=void 0);t=r-1,e._selectedSuggestion=e._suggestions[t],_(e,t)}}function f(e){if(0!==e._suggestions.length){var t=e._suggestions.length,r=e._suggestions.indexOf(e._selectedSuggestion),i=(r+1)%t;e._selectedSuggestion=e._suggestions[i],_(e,i)}}function m(e,t){e._scene.camera.flyTo({destination:t,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:s.IDENTITY})}function g(e,t,i){return e.then(function(e){if(r(e)&&"fulfilled"===e.state&&e.value.length>0)return e;var n=t.geocode(i).then(function(e){return{state:"fulfilled",value:e}}).otherwise(function(e){return{state:"rejected",reason:e}});return n})}function v(e,t){var i=e._searchText;if(b(i))return void e.showSuggestions();e._isSearchInProgress=!0;for(var n=u.resolve(),o=0;o<t.length;o++)n=g(n,t[o],i);e._geocodePromise=n,n.then(function(t){if(!n.cancel){e._isSearchInProgress=!1;var o=t.value;return"fulfilled"===t.state&&r(o)&&o.length>0?(e._searchText=o[0].displayName,void m(e,o[0].destination)):void(e._searchText=i+" (not found)")}})}function _(e,t){var r=d(e._viewContainer),i=r.getElementsByClassName("search-results")[0],n=r.getElementsByTagName("li"),o=n[t];if(0===t)return void(i.scrollTop=0);var a=o.offsetTop;a+o.clientHeight>i.clientHeight?i.scrollTop=a+o.clientHeight:a<i.scrollTop&&(i.scrollTop=a)}function y(e){e._isSearchInProgress=!1,r(e._geocodePromise)&&(e._geocodePromise.cancel=!0,e._geocodePromise=void 0)}function b(e){return/^\s*$/.test(e)}function C(e){l.getObservable(e,"_suggestions").removeAll()}function w(e){if(e.autoComplete){var t=e._searchText;if(C(e),!b(t)){var r=u.resolve([]);e._geocoderServices.forEach(function(e){r=r.then(function(r){return r.length>=5?r:e.geocode(t).then(function(e){return r=r.concat(e)})})}),r.then(function(t){for(var r=e._suggestions,i=0;i<t.length;i++)r.push(t[i])})}}}return i(h.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}}}),h.prototype.destroy=function(){this._suggestionSubscription.dispose()},h}),define("Widgets/Geocoder/Geocoder",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./GeocoderViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(e){var t=a(e.container),r=new s(e);r._startSearchPath=u,r._stopSearchPath=c;var i=document.createElement("form");i.setAttribute("data-bind","submit: search");var l=document.createElement("input");l.type="search",l.className="cesium-geocoder-input",l.setAttribute("placeholder","Enter an address or landmark..."),l.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(){l.select()},0)},l.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(l),this._textBox=l;var d=document.createElement("span");d.className="cesium-geocoder-searchButton",d.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(d),t.appendChild(i);var h=document.createElement("div");h.className="search-results",h.setAttribute("data-bind","visible: _suggestionsVisible");var p=document.createElement("ul");p.setAttribute("data-bind","foreach: _suggestions");var f=document.createElement("li");p.appendChild(f),f.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),h.appendChild(p),t.appendChild(h),o.applyBindings(r,i),o.applyBindings(r,h),this._container=t,this._searchSuggestionsContainer=h,this._viewModel=r,this._form=i,this._onInputBegin=function(e){t.contains(e.target)||(r._focusTextbox=!1,r.hideSuggestions())},this._onInputEnd=function(e){t.contains(e.target)&&(r._focusTextbox=!0,r.showSuggestions())},n.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),document.addEventListener("pointerup",this._onInputEnd,!0),document.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),document.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),document.addEventListener("touchend",this._onInputEnd,!0),document.addEventListener("touchcancel",this._onInputEnd,!0))}var u="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",c="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";return t(l.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return n.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),document.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),document.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),document.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),o.cleanNode(this._form),o.cleanNode(this._searchSuggestionsContainer),this._container.removeChild(this._form),this._container.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),r(this)},l}),define("Widgets/HomeButton/HomeButtonViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n){"use strict";function o(e,t){this._scene=e,this._duration=t;var r=this;this._command=n(function(){r._scene.camera.flyHome(r._duration)}),this.tooltip="View Home",i.track(this,["tooltip"])}return t(o.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}}}),o}),define("Widgets/HomeButton/HomeButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./HomeButtonViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){e=o(e);var i=new a(t,r);i._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 s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-home-button",s.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(s),n.applyBindings(i,s),this._container=e,this._viewModel=i,this._element=s}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return n.cleanNode(this._element),this._container.removeChild(this._element),r(this)},s}),define("Widgets/InfoBox/InfoBoxViewModel",["../../Core/defined","../../Core/defineProperties","../../Core/Event","../../ThirdParty/knockout"],function(e,t,r,i){"use strict";function n(){this._cameraClicked=new r,this._closeClicked=new r,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",i.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,i.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?a:o}}),i.defineProperty(this,"_bodyless",{get:function(){return!e(this.description)||0===this.description.length}})}var o="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",a="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";return n.prototype.maxHeightOffset=function(e){return this.maxHeight-e+"px"},t(n.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}}),n}),define("Widgets/InfoBox/InfoBox",["../../Core/buildModuleUrl","../../Core/Color","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","../subscribeAndEvaluate","./InfoBoxViewModel"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(i){i=s(i);var n=document.createElement("div");n.className="cesium-infoBox",n.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),i.appendChild(n);var o=document.createElement("div");o.className="cesium-infoBox-title",o.setAttribute("data-bind","text: titleText"),n.appendChild(o);var c=document.createElement("button");c.type="button",c.className="cesium-button cesium-infoBox-camera",c.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),n.appendChild(c);var d=document.createElement("button");d.type="button",d.className="cesium-infoBox-close",d.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),d.innerHTML="×",n.appendChild(d);var h=document.createElement("iframe");h.className="cesium-infoBox-iframe",h.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),h.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),h.setAttribute("allowfullscreen",!0),n.appendChild(h);var p=new u;a.applyBindings(p,n),this._container=i,this._element=n,this._frame=h,this._viewModel=p,this._descriptionSubscription=void 0;var f=this;h.addEventListener("load",function(){var i=h.contentDocument,o=i.createElement("link");o.href=e("Widgets/InfoBox/InfoBoxDescription.css"),o.rel="stylesheet",o.type="text/css";var a=i.createElement("div");a.className="cesium-infoBox-description",i.head.appendChild(o),i.body.appendChild(a),f._descriptionSubscription=l(p,"description",function(e){h.style.height="5px",a.innerHTML=e;var i=null,o=a.firstElementChild;if(null!==o&&1===a.childNodes.length){var s=window.getComputedStyle(o);if(null!==s){var l=s["background-color"],u=t.fromCssColorString(l);r(u)&&0!==u.alpha&&(i=s["background-color"])}}n.style["background-color"]=i;var c=a.getBoundingClientRect().height;h.style.height=c+"px"})}),h.setAttribute("src","about:blank")}return i(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){var e=this._container;return a.cleanNode(this._element),e.removeChild(this._element),r(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),n(this)},c}),define("Widgets/NavigationHelpButton/NavigationHelpButtonViewModel",["../../Core/defineProperties","../../ThirdParty/knockout","../createCommand"],function(e,t,r){"use strict";function i(){this.showInstructions=!1;var e=this;this._command=r(function(){e.showInstructions=!e.showInstructions}),this._showClick=r(function(){e._touch=!1}),this._showTouch=r(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",t.track(this,["tooltip","showInstructions","_touch"])}return e(i.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}}),i}),define("Widgets/NavigationHelpButton/NavigationHelpButton",["../../Core/buildModuleUrl","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./NavigationHelpButtonViewModel"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(r){var i=l(r.container),n=new u,o=t(r.instructionsInitiallyVisible,!1);n.showInstructions=o,n._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 c=document.createElement("span");c.className="cesium-navigationHelpButton-wrapper",i.appendChild(c);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",d.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),c.appendChild(d);var h=document.createElement("div");h.className="cesium-navigation-help",h.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),c.appendChild(h);var p=document.createElement("button");p.type="button",p.className="cesium-navigation-button cesium-navigation-button-left",p.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');var f=document.createElement("img");f.src=e("Widgets/Images/NavigationHelp/Mouse.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",p.appendChild(f),p.appendChild(document.createTextNode("Mouse"));var m=document.createElement("button");m.type="button",m.className="cesium-navigation-button cesium-navigation-button-right",m.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');var g=document.createElement("img");g.src=e("Widgets/Images/NavigationHelp/Touch.svg"),g.className="cesium-navigation-button-icon",g.style.width="25px",g.style.height="25px",m.appendChild(g),m.appendChild(document.createTextNode("Touch")),h.appendChild(p),h.appendChild(m);var v=document.createElement("div");v.className="cesium-click-navigation-help cesium-navigation-help-instructions",v.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),v.innerHTML=' <table> <tr> <td><img src="'+e("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="'+e("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="'+e("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>',h.appendChild(v);var _=document.createElement("div");_.className="cesium-touch-navigation-help cesium-navigation-help-instructions",_.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),_.innerHTML=' <table> <tr> <td><img src="'+e("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="'+e("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="'+e("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="'+e("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>',h.appendChild(_),s.applyBindings(n,c),this._container=i,this._viewModel=n,this._wrapper=c,this._closeInstructions=function(e){c.contains(e.target)||(n.showInstructions=!1)},a.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}return i(c.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),c.prototype.isDestroyed=function(){return!1},c.prototype.destroy=function(){return a.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),s.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),n(this)},c}),define("Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Scene/FrameRateMonitor","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s){"use strict";function l(t){this._scene=t.scene,this.lowFrameRateMessage=e(t.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,a.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);var r=this;this._dismissMessage=s(function(){r.showingLowFrameRateMessage=!1,r.lowFrameRateMessageDismissed=!0});var i=o.fromScene(t.scene);this._unsubscribeLowFrameRate=i.lowFrameRate.addEventListener(function(){r.lowFrameRateMessageDismissed||(r.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=i.nominalFrameRate.addEventListener(function(){r.showingLowFrameRateMessage=!1})}return r(l.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}}),l.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),i(this)},l}),define("Widgets/PerformanceWatchdog/PerformanceWatchdog",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./PerformanceWatchdogViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e){var t=o(e.container),r=new a(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");var s=document.createElement("button");s.setAttribute("type","button"),s.className="cesium-performance-watchdog-message-dismiss",s.innerHTML="×",s.setAttribute("data-bind","click: dismissMessage"),i.appendChild(s);var l=document.createElement("div");l.className="cesium-performance-watchdog-message",l.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(l),t.appendChild(i),n.applyBindings(r,i),this._container=t,this._viewModel=r,this._element=i}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),r(this)},s}),define("Widgets/ProjectionPicker/ProjectionPickerViewModel",["../../Core/Cartesian2","../../Core/Cartesian3","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Math","../../Core/Matrix4","../../Core/Ray","../../Scene/OrthographicFrustum","../../Scene/PerspectiveFrustum","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m){"use strict";function g(e){this._scene=e,this._orthographic=e.camera.frustum instanceof d,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,f.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);var t=this;f.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=m(function(){t.sceneMode===p.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new s,this._eventHelper.add(e.morphComplete,function(e,r,i,n){t.sceneMode=i,t._orthographic=i===p.SCENE2D||t._scene.camera.frustum instanceof d}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=i(e.camera._currentFlight)}),this._switchToPerspective=m(function(){t.sceneMode!==p.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=m(function(){t.sceneMode!==p.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=p}return n(g.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}}}),g.prototype.isDestroyed=function(){return!1},g.prototype.destroy=function(){this._eventHelper.removeAll(),o(this)},g}),define("Widgets/ProjectionPicker/ProjectionPicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./ProjectionPickerViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e=a(e);var r=new s(t);r._perspectivePath=u,r._orthographicPath=c;var i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);var l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button",l.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'),l.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(l);var d=document.createElement("button");d.type="button",d.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",d.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 }'),i.appendChild(d);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",h.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 }'),i.appendChild(h),o.applyBindings(r,i),this._viewModel=r,this._container=e,this._wrapper=i,this._closeDropDown=function(e){i.contains(e.target)||(r.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}var u="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",c="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";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){ +return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),r(this)},l}),define("Widgets/SceneModePicker/SceneModePickerViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Scene/SceneMode","../../ThirdParty/knockout","../createCommand"],function(e,t,r,i,n,o,a,s,l){"use strict";function u(t,r){this._scene=t;var i=this,n=function(e,t,r,n){i.sceneMode=r,i.dropDownVisible=!1};this._eventHelper=new o,this._eventHelper.add(t.morphStart,n),this._duration=e(r,2),this.sceneMode=t.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",s.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,s.defineProperty(this,"selectedTooltip",function(){var e=i.sceneMode;return e===a.SCENE2D?i.tooltip2D:e===a.SCENE3D?i.tooltip3D:i.tooltipColumbusView}),this._toggleDropDown=l(function(){i.dropDownVisible=!i.dropDownVisible}),this._morphTo2D=l(function(){t.morphTo2D(i._duration)}),this._morphTo3D=l(function(){t.morphTo3D(i._duration)}),this._morphToColumbusView=l(function(){t.morphToColumbusView(i._duration)}),this._sceneMode=a}return r(u.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}}}),u.prototype.isDestroyed=function(){return!1},u.prototype.destroy=function(){this._eventHelper.removeAll(),i(this)},u}),define("Widgets/SceneModePicker/SceneModePicker",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/FeatureDetection","../../ThirdParty/knockout","../getElement","./SceneModePickerViewModel"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t,r){e=a(e);var i=new s(t,r);i._globePath=u,i._flatMapPath=c,i._columbusViewPath=d;var l=document.createElement("span");l.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(l);var h=document.createElement("button");h.type="button",h.className="cesium-button cesium-toolbar-button",h.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'),h.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',l.appendChild(h);var p=document.createElement("button");p.type="button",p.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",p.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 }'),l.appendChild(p);var f=document.createElement("button");f.type="button",f.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",f.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 }'),l.appendChild(f);var m=document.createElement("button");m.type="button",m.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",m.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 }'),l.appendChild(m),o.applyBindings(i,l),this._viewModel=i,this._container=e,this._wrapper=l,this._closeDropDown=function(e){l.contains(e.target)||(i.dropDownVisible=!1)},n.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}var u="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",c="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",d="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";return t(l.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){return this._viewModel.destroy(),n.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),o.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),r(this)},l}),define("Widgets/SelectionIndicator/SelectionIndicatorViewModel",["../../Core/Cartesian2","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/EasingFunction","../../Scene/SceneTransforms","../../ThirdParty/knockout"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,i,n){this._scene=e,this._screenPositionX=c,this._screenPositionY=c,this._tweens=e.tweens,this._container=t(n,document.body),this._selectionIndicatorElement=i,this._scale=1,this.position=void 0,this.showSelection=!1,s.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,s.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&r(this.position)}}),s.defineProperty(this,"_transform",{get:function(){return"scale("+this._scale+")"}}),this.computeScreenSpacePosition=function(t,r){return a.wgs84ToWindowCoordinates(e,t,r)}}var u=new e,c="-1000px";return l.prototype.update=function(){if(this.showSelection&&r(this.position)){var e=this.computeScreenSpacePosition(this.position,u);if(r(e)){var t=this._container,i=t.parentNode.clientWidth,n=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,a=.5*o;e.x=Math.min(Math.max(e.x,-o),i+o)-a,e.y=Math.min(Math.max(e.y,-o),n+o)-a,this._screenPositionX=Math.floor(e.x+.25)+"px",this._screenPositionY=Math.floor(e.y+.25)+"px"}else this._screenPositionX=c,this._screenPositionY=c}},l.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},l.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:o.EXPONENTIAL_OUT})},i(l.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}}),l}),define("Widgets/SelectionIndicator/SelectionIndicator",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./SelectionIndicatorViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t){e=o(e),this._container=e;var r=document.createElement("div");r.className="cesium-selection-wrapper",r.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(r),this._element=r;var i="http://www.w3.org/2000/svg",s="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",l=document.createElementNS(i,"svg:svg");l.setAttribute("width",160),l.setAttribute("height",160),l.setAttribute("viewBox","0 0 160 160");var u=document.createElementNS(i,"g");u.setAttribute("transform","translate(80,80)"),l.appendChild(u);var c=document.createElementNS(i,"path");c.setAttribute("data-bind","attr: { transform: _transform }"),c.setAttribute("d",s),u.appendChild(c),r.appendChild(l);var d=new a(t,this._element,this._container);this._viewModel=d,n.applyBindings(this._viewModel,this._element)}return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){var e=this._container;return n.cleanNode(this._element),e.removeChild(this._element),r(this)},s}),define("Widgets/Timeline/TimelineHighlightRange",["../../Core/defaultValue","../../Core/JulianDate"],function(e,t){"use strict";function r(t,r,i){this._color=t,this._height=r,this._base=e(i,0)}return r.prototype.getHeight=function(){return this._height},r.prototype.getBase=function(){return this._base},r.prototype.getStartTime=function(){return this._start},r.prototype.getStopTime=function(){return this._stop},r.prototype.setRange=function(e,t){this._start=e,this._stop=t},r.prototype.render=function(e){var r="";if(this._start&&this._stop&&this._color){var i=t.secondsDifference(this._start,e.epochJulian),n=Math.round(e.timeBarWidth*e.getAlpha(i)),o=t.secondsDifference(this._stop,e.epochJulian),a=Math.round(e.timeBarWidth*e.getAlpha(o))-n;n<0&&(a+=n,n=0),n+a>e.timeBarWidth&&(a=e.timeBarWidth-n),a>0&&(r='<span class="cesium-timeline-highlight" style="left: '+n.toString()+"px; width: "+a.toString()+"px; bottom: "+this._base.toString()+"px; height: "+this._height+"px; background-color: "+this._color+';"></span>')}return r},r}),define("Widgets/Timeline/TimelineTrack",["../../Core/Color","../../Core/defined","../../Core/JulianDate"],function(e,t,r){"use strict";function i(t,r,i,n){this.interval=t,this.height=r,this.color=i||new e(.5,.5,.5,1),this.backgroundColor=n||new e(0,0,0,0)}return i.prototype.render=function(e,i){var n=this.interval.start,o=this.interval.stop,a=i.startJulian,s=r.addSeconds(i.startJulian,i.duration,new r);if(r.lessThan(n,a)&&r.greaterThan(o,s))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,i.y,i.timeBarWidth,this.height);else if(r.lessThanOrEquals(n,s)&&r.greaterThanOrEquals(o,a)){var l,u,c;for(l=0;l<i.timeBarWidth;++l){var d=r.addSeconds(i.startJulian,l/i.timeBarWidth*i.duration,new r);!t(u)&&r.greaterThanOrEquals(d,n)?u=l:!t(c)&&r.greaterThanOrEquals(d,o)&&(c=l)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,i.y,i.timeBarWidth,this.height),t(u)&&(t(c)||(c=i.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(u,i.y,Math.max(c-u,1),this.height))}},i}),define("Widgets/Timeline/Timeline",["../../Core/ClockRange","../../Core/defined","../../Core/destroyObject","../../Core/DeveloperError","../../Core/JulianDate","../getElement","./TimelineHighlightRange","./TimelineTrack"],function(e,t,r,i,n,o,a,s){"use strict";function l(e,t){e=o(e),this.container=e;var r=document.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=_.none,this._touchMode=y.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=c(this),this._onMouseUp=d(this),this._onMouseMove=h(this),this._onMouseWheel=p(this),this._onTouchStart=f(this),this._onTouchMove=g(this),this._onTouchEnd=m(this);var i=this._timeBarEle;document.addEventListener("mouseup",this._onMouseUp,!1),document.addEventListener("mousemove",this._onMouseMove,!1),i.addEventListener("mousedown",this._onMouseDown,!1),i.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),i.addEventListener("mousewheel",this._onMouseWheel,!1),i.addEventListener("touchstart",this._onTouchStart,!1),i.addEventListener("touchmove",this._onTouchMove,!1),i.addEventListener("touchend",this._onTouchEnd,!1),i.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}function u(e){return e<10?"0"+e.toString():e.toString()}function c(e){return function(t){e._mouseMode!==_.touchOnly&&(0===t.button?(e._mouseMode=_.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,2===t.button?e._mouseMode=_.zoom:e._mouseMode=_.slide)),t.preventDefault()}}function d(e){return function(t){e._mouseMode=_.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function h(e){return function(t){var r;if(e._mouseMode===_.scrub){t.preventDefault();var i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===_.slide){if(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r){var o=r*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(n.addSeconds(e._startJulian,o,new n),n.addSeconds(e._endJulian,o,new n))}}else e._mouseMode===_.zoom&&(r=e._mouseX-t.clientX,e._mouseX=t.clientX,0!==r&&e.zoomFrom(Math.pow(1.01,r)))}}function p(e){return function(t){var r=t.wheelDeltaY||t.wheelDelta||-t.detail;v=Math.max(Math.min(Math.abs(r),v),1),r/=v,e.zoomFrom(Math.pow(1.05,-r))}}function f(e){return function(t){var r,i,o=t.touches.length,a=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=_.touchOnly,1===o?(r=n.secondsDifference(e._scrubJulian,e._startJulian),i=Math.round(r*e._topDiv.clientWidth/e._timeBarSecondsSpan+a),Math.abs(t.touches[0].clientX-i)<50?(e._touchMode=y.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=1===o?"-16px 0":"0 0")):(e._touchMode=y.singleTap,e._touchState.centerX=t.touches[0].clientX-a)):2===o?(e._touchMode=y.slideZoom,e._touchState.centerX=.5*(t.touches[0].clientX+t.touches[1].clientX)-a,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=y.ignore}}function m(e){return function(t){var r=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap?(e._touchMode=y.scrub,e._onTouchMove(t)):e._touchMode===y.scrub&&e._onTouchMove(t),e._mouseMode=_.touchOnly,1!==r?e._touchMode=r>0?y.ignore:y.none:e._touchMode===y.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function g(e){return function(r){var i,o,a,s,l,u,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===y.singleTap&&(e._touchMode=y.slideZoom),e._mouseMode=_.touchOnly,e._touchMode===y.scrub?(r.preventDefault(),1===r.changedTouches.length&&(o=r.changedTouches[0].clientX-d,o>=0&&o<=e._topDiv.clientWidth&&e._setTimeBarTime(o,o*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===y.slideZoom&&(a=r.touches.length,2===a?(s=.5*(r.touches[0].clientX+r.touches[1].clientX)-d,l=Math.abs(r.touches[0].clientX-r.touches[1].clientX)):1===a&&(s=r.touches[0].clientX-d,l=0),t(s)&&(l>0&&e._touchState.spanX>0?(c=e._touchState.spanX/l,u=n.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-s*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new n)):(i=e._touchState.centerX-s,u=n.addSeconds(e._startJulian,i*e._timeBarSecondsSpan/e._topDiv.clientWidth,new n)),e.zoomTo(u,n.addSeconds(u,e._timeBarSecondsSpan*c,new n)),e._touchState.centerX=s,e._touchState.spanX=l))}}var v=1e12,_={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},y={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},b=[.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],C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];return l.prototype.addEventListener=function(e,t,r){this._topDiv.addEventListener(e,t,r)},l.prototype.removeEventListener=function(e,t,r){this._topDiv.removeEventListener(e,t,r)},l.prototype.isDestroyed=function(){return!1},l.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this),document.removeEventListener("mouseup",this._onMouseUp,!1),document.removeEventListener("mousemove",this._onMouseMove,!1);var e=this._timeBarEle;e.removeEventListener("mousedown",this._onMouseDown,!1),e.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),e.removeEventListener("mousewheel",this._onMouseWheel,!1),e.removeEventListener("touchstart",this._onTouchStart,!1),e.removeEventListener("touchmove",this._onTouchMove,!1),e.removeEventListener("touchend",this._onTouchEnd,!1),e.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),r(this)},l.prototype.addHighlightRange=function(e,t,r){var i=new a(e,t,r);return this._highlightRanges.push(i),this.resize(),i},l.prototype.addTrack=function(e,t,r,i){var n=new s(e,t,r,i);return this._trackList.push(n),this._lastHeight=void 0,this.resize(),n},l.prototype.zoomTo=function(t,r){if(this._startJulian=t,this._endJulian=r,this._timeBarSecondsSpan=n.secondsDifference(r,t),this._clock&&this._clock.clockRange!==e.UNBOUNDED){var i=this._clock.startTime,o=this._clock.stopTime,a=n.secondsDifference(o,i),s=n.secondsDifference(i,this._startJulian),l=n.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=a?(this._timeBarSecondsSpan=a,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=n.addSeconds(this._endJulian,s,new n),this._startJulian=i,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian)):l<0&&(this._startJulian=n.addSeconds(this._startJulian,l,new n),this._endJulian=o,this._timeBarSecondsSpan=n.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();var u=document.createEvent("Event");u.initEvent("setzoom",!0,!0),u.startJulian=this._startJulian,u.endJulian=this._endJulian,u.epochJulian=this._epochJulian,u.totalSpan=this._timeBarSecondsSpan,u.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(u)},l.prototype.zoomFrom=function(e){var t=n.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=.5*this._timeBarSecondsSpan:t+=t-.5*this._timeBarSecondsSpan;var r=this._timeBarSecondsSpan-t;this.zoomTo(n.addSeconds(this._startJulian,t-t*e,new n),n.addSeconds(this._endJulian,r*e-r,new n))},l.prototype.makeLabel=function(e){var t=n.toGregorianDate(e),r=t.millisecond,i=" UTC";if(r>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(r).toString();i.length<3;)i="0"+i;i="."+i}return C[t.month-1]+" "+t.day+" "+t.year+" "+u(t.hour)+":"+u(t.minute)+":"+u(t.second)+i},l.prototype.smallestTicInPixels=7,l.prototype._makeTics=function(){function e(e){return Math.floor(S/e)*e}function t(e,t){return Math.ceil(e/t+.5)*t}function r(e){return(e-S)/g}function i(e,t){return e-t*Math.round(e/t)}var o,a=this._timeBarEle,s=n.secondsDifference(this._scrubJulian,this._startJulian),l=Math.round(s*this._topDiv.clientWidth/this._timeBarSecondsSpan),u=l-8,c=this;this._needleEle.style.left=l.toString()+"px";var d="",h=.01,p=31536e6,f=1e-10,m=0,g=this._timeBarSecondsSpan;g<h?(g=h,this._timeBarSecondsSpan=h,this._endJulian=n.addSeconds(this._startJulian,h,new n)):g>p&&(g=p,this._timeBarSecondsSpan=p,this._endJulian=n.addSeconds(this._startJulian,p,new n));var v=this._timeBarEle.clientWidth;v<10&&(v=10);var _,y=this._startJulian,C=Math.min(g/v*1e-5,.4),w=n.toGregorianDate(y);_=g>31536e4?n.fromDate(new Date(Date.UTC(100*Math.floor(w.year/100),0))):g>31536e3?n.fromDate(new Date(Date.UTC(10*Math.floor(w.year/10),0))):g>86400?n.fromDate(new Date(Date.UTC(w.year,0))):n.fromDate(new Date(Date.UTC(w.year,w.month,w.day)));var S=n.secondsDifference(this._startJulian,n.addSeconds(_,C,new n)),E=S+g;this._epochJulian=_,this._rulerEle.innerHTML=this.makeLabel(n.addSeconds(this._endJulian,-h,new n));var T=this._rulerEle.offsetWidth+20;T<30&&(T=180);var x=m;m-=f;var P={startTime:S,startJulian:y,epochJulian:_,duration:g,timeBarWidth:v,getAlpha:r};this._highlightRanges.forEach(function(e){d+=e.render(P)});var A=0,D=0,I=0,M=T/v;M>1&&(M=1),M*=this._timeBarSecondsSpan;var O,R=-1,N=-1,k=b.length;for(O=0;O<k;++O){var L=b[O];if(++R,A=L,L>M&&L>m)break;N<0&&v*(L/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=R)}if(R>0){for(;R>0;)if(--R,Math.abs(i(A,b[R]))<1e-5){b[R]>=m&&(D=b[R]);break}if(N>=0)for(;N<R;){if(Math.abs(i(D,b[N]))<1e-5&&b[N]>=m){I=b[N];break}++N}}m=x,m>f&&I<1e-5&&Math.abs(m-A)>f&&(I=m,m<=A+f&&(D=0));var F,B=-999999;if(v*(I/this._timeBarSecondsSpan)>=3)for(o=e(I);o<=E;o=t(o,I))d+='<span class="cesium-timeline-ticTiny" style="left: '+Math.round(v*r(o)).toString()+'px;"></span>';if(v*(D/this._timeBarSecondsSpan)>=3)for(o=e(D);o<=E;o=t(o,D))d+='<span class="cesium-timeline-ticSub" style="left: '+Math.round(v*r(o)).toString()+'px;"></span>';if(v*(A/this._timeBarSecondsSpan)>=2){this._mainTicSpan=A,E+=A,o=e(A);for(var U=n.computeTaiMinusUtc(_);o<=E;){var V=n.addSeconds(y,o-S,new n);if(A>2.1){var z=n.computeTaiMinusUtc(V);Math.abs(z-U)>.1&&(o+=z-U,V=n.addSeconds(y,o-S,new n))}var G=Math.round(v*r(o)),H=this.makeLabel(V);this._rulerEle.innerHTML=H,F=this._rulerEle.offsetWidth,F<10&&(F=T);var W=G-(F/2-1);W>B?(B=W+F+5,d+='<span class="cesium-timeline-ticMain" style="left: '+G.toString()+'px;"></span><span class="cesium-timeline-ticLabel" style="left: '+W.toString()+'px;">'+H+"</span>"):d+='<span class="cesium-timeline-ticSub" style="left: '+G.toString()+'px;"></span>',o=t(o,A)}}else this._mainTicSpan=-1;d+='<span class="cesium-timeline-icon16" style="left:'+u+'px;bottom:0;background-position: 0 0;"></span>',a.innerHTML=d,this._scrubElement=a.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),P.y=0,this._trackList.forEach(function(e){e.render(c._context,P),P.y+=e.height})},l.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;var e=this._scrubElement;if(t(this._scrubElement)){ +var r=n.secondsDifference(this._scrubJulian,this._startJulian),i=Math.round(r*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==i&&(this._lastXPos=i,e.style.left=i-8+"px",this._needleEle.style.left=i+"px")}t(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(n.addSeconds(this._startJulian,this._timelineDrag,new n),n.addSeconds(this._endJulian,this._timelineDrag,new n)))},l.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=n.addSeconds(this._startJulian,t,new n),this._scrubElement){var r=e-8;this._scrubElement.style.left=r.toString()+"px",this._needleEle.style.left=e.toString()+"px"}var i=document.createEvent("Event");i.initEvent("settime",!0,!0),i.clientX=e,i.timeSeconds=t,i.timeJulian=this._scrubJulian,i.clock=this._clock,this._topDiv.dispatchEvent(i)},l.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 r=1;this._trackList.forEach(function(e){r+=e.height}),this._trackListEle.style.height=r.toString()+"px",this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=r,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t}},l}),define("Widgets/VRButton/VRButtonViewModel",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../Core/EventHelper","../../Core/Fullscreen","../../Scene/OrthographicFrustum","../../ThirdParty/knockout","../../ThirdParty/NoSleep","../createCommand","../getElement"],function(e,t,r,i,n,o,a,s,l,u,c,d){"use strict";function h(e){var r=!1,i=window.screen;return t(i)&&(t(i.lockOrientation)?r=i.lockOrientation(e):t(i.mozLockOrientation)?r=i.mozLockOrientation(e):t(i.msLockOrientation)?r=i.msLockOrientation(e):t(i.orientation&&i.orientation.lock)&&(r=i.orientation.lock(e))),r}function p(){var e=window.screen;t(e)&&(t(e.unlockOrientation)?e.unlockOrientation():t(e.mozUnlockOrientation)?e.mozUnlockOrientation():t(e.msUnlockOrientation)?e.msUnlockOrientation():t(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function f(e,t,r,i){i()||(r()?(t.useWebVR=!1,e._locked&&(p(),e._locked=!1),e._noSleep.disable(),a.exitFullscreen(),r(!1)):(a.fullscreen||a.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=h("landscape")),t.useWebVR=!0,r(!0)))}function m(t,r){var i=this,n=l.observable(a.enabled),h=l.observable(!1);this.isVRMode=void 0,l.defineProperty(this,"isVRMode",{get:function(){return h()}}),this.isVREnabled=void 0,l.defineProperty(this,"isVREnabled",{get:function(){return n()},set:function(e){n(e&&a.enabled)}}),this.tooltip=void 0,l.defineProperty(this,"tooltip",function(){return n()?h()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});var m=l.observable(!1);this._isOrthographic=void 0,l.defineProperty(this,"_isOrthographic",{get:function(){return m()}}),this._eventHelper=new o,this._eventHelper.add(t.preRender,function(){m(t.camera.frustum instanceof s)}),this._locked=!1,this._noSleep=new u,this._command=c(function(){f(i,t,h,m)},l.getObservable(this,"isVREnabled")),this._vrElement=e(d(r),document.body),this._callback=function(){!a.fullscreen&&h()&&(t.useWebVR=!1,i._locked&&(p(),i._locked=!1),i._noSleep.disable(),h(!1))},document.addEventListener(a.changeEventName,this._callback)}return r(m.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}}),m.prototype.isDestroyed=function(){return!1},m.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(a.changeEventName,this._callback),i(this)},m}),define("Widgets/VRButton/VRButton",["../../Core/defined","../../Core/defineProperties","../../Core/destroyObject","../../Core/DeveloperError","../../ThirdParty/knockout","../getElement","./VRButtonViewModel"],function(e,t,r,i,n,o,a){"use strict";function s(e,t,r){e=o(e);var i=new a(t,r);i._exitVRPath=u,i._enterVRPath=l;var s=document.createElement("button");s.type="button",s.className="cesium-button cesium-vrButton",s.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(s),n.applyBindings(i,s),this._container=e,this._viewModel=i,this._element=s}var l="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",u="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";return t(s.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}}),s.prototype.isDestroyed=function(){return!1},s.prototype.destroy=function(){return this._viewModel.destroy(),n.cleanNode(this._element),this._container.removeChild(this._element),r(this)},s}),define("Widgets/Viewer/Viewer",["../../Core/BoundingSphere","../../Core/Cartesian3","../../Core/Clock","../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/deprecationWarning","../../Core/destroyObject","../../Core/DeveloperError","../../Core/Event","../../Core/EventHelper","../../Core/isArray","../../Core/Matrix4","../../Core/Rectangle","../../Core/ScreenSpaceEventType","../../DataSources/BoundingSphereState","../../DataSources/ConstantPositionProperty","../../DataSources/DataSourceCollection","../../DataSources/DataSourceDisplay","../../DataSources/Entity","../../DataSources/EntityView","../../DataSources/Property","../../Scene/ImageryLayer","../../Scene/SceneMode","../../ThirdParty/knockout","../../ThirdParty/when","../Animation/Animation","../Animation/AnimationViewModel","../BaseLayerPicker/BaseLayerPicker","../BaseLayerPicker/createDefaultImageryProviderViewModels","../BaseLayerPicker/createDefaultTerrainProviderViewModels","../CesiumWidget/CesiumWidget","../ClockViewModel","../FullscreenButton/FullscreenButton","../Geocoder/Geocoder","../getElement","../HomeButton/HomeButton","../InfoBox/InfoBox","../NavigationHelpButton/NavigationHelpButton","../ProjectionPicker/ProjectionPicker","../SceneModePicker/SceneModePicker","../SelectionIndicator/SelectionIndicator","../subscribeAndEvaluate","../Timeline/Timeline","../VRButton/VRButton"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R,N,k,L,F,B,U,V,z,G,H,W){"use strict";function j(e){var t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function q(e,t){var r=e.scene.pick(t.position);if(n(r)){var o=i(r.id,r.primitive.id);if(o instanceof y)return o}if(n(e.scene.globe))return X(e,t.position)}function Y(e,t,r){if(n(r)){var i=r.clock;n(i)&&(i.getValue(t),n(e)&&(e.updateFromClock(),e.zoomTo(i.startTime,i.stopTime)))}}function X(e,t){var r=e.scene,i=r.camera.getPickRay(t),o=r.imageryLayers.pickImageryLayerFeatures(i,r);if(n(o)){var a=new y({id:"Loading...",description:"Loading feature information..."});return T(o,function(t){if(e.selectedEntity===a){if(!n(t)||0===t.length)return void(e.selectedEntity=Q());var r=t[0],i=new y({id:r.name,description:r.description});if(n(r.position)){var o=e.scene.globe.ellipsoid.cartographicToCartesian(r.position,ne);i.position=new g(o)}e.selectedEntity=i}},function(){e.selectedEntity===a&&(e.selectedEntity=Q())}),a}}function Q(){return new y({id:"None",description:"No features found."})}function Z(e,t){var r=e._geocoder,i=e._homeButton,o=e._sceneModePicker,a=e._projectionPicker,s=e._baseLayerPicker,l=e._animation,u=e._timeline,c=e._fullscreenButton,d=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(n(r)&&(r.container.style.visibility=p),n(i)&&(i.container.style.visibility=p),n(o)&&(o.container.style.visibility=p),n(a)&&(a.container.style.visibility=p),n(s)&&(s.container.style.visibility=p),n(l)&&(l.container.style.visibility=p),n(u)&&(u.container.style.visibility=p),n(c)&&c.viewModel.isFullscreenEnabled&&(c.container.style.visibility=p),n(d)&&(d.container.style.visibility=p),n(h)&&(h.container.style.visibility=p),e._container){var f=t||!n(c)?0:c.container.clientWidth;e._vrButton.container.style.right=f+"px",e.forceResize()}}function K(e,t){function o(e){var t=q(h,e);n(t)&&(C.getValueOrUndefined(t.position,h.clock.currentTime)?h.trackedEntity=t:h.zoomTo(t))}function s(e){h.selectedEntity=q(h,e)}e=k(e),t=i(t,i.EMPTY_OBJECT);var l=!(n(t.globe)&&t.globe===!1||n(t.baseLayerPicker)&&t.baseLayerPicker===!1),h=this,p=document.createElement("div");p.className="cesium-viewer",e.appendChild(p);var m=document.createElement("div");m.className="cesium-viewer-cesiumWidgetContainer",p.appendChild(m);var g=document.createElement("div");g.className="cesium-viewer-bottom",p.appendChild(g);var y=i(t.scene3DOnly,!1),b=t.clock;n(b)&&a("Viewer.options.clock","Passing options.clock when creating a new Viewer instance was deprecated in Cesium 1.34 and will be removed in Cesium 1.37, pass options.clockViewModel instead.");var w,S,T=!1;n(t.clockViewModel)?(S=t.clockViewModel,w=S.clock):(w=n(b)?b:new r,S=new O(w),T=!0);var Y=new M(m,{terrainProvider:t.terrainProvider,imageryProvider:!l&&t.imageryProvider,clock:w,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,creditContainer:n(t.creditContainer)?t.creditContainer:g,scene3DOnly:y,terrainExaggeration:t.terrainExaggeration,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D}),X=t.dataSources,Q=!1;n(X)||(X=new v,Q=!0);var J=new _({scene:Y.scene,dataSourceCollection:X}),$=new c;$.add(w.onTick,K.prototype._onTick,this),$.add(Y.scene.morphStart,K.prototype._clearTrackedObject,this);var ee;if(!n(t.selectionIndicator)||t.selectionIndicator!==!1){var te=document.createElement("div");te.className="cesium-viewer-selectionIndicatorContainer",p.appendChild(te),ee=new z(te,Y.scene)}var re;if(!n(t.infoBox)||t.infoBox!==!1){var ie=document.createElement("div");ie.className="cesium-viewer-infoBoxContainer",p.appendChild(ie),re=new F(ie);var ne=re.viewModel;$.add(ne.cameraClicked,K.prototype._onInfoBoxCameraClicked,this),$.add(ne.closeClicked,K.prototype._onInfoBoxClockClicked,this)}var oe=document.createElement("div");oe.className="cesium-viewer-toolbar",p.appendChild(oe);var ae;if(!n(t.geocoder)||t.geocoder!==!1){var se=document.createElement("div");se.className="cesium-viewer-geocoderContainer",oe.appendChild(se),ae=new N({container:se,geocoderServices:n(t.geocoder)?d(t.geocoder)?t.geocoder:[t.geocoder]:void 0,scene:Y.scene}),$.add(ae.viewModel.search.beforeExecute,K.prototype._clearObjects,this)}var le;n(t.homeButton)&&t.homeButton===!1||(le=new L(oe,Y.scene),n(ae)&&$.add(le.viewModel.command.afterExecute,function(){var e=ae.viewModel;e.searchText="",e.isSearchInProgress&&e.search()}),$.add(le.viewModel.command.beforeExecute,K.prototype._clearTrackedObject,this));var ue;y||n(t.sceneModePicker)&&t.sceneModePicker===!1||(ue=new V(oe,Y.scene));var ce;t.projectionPicker&&(ce=new U(oe,Y.scene));var de,he;if(l){var pe=i(t.imageryProviderViewModels,D()),fe=i(t.terrainProviderViewModels,I());de=new A(oe,{globe:Y.scene.globe,imageryProviderViewModels:pe,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:fe,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel});var me=oe.getElementsByClassName("cesium-baseLayerPicker-dropDown");he=me[0]}var ge;if(!n(t.navigationHelpButton)||t.navigationHelpButton!==!1){var ve=!0;try{if(n(window.localStorage)){var _e=window.localStorage.getItem("cesium-hasSeenNavHelp");n(_e)&&Boolean(_e)?ve=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch(e){}ge=new B({container:oe,instructionsInitiallyVisible:i(t.navigationInstructionsInitiallyVisible,ve)})}var ye;if(!n(t.animation)||t.animation!==!1){var be=document.createElement("div");be.className="cesium-viewer-animationContainer",p.appendChild(be),ye=new x(be,new P(S))}var Ce;if(!n(t.timeline)||t.timeline!==!1){var we=document.createElement("div");we.className="cesium-viewer-timelineContainer",p.appendChild(we),Ce=new H(we,w),Ce.addEventListener("settime",j,!1),Ce.zoomTo(w.startTime,w.stopTime)}var Se,Ee;if(!n(t.fullscreenButton)||t.fullscreenButton!==!1){var Te=document.createElement("div");Te.className="cesium-viewer-fullscreenContainer",p.appendChild(Te),Se=new R(Te,t.fullscreenElement),Ee=G(Se.viewModel,"isFullscreenEnabled",function(e){Te.style.display=e?"block":"none",n(Ce)&&(Ce.container.style.right=Te.clientWidth+"px",Ce.resize())})}var xe,Pe,Ae;if(t.vrButton){var De=document.createElement("div");De.className="cesium-viewer-vrContainer",p.appendChild(De),xe=new W(De,Y.scene,t.fullScreenElement),Pe=G(xe.viewModel,"isVREnabled",function(e){De.style.display=e?"block":"none",n(Se)&&(De.style.right=Te.clientWidth+"px"),n(Ce)&&(Ce.container.style.right=De.clientWidth+"px",Ce.resize())}),Ae=G(xe.viewModel,"isVRMode",function(e){Z(h,e)})}this._baseLayerPickerDropDown=he,this._fullscreenSubscription=Ee,this._vrSubscription=Pe,this._vrModeSubscription=Ae,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=i(t.automaticallyTrackDataSourceClocks,!0),this._container=e,this._bottomContainer=g,this._element=p,this._cesiumWidget=Y,this._selectionIndicator=ee,this._infoBox=re,this._dataSourceCollection=X,this._destroyDataSourceCollection=Q,this._dataSourceDisplay=J,this._clockViewModel=S,this._destroyClockViewModel=T,this._toolbar=oe,this._homeButton=le,this._sceneModePicker=ue,this._projectionPicker=ce,this._baseLayerPicker=de,this._navigationHelpButton=ge,this._animation=ye,this._timeline=Ce,this._fullscreenButton=Se,this._vrButton=xe,this._geocoder=ae,this._eventHelper=$,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=n(re)||n(ee),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._clockTrackedDataSource=void 0,this._forceResize=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new u,this._trackedEntityChanged=new u,E.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),$.add(X.dataSourceAdded,K.prototype._onDataSourceAdded,this),$.add(X.dataSourceRemoved,K.prototype._onDataSourceRemoved,this),$.add(Y.scene.preRender,K.prototype.resize,this),$.add(Y.scene.postRender,K.prototype._postRender,this);for(var Ie=X.length,Me=0;Me<Ie;Me++)this._dataSourceAdded(X,X.get(Me));this._dataSourceAdded(void 0,J.defaultDataSource),$.add(X.dataSourceAdded,K.prototype._dataSourceAdded,this),$.add(X.dataSourceRemoved,K.prototype._dataSourceRemoved,this),Y.screenSpaceEventHandler.setInputAction(s,f.LEFT_CLICK),Y.screenSpaceEventHandler.setInputAction(o,f.LEFT_DOUBLE_CLICK)}function J(e,t,r,o){ee(e);var a=T.defer();return e._zoomPromise=a,e._zoomIsFlight=o,e._zoomOptions=r,T(t,function(t){if(e._zoomPromise===a){if(t instanceof w)return void t.getViewableRectangle().then(function(t){e._zoomPromise===a&&(e._zoomTarget=t)});if(t.isLoading&&n(t.loadingEvent))var r=t.loadingEvent.addEventListener(function(){r(),e._zoomPromise===a&&(e._zoomTarget=t.entities.values.slice(0))});else{if(d(t))return void(e._zoomTarget=t.slice(0));t=i(t.values,t),n(t.entities)&&(t=t.entities.values),d(t)?e._zoomTarget=t.slice(0):e._zoomTarget=[t]}}}),a.promise}function $(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function ee(e){var t=e._zoomPromise;n(t)&&($(e),t.resolve(!1))}function te(t){var r=t._zoomTarget;if(n(r)&&t.scene.mode!==S.MORPHING){var o=t.scene,a=o.camera,s=t._zoomPromise,l=i(t._zoomOptions,{});if(r instanceof p){var u={destination:r,duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)}};return t._zoomIsFlight?a.flyTo(u):(a.setView(u),s.resolve(!0)),void $(t)}for(var c=[],d=0,f=r.length;d<f;d++){var g=t._dataSourceDisplay.getBoundingSphere(r[d],!1,ie);if(g===m.PENDING)return;g!==m.FAILED&&c.push(e.clone(ie))}if(0===c.length)return void ee(t);t.trackedEntity=void 0;var v=e.fromBoundingSpheres(c),_=o.screenSpaceCameraController;_.minimumZoomDistance=Math.min(_.minimumZoomDistance,.5*v.radius),t._zoomIsFlight?($(t),a.flyToBoundingSphere(v,{duration:l.duration,maximumHeight:l.maximumHeight,complete:function(){s.resolve(!0)},cancel:function(){s.resolve(!1)},offset:l.offset})):(a.viewBoundingSphere(v,t._zoomOptions),a.lookAtTransform(h.IDENTITY),$(t),s.resolve(!0))}}function re(e){if(e._needTrackedEntityUpdate){var t=e._trackedEntity,r=e.clock.currentTime,i=C.getValueOrUndefined(t.position,r);if(n(i)){var o=e.scene,a=e._dataSourceDisplay.getBoundingSphere(t,!1,ie);if(a!==m.PENDING){var s=o.mode;s!==S.COLUMBUS_VIEW&&s!==S.SCENE2D||(o.screenSpaceCameraController.enableTranslate=!1),s!==S.COLUMBUS_VIEW&&s!==S.SCENE3D||(o.screenSpaceCameraController.enableTilt=!1);var l=a!==m.FAILED?ie:void 0;e._entityView=new b(t,o,o.mapProjection.ellipsoid),e._entityView.update(r,l),e._needTrackedEntityUpdate=!1}}}}var ie=new e,ne=new t;return o(K.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}},cesiumLogo:{get:function(){return this._cesiumWidget.cesiumLogo}},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}},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,this._forceResize=!0}},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,ee(this);var t=this.scene,r=t.mode;n(e)&&n(e.position)?this._needTrackedEntityUpdate=!0:(this._needTrackedEntityUpdate=!1,r!==S.COLUMBUS_VIEW&&r!==S.SCENE2D||(t.screenSpaceCameraController.enableTranslate=!0),r!==S.COLUMBUS_VIEW&&r!==S.SCENE3D||(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(h.IDENTITY)),this._trackedEntityChanged.raiseEvent(e)}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;var t=n(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;n(e)?n(t)&&t.animateAppear():n(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,Y(this._timeline,this.clock,e))}}}),K.prototype.extend=function(e,t){e(this,t)},K.prototype.resize=function(){var e=this._cesiumWidget,t=this._container,r=t.clientWidth,i=t.clientHeight,o=n(this._animation),a=n(this._timeline);if(this._forceResize||r!==this._lastWidth||i!==this._lastHeight){e.resize(),this._forceResize=!1;var s=i-125,l=this._baseLayerPickerDropDown;if(n(l)&&(l.style.maxHeight=s+"px"),n(this._geocoder)){var u=this._geocoder.searchSuggestionsContainer;u.style.maxHeight=s+"px"}n(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);var c,d=this._timeline,h=0,p=0,f=0;if(o&&"hidden"!==window.getComputedStyle(this._animation.container).visibility){var m=this._lastWidth;c=this._animation.container,r>900?(h=169,m<=900&&(c.style.width="169px",c.style.height="112px",this._animation.resize())):r>=600?(h=136,(m<600||m>900)&&(c.style.width="136px",c.style.height="90px",this._animation.resize())):(h=106,(m>600||0===m)&&(c.style.width="106px",c.style.height="70px",this._animation.resize())),p=h+5}if(a&&"hidden"!==window.getComputedStyle(this._timeline.container).visibility){var g=this._fullscreenButton,v=this._vrButton,_=d.container,y=_.style;f=_.clientHeight+3,y.left=h+"px";var b=0;n(g)&&(b+=g.container.clientWidth),n(v)&&(b+=v.container.clientWidth),y.right=b+"px",d.resize()}this._bottomContainer.style.left=p+"px",this._bottomContainer.style.bottom=f+"px",this._lastWidth=r,this._lastHeight=i}},K.prototype.forceResize=function(){this._lastWidth=0,this.resize()},K.prototype.render=function(){this._cesiumWidget.render()},K.prototype.isDestroyed=function(){return!1},K.prototype.destroy=function(){var e;this.screenSpaceEventHandler.removeInputAction(f.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(f.LEFT_DOUBLE_CLICK);var t=this.dataSources,r=t.length;for(e=0;e<r;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(),n(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),n(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),n(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),n(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),n(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),n(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),n(this._timeline)&&(this._timeline.removeEventListener("settime",j,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),n(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),n(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),n(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),n(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()),s(this)},K.prototype._dataSourceAdded=function(e,t){var r=t.entities;r.collectionChanged.addEventListener(K.prototype._onEntityCollectionChanged,this)},K.prototype._dataSourceRemoved=function(e,t){var r=t.entities;r.collectionChanged.removeEventListener(K.prototype._onEntityCollectionChanged,this),n(this.trackedEntity)&&r.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),n(this.selectedEntity)&&r.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)},K.prototype._onTick=function(e){var r=e.currentTime,o=this._dataSourceDisplay.update(r);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=o);var a=this._entityView;if(n(a)){var s=this._trackedEntity,l=this._dataSourceDisplay.getBoundingSphere(s,!1,ie);l===m.DONE&&a.update(r,ie)}var u,c=!1,d=this.selectedEntity,h=n(d)&&this._enableInfoOrSelection;if(h&&d.isShowing&&d.isAvailable(r)){var p=this._dataSourceDisplay.getBoundingSphere(d,!0,ie);p!==m.FAILED?u=ie.center:n(d.position)&&(u=d.position.getValue(r,u)),c=n(u)}var f=n(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;n(f)&&(f.position=t.clone(u,f.position),f.showSelection=h&&c,f.update());var g=n(this._infoBox)?this._infoBox.viewModel:void 0;n(g)&&(g.showInfo=h,g.enableCamera=c,g.isCameraTracking=this.trackedEntity===this.selectedEntity,h?(g.titleText=i(d.name,d.id),g.description=C.getValueOrDefault(d.description,r,"")):(g.titleText="",g.description=""))},K.prototype._onEntityCollectionChanged=function(e,t,r){for(var i=r.length,n=0;n<i;n++){var o=r[n];this.trackedEntity===o&&(this.trackedEntity=void 0),this.selectedEntity===o&&(this.selectedEntity=void 0)}},K.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{var t=this.selectedEntity,r=t.position;n(r)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}},K.prototype._clearTrackedObject=function(){this.trackedEntity=void 0},K.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0},K.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0},K.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Y(this.timeline,this.clock,e)},K.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);var r=t.entities.id,i=this._eventHelper.add(t.changedEvent,K.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[r]=i},K.prototype._onDataSourceRemoved=function(e,t){var r=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,r){var n=e.length;this._automaticallyTrackDataSourceClocks&&n>0?this.clockTrackedDataSource=e.get(n-1):this.clockTrackedDataSource=void 0}},K.prototype.zoomTo=function(e,t){return J(this,e,t,!1)},K.prototype.flyTo=function(e,t){return J(this,e,t,!0)},K.prototype._postRender=function(){te(this),re(this)},K}),define("Widgets/Viewer/viewerCesiumInspectorMixin",["../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../CesiumInspector/CesiumInspector"],function(e,t,r,i){"use strict";function n(e){var r=document.createElement("div");r.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(r);var n=new i(r,e.scene);t(e,{cesiumInspector:{get:function(){return n}}})}return n}),define("Widgets/Viewer/viewerDragDropMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../../Core/Event","../../Core/wrapFunction","../../DataSources/CzmlDataSource","../../DataSources/GeoJsonDataSource","../../DataSources/KmlDataSource","../getElement"],function(e,t,r,i,n,o,a,s,l,u){"use strict";function c(t,i){function a(e){d(e),g&&(t.entities.removeAll(),t.dataSources.removeAll());for(var r=e.dataTransfer.files,i=r.length,n=0;n<i;n++){var o=r[n],a=new FileReader;a.onload=f(t,o,y,_),a.onerror=m(t,o),a.readAsText(o)}}i=e(i,e.EMPTY_OBJECT);var s=!0,l=e(i.flyToOnDrop,!0),c=new n,g=e(i.clearOnDrop,!0),v=e(i.dropTarget,t.container),_=e(i.clampToGround,!0),y=i.proxy;v=u(v),r(t,{dropTarget:{get:function(){return v},set:function(e){h(v,a),v=e,p(v,a)}},dropEnabled:{get:function(){return s},set:function(e){e!==s&&(e?p(v,a):h(v,a),s=e)}},dropError:{get:function(){return c}},clearOnDrop:{get:function(){return g},set:function(e){g=e}},flyToOnDrop:{get:function(){return l},set:function(e){l=e}},proxy:{get:function(){return y},set:function(e){y=e}},clampToGround:{get:function(){return _},set:function(e){_=e}}}),p(v,a),t.destroy=o(t,t.destroy,function(){t.dropEnabled=!1}),t._handleDrop=a}function d(e){e.stopPropagation(),e.preventDefault()}function h(e,r){var i=e;t(i)&&(i.removeEventListener("drop",r,!1),i.removeEventListener("dragenter",d,!1),i.removeEventListener("dragover",d,!1),i.removeEventListener("dragexit",d,!1))}function p(e,t){e.addEventListener("drop",t,!1), +e.addEventListener("dragenter",d,!1),e.addEventListener("dragover",d,!1),e.addEventListener("dragexit",d,!1)}function f(e,r,i,n){var o=e.scene;return function(u){var c=r.name;try{var d;if(/\.czml$/i.test(c))d=a.load(JSON.parse(u.target.result),{sourceUri:c});else if(/\.geojson$/i.test(c)||/\.json$/i.test(c)||/\.topojson$/i.test(c))d=s.load(JSON.parse(u.target.result),{sourceUri:c,clampToGround:n});else{if(!/\.(kml|kmz)$/i.test(c))return void e.dropError.raiseEvent(e,c,"Unrecognized file: "+c);d=l.load(r,{sourceUri:c,proxy:i,camera:o.camera,canvas:o.canvas})}t(d)&&e.dataSources.add(d).then(function(t){e.flyToOnDrop&&e.flyTo(t)}).otherwise(function(t){e.dropError.raiseEvent(e,c,t)})}catch(t){e.dropError.raiseEvent(e,c,t)}}}function m(e,t){return function(r){e.dropError.raiseEvent(e,t.name,r.target.error)}}return c}),define("Widgets/Viewer/viewerPerformanceWatchdogMixin",["../../Core/defaultValue","../../Core/defined","../../Core/defineProperties","../../Core/DeveloperError","../PerformanceWatchdog/PerformanceWatchdog"],function(e,t,r,i,n){"use strict";function o(t,i){i=e(i,e.EMPTY_OBJECT);var o=new n({scene:t.scene,container:t.bottomContainer,lowFrameRateMessage:i.lowFrameRateMessage});r(t,{performanceWatchdog:{get:function(){return o}}})}return o}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function i(i){var n,o=[],a={id:void 0,result:void 0,error:void 0};return function(s){var l=s.data;o.length=0,a.id=l.id,a.error=void 0,a.result=void 0;try{a.result=i(l.parameters,o)}catch(e){e instanceof Error?a.error={name:e.name,message:e.message,stack:e.stack}:a.error=e}t(n)||(n=e(self.webkitPostMessage,self.postMessage)),l.canTransferArrayBuffer||(o.length=0);try{n(a,o)}catch(e){a.result=void 0,a.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(a),n(a)}}}return i}),define("Cesium",["./Core/appendForwardSlash","./Core/arrayFill","./Core/arrayRemoveDuplicates","./Core/AssociativeArray","./Core/AttributeCompression","./Core/AxisAlignedBoundingBox","./Core/barycentricCoordinates","./Core/binarySearch","./Core/BingMapsApi","./Core/BingMapsGeocoderService","./Core/BoundingRectangle","./Core/BoundingSphere","./Core/BoxGeometry","./Core/BoxOutlineGeometry","./Core/buildModuleUrl","./Core/cancelAnimationFrame","./Core/Cartesian2","./Core/Cartesian3","./Core/Cartesian4","./Core/Cartographic","./Core/CartographicGeocoderService","./Core/CatmullRomSpline","./Core/CesiumTerrainProvider","./Core/Check","./Core/CircleGeometry","./Core/CircleOutlineGeometry","./Core/Clock","./Core/ClockRange","./Core/ClockStep","./Core/clone","./Core/Color","./Core/ColorGeometryInstanceAttribute","./Core/combine","./Core/ComponentDatatype","./Core/CompressedTextureBuffer","./Core/CornerType","./Core/CorridorGeometry","./Core/CorridorGeometryLibrary","./Core/CorridorOutlineGeometry","./Core/createGuid","./Core/Credit","./Core/CubicRealPolynomial","./Core/CylinderGeometry","./Core/CylinderGeometryLibrary","./Core/CylinderOutlineGeometry","./Core/decodeGoogleEarthEnterpriseData","./Core/DefaultProxy","./Core/defaultValue","./Core/defined","./Core/defineProperties","./Core/deprecationWarning","./Core/destroyObject","./Core/DeveloperError","./Core/DistanceDisplayCondition","./Core/DistanceDisplayConditionGeometryInstanceAttribute","./Core/EarthOrientationParameters","./Core/EarthOrientationParametersSample","./Core/EasingFunction","./Core/EllipseGeometry","./Core/EllipseGeometryLibrary","./Core/EllipseOutlineGeometry","./Core/Ellipsoid","./Core/EllipsoidalOccluder","./Core/EllipsoidGeodesic","./Core/EllipsoidGeometry","./Core/EllipsoidOutlineGeometry","./Core/EllipsoidTangentPlane","./Core/EllipsoidTerrainProvider","./Core/EncodedCartesian3","./Core/Event","./Core/EventHelper","./Core/ExtrapolationType","./Core/FeatureDetection","./Core/formatError","./Core/freezeObject","./Core/Fullscreen","./Core/GeocoderService","./Core/GeographicProjection","./Core/GeographicTilingScheme","./Core/Geometry","./Core/GeometryAttribute","./Core/GeometryAttributes","./Core/GeometryInstance","./Core/GeometryInstanceAttribute","./Core/GeometryPipeline","./Core/GeometryType","./Core/getAbsoluteUri","./Core/getBaseUri","./Core/getExtensionFromUri","./Core/getFilenameFromUri","./Core/getImagePixels","./Core/getMagic","./Core/getStringFromTypedArray","./Core/getTimestamp","./Core/GoogleEarthEnterpriseMetadata","./Core/GoogleEarthEnterpriseTerrainData","./Core/GoogleEarthEnterpriseTerrainProvider","./Core/GoogleEarthEnterpriseTileInformation","./Core/GregorianDate","./Core/HeadingPitchRange","./Core/HeadingPitchRoll","./Core/HeightmapTerrainData","./Core/HeightmapTessellator","./Core/HermitePolynomialApproximation","./Core/HermiteSpline","./Core/Iau2000Orientation","./Core/Iau2006XysData","./Core/Iau2006XysSample","./Core/IauOrientationAxes","./Core/IauOrientationParameters","./Core/IndexDatatype","./Core/InterpolationAlgorithm","./Core/Intersect","./Core/Intersections2D","./Core/IntersectionTests","./Core/Interval","./Core/isArray","./Core/isBitSet","./Core/isCrossOriginUrl","./Core/isDataUri","./Core/isLeapYear","./Core/Iso8601","./Core/joinUrls","./Core/JulianDate","./Core/KeyboardEventModifier","./Core/LagrangePolynomialApproximation","./Core/LeapSecond","./Core/LinearApproximation","./Core/LinearSpline","./Core/loadArrayBuffer","./Core/loadBlob","./Core/loadCRN","./Core/loadImage","./Core/loadImageFromTypedArray","./Core/loadImageViaBlob","./Core/loadJson","./Core/loadJsonp","./Core/loadKTX","./Core/loadText","./Core/loadWithXhr","./Core/loadXML","./Core/MapboxApi","./Core/MapProjection","./Core/Math","./Core/Matrix2","./Core/Matrix3","./Core/Matrix4","./Core/mergeSort","./Core/NearFarScalar","./Core/objectToQuery","./Core/Occluder","./Core/oneTimeWarning","./Core/OrientedBoundingBox","./Core/Packable","./Core/PackableForInterpolation","./Core/parseResponseHeaders","./Core/PinBuilder","./Core/PixelFormat","./Core/Plane","./Core/pointInsideTriangle","./Core/PolygonGeometry","./Core/PolygonGeometryLibrary","./Core/PolygonHierarchy","./Core/PolygonOutlineGeometry","./Core/PolygonPipeline","./Core/PolylineGeometry","./Core/PolylinePipeline","./Core/PolylineVolumeGeometry","./Core/PolylineVolumeGeometryLibrary","./Core/PolylineVolumeOutlineGeometry","./Core/PrimitiveType","./Core/QuadraticRealPolynomial","./Core/QuantizedMeshTerrainData","./Core/QuarticRealPolynomial","./Core/Quaternion","./Core/QuaternionSpline","./Core/queryToObject","./Core/Queue","./Core/Ray","./Core/Rectangle","./Core/RectangleGeometry","./Core/RectangleGeometryLibrary","./Core/RectangleOutlineGeometry","./Core/ReferenceFrame","./Core/requestAnimationFrame","./Core/RequestErrorEvent","./Core/RuntimeError","./Core/sampleTerrain","./Core/sampleTerrainMostDetailed","./Core/scaleToGeodeticSurface","./Core/ScreenSpaceEventHandler","./Core/ScreenSpaceEventType","./Core/ShowGeometryInstanceAttribute","./Core/Simon1994PlanetaryPositions","./Core/SimplePolylineGeometry","./Core/SphereGeometry","./Core/SphereOutlineGeometry","./Core/Spherical","./Core/Spline","./Core/subdivideArray","./Core/TaskProcessor","./Core/TerrainData","./Core/TerrainEncoding","./Core/TerrainMesh","./Core/TerrainProvider","./Core/TerrainQuantization","./Core/throttleRequestByServer","./Core/TileAvailability","./Core/TileProviderError","./Core/TilingScheme","./Core/TimeConstants","./Core/TimeInterval","./Core/TimeIntervalCollection","./Core/TimeStandard","./Core/Tipsify","./Core/Transforms","./Core/TranslationRotationScale","./Core/TridiagonalSystemSolver","./Core/TrustedServers","./Core/VertexFormat","./Core/VideoSynchronizer","./Core/Visibility","./Core/VRTheWorldTerrainProvider","./Core/WallGeometry","./Core/WallGeometryLibrary","./Core/WallOutlineGeometry","./Core/WebGLConstants","./Core/WebMercatorProjection","./Core/WebMercatorTilingScheme","./Core/WindingOrder","./Core/wrapFunction","./Core/writeTextToCanvas","./DataSources/BillboardGraphics","./DataSources/BillboardVisualizer","./DataSources/BoundingSphereState","./DataSources/BoxGeometryUpdater","./DataSources/BoxGraphics","./DataSources/CallbackProperty","./DataSources/CheckerboardMaterialProperty","./DataSources/ColorMaterialProperty","./DataSources/CompositeEntityCollection","./DataSources/CompositeMaterialProperty","./DataSources/CompositePositionProperty","./DataSources/CompositeProperty","./DataSources/ConstantPositionProperty","./DataSources/ConstantProperty","./DataSources/CorridorGeometryUpdater","./DataSources/CorridorGraphics","./DataSources/createMaterialPropertyDescriptor","./DataSources/createPropertyDescriptor","./DataSources/createRawPropertyDescriptor","./DataSources/CustomDataSource","./DataSources/CylinderGeometryUpdater","./DataSources/CylinderGraphics","./DataSources/CzmlDataSource","./DataSources/DataSource","./DataSources/DataSourceClock","./DataSources/DataSourceCollection","./DataSources/DataSourceDisplay","./DataSources/dynamicGeometryGetBoundingSphere","./DataSources/DynamicGeometryUpdater","./DataSources/EllipseGeometryUpdater","./DataSources/EllipseGraphics","./DataSources/EllipsoidGeometryUpdater","./DataSources/EllipsoidGraphics","./DataSources/Entity","./DataSources/EntityCluster","./DataSources/EntityCollection","./DataSources/EntityView","./DataSources/GeoJsonDataSource","./DataSources/GeometryUpdater","./DataSources/GeometryVisualizer","./DataSources/GridMaterialProperty","./DataSources/ImageMaterialProperty","./DataSources/KmlDataSource","./DataSources/LabelGraphics","./DataSources/LabelVisualizer","./DataSources/MaterialProperty","./DataSources/ModelGraphics","./DataSources/ModelVisualizer","./DataSources/NodeTransformationProperty","./DataSources/PathGraphics","./DataSources/PathVisualizer","./DataSources/PointGraphics","./DataSources/PointVisualizer","./DataSources/PolygonGeometryUpdater","./DataSources/PolygonGraphics","./DataSources/PolylineArrowMaterialProperty","./DataSources/PolylineDashMaterialProperty","./DataSources/PolylineGeometryUpdater","./DataSources/PolylineGlowMaterialProperty","./DataSources/PolylineGraphics","./DataSources/PolylineOutlineMaterialProperty","./DataSources/PolylineVolumeGeometryUpdater","./DataSources/PolylineVolumeGraphics","./DataSources/PositionProperty","./DataSources/PositionPropertyArray","./DataSources/Property","./DataSources/PropertyArray","./DataSources/PropertyBag","./DataSources/RectangleGeometryUpdater","./DataSources/RectangleGraphics","./DataSources/ReferenceProperty","./DataSources/Rotation","./DataSources/SampledPositionProperty","./DataSources/SampledProperty","./DataSources/ScaledPositionProperty","./DataSources/StaticGeometryColorBatch","./DataSources/StaticGeometryPerMaterialBatch","./DataSources/StaticGroundGeometryColorBatch","./DataSources/StaticOutlineGeometryBatch","./DataSources/StripeMaterialProperty","./DataSources/StripeOrientation","./DataSources/TimeIntervalCollectionPositionProperty","./DataSources/TimeIntervalCollectionProperty","./DataSources/VelocityOrientationProperty","./DataSources/VelocityVectorProperty","./DataSources/Visualizer","./DataSources/WallGeometryUpdater","./DataSources/WallGraphics","./Renderer/AutomaticUniforms","./Renderer/Buffer","./Renderer/BufferUsage","./Renderer/ClearCommand","./Renderer/ComputeCommand","./Renderer/ComputeEngine","./Renderer/Context","./Renderer/ContextLimits","./Renderer/createUniform","./Renderer/createUniformArray","./Renderer/CubeMap","./Renderer/CubeMapFace","./Renderer/DrawCommand","./Renderer/Framebuffer","./Renderer/loadCubeMap","./Renderer/MipmapHint","./Renderer/Pass","./Renderer/PassState","./Renderer/PickFramebuffer","./Renderer/PixelDatatype","./Renderer/Renderbuffer","./Renderer/RenderbufferFormat","./Renderer/RenderState","./Renderer/Sampler","./Renderer/ShaderCache","./Renderer/ShaderProgram","./Renderer/ShaderSource","./Renderer/Texture","./Renderer/TextureMagnificationFilter","./Renderer/TextureMinificationFilter","./Renderer/TextureWrap","./Renderer/UniformState","./Renderer/VertexArray","./Renderer/VertexArrayFacade","./Scene/Appearance","./Scene/ArcGisMapServerImageryProvider","./Scene/Axis","./Scene/BatchTable","./Scene/Billboard","./Scene/BillboardCollection","./Scene/BingMapsImageryProvider","./Scene/BingMapsStyle","./Scene/BlendEquation","./Scene/BlendFunction","./Scene/BlendingState","./Scene/BlendOption","./Scene/Camera","./Scene/CameraEventAggregator","./Scene/CameraEventType","./Scene/CameraFlightPath","./Scene/ColorBlendMode","./Scene/createOpenStreetMapImageryProvider","./Scene/createTangentSpaceDebugPrimitive","./Scene/createTileMapServiceImageryProvider","./Scene/CreditDisplay","./Scene/CullFace","./Scene/CullingVolume","./Scene/DebugAppearance","./Scene/DebugCameraPrimitive","./Scene/DebugModelMatrixPrimitive","./Scene/DepthFunction","./Scene/DepthPlane","./Scene/DeviceOrientationCameraController","./Scene/DiscardMissingTileImagePolicy","./Scene/EllipsoidPrimitive","./Scene/EllipsoidSurfaceAppearance","./Scene/Fog","./Scene/FrameRateMonitor","./Scene/FrameState","./Scene/FrustumCommands","./Scene/FXAA","./Scene/getAttributeOrUniformBySemantic","./Scene/getBinaryAccessor","./Scene/GetFeatureInfoFormat","./Scene/Globe","./Scene/GlobeDepth","./Scene/GlobeSurfaceShaderSet","./Scene/GlobeSurfaceTile","./Scene/GlobeSurfaceTileProvider","./Scene/GoogleEarthEnterpriseImageryProvider","./Scene/GoogleEarthImageryProvider","./Scene/GridImageryProvider","./Scene/GroundPrimitive","./Scene/HeightReference","./Scene/HorizontalOrigin","./Scene/Imagery","./Scene/ImageryLayer","./Scene/ImageryLayerCollection","./Scene/ImageryLayerFeatureInfo","./Scene/ImageryProvider","./Scene/ImagerySplitDirection","./Scene/ImageryState","./Scene/JobScheduler","./Scene/JobType","./Scene/Label","./Scene/LabelCollection","./Scene/LabelStyle","./Scene/MapboxImageryProvider","./Scene/MapMode2D","./Scene/Material","./Scene/MaterialAppearance","./Scene/Model","./Scene/ModelAnimation","./Scene/ModelAnimationCache","./Scene/ModelAnimationCollection","./Scene/ModelAnimationLoop","./Scene/ModelAnimationState","./Scene/ModelMaterial","./Scene/modelMaterialsCommon","./Scene/ModelMesh","./Scene/ModelNode","./Scene/Moon","./Scene/NeverTileDiscardPolicy","./Scene/OIT","./Scene/OrthographicFrustum","./Scene/OrthographicOffCenterFrustum","./Scene/PerformanceDisplay","./Scene/PerInstanceColorAppearance","./Scene/PerspectiveFrustum","./Scene/PerspectiveOffCenterFrustum","./Scene/PickDepth","./Scene/PointPrimitive","./Scene/PointPrimitiveCollection","./Scene/Polyline","./Scene/PolylineCollection","./Scene/PolylineColorAppearance","./Scene/PolylineMaterialAppearance","./Scene/Primitive","./Scene/PrimitiveCollection","./Scene/PrimitivePipeline","./Scene/PrimitiveState","./Scene/QuadtreeOccluders","./Scene/QuadtreePrimitive","./Scene/QuadtreeTile","./Scene/QuadtreeTileLoadState","./Scene/QuadtreeTileProvider","./Scene/Scene","./Scene/SceneMode","./Scene/SceneTransforms","./Scene/SceneTransitioner","./Scene/ScreenSpaceCameraController","./Scene/ShadowMap","./Scene/ShadowMapShader","./Scene/ShadowMode","./Scene/SingleTileImageryProvider","./Scene/SkyAtmosphere","./Scene/SkyBox","./Scene/StencilFunction","./Scene/StencilOperation","./Scene/Sun","./Scene/SunPostProcess","./Scene/TerrainState","./Scene/TextureAtlas","./Scene/TileBoundingRegion","./Scene/TileBoundingSphere","./Scene/TileBoundingVolume","./Scene/TileCoordinatesImageryProvider","./Scene/TileDiscardPolicy","./Scene/TileImagery","./Scene/TileOrientedBoundingBox","./Scene/TileReplacementQueue","./Scene/TileState","./Scene/TileTerrain","./Scene/TweenCollection","./Scene/UrlTemplateImageryProvider","./Scene/VerticalOrigin","./Scene/ViewportQuad","./Scene/WebMapServiceImageryProvider","./Scene/WebMapTileServiceImageryProvider","./Shaders/AdjustTranslucentFS","./Shaders/Appearances/AllMaterialAppearanceFS","./Shaders/Appearances/AllMaterialAppearanceVS","./Shaders/Appearances/BasicMaterialAppearanceFS","./Shaders/Appearances/BasicMaterialAppearanceVS","./Shaders/Appearances/EllipsoidSurfaceAppearanceFS","./Shaders/Appearances/EllipsoidSurfaceAppearanceVS","./Shaders/Appearances/PerInstanceColorAppearanceFS","./Shaders/Appearances/PerInstanceColorAppearanceVS","./Shaders/Appearances/PerInstanceFlatColorAppearanceFS","./Shaders/Appearances/PerInstanceFlatColorAppearanceVS","./Shaders/Appearances/PolylineColorAppearanceVS","./Shaders/Appearances/PolylineMaterialAppearanceVS","./Shaders/Appearances/TexturedMaterialAppearanceFS","./Shaders/Appearances/TexturedMaterialAppearanceVS","./Shaders/BillboardCollectionFS","./Shaders/BillboardCollectionVS","./Shaders/Builtin/Constants/degreesPerRadian","./Shaders/Builtin/Constants/depthRange","./Shaders/Builtin/Constants/epsilon1","./Shaders/Builtin/Constants/epsilon2","./Shaders/Builtin/Constants/epsilon3","./Shaders/Builtin/Constants/epsilon4","./Shaders/Builtin/Constants/epsilon5","./Shaders/Builtin/Constants/epsilon6","./Shaders/Builtin/Constants/epsilon7","./Shaders/Builtin/Constants/infinity","./Shaders/Builtin/Constants/oneOverPi","./Shaders/Builtin/Constants/oneOverTwoPi","./Shaders/Builtin/Constants/passCompute","./Shaders/Builtin/Constants/passEnvironment","./Shaders/Builtin/Constants/passGlobe","./Shaders/Builtin/Constants/passGround","./Shaders/Builtin/Constants/passOpaque","./Shaders/Builtin/Constants/passOverlay","./Shaders/Builtin/Constants/passTranslucent","./Shaders/Builtin/Constants/pi","./Shaders/Builtin/Constants/piOverFour","./Shaders/Builtin/Constants/piOverSix","./Shaders/Builtin/Constants/piOverThree","./Shaders/Builtin/Constants/piOverTwo","./Shaders/Builtin/Constants/radiansPerDegree","./Shaders/Builtin/Constants/sceneMode2D","./Shaders/Builtin/Constants/sceneMode3D","./Shaders/Builtin/Constants/sceneModeColumbusView","./Shaders/Builtin/Constants/sceneModeMorphing","./Shaders/Builtin/Constants/solarRadius","./Shaders/Builtin/Constants/threePiOver2","./Shaders/Builtin/Constants/twoPi","./Shaders/Builtin/Constants/webMercatorMaxLatitude","./Shaders/Builtin/CzmBuiltins","./Shaders/Builtin/Functions/alphaWeight","./Shaders/Builtin/Functions/antialias","./Shaders/Builtin/Functions/cascadeColor","./Shaders/Builtin/Functions/cascadeDistance","./Shaders/Builtin/Functions/cascadeMatrix","./Shaders/Builtin/Functions/cascadeWeights","./Shaders/Builtin/Functions/columbusViewMorph","./Shaders/Builtin/Functions/computePosition","./Shaders/Builtin/Functions/cosineAndSine","./Shaders/Builtin/Functions/decompressTextureCoordinates","./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates","./Shaders/Builtin/Functions/ellipsoidContainsPoint","./Shaders/Builtin/Functions/ellipsoidNew","./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates","./Shaders/Builtin/Functions/equalsEpsilon","./Shaders/Builtin/Functions/eyeOffset","./Shaders/Builtin/Functions/eyeToWindowCoordinates","./Shaders/Builtin/Functions/fog","./Shaders/Builtin/Functions/geodeticSurfaceNormal","./Shaders/Builtin/Functions/getDefaultMaterial","./Shaders/Builtin/Functions/getLambertDiffuse","./Shaders/Builtin/Functions/getSpecular","./Shaders/Builtin/Functions/getWaterNoise","./Shaders/Builtin/Functions/getWgs84EllipsoidEC","./Shaders/Builtin/Functions/HSBToRGB","./Shaders/Builtin/Functions/HSLToRGB","./Shaders/Builtin/Functions/hue","./Shaders/Builtin/Functions/isEmpty","./Shaders/Builtin/Functions/isFull","./Shaders/Builtin/Functions/latitudeToWebMercatorFraction","./Shaders/Builtin/Functions/luminance","./Shaders/Builtin/Functions/metersPerPixel","./Shaders/Builtin/Functions/modelToWindowCoordinates","./Shaders/Builtin/Functions/multiplyWithColorBalance","./Shaders/Builtin/Functions/nearFarScalar","./Shaders/Builtin/Functions/octDecode","./Shaders/Builtin/Functions/packDepth","./Shaders/Builtin/Functions/phong","./Shaders/Builtin/Functions/pointAlongRay","./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval","./Shaders/Builtin/Functions/RGBToHSB","./Shaders/Builtin/Functions/RGBToHSL","./Shaders/Builtin/Functions/RGBToXYZ","./Shaders/Builtin/Functions/saturation","./Shaders/Builtin/Functions/shadowDepthCompare","./Shaders/Builtin/Functions/shadowVisibility","./Shaders/Builtin/Functions/signNotZero","./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix","./Shaders/Builtin/Functions/translateRelativeToEye","./Shaders/Builtin/Functions/translucentPhong","./Shaders/Builtin/Functions/transpose","./Shaders/Builtin/Functions/unpackDepth","./Shaders/Builtin/Functions/windowToEyeCoordinates","./Shaders/Builtin/Functions/XYZToRGB","./Shaders/Builtin/Structs/depthRangeStruct","./Shaders/Builtin/Structs/ellipsoid","./Shaders/Builtin/Structs/material","./Shaders/Builtin/Structs/materialInput","./Shaders/Builtin/Structs/ray","./Shaders/Builtin/Structs/raySegment","./Shaders/Builtin/Structs/shadowParameters","./Shaders/CompositeOITFS","./Shaders/DepthPlaneFS","./Shaders/DepthPlaneVS","./Shaders/EllipsoidFS","./Shaders/EllipsoidVS","./Shaders/GlobeFS","./Shaders/GlobeVS","./Shaders/GroundAtmosphere","./Shaders/Materials/BumpMapMaterial","./Shaders/Materials/CheckerboardMaterial","./Shaders/Materials/DotMaterial","./Shaders/Materials/FadeMaterial","./Shaders/Materials/GridMaterial","./Shaders/Materials/NormalMapMaterial","./Shaders/Materials/PolylineArrowMaterial","./Shaders/Materials/PolylineDashMaterial","./Shaders/Materials/PolylineGlowMaterial","./Shaders/Materials/PolylineOutlineMaterial","./Shaders/Materials/RimLightingMaterial","./Shaders/Materials/StripeMaterial","./Shaders/Materials/Water","./Shaders/PointPrimitiveCollectionFS","./Shaders/PointPrimitiveCollectionVS","./Shaders/PolylineCommon","./Shaders/PolylineFS","./Shaders/PolylineVS","./Shaders/PostProcessFilters/AdditiveBlend","./Shaders/PostProcessFilters/BrightPass","./Shaders/PostProcessFilters/FXAA","./Shaders/PostProcessFilters/GaussianBlur1D","./Shaders/PostProcessFilters/PassThrough","./Shaders/ReprojectWebMercatorFS","./Shaders/ReprojectWebMercatorVS","./Shaders/ShadowVolumeFS","./Shaders/ShadowVolumeVS","./Shaders/SkyAtmosphereFS","./Shaders/SkyAtmosphereVS","./Shaders/SkyBoxFS","./Shaders/SkyBoxVS","./Shaders/SunFS","./Shaders/SunTextureFS","./Shaders/SunVS","./Shaders/ViewportQuadFS","./Shaders/ViewportQuadVS","./ThirdParty/Autolinker","./ThirdParty/crunch","./ThirdParty/earcut-2.1.1","./ThirdParty/gltfDefaults","./ThirdParty/google-earth-dbroot-parser","./ThirdParty/kdbush","./ThirdParty/knockout-3.4.0","./ThirdParty/knockout-es5","./ThirdParty/knockout","./ThirdParty/measureText","./ThirdParty/mersenne-twister","./ThirdParty/NoSleep","./ThirdParty/pako_inflate","./ThirdParty/protobuf-minimal","./ThirdParty/Shaders/FXAA3_11","./ThirdParty/sprintf","./ThirdParty/topojson","./ThirdParty/Tween","./ThirdParty/Uri","./ThirdParty/when","./ThirdParty/zip","./Widgets/Animation/Animation","./Widgets/Animation/AnimationViewModel","./Widgets/BaseLayerPicker/BaseLayerPicker","./Widgets/BaseLayerPicker/BaseLayerPickerViewModel","./Widgets/BaseLayerPicker/createDefaultImageryProviderViewModels","./Widgets/BaseLayerPicker/createDefaultTerrainProviderViewModels","./Widgets/BaseLayerPicker/ProviderViewModel","./Widgets/CesiumInspector/CesiumInspector","./Widgets/CesiumInspector/CesiumInspectorViewModel","./Widgets/CesiumWidget/CesiumWidget","./Widgets/ClockViewModel","./Widgets/Command","./Widgets/createCommand","./Widgets/FullscreenButton/FullscreenButton","./Widgets/FullscreenButton/FullscreenButtonViewModel","./Widgets/Geocoder/Geocoder","./Widgets/Geocoder/GeocoderViewModel","./Widgets/getElement","./Widgets/HomeButton/HomeButton","./Widgets/HomeButton/HomeButtonViewModel","./Widgets/InfoBox/InfoBox","./Widgets/InfoBox/InfoBoxViewModel","./Widgets/NavigationHelpButton/NavigationHelpButton","./Widgets/NavigationHelpButton/NavigationHelpButtonViewModel","./Widgets/PerformanceWatchdog/PerformanceWatchdog","./Widgets/PerformanceWatchdog/PerformanceWatchdogViewModel","./Widgets/ProjectionPicker/ProjectionPicker","./Widgets/ProjectionPicker/ProjectionPickerViewModel","./Widgets/SceneModePicker/SceneModePicker","./Widgets/SceneModePicker/SceneModePickerViewModel","./Widgets/SelectionIndicator/SelectionIndicator","./Widgets/SelectionIndicator/SelectionIndicatorViewModel","./Widgets/subscribeAndEvaluate","./Widgets/SvgPathBindingHandler","./Widgets/Timeline/Timeline","./Widgets/Timeline/TimelineHighlightRange","./Widgets/Timeline/TimelineTrack","./Widgets/ToggleButtonViewModel","./Widgets/Viewer/Viewer","./Widgets/Viewer/viewerCesiumInspectorMixin","./Widgets/Viewer/viewerDragDropMixin","./Widgets/Viewer/viewerPerformanceWatchdogMixin","./Widgets/VRButton/VRButton","./Widgets/VRButton/VRButtonViewModel","./Workers/createTaskProcessorWorker"],function(e,t,r,i,n,o,a,s,l,u,c,d,h,p,f,m,g,v,_,y,b,C,w,S,E,T,x,P,A,D,I,M,O,R,N,k,L,F,B,U,V,z,G,H,W,j,q,Y,X,Q,Z,K,J,$,ee,te,re,ie,ne,oe,ae,se,le,ue,ce,de,he,pe,fe,me,ge,ve,_e,ye,be,Ce,we,Se,Ee,Te,xe,Pe,Ae,De,Ie,Me,Oe,Re,Ne,ke,Le,Fe,Be,Ue,Ve,ze,Ge,He,We,je,qe,Ye,Xe,Qe,Ze,Ke,Je,$e,et,tt,rt,it,nt,ot,at,st,lt,ut,ct,dt,ht,pt,ft,mt,gt,vt,_t,yt,bt,Ct,wt,St,Et,Tt,xt,Pt,At,Dt,It,Mt,Ot,Rt,Nt,kt,Lt,Ft,Bt,Ut,Vt,zt,Gt,Ht,Wt,jt,qt,Yt,Xt,Qt,Zt,Kt,Jt,$t,er,tr,rr,ir,nr,or,ar,sr,lr,ur,cr,dr,hr,pr,fr,mr,gr,vr,_r,yr,br,Cr,wr,Sr,Er,Tr,xr,Pr,Ar,Dr,Ir,Mr,Or,Rr,Nr,kr,Lr,Fr,Br,Ur,Vr,zr,Gr,Hr,Wr,jr,qr,Yr,Xr,Qr,Zr,Kr,Jr,$r,ei,ti,ri,ii,ni,oi,ai,si,li,ui,ci,di,hi,pi,fi,mi,gi,vi,_i,yi,bi,Ci,wi,Si,Ei,Ti,xi,Pi,Ai,Di,Ii,Mi,Oi,Ri,Ni,ki,Li,Fi,Bi,Ui,Vi,zi,Gi,Hi,Wi,ji,qi,Yi,Xi,Qi,Zi,Ki,Ji,$i,en,tn,rn,nn,on,an,sn,ln,un,cn,dn,hn,pn,fn,mn,gn,vn,_n,yn,bn,Cn,wn,Sn,En,Tn,xn,Pn,An,Dn,In,Mn,On,Rn,Nn,kn,Ln,Fn,Bn,Un,Vn,zn,Gn,Hn,Wn,jn,qn,Yn,Xn,Qn,Zn,Kn,Jn,$n,eo,to,ro,io,no,oo,ao,so,lo,uo,co,ho,po,fo,mo,go,vo,_o,yo,bo,Co,wo,So,Eo,To,xo,Po,Ao,Do,Io,Mo,Oo,Ro,No,ko,Lo,Fo,Bo,Uo,Vo,zo,Go,Ho,Wo,jo,qo,Yo,Xo,Qo,Zo,Ko,Jo,$o,ea,ta,ra,ia,na,oa,aa,sa,la,ua,ca,da,ha,pa,fa,ma,ga,va,_a,ya,ba,Ca,wa,Sa,Ea,Ta,xa,Pa,Aa,Da,Ia,Ma,Oa,Ra,Na,ka,La,Fa,Ba,Ua,Va,za,Ga,Ha,Wa,ja,qa,Ya,Xa,Qa,Za,Ka,Ja,$a,es,ts,rs,is,ns,os,as,ss,ls,us,cs,ds,hs,ps,fs,ms,gs,vs,_s,ys,bs,Cs,ws,Ss,Es,Ts,xs,Ps,As,Ds,Is,Ms,Os,Rs,Ns,ks,Ls,Fs,Bs,Us,Vs,zs,Gs,Hs,Ws,js,qs,Ys,Xs,Qs,Zs,Ks,Js,$s,el,tl,rl,il,nl,ol,al,sl,ll,ul,cl,dl,hl,pl,fl,ml,gl,vl,_l,yl,bl,Cl,wl,Sl,El,Tl,xl,Pl,Al,Dl,Il,Ml,Ol,Rl,Nl,kl,Ll,Fl,Bl,Ul,Vl,zl,Gl,Hl,Wl,jl,ql,Yl,Xl,Ql,Zl,Kl,Jl,$l,eu,tu,ru,iu,nu,ou,au,su,lu,uu,cu,du,hu,pu,fu,mu,gu,vu,_u,yu,bu,Cu,wu,Su,Eu,Tu,xu,Pu,Au,Du,Iu,Mu,Ou,Ru,Nu,ku,Lu,Fu,Bu,Uu,Vu,zu,Gu,Hu,Wu,ju,qu,Yu,Xu,Qu,Zu,Ku,Ju,$u,ec,tc,rc,ic,nc,oc,ac,sc,lc,uc,cc,dc,hc,pc,fc,mc,gc,vc,_c,yc,bc,Cc,wc,Sc,Ec,Tc,xc,Pc,Ac,Dc,Ic,Mc,Oc,Rc,Nc,kc,Lc,Fc,Bc,Uc,Vc,zc,Gc,Hc,Wc,jc,qc,Yc,Xc,Qc,Zc,Kc,Jc,$c,ed,td,rd,id,nd,od,ad,sd,ld,ud,cd,dd,hd,pd,fd,md,gd,vd,_d,yd,bd,Cd,wd,Sd,Ed,Td,xd,Pd,Ad,Dd,Id,Md,Od,Rd,Nd,kd,Ld,Fd,Bd,Ud,Vd,zd,Gd,Hd,Wd,jd,qd,Yd,Xd,Qd,Zd,Kd,Jd,$d,eh,th,rh,ih,nh,oh,ah,sh,lh,uh,ch){"use strict";var dh={VERSION:"1.34",_shaders:{}};return dh.appendForwardSlash=e,dh.arrayFill=t,dh.arrayRemoveDuplicates=r,dh.AssociativeArray=i,dh.AttributeCompression=n,dh.AxisAlignedBoundingBox=o,dh.barycentricCoordinates=a,dh.binarySearch=s,dh.BingMapsApi=l,dh.BingMapsGeocoderService=u,dh.BoundingRectangle=c,dh.BoundingSphere=d,dh.BoxGeometry=h,dh.BoxOutlineGeometry=p,dh.buildModuleUrl=f,dh.cancelAnimationFrame=m,dh.Cartesian2=g,dh.Cartesian3=v,dh.Cartesian4=_,dh.Cartographic=y,dh.CartographicGeocoderService=b,dh.CatmullRomSpline=C,dh.CesiumTerrainProvider=w,dh.Check=S,dh.CircleGeometry=E,dh.CircleOutlineGeometry=T,dh.Clock=x,dh.ClockRange=P,dh.ClockStep=A,dh.clone=D,dh.Color=I,dh.ColorGeometryInstanceAttribute=M,dh.combine=O,dh.ComponentDatatype=R,dh.CompressedTextureBuffer=N,dh.CornerType=k,dh.CorridorGeometry=L,dh.CorridorGeometryLibrary=F,dh.CorridorOutlineGeometry=B,dh.createGuid=U,dh.Credit=V,dh.CubicRealPolynomial=z,dh.CylinderGeometry=G,dh.CylinderGeometryLibrary=H,dh.CylinderOutlineGeometry=W,dh.decodeGoogleEarthEnterpriseData=j,dh.DefaultProxy=q,dh.defaultValue=Y,dh.defined=X,dh.defineProperties=Q,dh.deprecationWarning=Z,dh.destroyObject=K,dh.DeveloperError=J,dh.DistanceDisplayCondition=$,dh.DistanceDisplayConditionGeometryInstanceAttribute=ee,dh.EarthOrientationParameters=te,dh.EarthOrientationParametersSample=re,dh.EasingFunction=ie,dh.EllipseGeometry=ne,dh.EllipseGeometryLibrary=oe,dh.EllipseOutlineGeometry=ae,dh.Ellipsoid=se,dh.EllipsoidalOccluder=le,dh.EllipsoidGeodesic=ue,dh.EllipsoidGeometry=ce,dh.EllipsoidOutlineGeometry=de,dh.EllipsoidTangentPlane=he,dh.EllipsoidTerrainProvider=pe,dh.EncodedCartesian3=fe,dh.Event=me,dh.EventHelper=ge,dh.ExtrapolationType=ve,dh.FeatureDetection=_e,dh.formatError=ye,dh.freezeObject=be,dh.Fullscreen=Ce,dh.GeocoderService=we,dh.GeographicProjection=Se,dh.GeographicTilingScheme=Ee,dh.Geometry=Te,dh.GeometryAttribute=xe,dh.GeometryAttributes=Pe,dh.GeometryInstance=Ae,dh.GeometryInstanceAttribute=De,dh.GeometryPipeline=Ie,dh.GeometryType=Me,dh.getAbsoluteUri=Oe,dh.getBaseUri=Re,dh.getExtensionFromUri=Ne,dh.getFilenameFromUri=ke,dh.getImagePixels=Le,dh.getMagic=Fe,dh.getStringFromTypedArray=Be,dh.getTimestamp=Ue,dh.GoogleEarthEnterpriseMetadata=Ve,dh.GoogleEarthEnterpriseTerrainData=ze,dh.GoogleEarthEnterpriseTerrainProvider=Ge,dh.GoogleEarthEnterpriseTileInformation=He,dh.GregorianDate=We,dh.HeadingPitchRange=je,dh.HeadingPitchRoll=qe,dh.HeightmapTerrainData=Ye,dh.HeightmapTessellator=Xe,dh.HermitePolynomialApproximation=Qe,dh.HermiteSpline=Ze,dh.Iau2000Orientation=Ke,dh.Iau2006XysData=Je,dh.Iau2006XysSample=$e,dh.IauOrientationAxes=et,dh.IauOrientationParameters=tt,dh.IndexDatatype=rt,dh.InterpolationAlgorithm=it,dh.Intersect=nt,dh.Intersections2D=ot,dh.IntersectionTests=at,dh.Interval=st,dh.isArray=lt,dh.isBitSet=ut,dh.isCrossOriginUrl=ct,dh.isDataUri=dt,dh.isLeapYear=ht,dh.Iso8601=pt,dh.joinUrls=ft,dh.JulianDate=mt,dh.KeyboardEventModifier=gt,dh.LagrangePolynomialApproximation=vt,dh.LeapSecond=_t,dh.LinearApproximation=yt,dh.LinearSpline=bt,dh.loadArrayBuffer=Ct,dh.loadBlob=wt,dh.loadCRN=St,dh.loadImage=Et,dh.loadImageFromTypedArray=Tt,dh.loadImageViaBlob=xt,dh.loadJson=Pt,dh.loadJsonp=At,dh.loadKTX=Dt,dh.loadText=It,dh.loadWithXhr=Mt,dh.loadXML=Ot,dh.MapboxApi=Rt,dh.MapProjection=Nt,dh.Math=kt,dh.Matrix2=Lt,dh.Matrix3=Ft,dh.Matrix4=Bt,dh.mergeSort=Ut,dh.NearFarScalar=Vt,dh.objectToQuery=zt,dh.Occluder=Gt,dh.oneTimeWarning=Ht,dh.OrientedBoundingBox=Wt,dh.Packable=jt,dh.PackableForInterpolation=qt,dh.parseResponseHeaders=Yt,dh.PinBuilder=Xt,dh.PixelFormat=Qt,dh.Plane=Zt,dh.pointInsideTriangle=Kt,dh.PolygonGeometry=Jt,dh.PolygonGeometryLibrary=$t,dh.PolygonHierarchy=er,dh.PolygonOutlineGeometry=tr,dh.PolygonPipeline=rr,dh.PolylineGeometry=ir,dh.PolylinePipeline=nr,dh.PolylineVolumeGeometry=or,dh.PolylineVolumeGeometryLibrary=ar,dh.PolylineVolumeOutlineGeometry=sr,dh.PrimitiveType=lr,dh.QuadraticRealPolynomial=ur,dh.QuantizedMeshTerrainData=cr,dh.QuarticRealPolynomial=dr,dh.Quaternion=hr,dh.QuaternionSpline=pr,dh.queryToObject=fr,dh.Queue=mr,dh.Ray=gr,dh.Rectangle=vr,dh.RectangleGeometry=_r,dh.RectangleGeometryLibrary=yr,dh.RectangleOutlineGeometry=br,dh.ReferenceFrame=Cr,dh.requestAnimationFrame=wr,dh.RequestErrorEvent=Sr,dh.RuntimeError=Er,dh.sampleTerrain=Tr,dh.sampleTerrainMostDetailed=xr,dh.scaleToGeodeticSurface=Pr,dh.ScreenSpaceEventHandler=Ar,dh.ScreenSpaceEventType=Dr,dh.ShowGeometryInstanceAttribute=Ir,dh.Simon1994PlanetaryPositions=Mr,dh.SimplePolylineGeometry=Or,dh.SphereGeometry=Rr,dh.SphereOutlineGeometry=Nr,dh.Spherical=kr,dh.Spline=Lr,dh.subdivideArray=Fr,dh.TaskProcessor=Br,dh.TerrainData=Ur,dh.TerrainEncoding=Vr,dh.TerrainMesh=zr,dh.TerrainProvider=Gr,dh.TerrainQuantization=Hr,dh.throttleRequestByServer=Wr,dh.TileAvailability=jr,dh.TileProviderError=qr,dh.TilingScheme=Yr,dh.TimeConstants=Xr,dh.TimeInterval=Qr,dh.TimeIntervalCollection=Zr,dh.TimeStandard=Kr,dh.Tipsify=Jr,dh.Transforms=$r,dh.TranslationRotationScale=ei,dh.TridiagonalSystemSolver=ti,dh.TrustedServers=ri,dh.VertexFormat=ii,dh.VideoSynchronizer=ni,dh.Visibility=oi,dh.VRTheWorldTerrainProvider=ai,dh.WallGeometry=si,dh.WallGeometryLibrary=li,dh.WallOutlineGeometry=ui,dh.WebGLConstants=ci,dh.WebMercatorProjection=di,dh.WebMercatorTilingScheme=hi,dh.WindingOrder=pi,dh.wrapFunction=fi,dh.writeTextToCanvas=mi, +dh.BillboardGraphics=gi,dh.BillboardVisualizer=vi,dh.BoundingSphereState=_i,dh.BoxGeometryUpdater=yi,dh.BoxGraphics=bi,dh.CallbackProperty=Ci,dh.CheckerboardMaterialProperty=wi,dh.ColorMaterialProperty=Si,dh.CompositeEntityCollection=Ei,dh.CompositeMaterialProperty=Ti,dh.CompositePositionProperty=xi,dh.CompositeProperty=Pi,dh.ConstantPositionProperty=Ai,dh.ConstantProperty=Di,dh.CorridorGeometryUpdater=Ii,dh.CorridorGraphics=Mi,dh.createMaterialPropertyDescriptor=Oi,dh.createPropertyDescriptor=Ri,dh.createRawPropertyDescriptor=Ni,dh.CustomDataSource=ki,dh.CylinderGeometryUpdater=Li,dh.CylinderGraphics=Fi,dh.CzmlDataSource=Bi,dh.DataSource=Ui,dh.DataSourceClock=Vi,dh.DataSourceCollection=zi,dh.DataSourceDisplay=Gi,dh.dynamicGeometryGetBoundingSphere=Hi,dh.DynamicGeometryUpdater=Wi,dh.EllipseGeometryUpdater=ji,dh.EllipseGraphics=qi,dh.EllipsoidGeometryUpdater=Yi,dh.EllipsoidGraphics=Xi,dh.Entity=Qi,dh.EntityCluster=Zi,dh.EntityCollection=Ki,dh.EntityView=Ji,dh.GeoJsonDataSource=$i,dh.GeometryUpdater=en,dh.GeometryVisualizer=tn,dh.GridMaterialProperty=rn,dh.ImageMaterialProperty=nn,dh.KmlDataSource=on,dh.LabelGraphics=an,dh.LabelVisualizer=sn,dh.MaterialProperty=ln,dh.ModelGraphics=un,dh.ModelVisualizer=cn,dh.NodeTransformationProperty=dn,dh.PathGraphics=hn,dh.PathVisualizer=pn,dh.PointGraphics=fn,dh.PointVisualizer=mn,dh.PolygonGeometryUpdater=gn,dh.PolygonGraphics=vn,dh.PolylineArrowMaterialProperty=_n,dh.PolylineDashMaterialProperty=yn,dh.PolylineGeometryUpdater=bn,dh.PolylineGlowMaterialProperty=Cn,dh.PolylineGraphics=wn,dh.PolylineOutlineMaterialProperty=Sn,dh.PolylineVolumeGeometryUpdater=En,dh.PolylineVolumeGraphics=Tn,dh.PositionProperty=xn,dh.PositionPropertyArray=Pn,dh.Property=An,dh.PropertyArray=Dn,dh.PropertyBag=In,dh.RectangleGeometryUpdater=Mn,dh.RectangleGraphics=On,dh.ReferenceProperty=Rn,dh.Rotation=Nn,dh.SampledPositionProperty=kn,dh.SampledProperty=Ln,dh.ScaledPositionProperty=Fn,dh.StaticGeometryColorBatch=Bn,dh.StaticGeometryPerMaterialBatch=Un,dh.StaticGroundGeometryColorBatch=Vn,dh.StaticOutlineGeometryBatch=zn,dh.StripeMaterialProperty=Gn,dh.StripeOrientation=Hn,dh.TimeIntervalCollectionPositionProperty=Wn,dh.TimeIntervalCollectionProperty=jn,dh.VelocityOrientationProperty=qn,dh.VelocityVectorProperty=Yn,dh.Visualizer=Xn,dh.WallGeometryUpdater=Qn,dh.WallGraphics=Zn,dh.AutomaticUniforms=Kn,dh.Buffer=Jn,dh.BufferUsage=$n,dh.ClearCommand=eo,dh.ComputeCommand=to,dh.ComputeEngine=ro,dh.Context=io,dh.ContextLimits=no,dh.createUniform=oo,dh.createUniformArray=ao,dh.CubeMap=so,dh.CubeMapFace=lo,dh.DrawCommand=uo,dh.Framebuffer=co,dh.loadCubeMap=ho,dh.MipmapHint=po,dh.Pass=fo,dh.PassState=mo,dh.PickFramebuffer=go,dh.PixelDatatype=vo,dh.Renderbuffer=_o,dh.RenderbufferFormat=yo,dh.RenderState=bo,dh.Sampler=Co,dh.ShaderCache=wo,dh.ShaderProgram=So,dh.ShaderSource=Eo,dh.Texture=To,dh.TextureMagnificationFilter=xo,dh.TextureMinificationFilter=Po,dh.TextureWrap=Ao,dh.UniformState=Do,dh.VertexArray=Io,dh.VertexArrayFacade=Mo,dh.Appearance=Oo,dh.ArcGisMapServerImageryProvider=Ro,dh.Axis=No,dh.BatchTable=ko,dh.Billboard=Lo,dh.BillboardCollection=Fo,dh.BingMapsImageryProvider=Bo,dh.BingMapsStyle=Uo,dh.BlendEquation=Vo,dh.BlendFunction=zo,dh.BlendingState=Go,dh.BlendOption=Ho,dh.Camera=Wo,dh.CameraEventAggregator=jo,dh.CameraEventType=qo,dh.CameraFlightPath=Yo,dh.ColorBlendMode=Xo,dh.createOpenStreetMapImageryProvider=Qo,dh.createTangentSpaceDebugPrimitive=Zo,dh.createTileMapServiceImageryProvider=Ko,dh.CreditDisplay=Jo,dh.CullFace=$o,dh.CullingVolume=ea,dh.DebugAppearance=ta,dh.DebugCameraPrimitive=ra,dh.DebugModelMatrixPrimitive=ia,dh.DepthFunction=na,dh.DepthPlane=oa,dh.DeviceOrientationCameraController=aa,dh.DiscardMissingTileImagePolicy=sa,dh.EllipsoidPrimitive=la,dh.EllipsoidSurfaceAppearance=ua,dh.Fog=ca,dh.FrameRateMonitor=da,dh.FrameState=ha,dh.FrustumCommands=pa,dh.FXAA=fa,dh.getAttributeOrUniformBySemantic=ma,dh.getBinaryAccessor=ga,dh.GetFeatureInfoFormat=va,dh.Globe=_a,dh.GlobeDepth=ya,dh.GlobeSurfaceShaderSet=ba,dh.GlobeSurfaceTile=Ca,dh.GlobeSurfaceTileProvider=wa,dh.GoogleEarthEnterpriseImageryProvider=Sa,dh.GoogleEarthImageryProvider=Ea,dh.GridImageryProvider=Ta,dh.GroundPrimitive=xa,dh.HeightReference=Pa,dh.HorizontalOrigin=Aa,dh.Imagery=Da,dh.ImageryLayer=Ia,dh.ImageryLayerCollection=Ma,dh.ImageryLayerFeatureInfo=Oa,dh.ImageryProvider=Ra,dh.ImagerySplitDirection=Na,dh.ImageryState=ka,dh.JobScheduler=La,dh.JobType=Fa,dh.Label=Ba,dh.LabelCollection=Ua,dh.LabelStyle=Va,dh.MapboxImageryProvider=za,dh.MapMode2D=Ga,dh.Material=Ha,dh.MaterialAppearance=Wa,dh.Model=ja,dh.ModelAnimation=qa,dh.ModelAnimationCache=Ya,dh.ModelAnimationCollection=Xa,dh.ModelAnimationLoop=Qa,dh.ModelAnimationState=Za,dh.ModelMaterial=Ka,dh.modelMaterialsCommon=Ja,dh.ModelMesh=$a,dh.ModelNode=es,dh.Moon=ts,dh.NeverTileDiscardPolicy=rs,dh.OIT=is,dh.OrthographicFrustum=ns,dh.OrthographicOffCenterFrustum=os,dh.PerformanceDisplay=as,dh.PerInstanceColorAppearance=ss,dh.PerspectiveFrustum=ls,dh.PerspectiveOffCenterFrustum=us,dh.PickDepth=cs,dh.PointPrimitive=ds,dh.PointPrimitiveCollection=hs,dh.Polyline=ps,dh.PolylineCollection=fs,dh.PolylineColorAppearance=ms,dh.PolylineMaterialAppearance=gs,dh.Primitive=vs,dh.PrimitiveCollection=_s,dh.PrimitivePipeline=ys,dh.PrimitiveState=bs,dh.QuadtreeOccluders=Cs,dh.QuadtreePrimitive=ws,dh.QuadtreeTile=Ss,dh.QuadtreeTileLoadState=Es,dh.QuadtreeTileProvider=Ts,dh.Scene=xs,dh.SceneMode=Ps,dh.SceneTransforms=As,dh.SceneTransitioner=Ds,dh.ScreenSpaceCameraController=Is,dh.ShadowMap=Ms,dh.ShadowMapShader=Os,dh.ShadowMode=Rs,dh.SingleTileImageryProvider=Ns,dh.SkyAtmosphere=ks,dh.SkyBox=Ls,dh.StencilFunction=Fs,dh.StencilOperation=Bs,dh.Sun=Us,dh.SunPostProcess=Vs,dh.TerrainState=zs,dh.TextureAtlas=Gs,dh.TileBoundingRegion=Hs,dh.TileBoundingSphere=Ws,dh.TileBoundingVolume=js,dh.TileCoordinatesImageryProvider=qs,dh.TileDiscardPolicy=Ys,dh.TileImagery=Xs,dh.TileOrientedBoundingBox=Qs,dh.TileReplacementQueue=Zs,dh.TileState=Ks,dh.TileTerrain=Js,dh.TweenCollection=$s,dh.UrlTemplateImageryProvider=el,dh.VerticalOrigin=tl,dh.ViewportQuad=rl,dh.WebMapServiceImageryProvider=il,dh.WebMapTileServiceImageryProvider=nl,dh._shaders.AdjustTranslucentFS=ol,dh._shaders.AllMaterialAppearanceFS=al,dh._shaders.AllMaterialAppearanceVS=sl,dh._shaders.BasicMaterialAppearanceFS=ll,dh._shaders.BasicMaterialAppearanceVS=ul,dh._shaders.EllipsoidSurfaceAppearanceFS=cl,dh._shaders.EllipsoidSurfaceAppearanceVS=dl,dh._shaders.PerInstanceColorAppearanceFS=hl,dh._shaders.PerInstanceColorAppearanceVS=pl,dh._shaders.PerInstanceFlatColorAppearanceFS=fl,dh._shaders.PerInstanceFlatColorAppearanceVS=ml,dh._shaders.PolylineColorAppearanceVS=gl,dh._shaders.PolylineMaterialAppearanceVS=vl,dh._shaders.TexturedMaterialAppearanceFS=_l,dh._shaders.TexturedMaterialAppearanceVS=yl,dh._shaders.BillboardCollectionFS=bl,dh._shaders.BillboardCollectionVS=Cl,dh._shaders.degreesPerRadian=wl,dh._shaders.depthRange=Sl,dh._shaders.epsilon1=El,dh._shaders.epsilon2=Tl,dh._shaders.epsilon3=xl,dh._shaders.epsilon4=Pl,dh._shaders.epsilon5=Al,dh._shaders.epsilon6=Dl,dh._shaders.epsilon7=Il,dh._shaders.infinity=Ml,dh._shaders.oneOverPi=Ol,dh._shaders.oneOverTwoPi=Rl,dh._shaders.passCompute=Nl,dh._shaders.passEnvironment=kl,dh._shaders.passGlobe=Ll,dh._shaders.passGround=Fl,dh._shaders.passOpaque=Bl,dh._shaders.passOverlay=Ul,dh._shaders.passTranslucent=Vl,dh._shaders.pi=zl,dh._shaders.piOverFour=Gl,dh._shaders.piOverSix=Hl,dh._shaders.piOverThree=Wl,dh._shaders.piOverTwo=jl,dh._shaders.radiansPerDegree=ql,dh._shaders.sceneMode2D=Yl,dh._shaders.sceneMode3D=Xl,dh._shaders.sceneModeColumbusView=Ql,dh._shaders.sceneModeMorphing=Zl,dh._shaders.solarRadius=Kl,dh._shaders.threePiOver2=Jl,dh._shaders.twoPi=$l,dh._shaders.webMercatorMaxLatitude=eu,dh._shaders.CzmBuiltins=tu,dh._shaders.alphaWeight=ru,dh._shaders.antialias=iu,dh._shaders.cascadeColor=nu,dh._shaders.cascadeDistance=ou,dh._shaders.cascadeMatrix=au,dh._shaders.cascadeWeights=su,dh._shaders.columbusViewMorph=lu,dh._shaders.computePosition=uu,dh._shaders.cosineAndSine=cu,dh._shaders.decompressTextureCoordinates=du,dh._shaders.eastNorthUpToEyeCoordinates=hu,dh._shaders.ellipsoidContainsPoint=pu,dh._shaders.ellipsoidNew=fu,dh._shaders.ellipsoidWgs84TextureCoordinates=mu,dh._shaders.equalsEpsilon=gu,dh._shaders.eyeOffset=vu,dh._shaders.eyeToWindowCoordinates=_u,dh._shaders.fog=yu,dh._shaders.geodeticSurfaceNormal=bu,dh._shaders.getDefaultMaterial=Cu,dh._shaders.getLambertDiffuse=wu,dh._shaders.getSpecular=Su,dh._shaders.getWaterNoise=Eu,dh._shaders.getWgs84EllipsoidEC=Tu,dh._shaders.HSBToRGB=xu,dh._shaders.HSLToRGB=Pu,dh._shaders.hue=Au,dh._shaders.isEmpty=Du,dh._shaders.isFull=Iu,dh._shaders.latitudeToWebMercatorFraction=Mu,dh._shaders.luminance=Ou,dh._shaders.metersPerPixel=Ru,dh._shaders.modelToWindowCoordinates=Nu,dh._shaders.multiplyWithColorBalance=ku,dh._shaders.nearFarScalar=Lu,dh._shaders.octDecode=Fu,dh._shaders.packDepth=Bu,dh._shaders.phong=Uu,dh._shaders.pointAlongRay=Vu,dh._shaders.rayEllipsoidIntersectionInterval=zu,dh._shaders.RGBToHSB=Gu,dh._shaders.RGBToHSL=Hu,dh._shaders.RGBToXYZ=Wu,dh._shaders.saturation=ju,dh._shaders.shadowDepthCompare=qu,dh._shaders.shadowVisibility=Yu,dh._shaders.signNotZero=Xu,dh._shaders.tangentToEyeSpaceMatrix=Qu,dh._shaders.translateRelativeToEye=Zu,dh._shaders.translucentPhong=Ku,dh._shaders.transpose=Ju,dh._shaders.unpackDepth=$u,dh._shaders.windowToEyeCoordinates=ec,dh._shaders.XYZToRGB=tc,dh._shaders.depthRangeStruct=rc,dh._shaders.ellipsoid=ic,dh._shaders.material=nc,dh._shaders.materialInput=oc,dh._shaders.ray=ac,dh._shaders.raySegment=sc,dh._shaders.shadowParameters=lc,dh._shaders.CompositeOITFS=uc,dh._shaders.DepthPlaneFS=cc,dh._shaders.DepthPlaneVS=dc,dh._shaders.EllipsoidFS=hc,dh._shaders.EllipsoidVS=pc,dh._shaders.GlobeFS=fc,dh._shaders.GlobeVS=mc,dh._shaders.GroundAtmosphere=gc,dh._shaders.BumpMapMaterial=vc,dh._shaders.CheckerboardMaterial=_c,dh._shaders.DotMaterial=yc,dh._shaders.FadeMaterial=bc,dh._shaders.GridMaterial=Cc,dh._shaders.NormalMapMaterial=wc,dh._shaders.PolylineArrowMaterial=Sc,dh._shaders.PolylineDashMaterial=Ec,dh._shaders.PolylineGlowMaterial=Tc,dh._shaders.PolylineOutlineMaterial=xc,dh._shaders.RimLightingMaterial=Pc,dh._shaders.StripeMaterial=Ac,dh._shaders.Water=Dc,dh._shaders.PointPrimitiveCollectionFS=Ic,dh._shaders.PointPrimitiveCollectionVS=Mc,dh._shaders.PolylineCommon=Oc,dh._shaders.PolylineFS=Rc,dh._shaders.PolylineVS=Nc,dh._shaders.AdditiveBlend=kc,dh._shaders.BrightPass=Lc,dh._shaders.FXAA=Fc,dh._shaders.GaussianBlur1D=Bc,dh._shaders.PassThrough=Uc,dh._shaders.ReprojectWebMercatorFS=Vc,dh._shaders.ReprojectWebMercatorVS=zc,dh._shaders.ShadowVolumeFS=Gc,dh._shaders.ShadowVolumeVS=Hc,dh._shaders.SkyAtmosphereFS=Wc,dh._shaders.SkyAtmosphereVS=jc,dh._shaders.SkyBoxFS=qc,dh._shaders.SkyBoxVS=Yc,dh._shaders.SunFS=Xc,dh._shaders.SunTextureFS=Qc,dh._shaders.SunVS=Zc,dh._shaders.ViewportQuadFS=Kc,dh._shaders.ViewportQuadVS=Jc,dh.Autolinker=$c,dh.crunch=ed,dh["earcut-2.1.1"]=td,dh.gltfDefaults=rd,dh["google-earth-dbroot-parser"]=id,dh.kdbush=nd,dh["knockout-3.4.0"]=od,dh["knockout-es5"]=ad,dh.knockout=sd,dh.measureText=ld,dh["mersenne-twister"]=ud,dh.NoSleep=cd,dh.pako_inflate=dd,dh["protobuf-minimal"]=hd,dh.FXAA3_11=pd,dh.sprintf=fd,dh.topojson=md,dh.Tween=gd,dh.Uri=vd,dh.when=_d,dh.zip=yd,dh.Animation=bd,dh.AnimationViewModel=Cd,dh.BaseLayerPicker=wd,dh.BaseLayerPickerViewModel=Sd,dh.createDefaultImageryProviderViewModels=Ed,dh.createDefaultTerrainProviderViewModels=Td,dh.ProviderViewModel=xd,dh.CesiumInspector=Pd,dh.CesiumInspectorViewModel=Ad,dh.CesiumWidget=Dd,dh.ClockViewModel=Id,dh.Command=Md,dh.createCommand=Od,dh.FullscreenButton=Rd,dh.FullscreenButtonViewModel=Nd,dh.Geocoder=kd,dh.GeocoderViewModel=Ld,dh.getElement=Fd,dh.HomeButton=Bd,dh.HomeButtonViewModel=Ud,dh.InfoBox=Vd,dh.InfoBoxViewModel=zd,dh.NavigationHelpButton=Gd,dh.NavigationHelpButtonViewModel=Hd,dh.PerformanceWatchdog=Wd,dh.PerformanceWatchdogViewModel=jd,dh.ProjectionPicker=qd,dh.ProjectionPickerViewModel=Yd,dh.SceneModePicker=Xd,dh.SceneModePickerViewModel=Qd,dh.SelectionIndicator=Zd,dh.SelectionIndicatorViewModel=Kd,dh.subscribeAndEvaluate=Jd,dh.SvgPathBindingHandler=$d,dh.Timeline=eh,dh.TimelineHighlightRange=th,dh.TimelineTrack=rh,dh.ToggleButtonViewModel=ih,dh.Viewer=nh,dh.viewerCesiumInspectorMixin=oh,dh.viewerDragDropMixin=ah,dh.viewerPerformanceWatchdogMixin=sh,dh.VRButton=lh,dh.VRButtonViewModel=uh,dh.createTaskProcessorWorker=ch,dh}),require(["Cesium"],function(e){"use strict";var t="undefined"!=typeof window?window:"undefined"!=typeof self?self:{};t.Cesium=e},void 0,!0)}(); \ No newline at end of file diff --git a/engines/Cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css b/engines/Cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css index b5e1619..8c0f1d8 100644 --- a/engines/Cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +++ b/engines/Cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css @@ -1 +1 @@ -.cesium-baseLayerPicker-selected{position:absolute;top:0;left:0;width:100%;height:100%;border:none;}.cesium-baseLayerPicker-dropDown{display:block;position:absolute;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;top:auto;right:0;width:320px;max-height:500px;margin-top:5px;background-color:rgba(38,38,38,0.75);border:1px solid #444;padding:6px;overflow:auto;border-radius:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:translate(0,-20%);-moz-transform:translate(0,-20%);transform:translate(0,-20%);visibility:hidden;opacity:0;-webkit-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-webkit-transform 0.2s ease-in;-moz-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-moz-transform 0.2s ease-in;transition:visibility 0s 0.2s,opacity 0.2s ease-in,transform 0.2s ease-in;}.cesium-baseLayerPicker-dropDown-visible{-webkit-transform:translate(0,0);-moz-transform:translate(0,0);transform:translate(0,0);visibility:visible;opacity:1;-webkit-transition:opacity 0.2s ease-out,-webkit-transform 0.2s ease-out;-moz-transition:opacity 0.2s ease-out,-moz-transform 0.2s ease-out;transition:opacity 0.2s ease-out,transform 0.2s ease-out;}.cesium-baseLayerPicker-sectionTitle{display:block;font-family:sans-serif;font-size:16pt;text-align:left;color:#edffff;border-bottom:1px solid #888;margin-bottom:4px;}.cesium-baseLayerPicker-choices{display:block;position:relative;top:auto;right:0;}.cesium-baseLayerPicker-item{display:inline-block;vertical-align:top;margin:2px 5px;width:64px;text-align:center;cursor:pointer;}.cesium-baseLayerPicker-itemLabel{display:block;font-family:sans-serif;font-size:8pt;text-align:center;vertical-align:middle;color:#edffff;cursor:pointer;word-wrap:break-word;}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel,.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel{text-decoration:underline;}.cesium-baseLayerPicker-itemIcon{display:inline-block;position:relative;width:inherit;height:auto;background-size:100% 100%;border:solid 1px #444;border-radius:9px;color:#edffff;margin:0;padding:0;cursor:pointer;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#fff;box-shadow:0 0 8px #fff,0 0 8px #fff;}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:rgb(189,236,248);}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px rgb(189,236,248);} \ No newline at end of file +.cesium-baseLayerPicker-selected{position:absolute;top:0;left:0;width:100%;height:100%;border:none;}.cesium-baseLayerPicker-dropDown{display:block;position:absolute;box-sizing:content-box;top:auto;right:0;width:320px;max-height:500px;margin-top:5px;background-color:rgba(38,38,38,0.75);border:1px solid #444;padding:6px;overflow:auto;border-radius:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;transform:translate(0,-20%);visibility:hidden;opacity:0;transition:visibility 0s 0.2s,opacity 0.2s ease-in,transform 0.2s ease-in;}.cesium-baseLayerPicker-dropDown-visible{transform:translate(0,0);visibility:visible;opacity:1;transition:opacity 0.2s ease-out,transform 0.2s ease-out;}.cesium-baseLayerPicker-sectionTitle{display:block;font-family:sans-serif;font-size:16pt;text-align:left;color:#edffff;border-bottom:1px solid #888;margin-bottom:4px;}.cesium-baseLayerPicker-choices{display:block;position:relative;top:auto;right:0;}.cesium-baseLayerPicker-item{display:inline-block;vertical-align:top;margin:2px 5px;width:64px;text-align:center;cursor:pointer;}.cesium-baseLayerPicker-itemLabel{display:block;font-family:sans-serif;font-size:8pt;text-align:center;vertical-align:middle;color:#edffff;cursor:pointer;word-wrap:break-word;}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel,.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel{text-decoration:underline;}.cesium-baseLayerPicker-itemIcon{display:inline-block;position:relative;width:inherit;height:auto;background-size:100% 100%;border:solid 1px #444;border-radius:9px;color:#edffff;margin:0;padding:0;cursor:pointer;box-sizing:border-box;}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#fff;box-shadow:0 0 8px #fff,0 0 8px #fff;}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:rgb(189,236,248);}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px rgb(189,236,248);} \ No newline at end of file diff --git a/engines/Cesium/Widgets/CesiumInspector/CesiumInspector.css b/engines/Cesium/Widgets/CesiumInspector/CesiumInspector.css index 9bde0e3..da76d27 100644 --- a/engines/Cesium/Widgets/CesiumInspector/CesiumInspector.css +++ b/engines/Cesium/Widgets/CesiumInspector/CesiumInspector.css @@ -1 +1 @@ -.cesium-cesiumInspector{border-radius:5px;-webkit-transition:width ease-in-out 0.25s;-moz-transition:width ease-in-out 0.25s;transition:width ease-in-out 0.25s;background:rgba(48,51,54,0.8);border:1px solid #444;color:#edffff;display:inline-block;position:relative;padding:4px 12px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;}.cesium-cesiumInspector-button{text-align:center;font-size:11pt;}.cesium-cesiumInspector-visible .cesium-cesiumInspector-button{border-bottom:1px solid #aaa;padding-bottom:3px;}.cesium-cesiumInspector input:enabled,.cesium-cesiumInspector-button{cursor:pointer;}.cesium-cesiumInspector-visible{width:185px;height:auto;}.cesium-cesiumInspector-hidden{width:122px;height:17px;}.cesium-cesiumInspector-show{max-height:500px;}.cesium-cesiumInspector-hide{max-height:0;padding:0 !important;overflow:hidden;}.cesium-cesiumInspector-dropDown{margin:5px 0;font-family:sans-serif;font-size:10pt;width:185px;}.cesium-cesiumInspector-frustumStats{padding-left:10px;padding:5px;background-color:rgba(80,80,80,0.75);}.cesium-cesiumInspector-pickButton{background-color:rgba(0,0,0,0.3);border:1px solid #444;color:#edffff;border-radius:5px;padding:3px 7px;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;margin:0 auto;}.cesium-cesiumInspector-pickButton:focus{outline:none;}.cesium-cesiumInspector-pickButton:active,.cesium-cesiumInspector-pickButtonHighlight{color:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-cesiumInspector-center{text-align:center;}.cesium-cesiumInspector-sectionHeader{font-weight:bold;}.cesium-cesiumInspector-pickSection{border:1px solid #aaa;border-radius:5px;padding:3px;margin-bottom:5px;}.cesium-cesiumInspector-section{margin-bottom:10px;-webkit-transition:max-height 0.25s;-moz-transition:max-height 0.25s;transition:max-height 0.25s;}.cesium-cesiumInspector-toggleSwitch{padding:3px;cursor:pointer;}.cesium-cesiumInspector-tileText{padding-bottom:10px;border-bottom:1px solid #aaa;}.cesium-cesiumInspector-relativeText{padding-top:10px;} \ No newline at end of file +.cesium-cesiumInspector{border-radius:5px;transition:width ease-in-out 0.25s;background:rgba(48,51,54,0.8);border:1px solid #444;color:#edffff;display:inline-block;position:relative;padding:4px 12px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;}.cesium-cesiumInspector-button{text-align:center;font-size:11pt;}.cesium-cesiumInspector-visible .cesium-cesiumInspector-button{border-bottom:1px solid #aaa;padding-bottom:3px;}.cesium-cesiumInspector input:enabled,.cesium-cesiumInspector-button{cursor:pointer;}.cesium-cesiumInspector-visible{width:185px;height:auto;}.cesium-cesiumInspector-hidden{width:122px;height:17px;}.cesium-cesiumInspector-show{max-height:500px;}.cesium-cesiumInspector-hide{max-height:0;padding:0 !important;overflow:hidden;}.cesium-cesiumInspector-dropDown{margin:5px 0;font-family:sans-serif;font-size:10pt;width:185px;}.cesium-cesiumInspector-frustumStats{padding-left:10px;padding:5px;background-color:rgba(80,80,80,0.75);}.cesium-cesiumInspector-pickButton{background-color:rgba(0,0,0,0.3);border:1px solid #444;color:#edffff;border-radius:5px;padding:3px 7px;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;margin:0 auto;}.cesium-cesiumInspector-pickButton:focus{outline:none;}.cesium-cesiumInspector-pickButton:active,.cesium-cesiumInspector-pickButtonHighlight{color:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-cesiumInspector-center{text-align:center;}.cesium-cesiumInspector-sectionHeader{font-weight:bold;}.cesium-cesiumInspector-pickSection{border:1px solid #aaa;border-radius:5px;padding:3px;margin-bottom:5px;}.cesium-cesiumInspector-section{margin-bottom:10px;transition:max-height 0.25s;}.cesium-cesiumInspector-toggleSwitch{padding:3px;cursor:pointer;}.cesium-cesiumInspector-tileText{padding-bottom:10px;border-bottom:1px solid #aaa;}.cesium-cesiumInspector-relativeText{padding-top:10px;} \ No newline at end of file diff --git a/engines/Cesium/Widgets/Geocoder/Geocoder.css b/engines/Cesium/Widgets/Geocoder/Geocoder.css index 0871a5b..c5fa0e8 100644 --- a/engines/Cesium/Widgets/Geocoder/Geocoder.css +++ b/engines/Cesium/Widgets/Geocoder/Geocoder.css @@ -1 +1 @@ -.cesium-viewer-geocoderContainer .cesium-geocoder-input{border:solid 1px #444;background-color:rgba(40,40,40,0.7);color:white;display:inline-block;vertical-align:middle;width:0;height:32px;margin:0;padding:0 32px 0 0;border-radius:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-moz-transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-webkit-appearance:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{border-color:#ea4;background-color:rgba(15,15,15,0.9);box-shadow:none;outline:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input,.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide{padding-left:4px;width:250px;}.cesium-viewer-geocoderContainer .search-results{position:absolute;background-color:#000;color:#eee;overflow-y:auto;opacity:0.8;width:100%;}.cesium-viewer-geocoderContainer .search-results ul{list-style-type:none;margin:0;padding:0;}.cesium-viewer-geocoderContainer .search-results ul li{font-size:14px;padding:3px 10px;}.cesium-viewer-geocoderContainer .search-results ul li:hover{cursor:pointer;}.cesium-viewer-geocoderContainer .search-results ul li.active{background:#48b;}.cesium-geocoder-searchButton{background-color:#303336;display:inline-block;position:absolute;cursor:pointer;width:32px;top:1px;right:1px;height:30px;vertical-align:middle;fill:#edffff;}.cesium-geocoder-searchButton:hover{background-color:#48b;} \ No newline at end of file +.cesium-viewer-geocoderContainer .cesium-geocoder-input{border:solid 1px #444;background-color:rgba(40,40,40,0.7);color:white;display:inline-block;vertical-align:middle;width:0;height:32px;margin:0;padding:0 32px 0 0;border-radius:0;box-sizing:border-box;transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-webkit-appearance:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{border-color:#ea4;background-color:rgba(15,15,15,0.9);box-shadow:none;outline:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input,.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide{padding-left:4px;width:250px;}.cesium-viewer-geocoderContainer .search-results{position:absolute;background-color:#000;color:#eee;overflow-y:auto;opacity:0.8;width:100%;}.cesium-viewer-geocoderContainer .search-results ul{list-style-type:none;margin:0;padding:0;}.cesium-viewer-geocoderContainer .search-results ul li{font-size:14px;padding:3px 10px;}.cesium-viewer-geocoderContainer .search-results ul li:hover{cursor:pointer;}.cesium-viewer-geocoderContainer .search-results ul li.active{background:#48b;}.cesium-geocoder-searchButton{background-color:#303336;display:inline-block;position:absolute;cursor:pointer;width:32px;top:1px;right:1px;height:30px;vertical-align:middle;fill:#edffff;}.cesium-geocoder-searchButton:hover{background-color:#48b;} \ No newline at end of file diff --git a/engines/Cesium/Widgets/InfoBox/InfoBox.css b/engines/Cesium/Widgets/InfoBox/InfoBox.css index 8a97760..ae80f74 100644 --- a/engines/Cesium/Widgets/InfoBox/InfoBox.css +++ b/engines/Cesium/Widgets/InfoBox/InfoBox.css @@ -1 +1 @@ -.cesium-infoBox{display:block;position:absolute;top:50px;right:0;width:40%;max-width:480px;background:rgba(38,38,38,0.95);color:#edffff;border:1px solid #444;border-right:none;border-top-left-radius:7px;border-bottom-left-radius:7px;box-shadow:0 0 10px 1px #000;-webkit-transform:translate(100%,0);-moz-transform:translate(100%,0);transform:translate(100%,0);visibility:hidden;opacity:0;-webkit-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-webkit-transform 0.2s ease-in;-moz-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-moz-transform 0.2s ease-in;transition:visibility 0s 0.2s,opacity 0.2s ease-in,transform 0.2s ease-in;}.cesium-infoBox-visible{-webkit-transform:translate(0,0);-moz-transform:translate(0,0);transform:translate(0,0);visibility:visible;opacity:1;-webkit-transition:opacity 0.2s ease-out,-webkit-transform 0.2s ease-out;-moz-transition:opacity 0.2s ease-out,-moz-transform 0.2s ease-out;transition:opacity 0.2s ease-out,transform 0.2s ease-out;}.cesium-infoBox-title{display:block;height:20px;padding:5px 30px 5px 25px;background:rgba(84,84,84,1.0);border-top-left-radius:7px;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}.cesium-infoBox-bodyless .cesium-infoBox-title{border-bottom-left-radius:7px;}button.cesium-infoBox-camera{display:block;position:absolute;top:4px;left:4px;width:22px;height:22px;background:transparent;border-color:transparent;border-radius:3px;padding:0 5px;margin:0;}button.cesium-infoBox-close{display:block;position:absolute;top:5px;right:5px;height:20px;background:transparent;border:none;border-radius:2px;font-weight:bold;font-size:16px;padding:0 5px;margin:0;color:#edffff;}button.cesium-infoBox-close:focus{background:rgba(238,136,0,0.44);outline:none;}button.cesium-infoBox-close:hover{background:#888;color:#000;}button.cesium-infoBox-close:active{background:#a00;color:#000;}.cesium-infoBox-bodyless .cesium-infoBox-iframe{display:none;}.cesium-infoBox-iframe{border:none;width:100%;width:calc(100% - 2px);} \ No newline at end of file +.cesium-infoBox{display:block;position:absolute;top:50px;right:0;width:40%;max-width:480px;background:rgba(38,38,38,0.95);color:#edffff;border:1px solid #444;border-right:none;border-top-left-radius:7px;border-bottom-left-radius:7px;box-shadow:0 0 10px 1px #000;transform:translate(100%,0);visibility:hidden;opacity:0;transition:visibility 0s 0.2s,opacity 0.2s ease-in,transform 0.2s ease-in;}.cesium-infoBox-visible{transform:translate(0,0);visibility:visible;opacity:1;transition:opacity 0.2s ease-out,transform 0.2s ease-out;}.cesium-infoBox-title{display:block;height:20px;padding:5px 30px 5px 25px;background:rgba(84,84,84,1.0);border-top-left-radius:7px;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:content-box;}.cesium-infoBox-bodyless .cesium-infoBox-title{border-bottom-left-radius:7px;}button.cesium-infoBox-camera{display:block;position:absolute;top:4px;left:4px;width:22px;height:22px;background:transparent;border-color:transparent;border-radius:3px;padding:0 5px;margin:0;}button.cesium-infoBox-close{display:block;position:absolute;top:5px;right:5px;height:20px;background:transparent;border:none;border-radius:2px;font-weight:bold;font-size:16px;padding:0 5px;margin:0;color:#edffff;}button.cesium-infoBox-close:focus{background:rgba(238,136,0,0.44);outline:none;}button.cesium-infoBox-close:hover{background:#888;color:#000;}button.cesium-infoBox-close:active{background:#a00;color:#000;}.cesium-infoBox-bodyless .cesium-infoBox-iframe{display:none;}.cesium-infoBox-iframe{border:none;width:100%;width:calc(100% - 2px);} \ No newline at end of file diff --git a/engines/Cesium/Widgets/InfoBox/InfoBoxDescription.css b/engines/Cesium/Widgets/InfoBox/InfoBoxDescription.css index e1f346c..4cfac27 100644 --- a/engines/Cesium/Widgets/InfoBox/InfoBoxDescription.css +++ b/engines/Cesium/Widgets/InfoBox/InfoBoxDescription.css @@ -1 +1 @@ -.cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:none;}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-button:disabled,.cesium-button-disabled,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button-disabled:active{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default;}.cesium-button option{background-color:#000;color:#eee;}.cesium-button option:disabled{color:#777;}.cesium-button input,.cesium-button label{cursor:pointer;}.cesium-button input{vertical-align:sub;}.cesium-toolbar-button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0;}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right;}.cesium-performanceDisplay{background-color:rgba(40,40,40,0.7);padding:7px;border-radius:5px;border:1px solid #444;font:bold 12px sans-serif;}.cesium-performanceDisplay-fps{color:#e52;}.cesium-performanceDisplay-ms{color:#de3;}body{margin:0;padding:0;}.cesium-infoBox-description{font-family:sans-serif;font-size:13px;padding:4px 10px;margin-right:4px;color:#edffff;}.cesium-infoBox-description a:link,.cesium-infoBox-description a:visited,.cesium-infoBox-description a:hover,.cesium-infoBox-description a:active{color:#edffff;}.cesium-infoBox-description table{color:#edffff;}.cesium-infoBox-defaultTable{width:100%;color:#edffff;}.cesium-infoBox-defaultTable tr:nth-child(odd){background-color:rgba(84,84,84,0.8);}.cesium-infoBox-defaultTable tr:nth-child(even){background-color:rgba(84,84,84,0.25);}.cesium-infoBox-defaultTable th{font-weight:normal;padding:3px;vertical-align:middle;text-align:center;}.cesium-infoBox-defaultTable td{padding:3px;vertical-align:middle;text-align:left;}.cesium-infoBox-description-lighter{color:#000000;}.cesium-infoBox-description-lighter a:link,.cesium-infoBox-description-lighter a:visited,.cesium-infoBox-description-lighter a:hover,.cesium-infoBox-description-lighter a:active{color:#000000;}.cesium-infoBox-description-lighter table{color:#000000;}.cesium-infoBox-defaultTable-lighter{width:100%;color:#000000;}.cesium-infoBox-defaultTable-lighter tr:nth-child(odd){background-color:rgba(179,179,179,0.8);}.cesium-infoBox-defaultTable-lighter tr:nth-child(even){background-color:rgba(179,179,179,0.25);}.cesium-infoBox-loadingContainer{margin:5px;text-align:center;}.cesium-infoBox-loading{display:inline-block;background-image:url(../Images/info-loading.gif);width:16px;height:11px;} \ No newline at end of file +.cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:none;}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-button:disabled,.cesium-button-disabled,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button-disabled:active{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default;}.cesium-button option{background-color:#000;color:#eee;}.cesium-button option:disabled{color:#777;}.cesium-button input,.cesium-button label{cursor:pointer;}.cesium-button input{vertical-align:sub;}.cesium-toolbar-button{box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0;}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right;}.cesium-performanceDisplay{background-color:rgba(40,40,40,0.7);padding:7px;border-radius:5px;border:1px solid #444;font:bold 12px sans-serif;}.cesium-performanceDisplay-fps{color:#e52;}.cesium-performanceDisplay-ms{color:#de3;}body{margin:0;padding:0;}.cesium-infoBox-description{font-family:sans-serif;font-size:13px;padding:4px 10px;margin-right:4px;color:#edffff;}.cesium-infoBox-description a:link,.cesium-infoBox-description a:visited,.cesium-infoBox-description a:hover,.cesium-infoBox-description a:active{color:#edffff;}.cesium-infoBox-description table{color:#edffff;}.cesium-infoBox-defaultTable{width:100%;color:#edffff;}.cesium-infoBox-defaultTable tr:nth-child(odd){background-color:rgba(84,84,84,0.8);}.cesium-infoBox-defaultTable tr:nth-child(even){background-color:rgba(84,84,84,0.25);}.cesium-infoBox-defaultTable th{font-weight:normal;padding:3px;vertical-align:middle;text-align:center;}.cesium-infoBox-defaultTable td{padding:3px;vertical-align:middle;text-align:left;}.cesium-infoBox-description-lighter{color:#000000;}.cesium-infoBox-description-lighter a:link,.cesium-infoBox-description-lighter a:visited,.cesium-infoBox-description-lighter a:hover,.cesium-infoBox-description-lighter a:active{color:#000000;}.cesium-infoBox-description-lighter table{color:#000000;}.cesium-infoBox-defaultTable-lighter{width:100%;color:#000000;}.cesium-infoBox-defaultTable-lighter tr:nth-child(odd){background-color:rgba(179,179,179,0.8);}.cesium-infoBox-defaultTable-lighter tr:nth-child(even){background-color:rgba(179,179,179,0.25);}.cesium-infoBox-loadingContainer{margin:5px;text-align:center;}.cesium-infoBox-loading{display:inline-block;background-image:url(../Images/info-loading.gif);width:16px;height:11px;} \ No newline at end of file diff --git a/engines/Cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css b/engines/Cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css index 084ebb4..9ce3b5e 100644 --- a/engines/Cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +++ b/engines/Cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css @@ -1 +1 @@ -.cesium-navigationHelpButton-wrapper{position:relative;display:inline-block;}.cesium-navigation-help{visibility:hidden;position:absolute;top:38px;right:2px;width:250px;border-radius:10px;-webkit-transform:scale(0.01);-moz-transform:scale(0.01);transform:scale(0.01);-webkit-transform-origin:234px -10px;-moz-transform-origin:234px -10px;transform-origin:234px -10px;-webkit-transition:visibility 0s 0.25s,-webkit-transform 0.25s ease-in;-moz-transition:visibility 0s 0.25s,-moz-transform 0.25s ease-in;transition:visibility 0s 0.25s,transform 0.25s ease-in;}.cesium-navigation-help-visible{visibility:visible;-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform 0.25s ease-out;-moz-transition:-moz-transform 0.25s ease-out;transition:transform 0.25s ease-out;}.cesium-navigation-help-instructions{border:1px solid #444;background-color:rgba(38,38,38,0.75);padding-bottom:5px;border-radius:0 0 10px 10px;}.cesium-click-navigation-help{display:none;}.cesium-touch-navigation-help{display:none;padding-top:5px;}.cesium-click-navigation-help-visible{display:block;}.cesium-touch-navigation-help-visible{display:block;}.cesium-navigation-help-pan{color:#66ccff;font-weight:bold;}.cesium-navigation-help-zoom{color:#65fd00;font-weight:bold;}.cesium-navigation-help-rotate{color:#ffd800;font-weight:bold;}.cesium-navigation-help-tilt{color:#d800d8;font-weight:bold;}.cesium-navigation-help-details{color:#ffffff;}.cesium-navigation-button{color:#fff;background-color:transparent;border-bottom:none;border-top:1px solid #444;border-right:1px solid #444;margin:0;width:50%;cursor:pointer;}.cesium-navigation-button-icon{vertical-align:middle;padding:5px 1px;}.cesium-navigation-button:focus{outline:none;}.cesium-navigation-button-left{border-radius:10px 0 0 0;border-left:1px solid #444;}.cesium-navigation-button-right{border-radius:0 10px 0 0;border-left:none;}.cesium-navigation-button-selected{background-color:rgba(38,38,38,0.75);}.cesium-navigation-button-unselected{background-color:rgba(0,0,0,0.75);}.cesium-navigation-button-unselected:hover{background-color:rgba(76,76,76,0.75);} \ No newline at end of file +.cesium-navigationHelpButton-wrapper{position:relative;display:inline-block;}.cesium-navigation-help{visibility:hidden;position:absolute;top:38px;right:2px;width:250px;border-radius:10px;transform:scale(0.01);transform-origin:234px -10px;transition:visibility 0s 0.25s,transform 0.25s ease-in;}.cesium-navigation-help-visible{visibility:visible;transform:scale(1);transition:transform 0.25s ease-out;}.cesium-navigation-help-instructions{border:1px solid #444;background-color:rgba(38,38,38,0.75);padding-bottom:5px;border-radius:0 0 10px 10px;}.cesium-click-navigation-help{display:none;}.cesium-touch-navigation-help{display:none;padding-top:5px;}.cesium-click-navigation-help-visible{display:block;}.cesium-touch-navigation-help-visible{display:block;}.cesium-navigation-help-pan{color:#66ccff;font-weight:bold;}.cesium-navigation-help-zoom{color:#65fd00;font-weight:bold;}.cesium-navigation-help-rotate{color:#ffd800;font-weight:bold;}.cesium-navigation-help-tilt{color:#d800d8;font-weight:bold;}.cesium-navigation-help-details{color:#ffffff;}.cesium-navigation-button{color:#fff;background-color:transparent;border-bottom:none;border-top:1px solid #444;border-right:1px solid #444;margin:0;width:50%;cursor:pointer;}.cesium-navigation-button-icon{vertical-align:middle;padding:5px 1px;}.cesium-navigation-button:focus{outline:none;}.cesium-navigation-button-left{border-radius:10px 0 0 0;border-left:1px solid #444;}.cesium-navigation-button-right{border-radius:0 10px 0 0;border-left:none;}.cesium-navigation-button-selected{background-color:rgba(38,38,38,0.75);}.cesium-navigation-button-unselected{background-color:rgba(0,0,0,0.75);}.cesium-navigation-button-unselected:hover{background-color:rgba(76,76,76,0.75);} \ No newline at end of file diff --git a/engines/Cesium/Widgets/ProjectionPicker/ProjectionPicker.css b/engines/Cesium/Widgets/ProjectionPicker/ProjectionPicker.css new file mode 100644 index 0000000..a92377e --- /dev/null +++ b/engines/Cesium/Widgets/ProjectionPicker/ProjectionPicker.css @@ -0,0 +1 @@ +span.cesium-projectionPicker-wrapper{display:inline-block;position:relative;margin:0 3px;}.cesium-projectionPicker-visible{visibility:visible;opacity:1;transition:opacity 0.25s linear;}.cesium-projectionPicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s 0.25s,opacity 0.25s linear;}.cesium-projectionPicker-wrapper .cesium-projectionPicker-none{display:none;}.cesium-projectionPicker-wrapper .cesium-projectionPicker-dropDown-icon{box-sizing:border-box;padding:0;margin:3px 0;}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective,.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic{margin:0 0 3px 0;}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective .cesium-projectionPicker-iconOrthographic{left:100%;}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic .cesium-projectionPicker-iconPerspective{left:-100%;}.cesium-projectionPicker-wrapper .cesium-projectionPicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff;} \ No newline at end of file diff --git a/engines/Cesium/Widgets/SceneModePicker/SceneModePicker.css b/engines/Cesium/Widgets/SceneModePicker/SceneModePicker.css index 2a98a4c..1807a67 100644 --- a/engines/Cesium/Widgets/SceneModePicker/SceneModePicker.css +++ b/engines/Cesium/Widgets/SceneModePicker/SceneModePicker.css @@ -1 +1 @@ -span.cesium-sceneModePicker-wrapper{display:inline-block;position:relative;margin:0 3px;}.cesium-sceneModePicker-visible{visibility:visible;opacity:1;transition:opacity 0.25s linear;-webkit-transition:opacity 0.25s linear;-moz-transition:opacity 0.25s linear;}.cesium-sceneModePicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s 0.25s,opacity 0.25s linear;-webkit-transition:visibility 0s 0.25s,opacity 0.25s linear;-moz-transition:visibility 0s 0.25s,opacity 0.25s linear;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none{display:none;}.cesium-sceneModePicker-slide-svg{-webkit-transition:left 2s;-moz-transition:left 2s;transition:left 2s;top:0;left:0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0;margin:3px 0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D{margin:0 0 3px 0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-icon2D{left:100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-iconColumbusView{left:200%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon3D{left:-200%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon2D{left:-100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-icon3D{left:-100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-iconColumbusView{left:100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff;} \ No newline at end of file +span.cesium-sceneModePicker-wrapper{display:inline-block;position:relative;margin:0 3px;}.cesium-sceneModePicker-visible{visibility:visible;opacity:1;transition:opacity 0.25s linear;}.cesium-sceneModePicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s 0.25s,opacity 0.25s linear;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none{display:none;}.cesium-sceneModePicker-slide-svg{transition:left 2s;top:0;left:0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon{box-sizing:border-box;padding:0;margin:3px 0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D{margin:0 0 3px 0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-icon2D{left:100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-iconColumbusView{left:200%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon3D{left:-200%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon2D{left:-100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-icon3D{left:-100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-iconColumbusView{left:100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff;} \ No newline at end of file diff --git a/engines/Cesium/Widgets/SelectionIndicator/SelectionIndicator.css b/engines/Cesium/Widgets/SelectionIndicator/SelectionIndicator.css index dca2461..e4ad1e8 100644 --- a/engines/Cesium/Widgets/SelectionIndicator/SelectionIndicator.css +++ b/engines/Cesium/Widgets/SelectionIndicator/SelectionIndicator.css @@ -1 +1 @@ -.cesium-selection-wrapper{position:absolute;width:160px;height:160px;pointer-events:none;visibility:hidden;opacity:0;-webkit-transition:visibility 0s 0.2s,opacity 0.2s ease-in;-moz-transition:visibility 0s 0.2s,opacity 0.2s ease-in;transition:visibility 0s 0.2s,opacity 0.2s ease-in;}.cesium-selection-wrapper-visible{visibility:visible;opacity:1;-webkit-transition:opacity 0.2s ease-out;-moz-transition:opacity 0.2s ease-out;transition:opacity 0.2s ease-out;}.cesium-selection-wrapper svg{fill:#2e2;stroke:#000;stroke-width:1.1px;} \ No newline at end of file +.cesium-selection-wrapper{position:absolute;width:160px;height:160px;pointer-events:none;visibility:hidden;opacity:0;transition:visibility 0s 0.2s,opacity 0.2s ease-in;}.cesium-selection-wrapper-visible{visibility:visible;opacity:1;transition:opacity 0.2s ease-out;}.cesium-selection-wrapper svg{fill:#2e2;stroke:#000;stroke-width:1.1px;} \ No newline at end of file diff --git a/engines/Cesium/Widgets/Timeline/Timeline.css b/engines/Cesium/Widgets/Timeline/Timeline.css index 4484cb7..4c6d600 100644 --- a/engines/Cesium/Widgets/Timeline/Timeline.css +++ b/engines/Cesium/Widgets/Timeline/Timeline.css @@ -1 +1 @@ -.cesium-timeline-main{position:relative;left:0;bottom:0;overflow:hidden;border:solid 1px #888;}.cesium-timeline-trackContainer{width:100%;overflow:auto;border-top:solid 1px #888;position:relative;top:0;left:0;}.cesium-timeline-tracks{position:absolute;top:0;left:0;width:100%;}.cesium-timeline-needle{position:absolute;left:0;top:1.7em;bottom:0;width:1px;background:#F00;}.cesium-timeline-bar{position:relative;left:0;top:0;overflow:hidden;cursor:pointer;width:100%;height:1.7em;background-color:#fafafa;background:rgba(32,32,32,0.8);background:-moz-linear-gradient(top,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);background:-webkit-linear-gradient(top,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);background:linear-gradient(to bottom,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);}.cesium-timeline-ruler{visibility:hidden;white-space:nowrap;font-size:80%;z-index:-200;}.cesium-timeline-highlight{position:absolute;bottom:0;left:0;background:#08F;}.cesium-timeline-ticLabel{position:absolute;top:0;left:0;white-space:nowrap;font-size:80%;color:#eee;}.cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#eee;}.cesium-timeline-ticSub{position:absolute;bottom:0;left:0;width:1px;height:33%;background:#aaa;}.cesium-timeline-ticTiny{position:absolute;bottom:0;left:0;width:1px;height:25%;background:#888;}.cesium-timeline-icon16{display:block;position:absolute;width:16px;height:16px;background-image:url("../Images/TimelineIcons.png");background-repeat:no-repeat;} \ No newline at end of file +.cesium-timeline-main{position:relative;left:0;bottom:0;overflow:hidden;border:solid 1px #888;}.cesium-timeline-trackContainer{width:100%;overflow:auto;border-top:solid 1px #888;position:relative;top:0;left:0;}.cesium-timeline-tracks{position:absolute;top:0;left:0;width:100%;}.cesium-timeline-needle{position:absolute;left:0;top:1.7em;bottom:0;width:1px;background:#F00;}.cesium-timeline-bar{position:relative;left:0;top:0;overflow:hidden;cursor:pointer;width:100%;height:1.7em;background:linear-gradient(to bottom,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);}.cesium-timeline-ruler{visibility:hidden;white-space:nowrap;font-size:80%;z-index:-200;}.cesium-timeline-highlight{position:absolute;bottom:0;left:0;background:#08F;}.cesium-timeline-ticLabel{position:absolute;top:0;left:0;white-space:nowrap;font-size:80%;color:#eee;}.cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#eee;}.cesium-timeline-ticSub{position:absolute;bottom:0;left:0;width:1px;height:33%;background:#aaa;}.cesium-timeline-ticTiny{position:absolute;bottom:0;left:0;width:1px;height:25%;background:#888;}.cesium-timeline-icon16{display:block;position:absolute;width:16px;height:16px;background-image:url("../Images/TimelineIcons.png");background-repeat:no-repeat;} \ No newline at end of file diff --git a/engines/Cesium/Widgets/Timeline/lighter.css b/engines/Cesium/Widgets/Timeline/lighter.css index 422bb1b..ab90493 100644 --- a/engines/Cesium/Widgets/Timeline/lighter.css +++ b/engines/Cesium/Widgets/Timeline/lighter.css @@ -1 +1 @@ -.cesium-lighter .cesium-timeline-bar{background:-moz-linear-gradient(top,#eeeeee 0%,#ffffff 50%,#fafafa 100%);background:-webkit-linear-gradient(top,#eeeeee 0%,#ffffff 50%,#fafafa 100%);background:linear-gradient(to bottom,#eeeeee 0%,#ffffff 50%,#fafafa 100%);}.cesium-lighter .cesium-timeline-ticLabel{color:#000;}.cesium-lighter .cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#000;}.cesium-lighter .cesium-timeline-ticSub{background:#444;} \ No newline at end of file +.cesium-lighter .cesium-timeline-bar{background:linear-gradient(to bottom,#eeeeee 0%,#ffffff 50%,#fafafa 100%);}.cesium-lighter .cesium-timeline-ticLabel{color:#000;}.cesium-lighter .cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#000;}.cesium-lighter .cesium-timeline-ticSub{background:#444;} \ No newline at end of file diff --git a/engines/Cesium/Widgets/lighter.css b/engines/Cesium/Widgets/lighter.css index 3c2c52c..d5bdd58 100644 --- a/engines/Cesium/Widgets/lighter.css +++ b/engines/Cesium/Widgets/lighter.css @@ -1 +1 @@ -.cesium-lighter .cesium-button{color:#111;fill:#111;background:#e2f0ff;border:1px solid #759dc0;}.cesium-lighter .cesium-button:focus{color:#000;fill:#000;border-color:#ea4;}.cesium-lighter .cesium-button:hover{color:#000;fill:#000;background:#a6d2ff;border-color:#aef;box-shadow:0 0 8px #777;}.cesium-lighter .cesium-button:active{color:#fff;fill:#fff;background:#48b;border-color:#ea0;}.cesium-lighter .cesium-button:disabled,.cesium-lighter .cesium-button-disabled,.cesium-lighter .cesium-button-disabled:focus,.cesium-lighter .cesium-button-disabled:hover,.cesium-lighter .cesium-button-disabled:active{background:#ccc;border-color:#999;color:#999;fill:#999;box-shadow:none;}.cesium-lighter .cesium-performanceDisplay{background-color:#e2f0ff;border-color:#759dc0;}.cesium-lighter .cesium-performanceDisplay-fps{color:#e52;}.cesium-lighter .cesium-performanceDisplay-ms{color:#ea4;}.cesium-lighter .cesium-animation-themeNormal{color:#E5F2FE;}.cesium-lighter .cesium-animation-themeHover{color:#ABD6FF;}.cesium-lighter .cesium-animation-themeSelect{color:#E5F2FE;}.cesium-lighter .cesium-animation-themeDisabled{color:#EFEFEF;}.cesium-lighter .cesium-animation-themeKnob{color:#E1E2E3;}.cesium-lighter .cesium-animation-themePointer{color:#FA5;}.cesium-lighter .cesium-animation-themeSwoosh{color:#ACE;}.cesium-lighter .cesium-animation-themeSwooshHover{color:#BDF;}.cesium-lighter .cesium-animation-svgText{fill:#111;}.cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonPath{fill:#111;}.cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonMain{stroke:#759DC0;}.cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonGlow{fill:#FFAA2A;}.cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonMain{stroke:#EA0;}.cesium-lighter .cesium-animation-rectButton:hover .cesium-animation-buttonMain{stroke:#759DC0;}.cesium-lighter .cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow{fill:#fff;}.cesium-lighter .cesium-animation-buttonToggled:hover .cesium-animation-buttonMain{stroke:#EA0;}.cesium-lighter .cesium-animation-rectButton:active .cesium-animation-buttonMain{fill:#ABD6FF;}.cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonMain{stroke:#D3D3D3;}.cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonPath{fill:#818181;}.cesium-lighter .cesium-animation-shuttleRingBack{fill:#FAFAFA;fill-opacity:1;stroke:#AEAEAE;stroke-width:1.2;}.cesium-lighter .cesium-animation-shuttleRingSwoosh line{stroke:#8AC;}.cesium-lighter .cesium-animation-knobOuter{stroke:#A5A5A5;}.cesium-lighter .cesium-baseLayerPicker-itemIcon{border-color:#759dc0;}.cesium-lighter .cesium-baseLayerPicker-dropDown{background-color:rgba(240,240,240,0.75);}.cesium-lighter .cesium-baseLayerPicker-sectionTitle{color:black;}.cesium-lighter .cesium-baseLayerPicker-itemLabel{color:black;}.cesium-lighter .cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#000;}.cesium-lighter .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:rgb(0,61,168);}.cesium-lighter .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px rgb(0,61,168);}.cesium-lighter .cesium-widget-errorPanel{background:rgba(255,255,255,0.7);}.cesium-lighter .cesium-widget-errorPanel-content{border:1px solid #526F82;border-radius:7px;background-color:white;color:black;}.cesium-lighter .cesium-widget-errorPanel-header{color:#B87D00;}.cesium-lighter .cesium-geocoder-input{border:solid 1px #759dc0;background-color:rgba(240,240,240,0.9);color:black;}.cesium-lighter .cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-lighter .cesium-geocoder-searchButton{background-color:#e2f0ff;fill:#111;}.cesium-lighter .cesium-geocoder-searchButton:hover{background-color:#a6d2ff;}.cesium-lighter .cesium-timeline-bar{background:-moz-linear-gradient(top,#eeeeee 0%,#ffffff 50%,#fafafa 100%);background:-webkit-linear-gradient(top,#eeeeee 0%,#ffffff 50%,#fafafa 100%);background:linear-gradient(to bottom,#eeeeee 0%,#ffffff 50%,#fafafa 100%);}.cesium-lighter .cesium-timeline-ticLabel{color:#000;}.cesium-lighter .cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#000;}.cesium-lighter .cesium-timeline-ticSub{background:#444;}.cesium-lighter .cesium-navigation-help-instructions{border:1px solid #759dc0;background-color:rgba(255,255,255,0.9);}.cesium-lighter .cesium-navigation-help-pan{color:#66ccee;font-weight:bold;}.cesium-lighter .cesium-navigation-help-zoom{color:#65ec00;font-weight:bold;}.cesium-lighter .cesium-navigation-help-rotate{color:#eec722;font-weight:bold;}.cesium-lighter .cesium-navigation-help-tilt{color:#d800d8;font-weight:bold;}.cesium-lighter .cesium-navigation-help-details{color:#222222;}.cesium-lighter .cesium-navigation-button{color:#222222;border-top:1px solid #759dc0;border-right:1px solid #759dc0;}.cesium-lighter .cesium-navigation-button-selected{background-color:rgba(196,225,255,0.9);}.cesium-lighter .cesium-navigation-button-unselected{background-color:rgba(226,240,255,0.9);}.cesium-lighter .cesium-navigation-button-unselected:hover{background-color:rgba(166,210,255,0.9);} \ No newline at end of file +.cesium-lighter .cesium-button{color:#111;fill:#111;background:#e2f0ff;border:1px solid #759dc0;}.cesium-lighter .cesium-button:focus{color:#000;fill:#000;border-color:#ea4;}.cesium-lighter .cesium-button:hover{color:#000;fill:#000;background:#a6d2ff;border-color:#aef;box-shadow:0 0 8px #777;}.cesium-lighter .cesium-button:active{color:#fff;fill:#fff;background:#48b;border-color:#ea0;}.cesium-lighter .cesium-button:disabled,.cesium-lighter .cesium-button-disabled,.cesium-lighter .cesium-button-disabled:focus,.cesium-lighter .cesium-button-disabled:hover,.cesium-lighter .cesium-button-disabled:active{background:#ccc;border-color:#999;color:#999;fill:#999;box-shadow:none;}.cesium-lighter .cesium-performanceDisplay{background-color:#e2f0ff;border-color:#759dc0;}.cesium-lighter .cesium-performanceDisplay-fps{color:#e52;}.cesium-lighter .cesium-performanceDisplay-ms{color:#ea4;}.cesium-lighter .cesium-animation-themeNormal{color:#E5F2FE;}.cesium-lighter .cesium-animation-themeHover{color:#ABD6FF;}.cesium-lighter .cesium-animation-themeSelect{color:#E5F2FE;}.cesium-lighter .cesium-animation-themeDisabled{color:#EFEFEF;}.cesium-lighter .cesium-animation-themeKnob{color:#E1E2E3;}.cesium-lighter .cesium-animation-themePointer{color:#FA5;}.cesium-lighter .cesium-animation-themeSwoosh{color:#ACE;}.cesium-lighter .cesium-animation-themeSwooshHover{color:#BDF;}.cesium-lighter .cesium-animation-svgText{fill:#111;}.cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonPath{fill:#111;}.cesium-lighter .cesium-animation-rectButton .cesium-animation-buttonMain{stroke:#759DC0;}.cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonGlow{fill:#FFAA2A;}.cesium-lighter .cesium-animation-buttonToggled .cesium-animation-buttonMain{stroke:#EA0;}.cesium-lighter .cesium-animation-rectButton:hover .cesium-animation-buttonMain{stroke:#759DC0;}.cesium-lighter .cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow{fill:#fff;}.cesium-lighter .cesium-animation-buttonToggled:hover .cesium-animation-buttonMain{stroke:#EA0;}.cesium-lighter .cesium-animation-rectButton:active .cesium-animation-buttonMain{fill:#ABD6FF;}.cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonMain{stroke:#D3D3D3;}.cesium-lighter .cesium-animation-buttonDisabled .cesium-animation-buttonPath{fill:#818181;}.cesium-lighter .cesium-animation-shuttleRingBack{fill:#FAFAFA;fill-opacity:1;stroke:#AEAEAE;stroke-width:1.2;}.cesium-lighter .cesium-animation-shuttleRingSwoosh line{stroke:#8AC;}.cesium-lighter .cesium-animation-knobOuter{stroke:#A5A5A5;}.cesium-lighter .cesium-baseLayerPicker-itemIcon{border-color:#759dc0;}.cesium-lighter .cesium-baseLayerPicker-dropDown{background-color:rgba(240,240,240,0.75);}.cesium-lighter .cesium-baseLayerPicker-sectionTitle{color:black;}.cesium-lighter .cesium-baseLayerPicker-itemLabel{color:black;}.cesium-lighter .cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#000;}.cesium-lighter .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:rgb(0,61,168);}.cesium-lighter .cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px rgb(0,61,168);}.cesium-lighter .cesium-widget-errorPanel{background:rgba(255,255,255,0.7);}.cesium-lighter .cesium-widget-errorPanel-content{border:1px solid #526F82;border-radius:7px;background-color:white;color:black;}.cesium-lighter .cesium-widget-errorPanel-header{color:#B87D00;}.cesium-lighter .cesium-geocoder-input{border:solid 1px #759dc0;background-color:rgba(240,240,240,0.9);color:black;}.cesium-lighter .cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-lighter .cesium-geocoder-searchButton{background-color:#e2f0ff;fill:#111;}.cesium-lighter .cesium-geocoder-searchButton:hover{background-color:#a6d2ff;}.cesium-lighter .cesium-timeline-bar{background:linear-gradient(to bottom,#eeeeee 0%,#ffffff 50%,#fafafa 100%);}.cesium-lighter .cesium-timeline-ticLabel{color:#000;}.cesium-lighter .cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#000;}.cesium-lighter .cesium-timeline-ticSub{background:#444;}.cesium-lighter .cesium-navigation-help-instructions{border:1px solid #759dc0;background-color:rgba(255,255,255,0.9);}.cesium-lighter .cesium-navigation-help-pan{color:#66ccee;font-weight:bold;}.cesium-lighter .cesium-navigation-help-zoom{color:#65ec00;font-weight:bold;}.cesium-lighter .cesium-navigation-help-rotate{color:#eec722;font-weight:bold;}.cesium-lighter .cesium-navigation-help-tilt{color:#d800d8;font-weight:bold;}.cesium-lighter .cesium-navigation-help-details{color:#222222;}.cesium-lighter .cesium-navigation-button{color:#222222;border-top:1px solid #759dc0;border-right:1px solid #759dc0;}.cesium-lighter .cesium-navigation-button-selected{background-color:rgba(196,225,255,0.9);}.cesium-lighter .cesium-navigation-button-unselected{background-color:rgba(226,240,255,0.9);}.cesium-lighter .cesium-navigation-button-unselected:hover{background-color:rgba(166,210,255,0.9);} \ No newline at end of file diff --git a/engines/Cesium/Widgets/shared.css b/engines/Cesium/Widgets/shared.css index 82b2367..16fb57f 100644 --- a/engines/Cesium/Widgets/shared.css +++ b/engines/Cesium/Widgets/shared.css @@ -1 +1 @@ -.cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:none;}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-button:disabled,.cesium-button-disabled,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button-disabled:active{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default;}.cesium-button option{background-color:#000;color:#eee;}.cesium-button option:disabled{color:#777;}.cesium-button input,.cesium-button label{cursor:pointer;}.cesium-button input{vertical-align:sub;}.cesium-toolbar-button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0;}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right;}.cesium-performanceDisplay{background-color:rgba(40,40,40,0.7);padding:7px;border-radius:5px;border:1px solid #444;font:bold 12px sans-serif;}.cesium-performanceDisplay-fps{color:#e52;}.cesium-performanceDisplay-ms{color:#de3;} \ No newline at end of file +.cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:none;}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-button:disabled,.cesium-button-disabled,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button-disabled:active{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default;}.cesium-button option{background-color:#000;color:#eee;}.cesium-button option:disabled{color:#777;}.cesium-button input,.cesium-button label{cursor:pointer;}.cesium-button input{vertical-align:sub;}.cesium-toolbar-button{box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0;}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right;}.cesium-performanceDisplay{background-color:rgba(40,40,40,0.7);padding:7px;border-radius:5px;border:1px solid #444;font:bold 12px sans-serif;}.cesium-performanceDisplay-fps{color:#e52;}.cesium-performanceDisplay-ms{color:#de3;} \ No newline at end of file diff --git a/engines/Cesium/Widgets/widgets.css b/engines/Cesium/Widgets/widgets.css index af76a1a..0fa947e 100644 --- a/engines/Cesium/Widgets/widgets.css +++ b/engines/Cesium/Widgets/widgets.css @@ -1 +1 @@ -.cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:none;}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-button:disabled,.cesium-button-disabled,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button-disabled:active{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default;}.cesium-button option{background-color:#000;color:#eee;}.cesium-button option:disabled{color:#777;}.cesium-button input,.cesium-button label{cursor:pointer;}.cesium-button input{vertical-align:sub;}.cesium-toolbar-button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0;}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right;}.cesium-performanceDisplay{background-color:rgba(40,40,40,0.7);padding:7px;border-radius:5px;border:1px solid #444;font:bold 12px sans-serif;}.cesium-performanceDisplay-fps{color:#e52;}.cesium-performanceDisplay-ms{color:#de3;}.cesium-animation-theme{visibility:hidden;display:block;position:absolute;z-index:-100;}.cesium-animation-themeNormal{color:#222;}.cesium-animation-themeHover{color:#4488B0;}.cesium-animation-themeSelect{color:#242;}.cesium-animation-themeDisabled{color:#333;}.cesium-animation-themeKnob{color:#222;}.cesium-animation-themePointer{color:#2E2;}.cesium-animation-themeSwoosh{color:#8AC;}.cesium-animation-themeSwooshHover{color:#AEF;}.cesium-animation-svgText{fill:#edffff;font-family:Sans-Serif;font-size:15px;text-anchor:middle;}.cesium-animation-blank{fill:#000;fill-opacity:0.01;stroke:none;}.cesium-animation-rectButton{cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-animation-rectButton .cesium-animation-buttonGlow{fill:#fff;stroke:none;display:none;}.cesium-animation-rectButton:hover .cesium-animation-buttonGlow{display:block;}.cesium-animation-rectButton .cesium-animation-buttonPath{fill:#edffff;}.cesium-animation-rectButton .cesium-animation-buttonMain{stroke:#444;stroke-width:1.2;}.cesium-animation-rectButton:hover .cesium-animation-buttonMain{stroke:#AEF;}.cesium-animation-rectButton:active .cesium-animation-buttonMain{fill:#ABD6FF;}.cesium-animation-buttonDisabled{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-animation-buttonDisabled .cesium-animation-buttonMain{stroke:#555;}.cesium-animation-buttonDisabled .cesium-animation-buttonPath{fill:#818181;}.cesium-animation-buttonDisabled .cesium-animation-buttonGlow{display:none;}.cesium-animation-buttonToggled .cesium-animation-buttonGlow{display:block;fill:#2E2;}.cesium-animation-buttonToggled .cesium-animation-buttonMain{stroke:#2E2;}.cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow{fill:#fff;}.cesium-animation-buttonToggled:hover .cesium-animation-buttonMain{stroke:#2E2;}.cesium-animation-shuttleRingG{cursor:pointer;}.cesium-animation-shuttleRingPointer{cursor:pointer;}.cesium-animation-shuttleRingPausePointer{cursor:pointer;}.cesium-animation-shuttleRingBack{fill:#181818;fill-opacity:0.8;stroke:#333;stroke-width:1.2;}.cesium-animation-shuttleRingSwoosh line{stroke:#8AC;stroke-width:3;stroke-opacity:0.2;stroke-linecap:round;}.cesium-animation-knobOuter{cursor:pointer;stroke:#444;stroke-width:1.2;}.cesium-animation-knobInner{cursor:pointer;}.cesium-baseLayerPicker-selected{position:absolute;top:0;left:0;width:100%;height:100%;border:none;}.cesium-baseLayerPicker-dropDown{display:block;position:absolute;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;top:auto;right:0;width:320px;max-height:500px;margin-top:5px;background-color:rgba(38,38,38,0.75);border:1px solid #444;padding:6px;overflow:auto;border-radius:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;-webkit-transform:translate(0,-20%);-moz-transform:translate(0,-20%);transform:translate(0,-20%);visibility:hidden;opacity:0;-webkit-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-webkit-transform 0.2s ease-in;-moz-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-moz-transform 0.2s ease-in;transition:visibility 0s 0.2s,opacity 0.2s ease-in,transform 0.2s ease-in;}.cesium-baseLayerPicker-dropDown-visible{-webkit-transform:translate(0,0);-moz-transform:translate(0,0);transform:translate(0,0);visibility:visible;opacity:1;-webkit-transition:opacity 0.2s ease-out,-webkit-transform 0.2s ease-out;-moz-transition:opacity 0.2s ease-out,-moz-transform 0.2s ease-out;transition:opacity 0.2s ease-out,transform 0.2s ease-out;}.cesium-baseLayerPicker-sectionTitle{display:block;font-family:sans-serif;font-size:16pt;text-align:left;color:#edffff;border-bottom:1px solid #888;margin-bottom:4px;}.cesium-baseLayerPicker-choices{display:block;position:relative;top:auto;right:0;}.cesium-baseLayerPicker-item{display:inline-block;vertical-align:top;margin:2px 5px;width:64px;text-align:center;cursor:pointer;}.cesium-baseLayerPicker-itemLabel{display:block;font-family:sans-serif;font-size:8pt;text-align:center;vertical-align:middle;color:#edffff;cursor:pointer;word-wrap:break-word;}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel,.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel{text-decoration:underline;}.cesium-baseLayerPicker-itemIcon{display:inline-block;position:relative;width:inherit;height:auto;background-size:100% 100%;border:solid 1px #444;border-radius:9px;color:#edffff;margin:0;padding:0;cursor:pointer;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#fff;box-shadow:0 0 8px #fff,0 0 8px #fff;}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:rgb(189,236,248);}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px rgb(189,236,248);}.cesium-widget{position:relative;}.cesium-widget,.cesium-widget canvas{width:100%;height:100%;touch-action:none;}.cesium-widget-credits{display:block;position:absolute;bottom:0;left:0;color:#fff;font-size:10px;text-shadow:0px 0px 2px #000000;padding-right:5px;}.cesium-widget-credits a,.cesium-widget-credits a:visited{color:#fff;}.cesium-widget-errorPanel{position:absolute;top:0;right:0;bottom:0;left:0;text-align:center;background:rgba(0,0,0,0.7);z-index:99999;}.cesium-widget-errorPanel:before{display:inline-block;vertical-align:middle;height:100%;content:"";}.cesium-widget-errorPanel-content{width:75%;display:inline-block;text-align:left;vertical-align:middle;border:1px solid #526F82;border-radius:7px;background-color:black;color:white;font-size:10pt;padding:1em;}.cesium-widget-errorPanel-header{font-size:120%;color:#fe4;}.cesium-widget-errorPanel-scroll{overflow:auto;font-family:monospace;white-space:pre-wrap;padding:0;margin:10px 0;}.cesium-widget-errorPanel-buttonPanel{text-align:center;}.cesium-cesiumInspector{border-radius:5px;-webkit-transition:width ease-in-out 0.25s;-moz-transition:width ease-in-out 0.25s;transition:width ease-in-out 0.25s;background:rgba(48,51,54,0.8);border:1px solid #444;color:#edffff;display:inline-block;position:relative;padding:4px 12px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;}.cesium-cesiumInspector-button{text-align:center;font-size:11pt;}.cesium-cesiumInspector-visible .cesium-cesiumInspector-button{border-bottom:1px solid #aaa;padding-bottom:3px;}.cesium-cesiumInspector input:enabled,.cesium-cesiumInspector-button{cursor:pointer;}.cesium-cesiumInspector-visible{width:185px;height:auto;}.cesium-cesiumInspector-hidden{width:122px;height:17px;}.cesium-cesiumInspector-show{max-height:500px;}.cesium-cesiumInspector-hide{max-height:0;padding:0 !important;overflow:hidden;}.cesium-cesiumInspector-dropDown{margin:5px 0;font-family:sans-serif;font-size:10pt;width:185px;}.cesium-cesiumInspector-frustumStats{padding-left:10px;padding:5px;background-color:rgba(80,80,80,0.75);}.cesium-cesiumInspector-pickButton{background-color:rgba(0,0,0,0.3);border:1px solid #444;color:#edffff;border-radius:5px;padding:3px 7px;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;margin:0 auto;}.cesium-cesiumInspector-pickButton:focus{outline:none;}.cesium-cesiumInspector-pickButton:active,.cesium-cesiumInspector-pickButtonHighlight{color:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-cesiumInspector-center{text-align:center;}.cesium-cesiumInspector-sectionHeader{font-weight:bold;}.cesium-cesiumInspector-pickSection{border:1px solid #aaa;border-radius:5px;padding:3px;margin-bottom:5px;}.cesium-cesiumInspector-section{margin-bottom:10px;-webkit-transition:max-height 0.25s;-moz-transition:max-height 0.25s;transition:max-height 0.25s;}.cesium-cesiumInspector-toggleSwitch{padding:3px;cursor:pointer;}.cesium-cesiumInspector-tileText{padding-bottom:10px;border-bottom:1px solid #aaa;}.cesium-cesiumInspector-relativeText{padding-top:10px;}.cesium-button.cesium-fullscreenButton{display:block;width:100%;height:100%;margin:0;border-radius:0;}.cesium-button.cesium-vrButton{display:block;width:100%;height:100%;margin:0;border-radius:0;}.cesium-viewer-geocoderContainer .cesium-geocoder-input{border:solid 1px #444;background-color:rgba(40,40,40,0.7);color:white;display:inline-block;vertical-align:middle;width:0;height:32px;margin:0;padding:0 32px 0 0;border-radius:0;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-moz-transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-webkit-appearance:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{border-color:#ea4;background-color:rgba(15,15,15,0.9);box-shadow:none;outline:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input,.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide{padding-left:4px;width:250px;}.cesium-viewer-geocoderContainer .search-results{position:absolute;background-color:#000;color:#eee;overflow-y:auto;opacity:0.8;width:100%;}.cesium-viewer-geocoderContainer .search-results ul{list-style-type:none;margin:0;padding:0;}.cesium-viewer-geocoderContainer .search-results ul li{font-size:14px;padding:3px 10px;}.cesium-viewer-geocoderContainer .search-results ul li:hover{cursor:pointer;}.cesium-viewer-geocoderContainer .search-results ul li.active{background:#48b;}.cesium-geocoder-searchButton{background-color:#303336;display:inline-block;position:absolute;cursor:pointer;width:32px;top:1px;right:1px;height:30px;vertical-align:middle;fill:#edffff;}.cesium-geocoder-searchButton:hover{background-color:#48b;}.cesium-infoBox{display:block;position:absolute;top:50px;right:0;width:40%;max-width:480px;background:rgba(38,38,38,0.95);color:#edffff;border:1px solid #444;border-right:none;border-top-left-radius:7px;border-bottom-left-radius:7px;box-shadow:0 0 10px 1px #000;-webkit-transform:translate(100%,0);-moz-transform:translate(100%,0);transform:translate(100%,0);visibility:hidden;opacity:0;-webkit-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-webkit-transform 0.2s ease-in;-moz-transition:visibility 0s 0.2s,opacity 0.2s ease-in,-moz-transform 0.2s ease-in;transition:visibility 0s 0.2s,opacity 0.2s ease-in,transform 0.2s ease-in;}.cesium-infoBox-visible{-webkit-transform:translate(0,0);-moz-transform:translate(0,0);transform:translate(0,0);visibility:visible;opacity:1;-webkit-transition:opacity 0.2s ease-out,-webkit-transform 0.2s ease-out;-moz-transition:opacity 0.2s ease-out,-moz-transform 0.2s ease-out;transition:opacity 0.2s ease-out,transform 0.2s ease-out;}.cesium-infoBox-title{display:block;height:20px;padding:5px 30px 5px 25px;background:rgba(84,84,84,1.0);border-top-left-radius:7px;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;}.cesium-infoBox-bodyless .cesium-infoBox-title{border-bottom-left-radius:7px;}button.cesium-infoBox-camera{display:block;position:absolute;top:4px;left:4px;width:22px;height:22px;background:transparent;border-color:transparent;border-radius:3px;padding:0 5px;margin:0;}button.cesium-infoBox-close{display:block;position:absolute;top:5px;right:5px;height:20px;background:transparent;border:none;border-radius:2px;font-weight:bold;font-size:16px;padding:0 5px;margin:0;color:#edffff;}button.cesium-infoBox-close:focus{background:rgba(238,136,0,0.44);outline:none;}button.cesium-infoBox-close:hover{background:#888;color:#000;}button.cesium-infoBox-close:active{background:#a00;color:#000;}.cesium-infoBox-bodyless .cesium-infoBox-iframe{display:none;}.cesium-infoBox-iframe{border:none;width:100%;width:calc(100% - 2px);}span.cesium-sceneModePicker-wrapper{display:inline-block;position:relative;margin:0 3px;}.cesium-sceneModePicker-visible{visibility:visible;opacity:1;transition:opacity 0.25s linear;-webkit-transition:opacity 0.25s linear;-moz-transition:opacity 0.25s linear;}.cesium-sceneModePicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s 0.25s,opacity 0.25s linear;-webkit-transition:visibility 0s 0.25s,opacity 0.25s linear;-moz-transition:visibility 0s 0.25s,opacity 0.25s linear;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none{display:none;}.cesium-sceneModePicker-slide-svg{-webkit-transition:left 2s;-moz-transition:left 2s;transition:left 2s;top:0;left:0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0;margin:3px 0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D{margin:0 0 3px 0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-icon2D{left:100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-iconColumbusView{left:200%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon3D{left:-200%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon2D{left:-100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-icon3D{left:-100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-iconColumbusView{left:100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff;}.cesium-performance-watchdog-message-area{position:relative;background-color:yellow;color:black;padding:10px;}.cesium-performance-watchdog-message{margin-right:30px;}.cesium-performance-watchdog-message-dismiss{position:absolute;right:0;margin:0 10px 0 0;}.cesium-navigationHelpButton-wrapper{position:relative;display:inline-block;}.cesium-navigation-help{visibility:hidden;position:absolute;top:38px;right:2px;width:250px;border-radius:10px;-webkit-transform:scale(0.01);-moz-transform:scale(0.01);transform:scale(0.01);-webkit-transform-origin:234px -10px;-moz-transform-origin:234px -10px;transform-origin:234px -10px;-webkit-transition:visibility 0s 0.25s,-webkit-transform 0.25s ease-in;-moz-transition:visibility 0s 0.25s,-moz-transform 0.25s ease-in;transition:visibility 0s 0.25s,transform 0.25s ease-in;}.cesium-navigation-help-visible{visibility:visible;-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1);-webkit-transition:-webkit-transform 0.25s ease-out;-moz-transition:-moz-transform 0.25s ease-out;transition:transform 0.25s ease-out;}.cesium-navigation-help-instructions{border:1px solid #444;background-color:rgba(38,38,38,0.75);padding-bottom:5px;border-radius:0 0 10px 10px;}.cesium-click-navigation-help{display:none;}.cesium-touch-navigation-help{display:none;padding-top:5px;}.cesium-click-navigation-help-visible{display:block;}.cesium-touch-navigation-help-visible{display:block;}.cesium-navigation-help-pan{color:#66ccff;font-weight:bold;}.cesium-navigation-help-zoom{color:#65fd00;font-weight:bold;}.cesium-navigation-help-rotate{color:#ffd800;font-weight:bold;}.cesium-navigation-help-tilt{color:#d800d8;font-weight:bold;}.cesium-navigation-help-details{color:#ffffff;}.cesium-navigation-button{color:#fff;background-color:transparent;border-bottom:none;border-top:1px solid #444;border-right:1px solid #444;margin:0;width:50%;cursor:pointer;}.cesium-navigation-button-icon{vertical-align:middle;padding:5px 1px;}.cesium-navigation-button:focus{outline:none;}.cesium-navigation-button-left{border-radius:10px 0 0 0;border-left:1px solid #444;}.cesium-navigation-button-right{border-radius:0 10px 0 0;border-left:none;}.cesium-navigation-button-selected{background-color:rgba(38,38,38,0.75);}.cesium-navigation-button-unselected{background-color:rgba(0,0,0,0.75);}.cesium-navigation-button-unselected:hover{background-color:rgba(76,76,76,0.75);}.cesium-selection-wrapper{position:absolute;width:160px;height:160px;pointer-events:none;visibility:hidden;opacity:0;-webkit-transition:visibility 0s 0.2s,opacity 0.2s ease-in;-moz-transition:visibility 0s 0.2s,opacity 0.2s ease-in;transition:visibility 0s 0.2s,opacity 0.2s ease-in;}.cesium-selection-wrapper-visible{visibility:visible;opacity:1;-webkit-transition:opacity 0.2s ease-out;-moz-transition:opacity 0.2s ease-out;transition:opacity 0.2s ease-out;}.cesium-selection-wrapper svg{fill:#2e2;stroke:#000;stroke-width:1.1px;}.cesium-timeline-main{position:relative;left:0;bottom:0;overflow:hidden;border:solid 1px #888;}.cesium-timeline-trackContainer{width:100%;overflow:auto;border-top:solid 1px #888;position:relative;top:0;left:0;}.cesium-timeline-tracks{position:absolute;top:0;left:0;width:100%;}.cesium-timeline-needle{position:absolute;left:0;top:1.7em;bottom:0;width:1px;background:#F00;}.cesium-timeline-bar{position:relative;left:0;top:0;overflow:hidden;cursor:pointer;width:100%;height:1.7em;background-color:#fafafa;background:rgba(32,32,32,0.8);background:-moz-linear-gradient(top,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);background:-webkit-linear-gradient(top,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);background:linear-gradient(to bottom,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);}.cesium-timeline-ruler{visibility:hidden;white-space:nowrap;font-size:80%;z-index:-200;}.cesium-timeline-highlight{position:absolute;bottom:0;left:0;background:#08F;}.cesium-timeline-ticLabel{position:absolute;top:0;left:0;white-space:nowrap;font-size:80%;color:#eee;}.cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#eee;}.cesium-timeline-ticSub{position:absolute;bottom:0;left:0;width:1px;height:33%;background:#aaa;}.cesium-timeline-ticTiny{position:absolute;bottom:0;left:0;width:1px;height:25%;background:#888;}.cesium-timeline-icon16{display:block;position:absolute;width:16px;height:16px;background-image:url(Images/TimelineIcons.png);background-repeat:no-repeat;}.cesium-viewer{font-family:sans-serif;font-size:16px;overflow:hidden;display:block;position:relative;top:0;left:0;width:100%;height:100%;}.cesium-viewer-cesiumWidgetContainer{width:100%;height:100%;}.cesium-viewer-bottom{display:block;position:absolute;bottom:0;left:0;right:0;padding-right:5px;}.cesium-viewer .cesium-widget-credits{display:inline;position:static;bottom:auto;left:auto;padding-right:0;color:#ffffff;font-size:10px;text-shadow:0 0 2px #000000;}.cesium-viewer-timelineContainer{position:absolute;bottom:0;left:169px;right:29px;height:27px;padding:0;margin:0;overflow:hidden;font-size:14px;}.cesium-viewer-animationContainer{position:absolute;bottom:0;left:0;padding:0;width:169px;height:112px;}.cesium-viewer-fullscreenContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden;}.cesium-viewer-vrContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden;}.cesium-viewer-toolbar{display:block;position:absolute;top:5px;right:5px;}.cesium-viewer-cesiumInspectorContainer{display:block;position:absolute;top:50px;right:10px;}.cesium-viewer-geocoderContainer{position:relative;display:inline-block;margin:0 3px;} \ No newline at end of file +.cesium-svgPath-svg{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;}.cesium-button{display:inline-block;position:relative;background:#303336;border:1px solid #444;color:#edffff;fill:#edffff;border-radius:4px;padding:5px 12px;margin:2px 3px;cursor:pointer;overflow:hidden;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-button:focus{color:#fff;fill:#fff;border-color:#ea4;outline:none;}.cesium-button:hover{color:#fff;fill:#fff;background:#48b;border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-button:active{color:#000;fill:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-button:disabled,.cesium-button-disabled,.cesium-button-disabled:focus,.cesium-button-disabled:hover,.cesium-button-disabled:active{background:#303336;border-color:#444;color:#646464;fill:#646464;box-shadow:none;cursor:default;}.cesium-button option{background-color:#000;color:#eee;}.cesium-button option:disabled{color:#777;}.cesium-button input,.cesium-button label{cursor:pointer;}.cesium-button input{vertical-align:sub;}.cesium-toolbar-button{box-sizing:border-box;width:32px;height:32px;border-radius:14%;padding:0;vertical-align:middle;z-index:0;}.cesium-performanceDisplay-defaultContainer{position:absolute;top:50px;right:10px;text-align:right;}.cesium-performanceDisplay{background-color:rgba(40,40,40,0.7);padding:7px;border-radius:5px;border:1px solid #444;font:bold 12px sans-serif;}.cesium-performanceDisplay-fps{color:#e52;}.cesium-performanceDisplay-ms{color:#de3;}.cesium-animation-theme{visibility:hidden;display:block;position:absolute;z-index:-100;}.cesium-animation-themeNormal{color:#222;}.cesium-animation-themeHover{color:#4488B0;}.cesium-animation-themeSelect{color:#242;}.cesium-animation-themeDisabled{color:#333;}.cesium-animation-themeKnob{color:#222;}.cesium-animation-themePointer{color:#2E2;}.cesium-animation-themeSwoosh{color:#8AC;}.cesium-animation-themeSwooshHover{color:#AEF;}.cesium-animation-svgText{fill:#edffff;font-family:Sans-Serif;font-size:15px;text-anchor:middle;}.cesium-animation-blank{fill:#000;fill-opacity:0.01;stroke:none;}.cesium-animation-rectButton{cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-animation-rectButton .cesium-animation-buttonGlow{fill:#fff;stroke:none;display:none;}.cesium-animation-rectButton:hover .cesium-animation-buttonGlow{display:block;}.cesium-animation-rectButton .cesium-animation-buttonPath{fill:#edffff;}.cesium-animation-rectButton .cesium-animation-buttonMain{stroke:#444;stroke-width:1.2;}.cesium-animation-rectButton:hover .cesium-animation-buttonMain{stroke:#AEF;}.cesium-animation-rectButton:active .cesium-animation-buttonMain{fill:#ABD6FF;}.cesium-animation-buttonDisabled{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.cesium-animation-buttonDisabled .cesium-animation-buttonMain{stroke:#555;}.cesium-animation-buttonDisabled .cesium-animation-buttonPath{fill:#818181;}.cesium-animation-buttonDisabled .cesium-animation-buttonGlow{display:none;}.cesium-animation-buttonToggled .cesium-animation-buttonGlow{display:block;fill:#2E2;}.cesium-animation-buttonToggled .cesium-animation-buttonMain{stroke:#2E2;}.cesium-animation-buttonToggled:hover .cesium-animation-buttonGlow{fill:#fff;}.cesium-animation-buttonToggled:hover .cesium-animation-buttonMain{stroke:#2E2;}.cesium-animation-shuttleRingG{cursor:pointer;}.cesium-animation-shuttleRingPointer{cursor:pointer;}.cesium-animation-shuttleRingPausePointer{cursor:pointer;}.cesium-animation-shuttleRingBack{fill:#181818;fill-opacity:0.8;stroke:#333;stroke-width:1.2;}.cesium-animation-shuttleRingSwoosh line{stroke:#8AC;stroke-width:3;stroke-opacity:0.2;stroke-linecap:round;}.cesium-animation-knobOuter{cursor:pointer;stroke:#444;stroke-width:1.2;}.cesium-animation-knobInner{cursor:pointer;}.cesium-baseLayerPicker-selected{position:absolute;top:0;left:0;width:100%;height:100%;border:none;}.cesium-baseLayerPicker-dropDown{display:block;position:absolute;box-sizing:content-box;top:auto;right:0;width:320px;max-height:500px;margin-top:5px;background-color:rgba(38,38,38,0.75);border:1px solid #444;padding:6px;overflow:auto;border-radius:10px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;transform:translate(0,-20%);visibility:hidden;opacity:0;transition:visibility 0s 0.2s,opacity 0.2s ease-in,transform 0.2s ease-in;}.cesium-baseLayerPicker-dropDown-visible{transform:translate(0,0);visibility:visible;opacity:1;transition:opacity 0.2s ease-out,transform 0.2s ease-out;}.cesium-baseLayerPicker-sectionTitle{display:block;font-family:sans-serif;font-size:16pt;text-align:left;color:#edffff;border-bottom:1px solid #888;margin-bottom:4px;}.cesium-baseLayerPicker-choices{display:block;position:relative;top:auto;right:0;}.cesium-baseLayerPicker-item{display:inline-block;vertical-align:top;margin:2px 5px;width:64px;text-align:center;cursor:pointer;}.cesium-baseLayerPicker-itemLabel{display:block;font-family:sans-serif;font-size:8pt;text-align:center;vertical-align:middle;color:#edffff;cursor:pointer;word-wrap:break-word;}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemLabel,.cesium-baseLayerPicker-item:focus .cesium-baseLayerPicker-itemLabel{text-decoration:underline;}.cesium-baseLayerPicker-itemIcon{display:inline-block;position:relative;width:inherit;height:auto;background-size:100% 100%;border:solid 1px #444;border-radius:9px;color:#edffff;margin:0;padding:0;cursor:pointer;box-sizing:border-box;}.cesium-baseLayerPicker-item:hover .cesium-baseLayerPicker-itemIcon{border-color:#fff;box-shadow:0 0 8px #fff,0 0 8px #fff;}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemLabel{color:rgb(189,236,248);}.cesium-baseLayerPicker-selectedItem .cesium-baseLayerPicker-itemIcon{border:double 4px rgb(189,236,248);}.cesium-widget{position:relative;}.cesium-widget,.cesium-widget canvas{width:100%;height:100%;touch-action:none;}.cesium-widget-credits{display:block;position:absolute;bottom:0;left:0;color:#fff;font-size:10px;text-shadow:0px 0px 2px #000000;padding-right:5px;}.cesium-widget-credits a,.cesium-widget-credits a:visited{color:#fff;}.cesium-widget-errorPanel{position:absolute;top:0;right:0;bottom:0;left:0;text-align:center;background:rgba(0,0,0,0.7);z-index:99999;}.cesium-widget-errorPanel:before{display:inline-block;vertical-align:middle;height:100%;content:"";}.cesium-widget-errorPanel-content{width:75%;display:inline-block;text-align:left;vertical-align:middle;border:1px solid #526F82;border-radius:7px;background-color:black;color:white;font-size:10pt;padding:1em;}.cesium-widget-errorPanel-header{font-size:120%;color:#fe4;}.cesium-widget-errorPanel-scroll{overflow:auto;font-family:monospace;white-space:pre-wrap;padding:0;margin:10px 0;}.cesium-widget-errorPanel-buttonPanel{text-align:center;}.cesium-cesiumInspector{border-radius:5px;transition:width ease-in-out 0.25s;background:rgba(48,51,54,0.8);border:1px solid #444;color:#edffff;display:inline-block;position:relative;padding:4px 12px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;}.cesium-cesiumInspector-button{text-align:center;font-size:11pt;}.cesium-cesiumInspector-visible .cesium-cesiumInspector-button{border-bottom:1px solid #aaa;padding-bottom:3px;}.cesium-cesiumInspector input:enabled,.cesium-cesiumInspector-button{cursor:pointer;}.cesium-cesiumInspector-visible{width:185px;height:auto;}.cesium-cesiumInspector-hidden{width:122px;height:17px;}.cesium-cesiumInspector-show{max-height:500px;}.cesium-cesiumInspector-hide{max-height:0;padding:0 !important;overflow:hidden;}.cesium-cesiumInspector-dropDown{margin:5px 0;font-family:sans-serif;font-size:10pt;width:185px;}.cesium-cesiumInspector-frustumStats{padding-left:10px;padding:5px;background-color:rgba(80,80,80,0.75);}.cesium-cesiumInspector-pickButton{background-color:rgba(0,0,0,0.3);border:1px solid #444;color:#edffff;border-radius:5px;padding:3px 7px;cursor:pointer;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;margin:0 auto;}.cesium-cesiumInspector-pickButton:focus{outline:none;}.cesium-cesiumInspector-pickButton:active,.cesium-cesiumInspector-pickButtonHighlight{color:#000;background:#adf;border-color:#fff;box-shadow:0 0 8px #fff;}.cesium-cesiumInspector-center{text-align:center;}.cesium-cesiumInspector-sectionHeader{font-weight:bold;}.cesium-cesiumInspector-pickSection{border:1px solid #aaa;border-radius:5px;padding:3px;margin-bottom:5px;}.cesium-cesiumInspector-section{margin-bottom:10px;transition:max-height 0.25s;}.cesium-cesiumInspector-toggleSwitch{padding:3px;cursor:pointer;}.cesium-cesiumInspector-tileText{padding-bottom:10px;border-bottom:1px solid #aaa;}.cesium-cesiumInspector-relativeText{padding-top:10px;}.cesium-button.cesium-fullscreenButton{display:block;width:100%;height:100%;margin:0;border-radius:0;}.cesium-button.cesium-vrButton{display:block;width:100%;height:100%;margin:0;border-radius:0;}.cesium-viewer-geocoderContainer .cesium-geocoder-input{border:solid 1px #444;background-color:rgba(40,40,40,0.7);color:white;display:inline-block;vertical-align:middle;width:0;height:32px;margin:0;padding:0 32px 0 0;border-radius:0;box-sizing:border-box;transition:width ease-in-out 0.25s,background-color 0.2s ease-in-out;-webkit-appearance:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input{border-color:#aef;box-shadow:0 0 8px #fff;}.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus{border-color:#ea4;background-color:rgba(15,15,15,0.9);box-shadow:none;outline:none;}.cesium-viewer-geocoderContainer:hover .cesium-geocoder-input,.cesium-viewer-geocoderContainer .cesium-geocoder-input:focus,.cesium-viewer-geocoderContainer .cesium-geocoder-input-wide{padding-left:4px;width:250px;}.cesium-viewer-geocoderContainer .search-results{position:absolute;background-color:#000;color:#eee;overflow-y:auto;opacity:0.8;width:100%;}.cesium-viewer-geocoderContainer .search-results ul{list-style-type:none;margin:0;padding:0;}.cesium-viewer-geocoderContainer .search-results ul li{font-size:14px;padding:3px 10px;}.cesium-viewer-geocoderContainer .search-results ul li:hover{cursor:pointer;}.cesium-viewer-geocoderContainer .search-results ul li.active{background:#48b;}.cesium-geocoder-searchButton{background-color:#303336;display:inline-block;position:absolute;cursor:pointer;width:32px;top:1px;right:1px;height:30px;vertical-align:middle;fill:#edffff;}.cesium-geocoder-searchButton:hover{background-color:#48b;}.cesium-infoBox{display:block;position:absolute;top:50px;right:0;width:40%;max-width:480px;background:rgba(38,38,38,0.95);color:#edffff;border:1px solid #444;border-right:none;border-top-left-radius:7px;border-bottom-left-radius:7px;box-shadow:0 0 10px 1px #000;transform:translate(100%,0);visibility:hidden;opacity:0;transition:visibility 0s 0.2s,opacity 0.2s ease-in,transform 0.2s ease-in;}.cesium-infoBox-visible{transform:translate(0,0);visibility:visible;opacity:1;transition:opacity 0.2s ease-out,transform 0.2s ease-out;}.cesium-infoBox-title{display:block;height:20px;padding:5px 30px 5px 25px;background:rgba(84,84,84,1.0);border-top-left-radius:7px;text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;box-sizing:content-box;}.cesium-infoBox-bodyless .cesium-infoBox-title{border-bottom-left-radius:7px;}button.cesium-infoBox-camera{display:block;position:absolute;top:4px;left:4px;width:22px;height:22px;background:transparent;border-color:transparent;border-radius:3px;padding:0 5px;margin:0;}button.cesium-infoBox-close{display:block;position:absolute;top:5px;right:5px;height:20px;background:transparent;border:none;border-radius:2px;font-weight:bold;font-size:16px;padding:0 5px;margin:0;color:#edffff;}button.cesium-infoBox-close:focus{background:rgba(238,136,0,0.44);outline:none;}button.cesium-infoBox-close:hover{background:#888;color:#000;}button.cesium-infoBox-close:active{background:#a00;color:#000;}.cesium-infoBox-bodyless .cesium-infoBox-iframe{display:none;}.cesium-infoBox-iframe{border:none;width:100%;width:calc(100% - 2px);}span.cesium-sceneModePicker-wrapper{display:inline-block;position:relative;margin:0 3px;}.cesium-sceneModePicker-visible{visibility:visible;opacity:1;transition:opacity 0.25s linear;}.cesium-sceneModePicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s 0.25s,opacity 0.25s linear;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-none{display:none;}.cesium-sceneModePicker-slide-svg{transition:left 2s;top:0;left:0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-dropDown-icon{box-sizing:border-box;padding:0;margin:3px 0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView,.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D{margin:0 0 3px 0;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-icon2D{left:100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button3D .cesium-sceneModePicker-iconColumbusView{left:200%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon3D{left:-200%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-buttonColumbusView .cesium-sceneModePicker-icon2D{left:-100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-icon3D{left:-100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-button2D .cesium-sceneModePicker-iconColumbusView{left:100%;}.cesium-sceneModePicker-wrapper .cesium-sceneModePicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff;}span.cesium-projectionPicker-wrapper{display:inline-block;position:relative;margin:0 3px;}.cesium-projectionPicker-visible{visibility:visible;opacity:1;transition:opacity 0.25s linear;}.cesium-projectionPicker-hidden{visibility:hidden;opacity:0;transition:visibility 0s 0.25s,opacity 0.25s linear;}.cesium-projectionPicker-wrapper .cesium-projectionPicker-none{display:none;}.cesium-projectionPicker-wrapper .cesium-projectionPicker-dropDown-icon{box-sizing:border-box;padding:0;margin:3px 0;}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective,.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic{margin:0 0 3px 0;}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonPerspective .cesium-projectionPicker-iconOrthographic{left:100%;}.cesium-projectionPicker-wrapper .cesium-projectionPicker-buttonOrthographic .cesium-projectionPicker-iconPerspective{left:-100%;}.cesium-projectionPicker-wrapper .cesium-projectionPicker-selected{border-color:#2e2;box-shadow:0 0 8px #fff,0 0 8px #fff;}.cesium-performance-watchdog-message-area{position:relative;background-color:yellow;color:black;padding:10px;}.cesium-performance-watchdog-message{margin-right:30px;}.cesium-performance-watchdog-message-dismiss{position:absolute;right:0;margin:0 10px 0 0;}.cesium-navigationHelpButton-wrapper{position:relative;display:inline-block;}.cesium-navigation-help{visibility:hidden;position:absolute;top:38px;right:2px;width:250px;border-radius:10px;transform:scale(0.01);transform-origin:234px -10px;transition:visibility 0s 0.25s,transform 0.25s ease-in;}.cesium-navigation-help-visible{visibility:visible;transform:scale(1);transition:transform 0.25s ease-out;}.cesium-navigation-help-instructions{border:1px solid #444;background-color:rgba(38,38,38,0.75);padding-bottom:5px;border-radius:0 0 10px 10px;}.cesium-click-navigation-help{display:none;}.cesium-touch-navigation-help{display:none;padding-top:5px;}.cesium-click-navigation-help-visible{display:block;}.cesium-touch-navigation-help-visible{display:block;}.cesium-navigation-help-pan{color:#66ccff;font-weight:bold;}.cesium-navigation-help-zoom{color:#65fd00;font-weight:bold;}.cesium-navigation-help-rotate{color:#ffd800;font-weight:bold;}.cesium-navigation-help-tilt{color:#d800d8;font-weight:bold;}.cesium-navigation-help-details{color:#ffffff;}.cesium-navigation-button{color:#fff;background-color:transparent;border-bottom:none;border-top:1px solid #444;border-right:1px solid #444;margin:0;width:50%;cursor:pointer;}.cesium-navigation-button-icon{vertical-align:middle;padding:5px 1px;}.cesium-navigation-button:focus{outline:none;}.cesium-navigation-button-left{border-radius:10px 0 0 0;border-left:1px solid #444;}.cesium-navigation-button-right{border-radius:0 10px 0 0;border-left:none;}.cesium-navigation-button-selected{background-color:rgba(38,38,38,0.75);}.cesium-navigation-button-unselected{background-color:rgba(0,0,0,0.75);}.cesium-navigation-button-unselected:hover{background-color:rgba(76,76,76,0.75);}.cesium-selection-wrapper{position:absolute;width:160px;height:160px;pointer-events:none;visibility:hidden;opacity:0;transition:visibility 0s 0.2s,opacity 0.2s ease-in;}.cesium-selection-wrapper-visible{visibility:visible;opacity:1;transition:opacity 0.2s ease-out;}.cesium-selection-wrapper svg{fill:#2e2;stroke:#000;stroke-width:1.1px;}.cesium-timeline-main{position:relative;left:0;bottom:0;overflow:hidden;border:solid 1px #888;}.cesium-timeline-trackContainer{width:100%;overflow:auto;border-top:solid 1px #888;position:relative;top:0;left:0;}.cesium-timeline-tracks{position:absolute;top:0;left:0;width:100%;}.cesium-timeline-needle{position:absolute;left:0;top:1.7em;bottom:0;width:1px;background:#F00;}.cesium-timeline-bar{position:relative;left:0;top:0;overflow:hidden;cursor:pointer;width:100%;height:1.7em;background:linear-gradient(to bottom,rgba(116,117,119,0.8) 0%,rgba(58,68,82,0.8) 11%,rgba(46,50,56,0.8) 46%,rgba(53,53,53,0.8) 81%,rgba(53,53,53,0.8) 100%);}.cesium-timeline-ruler{visibility:hidden;white-space:nowrap;font-size:80%;z-index:-200;}.cesium-timeline-highlight{position:absolute;bottom:0;left:0;background:#08F;}.cesium-timeline-ticLabel{position:absolute;top:0;left:0;white-space:nowrap;font-size:80%;color:#eee;}.cesium-timeline-ticMain{position:absolute;bottom:0;left:0;width:1px;height:50%;background:#eee;}.cesium-timeline-ticSub{position:absolute;bottom:0;left:0;width:1px;height:33%;background:#aaa;}.cesium-timeline-ticTiny{position:absolute;bottom:0;left:0;width:1px;height:25%;background:#888;}.cesium-timeline-icon16{display:block;position:absolute;width:16px;height:16px;background-image:url(Images/TimelineIcons.png);background-repeat:no-repeat;}.cesium-viewer{font-family:sans-serif;font-size:16px;overflow:hidden;display:block;position:relative;top:0;left:0;width:100%;height:100%;}.cesium-viewer-cesiumWidgetContainer{width:100%;height:100%;}.cesium-viewer-bottom{display:block;position:absolute;bottom:0;left:0;right:0;padding-right:5px;}.cesium-viewer .cesium-widget-credits{display:inline;position:static;bottom:auto;left:auto;padding-right:0;color:#ffffff;font-size:10px;text-shadow:0 0 2px #000000;}.cesium-viewer-timelineContainer{position:absolute;bottom:0;left:169px;right:29px;height:27px;padding:0;margin:0;overflow:hidden;font-size:14px;}.cesium-viewer-animationContainer{position:absolute;bottom:0;left:0;padding:0;width:169px;height:112px;}.cesium-viewer-fullscreenContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden;}.cesium-viewer-vrContainer{position:absolute;bottom:0;right:0;padding:0;width:29px;height:29px;overflow:hidden;}.cesium-viewer-toolbar{display:block;position:absolute;top:5px;right:5px;}.cesium-viewer-cesiumInspectorContainer{display:block;position:absolute;top:50px;right:10px;}.cesium-viewer-geocoderContainer{position:relative;display:inline-block;margin:0 3px;} \ No newline at end of file diff --git a/engines/Cesium/Workers/combineGeometry.js b/engines/Cesium/Workers/combineGeometry.js index 4448ea8..0203f2e 100644 --- a/engines/Cesium/Workers/combineGeometry.js +++ b/engines/Cesium/Workers/combineGeometry.js @@ -55,8 +55,8 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var E=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,E=n*u-a*o;return r.x=c,r.y=l,r.z=E,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(n),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),r(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,E=r.y,f=r.z,h=a.x,d=a.y,_=a.z,p=l*l*h*h,m=E*E*d*d,T=f*f*_*_,y=p+m+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(r,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,S=u.y,N=u.z,I=o;I.x=A.x*v*2,I.y=A.y*S*2,I.z=A.z*N*2;var M,O,g,C,w,P,x,L,U,b,F,D=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),B=0;do{D-=B,g=1/(1+D*v),C=1/(1+D*S),w=1/(1+D*N),P=g*g,x=C*C,L=w*w,U=P*g,b=x*C,F=L*w,M=p*P+m*x+T*L-1,O=p*U*v+m*b*S+T*F*N;var z=-2*O;B=M/z}while(Math.abs(M)>n.EPSILON12);return t(c)?(c.x=l*g,c.y=E*C,c.z=f*w,c):new e(l*g,E*C,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var d=r(n)?n.oneOverRadii:E,_=r(n)?n.oneOverRadiiSquared:f,p=r(n)?n._centerToleranceSquared:h,m=o(t,d,_,p,c);if(r(m)){var T=e.multiplyComponents(m,_,s);T=e.normalize(T,T);var y=e.subtract(t,m,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),v=i.sign(e.dot(y,t))*e.magnitude(y);return r(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,r){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._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,r){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,_=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,_),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(_[r],d[r])];t+=2*n*n}return Math.sqrt(t)}function E(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(_[i],d[i])]);o>n&&(a=i,n=o)}var c=1,l=0,E=d[a],f=_[a];if(Math.abs(e[s.getElementIndex(f,E)])>r){var h,p=e[s.getElementIndex(f,f)],m=e[s.getElementIndex(E,E)],T=e[s.getElementIndex(f,E)],y=(p-m)/2/T;h=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(E,E)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,E)]=l,t[s.getElementIndex(E,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=r-u-E+h,_=2*(a-f),p=2*(i+l),m=2*(a+f),T=-r+u-E+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),v=-r-u+E+h;return n(t)?(t[0]=d,t[1]=m,t[2]=R,t[3]=_,t[4]=T,t[5]=A,t[6]=p,t[7]=y,t[8]=v,t):new s(d,_,p,m,T,y,R,A,v)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,E=-i*u+c*o*a,f=c*u+i*o*a,h=r*u,d=i*a+c*o*u,_=-o*i+i*o*u,p=-o,m=c*r,T=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=E,t[4]=d,t[5]=m,t[6]=f,t[7]=_,t[8]=T,t):new s(l,E,f,h,d,_,p,m,T)},s.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var f=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),r};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=E,r},s.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},s.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},s.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],_=[2,2,1],p=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,i=0,o=0;n(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),d=r*c(h);o<a&&l(h)>d;)E(h,p),s.transpose(p,m),s.multiply(h,p,h),s.multiply(m,h,h),s.multiply(f,p,f),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],E=e[8],f=s.determinant(e);t[0]=o*E-l*u,t[1]=l*a-n*E,t[2]=n*u-o*a,t[3]=c*u-i*E,t[4]=r*E-c*a,t[5]=i*a-r*u,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/f;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){ -"use strict";function l(e,t,r,a,i,o,u,s,c,l,E,f,h,d,_,p){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(d,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(E,0),this[11]=n(_,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(p,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new l),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,r,i){return r=n(r,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,i):new l(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,E=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,_=t.y*t.w,p=t.z*t.z,m=t.z*t.w,T=t.w*t.w,y=s-h-p+T,R=2*(c-m),A=2*(E+_),v=2*(c+m),S=-s+h-p+T,N=2*(d-f),I=2*(E-_),M=2*(d+f),O=-s-h+p+T;return n[0]=y*i,n[1]=v*i,n[2]=I*i,n[3]=0,n[4]=R*o,n[5]=S*o,n[6]=M*o,n[7]=0,n[8]=A*u,n[9]=N*u,n[10]=O*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var E=new e,f=new e,h=new e;l.fromCamera=function(t,r){var n=t.position,i=t.direction,o=t.up;e.normalize(i,E),e.normalize(e.cross(E,o,f),f),e.normalize(e.cross(f,E,h),h);var u=f.x,s=f.y,c=f.z,d=E.x,_=E.y,p=E.z,m=h.x,T=h.y,y=h.z,R=n.x,A=n.y,v=n.z,S=u*-R+s*-A+c*-v,N=m*-R+T*-A+y*-v,I=d*R+_*A+p*v;return a(r)?(r[0]=u,r[1]=m,r[2]=-d,r[3]=0,r[4]=s,r[5]=T,r[6]=-_,r[7]=0,r[8]=c,r[9]=y,r[10]=-p,r[11]=0,r[12]=S,r[13]=N,r[14]=I,r[15]=1,r):new l(u,s,c,S,m,T,y,N,-d,-_,-p,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,E=-(n+r)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,E=.5*(r-t),f=c,h=l,d=E,_=i+c,p=o+l,m=t+E,T=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=_,a[13]=p,a[14]=m,a[15]=T,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var d=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),r};var _=new e;l.getMaximumScale=function(t){return l.getScale(t,_),e.maximumComponent(_)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],_=e[12],p=e[13],m=e[14],T=e[15],y=t[0],R=t[1],A=t[2],v=t[3],S=t[4],N=t[5],I=t[6],M=t[7],O=t[8],g=t[9],C=t[10],w=t[11],P=t[12],x=t[13],L=t[14],U=t[15],b=n*y+u*R+E*A+_*v,F=a*y+s*R+f*A+p*v,D=i*y+c*R+h*A+m*v,B=o*y+l*R+d*A+T*v,z=n*S+u*N+E*I+_*M,G=a*S+s*N+f*I+p*M,V=i*S+c*N+h*I+m*M,q=o*S+l*N+d*I+T*M,X=n*O+u*g+E*C+_*w,H=a*O+s*g+f*C+p*w,W=i*O+c*g+h*C+m*w,k=o*O+l*g+d*C+T*w,Y=n*P+u*x+E*L+_*U,Z=a*P+s*x+f*L+p*U,K=i*P+c*x+h*L+m*U,j=o*P+l*x+d*L+T*U;return r[0]=b,r[1]=F,r[2]=D,r[3]=B,r[4]=z,r[5]=G,r[6]=V,r[7]=q,r[8]=X,r[9]=H,r[10]=W,r[11]=k,r[12]=Y,r[13]=Z,r[14]=K,r[15]=j,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],_=t[0],p=t[1],m=t[2],T=t[4],y=t[5],R=t[6],A=t[8],v=t[9],S=t[10],N=t[12],I=t[13],M=t[14],O=n*_+o*p+c*m,g=a*_+u*p+l*m,C=i*_+s*p+E*m,w=n*T+o*y+c*R,P=a*T+u*y+l*R,x=i*T+s*y+E*R,L=n*A+o*v+c*S,U=a*A+u*v+l*S,b=i*A+s*v+E*S,F=n*N+o*I+c*M+f,D=a*N+u*I+l*M+h,B=i*N+s*I+E*M+d;return r[0]=O,r[1]=g,r[2]=C,r[3]=0,r[4]=w,r[5]=P,r[6]=x,r[7]=0,r[8]=L,r[9]=U,r[10]=b,r[11]=0,r[12]=F,r[13]=D,r[14]=B,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],_=t[3],p=t[4],m=t[5],T=t[6],y=t[7],R=t[8],A=n*f+o*h+c*d,v=a*f+u*h+l*d,S=i*f+s*h+E*d,N=n*_+o*p+c*m,I=a*_+u*p+l*m,M=i*_+s*p+E*m,O=n*T+o*y+c*R,g=a*T+u*y+l*R,C=i*T+s*y+E*R;return r[0]=A,r[1]=v,r[2]=S,r[3]=0,r[4]=N,r[5]=I,r[6]=M,r[7]=0,r[8]=O,r[9]=g,r[10]=C,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var p=new e;l.multiplyByUniformScale=function(e,t,r){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var m=new s,T=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,m),T,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],E=e[1],f=e[5],h=e[9],d=e[13],_=e[2],p=e[6],A=e[10],v=e[14],S=e[3],N=e[7],I=e[11],M=e[15],O=A*M,g=v*I,C=p*M,w=v*N,P=p*I,x=A*N,L=_*M,U=v*S,b=_*I,F=A*S,D=_*N,B=p*S,z=O*f+w*h+P*d-(g*f+C*h+x*d),G=g*E+L*h+F*d-(O*E+U*h+b*d),V=C*E+U*f+D*d-(w*E+L*f+B*d),q=x*E+b*f+B*h-(P*E+F*f+D*h),X=g*a+C*i+x*o-(O*a+w*i+P*o),H=O*n+U*i+b*o-(g*n+L*i+F*o),W=w*n+L*a+B*o-(C*n+U*a+D*o),k=P*n+F*a+D*i-(x*n+b*a+B*i);O=i*d,g=o*h,C=a*d,w=o*f,P=a*h,x=i*f,L=n*d,U=o*E,b=n*h,F=i*E,D=n*f,B=a*E;var Y=O*N+w*I+P*M-(g*N+C*I+x*M),Z=g*S+L*I+F*M-(O*S+U*I+b*M),K=C*S+U*N+D*M-(w*S+L*N+B*M),j=x*S+b*N+B*I-(P*S+F*N+D*I),Q=C*A+x*v+g*p-(P*v+O*p+w*A),J=b*v+O*_+U*A-(L*A+F*v+g*_),$=L*p+B*v+w*_-(D*v+C*_+U*p),ee=D*A+P*_+F*p-(b*p+B*A+x*_),te=n*z+a*G+i*V+o*q;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=z*te,r[1]=G*te,r[2]=V*te,r[3]=q*te,r[4]=X*te,r[5]=H*te,r[6]=W*te,r[7]=k*te,r[8]=Y*te,r[9]=Z*te,r[10]=K*te,r[11]=j*te,r[12]=Q*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-r*E-n*f-a*h,_=-i*E-o*f-u*h,p=-s*E-c*f-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=_,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(r(e,0)),t=u.toRadians(r(t,0)),a=u.toRadians(r(a,0)),i=u.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var _=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,_),c=Math.max(c,_)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=E,r):new s(a,l,i,E)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),E=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return n(r)?(r.west=l,r.south=f,r.east=E,r.north=h,r):new s(l,f,E,h)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),E=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=E,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0),n(o)||(o=[]);var l=0,E=e.north,f=e.south,h=e.east,d=e.west,_=c;_.height=a,_.longitude=d,_.latitude=E,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=h,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.latitude=f,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++,E<0?_.latitude=E:f>0?_.latitude=f:_.latitude=0;for(var p=1;p<8;++p)_.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=t.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=h,o[l]=t.cartographicToCartesian(_,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,E){"use strict";function f(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,d=new e,_=new e,p=new e,m=new e,T=new e,y=new e,R=new e,A=new e,v=new e,S=new e,N=new e;f.fromPoints=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],y),i=e.clone(n,h),o=e.clone(n,d),u=e.clone(n,_),s=e.clone(n,p),c=e.clone(n,m),l=e.clone(n,T),E=t.length,I=1;I<E;I++){e.clone(t[I],n);var M=n.x,O=n.y,g=n.z;M<i.x&&e.clone(n,i),M>s.x&&e.clone(n,s),O<o.y&&e.clone(n,o),O>c.y&&e.clone(n,c),g<u.z&&e.clone(n,u),g>l.z&&e.clone(n,l)}var C=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=i,L=s,U=C;w>U&&(U=w,x=o,L=c),P>U&&(U=P,x=u,L=l);var b=A;b.x=.5*(x.x+L.x),b.y=.5*(x.y+L.y),b.z=.5*(x.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,R)),D=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,R),.5,N),V=0;for(I=0;I<E;I++){e.clone(t[I],n);var q=e.magnitude(e.subtract(n,G,R));q>V&&(V=q);var X=e.magnitudeSquared(e.subtract(n,b,R));if(X>F){var H=Math.sqrt(X);D=.5*(D+H),F=D*D;var W=H-D;b.x=(D*b.x+W*n.x)/H,b.y=(D*b.y+W*n.y)/H,b.z=(D*b.z+W*n.z)/H}}return D<V?(e.clone(b,r.center),r.radius=D):(e.clone(G,r.center),r.radius=V),r};var I=new o,M=new e,O=new e,g=new t,C=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,I),E.southwest(t,g),g.height=i,E.northeast(t,C),C.height=o;var s=r.project(g,M),c=r.project(C,O),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*h,_.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,r,o){t=n(t,i.WGS84),r=n(r,0);var u;return a(e)&&(u=E.subsample(e,t,r,w)),f.fromPoints(u,o)},f.fromVertices=function(t,r,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),i=n(i,3);var u=y;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,_),E=e.clone(u,p),I=e.clone(u,m),M=e.clone(u,T),O=t.length,g=0;g<O;g+=i){var C=t[g]+r.x,w=t[g+1]+r.y,P=t[g+2]+r.z;u.x=C,u.y=w,u.z=P,C<s.x&&e.clone(u,s),C>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),P<l.z&&e.clone(u,l),P>M.z&&e.clone(u,M)}var x=e.magnitudeSquared(e.subtract(E,s,R)),L=e.magnitudeSquared(e.subtract(I,c,R)),U=e.magnitudeSquared(e.subtract(M,l,R)),b=s,F=E,D=x;L>D&&(D=L,b=c,F=I),U>D&&(D=U,b=l,F=M);var B=A;B.x=.5*(b.x+F.x),B.y=.5*(b.y+F.y),B.z=.5*(b.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(z),V=v;V.x=s.x,V.y=c.y,V.z=l.z;var q=S;q.x=E.x,q.y=I.y,q.z=M.z;var X=e.multiplyByScalar(e.add(V,q,R),.5,N),H=0;for(g=0;g<O;g+=i){u.x=t[g]+r.x,u.y=t[g+1]+r.y,u.z=t[g+2]+r.z;var W=e.magnitude(e.subtract(u,X,R));W>H&&(H=W);var k=e.magnitudeSquared(e.subtract(u,B,R));if(k>z){var Y=Math.sqrt(k);G=.5*(G+Y),z=G*G;var Z=Y-G;B.x=(G*B.x+Z*u.x)/Y,B.y=(G*B.y+Z*u.y)/Y,B.z=(G*B.z+Z*u.z)/Y}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},f.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new f),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=y;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,_),c=e.clone(i,p),l=e.clone(i,m),E=e.clone(i,T),I=t.length,M=0;M<I;M+=3){var O=t[M]+r[M],g=t[M+1]+r[M+1],C=t[M+2]+r[M+2];i.x=O,i.y=g,i.z=C,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),C<s.z&&e.clone(i,s),C>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=e.magnitudeSquared(e.subtract(E,s,R)),L=o,U=c,b=w;P>b&&(b=P,L=u,U=l),x>b&&(b=x,L=s,U=E);var F=A;F.x=.5*(L.x+U.x),F.y=.5*(L.y+U.y),F.z=.5*(L.z+U.z);var D=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(D),z=v;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=E.z;var V=e.multiplyByScalar(e.add(z,G,R),.5,N),q=0;for(M=0;M<I;M+=3){i.x=t[M]+r[M],i.y=t[M+1]+r[M+1],i.z=t[M+2]+r[M+2];var X=e.magnitude(e.subtract(i,V,R));X>q&&(q=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>D){var W=Math.sqrt(H);B=.5*(B+W),D=B*B;var k=W-B;F.x=(B*F.x+k*i.x)/W,F.y=(B*F.y+k*i.y)/W,F.z=(B*F.z+k*i.z)/W}}return B<q?(e.clone(F,n.center),n.radius=B):(e.clone(V,n.center),n.radius=q),n},f.fromCornerPoints=function(t,r,n){a(n)||(n=new f);var i=n.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),n.radius=e.distance(i,r),n},f.fromEllipsoid=function(t,r){return a(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var P=new e;f.fromBoundingSpheres=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return f.clone(t[0],r);if(2===n)return f.union(t[0],t[1],r);for(var i=[],o=0;o<n;o++)i.push(t[o].center);r=f.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var x=new e,L=new e,U=new e;f.fromOrientedBoundingBox=function(t,r){a(r)||(r=new f);var n=t.halfAxes,i=c.getColumn(n,0,x),o=c.getColumn(n,1,L),u=c.getColumn(n,2,U),s=e.magnitude(i),l=e.magnitude(o),E=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,E),r},f.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},f.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new f);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var b=new e,F=new e;f.union=function(t,r,n){a(n)||(n=new f);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,b),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,n.center),n.radius=E,n};var D=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,D));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var B=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,B);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;f.computePlaneDistances=function(t,r,n,i){a(i)||(i=new s);var o=e.subtract(t.center,r,z),u=e.dot(n,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,V=new e,q=new e,X=new e,H=new e,W=new t,k=new Array(8),Y=0;Y<8;++Y)k[Y]=new e;var Z=new o;return f.projectTo2D=function(t,r,a){r=n(r,Z);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,V);e.normalize(c,c);var l=e.cross(s,c,q);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,H),h=e.negate(c,X),d=k,_=d[0];e.add(s,l,_),e.add(_,c,_),_=d[1],e.add(s,l,_),e.add(_,h,_),_=d[2],e.add(s,E,_),e.add(_,h,_),_=d[3],e.add(s,E,_),e.add(_,c,_),e.negate(s,s),_=d[4],e.add(s,l,_),e.add(_,c,_),_=d[5],e.add(s,l,_),e.add(_,h,_),_=d[6],e.add(s,E,_),e.add(_,h,_),_=d[7],e.add(s,E,_),e.add(_,c,_);for(var p=d.length,m=0;m<p;++m){var T=d[m];e.add(o,T,T);var y=i.cartesianToCartographic(T,W);r.project(y,T)}a=f.fromPoints(d,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,r){return f.computePlaneDistances(this,e,t,r)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=n(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(S)&&(S=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=n(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,M=n(e[1]),M.isNightly=!!e[2])}return I}function c(){return s()&&M}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1])))}return O}function E(){return l()&&g}function f(){if(!t(C)){C=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,w=n(e[1]))}return C}function h(){return f()&&w}function d(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent); -null!==e&&(P=!0,x=n(e[1]))}return P}function _(){return t(L)||(L=/Windows/i.test(R.appVersion)),L}function p(){return d()&&x}function m(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function T(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(b=r)}return F}function y(){return T()?b:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,S,N,I,M,O,g,C,w,P,x,L,U,b,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:p,isWindows:_,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:T,imageRenderingValue:y};return D.supportsFullscreen=function(){return r.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var a=0;a<n;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var E=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var E,f,h,d,_,p,m,T;r(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(n,a,u),d=t.dot(E,E),_=t.dot(E,f),p=t.dot(E,h),m=t.dot(f,f),T=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(n,a,u),d=e.dot(E,E),_=e.dot(E,f),p=e.dot(E,h),m=e.dot(f,f),T=e.dot(f,h));var y=1/(d*m-_*_);return l.y=(m*p-_*T)*y,l.z=(d*T-_*p)*y,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,E=r(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(E),t.EPSILON14);return n>0?[f/e,a/f]:[a/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,_=o*c-u*s,p=u*c-h,m=4*d*p-_*_;if(m<0){var T,y,R;f*E>=l*h?(T=o,y=d,R=-2*u*d+o*_):(T=c,y=p,R=-c*_+2*s*p);var A=R<0?-1:1,v=-A*Math.abs(T)*Math.sqrt(-m);i=-R+v;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),I=i===v?-N:-y/N;return a=y<=0?N+I:-R/(N*N+I*I+y),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var M=d,O=-2*u*d+o*_,g=p,C=-c*_+2*s*p,w=Math.sqrt(m),P=Math.sqrt(3)/2,x=Math.abs(Math.atan2(o*w,-O)/3);a=2*Math.sqrt(-M);var L=Math.cos(x);i=a*L;var U=a*(-L/2-P*Math.sin(x)),b=i+U>2*u?i-u:U-u,F=o,D=b/F;x=Math.abs(Math.atan2(c*w,-C)/3),a=2*Math.sqrt(-g),L=Math.cos(x),i=a*L,U=a*(-L/2-P*Math.sin(x));var B=-c,z=i+U<2*s?i+s:U+s,G=B/z,V=F*z,q=-b*z-F*B,X=b*B,H=(s*q-u*X)/(-u*q+s*V);return D<=H?D<=G?H<=G?[D,H,G]:[D,G,H]:[G,D,H]:D<=G?[H,D,G]:H<=G?[H,G,D]:[G,H,D]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var _,p=d[0],m=d[1];if(p>=0&&m>=0){var T=Math.sqrt(p),y=Math.sqrt(m);return[f-y,f-T,f+T,f+y]}if(p>=0&&m<0)return _=Math.sqrt(p),[f-_,f+_];if(p<0&&m>=0)return _=Math.sqrt(m),[f-_,f+_]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,S=n.computeRealRoots(1,R,A),N=n.computeRealRoots(1,-R,v);return 0!==S.length?(S[0]+=f,S[1]+=f,0!==N.length?(N[0]+=f,N[1]+=f,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=f,N[1]+=f,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,_,p=h[0],m=a-p,T=m*m,y=t/2,R=m/2,A=T-4*o,v=T+4*Math.abs(o),S=c-4*p,N=c+4*Math.abs(p);if(p<0||A*N<S*v){var I=Math.sqrt(S);d=I/2,_=0===I?0:(t*R-i)/I}else{var M=Math.sqrt(A);d=0===M?0:(t*R-i)/M,_=M/2}var O,g;0===y&&0===d?(O=0,g=0):r.sign(y)===r.sign(d)?(O=y+d,g=p/O):(g=y-d,O=p/g);var C,w;0===R&&0===_?(C=0,w=0):r.sign(R)===r.sign(_)?(C=R+_,w=o/C):(w=R-_,C=o/w);var P=n.computeRealRoots(1,O,C),x=n.computeRealRoots(1,g,w);if(0!==P.length)return 0!==x.length?P[1]<=x[0]?[P[0],P[1],x[0],x[1]]:x[1]<=P[0]?[x[0],x[1],P[0],P[1]]:P[0]>=x[0]&&P[1]<=x[1]?[x[0],P[0],P[1],x[1]]:x[0]>=P[0]&&x[1]<=P[1]?[P[0],x[0],x[1],P[1]]:P[0]>x[0]&&P[0]<x[1]?[x[0],P[0],x[1],P[1]]:[P[0],x[0],P[1],x[1]]:P;if(0!==x.length)return x}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,E=n*n,f=E*n,h=a*a,d=h*a,_=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*o*d+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*E+144*i*r*E)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return _},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n}return a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";function E(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function f(t,r,a){n(a)||(a=new i);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,T),f=e.dot(u,u),h=2*e.dot(u,l),d=e.magnitudeSquared(l)-c,_=E(f,h,d,v);if(n(_))return a.start=_.root0,a.stop=_.root1,a}function h(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function d(t,r,n,a,i){var l,E=a*a,f=i*i,d=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,_=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),p=t[u.COLUMN0ROW0]*E+t[u.COLUMN2ROW2]*f+a*r.x+n,m=f*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),T=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),y=[];if(0===T&&0===m){if(l=s.computeRealRoots(d,_,p),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)), -2===l.length){var v=l[1],S=Math.sqrt(Math.max(1-v*v,0));y.push(new e(a,i*v,i*-S)),y.push(new e(a,i*v,i*S))}return y}var N=T*T,I=m*m,M=d*d,O=T*m,g=M+I,C=2*(_*d+O),w=2*p*d+_*_-I+N,P=2*(p*_-O),x=p*p-N;if(0===g&&0===C&&0===w&&0===P)return y;l=c.computeRealRoots(g,C,w,P,x);var L=l.length;if(0===L)return y;for(var U=0;U<L;++U){var b,F=l[U],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B);b=o.sign(d)===o.sign(p)?h(d*D+p,_*F,o.EPSILON12):o.sign(p)===o.sign(_*F)?h(d*D,_*F+p,o.EPSILON12):h(d*D+_*F,p,o.EPSILON12);var G=h(m*F,T,o.EPSILON15),V=b*G;V<0?y.push(new e(a,i*F,i*z)):V>0?y.push(new e(a,i*F,i*-z)):0!==z?(y.push(new e(a,i*F,i*-z)),y.push(new e(a,i*F,i*z)),++U):y.push(new e(a,i*F,i*z))}return y}var _={};_.rayPlane=function(t,r,a){n(a)||(a=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,m=new e,T=new e,y=new e,R=new e;_.rayTriangleParametric=function(t,n,a,i,u){u=r(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,_=e.subtract(a,n,p),A=e.subtract(i,n,m),v=e.cross(d,A,T),S=e.dot(_,v);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,n,y),l=e.dot(s,v),l<0||l>S)return;if(c=e.cross(s,_,R),E=e.dot(d,c),E<0||l+E>S)return;f=e.dot(A,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(h,n,y),l=e.dot(s,v)*N,l<0||l>1)return;if(c=e.cross(s,_,R),E=e.dot(d,c)*N,E<0||l+E>1)return;f=e.dot(A,c)*N}return f},_.rayTriangle=function(t,r,a,i,o,u){var s=_.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;_.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=_.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};_.raySphere=function(e,t,r){if(r=f(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new l;_.lineSegmentSphere=function(t,r,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,I=new e;_.rayEllipsoid=function(t,r){var n,a,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),E=e.multiplyComponents(c,t.direction,I),f=e.magnitudeSquared(l),h=e.dot(l,E);if(f>1){if(h>=0)return;var d=h*h;if(n=f-1,a=e.magnitudeSquared(E),o=a*n,d<o)return;if(d>o){u=h*h-o,s=-h+Math.sqrt(u);var _=s/a,p=n/s;return _<p?new i(_,p):{start:p,stop:_}}var m=Math.sqrt(n/a);return new i(m,m)}return f<1?(n=f-1,a=e.magnitudeSquared(E),o=a*n,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(E),new i(0,-h/a)):void 0};var M=new e,O=new e,g=new e,C=new e,w=new e,P=new u,x=new u,L=new u,U=new u,b=new u,F=new u,D=new u,B=new e,z=new e,G=new t;_.grazingAltitudeLocation=function(t,r){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,M);if(e.dot(i,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(i,M),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,C),h=e.normalize(e.cross(f,E,O),O),_=e.normalize(e.cross(E,h,g),g),p=P;p[0]=E.x,p[1]=E.y,p[2]=E.z,p[3]=h.x,p[4]=h.y,p[5]=h.z,p[6]=_.x,p[7]=_.y,p[8]=_.z;var m=u.transpose(p,x),T=u.fromScale(r.radii,L),y=u.fromScale(r.oneOverRadii,U),R=b;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,v,S=u.multiply(u.multiply(m,y,F),R,F),N=u.multiply(u.multiply(S,T,D),p,D),I=u.multiplyByVector(S,a,w),V=d(N,e.negate(I,M),0,0,1),q=V.length;if(q>0){for(var X=e.clone(e.ZERO,z),H=Number.NEGATIVE_INFINITY,W=0;W<q;++W){A=u.multiplyByVector(T,u.multiplyByVector(p,V[W],B),B);var k=e.normalize(e.subtract(A,a,C),C),Y=e.dot(k,i);Y>H&&(H=Y,X=e.clone(A,X))}var Z=r.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),v=e.magnitude(e.subtract(X,a,C))*Math.sqrt(1-H*H),v=c?-v:v,Z.height=v,r.cartographicToCartesian(Z,new e)}};var V=new e;return _.lineSegmentPlane=function(t,r,a,i){n(i)||(i=new e);var u=e.subtract(r,t,V),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,i),e.add(t,i,i),i}},_.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return _.lineSegmentPlane(t,r,a,E),_.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return _.lineSegmentPlane(r,n,a,E),_.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return _.lineSegmentPlane(n,t,a,E),_.lineSegmentPlane(n,r,a,f),{positions:[t,r,n,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return _.lineSegmentPlane(r,t,a,E),_.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return _.lineSegmentPlane(n,r,a,E),_.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return _.lineSegmentPlane(t,n,a,E),_.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},_}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[n[f]]>i&&(c[n[f]]=E,++E);return(E-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<r.length;){var f=r[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],_=0;_<l;_++)d[_]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var p=0;E<h;)d[o[E]].vertexTriangles.push(p),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(p),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(p),++d[o[E+2]].numLiveTriangles,++p,E+=3;var m=0,T=s+1;i=1;var y,R,A=[],v=[],S=0,N=[],I=c/3,M=[];for(_=0;_<I;_++)M[_]=!1;for(var O,g;m!==-1;){A=[],R=d[m],g=R.vertexTriangles.length;for(var C=0;C<g;++C)if(p=R.vertexTriangles[C],!M[p]){M[p]=!0,E=p+p+p;for(var w=0;w<3;++w)O=o[E],A.push(O),v.push(O),N[S]=O,++S,y=d[O],--y.numLiveTriangles,T-y.timeStamp>s&&(y.timeStamp=T,++T),++E}m=a(o,s,A,d,T,v,l)}return N},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h,d,_,p,m,T,y,R,A,v,S,N){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function M(e){for(var t=e.length,r=t/3*6,n=p.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function g(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=p.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function C(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new d({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function w(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),A.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function x(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function L(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,E=1;E<n;++E){var f=e[E][t].attributes[r];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[r]=new d({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var n,i,o,u,s,l,E,f=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),_=e[0][t].primitiveType,m=L(e,t);for(n in m)if(m.hasOwnProperty(n))for(s=m[n].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[n].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var T;if(d){var y=0;for(i=0;i<f;++i)y+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:m,primitiveType:S.POINTS})),A=p.createTypedArray(R,y),v=0,N=0;for(i=0;i<f;++i){var I=e[i][t].indices,M=I.length;for(u=0;u<M;++u)A[v++]=N+I[u];N+=h.computeNumberOfVertices(e[i][t])}T=A}var O,g=new a,C=0;for(i=0;i<f;++i){if(O=e[i][t].boundingSphere,!c(O)){g=void 0;break}a.add(O.center,g,g)}if(c(g))for(a.divideByScalar(g,f,g),i=0;i<f;++i){O=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(O.center,g,se))+O.radius;w>C&&(C=w)}return new h({attributes:m,indices:T,primitiveType:_,boundingSphere:c(g)?new r(g,C):void 0})}function b(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function D(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function z(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function V(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return F(e);case S.TRIANGLE_STRIP:return D(e);case S.TRIANGLES:return b(e);case S.LINE_STRIP:return z(e);case S.LINE_LOOP:return G(e);case S.LINES:return B(e)}return e}function q(e,t){Math.abs(e.y)<y.EPSILON6&&(t?e.y=-y.EPSILON6:e.y=y.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return q(e,e.y<0),q(t,t.y<0),void q(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?y.sign(e.y):y.sign(r.y):i>o?y.sign(t.y):y.sign(r.y);var u=n<0;q(e,u),q(t,u),q(r,u)}function H(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Ae),e.y/(e.y-t.y),Ae),r),a.clone(r,n),q(r,!0),q(n,!1)}function W(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){X(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Me.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(H(e,t,ve,Ne),H(e,r,Se,Ie),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,r,ve,Ne),H(t,e,Se,Ie),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(r,e,ve,Ne),H(r,t,Se,Ie),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(H(r,e,ve,Ne),H(r,t,Se,Ie),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,r,ve,Ne),H(t,e,Se,Ie),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,ve,Ne),H(e,r,Se,Ie),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Me.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=ve,s[4]=Se,s[5]=Ne,s[6]=Ie,s.length=7),Me}}function k(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=p.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function Y(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function Z(e,t,r){var n=c(e.geometry.boundingSphere);t=k(t,n),r=k(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function K(e,r,i,o,u,s,l,E,f,h,d,_){if(c(s)||c(l)||c(E)||c(f)||c(h)){var p=a.fromArray(u,3*e,Oe),m=a.fromArray(u,3*r,ge),T=a.fromArray(u,3*i,Ce),y=t(o,p,m,T,we);if(c(s)){var R=a.fromArray(s,3*e,Oe),A=a.fromArray(s,3*r,ge),v=a.fromArray(s,3*i,Ce);a.multiplyByScalar(R,y.x,R),a.multiplyByScalar(A,y.y,A),a.multiplyByScalar(v,y.z,v);var S=a.add(R,A,R);a.add(S,v,S),a.normalize(S,S),a.pack(S,d.normal.values,3*_)}if(c(h)){var N=a.fromArray(h,3*e,Oe),I=a.fromArray(h,3*r,ge),M=a.fromArray(h,3*i,Ce);a.multiplyByScalar(N,y.x,N),a.multiplyByScalar(I,y.y,I),a.multiplyByScalar(M,y.z,M);var O;a.equals(N,a.ZERO)&&a.equals(I,a.ZERO)&&a.equals(M,a.ZERO)?(O=Oe,O.x=0,O.y=0,O.z=0):(O=a.add(N,I,N),a.add(O,M,O),a.normalize(O,O)),a.pack(O,d.extrudeDirection.values,3*_)}if(c(l)){var g=a.fromArray(l,3*e,Oe),C=a.fromArray(l,3*r,ge),w=a.fromArray(l,3*i,Ce);a.multiplyByScalar(g,y.x,g),a.multiplyByScalar(C,y.y,C),a.multiplyByScalar(w,y.z,w);var P=a.add(g,C,g);a.add(P,w,P),a.normalize(P,P),a.pack(P,d.tangent.values,3*_)}if(c(E)){var x=a.fromArray(E,3*e,Oe),L=a.fromArray(E,3*r,ge),U=a.fromArray(E,3*i,Ce);a.multiplyByScalar(x,y.x,x),a.multiplyByScalar(L,y.y,L),a.multiplyByScalar(U,y.z,U);var b=a.add(x,L,x);a.add(b,U,b),a.normalize(b,b),a.pack(b,d.bitangent.values,3*_)}if(c(f)){var F=n.fromArray(f,2*e,Pe),D=n.fromArray(f,2*r,xe),B=n.fromArray(f,2*i,Le);n.multiplyByScalar(F,y.x,F),n.multiplyByScalar(D,y.y,D),n.multiplyByScalar(B,y.z,B);var z=n.add(F,D,F);n.add(z,B,z),n.pack(z,d.st.values,2*_)}}}function j(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,_=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,p=u.indices,m=Y(u),T=Y(u),y=[];y.length=l.length/3;var R=[];for(R.length=l.length/3,o=0;o<y.length;++o)y[o]=-1,R[o]=-1;var A=p.length;for(o=0;o<A;o+=3){var v=p[o],S=p[o+1],N=p[o+2],I=a.fromArray(l,3*v),M=a.fromArray(l,3*S),O=a.fromArray(l,3*N),g=W(I,M,O);if(c(g)&&g.positions.length>3)for(var C=g.positions,w=g.indices,P=w.length,x=0;x<P;++x){var L=w[x],U=C[L];U.y<0?(t=T.attributes,r=T.indices,n=y):(t=m.attributes,r=m.indices,n=R),i=j(t,r,n,p,L<3?o+L:-1,U),K(v,S,N,U,l,E,h,f,d,_,t,i)}else c(g)&&(I=g.positions[0],M=g.positions[1],O=g.positions[2]),I.y<0?(t=T.attributes,r=T.indices,n=y):(t=m.attributes,r=m.indices,n=R),i=j(t,r,n,p,o,I),K(v,S,N,I,l,E,h,f,d,_,t,i),i=j(t,r,n,p,o+1,M),K(v,S,N,M,l,E,h,f,d,_,t,i),i=j(t,r,n,p,o+2,O),K(v,S,N,O,l,E,h,f,d,_,t,i)}Z(e,T,m)}function J(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=Y(r),s=Y(r),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],_=a.fromArray(i,3*h,Oe),p=a.fromArray(i,3*d,ge);Math.abs(_.y)<y.EPSILON6&&(_.y<0?_.y=-y.EPSILON6:_.y=y.EPSILON6),Math.abs(p.y)<y.EPSILON6&&(p.y<0?p.y=-y.EPSILON6:p.y=y.EPSILON6);var m=u.attributes,R=u.indices,A=f,v=s.attributes,S=s.indices,N=E,I=T.lineSegmentPlane(_,p,Ue,Ce);if(c(I)){var M=a.multiplyByScalar(a.UNIT_Y,5*y.EPSILON9,be);_.y<0&&(a.negate(M,M),m=s.attributes,R=s.indices,A=E,v=u.attributes,S=u.indices,N=f);var O=a.add(I,M,Fe);j(m,R,A,o,t,_),j(m,R,A,o,-1,O),a.negate(M,M),a.add(I,M,O),j(v,S,N,o,-1,O),j(v,S,N,o,t+1,p)}else{var g,C,w;_.y<0?(g=s.attributes,C=s.indices,w=E):(g=u.attributes,C=u.indices,w=f),j(g,C,w,o,t,_),j(g,C,w,o,t+1,p)}}Z(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,ze);if(!(s.x>0)){var c=a.unpack(n,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,Ve);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,_=c(s.color)?s.color.values:void 0,p=Y(u),m=Y(u),R=!1,A=l.length/3;for(t=0;t<A;t+=4){var v=t,S=t+2,N=a.fromArray(l,3*v,ze),I=a.fromArray(l,3*S,Ge);if(Math.abs(N.y)<Ye)for(N.y=Ye*(I.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,r=3*v;r<3*v+12;r+=3)E[r]=l[3*t],E[r+1]=l[3*t+1],E[r+2]=l[3*t+2];if(Math.abs(I.y)<Ye)for(I.y=Ye*(N.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*v;r<3*v+12;r+=3)f[r]=l[3*(t+2)],f[r+1]=l[3*(t+2)+1],f[r+2]=l[3*(t+2)+2];var M=p.attributes,O=p.indices,g=m.attributes,C=m.indices,w=T.lineSegmentPlane(N,I,Ue,qe);if(c(w)){R=!0;var P=a.multiplyByScalar(a.UNIT_Y,ke,Xe);N.y<0&&(a.negate(P,P),M=m.attributes,O=m.indices,g=p.attributes,C=p.indices);var x=a.add(w,P,He);M.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),M.position.values.push(x.x,x.y,x.z),M.position.values.push(x.x,x.y,x.z),M.prevPosition.values.push(E[3*v],E[3*v+1],E[3*v+2]),M.prevPosition.values.push(E[3*v+3],E[3*v+4],E[3*v+5]),M.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),a.negate(P,P),a.add(w,P,x),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.nextPosition.values.push(f[3*S],f[3*S+1],f[3*S+2]),g.nextPosition.values.push(f[3*S+3],f[3*S+4],f[3*S+5]);var L=n.fromArray(h,2*v,De),U=Math.abs(L.y);M.expandAndWidth.values.push(-1,U,1,U),M.expandAndWidth.values.push(-1,-U,1,-U),g.expandAndWidth.values.push(-1,U,1,U),g.expandAndWidth.values.push(-1,-U,1,-U);var b=a.magnitudeSquared(a.subtract(w,N,Ve));if(b/=a.magnitudeSquared(a.subtract(I,N,Ve)),c(_)){var F=i.fromArray(_,4*v,We),D=i.fromArray(_,4*S,We),B=y.lerp(F.x,D.x,b),z=y.lerp(F.y,D.y,b),G=y.lerp(F.z,D.z,b),V=y.lerp(F.w,D.w,b);for(r=4*v;r<4*v+8;++r)M.color.values.push(_[r]);for(M.color.values.push(B,z,G,V),M.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),r=4*S;r<4*S+8;++r)g.color.values.push(_[r])}if(c(d)){var q=n.fromArray(d,2*v,De),X=n.fromArray(d,2*(t+3),Be),H=y.lerp(q.x,X.x,b);for(r=2*v;r<2*v+4;++r)M.st.values.push(d[r]);for(M.st.values.push(H,q.y),M.st.values.push(H,X.y),g.st.values.push(H,q.y),g.st.values.push(H,X.y),r=2*S;r<2*S+4;++r)g.st.values.push(d[r])}o=M.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=g.position.values.length/3-4,C.push(o,o+2,o+1),C.push(o+1,o+2,o+3)}else{var W,k;for(N.y<0?(W=m.attributes,k=m.indices):(W=p.attributes,k=p.indices),W.position.values.push(N.x,N.y,N.z),W.position.values.push(N.x,N.y,N.z),W.position.values.push(I.x,I.y,I.z),W.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)W.prevPosition.values.push(E[r]),W.nextPosition.values.push(f[r]);for(r=2*t;r<2*t+8;++r)W.expandAndWidth.values.push(h[r]),c(d)&&W.st.values.push(d[r]);if(c(_))for(r=4*t;r<4*t+16;++r)W.color.values.push(_[r]);o=W.position.values.length/3-4,k.push(o,o+2,o+1),k.push(o+1,o+2,o+3)}}R&&($(m),$(p)),Z(e,m,p)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=M(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=g(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*n,l[E++]=a[f+1]+i[f+1]*n,l[E++]=a[f+2]+i[f+2]*n;var _,p=e.boundingSphere;return c(p)&&(_=new r(p.center,p.radius+n)),new h({attributes:{position:new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:_})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=p.createTypedArray(t,s),E=0,f=0,d=0;E<s;)i=n[o[E]],i!==-1?l[f]=i:(i=o[E],n[i]=d,l[f]=d,++d),++E,++f;e.indices=l;var _=e.attributes;for(var m in _)if(_.hasOwnProperty(m)&&c(_[m])&&c(_[m].values)){for(var T=_[m],y=T.values,R=0,A=T.componentsPerAttribute,v=u.createTypedArray(T.componentDatatype,d*A);R<t;){var S=n[R];if(S!==-1)for(a=0;a<A;a++)v[A*S+a]=y[A*R+a];++R}T.values=v}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=N.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=y.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=C(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var E=0;E<l;E+=n){for(var f=0;f<n;++f){var d=s[E+f],_=a[d];c(_)||(_=o++,a[d]=_,w(u,e.attributes,d)),i.push(_)}o+n>=y.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=C(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new f;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),h=0,_=0;_<l.length;_+=3){var p=a.fromArray(l,_,re),m=s.cartesianToCartographic(p,ne),T=i.project(m,re);E[h++]=T.x,E[h++]=T.y,E[h++]=T.z}return e.attributes[r]=o,e.attributes[n]=new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)E.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var f=a.componentsPerAttribute;return e.attributes[r]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[n]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var ie=new a,oe=new A,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(A.inverse(t,oe),A.transpose(oe,oe),A.getRotation(oe,ue),x(ue,n.normal),x(ue,n.tangent),x(ue,n.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),r.length>0&&(o.push(U(r,"westHemisphereGeometry")),o.push(U(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,Ee=new a,fe=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],_=t[E+1],p=t[E+2],m=3*h,T=3*_,R=3*p;le.x=n[m],le.y=n[m+1],le.z=n[m+2],Ee.x=n[T],Ee.y=n[T+1],Ee.z=n[T+2],fe.x=n[R],fe.y=n[R+1],fe.z=n[R+2],s[h].count++,s[_].count++,s[p].count++,a.subtract(Ee,le,Ee),a.subtract(fe,le,fe),c[f]=a.cross(Ee,fe,new a),f++}var A=0;for(E=0;E<i;E++)s[E].indexOffset+=A,A+=s[E].count;f=0;var v;for(E=0;E<o;E+=3){v=s[t[E]];var S=v.indexOffset+v.currentCount;l[S]=f,v.currentCount++,v=s[t[E+1]],S=v.indexOffset+v.currentCount,l[S]=f,v.currentCount++,v=s[t[E+2]],S=v.indexOffset+v.currentCount,l[S]=f,v.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var I=3*E;if(v=s[E],a.clone(a.ZERO,ce),v.count>0){for(f=0;f<v.count;f++)a.add(ce,c[l[v.indexOffset+f]],ce);a.equalsEpsilon(a.ZERO,ce,y.EPSILON10)&&a.clone(c[l[v.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,y.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),N[I]=ce.x,N[I+1]=ce.y,N[I+2]=ce.z}return e.attributes.normal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,de=new a,_e=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var _=t[l],p=t[l+1],m=t[l+2];E=3*_,f=3*p,h=3*m;var T=2*_,y=2*p,R=2*m,A=r[E],v=r[E+1],S=r[E+2],N=i[T],I=i[T+1],M=i[y+1]-I,O=i[R+1]-I,g=1/((i[y]-N)*O-(i[R]-N)*M),C=(O*(r[f]-A)-M*(r[h]-A))*g,w=(O*(r[f+1]-v)-M*(r[h+1]-v))*g,P=(O*(r[f+2]-S)-M*(r[h+2]-S))*g;c[E]+=C,c[E+1]+=w,c[E+2]+=P,c[f]+=C,c[f+1]+=w,c[f+2]+=P,c[h]+=C,c[h+1]+=w,c[h+2]+=P}var x=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var U=a.fromArray(n,E,he),b=a.fromArray(c,E,_e),F=a.dot(U,b);a.multiplyByScalar(U,F,de),a.normalize(a.subtract(b,de,b),b),x[E]=b.x,x[f]=b.y,x[h]=b.z,a.normalize(a.cross(U,b,b),b),L[E]=b.x,L[f]=b.y,L[h]=b.z}return e.attributes.tangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:x}),e.attributes.bitangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e};var pe=new n,me=new a,Te=new a,ye=new a,Re=new n;te.compressVertices=function(t){var r,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),E=0;for(r=0;r<i;++r)a.fromArray(s,3*r,me),a.equals(me,a.ZERO)?E+=2:(Re=e.octEncodeInRange(me,65535,Re),l[E++]=Re.x,l[E++]=Re.y);return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var f=t.attributes.normal,h=t.attributes.st,_=c(f),p=c(h);if(!_&&!p)return t;var m,T,y,R,A=t.attributes.tangent,v=t.attributes.bitangent,S=c(A),N=c(v);_&&(m=f.values),p&&(T=h.values),S&&(y=A.values),N&&(R=v.values);var I=_?m.length:T.length,M=_?3:2;i=I/M;var O=i,g=p&&_?2:1;g+=S||N?1:0,O*=g;var C=new Float32Array(O),w=0;for(r=0;r<i;++r){p&&(n.fromArray(T,2*r,pe),C[w++]=e.compressTextureCoordinates(pe));var P=3*r;_&&c(y)&&c(R)?(a.fromArray(m,P,me),a.fromArray(y,P,Te),a.fromArray(R,P,ye),e.octPack(me,Te,ye,pe),C[w++]=pe.x,C[w++]=pe.y):(_&&(a.fromArray(m,P,me),C[w++]=e.octEncodeFloat(me)),S&&(a.fromArray(y,P,me),C[w++]=e.octEncodeFloat(me)),N&&(a.fromArray(R,P,me),C[w++]=e.octEncodeFloat(me)))}return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:g,values:C}),_&&delete t.attributes.normal,p&&delete t.attributes.st,N&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Ae=new a,ve=new a,Se=new a,Ne=new a,Ie=new a,Me={positions:new Array(7),indices:new Array(9)},Oe=new a,ge=new a,Ce=new a,we=new a,Pe=new n,xe=new n,Le=new n,Ue=v.fromPointNormal(a.ZERO,a.UNIT_Y),be=new a,Fe=new a,De=new n,Be=new n,ze=new a,Ge=new a,Ve=new a,qe=new a,Xe=new a,He=new a,We=new i,ke=5*y.EPSILON9,Ye=y.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,v.ORIGIN_ZX_PLANE)!==m.INTERSECTING)return e}if(t.geometryType!==_.NONE)switch(t.geometryType){case _.POLYLINES:ee(e);break;case _.TRIANGLES:Q(e);break;case _.LINES:J(e)}else V(t),t.primitiveType===S.TRIANGLES?Q(e):t.primitiveType===S.LINES&&J(e);return e},te}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},s.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h){ +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var E=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,E=n*u-a*o;return r.x=c,r.y=l,r.z=E,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(n),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),r(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,E=r.y,f=r.z,h=a.x,d=a.y,_=a.z,p=l*l*h*h,m=E*E*d*d,T=f*f*_*_,y=p+m+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(r,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,S=u.y,N=u.z,I=o;I.x=A.x*v*2,I.y=A.y*S*2,I.z=A.z*N*2;var M,O,g,C,w,P,x,L,U,b,F,D=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),B=0;do{D-=B,g=1/(1+D*v),C=1/(1+D*S),w=1/(1+D*N),P=g*g,x=C*C,L=w*w,U=P*g,b=x*C,F=L*w,M=p*P+m*x+T*L-1,O=p*U*v+m*b*S+T*F*N;var z=-2*O;B=M/z}while(Math.abs(M)>n.EPSILON12);return t(c)?(c.x=l*g,c.y=E*C,c.z=f*w,c):new e(l*g,E*C,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,t,n){this.longitude=r(e,0),this.latitude=r(t,0),this.height=r(n,0)}u.fromRadians=function(e,t,a,i){return a=r(a,0),n(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var d=n(r)?r.oneOverRadii:E,_=n(r)?r.oneOverRadiiSquared:f,p=n(r)?r._centerToleranceSquared:h,m=o(t,d,_,p,c);if(n(m)){var T=e.multiplyComponents(m,_,s);T=e.normalize(T,T);var y=e.subtract(t,m,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),v=i.sign(e.dot(y,t))*e.magnitude(y);return n(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,r){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._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,r){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,_=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,_),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(_[r],d[r])];t+=2*n*n}return Math.sqrt(t)}function E(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(_[i],d[i])]);o>n&&(a=i,n=o)}var c=1,l=0,E=d[a],f=_[a];if(Math.abs(e[s.getElementIndex(f,E)])>r){var h,p=e[s.getElementIndex(f,f)],m=e[s.getElementIndex(E,E)],T=e[s.getElementIndex(f,E)],y=(p-m)/2/T;h=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(E,E)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,E)]=l,t[s.getElementIndex(E,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=r-u-E+h,_=2*(a-f),p=2*(i+l),m=2*(a+f),T=-r+u-E+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),v=-r-u+E+h;return n(t)?(t[0]=d,t[1]=m,t[2]=R,t[3]=_,t[4]=T,t[5]=A,t[6]=p,t[7]=y,t[8]=v,t):new s(d,_,p,m,T,y,R,A,v)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,E=-i*u+c*o*a,f=c*u+i*o*a,h=r*u,d=i*a+c*o*u,_=-c*a+i*o*u,p=-o,m=c*r,T=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=E,t[4]=d,t[5]=m,t[6]=f,t[7]=_,t[8]=T,t):new s(l,E,f,h,d,_,p,m,T)},s.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var f=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),r};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=E,r},s.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},s.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},s.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],_=[2,2,1],p=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,i=0,o=0;n(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),d=r*c(h);o<a&&l(h)>d;)E(h,p),s.transpose(p,m),s.multiply(h,p,h),s.multiply(m,h,h),s.multiply(f,p,f),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],E=e[8],f=s.determinant(e);t[0]=o*E-l*u,t[1]=l*a-n*E,t[2]=n*u-o*a,t[3]=c*u-i*E,t[4]=r*E-c*a,t[5]=i*a-r*u,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/f;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){ +"use strict";function l(e,t,r,a,i,o,u,s,c,l,E,f,h,d,_,p){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(d,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(E,0),this[11]=n(_,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(p,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new l),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,r,i){return r=n(r,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,i):new l(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,E=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,_=t.y*t.w,p=t.z*t.z,m=t.z*t.w,T=t.w*t.w,y=s-h-p+T,R=2*(c-m),A=2*(E+_),v=2*(c+m),S=-s+h-p+T,N=2*(d-f),I=2*(E-_),M=2*(d+f),O=-s-h+p+T;return n[0]=y*i,n[1]=v*i,n[2]=I*i,n[3]=0,n[4]=R*o,n[5]=S*o,n[6]=M*o,n[7]=0,n[8]=A*u,n[9]=N*u,n[10]=O*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var E=new e,f=new e,h=new e;l.fromCamera=function(t,r){var n=t.position,i=t.direction,o=t.up;e.normalize(i,E),e.normalize(e.cross(E,o,f),f),e.normalize(e.cross(f,E,h),h);var u=f.x,s=f.y,c=f.z,d=E.x,_=E.y,p=E.z,m=h.x,T=h.y,y=h.z,R=n.x,A=n.y,v=n.z,S=u*-R+s*-A+c*-v,N=m*-R+T*-A+y*-v,I=d*R+_*A+p*v;return a(r)?(r[0]=u,r[1]=m,r[2]=-d,r[3]=0,r[4]=s,r[5]=T,r[6]=-_,r[7]=0,r[8]=c,r[9]=y,r[10]=-p,r[11]=0,r[12]=S,r[13]=N,r[14]=I,r[15]=1,r):new l(u,s,c,S,m,T,y,N,-d,-_,-p,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,E=-(n+r)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,E=.5*(r-t),f=c,h=l,d=E,_=i+c,p=o+l,m=t+E,T=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=_,a[13]=p,a[14]=m,a[15]=T,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var d=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),r};var _=new e;l.getMaximumScale=function(t){return l.getScale(t,_),e.maximumComponent(_)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],_=e[12],p=e[13],m=e[14],T=e[15],y=t[0],R=t[1],A=t[2],v=t[3],S=t[4],N=t[5],I=t[6],M=t[7],O=t[8],g=t[9],C=t[10],w=t[11],P=t[12],x=t[13],L=t[14],U=t[15],b=n*y+u*R+E*A+_*v,F=a*y+s*R+f*A+p*v,D=i*y+c*R+h*A+m*v,B=o*y+l*R+d*A+T*v,z=n*S+u*N+E*I+_*M,G=a*S+s*N+f*I+p*M,V=i*S+c*N+h*I+m*M,q=o*S+l*N+d*I+T*M,X=n*O+u*g+E*C+_*w,H=a*O+s*g+f*C+p*w,W=i*O+c*g+h*C+m*w,k=o*O+l*g+d*C+T*w,Y=n*P+u*x+E*L+_*U,Z=a*P+s*x+f*L+p*U,K=i*P+c*x+h*L+m*U,j=o*P+l*x+d*L+T*U;return r[0]=b,r[1]=F,r[2]=D,r[3]=B,r[4]=z,r[5]=G,r[6]=V,r[7]=q,r[8]=X,r[9]=H,r[10]=W,r[11]=k,r[12]=Y,r[13]=Z,r[14]=K,r[15]=j,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],_=t[0],p=t[1],m=t[2],T=t[4],y=t[5],R=t[6],A=t[8],v=t[9],S=t[10],N=t[12],I=t[13],M=t[14],O=n*_+o*p+c*m,g=a*_+u*p+l*m,C=i*_+s*p+E*m,w=n*T+o*y+c*R,P=a*T+u*y+l*R,x=i*T+s*y+E*R,L=n*A+o*v+c*S,U=a*A+u*v+l*S,b=i*A+s*v+E*S,F=n*N+o*I+c*M+f,D=a*N+u*I+l*M+h,B=i*N+s*I+E*M+d;return r[0]=O,r[1]=g,r[2]=C,r[3]=0,r[4]=w,r[5]=P,r[6]=x,r[7]=0,r[8]=L,r[9]=U,r[10]=b,r[11]=0,r[12]=F,r[13]=D,r[14]=B,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],_=t[3],p=t[4],m=t[5],T=t[6],y=t[7],R=t[8],A=n*f+o*h+c*d,v=a*f+u*h+l*d,S=i*f+s*h+E*d,N=n*_+o*p+c*m,I=a*_+u*p+l*m,M=i*_+s*p+E*m,O=n*T+o*y+c*R,g=a*T+u*y+l*R,C=i*T+s*y+E*R;return r[0]=A,r[1]=v,r[2]=S,r[3]=0,r[4]=N,r[5]=I,r[6]=M,r[7]=0,r[8]=O,r[9]=g,r[10]=C,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var p=new e;l.multiplyByUniformScale=function(e,t,r){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var m=new s,T=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,m),T,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],E=e[1],f=e[5],h=e[9],d=e[13],_=e[2],p=e[6],A=e[10],v=e[14],S=e[3],N=e[7],I=e[11],M=e[15],O=A*M,g=v*I,C=p*M,w=v*N,P=p*I,x=A*N,L=_*M,U=v*S,b=_*I,F=A*S,D=_*N,B=p*S,z=O*f+w*h+P*d-(g*f+C*h+x*d),G=g*E+L*h+F*d-(O*E+U*h+b*d),V=C*E+U*f+D*d-(w*E+L*f+B*d),q=x*E+b*f+B*h-(P*E+F*f+D*h),X=g*a+C*i+x*o-(O*a+w*i+P*o),H=O*n+U*i+b*o-(g*n+L*i+F*o),W=w*n+L*a+B*o-(C*n+U*a+D*o),k=P*n+F*a+D*i-(x*n+b*a+B*i);O=i*d,g=o*h,C=a*d,w=o*f,P=a*h,x=i*f,L=n*d,U=o*E,b=n*h,F=i*E,D=n*f,B=a*E;var Y=O*N+w*I+P*M-(g*N+C*I+x*M),Z=g*S+L*I+F*M-(O*S+U*I+b*M),K=C*S+U*N+D*M-(w*S+L*N+B*M),j=x*S+b*N+B*I-(P*S+F*N+D*I),Q=C*A+x*v+g*p-(P*v+O*p+w*A),J=b*v+O*_+U*A-(L*A+F*v+g*_),$=L*p+B*v+w*_-(D*v+C*_+U*p),ee=D*A+P*_+F*p-(b*p+B*A+x*_),te=n*z+a*G+i*V+o*q;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=z*te,r[1]=G*te,r[2]=V*te,r[3]=q*te,r[4]=X*te,r[5]=H*te,r[6]=W*te,r[7]=k*te,r[8]=Y*te,r[9]=Z*te,r[10]=K*te,r[11]=j*te,r[12]=Q*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-r*E-n*f-a*h,_=-i*E-o*f-u*h,p=-s*E-c*f-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=_,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(r(e,0)),t=u.toRadians(r(t,0)),a=u.toRadians(r(a,0)),i=u.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var _=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,_),c=Math.max(c,_)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=E,r):new s(a,l,i,E)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),E=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return n(r)?(r.west=l,r.south=f,r.east=E,r.north=h,r):new s(l,f,E,h)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),E=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=E,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0),n(o)||(o=[]);var l=0,E=e.north,f=e.south,h=e.east,d=e.west,_=c;_.height=a,_.longitude=d,_.latitude=E,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=h,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.latitude=f,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++,E<0?_.latitude=E:f>0?_.latitude=f:_.latitude=0;for(var p=1;p<8;++p)_.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=t.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=h,o[l]=t.cartographicToCartesian(_,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,E){"use strict";function f(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,d=new e,_=new e,p=new e,m=new e,T=new e,y=new e,R=new e,A=new e,v=new e,S=new e,N=new e;f.fromPoints=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],y),i=e.clone(n,h),o=e.clone(n,d),u=e.clone(n,_),s=e.clone(n,p),c=e.clone(n,m),l=e.clone(n,T),E=t.length,I=1;I<E;I++){e.clone(t[I],n);var M=n.x,O=n.y,g=n.z;M<i.x&&e.clone(n,i),M>s.x&&e.clone(n,s),O<o.y&&e.clone(n,o),O>c.y&&e.clone(n,c),g<u.z&&e.clone(n,u),g>l.z&&e.clone(n,l)}var C=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=i,L=s,U=C;w>U&&(U=w,x=o,L=c),P>U&&(U=P,x=u,L=l);var b=A;b.x=.5*(x.x+L.x),b.y=.5*(x.y+L.y),b.z=.5*(x.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,R)),D=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,R),.5,N),V=0;for(I=0;I<E;I++){e.clone(t[I],n);var q=e.magnitude(e.subtract(n,G,R));q>V&&(V=q);var X=e.magnitudeSquared(e.subtract(n,b,R));if(X>F){var H=Math.sqrt(X);D=.5*(D+H),F=D*D;var W=H-D;b.x=(D*b.x+W*n.x)/H,b.y=(D*b.y+W*n.y)/H,b.z=(D*b.z+W*n.z)/H}}return D<V?(e.clone(b,r.center),r.radius=D):(e.clone(G,r.center),r.radius=V),r};var I=new o,M=new e,O=new e,g=new t,C=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,I),E.southwest(t,g),g.height=i,E.northeast(t,C),C.height=o;var s=r.project(g,M),c=r.project(C,O),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*h,_.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,r,o){t=n(t,i.WGS84),r=n(r,0);var u;return a(e)&&(u=E.subsample(e,t,r,w)),f.fromPoints(u,o)},f.fromVertices=function(t,r,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),i=n(i,3);var u=y;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,_),E=e.clone(u,p),I=e.clone(u,m),M=e.clone(u,T),O=t.length,g=0;g<O;g+=i){var C=t[g]+r.x,w=t[g+1]+r.y,P=t[g+2]+r.z;u.x=C,u.y=w,u.z=P,C<s.x&&e.clone(u,s),C>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),P<l.z&&e.clone(u,l),P>M.z&&e.clone(u,M)}var x=e.magnitudeSquared(e.subtract(E,s,R)),L=e.magnitudeSquared(e.subtract(I,c,R)),U=e.magnitudeSquared(e.subtract(M,l,R)),b=s,F=E,D=x;L>D&&(D=L,b=c,F=I),U>D&&(D=U,b=l,F=M);var B=A;B.x=.5*(b.x+F.x),B.y=.5*(b.y+F.y),B.z=.5*(b.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(z),V=v;V.x=s.x,V.y=c.y,V.z=l.z;var q=S;q.x=E.x,q.y=I.y,q.z=M.z;var X=e.multiplyByScalar(e.add(V,q,R),.5,N),H=0;for(g=0;g<O;g+=i){u.x=t[g]+r.x,u.y=t[g+1]+r.y,u.z=t[g+2]+r.z;var W=e.magnitude(e.subtract(u,X,R));W>H&&(H=W);var k=e.magnitudeSquared(e.subtract(u,B,R));if(k>z){var Y=Math.sqrt(k);G=.5*(G+Y),z=G*G;var Z=Y-G;B.x=(G*B.x+Z*u.x)/Y,B.y=(G*B.y+Z*u.y)/Y,B.z=(G*B.z+Z*u.z)/Y}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},f.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new f),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=y;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,_),c=e.clone(i,p),l=e.clone(i,m),E=e.clone(i,T),I=t.length,M=0;M<I;M+=3){var O=t[M]+r[M],g=t[M+1]+r[M+1],C=t[M+2]+r[M+2];i.x=O,i.y=g,i.z=C,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),C<s.z&&e.clone(i,s),C>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=e.magnitudeSquared(e.subtract(E,s,R)),L=o,U=c,b=w;P>b&&(b=P,L=u,U=l),x>b&&(b=x,L=s,U=E);var F=A;F.x=.5*(L.x+U.x),F.y=.5*(L.y+U.y),F.z=.5*(L.z+U.z);var D=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(D),z=v;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=E.z;var V=e.multiplyByScalar(e.add(z,G,R),.5,N),q=0;for(M=0;M<I;M+=3){i.x=t[M]+r[M],i.y=t[M+1]+r[M+1],i.z=t[M+2]+r[M+2];var X=e.magnitude(e.subtract(i,V,R));X>q&&(q=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>D){var W=Math.sqrt(H);B=.5*(B+W),D=B*B;var k=W-B;F.x=(B*F.x+k*i.x)/W,F.y=(B*F.y+k*i.y)/W,F.z=(B*F.z+k*i.z)/W}}return B<q?(e.clone(F,n.center),n.radius=B):(e.clone(V,n.center),n.radius=q),n},f.fromCornerPoints=function(t,r,n){a(n)||(n=new f);var i=n.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),n.radius=e.distance(i,r),n},f.fromEllipsoid=function(t,r){return a(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var P=new e;f.fromBoundingSpheres=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return f.clone(t[0],r);if(2===n)return f.union(t[0],t[1],r);for(var i=[],o=0;o<n;o++)i.push(t[o].center);r=f.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var x=new e,L=new e,U=new e;f.fromOrientedBoundingBox=function(t,r){a(r)||(r=new f);var n=t.halfAxes,i=c.getColumn(n,0,x),o=c.getColumn(n,1,L),u=c.getColumn(n,2,U);return e.add(i,o,i),e.add(i,u,i),r.center=e.clone(t.center,r.center),r.radius=e.magnitude(i),r},f.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},f.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new f);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var b=new e,F=new e;f.union=function(t,r,n){a(n)||(n=new f);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,b),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,n.center),n.radius=E,n};var D=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,D));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var B=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,B);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;f.computePlaneDistances=function(t,r,n,i){a(i)||(i=new s);var o=e.subtract(t.center,r,z),u=e.dot(n,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,V=new e,q=new e,X=new e,H=new e,W=new t,k=new Array(8),Y=0;Y<8;++Y)k[Y]=new e;var Z=new o;return f.projectTo2D=function(t,r,a){r=n(r,Z);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,V);e.normalize(c,c);var l=e.cross(s,c,q);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,H),h=e.negate(c,X),d=k,_=d[0];e.add(s,l,_),e.add(_,c,_),_=d[1],e.add(s,l,_),e.add(_,h,_),_=d[2],e.add(s,E,_),e.add(_,h,_),_=d[3],e.add(s,E,_),e.add(_,c,_),e.negate(s,s),_=d[4],e.add(s,l,_),e.add(_,c,_),_=d[5],e.add(s,l,_),e.add(_,h,_),_=d[6],e.add(s,E,_),e.add(_,h,_),_=d[7],e.add(s,E,_),e.add(_,c,_);for(var p=d.length,m=0;m<p;++m){var T=d[m];e.add(o,T,T);var y=i.cartesianToCartographic(T,W);r.project(y,T)}a=f.fromPoints(d,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,r){return f.computePlaneDistances(this,e,t,r)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=n(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(S)&&(S=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=n(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,M=n(e[1]),M.isNightly=!!e[2])}return I}function c(){return s()&&M}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1])))}return O}function E(){return l()&&g}function f(){if(!t(C)){C=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,w=n(e[1]))}return C}function h(){return f()&&w}function d(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(P=!0,x=n(e[1])); +}return P}function _(){return t(L)||(L=/Windows/i.test(R.appVersion)),L}function p(){return d()&&x}function m(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function T(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(b=r)}return F}function y(){return T()?b:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,S,N,I,M,O,g,C,w,P,x,L,U,b,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:p,isWindows:_,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:T,imageRenderingValue:y};return D.supportsFullscreen=function(){return r.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var a=0;a<n;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var E=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,r,n,a,i){"use strict";var o={};o.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,a=r.y;r.x=(1-Math.abs(a))*i.signNotZero(n),r.y=(1-Math.abs(n))*i.signNotZero(a)}return r.x=i.toSNorm(r.x,t),r.y=i.toSNorm(r.y,t),r},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,r,n,a){if(a.x=i.fromSNorm(e,n),a.y=i.fromSNorm(r,n),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},o.octDecode=function(e,t,r){return o.octDecodeInRange(e,t,255,r)},o.octPackFloat=function(e){return 256*e.x+e.y};var u=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,u),o.octPackFloat(u)},o.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return o.octDecode(n,a,t)},o.octPack=function(e,t,r,n){var a=o.octEncodeFloat(e),i=o.octEncodeFloat(t),s=o.octEncode(r,u);return n.x=65536*s.x+a,n.y=65536*s.y+i,n},o.octUnpack=function(e,t,r,n){var a=e.x/65536,i=Math.floor(a),u=65536*(a-i);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);o.octDecodeFloat(u,t),o.octDecodeFloat(c,r),o.octDecode(i,s,n)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},o.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},o}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined"],function(e,t,r,n){"use strict";function a(r,a,s,c,l){n(l)||(l=new t);var E,f,h,d,_,p,m,T;n(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(r,a,u),d=t.dot(E,E),_=t.dot(E,f),p=t.dot(E,h),m=t.dot(f,f),T=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(r,a,u),d=e.dot(E,E),_=e.dot(E,f),p=e.dot(E,h),m=e.dot(f,f),T=e.dot(f,h));var y=1/(d*m-_*_);return l.y=(m*p-_*T)*y,l.z=(d*T-_*p)*y,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,E=r(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(E),t.EPSILON14);return n>0?[f/e,a/f]:[a/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,_=o*c-u*s,p=u*c-h,m=4*d*p-_*_;if(m<0){var T,y,R;f*E>=l*h?(T=o,y=d,R=-2*u*d+o*_):(T=c,y=p,R=-c*_+2*s*p);var A=R<0?-1:1,v=-A*Math.abs(T)*Math.sqrt(-m);i=-R+v;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),I=i===v?-N:-y/N;return a=y<=0?N+I:-R/(N*N+I*I+y),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var M=d,O=-2*u*d+o*_,g=p,C=-c*_+2*s*p,w=Math.sqrt(m),P=Math.sqrt(3)/2,x=Math.abs(Math.atan2(o*w,-O)/3);a=2*Math.sqrt(-M);var L=Math.cos(x);i=a*L;var U=a*(-L/2-P*Math.sin(x)),b=i+U>2*u?i-u:U-u,F=o,D=b/F;x=Math.abs(Math.atan2(c*w,-C)/3),a=2*Math.sqrt(-g),L=Math.cos(x),i=a*L,U=a*(-L/2-P*Math.sin(x));var B=-c,z=i+U<2*s?i+s:U+s,G=B/z,V=F*z,q=-b*z-F*B,X=b*B,H=(s*q-u*X)/(-u*q+s*V);return D<=H?D<=G?H<=G?[D,H,G]:[D,G,H]:[G,D,H]:D<=G?[H,D,G]:H<=G?[H,G,D]:[G,H,D]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var _,p=d[0],m=d[1];if(p>=0&&m>=0){var T=Math.sqrt(p),y=Math.sqrt(m);return[f-y,f-T,f+T,f+y]}if(p>=0&&m<0)return _=Math.sqrt(p),[f-_,f+_];if(p<0&&m>=0)return _=Math.sqrt(m),[f-_,f+_]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,S=n.computeRealRoots(1,R,A),N=n.computeRealRoots(1,-R,v);return 0!==S.length?(S[0]+=f,S[1]+=f,0!==N.length?(N[0]+=f,N[1]+=f,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=f,N[1]+=f,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,_,p=h[0],m=a-p,T=m*m,y=t/2,R=m/2,A=T-4*o,v=T+4*Math.abs(o),S=c-4*p,N=c+4*Math.abs(p);if(p<0||A*N<S*v){var I=Math.sqrt(S);d=I/2,_=0===I?0:(t*R-i)/I}else{var M=Math.sqrt(A);d=0===M?0:(t*R-i)/M,_=M/2}var O,g;0===y&&0===d?(O=0,g=0):r.sign(y)===r.sign(d)?(O=y+d,g=p/O):(g=y-d,O=p/g);var C,w;0===R&&0===_?(C=0,w=0):r.sign(R)===r.sign(_)?(C=R+_,w=o/C):(w=R-_,C=o/w);var P=n.computeRealRoots(1,O,C),x=n.computeRealRoots(1,g,w);if(0!==P.length)return 0!==x.length?P[1]<=x[0]?[P[0],P[1],x[0],x[1]]:x[1]<=P[0]?[x[0],x[1],P[0],P[1]]:P[0]>=x[0]&&P[1]<=x[1]?[x[0],P[0],P[1],x[1]]:x[0]>=P[0]&&x[1]<=P[1]?[P[0],x[0],x[1],P[1]]:P[0]>x[0]&&P[0]<x[1]?[x[0],P[0],x[1],P[1]]:[P[0],x[0],P[1],x[1]]:P;if(0!==x.length)return x}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,E=n*n,f=E*n,h=a*a,d=h*a,_=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*o*d+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*E+144*i*r*E)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return _},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n}return a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";function E(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function f(t,r,a){n(a)||(a=new i);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,T),f=e.dot(u,u),h=2*e.dot(u,l),d=e.magnitudeSquared(l)-c,_=E(f,h,d,v);if(n(_))return a.start=_.root0,a.stop=_.root1,a}function h(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function d(t,r,n,a,i){var l,E=a*a,f=i*i,d=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,_=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),p=t[u.COLUMN0ROW0]*E+t[u.COLUMN2ROW2]*f+a*r.x+n,m=f*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),T=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),y=[];if(0===T&&0===m){if(l=s.computeRealRoots(d,_,p),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)),2===l.length){var v=l[1],S=Math.sqrt(Math.max(1-v*v,0)); +y.push(new e(a,i*v,i*-S)),y.push(new e(a,i*v,i*S))}return y}var N=T*T,I=m*m,M=d*d,O=T*m,g=M+I,C=2*(_*d+O),w=2*p*d+_*_-I+N,P=2*(p*_-O),x=p*p-N;if(0===g&&0===C&&0===w&&0===P)return y;l=c.computeRealRoots(g,C,w,P,x);var L=l.length;if(0===L)return y;for(var U=0;U<L;++U){var b,F=l[U],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B);b=o.sign(d)===o.sign(p)?h(d*D+p,_*F,o.EPSILON12):o.sign(p)===o.sign(_*F)?h(d*D,_*F+p,o.EPSILON12):h(d*D+_*F,p,o.EPSILON12);var G=h(m*F,T,o.EPSILON15),V=b*G;V<0?y.push(new e(a,i*F,i*z)):V>0?y.push(new e(a,i*F,i*-z)):0!==z?(y.push(new e(a,i*F,i*-z)),y.push(new e(a,i*F,i*z)),++U):y.push(new e(a,i*F,i*z))}return y}var _={};_.rayPlane=function(t,r,a){n(a)||(a=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,m=new e,T=new e,y=new e,R=new e;_.rayTriangleParametric=function(t,n,a,i,u){u=r(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,_=e.subtract(a,n,p),A=e.subtract(i,n,m),v=e.cross(d,A,T),S=e.dot(_,v);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,n,y),l=e.dot(s,v),l<0||l>S)return;if(c=e.cross(s,_,R),E=e.dot(d,c),E<0||l+E>S)return;f=e.dot(A,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(h,n,y),l=e.dot(s,v)*N,l<0||l>1)return;if(c=e.cross(s,_,R),E=e.dot(d,c)*N,E<0||l+E>1)return;f=e.dot(A,c)*N}return f},_.rayTriangle=function(t,r,a,i,o,u){var s=_.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;_.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=_.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};_.raySphere=function(e,t,r){if(r=f(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new l;_.lineSegmentSphere=function(t,r,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,I=new e;_.rayEllipsoid=function(t,r){var n,a,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),E=e.multiplyComponents(c,t.direction,I),f=e.magnitudeSquared(l),h=e.dot(l,E);if(f>1){if(h>=0)return;var d=h*h;if(n=f-1,a=e.magnitudeSquared(E),o=a*n,d<o)return;if(d>o){u=h*h-o,s=-h+Math.sqrt(u);var _=s/a,p=n/s;return _<p?new i(_,p):{start:p,stop:_}}var m=Math.sqrt(n/a);return new i(m,m)}return f<1?(n=f-1,a=e.magnitudeSquared(E),o=a*n,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(E),new i(0,-h/a)):void 0};var M=new e,O=new e,g=new e,C=new e,w=new e,P=new u,x=new u,L=new u,U=new u,b=new u,F=new u,D=new u,B=new e,z=new e,G=new t;_.grazingAltitudeLocation=function(t,r){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,M);if(e.dot(i,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(i,M),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,C),h=e.normalize(e.cross(f,E,O),O),_=e.normalize(e.cross(E,h,g),g),p=P;p[0]=E.x,p[1]=E.y,p[2]=E.z,p[3]=h.x,p[4]=h.y,p[5]=h.z,p[6]=_.x,p[7]=_.y,p[8]=_.z;var m=u.transpose(p,x),T=u.fromScale(r.radii,L),y=u.fromScale(r.oneOverRadii,U),R=b;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,v,S=u.multiply(u.multiply(m,y,F),R,F),N=u.multiply(u.multiply(S,T,D),p,D),I=u.multiplyByVector(S,a,w),V=d(N,e.negate(I,M),0,0,1),q=V.length;if(q>0){for(var X=e.clone(e.ZERO,z),H=Number.NEGATIVE_INFINITY,W=0;W<q;++W){A=u.multiplyByVector(T,u.multiplyByVector(p,V[W],B),B);var k=e.normalize(e.subtract(A,a,C),C),Y=e.dot(k,i);Y>H&&(H=Y,X=e.clone(A,X))}var Z=r.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),v=e.magnitude(e.subtract(X,a,C))*Math.sqrt(1-H*H),v=c?-v:v,Z.height=v,r.cartographicToCartesian(Z,new e)}};var V=new e;return _.lineSegmentPlane=function(t,r,a,i){n(i)||(i=new e);var u=e.subtract(r,t,V),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,i),e.add(t,i,i),i}},_.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return _.lineSegmentPlane(t,r,a,E),_.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return _.lineSegmentPlane(r,n,a,E),_.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return _.lineSegmentPlane(n,t,a,E),_.lineSegmentPlane(n,r,a,f),{positions:[t,r,n,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return _.lineSegmentPlane(r,t,a,E),_.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return _.lineSegmentPlane(n,r,a,E),_.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return _.lineSegmentPlane(t,n,a,E),_.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},_}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,r,n,a){"use strict";function i(t,r){this.normal=e.clone(t),this.distance=r}i.fromPointNormal=function(r,n,a){var o=-e.dot(n,r);return t(a)?(e.clone(n,a.normal),a.distance=o,a):new i(n,o)};var o=new e;return i.fromCartesian4=function(r,n){var a=e.fromCartesian4(r,o),u=r.w;return t(n)?(e.clone(a,n.normal),n.distance=u,n):new i(a,u)},i.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[n[f]]>i&&(c[n[f]]=E,++E);return(E-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<r.length;){var f=r[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],_=0;_<l;_++)d[_]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var p=0;E<h;)d[o[E]].vertexTriangles.push(p),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(p),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(p),++d[o[E+2]].numLiveTriangles,++p,E+=3;var m=0,T=s+1;i=1;var y,R,A=[],v=[],S=0,N=[],I=c/3,M=[];for(_=0;_<I;_++)M[_]=!1;for(var O,g;m!==-1;){A=[],R=d[m],g=R.vertexTriangles.length;for(var C=0;C<g;++C)if(p=R.vertexTriangles[C],!M[p]){M[p]=!0,E=p+p+p;for(var w=0;w<3;++w)O=o[E],A.push(O),v.push(O),N[S]=O,++S,y=d[O],--y.numLiveTriangles,T-y.timeStamp>s&&(y.timeStamp=T,++T),++E}m=a(o,s,A,d,T,v,l)}return N},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h,d,_,p,m,T,y,R,A,v,S,N){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function M(e){for(var t=e.length,r=t/3*6,n=p.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function g(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=p.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function C(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new d({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function w(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),A.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function x(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function L(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,E=1;E<n;++E){var f=e[E][t].attributes[r];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[r]=new d({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var n,i,o,u,s,l,E,f=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),_=e[0][t].primitiveType,m=L(e,t);for(n in m)if(m.hasOwnProperty(n))for(s=m[n].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[n].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var T;if(d){var y=0;for(i=0;i<f;++i)y+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:m,primitiveType:S.POINTS})),A=p.createTypedArray(R,y),v=0,N=0;for(i=0;i<f;++i){var I=e[i][t].indices,M=I.length;for(u=0;u<M;++u)A[v++]=N+I[u];N+=h.computeNumberOfVertices(e[i][t])}T=A}var O,g=new a,C=0;for(i=0;i<f;++i){if(O=e[i][t].boundingSphere,!c(O)){g=void 0;break}a.add(O.center,g,g)}if(c(g))for(a.divideByScalar(g,f,g),i=0;i<f;++i){O=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(O.center,g,se))+O.radius;w>C&&(C=w)}return new h({attributes:m,indices:T,primitiveType:_,boundingSphere:c(g)?new r(g,C):void 0})}function b(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function D(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function z(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function V(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return F(e);case S.TRIANGLE_STRIP:return D(e);case S.TRIANGLES:return b(e);case S.LINE_STRIP:return z(e);case S.LINE_LOOP:return G(e);case S.LINES:return B(e)}return e}function q(e,t){Math.abs(e.y)<y.EPSILON6&&(t?e.y=-y.EPSILON6:e.y=y.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return q(e,e.y<0),q(t,t.y<0),void q(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?y.sign(e.y):y.sign(r.y):i>o?y.sign(t.y):y.sign(r.y);var u=n<0;q(e,u),q(t,u),q(r,u)}function H(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Ae),e.y/(e.y-t.y),Ae),r),a.clone(r,n),q(r,!0),q(n,!1)}function W(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){X(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Me.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(H(e,t,ve,Ne),H(e,r,Se,Ie),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,r,ve,Ne),H(t,e,Se,Ie),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(r,e,ve,Ne),H(r,t,Se,Ie),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(H(r,e,ve,Ne),H(r,t,Se,Ie),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,r,ve,Ne),H(t,e,Se,Ie),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,ve,Ne),H(e,r,Se,Ie),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Me.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=ve,s[4]=Se,s[5]=Ne,s[6]=Ie,s.length=7),Me}}function k(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=p.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function Y(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function Z(e,t,r){var n=c(e.geometry.boundingSphere);t=k(t,n),r=k(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function K(e,r,i,o,u,s,l,E,f,h,d,_){if(c(s)||c(l)||c(E)||c(f)||c(h)){var p=a.fromArray(u,3*e,Oe),m=a.fromArray(u,3*r,ge),T=a.fromArray(u,3*i,Ce),y=t(o,p,m,T,we);if(c(s)){var R=a.fromArray(s,3*e,Oe),A=a.fromArray(s,3*r,ge),v=a.fromArray(s,3*i,Ce);a.multiplyByScalar(R,y.x,R),a.multiplyByScalar(A,y.y,A),a.multiplyByScalar(v,y.z,v);var S=a.add(R,A,R);a.add(S,v,S),a.normalize(S,S),a.pack(S,d.normal.values,3*_)}if(c(h)){var N=a.fromArray(h,3*e,Oe),I=a.fromArray(h,3*r,ge),M=a.fromArray(h,3*i,Ce);a.multiplyByScalar(N,y.x,N),a.multiplyByScalar(I,y.y,I),a.multiplyByScalar(M,y.z,M);var O;a.equals(N,a.ZERO)&&a.equals(I,a.ZERO)&&a.equals(M,a.ZERO)?(O=Oe,O.x=0,O.y=0,O.z=0):(O=a.add(N,I,N),a.add(O,M,O),a.normalize(O,O)),a.pack(O,d.extrudeDirection.values,3*_)}if(c(l)){var g=a.fromArray(l,3*e,Oe),C=a.fromArray(l,3*r,ge),w=a.fromArray(l,3*i,Ce);a.multiplyByScalar(g,y.x,g),a.multiplyByScalar(C,y.y,C),a.multiplyByScalar(w,y.z,w);var P=a.add(g,C,g);a.add(P,w,P),a.normalize(P,P),a.pack(P,d.tangent.values,3*_)}if(c(E)){var x=a.fromArray(E,3*e,Oe),L=a.fromArray(E,3*r,ge),U=a.fromArray(E,3*i,Ce);a.multiplyByScalar(x,y.x,x),a.multiplyByScalar(L,y.y,L),a.multiplyByScalar(U,y.z,U);var b=a.add(x,L,x);a.add(b,U,b),a.normalize(b,b),a.pack(b,d.bitangent.values,3*_)}if(c(f)){var F=n.fromArray(f,2*e,Pe),D=n.fromArray(f,2*r,xe),B=n.fromArray(f,2*i,Le);n.multiplyByScalar(F,y.x,F),n.multiplyByScalar(D,y.y,D),n.multiplyByScalar(B,y.z,B);var z=n.add(F,D,F);n.add(z,B,z),n.pack(z,d.st.values,2*_)}}}function j(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,_=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,p=u.indices,m=Y(u),T=Y(u),y=[];y.length=l.length/3;var R=[];for(R.length=l.length/3,o=0;o<y.length;++o)y[o]=-1,R[o]=-1;var A=p.length;for(o=0;o<A;o+=3){var v=p[o],S=p[o+1],N=p[o+2],I=a.fromArray(l,3*v),M=a.fromArray(l,3*S),O=a.fromArray(l,3*N),g=W(I,M,O);if(c(g)&&g.positions.length>3)for(var C=g.positions,w=g.indices,P=w.length,x=0;x<P;++x){var L=w[x],U=C[L];U.y<0?(t=T.attributes,r=T.indices,n=y):(t=m.attributes,r=m.indices,n=R),i=j(t,r,n,p,L<3?o+L:-1,U),K(v,S,N,U,l,E,h,f,d,_,t,i)}else c(g)&&(I=g.positions[0],M=g.positions[1],O=g.positions[2]),I.y<0?(t=T.attributes,r=T.indices,n=y):(t=m.attributes,r=m.indices,n=R),i=j(t,r,n,p,o,I),K(v,S,N,I,l,E,h,f,d,_,t,i),i=j(t,r,n,p,o+1,M),K(v,S,N,M,l,E,h,f,d,_,t,i),i=j(t,r,n,p,o+2,O),K(v,S,N,O,l,E,h,f,d,_,t,i)}Z(e,T,m)}function J(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=Y(r),s=Y(r),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],_=a.fromArray(i,3*h,Oe),p=a.fromArray(i,3*d,ge);Math.abs(_.y)<y.EPSILON6&&(_.y<0?_.y=-y.EPSILON6:_.y=y.EPSILON6),Math.abs(p.y)<y.EPSILON6&&(p.y<0?p.y=-y.EPSILON6:p.y=y.EPSILON6);var m=u.attributes,R=u.indices,A=f,v=s.attributes,S=s.indices,N=E,I=T.lineSegmentPlane(_,p,Ue,Ce);if(c(I)){var M=a.multiplyByScalar(a.UNIT_Y,5*y.EPSILON9,be);_.y<0&&(a.negate(M,M),m=s.attributes,R=s.indices,A=E,v=u.attributes,S=u.indices,N=f);var O=a.add(I,M,Fe);j(m,R,A,o,t,_),j(m,R,A,o,-1,O),a.negate(M,M),a.add(I,M,O),j(v,S,N,o,-1,O),j(v,S,N,o,t+1,p)}else{var g,C,w;_.y<0?(g=s.attributes,C=s.indices,w=E):(g=u.attributes,C=u.indices,w=f),j(g,C,w,o,t,_),j(g,C,w,o,t+1,p)}}Z(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,ze);if(!(s.x>0)){var c=a.unpack(n,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,Ve);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,_=c(s.color)?s.color.values:void 0,p=Y(u),m=Y(u),R=!1,A=l.length/3;for(t=0;t<A;t+=4){var v=t,S=t+2,N=a.fromArray(l,3*v,ze),I=a.fromArray(l,3*S,Ge);if(Math.abs(N.y)<Ye)for(N.y=Ye*(I.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,r=3*v;r<3*v+12;r+=3)E[r]=l[3*t],E[r+1]=l[3*t+1],E[r+2]=l[3*t+2];if(Math.abs(I.y)<Ye)for(I.y=Ye*(N.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*v;r<3*v+12;r+=3)f[r]=l[3*(t+2)],f[r+1]=l[3*(t+2)+1],f[r+2]=l[3*(t+2)+2];var M=p.attributes,O=p.indices,g=m.attributes,C=m.indices,w=T.lineSegmentPlane(N,I,Ue,qe);if(c(w)){R=!0;var P=a.multiplyByScalar(a.UNIT_Y,ke,Xe);N.y<0&&(a.negate(P,P),M=m.attributes,O=m.indices,g=p.attributes,C=p.indices);var x=a.add(w,P,He);M.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),M.position.values.push(x.x,x.y,x.z),M.position.values.push(x.x,x.y,x.z),M.prevPosition.values.push(E[3*v],E[3*v+1],E[3*v+2]),M.prevPosition.values.push(E[3*v+3],E[3*v+4],E[3*v+5]),M.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),a.negate(P,P),a.add(w,P,x),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.nextPosition.values.push(f[3*S],f[3*S+1],f[3*S+2]),g.nextPosition.values.push(f[3*S+3],f[3*S+4],f[3*S+5]);var L=n.fromArray(h,2*v,De),U=Math.abs(L.y);M.expandAndWidth.values.push(-1,U,1,U),M.expandAndWidth.values.push(-1,-U,1,-U),g.expandAndWidth.values.push(-1,U,1,U),g.expandAndWidth.values.push(-1,-U,1,-U);var b=a.magnitudeSquared(a.subtract(w,N,Ve));if(b/=a.magnitudeSquared(a.subtract(I,N,Ve)),c(_)){var F=i.fromArray(_,4*v,We),D=i.fromArray(_,4*S,We),B=y.lerp(F.x,D.x,b),z=y.lerp(F.y,D.y,b),G=y.lerp(F.z,D.z,b),V=y.lerp(F.w,D.w,b);for(r=4*v;r<4*v+8;++r)M.color.values.push(_[r]);for(M.color.values.push(B,z,G,V),M.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),r=4*S;r<4*S+8;++r)g.color.values.push(_[r])}if(c(d)){var q=n.fromArray(d,2*v,De),X=n.fromArray(d,2*(t+3),Be),H=y.lerp(q.x,X.x,b);for(r=2*v;r<2*v+4;++r)M.st.values.push(d[r]);for(M.st.values.push(H,q.y),M.st.values.push(H,X.y),g.st.values.push(H,q.y),g.st.values.push(H,X.y),r=2*S;r<2*S+4;++r)g.st.values.push(d[r])}o=M.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=g.position.values.length/3-4,C.push(o,o+2,o+1),C.push(o+1,o+2,o+3)}else{var W,k;for(N.y<0?(W=m.attributes,k=m.indices):(W=p.attributes,k=p.indices),W.position.values.push(N.x,N.y,N.z),W.position.values.push(N.x,N.y,N.z),W.position.values.push(I.x,I.y,I.z),W.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)W.prevPosition.values.push(E[r]),W.nextPosition.values.push(f[r]);for(r=2*t;r<2*t+8;++r)W.expandAndWidth.values.push(h[r]),c(d)&&W.st.values.push(d[r]);if(c(_))for(r=4*t;r<4*t+16;++r)W.color.values.push(_[r]);o=W.position.values.length/3-4,k.push(o,o+2,o+1),k.push(o+1,o+2,o+3)}}R&&($(m),$(p)),Z(e,m,p)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=M(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=g(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*n,l[E++]=a[f+1]+i[f+1]*n,l[E++]=a[f+2]+i[f+2]*n;var _,p=e.boundingSphere;return c(p)&&(_=new r(p.center,p.radius+n)),new h({attributes:{position:new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:_})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=p.createTypedArray(t,s),E=0,f=0,d=0;E<s;)i=n[o[E]],i!==-1?l[f]=i:(i=o[E],n[i]=d,l[f]=d,++d),++E,++f;e.indices=l;var _=e.attributes;for(var m in _)if(_.hasOwnProperty(m)&&c(_[m])&&c(_[m].values)){for(var T=_[m],y=T.values,R=0,A=T.componentsPerAttribute,v=u.createTypedArray(T.componentDatatype,d*A);R<t;){var S=n[R];if(S!==-1)for(a=0;a<A;a++)v[A*S+a]=y[A*R+a];++R}T.values=v}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=N.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=y.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=C(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var E=0;E<l;E+=n){for(var f=0;f<n;++f){var d=s[E+f],_=a[d];c(_)||(_=o++,a[d]=_,w(u,e.attributes,d)),i.push(_)}o+n>=y.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=C(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new f;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),h=0,_=0;_<l.length;_+=3){var p=a.fromArray(l,_,re),m=s.cartesianToCartographic(p,ne),T=i.project(m,re);E[h++]=T.x,E[h++]=T.y,E[h++]=T.z}return e.attributes[r]=o,e.attributes[n]=new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)E.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var f=a.componentsPerAttribute;return e.attributes[r]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[n]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var ie=new a,oe=new A,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(A.inverse(t,oe),A.transpose(oe,oe),A.getRotation(oe,ue),x(ue,n.normal),x(ue,n.tangent),x(ue,n.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),r.length>0&&(o.push(U(r,"westHemisphereGeometry")),o.push(U(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,Ee=new a,fe=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],_=t[E+1],p=t[E+2],m=3*h,T=3*_,R=3*p;le.x=n[m],le.y=n[m+1],le.z=n[m+2],Ee.x=n[T],Ee.y=n[T+1],Ee.z=n[T+2],fe.x=n[R],fe.y=n[R+1],fe.z=n[R+2],s[h].count++,s[_].count++,s[p].count++,a.subtract(Ee,le,Ee),a.subtract(fe,le,fe),c[f]=a.cross(Ee,fe,new a),f++}var A=0;for(E=0;E<i;E++)s[E].indexOffset+=A,A+=s[E].count;f=0;var v;for(E=0;E<o;E+=3){v=s[t[E]];var S=v.indexOffset+v.currentCount;l[S]=f,v.currentCount++,v=s[t[E+1]],S=v.indexOffset+v.currentCount,l[S]=f,v.currentCount++,v=s[t[E+2]],S=v.indexOffset+v.currentCount,l[S]=f,v.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var I=3*E;if(v=s[E],a.clone(a.ZERO,ce),v.count>0){for(f=0;f<v.count;f++)a.add(ce,c[l[v.indexOffset+f]],ce);a.equalsEpsilon(a.ZERO,ce,y.EPSILON10)&&a.clone(c[l[v.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,y.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),N[I]=ce.x,N[I+1]=ce.y,N[I+2]=ce.z}return e.attributes.normal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,de=new a,_e=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var _=t[l],p=t[l+1],m=t[l+2];E=3*_,f=3*p,h=3*m;var T=2*_,y=2*p,R=2*m,A=r[E],v=r[E+1],S=r[E+2],N=i[T],I=i[T+1],M=i[y+1]-I,O=i[R+1]-I,g=1/((i[y]-N)*O-(i[R]-N)*M),C=(O*(r[f]-A)-M*(r[h]-A))*g,w=(O*(r[f+1]-v)-M*(r[h+1]-v))*g,P=(O*(r[f+2]-S)-M*(r[h+2]-S))*g;c[E]+=C,c[E+1]+=w,c[E+2]+=P,c[f]+=C,c[f+1]+=w,c[f+2]+=P,c[h]+=C,c[h+1]+=w,c[h+2]+=P}var x=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var U=a.fromArray(n,E,he),b=a.fromArray(c,E,_e),F=a.dot(U,b);a.multiplyByScalar(U,F,de),a.normalize(a.subtract(b,de,b),b),x[E]=b.x,x[f]=b.y,x[h]=b.z,a.normalize(a.cross(U,b,b),b),L[E]=b.x,L[f]=b.y,L[h]=b.z}return e.attributes.tangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:x}),e.attributes.bitangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e};var pe=new n,me=new a,Te=new a,ye=new a,Re=new n;te.compressVertices=function(t){var r,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),E=0;for(r=0;r<i;++r)a.fromArray(s,3*r,me),a.equals(me,a.ZERO)?E+=2:(Re=e.octEncodeInRange(me,65535,Re),l[E++]=Re.x,l[E++]=Re.y);return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var f=t.attributes.normal,h=t.attributes.st,_=c(f),p=c(h);if(!_&&!p)return t;var m,T,y,R,A=t.attributes.tangent,v=t.attributes.bitangent,S=c(A),N=c(v);_&&(m=f.values),p&&(T=h.values),S&&(y=A.values),N&&(R=v.values);var I=_?m.length:T.length,M=_?3:2;i=I/M;var O=i,g=p&&_?2:1;g+=S||N?1:0,O*=g;var C=new Float32Array(O),w=0;for(r=0;r<i;++r){p&&(n.fromArray(T,2*r,pe),C[w++]=e.compressTextureCoordinates(pe));var P=3*r;_&&c(y)&&c(R)?(a.fromArray(m,P,me),a.fromArray(y,P,Te),a.fromArray(R,P,ye),e.octPack(me,Te,ye,pe),C[w++]=pe.x,C[w++]=pe.y):(_&&(a.fromArray(m,P,me),C[w++]=e.octEncodeFloat(me)),S&&(a.fromArray(y,P,me),C[w++]=e.octEncodeFloat(me)),N&&(a.fromArray(R,P,me),C[w++]=e.octEncodeFloat(me)))}return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:g,values:C}),_&&delete t.attributes.normal,p&&delete t.attributes.st,N&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Ae=new a,ve=new a,Se=new a,Ne=new a,Ie=new a,Me={positions:new Array(7),indices:new Array(9)},Oe=new a,ge=new a,Ce=new a,we=new a,Pe=new n,xe=new n,Le=new n,Ue=v.fromPointNormal(a.ZERO,a.UNIT_Y),be=new a,Fe=new a,De=new n,Be=new n,ze=new a,Ge=new a,Ve=new a,qe=new a,Xe=new a,He=new a,We=new i,ke=5*y.EPSILON9,Ye=y.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,v.ORIGIN_ZX_PLANE)!==m.INTERSECTING)return e}if(t.geometryType!==_.NONE)switch(t.geometryType){case _.POLYLINES:ee(e);break;case _.TRIANGLES:Q(e);break;case _.LINES:J(e)}else V(t),t.primitiveType===S.TRIANGLES?Q(e):t.primitiveType===S.LINES&&J(e);return e},te}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},s.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h){ "use strict";function d(e,t,n){var a,i=!n,o=e.length;if(!i&&o>1){var u=e[0].modelMatrix;for(a=1;a<o;++a)if(!f.equals(u,e[a].modelMatrix)){i=!0;break}}if(i)for(a=0;a<o;++a)r(e[a].geometry)&&l.transformToWorldCoordinates(e[a]);else f.multiplyTransformation(t,e[0].modelMatrix,t)}function _(e,r){var n=e.attributes,a=n.position,i=a.values.length/a.componentsPerAttribute;n.batchId=new s({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(i)});for(var o=n.batchId.values,u=0;u<i;++u)o[u]=r}function p(e){for(var t=e.length,n=0;n<t;++n){var a=e[n];r(a.geometry)?_(a.geometry,n):r(a.westHemisphereGeometry)&&r(a.eastHemisphereGeometry)&&(_(a.westHemisphereGeometry,n),_(a.eastHemisphereGeometry,n))}}function m(n){var a,i,o,u=n.instances,s=n.projection,c=n.elementIndexUintSupported,E=n.scene3DOnly,f=n.vertexCacheOptimize,h=n.compressVertices,_=n.modelMatrix,m=u.length;for(a=0;a<m;++a)if(r(u[a].geometry)){o=u[a].geometry.primitiveType;break}if(d(u,_,E),!E)for(a=0;a<m;++a)r(u[a].geometry)&&l.splitLongitude(u[a]);if(p(u),f)for(a=0;a<m;++a){var T=u[a];r(T.geometry)?(l.reorderForPostVertexCache(T.geometry),l.reorderForPreVertexCache(T.geometry)):r(T.westHemisphereGeometry)&&r(T.eastHemisphereGeometry)&&(l.reorderForPostVertexCache(T.westHemisphereGeometry),l.reorderForPreVertexCache(T.westHemisphereGeometry),l.reorderForPostVertexCache(T.eastHemisphereGeometry),l.reorderForPreVertexCache(T.eastHemisphereGeometry))}var y=l.combineInstances(u);for(m=y.length,a=0;a<m;++a){i=y[a];var R,A=i.attributes;if(E)for(R in A)A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE&&l.encodeAttribute(i,R,R+"3DHigh",R+"3DLow");else for(R in A)if(A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE){var v=R+"3D",S=R+"2D";l.projectTo2D(i,R,v,S,s),r(i.boundingSphere)&&"position"===R&&(i.boundingSphereCV=e.fromVertices(i.attributes.position2D.values)),l.encodeAttribute(i,v,v+"High",v+"Low"),l.encodeAttribute(i,S,S+"High",S+"Low")}h&&l.compressVertices(i)}if(!c){var N=[];for(m=y.length,a=0;a<m;++a)i=y[a],N=N.concat(l.fitToUnsignedShortIndices(i));y=N}return y}function T(e,t,n,a){var i,o,u,s=a.length-1;if(s>=0){var c=a[s];i=c.offset+c.count,u=c.index,o=n[u].indices.length}else i=0,u=0,o=n[u].indices.length;for(var l=e.length,E=0;E<l;++E){var f=e[E],h=f[t];if(r(h)){var d=h.indices.length;i+d>o&&(i=0,o=n[++u].indices.length),a.push({index:u,offset:i,count:d}),i+=d}}}function y(e,t){var r=[];return T(e,"geometry",t,r),T(e,"westHemisphereGeometry",t,r),T(e,"eastHemisphereGeometry",t,r),r}function R(e,t){var n=e.attributes;for(var a in n)if(n.hasOwnProperty(a)){var i=n[a];r(i)&&r(i.values)&&t.push(i.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function A(e,t){for(var r=e.length,n=0;n<r;++n)R(e[n],t)}function v(t){for(var n=1,a=t.length,i=0;i<a;i++){var o=t[i];if(++n,r(o)){var u=o.attributes;n+=6+2*e.packedLength+(r(o.indices)?o.indices.length:0);for(var s in u)if(u.hasOwnProperty(s)&&r(u[s])){var c=u[s];n+=5+c.values.length}}}return n}function S(e,t){var r=e.length,n=new Float64Array(1+16*r),a=0;n[a++]=r;for(var i=0;i<r;i++){var o=e[i];f.pack(o.modelMatrix,n,a),a+=f.packedLength}return t.push(n.buffer),n}function N(e){for(var t=e,r=new Array(t[0]),n=0,a=1;a<t.length;){var i=f.unpack(t,a);a+=f.packedLength,r[n++]={modelMatrix:i}}return r}function I(t){var n=t.length,a=1+(e.packedLength+1)*n,i=new Float32Array(a),o=0;i[o++]=n;for(var u=0;u<n;++u){var s=t[u];r(s)?(i[o++]=1,e.pack(t[u],i,o)):i[o++]=0,o+=e.packedLength}return i}function M(t){for(var r=new Array(t[0]),n=0,a=1;a<t.length;)1===t[a++]&&(r[n]=e.unpack(t,a)),++n,a+=e.packedLength;return r}if(!i.supportsTypedArrays())return{};var O={};return O.combineGeometry=function(t){var n,a,i=t.instances,o=i.length;o>0&&(n=m(t),n.length>0&&(a=l.createAttributeLocations(n[0])));var u;t.createPickOffsets&&n.length>0&&(u=y(i,n));for(var s=new Array(o),c=new Array(o),E=0;E<o;++E){var f=i[E],h=f.geometry;r(h)&&(s[E]=h.boundingSphere,c[E]=h.boundingSphereCV);var d=f.eastHemisphereGeometry,_=f.westHemisphereGeometry;r(d)&&r(_)&&(r(d.boundingSphere)&&r(_.boundingSphere)&&(s[E]=e.union(d.boundingSphere,_.boundingSphere)),r(d.boundingSphereCV)&&r(_.boundingSphereCV)&&(c[E]=e.union(d.boundingSphereCV,_.boundingSphereCV)))}return{geometries:n,modelMatrix:t.modelMatrix,attributeLocations:a,pickOffsets:u,boundingSpheres:s,boundingSpheresCV:c}},O.packCreateGeometryResults=function(t,n){var a=new Float64Array(v(t)),i=[],o={},u=t.length,s=0;a[s++]=u;for(var c=0;c<u;c++){var l=t[c],E=r(l);if(a[s++]=E?1:0,E){a[s++]=l.primitiveType,a[s++]=l.geometryType;var f=r(l.boundingSphere)?1:0;a[s++]=f,f&&e.pack(l.boundingSphere,a,s),s+=e.packedLength;var h=r(l.boundingSphereCV)?1:0;a[s++]=h,h&&e.pack(l.boundingSphereCV,a,s),s+=e.packedLength;var d=l.attributes,_=[];for(var p in d)d.hasOwnProperty(p)&&r(d[p])&&(_.push(p),r(o[p])||(o[p]=i.length,i.push(p)));a[s++]=_.length;for(var m=0;m<_.length;m++){var T=_[m],y=d[T];a[s++]=o[T],a[s++]=y.componentDatatype,a[s++]=y.componentsPerAttribute,a[s++]=y.normalize?1:0,a[s++]=y.values.length,a.set(y.values,s),s+=y.values.length}var R=r(l.indices)?l.indices.length:0;a[s++]=R,R>0&&(a.set(l.indices,s),s+=R)}}return n.push(a.buffer),{stringTable:i,packedData:a}},O.unpackCreateGeometryResults=function(r){for(var n,a=r.stringTable,i=r.packedData,o=new Array(i[0]),l=0,f=1;f<i.length;){var h=1===i[f++];if(h){var d,_,p=i[f++],m=i[f++],T=1===i[f++];T&&(d=e.unpack(i,f)),f+=e.packedLength;var y=1===i[f++];y&&(_=e.unpack(i,f)),f+=e.packedLength;var R,A,v,S=new c,N=i[f++];for(n=0;n<N;n++){var I=a[i[f++]],M=i[f++];v=i[f++];var O=0!==i[f++];R=i[f++],A=t.createTypedArray(M,R);for(var g=0;g<R;g++)A[g]=i[f++];S[I]=new s({componentDatatype:M,componentsPerAttribute:v,normalize:O,values:A})}var C;if(R=i[f++],R>0){var w=A.length/v;for(C=E.createTypedArray(w,R),n=0;n<R;n++)C[n]=i[f++]}o[l++]=new u({primitiveType:p,geometryType:m,boundingSphere:d,boundingSphereCV:_,indices:C,attributes:S})}else o[l++]=void 0}return o},O.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,a=0;a<n;a++)t.push(r[a].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:S(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},O.unpackCombineGeometryParameters=function(e){for(var t=N(e.packedInstances),r=e.createGeometryResults,n=r.length,i=0,u=0;u<n;u++)for(var s=O.unpackCreateGeometryResults(r[u]),c=s.length,l=0;l<c;l++){var E=s[l],d=t[i];d.geometry=E,++i}var _=a.clone(e.ellipsoid),p=e.isGeographic?new o(_):new h(_);return{instances:t,ellipsoid:_,projection:p,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:f.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},O.packCombineGeometryResults=function(e,t){r(e.geometries)&&A(e.geometries,t);var n=I(e.boundingSpheres),a=I(e.boundingSpheresCV);return t.push(n.buffer,a.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:n,boundingSpheresCV:a}},O.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:M(e.boundingSpheres),boundingSpheresCV:M(e.boundingSpheresCV)}},O}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,n=t.name,a=t.message;r=e(n)&&e(a)?n+": "+a:t.toString();var i=t.stack;return e(i)&&(r+="\n"+i),r}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function n(n){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=n(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return n}),define("Workers/combineGeometry",["../Scene/PrimitivePipeline","./createTaskProcessorWorker"],function(e,t){"use strict";function r(t,r){var n=e.unpackCombineGeometryParameters(t),a=e.combineGeometry(n);return e.packCombineGeometryResults(a,r)}return t(r)})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createBoxGeometry.js b/engines/Cesium/Workers/createBoxGeometry.js index 470e1d2..df6be9c 100644 --- a/engines/Cesium/Workers/createBoxGeometry.js +++ b/engines/Cesium/Workers/createBoxGeometry.js @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var i={};return i.typeOf={},i.defined=function(r,i){if(!t(i))throw new e(n(r))},i.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},i.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},i.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},i.typeOf.number.lessThan=function(t,n,r){if(i.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(t,n,r){if(i.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},i.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},i}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,I=f+h+N,d=Math.sqrt(1/I),S=t.multiplyByScalar(n,d,a);if(I<E)return isFinite(d)?t.clone(S,s):void 0;var m=u.x,O=u.y,M=u.z,y=o;y.x=S.x*m*2,y.y=S.y*O*2,y.z=S.z*M*2;var p,C,U,L,F,P,w,g,x,D,v,B=(1-d)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*m),L=1/(1+B*O),F=1/(1+B*M),P=U*U,w=L*L,g=F*F,x=P*U,D=w*L,v=g*F,p=f*P+h*w+N*g-1,C=f*x*m+h*D*O+N*v*M;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,i,a){return i=e(i,0),n(a)?(a.longitude=t,a.latitude=r,a.height=i,a):new u(t,r,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(e,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,h=o(e,l,A,f,s);if(n(h)){var N=t.multiplyComponents(h,A,E);N=t.normalize(N,N);var I=t.subtract(e,h,c),d=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=a.sign(t.dot(I,e))*t.magnitude(I);return n(i)?(i.longitude=d,i.latitude=S,i.height=m,i):new u(d,S,m)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(c.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}}}),c.clone=function(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,l=new t,A=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=t.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i,a,o,u,E,s){this[0]=n(t,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(A[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(t[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,f=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],I=(f-h)/2/N;R=I<0?-1/(-I+Math.sqrt(1+I*I)):1/(I+Math.sqrt(1+I*I)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5],i[6]=t[e+6],i[7]=t[e+7],i[8]=t[e+8],i},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,I=2*(s-o),d=2*(a-c),S=2*(s+o),m=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=d,e[3]=A,e[4]=N,e[5]=S,e[6]=f,e[7]=I,e[8]=m,e):new E(l,A,f,h,N,I,d,S,m)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-o*a+a*o*u,f=-o,h=s*n,N=a*n;return r(e)?(e[0]=c,e[1]=R,e[2]=f,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=A,e[8]=N,e):new E(c,_,T,R,l,A,f,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=i,e[6]=0,e[7]=-i,e[8]=n,e):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=n,e):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,i=10,a=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*i-r*_,e[2]=r*u-o*i,e[3]=s*u-a*_,e[4]=n*_-s*i,e[5]=a*i-n*u,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}o.fromElements=function(t,e,r,i,a){return n(a)?(a.x=t,a.y=e,a.z=r,a.w=i,a):new o(t,e,r,i)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r++],i.w=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var i=0;i<r;++i)o.pack(t[i],e,4*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)&&a.equalsEpsilon(t.w,e.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){ -"use strict";function c(t,e,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),i(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(i(t))return i(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return i(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,a){return n=r(n,t.ZERO),i(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,A=e.y*e.w,f=e.z*e.z,h=e.z*e.w,N=e.w*e.w,I=E-R-f+N,d=2*(s-h),S=2*(_+A),m=2*(s+h),O=-E+R-f+N,M=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+N;return r[0]=I*a,r[1]=m*a,r[2]=y*a,r[3]=0,r[4]=d*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=M*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return i(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return i(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var r=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,h=R.x,N=R.y,I=R.z,d=r.x,S=r.y,m=r.z,O=u*-d+E*-S+s*-m,M=h*-d+N*-S+I*-m,y=l*d+A*S+f*m;return i(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=I,n[10]=-f,n[11]=0,n[12]=O,n[13]=M,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,I,M,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(t,e,n,i){t=r(t,r.EMPTY_OBJECT);var a=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,A=a+s,f=o+c,h=e+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return i(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var A=new t;c.getMaximumScale=function(e){return c.getScale(e,A),t.maximumComponent(A)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],A=t[12],f=t[13],h=t[14],N=t[15],I=e[0],d=e[1],S=e[2],m=e[3],O=e[4],M=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],w=e[13],g=e[14],x=e[15],D=r*I+u*d+_*S+A*m,v=i*I+E*d+T*S+f*m,B=a*I+s*d+R*S+h*m,z=o*I+c*d+l*S+N*m,G=r*O+u*M+_*y+A*p,b=i*O+E*M+T*y+f*p,X=a*O+s*M+R*y+h*p,V=o*O+c*M+l*y+N*p,q=r*C+u*U+_*L+A*F,H=i*C+E*U+T*L+f*F,W=a*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,k=r*P+u*w+_*g+A*x,K=i*P+E*w+T*g+f*x,Z=a*P+s*w+R*g+h*x,j=o*P+c*w+l*g+N*x;return n[0]=D,n[1]=v,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],A=e[0],f=e[1],h=e[2],N=e[4],I=e[5],d=e[6],S=e[8],m=e[9],O=e[10],M=e[12],y=e[13],p=e[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,L=a*A+E*f+_*h,F=r*N+o*I+s*d,P=i*N+u*I+c*d,w=a*N+E*I+_*d,g=r*S+o*m+s*O,x=i*S+u*m+c*O,D=a*S+E*m+_*O,v=r*M+o*y+s*p+T,B=i*M+u*y+c*p+R,z=a*M+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=w,n[7]=0,n[8]=g,n[9]=x,n[10]=D,n[11]=0,n[12]=v,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],A=e[3],f=e[4],h=e[5],N=e[6],I=e[7],d=e[8],S=r*T+o*R+s*l,m=i*T+u*R+c*l,O=a*T+E*R+_*l,M=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*I+s*d,U=i*N+u*I+c*d,L=a*N+E*I+_*d;return n[0]=S,n[1]=m,n[2]=O,n[3]=0,n[4]=M,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var f=new t;c.multiplyByUniformScale=function(t,e,n){return f.x=e,f.y=e,f.z=e,c.multiplyByScale(t,f,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||i(t)&&i(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||i(t)&&i(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,I=new e,d=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,I),d))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],A=t[2],f=t[6],S=t[10],m=t[14],O=t[3],M=t[7],y=t[11],p=t[15],C=S*p,U=m*y,L=f*p,F=m*M,P=f*y,w=S*M,g=A*p,x=m*O,D=A*y,v=S*O,B=A*M,z=f*O,G=C*T+F*R+P*l-(U*T+L*R+w*l),b=U*_+g*R+v*l-(C*_+x*R+D*l),X=L*_+x*T+B*l-(F*_+g*T+z*l),V=w*_+D*T+z*R-(P*_+v*T+B*R),q=U*i+L*a+w*o-(C*i+F*a+P*o),H=C*r+x*a+D*o-(U*r+g*a+v*o),W=F*r+g*i+z*o-(L*r+x*i+B*o),Y=P*r+v*i+B*a-(w*r+D*i+z*a);C=a*l,U=o*R,L=i*l,F=o*T,P=i*R,w=a*T,g=r*l,x=o*_,D=r*R,v=a*_,B=r*T,z=i*_;var k=C*M+F*y+P*p-(U*M+L*y+w*p),K=U*O+g*y+v*p-(C*O+x*y+D*p),Z=L*O+x*M+B*p-(F*O+g*M+z*p),j=w*O+D*M+z*y-(P*O+v*M+B*y),Q=L*S+w*m+U*f-(P*m+C*f+F*S),J=D*m+C*A+x*S-(g*S+v*m+U*A),$=g*f+z*m+F*A-(B*m+L*A+x*f),tt=B*S+P*A+v*f-(D*f+z*S+w*A),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=A,e[14]=f,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i.west=t[e++],i.south=t[e++],i.east=t[e++],i.north=t[e],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,i,a,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=t,o.south=e,o.east=i,o.north=a,o):new E(t,e,i,a)},E.fromRadians=function(t,e,i,a,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(i,0),o.north=n(a,0),o):new E(t,e,i,a)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=i,e.north=c,e):new E(n,s,i,c)},E.fromCartesianArray=function(t,e,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,n){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=e.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(t,A)&&(o[c]=e.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=e.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,A=new t,f=new t,h=new t,N=new t,I=new t,d=new t,S=new t,m=new t,O=new t,M=new t;T.fromPoints=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],I),a=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,A),E=t.clone(r,f),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&t.clone(r,a),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,a,d)),F=t.magnitudeSquared(t.subtract(s,o,d)),P=t.magnitudeSquared(t.subtract(c,u,d)),w=a,g=E,x=L;F>x&&(x=F,w=o,g=s),P>x&&(x=P,w=u,g=c);var D=S;D.x=.5*(w.x+g.x),D.y=.5*(w.y+g.y),D.z=.5*(w.z+g.z);var v=t.magnitudeSquared(t.subtract(g,D,d)),B=Math.sqrt(v),z=m;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,d),.5,M),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,d));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,D,d));if(q>v){var H=Math.sqrt(q);B=.5*(B+H),v=B*B;var W=H-B;D.x=(B*D.x+W*r.x)/H,D.y=(B*D.y+W*r.y)/H,D.z=(B*D.z+W*r.z)/H}}return B<X?(t.clone(D,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,a,o,u){if(i(u)||(u=new T),!i(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=a,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,a.WGS84),n=r(n,0);var u;return i(t)&&(u=_.subsample(t,e,n,F)),T.fromPoints(u,o)},T.fromVertices=function(e,n,a,o){if(i(o)||(o=new T),!i(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),a=r(a,3);var u=I;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,A),_=t.clone(u,f),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=a){var L=e[U]+n.x,F=e[U+1]+n.y,P=e[U+2]+n.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>y.y&&t.clone(u,y),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var w=t.magnitudeSquared(t.subtract(_,E,d)),g=t.magnitudeSquared(t.subtract(y,s,d)),x=t.magnitudeSquared(t.subtract(p,c,d)),D=E,v=_,B=w;g>B&&(B=g,D=s,v=y),x>B&&(B=x,D=c,v=p);var z=S;z.x=.5*(D.x+v.x),z.y=.5*(D.y+v.y),z.z=.5*(D.z+v.z);var G=t.magnitudeSquared(t.subtract(v,z,d)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,d),.5,M),H=0;for(U=0;U<C;U+=a){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,d));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,d));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(i(r)||(r=new T),!i(e)||!i(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var a=I;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,R),u=t.clone(a,l),E=t.clone(a,A),s=t.clone(a,f),c=t.clone(a,h),_=t.clone(a,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var F=t.magnitudeSquared(t.subtract(s,o,d)),P=t.magnitudeSquared(t.subtract(c,u,d)),w=t.magnitudeSquared(t.subtract(_,E,d)),g=o,x=s,D=F;P>D&&(D=P,g=u,x=c),w>D&&(D=w,g=E,x=_);var v=S;v.x=.5*(g.x+x.x),v.y=.5*(g.y+x.y),v.z=.5*(g.z+x.z);var B=t.magnitudeSquared(t.subtract(x,v,d)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,d),.5,M),V=0;for(p=0;p<y;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(a,X,d));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,v,d));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;v.x=(z*v.x+Y*a.x)/W,v.y=(z*v.y+Y*a.y)/W,v.z=(z*v.z+Y*a.z)/W}}return z<V?(t.clone(v,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){i(r)||(r=new T);var a=r.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),r.radius=t.distance(a,n),r},T.fromEllipsoid=function(e,n){return i(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var a=[],o=0;o<r;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var w=new t,g=new t,x=new t;T.fromOrientedBoundingBox=function(e,n){i(n)||(n=new T);var r=e.halfAxes,a=s.getColumn(r,0,w),o=s.getColumn(r,1,g),u=s.getColumn(r,2,x),E=t.magnitude(a),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(i(e))return i(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var i=t.center;return e[n++]=i.x,e[n++]=i.y,e[n++]=i.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),i(n)||(n=new T);var a=n.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],n.radius=t[e],n};var D=new t,v=new t;T.union=function(e,n,r){i(r)||(r=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,D),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,v);return t.add(R,a,R),t.clone(R,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,a){i(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,i){n=r(n,K);var a=n.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),R=t.negate(s,q),l=Y,A=l[0];t.add(E,c,A),t.add(A,s,A),A=l[1],t.add(E,c,A),t.add(A,R,A),A=l[2],t.add(E,_,A),t.add(A,R,A),A=l[3],t.add(E,_,A),t.add(A,s,A),t.negate(E,E),A=l[4],t.add(E,c,A),t.add(A,s,A),A=l[5],t.add(E,c,A),t.add(A,R,A),A=l[6],t.add(E,_,A),t.add(A,R,A),A=l[7],t.add(E,_,A),t.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];t.add(o,N,N);var I=a.cartesianToCartographic(N,W);n.project(I,N)}i=T.fromPoints(l,i),o=i.center;var d=o.x,S=o.y,m=o.z;return o.x=m,o.y=d,o.z=S,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||i(e)&&i(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function a(){return i()&&m}function o(){if(!e(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(d.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(O=!0,M=r(t[1]))}return O}function u(){return o()&&M}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(d.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===d.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===d.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function R(){return T()&&F}function l(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(d.userAgent); -null!==t&&(P=!0,w=r(t[1]))}return P}function A(){return e(g)||(g=/Windows/i.test(d.appVersion)),g}function f(){return l()&&w}function h(){return e(x)||(x="undefined"!=typeof PointerEvent&&(!e(d.pointerEnabled)||d.pointerEnabled)),x}function N(){if(!e(v)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;v=e(n)&&""!==n,v&&(D=n)}return v}function I(){return N()?D:void 0}var d;d="undefined"!=typeof navigator?navigator:{};var S,m,O,M,y,p,C,U,L,F,P,w,g,x,D,v,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:t(d.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:I};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return i.POSITION_ONLY=r(new i({position:!0})),i.POSITION_AND_NORMAL=r(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=r(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=r(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=r(new i({position:!0,color:!0})),i.ALL=r(new i({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.tangent?1:0,n[r++]=e.bitangent?1:0,n[r++]=e.color?1:0,n},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.position=1===n[r++],a.normal=1===n[r++],a.st=1===n[r++],a.tangent=1===n[r++],a.bitangent=1===n[r++],a.color=1===n[r++],a},i.clone=function(t,n){if(e(t))return e(n)||(n=new i),n.position=t.position,n.normal=t.normal,n.st=t.st,n.tangent=t.tangent,n.bitangent=t.bitangent,n.color=t.color,n},i}),define("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(t,e,n,r,i,a,o,u,E,s,c){"use strict";function _(t){t=r(t,r.EMPTY_OBJECT);var n=t.minimum,i=t.maximum,a=r(t.vertexFormat,c.DEFAULT);this._minimum=e.clone(n),this._maximum=e.clone(i),this._vertexFormat=a,this._workerName="createBoxGeometry"}var T=new e;_.fromDimensions=function(t){t=r(t,r.EMPTY_OBJECT);var n=t.dimensions,i=e.multiplyByScalar(n,.5,new e);return new _({minimum:e.negate(i,new e),maximum:i,vertexFormat:t.vertexFormat})},_.fromAxisAlignedBoundingBox=function(t){return new _({minimum:t.minimum,maximum:t.maximum})},_.packedLength=2*e.packedLength+c.packedLength,_.pack=function(t,n,i){return i=r(i,0),e.pack(t._minimum,n,i),e.pack(t._maximum,n,i+e.packedLength),c.pack(t._vertexFormat,n,i+2*e.packedLength),n};var R=new e,l=new e,A=new c,f={minimum:R,maximum:l,vertexFormat:A};return _.unpack=function(t,n,a){n=r(n,0);var o=e.unpack(t,n,R),u=e.unpack(t,n+e.packedLength,l),E=c.unpack(t,n+2*e.packedLength,A);return i(a)?(a._minimum=e.clone(o,a._minimum),a._maximum=e.clone(u,a._maximum),a._vertexFormat=c.clone(E,a._vertexFormat),a):new _(f)},_.createGeometry=function(r){var i=r._minimum,a=r._maximum,c=r._vertexFormat;if(!e.equals(i,a)){var _,R,l=new E;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&(R=new Float64Array(72),R[0]=i.x,R[1]=i.y,R[2]=a.z,R[3]=a.x,R[4]=i.y,R[5]=a.z,R[6]=a.x,R[7]=a.y,R[8]=a.z,R[9]=i.x,R[10]=a.y,R[11]=a.z,R[12]=i.x,R[13]=i.y,R[14]=i.z,R[15]=a.x,R[16]=i.y,R[17]=i.z,R[18]=a.x,R[19]=a.y,R[20]=i.z,R[21]=i.x,R[22]=a.y,R[23]=i.z,R[24]=a.x,R[25]=i.y,R[26]=i.z,R[27]=a.x,R[28]=a.y,R[29]=i.z,R[30]=a.x,R[31]=a.y,R[32]=a.z,R[33]=a.x,R[34]=i.y,R[35]=a.z,R[36]=i.x,R[37]=i.y,R[38]=i.z,R[39]=i.x,R[40]=a.y,R[41]=i.z,R[42]=i.x,R[43]=a.y,R[44]=a.z,R[45]=i.x,R[46]=i.y,R[47]=a.z,R[48]=i.x,R[49]=a.y,R[50]=i.z,R[51]=a.x,R[52]=a.y,R[53]=i.z,R[54]=a.x,R[55]=a.y,R[56]=a.z,R[57]=i.x,R[58]=a.y,R[59]=a.z,R[60]=i.x,R[61]=i.y,R[62]=i.z,R[63]=a.x,R[64]=i.y,R[65]=i.z,R[66]=a.x,R[67]=i.y,R[68]=a.z,R[69]=i.x,R[70]=i.y,R[71]=a.z,l.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:R})),c.normal){var A=new Float32Array(72);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,A[12]=0,A[13]=0,A[14]=-1,A[15]=0,A[16]=0,A[17]=-1,A[18]=0,A[19]=0,A[20]=-1,A[21]=0,A[22]=0,A[23]=-1,A[24]=1,A[25]=0,A[26]=0,A[27]=1,A[28]=0,A[29]=0,A[30]=1,A[31]=0,A[32]=0,A[33]=1,A[34]=0,A[35]=0,A[36]=-1,A[37]=0,A[38]=0,A[39]=-1,A[40]=0,A[41]=0,A[42]=-1,A[43]=0,A[44]=0,A[45]=-1,A[46]=0,A[47]=0,A[48]=0,A[49]=1,A[50]=0,A[51]=0,A[52]=1,A[53]=0,A[54]=0,A[55]=1,A[56]=0,A[57]=0,A[58]=1,A[59]=0,A[60]=0,A[61]=-1,A[62]=0,A[63]=0,A[64]=-1,A[65]=0,A[66]=0,A[67]=-1,A[68]=0,A[69]=0,A[70]=-1,A[71]=0,l.normal=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:A})}if(c.st){var f=new Float32Array(48);f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=1,f[5]=1,f[6]=0,f[7]=1,f[8]=1,f[9]=0,f[10]=0,f[11]=0,f[12]=0,f[13]=1,f[14]=1,f[15]=1,f[16]=0,f[17]=0,f[18]=1,f[19]=0,f[20]=1,f[21]=1,f[22]=0,f[23]=1,f[24]=1,f[25]=0,f[26]=0,f[27]=0,f[28]=0,f[29]=1,f[30]=1,f[31]=1,f[32]=1,f[33]=0,f[34]=0,f[35]=0,f[36]=0,f[37]=1,f[38]=1,f[39]=1,f[40]=0,f[41]=0,f[42]=1,f[43]=0,f[44]=1,f[45]=1,f[46]=0,f[47]=1,l.st=new u({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:f})}if(c.tangent){var h=new Float32Array(72);h[0]=1,h[1]=0,h[2]=0,h[3]=1,h[4]=0,h[5]=0,h[6]=1,h[7]=0,h[8]=0,h[9]=1,h[10]=0,h[11]=0,h[12]=-1,h[13]=0,h[14]=0,h[15]=-1,h[16]=0,h[17]=0,h[18]=-1,h[19]=0,h[20]=0,h[21]=-1,h[22]=0,h[23]=0,h[24]=0,h[25]=1,h[26]=0,h[27]=0,h[28]=1,h[29]=0,h[30]=0,h[31]=1,h[32]=0,h[33]=0,h[34]=1,h[35]=0,h[36]=0,h[37]=-1,h[38]=0,h[39]=0,h[40]=-1,h[41]=0,h[42]=0,h[43]=-1,h[44]=0,h[45]=0,h[46]=-1,h[47]=0,h[48]=-1,h[49]=0,h[50]=0,h[51]=-1,h[52]=0,h[53]=0,h[54]=-1,h[55]=0,h[56]=0,h[57]=-1,h[58]=0,h[59]=0,h[60]=1,h[61]=0,h[62]=0,h[63]=1,h[64]=0,h[65]=0,h[66]=1,h[67]=0,h[68]=0,h[69]=1,h[70]=0,h[71]=0,l.tangent=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:h})}if(c.bitangent){var N=new Float32Array(72);N[0]=0,N[1]=1,N[2]=0,N[3]=0,N[4]=1,N[5]=0,N[6]=0,N[7]=1,N[8]=0,N[9]=0,N[10]=1,N[11]=0,N[12]=0,N[13]=1,N[14]=0,N[15]=0,N[16]=1,N[17]=0,N[18]=0,N[19]=1,N[20]=0,N[21]=0,N[22]=1,N[23]=0,N[24]=0,N[25]=0,N[26]=1,N[27]=0,N[28]=0,N[29]=1,N[30]=0,N[31]=0,N[32]=1,N[33]=0,N[34]=0,N[35]=1,N[36]=0,N[37]=0,N[38]=1,N[39]=0,N[40]=0,N[41]=1,N[42]=0,N[43]=0,N[44]=1,N[45]=0,N[46]=0,N[47]=1,N[48]=0,N[49]=0,N[50]=1,N[51]=0,N[52]=0,N[53]=1,N[54]=0,N[55]=0,N[56]=1,N[57]=0,N[58]=0,N[59]=1,N[60]=0,N[61]=0,N[62]=1,N[63]=0,N[64]=0,N[65]=1,N[66]=0,N[67]=0,N[68]=1,N[69]=0,N[70]=0,N[71]=1,l.bitangent=new u({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:N})}_=new Uint16Array(36),_[0]=0,_[1]=1,_[2]=2,_[3]=0,_[4]=2,_[5]=3,_[6]=6,_[7]=5,_[8]=4,_[9]=7,_[10]=6,_[11]=4,_[12]=8,_[13]=9,_[14]=10,_[15]=8,_[16]=10,_[17]=11,_[18]=14,_[19]=13,_[20]=12,_[21]=15,_[22]=14,_[23]=12,_[24]=18,_[25]=17,_[26]=16,_[27]=19,_[28]=18,_[29]=16,_[30]=20,_[31]=21,_[32]=22,_[33]=20,_[34]=22,_[35]=23}else R=new Float64Array(24),R[0]=i.x,R[1]=i.y,R[2]=i.z,R[3]=a.x,R[4]=i.y,R[5]=i.z,R[6]=a.x,R[7]=a.y,R[8]=i.z,R[9]=i.x,R[10]=a.y,R[11]=i.z,R[12]=i.x,R[13]=i.y,R[14]=a.z,R[15]=a.x,R[16]=i.y,R[17]=a.z,R[18]=a.x,R[19]=a.y,R[20]=a.z,R[21]=i.x,R[22]=a.y,R[23]=a.z,l.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:R}),_=new Uint16Array(36),_[0]=4,_[1]=5,_[2]=6,_[3]=4,_[4]=6,_[5]=7,_[6]=1,_[7]=0,_[8]=3,_[9]=1,_[10]=3,_[11]=2,_[12]=1,_[13]=6,_[14]=5,_[15]=1,_[16]=2,_[17]=6,_[18]=2,_[19]=3,_[20]=7,_[21]=2,_[22]=7,_[23]=6,_[24]=3,_[25]=0,_[26]=4,_[27]=3,_[28]=4,_[29]=7,_[30]=0,_[31]=1,_[32]=5,_[33]=0,_[34]=5,_[35]=4;var I=e.subtract(a,i,T),d=.5*e.magnitude(I);return new o({attributes:l,indices:_,primitiveType:s.TRIANGLES,boundingSphere:new t(e.ZERO,d)})}},_}),define("Workers/createBoxGeometry",["../Core/BoxGeometry","../Core/defined"],function(t,e){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var i={};return i.typeOf={},i.defined=function(r,i){if(!t(i))throw new e(n(r))},i.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},i.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},i.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},i.typeOf.number.lessThan=function(t,n,r){if(i.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(t,n,r){if(i.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},i.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},i}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,I=f+h+N,d=Math.sqrt(1/I),S=t.multiplyByScalar(n,d,a);if(I<E)return isFinite(d)?t.clone(S,s):void 0;var m=u.x,O=u.y,M=u.z,y=o;y.x=S.x*m*2,y.y=S.y*O*2,y.z=S.z*M*2;var p,C,U,L,F,P,w,g,x,D,v,B=(1-d)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*m),L=1/(1+B*O),F=1/(1+B*M),P=U*U,w=L*L,g=F*F,x=P*U,D=w*L,v=g*F,p=f*P+h*w+N*g-1,C=f*x*m+h*D*O+N*v*M;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,e,r){this.longitude=n(t,0),this.latitude=n(e,0),this.height=n(r,0)}u.fromRadians=function(t,e,i,a){return i=n(i,0),r(a)?(a.longitude=t,a.latitude=e,a.height=i,a):new u(t,e,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(e,n,i){var l=r(n)?n.oneOverRadii:_,A=r(n)?n.oneOverRadiiSquared:T,f=r(n)?n._centerToleranceSquared:R,h=o(e,l,A,f,s);if(r(h)){var N=t.multiplyComponents(h,A,E);N=t.normalize(N,N);var I=t.subtract(e,h,c),d=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=a.sign(t.dot(I,e))*t.magnitude(I);return r(i)?(i.longitude=d,i.latitude=S,i.height=m,i):new u(d,S,m)}},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(c.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}}}),c.clone=function(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,l=new t,A=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=t.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i,a,o,u,E,s){this[0]=n(t,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(A[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(t[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,f=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],I=(f-h)/2/N;R=I<0?-1/(-I+Math.sqrt(1+I*I)):1/(I+Math.sqrt(1+I*I)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5],i[6]=t[e+6],i[7]=t[e+7],i[8]=t[e+8],i},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,I=2*(s-o),d=2*(a-c),S=2*(s+o),m=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=d,e[3]=A,e[4]=N,e[5]=S,e[6]=f,e[7]=I,e[8]=m,e):new E(l,A,f,h,N,I,d,S,m)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-s*i+a*o*u,f=-o,h=s*n,N=a*n;return r(e)?(e[0]=c,e[1]=R,e[2]=f,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=A,e[8]=N,e):new E(c,_,T,R,l,A,f,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=i,e[6]=0,e[7]=-i,e[8]=n,e):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=n,e):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,i=10,a=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*i-r*_,e[2]=r*u-o*i,e[3]=s*u-a*_,e[4]=n*_-s*i,e[5]=a*i-n*u,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}o.fromElements=function(t,e,r,i,a){return n(a)?(a.x=t,a.y=e,a.z=r,a.w=i,a):new o(t,e,r,i)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r++],i.w=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var i=0;i<r;++i)o.pack(t[i],e,4*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)&&a.equalsEpsilon(t.w,e.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){ +"use strict";function c(t,e,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),i(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(i(t))return i(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return i(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,a){return n=r(n,t.ZERO),i(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,A=e.y*e.w,f=e.z*e.z,h=e.z*e.w,N=e.w*e.w,I=E-R-f+N,d=2*(s-h),S=2*(_+A),m=2*(s+h),O=-E+R-f+N,M=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+N;return r[0]=I*a,r[1]=m*a,r[2]=y*a,r[3]=0,r[4]=d*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=M*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return i(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return i(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var r=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,h=R.x,N=R.y,I=R.z,d=r.x,S=r.y,m=r.z,O=u*-d+E*-S+s*-m,M=h*-d+N*-S+I*-m,y=l*d+A*S+f*m;return i(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=I,n[10]=-f,n[11]=0,n[12]=O,n[13]=M,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,I,M,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(t,e,n,i){t=r(t,r.EMPTY_OBJECT);var a=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,A=a+s,f=o+c,h=e+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return i(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var A=new t;c.getMaximumScale=function(e){return c.getScale(e,A),t.maximumComponent(A)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],A=t[12],f=t[13],h=t[14],N=t[15],I=e[0],d=e[1],S=e[2],m=e[3],O=e[4],M=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],w=e[13],g=e[14],x=e[15],D=r*I+u*d+_*S+A*m,v=i*I+E*d+T*S+f*m,B=a*I+s*d+R*S+h*m,z=o*I+c*d+l*S+N*m,G=r*O+u*M+_*y+A*p,b=i*O+E*M+T*y+f*p,X=a*O+s*M+R*y+h*p,V=o*O+c*M+l*y+N*p,q=r*C+u*U+_*L+A*F,H=i*C+E*U+T*L+f*F,W=a*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,k=r*P+u*w+_*g+A*x,K=i*P+E*w+T*g+f*x,Z=a*P+s*w+R*g+h*x,j=o*P+c*w+l*g+N*x;return n[0]=D,n[1]=v,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],A=e[0],f=e[1],h=e[2],N=e[4],I=e[5],d=e[6],S=e[8],m=e[9],O=e[10],M=e[12],y=e[13],p=e[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,L=a*A+E*f+_*h,F=r*N+o*I+s*d,P=i*N+u*I+c*d,w=a*N+E*I+_*d,g=r*S+o*m+s*O,x=i*S+u*m+c*O,D=a*S+E*m+_*O,v=r*M+o*y+s*p+T,B=i*M+u*y+c*p+R,z=a*M+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=w,n[7]=0,n[8]=g,n[9]=x,n[10]=D,n[11]=0,n[12]=v,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],A=e[3],f=e[4],h=e[5],N=e[6],I=e[7],d=e[8],S=r*T+o*R+s*l,m=i*T+u*R+c*l,O=a*T+E*R+_*l,M=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*I+s*d,U=i*N+u*I+c*d,L=a*N+E*I+_*d;return n[0]=S,n[1]=m,n[2]=O,n[3]=0,n[4]=M,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var f=new t;c.multiplyByUniformScale=function(t,e,n){return f.x=e,f.y=e,f.z=e,c.multiplyByScale(t,f,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||i(t)&&i(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||i(t)&&i(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,I=new e,d=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,I),d))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],A=t[2],f=t[6],S=t[10],m=t[14],O=t[3],M=t[7],y=t[11],p=t[15],C=S*p,U=m*y,L=f*p,F=m*M,P=f*y,w=S*M,g=A*p,x=m*O,D=A*y,v=S*O,B=A*M,z=f*O,G=C*T+F*R+P*l-(U*T+L*R+w*l),b=U*_+g*R+v*l-(C*_+x*R+D*l),X=L*_+x*T+B*l-(F*_+g*T+z*l),V=w*_+D*T+z*R-(P*_+v*T+B*R),q=U*i+L*a+w*o-(C*i+F*a+P*o),H=C*r+x*a+D*o-(U*r+g*a+v*o),W=F*r+g*i+z*o-(L*r+x*i+B*o),Y=P*r+v*i+B*a-(w*r+D*i+z*a);C=a*l,U=o*R,L=i*l,F=o*T,P=i*R,w=a*T,g=r*l,x=o*_,D=r*R,v=a*_,B=r*T,z=i*_;var k=C*M+F*y+P*p-(U*M+L*y+w*p),K=U*O+g*y+v*p-(C*O+x*y+D*p),Z=L*O+x*M+B*p-(F*O+g*M+z*p),j=w*O+D*M+z*y-(P*O+v*M+B*y),Q=L*S+w*m+U*f-(P*m+C*f+F*S),J=D*m+C*A+x*S-(g*S+v*m+U*A),$=g*f+z*m+F*A-(B*m+L*A+x*f),tt=B*S+P*A+v*f-(D*f+z*S+w*A),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=A,e[14]=f,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i.west=t[e++],i.south=t[e++],i.east=t[e++],i.north=t[e],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,i,a,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=t,o.south=e,o.east=i,o.north=a,o):new E(t,e,i,a)},E.fromRadians=function(t,e,i,a,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(i,0),o.north=n(a,0),o):new E(t,e,i,a)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=i,e.north=c,e):new E(n,s,i,c)},E.fromCartesianArray=function(t,e,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,n){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=e.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(t,A)&&(o[c]=e.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=e.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,A=new t,f=new t,h=new t,N=new t,I=new t,d=new t,S=new t,m=new t,O=new t,M=new t;T.fromPoints=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],I),a=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,A),E=t.clone(r,f),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&t.clone(r,a),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,a,d)),F=t.magnitudeSquared(t.subtract(s,o,d)),P=t.magnitudeSquared(t.subtract(c,u,d)),w=a,g=E,x=L;F>x&&(x=F,w=o,g=s),P>x&&(x=P,w=u,g=c);var D=S;D.x=.5*(w.x+g.x),D.y=.5*(w.y+g.y),D.z=.5*(w.z+g.z);var v=t.magnitudeSquared(t.subtract(g,D,d)),B=Math.sqrt(v),z=m;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,d),.5,M),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,d));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,D,d));if(q>v){var H=Math.sqrt(q);B=.5*(B+H),v=B*B;var W=H-B;D.x=(B*D.x+W*r.x)/H,D.y=(B*D.y+W*r.y)/H,D.z=(B*D.z+W*r.z)/H}}return B<X?(t.clone(D,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,a,o,u){if(i(u)||(u=new T),!i(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=a,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,a.WGS84),n=r(n,0);var u;return i(t)&&(u=_.subsample(t,e,n,F)),T.fromPoints(u,o)},T.fromVertices=function(e,n,a,o){if(i(o)||(o=new T),!i(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),a=r(a,3);var u=I;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,A),_=t.clone(u,f),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=a){var L=e[U]+n.x,F=e[U+1]+n.y,P=e[U+2]+n.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>y.y&&t.clone(u,y),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var w=t.magnitudeSquared(t.subtract(_,E,d)),g=t.magnitudeSquared(t.subtract(y,s,d)),x=t.magnitudeSquared(t.subtract(p,c,d)),D=E,v=_,B=w;g>B&&(B=g,D=s,v=y),x>B&&(B=x,D=c,v=p);var z=S;z.x=.5*(D.x+v.x),z.y=.5*(D.y+v.y),z.z=.5*(D.z+v.z);var G=t.magnitudeSquared(t.subtract(v,z,d)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,d),.5,M),H=0;for(U=0;U<C;U+=a){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,d));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,d));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(i(r)||(r=new T),!i(e)||!i(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var a=I;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,R),u=t.clone(a,l),E=t.clone(a,A),s=t.clone(a,f),c=t.clone(a,h),_=t.clone(a,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var F=t.magnitudeSquared(t.subtract(s,o,d)),P=t.magnitudeSquared(t.subtract(c,u,d)),w=t.magnitudeSquared(t.subtract(_,E,d)),g=o,x=s,D=F;P>D&&(D=P,g=u,x=c),w>D&&(D=w,g=E,x=_);var v=S;v.x=.5*(g.x+x.x),v.y=.5*(g.y+x.y),v.z=.5*(g.z+x.z);var B=t.magnitudeSquared(t.subtract(x,v,d)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,d),.5,M),V=0;for(p=0;p<y;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(a,X,d));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,v,d));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;v.x=(z*v.x+Y*a.x)/W,v.y=(z*v.y+Y*a.y)/W,v.z=(z*v.z+Y*a.z)/W}}return z<V?(t.clone(v,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){i(r)||(r=new T);var a=r.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),r.radius=t.distance(a,n),r},T.fromEllipsoid=function(e,n){return i(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var a=[],o=0;o<r;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var w=new t,g=new t,x=new t;T.fromOrientedBoundingBox=function(e,n){i(n)||(n=new T);var r=e.halfAxes,a=s.getColumn(r,0,w),o=s.getColumn(r,1,g),u=s.getColumn(r,2,x);return t.add(a,o,a),t.add(a,u,a),n.center=t.clone(e.center,n.center),n.radius=t.magnitude(a),n},T.clone=function(e,n){if(i(e))return i(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var i=t.center;return e[n++]=i.x,e[n++]=i.y,e[n++]=i.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),i(n)||(n=new T);var a=n.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],n.radius=t[e],n};var D=new t,v=new t;T.union=function(e,n,r){i(r)||(r=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,D),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,v);return t.add(R,a,R),t.clone(R,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,a){i(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,i){n=r(n,K);var a=n.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),R=t.negate(s,q),l=Y,A=l[0];t.add(E,c,A),t.add(A,s,A),A=l[1],t.add(E,c,A),t.add(A,R,A),A=l[2],t.add(E,_,A),t.add(A,R,A),A=l[3],t.add(E,_,A),t.add(A,s,A),t.negate(E,E),A=l[4],t.add(E,c,A),t.add(A,s,A),A=l[5],t.add(E,c,A),t.add(A,R,A),A=l[6],t.add(E,_,A),t.add(A,R,A),A=l[7],t.add(E,_,A),t.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];t.add(o,N,N);var I=a.cartesianToCartographic(N,W);n.project(I,N)}i=T.fromPoints(l,i),o=i.center;var d=o.x,S=o.y,m=o.z;return o.x=m,o.y=d,o.z=S,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||i(e)&&i(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function a(){return i()&&m}function o(){if(!e(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(d.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(O=!0,M=r(t[1]))}return O}function u(){return o()&&M}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(d.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===d.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===d.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function R(){return T()&&F}function l(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(d.userAgent);null!==t&&(P=!0,w=r(t[1])); +}return P}function A(){return e(g)||(g=/Windows/i.test(d.appVersion)),g}function f(){return l()&&w}function h(){return e(x)||(x="undefined"!=typeof PointerEvent&&(!e(d.pointerEnabled)||d.pointerEnabled)),x}function N(){if(!e(v)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;v=e(n)&&""!==n,v&&(D=n)}return v}function I(){return N()?D:void 0}var d;d="undefined"!=typeof navigator?navigator:{};var S,m,O,M,y,p,C,U,L,F,P,w,g,x,D,v,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:t(d.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:I};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return i.POSITION_ONLY=r(new i({position:!0})),i.POSITION_AND_NORMAL=r(new i({position:!0,normal:!0})),i.POSITION_NORMAL_AND_ST=r(new i({position:!0,normal:!0,st:!0})),i.POSITION_AND_ST=r(new i({position:!0,st:!0})),i.POSITION_AND_COLOR=r(new i({position:!0,color:!0})),i.ALL=r(new i({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),i.DEFAULT=i.POSITION_NORMAL_AND_ST,i.packedLength=6,i.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.tangent?1:0,n[r++]=e.bitangent?1:0,n[r++]=e.color?1:0,n},i.unpack=function(n,r,a){return r=t(r,0),e(a)||(a=new i),a.position=1===n[r++],a.normal=1===n[r++],a.st=1===n[r++],a.tangent=1===n[r++],a.bitangent=1===n[r++],a.color=1===n[r++],a},i.clone=function(t,n){if(e(t))return e(n)||(n=new i),n.position=t.position,n.normal=t.normal,n.st=t.st,n.tangent=t.tangent,n.bitangent=t.bitangent,n.color=t.color,n},i}),define("Core/BoxGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType","./VertexFormat"],function(t,e,n,r,i,a,o,u,E,s,c){"use strict";function _(t){t=i(t,i.EMPTY_OBJECT);var n=t.minimum,r=t.maximum,a=i(t.vertexFormat,c.DEFAULT);this._minimum=e.clone(n),this._maximum=e.clone(r),this._vertexFormat=a,this._workerName="createBoxGeometry"}var T=new e;_.fromDimensions=function(t){t=i(t,i.EMPTY_OBJECT);var n=t.dimensions,r=e.multiplyByScalar(n,.5,new e);return new _({minimum:e.negate(r,new e),maximum:r,vertexFormat:t.vertexFormat})},_.fromAxisAlignedBoundingBox=function(t){return new _({minimum:t.minimum,maximum:t.maximum})},_.packedLength=2*e.packedLength+c.packedLength,_.pack=function(t,n,r){return r=i(r,0),e.pack(t._minimum,n,r),e.pack(t._maximum,n,r+e.packedLength),c.pack(t._vertexFormat,n,r+2*e.packedLength),n};var R=new e,l=new e,A=new c,f={minimum:R,maximum:l,vertexFormat:A};return _.unpack=function(t,n,r){n=i(n,0);var o=e.unpack(t,n,R),u=e.unpack(t,n+e.packedLength,l),E=c.unpack(t,n+2*e.packedLength,A);return a(r)?(r._minimum=e.clone(o,r._minimum),r._maximum=e.clone(u,r._maximum),r._vertexFormat=c.clone(E,r._vertexFormat),r):new _(f)},_.createGeometry=function(n){var i=n._minimum,a=n._maximum,c=n._vertexFormat;if(!e.equals(i,a)){var _,R,l=new E;if(c.position&&(c.st||c.normal||c.tangent||c.bitangent)){if(c.position&&(R=new Float64Array(72),R[0]=i.x,R[1]=i.y,R[2]=a.z,R[3]=a.x,R[4]=i.y,R[5]=a.z,R[6]=a.x,R[7]=a.y,R[8]=a.z,R[9]=i.x,R[10]=a.y,R[11]=a.z,R[12]=i.x,R[13]=i.y,R[14]=i.z,R[15]=a.x,R[16]=i.y,R[17]=i.z,R[18]=a.x,R[19]=a.y,R[20]=i.z,R[21]=i.x,R[22]=a.y,R[23]=i.z,R[24]=a.x,R[25]=i.y,R[26]=i.z,R[27]=a.x,R[28]=a.y,R[29]=i.z,R[30]=a.x,R[31]=a.y,R[32]=a.z,R[33]=a.x,R[34]=i.y,R[35]=a.z,R[36]=i.x,R[37]=i.y,R[38]=i.z,R[39]=i.x,R[40]=a.y,R[41]=i.z,R[42]=i.x,R[43]=a.y,R[44]=a.z,R[45]=i.x,R[46]=i.y,R[47]=a.z,R[48]=i.x,R[49]=a.y,R[50]=i.z,R[51]=a.x,R[52]=a.y,R[53]=i.z,R[54]=a.x,R[55]=a.y,R[56]=a.z,R[57]=i.x,R[58]=a.y,R[59]=a.z,R[60]=i.x,R[61]=i.y,R[62]=i.z,R[63]=a.x,R[64]=i.y,R[65]=i.z,R[66]=a.x,R[67]=i.y,R[68]=a.z,R[69]=i.x,R[70]=i.y,R[71]=a.z,l.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:R})),c.normal){var A=new Float32Array(72);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,A[12]=0,A[13]=0,A[14]=-1,A[15]=0,A[16]=0,A[17]=-1,A[18]=0,A[19]=0,A[20]=-1,A[21]=0,A[22]=0,A[23]=-1,A[24]=1,A[25]=0,A[26]=0,A[27]=1,A[28]=0,A[29]=0,A[30]=1,A[31]=0,A[32]=0,A[33]=1,A[34]=0,A[35]=0,A[36]=-1,A[37]=0,A[38]=0,A[39]=-1,A[40]=0,A[41]=0,A[42]=-1,A[43]=0,A[44]=0,A[45]=-1,A[46]=0,A[47]=0,A[48]=0,A[49]=1,A[50]=0,A[51]=0,A[52]=1,A[53]=0,A[54]=0,A[55]=1,A[56]=0,A[57]=0,A[58]=1,A[59]=0,A[60]=0,A[61]=-1,A[62]=0,A[63]=0,A[64]=-1,A[65]=0,A[66]=0,A[67]=-1,A[68]=0,A[69]=0,A[70]=-1,A[71]=0,l.normal=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:A})}if(c.st){var f=new Float32Array(48);f[0]=0,f[1]=0,f[2]=1,f[3]=0,f[4]=1,f[5]=1,f[6]=0,f[7]=1,f[8]=1,f[9]=0,f[10]=0,f[11]=0,f[12]=0,f[13]=1,f[14]=1,f[15]=1,f[16]=0,f[17]=0,f[18]=1,f[19]=0,f[20]=1,f[21]=1,f[22]=0,f[23]=1,f[24]=1,f[25]=0,f[26]=0,f[27]=0,f[28]=0,f[29]=1,f[30]=1,f[31]=1,f[32]=1,f[33]=0,f[34]=0,f[35]=0,f[36]=0,f[37]=1,f[38]=1,f[39]=1,f[40]=0,f[41]=0,f[42]=1,f[43]=0,f[44]=1,f[45]=1,f[46]=0,f[47]=1,l.st=new u({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:f})}if(c.tangent){var h=new Float32Array(72);h[0]=1,h[1]=0,h[2]=0,h[3]=1,h[4]=0,h[5]=0,h[6]=1,h[7]=0,h[8]=0,h[9]=1,h[10]=0,h[11]=0,h[12]=-1,h[13]=0,h[14]=0,h[15]=-1,h[16]=0,h[17]=0,h[18]=-1,h[19]=0,h[20]=0,h[21]=-1,h[22]=0,h[23]=0,h[24]=0,h[25]=1,h[26]=0,h[27]=0,h[28]=1,h[29]=0,h[30]=0,h[31]=1,h[32]=0,h[33]=0,h[34]=1,h[35]=0,h[36]=0,h[37]=-1,h[38]=0,h[39]=0,h[40]=-1,h[41]=0,h[42]=0,h[43]=-1,h[44]=0,h[45]=0,h[46]=-1,h[47]=0,h[48]=-1,h[49]=0,h[50]=0,h[51]=-1,h[52]=0,h[53]=0,h[54]=-1,h[55]=0,h[56]=0,h[57]=-1,h[58]=0,h[59]=0,h[60]=1,h[61]=0,h[62]=0,h[63]=1,h[64]=0,h[65]=0,h[66]=1,h[67]=0,h[68]=0,h[69]=1,h[70]=0,h[71]=0,l.tangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:h})}if(c.bitangent){var N=new Float32Array(72);N[0]=0,N[1]=1,N[2]=0,N[3]=0,N[4]=1,N[5]=0,N[6]=0,N[7]=1,N[8]=0,N[9]=0,N[10]=1,N[11]=0,N[12]=0,N[13]=1,N[14]=0,N[15]=0,N[16]=1,N[17]=0,N[18]=0,N[19]=1,N[20]=0,N[21]=0,N[22]=1,N[23]=0,N[24]=0,N[25]=0,N[26]=1,N[27]=0,N[28]=0,N[29]=1,N[30]=0,N[31]=0,N[32]=1,N[33]=0,N[34]=0,N[35]=1,N[36]=0,N[37]=0,N[38]=1,N[39]=0,N[40]=0,N[41]=1,N[42]=0,N[43]=0,N[44]=1,N[45]=0,N[46]=0,N[47]=1,N[48]=0,N[49]=0,N[50]=1,N[51]=0,N[52]=0,N[53]=1,N[54]=0,N[55]=0,N[56]=1,N[57]=0,N[58]=0,N[59]=1,N[60]=0,N[61]=0,N[62]=1,N[63]=0,N[64]=0,N[65]=1,N[66]=0,N[67]=0,N[68]=1,N[69]=0,N[70]=0,N[71]=1,l.bitangent=new u({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:N})}_=new Uint16Array(36),_[0]=0,_[1]=1,_[2]=2,_[3]=0,_[4]=2,_[5]=3,_[6]=6,_[7]=5,_[8]=4,_[9]=7,_[10]=6,_[11]=4,_[12]=8,_[13]=9,_[14]=10,_[15]=8,_[16]=10,_[17]=11,_[18]=14,_[19]=13,_[20]=12,_[21]=15,_[22]=14,_[23]=12,_[24]=18,_[25]=17,_[26]=16,_[27]=19,_[28]=18,_[29]=16,_[30]=20,_[31]=21,_[32]=22,_[33]=20,_[34]=22,_[35]=23}else R=new Float64Array(24),R[0]=i.x,R[1]=i.y,R[2]=i.z,R[3]=a.x,R[4]=i.y,R[5]=i.z,R[6]=a.x,R[7]=a.y,R[8]=i.z,R[9]=i.x,R[10]=a.y,R[11]=i.z,R[12]=i.x,R[13]=i.y,R[14]=a.z,R[15]=a.x,R[16]=i.y,R[17]=a.z,R[18]=a.x,R[19]=a.y,R[20]=a.z,R[21]=i.x,R[22]=a.y,R[23]=a.z,l.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:R}),_=new Uint16Array(36),_[0]=4,_[1]=5,_[2]=6,_[3]=4,_[4]=6,_[5]=7,_[6]=1,_[7]=0,_[8]=3,_[9]=1,_[10]=3,_[11]=2,_[12]=1,_[13]=6,_[14]=5,_[15]=1,_[16]=2,_[17]=6,_[18]=2,_[19]=3,_[20]=7,_[21]=2,_[22]=7,_[23]=6,_[24]=3,_[25]=0,_[26]=4,_[27]=3,_[28]=4,_[29]=7,_[30]=0,_[31]=1,_[32]=5,_[33]=0,_[34]=5,_[35]=4;var I=e.subtract(a,i,T),d=.5*e.magnitude(I);return new o({attributes:l,indices:_,primitiveType:s.TRIANGLES,boundingSphere:new t(e.ZERO,d)})}},_}),define("Workers/createBoxGeometry",["../Core/BoxGeometry","../Core/defined"],function(t,e){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createBoxOutlineGeometry.js b/engines/Cesium/Workers/createBoxOutlineGeometry.js index 73f5b1c..78b1e40 100644 --- a/engines/Cesium/Workers/createBoxOutlineGeometry.js +++ b/engines/Cesium/Workers/createBoxOutlineGeometry.js @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,s),o.normalize(t,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,E=t.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(e),T.y=s*Math.sin(e),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,t,r[s])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,t,r[s])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,t,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),S=e.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?e.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,P,F,w,B,g,D,v,x=(1-I)*e.magnitude(n)/(.5*e.magnitude(y)),z=0;do{x-=z,U=1/(1+x*M),L=1/(1+x*O),P=1/(1+x*m),F=U*U,w=L*L,B=P*P,g=F*U,D=w*L,v=B*P,p=f*F+h*w+N*B-1,C=f*g*M+h*D*O+N*v*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=T*P,s):new e(c*U,_*L,T*P)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),T=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(t,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,h=o(t,l,A,f,s);if(n(h)){var N=e.multiplyComponents(h,A,E);N=e.normalize(N,N);var d=e.subtract(t,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(e.dot(d,t))*e.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(c.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}}}),c.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,T=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,l=new e,A=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=e.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(E,n))*e.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new t(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,E,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,t,r,i,a,o,u,E,s){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[E.getElementIndex(A[n],l[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(e[E.getElementIndex(T,_)])>n){var R,f=e[E.getElementIndex(T,T)],h=e[E.getElementIndex(_,_)],N=e[E.getElementIndex(T,_)],d=(f-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return t=E.clone(E.IDENTITY,t),t[E.getElementIndex(_,_)]=t[E.getElementIndex(T,T)]=s,t[E.getElementIndex(T,_)]=c,t[E.getElementIndex(_,T)]=-c,t}E.packedLength=9,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},E.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new E(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},E.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},E.fromColumnMajorArray=function(e,t){return E.clone(e,t)},E.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new E(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},E.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,T=e.z*e.w,R=e.w*e.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(t)?(t[0]=l,t[1]=h,t[2]=I,t[3]=A,t[4]=N,t[5]=S,t[6]=f,t[7]=d,t[8]=M,t):new E(l,A,f,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),s=Math.sin(e.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-o*a+a*o*u,f=-o,h=s*n,N=a*n;return r(t)?(t[0]=c,t[1]=R,t[2]=f,t[3]=_,t[4]=l,t[5]=h,t[6]=T,t[7]=A,t[8]=N,t):new E(c,_,T,R,l,A,f,h,N)},E.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new E(e.x,0,0,0,e.y,0,0,0,e.z)},E.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new E(e,0,0,0,e,0,0,0,e)},E.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new E(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},E.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},E.getElementIndex=function(e,t){return 3*e+t},E.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(e,t,n,r){r=E.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(e,t,n,r){return r=E.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var T=new e;E.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],T)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],T)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],T)),n};var R=new e;E.getMaximumScale=function(t){return E.getScale(t,R),e.maximumComponent(R)},E.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},E.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},E.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},E.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},E.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},E.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var T=t.unitary=E.clone(E.IDENTITY,t.unitary),R=t.diagonal=E.clone(e,t.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return t},E.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},E.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],s=e[6],c=e[7],_=e[8],T=E.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=s*u-a*_,t[4]=n*_-s*i,t[5]=a*i-n*u,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(t,R,t)},E.equals=function(e,t){return e===t||r(e)&&r(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]},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,s);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E,s){ -"use strict";function c(e,t,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}c.packedLength=16,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},c.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new c),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},c.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,s=t.x*t.y,_=t.x*t.z,T=t.x*t.w,R=t.y*t.y,l=t.y*t.z,A=t.y*t.w,f=t.z*t.z,h=t.z*t.w,N=t.w*t.w,d=E-R-f+N,I=2*(s-h),S=2*(_+A),M=2*(s+h),O=-E+R-f+N,m=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(E.IDENTITY,e,t)},c.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,T=new e,R=new e;c.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,T),T),e.normalize(e.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=l*I+A*S+f*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,d,m,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),E=1/(r-n),s=1/(a-i),c=-(t+e)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),E=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),E=(t+e)/(t-e),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),E=r(e.height,0);t=r(t,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-t),T=s,R=c,l=_,A=a+s,f=o+c,h=t+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},c.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var l=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],l)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],l)),n};var A=new e;c.getMaximumScale=function(t){return c.getScale(t,A),e.maximumComponent(A)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=e[9],R=e[10],l=e[11],A=e[12],f=e[13],h=e[14],N=e[15],d=t[0],I=t[1],S=t[2],M=t[3],O=t[4],m=t[5],y=t[6],p=t[7],C=t[8],U=t[9],L=t[10],P=t[11],F=t[12],w=t[13],B=t[14],g=t[15],D=r*d+u*I+_*S+A*M,v=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,q=r*C+u*U+_*L+A*P,H=i*C+E*U+T*L+f*P,W=a*C+s*U+R*L+h*P,Y=o*C+c*U+l*L+N*P,K=r*F+u*w+_*B+A*g,k=i*F+E*w+T*B+f*g,Z=a*F+s*w+R*B+h*g,j=o*F+c*w+l*B+N*g;return n[0]=D,n[1]=v,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=e[12],R=e[13],l=e[14],A=t[0],f=t[1],h=t[2],N=t[4],d=t[5],I=t[6],S=t[8],M=t[9],O=t[10],m=t[12],y=t[13],p=t[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,L=a*A+E*f+_*h,P=r*N+o*d+s*I,F=i*N+u*d+c*I,w=a*N+E*d+_*I,B=r*S+o*M+s*O,g=i*S+u*M+c*O,D=a*S+E*M+_*O,v=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=P,n[5]=F,n[6]=w,n[7]=0,n[8]=B,n[9]=g,n[10]=D,n[11]=0,n[12]=v,n[13]=x,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=t[0],R=t[1],l=t[2],A=t[3],f=t[4],h=t[5],N=t[6],d=t[7],I=t[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],E=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=E,n[15]=e[15],n};var f=new e;c.multiplyByUniformScale=function(e,t,n){return f.x=t,f.y=t,f.z=t,c.multiplyByScale(e,f,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,E=e[1]*r+e[5]*i+e[9]*a+e[13]*o,s=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,E=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],E=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var h=new E,N=new E,d=new t,I=new t(0,0,0,1);return c.inverse=function(e,n){if(E.equalsEpsilon(c.getRotation(e,h),N,u.EPSILON7)&&t.equals(c.getRow(e,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],T=e[5],R=e[9],l=e[13],A=e[2],f=e[6],S=e[10],M=e[14],O=e[3],m=e[7],y=e[11],p=e[15],C=S*p,U=M*y,L=f*p,P=M*m,F=f*y,w=S*m,B=A*p,g=M*O,D=A*y,v=S*O,x=A*m,z=f*O,G=C*T+P*R+F*l-(U*T+L*R+w*l),b=U*_+B*R+v*l-(C*_+g*R+D*l),X=L*_+g*T+x*l-(P*_+B*T+z*l),V=w*_+D*T+z*R-(F*_+v*T+x*R),q=U*i+L*a+w*o-(C*i+P*a+F*o),H=C*r+g*a+D*o-(U*r+B*a+v*o),W=P*r+B*i+z*o-(L*r+g*i+x*o),Y=F*r+v*i+x*a-(w*r+D*i+z*a);C=a*l,U=o*R,L=i*l,P=o*T,F=i*R,w=a*T,B=r*l,g=o*_,D=r*R,v=a*_,x=r*T,z=i*_;var K=C*m+P*y+F*p-(U*m+L*y+w*p),k=U*O+B*y+v*p-(C*O+g*y+D*p),Z=L*O+g*m+x*p-(P*O+B*m+z*p),j=w*O+D*m+z*y-(F*O+v*m+x*y),Q=L*S+w*M+U*f-(F*M+C*f+P*S),J=D*M+C*A+g*S-(B*S+v*M+U*A),$=B*f+z*M+P*A-(x*M+L*A+g*f),ee=x*S+F*A+v*f-(D*f+z*S+w*A),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=q*te,n[5]=H*te,n[6]=W*te,n[7]=Y*te,n[8]=K*te,n[9]=k*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],E=e[8],s=e[9],c=e[10],_=e[12],T=e[13],R=e[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return t[0]=n,t[1]=a,t[2]=E,t[3]=0,t[4]=r,t[5]=o,t[6]=s,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=l,t[13]=A,t[14]=f,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},E.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,t,i,a,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new E(e,t,i,a)},E.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new E(e,t,i,a)},E.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=e.length;_<T;_++){var R=e[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=s,t.east=i,t.north=c,t):new E(n,s,i,c)},E.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=e.length;T<R;T++){var l=t.cartesianToCartographic(e[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},E.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},E.validate=function(e){},E.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},E.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},E.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},E.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},E.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new e(o,E)},E.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var T=Math.max(e.south,t.south),R=Math.min(e.north,t.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(e,t,n){r(n)||(n=new E);var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},E.expand=function(e,t,n){return r(n)||(n=new E),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},E.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var s=new e;return E.subsample=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=e.north,T=e.south,R=e.east,l=e.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=t.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(e,A)&&(o[c]=t.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=t.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function T(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var R=new e,l=new e,A=new e,f=new e,h=new e,N=new e,d=new e,I=new e,S=new e,M=new e,O=new e,m=new e;T.fromPoints=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],d),a=e.clone(r,R),o=e.clone(r,l),u=e.clone(r,A),E=e.clone(r,f),s=e.clone(r,h),c=e.clone(r,N),_=t.length,y=1;y<_;y++){e.clone(t[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&e.clone(r,a),p>E.x&&e.clone(r,E),C<o.y&&e.clone(r,o),C>s.y&&e.clone(r,s),U<u.z&&e.clone(r,u),U>c.z&&e.clone(r,c)}var L=e.magnitudeSquared(e.subtract(E,a,I)),P=e.magnitudeSquared(e.subtract(s,o,I)),F=e.magnitudeSquared(e.subtract(c,u,I)),w=a,B=E,g=L;P>g&&(g=P,w=o,B=s),F>g&&(g=F,w=u,B=c);var D=S;D.x=.5*(w.x+B.x),D.y=.5*(w.y+B.y),D.z=.5*(w.z+B.z);var v=e.magnitudeSquared(e.subtract(B,D,I)),x=Math.sqrt(v),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){e.clone(t[y],r);var V=e.magnitude(e.subtract(r,b,I));V>X&&(X=V);var q=e.magnitudeSquared(e.subtract(r,D,I));if(q>v){var H=Math.sqrt(q);x=.5*(x+H),v=x*x;var W=H-x;D.x=(x*D.x+W*r.x)/H,D.y=(x*D.y+W*r.y)/H,D.z=(x*D.z+W*r.z)/H}}return x<X?(e.clone(D,n.center),n.radius=x):(e.clone(b,n.center),n.radius=X),n};var y=new o,p=new e,C=new e,U=new t,L=new t;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new T),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(t,U),U.height=a,_.northeast(t,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var P=[];T.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,P)),T.fromPoints(u,o)},T.fromVertices=function(t,n,a,o){if(i(o)||(o=new T),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=d;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var E=e.clone(u,R),s=e.clone(u,l),c=e.clone(u,A),_=e.clone(u,f),y=e.clone(u,h),p=e.clone(u,N),C=t.length,U=0;U<C;U+=a){var L=t[U]+n.x,P=t[U+1]+n.y,F=t[U+2]+n.z;u.x=L,u.y=P,u.z=F,L<E.x&&e.clone(u,E),L>_.x&&e.clone(u,_),P<s.y&&e.clone(u,s),P>y.y&&e.clone(u,y),F<c.z&&e.clone(u,c),F>p.z&&e.clone(u,p)}var w=e.magnitudeSquared(e.subtract(_,E,I)),B=e.magnitudeSquared(e.subtract(y,s,I)),g=e.magnitudeSquared(e.subtract(p,c,I)),D=E,v=_,x=w;B>x&&(x=B,D=s,v=y),g>x&&(x=g,D=c,v=p);var z=S;z.x=.5*(D.x+v.x),z.y=.5*(D.y+v.y),z.z=.5*(D.z+v.z);var G=e.magnitudeSquared(e.subtract(v,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=e.multiplyByScalar(e.add(X,V,I),.5,m),H=0;for(U=0;U<C;U+=a){u.x=t[U]+n.x,u.y=t[U+1]+n.y,u.z=t[U+2]+n.z;var W=e.magnitude(e.subtract(u,q,I));W>H&&(H=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var k=K-b;z.x=(b*z.x+k*u.x)/K,z.y=(b*z.y+k*u.y)/K,z.z=(b*z.z+k*u.z)/K}}return b<H?(e.clone(z,o.center),o.radius=b):(e.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new T),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=d;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,R),u=e.clone(a,l),E=e.clone(a,A),s=e.clone(a,f),c=e.clone(a,h),_=e.clone(a,N),y=t.length,p=0;p<y;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],L=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&e.clone(a,o),C>s.x&&e.clone(a,s),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),L<E.z&&e.clone(a,E),L>_.z&&e.clone(a,_)}var P=e.magnitudeSquared(e.subtract(s,o,I)),F=e.magnitudeSquared(e.subtract(c,u,I)),w=e.magnitudeSquared(e.subtract(_,E,I)),B=o,g=s,D=P;F>D&&(D=F,B=u,g=c),w>D&&(D=w,B=E,g=_);var v=S;v.x=.5*(B.x+g.x),v.y=.5*(B.y+g.y),v.z=.5*(B.z+g.z);var x=e.magnitudeSquared(e.subtract(g,v,I)),z=Math.sqrt(x),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var q=e.magnitude(e.subtract(a,X,I));q>V&&(V=q);var H=e.magnitudeSquared(e.subtract(a,v,I));if(H>x){var W=Math.sqrt(H);z=.5*(z+W),x=z*z;var Y=W-z;v.x=(z*v.x+Y*a.x)/W,v.y=(z*v.y+Y*a.y)/W,v.z=(z*v.z+Y*a.z)/W}}return z<V?(e.clone(v,r.center),r.radius=z):(e.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(t,n,r){i(r)||(r=new T);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},T.fromEllipsoid=function(t,n){return i(n)||(n=new T),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var F=new e;T.fromBoundingSpheres=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return T.clone(t[0],n);if(2===r)return T.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var w=new e,B=new e,g=new e;T.fromOrientedBoundingBox=function(t,n){i(n)||(n=new T);var r=t.halfAxes,a=s.getColumn(r,0,w),o=s.getColumn(r,1,B),u=s.getColumn(r,2,g),E=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius)},T.packedLength=4,T.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},T.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new T);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var D=new e,v=new e;T.union=function(t,n,r){i(r)||(r=new T);var a=t.center,o=t.radius,u=n.center,E=n.radius,s=e.subtract(u,a,D),c=e.magnitude(s);if(o>=c+E)return t.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=e.multiplyByScalar(s,(-o+_)/c,v);return e.add(R,a,R),e.clone(R,r.center),r.radius=_,r};var x=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},T.transformWithoutScale=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;T.computePlaneDistances=function(t,n,r,a){i(a)||(a=new E);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,q=new e,H=new e,W=new t,Y=new Array(8),K=0;K<8;++K)Y[K]=new e;var k=new o;return T.projectTo2D=function(t,n,i){n=r(n,k);var a=n.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,b),s=e.cross(e.UNIT_Z,E,X);e.normalize(s,s);var c=e.cross(E,s,V);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,H),R=e.negate(s,q),l=Y,A=l[0];e.add(E,c,A),e.add(A,s,A),A=l[1],e.add(E,c,A),e.add(A,R,A),A=l[2],e.add(E,_,A),e.add(A,R,A),A=l[3],e.add(E,_,A),e.add(A,s,A),e.negate(E,E),A=l[4],e.add(E,c,A),e.add(A,s,A),A=l[5],e.add(E,c,A),e.add(A,R,A),A=l[6],e.add(E,_,A),e.add(A,R,A),A=l[7],e.add(E,_,A),e.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];e.add(o,N,N);var d=a.cartesianToCartographic(N,W);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!T())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(O=!0,m=r(e[1]))}return O}function u(){return o()&&m}function E(){if(!t(y)){y=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(y=!0,p=r(e[1]),p.isNightly=!!e[2])}return y}function s(){return E()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function T(){if(!t(L)){L=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(L=!0,P=r(e[1]))}return L}function R(){return T()&&P}function l(){if(!t(F)){F=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent); -null!==e&&(F=!0,w=r(e[1]))}return F}function A(){return t(B)||(B=/Windows/i.test(I.appVersion)),B}function f(){return l()&&w}function h(){return t(g)||(g="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),g}function N(){if(!t(v)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;v=t(n)&&""!==n,v&&(D=n)}return v}function d(){return N()?D:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,P,F,w,B,g,D,v,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E,s){"use strict";function c(e){e=r(e,r.EMPTY_OBJECT);var n=e.minimum,i=e.maximum;this._min=t.clone(n),this._max=t.clone(i),this._workerName="createBoxOutlineGeometry"}var _=new t;c.fromDimensions=function(e){e=r(e,r.EMPTY_OBJECT);var n=e.dimensions,i=t.multiplyByScalar(n,.5,new t);return new c({minimum:t.negate(i,new t),maximum:i})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,n,i){return i=r(i,0),t.pack(e._min,n,i),t.pack(e._max,n,i+t.packedLength),n};var T=new t,R=new t,l={minimum:T,maximum:R};return c.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,T),u=t.unpack(e,n+t.packedLength,R);return i(a)?(a._min=t.clone(o,a._min),a._max=t.clone(u,a._max),a):new c(l)},c.createGeometry=function(r){var i=r._min,a=r._max;if(!t.equals(i,a)){var c=new E,T=new Uint16Array(24),R=new Float64Array(24);R[0]=i.x,R[1]=i.y,R[2]=i.z,R[3]=a.x,R[4]=i.y,R[5]=i.z,R[6]=a.x,R[7]=a.y,R[8]=i.z,R[9]=i.x,R[10]=a.y,R[11]=i.z,R[12]=i.x,R[13]=i.y,R[14]=a.z,R[15]=a.x,R[16]=i.y,R[17]=a.z,R[18]=a.x,R[19]=a.y,R[20]=a.z,R[21]=i.x,R[22]=a.y,R[23]=a.z,c.position=new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:R}),T[0]=4,T[1]=5,T[2]=5,T[3]=6,T[4]=6,T[5]=7,T[6]=7,T[7]=4,T[8]=0,T[9]=1,T[10]=1,T[11]=2,T[12]=2,T[13]=3,T[14]=3,T[15]=0,T[16]=0,T[17]=4,T[18]=1,T[19]=5,T[20]=2,T[21]=6,T[22]=3,T[23]=7;var l=t.subtract(a,i,_),A=.5*t.magnitude(l);return new o({attributes:c,indices:T,primitiveType:s.LINES,boundingSphere:new e(t.ZERO,A)})}},c}),define("Workers/createBoxOutlineGeometry",["../Core/BoxOutlineGeometry","../Core/defined"],function(e,t){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,s),o.normalize(t,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,E=t.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(e),T.y=s*Math.sin(e),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,t,r[s])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,t,r[s])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,t,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),S=e.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?e.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,P,F,w,B,g,D,v,x=(1-I)*e.magnitude(n)/(.5*e.magnitude(y)),z=0;do{x-=z,U=1/(1+x*M),L=1/(1+x*O),P=1/(1+x*m),F=U*U,w=L*L,B=P*P,g=F*U,D=w*L,v=B*P,p=f*F+h*w+N*B-1,C=f*g*M+h*D*O+N*v*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=T*P,s):new e(c*U,_*L,T*P)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,i,a){return i=n(i,0),r(a)?(a.longitude=e,a.latitude=t,a.height=i,a):new u(e,t,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),T=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(t,n,i){var l=r(n)?n.oneOverRadii:_,A=r(n)?n.oneOverRadiiSquared:T,f=r(n)?n._centerToleranceSquared:R,h=o(t,l,A,f,s);if(r(h)){var N=e.multiplyComponents(h,A,E);N=e.normalize(N,N);var d=e.subtract(t,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(e.dot(d,t))*e.magnitude(d);return r(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(c.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}}}),c.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,T=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,l=new e,A=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=e.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(E,n))*e.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new t(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,E,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,t,r,i,a,o,u,E,s){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[E.getElementIndex(A[n],l[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(e[E.getElementIndex(T,_)])>n){var R,f=e[E.getElementIndex(T,T)],h=e[E.getElementIndex(_,_)],N=e[E.getElementIndex(T,_)],d=(f-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return t=E.clone(E.IDENTITY,t),t[E.getElementIndex(_,_)]=t[E.getElementIndex(T,T)]=s,t[E.getElementIndex(T,_)]=c,t[E.getElementIndex(_,T)]=-c,t}E.packedLength=9,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},E.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new E(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},E.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},E.fromColumnMajorArray=function(e,t){return E.clone(e,t)},E.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new E(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},E.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,T=e.z*e.w,R=e.w*e.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(t)?(t[0]=l,t[1]=h,t[2]=I,t[3]=A,t[4]=N,t[5]=S,t[6]=f,t[7]=d,t[8]=M,t):new E(l,A,f,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),s=Math.sin(e.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-s*i+a*o*u,f=-o,h=s*n,N=a*n;return r(t)?(t[0]=c,t[1]=R,t[2]=f,t[3]=_,t[4]=l,t[5]=h,t[6]=T,t[7]=A,t[8]=N,t):new E(c,_,T,R,l,A,f,h,N)},E.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new E(e.x,0,0,0,e.y,0,0,0,e.z)},E.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new E(e,0,0,0,e,0,0,0,e)},E.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new E(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},E.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},E.getElementIndex=function(e,t){return 3*e+t},E.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(e,t,n,r){r=E.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(e,t,n,r){return r=E.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var T=new e;E.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],T)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],T)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],T)),n};var R=new e;E.getMaximumScale=function(t){return E.getScale(t,R),e.maximumComponent(R)},E.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},E.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},E.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},E.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},E.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},E.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var T=t.unitary=E.clone(E.IDENTITY,t.unitary),R=t.diagonal=E.clone(e,t.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return t},E.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},E.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],s=e[6],c=e[7],_=e[8],T=E.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=s*u-a*_,t[4]=n*_-s*i,t[5]=a*i-n*u,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(t,R,t)},E.equals=function(e,t){return e===t||r(e)&&r(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]},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,s);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E,s){ +"use strict";function c(e,t,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}c.packedLength=16,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},c.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new c),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},c.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,s=t.x*t.y,_=t.x*t.z,T=t.x*t.w,R=t.y*t.y,l=t.y*t.z,A=t.y*t.w,f=t.z*t.z,h=t.z*t.w,N=t.w*t.w,d=E-R-f+N,I=2*(s-h),S=2*(_+A),M=2*(s+h),O=-E+R-f+N,m=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(E.IDENTITY,e,t)},c.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,T=new e,R=new e;c.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,T),T),e.normalize(e.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=l*I+A*S+f*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,d,m,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),E=1/(r-n),s=1/(a-i),c=-(t+e)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),E=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),E=(t+e)/(t-e),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),E=r(e.height,0);t=r(t,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-t),T=s,R=c,l=_,A=a+s,f=o+c,h=t+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},c.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var l=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],l)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],l)),n};var A=new e;c.getMaximumScale=function(t){return c.getScale(t,A),e.maximumComponent(A)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=e[9],R=e[10],l=e[11],A=e[12],f=e[13],h=e[14],N=e[15],d=t[0],I=t[1],S=t[2],M=t[3],O=t[4],m=t[5],y=t[6],p=t[7],C=t[8],U=t[9],L=t[10],P=t[11],F=t[12],w=t[13],B=t[14],g=t[15],D=r*d+u*I+_*S+A*M,v=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,q=r*C+u*U+_*L+A*P,H=i*C+E*U+T*L+f*P,W=a*C+s*U+R*L+h*P,Y=o*C+c*U+l*L+N*P,K=r*F+u*w+_*B+A*g,k=i*F+E*w+T*B+f*g,Z=a*F+s*w+R*B+h*g,j=o*F+c*w+l*B+N*g;return n[0]=D,n[1]=v,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=e[12],R=e[13],l=e[14],A=t[0],f=t[1],h=t[2],N=t[4],d=t[5],I=t[6],S=t[8],M=t[9],O=t[10],m=t[12],y=t[13],p=t[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,L=a*A+E*f+_*h,P=r*N+o*d+s*I,F=i*N+u*d+c*I,w=a*N+E*d+_*I,B=r*S+o*M+s*O,g=i*S+u*M+c*O,D=a*S+E*M+_*O,v=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=P,n[5]=F,n[6]=w,n[7]=0,n[8]=B,n[9]=g,n[10]=D,n[11]=0,n[12]=v,n[13]=x,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=t[0],R=t[1],l=t[2],A=t[3],f=t[4],h=t[5],N=t[6],d=t[7],I=t[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],E=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=E,n[15]=e[15],n};var f=new e;c.multiplyByUniformScale=function(e,t,n){return f.x=t,f.y=t,f.z=t,c.multiplyByScale(e,f,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,E=e[1]*r+e[5]*i+e[9]*a+e[13]*o,s=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,E=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],E=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var h=new E,N=new E,d=new t,I=new t(0,0,0,1);return c.inverse=function(e,n){if(E.equalsEpsilon(c.getRotation(e,h),N,u.EPSILON7)&&t.equals(c.getRow(e,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],T=e[5],R=e[9],l=e[13],A=e[2],f=e[6],S=e[10],M=e[14],O=e[3],m=e[7],y=e[11],p=e[15],C=S*p,U=M*y,L=f*p,P=M*m,F=f*y,w=S*m,B=A*p,g=M*O,D=A*y,v=S*O,x=A*m,z=f*O,G=C*T+P*R+F*l-(U*T+L*R+w*l),b=U*_+B*R+v*l-(C*_+g*R+D*l),X=L*_+g*T+x*l-(P*_+B*T+z*l),V=w*_+D*T+z*R-(F*_+v*T+x*R),q=U*i+L*a+w*o-(C*i+P*a+F*o),H=C*r+g*a+D*o-(U*r+B*a+v*o),W=P*r+B*i+z*o-(L*r+g*i+x*o),Y=F*r+v*i+x*a-(w*r+D*i+z*a);C=a*l,U=o*R,L=i*l,P=o*T,F=i*R,w=a*T,B=r*l,g=o*_,D=r*R,v=a*_,x=r*T,z=i*_;var K=C*m+P*y+F*p-(U*m+L*y+w*p),k=U*O+B*y+v*p-(C*O+g*y+D*p),Z=L*O+g*m+x*p-(P*O+B*m+z*p),j=w*O+D*m+z*y-(F*O+v*m+x*y),Q=L*S+w*M+U*f-(F*M+C*f+P*S),J=D*M+C*A+g*S-(B*S+v*M+U*A),$=B*f+z*M+P*A-(x*M+L*A+g*f),ee=x*S+F*A+v*f-(D*f+z*S+w*A),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=q*te,n[5]=H*te,n[6]=W*te,n[7]=Y*te,n[8]=K*te,n[9]=k*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],E=e[8],s=e[9],c=e[10],_=e[12],T=e[13],R=e[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return t[0]=n,t[1]=a,t[2]=E,t[3]=0,t[4]=r,t[5]=o,t[6]=s,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=l,t[13]=A,t[14]=f,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},E.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,t,i,a,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new E(e,t,i,a)},E.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new E(e,t,i,a)},E.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=e.length;_<T;_++){var R=e[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=s,t.east=i,t.north=c,t):new E(n,s,i,c)},E.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=e.length;T<R;T++){var l=t.cartesianToCartographic(e[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},E.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},E.validate=function(e){},E.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},E.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},E.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},E.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},E.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new e(o,E)},E.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var T=Math.max(e.south,t.south),R=Math.min(e.north,t.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(e,t,n){r(n)||(n=new E);var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},E.expand=function(e,t,n){return r(n)||(n=new E),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},E.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var s=new e;return E.subsample=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=e.north,T=e.south,R=e.east,l=e.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=t.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(e,A)&&(o[c]=t.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=t.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function T(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var R=new e,l=new e,A=new e,f=new e,h=new e,N=new e,d=new e,I=new e,S=new e,M=new e,O=new e,m=new e;T.fromPoints=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],d),a=e.clone(r,R),o=e.clone(r,l),u=e.clone(r,A),E=e.clone(r,f),s=e.clone(r,h),c=e.clone(r,N),_=t.length,y=1;y<_;y++){e.clone(t[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&e.clone(r,a),p>E.x&&e.clone(r,E),C<o.y&&e.clone(r,o),C>s.y&&e.clone(r,s),U<u.z&&e.clone(r,u),U>c.z&&e.clone(r,c)}var L=e.magnitudeSquared(e.subtract(E,a,I)),P=e.magnitudeSquared(e.subtract(s,o,I)),F=e.magnitudeSquared(e.subtract(c,u,I)),w=a,B=E,g=L;P>g&&(g=P,w=o,B=s),F>g&&(g=F,w=u,B=c);var D=S;D.x=.5*(w.x+B.x),D.y=.5*(w.y+B.y),D.z=.5*(w.z+B.z);var v=e.magnitudeSquared(e.subtract(B,D,I)),x=Math.sqrt(v),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){e.clone(t[y],r);var V=e.magnitude(e.subtract(r,b,I));V>X&&(X=V);var q=e.magnitudeSquared(e.subtract(r,D,I));if(q>v){var H=Math.sqrt(q);x=.5*(x+H),v=x*x;var W=H-x;D.x=(x*D.x+W*r.x)/H,D.y=(x*D.y+W*r.y)/H,D.z=(x*D.z+W*r.z)/H}}return x<X?(e.clone(D,n.center),n.radius=x):(e.clone(b,n.center),n.radius=X),n};var y=new o,p=new e,C=new e,U=new t,L=new t;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new T),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(t,U),U.height=a,_.northeast(t,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var P=[];T.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,P)),T.fromPoints(u,o)},T.fromVertices=function(t,n,a,o){if(i(o)||(o=new T),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=d;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var E=e.clone(u,R),s=e.clone(u,l),c=e.clone(u,A),_=e.clone(u,f),y=e.clone(u,h),p=e.clone(u,N),C=t.length,U=0;U<C;U+=a){var L=t[U]+n.x,P=t[U+1]+n.y,F=t[U+2]+n.z;u.x=L,u.y=P,u.z=F,L<E.x&&e.clone(u,E),L>_.x&&e.clone(u,_),P<s.y&&e.clone(u,s),P>y.y&&e.clone(u,y),F<c.z&&e.clone(u,c),F>p.z&&e.clone(u,p)}var w=e.magnitudeSquared(e.subtract(_,E,I)),B=e.magnitudeSquared(e.subtract(y,s,I)),g=e.magnitudeSquared(e.subtract(p,c,I)),D=E,v=_,x=w;B>x&&(x=B,D=s,v=y),g>x&&(x=g,D=c,v=p);var z=S;z.x=.5*(D.x+v.x),z.y=.5*(D.y+v.y),z.z=.5*(D.z+v.z);var G=e.magnitudeSquared(e.subtract(v,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=e.multiplyByScalar(e.add(X,V,I),.5,m),H=0;for(U=0;U<C;U+=a){u.x=t[U]+n.x,u.y=t[U+1]+n.y,u.z=t[U+2]+n.z;var W=e.magnitude(e.subtract(u,q,I));W>H&&(H=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var k=K-b;z.x=(b*z.x+k*u.x)/K,z.y=(b*z.y+k*u.y)/K,z.z=(b*z.z+k*u.z)/K}}return b<H?(e.clone(z,o.center),o.radius=b):(e.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new T),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=d;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,R),u=e.clone(a,l),E=e.clone(a,A),s=e.clone(a,f),c=e.clone(a,h),_=e.clone(a,N),y=t.length,p=0;p<y;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],L=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&e.clone(a,o),C>s.x&&e.clone(a,s),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),L<E.z&&e.clone(a,E),L>_.z&&e.clone(a,_)}var P=e.magnitudeSquared(e.subtract(s,o,I)),F=e.magnitudeSquared(e.subtract(c,u,I)),w=e.magnitudeSquared(e.subtract(_,E,I)),B=o,g=s,D=P;F>D&&(D=F,B=u,g=c),w>D&&(D=w,B=E,g=_);var v=S;v.x=.5*(B.x+g.x),v.y=.5*(B.y+g.y),v.z=.5*(B.z+g.z);var x=e.magnitudeSquared(e.subtract(g,v,I)),z=Math.sqrt(x),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var q=e.magnitude(e.subtract(a,X,I));q>V&&(V=q);var H=e.magnitudeSquared(e.subtract(a,v,I));if(H>x){var W=Math.sqrt(H);z=.5*(z+W),x=z*z;var Y=W-z;v.x=(z*v.x+Y*a.x)/W,v.y=(z*v.y+Y*a.y)/W,v.z=(z*v.z+Y*a.z)/W}}return z<V?(e.clone(v,r.center),r.radius=z):(e.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(t,n,r){i(r)||(r=new T);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},T.fromEllipsoid=function(t,n){return i(n)||(n=new T),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var F=new e;T.fromBoundingSpheres=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return T.clone(t[0],n);if(2===r)return T.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var w=new e,B=new e,g=new e;T.fromOrientedBoundingBox=function(t,n){i(n)||(n=new T);var r=t.halfAxes,a=s.getColumn(r,0,w),o=s.getColumn(r,1,B),u=s.getColumn(r,2,g);return e.add(a,o,a),e.add(a,u,a),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(a),n},T.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius)},T.packedLength=4,T.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},T.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new T);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var D=new e,v=new e;T.union=function(t,n,r){i(r)||(r=new T);var a=t.center,o=t.radius,u=n.center,E=n.radius,s=e.subtract(u,a,D),c=e.magnitude(s);if(o>=c+E)return t.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=e.multiplyByScalar(s,(-o+_)/c,v);return e.add(R,a,R),e.clone(R,r.center),r.radius=_,r};var x=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},T.transformWithoutScale=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;T.computePlaneDistances=function(t,n,r,a){i(a)||(a=new E);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,q=new e,H=new e,W=new t,Y=new Array(8),K=0;K<8;++K)Y[K]=new e;var k=new o;return T.projectTo2D=function(t,n,i){n=r(n,k);var a=n.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,b),s=e.cross(e.UNIT_Z,E,X);e.normalize(s,s);var c=e.cross(E,s,V);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,H),R=e.negate(s,q),l=Y,A=l[0];e.add(E,c,A),e.add(A,s,A),A=l[1],e.add(E,c,A),e.add(A,R,A),A=l[2],e.add(E,_,A),e.add(A,R,A),A=l[3],e.add(E,_,A),e.add(A,s,A),e.negate(E,E),A=l[4],e.add(E,c,A),e.add(A,s,A),A=l[5],e.add(E,c,A),e.add(A,R,A),A=l[6],e.add(E,_,A),e.add(A,R,A),A=l[7],e.add(E,_,A),e.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];e.add(o,N,N);var d=a.cartesianToCartographic(N,W);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!T())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(O=!0,m=r(e[1]))}return O}function u(){return o()&&m}function E(){if(!t(y)){y=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(y=!0,p=r(e[1]),p.isNightly=!!e[2])}return y}function s(){return E()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function T(){if(!t(L)){L=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(L=!0,P=r(e[1]))}return L}function R(){return T()&&P}function l(){if(!t(F)){F=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(F=!0,w=r(e[1])); +}return F}function A(){return t(B)||(B=/Windows/i.test(I.appVersion)),B}function f(){return l()&&w}function h(){return t(g)||(g="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),g}function N(){if(!t(v)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;v=t(n)&&""!==n,v&&(D=n)}return v}function d(){return N()?D:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,P,F,w,B,g,D,v,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/BoxOutlineGeometry",["./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E,s){"use strict";function c(e){e=i(e,i.EMPTY_OBJECT);var n=e.minimum,r=e.maximum;this._min=t.clone(n),this._max=t.clone(r),this._workerName="createBoxOutlineGeometry"}var _=new t;c.fromDimensions=function(e){e=i(e,i.EMPTY_OBJECT);var n=e.dimensions,r=t.multiplyByScalar(n,.5,new t);return new c({minimum:t.negate(r,new t),maximum:r})},c.fromAxisAlignedBoundingBox=function(e){return new c({minimum:e.minimum,maximum:e.maximum})},c.packedLength=2*t.packedLength,c.pack=function(e,n,r){return r=i(r,0),t.pack(e._min,n,r),t.pack(e._max,n,r+t.packedLength),n};var T=new t,R=new t,l={minimum:T,maximum:R};return c.unpack=function(e,n,r){n=i(n,0);var o=t.unpack(e,n,T),u=t.unpack(e,n+t.packedLength,R);return a(r)?(r._min=t.clone(o,r._min),r._max=t.clone(u,r._max),r):new c(l)},c.createGeometry=function(n){var i=n._min,a=n._max;if(!t.equals(i,a)){var c=new E,T=new Uint16Array(24),R=new Float64Array(24);R[0]=i.x,R[1]=i.y,R[2]=i.z,R[3]=a.x,R[4]=i.y,R[5]=i.z,R[6]=a.x,R[7]=a.y,R[8]=i.z,R[9]=i.x,R[10]=a.y,R[11]=i.z,R[12]=i.x,R[13]=i.y,R[14]=a.z,R[15]=a.x,R[16]=i.y,R[17]=a.z,R[18]=a.x,R[19]=a.y,R[20]=a.z,R[21]=i.x,R[22]=a.y,R[23]=a.z,c.position=new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:R}),T[0]=4,T[1]=5,T[2]=5,T[3]=6,T[4]=6,T[5]=7,T[6]=7,T[7]=4,T[8]=0,T[9]=1,T[10]=1,T[11]=2,T[12]=2,T[13]=3,T[14]=3,T[15]=0,T[16]=0,T[17]=4,T[18]=1,T[19]=5,T[20]=2,T[21]=6,T[22]=3,T[23]=7;var l=t.subtract(a,i,_),A=.5*t.magnitude(l);return new o({attributes:c,indices:T,primitiveType:s.LINES,boundingSphere:new e(t.ZERO,A)})}},c}),define("Workers/createBoxOutlineGeometry",["../Core/BoxOutlineGeometry","../Core/defined"],function(e,t){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createCircleGeometry.js b/engines/Cesium/Workers/createCircleGeometry.js index 32aaf3b..eec2624 100644 --- a/engines/Cesium/Workers/createCircleGeometry.js +++ b/engines/Cesium/Workers/createCircleGeometry.js @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var f=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,f=n*u-a*o;return r.x=c,r.y=l,r.z=f,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:E,c=Math.cos(n);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(n),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),r(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,f=r.y,d=r.z,h=a.x,E=a.y,m=a.z,p=l*l*h*h,y=f*f*E*E,_=d*d*m*m,T=p+y+_,R=Math.sqrt(1/T),v=e.multiplyByScalar(r,R,i);if(T<s)return isFinite(R)?e.clone(v,c):void 0;var A=u.x,S=u.y,N=u.z,g=o;g.x=v.x*A*2,g.y=v.y*S*2,g.z=v.z*N*2;var I,w,O,M,x,C,P,D,L,U,F,b=(1-R)*e.magnitude(r)/(.5*e.magnitude(g)),z=0;do{b-=z,O=1/(1+b*A),M=1/(1+b*S),x=1/(1+b*N),C=O*O,P=M*M,D=x*x,L=C*O,U=P*M,F=D*x,I=p*C+y*P+_*D-1,w=p*L*A+y*U*S+_*F*N;var B=-2*w;z=I/B}while(Math.abs(I)>n.EPSILON12);return t(c)?(c.x=l*O,c.y=f*M,c.z=d*x,c):new e(l*O,f*M,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,m=r(n)?n.oneOverRadiiSquared:d,p=r(n)?n._centerToleranceSquared:h,y=o(t,E,m,p,c);if(r(y)){var _=e.multiplyComponents(y,m,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),R=Math.atan2(_.y,_.x),v=Math.asin(_.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=R,a.latitude=v,a.height=A,a):new u(R,v,A)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,r){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._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,r){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,E);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(m[r],E[r])];t+=2*n*n}return Math.sqrt(t)}function f(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>n&&(a=i,n=o)}var c=1,l=0,f=E[a],d=m[a];if(Math.abs(e[s.getElementIndex(d,f)])>r){var h,p=e[s.getElementIndex(d,d)],y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(d,f)],T=(p-y)/2/_;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=r-u-f+h,m=2*(a-d),p=2*(i+l),y=2*(a+d),_=-r+u-f+h,T=2*(c-o),R=2*(i-l),v=2*(c+o),A=-r-u+f+h;return n(t)?(t[0]=E,t[1]=y,t[2]=R,t[3]=m,t[4]=_,t[5]=v,t[6]=p,t[7]=T,t[8]=A,t):new s(E,m,p,y,_,T,R,v,A)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=r*u,E=i*a+c*o*u,m=-o*i+i*o*u,p=-o,y=c*r,_=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=f,t[4]=E,t[5]=y,t[6]=d,t[7]=m,t[8]=_,t):new s(l,f,d,h,E,m,p,y,_)},s.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var d=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),r};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},s.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},s.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},s.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],p=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,i=0,o=0;n(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=r*c(h);o<a&&l(h)>E;)f(h,p),s.transpose(p,y),s.multiply(h,p,h),s.multiply(y,h,h),s.multiply(d,p,d),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-n*f,t[2]=n*u-o*a,t[3]=c*u-i*f,t[4]=r*f-c*a,t[5]=i*a-r*u,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/d;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){ -"use strict";function l(e,t,r,a,i,o,u,s,c,l,f,d,h,E,m,p){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(m,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(d,0),this[15]=n(p,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new l),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,r,i){return r=n(r,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,i):new l(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-h-p+_,R=2*(c-y),v=2*(f+m),A=2*(c+y),S=-s+h-p+_,N=2*(E-d),g=2*(f-m),I=2*(E+d),w=-s-h+p+_;return n[0]=T*i,n[1]=A*i,n[2]=g*i,n[3]=0,n[4]=R*o,n[5]=S*o,n[6]=I*o,n[7]=0,n[8]=v*u,n[9]=N*u,n[10]=w*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,r){var n=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,m=f.y,p=f.z,y=h.x,_=h.y,T=h.z,R=n.x,v=n.y,A=n.z,S=u*-R+s*-v+c*-A,N=y*-R+_*-v+T*-A,g=E*R+m*v+p*A;return a(r)?(r[0]=u,r[1]=y,r[2]=-E,r[3]=0,r[4]=s,r[5]=_,r[6]=-m,r[7]=0,r[8]=c,r[9]=T,r[10]=-p,r[11]=0,r[12]=S,r[13]=N,r[14]=g,r[15]=1,r):new l(u,s,c,S,y,_,T,N,-E,-m,-p,g,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,f=-(n+r)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),d=c,h=l,E=f,m=i+c,p=o+l,y=t+f,_=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=p,a[14]=y,a[15]=_,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var E=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),r};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],p=e[13],y=e[14],_=e[15],T=t[0],R=t[1],v=t[2],A=t[3],S=t[4],N=t[5],g=t[6],I=t[7],w=t[8],O=t[9],M=t[10],x=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=n*T+u*R+f*v+m*A,F=a*T+s*R+d*v+p*A,b=i*T+c*R+h*v+y*A,z=o*T+l*R+E*v+_*A,B=n*S+u*N+f*g+m*I,G=a*S+s*N+d*g+p*I,q=i*S+c*N+h*g+y*I,V=o*S+l*N+E*g+_*I,W=n*w+u*O+f*M+m*x,X=a*w+s*O+d*M+p*x,H=i*w+c*O+h*M+y*x,Y=o*w+l*O+E*M+_*x,k=n*C+u*P+f*D+m*L,j=a*C+s*P+d*D+p*L,Z=i*C+c*P+h*D+y*L,K=o*C+l*P+E*D+_*L;return r[0]=U,r[1]=F,r[2]=b,r[3]=z,r[4]=B,r[5]=G,r[6]=q,r[7]=V,r[8]=W,r[9]=X,r[10]=H,r[11]=Y,r[12]=k,r[13]=j,r[14]=Z,r[15]=K,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],p=t[1],y=t[2],_=t[4],T=t[5],R=t[6],v=t[8],A=t[9],S=t[10],N=t[12],g=t[13],I=t[14],w=n*m+o*p+c*y,O=a*m+u*p+l*y,M=i*m+s*p+f*y,x=n*_+o*T+c*R,C=a*_+u*T+l*R,P=i*_+s*T+f*R,D=n*v+o*A+c*S,L=a*v+u*A+l*S,U=i*v+s*A+f*S,F=n*N+o*g+c*I+d,b=a*N+u*g+l*I+h,z=i*N+s*g+f*I+E;return r[0]=w,r[1]=O,r[2]=M,r[3]=0,r[4]=x,r[5]=C,r[6]=P,r[7]=0,r[8]=D,r[9]=L,r[10]=U,r[11]=0,r[12]=F,r[13]=b,r[14]=z,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],p=t[4],y=t[5],_=t[6],T=t[7],R=t[8],v=n*d+o*h+c*E,A=a*d+u*h+l*E,S=i*d+s*h+f*E,N=n*m+o*p+c*y,g=a*m+u*p+l*y,I=i*m+s*p+f*y,w=n*_+o*T+c*R,O=a*_+u*T+l*R,M=i*_+s*T+f*R;return r[0]=v,r[1]=A,r[2]=S,r[3]=0,r[4]=N,r[5]=g,r[6]=I,r[7]=0,r[8]=w,r[9]=O,r[10]=M,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var p=new e;l.multiplyByUniformScale=function(e,t,r){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var y=new s,_=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,y),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],p=e[6],v=e[10],A=e[14],S=e[3],N=e[7],g=e[11],I=e[15],w=v*I,O=A*g,M=p*I,x=A*N,C=p*g,P=v*N,D=m*I,L=A*S,U=m*g,F=v*S,b=m*N,z=p*S,B=w*d+x*h+C*E-(O*d+M*h+P*E),G=O*f+D*h+F*E-(w*f+L*h+U*E),q=M*f+L*d+b*E-(x*f+D*d+z*E),V=P*f+U*d+z*h-(C*f+F*d+b*h),W=O*a+M*i+P*o-(w*a+x*i+C*o),X=w*n+L*i+U*o-(O*n+D*i+F*o),H=x*n+D*a+z*o-(M*n+L*a+b*o),Y=C*n+F*a+b*i-(P*n+U*a+z*i);w=i*E,O=o*h,M=a*E,x=o*d,C=a*h,P=i*d,D=n*E,L=o*f,U=n*h,F=i*f,b=n*d,z=a*f;var k=w*N+x*g+C*I-(O*N+M*g+P*I),j=O*S+D*g+F*I-(w*S+L*g+U*I),Z=M*S+L*N+b*I-(x*S+D*N+z*I),K=P*S+U*N+z*g-(C*S+F*N+b*g),J=M*v+P*A+O*p-(C*A+w*p+x*v),Q=U*A+w*m+L*v-(D*v+F*A+O*m),$=D*p+z*A+x*m-(b*A+M*m+L*p),ee=b*v+C*m+F*p-(U*p+z*v+P*m),te=n*B+a*G+i*q+o*V;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=B*te,r[1]=G*te,r[2]=q*te,r[3]=V*te,r[4]=W*te,r[5]=X*te,r[6]=H*te,r[7]=Y*te,r[8]=k*te,r[9]=j*te,r[10]=Z*te,r[11]=K*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-r*f-n*d-a*h,m=-i*f-o*d-u*h,p=-s*f-c*d-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(r(e,0)),t=u.toRadians(r(t,0)),a=u.toRadians(r(a,0)),i=u.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=f,r):new s(a,l,i,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return n(r)?(r.west=l,r.south=d,r.east=f,r.north=h,r):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0),n(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,E=new e,m=new e,p=new e,y=new e,_=new e,T=new e,R=new e,v=new e,A=new e,S=new e,N=new e;d.fromPoints=function(t,r){if(a(r)||(r=new d),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],T),i=e.clone(n,h),o=e.clone(n,E),u=e.clone(n,m),s=e.clone(n,p),c=e.clone(n,y),l=e.clone(n,_),f=t.length,g=1;g<f;g++){e.clone(t[g],n);var I=n.x,w=n.y,O=n.z;I<i.x&&e.clone(n,i),I>s.x&&e.clone(n,s),w<o.y&&e.clone(n,o),w>c.y&&e.clone(n,c),O<u.z&&e.clone(n,u),O>l.z&&e.clone(n,l)}var M=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,D=s,L=M;x>L&&(L=x,P=o,D=c),C>L&&(L=C,P=u,D=l);var U=v;U.x=.5*(P.x+D.x),U.y=.5*(P.y+D.y),U.z=.5*(P.z+D.z);var F=e.magnitudeSquared(e.subtract(D,U,R)),b=Math.sqrt(F),z=A;z.x=i.x,z.y=o.y,z.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,R),.5,N),q=0;for(g=0;g<f;g++){e.clone(t[g],n);var V=e.magnitude(e.subtract(n,G,R));V>q&&(q=V);var W=e.magnitudeSquared(e.subtract(n,U,R));if(W>F){var X=Math.sqrt(W);b=.5*(b+X),F=b*b;var H=X-b;U.x=(b*U.x+H*n.x)/X,U.y=(b*U.y+H*n.y)/X,U.z=(b*U.z+H*n.z)/X}}return b<q?(e.clone(U,r.center),r.radius=b):(e.clone(G,r.center),r.radius=q),r};var g=new o,I=new e,w=new e,O=new t,M=new t;d.fromRectangle2D=function(e,t,r){return d.fromRectangleWithHeights2D(e,t,0,0,r)},d.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,g),f.southwest(t,O),O.height=i,f.northeast(t,M),M.height=o;var s=r.project(O,I),c=r.project(M,w),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,r,o){t=n(t,i.WGS84),r=n(r,0);var u;return a(e)&&(u=f.subsample(e,t,r,x)),d.fromPoints(u,o)},d.fromVertices=function(t,r,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),i=n(i,3);var u=T;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,p),g=e.clone(u,y),I=e.clone(u,_),w=t.length,O=0;O<w;O+=i){var M=t[O]+r.x,x=t[O+1]+r.y,C=t[O+2]+r.z;u.x=M,u.y=x,u.z=C,M<s.x&&e.clone(u,s),M>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>g.y&&e.clone(u,g),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(g,c,R)),L=e.magnitudeSquared(e.subtract(I,l,R)),U=s,F=f,b=P;D>b&&(b=D,U=c,F=g),L>b&&(b=L,U=l,F=I);var z=v;z.x=.5*(U.x+F.x),z.y=.5*(U.y+F.y),z.z=.5*(U.z+F.z);var B=e.magnitudeSquared(e.subtract(F,z,R)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var V=S;V.x=f.x,V.y=g.y,V.z=I.z;var W=e.multiplyByScalar(e.add(q,V,R),.5,N),X=0;for(O=0;O<w;O+=i){u.x=t[O]+r.x,u.y=t[O+1]+r.y,u.z=t[O+2]+r.z;var H=e.magnitude(e.subtract(u,W,R));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var j=k-G;z.x=(G*z.x+j*u.x)/k,z.y=(G*z.y+j*u.y)/k,z.z=(G*z.z+j*u.z)/k}}return G<X?(e.clone(z,o.center),o.radius=G):(e.clone(W,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new d),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=T;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,y),f=e.clone(i,_),g=t.length,I=0;I<g;I+=3){var w=t[I]+r[I],O=t[I+1]+r[I+1],M=t[I+2]+r[I+2];i.x=w,i.y=O,i.z=M,w<o.x&&e.clone(i,o),w>c.x&&e.clone(i,c),O<u.y&&e.clone(i,u),O>l.y&&e.clone(i,l),M<s.z&&e.clone(i,s),M>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),D=o,L=c,U=x;C>U&&(U=C,D=u,L=l),P>U&&(U=P,D=s,L=f);var F=v;F.x=.5*(D.x+L.x),F.y=.5*(D.y+L.y),F.z=.5*(D.z+L.z);var b=e.magnitudeSquared(e.subtract(L,F,R)),z=Math.sqrt(b),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,R),.5,N),V=0;for(I=0;I<g;I+=3){i.x=t[I]+r[I],i.y=t[I+1]+r[I+1],i.z=t[I+2]+r[I+2];var W=e.magnitude(e.subtract(i,q,R));W>V&&(V=W);var X=e.magnitudeSquared(e.subtract(i,F,R));if(X>b){var H=Math.sqrt(X);z=.5*(z+H),b=z*z;var Y=H-z;F.x=(z*F.x+Y*i.x)/H,F.y=(z*F.y+Y*i.y)/H,F.z=(z*F.z+Y*i.z)/H}}return z<V?(e.clone(F,n.center),n.radius=z):(e.clone(q,n.center),n.radius=V),n},d.fromCornerPoints=function(t,r,n){a(n)||(n=new d);var i=n.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),n.radius=e.distance(i,r),n},d.fromEllipsoid=function(t,r){return a(r)||(r=new d),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var C=new e;d.fromBoundingSpheres=function(t,r){if(a(r)||(r=new d),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return d.clone(t[0],r);if(2===n)return d.union(t[0],t[1],r);for(var i=[],o=0;o<n;o++)i.push(t[o].center);r=d.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return r.radius=s,r};var P=new e,D=new e,L=new e;d.fromOrientedBoundingBox=function(t,r){a(r)||(r=new d);var n=t.halfAxes,i=c.getColumn(n,0,P),o=c.getColumn(n,1,D),u=c.getColumn(n,2,L),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,f),r},d.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},d.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new d);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var U=new e,F=new e;d.union=function(t,r,n){a(n)||(n=new d);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(h,i,h),e.clone(h,n.center),n.radius=f,n};var b=new e;d.expand=function(t,r,n){n=d.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,b));return a>n.radius&&(n.radius=a),n},d.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,r){return a(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var z=new e;d.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},d.transformWithoutScale=function(e,t,r){return a(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var B=new e;d.computePlaneDistances=function(t,r,n,i){a(i)||(i=new s);var o=e.subtract(t.center,r,B),u=e.dot(n,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,W=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,r,a){r=n(r,j);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,W),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var p=E.length,y=0;y<p;++y){var _=E[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);r.project(T,_)}a=d.fromPoints(E,a),o=a.center;var R=o.x,v=o.y,A=o.z;return o.x=A,o.y=R,o.z=v,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,r){return d.computePlaneDistances(this,e,t,r)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var a=0;a<n;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]; -}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(v)&&(v=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,A=n(e[1]))}return v}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=n(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(g=!0,I=n(e[1]),I.isNightly=!!e[2])}return g}function c(){return s()&&I}function l(){if(!t(w)){w=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(w=!0,O=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(w=!0,O=n(e[1])))}return w}function f(){return l()&&O}function d(){if(!t(M)){M=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(M=!0,x=n(e[1]))}return M}function h(){return d()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=n(e[1]))}return C}function m(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function p(){return E()&&P}function y(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),L}function _(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(U=r)}return F}function T(){return _()?U:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var v,A,S,N,g,I,w,O,M,x,C,P,D,L,U,F,b={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return b.supportsFullscreen=function(){return r.supportsFullscreen()},b.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},b.supportsWebWorkers=function(){return"undefined"!=typeof Worker},b}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(a[r])||(a[r]=!0,console.warn(e(n,r)))}var a={};return n.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.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(t,r,n){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(n,0)}return a.fromQuaternion=function(e,r){t(r)||(r=new a);var n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(s,u),r.roll=Math.atan2(o,i),r.pitch=-Math.asin(n),r},a.fromDegrees=function(e,r,i,o){return t(o)||(o=new a),o.heading=e*n.RADIANS_PER_DEGREE,o.pitch=r*n.RADIANS_PER_DEGREE,o.roll=i*n.RADIANS_PER_DEGREE,o},a.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},a.equalsEpsilon=function(e,r,a,i){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,a,i)&&n.equalsEpsilon(e.pitch,r.pitch,a,i)&&n.equalsEpsilon(e.roll,r.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.z=r(n,0),this.w=r(a,0)}var f=new e;l.fromAxisAngle=function(t,r,a){var i=r/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,d=Math.cos(i);return n(a)?(a.x=u,a.y=s,a.z=c,a.w=d,a):new l(u,s,c,d)};var d=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var r,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+f+E;if(m>0)r=Math.sqrt(m+1),u=.5*r,r=.5/r,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*r,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*r,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*r;else{var p=d,y=0;f>s&&(y=1),E>s&&E>f&&(y=2);var _=p[y],T=p[_];r=Math.sqrt(e[c.getElementIndex(y,y)]-e[c.getElementIndex(_,_)]-e[c.getElementIndex(T,T)]+1);var R=h;R[y]=.5*r,r=.5/r,u=(e[c.getElementIndex(T,_)]-e[c.getElementIndex(_,T)])*r,R[_]=(e[c.getElementIndex(_,y)]+e[c.getElementIndex(y,_)])*r,R[T]=(e[c.getElementIndex(T,y)]+e[c.getElementIndex(y,T)])*r,a=-R[0],i=-R[1],o=-R[2]}return n(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,p=new l,y=new l;l.fromHeadingPitchRoll=function(t,r,n,i){var o;return t instanceof u?(o=t,i=r):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,r,n)),y=l.fromAxisAngle(e.UNIT_X,o.roll,E),p=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(p,y,p),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var _=new e,T=new e,R=new l,v=new l,A=new l;l.packedLength=4,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},l.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,r,n){l.unpack(e,4*r,A),l.conjugate(A,A);for(var a=0,i=r-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,A,R),R.w<0&&l.negate(R,R),l.computeAxis(R,_);var u=l.computeAngle(R);n[o]=_.x*u,n[o+1]=_.y*u,n[o+2]=_.z*u}},l.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(r,4*i,v),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,v,o)},l.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var r=1/l.magnitude(e),n=e.x*r,a=e.y*r,i=e.z*r,o=e.w*r;return t.x=n,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var r=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/r,t)},l.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},l.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+n*l+a*c-i*s,d=o*s-n*c+a*l+i*u,h=o*c+n*s-a*u+i*l,E=o*l-n*u-a*s-i*c;return r.x=f,r.y=d,r.z=h,r.w=E,r},l.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},l.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},l.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var S=new l;l.lerp=function(e,t,r,n){return S=l.multiplyByScalar(t,r,S),n=l.multiplyByScalar(e,1-r,n),l.add(S,n,n)};var N=new l,g=new l,I=new l;l.slerp=function(e,t,r,n){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,r,n);var o=Math.acos(a);return g=l.multiplyByScalar(e,Math.sin((1-r)*o),g),I=l.multiplyByScalar(i,Math.sin(r*o),I),n=l.add(g,I,n),l.multiplyByScalar(n,1/Math.sin(o),n)},l.log=function(t,r){var n=s.acosClamped(t.w),a=0;return 0!==n&&(a=n/Math.sin(n)),e.multiplyByScalar(t,a,r)},l.exp=function(t,r){var n=e.magnitude(t),a=0;return 0!==n&&(a=Math.sin(n)/n),r.x=t.x*a,r.y=t.y*a,r.z=t.z*a,r.w=Math.cos(n),r};var w=new e,O=new e,M=new l,x=new l;l.computeInnerQuadrangle=function(t,r,n,a){var i=l.conjugate(r,M);l.multiply(i,n,x);var o=l.log(x,w);l.multiply(i,t,x);var u=l.log(x,O);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,M),l.multiply(r,M,a)},l.squad=function(e,t,r,n,a,i){var o=l.slerp(e,t,a,M),u=l.slerp(r,n,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],b=0;b<7;++b){var z=b+1,B=2*z+1;D[b]=1/(z*B),L[b]=z/B}return D[7]=P/136,L[7]=8*P/17,l.fastSlerp=function(e,t,r,n){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-r,s=r*r,c=u*u,f=7;f>=0;--f)U[f]=(D[f]*s-L[f])*o,F[f]=(D[f]*c-L[f])*o;var d=a*r*(1+U[0]*(1+U[1]*(1+U[2]*(1+U[3]*(1+U[4]*(1+U[5]*(1+U[6]*(1+U[7])))))))),h=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,h,C);return l.multiplyByScalar(t,d,n),l.add(E,n,n)},l.fastSquad=function(e,t,r,n,a,i){var o=l.fastSlerp(e,t,a,M),u=l.fastSlerp(r,n,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,n){"use strict";function a(t,a,i,l,f,d,h,E,m,p){var y=t+a;e.multiplyByScalar(l,Math.cos(y),o),e.multiplyByScalar(i,Math.sin(y),u),e.add(o,u,o);var _=Math.cos(t);_*=_;var T=Math.sin(t);T*=T;var R=d/Math.sqrt(h*_+f*T),v=R/E;return n.fromAxisAngle(o,v,s),r.fromQuaternion(s,c),r.multiplyByVector(c,m,p),e.normalize(p,p),e.multiplyByScalar(p,E,p),p}var i={},o=new e,u=new e,s=new n,c=new r,l=new e,f=new e,d=new e,h=new e;i.raisePositionsToHeight=function(t,r,n){for(var a=r.ellipsoid,i=r.height,o=r.extrudedHeight,u=n?t.length/3*2:t.length/3,s=new Float64Array(3*u),c=t.length,E=n?c:0,m=0;m<c;m+=3){var p=m+1,y=m+2,_=e.fromArray(t,m,l);a.scaleToGeodeticSurface(_,_);var T=e.clone(_,f),R=a.geodeticSurfaceNormal(_,h),v=e.multiplyByScalar(R,i,d);e.add(_,v,_),n&&(e.multiplyByScalar(R,o,v),e.add(T,v,T),s[m+E]=T.x,s[p+E]=T.y,s[y+E]=T.z),s[m]=_.x,s[p]=_.y,s[y]=_.z}return s};var E=new e,m=new e,p=new e;return i.computeEllipsePositions=function(r,n,i){var o=r.semiMinorAxis,u=r.semiMajorAxis,s=r.rotation,c=r.center,h=8*r.granularity,y=o*o,_=u*u,T=u*o,R=e.magnitude(c),v=e.normalize(c,E),A=e.cross(e.UNIT_Z,c,m);A=e.normalize(A,A);var S=e.cross(v,A,p),N=1+Math.ceil(t.PI_OVER_TWO/h),g=t.PI_OVER_TWO/(N-1),I=t.PI_OVER_TWO-N*g;I<0&&(N-=Math.ceil(Math.abs(I)/g));var w,O,M,x,C,P=2*(N*(N+2)),D=n?new Array(3*P):void 0,L=0,U=l,F=f,b=4*N*3,z=b-1,B=0,G=i?new Array(b):void 0;for(I=t.PI_OVER_TWO,U=a(I,s,S,A,y,T,_,R,v,U),n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x),I=t.PI_OVER_TWO-g,w=1;w<N+1;++w){if(U=a(I,s,S,A,y,T,_,R,v,U),F=a(Math.PI-I,s,S,A,y,T,_,R,v,F),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,M=2*w+2,O=1;O<M-1;++O)x=O/(M-1),C=e.lerp(U,F,x,d),D[L++]=C.x,D[L++]=C.y,D[L++]=C.z;D[L++]=F.x,D[L++]=F.y,D[L++]=F.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=F.x,G[B++]=F.y,G[B++]=F.z),I=t.PI_OVER_TWO-(w+1)*g}for(w=N;w>1;--w){if(I=t.PI_OVER_TWO-(w-1)*g,U=a(-I,s,S,A,y,T,_,R,v,U),F=a(I+Math.PI,s,S,A,y,T,_,R,v,F),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,M=2*(w-1)+2,O=1;O<M-1;++O)x=O/(M-1),C=e.lerp(U,F,x,d),D[L++]=C.x,D[L++]=C.y,D[L++]=C.z;D[L++]=F.x,D[L++]=F.y,D[L++]=F.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=F.x,G[B++]=F.y,G[B++]=F.z)}I=t.PI_OVER_TWO,U=a(-I,s,S,A,y,T,_,R,v,U);var q={};return n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,q.positions=D,q.numPts=N),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,q.outerPositions=G),q},i}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1), -this.values=t.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var f,d,h,E,m,p,y,_;r(a.z)?(f=t.subtract(s,a,i),d=t.subtract(c,a,o),h=t.subtract(n,a,u),E=t.dot(f,f),m=t.dot(f,d),p=t.dot(f,h),y=t.dot(d,d),_=t.dot(d,h)):(f=e.subtract(s,a,i),d=e.subtract(c,a,o),h=e.subtract(n,a,u),E=e.dot(f,f),m=e.dot(f,d),p=e.dot(f,h),y=e.dot(d,d),_=e.dot(d,h));var T=1/(E*y-m*m);return l.y=(y*p-m*_)*T,l.z=(E*_-m*p)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[d/e,a/d]:[a/d,d/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,p=u*c-h,y=4*E*p-m*m;if(y<0){var _,T,R;d*f>=l*h?(_=o,T=E,R=-2*u*E+o*m):(_=c,T=p,R=-c*m+2*s*p);var v=R<0?-1:1,A=-v*Math.abs(_)*Math.sqrt(-y);i=-R+A;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),g=i===A?-N:-T/N;return a=T<=0?N+g:-R/(N*N+g*g+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var I=E,w=-2*u*E+o*m,O=p,M=-c*m+2*s*p,x=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-w)/3);a=2*Math.sqrt(-I);var D=Math.cos(P);i=a*D;var L=a*(-D/2-C*Math.sin(P)),U=i+L>2*u?i-u:L-u,F=o,b=U/F;P=Math.abs(Math.atan2(c*x,-M)/3),a=2*Math.sqrt(-O),D=Math.cos(P),i=a*D,L=a*(-D/2-C*Math.sin(P));var z=-c,B=i+L<2*s?i+s:L+s,G=z/B,q=F*B,V=-U*B-F*z,W=U*z,X=(s*V-u*W)/(-u*V+s*q);return b<=X?b<=G?X<=G?[b,X,G]:[b,G,X]:[G,b,X]:b<=G?[X,b,G]:X<=G?[X,G,b]:[G,X,b]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var E=n.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],y=E[1];if(p>=0&&y>=0){var _=Math.sqrt(p),T=Math.sqrt(y);return[d-T,d-_,d+_,d+T]}if(p>=0&&y<0)return m=Math.sqrt(p),[d-m,d+m];if(p<0&&y>=0)return m=Math.sqrt(y),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),v=(s+h-c/R)/2,A=(s+h+c/R)/2,S=n.computeRealRoots(1,R,v),N=n.computeRealRoots(1,-R,A);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==N.length?(N[0]+=d,N[1]+=d,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=d,N[1]+=d,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,p=h[0],y=a-p,_=y*y,T=t/2,R=y/2,v=_-4*o,A=_+4*Math.abs(o),S=c-4*p,N=c+4*Math.abs(p);if(p<0||v*N<S*A){var g=Math.sqrt(S);E=g/2,m=0===g?0:(t*R-i)/g}else{var I=Math.sqrt(v);E=0===I?0:(t*R-i)/I,m=I/2}var w,O;0===T&&0===E?(w=0,O=0):r.sign(T)===r.sign(E)?(w=T+E,O=p/w):(O=T-E,w=p/O);var M,x;0===R&&0===m?(M=0,x=0):r.sign(R)===r.sign(m)?(M=R+m,x=o/M):(x=R-m,M=o/x);var C=n.computeRealRoots(1,w,M),P=n.computeRealRoots(1,O,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,d=f*n,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*r*d-27*i*f*f+256*o*E+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*i*r*f)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return m},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n}return a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";function f(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function d(t,r,a){n(a)||(a=new i);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,_),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(d,h,E,A);if(n(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function E(t,r,n,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),p=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*r.x+n,y=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),T=[];if(0===_&&0===y){if(l=s.computeRealRoots(E,m,p),0===l.length)return T;var R=l[0],v=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-v)),T.push(new e(a,i*R,i*v)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,i*A,i*-S)),T.push(new e(a,i*A,i*S))}return T}var N=_*_,g=y*y,I=E*E,w=_*y,O=I+g,M=2*(m*E+w),x=2*p*E+m*m-g+N,C=2*(p*m-w),P=p*p-N;if(0===O&&0===M&&0===x&&0===C)return T;l=c.computeRealRoots(O,M,x,C,P);var D=l.length;if(0===D)return T;for(var L=0;L<D;++L){var U,F=l[L],b=F*F,z=Math.max(1-b,0),B=Math.sqrt(z);U=o.sign(E)===o.sign(p)?h(E*b+p,m*F,o.EPSILON12):o.sign(p)===o.sign(m*F)?h(E*b,m*F+p,o.EPSILON12):h(E*b+m*F,p,o.EPSILON12);var G=h(y*F,_,o.EPSILON15),q=U*G;q<0?T.push(new e(a,i*F,i*B)):q>0?T.push(new e(a,i*F,i*-B)):0!==B?(T.push(new e(a,i*F,i*-B)),T.push(new e(a,i*F,i*B)),++L):T.push(new e(a,i*F,i*B))}return T}var m={};m.rayPlane=function(t,r,a){n(a)||(a=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,y=new e,_=new e,T=new e,R=new e;m.rayTriangleParametric=function(t,n,a,i,u){u=r(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,m=e.subtract(a,n,p),v=e.subtract(i,n,y),A=e.cross(E,v,_),S=e.dot(m,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,n,T),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(v,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(h,n,T),l=e.dot(s,A)*N,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*N,f<0||l+f>1)return;d=e.dot(v,c)*N}return d},m.rayTriangle=function(t,r,a,i,o,u){var s=m.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var v=new l;m.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=v;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};m.raySphere=function(e,t,r){if(r=d(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new l;m.lineSegmentSphere=function(t,r,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,g=new e;m.rayEllipsoid=function(t,r){var n,a,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,g),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(n=d-1,a=e.magnitudeSquared(f),o=a*n,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,p=n/s;return m<p?new i(m,p):{start:p,stop:m}}var y=Math.sqrt(n/a);return new i(y,y)}return d<1?(n=d-1,a=e.magnitudeSquared(f),o=a*n,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var I=new e,w=new e,O=new e,M=new e,x=new e,C=new u,P=new u,D=new u,L=new u,U=new u,F=new u,b=new u,z=new e,B=new e,G=new t;m.grazingAltitudeLocation=function(t,r){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,I);if(e.dot(i,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(i,I),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,M),h=e.normalize(e.cross(d,f,w),w),m=e.normalize(e.cross(f,h,O),O),p=C;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=h.x,p[4]=h.y,p[5]=h.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var y=u.transpose(p,P),_=u.fromScale(r.radii,D),T=u.fromScale(r.oneOverRadii,L),R=U;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var v,A,S=u.multiply(u.multiply(y,T,F),R,F),N=u.multiply(u.multiply(S,_,b),p,b),g=u.multiplyByVector(S,a,x),q=E(N,e.negate(g,I),0,0,1),V=q.length;if(V>0){for(var W=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,H=0;H<V;++H){v=u.multiplyByVector(_,u.multiplyByVector(p,q[H],z),z);var Y=e.normalize(e.subtract(v,a,M),M),k=e.dot(Y,i);k>X&&(X=k,W=e.clone(v,W))}var j=r.cartesianToCartographic(W,G);return X=o.clamp(X,0,1),A=e.magnitude(e.subtract(W,a,M))*Math.sqrt(1-X*X),A=c?-A:A,j.height=A,r.cartographicToCartesian(j,new e)}};var q=new e;return m.lineSegmentPlane=function(t,r,a,i){n(i)||(i=new e);var u=e.subtract(r,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(t,n,a,d),{positions:[t,r,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(r,t,a,d),{positions:[t,r,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(n,r,a,d),{positions:[t,r,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(n,t,a,d),{positions:[t,r,n,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(t,r,a,d),{positions:[t,r,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(r,n,a,d),{positions:[t,r,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,d=0;d<o;++d)f-c[n[d]]>i&&(c[n[d]]=f,++f);return(f-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var d=r[f];a[d].numLiveTriangles&&(s=0,i-a[d].timeStamp+2*a[d].numLiveTriangles<=t&&(s=i-a[d].timeStamp),(s>l||l===-1)&&(l=s,c=d)),++f}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,f=0,d=o[f],h=c;if(t(u))l=u+1;else{for(;f<h;)d>l&&(l=d),++f,d=o[f];if(l===-1)return 0;++l}for(var E=[],m=0;m<l;m++)E[m]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var p=0;f<h;)E[o[f]].vertexTriangles.push(p),++E[o[f]].numLiveTriangles,E[o[f+1]].vertexTriangles.push(p),++E[o[f+1]].numLiveTriangles,E[o[f+2]].vertexTriangles.push(p),++E[o[f+2]].numLiveTriangles,++p,f+=3;var y=0,_=s+1;i=1;var T,R,v=[],A=[],S=0,N=[],g=c/3,I=[];for(m=0;m<g;m++)I[m]=!1;for(var w,O;y!==-1;){v=[],R=E[y],O=R.vertexTriangles.length;for(var M=0;M<O;++M)if(p=R.vertexTriangles[M],!I[p]){I[p]=!0,f=p+p+p;for(var x=0;x<3;++x)w=o[f],v.push(w),A.push(w),N[S]=w,++S,T=E[w],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}y=a(o,s,v,E,_,A,l)}return N},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R,v,A,S,N){"use strict";function g(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function I(e){for(var t=e.length,r=t/3*6,n=p.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)g(n,a,e[i],e[i+1],e[i+2]);return n}function w(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);g(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)g(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function O(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=p.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)g(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function M(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new E({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function x(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function C(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),v.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function D(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,f=1;f<n;++f){var d=e[f][t].attributes[r];if(!c(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){l=!1;break}s+=d.values.length}l&&(a[r]=new E({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function L(e,t){var n,i,o,u,s,l,f,d=e.length,E=(e[0].modelMatrix,c(e[0][t].indices)),m=e[0][t].primitiveType,y=D(e,t);for(n in y)if(y.hasOwnProperty(n))for(s=y[n].values,u=0,i=0;i<d;++i)for(l=e[i][t].attributes[n].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(E){var T=0;for(i=0;i<d;++i)T+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:y,primitiveType:S.POINTS})),v=p.createTypedArray(R,T),A=0,N=0;for(i=0;i<d;++i){var g=e[i][t].indices,I=g.length;for(u=0;u<I;++u)v[A++]=N+g[u];N+=h.computeNumberOfVertices(e[i][t])}_=v}var w,O=new a,M=0;for(i=0;i<d;++i){if(w=e[i][t].boundingSphere,!c(w)){O=void 0;break}a.add(w.center,O,O)}if(c(O))for(a.divideByScalar(O,d,O),i=0;i<d;++i){w=e[i][t].boundingSphere;var x=a.magnitude(a.subtract(w.center,O,se))+w.radius;x>M&&(M=x)}return new h({attributes:y,indices:_,primitiveType:m,boundingSphere:c(O)?new r(O,M):void 0})}function U(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function b(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function B(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return F(e);case S.TRIANGLE_STRIP:return b(e);case S.TRIANGLES:return U(e);case S.LINE_STRIP:return B(e);case S.LINE_LOOP:return G(e);case S.LINES:return z(e)}return e}function V(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function W(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return V(e,e.y<0),V(t,t.y<0),void V(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?T.sign(e.y):T.sign(r.y):i>o?T.sign(t.y):T.sign(r.y);var u=n<0;V(e,u),V(t,u),V(r,u)}function X(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,ve),e.y/(e.y-t.y),ve),r),a.clone(r,n),V(r,!0),V(n,!1)}function H(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){W(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(X(e,t,Ae,Ne),X(e,r,Se,ge),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(X(t,r,Ae,Ne),X(t,e,Se,ge),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(X(r,e,Ae,Ne),X(r,t,Se,ge),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(X(r,e,Ae,Ne),X(r,t,Se,ge),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(X(t,r,Ae,Ne),X(t,e,Se,ge),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(X(e,t,Ae,Ne),X(e,r,Se,ge),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=Se,s[5]=Ne,s[6]=ge,s.length=7),Ie}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=p.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function k(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new E({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function j(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Z(e,r,i,o,u,s,l,f,d,h,E,m){if(c(s)||c(l)||c(f)||c(d)||c(h)){var p=a.fromArray(u,3*e,we),y=a.fromArray(u,3*r,Oe),_=a.fromArray(u,3*i,Me),T=t(o,p,y,_,xe);if(c(s)){var R=a.fromArray(s,3*e,we),v=a.fromArray(s,3*r,Oe),A=a.fromArray(s,3*i,Me);a.multiplyByScalar(R,T.x,R),a.multiplyByScalar(v,T.y,v),a.multiplyByScalar(A,T.z,A);var S=a.add(R,v,R);a.add(S,A,S),a.normalize(S,S),a.pack(S,E.normal.values,3*m)}if(c(h)){var N=a.fromArray(h,3*e,we),g=a.fromArray(h,3*r,Oe),I=a.fromArray(h,3*i,Me);a.multiplyByScalar(N,T.x,N),a.multiplyByScalar(g,T.y,g),a.multiplyByScalar(I,T.z,I);var w;a.equals(N,a.ZERO)&&a.equals(g,a.ZERO)&&a.equals(I,a.ZERO)?(w=we,w.x=0,w.y=0,w.z=0):(w=a.add(N,g,N),a.add(w,I,w),a.normalize(w,w)),a.pack(w,E.extrudeDirection.values,3*m)}if(c(l)){var O=a.fromArray(l,3*e,we),M=a.fromArray(l,3*r,Oe),x=a.fromArray(l,3*i,Me);a.multiplyByScalar(O,T.x,O),a.multiplyByScalar(M,T.y,M),a.multiplyByScalar(x,T.z,x);var C=a.add(O,M,O);a.add(C,x,C),a.normalize(C,C),a.pack(C,E.tangent.values,3*m)}if(c(f)){var P=a.fromArray(f,3*e,we),D=a.fromArray(f,3*r,Oe),L=a.fromArray(f,3*i,Me);a.multiplyByScalar(P,T.x,P),a.multiplyByScalar(D,T.y,D),a.multiplyByScalar(L,T.z,L);var U=a.add(P,D,P);a.add(U,L,U),a.normalize(U,U),a.pack(U,E.bitangent.values,3*m)}if(c(d)){var F=n.fromArray(d,2*e,Ce),b=n.fromArray(d,2*r,Pe),z=n.fromArray(d,2*i,De);n.multiplyByScalar(F,T.x,F),n.multiplyByScalar(b,T.y,b),n.multiplyByScalar(z,T.z,z);var B=n.add(F,b,F);n.add(B,z,B),n.pack(B,E.st.values,2*m)}}}function K(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,d=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,E=c(s.st)?s.st.values:void 0,m=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,p=u.indices,y=k(u),_=k(u),T=[];T.length=l.length/3;var R=[];for(R.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,R[o]=-1;var v=p.length;for(o=0;o<v;o+=3){var A=p[o],S=p[o+1],N=p[o+2],g=a.fromArray(l,3*A),I=a.fromArray(l,3*S),w=a.fromArray(l,3*N),O=H(g,I,w);if(c(O)&&O.positions.length>3)for(var M=O.positions,x=O.indices,C=x.length,P=0;P<C;++P){var D=x[P],L=M[D];L.y<0?(t=_.attributes,r=_.indices,n=T):(t=y.attributes,r=y.indices,n=R),i=K(t,r,n,p,D<3?o+D:-1,L),Z(A,S,N,L,l,f,h,d,E,m,t,i)}else c(O)&&(g=O.positions[0],I=O.positions[1],w=O.positions[2]),g.y<0?(t=_.attributes,r=_.indices,n=T):(t=y.attributes,r=y.indices,n=R),i=K(t,r,n,p,o,g),Z(A,S,N,g,l,f,h,d,E,m,t,i),i=K(t,r,n,p,o+1,I),Z(A,S,N,I,l,f,h,d,E,m,t,i),i=K(t,r,n,p,o+2,w),Z(A,S,N,w,l,f,h,d,E,m,t,i)}j(e,_,y)}function Q(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=k(r),s=k(r),l=o.length,f=[];f.length=i.length/3;var d=[];for(d.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,d[t]=-1;for(t=0;t<l;t+=2){var h=o[t],E=o[t+1],m=a.fromArray(i,3*h,we),p=a.fromArray(i,3*E,Oe);Math.abs(m.y)<T.EPSILON6&&(m.y<0?m.y=-T.EPSILON6:m.y=T.EPSILON6),Math.abs(p.y)<T.EPSILON6&&(p.y<0?p.y=-T.EPSILON6:p.y=T.EPSILON6);var y=u.attributes,R=u.indices,v=d,A=s.attributes,S=s.indices,N=f,g=_.lineSegmentPlane(m,p,Le,Me);if(c(g)){var I=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Ue);m.y<0&&(a.negate(I,I),y=s.attributes,R=s.indices,v=f,A=u.attributes,S=u.indices,N=d);var w=a.add(g,I,Fe);K(y,R,v,o,t,m),K(y,R,v,o,-1,w),a.negate(I,I),a.add(g,I,w),K(A,S,N,o,-1,w),K(A,S,N,o,t+1,p)}else{var O,M,x;m.y<0?(O=s.attributes,M=s.indices,x=f):(O=u.attributes,M=u.indices,x=d),K(O,M,x,o,t,m),K(O,M,x,o,t+1,p)}}j(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,Be);if(!(s.x>0)){var c=a.unpack(n,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,d=s.nextPosition.values,h=s.expandAndWidth.values,E=c(s.st)?s.st.values:void 0,m=c(s.color)?s.color.values:void 0,p=k(u),y=k(u),R=!1,v=l.length/3;for(t=0;t<v;t+=4){var A=t,S=t+2,N=a.fromArray(l,3*A,Be),g=a.fromArray(l,3*S,Ge);if(Math.abs(N.y)<ke)for(N.y=ke*(g.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(g.y)<ke)for(g.y=ke*(N.y<0?-1:1),l[3*(t+2)+1]=g.y,l[3*(t+3)+1]=g.y,r=3*A;r<3*A+12;r+=3)d[r]=l[3*(t+2)],d[r+1]=l[3*(t+2)+1],d[r+2]=l[3*(t+2)+2];var I=p.attributes,w=p.indices,O=y.attributes,M=y.indices,x=_.lineSegmentPlane(N,g,Le,Ve);if(c(x)){R=!0;var C=a.multiplyByScalar(a.UNIT_Y,Ye,We);N.y<0&&(a.negate(C,C),I=y.attributes,w=y.indices,O=p.attributes,M=p.indices);var P=a.add(x,C,Xe);I.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.position.values.push(P.x,P.y,P.z),I.position.values.push(P.x,P.y,P.z),I.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),I.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),I.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),a.negate(C,C),a.add(x,C,P),O.position.values.push(P.x,P.y,P.z),O.position.values.push(P.x,P.y,P.z),O.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),O.nextPosition.values.push(d[3*S],d[3*S+1],d[3*S+2]),O.nextPosition.values.push(d[3*S+3],d[3*S+4],d[3*S+5]);var D=n.fromArray(h,2*A,be),L=Math.abs(D.y);I.expandAndWidth.values.push(-1,L,1,L),I.expandAndWidth.values.push(-1,-L,1,-L),O.expandAndWidth.values.push(-1,L,1,L),O.expandAndWidth.values.push(-1,-L,1,-L);var U=a.magnitudeSquared(a.subtract(x,N,qe));if(U/=a.magnitudeSquared(a.subtract(g,N,qe)),c(m)){var F=i.fromArray(m,4*A,He),b=i.fromArray(m,4*S,He),z=T.lerp(F.x,b.x,U),B=T.lerp(F.y,b.y,U),G=T.lerp(F.z,b.z,U),q=T.lerp(F.w,b.w,U);for(r=4*A;r<4*A+8;++r)I.color.values.push(m[r]);for(I.color.values.push(z,B,G,q),I.color.values.push(z,B,G,q),O.color.values.push(z,B,G,q),O.color.values.push(z,B,G,q),r=4*S;r<4*S+8;++r)O.color.values.push(m[r])}if(c(E)){var V=n.fromArray(E,2*A,be),W=n.fromArray(E,2*(t+3),ze),X=T.lerp(V.x,W.x,U);for(r=2*A;r<2*A+4;++r)I.st.values.push(E[r]);for(I.st.values.push(X,V.y),I.st.values.push(X,W.y),O.st.values.push(X,V.y),O.st.values.push(X,W.y),r=2*S;r<2*S+4;++r)O.st.values.push(E[r])}o=I.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3),o=O.position.values.length/3-4,M.push(o,o+2,o+1), -M.push(o+1,o+2,o+3)}else{var H,Y;for(N.y<0?(H=y.attributes,Y=y.indices):(H=p.attributes,Y=p.indices),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(g.x,g.y,g.z),H.position.values.push(g.x,g.y,g.z),r=3*t;r<3*t+12;++r)H.prevPosition.values.push(f[r]),H.nextPosition.values.push(d[r]);for(r=2*t;r<2*t+8;++r)H.expandAndWidth.values.push(h[r]),c(E)&&H.st.values.push(E[r]);if(c(m))for(r=4*t;r<4*t+16;++r)H.color.values.push(m[r]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}R&&($(y),$(p)),j(e,y,p)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=I(t);break;case S.TRIANGLE_STRIP:e.indices=w(t);break;case S.TRIANGLE_FAN:e.indices=O(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,d=0;d<o;d+=3)l[f++]=a[d],l[f++]=a[d+1],l[f++]=a[d+2],l[f++]=a[d]+i[d]*n,l[f++]=a[d+1]+i[d+1]*n,l[f++]=a[d+2]+i[d+2]*n;var m,p=e.boundingSphere;return c(p)&&(m=new r(p.center,p.radius+n)),new h({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:m})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=p.createTypedArray(t,s),f=0,d=0,E=0;f<s;)i=n[o[f]],i!==-1?l[d]=i:(i=o[f],n[i]=E,l[d]=E,++E),++f,++d;e.indices=l;var m=e.attributes;for(var y in m)if(m.hasOwnProperty(y)&&c(m[y])&&c(m[y].values)){for(var _=m[y],T=_.values,R=0,v=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,E*v);R<t;){var S=n[R];if(S!==-1)for(a=0;a<v;a++)A[v*S+a]=T[v*R+a];++R}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=N.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=T.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=M(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var f=0;f<l;f+=n){for(var d=0;d<n;++d){var E=s[f+d],m=a[E];c(m)||(m=o++,a[E]=m,x(u,e.attributes,E)),i.push(m)}o+n>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=M(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new d;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),h=0,m=0;m<l.length;m+=3){var p=a.fromArray(l,m,re),y=s.cartesianToCartographic(p,ne),_=i.project(y,re);f[h++]=_.x,f[h++]=_.y,f[h++]=_.z}return e.attributes[r]=o,e.attributes[n]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var d=a.componentsPerAttribute;return e.attributes[r]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:s}),e.attributes[n]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var ie=new a,oe=new v,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(v.equals(t,v.IDENTITY))return e;var n=e.geometry.attributes;C(t,n.position),C(t,n.prevPosition),C(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(v.inverse(t,oe),v.transpose(oe,oe),v.getRotation(oe,ue),P(ue,n.normal),P(ue,n.tangent),P(ue,n.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=v.clone(v.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(L(t,"geometry")),r.length>0&&(o.push(L(r,"westHemisphereGeometry")),o.push(L(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,fe=new a,de=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var d=0;for(f=0;f<o;f+=3){var h=t[f],m=t[f+1],p=t[f+2],y=3*h,_=3*m,R=3*p;le.x=n[y],le.y=n[y+1],le.z=n[y+2],fe.x=n[_],fe.y=n[_+1],fe.z=n[_+2],de.x=n[R],de.y=n[R+1],de.z=n[R+2],s[h].count++,s[m].count++,s[p].count++,a.subtract(fe,le,fe),a.subtract(de,le,de),c[d]=a.cross(fe,de,new a),d++}var v=0;for(f=0;f<i;f++)s[f].indexOffset+=v,v+=s[f].count;d=0;var A;for(f=0;f<o;f+=3){A=s[t[f]];var S=A.indexOffset+A.currentCount;l[S]=d,A.currentCount++,A=s[t[f+1]],S=A.indexOffset+A.currentCount,l[S]=d,A.currentCount++,A=s[t[f+2]],S=A.indexOffset+A.currentCount,l[S]=d,A.currentCount++,d++}var N=new Float32Array(3*i);for(f=0;f<i;f++){var g=3*f;if(A=s[f],a.clone(a.ZERO,ce),A.count>0){for(d=0;d<A.count;d++)a.add(ce,c[l[A.indexOffset+d]],ce);a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&a.clone(c[l[A.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),N[g]=ce.x,N[g+1]=ce.y,N[g+2]=ce.z}return e.attributes.normal=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,Ee=new a,me=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,d,h;for(l=0;l<s;l+=3){var m=t[l],p=t[l+1],y=t[l+2];f=3*m,d=3*p,h=3*y;var _=2*m,T=2*p,R=2*y,v=r[f],A=r[f+1],S=r[f+2],N=i[_],g=i[_+1],I=i[T+1]-g,w=i[R+1]-g,O=1/((i[T]-N)*w-(i[R]-N)*I),M=(w*(r[d]-v)-I*(r[h]-v))*O,x=(w*(r[d+1]-A)-I*(r[h+1]-A))*O,C=(w*(r[d+2]-S)-I*(r[h+2]-S))*O;c[f]+=M,c[f+1]+=x,c[f+2]+=C,c[d]+=M,c[d+1]+=x,c[d+2]+=C,c[h]+=M,c[h+1]+=x,c[h+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,d=f+1,h=f+2;var L=a.fromArray(n,f,he),U=a.fromArray(c,f,me),F=a.dot(L,U);a.multiplyByScalar(L,F,Ee),a.normalize(a.subtract(U,Ee,U),U),P[f]=U.x,P[d]=U.y,P[h]=U.z,a.normalize(a.cross(L,U,U),U),D[f]=U.x,D[d]=U.y,D[h]=U.z}return e.attributes.tangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e};var pe=new n,ye=new a,_e=new a,Te=new a,Re=new n;te.compressVertices=function(t){var r,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),f=0;for(r=0;r<i;++r)a.fromArray(s,3*r,ye),a.equals(ye,a.ZERO)?f+=2:(Re=e.octEncodeInRange(ye,65535,Re),l[f++]=Re.x,l[f++]=Re.y);return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var d=t.attributes.normal,h=t.attributes.st,m=c(d),p=c(h);if(!m&&!p)return t;var y,_,T,R,v=t.attributes.tangent,A=t.attributes.bitangent,S=c(v),N=c(A);m&&(y=d.values),p&&(_=h.values),S&&(T=v.values),N&&(R=A.values);var g=m?y.length:_.length,I=m?3:2;i=g/I;var w=i,O=p&&m?2:1;O+=S||N?1:0,w*=O;var M=new Float32Array(w),x=0;for(r=0;r<i;++r){p&&(n.fromArray(_,2*r,pe),M[x++]=e.compressTextureCoordinates(pe));var C=3*r;m&&c(T)&&c(R)?(a.fromArray(y,C,ye),a.fromArray(T,C,_e),a.fromArray(R,C,Te),e.octPack(ye,_e,Te,pe),M[x++]=pe.x,M[x++]=pe.y):(m&&(a.fromArray(y,C,ye),M[x++]=e.octEncodeFloat(ye)),S&&(a.fromArray(T,C,ye),M[x++]=e.octEncodeFloat(ye)),N&&(a.fromArray(R,C,ye),M[x++]=e.octEncodeFloat(ye)))}return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:O,values:M}),m&&delete t.attributes.normal,p&&delete t.attributes.st,N&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var ve=new a,Ae=new a,Se=new a,Ne=new a,ge=new a,Ie={positions:new Array(7),indices:new Array(9)},we=new a,Oe=new a,Me=new a,xe=new a,Ce=new n,Pe=new n,De=new n,Le=A.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,Fe=new a,be=new n,ze=new n,Be=new a,Ge=new a,qe=new a,Ve=new a,We=new a,Xe=new a,He=new i,Ye=5*T.EPSILON9,ke=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,A.ORIGIN_ZX_PLANE)!==y.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:J(e);break;case m.LINES:Q(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&Q(e);return e},te}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,a){return t(e).then(r,n,a)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=o(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=a(e),t}function r(t){return e(t,i)}function n(e){this.then=e}function a(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(e){return i(e)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(e){return i(e)}});return r}function o(){function e(e,t,r){return d(e,t,r)}function r(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new n(e),s={then:e,resolve:r,reject:a,progress:u,promise:c,resolver:{resolve:r,reject:a,progress:u}},l=[],f=[],d=function(e,t,r){var n,a;return n=o(),a="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,a)}),f.push(a),n.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=y,m(l,e),f=l=v,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,a,i){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,p,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),f=[],l=_-c+1,d=[],h=o(),c)for(p=h.progress,m=function(e){d.push(e),--l||(E=m=y,h.reject(d))},E=function(e){f.push(e),--c||(E=m=y,h.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,p);else h.resolve(f);return h.then(n,a,i)})}function c(e,t,r,n){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,r,n)}function l(e,t,r,n){return p(1,arguments),d(e,_).then(t,r,n)}function f(){return d(arguments,_)}function d(t,r){return e(t,function(t){var n,a,i,u,s,c;if(i=a=t.length>>>0,n=[],c=o(),i)for(u=function(t,a){e(t,r).then(function(e){n[a]=e,--i||c.resolve(n)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function h(t,r){var n=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,n[0]=function(t,n,i){return e(t,function(t){return e(n,function(e){return r(t,e,i,a)})})},T.apply(t,n)})}function E(t,r,n){var a=arguments.length>2;return e(t,function(e){return e=a?n:e,r.resolve(e),e},function(e){return r.reject(e),i(e)},r.progress)}function m(e,t){for(var r,n=0;r=e[n++];)r(t)}function p(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function y(){}function _(e){return e}var T,R,v;return e.defer=o,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(v,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(v,t)})})}},R=[].slice,T=[].reduce||function(e){var t,r,n,a,i;if(i=0,t=Object(this),a=t.length>>>0,r=arguments,r.length<=1)for(;;){if(i in t){n=t[i++];break}if(++i>=a)throw new TypeError}else n=r[1];for(;i<a;++i)i in t&&(n=e(n,t[i],i,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r){for(var n,a,i=0,o=e.length-1;i<=o;)if(n=~~((i+o)/2),a=r(e[n],t),a<0)i=n+1;else{if(!(a>0))return n;o=n-1}return~(o+1)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,n,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,n=t[r++],a=function(e,t,r,n){r||(r=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return n?e+a:a+e},i=function(e,t,r,n,i,o){var u=n-e.length;return u>0&&(e=r||!i?a(e,n,o,r):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,r,n,o,u,s){var c=e>>>0;return r=r&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+a(c.toString(t),u||0,"0",!1),i(e,r,n,o,s)},u=function(e,t,r,n,a,o){return null!=n&&(e=e.slice(0,n)),i(e,"",t,r,a,o)},s=function(e,n,s,c,l,f,d){var h,E,m,p,y;if("%%"==e)return"%";for(var _=!1,T="",R=!1,v=!1,A=" ",S=s.length,N=0;s&&N<S;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":A=s.charAt(N+1);break;case"0":R=!0;break;case"#":v=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[r++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=n?t[n.slice(0,-1)]:t[r++],d){case"s":return u(String(y),_,c,f,R,A);case"c":return u(String.fromCharCode(+y),_,c,f,R);case"b":return o(y,2,v,_,c,f,R);case"o":return o(y,8,v,_,c,f,R);case"x":return o(y,16,v,_,c,f,R);case"X":return o(y,16,v,_,c,f,R).toUpperCase();case"u":return o(y,10,v,_,c,f,R);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=h<0?"-":T,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,_,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=E+Math.abs(h)[m](f),i(y,E,_,c,R)[p]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,a,i,o,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var r=m.leapSeconds,n=t(r,T,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var a=r[n].offset;if(n>0){var i=m.secondsDifference(r[n].julianDate,e);i>a&&(n--,a=r[n].offset)}m.addSeconds(e,a,e)}function d(e,r){T.julianDate=e;var n=m.leapSeconds,a=t(n,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-n[0].offset,r);if(a>=n.length)return m.addSeconds(e,-n[a-1].offset,r);var i=m.secondsDifference(n[a].julianDate,e);return 0===i?m.addSeconds(e,-n[a].offset,r):i<=1?void 0:m.addSeconds(e,-n[--a].offset,r)}function h(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,t<0&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function E(e,t,r,n,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+r-32075;n-=12,n<0&&(n+=24);var f=i+(n*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),n=r(n,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),n===c.UTC&&f(this)}var p=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,R=/^(\d{4})$/,v=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,g=/([Z+\-])?(\d{2})?:?(\d{2})?$/,I=/^(\d{2})(\.\d+)?/.source+g.source,w=/^(\d{2}):?(\d{2})(\.\d+)?/.source+g.source,O=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+g.source;m.fromDate=function(e,t){var r=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n(t)?(h(r[0],r[1],t),f(t),t):new m(r[0],r[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var r,a,i,u=e.split("T"),s=1,l=1,d=0,p=0,T=0,g=0,M=u[0],x=u[1];if(u=M.match(N),null!==u)r=+u[1],s=+u[2],l=+u[3];else if(u=M.match(v),null!==u)r=+u[1],s=+u[2];else if(u=M.match(R),null!==u)r=+u[1];else{var C;if(u=M.match(A),null!==u)r=+u[1],C=+u[2],i=o(r);else if(u=M.match(S),null!==u){r=+u[1];var P=+u[2],D=+u[3]||0,L=new Date(Date.UTC(r,0,4));C=7*P+D-L.getUTCDay()-3}a=new Date(Date.UTC(r,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(r);var U;if(n(x)){u=x.match(O),null!==u?(d=+u[1],p=+u[2],T=+u[3],g=1e3*+(u[4]||0),U=5):(u=x.match(w),null!==u?(d=+u[1],p=+u[2],T=60*+(u[3]||0),U=4):(u=x.match(I),null!==u&&(d=+u[1],p=60*+(u[2]||0),U=3)));var F=u[U],b=+u[U+1],z=+(u[U+2]||0);switch(F){case"+":d-=b,p-=z;break;case"-":d+=b,p+=z;break;case"Z":break;default:p+=new Date(Date.UTC(r,s-1,l,d,p)).getTimezoneOffset()}}else p+=new Date(r,s-1,l).getTimezoneOffset();var B=60===T;for(B&&T--;p>=60;)p-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,r++),a=i&&2===s?_:y[s-1];for(;p<0;)p+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,r--),a=i&&2===s?_:y[s-1],l+=a;var G=E(r,s,l,d,p,T,g);return n(t)?(h(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),B&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var M=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var r=!1,a=d(e,M);n(a)||(m.addSeconds(e,-1,M),a=d(M,M),r=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var p=h+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var v=0|T,A=(T-v)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(v+=1),n(t)?(t.year=y,t.month=p,t.day=E,t.hour=_,t.minute=R,t.second=v,t.millisecond=A,t.isLeapSecond=r,t):new i(y,p,E,_,R,v,A,r)},m.toDate=function(e){var t=m.toGregorianDate(e,p),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},m.toIso8601=function(t,r){var a,i=m.toGregorianDate(t,i);return n(r)||0===i.millisecond?n(r)&&0!==r?(a=(.01*i.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(n(e))return n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(m.secondsDifference(e,t))<=r},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},m.computeTaiMinusUtc=function(e){T.julianDate=e;var r=m.leapSeconds,n=t(r,T,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},m.addSeconds=function(e,t,r){return h(e.dayNumber,e.secondsOfDay+t,r)},m.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,n,r)},m.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,n,r)},m.addDays=function(e,t,r){var n=e.dayNumber+t;return h(n,e.secondsOfDay,r)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var a=new r.constructor;for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];n&&(o=t(o,n)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var a=r[n],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,n){this.statusCode=e,this.response=r,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=n.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function r(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var n=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,r).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var a=n.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])||(i[n]=!0)},a.remove=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])&&delete i[n]},a.contains=function(e){var r=n(e);return!(!t(r)||!t(i[r]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,n,a,i,o){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,a=t(r.method,"GET"),i=r.data,o=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,n,a,i,o,r,s),r.promise})}function s(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function c(e,t){for(var r=s(e,t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return n}function l(e,r){r=t(r,"");var n=e[1],a=!!e[2],i=e[3];switch(r){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:n});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),n);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,n,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),r(d)&&r(E.overrideMimeType)&&E.overrideMimeType(d),E.open(n,e,!0),r(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);r(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,n=E.responseType;if(!r(e)||r(t)&&n!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===n||"document"===n)&&r(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==n&&"text"!==n||!r(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function a(r,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,n(r,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))E(this,t.data);else if(n(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=r.columnNames.indexOf("modifiedJulianDateUtc"),i=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),d=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=r.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c, -e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,R=0,v=p.length;R<v;R+=e._columnCount){var A=p[R+a],S=p[R+m],N=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,g=new o(N,S,f.TAI);if(y.push(g),T){if(S!==_&&n(_)){var I=o.leapSeconds,w=t(I,g,h);if(w<0){var O=new u(g,S);I.splice(~w,0,O)}}_=S}}}function m(e,t,r,n,a){var i=r*n;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,r){return t+e*(r-t)}function y(e,t,r,n,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||n.equals(c))return m(e,r,a,s,u),u;if(n.equals(l))return m(e,r,i,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=r[d+e._ut1MinusUtcSecondsColumn],y=r[h+e._ut1MinusUtcSecondsColumn],_=y-E;if(_>.5||_<-.5){var T=r[d+e._taiMinusUtcSecondsColumn],R=r[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(n)?E=y:y-=R-T)}return u.xPoleWander=p(f,r[d+e._xPoleWanderRadiansColumn],r[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,r[d+e._yPoleWanderRadiansColumn],r[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,r[d+e._xCelestialPoleOffsetRadiansColumn],r[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,r[d+e._yCelestialPoleOffsetRadiansColumn],r[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,y),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return n(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,r){if(n(this._samples)){if(n(r)||(r=new a(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var i=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!n(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,r),r}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},d}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=t(n,document.location.href);var a=new e(n),i=new e(r);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,i){i=t(i,!0),n instanceof e||(n=new e(n)),a instanceof e||(a=new e(a)),r(a.authority)&&!r(a.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=n.scheme);var o=n;a.isAbsolute()&&(o=a);var u="";r(o.scheme)&&(u+=o.scheme+":"),r(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===n?i?n.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):n.path+a.path:a.path;var s=r(n.query),c=r(a.query);s&&c?u+="?"+n.query+"&"+a.query:s&&!c?u+="?"+n.query:!s&&c&&(u+="?"+a.query);var l=r(a.fragment);return r(n.fragment)&&!l?u+="#"+n.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,n,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),a=E.exec(n);if(null!==a)return a[1]}}function u(){if(t(f))return f;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(n(r))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var r=d(e);return h.href=r,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){n[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,i.daysDifference(n,e._sampleZeroDateTT)}function l(r,a){if(r._chunkDownloadsInProgress[a])return r._chunkDownloadsInProgress[a];var i=e.defer();r._chunkDownloadsInProgress[a]=i;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){r._chunkDownloadsInProgress[a]=!1;for(var t=r._samples,n=e.samples,o=a*r._samplesPerXysFile*3,u=0,s=n.length;u<s;++u)t[o+u]=n[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,r,n,a){var i=c(this,t,r),o=c(this,n,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,r){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(n(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),n(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){n(r)?(r.x=0,r.y=0,r.s=0):r=new a(0,0,0);var E,m,p=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)y[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=y[m]);T[E]*=_[E];var v=3*(s+E);r.x+=T[E]*h[v++],r.y+=T[E]*h[v++],r.s+=T[E]*h[v]}return r}}}},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R){"use strict";var v={},A={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},S={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},N={},g={east:new r,north:new r,up:new r,west:new r,south:new r,down:new r},I=new r,w=new r,O=new r;v.localFrameToFixedFrameGenerator=function(e,t){if(!A.hasOwnProperty(e)||!A[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var n,a=A[e][t],i=e+t;return u(N[i])?n=N[i]:(n=function(n,i,s){if(u(s)||(s=new _),p.equalsEpsilon(n.x,0,p.EPSILON14)&&p.equalsEpsilon(n.y,0,p.EPSILON14)){var c=p.sign(n.z);r.unpack(S[e],0,I),"east"!==e&&"west"!==e&&r.multiplyByScalar(I,c,I),r.unpack(S[t],0,w),"east"!==t&&"west"!==t&&r.multiplyByScalar(w,c,w),r.unpack(S[a],0,O),"east"!==a&&"west"!==a&&r.multiplyByScalar(O,c,O)}else{i=o(i,d.WGS84),i.geodeticSurfaceNormal(n,g.up);var l=g.up,f=g.east;f.x=-n.y,f.y=n.x,f.z=0,r.normalize(f,g.east),r.cross(l,f,g.north),r.multiplyByScalar(g.up,-1,g.down),r.multiplyByScalar(g.east,-1,g.west),r.multiplyByScalar(g.north,-1,g.south),I=g[e],w=g[t],O=g[a]}return s[0]=I.x,s[1]=I.y,s[2]=I.z,s[3]=0,s[4]=w.x,s[5]=w.y,s[6]=w.z,s[7]=0,s[8]=O.x,s[9]=O.y,s[10]=O.z,s[11]=0,s[12]=n.x,s[13]=n.y,s[14]=n.z,s[15]=1,s},N[i]=n),n},v.eastNorthUpToFixedFrame=v.localFrameToFixedFrameGenerator("east","north"),v.northEastDownToFixedFrame=v.localFrameToFixedFrameGenerator("north","east"),v.northUpEastToFixedFrame=v.localFrameToFixedFrameGenerator("north","up"),v.northWestUpToFixedFrame=v.localFrameToFixedFrameGenerator("north","west");var M=new T,x=new r(1,1,1),C=new _;v.headingPitchRollToFixedFrame=function(e,t,n,a,i){a instanceof _&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,v.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,M),c=_.fromTranslationQuaternionRotationScale(r.ZERO,u,x,C);return i=a(e,n,i),_.multiply(i,c,i)};var P=new _,D=new y;v.headingPitchRollQuaternion=function(e,t,r,n,a){n instanceof T&&(a=n,n=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=v.headingPitchRollToFixedFrame(e,t,r,n,P),o=_.getRotation(i,D);return T.fromRotationMatrix(o,a)};var L=24110.54841,U=8640184.812866,F=.093104,b=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,G=p.TWO_PI/86400,q=new m;v.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var r,n=q.dayNumber,a=q.secondsOfDay,i=n-2451545;r=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=L+r*(U+r*(F+r*b)),s=o*G%p.TWO_PI,c=B+z*(n-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(d,h,0,-h,d,0,0,0,1)},v.iau2006XysData=new h,v.earthOrientationParameters=l.NONE;var V=32.184,W=2451545;v.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+V,a=t.stop.dayNumber,i=t.stop.secondsOfDay+V,o=v.iau2006XysData.preload(r,n,a,i),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var r=v.computeFixedToIcrfMatrix(e,t);if(u(r))return y.transpose(r,t)};var X=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new y,k=new y;v.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var r=v.earthOrientationParameters.compute(e,H);if(u(r)){var n=e.dayNumber,a=e.secondsOfDay+V,i=v.iau2006XysData.computeXysRadians(n,a,X);if(u(i)){var o=i.x+r.xPoleOffset,s=i.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,k),d=y.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=h-2451545,T=E/R.SECONDS_PER_DAY,A=.779057273264+T+.00273781191135448*(_+T);A=A%1*p.TWO_PI;var S=y.fromRotationZ(A,k),N=y.multiply(d,S,Y),g=Math.cos(r.xPoleWander),I=Math.cos(r.yPoleWander),w=Math.sin(r.xPoleWander),O=Math.sin(r.yPoleWander),M=n-W+a/R.SECONDS_PER_DAY;M/=36525;var x=-47e-6*M*p.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=k;return D[0]=g*C,D[1]=g*P,D[2]=w,D[3]=-I*P+O*w*C,D[4]=I*C+O*w*P,D[5]=-O*g,D[6]=-O*P-I*w*C,D[7]=O*C-I*w*P,D[8]=I*g,y.multiply(N,D,t)}}};var j=new n;v.pointToWindowCoordinates=function(e,t,r,n){return n=v.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},v.pointToGLWindowCoordinates=function(e,r,a,i){u(i)||(i=new t);var o=j;return _.multiplyByVector(e,n.fromElements(a.x,a.y,a.z,1,o),o),n.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(r,o,o),t.fromCartesian4(o,i)};var Z=new r,K=new r,J=new r;v.rotationMatrixFromPositionVelocity=function(e,t,n,a){var i=o(n,d.WGS84).geodeticSurfaceNormal(e,Z),s=r.cross(t,i,K);r.equalsEpsilon(s,r.ZERO,p.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var c=r.cross(s,t,J);return r.cross(t,c,s),r.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new r,ee=new r,te=new n,re=new n,ne=new n,ae=new n,ie=new n,oe=new _,ue=new _;v.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=v.eastNorthUpToFixedFrame(o,i,oe),c=_.inverseTransformation(s,ue),l=e.project(u,$),f=re;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=_.getColumn(t,0,ee),h=r.magnitude(d),E=_.multiplyByVector(c,d,ne);n.fromElements(E.z,E.x,E.y,0,E);var m=_.getColumn(t,1,ee),p=r.magnitude(m),y=_.multiplyByVector(c,m,ae);n.fromElements(y.z,y.x,y.y,0,y);var T=_.getColumn(t,2,ee),R=r.magnitude(T),A=ie;return r.cross(E,y,A),r.normalize(A,A),r.cross(y,A,E),r.normalize(E,E),r.cross(A,E,y),r.normalize(y,y),r.multiplyByScalar(E,h,E),r.multiplyByScalar(y,p,y),r.multiplyByScalar(A,R,A),_.setColumn(a,0,E,a),_.setColumn(a,1,y,a),_.setColumn(a,2,A,a),_.setColumn(a,3,f,a),a};var se=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return v.wgs84To2DModelMatrix=function(e,t,r){var n=e.ellipsoid,a=v.eastNorthUpToFixedFrame(t,n,oe),i=_.inverseTransformation(a,ue),o=n.cartesianToCartographic(t,Q),u=e.project(o,$),s=re;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=_.fromTranslation(s,oe);return _.multiply(se,i,r),_.multiply(c,r,r),r},v}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=n(new a({position:!0})),a.POSITION_AND_NORMAL=n(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=n(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=n(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=n(new a({position:!0,color:!0})),a.ALL=n(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.position?1:0,r[n++]=t.normal?1:0,r[n++]=t.st?1:0,r[n++]=t.tangent?1:0,r[n++]=t.bitangent?1:0,r[n++]=t.color?1:0,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.position=1===r[n++],i.normal=1===r[n++],i.st=1===r[n++],i.tangent=1===r[n++],i.bitangent=1===r[n++],i.color=1===r[n++],i},a.clone=function(e,r){if(t(e))return t(r)||(r=new a),r.position=e.position,r.normal=e.normal,r.st=e.st,r.tangent=e.tangent,r.bitangent=e.bitangent,r.color=e.color,r},a}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R,v,A,S,N,g){"use strict";function I(e,n,i){var o=n.vertexFormat,u=n.center,s=n.semiMajorAxis,l=n.semiMinorAxis,d=n.ellipsoid,m=n.stRotation,p=i?e.length/3*2:e.length/3,y=n.shadowVolume,_=o.st?new Float32Array(2*p):void 0,R=o.normal?new Float32Array(3*p):void 0,v=o.tangent?new Float32Array(3*p):void 0,S=o.bitangent?new Float32Array(3*p):void 0,N=y?new Float32Array(3*p):void 0,g=0,I=q,w=V,O=W,M=new f(d),x=M.project(d.cartesianToCartographic(u,X),H),C=d.scaleToGeodeticSurface(u,L);d.geodeticSurfaceNormal(C,C);for(var P=A.fromAxisAngle(C,m,G),D=T.fromQuaternion(P,B),b=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),j=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),Z=e.length,K=i?Z:0,J=K/3*2,Q=0;Q<Z;Q+=3){var $=Q+1,ee=Q+2,te=r.fromArray(e,Q,L);if(o.st){var re=T.multiplyByVector(D,te,U),ne=M.project(d.cartesianToCartographic(re,X),F);r.subtract(ne,x,ne),z.x=(ne.x+s)/(2*s),z.y=(ne.y+l)/(2*l),b.x=Math.min(z.x,b.x),b.y=Math.min(z.y,b.y),j.x=Math.max(z.x,j.x),j.y=Math.max(z.y,j.y),i&&(_[g+J]=z.x,_[g+1+J]=z.y),_[g++]=z.x,_[g++]=z.y}(o.normal||o.tangent||o.bitangent||y)&&(I=d.geodeticSurfaceNormal(te,I),y&&(N[Q+K]=-I.x,N[$+K]=-I.y,N[ee+K]=-I.z),(o.normal||o.tangent||o.bitangent)&&((o.tangent||o.bitangent)&&(w=r.normalize(r.cross(r.UNIT_Z,I,w),w),T.multiplyByVector(D,w,w)),o.normal&&(R[Q]=I.x,R[$]=I.y,R[ee]=I.z,i&&(R[Q+K]=-I.x,R[$+K]=-I.y,R[ee+K]=-I.z)),o.tangent&&(v[Q]=w.x,v[$]=w.y,v[ee]=w.z,i&&(v[Q+K]=-w.x,v[$+K]=-w.y,v[ee+K]=-w.z)),o.bitangent&&(O=r.normalize(r.cross(I,w,O),O),S[Q]=O.x,S[$]=O.y,S[ee]=O.z,i&&(S[Q+K]=O.x,S[$+K]=O.y,S[ee+K]=O.z))))}if(o.st){Z=_.length;for(var ae=0;ae<Z;ae+=2)_[ae]=(_[ae]-b.x)/(j.x-b.x),_[ae+1]=(_[ae+1]-b.y)/(j.y-b.y)}var ie=new E;if(o.position){var oe=c.raisePositionsToHeight(e,n,i);ie.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:oe})}return o.st&&(ie.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),o.normal&&(ie.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),o.tangent&&(ie.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),o.bitangent&&(ie.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),y&&(ie.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:N})),ie}function w(e){var t,r,n,a,i,o=new Array(12*(e*(e+1))-6),u=0;for(t=0,n=1,a=0;a<3;a++)o[u++]=n++,o[u++]=t,o[u++]=n;for(a=2;a<e+1;++a){for(n=a*(a+1)-1,t=(a-1)*a-1,o[u++]=n++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=n++,o[u++]=t,o[u++]=n}for(r=2*e,++n,++t,a=0;a<r-1;++a)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;for(o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t++,o[u++]=t,++t,a=e-1;a>1;--a){for(o[u++]=t++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=t++,o[u++]=t++,o[u++]=n++}for(a=0;a<3;a++)o[u++]=t++,o[u++]=t,o[u++]=n;return o}function O(t){var n=t.center;j=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(n,j),t.height,j),j=r.add(n,j,j);var a=new e(j,t.semiMajorAxis),i=c.computeEllipsePositions(t,!0,!1),o=i.positions,u=i.numPts,s=I(o,t,!1),l=w(u);return l=y.createTypedArray(o.length/3,l),{boundingSphere:a,attributes:s,indices:l}}function M(e,n){var i=n.vertexFormat,o=n.center,u=n.semiMajorAxis,s=n.semiMinorAxis,c=n.ellipsoid,l=n.height,d=n.extrudedHeight,m=n.stRotation,p=e.length/3*2,y=new Float64Array(3*p),_=i.st?new Float32Array(2*p):void 0,R=i.normal?new Float32Array(3*p):void 0,v=i.tangent?new Float32Array(3*p):void 0,S=i.bitangent?new Float32Array(3*p):void 0,N=n.shadowVolume,g=N?new Float32Array(3*p):void 0,I=0,w=q,O=V,M=W,x=new f(c),C=x.project(c.cartesianToCartographic(o,X),H),P=c.scaleToGeodeticSurface(o,L);c.geodeticSurfaceNormal(P,P);for(var D=A.fromAxisAngle(P,m,G),j=T.fromQuaternion(D,B),Z=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),K=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),J=e.length,Q=J/3*2,$=0;$<J;$+=3){var ee,te=$+1,re=$+2,ne=r.fromArray(e,$,L);if(i.st){var ae=T.multiplyByVector(j,ne,U),ie=x.project(c.cartesianToCartographic(ae,X),F);r.subtract(ie,C,ie),z.x=(ie.x+u)/(2*u),z.y=(ie.y+s)/(2*s),Z.x=Math.min(z.x,Z.x),Z.y=Math.min(z.y,Z.y),K.x=Math.max(z.x,K.x),K.y=Math.max(z.y,K.y),_[I+Q]=z.x,_[I+1+Q]=z.y,_[I++]=z.x,_[I++]=z.y}ne=c.scaleToGeodeticSurface(ne,ne),ee=r.clone(ne,U),w=c.geodeticSurfaceNormal(ne,w),N&&(g[$+J]=-w.x,g[te+J]=-w.y,g[re+J]=-w.z);var oe=r.multiplyByScalar(w,l,b);if(ne=r.add(ne,oe,ne),oe=r.multiplyByScalar(w,d,oe),ee=r.add(ee,oe,ee),i.position&&(y[$+J]=ee.x,y[te+J]=ee.y,y[re+J]=ee.z,y[$]=ne.x,y[te]=ne.y,y[re]=ne.z),i.normal||i.tangent||i.bitangent){M=r.clone(w,M);var ue=r.fromArray(e,($+3)%J,b);r.subtract(ue,ne,ue);var se=r.subtract(ee,ne,F);w=r.normalize(r.cross(se,ue,w),w),i.normal&&(R[$]=w.x,R[te]=w.y,R[re]=w.z,R[$+J]=w.x,R[te+J]=w.y,R[re+J]=w.z),i.tangent&&(O=r.normalize(r.cross(M,w,O),O),v[$]=O.x,v[te]=O.y,v[re]=O.z,v[$+J]=O.x,v[$+1+J]=O.y,v[$+2+J]=O.z),i.bitangent&&(S[$]=M.x,S[te]=M.y,S[re]=M.z,S[$+J]=M.x,S[te+J]=M.y,S[re+J]=M.z)}}if(i.st){J=_.length;for(var ce=0;ce<J;ce+=2)_[ce]=(_[ce]-Z.x)/(K.x-Z.x),_[ce+1]=(_[ce+1]-Z.y)/(K.y-Z.y)}var le=new E;return i.position&&(le.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:y})),i.st&&(le.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),i.normal&&(le.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),i.tangent&&(le.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),i.bitangent&&(le.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),N&&(le.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:g})),le}function x(e){for(var t=e.length/3,r=y.createTypedArray(t,6*t),n=0,a=0;a<t;a++){var i=a,o=a+t,u=(i+1)%t,s=u+t;r[n++]=i,r[n++]=o,r[n++]=u,r[n++]=u,r[n++]=o,r[n++]=s}return r}function C(t){var n=t.center,a=t.ellipsoid,i=t.semiMajorAxis,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,L),t.height,L);Z.center=r.add(n,o,Z.center),Z.radius=i,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,o),t.extrudedHeight,o),K.center=r.add(n,o,K.center),K.radius=i;var u=c.computeEllipsePositions(t,!0,!0),s=u.positions,l=u.numPts,f=u.outerPositions,h=e.union(Z,K),E=I(s,t,!0),_=w(l),T=_.length;_.length=2*T;for(var R=s.length/3,A=0;A<T;A+=3)_[A+T]=_[A+2]+R,_[A+1+T]=_[A+1]+R,_[A+2+T]=_[A]+R;var S=y.createTypedArray(2*R/3,_),N=new d({attributes:E,indices:S,primitiveType:v.TRIANGLES}),g=M(f,t);_=x(f);var O=y.createTypedArray(2*f.length/3,_),C=new d({attributes:g,indices:O,primitiveType:v.TRIANGLES}),P=p.combineInstances([new m({geometry:N}),new m({geometry:C})]);return{boundingSphere:h,attributes:P[0].attributes,indices:P[0].indices}}function P(e,t,n,a,i){N.eastNorthUpToFixedFrame(e,t,J),R.inverseTransformation(J,Q);for(var o=0;o<4;++o)r.clone(r.ZERO,ee[o]);for(ee[0].x+=n,ee[1].x-=n,ee[2].y+=a,ee[3].y-=a,T.fromRotationZ(i,$),o=0;o<4;++o)T.multiplyByVector($,ee[o],ee[o]),R.multiplyByPoint(J,ee[o],ee[o]),t.cartesianToCartographic(ee[o],te[o]);return S.fromCartographicArray(te)}function D(e){e=i(e,i.EMPTY_OBJECT);var t=e.center,n=i(e.ellipsoid,l.WGS84),a=e.semiMajorAxis,u=e.semiMinorAxis,s=i(e.granularity,_.RADIANS_PER_DEGREE),c=i(e.height,0),f=e.extrudedHeight,d=o(f)&&Math.abs(c-f)>1,h=i(e.vertexFormat,g.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=a,this._semiMinorAxis=u,this._ellipsoid=l.clone(n),this._rotation=i(e.rotation,0),this._stRotation=i(e.stRotation,0),this._height=c,this._granularity=s,this._vertexFormat=g.clone(h),this._extrudedHeight=i(f,c),this._extrude=d,this._shadowVolume=i(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._rectangle=P(this._center,this._ellipsoid,a,u,this._rotation)}var L=new r,U=new r,F=new r,b=new r,z=new t,B=new T,G=new A,q=new r,V=new r,W=new r,X=new n,H=new r,Y=new t,k=new t,j=new r,Z=new e,K=new e,J=new R,Q=new R,$=new T,ee=[new r,new r,new r,new r],te=[new n,new n,new n,new n];D.packedLength=r.packedLength+l.packedLength+g.packedLength+S.packedLength+9,D.pack=function(e,t,n){return n=i(n,0),r.pack(e._center,t,n),n+=r.packedLength,l.pack(e._ellipsoid,t,n),n+=l.packedLength,g.pack(e._vertexFormat,t,n),n+=g.packedLength,S.pack(e._rectangle,t,n),n+=S.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._extrude?1:0,t[n]=e._shadowVolume?1:0,t};var re=new r,ne=new l,ae=new g,ie=new S,oe={center:re,ellipsoid:ne,vertexFormat:ae,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0};return D.unpack=function(e,t,n){t=i(t,0);var a=r.unpack(e,t,re);t+=r.packedLength;var u=l.unpack(e,t,ne);t+=l.packedLength;var s=g.unpack(e,t,ae);t+=g.packedLength;var c=S.unpack(e,t,ie);t+=S.packedLength;var f=e[t++],d=e[t++],h=e[t++],E=e[t++],m=e[t++],p=e[t++],y=e[t++],_=1===e[t++],T=1===e[t];return o(n)?(n._center=r.clone(a,n._center),n._ellipsoid=l.clone(u,n._ellipsoid),n._vertexFormat=g.clone(s,n._vertexFormat),n._semiMajorAxis=f,n._semiMinorAxis=d,n._rotation=h,n._stRotation=E,n._height=m,n._granularity=p,n._extrudedHeight=y,n._extrude=_,n._shadowVolume=T,n._rectangle=S.clone(c),n):(oe.height=m,oe.extrudedHeight=y,oe.granularity=p,oe.stRotation=E,oe.rotation=h,oe.semiMajorAxis=f,oe.semiMinorAxis=d,oe.shadowVolume=T,new D(oe))},D.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),r.shadowVolume=e._shadowVolume,t=C(r)):t=O(r),new d({attributes:t.attributes,indices:t.indices,primitiveType:v.TRIANGLES,boundingSphere:t.boundingSphere})}},D.createShadowVolume=function(e,t,r){var n=e._granularity,a=e._ellipsoid,i=t(n,a),o=r(n,a);return new D({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:a,rotation:e._rotation,stRotation:e._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:g.POSITION_ONLY,shadowVolume:!0})},u(D.prototype,{rectangle:{get:function(){return this._rectangle}}}),D}),define("Core/CircleGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT);var t=e.radius,n={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 i(n),this._workerName="createCircleGeometry"}s.packedLength=i.packedLength,s.pack=function(e,t,r){return i.pack(e._ellipseGeometry,t,r)};var c=new i({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new u,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return s.unpack=function(t,r,a){var f=i.unpack(t,r,c);return l.center=e.clone(f._center,l.center),l.ellipsoid=o.clone(f._ellipsoid,l.ellipsoid),l.height=f._height,l.extrudedHeight=f._extrudedHeight,l.granularity=f._granularity,l.vertexFormat=u.clone(f._vertexFormat,l.vertexFormat),l.stRotation=f._stRotation,l.shadowVolume=f._shadowVolume,n(a)?(l.semiMajorAxis=f._semiMajorAxis,l.semiMinorAxis=f._semiMinorAxis,a._ellipseGeometry=new i(l),a):(l.radius=f._semiMajorAxis,new s(l))},s.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},s.createShadowVolume=function(e,t,r){var n=e._ellipseGeometry._granularity,a=e._ellipseGeometry._ellipsoid,i=t(n,a),o=r(n,a);return new s({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:a,stRotation:e._ellipseGeometry._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:u.POSITION_ONLY,shadowVolume:!0})},a(s.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),s}),define("Workers/createCircleGeometry",["../Core/Cartesian3","../Core/CircleGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,r,n){"use strict";function a(a,i){return r(i)&&(a=t.unpack(a,i)),a._ellipseGeometry._center=e.clone(a._ellipseGeometry._center),a._ellipseGeometry._ellipsoid=n.clone(a._ellipseGeometry._ellipsoid),t.createGeometry(a)}return a})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var f=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,f=n*u-a*o;return r.x=c,r.y=l,r.z=f,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:E,c=Math.cos(n);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(n),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),r(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,f=r.y,d=r.z,h=a.x,E=a.y,m=a.z,p=l*l*h*h,y=f*f*E*E,_=d*d*m*m,T=p+y+_,R=Math.sqrt(1/T),v=e.multiplyByScalar(r,R,i);if(T<s)return isFinite(R)?e.clone(v,c):void 0;var A=u.x,S=u.y,N=u.z,g=o;g.x=v.x*A*2,g.y=v.y*S*2,g.z=v.z*N*2;var I,w,O,M,x,C,P,D,L,U,F,b=(1-R)*e.magnitude(r)/(.5*e.magnitude(g)),z=0;do{b-=z,O=1/(1+b*A),M=1/(1+b*S),x=1/(1+b*N),C=O*O,P=M*M,D=x*x,L=C*O,U=P*M,F=D*x,I=p*C+y*P+_*D-1,w=p*L*A+y*U*S+_*F*N;var B=-2*w;z=I/B}while(Math.abs(I)>n.EPSILON12);return t(c)?(c.x=l*O,c.y=f*M,c.z=d*x,c):new e(l*O,f*M,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,t,n){this.longitude=r(e,0),this.latitude=r(t,0),this.height=r(n,0)}u.fromRadians=function(e,t,a,i){return a=r(a,0),n(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:d,p=n(r)?r._centerToleranceSquared:h,y=o(t,E,m,p,c);if(n(y)){var _=e.multiplyComponents(y,m,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),R=Math.atan2(_.y,_.x),v=Math.asin(_.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=v,a.height=A,a):new u(R,v,A)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,r){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._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,r){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,E);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(m[r],E[r])];t+=2*n*n}return Math.sqrt(t)}function f(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>n&&(a=i,n=o)}var c=1,l=0,f=E[a],d=m[a];if(Math.abs(e[s.getElementIndex(d,f)])>r){var h,p=e[s.getElementIndex(d,d)],y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(d,f)],T=(p-y)/2/_;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=r-u-f+h,m=2*(a-d),p=2*(i+l),y=2*(a+d),_=-r+u-f+h,T=2*(c-o),R=2*(i-l),v=2*(c+o),A=-r-u+f+h;return n(t)?(t[0]=E,t[1]=y,t[2]=R,t[3]=m,t[4]=_,t[5]=v,t[6]=p,t[7]=T,t[8]=A,t):new s(E,m,p,y,_,T,R,v,A)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=r*u,E=i*a+c*o*u,m=-c*a+i*o*u,p=-o,y=c*r,_=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=f,t[4]=E,t[5]=y,t[6]=d,t[7]=m,t[8]=_,t):new s(l,f,d,h,E,m,p,y,_)},s.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var d=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),r};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},s.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},s.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},s.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],p=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,i=0,o=0;n(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=r*c(h);o<a&&l(h)>E;)f(h,p),s.transpose(p,y),s.multiply(h,p,h),s.multiply(y,h,h),s.multiply(d,p,d),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-n*f,t[2]=n*u-o*a,t[3]=c*u-i*f,t[4]=r*f-c*a,t[5]=i*a-r*u,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/d;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){ +"use strict";function l(e,t,r,a,i,o,u,s,c,l,f,d,h,E,m,p){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(m,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(d,0),this[15]=n(p,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new l),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,r,i){return r=n(r,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,i):new l(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-h-p+_,R=2*(c-y),v=2*(f+m),A=2*(c+y),S=-s+h-p+_,N=2*(E-d),g=2*(f-m),I=2*(E+d),w=-s-h+p+_;return n[0]=T*i,n[1]=A*i,n[2]=g*i,n[3]=0,n[4]=R*o,n[5]=S*o,n[6]=I*o,n[7]=0,n[8]=v*u,n[9]=N*u,n[10]=w*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,r){var n=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,m=f.y,p=f.z,y=h.x,_=h.y,T=h.z,R=n.x,v=n.y,A=n.z,S=u*-R+s*-v+c*-A,N=y*-R+_*-v+T*-A,g=E*R+m*v+p*A;return a(r)?(r[0]=u,r[1]=y,r[2]=-E,r[3]=0,r[4]=s,r[5]=_,r[6]=-m,r[7]=0,r[8]=c,r[9]=T,r[10]=-p,r[11]=0,r[12]=S,r[13]=N,r[14]=g,r[15]=1,r):new l(u,s,c,S,y,_,T,N,-E,-m,-p,g,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,f=-(n+r)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),d=c,h=l,E=f,m=i+c,p=o+l,y=t+f,_=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=p,a[14]=y,a[15]=_,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var E=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),r};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],p=e[13],y=e[14],_=e[15],T=t[0],R=t[1],v=t[2],A=t[3],S=t[4],N=t[5],g=t[6],I=t[7],w=t[8],O=t[9],M=t[10],x=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=n*T+u*R+f*v+m*A,F=a*T+s*R+d*v+p*A,b=i*T+c*R+h*v+y*A,z=o*T+l*R+E*v+_*A,B=n*S+u*N+f*g+m*I,G=a*S+s*N+d*g+p*I,q=i*S+c*N+h*g+y*I,V=o*S+l*N+E*g+_*I,W=n*w+u*O+f*M+m*x,X=a*w+s*O+d*M+p*x,H=i*w+c*O+h*M+y*x,Y=o*w+l*O+E*M+_*x,k=n*C+u*P+f*D+m*L,j=a*C+s*P+d*D+p*L,Z=i*C+c*P+h*D+y*L,K=o*C+l*P+E*D+_*L;return r[0]=U,r[1]=F,r[2]=b,r[3]=z,r[4]=B,r[5]=G,r[6]=q,r[7]=V,r[8]=W,r[9]=X,r[10]=H,r[11]=Y,r[12]=k,r[13]=j,r[14]=Z,r[15]=K,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],p=t[1],y=t[2],_=t[4],T=t[5],R=t[6],v=t[8],A=t[9],S=t[10],N=t[12],g=t[13],I=t[14],w=n*m+o*p+c*y,O=a*m+u*p+l*y,M=i*m+s*p+f*y,x=n*_+o*T+c*R,C=a*_+u*T+l*R,P=i*_+s*T+f*R,D=n*v+o*A+c*S,L=a*v+u*A+l*S,U=i*v+s*A+f*S,F=n*N+o*g+c*I+d,b=a*N+u*g+l*I+h,z=i*N+s*g+f*I+E;return r[0]=w,r[1]=O,r[2]=M,r[3]=0,r[4]=x,r[5]=C,r[6]=P,r[7]=0,r[8]=D,r[9]=L,r[10]=U,r[11]=0,r[12]=F,r[13]=b,r[14]=z,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],p=t[4],y=t[5],_=t[6],T=t[7],R=t[8],v=n*d+o*h+c*E,A=a*d+u*h+l*E,S=i*d+s*h+f*E,N=n*m+o*p+c*y,g=a*m+u*p+l*y,I=i*m+s*p+f*y,w=n*_+o*T+c*R,O=a*_+u*T+l*R,M=i*_+s*T+f*R;return r[0]=v,r[1]=A,r[2]=S,r[3]=0,r[4]=N,r[5]=g,r[6]=I,r[7]=0,r[8]=w,r[9]=O,r[10]=M,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var p=new e;l.multiplyByUniformScale=function(e,t,r){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var y=new s,_=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,y),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],p=e[6],v=e[10],A=e[14],S=e[3],N=e[7],g=e[11],I=e[15],w=v*I,O=A*g,M=p*I,x=A*N,C=p*g,P=v*N,D=m*I,L=A*S,U=m*g,F=v*S,b=m*N,z=p*S,B=w*d+x*h+C*E-(O*d+M*h+P*E),G=O*f+D*h+F*E-(w*f+L*h+U*E),q=M*f+L*d+b*E-(x*f+D*d+z*E),V=P*f+U*d+z*h-(C*f+F*d+b*h),W=O*a+M*i+P*o-(w*a+x*i+C*o),X=w*n+L*i+U*o-(O*n+D*i+F*o),H=x*n+D*a+z*o-(M*n+L*a+b*o),Y=C*n+F*a+b*i-(P*n+U*a+z*i);w=i*E,O=o*h,M=a*E,x=o*d,C=a*h,P=i*d,D=n*E,L=o*f,U=n*h,F=i*f,b=n*d,z=a*f;var k=w*N+x*g+C*I-(O*N+M*g+P*I),j=O*S+D*g+F*I-(w*S+L*g+U*I),Z=M*S+L*N+b*I-(x*S+D*N+z*I),K=P*S+U*N+z*g-(C*S+F*N+b*g),J=M*v+P*A+O*p-(C*A+w*p+x*v),Q=U*A+w*m+L*v-(D*v+F*A+O*m),$=D*p+z*A+x*m-(b*A+M*m+L*p),ee=b*v+C*m+F*p-(U*p+z*v+P*m),te=n*B+a*G+i*q+o*V;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=B*te,r[1]=G*te,r[2]=q*te,r[3]=V*te,r[4]=W*te,r[5]=X*te,r[6]=H*te,r[7]=Y*te,r[8]=k*te,r[9]=j*te,r[10]=Z*te,r[11]=K*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-r*f-n*d-a*h,m=-i*f-o*d-u*h,p=-s*f-c*d-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(r(e,0)),t=u.toRadians(r(t,0)),a=u.toRadians(r(a,0)),i=u.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=f,r):new s(a,l,i,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return n(r)?(r.west=l,r.south=d,r.east=f,r.north=h,r):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0),n(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,E=new e,m=new e,p=new e,y=new e,_=new e,T=new e,R=new e,v=new e,A=new e,S=new e,N=new e;d.fromPoints=function(t,r){if(a(r)||(r=new d),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],T),i=e.clone(n,h),o=e.clone(n,E),u=e.clone(n,m),s=e.clone(n,p),c=e.clone(n,y),l=e.clone(n,_),f=t.length,g=1;g<f;g++){e.clone(t[g],n);var I=n.x,w=n.y,O=n.z;I<i.x&&e.clone(n,i),I>s.x&&e.clone(n,s),w<o.y&&e.clone(n,o),w>c.y&&e.clone(n,c),O<u.z&&e.clone(n,u),O>l.z&&e.clone(n,l)}var M=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,D=s,L=M;x>L&&(L=x,P=o,D=c),C>L&&(L=C,P=u,D=l);var U=v;U.x=.5*(P.x+D.x),U.y=.5*(P.y+D.y),U.z=.5*(P.z+D.z);var F=e.magnitudeSquared(e.subtract(D,U,R)),b=Math.sqrt(F),z=A;z.x=i.x,z.y=o.y,z.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,R),.5,N),q=0;for(g=0;g<f;g++){e.clone(t[g],n);var V=e.magnitude(e.subtract(n,G,R));V>q&&(q=V);var W=e.magnitudeSquared(e.subtract(n,U,R));if(W>F){var X=Math.sqrt(W);b=.5*(b+X),F=b*b;var H=X-b;U.x=(b*U.x+H*n.x)/X,U.y=(b*U.y+H*n.y)/X,U.z=(b*U.z+H*n.z)/X}}return b<q?(e.clone(U,r.center),r.radius=b):(e.clone(G,r.center),r.radius=q),r};var g=new o,I=new e,w=new e,O=new t,M=new t;d.fromRectangle2D=function(e,t,r){return d.fromRectangleWithHeights2D(e,t,0,0,r)},d.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,g),f.southwest(t,O),O.height=i,f.northeast(t,M),M.height=o;var s=r.project(O,I),c=r.project(M,w),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,r,o){t=n(t,i.WGS84),r=n(r,0);var u;return a(e)&&(u=f.subsample(e,t,r,x)),d.fromPoints(u,o)},d.fromVertices=function(t,r,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),i=n(i,3);var u=T;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,p),g=e.clone(u,y),I=e.clone(u,_),w=t.length,O=0;O<w;O+=i){var M=t[O]+r.x,x=t[O+1]+r.y,C=t[O+2]+r.z;u.x=M,u.y=x,u.z=C,M<s.x&&e.clone(u,s),M>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>g.y&&e.clone(u,g),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(g,c,R)),L=e.magnitudeSquared(e.subtract(I,l,R)),U=s,F=f,b=P;D>b&&(b=D,U=c,F=g),L>b&&(b=L,U=l,F=I);var z=v;z.x=.5*(U.x+F.x),z.y=.5*(U.y+F.y),z.z=.5*(U.z+F.z);var B=e.magnitudeSquared(e.subtract(F,z,R)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var V=S;V.x=f.x,V.y=g.y,V.z=I.z;var W=e.multiplyByScalar(e.add(q,V,R),.5,N),X=0;for(O=0;O<w;O+=i){u.x=t[O]+r.x,u.y=t[O+1]+r.y,u.z=t[O+2]+r.z;var H=e.magnitude(e.subtract(u,W,R));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var j=k-G;z.x=(G*z.x+j*u.x)/k,z.y=(G*z.y+j*u.y)/k,z.z=(G*z.z+j*u.z)/k}}return G<X?(e.clone(z,o.center),o.radius=G):(e.clone(W,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new d),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=T;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,y),f=e.clone(i,_),g=t.length,I=0;I<g;I+=3){var w=t[I]+r[I],O=t[I+1]+r[I+1],M=t[I+2]+r[I+2];i.x=w,i.y=O,i.z=M,w<o.x&&e.clone(i,o),w>c.x&&e.clone(i,c),O<u.y&&e.clone(i,u),O>l.y&&e.clone(i,l),M<s.z&&e.clone(i,s),M>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),D=o,L=c,U=x;C>U&&(U=C,D=u,L=l),P>U&&(U=P,D=s,L=f);var F=v;F.x=.5*(D.x+L.x),F.y=.5*(D.y+L.y),F.z=.5*(D.z+L.z);var b=e.magnitudeSquared(e.subtract(L,F,R)),z=Math.sqrt(b),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,R),.5,N),V=0;for(I=0;I<g;I+=3){i.x=t[I]+r[I],i.y=t[I+1]+r[I+1],i.z=t[I+2]+r[I+2];var W=e.magnitude(e.subtract(i,q,R));W>V&&(V=W);var X=e.magnitudeSquared(e.subtract(i,F,R));if(X>b){var H=Math.sqrt(X);z=.5*(z+H),b=z*z;var Y=H-z;F.x=(z*F.x+Y*i.x)/H,F.y=(z*F.y+Y*i.y)/H,F.z=(z*F.z+Y*i.z)/H}}return z<V?(e.clone(F,n.center),n.radius=z):(e.clone(q,n.center),n.radius=V),n},d.fromCornerPoints=function(t,r,n){a(n)||(n=new d);var i=n.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),n.radius=e.distance(i,r),n},d.fromEllipsoid=function(t,r){return a(r)||(r=new d),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var C=new e;d.fromBoundingSpheres=function(t,r){if(a(r)||(r=new d),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return d.clone(t[0],r);if(2===n)return d.union(t[0],t[1],r);for(var i=[],o=0;o<n;o++)i.push(t[o].center);r=d.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return r.radius=s,r};var P=new e,D=new e,L=new e;d.fromOrientedBoundingBox=function(t,r){a(r)||(r=new d);var n=t.halfAxes,i=c.getColumn(n,0,P),o=c.getColumn(n,1,D),u=c.getColumn(n,2,L);return e.add(i,o,i),e.add(i,u,i),r.center=e.clone(t.center,r.center),r.radius=e.magnitude(i),r},d.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},d.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new d);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var U=new e,F=new e;d.union=function(t,r,n){a(n)||(n=new d);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(h,i,h),e.clone(h,n.center),n.radius=f,n};var b=new e;d.expand=function(t,r,n){n=d.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,b));return a>n.radius&&(n.radius=a),n},d.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,r){return a(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var z=new e;d.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},d.transformWithoutScale=function(e,t,r){return a(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var B=new e;d.computePlaneDistances=function(t,r,n,i){a(i)||(i=new s);var o=e.subtract(t.center,r,B),u=e.dot(n,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,W=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,r,a){r=n(r,j);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,W),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var p=E.length,y=0;y<p;++y){var _=E[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);r.project(T,_)}a=d.fromPoints(E,a),o=a.center;var R=o.x,v=o.y,A=o.z;return o.x=A,o.y=R,o.z=v,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,r){return d.computePlaneDistances(this,e,t,r)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var a=0;a<n;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{ +get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(v)&&(v=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,A=n(e[1]))}return v}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=n(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(g=!0,I=n(e[1]),I.isNightly=!!e[2])}return g}function c(){return s()&&I}function l(){if(!t(w)){w=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(w=!0,O=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(w=!0,O=n(e[1])))}return w}function f(){return l()&&O}function d(){if(!t(M)){M=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(M=!0,x=n(e[1]))}return M}function h(){return d()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=n(e[1]))}return C}function m(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function p(){return E()&&P}function y(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),L}function _(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(U=r)}return F}function T(){return _()?U:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var v,A,S,N,g,I,w,O,M,x,C,P,D,L,U,F,b={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return b.supportsFullscreen=function(){return r.supportsFullscreen()},b.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},b.supportsWebWorkers=function(){return"undefined"!=typeof Worker},b}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(a[r])||(a[r]=!0,console.warn(e(n,r)))}var a={};return n.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.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(t,r,n){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(n,0)}return a.fromQuaternion=function(e,r){t(r)||(r=new a);var n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(s,u),r.roll=Math.atan2(o,i),r.pitch=-Math.asin(n),r},a.fromDegrees=function(e,r,i,o){return t(o)||(o=new a),o.heading=e*n.RADIANS_PER_DEGREE,o.pitch=r*n.RADIANS_PER_DEGREE,o.roll=i*n.RADIANS_PER_DEGREE,o},a.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},a.equalsEpsilon=function(e,r,a,i){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,a,i)&&n.equalsEpsilon(e.pitch,r.pitch,a,i)&&n.equalsEpsilon(e.roll,r.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.z=r(n,0),this.w=r(a,0)}var f=new e;l.fromAxisAngle=function(t,r,a){var i=r/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,d=Math.cos(i);return n(a)?(a.x=u,a.y=s,a.z=c,a.w=d,a):new l(u,s,c,d)};var d=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var r,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+f+E;if(m>0)r=Math.sqrt(m+1),u=.5*r,r=.5/r,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*r,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*r,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*r;else{var p=d,y=0;f>s&&(y=1),E>s&&E>f&&(y=2);var _=p[y],T=p[_];r=Math.sqrt(e[c.getElementIndex(y,y)]-e[c.getElementIndex(_,_)]-e[c.getElementIndex(T,T)]+1);var R=h;R[y]=.5*r,r=.5/r,u=(e[c.getElementIndex(T,_)]-e[c.getElementIndex(_,T)])*r,R[_]=(e[c.getElementIndex(_,y)]+e[c.getElementIndex(y,_)])*r,R[T]=(e[c.getElementIndex(T,y)]+e[c.getElementIndex(y,T)])*r,a=-R[0],i=-R[1],o=-R[2]}return n(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,p=new l,y=new l;l.fromHeadingPitchRoll=function(t,r,n,i){var o;return t instanceof u?(o=t,i=r):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,r,n)),y=l.fromAxisAngle(e.UNIT_X,o.roll,E),p=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(p,y,p),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var _=new e,T=new e,R=new l,v=new l,A=new l;l.packedLength=4,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},l.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,r,n){l.unpack(e,4*r,A),l.conjugate(A,A);for(var a=0,i=r-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,A,R),R.w<0&&l.negate(R,R),l.computeAxis(R,_);var u=l.computeAngle(R);n[o]=_.x*u,n[o+1]=_.y*u,n[o+2]=_.z*u}},l.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(r,4*i,v),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,v,o)},l.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var r=1/l.magnitude(e),n=e.x*r,a=e.y*r,i=e.z*r,o=e.w*r;return t.x=n,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var r=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/r,t)},l.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},l.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+n*l+a*c-i*s,d=o*s-n*c+a*l+i*u,h=o*c+n*s-a*u+i*l,E=o*l-n*u-a*s-i*c;return r.x=f,r.y=d,r.z=h,r.w=E,r},l.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},l.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},l.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var S=new l;l.lerp=function(e,t,r,n){return S=l.multiplyByScalar(t,r,S),n=l.multiplyByScalar(e,1-r,n),l.add(S,n,n)};var N=new l,g=new l,I=new l;l.slerp=function(e,t,r,n){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,r,n);var o=Math.acos(a);return g=l.multiplyByScalar(e,Math.sin((1-r)*o),g),I=l.multiplyByScalar(i,Math.sin(r*o),I),n=l.add(g,I,n),l.multiplyByScalar(n,1/Math.sin(o),n)},l.log=function(t,r){var n=s.acosClamped(t.w),a=0;return 0!==n&&(a=n/Math.sin(n)),e.multiplyByScalar(t,a,r)},l.exp=function(t,r){var n=e.magnitude(t),a=0;return 0!==n&&(a=Math.sin(n)/n),r.x=t.x*a,r.y=t.y*a,r.z=t.z*a,r.w=Math.cos(n),r};var w=new e,O=new e,M=new l,x=new l;l.computeInnerQuadrangle=function(t,r,n,a){var i=l.conjugate(r,M);l.multiply(i,n,x);var o=l.log(x,w);l.multiply(i,t,x);var u=l.log(x,O);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,M),l.multiply(r,M,a)},l.squad=function(e,t,r,n,a,i){var o=l.slerp(e,t,a,M),u=l.slerp(r,n,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],b=0;b<7;++b){var z=b+1,B=2*z+1;D[b]=1/(z*B),L[b]=z/B}return D[7]=P/136,L[7]=8*P/17,l.fastSlerp=function(e,t,r,n){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-r,s=r*r,c=u*u,f=7;f>=0;--f)U[f]=(D[f]*s-L[f])*o,F[f]=(D[f]*c-L[f])*o;var d=a*r*(1+U[0]*(1+U[1]*(1+U[2]*(1+U[3]*(1+U[4]*(1+U[5]*(1+U[6]*(1+U[7])))))))),h=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,h,C);return l.multiplyByScalar(t,d,n),l.add(E,n,n)},l.fastSquad=function(e,t,r,n,a,i){var o=l.fastSlerp(e,t,a,M),u=l.fastSlerp(r,n,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,n){"use strict";function a(t,a,i,l,f,d,h,E,m,p){var y=t+a;e.multiplyByScalar(l,Math.cos(y),o),e.multiplyByScalar(i,Math.sin(y),u),e.add(o,u,o);var _=Math.cos(t);_*=_;var T=Math.sin(t);T*=T;var R=d/Math.sqrt(h*_+f*T),v=R/E;return n.fromAxisAngle(o,v,s),r.fromQuaternion(s,c),r.multiplyByVector(c,m,p),e.normalize(p,p),e.multiplyByScalar(p,E,p),p}var i={},o=new e,u=new e,s=new n,c=new r,l=new e,f=new e,d=new e,h=new e;i.raisePositionsToHeight=function(t,r,n){for(var a=r.ellipsoid,i=r.height,o=r.extrudedHeight,u=n?t.length/3*2:t.length/3,s=new Float64Array(3*u),c=t.length,E=n?c:0,m=0;m<c;m+=3){var p=m+1,y=m+2,_=e.fromArray(t,m,l);a.scaleToGeodeticSurface(_,_);var T=e.clone(_,f),R=a.geodeticSurfaceNormal(_,h),v=e.multiplyByScalar(R,i,d);e.add(_,v,_),n&&(e.multiplyByScalar(R,o,v),e.add(T,v,T),s[m+E]=T.x,s[p+E]=T.y,s[y+E]=T.z),s[m]=_.x,s[p]=_.y,s[y]=_.z}return s};var E=new e,m=new e,p=new e;return i.computeEllipsePositions=function(r,n,i){var o=r.semiMinorAxis,u=r.semiMajorAxis,s=r.rotation,c=r.center,h=8*r.granularity,y=o*o,_=u*u,T=u*o,R=e.magnitude(c),v=e.normalize(c,E),A=e.cross(e.UNIT_Z,c,m);A=e.normalize(A,A);var S=e.cross(v,A,p),N=1+Math.ceil(t.PI_OVER_TWO/h),g=t.PI_OVER_TWO/(N-1),I=t.PI_OVER_TWO-N*g;I<0&&(N-=Math.ceil(Math.abs(I)/g));var w,O,M,x,C,P=2*(N*(N+2)),D=n?new Array(3*P):void 0,L=0,U=l,F=f,b=4*N*3,z=b-1,B=0,G=i?new Array(b):void 0;for(I=t.PI_OVER_TWO,U=a(I,s,S,A,y,T,_,R,v,U),n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x),I=t.PI_OVER_TWO-g,w=1;w<N+1;++w){if(U=a(I,s,S,A,y,T,_,R,v,U),F=a(Math.PI-I,s,S,A,y,T,_,R,v,F),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,M=2*w+2,O=1;O<M-1;++O)x=O/(M-1),C=e.lerp(U,F,x,d),D[L++]=C.x,D[L++]=C.y,D[L++]=C.z;D[L++]=F.x,D[L++]=F.y,D[L++]=F.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=F.x,G[B++]=F.y,G[B++]=F.z),I=t.PI_OVER_TWO-(w+1)*g}for(w=N;w>1;--w){if(I=t.PI_OVER_TWO-(w-1)*g,U=a(-I,s,S,A,y,T,_,R,v,U),F=a(I+Math.PI,s,S,A,y,T,_,R,v,F),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,M=2*(w-1)+2,O=1;O<M-1;++O)x=O/(M-1),C=e.lerp(U,F,x,d),D[L++]=C.x,D[L++]=C.y,D[L++]=C.z;D[L++]=F.x,D[L++]=F.y,D[L++]=F.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=F.x,G[B++]=F.y,G[B++]=F.z)}I=t.PI_OVER_TWO,U=a(-I,s,S,A,y,T,_,R,v,U);var q={};return n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,q.positions=D,q.numPts=N),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,q.outerPositions=G),q},i}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values; +}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,r,n,a,i){"use strict";var o={};o.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,a=r.y;r.x=(1-Math.abs(a))*i.signNotZero(n),r.y=(1-Math.abs(n))*i.signNotZero(a)}return r.x=i.toSNorm(r.x,t),r.y=i.toSNorm(r.y,t),r},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,r,n,a){if(a.x=i.fromSNorm(e,n),a.y=i.fromSNorm(r,n),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},o.octDecode=function(e,t,r){return o.octDecodeInRange(e,t,255,r)},o.octPackFloat=function(e){return 256*e.x+e.y};var u=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,u),o.octPackFloat(u)},o.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return o.octDecode(n,a,t)},o.octPack=function(e,t,r,n){var a=o.octEncodeFloat(e),i=o.octEncodeFloat(t),s=o.octEncode(r,u);return n.x=65536*s.x+a,n.y=65536*s.y+i,n},o.octUnpack=function(e,t,r,n){var a=e.x/65536,i=Math.floor(a),u=65536*(a-i);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);o.octDecodeFloat(u,t),o.octDecodeFloat(c,r),o.octDecode(i,s,n)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},o.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},o}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined"],function(e,t,r,n){"use strict";function a(r,a,s,c,l){n(l)||(l=new t);var f,d,h,E,m,p,y,_;n(a.z)?(f=t.subtract(s,a,i),d=t.subtract(c,a,o),h=t.subtract(r,a,u),E=t.dot(f,f),m=t.dot(f,d),p=t.dot(f,h),y=t.dot(d,d),_=t.dot(d,h)):(f=e.subtract(s,a,i),d=e.subtract(c,a,o),h=e.subtract(r,a,u),E=e.dot(f,f),m=e.dot(f,d),p=e.dot(f,h),y=e.dot(d,d),_=e.dot(d,h));var T=1/(E*y-m*m);return l.y=(y*p-m*_)*T,l.z=(E*_-m*p)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[d/e,a/d]:[a/d,d/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,p=u*c-h,y=4*E*p-m*m;if(y<0){var _,T,R;d*f>=l*h?(_=o,T=E,R=-2*u*E+o*m):(_=c,T=p,R=-c*m+2*s*p);var v=R<0?-1:1,A=-v*Math.abs(_)*Math.sqrt(-y);i=-R+A;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),g=i===A?-N:-T/N;return a=T<=0?N+g:-R/(N*N+g*g+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var I=E,w=-2*u*E+o*m,O=p,M=-c*m+2*s*p,x=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-w)/3);a=2*Math.sqrt(-I);var D=Math.cos(P);i=a*D;var L=a*(-D/2-C*Math.sin(P)),U=i+L>2*u?i-u:L-u,F=o,b=U/F;P=Math.abs(Math.atan2(c*x,-M)/3),a=2*Math.sqrt(-O),D=Math.cos(P),i=a*D,L=a*(-D/2-C*Math.sin(P));var z=-c,B=i+L<2*s?i+s:L+s,G=z/B,q=F*B,V=-U*B-F*z,W=U*z,X=(s*V-u*W)/(-u*V+s*q);return b<=X?b<=G?X<=G?[b,X,G]:[b,G,X]:[G,b,X]:b<=G?[X,b,G]:X<=G?[X,G,b]:[G,X,b]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var E=n.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],y=E[1];if(p>=0&&y>=0){var _=Math.sqrt(p),T=Math.sqrt(y);return[d-T,d-_,d+_,d+T]}if(p>=0&&y<0)return m=Math.sqrt(p),[d-m,d+m];if(p<0&&y>=0)return m=Math.sqrt(y),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),v=(s+h-c/R)/2,A=(s+h+c/R)/2,S=n.computeRealRoots(1,R,v),N=n.computeRealRoots(1,-R,A);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==N.length?(N[0]+=d,N[1]+=d,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=d,N[1]+=d,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,p=h[0],y=a-p,_=y*y,T=t/2,R=y/2,v=_-4*o,A=_+4*Math.abs(o),S=c-4*p,N=c+4*Math.abs(p);if(p<0||v*N<S*A){var g=Math.sqrt(S);E=g/2,m=0===g?0:(t*R-i)/g}else{var I=Math.sqrt(v);E=0===I?0:(t*R-i)/I,m=I/2}var w,O;0===T&&0===E?(w=0,O=0):r.sign(T)===r.sign(E)?(w=T+E,O=p/w):(O=T-E,w=p/O);var M,x;0===R&&0===m?(M=0,x=0):r.sign(R)===r.sign(m)?(M=R+m,x=o/M):(x=R-m,M=o/x);var C=n.computeRealRoots(1,w,M),P=n.computeRealRoots(1,O,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,d=f*n,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*r*d-27*i*f*f+256*o*E+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*i*r*f)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return m},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n}return a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";function f(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function d(t,r,a){n(a)||(a=new i);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,_),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(d,h,E,A);if(n(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function E(t,r,n,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),p=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*r.x+n,y=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),T=[];if(0===_&&0===y){if(l=s.computeRealRoots(E,m,p),0===l.length)return T;var R=l[0],v=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-v)),T.push(new e(a,i*R,i*v)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,i*A,i*-S)),T.push(new e(a,i*A,i*S))}return T}var N=_*_,g=y*y,I=E*E,w=_*y,O=I+g,M=2*(m*E+w),x=2*p*E+m*m-g+N,C=2*(p*m-w),P=p*p-N;if(0===O&&0===M&&0===x&&0===C)return T;l=c.computeRealRoots(O,M,x,C,P);var D=l.length;if(0===D)return T;for(var L=0;L<D;++L){var U,F=l[L],b=F*F,z=Math.max(1-b,0),B=Math.sqrt(z);U=o.sign(E)===o.sign(p)?h(E*b+p,m*F,o.EPSILON12):o.sign(p)===o.sign(m*F)?h(E*b,m*F+p,o.EPSILON12):h(E*b+m*F,p,o.EPSILON12);var G=h(y*F,_,o.EPSILON15),q=U*G;q<0?T.push(new e(a,i*F,i*B)):q>0?T.push(new e(a,i*F,i*-B)):0!==B?(T.push(new e(a,i*F,i*-B)),T.push(new e(a,i*F,i*B)),++L):T.push(new e(a,i*F,i*B))}return T}var m={};m.rayPlane=function(t,r,a){n(a)||(a=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,y=new e,_=new e,T=new e,R=new e;m.rayTriangleParametric=function(t,n,a,i,u){u=r(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,m=e.subtract(a,n,p),v=e.subtract(i,n,y),A=e.cross(E,v,_),S=e.dot(m,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,n,T),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(v,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(h,n,T),l=e.dot(s,A)*N,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*N,f<0||l+f>1)return;d=e.dot(v,c)*N}return d},m.rayTriangle=function(t,r,a,i,o,u){var s=m.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var v=new l;m.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=v;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};m.raySphere=function(e,t,r){if(r=d(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new l;m.lineSegmentSphere=function(t,r,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,g=new e;m.rayEllipsoid=function(t,r){var n,a,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,g),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(n=d-1,a=e.magnitudeSquared(f),o=a*n,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,p=n/s;return m<p?new i(m,p):{start:p,stop:m}}var y=Math.sqrt(n/a);return new i(y,y)}return d<1?(n=d-1,a=e.magnitudeSquared(f),o=a*n,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var I=new e,w=new e,O=new e,M=new e,x=new e,C=new u,P=new u,D=new u,L=new u,U=new u,F=new u,b=new u,z=new e,B=new e,G=new t;m.grazingAltitudeLocation=function(t,r){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,I);if(e.dot(i,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(i,I),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,M),h=e.normalize(e.cross(d,f,w),w),m=e.normalize(e.cross(f,h,O),O),p=C;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=h.x,p[4]=h.y,p[5]=h.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var y=u.transpose(p,P),_=u.fromScale(r.radii,D),T=u.fromScale(r.oneOverRadii,L),R=U;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var v,A,S=u.multiply(u.multiply(y,T,F),R,F),N=u.multiply(u.multiply(S,_,b),p,b),g=u.multiplyByVector(S,a,x),q=E(N,e.negate(g,I),0,0,1),V=q.length;if(V>0){for(var W=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,H=0;H<V;++H){v=u.multiplyByVector(_,u.multiplyByVector(p,q[H],z),z);var Y=e.normalize(e.subtract(v,a,M),M),k=e.dot(Y,i);k>X&&(X=k,W=e.clone(v,W))}var j=r.cartesianToCartographic(W,G);return X=o.clamp(X,0,1),A=e.magnitude(e.subtract(W,a,M))*Math.sqrt(1-X*X),A=c?-A:A,j.height=A,r.cartographicToCartesian(j,new e)}};var q=new e;return m.lineSegmentPlane=function(t,r,a,i){n(i)||(i=new e);var u=e.subtract(r,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(t,n,a,d),{positions:[t,r,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(r,t,a,d),{positions:[t,r,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(n,r,a,d),{positions:[t,r,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(n,t,a,d),{positions:[t,r,n,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(t,r,a,d),{positions:[t,r,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(r,n,a,d),{positions:[t,r,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,r,n,a){"use strict";function i(t,r){this.normal=e.clone(t),this.distance=r}i.fromPointNormal=function(r,n,a){var o=-e.dot(n,r);return t(a)?(e.clone(n,a.normal),a.distance=o,a):new i(n,o)};var o=new e;return i.fromCartesian4=function(r,n){var a=e.fromCartesian4(r,o),u=r.w;return t(n)?(e.clone(a,n.normal),n.distance=u,n):new i(a,u)},i.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,d=0;d<o;++d)f-c[n[d]]>i&&(c[n[d]]=f,++f);return(f-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var d=r[f];a[d].numLiveTriangles&&(s=0,i-a[d].timeStamp+2*a[d].numLiveTriangles<=t&&(s=i-a[d].timeStamp),(s>l||l===-1)&&(l=s,c=d)),++f}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,f=0,d=o[f],h=c;if(t(u))l=u+1;else{for(;f<h;)d>l&&(l=d),++f,d=o[f];if(l===-1)return 0;++l}for(var E=[],m=0;m<l;m++)E[m]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var p=0;f<h;)E[o[f]].vertexTriangles.push(p),++E[o[f]].numLiveTriangles,E[o[f+1]].vertexTriangles.push(p),++E[o[f+1]].numLiveTriangles,E[o[f+2]].vertexTriangles.push(p),++E[o[f+2]].numLiveTriangles,++p,f+=3;var y=0,_=s+1;i=1;var T,R,v=[],A=[],S=0,N=[],g=c/3,I=[];for(m=0;m<g;m++)I[m]=!1;for(var w,O;y!==-1;){v=[],R=E[y],O=R.vertexTriangles.length;for(var M=0;M<O;++M)if(p=R.vertexTriangles[M],!I[p]){I[p]=!0,f=p+p+p;for(var x=0;x<3;++x)w=o[f],v.push(w),A.push(w),N[S]=w,++S,T=E[w],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}y=a(o,s,v,E,_,A,l)}return N},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R,v,A,S,N){"use strict";function g(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function I(e){for(var t=e.length,r=t/3*6,n=p.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)g(n,a,e[i],e[i+1],e[i+2]);return n}function w(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);g(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)g(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function O(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=p.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)g(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function M(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new E({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function x(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function C(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),v.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function D(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,f=1;f<n;++f){var d=e[f][t].attributes[r];if(!c(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){l=!1;break}s+=d.values.length}l&&(a[r]=new E({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function L(e,t){var n,i,o,u,s,l,f,d=e.length,E=(e[0].modelMatrix,c(e[0][t].indices)),m=e[0][t].primitiveType,y=D(e,t);for(n in y)if(y.hasOwnProperty(n))for(s=y[n].values,u=0,i=0;i<d;++i)for(l=e[i][t].attributes[n].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(E){var T=0;for(i=0;i<d;++i)T+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:y,primitiveType:S.POINTS})),v=p.createTypedArray(R,T),A=0,N=0;for(i=0;i<d;++i){var g=e[i][t].indices,I=g.length;for(u=0;u<I;++u)v[A++]=N+g[u];N+=h.computeNumberOfVertices(e[i][t])}_=v}var w,O=new a,M=0;for(i=0;i<d;++i){if(w=e[i][t].boundingSphere,!c(w)){O=void 0;break}a.add(w.center,O,O)}if(c(O))for(a.divideByScalar(O,d,O),i=0;i<d;++i){w=e[i][t].boundingSphere;var x=a.magnitude(a.subtract(w.center,O,se))+w.radius;x>M&&(M=x)}return new h({attributes:y,indices:_,primitiveType:m,boundingSphere:c(O)?new r(O,M):void 0})}function U(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function b(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function B(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return F(e);case S.TRIANGLE_STRIP:return b(e);case S.TRIANGLES:return U(e);case S.LINE_STRIP:return B(e);case S.LINE_LOOP:return G(e);case S.LINES:return z(e)}return e}function V(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function W(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return V(e,e.y<0),V(t,t.y<0),void V(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?T.sign(e.y):T.sign(r.y):i>o?T.sign(t.y):T.sign(r.y);var u=n<0;V(e,u),V(t,u),V(r,u)}function X(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,ve),e.y/(e.y-t.y),ve),r),a.clone(r,n),V(r,!0),V(n,!1)}function H(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){W(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(X(e,t,Ae,Ne),X(e,r,Se,ge),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(X(t,r,Ae,Ne),X(t,e,Se,ge),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(X(r,e,Ae,Ne),X(r,t,Se,ge),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(X(r,e,Ae,Ne),X(r,t,Se,ge),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(X(t,r,Ae,Ne),X(t,e,Se,ge),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(X(e,t,Ae,Ne),X(e,r,Se,ge),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=Se,s[5]=Ne,s[6]=ge,s.length=7),Ie}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=p.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function k(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new E({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function j(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Z(e,r,i,o,u,s,l,f,d,h,E,m){if(c(s)||c(l)||c(f)||c(d)||c(h)){var p=a.fromArray(u,3*e,we),y=a.fromArray(u,3*r,Oe),_=a.fromArray(u,3*i,Me),T=t(o,p,y,_,xe);if(c(s)){var R=a.fromArray(s,3*e,we),v=a.fromArray(s,3*r,Oe),A=a.fromArray(s,3*i,Me);a.multiplyByScalar(R,T.x,R),a.multiplyByScalar(v,T.y,v),a.multiplyByScalar(A,T.z,A);var S=a.add(R,v,R);a.add(S,A,S),a.normalize(S,S),a.pack(S,E.normal.values,3*m)}if(c(h)){var N=a.fromArray(h,3*e,we),g=a.fromArray(h,3*r,Oe),I=a.fromArray(h,3*i,Me);a.multiplyByScalar(N,T.x,N),a.multiplyByScalar(g,T.y,g),a.multiplyByScalar(I,T.z,I);var w;a.equals(N,a.ZERO)&&a.equals(g,a.ZERO)&&a.equals(I,a.ZERO)?(w=we,w.x=0,w.y=0,w.z=0):(w=a.add(N,g,N),a.add(w,I,w),a.normalize(w,w)),a.pack(w,E.extrudeDirection.values,3*m)}if(c(l)){var O=a.fromArray(l,3*e,we),M=a.fromArray(l,3*r,Oe),x=a.fromArray(l,3*i,Me);a.multiplyByScalar(O,T.x,O),a.multiplyByScalar(M,T.y,M),a.multiplyByScalar(x,T.z,x);var C=a.add(O,M,O);a.add(C,x,C),a.normalize(C,C),a.pack(C,E.tangent.values,3*m)}if(c(f)){var P=a.fromArray(f,3*e,we),D=a.fromArray(f,3*r,Oe),L=a.fromArray(f,3*i,Me);a.multiplyByScalar(P,T.x,P),a.multiplyByScalar(D,T.y,D),a.multiplyByScalar(L,T.z,L);var U=a.add(P,D,P);a.add(U,L,U),a.normalize(U,U),a.pack(U,E.bitangent.values,3*m)}if(c(d)){var F=n.fromArray(d,2*e,Ce),b=n.fromArray(d,2*r,Pe),z=n.fromArray(d,2*i,De);n.multiplyByScalar(F,T.x,F),n.multiplyByScalar(b,T.y,b),n.multiplyByScalar(z,T.z,z);var B=n.add(F,b,F);n.add(B,z,B),n.pack(B,E.st.values,2*m)}}}function K(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,d=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,E=c(s.st)?s.st.values:void 0,m=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,p=u.indices,y=k(u),_=k(u),T=[];T.length=l.length/3;var R=[];for(R.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,R[o]=-1;var v=p.length;for(o=0;o<v;o+=3){var A=p[o],S=p[o+1],N=p[o+2],g=a.fromArray(l,3*A),I=a.fromArray(l,3*S),w=a.fromArray(l,3*N),O=H(g,I,w);if(c(O)&&O.positions.length>3)for(var M=O.positions,x=O.indices,C=x.length,P=0;P<C;++P){var D=x[P],L=M[D];L.y<0?(t=_.attributes,r=_.indices,n=T):(t=y.attributes,r=y.indices,n=R),i=K(t,r,n,p,D<3?o+D:-1,L),Z(A,S,N,L,l,f,h,d,E,m,t,i)}else c(O)&&(g=O.positions[0],I=O.positions[1],w=O.positions[2]),g.y<0?(t=_.attributes,r=_.indices,n=T):(t=y.attributes,r=y.indices,n=R),i=K(t,r,n,p,o,g),Z(A,S,N,g,l,f,h,d,E,m,t,i),i=K(t,r,n,p,o+1,I),Z(A,S,N,I,l,f,h,d,E,m,t,i),i=K(t,r,n,p,o+2,w),Z(A,S,N,w,l,f,h,d,E,m,t,i)}j(e,_,y)}function Q(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=k(r),s=k(r),l=o.length,f=[];f.length=i.length/3;var d=[];for(d.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,d[t]=-1;for(t=0;t<l;t+=2){var h=o[t],E=o[t+1],m=a.fromArray(i,3*h,we),p=a.fromArray(i,3*E,Oe);Math.abs(m.y)<T.EPSILON6&&(m.y<0?m.y=-T.EPSILON6:m.y=T.EPSILON6),Math.abs(p.y)<T.EPSILON6&&(p.y<0?p.y=-T.EPSILON6:p.y=T.EPSILON6);var y=u.attributes,R=u.indices,v=d,A=s.attributes,S=s.indices,N=f,g=_.lineSegmentPlane(m,p,Le,Me);if(c(g)){var I=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Ue);m.y<0&&(a.negate(I,I),y=s.attributes,R=s.indices,v=f,A=u.attributes,S=u.indices,N=d);var w=a.add(g,I,Fe);K(y,R,v,o,t,m),K(y,R,v,o,-1,w),a.negate(I,I),a.add(g,I,w),K(A,S,N,o,-1,w),K(A,S,N,o,t+1,p)}else{var O,M,x;m.y<0?(O=s.attributes,M=s.indices,x=f):(O=u.attributes,M=u.indices,x=d),K(O,M,x,o,t,m),K(O,M,x,o,t+1,p)}}j(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,Be);if(!(s.x>0)){var c=a.unpack(n,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,d=s.nextPosition.values,h=s.expandAndWidth.values,E=c(s.st)?s.st.values:void 0,m=c(s.color)?s.color.values:void 0,p=k(u),y=k(u),R=!1,v=l.length/3;for(t=0;t<v;t+=4){var A=t,S=t+2,N=a.fromArray(l,3*A,Be),g=a.fromArray(l,3*S,Ge);if(Math.abs(N.y)<ke)for(N.y=ke*(g.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(g.y)<ke)for(g.y=ke*(N.y<0?-1:1),l[3*(t+2)+1]=g.y,l[3*(t+3)+1]=g.y,r=3*A;r<3*A+12;r+=3)d[r]=l[3*(t+2)],d[r+1]=l[3*(t+2)+1],d[r+2]=l[3*(t+2)+2];var I=p.attributes,w=p.indices,O=y.attributes,M=y.indices,x=_.lineSegmentPlane(N,g,Le,Ve);if(c(x)){R=!0;var C=a.multiplyByScalar(a.UNIT_Y,Ye,We);N.y<0&&(a.negate(C,C),I=y.attributes,w=y.indices,O=p.attributes,M=p.indices);var P=a.add(x,C,Xe);I.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.position.values.push(P.x,P.y,P.z),I.position.values.push(P.x,P.y,P.z),I.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),I.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),I.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),a.negate(C,C),a.add(x,C,P),O.position.values.push(P.x,P.y,P.z),O.position.values.push(P.x,P.y,P.z),O.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.prevPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),O.nextPosition.values.push(d[3*S],d[3*S+1],d[3*S+2]),O.nextPosition.values.push(d[3*S+3],d[3*S+4],d[3*S+5]);var D=n.fromArray(h,2*A,be),L=Math.abs(D.y);I.expandAndWidth.values.push(-1,L,1,L),I.expandAndWidth.values.push(-1,-L,1,-L),O.expandAndWidth.values.push(-1,L,1,L),O.expandAndWidth.values.push(-1,-L,1,-L);var U=a.magnitudeSquared(a.subtract(x,N,qe));if(U/=a.magnitudeSquared(a.subtract(g,N,qe)),c(m)){var F=i.fromArray(m,4*A,He),b=i.fromArray(m,4*S,He),z=T.lerp(F.x,b.x,U),B=T.lerp(F.y,b.y,U),G=T.lerp(F.z,b.z,U),q=T.lerp(F.w,b.w,U);for(r=4*A;r<4*A+8;++r)I.color.values.push(m[r]);for(I.color.values.push(z,B,G,q),I.color.values.push(z,B,G,q),O.color.values.push(z,B,G,q),O.color.values.push(z,B,G,q),r=4*S;r<4*S+8;++r)O.color.values.push(m[r])}if(c(E)){var V=n.fromArray(E,2*A,be),W=n.fromArray(E,2*(t+3),ze),X=T.lerp(V.x,W.x,U);for(r=2*A;r<2*A+4;++r)I.st.values.push(E[r]);for(I.st.values.push(X,V.y),I.st.values.push(X,W.y),O.st.values.push(X,V.y),O.st.values.push(X,W.y),r=2*S;r<2*S+4;++r)O.st.values.push(E[r])}o=I.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3),o=O.position.values.length/3-4,M.push(o,o+2,o+1),M.push(o+1,o+2,o+3); +}else{var H,Y;for(N.y<0?(H=y.attributes,Y=y.indices):(H=p.attributes,Y=p.indices),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(g.x,g.y,g.z),H.position.values.push(g.x,g.y,g.z),r=3*t;r<3*t+12;++r)H.prevPosition.values.push(f[r]),H.nextPosition.values.push(d[r]);for(r=2*t;r<2*t+8;++r)H.expandAndWidth.values.push(h[r]),c(E)&&H.st.values.push(E[r]);if(c(m))for(r=4*t;r<4*t+16;++r)H.color.values.push(m[r]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}R&&($(y),$(p)),j(e,y,p)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=I(t);break;case S.TRIANGLE_STRIP:e.indices=w(t);break;case S.TRIANGLE_FAN:e.indices=O(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,d=0;d<o;d+=3)l[f++]=a[d],l[f++]=a[d+1],l[f++]=a[d+2],l[f++]=a[d]+i[d]*n,l[f++]=a[d+1]+i[d+1]*n,l[f++]=a[d+2]+i[d+2]*n;var m,p=e.boundingSphere;return c(p)&&(m=new r(p.center,p.radius+n)),new h({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:m})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=p.createTypedArray(t,s),f=0,d=0,E=0;f<s;)i=n[o[f]],i!==-1?l[d]=i:(i=o[f],n[i]=E,l[d]=E,++E),++f,++d;e.indices=l;var m=e.attributes;for(var y in m)if(m.hasOwnProperty(y)&&c(m[y])&&c(m[y].values)){for(var _=m[y],T=_.values,R=0,v=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,E*v);R<t;){var S=n[R];if(S!==-1)for(a=0;a<v;a++)A[v*S+a]=T[v*R+a];++R}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=N.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=T.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=M(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var f=0;f<l;f+=n){for(var d=0;d<n;++d){var E=s[f+d],m=a[E];c(m)||(m=o++,a[E]=m,x(u,e.attributes,E)),i.push(m)}o+n>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=M(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new d;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),h=0,m=0;m<l.length;m+=3){var p=a.fromArray(l,m,re),y=s.cartesianToCartographic(p,ne),_=i.project(y,re);f[h++]=_.x,f[h++]=_.y,f[h++]=_.z}return e.attributes[r]=o,e.attributes[n]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var d=a.componentsPerAttribute;return e.attributes[r]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:s}),e.attributes[n]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var ie=new a,oe=new v,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(v.equals(t,v.IDENTITY))return e;var n=e.geometry.attributes;C(t,n.position),C(t,n.prevPosition),C(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(v.inverse(t,oe),v.transpose(oe,oe),v.getRotation(oe,ue),P(ue,n.normal),P(ue,n.tangent),P(ue,n.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=v.clone(v.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(L(t,"geometry")),r.length>0&&(o.push(L(r,"westHemisphereGeometry")),o.push(L(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,fe=new a,de=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var d=0;for(f=0;f<o;f+=3){var h=t[f],m=t[f+1],p=t[f+2],y=3*h,_=3*m,R=3*p;le.x=n[y],le.y=n[y+1],le.z=n[y+2],fe.x=n[_],fe.y=n[_+1],fe.z=n[_+2],de.x=n[R],de.y=n[R+1],de.z=n[R+2],s[h].count++,s[m].count++,s[p].count++,a.subtract(fe,le,fe),a.subtract(de,le,de),c[d]=a.cross(fe,de,new a),d++}var v=0;for(f=0;f<i;f++)s[f].indexOffset+=v,v+=s[f].count;d=0;var A;for(f=0;f<o;f+=3){A=s[t[f]];var S=A.indexOffset+A.currentCount;l[S]=d,A.currentCount++,A=s[t[f+1]],S=A.indexOffset+A.currentCount,l[S]=d,A.currentCount++,A=s[t[f+2]],S=A.indexOffset+A.currentCount,l[S]=d,A.currentCount++,d++}var N=new Float32Array(3*i);for(f=0;f<i;f++){var g=3*f;if(A=s[f],a.clone(a.ZERO,ce),A.count>0){for(d=0;d<A.count;d++)a.add(ce,c[l[A.indexOffset+d]],ce);a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&a.clone(c[l[A.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),N[g]=ce.x,N[g+1]=ce.y,N[g+2]=ce.z}return e.attributes.normal=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,Ee=new a,me=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,d,h;for(l=0;l<s;l+=3){var m=t[l],p=t[l+1],y=t[l+2];f=3*m,d=3*p,h=3*y;var _=2*m,T=2*p,R=2*y,v=r[f],A=r[f+1],S=r[f+2],N=i[_],g=i[_+1],I=i[T+1]-g,w=i[R+1]-g,O=1/((i[T]-N)*w-(i[R]-N)*I),M=(w*(r[d]-v)-I*(r[h]-v))*O,x=(w*(r[d+1]-A)-I*(r[h+1]-A))*O,C=(w*(r[d+2]-S)-I*(r[h+2]-S))*O;c[f]+=M,c[f+1]+=x,c[f+2]+=C,c[d]+=M,c[d+1]+=x,c[d+2]+=C,c[h]+=M,c[h+1]+=x,c[h+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,d=f+1,h=f+2;var L=a.fromArray(n,f,he),U=a.fromArray(c,f,me),F=a.dot(L,U);a.multiplyByScalar(L,F,Ee),a.normalize(a.subtract(U,Ee,U),U),P[f]=U.x,P[d]=U.y,P[h]=U.z,a.normalize(a.cross(L,U,U),U),D[f]=U.x,D[d]=U.y,D[h]=U.z}return e.attributes.tangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e};var pe=new n,ye=new a,_e=new a,Te=new a,Re=new n;te.compressVertices=function(t){var r,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),f=0;for(r=0;r<i;++r)a.fromArray(s,3*r,ye),a.equals(ye,a.ZERO)?f+=2:(Re=e.octEncodeInRange(ye,65535,Re),l[f++]=Re.x,l[f++]=Re.y);return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var d=t.attributes.normal,h=t.attributes.st,m=c(d),p=c(h);if(!m&&!p)return t;var y,_,T,R,v=t.attributes.tangent,A=t.attributes.bitangent,S=c(v),N=c(A);m&&(y=d.values),p&&(_=h.values),S&&(T=v.values),N&&(R=A.values);var g=m?y.length:_.length,I=m?3:2;i=g/I;var w=i,O=p&&m?2:1;O+=S||N?1:0,w*=O;var M=new Float32Array(w),x=0;for(r=0;r<i;++r){p&&(n.fromArray(_,2*r,pe),M[x++]=e.compressTextureCoordinates(pe));var C=3*r;m&&c(T)&&c(R)?(a.fromArray(y,C,ye),a.fromArray(T,C,_e),a.fromArray(R,C,Te),e.octPack(ye,_e,Te,pe),M[x++]=pe.x,M[x++]=pe.y):(m&&(a.fromArray(y,C,ye),M[x++]=e.octEncodeFloat(ye)),S&&(a.fromArray(T,C,ye),M[x++]=e.octEncodeFloat(ye)),N&&(a.fromArray(R,C,ye),M[x++]=e.octEncodeFloat(ye)))}return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:O,values:M}),m&&delete t.attributes.normal,p&&delete t.attributes.st,N&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var ve=new a,Ae=new a,Se=new a,Ne=new a,ge=new a,Ie={positions:new Array(7),indices:new Array(9)},we=new a,Oe=new a,Me=new a,xe=new a,Ce=new n,Pe=new n,De=new n,Le=A.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,Fe=new a,be=new n,ze=new n,Be=new a,Ge=new a,qe=new a,Ve=new a,We=new a,Xe=new a,He=new i,Ye=5*T.EPSILON9,ke=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,A.ORIGIN_ZX_PLANE)!==y.INTERSECTING)return e}if(t.geometryType!==m.NONE)switch(t.geometryType){case m.POLYLINES:ee(e);break;case m.TRIANGLES:J(e);break;case m.LINES:Q(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&Q(e);return e},te}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,a){return t(e).then(r,n,a)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=o(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=a(e),t}function r(t){return e(t,i)}function n(e){this.then=e}function a(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(e){return i(e)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(e){return i(e)}});return r}function o(){function e(e,t,r){return d(e,t,r)}function r(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new n(e),s={then:e,resolve:r,reject:a,progress:u,promise:c,resolver:{resolve:r,reject:a,progress:u}},l=[],f=[],d=function(e,t,r){var n,a;return n=o(),a="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,a)}),f.push(a),n.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=y,m(l,e),f=l=v,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,a,i){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,p,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),f=[],l=_-c+1,d=[],h=o(),c)for(p=h.progress,m=function(e){d.push(e),--l||(E=m=y,h.reject(d))},E=function(e){f.push(e),--c||(E=m=y,h.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,p);else h.resolve(f);return h.then(n,a,i)})}function c(e,t,r,n){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,r,n)}function l(e,t,r,n){return p(1,arguments),d(e,_).then(t,r,n)}function f(){return d(arguments,_)}function d(t,r){return e(t,function(t){var n,a,i,u,s,c;if(i=a=t.length>>>0,n=[],c=o(),i)for(u=function(t,a){e(t,r).then(function(e){n[a]=e,--i||c.resolve(n)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function h(t,r){var n=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,n[0]=function(t,n,i){return e(t,function(t){return e(n,function(e){return r(t,e,i,a)})})},T.apply(t,n)})}function E(t,r,n){var a=arguments.length>2;return e(t,function(e){return e=a?n:e,r.resolve(e),e},function(e){return r.reject(e),i(e)},r.progress)}function m(e,t){for(var r,n=0;r=e[n++];)r(t)}function p(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function y(){}function _(e){return e}var T,R,v;return e.defer=o,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(v,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(v,t)})})}},R=[].slice,T=[].reduce||function(e){var t,r,n,a,i;if(i=0,t=Object(this),a=t.length>>>0,r=arguments,r.length<=1)for(;;){if(i in t){n=t[i++];break}if(++i>=a)throw new TypeError}else n=r[1];for(;i<a;++i)i in t&&(n=e(n,t[i],i,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function r(e,t,r){for(var n,a,i=0,o=e.length-1;i<=o;)if(n=~~((i+o)/2),a=r(e[n],t),a<0)i=n+1;else{if(!(a>0))return n;o=n-1}return~(o+1)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,n,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,n=t[r++],a=function(e,t,r,n){r||(r=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return n?e+a:a+e},i=function(e,t,r,n,i,o){var u=n-e.length;return u>0&&(e=r||!i?a(e,n,o,r):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,r,n,o,u,s){var c=e>>>0;return r=r&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+a(c.toString(t),u||0,"0",!1),i(e,r,n,o,s)},u=function(e,t,r,n,a,o){return null!=n&&(e=e.slice(0,n)),i(e,"",t,r,a,o)},s=function(e,n,s,c,l,f,d){var h,E,m,p,y;if("%%"==e)return"%";for(var _=!1,T="",R=!1,v=!1,A=" ",S=s.length,N=0;s&&N<S;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":A=s.charAt(N+1);break;case"0":R=!0;break;case"#":v=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[r++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=n?t[n.slice(0,-1)]:t[r++],d){case"s":return u(String(y),_,c,f,R,A);case"c":return u(String.fromCharCode(+y),_,c,f,R);case"b":return o(y,2,v,_,c,f,R);case"o":return o(y,8,v,_,c,f,R);case"x":return o(y,16,v,_,c,f,R);case"X":return o(y,16,v,_,c,f,R).toUpperCase();case"u":return o(y,10,v,_,c,f,R);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=h<0?"-":T,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,_,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=E+Math.abs(h)[m](f),i(y,E,_,c,R)[p]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,a,i,o,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var r=m.leapSeconds,n=t(r,T,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var a=r[n].offset;if(n>0){var i=m.secondsDifference(r[n].julianDate,e);i>a&&(n--,a=r[n].offset)}m.addSeconds(e,a,e)}function d(e,r){T.julianDate=e;var n=m.leapSeconds,a=t(n,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-n[0].offset,r);if(a>=n.length)return m.addSeconds(e,-n[a-1].offset,r);var i=m.secondsDifference(n[a].julianDate,e);return 0===i?m.addSeconds(e,-n[a].offset,r):i<=1?void 0:m.addSeconds(e,-n[--a].offset,r)}function h(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,t<0&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function E(e,t,r,n,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+r-32075;n-=12,n<0&&(n+=24);var f=i+(n*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),n=r(n,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),n===c.UTC&&f(this)}var p=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,R=/^(\d{4})$/,v=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,g=/([Z+\-])?(\d{2})?:?(\d{2})?$/,I=/^(\d{2})(\.\d+)?/.source+g.source,w=/^(\d{2}):?(\d{2})(\.\d+)?/.source+g.source,O=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+g.source;m.fromDate=function(e,t){var r=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n(t)?(h(r[0],r[1],t),f(t),t):new m(r[0],r[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var r,a,i,u=e.split("T"),s=1,l=1,d=0,p=0,T=0,g=0,M=u[0],x=u[1];if(u=M.match(N),null!==u)r=+u[1],s=+u[2],l=+u[3];else if(u=M.match(v),null!==u)r=+u[1],s=+u[2];else if(u=M.match(R),null!==u)r=+u[1];else{var C;if(u=M.match(A),null!==u)r=+u[1],C=+u[2],i=o(r);else if(u=M.match(S),null!==u){r=+u[1];var P=+u[2],D=+u[3]||0,L=new Date(Date.UTC(r,0,4));C=7*P+D-L.getUTCDay()-3}a=new Date(Date.UTC(r,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(r);var U;if(n(x)){u=x.match(O),null!==u?(d=+u[1],p=+u[2],T=+u[3],g=1e3*+(u[4]||0),U=5):(u=x.match(w),null!==u?(d=+u[1],p=+u[2],T=60*+(u[3]||0),U=4):(u=x.match(I),null!==u&&(d=+u[1],p=60*+(u[2]||0),U=3)));var F=u[U],b=+u[U+1],z=+(u[U+2]||0);switch(F){case"+":d-=b,p-=z;break;case"-":d+=b,p+=z;break;case"Z":break;default:p+=new Date(Date.UTC(r,s-1,l,d,p)).getTimezoneOffset()}}else p+=new Date(r,s-1,l).getTimezoneOffset();var B=60===T;for(B&&T--;p>=60;)p-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,r++),a=i&&2===s?_:y[s-1];for(;p<0;)p+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,r--),a=i&&2===s?_:y[s-1],l+=a;var G=E(r,s,l,d,p,T,g);return n(t)?(h(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),B&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var M=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var r=!1,a=d(e,M);n(a)||(m.addSeconds(e,-1,M),a=d(M,M),r=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var p=h+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var v=0|T,A=(T-v)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(v+=1),n(t)?(t.year=y,t.month=p,t.day=E,t.hour=_,t.minute=R,t.second=v,t.millisecond=A,t.isLeapSecond=r,t):new i(y,p,E,_,R,v,A,r)},m.toDate=function(e){var t=m.toGregorianDate(e,p),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},m.toIso8601=function(t,r){var a,i=m.toGregorianDate(t,i);return n(r)||0===i.millisecond?n(r)&&0!==r?(a=(.01*i.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(n(e))return n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(m.secondsDifference(e,t))<=r},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},m.computeTaiMinusUtc=function(e){T.julianDate=e;var r=m.leapSeconds,n=t(r,T,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},m.addSeconds=function(e,t,r){return h(e.dayNumber,e.secondsOfDay+t,r)},m.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,n,r)},m.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,n,r)},m.addDays=function(e,t,r){var n=e.dayNumber+t;return h(n,e.secondsOfDay,r)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var a=new r.constructor;for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];n&&(o=t(o,n)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var a=r[n],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,n){this.statusCode=e,this.response=r,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=n.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function r(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var n=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,r).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var a=n.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])||(i[n]=!0)},a.remove=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])&&delete i[n]},a.contains=function(e){var r=n(e);return!(!t(r)||!t(i[r]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,n,a,i,o){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,a=t(r.method,"GET"),i=r.data,o=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,n,a,i,o,r,s),r.promise})}function s(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function c(e,t){for(var r=s(e,t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return n}function l(e,r){r=t(r,"");var n=e[1],a=!!e[2],i=e[3];switch(r){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:n});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),n);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,n,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),r(d)&&r(E.overrideMimeType)&&E.overrideMimeType(d),E.open(n,e,!0),r(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);r(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,n=E.responseType;if(!r(e)||r(t)&&n!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===n||"document"===n)&&r(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==n&&"text"!==n||!r(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function a(r,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,n(r,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))E(this,t.data);else if(n(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=r.columnNames.indexOf("modifiedJulianDateUtc"),i=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),d=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=r.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=r.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d, +e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,R=0,v=p.length;R<v;R+=e._columnCount){var A=p[R+a],S=p[R+m],N=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,g=new o(N,S,f.TAI);if(y.push(g),T){if(S!==_&&n(_)){var I=o.leapSeconds,w=t(I,g,h);if(w<0){var O=new u(g,S);I.splice(~w,0,O)}}_=S}}}function m(e,t,r,n,a){var i=r*n;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,r){return t+e*(r-t)}function y(e,t,r,n,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||n.equals(c))return m(e,r,a,s,u),u;if(n.equals(l))return m(e,r,i,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=r[d+e._ut1MinusUtcSecondsColumn],y=r[h+e._ut1MinusUtcSecondsColumn],_=y-E;if(_>.5||_<-.5){var T=r[d+e._taiMinusUtcSecondsColumn],R=r[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(n)?E=y:y-=R-T)}return u.xPoleWander=p(f,r[d+e._xPoleWanderRadiansColumn],r[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,r[d+e._yPoleWanderRadiansColumn],r[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,r[d+e._xCelestialPoleOffsetRadiansColumn],r[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,r[d+e._yCelestialPoleOffsetRadiansColumn],r[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,y),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return n(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,r){if(n(this._samples)){if(n(r)||(r=new a(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var i=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!n(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,r),r}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},d}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=t(n,document.location.href);var a=new e(n),i=new e(r);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,i){if(i=t(i,!0),n instanceof e||(n=new e(n)),a instanceof e||(a=new e(a)),"data"===n.scheme)return n.toString();if("data"===a.scheme)return a.toString();r(a.authority)&&!r(a.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=n.scheme);var o=n;a.isAbsolute()&&(o=a);var u="";r(o.scheme)&&(u+=o.scheme+":"),r(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===n?i?n.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):n.path+a.path:a.path;var s=r(n.query),c=r(a.query);s&&c?u+="?"+n.query+"&"+a.query:s&&!c?u+="?"+n.query:!s&&c&&(u+="?"+a.query);var l=r(a.fragment);return r(n.fragment)&&!l?u+="#"+n.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,n,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),a=E.exec(n);if(null!==a)return a[1]}}function u(){if(t(f))return f;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(n(r))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var r=d(e);return h.href=r,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){n[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,i.daysDifference(n,e._sampleZeroDateTT)}function l(r,a){if(r._chunkDownloadsInProgress[a])return r._chunkDownloadsInProgress[a];var i=e.defer();r._chunkDownloadsInProgress[a]=i;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){r._chunkDownloadsInProgress[a]=!1;for(var t=r._samples,n=e.samples,o=a*r._samplesPerXysFile*3,u=0,s=n.length;u<s;++u)t[o+u]=n[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,r,n,a){var i=c(this,t,r),o=c(this,n,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,r){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(n(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),n(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){n(r)?(r.x=0,r.y=0,r.s=0):r=new a(0,0,0);var E,m,p=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)y[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=y[m]);T[E]*=_[E];var v=3*(s+E);r.x+=T[E]*h[v++],r.y+=T[E]*h[v++],r.s+=T[E]*h[v]}return r}}}},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R){"use strict";var v={},A={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},S={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},N={},g={east:new r,north:new r,up:new r,west:new r,south:new r,down:new r},I=new r,w=new r,O=new r;v.localFrameToFixedFrameGenerator=function(e,t){if(!A.hasOwnProperty(e)||!A[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var n,a=A[e][t],i=e+t;return u(N[i])?n=N[i]:(n=function(n,i,s){if(u(s)||(s=new _),p.equalsEpsilon(n.x,0,p.EPSILON14)&&p.equalsEpsilon(n.y,0,p.EPSILON14)){var c=p.sign(n.z);r.unpack(S[e],0,I),"east"!==e&&"west"!==e&&r.multiplyByScalar(I,c,I),r.unpack(S[t],0,w),"east"!==t&&"west"!==t&&r.multiplyByScalar(w,c,w),r.unpack(S[a],0,O),"east"!==a&&"west"!==a&&r.multiplyByScalar(O,c,O)}else{i=o(i,d.WGS84),i.geodeticSurfaceNormal(n,g.up);var l=g.up,f=g.east;f.x=-n.y,f.y=n.x,f.z=0,r.normalize(f,g.east),r.cross(l,f,g.north),r.multiplyByScalar(g.up,-1,g.down),r.multiplyByScalar(g.east,-1,g.west),r.multiplyByScalar(g.north,-1,g.south),I=g[e],w=g[t],O=g[a]}return s[0]=I.x,s[1]=I.y,s[2]=I.z,s[3]=0,s[4]=w.x,s[5]=w.y,s[6]=w.z,s[7]=0,s[8]=O.x,s[9]=O.y,s[10]=O.z,s[11]=0,s[12]=n.x,s[13]=n.y,s[14]=n.z,s[15]=1,s},N[i]=n),n},v.eastNorthUpToFixedFrame=v.localFrameToFixedFrameGenerator("east","north"),v.northEastDownToFixedFrame=v.localFrameToFixedFrameGenerator("north","east"),v.northUpEastToFixedFrame=v.localFrameToFixedFrameGenerator("north","up"),v.northWestUpToFixedFrame=v.localFrameToFixedFrameGenerator("north","west");var M=new T,x=new r(1,1,1),C=new _;v.headingPitchRollToFixedFrame=function(e,t,n,a,i){a instanceof _&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,v.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,M),c=_.fromTranslationQuaternionRotationScale(r.ZERO,u,x,C);return i=a(e,n,i),_.multiply(i,c,i)};var P=new _,D=new y;v.headingPitchRollQuaternion=function(e,t,r,n,a){n instanceof T&&(a=n,n=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=v.headingPitchRollToFixedFrame(e,t,r,n,P),o=_.getRotation(i,D);return T.fromRotationMatrix(o,a)};var L=24110.54841,U=8640184.812866,F=.093104,b=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,G=p.TWO_PI/86400,q=new m;v.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var r,n=q.dayNumber,a=q.secondsOfDay,i=n-2451545;r=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=L+r*(U+r*(F+r*b)),s=o*G%p.TWO_PI,c=B+z*(n-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(d,h,0,-h,d,0,0,0,1)},v.iau2006XysData=new h,v.earthOrientationParameters=l.NONE;var V=32.184,W=2451545;v.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+V,a=t.stop.dayNumber,i=t.stop.secondsOfDay+V,o=v.iau2006XysData.preload(r,n,a,i),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var r=v.computeFixedToIcrfMatrix(e,t);if(u(r))return y.transpose(r,t)};var X=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new y,k=new y;v.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var r=v.earthOrientationParameters.compute(e,H);if(u(r)){var n=e.dayNumber,a=e.secondsOfDay+V,i=v.iau2006XysData.computeXysRadians(n,a,X);if(u(i)){var o=i.x+r.xPoleOffset,s=i.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,k),d=y.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=h-2451545,T=E/R.SECONDS_PER_DAY,A=.779057273264+T+.00273781191135448*(_+T);A=A%1*p.TWO_PI;var S=y.fromRotationZ(A,k),N=y.multiply(d,S,Y),g=Math.cos(r.xPoleWander),I=Math.cos(r.yPoleWander),w=Math.sin(r.xPoleWander),O=Math.sin(r.yPoleWander),M=n-W+a/R.SECONDS_PER_DAY;M/=36525;var x=-47e-6*M*p.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=k;return D[0]=g*C,D[1]=g*P,D[2]=w,D[3]=-I*P+O*w*C,D[4]=I*C+O*w*P,D[5]=-O*g,D[6]=-O*P-I*w*C,D[7]=O*C-I*w*P,D[8]=I*g,y.multiply(N,D,t)}}};var j=new n;v.pointToWindowCoordinates=function(e,t,r,n){return n=v.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},v.pointToGLWindowCoordinates=function(e,r,a,i){u(i)||(i=new t);var o=j;return _.multiplyByVector(e,n.fromElements(a.x,a.y,a.z,1,o),o),n.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(r,o,o),t.fromCartesian4(o,i)};var Z=new r,K=new r,J=new r;v.rotationMatrixFromPositionVelocity=function(e,t,n,a){var i=o(n,d.WGS84).geodeticSurfaceNormal(e,Z),s=r.cross(t,i,K);r.equalsEpsilon(s,r.ZERO,p.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var c=r.cross(s,t,J);return r.cross(t,c,s),r.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new r,te=new r,re=new y,ne=new _,ae=new _;return v.basisTo2D=function(e,t,n){var a=_.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);r.fromElements(u.z,u.x,u.y,u);var s=v.eastNorthUpToFixedFrame(a,i,ne),c=_.inverseTransformation(s,ae),l=_.getRotation(t,re),f=_.multiplyByMatrix3(c,l,n);return _.multiply(Q,f,n),_.setTranslation(n,u,n),n},v.wgs84To2DModelMatrix=function(e,t,n){var a=e.ellipsoid,i=v.eastNorthUpToFixedFrame(t,a,ne),o=_.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);r.fromElements(s.z,s.x,s.y,s);var c=_.fromTranslation(s,ne);return _.multiply(Q,o,n),_.multiply(c,n,n),n},v}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=n(new a({position:!0})),a.POSITION_AND_NORMAL=n(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=n(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=n(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=n(new a({position:!0,color:!0})),a.ALL=n(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.position?1:0,r[n++]=t.normal?1:0,r[n++]=t.st?1:0,r[n++]=t.tangent?1:0,r[n++]=t.bitangent?1:0,r[n++]=t.color?1:0,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.position=1===r[n++],i.normal=1===r[n++],i.st=1===r[n++],i.tangent=1===r[n++],i.bitangent=1===r[n++],i.color=1===r[n++],i},a.clone=function(e,r){if(t(e))return t(r)||(r=new a),r.position=e.position,r.normal=e.normal,r.st=e.st,r.tangent=e.tangent,r.bitangent=e.bitangent,r.color=e.color,r},a}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,m,p,y,_,T,R,v,A,S,N,g){"use strict";function I(e,n,i){var o=n.vertexFormat,u=n.center,s=n.semiMajorAxis,l=n.semiMinorAxis,d=n.ellipsoid,m=n.stRotation,p=i?e.length/3*2:e.length/3,y=n.shadowVolume,_=o.st?new Float32Array(2*p):void 0,R=o.normal?new Float32Array(3*p):void 0,v=o.tangent?new Float32Array(3*p):void 0,S=o.bitangent?new Float32Array(3*p):void 0,N=y?new Float32Array(3*p):void 0,g=0,I=q,w=V,O=W,M=new f(d),x=M.project(d.cartesianToCartographic(u,X),H),C=d.scaleToGeodeticSurface(u,L);d.geodeticSurfaceNormal(C,C);for(var P=A.fromAxisAngle(C,m,G),D=T.fromQuaternion(P,B),b=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),j=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),Z=e.length,K=i?Z:0,J=K/3*2,Q=0;Q<Z;Q+=3){var $=Q+1,ee=Q+2,te=r.fromArray(e,Q,L);if(o.st){var re=T.multiplyByVector(D,te,U),ne=M.project(d.cartesianToCartographic(re,X),F);r.subtract(ne,x,ne),z.x=(ne.x+s)/(2*s),z.y=(ne.y+l)/(2*l),b.x=Math.min(z.x,b.x),b.y=Math.min(z.y,b.y),j.x=Math.max(z.x,j.x),j.y=Math.max(z.y,j.y),i&&(_[g+J]=z.x,_[g+1+J]=z.y),_[g++]=z.x,_[g++]=z.y}(o.normal||o.tangent||o.bitangent||y)&&(I=d.geodeticSurfaceNormal(te,I),y&&(N[Q+K]=-I.x,N[$+K]=-I.y,N[ee+K]=-I.z),(o.normal||o.tangent||o.bitangent)&&((o.tangent||o.bitangent)&&(w=r.normalize(r.cross(r.UNIT_Z,I,w),w),T.multiplyByVector(D,w,w)),o.normal&&(R[Q]=I.x,R[$]=I.y,R[ee]=I.z,i&&(R[Q+K]=-I.x,R[$+K]=-I.y,R[ee+K]=-I.z)),o.tangent&&(v[Q]=w.x,v[$]=w.y,v[ee]=w.z,i&&(v[Q+K]=-w.x,v[$+K]=-w.y,v[ee+K]=-w.z)),o.bitangent&&(O=r.normalize(r.cross(I,w,O),O),S[Q]=O.x,S[$]=O.y,S[ee]=O.z,i&&(S[Q+K]=O.x,S[$+K]=O.y,S[ee+K]=O.z))))}if(o.st){Z=_.length;for(var ae=0;ae<Z;ae+=2)_[ae]=(_[ae]-b.x)/(j.x-b.x),_[ae+1]=(_[ae+1]-b.y)/(j.y-b.y)}var ie=new E;if(o.position){var oe=c.raisePositionsToHeight(e,n,i);ie.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:oe})}return o.st&&(ie.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),o.normal&&(ie.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),o.tangent&&(ie.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),o.bitangent&&(ie.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),y&&(ie.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:N})),ie}function w(e){var t,r,n,a,i,o=new Array(12*(e*(e+1))-6),u=0;for(t=0,n=1,a=0;a<3;a++)o[u++]=n++,o[u++]=t,o[u++]=n;for(a=2;a<e+1;++a){for(n=a*(a+1)-1,t=(a-1)*a-1,o[u++]=n++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=n++,o[u++]=t,o[u++]=n}for(r=2*e,++n,++t,a=0;a<r-1;++a)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;for(o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t++,o[u++]=t,++t,a=e-1;a>1;--a){for(o[u++]=t++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=t++,o[u++]=t++,o[u++]=n++}for(a=0;a<3;a++)o[u++]=t++,o[u++]=t,o[u++]=n;return o}function O(t){var n=t.center;j=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(n,j),t.height,j),j=r.add(n,j,j);var a=new e(j,t.semiMajorAxis),i=c.computeEllipsePositions(t,!0,!1),o=i.positions,u=i.numPts,s=I(o,t,!1),l=w(u);return l=y.createTypedArray(o.length/3,l),{boundingSphere:a,attributes:s,indices:l}}function M(e,n){var i=n.vertexFormat,o=n.center,u=n.semiMajorAxis,s=n.semiMinorAxis,c=n.ellipsoid,l=n.height,d=n.extrudedHeight,m=n.stRotation,p=e.length/3*2,y=new Float64Array(3*p),_=i.st?new Float32Array(2*p):void 0,R=i.normal?new Float32Array(3*p):void 0,v=i.tangent?new Float32Array(3*p):void 0,S=i.bitangent?new Float32Array(3*p):void 0,N=n.shadowVolume,g=N?new Float32Array(3*p):void 0,I=0,w=q,O=V,M=W,x=new f(c),C=x.project(c.cartesianToCartographic(o,X),H),P=c.scaleToGeodeticSurface(o,L);c.geodeticSurfaceNormal(P,P);for(var D=A.fromAxisAngle(P,m,G),j=T.fromQuaternion(D,B),Z=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),K=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),J=e.length,Q=J/3*2,$=0;$<J;$+=3){var ee,te=$+1,re=$+2,ne=r.fromArray(e,$,L);if(i.st){var ae=T.multiplyByVector(j,ne,U),ie=x.project(c.cartesianToCartographic(ae,X),F);r.subtract(ie,C,ie),z.x=(ie.x+u)/(2*u),z.y=(ie.y+s)/(2*s),Z.x=Math.min(z.x,Z.x),Z.y=Math.min(z.y,Z.y),K.x=Math.max(z.x,K.x),K.y=Math.max(z.y,K.y),_[I+Q]=z.x,_[I+1+Q]=z.y,_[I++]=z.x,_[I++]=z.y}ne=c.scaleToGeodeticSurface(ne,ne),ee=r.clone(ne,U),w=c.geodeticSurfaceNormal(ne,w),N&&(g[$+J]=-w.x,g[te+J]=-w.y,g[re+J]=-w.z);var oe=r.multiplyByScalar(w,l,b);if(ne=r.add(ne,oe,ne),oe=r.multiplyByScalar(w,d,oe),ee=r.add(ee,oe,ee),i.position&&(y[$+J]=ee.x,y[te+J]=ee.y,y[re+J]=ee.z,y[$]=ne.x,y[te]=ne.y,y[re]=ne.z),i.normal||i.tangent||i.bitangent){M=r.clone(w,M);var ue=r.fromArray(e,($+3)%J,b);r.subtract(ue,ne,ue);var se=r.subtract(ee,ne,F);w=r.normalize(r.cross(se,ue,w),w),i.normal&&(R[$]=w.x,R[te]=w.y,R[re]=w.z,R[$+J]=w.x,R[te+J]=w.y,R[re+J]=w.z),i.tangent&&(O=r.normalize(r.cross(M,w,O),O),v[$]=O.x,v[te]=O.y,v[re]=O.z,v[$+J]=O.x,v[$+1+J]=O.y,v[$+2+J]=O.z),i.bitangent&&(S[$]=M.x,S[te]=M.y,S[re]=M.z,S[$+J]=M.x,S[te+J]=M.y,S[re+J]=M.z)}}if(i.st){J=_.length;for(var ce=0;ce<J;ce+=2)_[ce]=(_[ce]-Z.x)/(K.x-Z.x),_[ce+1]=(_[ce+1]-Z.y)/(K.y-Z.y)}var le=new E;return i.position&&(le.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:y})),i.st&&(le.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),i.normal&&(le.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),i.tangent&&(le.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),i.bitangent&&(le.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),N&&(le.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:g})),le}function x(e){for(var t=e.length/3,r=y.createTypedArray(t,6*t),n=0,a=0;a<t;a++){var i=a,o=a+t,u=(i+1)%t,s=u+t;r[n++]=i,r[n++]=o,r[n++]=u,r[n++]=u,r[n++]=o,r[n++]=s}return r}function C(t){var n=t.center,a=t.ellipsoid,i=t.semiMajorAxis,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,L),t.height,L);Z.center=r.add(n,o,Z.center),Z.radius=i,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,o),t.extrudedHeight,o),K.center=r.add(n,o,K.center),K.radius=i;var u=c.computeEllipsePositions(t,!0,!0),s=u.positions,l=u.numPts,f=u.outerPositions,h=e.union(Z,K),E=I(s,t,!0),_=w(l),T=_.length;_.length=2*T;for(var R=s.length/3,A=0;A<T;A+=3)_[A+T]=_[A+2]+R,_[A+1+T]=_[A+1]+R,_[A+2+T]=_[A]+R;var S=y.createTypedArray(2*R/3,_),N=new d({attributes:E,indices:S,primitiveType:v.TRIANGLES}),g=M(f,t);_=x(f);var O=y.createTypedArray(2*f.length/3,_),C=new d({attributes:g,indices:O,primitiveType:v.TRIANGLES}),P=p.combineInstances([new m({geometry:N}),new m({geometry:C})]);return{boundingSphere:h,attributes:P[0].attributes,indices:P[0].indices}}function P(e,t,n,a,i){N.eastNorthUpToFixedFrame(e,t,J),R.inverseTransformation(J,Q);for(var o=0;o<4;++o)r.clone(r.ZERO,ee[o]);for(ee[0].x+=n,ee[1].x-=n,ee[2].y+=a,ee[3].y-=a,T.fromRotationZ(i,$),o=0;o<4;++o)T.multiplyByVector($,ee[o],ee[o]),R.multiplyByPoint(J,ee[o],ee[o]),t.cartesianToCartographic(ee[o],te[o]);return S.fromCartographicArray(te)}function D(e){e=i(e,i.EMPTY_OBJECT);var t=e.center,n=i(e.ellipsoid,l.WGS84),a=e.semiMajorAxis,u=e.semiMinorAxis,s=i(e.granularity,_.RADIANS_PER_DEGREE),c=i(e.height,0),f=e.extrudedHeight,d=o(f)&&Math.abs(c-f)>1,h=i(e.vertexFormat,g.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=a,this._semiMinorAxis=u,this._ellipsoid=l.clone(n),this._rotation=i(e.rotation,0),this._stRotation=i(e.stRotation,0),this._height=c,this._granularity=s,this._vertexFormat=g.clone(h),this._extrudedHeight=i(f,c),this._extrude=d,this._shadowVolume=i(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._rectangle=P(this._center,this._ellipsoid,a,u,this._rotation)}var L=new r,U=new r,F=new r,b=new r,z=new t,B=new T,G=new A,q=new r,V=new r,W=new r,X=new n,H=new r,Y=new t,k=new t,j=new r,Z=new e,K=new e,J=new R,Q=new R,$=new T,ee=[new r,new r,new r,new r],te=[new n,new n,new n,new n];D.packedLength=r.packedLength+l.packedLength+g.packedLength+S.packedLength+9,D.pack=function(e,t,n){return n=i(n,0),r.pack(e._center,t,n),n+=r.packedLength,l.pack(e._ellipsoid,t,n),n+=l.packedLength,g.pack(e._vertexFormat,t,n),n+=g.packedLength,S.pack(e._rectangle,t,n),n+=S.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._extrude?1:0,t[n]=e._shadowVolume?1:0,t};var re=new r,ne=new l,ae=new g,ie=new S,oe={center:re,ellipsoid:ne,vertexFormat:ae,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0};return D.unpack=function(e,t,n){t=i(t,0);var a=r.unpack(e,t,re);t+=r.packedLength;var u=l.unpack(e,t,ne);t+=l.packedLength;var s=g.unpack(e,t,ae);t+=g.packedLength;var c=S.unpack(e,t,ie);t+=S.packedLength;var f=e[t++],d=e[t++],h=e[t++],E=e[t++],m=e[t++],p=e[t++],y=e[t++],_=1===e[t++],T=1===e[t];return o(n)?(n._center=r.clone(a,n._center),n._ellipsoid=l.clone(u,n._ellipsoid),n._vertexFormat=g.clone(s,n._vertexFormat),n._semiMajorAxis=f,n._semiMinorAxis=d,n._rotation=h,n._stRotation=E,n._height=m,n._granularity=p,n._extrudedHeight=y,n._extrude=_,n._shadowVolume=T,n._rectangle=S.clone(c),n):(oe.height=m,oe.extrudedHeight=y,oe.granularity=p,oe.stRotation=E,oe.rotation=h,oe.semiMajorAxis=f,oe.semiMinorAxis=d,oe.shadowVolume=T,new D(oe))},D.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),r.shadowVolume=e._shadowVolume,t=C(r)):t=O(r),new d({attributes:t.attributes,indices:t.indices,primitiveType:v.TRIANGLES,boundingSphere:t.boundingSphere})}},D.createShadowVolume=function(e,t,r){var n=e._granularity,a=e._ellipsoid,i=t(n,a),o=r(n,a);return new D({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:a,rotation:e._rotation,stRotation:e._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:g.POSITION_ONLY,shadowVolume:!0})},u(D.prototype,{rectangle:{get:function(){return this._rectangle}}}),D}),define("Core/CircleGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./EllipseGeometry","./Ellipsoid","./VertexFormat"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT);var t=e.radius,n={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 i(n),this._workerName="createCircleGeometry"}s.packedLength=i.packedLength,s.pack=function(e,t,r){return i.pack(e._ellipseGeometry,t,r)};var c=new i({center:new e,semiMajorAxis:1,semiMinorAxis:1}),l={center:new e,radius:void 0,ellipsoid:o.clone(o.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new u,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};return s.unpack=function(t,r,a){var f=i.unpack(t,r,c);return l.center=e.clone(f._center,l.center),l.ellipsoid=o.clone(f._ellipsoid,l.ellipsoid),l.height=f._height,l.extrudedHeight=f._extrudedHeight,l.granularity=f._granularity,l.vertexFormat=u.clone(f._vertexFormat,l.vertexFormat),l.stRotation=f._stRotation,l.shadowVolume=f._shadowVolume,n(a)?(l.semiMajorAxis=f._semiMajorAxis,l.semiMinorAxis=f._semiMinorAxis,a._ellipseGeometry=new i(l),a):(l.radius=f._semiMajorAxis,new s(l))},s.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},s.createShadowVolume=function(e,t,r){var n=e._ellipseGeometry._granularity,a=e._ellipseGeometry._ellipsoid,i=t(n,a),o=r(n,a);return new s({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:a,stRotation:e._ellipseGeometry._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:u.POSITION_ONLY,shadowVolume:!0})},a(s.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}}}),s}),define("Workers/createCircleGeometry",["../Core/Cartesian3","../Core/CircleGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,r,n){"use strict";function a(a,i){return r(i)&&(a=t.unpack(a,i)),a._ellipseGeometry._center=e.clone(a._ellipseGeometry._center),a._ellipseGeometry._ellipsoid=n.clone(a._ellipseGeometry._ellipsoid),t.createGeometry(a)}return a})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createCircleOutlineGeometry.js b/engines/Cesium/Workers/createCircleOutlineGeometry.js index 496e403..c4b14a6 100644 --- a/engines/Cesium/Workers/createCircleOutlineGeometry.js +++ b/engines/Cesium/Workers/createCircleOutlineGeometry.js @@ -55,7 +55,7 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,E),o.normalize(t,c);var n=o.dot(E,c),r=o.magnitude(o.cross(E,c,E));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,E=i*s-a*u,c=a*o-r*s,_=r*u-i*o;return n.x=E,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var l=new o,T=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:R,E=Math.cos(r);l.x=E*Math.cos(e),l.y=E*Math.sin(e),l.z=Math.sin(r),l=o.normalize(l,l),o.multiplyComponents(s,l,T);var c=Math.sqrt(o.dot(l,T));return T=o.divideByScalar(T,c,T),l=o.multiplyByScalar(l,i,l),n(u)||(u=new o),o.add(T,l,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromDegrees(u,s,0,t,r[E])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromRadians(u,s,0,t,r[E])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromDegrees(u,s,E,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromRadians(u,s,E,t,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,E){var c=n.x,_=n.y,l=n.z,T=i.x,R=i.y,h=i.z,f=c*c*T*T,d=_*_*R*R,A=l*l*h*h,N=f+d+A,I=Math.sqrt(1/N),S=e.multiplyByScalar(n,I,a);if(N<s)return isFinite(I)?e.clone(S,E):void 0;var y=u.x,M=u.y,m=u.z,p=o;p.x=S.x*y*2,p.y=S.y*M*2,p.z=S.z*m*2;var O,C,g,w,U,x,L,P,v,F,D,B=(1-I)*e.magnitude(n)/(.5*e.magnitude(p)),z=0;do{B-=z,g=1/(1+B*y),w=1/(1+B*M),U=1/(1+B*m),x=g*g,L=w*w,P=U*U,v=x*g,F=L*w,D=P*U,O=f*x+d*L+A*P-1,C=f*v*y+d*F*M+A*D*m;var G=-2*C;z=O/G}while(Math.abs(O)>r.EPSILON12);return t(E)?(E.x=c*g,E.y=_*w,E.z=l*U,E):new e(c*g,_*w,l*U)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,E=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),l=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(t,r,i){var R=n(r)?r.oneOverRadii:_,h=n(r)?r.oneOverRadiiSquared:l,f=n(r)?r._centerToleranceSquared:T,d=o(t,R,h,f,E);if(n(d)){var A=e.multiplyComponents(d,h,s);A=e.normalize(A,A);var N=e.subtract(t,d,c),I=Math.atan2(A.y,A.x),S=Math.asin(A.z),y=a.sign(e.dot(N,t))*e.magnitude(N);return n(i)?(i.longitude=I,i.latitude=S,i.height=y,i):new u(I,S,y)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,E(this,e,t,n)}i(c.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}}}),c.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(E(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),E=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=E,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,l=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=l;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var T=new e,R=new e,h=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,R);if(r(a)){var o=this.geodeticSurfaceNormal(a,T),s=e.subtract(n,a,h),E=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=E,i.latitude=c,i.height=_,i):new t(E,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i,a,o,u,s,E){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(E,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(h[n],R[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(h[a],R[a])]);o>r&&(i=a,r=o)}var E=1,c=0,_=R[i],l=h[i];if(Math.abs(e[s.getElementIndex(l,_)])>n){var T,f=e[s.getElementIndex(l,l)],d=e[s.getElementIndex(_,_)],A=e[s.getElementIndex(l,_)],N=(f-d)/2/A;T=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),E=1/Math.sqrt(1+T*T),c=T*E}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(_,_)]=t[s.getElementIndex(l,l)]=E,t[s.getElementIndex(l,_)]=c,t[s.getElementIndex(_,l)]=-c,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,E=e.y*e.z,c=e.y*e.w,_=e.z*e.z,l=e.z*e.w,T=e.w*e.w,R=n-u-_+T,h=2*(i-l),f=2*(a+c),d=2*(i+l),A=-n+u-_+T,N=2*(E-o),I=2*(a-c),S=2*(E+o),y=-n-u+_+T;return r(t)?(t[0]=R,t[1]=d,t[2]=I,t[3]=h,t[4]=A,t[5]=S,t[6]=f,t[7]=N,t[8]=y,t):new s(R,h,f,d,A,N,I,S,y)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),E=Math.sin(e.roll),c=n*i,_=-a*u+E*o*i,l=E*u+a*o*i,T=n*u,R=a*i+E*o*u,h=-o*a+a*o*u,f=-o,d=E*n,A=a*n;return r(t)?(t[0]=c,t[1]=T,t[2]=f,t[3]=_,t[4]=R,t[5]=d,t[6]=l,t[7]=h,t[8]=A,t):new s(c,_,l,T,R,h,f,d,A)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new s(1,0,0,0,n,-i,0,i,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new s(n,0,i,0,1,0,-i,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-i,0,i,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),n};var T=new e;s.getMaximumScale=function(t){return s.getScale(t,T),e.maximumComponent(T)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],E=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=E,n[7]=c,n[8]=_,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],E=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=E,t[8]=c,t};var R=[1,0,0],h=[2,2,1],f=new s,d=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var l=t.unitary=s.clone(s.IDENTITY,t.unitary),T=t.diagonal=s.clone(e,t.diagonal),R=n*E(T);o<i&&c(T)>R;)_(T,f),s.transpose(f,d),s.multiply(T,f,T),s.multiply(d,T,T),s.multiply(l,f,l),++a>2&&(++o,a=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],E=e[8];return t*(a*E-s*o)+i*(s*r-n*E)+u*(n*o-a*r)},s.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],E=e[6],c=e[7],_=e[8],l=s.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=E*u-a*_,t[4]=n*_-E*i,t[5]=a*i-n*u,t[6]=a*c-E*o,t[7]=E*r-n*c,t[8]=n*o-a*r;var T=1/l;return s.multiplyByScalar(t,T,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,E){ -"use strict";function c(e,t,n,i,a,o,u,s,E,c,_,l,T,R,h,f){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(E,0),this[3]=r(T,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(R,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(h,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(l,0),this[15]=r(f,0)}c.packedLength=16,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},c.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new c),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},c.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,E=t.x*t.y,_=t.x*t.z,l=t.x*t.w,T=t.y*t.y,R=t.y*t.z,h=t.y*t.w,f=t.z*t.z,d=t.z*t.w,A=t.w*t.w,N=s-T-f+A,I=2*(E-d),S=2*(_+h),y=2*(E+d),M=-s+T-f+A,m=2*(R-l),p=2*(_-h),O=2*(R+l),C=-s-T+f+A;return r[0]=N*a,r[1]=y*a,r[2]=p*a,r[3]=0,r[4]=I*o,r[5]=M*o,r[6]=O*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(s.IDENTITY,e,t)},c.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,l=new e,T=new e;c.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,l),l),e.normalize(e.cross(l,_,T),T);var u=l.x,s=l.y,E=l.z,R=_.x,h=_.y,f=_.z,d=T.x,A=T.y,N=T.z,I=r.x,S=r.y,y=r.z,M=u*-I+s*-S+E*-y,m=d*-I+A*-S+N*-y,p=R*I+h*S+f*y;return i(n)?(n[0]=u,n[1]=d,n[2]=-R,n[3]=0,n[4]=s,n[5]=A,n[6]=-h,n[7]=0,n[8]=E,n[9]=N,n[10]=-f,n[11]=0,n[12]=M,n[13]=m,n[14]=p,n[15]=1,n):new c(u,s,E,M,d,A,N,m,-R,-h,-f,p,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),E=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=E,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),E=1/(a-i),c=-(t+e)*u,_=-(r+n)*s,l=-(a+i)*E;return u*=2,s*=2,E*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=E,o[11]=0,o[12]=c,o[13]=_,o[14]=l,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),E=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),l=-1,T=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=E,o[9]=c,o[10]=_,o[11]=l,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),E=(r+n)/(r-n),c=-1,_=-1,l=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=s,a[9]=E,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=l,a[15]=0,a},c.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var E=.5*u,c=.5*s,_=.5*(n-t),l=E,T=c,R=_,h=a+E,f=o+c,d=t+_,A=1;return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=T,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=R,i[11]=0,i[12]=h,i[13]=f,i[14]=d,i[15]=A,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},c.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var R=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],R)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],R)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],R)),n};var h=new e;c.getMaximumScale=function(t){return c.getScale(t,h),e.maximumComponent(h)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],E=e[6],c=e[7],_=e[8],l=e[9],T=e[10],R=e[11],h=e[12],f=e[13],d=e[14],A=e[15],N=t[0],I=t[1],S=t[2],y=t[3],M=t[4],m=t[5],p=t[6],O=t[7],C=t[8],g=t[9],w=t[10],U=t[11],x=t[12],L=t[13],P=t[14],v=t[15],F=r*N+u*I+_*S+h*y,D=i*N+s*I+l*S+f*y,B=a*N+E*I+T*S+d*y,z=o*N+c*I+R*S+A*y,G=r*M+u*m+_*p+h*O,b=i*M+s*m+l*p+f*O,V=a*M+E*m+T*p+d*O,X=o*M+c*m+R*p+A*O,H=r*C+u*g+_*w+h*U,q=i*C+s*g+l*w+f*U,W=a*C+E*g+T*w+d*U,Y=o*C+c*g+R*w+A*U,k=r*x+u*L+_*P+h*v,K=i*x+s*L+l*P+f*v,j=a*x+E*L+T*P+d*v,Z=o*x+c*L+R*P+A*v;return n[0]=F,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=V,n[7]=X,n[8]=H,n[9]=q,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=j,n[15]=Z,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=e[12],T=e[13],R=e[14],h=t[0],f=t[1],d=t[2],A=t[4],N=t[5],I=t[6],S=t[8],y=t[9],M=t[10],m=t[12],p=t[13],O=t[14],C=r*h+o*f+E*d,g=i*h+u*f+c*d,w=a*h+s*f+_*d,U=r*A+o*N+E*I,x=i*A+u*N+c*I,L=a*A+s*N+_*I,P=r*S+o*y+E*M,v=i*S+u*y+c*M,F=a*S+s*y+_*M,D=r*m+o*p+E*O+l,B=i*m+u*p+c*O+T,z=a*m+s*p+_*O+R;return n[0]=C,n[1]=g,n[2]=w,n[3]=0,n[4]=U,n[5]=x,n[6]=L,n[7]=0,n[8]=P,n[9]=v,n[10]=F,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=t[0],T=t[1],R=t[2],h=t[3],f=t[4],d=t[5],A=t[6],N=t[7],I=t[8],S=r*l+o*T+E*R,y=i*l+u*T+c*R,M=a*l+s*T+_*R,m=r*h+o*f+E*d,p=i*h+u*f+c*d,O=a*h+s*f+_*d,C=r*A+o*N+E*I,g=i*A+u*N+c*I,w=a*A+s*N+_*I;return n[0]=S,n[1]=y,n[2]=M,n[3]=0,n[4]=m,n[5]=p,n[6]=O,n[7]=0,n[8]=C,n[9]=g,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var f=new e;c.multiplyByUniformScale=function(e,t,n){return f.x=t,f.y=t,f.z=t,c.multiplyByScale(e,f,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,E=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=E,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var d=new s,A=new s,N=new t,I=new t(0,0,0,1);return c.inverse=function(e,n){if(s.equalsEpsilon(c.getRotation(e,d),A,u.EPSILON7)&&t.equals(c.getRow(e,3,N),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],l=e[5],T=e[9],R=e[13],h=e[2],f=e[6],S=e[10],y=e[14],M=e[3],m=e[7],p=e[11],O=e[15],C=S*O,g=y*p,w=f*O,U=y*m,x=f*p,L=S*m,P=h*O,v=y*M,F=h*p,D=S*M,B=h*m,z=f*M,G=C*l+U*T+x*R-(g*l+w*T+L*R),b=g*_+P*T+D*R-(C*_+v*T+F*R),V=w*_+v*l+B*R-(U*_+P*l+z*R),X=L*_+F*l+z*T-(x*_+D*l+B*T),H=g*i+w*a+L*o-(C*i+U*a+x*o),q=C*r+v*a+F*o-(g*r+P*a+D*o),W=U*r+P*i+z*o-(w*r+v*i+B*o),Y=x*r+D*i+B*a-(L*r+F*i+z*a);C=a*R,g=o*T,w=i*R,U=o*l,x=i*T,L=a*l,P=r*R,v=o*_,F=r*T,D=a*_,B=r*l,z=i*_;var k=C*m+U*p+x*O-(g*m+w*p+L*O),K=g*M+P*p+D*O-(C*M+v*p+F*O),j=w*M+v*m+B*O-(U*M+P*m+z*O),Z=L*M+F*m+z*p-(x*M+D*m+B*p),Q=w*S+L*y+g*f-(x*y+C*f+U*S),J=F*y+C*h+v*S-(P*S+D*y+g*h),$=P*f+z*y+U*h-(B*y+w*h+v*f),ee=B*S+x*h+D*f-(F*f+z*S+L*h),te=r*G+i*b+a*V+o*X;if(Math.abs(te)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=V*te,n[3]=X*te,n[4]=H*te,n[5]=q*te,n[6]=W*te,n[7]=Y*te,n[8]=k*te,n[9]=K*te,n[10]=j*te,n[11]=Z*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],E=e[9],c=e[10],_=e[12],l=e[13],T=e[14],R=-n*_-r*l-i*T,h=-a*_-o*l-u*T,f=-s*_-E*l-c*T;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=E,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=R,t[13]=h,t[14]=f,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,i,a,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new s(e,t,i,a)},s.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new s(e,t,i,a)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,E=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,l=e.length;_<l;_++){var T=e[_];n=Math.min(n,T.longitude),i=Math.max(i,T.longitude),E=Math.min(E,T.latitude),c=Math.max(c,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+u.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=E,t.east=i,t.north=c,t):new s(n,E,i,c)},s.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,E=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,l=0,T=e.length;l<T;l++){var R=t.cartesianToCartographic(e[l]);i=Math.min(i,R.longitude),a=Math.max(a,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var h=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,h),E=Math.max(E,h)}return a-i>E-o&&(i=o,a=E,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new s(i,c,a,_)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,E)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var l=Math.max(e.south,t.south),T=Math.min(e.north,t.north);if(!(l>=T))return r(n)?(n.west=c,n.south=l,n.east=_,n.north=T,n):new s(c,l,_,T)}},s.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,E)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var E=new e;return s.subsample=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=e.north,l=e.south,T=e.east,R=e.west,h=E;h.height=i,h.longitude=R,h.latitude=_,o[c]=t.cartographicToCartesian(h,o[c]),c++,h.longitude=T,o[c]=t.cartographicToCartesian(h,o[c]),c++,h.latitude=l,o[c]=t.cartographicToCartesian(h,o[c]),c++,h.longitude=R,o[c]=t.cartographicToCartesian(h,o[c]),c++,_<0?h.latitude=_:l>0?h.latitude=l:h.latitude=0;for(var f=1;f<8;++f)h.longitude=-Math.PI+f*u.PI_OVER_TWO,s.contains(e,h)&&(o[c]=t.cartographicToCartesian(h,o[c]),c++);return 0===h.latitude&&(h.longitude=R,o[c]=t.cartographicToCartesian(h,o[c]),c++,h.longitude=T,o[c]=t.cartographicToCartesian(h,o[c]),c++),o.length=c,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,E,c,_){"use strict";function l(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var T=new e,R=new e,h=new e,f=new e,d=new e,A=new e,N=new e,I=new e,S=new e,y=new e,M=new e,m=new e;l.fromPoints=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],N),a=e.clone(r,T),o=e.clone(r,R),u=e.clone(r,h),s=e.clone(r,f),E=e.clone(r,d),c=e.clone(r,A),_=t.length,p=1;p<_;p++){e.clone(t[p],r);var O=r.x,C=r.y,g=r.z;O<a.x&&e.clone(r,a),O>s.x&&e.clone(r,s),C<o.y&&e.clone(r,o),C>E.y&&e.clone(r,E),g<u.z&&e.clone(r,u),g>c.z&&e.clone(r,c)}var w=e.magnitudeSquared(e.subtract(s,a,I)),U=e.magnitudeSquared(e.subtract(E,o,I)),x=e.magnitudeSquared(e.subtract(c,u,I)),L=a,P=s,v=w;U>v&&(v=U,L=o,P=E),x>v&&(v=x,L=u,P=c);var F=S;F.x=.5*(L.x+P.x),F.y=.5*(L.y+P.y),F.z=.5*(L.z+P.z);var D=e.magnitudeSquared(e.subtract(P,F,I)),B=Math.sqrt(D),z=y;z.x=a.x,z.y=o.y,z.z=u.z;var G=M;G.x=s.x,G.y=E.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),V=0;for(p=0;p<_;p++){e.clone(t[p],r);var X=e.magnitude(e.subtract(r,b,I));X>V&&(V=X);var H=e.magnitudeSquared(e.subtract(r,F,I));if(H>D){var q=Math.sqrt(H);B=.5*(B+q),D=B*B;var W=q-B;F.x=(B*F.x+W*r.x)/q,F.y=(B*F.y+W*r.y)/q,F.z=(B*F.z+W*r.z)/q}}return B<V?(e.clone(F,n.center),n.radius=B):(e.clone(b,n.center),n.radius=V),n};var p=new o,O=new e,C=new e,g=new t,w=new t;l.fromRectangle2D=function(e,t,n){return l.fromRectangleWithHeights2D(e,t,0,0,n)},l.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new l),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,p),_.southwest(t,g),g.height=a,_.northeast(t,w),w.height=o;var s=n.project(g,O),E=n.project(w,C),c=E.x-s.x,T=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(c*c+T*T+R*R);var h=u.center;return h.x=s.x+.5*c,h.y=s.y+.5*T,h.z=s.z+.5*R,u};var U=[];l.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,U)),l.fromPoints(u,o)},l.fromVertices=function(t,n,a,o){if(i(o)||(o=new l),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=N;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,T),E=e.clone(u,R),c=e.clone(u,h),_=e.clone(u,f),p=e.clone(u,d),O=e.clone(u,A),C=t.length,g=0;g<C;g+=a){var w=t[g]+n.x,U=t[g+1]+n.y,x=t[g+2]+n.z;u.x=w,u.y=U,u.z=x,w<s.x&&e.clone(u,s),w>_.x&&e.clone(u,_),U<E.y&&e.clone(u,E),U>p.y&&e.clone(u,p),x<c.z&&e.clone(u,c),x>O.z&&e.clone(u,O)}var L=e.magnitudeSquared(e.subtract(_,s,I)),P=e.magnitudeSquared(e.subtract(p,E,I)),v=e.magnitudeSquared(e.subtract(O,c,I)),F=s,D=_,B=L;P>B&&(B=P,F=E,D=p),v>B&&(B=v,F=c,D=O);var z=S;z.x=.5*(F.x+D.x),z.y=.5*(F.y+D.y),z.z=.5*(F.z+D.z);var G=e.magnitudeSquared(e.subtract(D,z,I)),b=Math.sqrt(G),V=y;V.x=s.x,V.y=E.y,V.z=c.z;var X=M;X.x=_.x,X.y=p.y,X.z=O.z;var H=e.multiplyByScalar(e.add(V,X,I),.5,m),q=0;for(g=0;g<C;g+=a){u.x=t[g]+n.x,u.y=t[g+1]+n.y,u.z=t[g+2]+n.z;var W=e.magnitude(e.subtract(u,H,I));W>q&&(q=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<q?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=q),o},l.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new l),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=N;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,T),u=e.clone(a,R),s=e.clone(a,h),E=e.clone(a,f),c=e.clone(a,d),_=e.clone(a,A),p=t.length,O=0;O<p;O+=3){var C=t[O]+n[O],g=t[O+1]+n[O+1],w=t[O+2]+n[O+2];a.x=C,a.y=g,a.z=w,C<o.x&&e.clone(a,o),C>E.x&&e.clone(a,E),g<u.y&&e.clone(a,u),g>c.y&&e.clone(a,c),w<s.z&&e.clone(a,s),w>_.z&&e.clone(a,_)}var U=e.magnitudeSquared(e.subtract(E,o,I)),x=e.magnitudeSquared(e.subtract(c,u,I)),L=e.magnitudeSquared(e.subtract(_,s,I)),P=o,v=E,F=U;x>F&&(F=x,P=u,v=c),L>F&&(F=L,P=s,v=_);var D=S;D.x=.5*(P.x+v.x),D.y=.5*(P.y+v.y),D.z=.5*(P.z+v.z);var B=e.magnitudeSquared(e.subtract(v,D,I)),z=Math.sqrt(B),G=y;G.x=o.x,G.y=u.y,G.z=s.z;var b=M;b.x=E.x,b.y=c.y,b.z=_.z;var V=e.multiplyByScalar(e.add(G,b,I),.5,m),X=0;for(O=0;O<p;O+=3){a.x=t[O]+n[O],a.y=t[O+1]+n[O+1],a.z=t[O+2]+n[O+2];var H=e.magnitude(e.subtract(a,V,I));H>X&&(X=H);var q=e.magnitudeSquared(e.subtract(a,D,I));if(q>B){var W=Math.sqrt(q);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<X?(e.clone(D,r.center),r.radius=z):(e.clone(V,r.center),r.radius=X),r},l.fromCornerPoints=function(t,n,r){i(r)||(r=new l);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},l.fromEllipsoid=function(t,n){return i(n)||(n=new l),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var x=new e;l.fromBoundingSpheres=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return l.clone(t[0],n);if(2===r)return l.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=l.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var E=t[o];s=Math.max(s,e.distance(u,E.center,x)+E.radius)}return n.radius=s,n};var L=new e,P=new e,v=new e;l.fromOrientedBoundingBox=function(t,n){i(n)||(n=new l);var r=t.halfAxes,a=E.getColumn(r,0,L),o=E.getColumn(r,1,P),u=E.getColumn(r,2,v),s=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,c,_),n},l.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new l(t.center,t.radius)},l.packedLength=4,l.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},l.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new l);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var F=new e,D=new e;l.union=function(t,n,r){i(r)||(r=new l);var a=t.center,o=t.radius,u=n.center,s=n.radius,E=e.subtract(u,a,F),c=e.magnitude(E);if(o>=c+s)return t.clone(r),r;if(s>=c+o)return n.clone(r),r;var _=.5*(o+c+s),T=e.multiplyByScalar(E,(-o+_)/c,D);return e.add(T,a,T),e.clone(T,r.center),r.radius=_,r};var B=new e;l.expand=function(t,n,r){r=l.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},l.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},l.transform=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;l.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},l.transformWithoutScale=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;l.computePlaneDistances=function(t,n,r,a){i(a)||(a=new s);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,V=new e,X=new e,H=new e,q=new e,W=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var K=new o;return l.projectTo2D=function(t,n,i){n=r(n,K);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,b),E=e.cross(e.UNIT_Z,s,V);e.normalize(E,E);var c=e.cross(s,E,X);e.normalize(c,c),e.multiplyByScalar(s,u,s),e.multiplyByScalar(c,u,c),e.multiplyByScalar(E,u,E);var _=e.negate(c,q),T=e.negate(E,H),R=Y,h=R[0];e.add(s,c,h),e.add(h,E,h),h=R[1],e.add(s,c,h),e.add(h,T,h),h=R[2],e.add(s,_,h),e.add(h,T,h),h=R[3],e.add(s,_,h),e.add(h,E,h),e.negate(s,s),h=R[4],e.add(s,c,h),e.add(h,E,h),h=R[5],e.add(s,c,h),e.add(h,T,h),h=R[6],e.add(s,_,h),e.add(h,T,h),h=R[7],e.add(s,_,h),e.add(h,E,h);for(var f=R.length,d=0;d<f;++d){var A=R[d];e.add(o,A,A);var N=a.cartesianToCartographic(A,W);n.project(N,A)}i=l.fromPoints(R,i),o=i.center;var I=o.x,S=o.y,y=o.z;return o.x=y,o.y=I,o.z=S,i},l.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},l.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.distanceSquaredTo=function(e){return l.distanceSquaredTo(this,e)},l.prototype.computePlaneDistances=function(e,t,n){return l.computePlaneDistances(this,e,t,n)},l.prototype.isOccluded=function(e){return l.isOccluded(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.clone=function(e){return l.clone(this,e)},l}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!l())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,y=r(e[1]))}return S}function a(){return i()&&y}function o(){if(!t(M)&&(M=!1,!i()&&!l()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(M=!0,m=r(e[1]))}return M}function u(){return o()&&m}function s(){if(!t(p)){p=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(p=!0,O=r(e[1]),O.isNightly=!!e[2])}return p}function E(){return s()&&O}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,g=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,g=r(e[1])))}return C}function _(){return c()&&g}function l(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(w=!0,U=r(e[1]))}return w}function T(){return l()&&U}function R(){if(!t(x)){x=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent); -null!==e&&(x=!0,L=r(e[1]))}return x}function h(){return t(P)||(P=/Windows/i.test(I.appVersion)),P}function f(){return R()&&L}function d(){return t(v)||(v="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),v}function A(){if(!t(D)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;D=t(n)&&""!==n,D&&(F=n)}return D}function N(){return A()?F:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,y,M,m,p,O,C,g,w,U,x,L,P,v,F,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:_,isEdge:l,edgeVersion:T,isFirefox:R,firefoxVersion:f,isWindows:h,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:d,supportsImageRenderingPixelated:A,imageRenderingValue:N};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(i[n])||(i[n]=!0,console.warn(e(r,n)))}var i={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return i.fromQuaternion=function(e,n){t(n)||(n=new i);var r=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,a),n.pitch=-Math.asin(r),n},i.fromDegrees=function(e,n,a,o){return t(o)||(o=new i),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=a*r.RADIANS_PER_DEGREE,o},i.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},i.equalsEpsilon=function(e,n,i,a){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,i,a)&&r.equalsEpsilon(e.pitch,n.pitch,i,a)&&r.equalsEpsilon(e.roll,n.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u,s,E){"use strict";function c(e,t,r,i){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(i,0)}var _=new e;c.fromAxisAngle=function(t,n,i){var a=n/2,o=Math.sin(a);_=e.normalize(t,_);var u=_.x*o,s=_.y*o,E=_.z*o,l=Math.cos(a);return r(i)?(i.x=u,i.y=s,i.z=E,i.w=l,i):new c(u,s,E,l)};var l=[1,2,0],T=new Array(3);c.fromRotationMatrix=function(e,t){var n,i,a,o,u,s=e[E.COLUMN0ROW0],_=e[E.COLUMN1ROW1],R=e[E.COLUMN2ROW2],h=s+_+R;if(h>0)n=Math.sqrt(h+1),u=.5*n,n=.5/n,i=(e[E.COLUMN1ROW2]-e[E.COLUMN2ROW1])*n,a=(e[E.COLUMN2ROW0]-e[E.COLUMN0ROW2])*n,o=(e[E.COLUMN0ROW1]-e[E.COLUMN1ROW0])*n;else{var f=l,d=0;_>s&&(d=1),R>s&&R>_&&(d=2);var A=f[d],N=f[A];n=Math.sqrt(e[E.getElementIndex(d,d)]-e[E.getElementIndex(A,A)]-e[E.getElementIndex(N,N)]+1);var I=T;I[d]=.5*n,n=.5/n,u=(e[E.getElementIndex(N,A)]-e[E.getElementIndex(A,N)])*n,I[A]=(e[E.getElementIndex(A,d)]+e[E.getElementIndex(d,A)])*n,I[N]=(e[E.getElementIndex(N,d)]+e[E.getElementIndex(d,N)])*n,i=-I[0],a=-I[1],o=-I[2]}return r(t)?(t.x=i,t.y=a,t.z=o,t.w=u,t):new c(i,a,o,u)};var R=new c,h=new c,f=new c,d=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var o;return t instanceof u?(o=t,a=n):(i("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),d=c.fromAxisAngle(e.UNIT_X,o.roll,R),f=c.fromAxisAngle(e.UNIT_Y,-o.pitch,a),a=c.multiply(f,d,f),h=c.fromAxisAngle(e.UNIT_Z,-o.heading,R),c.multiply(h,a,a)};var A=new e,N=new e,I=new c,S=new c,y=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,y),c.conjugate(y,y);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;c.unpack(e,4*(t+i),I),c.multiply(I,y,I),I.w<0&&c.negate(I,I),c.computeAxis(I,A);var u=c.computeAngle(I);r[o]=A.x*u,r[o+1]=A.y*u,r[o+2]=A.z*u}},c.unpackInterpolationResult=function(t,n,i,a,o){r(o)||(o=new c),e.fromArray(t,0,N);var u=e.magnitude(N);return c.unpack(n,4*a,S),0===u?c.clone(c.IDENTITY,I):c.fromAxisAngle(N,u,I),c.multiply(I,S,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,E=t.z,c=t.w,_=o*u+r*c+i*E-a*s,l=o*s-r*E+i*c+a*u,T=o*E+r*s-i*u+a*c,R=o*c-r*u-i*s-a*E;return n.x=_,n.y=l,n.z=T,n.w=R,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var M=new c;c.lerp=function(e,t,n,r){return M=c.multiplyByScalar(t,n,M),r=c.multiplyByScalar(e,1-n,r),c.add(M,r,r)};var m=new c,p=new c,O=new c;c.slerp=function(e,t,n,r){var i=c.dot(e,t),a=t;if(i<0&&(i=-i,a=m=c.negate(t,m)),1-i<s.EPSILON6)return c.lerp(e,a,n,r);var o=Math.acos(i);return p=c.multiplyByScalar(e,Math.sin((1-n)*o),p),O=c.multiplyByScalar(a,Math.sin(n*o),O),r=c.add(p,O,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=s.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},c.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var C=new e,g=new e,w=new c,U=new c;c.computeInnerQuadrangle=function(t,n,r,i){var a=c.conjugate(n,w);c.multiply(a,r,U);var o=c.log(U,C);c.multiply(a,t,U);var u=c.log(U,g);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,w),c.multiply(n,w,i)},c.squad=function(e,t,n,r,i,a){var o=c.slerp(e,t,i,w),u=c.slerp(n,r,i,U);return c.slerp(o,u,2*i*(1-i),a)};for(var x=new c,L=1.9011074535173003,P=a.supportsTypedArrays()?new Float32Array(8):[],v=a.supportsTypedArrays()?new Float32Array(8):[],F=a.supportsTypedArrays()?new Float32Array(8):[],D=a.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,G=2*z+1;P[B]=1/(z*G),v[B]=z/G}return P[7]=L/136,v[7]=8*L/17,c.fastSlerp=function(e,t,n,r){var i,a=c.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,s=n*n,E=u*u,_=7;_>=0;--_)F[_]=(P[_]*s-v[_])*o,D[_]=(P[_]*E-v[_])*o;var l=i*n*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),T=u*(1+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),R=c.multiplyByScalar(e,T,x);return c.multiplyByScalar(t,l,r),c.add(R,r,r)},c.fastSquad=function(e,t,n,r,i,a){var o=c.fastSlerp(e,t,i,w),u=c.fastSlerp(n,r,i,U);return c.fastSlerp(o,u,2*i*(1-i),a)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,n,r){"use strict";function i(t,i,a,c,_,l,T,R,h,f){var d=t+i;e.multiplyByScalar(c,Math.cos(d),o),e.multiplyByScalar(a,Math.sin(d),u),e.add(o,u,o);var A=Math.cos(t);A*=A;var N=Math.sin(t);N*=N;var I=l/Math.sqrt(T*A+_*N),S=I/R;return r.fromAxisAngle(o,S,s),n.fromQuaternion(s,E),n.multiplyByVector(E,h,f),e.normalize(f,f),e.multiplyByScalar(f,R,f),f}var a={},o=new e,u=new e,s=new r,E=new n,c=new e,_=new e,l=new e,T=new e;a.raisePositionsToHeight=function(t,n,r){for(var i=n.ellipsoid,a=n.height,o=n.extrudedHeight,u=r?t.length/3*2:t.length/3,s=new Float64Array(3*u),E=t.length,R=r?E:0,h=0;h<E;h+=3){var f=h+1,d=h+2,A=e.fromArray(t,h,c);i.scaleToGeodeticSurface(A,A);var N=e.clone(A,_),I=i.geodeticSurfaceNormal(A,T),S=e.multiplyByScalar(I,a,l);e.add(A,S,A),r&&(e.multiplyByScalar(I,o,S),e.add(N,S,N),s[h+R]=N.x,s[f+R]=N.y,s[d+R]=N.z),s[h]=A.x,s[f]=A.y,s[d]=A.z}return s};var R=new e,h=new e,f=new e;return a.computeEllipsePositions=function(n,r,a){var o=n.semiMinorAxis,u=n.semiMajorAxis,s=n.rotation,E=n.center,T=8*n.granularity,d=o*o,A=u*u,N=u*o,I=e.magnitude(E),S=e.normalize(E,R),y=e.cross(e.UNIT_Z,E,h);y=e.normalize(y,y);var M=e.cross(S,y,f),m=1+Math.ceil(t.PI_OVER_TWO/T),p=t.PI_OVER_TWO/(m-1),O=t.PI_OVER_TWO-m*p;O<0&&(m-=Math.ceil(Math.abs(O)/p));var C,g,w,U,x,L=2*(m*(m+2)),P=r?new Array(3*L):void 0,v=0,F=c,D=_,B=4*m*3,z=B-1,G=0,b=a?new Array(B):void 0;for(O=t.PI_OVER_TWO,F=i(O,s,M,y,d,N,A,I,S,F),r&&(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z),a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x),O=t.PI_OVER_TWO-p,C=1;C<m+1;++C){if(F=i(O,s,M,y,d,N,A,I,S,F),D=i(Math.PI-O,s,M,y,d,N,A,I,S,D),r){for(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z,w=2*C+2,g=1;g<w-1;++g)U=g/(w-1),x=e.lerp(F,D,U,l),P[v++]=x.x,P[v++]=x.y,P[v++]=x.z;P[v++]=D.x,P[v++]=D.y,P[v++]=D.z}a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,b[G++]=D.x,b[G++]=D.y,b[G++]=D.z),O=t.PI_OVER_TWO-(C+1)*p}for(C=m;C>1;--C){if(O=t.PI_OVER_TWO-(C-1)*p,F=i(-O,s,M,y,d,N,A,I,S,F),D=i(O+Math.PI,s,M,y,d,N,A,I,S,D),r){for(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z,w=2*(C-1)+2,g=1;g<w-1;++g)U=g/(w-1),x=e.lerp(F,D,U,l),P[v++]=x.x,P[v++]=x.y,P[v++]=x.z;P[v++]=D.x,P[v++]=D.y,P[v++]=D.z}a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,b[G++]=D.x,b[G++]=D.y,b[G++]=D.z)}O=t.PI_OVER_TWO,F=i(-O,s,M,y,d,N,A,I,S,F);var V={};return r&&(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z,V.positions=P,V.numPts=m),a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,V.outerPositions=b),V},a}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,n,r,i,a,o,u,s,E,c,_,l,T){"use strict";function R(r){var i=r.center;A=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(i,A),r.height,A),A=t.add(i,A,A);for(var a=new e(A,r.semiMajorAxis),u=o.computeEllipsePositions(r,!1,!0).outerPositions,s=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(u,r,!1)})}),l=u.length/3,T=_.createTypedArray(l,2*l),R=0,h=0;h<l;++h)T[R++]=h,T[R++]=(h+1)%l;return{boundingSphere:a,attributes:s,indices:T}}function h(i){var a=i.center,u=i.ellipsoid,s=i.semiMajorAxis,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,d),i.height,d);N.center=t.add(a,T,N.center),N.radius=s,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,T),i.extrudedHeight,T),I.center=t.add(a,T,I.center),I.radius=s;var R=o.computeEllipsePositions(i,!1,!0).outerPositions,h=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(R,i,!0)})});R=h.position.values;var f=e.union(N,I),A=R.length/3,S=r(i.numberOfVerticalLines,16);S=l.clamp(S,0,A/2);var y=_.createTypedArray(A,2*A+2*S);A/=2;var M,m=0;for(M=0;M<A;++M)y[m++]=M,y[m++]=(M+1)%A,y[m++]=M+A,y[m++]=(M+1)%A+A;var p;if(S>0){var O=Math.min(S,A);p=Math.round(A/O);var C=Math.min(p*S,A);for(M=0;M<C;M+=p)y[m++]=M,y[m++]=M+A}return{boundingSphere:f,attributes:h,indices:y}}function f(e){e=r(e,r.EMPTY_OBJECT);var n=e.center,a=r(e.ellipsoid,u.WGS84),o=e.semiMajorAxis,s=e.semiMinorAxis,E=r(e.granularity,l.RADIANS_PER_DEGREE),c=r(e.height,0),_=e.extrudedHeight,T=i(_)&&Math.abs(c-_)>1;this._center=t.clone(n),this._semiMajorAxis=o,this._semiMinorAxis=s, -this._ellipsoid=u.clone(a),this._rotation=r(e.rotation,0),this._height=c,this._granularity=E,this._extrudedHeight=_,this._extrude=T,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var d=new t,A=new t,N=new e,I=new e;f.packedLength=t.packedLength+u.packedLength+9,f.pack=function(e,n,a){return a=r(a,0),t.pack(e._center,n,a),a+=t.packedLength,u.pack(e._ellipsoid,n,a),a+=u.packedLength,n[a++]=e._semiMajorAxis,n[a++]=e._semiMinorAxis,n[a++]=e._rotation,n[a++]=e._height,n[a++]=e._granularity,n[a++]=i(e._extrudedHeight)?1:0,n[a++]=r(e._extrudedHeight,0),n[a++]=e._extrude?1:0,n[a]=e._numberOfVerticalLines,n};var S=new t,y=new u,M={center:S,ellipsoid:y,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return f.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,S);n+=t.packedLength;var s=u.unpack(e,n,y);n+=u.packedLength;var E=e[n++],c=e[n++],_=e[n++],l=e[n++],T=e[n++],R=e[n++],h=e[n++],d=1===e[n++],A=e[n];return i(a)?(a._center=t.clone(o,a._center),a._ellipsoid=u.clone(s,a._ellipsoid),a._semiMajorAxis=E,a._semiMinorAxis=c,a._rotation=_,a._height=l,a._granularity=T,a._extrudedHeight=R?h:void 0,a._extrude=d,a._numberOfVerticalLines=A,a):(M.height=l,M.extrudedHeight=R?h:void 0,M.granularity=T,M.rotation=_,M.semiMajorAxis=E,M.semiMinorAxis=c,M.numberOfVerticalLines=A,new f(M))},f.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,n={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(n.extrudedHeight=Math.min(e._extrudedHeight,e._height),n.height=Math.max(e._extrudedHeight,e._height),t=h(n)):t=R(n),new s({attributes:t.attributes,indices:t.indices,primitiveType:T.LINES,boundingSphere:t.boundingSphere})}},f}),define("Core/CircleOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,n,r,i,a){"use strict";function o(e){e=n(e,n.EMPTY_OBJECT);var t=e.radius,r={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 i(r),this._workerName="createCircleOutlineGeometry"}o.packedLength=i.packedLength,o.pack=function(e,t,n){return i.pack(e._ellipseGeometry,t,n)};var u=new i({center:new e,semiMajorAxis:1,semiMinorAxis:1}),s={center:new e,radius:void 0,ellipsoid:a.clone(a.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return o.unpack=function(t,n,E){var c=i.unpack(t,n,u);return s.center=e.clone(c._center,s.center),s.ellipsoid=a.clone(c._ellipsoid,s.ellipsoid),s.height=c._height,s.extrudedHeight=c._extrudedHeight,s.granularity=c._granularity,s.numberOfVerticalLines=c._numberOfVerticalLines,r(E)?(s.semiMajorAxis=c._semiMajorAxis,s.semiMinorAxis=c._semiMinorAxis,E._ellipseGeometry=new i(s),E):(s.radius=c._semiMajorAxis,new o(s))},o.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},o}),define("Workers/createCircleOutlineGeometry",["../Core/Cartesian3","../Core/CircleOutlineGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,n,r){"use strict";function i(i,a){return n(a)&&(i=t.unpack(i,a)),i._ellipseGeometry._center=e.clone(i._ellipseGeometry._center),i._ellipseGeometry._ellipsoid=r.clone(i._ellipseGeometry._ellipsoid),t.createGeometry(i)}return i})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,E),o.normalize(t,c);var n=o.dot(E,c),r=o.magnitude(o.cross(E,c,E));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,E=i*s-a*u,c=a*o-r*s,_=r*u-i*o;return n.x=E,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var l=new o,T=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:R,E=Math.cos(r);l.x=E*Math.cos(e),l.y=E*Math.sin(e),l.z=Math.sin(r),l=o.normalize(l,l),o.multiplyComponents(s,l,T);var c=Math.sqrt(o.dot(l,T));return T=o.divideByScalar(T,c,T),l=o.multiplyByScalar(l,i,l),n(u)||(u=new o),o.add(T,l,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromDegrees(u,s,0,t,r[E])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromRadians(u,s,0,t,r[E])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromDegrees(u,s,E,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromRadians(u,s,E,t,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,E){var c=n.x,_=n.y,l=n.z,T=i.x,R=i.y,h=i.z,f=c*c*T*T,d=_*_*R*R,A=l*l*h*h,N=f+d+A,I=Math.sqrt(1/N),S=e.multiplyByScalar(n,I,a);if(N<s)return isFinite(I)?e.clone(S,E):void 0;var y=u.x,M=u.y,m=u.z,p=o;p.x=S.x*y*2,p.y=S.y*M*2,p.z=S.z*m*2;var O,C,g,w,U,x,L,P,v,F,D,B=(1-I)*e.magnitude(n)/(.5*e.magnitude(p)),z=0;do{B-=z,g=1/(1+B*y),w=1/(1+B*M),U=1/(1+B*m),x=g*g,L=w*w,P=U*U,v=x*g,F=L*w,D=P*U,O=f*x+d*L+A*P-1,C=f*v*y+d*F*M+A*D*m;var G=-2*C;z=O/G}while(Math.abs(O)>r.EPSILON12);return t(E)?(E.x=c*g,E.y=_*w,E.z=l*U,E):new e(c*g,_*w,l*U)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,i,a){return i=n(i,0),r(a)?(a.longitude=e,a.latitude=t,a.height=i,a):new u(e,t,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,E=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),l=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(t,n,i){var R=r(n)?n.oneOverRadii:_,h=r(n)?n.oneOverRadiiSquared:l,f=r(n)?n._centerToleranceSquared:T,d=o(t,R,h,f,E);if(r(d)){var A=e.multiplyComponents(d,h,s);A=e.normalize(A,A);var N=e.subtract(t,d,c),I=Math.atan2(A.y,A.x),S=Math.asin(A.z),y=a.sign(e.dot(N,t))*e.magnitude(N);return r(i)?(i.longitude=I,i.latitude=S,i.height=y,i):new u(I,S,y)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,E(this,e,t,n)}i(c.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}}}),c.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(E(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),E=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=E,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,l=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=l;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var T=new e,R=new e,h=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,R);if(r(a)){var o=this.geodeticSurfaceNormal(a,T),s=e.subtract(n,a,h),E=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=E,i.latitude=c,i.height=_,i):new t(E,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i,a,o,u,s,E){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(E,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(h[n],R[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(h[a],R[a])]);o>r&&(i=a,r=o)}var E=1,c=0,_=R[i],l=h[i];if(Math.abs(e[s.getElementIndex(l,_)])>n){var T,f=e[s.getElementIndex(l,l)],d=e[s.getElementIndex(_,_)],A=e[s.getElementIndex(l,_)],N=(f-d)/2/A;T=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),E=1/Math.sqrt(1+T*T),c=T*E}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(_,_)]=t[s.getElementIndex(l,l)]=E,t[s.getElementIndex(l,_)]=c,t[s.getElementIndex(_,l)]=-c,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,E=e.y*e.z,c=e.y*e.w,_=e.z*e.z,l=e.z*e.w,T=e.w*e.w,R=n-u-_+T,h=2*(i-l),f=2*(a+c),d=2*(i+l),A=-n+u-_+T,N=2*(E-o),I=2*(a-c),S=2*(E+o),y=-n-u+_+T;return r(t)?(t[0]=R,t[1]=d,t[2]=I,t[3]=h,t[4]=A,t[5]=S,t[6]=f,t[7]=N,t[8]=y,t):new s(R,h,f,d,A,N,I,S,y)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),E=Math.sin(e.roll),c=n*i,_=-a*u+E*o*i,l=E*u+a*o*i,T=n*u,R=a*i+E*o*u,h=-E*i+a*o*u,f=-o,d=E*n,A=a*n;return r(t)?(t[0]=c,t[1]=T,t[2]=f,t[3]=_,t[4]=R,t[5]=d,t[6]=l,t[7]=h,t[8]=A,t):new s(c,_,l,T,R,h,f,d,A)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new s(1,0,0,0,n,-i,0,i,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new s(n,0,i,0,1,0,-i,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-i,0,i,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),n};var T=new e;s.getMaximumScale=function(t){return s.getScale(t,T),e.maximumComponent(T)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],E=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=E,n[7]=c,n[8]=_,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],E=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=E,t[8]=c,t};var R=[1,0,0],h=[2,2,1],f=new s,d=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var l=t.unitary=s.clone(s.IDENTITY,t.unitary),T=t.diagonal=s.clone(e,t.diagonal),R=n*E(T);o<i&&c(T)>R;)_(T,f),s.transpose(f,d),s.multiply(T,f,T),s.multiply(d,T,T),s.multiply(l,f,l),++a>2&&(++o,a=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],E=e[8];return t*(a*E-s*o)+i*(s*r-n*E)+u*(n*o-a*r)},s.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],E=e[6],c=e[7],_=e[8],l=s.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=E*u-a*_,t[4]=n*_-E*i,t[5]=a*i-n*u,t[6]=a*c-E*o,t[7]=E*r-n*c,t[8]=n*o-a*r;var T=1/l;return s.multiplyByScalar(t,T,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,E){ +"use strict";function c(e,t,n,i,a,o,u,s,E,c,_,l,T,R,h,f){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(E,0),this[3]=r(T,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(R,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(h,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(l,0),this[15]=r(f,0)}c.packedLength=16,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},c.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new c),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},c.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,E=t.x*t.y,_=t.x*t.z,l=t.x*t.w,T=t.y*t.y,R=t.y*t.z,h=t.y*t.w,f=t.z*t.z,d=t.z*t.w,A=t.w*t.w,N=s-T-f+A,I=2*(E-d),S=2*(_+h),y=2*(E+d),M=-s+T-f+A,m=2*(R-l),p=2*(_-h),O=2*(R+l),C=-s-T+f+A;return r[0]=N*a,r[1]=y*a,r[2]=p*a,r[3]=0,r[4]=I*o,r[5]=M*o,r[6]=O*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(s.IDENTITY,e,t)},c.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,l=new e,T=new e;c.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,l),l),e.normalize(e.cross(l,_,T),T);var u=l.x,s=l.y,E=l.z,R=_.x,h=_.y,f=_.z,d=T.x,A=T.y,N=T.z,I=r.x,S=r.y,y=r.z,M=u*-I+s*-S+E*-y,m=d*-I+A*-S+N*-y,p=R*I+h*S+f*y;return i(n)?(n[0]=u,n[1]=d,n[2]=-R,n[3]=0,n[4]=s,n[5]=A,n[6]=-h,n[7]=0,n[8]=E,n[9]=N,n[10]=-f,n[11]=0,n[12]=M,n[13]=m,n[14]=p,n[15]=1,n):new c(u,s,E,M,d,A,N,m,-R,-h,-f,p,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),E=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=E,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),E=1/(a-i),c=-(t+e)*u,_=-(r+n)*s,l=-(a+i)*E;return u*=2,s*=2,E*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=E,o[11]=0,o[12]=c,o[13]=_,o[14]=l,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),E=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),l=-1,T=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=E,o[9]=c,o[10]=_,o[11]=l,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),E=(r+n)/(r-n),c=-1,_=-1,l=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=s,a[9]=E,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=l,a[15]=0,a},c.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var E=.5*u,c=.5*s,_=.5*(n-t),l=E,T=c,R=_,h=a+E,f=o+c,d=t+_,A=1;return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=T,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=R,i[11]=0,i[12]=h,i[13]=f,i[14]=d,i[15]=A,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},c.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var R=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],R)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],R)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],R)),n};var h=new e;c.getMaximumScale=function(t){return c.getScale(t,h),e.maximumComponent(h)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],E=e[6],c=e[7],_=e[8],l=e[9],T=e[10],R=e[11],h=e[12],f=e[13],d=e[14],A=e[15],N=t[0],I=t[1],S=t[2],y=t[3],M=t[4],m=t[5],p=t[6],O=t[7],C=t[8],g=t[9],w=t[10],U=t[11],x=t[12],L=t[13],P=t[14],v=t[15],F=r*N+u*I+_*S+h*y,D=i*N+s*I+l*S+f*y,B=a*N+E*I+T*S+d*y,z=o*N+c*I+R*S+A*y,G=r*M+u*m+_*p+h*O,b=i*M+s*m+l*p+f*O,V=a*M+E*m+T*p+d*O,X=o*M+c*m+R*p+A*O,H=r*C+u*g+_*w+h*U,q=i*C+s*g+l*w+f*U,W=a*C+E*g+T*w+d*U,Y=o*C+c*g+R*w+A*U,k=r*x+u*L+_*P+h*v,K=i*x+s*L+l*P+f*v,j=a*x+E*L+T*P+d*v,Z=o*x+c*L+R*P+A*v;return n[0]=F,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=V,n[7]=X,n[8]=H,n[9]=q,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=j,n[15]=Z,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=e[12],T=e[13],R=e[14],h=t[0],f=t[1],d=t[2],A=t[4],N=t[5],I=t[6],S=t[8],y=t[9],M=t[10],m=t[12],p=t[13],O=t[14],C=r*h+o*f+E*d,g=i*h+u*f+c*d,w=a*h+s*f+_*d,U=r*A+o*N+E*I,x=i*A+u*N+c*I,L=a*A+s*N+_*I,P=r*S+o*y+E*M,v=i*S+u*y+c*M,F=a*S+s*y+_*M,D=r*m+o*p+E*O+l,B=i*m+u*p+c*O+T,z=a*m+s*p+_*O+R;return n[0]=C,n[1]=g,n[2]=w,n[3]=0,n[4]=U,n[5]=x,n[6]=L,n[7]=0,n[8]=P,n[9]=v,n[10]=F,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=t[0],T=t[1],R=t[2],h=t[3],f=t[4],d=t[5],A=t[6],N=t[7],I=t[8],S=r*l+o*T+E*R,y=i*l+u*T+c*R,M=a*l+s*T+_*R,m=r*h+o*f+E*d,p=i*h+u*f+c*d,O=a*h+s*f+_*d,C=r*A+o*N+E*I,g=i*A+u*N+c*I,w=a*A+s*N+_*I;return n[0]=S,n[1]=y,n[2]=M,n[3]=0,n[4]=m,n[5]=p,n[6]=O,n[7]=0,n[8]=C,n[9]=g,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var f=new e;c.multiplyByUniformScale=function(e,t,n){return f.x=t,f.y=t,f.z=t,c.multiplyByScale(e,f,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,E=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=E,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var d=new s,A=new s,N=new t,I=new t(0,0,0,1);return c.inverse=function(e,n){if(s.equalsEpsilon(c.getRotation(e,d),A,u.EPSILON7)&&t.equals(c.getRow(e,3,N),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],l=e[5],T=e[9],R=e[13],h=e[2],f=e[6],S=e[10],y=e[14],M=e[3],m=e[7],p=e[11],O=e[15],C=S*O,g=y*p,w=f*O,U=y*m,x=f*p,L=S*m,P=h*O,v=y*M,F=h*p,D=S*M,B=h*m,z=f*M,G=C*l+U*T+x*R-(g*l+w*T+L*R),b=g*_+P*T+D*R-(C*_+v*T+F*R),V=w*_+v*l+B*R-(U*_+P*l+z*R),X=L*_+F*l+z*T-(x*_+D*l+B*T),H=g*i+w*a+L*o-(C*i+U*a+x*o),q=C*r+v*a+F*o-(g*r+P*a+D*o),W=U*r+P*i+z*o-(w*r+v*i+B*o),Y=x*r+D*i+B*a-(L*r+F*i+z*a);C=a*R,g=o*T,w=i*R,U=o*l,x=i*T,L=a*l,P=r*R,v=o*_,F=r*T,D=a*_,B=r*l,z=i*_;var k=C*m+U*p+x*O-(g*m+w*p+L*O),K=g*M+P*p+D*O-(C*M+v*p+F*O),j=w*M+v*m+B*O-(U*M+P*m+z*O),Z=L*M+F*m+z*p-(x*M+D*m+B*p),Q=w*S+L*y+g*f-(x*y+C*f+U*S),J=F*y+C*h+v*S-(P*S+D*y+g*h),$=P*f+z*y+U*h-(B*y+w*h+v*f),ee=B*S+x*h+D*f-(F*f+z*S+L*h),te=r*G+i*b+a*V+o*X;if(Math.abs(te)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=V*te,n[3]=X*te,n[4]=H*te,n[5]=q*te,n[6]=W*te,n[7]=Y*te,n[8]=k*te,n[9]=K*te,n[10]=j*te,n[11]=Z*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],E=e[9],c=e[10],_=e[12],l=e[13],T=e[14],R=-n*_-r*l-i*T,h=-a*_-o*l-u*T,f=-s*_-E*l-c*T;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=E,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=R,t[13]=h,t[14]=f,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,i,a,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new s(e,t,i,a)},s.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new s(e,t,i,a)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,E=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,l=e.length;_<l;_++){var T=e[_];n=Math.min(n,T.longitude),i=Math.max(i,T.longitude),E=Math.min(E,T.latitude),c=Math.max(c,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+u.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=E,t.east=i,t.north=c,t):new s(n,E,i,c)},s.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,E=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,l=0,T=e.length;l<T;l++){var R=t.cartesianToCartographic(e[l]);i=Math.min(i,R.longitude),a=Math.max(a,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var h=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,h),E=Math.max(E,h)}return a-i>E-o&&(i=o,a=E,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new s(i,c,a,_)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,E)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var l=Math.max(e.south,t.south),T=Math.min(e.north,t.north);if(!(l>=T))return r(n)?(n.west=c,n.south=l,n.east=_,n.north=T,n):new s(c,l,_,T)}},s.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,E)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var E=new e;return s.subsample=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=e.north,l=e.south,T=e.east,R=e.west,h=E;h.height=i,h.longitude=R,h.latitude=_,o[c]=t.cartographicToCartesian(h,o[c]),c++,h.longitude=T,o[c]=t.cartographicToCartesian(h,o[c]),c++,h.latitude=l,o[c]=t.cartographicToCartesian(h,o[c]),c++,h.longitude=R,o[c]=t.cartographicToCartesian(h,o[c]),c++,_<0?h.latitude=_:l>0?h.latitude=l:h.latitude=0;for(var f=1;f<8;++f)h.longitude=-Math.PI+f*u.PI_OVER_TWO,s.contains(e,h)&&(o[c]=t.cartographicToCartesian(h,o[c]),c++);return 0===h.latitude&&(h.longitude=R,o[c]=t.cartographicToCartesian(h,o[c]),c++,h.longitude=T,o[c]=t.cartographicToCartesian(h,o[c]),c++),o.length=c,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,E,c,_){"use strict";function l(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var T=new e,R=new e,h=new e,f=new e,d=new e,A=new e,N=new e,I=new e,S=new e,y=new e,M=new e,m=new e;l.fromPoints=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],N),a=e.clone(r,T),o=e.clone(r,R),u=e.clone(r,h),s=e.clone(r,f),E=e.clone(r,d),c=e.clone(r,A),_=t.length,p=1;p<_;p++){e.clone(t[p],r);var O=r.x,C=r.y,g=r.z;O<a.x&&e.clone(r,a),O>s.x&&e.clone(r,s),C<o.y&&e.clone(r,o),C>E.y&&e.clone(r,E),g<u.z&&e.clone(r,u),g>c.z&&e.clone(r,c)}var w=e.magnitudeSquared(e.subtract(s,a,I)),U=e.magnitudeSquared(e.subtract(E,o,I)),x=e.magnitudeSquared(e.subtract(c,u,I)),L=a,P=s,v=w;U>v&&(v=U,L=o,P=E),x>v&&(v=x,L=u,P=c);var F=S;F.x=.5*(L.x+P.x),F.y=.5*(L.y+P.y),F.z=.5*(L.z+P.z);var D=e.magnitudeSquared(e.subtract(P,F,I)),B=Math.sqrt(D),z=y;z.x=a.x,z.y=o.y,z.z=u.z;var G=M;G.x=s.x,G.y=E.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),V=0;for(p=0;p<_;p++){e.clone(t[p],r);var X=e.magnitude(e.subtract(r,b,I));X>V&&(V=X);var H=e.magnitudeSquared(e.subtract(r,F,I));if(H>D){var q=Math.sqrt(H);B=.5*(B+q),D=B*B;var W=q-B;F.x=(B*F.x+W*r.x)/q,F.y=(B*F.y+W*r.y)/q,F.z=(B*F.z+W*r.z)/q}}return B<V?(e.clone(F,n.center),n.radius=B):(e.clone(b,n.center),n.radius=V),n};var p=new o,O=new e,C=new e,g=new t,w=new t;l.fromRectangle2D=function(e,t,n){return l.fromRectangleWithHeights2D(e,t,0,0,n)},l.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new l),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,p),_.southwest(t,g),g.height=a,_.northeast(t,w),w.height=o;var s=n.project(g,O),E=n.project(w,C),c=E.x-s.x,T=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(c*c+T*T+R*R);var h=u.center;return h.x=s.x+.5*c,h.y=s.y+.5*T,h.z=s.z+.5*R,u};var U=[];l.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,U)),l.fromPoints(u,o)},l.fromVertices=function(t,n,a,o){if(i(o)||(o=new l),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=N;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,T),E=e.clone(u,R),c=e.clone(u,h),_=e.clone(u,f),p=e.clone(u,d),O=e.clone(u,A),C=t.length,g=0;g<C;g+=a){var w=t[g]+n.x,U=t[g+1]+n.y,x=t[g+2]+n.z;u.x=w,u.y=U,u.z=x,w<s.x&&e.clone(u,s),w>_.x&&e.clone(u,_),U<E.y&&e.clone(u,E),U>p.y&&e.clone(u,p),x<c.z&&e.clone(u,c),x>O.z&&e.clone(u,O)}var L=e.magnitudeSquared(e.subtract(_,s,I)),P=e.magnitudeSquared(e.subtract(p,E,I)),v=e.magnitudeSquared(e.subtract(O,c,I)),F=s,D=_,B=L;P>B&&(B=P,F=E,D=p),v>B&&(B=v,F=c,D=O);var z=S;z.x=.5*(F.x+D.x),z.y=.5*(F.y+D.y),z.z=.5*(F.z+D.z);var G=e.magnitudeSquared(e.subtract(D,z,I)),b=Math.sqrt(G),V=y;V.x=s.x,V.y=E.y,V.z=c.z;var X=M;X.x=_.x,X.y=p.y,X.z=O.z;var H=e.multiplyByScalar(e.add(V,X,I),.5,m),q=0;for(g=0;g<C;g+=a){u.x=t[g]+n.x,u.y=t[g+1]+n.y,u.z=t[g+2]+n.z;var W=e.magnitude(e.subtract(u,H,I));W>q&&(q=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<q?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=q),o},l.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new l),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=N;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,T),u=e.clone(a,R),s=e.clone(a,h),E=e.clone(a,f),c=e.clone(a,d),_=e.clone(a,A),p=t.length,O=0;O<p;O+=3){var C=t[O]+n[O],g=t[O+1]+n[O+1],w=t[O+2]+n[O+2];a.x=C,a.y=g,a.z=w,C<o.x&&e.clone(a,o),C>E.x&&e.clone(a,E),g<u.y&&e.clone(a,u),g>c.y&&e.clone(a,c),w<s.z&&e.clone(a,s),w>_.z&&e.clone(a,_)}var U=e.magnitudeSquared(e.subtract(E,o,I)),x=e.magnitudeSquared(e.subtract(c,u,I)),L=e.magnitudeSquared(e.subtract(_,s,I)),P=o,v=E,F=U;x>F&&(F=x,P=u,v=c),L>F&&(F=L,P=s,v=_);var D=S;D.x=.5*(P.x+v.x),D.y=.5*(P.y+v.y),D.z=.5*(P.z+v.z);var B=e.magnitudeSquared(e.subtract(v,D,I)),z=Math.sqrt(B),G=y;G.x=o.x,G.y=u.y,G.z=s.z;var b=M;b.x=E.x,b.y=c.y,b.z=_.z;var V=e.multiplyByScalar(e.add(G,b,I),.5,m),X=0;for(O=0;O<p;O+=3){a.x=t[O]+n[O],a.y=t[O+1]+n[O+1],a.z=t[O+2]+n[O+2];var H=e.magnitude(e.subtract(a,V,I));H>X&&(X=H);var q=e.magnitudeSquared(e.subtract(a,D,I));if(q>B){var W=Math.sqrt(q);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<X?(e.clone(D,r.center),r.radius=z):(e.clone(V,r.center),r.radius=X),r},l.fromCornerPoints=function(t,n,r){i(r)||(r=new l);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},l.fromEllipsoid=function(t,n){return i(n)||(n=new l),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var x=new e;l.fromBoundingSpheres=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return l.clone(t[0],n);if(2===r)return l.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=l.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var E=t[o];s=Math.max(s,e.distance(u,E.center,x)+E.radius)}return n.radius=s,n};var L=new e,P=new e,v=new e;l.fromOrientedBoundingBox=function(t,n){i(n)||(n=new l);var r=t.halfAxes,a=E.getColumn(r,0,L),o=E.getColumn(r,1,P),u=E.getColumn(r,2,v);return e.add(a,o,a),e.add(a,u,a),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(a),n},l.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new l(t.center,t.radius)},l.packedLength=4,l.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},l.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new l);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var F=new e,D=new e;l.union=function(t,n,r){i(r)||(r=new l);var a=t.center,o=t.radius,u=n.center,s=n.radius,E=e.subtract(u,a,F),c=e.magnitude(E);if(o>=c+s)return t.clone(r),r;if(s>=c+o)return n.clone(r),r;var _=.5*(o+c+s),T=e.multiplyByScalar(E,(-o+_)/c,D);return e.add(T,a,T),e.clone(T,r.center),r.radius=_,r};var B=new e;l.expand=function(t,n,r){r=l.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},l.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},l.transform=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;l.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},l.transformWithoutScale=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;l.computePlaneDistances=function(t,n,r,a){i(a)||(a=new s);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,V=new e,X=new e,H=new e,q=new e,W=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var K=new o;return l.projectTo2D=function(t,n,i){n=r(n,K);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,b),E=e.cross(e.UNIT_Z,s,V);e.normalize(E,E);var c=e.cross(s,E,X);e.normalize(c,c),e.multiplyByScalar(s,u,s),e.multiplyByScalar(c,u,c),e.multiplyByScalar(E,u,E);var _=e.negate(c,q),T=e.negate(E,H),R=Y,h=R[0];e.add(s,c,h),e.add(h,E,h),h=R[1],e.add(s,c,h),e.add(h,T,h),h=R[2],e.add(s,_,h),e.add(h,T,h),h=R[3],e.add(s,_,h),e.add(h,E,h),e.negate(s,s),h=R[4],e.add(s,c,h),e.add(h,E,h),h=R[5],e.add(s,c,h),e.add(h,T,h),h=R[6],e.add(s,_,h),e.add(h,T,h),h=R[7],e.add(s,_,h),e.add(h,E,h);for(var f=R.length,d=0;d<f;++d){var A=R[d];e.add(o,A,A);var N=a.cartesianToCartographic(A,W);n.project(N,A)}i=l.fromPoints(R,i),o=i.center;var I=o.x,S=o.y,y=o.z;return o.x=y,o.y=I,o.z=S,i},l.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},l.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.distanceSquaredTo=function(e){return l.distanceSquaredTo(this,e)},l.prototype.computePlaneDistances=function(e,t,n){return l.computePlaneDistances(this,e,t,n)},l.prototype.isOccluded=function(e){return l.isOccluded(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.clone=function(e){return l.clone(this,e)},l}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!l())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,y=r(e[1]))}return S}function a(){return i()&&y}function o(){if(!t(M)&&(M=!1,!i()&&!l()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(M=!0,m=r(e[1]))}return M}function u(){return o()&&m}function s(){if(!t(p)){p=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(p=!0,O=r(e[1]),O.isNightly=!!e[2])}return p}function E(){return s()&&O}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,g=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,g=r(e[1])))}return C}function _(){return c()&&g}function l(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(w=!0,U=r(e[1]))}return w}function T(){return l()&&U}function R(){if(!t(x)){x=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(x=!0,L=r(e[1])); +}return x}function h(){return t(P)||(P=/Windows/i.test(I.appVersion)),P}function f(){return R()&&L}function d(){return t(v)||(v="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),v}function A(){if(!t(D)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;D=t(n)&&""!==n,D&&(F=n)}return D}function N(){return A()?F:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,y,M,m,p,O,C,g,w,U,x,L,P,v,F,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:_,isEdge:l,edgeVersion:T,isFirefox:R,firefoxVersion:f,isWindows:h,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:d,supportsImageRenderingPixelated:A,imageRenderingValue:N};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(i[n])||(i[n]=!0,console.warn(e(r,n)))}var i={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return i.fromQuaternion=function(e,n){t(n)||(n=new i);var r=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,a),n.pitch=-Math.asin(r),n},i.fromDegrees=function(e,n,a,o){return t(o)||(o=new i),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=a*r.RADIANS_PER_DEGREE,o},i.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},i.equalsEpsilon=function(e,n,i,a){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,i,a)&&r.equalsEpsilon(e.pitch,n.pitch,i,a)&&r.equalsEpsilon(e.roll,n.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u,s,E){"use strict";function c(e,t,r,i){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(i,0)}var _=new e;c.fromAxisAngle=function(t,n,i){var a=n/2,o=Math.sin(a);_=e.normalize(t,_);var u=_.x*o,s=_.y*o,E=_.z*o,l=Math.cos(a);return r(i)?(i.x=u,i.y=s,i.z=E,i.w=l,i):new c(u,s,E,l)};var l=[1,2,0],T=new Array(3);c.fromRotationMatrix=function(e,t){var n,i,a,o,u,s=e[E.COLUMN0ROW0],_=e[E.COLUMN1ROW1],R=e[E.COLUMN2ROW2],h=s+_+R;if(h>0)n=Math.sqrt(h+1),u=.5*n,n=.5/n,i=(e[E.COLUMN1ROW2]-e[E.COLUMN2ROW1])*n,a=(e[E.COLUMN2ROW0]-e[E.COLUMN0ROW2])*n,o=(e[E.COLUMN0ROW1]-e[E.COLUMN1ROW0])*n;else{var f=l,d=0;_>s&&(d=1),R>s&&R>_&&(d=2);var A=f[d],N=f[A];n=Math.sqrt(e[E.getElementIndex(d,d)]-e[E.getElementIndex(A,A)]-e[E.getElementIndex(N,N)]+1);var I=T;I[d]=.5*n,n=.5/n,u=(e[E.getElementIndex(N,A)]-e[E.getElementIndex(A,N)])*n,I[A]=(e[E.getElementIndex(A,d)]+e[E.getElementIndex(d,A)])*n,I[N]=(e[E.getElementIndex(N,d)]+e[E.getElementIndex(d,N)])*n,i=-I[0],a=-I[1],o=-I[2]}return r(t)?(t.x=i,t.y=a,t.z=o,t.w=u,t):new c(i,a,o,u)};var R=new c,h=new c,f=new c,d=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var o;return t instanceof u?(o=t,a=n):(i("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),d=c.fromAxisAngle(e.UNIT_X,o.roll,R),f=c.fromAxisAngle(e.UNIT_Y,-o.pitch,a),a=c.multiply(f,d,f),h=c.fromAxisAngle(e.UNIT_Z,-o.heading,R),c.multiply(h,a,a)};var A=new e,N=new e,I=new c,S=new c,y=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,y),c.conjugate(y,y);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;c.unpack(e,4*(t+i),I),c.multiply(I,y,I),I.w<0&&c.negate(I,I),c.computeAxis(I,A);var u=c.computeAngle(I);r[o]=A.x*u,r[o+1]=A.y*u,r[o+2]=A.z*u}},c.unpackInterpolationResult=function(t,n,i,a,o){r(o)||(o=new c),e.fromArray(t,0,N);var u=e.magnitude(N);return c.unpack(n,4*a,S),0===u?c.clone(c.IDENTITY,I):c.fromAxisAngle(N,u,I),c.multiply(I,S,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,E=t.z,c=t.w,_=o*u+r*c+i*E-a*s,l=o*s-r*E+i*c+a*u,T=o*E+r*s-i*u+a*c,R=o*c-r*u-i*s-a*E;return n.x=_,n.y=l,n.z=T,n.w=R,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var M=new c;c.lerp=function(e,t,n,r){return M=c.multiplyByScalar(t,n,M),r=c.multiplyByScalar(e,1-n,r),c.add(M,r,r)};var m=new c,p=new c,O=new c;c.slerp=function(e,t,n,r){var i=c.dot(e,t),a=t;if(i<0&&(i=-i,a=m=c.negate(t,m)),1-i<s.EPSILON6)return c.lerp(e,a,n,r);var o=Math.acos(i);return p=c.multiplyByScalar(e,Math.sin((1-n)*o),p),O=c.multiplyByScalar(a,Math.sin(n*o),O),r=c.add(p,O,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=s.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},c.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var C=new e,g=new e,w=new c,U=new c;c.computeInnerQuadrangle=function(t,n,r,i){var a=c.conjugate(n,w);c.multiply(a,r,U);var o=c.log(U,C);c.multiply(a,t,U);var u=c.log(U,g);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,w),c.multiply(n,w,i)},c.squad=function(e,t,n,r,i,a){var o=c.slerp(e,t,i,w),u=c.slerp(n,r,i,U);return c.slerp(o,u,2*i*(1-i),a)};for(var x=new c,L=1.9011074535173003,P=a.supportsTypedArrays()?new Float32Array(8):[],v=a.supportsTypedArrays()?new Float32Array(8):[],F=a.supportsTypedArrays()?new Float32Array(8):[],D=a.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,G=2*z+1;P[B]=1/(z*G),v[B]=z/G}return P[7]=L/136,v[7]=8*L/17,c.fastSlerp=function(e,t,n,r){var i,a=c.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,s=n*n,E=u*u,_=7;_>=0;--_)F[_]=(P[_]*s-v[_])*o,D[_]=(P[_]*E-v[_])*o;var l=i*n*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),T=u*(1+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),R=c.multiplyByScalar(e,T,x);return c.multiplyByScalar(t,l,r),c.add(R,r,r)},c.fastSquad=function(e,t,n,r,i,a){var o=c.fastSlerp(e,t,i,w),u=c.fastSlerp(n,r,i,U);return c.fastSlerp(o,u,2*i*(1-i),a)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,n,r){"use strict";function i(t,i,a,c,_,l,T,R,h,f){var d=t+i;e.multiplyByScalar(c,Math.cos(d),o),e.multiplyByScalar(a,Math.sin(d),u),e.add(o,u,o);var A=Math.cos(t);A*=A;var N=Math.sin(t);N*=N;var I=l/Math.sqrt(T*A+_*N),S=I/R;return r.fromAxisAngle(o,S,s),n.fromQuaternion(s,E),n.multiplyByVector(E,h,f),e.normalize(f,f),e.multiplyByScalar(f,R,f),f}var a={},o=new e,u=new e,s=new r,E=new n,c=new e,_=new e,l=new e,T=new e;a.raisePositionsToHeight=function(t,n,r){for(var i=n.ellipsoid,a=n.height,o=n.extrudedHeight,u=r?t.length/3*2:t.length/3,s=new Float64Array(3*u),E=t.length,R=r?E:0,h=0;h<E;h+=3){var f=h+1,d=h+2,A=e.fromArray(t,h,c);i.scaleToGeodeticSurface(A,A);var N=e.clone(A,_),I=i.geodeticSurfaceNormal(A,T),S=e.multiplyByScalar(I,a,l);e.add(A,S,A),r&&(e.multiplyByScalar(I,o,S),e.add(N,S,N),s[h+R]=N.x,s[f+R]=N.y,s[d+R]=N.z),s[h]=A.x,s[f]=A.y,s[d]=A.z}return s};var R=new e,h=new e,f=new e;return a.computeEllipsePositions=function(n,r,a){var o=n.semiMinorAxis,u=n.semiMajorAxis,s=n.rotation,E=n.center,T=8*n.granularity,d=o*o,A=u*u,N=u*o,I=e.magnitude(E),S=e.normalize(E,R),y=e.cross(e.UNIT_Z,E,h);y=e.normalize(y,y);var M=e.cross(S,y,f),m=1+Math.ceil(t.PI_OVER_TWO/T),p=t.PI_OVER_TWO/(m-1),O=t.PI_OVER_TWO-m*p;O<0&&(m-=Math.ceil(Math.abs(O)/p));var C,g,w,U,x,L=2*(m*(m+2)),P=r?new Array(3*L):void 0,v=0,F=c,D=_,B=4*m*3,z=B-1,G=0,b=a?new Array(B):void 0;for(O=t.PI_OVER_TWO,F=i(O,s,M,y,d,N,A,I,S,F),r&&(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z),a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x),O=t.PI_OVER_TWO-p,C=1;C<m+1;++C){if(F=i(O,s,M,y,d,N,A,I,S,F),D=i(Math.PI-O,s,M,y,d,N,A,I,S,D),r){for(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z,w=2*C+2,g=1;g<w-1;++g)U=g/(w-1),x=e.lerp(F,D,U,l),P[v++]=x.x,P[v++]=x.y,P[v++]=x.z;P[v++]=D.x,P[v++]=D.y,P[v++]=D.z}a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,b[G++]=D.x,b[G++]=D.y,b[G++]=D.z),O=t.PI_OVER_TWO-(C+1)*p}for(C=m;C>1;--C){if(O=t.PI_OVER_TWO-(C-1)*p,F=i(-O,s,M,y,d,N,A,I,S,F),D=i(O+Math.PI,s,M,y,d,N,A,I,S,D),r){for(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z,w=2*(C-1)+2,g=1;g<w-1;++g)U=g/(w-1),x=e.lerp(F,D,U,l),P[v++]=x.x,P[v++]=x.y,P[v++]=x.z;P[v++]=D.x,P[v++]=D.y,P[v++]=D.z}a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,b[G++]=D.x,b[G++]=D.y,b[G++]=D.z)}O=t.PI_OVER_TWO,F=i(-O,s,M,y,d,N,A,I,S,F);var V={};return r&&(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z,V.positions=P,V.numPts=m),a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,V.outerPositions=b),V},a}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,n,r,i,a,o,u,s,E,c,_,l,T){"use strict";function R(r){var i=r.center;A=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(i,A),r.height,A),A=t.add(i,A,A);for(var a=new e(A,r.semiMajorAxis),u=o.computeEllipsePositions(r,!1,!0).outerPositions,s=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(u,r,!1)})}),l=u.length/3,T=_.createTypedArray(l,2*l),R=0,h=0;h<l;++h)T[R++]=h,T[R++]=(h+1)%l;return{boundingSphere:a,attributes:s,indices:T}}function h(i){var a=i.center,u=i.ellipsoid,s=i.semiMajorAxis,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,d),i.height,d);N.center=t.add(a,T,N.center),N.radius=s,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,T),i.extrudedHeight,T),I.center=t.add(a,T,I.center),I.radius=s;var R=o.computeEllipsePositions(i,!1,!0).outerPositions,h=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(R,i,!0)})});R=h.position.values;var f=e.union(N,I),A=R.length/3,S=r(i.numberOfVerticalLines,16);S=l.clamp(S,0,A/2);var y=_.createTypedArray(A,2*A+2*S);A/=2;var M,m=0;for(M=0;M<A;++M)y[m++]=M,y[m++]=(M+1)%A,y[m++]=M+A,y[m++]=(M+1)%A+A;var p;if(S>0){var O=Math.min(S,A);p=Math.round(A/O);var C=Math.min(p*S,A);for(M=0;M<C;M+=p)y[m++]=M,y[m++]=M+A}return{boundingSphere:f,attributes:h,indices:y}}function f(e){e=r(e,r.EMPTY_OBJECT);var n=e.center,a=r(e.ellipsoid,u.WGS84),o=e.semiMajorAxis,s=e.semiMinorAxis,E=r(e.granularity,l.RADIANS_PER_DEGREE),c=r(e.height,0),_=e.extrudedHeight,T=i(_)&&Math.abs(c-_)>1;this._center=t.clone(n),this._semiMajorAxis=o,this._semiMinorAxis=s,this._ellipsoid=u.clone(a), +this._rotation=r(e.rotation,0),this._height=c,this._granularity=E,this._extrudedHeight=_,this._extrude=T,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var d=new t,A=new t,N=new e,I=new e;f.packedLength=t.packedLength+u.packedLength+9,f.pack=function(e,n,a){return a=r(a,0),t.pack(e._center,n,a),a+=t.packedLength,u.pack(e._ellipsoid,n,a),a+=u.packedLength,n[a++]=e._semiMajorAxis,n[a++]=e._semiMinorAxis,n[a++]=e._rotation,n[a++]=e._height,n[a++]=e._granularity,n[a++]=i(e._extrudedHeight)?1:0,n[a++]=r(e._extrudedHeight,0),n[a++]=e._extrude?1:0,n[a]=e._numberOfVerticalLines,n};var S=new t,y=new u,M={center:S,ellipsoid:y,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return f.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,S);n+=t.packedLength;var s=u.unpack(e,n,y);n+=u.packedLength;var E=e[n++],c=e[n++],_=e[n++],l=e[n++],T=e[n++],R=e[n++],h=e[n++],d=1===e[n++],A=e[n];return i(a)?(a._center=t.clone(o,a._center),a._ellipsoid=u.clone(s,a._ellipsoid),a._semiMajorAxis=E,a._semiMinorAxis=c,a._rotation=_,a._height=l,a._granularity=T,a._extrudedHeight=R?h:void 0,a._extrude=d,a._numberOfVerticalLines=A,a):(M.height=l,M.extrudedHeight=R?h:void 0,M.granularity=T,M.rotation=_,M.semiMajorAxis=E,M.semiMinorAxis=c,M.numberOfVerticalLines=A,new f(M))},f.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,n={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(n.extrudedHeight=Math.min(e._extrudedHeight,e._height),n.height=Math.max(e._extrudedHeight,e._height),t=h(n)):t=R(n),new s({attributes:t.attributes,indices:t.indices,primitiveType:T.LINES,boundingSphere:t.boundingSphere})}},f}),define("Core/CircleOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipseOutlineGeometry","./Ellipsoid"],function(e,t,n,r,i,a){"use strict";function o(e){e=n(e,n.EMPTY_OBJECT);var t=e.radius,r={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 i(r),this._workerName="createCircleOutlineGeometry"}o.packedLength=i.packedLength,o.pack=function(e,t,n){return i.pack(e._ellipseGeometry,t,n)};var u=new i({center:new e,semiMajorAxis:1,semiMinorAxis:1}),s={center:new e,radius:void 0,ellipsoid:a.clone(a.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};return o.unpack=function(t,n,E){var c=i.unpack(t,n,u);return s.center=e.clone(c._center,s.center),s.ellipsoid=a.clone(c._ellipsoid,s.ellipsoid),s.height=c._height,s.extrudedHeight=c._extrudedHeight,s.granularity=c._granularity,s.numberOfVerticalLines=c._numberOfVerticalLines,r(E)?(s.semiMajorAxis=c._semiMajorAxis,s.semiMinorAxis=c._semiMinorAxis,E._ellipseGeometry=new i(s),E):(s.radius=c._semiMajorAxis,new o(s))},o.createGeometry=function(e){return i.createGeometry(e._ellipseGeometry)},o}),define("Workers/createCircleOutlineGeometry",["../Core/Cartesian3","../Core/CircleOutlineGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,n,r){"use strict";function i(i,a){return n(a)&&(i=t.unpack(i,a)),i._ellipseGeometry._center=e.clone(i._ellipseGeometry._center),i._ellipseGeometry._ellipsoid=r.clone(i._ellipseGeometry._ellipsoid),t.createGeometry(i)}return i})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createCorridorGeometry.js b/engines/Cesium/Workers/createCorridorGeometry.js index cd71444..730ee1a 100644 --- a/engines/Cesium/Workers/createCorridorGeometry.js +++ b/engines/Cesium/Workers/createCorridorGeometry.js @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(r),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),n(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,d=n.z,h=a.x,E=a.y,m=a.z,p=l*l*h*h,_=f*f*E*E,y=d*d*m*m,T=p+_+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,S=u.y,g=u.z,N=o;N.x=A.x*v*2,N.y=A.y*S*2,N.z=A.z*g*2;var w,O,M,I,x,C,P,D,U,L,F,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(N)),b=0;do{B-=b,M=1/(1+B*v),I=1/(1+B*S),x=1/(1+B*g),C=M*M,P=I*I,D=x*x,U=C*M,L=P*I,F=D*x,w=p*C+_*P+y*D-1,O=p*U*v+_*L*S+y*F*g;var z=-2*O;b=w/z}while(Math.abs(w)>r.EPSILON12);return t(c)?(c.x=l*M,c.y=f*I,c.z=d*x,c):new e(l*M,f*I,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:d,p=n(r)?r._centerToleranceSquared:h,_=o(t,E,m,p,c);if(n(_)){var y=e.multiplyComponents(_,m,s);y=e.normalize(y,y);var T=e.subtract(t,_,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),v=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],d=m[a];if(Math.abs(e[s.getElementIndex(d,f)])>n){var h,p=e[s.getElementIndex(d,d)],_=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(d,f)],T=(p-_)/2/y;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=n-u-f+h,m=2*(a-d),p=2*(i+l),_=2*(a+d),y=-n+u-f+h,T=2*(c-o),R=2*(i-l),A=2*(c+o),v=-n-u+f+h;return r(t)?(t[0]=E,t[1]=_,t[2]=R,t[3]=m,t[4]=y,t[5]=A,t[6]=p,t[7]=T,t[8]=v,t):new s(E,m,p,_,y,T,R,A,v)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=n*u,E=i*a+c*o*u,m=-o*i+i*o*u,p=-o,_=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=f,t[4]=E,t[5]=_,t[6]=d,t[7]=m,t[8]=y,t):new s(l,f,d,h,E,m,p,_,y)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var d=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],p=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=n*c(h);o<a&&l(h)>E;)f(h,p),s.transpose(p,_),s.multiply(h,p,h),s.multiply(_,h,h),s.multiply(d,p,d),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/d;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){ -this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,d,h,E,m,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(d,0),this[15]=r(p,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,_=t.z*t.w,y=t.w*t.w,T=s-h-p+y,R=2*(c-_),A=2*(f+m),v=2*(c+_),S=-s+h-p+y,g=2*(E-d),N=2*(f-m),w=2*(E+d),O=-s-h+p+y;return r[0]=T*i,r[1]=v*i,r[2]=N*i,r[3]=0,r[4]=R*o,r[5]=S*o,r[6]=w*o,r[7]=0,r[8]=A*u,r[9]=g*u,r[10]=O*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,m=f.y,p=f.z,_=h.x,y=h.y,T=h.z,R=r.x,A=r.y,v=r.z,S=u*-R+s*-A+c*-v,g=_*-R+y*-A+T*-v,N=E*R+m*A+p*v;return a(n)?(n[0]=u,n[1]=_,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-p,n[11]=0,n[12]=S,n[13]=g,n[14]=N,n[15]=1,n):new l(u,s,c,S,_,y,T,g,-E,-m,-p,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),d=c,h=l,E=f,m=i+c,p=o+l,_=t+f,y=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=p,a[14]=_,a[15]=y,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],p=e[13],_=e[14],y=e[15],T=t[0],R=t[1],A=t[2],v=t[3],S=t[4],g=t[5],N=t[6],w=t[7],O=t[8],M=t[9],I=t[10],x=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=r*T+u*R+f*A+m*v,F=a*T+s*R+d*A+p*v,B=i*T+c*R+h*A+_*v,b=o*T+l*R+E*A+y*v,z=r*S+u*g+f*N+m*w,G=a*S+s*g+d*N+p*w,q=i*S+c*g+h*N+_*w,V=o*S+l*g+E*N+y*w,W=r*O+u*M+f*I+m*x,X=a*O+s*M+d*I+p*x,H=i*O+c*M+h*I+_*x,Y=o*O+l*M+E*I+y*x,k=r*C+u*P+f*D+m*U,Z=a*C+s*P+d*D+p*U,j=i*C+c*P+h*D+_*U,K=o*C+l*P+E*D+y*U;return n[0]=L,n[1]=F,n[2]=B,n[3]=b,n[4]=z,n[5]=G,n[6]=q,n[7]=V,n[8]=W,n[9]=X,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],p=t[1],_=t[2],y=t[4],T=t[5],R=t[6],A=t[8],v=t[9],S=t[10],g=t[12],N=t[13],w=t[14],O=r*m+o*p+c*_,M=a*m+u*p+l*_,I=i*m+s*p+f*_,x=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,D=r*A+o*v+c*S,U=a*A+u*v+l*S,L=i*A+s*v+f*S,F=r*g+o*N+c*w+d,B=a*g+u*N+l*w+h,b=i*g+s*N+f*w+E;return n[0]=O,n[1]=M,n[2]=I,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=b,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],p=t[4],_=t[5],y=t[6],T=t[7],R=t[8],A=r*d+o*h+c*E,v=a*d+u*h+l*E,S=i*d+s*h+f*E,g=r*m+o*p+c*_,N=a*m+u*p+l*_,w=i*m+s*p+f*_,O=r*y+o*T+c*R,M=a*y+u*T+l*R,I=i*y+s*T+f*R;return n[0]=A,n[1]=v,n[2]=S,n[3]=0,n[4]=g,n[5]=N,n[6]=w,n[7]=0,n[8]=O,n[9]=M,n[10]=I,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var p=new e;l.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var _=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,_),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],p=e[6],A=e[10],v=e[14],S=e[3],g=e[7],N=e[11],w=e[15],O=A*w,M=v*N,I=p*w,x=v*g,C=p*N,P=A*g,D=m*w,U=v*S,L=m*N,F=A*S,B=m*g,b=p*S,z=O*d+x*h+C*E-(M*d+I*h+P*E),G=M*f+D*h+F*E-(O*f+U*h+L*E),q=I*f+U*d+B*E-(x*f+D*d+b*E),V=P*f+L*d+b*h-(C*f+F*d+B*h),W=M*a+I*i+P*o-(O*a+x*i+C*o),X=O*r+U*i+L*o-(M*r+D*i+F*o),H=x*r+D*a+b*o-(I*r+U*a+B*o),Y=C*r+F*a+B*i-(P*r+L*a+b*i);O=i*E,M=o*h,I=a*E,x=o*d,C=a*h,P=i*d,D=r*E,U=o*f,L=r*h,F=i*f,B=r*d,b=a*f;var k=O*g+x*N+C*w-(M*g+I*N+P*w),Z=M*S+D*N+F*w-(O*S+U*N+L*w),j=I*S+U*g+B*w-(x*S+D*g+b*w),K=P*S+L*g+b*N-(C*S+F*g+B*N),Q=I*A+P*v+M*p-(C*v+O*p+x*A),J=L*v+O*m+U*A-(D*A+F*v+M*m),$=D*p+b*v+x*m-(B*v+I*m+U*p),ee=B*A+C*m+F*p-(L*p+b*A+P*m),te=r*z+a*G+i*q+o*V;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=z*te,n[1]=G*te,n[2]=q*te,n[3]=V*te,n[4]=W*te,n[5]=X*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-n*f-r*d-a*h,m=-i*f-o*d-u*h,p=-s*f-c*d-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return r(n)?(n.west=l,n.south=d,n.east=f,n.north=h,n):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,E=new e,m=new e,p=new e,_=new e,y=new e,T=new e,R=new e,A=new e,v=new e,S=new e,g=new e;d.fromPoints=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,h),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,p),c=e.clone(r,_),l=e.clone(r,y),f=t.length,N=1;N<f;N++){e.clone(t[N],r);var w=r.x,O=r.y,M=r.z;w<i.x&&e.clone(r,i),w>s.x&&e.clone(r,s),O<o.y&&e.clone(r,o),O>c.y&&e.clone(r,c),M<u.z&&e.clone(r,u),M>l.z&&e.clone(r,l)}var I=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,D=s,U=I;x>U&&(U=x,P=o,D=c),C>U&&(U=C,P=u,D=l);var L=A;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var F=e.magnitudeSquared(e.subtract(D,L,R)),B=Math.sqrt(F),b=v;b.x=i.x,b.y=o.y,b.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(b,z,R),.5,g),q=0;for(N=0;N<f;N++){e.clone(t[N],r);var V=e.magnitude(e.subtract(r,G,R));V>q&&(q=V);var W=e.magnitudeSquared(e.subtract(r,L,R));if(W>F){var X=Math.sqrt(W);B=.5*(B+X),F=B*B;var H=X-B;L.x=(B*L.x+H*r.x)/X,L.y=(B*L.y+H*r.y)/X,L.z=(B*L.z+H*r.z)/X}}return B<q?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var N=new o,w=new e,O=new e,M=new t,I=new t;d.fromRectangle2D=function(e,t,n){return d.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,N),f.southwest(t,M),M.height=i,f.northeast(t,I),I.height=o;var s=n.project(M,w),c=n.project(I,O),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),d.fromPoints(u,o)},d.fromVertices=function(t,n,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,p),N=e.clone(u,_),w=e.clone(u,y),O=t.length,M=0;M<O;M+=i){var I=t[M]+n.x,x=t[M+1]+n.y,C=t[M+2]+n.z;u.x=I,u.y=x,u.z=C,I<s.x&&e.clone(u,s),I>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>w.z&&e.clone(u,w)}var P=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(N,c,R)),U=e.magnitudeSquared(e.subtract(w,l,R)),L=s,F=f,B=P;D>B&&(B=D,L=c,F=N),U>B&&(B=U,L=l,F=w);var b=A;b.x=.5*(L.x+F.x),b.y=.5*(L.y+F.y),b.z=.5*(L.z+F.z);var z=e.magnitudeSquared(e.subtract(F,b,R)),G=Math.sqrt(z),q=v;q.x=s.x,q.y=c.y,q.z=l.z;var V=S;V.x=f.x,V.y=N.y,V.z=w.z;var W=e.multiplyByScalar(e.add(q,V,R),.5,g),X=0;for(M=0;M<O;M+=i){u.x=t[M]+n.x,u.y=t[M+1]+n.y,u.z=t[M+2]+n.z;var H=e.magnitude(e.subtract(u,W,R));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,b,R));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var Z=k-G;b.x=(G*b.x+Z*u.x)/k,b.y=(G*b.y+Z*u.y)/k,b.z=(G*b.z+Z*u.z)/k}}return G<X?(e.clone(b,o.center),o.radius=G):(e.clone(W,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new d),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,_),f=e.clone(i,y),N=t.length,w=0;w<N;w+=3){var O=t[w]+n[w],M=t[w+1]+n[w+1],I=t[w+2]+n[w+2];i.x=O,i.y=M,i.z=I,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),M<u.y&&e.clone(i,u),M>l.y&&e.clone(i,l),I<s.z&&e.clone(i,s),I>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),D=o,U=c,L=x;C>L&&(L=C,D=u,U=l),P>L&&(L=P,D=s,U=f);var F=A;F.x=.5*(D.x+U.x),F.y=.5*(D.y+U.y),F.z=.5*(D.z+U.z);var B=e.magnitudeSquared(e.subtract(U,F,R)),b=Math.sqrt(B),z=v;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(z,G,R),.5,g),V=0;for(w=0;w<N;w+=3){i.x=t[w]+n[w],i.y=t[w+1]+n[w+1],i.z=t[w+2]+n[w+2];var W=e.magnitude(e.subtract(i,q,R));W>V&&(V=W);var X=e.magnitudeSquared(e.subtract(i,F,R));if(X>B){var H=Math.sqrt(X);b=.5*(b+H),B=b*b;var Y=H-b;F.x=(b*F.x+Y*i.x)/H,F.y=(b*F.y+Y*i.y)/H,F.z=(b*F.z+Y*i.z)/H}}return b<V?(e.clone(F,r.center),r.radius=b):(e.clone(q,r.center),r.radius=V),r},d.fromCornerPoints=function(t,n,r){a(r)||(r=new d);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},d.fromEllipsoid=function(t,n){return a(n)||(n=new d),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;d.fromBoundingSpheres=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return d.clone(t[0],n);if(2===r)return d.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,U=new e;d.fromOrientedBoundingBox=function(t,n){a(n)||(n=new d);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,D),u=c.getColumn(r,2,U),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},d.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},d.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new d);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;d.union=function(t,n,r){a(r)||(r=new d);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(h,i,h),e.clone(h,r.center),r.radius=f,r};var B=new e;d.expand=function(t,n,r){r=d.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},d.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var b=new e;d.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,b);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var z=new e;d.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,z),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,W=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return d.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,W),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var p=E.length,_=0;_<p;++_){var y=E[_];e.add(o,y,y);var T=i.cartesianToCartographic(y,H);n.project(T,y)}a=d.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){return d.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=r(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,g=r(e[1]))}return S}function u(){return o()&&g}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(N=!0,w=r(e[1]),w.isNightly=!!e[2])}return N}function c(){return s()&&w; -}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,M=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,M=r(e[1])))}return O}function f(){return l()&&M}function d(){if(!t(I)){I=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(I=!0,x=r(e[1]))}return I}function h(){return d()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function p(){return E()&&P}function _(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,S,g,N,w,O,M,I,x,C,P,D,U,L,F,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:y,imageRenderingValue:T};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,d=f*f,h=1-d,E=Math.sqrt(h),m=t/4,p=m*m,_=p*m,y=p*p,T=1+m-3*p/4+5*_/4-175*y/64,R=1-m+15*p/8-35*_/8,A=1-3*m+35*p/4,v=1-5*m,S=T*l-R*Math.sin(2*l)*m/2-A*Math.sin(4*l)*p/16-v*Math.sin(6*l)*_/48-5*Math.sin(8*l)*y/512,g=e._constants;g.a=n,g.b=r,g.f=a,g.cosineHeading=i,g.sineHeading=o,g.tanU=u,g.cosineU=s,g.sineU=c,g.sigma=l,g.sineAlpha=f,g.sineSquaredAlpha=d,g.cosineSquaredAlpha=h,g.cosineAlpha=E,g.u2Over4=m,g.u4Over16=p,g.u6Over64=_,g.u8Over256=y,g.a0=T,g.a1=R,g.a2=A,g.a3=v,g.distanceRatio=S}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,d,h,E=(t-n)/t,m=i-r,p=Math.atan((1-E)*Math.tan(a)),_=Math.atan((1-E)*Math.tan(o)),y=Math.cos(p),T=Math.sin(p),R=Math.cos(_),A=Math.sin(_),v=y*R,S=y*A,g=T*A,N=T*R,w=m,O=u.TWO_PI,M=Math.cos(w),I=Math.sin(w);do{M=Math.cos(w),I=Math.sin(w);var x=S-N*M;f=Math.sqrt(R*R*I*I+x*x),c=g+v*M,s=Math.atan2(f,c);var C;0===f?(C=0,d=1):(C=v*I/f,d=1-C*C),O=w,h=c-2*g/d,isNaN(h)&&(h=0),w=m+l(E,C,d,s,f,c,h)}while(Math.abs(w-O)>u.EPSILON12);var P=d*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,U=P*(256+P*(P*(74-47*P)-128))/1024,L=h*h,F=U*f*(h+U*(c*(2*L-1)-U*h*(4*f*f-3)*(4*L-3)/6)/4),B=n*D*(s-F),b=Math.atan2(R*I,S-N*M),z=Math.atan2(y*I,S*M-N);e._distance=B,e._startHeading=b,e._endHeading=z,e._uSquared=P}function d(n,r,a,i){e.normalize(i.cartographicToCartesian(r,m),E),e.normalize(i.cartographicToCartesian(a,m),m);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function h(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&d(this,e,a,u)}var E=new e,m=new e;return a(h.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}}}),h.prototype.setEndPoints=function(e,t){d(this,e,t,this._ellipsoid)},h.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},h.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),d=Math.sin(6*i),h=Math.sin(8*i),E=i*i,m=i*E,p=a.u8Over256,_=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*m*p*o/3+i*(1-_+7*T/4-15*y/4+579*p/64-(T-15*y/4+187*p/16)*o-(5*y/4-115*p/16)*u-29*p*s/16)+(_/2-T+71*y/32-85*p/16)*c+(5*T/16-5*y/4+383*p/96)*f-E*((y-11*p/2)*c+5*p*f/2)+(29*y/96-29*p/16)*d+539*p*h/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),v=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var S=Math.cos(2*a.sigma+R),g=Math.sin(R),N=Math.cos(R),w=a.cosineU*N,O=a.sineU*g,M=Math.atan2(g*a.sineHeading,w-O*a.cosineHeading),I=M-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,g,N,S);return r(n)?(n.longitude=this._start.longitude+I,n.latitude=v,n.height=0,n):new t(this._start.longitude+I,v,0)},h}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[d/e,a/d]:[a/d,d/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,p=u*c-h,_=4*E*p-m*m;if(_<0){var y,T,R;d*f>=l*h?(y=o,T=E,R=-2*u*E+o*m):(y=c,T=p,R=-c*m+2*s*p);var A=R<0?-1:1,v=-A*Math.abs(y)*Math.sqrt(-_);i=-R+v;var S=i/2,g=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),N=i===v?-g:-T/g;return a=T<=0?g+N:-R/(g*g+N*N+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var w=E,O=-2*u*E+o*m,M=p,I=-c*m+2*s*p,x=Math.sqrt(_),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-w);var D=Math.cos(P);i=a*D;var U=a*(-D/2-C*Math.sin(P)),L=i+U>2*u?i-u:U-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*x,-I)/3),a=2*Math.sqrt(-M),D=Math.cos(P),i=a*D,U=a*(-D/2-C*Math.sin(P));var b=-c,z=i+U<2*s?i+s:U+s,G=b/z,q=F*z,V=-L*z-F*b,W=L*b,X=(s*V-u*W)/(-u*V+s*q);return B<=X?B<=G?X<=G?[B,X,G]:[B,G,X]:[G,B,X]:B<=G?[X,B,G]:X<=G?[X,G,B]:[G,X,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],_=E[1];if(p>=0&&_>=0){var y=Math.sqrt(p),T=Math.sqrt(_);return[d-T,d-y,d+y,d+T]}if(p>=0&&_<0)return m=Math.sqrt(p),[d-m,d+m];if(p<0&&_>=0)return m=Math.sqrt(_),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,S=r.computeRealRoots(1,R,A),g=r.computeRealRoots(1,-R,v);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==g.length?(g[0]+=d,g[1]+=d,S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>g[0]&&S[0]<g[1]?[g[0],S[0],g[1],S[1]]:[S[0],g[0],S[1],g[1]]):S):0!==g.length?(g[0]+=d,g[1]+=d,g):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,p=h[0],_=a-p,y=_*_,T=t/2,R=_/2,A=y-4*o,v=y+4*Math.abs(o),S=c-4*p,g=c+4*Math.abs(p);if(p<0||A*g<S*v){var N=Math.sqrt(S);E=N/2,m=0===N?0:(t*R-i)/N}else{var w=Math.sqrt(A);E=0===w?0:(t*R-i)/w,m=w/2}var O,M;0===T&&0===E?(O=0,M=0):n.sign(T)===n.sign(E)?(O=T+E,M=p/O):(M=T-E,O=p/M);var I,x;0===R&&0===m?(I=0,x=0):n.sign(R)===n.sign(m)?(I=R+m,x=o/I):(x=R-m,I=o/x);var C=r.computeRealRoots(1,O,I),P=r.computeRealRoots(1,M,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,d=f*r,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*n*d-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function d(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(d,h,E,v);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),p=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*n.x+r,_=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===_){if(l=s.computeRealRoots(E,m,p),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var v=l[1],S=Math.sqrt(Math.max(1-v*v,0));T.push(new e(a,i*v,i*-S)),T.push(new e(a,i*v,i*S))}return T}var g=y*y,N=_*_,w=E*E,O=y*_,M=w+N,I=2*(m*E+O),x=2*p*E+m*m-N+g,C=2*(p*m-O),P=p*p-g;if(0===M&&0===I&&0===x&&0===C)return T;l=c.computeRealRoots(M,I,x,C,P);var D=l.length;if(0===D)return T;for(var U=0;U<D;++U){var L,F=l[U],B=F*F,b=Math.max(1-B,0),z=Math.sqrt(b);L=o.sign(E)===o.sign(p)?h(E*B+p,m*F,o.EPSILON12):o.sign(p)===o.sign(m*F)?h(E*B,m*F+p,o.EPSILON12):h(E*B+m*F,p,o.EPSILON12);var G=h(_*F,y,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*z)):q>0?T.push(new e(a,i*F,i*-z)):0!==z?(T.push(new e(a,i*F,i*-z)),T.push(new e(a,i*F,i*z)),++U):T.push(new e(a,i*F,i*z))}return T}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,_=new e,y=new e,T=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,m=e.subtract(a,r,p),A=e.subtract(i,r,_),v=e.cross(E,A,y),S=e.dot(m,v);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,r,T),l=e.dot(s,v),l<0||l>S)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(A,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var g=1/S;if(s=e.subtract(h,r,T),l=e.dot(s,v)*g,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*g,f<0||l+f>1)return;d=e.dot(A,c)*g}return d},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=d(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new l;m.lineSegmentSphere=function(t,n,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var g=new e,N=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,g),f=e.multiplyComponents(c,t.direction,N),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(r=d-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,p=r/s;return m<p?new i(m,p):{start:p,stop:m}}var _=Math.sqrt(r/a);return new i(_,_)}return d<1?(r=d-1,a=e.magnitudeSquared(f),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var w=new e,O=new e,M=new e,I=new e,x=new e,C=new u,P=new u,D=new u,U=new u,L=new u,F=new u,B=new u,b=new e,z=new e,G=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,w);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,w),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,I),h=e.normalize(e.cross(d,f,O),O),m=e.normalize(e.cross(f,h,M),M),p=C;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=h.x,p[4]=h.y,p[5]=h.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var _=u.transpose(p,P),y=u.fromScale(n.radii,D),T=u.fromScale(n.oneOverRadii,U),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,v,S=u.multiply(u.multiply(_,T,F),R,F),g=u.multiply(u.multiply(S,y,B),p,B),N=u.multiplyByVector(S,a,x),q=E(g,e.negate(N,w),0,0,1),V=q.length;if(V>0){for(var W=e.clone(e.ZERO,z),X=Number.NEGATIVE_INFINITY,H=0;H<V;++H){A=u.multiplyByVector(y,u.multiplyByVector(p,q[H],b),b);var Y=e.normalize(e.subtract(A,a,I),I),k=e.dot(Y,i);k>X&&(X=k,W=e.clone(A,W))}var Z=n.cartesianToCartographic(W,G);return X=o.clamp(X,0,1),v=e.magnitude(e.subtract(W,a,I))*Math.sqrt(1-X*X),v=c?-v:v,Z.height=v,n.cartographicToCartesian(Z,new e); -}};var q=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,d),{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,d),{positions:[t,n,r,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(e,t,n){var r=g;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function h(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,M),l=a.scaleToGeodeticSurface(n,I),f=E.numberOfPoints(t,n,r),h=a.cartesianToCartographic(c,N),m=a.cartesianToCartographic(l,w),p=d(f,i,o);x.setEndPoints(h,m);var _=x.surfaceDistance/f,y=s;h.height=i;var T=a.cartographicToCartesian(h,O);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=x.interpolateUsingSurfaceDistance(R*_,w);A.height=p[R],T=a.cartographicToCartesian(A,O),e.pack(T,u,y),y+=3}return y}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var m=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,m).height}return r};var p=new l,_=new e,y=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),v=new e,S=new e,g=[],N=new t,w=new t,O=new e,M=new e,I=new e,x=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,p),c=l.multiplyByPoint(s,e.ZERO,_),d=l.multiplyByPointAsVector(s,e.UNIT_Y,y),h=f.fromPointNormal(c,d,T),E=l.multiplyByPointAsVector(s,e.UNIT_X,R),m=f.fromPointNormal(c,E,A),g=1;i.push(e.clone(t[0]));for(var N=i[0],w=t.length,O=1;O<w;++O){var M=t[O];if(f.getPointDistance(m,N)<0||f.getPointDistance(m,M)<0){var I=u.lineSegmentPlane(N,M,h,v);if(r(I)){var x=e.multiplyByScalar(d,5e-9,S);f.getPointDistance(h,N)<0&&e.negate(x,x),i.push(e.add(I,x,new e)),o.push(g+1),e.negate(x,x),i.push(e.add(I,x,new e)),g=1}}i.push(e.clone(t[O])),g++,N=M}o.push(g)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var d=u.scaleToGeodeticSurface(a[0],M);if(l=f?l[0]:l,0!==l){var m=u.geodeticSurfaceNormal(d,O);e.multiplyByScalar(m,l,m),e.add(d,m,d)}return[d.x,d.y,d.z]}var p=t.minDistance;if(!r(p)){var _=n(t.granularity,c.RADIANS_PER_DEGREE);p=c.chordLength(_,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=E.numberOfPoints(a[y],a[y+1],p);var R=3*(T+1),A=new Array(R),v=0;for(y=0;y<o-1;y++){var S=a[y],w=a[y+1],I=f?l[y]:l,x=f?l[y+1]:l;v=h(S,w,p,u,I,x,A,v)}g.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,N);P.height=f?l[o-1]:l;var D=u.cartographicToCartesian(P,O);return e.pack(D,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,d=1;d<f;d++){var h=t[d],E=h.x,m=h.y,p=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(p,u),l=Math.max(p,l)}var _=r.minimum;_.x=a,_.y=o,_.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(_,y,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],d=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=_,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,p,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,d=[],h=o(),c)for(p=h.progress,m=function(e){d.push(e),--l||(E=m=_,h.reject(d))},E=function(e){f.push(e),--c||(E=m=_,h.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,p);else h.resolve(f);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return p(1,arguments),d(e,y).then(t,n,r)}function f(){return d(arguments,y)}function d(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function p(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function _(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,d){var h,E,m,p,_;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,v=" ",S=s.length,g=0;s&&g<S;g++)switch(s.charAt(g)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":v=s.charAt(g+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,_=r?t[r.slice(0,-1)]:t[n++],d){case"s":return u(String(_),y,c,f,R,v);case"c":return u(String.fromCharCode(+_),y,c,f,R);case"b":return o(_,2,A,y,c,f,R);case"o":return o(_,8,A,y,c,f,R);case"x":return o(_,16,A,y,c,f,R);case"X":return o(_,16,A,y,c,f,R).toUpperCase();case"u":return o(_,10,A,y,c,f,R);case"i":case"d":return h=+_||0,h=Math.round(h-h%1),E=h<0?"-":T,_=E+a(String(Math.abs(h)),f,"0",!1),i(_,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+_,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],_=E+Math.abs(h)[m](f),i(_,E,y,c,R)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function d(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&f(this)}var p=new i,_=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,v=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,g=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,w=/^(\d{2})(\.\d+)?/.source+N.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,d=0,p=0,T=0,N=0,I=u[0],x=u[1];if(u=I.match(g),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=I.match(A),null!==u)n=+u[1],s=+u[2];else if(u=I.match(R),null!==u)n=+u[1];else{var C;if(u=I.match(v),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=I.match(S),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,U=new Date(Date.UTC(n,0,4));C=7*P+D-U.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(x)){u=x.match(M),null!==u?(d=+u[1],p=+u[2],T=+u[3],N=1e3*+(u[4]||0),L=5):(u=x.match(O),null!==u?(d=+u[1],p=+u[2],T=60*+(u[3]||0),L=4):(u=x.match(w),null!==u&&(d=+u[1],p=60*+(u[2]||0),L=3)));var F=u[L],B=+u[L+1],b=+(u[L+2]||0);switch(F){case"+":d-=B,p-=b;break;case"-":d+=B,p+=b;break;case"Z":break;default:p+=new Date(Date.UTC(n,s-1,l,d,p)).getTimezoneOffset()}}else p+=new Date(n,s-1,l).getTimezoneOffset();var z=60===T;for(z&&T--;p>=60;)p-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?y:_[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:_[s-1];for(;p<0;)p+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:_[s-1],l+=a;var G=E(n,s,l,d,p,T,N);return r(t)?(h(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),z&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var I=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=d(e,I);r(a)||(m.addSeconds(e,-1,I),a=d(I,I),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var p=h+2-12*c|0,_=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,v=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=_,t.month=p,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=v,t.isLeapSecond=n,t):new i(_,p,E,y,R,A,v,n)},m.toDate=function(e){var t=m.toGregorianDate(e,p),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(d)&&n(E.overrideMimeType)&&E.overrideMimeType(d),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds"); -if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=n.samples,_=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=p.length;R<A;R+=e._columnCount){var v=p[R+a],S=p[R+m],g=v+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(_.push(N),T){if(S!==y&&r(y)){var w=o.leapSeconds,O=t(w,N,h);if(O<0){var M=new u(N,S);w.splice(~O,0,M)}}y=S}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,n){return t+e*(n-t)}function _(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=n[d+e._ut1MinusUtcSecondsColumn],_=n[h+e._ut1MinusUtcSecondsColumn],y=_-E;if(y>.5||y<-.5){var T=n[d+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=_:_-=R-T)}return u.xPoleWander=p(f,n[d+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,n[d+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,_),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!r(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,_(this,i,this._samples,e,s,l,n),n}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,_(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},d}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=d(e);return h.href=n,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),r(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,p=i-s*this._stepSizeDays,_=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)_[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=_[m]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*h[A++],n.y+=T[E]*h[A++],n.s+=T[E]*h[A]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,d=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=d,a):new l(u,s,c,d)};var d=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+f+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var p=d,_=0;f>s&&(_=1),E>s&&E>f&&(_=2);var y=p[_],T=p[y];n=Math.sqrt(e[c.getElementIndex(_,_)]-e[c.getElementIndex(y,y)]-e[c.getElementIndex(T,T)]+1);var R=h;R[_]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,y)]-e[c.getElementIndex(y,T)])*n,R[y]=(e[c.getElementIndex(y,_)]+e[c.getElementIndex(_,y)])*n,R[T]=(e[c.getElementIndex(T,_)]+e[c.getElementIndex(_,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,p=new l,_=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),_=l.fromAxisAngle(e.UNIT_X,o.roll,E),p=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(p,_,p),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var y=new e,T=new e,R=new l,A=new l,v=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,v),l.conjugate(v,v);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,v,R),R.w<0&&l.negate(R,R),l.computeAxis(R,y);var u=l.computeAngle(R);r[o]=y.x*u,r[o+1]=y.y*u,r[o+2]=y.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,d=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=d,n.z=h,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var S=new l;l.lerp=function(e,t,n,r){return S=l.multiplyByScalar(t,n,S),r=l.multiplyByScalar(e,1-n,r),l.add(S,r,r)};var g=new l,N=new l,w=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=g=l.negate(t,g)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return N=l.multiplyByScalar(e,Math.sin((1-n)*o),N),w=l.multiplyByScalar(i,Math.sin(n*o),w),r=l.add(N,w,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var O=new e,M=new e,I=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,I);l.multiply(i,r,x);var o=l.log(x,O);l.multiply(i,t,x);var u=l.log(x,M);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,I),l.multiply(n,I,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,I),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var b=B+1,z=2*b+1;D[B]=1/(b*z),U[B]=b/z}return D[7]=P/136,U[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)L[f]=(D[f]*s-U[f])*o,F[f]=(D[f]*c-U[f])*o;var d=a*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),h=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,h,C);return l.multiplyByScalar(t,d,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,I),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,p,_,y,T,R){"use strict";var A={},v={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},S={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},g={},N={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},w=new n,O=new n,M=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!v.hasOwnProperty(e)||!v[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=v[e][t],i=e+t;return u(g[i])?r=g[i]:(r=function(r,i,s){if(u(s)||(s=new y),p.equalsEpsilon(r.x,0,p.EPSILON14)&&p.equalsEpsilon(r.y,0,p.EPSILON14)){var c=p.sign(r.z);n.unpack(S[e],0,w),"east"!==e&&"west"!==e&&n.multiplyByScalar(w,c,w),n.unpack(S[t],0,O),"east"!==t&&"west"!==t&&n.multiplyByScalar(O,c,O),n.unpack(S[a],0,M),"east"!==a&&"west"!==a&&n.multiplyByScalar(M,c,M)}else{i=o(i,d.WGS84),i.geodeticSurfaceNormal(r,N.up);var l=N.up,f=N.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,N.east),n.cross(l,f,N.north),n.multiplyByScalar(N.up,-1,N.down),n.multiplyByScalar(N.east,-1,N.west),n.multiplyByScalar(N.north,-1,N.south),w=N[e],O=N[t],M=N[a]}return s[0]=w.x,s[1]=w.y,s[2]=w.z,s[3]=0,s[4]=O.x,s[5]=O.y,s[6]=O.z,s[7]=0,s[8]=M.x,s[9]=M.y,s[10]=M.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},g[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var I=new T,x=new n(1,1,1),C=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof y&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,I),c=y.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),y.multiply(i,c,i)};var P=new y,D=new _;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=y.getRotation(i,D);return T.fromRotationMatrix(o,a)};var U=24110.54841,L=8640184.812866,F=.093104,B=-62e-7,b=1.1772758384668e-19,z=72921158553e-15,G=p.TWO_PI/86400,q=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=U+n*(L+n*(F+n*B)),s=o*G%p.TWO_PI,c=z+b*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new _(d,h,0,-h,d,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=l.NONE;var V=32.184,W=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+V,a=t.stop.dayNumber,i=t.stop.secondsOfDay+V,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new _);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return _.transpose(n,t)};var X=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new _,k=new _;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new _);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+V,i=A.iau2006XysData.computeXysRadians(r,a,X);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=_.fromRotationZ(-i.s,k),d=_.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=h-2451545,T=E/R.SECONDS_PER_DAY,v=.779057273264+T+.00273781191135448*(y+T);v=v%1*p.TWO_PI;var S=_.fromRotationZ(v,k),g=_.multiply(d,S,Y),N=Math.cos(n.xPoleWander),w=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander),I=r-W+a/R.SECONDS_PER_DAY;I/=36525;var x=-47e-6*I*p.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=k;return D[0]=N*C,D[1]=N*P,D[2]=O,D[3]=-w*P+M*O*C,D[4]=w*C+M*O*P,D[5]=-M*N,D[6]=-M*P-w*O*C,D[7]=M*C-w*O*P,D[8]=w*N,_.multiply(g,D,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,Q=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,d.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,p.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,Q);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new _),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new y,ue=new y;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=y.getColumn(t,3,te),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,oe),c=y.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=y.getColumn(t,0,ee),h=n.magnitude(d),E=y.multiplyByVector(c,d,re);r.fromElements(E.z,E.x,E.y,0,E);var m=y.getColumn(t,1,ee),p=n.magnitude(m),_=y.multiplyByVector(c,m,ae);r.fromElements(_.z,_.x,_.y,0,_);var T=y.getColumn(t,2,ee),R=n.magnitude(T),v=ie;return n.cross(E,_,v),n.normalize(v,v),n.cross(_,v,E),n.normalize(E,E),n.cross(v,E,_),n.normalize(_,_),n.multiplyByScalar(E,h,E),n.multiplyByScalar(_,p,_),n.multiplyByScalar(v,R,v),y.setColumn(a,0,E,a),y.setColumn(a,1,_,a),y.setColumn(a,2,v,a),y.setColumn(a,3,f,a),a};var se=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,oe),i=y.inverseTransformation(a,ue),o=r.cartesianToCartographic(t,J),u=e.project(o,$),s=ne;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=y.fromTranslation(s,oe);return y.multiply(se,i,n),y.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var p=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new E(r.center,n)};var _=new d,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=_;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=_;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var d=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},E}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];D=t.cartesianToCartographic(a,D),n[r]=D.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function h(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,d=f/c;for(i=1;i<c;i++){var h=n+i*d;l[i]=h}return l[0]=n,l.push(r),l}function E(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function m(e,n,r,a,i,o,c,l){var d=z,h=G;L=f.eastNorthUpToFixedFrame(e,i,L),d=s.multiplyByPointAsVector(L,U,d),d=t.normalize(d,d);var m=E(d,n,e,i);B=u.fromRotationZ(m,B),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(B,q,F),L);var p=b;p[0]=c;for(var _=0;_<l;_++)for(var y=0;y<r.length;y+=3)h=t.fromArray(r,y,h),h=u.multiplyByVector(p,h,h),h=s.multiplyByPoint(L,h,h),a.push(h.x,h.y,h.z);return a}function p(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,V);a=m(c,n,r,a,i,o[s/3],u,1)}return a}function _(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function y(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,d,h,E){var p,_=t.angleBetween(t.subtract(n,e,x),t.subtract(r,e,C)),y=i===a.BEVELED?0:Math.ceil(_/o.toRadians(5));p=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,x),_/(y+1),W),H):u.fromQuaternion(l.fromAxisAngle(e,_/(y+1),W),H);var T,R;if(n=t.clone(n,X),y>0)for(var A=E?2:1,v=0;v<y;v++)n=u.multiplyByVector(p,n,n),T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=m(R,T,d,f,c,h,1,A);else T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=m(R,T,d,f,c,h,1,1),r=t.clone(r,X),T=t.subtract(r,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,C),f=m(R,T,d,f,c,h,1,1);return f}var R=[new t,new t],A=new t,v=new t,S=new t,g=new t,N=new t,w=new t,O=new t,M=new t,I=new t,x=new t,C=new t,P={},D=new r,U=new t(-1,0,0),L=new s,F=new s,B=new u,b=u.IDENTITY.clone(),z=new t,G=new n,q=new t,V=new t,W=new l,X=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=d(e,s),f=i._granularity,E=i._cornerType,C=u?_(n,r):y(n,r),D=u?y(n,r):void 0,U=r.height/2,L=r.width/2,F=e.length,B=[],b=u?[]:void 0,z=A,G=v,q=S,V=g,W=N,X=w,H=O,Y=M,k=I,K=e[0],Q=e[1];V=s.geodeticSurfaceNormal(K,V),z=t.subtract(Q,K,z),z=t.normalize(z,z),Y=t.cross(V,z,Y),Y=t.normalize(Y,Y);var J=l[0],$=l[1];u&&(b=m(K,Y,D,b,s,J+U,1,1)),k=t.clone(K,k),K=Q,G=t.negate(z,G);for(var ee,te,ne=1;ne<F-1;ne++){var re=u?2:1;Q=e[ne+1],z=t.subtract(Q,K,z),z=t.normalize(z,z),q=t.add(z,G,q),q=t.normalize(q,q),V=s.geodeticSurfaceNormal(K,V);var ae=t.multiplyByScalar(V,t.dot(z,V),Z);t.subtract(z,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(V,t.dot(G,V),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,V,q),q=t.cross(V,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,x))),se=P.angleIsGreaterThanPi(z,G,K,s);se?(W=t.add(K,t.multiplyByScalar(q,ue*L,q),W),X=t.add(W,t.multiplyByScalar(Y,L,X),X),R[0]=t.clone(k,R[0]),R[1]=t.clone(X,R[1]),ee=h(R,J+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=p(te,Y,C,B,s,ee,1),Y=t.cross(V,z,Y),Y=t.normalize(Y,Y),H=t.add(W,t.multiplyByScalar(Y,L,H),H),E===a.ROUNDED||E===a.BEVELED?T(W,X,H,E,se,s,B,C,$+U,u):(q=t.negate(q,q),B=m(K,q,C,B,s,$+U,ue,re)),k=t.clone(H,k)):(W=t.add(K,t.multiplyByScalar(q,ue*L,q),W),X=t.add(W,t.multiplyByScalar(Y,-L,X),X),R[0]=t.clone(k,R[0]),R[1]=t.clone(X,R[1]),ee=h(R,J+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=p(te,Y,C,B,s,ee,1),Y=t.cross(V,z,Y),Y=t.normalize(Y,Y),H=t.add(W,t.multiplyByScalar(Y,-L,H),H),E===a.ROUNDED||E===a.BEVELED?T(W,X,H,E,se,s,B,C,$+U,u):B=m(K,q,C,B,s,$+U,ue,re),k=t.clone(H,k)),G=t.negate(z,G)}else B=m(k,Y,C,B,s,J+U,1,1),k=K;J=$,$=l[ne+1],K=Q}R[0]=t.clone(k,R[0]),R[1]=t.clone(K,R[1]),ee=h(R,J+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=p(te,Y,C,B,s,ee,1),u&&(b=m(K,Y,D,b,s,$+U,1,1)),F=B.length;var ce=u?F+b.length:F,le=new Float64Array(ce);return le.set(B),u&&le.set(b,F),le},P}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,n,r,a,i,o,u){"use strict";function s(n,i,o,s,c){var l=e.angleBetween(e.subtract(i,n,E),e.subtract(o,n,m)),f=s===t.BEVELED?1:Math.ceil(l/r.toRadians(5))+1,d=3*f,h=new Array(d);h[d-3]=o.x,h[d-2]=o.y,h[d-1]=o.z;var p;p=c?a.fromQuaternion(u.fromAxisAngle(e.negate(n,E),l/f,I),x):a.fromQuaternion(u.fromAxisAngle(n,l/f,I),x);var _=0;i=e.clone(i,E);for(var y=0;y<f;y++)i=a.multiplyByVector(p,i,i),h[_++]=i.x,h[_++]=i.y,h[_++]=i.z;return h}function c(n){var r=T,a=R,i=A,o=n[1];a=e.fromArray(n[1],o.length-3,a),i=e.fromArray(n[0],0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var u=s(r,a,i,t.ROUNDED,!1),c=n.length-1,l=n[c-1];o=n[c],a=e.fromArray(l,l.length-3,a),i=e.fromArray(o,0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var f=s(r,a,i,t.ROUNDED,!1);return[u,f]}function l(t,n,r,a){var i=E;return a?i=e.add(t,n,i):(n=e.negate(n,n),i=e.add(t,n,i)),[i.x,i.y,i.z,r.x,r.y,r.z]}function f(t,n,r,a){for(var i=new Array(t.length),o=new Array(t.length),u=e.multiplyByScalar(n,r,E),s=e.negate(u,m),c=0,l=t.length-1,f=0;f<t.length;f+=3){var d=e.fromArray(t,f,p),h=e.add(d,s,_);i[c++]=h.x,i[c++]=h.y,i[c++]=h.z;var y=e.add(d,u,_);o[l--]=y.z,o[l--]=y.y,o[l--]=y.x}return a.push(i,o),a}function d(e,t){for(var n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}var h={},E=new e,m=new e,p=new e,_=new e,y=[new e,new e],T=new e,R=new e,A=new e,v=new e,S=new e,g=new e,N=new e,w=new e,O=new e,M=new e,I=new u,x=new a; -h.addAttribute=function(e,t,r,a){var i=t.x,o=t.y,u=t.z;n(r)&&(e[r]=i,e[r+1]=o,e[r+2]=u),n(a)&&(e[a]=u,e[a-1]=o,e[a-2]=i)};var C=new e,P=new e;return h.computePositions=function(n){var a=n.granularity,u=n.positions,h=n.ellipsoid;u=d(u,h);var m=n.width/2,p=n.cornerType,_=n.saveAttributes,I=T,x=R,D=A,U=v,L=S,F=g,B=N,b=w,z=O,G=M,q=[],V=_?[]:void 0,W=_?[]:void 0,X=u[0],H=u[1];x=e.normalize(e.subtract(H,X,x),x),I=h.geodeticSurfaceNormal(X,I),U=e.normalize(e.cross(I,x,U),U),_&&(V.push(U.x,U.y,U.z),W.push(I.x,I.y,I.z)),B=e.clone(X,B),X=H,D=e.negate(x,D);var Y,k,Z=[],j=u.length;for(k=1;k<j-1;k++){I=h.geodeticSurfaceNormal(X,I),H=u[k+1],x=e.normalize(e.subtract(H,X,x),x),L=e.normalize(e.add(x,D,L),L);var K=e.multiplyByScalar(I,e.dot(x,I),C);e.subtract(x,K,K),e.normalize(K,K);var Q=e.multiplyByScalar(I,e.dot(D,I),P);e.subtract(D,Q,Q),e.normalize(Q,Q);var J=!r.equalsEpsilon(Math.abs(e.dot(K,Q)),1,r.EPSILON7);if(J){L=e.cross(L,I,L),L=e.cross(I,L,L),L=e.normalize(L,L);var $=m/Math.max(.25,e.magnitude(e.cross(L,D,E))),ee=o.angleIsGreaterThanPi(x,D,X,h);L=e.multiplyByScalar(L,$,L),ee?(b=e.add(X,L,b),G=e.add(b,e.multiplyByScalar(U,m,G),G),z=e.add(b,e.multiplyByScalar(U,2*m,z),z),y[0]=e.clone(B,y[0]),y[1]=e.clone(G,y[1]),Y=i.generateArc({positions:y,granularity:a,ellipsoid:h}),q=f(Y,U,m,q),_&&(V.push(U.x,U.y,U.z),W.push(I.x,I.y,I.z)),F=e.clone(z,F),U=e.normalize(e.cross(I,x,U),U),z=e.add(b,e.multiplyByScalar(U,2*m,z),z),B=e.add(b,e.multiplyByScalar(U,m,B),B),p===t.ROUNDED||p===t.BEVELED?Z.push({leftPositions:s(b,F,z,p,ee)}):Z.push({leftPositions:l(X,e.negate(L,L),z,ee)})):(z=e.add(X,L,z),G=e.add(z,e.negate(e.multiplyByScalar(U,m,G),G),G),b=e.add(z,e.negate(e.multiplyByScalar(U,2*m,b),b),b),y[0]=e.clone(B,y[0]),y[1]=e.clone(G,y[1]),Y=i.generateArc({positions:y,granularity:a,ellipsoid:h}),q=f(Y,U,m,q),_&&(V.push(U.x,U.y,U.z),W.push(I.x,I.y,I.z)),F=e.clone(b,F),U=e.normalize(e.cross(I,x,U),U),b=e.add(z,e.negate(e.multiplyByScalar(U,2*m,b),b),b),B=e.add(z,e.negate(e.multiplyByScalar(U,m,B),B),B),p===t.ROUNDED||p===t.BEVELED?Z.push({rightPositions:s(z,F,b,p,ee)}):Z.push({rightPositions:l(X,L,b,ee)})),D=e.negate(x,D)}X=H}I=h.geodeticSurfaceNormal(X,I),y[0]=e.clone(B,y[0]),y[1]=e.clone(X,y[1]),Y=i.generateArc({positions:y,granularity:a,ellipsoid:h}),q=f(Y,U,m,q),_&&(V.push(U.x,U.y,U.z),W.push(I.x,I.y,I.z));var te;return p===t.ROUNDED&&(te=c(q)),{positions:q,corners:Z,lefts:V,normals:W,endPositions:te}},h}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,d,h,E,m,p;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=d=e[0],f=h=e[1];for(var _=a;_<o;_+=a)E=e[_],m=e[_+1],E<l&&(l=E),m<f&&(f=m),E>d&&(d=E),m>h&&(h=m);p=Math.max(d-l,h-f)}return r(u,c,a,l,f,p),c}function t(e,t,n,r,a){var i,o;if(a===M(e,t,n,r)>0)for(i=t;i<n;i+=r)o=N(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=N(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(w(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(w(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,h){if(e){!h&&f&&d(e,c,l,f);for(var E,m,p=e;e.prev!==e.next;)if(E=e.prev,m=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(m.i/s),w(e),e=m.next,p=m.next;else if(e=m,e===p){h?1===h?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===h&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(p(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),d=E(c,l,t,n,r),h=e.nextZ;h&&h.z<=d;){if(h!==e.prev&&h!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&y(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(h=e.prevZ;h&&h.z>=f;){if(h!==e.prev&&h!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&y(h.prev,h,h.next)>=0)return!1;h=h.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&v(a,i)&&v(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),w(r),w(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&_(s,c)){var l=g(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,d,h=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,d=t(e,s,f,i,!1),d===d.next&&(d.steiner=!0),h.push(m(d));for(h.sort(c),o=0;o<h.length;o++)l(h[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=g(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,d=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&p(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<d||s===d&&r.x>n.x)&&v(r,e)&&(n=r,d=s)),r=r.next;return n}function d(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,h(a)}function h(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function p(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&v(e,t)&&v(t,e)&&S(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function v(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function S(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function g(e,t){var n=new O(e.i,e.x,e.y),r=new O(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function N(e,t,n,r){var a=new O(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function w(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,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(M(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(M(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var d=r[u]*n,h=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[d]-e[E])*(e[h+1]-e[d+1])-(e[d]-e[h])*(e[E+1]-e[d+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,d){"use strict";var h=new n,E=new n,m={};m.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},m.computeWindingOrder2D=function(e){var t=m.computeArea2D(e);return t>0?d.COUNTER_CLOCKWISE:d.CLOCKWISE},m.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var p=new n,_=new n,y=new n,T=new n,R=new n,A=new n,v=new n;return m.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var d,h=o.slice(0),E=t.length,m=new Array(3*E),S=0;for(d=0;d<E;d++){var g=t[d];m[S++]=g.x,m[S++]=g.y,m[S++]=g.z}for(var N=[],w={},O=e.maximumRadius,M=l.chordLength(u,O),I=M*M;h.length>0;){var x,C,P=h.pop(),D=h.pop(),U=h.pop(),L=n.fromArray(m,3*U,p),F=n.fromArray(m,3*D,_),B=n.fromArray(m,3*P,y),b=n.multiplyByScalar(n.normalize(L,T),O,T),z=n.multiplyByScalar(n.normalize(F,R),O,R),G=n.multiplyByScalar(n.normalize(B,A),O,A),q=n.magnitudeSquared(n.subtract(b,z,v)),V=n.magnitudeSquared(n.subtract(z,G,v)),W=n.magnitudeSquared(n.subtract(G,b,v)),X=Math.max(q,V,W);X>I?q===X?(x=Math.min(U,D)+" "+Math.max(U,D),d=w[x],i(d)||(C=n.add(L,F,v),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),d=m.length/3-1,w[x]=d),h.push(U,d,P),h.push(d,D,P)):V===X?(x=Math.min(D,P)+" "+Math.max(D,P),d=w[x],i(d)||(C=n.add(F,B,v),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),d=m.length/3-1,w[x]=d),h.push(D,d,U),h.push(d,P,U)):W===X&&(x=Math.min(P,U)+" "+Math.max(P,U),d=w[x],i(d)||(C=n.add(B,L,v),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),d=m.length/3-1,w[x]=d),h.push(P,d,D),h.push(d,U,D)):(N.push(U),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m})},indices:N,primitiveType:f.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=h,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},m}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/CorridorGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./VertexFormat"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,p,_,y,T,R){"use strict";function A(e,t,r,a,i,u){var s=e.normals,c=e.tangents,l=e.bitangents,f=n.normalize(n.cross(r,t,L),L);u.normal&&o.addAttribute(s,t,a,i),u.tangent&&o.addAttribute(c,f,a,i),u.bitangent&&o.addAttribute(l,r,a,i)}function v(e,t,r){var i,u,c,l=e.positions,f=e.corners,d=e.endPositions,_=e.lefts,y=e.normals,T=new E,R=0,v=0,S=0;for(u=0;u<l.length;u+=2)c=l[u].length-3,R+=c,S+=2*c,v+=l[u+1].length-3;for(R+=3,v+=3,u=0;u<f.length;u++){i=f[u];var g=f[u].leftPositions;s(g)?(c=g.length,R+=c,S+=c):(c=f[u].rightPositions.length,v+=c,S+=c)}var N,w=s(d);w&&(N=d[0].length-3,R+=N,v+=N,N/=3,S+=6*N);var O,M,D,B,b,z,G=R+v,q=new Float64Array(G),V=t.normal?new Float32Array(G):void 0,W=t.tangent?new Float32Array(G):void 0,X=t.bitangent?new Float32Array(G):void 0,H={normals:V,tangents:W,bitangents:X},Y=0,k=G-1,Z=I,j=x,K=N/2,Q=m.createTypedArray(G/3,S),J=0;if(w){z=C,b=P;var $=d[0];for(Z=n.fromArray(y,0,Z),j=n.fromArray(_,0,j),u=0;u<K;u++)z=n.fromArray($,3*(K-1-u),z),b=n.fromArray($,3*(K+u),b),o.addAttribute(q,b,Y),o.addAttribute(q,z,void 0,k),A(H,Z,j,Y,k,t),M=Y/3,B=M+1,O=(k-2)/3,D=O-1,Q[J++]=O,Q[J++]=M,Q[J++]=D,Q[J++]=D,Q[J++]=M,Q[J++]=B,Y+=3,k-=3}var ee=0,te=0,ne=l[ee++],re=l[ee++];q.set(ne,Y),q.set(re,k-re.length+1),j=n.fromArray(_,te,j);var ae,ie;for(c=re.length-3,u=0;u<c;u+=3)ae=r.geodeticSurfaceNormal(n.fromArray(ne,u,L),L),ie=r.geodeticSurfaceNormal(n.fromArray(re,c-u,F),F),Z=n.normalize(n.add(ae,ie,Z),Z),A(H,Z,j,Y,k,t),M=Y/3,B=M+1,O=(k-2)/3,D=O-1,Q[J++]=O,Q[J++]=M,Q[J++]=D,Q[J++]=D,Q[J++]=M,Q[J++]=B,Y+=3,k-=3;for(ae=r.geodeticSurfaceNormal(n.fromArray(ne,c,L),L),ie=r.geodeticSurfaceNormal(n.fromArray(re,c,F),F),Z=n.normalize(n.add(ae,ie,Z),Z),te+=3,u=0;u<f.length;u++){var oe;i=f[u];var ue,se,ce=i.leftPositions,le=i.rightPositions,fe=U,de=C,he=P;if(Z=n.fromArray(y,te,Z),s(ce)){for(A(H,Z,j,void 0,k,t),k-=3,ue=B,se=D,oe=0;oe<ce.length/3;oe++)fe=n.fromArray(ce,3*oe,fe),Q[J++]=ue,Q[J++]=se-oe-1,Q[J++]=se-oe,o.addAttribute(q,fe,void 0,k),de=n.fromArray(q,3*(se-oe-1),de),he=n.fromArray(q,3*ue,he),j=n.normalize(n.subtract(de,he,j),j),A(H,Z,j,void 0,k,t),k-=3;fe=n.fromArray(q,3*ue,fe),de=n.subtract(n.fromArray(q,3*se,de),fe,de),he=n.subtract(n.fromArray(q,3*(se-oe),he),fe,he),j=n.normalize(n.add(de,he,j),j),A(H,Z,j,Y,void 0,t),Y+=3}else{for(A(H,Z,j,Y,void 0,t),Y+=3,ue=D,se=B,oe=0;oe<le.length/3;oe++)fe=n.fromArray(le,3*oe,fe),Q[J++]=ue,Q[J++]=se+oe,Q[J++]=se+oe+1,o.addAttribute(q,fe,Y),de=n.fromArray(q,3*ue,de),he=n.fromArray(q,3*(se+oe),he),j=n.normalize(n.subtract(de,he,j),j),A(H,Z,j,Y,void 0,t),Y+=3;fe=n.fromArray(q,3*ue,fe),de=n.subtract(n.fromArray(q,3*(se+oe),de),fe,de),he=n.subtract(n.fromArray(q,3*se,he),fe,he),j=n.normalize(n.negate(n.add(he,de,j),j),j),A(H,Z,j,void 0,k,t),k-=3}for(ne=l[ee++],re=l[ee++],ne.splice(0,3),re.splice(re.length-3,3),q.set(ne,Y),q.set(re,k-re.length+1),c=re.length-3,te+=3,j=n.fromArray(_,te,j),oe=0;oe<re.length;oe+=3)ae=r.geodeticSurfaceNormal(n.fromArray(ne,oe,L),L),ie=r.geodeticSurfaceNormal(n.fromArray(re,c-oe,F),F),Z=n.normalize(n.add(ae,ie,Z),Z),A(H,Z,j,Y,k,t),B=Y/3,M=B-1,D=(k-2)/3,O=D+1,Q[J++]=O,Q[J++]=M,Q[J++]=D,Q[J++]=D,Q[J++]=M,Q[J++]=B,Y+=3,k-=3;Y-=3,k+=3}if(Z=n.fromArray(y,y.length-3,Z),A(H,Z,j,Y,k,t),w){Y+=3,k-=3,z=C,b=P;var Ee=d[1];for(u=0;u<K;u++)z=n.fromArray(Ee,3*(N-u-1),z),b=n.fromArray(Ee,3*u,b),o.addAttribute(q,z,void 0,k),o.addAttribute(q,b,Y),A(H,Z,j,Y,k,t),B=Y/3,M=B-1,D=(k-2)/3,O=D+1,Q[J++]=O,Q[J++]=M,Q[J++]=D,Q[J++]=D,Q[J++]=M,Q[J++]=B,Y+=3,k-=3}if(T.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:q}),t.st){var me,pe,_e=new Float32Array(G/3*2),ye=0;if(w){R/=3,v/=3;var Te=Math.PI/(N+1);pe=1/(R-N+1),me=1/(v-N+1);var Re,Ae=N/2;for(u=Ae+1;u<N+1;u++)Re=p.PI_OVER_TWO+Te*u,_e[ye++]=me*(1+Math.cos(Re)),_e[ye++]=.5*(1+Math.sin(Re));for(u=1;u<v-N+1;u++)_e[ye++]=u*me,_e[ye++]=0;for(u=N;u>Ae;u--)Re=p.PI_OVER_TWO-u*Te,_e[ye++]=1-me*(1+Math.cos(Re)),_e[ye++]=.5*(1+Math.sin(Re));for(u=Ae;u>0;u--)Re=p.PI_OVER_TWO-Te*u,_e[ye++]=1-pe*(1+Math.cos(Re)),_e[ye++]=.5*(1+Math.sin(Re));for(u=R-N;u>0;u--)_e[ye++]=u*pe,_e[ye++]=1;for(u=1;u<Ae+1;u++)Re=p.PI_OVER_TWO+Te*u,_e[ye++]=pe*(1+Math.cos(Re)),_e[ye++]=.5*(1+Math.sin(Re))}else{for(R/=3,v/=3,pe=1/(R-1),me=1/(v-1),u=0;u<v;u++)_e[ye++]=u*me,_e[ye++]=0;for(u=R;u>0;u--)_e[ye++]=(u-1)*pe,_e[ye++]=1}T.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_e})}return t.normal&&(T.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.normals})),t.tangent&&(T.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.tangents})),t.bitangent&&(T.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.bitangents})),{attributes:T,indices:Q}}function S(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var r,a,i=e.position.values;(t.normal||t.bitangent)&&(r=e.normal.values,a=e.bitangent.values);var u,s=e.position.values.length/18,c=3*s,l=2*s,f=2*c;if(t.normal||t.bitangent||t.tangent){var d=t.normal?new Float32Array(6*c):void 0,h=t.tangent?new Float32Array(6*c):void 0,E=t.bitangent?new Float32Array(6*c):void 0,m=I,p=x,_=C,y=P,T=D,R=U,A=f;for(u=0;u<c;u+=3){var v=A+f;m=n.fromArray(i,u,m),p=n.fromArray(i,u+c,p),_=n.fromArray(i,(u+3)%c,_),p=n.subtract(p,m,p),_=n.subtract(_,m,_),y=n.normalize(n.cross(p,_,y),y),t.normal&&(o.addAttribute(d,y,v),o.addAttribute(d,y,v+3),o.addAttribute(d,y,A),o.addAttribute(d,y,A+3)),(t.tangent||t.bitangent)&&(R=n.fromArray(r,u,R),t.bitangent&&(o.addAttribute(E,R,v),o.addAttribute(E,R,v+3),o.addAttribute(E,R,A),o.addAttribute(E,R,A+3)),t.tangent&&(T=n.normalize(n.cross(R,y,T),T),o.addAttribute(h,T,v),o.addAttribute(h,T,v+3),o.addAttribute(h,T,A),o.addAttribute(h,T,A+3))),A+=6}if(t.normal){for(d.set(r),u=0;u<c;u+=3)d[u+c]=-r[u],d[u+c+1]=-r[u+1],d[u+c+2]=-r[u+2];e.normal.values=d}else e.normal=void 0;if(t.bitangent?(E.set(a),E.set(a,c),e.bitangent.values=E):e.bitangent=void 0,t.tangent){var S=e.tangent.values;h.set(S),h.set(S,c),e.tangent.values=h}}if(t.st){var g=e.st.values,N=new Float32Array(6*l);N.set(g),N.set(g,l);for(var w=2*l,O=0;O<2;O++){for(N[w++]=g[0],N[w++]=g[1],u=2;u<l;u+=2){var M=g[u],L=g[u+1];N[w++]=M,N[w++]=L,N[w++]=M,N[w++]=L}N[w++]=g[0],N[w++]=g[1]}e.st.values=N}return e}function g(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(var r=3;r<e.length;r+=3){var a=e[r],i=e[r+1],o=e[r+2];n[t++]=a,n[t++]=i,n[t++]=o,n[t++]=a,n[t++]=i,n[t++]=o}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function N(e,t){var n=new R({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),r=e.ellipsoid,i=o.computePositions(e),u=v(i,n,r),s=e.height,c=e.extrudedHeight,l=u.attributes,f=u.indices,d=l.position.values,E=d.length,p=new Float64Array(6*E),y=new Float64Array(E);y.set(d);var T=new Float64Array(4*E);d=_.scaleToGeodeticHeight(d,s,r),T=g(d,0,T),y=_.scaleToGeodeticHeight(y,c,r),T=g(y,2*E,T),p.set(d),p.set(y,E),p.set(T,2*E),l.position.values=p,l=S(l,t);var A=E/3;if(e.shadowVolume){var N=l.normal.values;E=N.length;var w=new Float32Array(6*E);for(O=0;O<E;O++)N[O]=-N[O];w.set(N,E),w=g(N,4*E,w),l.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:w}),t.normal||(l.normal=void 0)}var O,M=f.length,I=A+A,x=m.createTypedArray(p.length/3,2*M+3*I);x.set(f);var C=M;for(O=0;O<M;O+=3){var P=f[O],D=f[O+1],U=f[O+2];x[C++]=U+A,x[C++]=D+A,x[C++]=P+A}var L,F,B,b;for(O=0;O<I;O+=2)L=O+I,F=L+I,B=L+1,b=F+1,x[C++]=L,x[C++]=F,x[C++]=B,x[C++]=B,x[C++]=F,x[C++]=b;return{attributes:l,indices:x}}function w(e,t,r,a,i,o){var u=n.subtract(t,e,B);n.normalize(u,u);var s=r.geodeticSurfaceNormal(e,b),c=n.cross(u,s,B);n.multiplyByScalar(c,a,c);var l=i.latitude,f=i.longitude,d=o.latitude,h=o.longitude;n.add(e,c,b),r.cartesianToCartographic(b,z);var E=z.latitude,m=z.longitude;l=Math.min(l,E),f=Math.min(f,m),d=Math.max(d,E),h=Math.max(h,m),n.subtract(e,c,b),r.cartesianToCartographic(b,z),E=z.latitude,m=z.longitude,l=Math.min(l,E),f=Math.min(f,m),d=Math.max(d,E),h=Math.max(h,m),i.latitude=l,i.longitude=f,o.latitude=d,o.longitude=h}function O(t,r,a,o){var u=e(t,n.equalsEpsilon),s=u.length;if(s<2||a<=0)return new T;var c=.5*a;V.latitude=Number.POSITIVE_INFINITY,V.longitude=Number.POSITIVE_INFINITY,W.latitude=Number.NEGATIVE_INFINITY,W.longitude=Number.NEGATIVE_INFINITY;var l,f;if(o===i.ROUNDED){var d=u[0];n.subtract(d,u[1],G),n.normalize(G,G),n.multiplyByScalar(G,c,G),n.add(d,G,q),r.cartesianToCartographic(q,z),l=z.latitude,f=z.longitude,V.latitude=Math.min(V.latitude,l),V.longitude=Math.min(V.longitude,f),W.latitude=Math.max(W.latitude,l),W.longitude=Math.max(W.longitude,f)}for(var h=0;h<s-1;++h)w(u[h],u[h+1],r,c,V,W);var E=u[s-1];n.subtract(E,u[s-2],G),n.normalize(G,G),n.multiplyByScalar(G,c,G),n.add(E,G,q),w(E,q,r,c,V,W),o===i.ROUNDED&&(r.cartesianToCartographic(q,z),l=z.latitude,f=z.longitude,V.latitude=Math.min(V.latitude,l),V.longitude=Math.min(V.longitude,f),W.latitude=Math.max(W.latitude,l),W.longitude=Math.max(W.longitude,f));var m=new T;return m.north=W.latitude,m.south=V.latitude,m.east=W.longitude,m.west=V.longitude,m}function M(e){e=u(e,u.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=f.clone(u(e.ellipsoid,f.WGS84)),this._vertexFormat=R.clone(u(e.vertexFormat,R.DEFAULT)),this._width=r,this._height=u(e.height,0),this._extrudedHeight=u(e.extrudedHeight,this._height),this._cornerType=u(e.cornerType,i.ROUNDED),this._granularity=u(e.granularity,p.RADIANS_PER_DEGREE),this._shadowVolume=u(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._rectangle=O(t,this._ellipsoid,r,this._cornerType),this.packedLength=1+t.length*n.packedLength+f.packedLength+R.packedLength+T.packedLength+6}var I=new n,x=new n,C=new n,P=new n,D=new n,U=new n,L=new n,F=new n,B=new n,b=new n,z=new r,G=new n,q=new n,V=new r,W=new r;M.pack=function(e,t,r){r=u(r,0);var a=e._positions,i=a.length;t[r++]=i;for(var o=0;o<i;++o,r+=n.packedLength)n.pack(a[o],t,r);return f.pack(e._ellipsoid,t,r),r+=f.packedLength,R.pack(e._vertexFormat,t,r),r+=R.packedLength,T.pack(e._rectangle,t,r),r+=T.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r++]=e._granularity,t[r]=e._shadowVolume?1:0,t};var X=f.clone(f.UNIT_SPHERE),H=new R,Y=new T,k={positions:void 0,ellipsoid:X,vertexFormat:H,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0};return M.unpack=function(e,t,r){t=u(t,0);for(var a=e[t++],i=new Array(a),o=0;o<a;++o,t+=n.packedLength)i[o]=n.unpack(e,t);var c=f.unpack(e,t,X);t+=f.packedLength;var l=R.unpack(e,t,H);t+=R.packedLength;var d=T.unpack(e,t,Y);t+=T.packedLength;var h=e[t++],E=e[t++],m=e[t++],p=e[t++],_=e[t++],y=1===e[t];return s(r)?(r._positions=i,r._ellipsoid=f.clone(c,r._ellipsoid),r._vertexFormat=R.clone(l,r._vertexFormat),r._width=h,r._height=E,r._extrudedHeight=m,r._cornerType=p,r._granularity=_,r._rectangle=T.clone(d),r._shadowVolume=y,r):(k.positions=i,k.width=h,k.height=E,k.extrudedHeight=m,k.cornerType=p,k.granularity=_,k.shadowVolume=y,new M(k))},M.createGeometry=function(r){var a=r._positions,i=r._height,u=r._width,s=r._extrudedHeight,c=i!==s,l=e(a,n.equalsEpsilon);if(!(l.length<2||u<=0)){var f,h=r._ellipsoid,E=r._vertexFormat,m={ellipsoid:h,positions:l,width:u,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!0};if(c){var p=Math.max(i,s);s=Math.min(i,s),i=p,m.height=i,m.extrudedHeight=s,m.shadowVolume=r._shadowVolume,f=N(m,E)}else{var T=o.computePositions(m);f=v(T,E,h),f.attributes.position.values=_.scaleToGeodeticHeight(f.attributes.position.values,i,h)}var R=f.attributes,A=t.fromVertices(R.position.values,void 0,3);return E.position||(f.attributes.position.values=void 0),new d({attributes:R,indices:f.indices,primitiveType:y.TRIANGLES,boundingSphere:A})}},M.createShadowVolume=function(e,t,n){var r=e._granularity,a=e._ellipsoid,i=t(r,a),o=n(r,a);return new M({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:a,granularity:r,extrudedHeight:i,height:o,vertexFormat:R.POSITION_ONLY,shadowVolume:!0})},c(M.prototype,{rectangle:{get:function(){return this._rectangle}}}),M}),define("Workers/createCorridorGeometry",["../Core/CorridorGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,n){"use strict";function r(r,a){return t(a)&&(r=e.unpack(r,a)),r._ellipsoid=n.clone(r._ellipsoid),e.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/arrayRemoveDuplicates",["./Check","./defaultValue","./defined","./Math"],function(e,t,n,r){"use strict";function a(e,r,a){if(n(e)){a=t(a,!1);var o=e.length;if(o<2)return e;var u,s,c;for(u=1;u<o&&(s=e[u-1],c=e[u],!r(s,c,i));++u);if(u===o)return a&&r(e[0],e[e.length-1],i)?e.slice(1):e;for(var l=e.slice(0,u);u<o;++u)c=e[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(r),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),n(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,d=n.z,h=a.x,E=a.y,m=a.z,p=l*l*h*h,_=f*f*E*E,y=d*d*m*m,T=p+_+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,S=u.y,g=u.z,N=o;N.x=A.x*v*2,N.y=A.y*S*2,N.z=A.z*g*2;var w,O,M,I,x,C,P,D,U,L,F,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(N)),b=0;do{B-=b,M=1/(1+B*v),I=1/(1+B*S),x=1/(1+B*g),C=M*M,P=I*I,D=x*x,U=C*M,L=P*I,F=D*x,w=p*C+_*P+y*D-1,O=p*U*v+_*L*S+y*F*g;var z=-2*O;b=w/z}while(Math.abs(w)>r.EPSILON12);return t(c)?(c.x=l*M,c.y=f*I,c.z=d*x,c):new e(l*M,f*I,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,a,i){return a=n(a,0),r(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,m=r(n)?n.oneOverRadiiSquared:d,p=r(n)?n._centerToleranceSquared:h,_=o(t,E,m,p,c);if(r(_)){var y=e.multiplyComponents(_,m,s);y=e.normalize(y,y);var T=e.subtract(t,_,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),v=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],d=m[a];if(Math.abs(e[s.getElementIndex(d,f)])>n){var h,p=e[s.getElementIndex(d,d)],_=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(d,f)],T=(p-_)/2/y;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=n-u-f+h,m=2*(a-d),p=2*(i+l),_=2*(a+d),y=-n+u-f+h,T=2*(c-o),R=2*(i-l),A=2*(c+o),v=-n-u+f+h;return r(t)?(t[0]=E,t[1]=_,t[2]=R,t[3]=m,t[4]=y,t[5]=A,t[6]=p,t[7]=T,t[8]=v,t):new s(E,m,p,_,y,T,R,A,v)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=n*u,E=i*a+c*o*u,m=-c*a+i*o*u,p=-o,_=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=f,t[4]=E,t[5]=_,t[6]=d,t[7]=m,t[8]=y,t):new s(l,f,d,h,E,m,p,_,y)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var d=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],p=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=n*c(h);o<a&&l(h)>E;)f(h,p),s.transpose(p,_),s.multiply(h,p,h),s.multiply(_,h,h),s.multiply(d,p,d),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/d;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError", +this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,d,h,E,m,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(d,0),this[15]=r(p,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,_=t.z*t.w,y=t.w*t.w,T=s-h-p+y,R=2*(c-_),A=2*(f+m),v=2*(c+_),S=-s+h-p+y,g=2*(E-d),N=2*(f-m),w=2*(E+d),O=-s-h+p+y;return r[0]=T*i,r[1]=v*i,r[2]=N*i,r[3]=0,r[4]=R*o,r[5]=S*o,r[6]=w*o,r[7]=0,r[8]=A*u,r[9]=g*u,r[10]=O*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,m=f.y,p=f.z,_=h.x,y=h.y,T=h.z,R=r.x,A=r.y,v=r.z,S=u*-R+s*-A+c*-v,g=_*-R+y*-A+T*-v,N=E*R+m*A+p*v;return a(n)?(n[0]=u,n[1]=_,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-p,n[11]=0,n[12]=S,n[13]=g,n[14]=N,n[15]=1,n):new l(u,s,c,S,_,y,T,g,-E,-m,-p,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),d=c,h=l,E=f,m=i+c,p=o+l,_=t+f,y=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=p,a[14]=_,a[15]=y,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],p=e[13],_=e[14],y=e[15],T=t[0],R=t[1],A=t[2],v=t[3],S=t[4],g=t[5],N=t[6],w=t[7],O=t[8],M=t[9],I=t[10],x=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=r*T+u*R+f*A+m*v,F=a*T+s*R+d*A+p*v,B=i*T+c*R+h*A+_*v,b=o*T+l*R+E*A+y*v,z=r*S+u*g+f*N+m*w,G=a*S+s*g+d*N+p*w,q=i*S+c*g+h*N+_*w,W=o*S+l*g+E*N+y*w,V=r*O+u*M+f*I+m*x,X=a*O+s*M+d*I+p*x,H=i*O+c*M+h*I+_*x,Y=o*O+l*M+E*I+y*x,k=r*C+u*P+f*D+m*U,Z=a*C+s*P+d*D+p*U,j=i*C+c*P+h*D+_*U,K=o*C+l*P+E*D+y*U;return n[0]=L,n[1]=F,n[2]=B,n[3]=b,n[4]=z,n[5]=G,n[6]=q,n[7]=W,n[8]=V,n[9]=X,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],p=t[1],_=t[2],y=t[4],T=t[5],R=t[6],A=t[8],v=t[9],S=t[10],g=t[12],N=t[13],w=t[14],O=r*m+o*p+c*_,M=a*m+u*p+l*_,I=i*m+s*p+f*_,x=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,D=r*A+o*v+c*S,U=a*A+u*v+l*S,L=i*A+s*v+f*S,F=r*g+o*N+c*w+d,B=a*g+u*N+l*w+h,b=i*g+s*N+f*w+E;return n[0]=O,n[1]=M,n[2]=I,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=b,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],p=t[4],_=t[5],y=t[6],T=t[7],R=t[8],A=r*d+o*h+c*E,v=a*d+u*h+l*E,S=i*d+s*h+f*E,g=r*m+o*p+c*_,N=a*m+u*p+l*_,w=i*m+s*p+f*_,O=r*y+o*T+c*R,M=a*y+u*T+l*R,I=i*y+s*T+f*R;return n[0]=A,n[1]=v,n[2]=S,n[3]=0,n[4]=g,n[5]=N,n[6]=w,n[7]=0,n[8]=O,n[9]=M,n[10]=I,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var p=new e;l.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var _=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,_),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],p=e[6],A=e[10],v=e[14],S=e[3],g=e[7],N=e[11],w=e[15],O=A*w,M=v*N,I=p*w,x=v*g,C=p*N,P=A*g,D=m*w,U=v*S,L=m*N,F=A*S,B=m*g,b=p*S,z=O*d+x*h+C*E-(M*d+I*h+P*E),G=M*f+D*h+F*E-(O*f+U*h+L*E),q=I*f+U*d+B*E-(x*f+D*d+b*E),W=P*f+L*d+b*h-(C*f+F*d+B*h),V=M*a+I*i+P*o-(O*a+x*i+C*o),X=O*r+U*i+L*o-(M*r+D*i+F*o),H=x*r+D*a+b*o-(I*r+U*a+B*o),Y=C*r+F*a+B*i-(P*r+L*a+b*i);O=i*E,M=o*h,I=a*E,x=o*d,C=a*h,P=i*d,D=r*E,U=o*f,L=r*h,F=i*f,B=r*d,b=a*f;var k=O*g+x*N+C*w-(M*g+I*N+P*w),Z=M*S+D*N+F*w-(O*S+U*N+L*w),j=I*S+U*g+B*w-(x*S+D*g+b*w),K=P*S+L*g+b*N-(C*S+F*g+B*N),Q=I*A+P*v+M*p-(C*v+O*p+x*A),J=L*v+O*m+U*A-(D*A+F*v+M*m),$=D*p+b*v+x*m-(B*v+I*m+U*p),ee=B*A+C*m+F*p-(L*p+b*A+P*m),te=r*z+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=z*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=V*te,n[5]=X*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-n*f-r*d-a*h,m=-i*f-o*d-u*h,p=-s*f-c*d-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return r(n)?(n.west=l,n.south=d,n.east=f,n.north=h,n):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,E=new e,m=new e,p=new e,_=new e,y=new e,T=new e,R=new e,A=new e,v=new e,S=new e,g=new e;d.fromPoints=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,h),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,p),c=e.clone(r,_),l=e.clone(r,y),f=t.length,N=1;N<f;N++){e.clone(t[N],r);var w=r.x,O=r.y,M=r.z;w<i.x&&e.clone(r,i),w>s.x&&e.clone(r,s),O<o.y&&e.clone(r,o),O>c.y&&e.clone(r,c),M<u.z&&e.clone(r,u),M>l.z&&e.clone(r,l)}var I=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,D=s,U=I;x>U&&(U=x,P=o,D=c),C>U&&(U=C,P=u,D=l);var L=A;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var F=e.magnitudeSquared(e.subtract(D,L,R)),B=Math.sqrt(F),b=v;b.x=i.x,b.y=o.y,b.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(b,z,R),.5,g),q=0;for(N=0;N<f;N++){e.clone(t[N],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var V=e.magnitudeSquared(e.subtract(r,L,R));if(V>F){var X=Math.sqrt(V);B=.5*(B+X),F=B*B;var H=X-B;L.x=(B*L.x+H*r.x)/X,L.y=(B*L.y+H*r.y)/X,L.z=(B*L.z+H*r.z)/X}}return B<q?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var N=new o,w=new e,O=new e,M=new t,I=new t;d.fromRectangle2D=function(e,t,n){return d.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,N),f.southwest(t,M),M.height=i,f.northeast(t,I),I.height=o;var s=n.project(M,w),c=n.project(I,O),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),d.fromPoints(u,o)},d.fromVertices=function(t,n,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,p),N=e.clone(u,_),w=e.clone(u,y),O=t.length,M=0;M<O;M+=i){var I=t[M]+n.x,x=t[M+1]+n.y,C=t[M+2]+n.z;u.x=I,u.y=x,u.z=C,I<s.x&&e.clone(u,s),I>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>w.z&&e.clone(u,w)}var P=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(N,c,R)),U=e.magnitudeSquared(e.subtract(w,l,R)),L=s,F=f,B=P;D>B&&(B=D,L=c,F=N),U>B&&(B=U,L=l,F=w);var b=A;b.x=.5*(L.x+F.x),b.y=.5*(L.y+F.y),b.z=.5*(L.z+F.z);var z=e.magnitudeSquared(e.subtract(F,b,R)),G=Math.sqrt(z),q=v;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=N.y,W.z=w.z;var V=e.multiplyByScalar(e.add(q,W,R),.5,g),X=0;for(M=0;M<O;M+=i){u.x=t[M]+n.x,u.y=t[M+1]+n.y,u.z=t[M+2]+n.z;var H=e.magnitude(e.subtract(u,V,R));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,b,R));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var Z=k-G;b.x=(G*b.x+Z*u.x)/k,b.y=(G*b.y+Z*u.y)/k,b.z=(G*b.z+Z*u.z)/k}}return G<X?(e.clone(b,o.center),o.radius=G):(e.clone(V,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new d),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,_),f=e.clone(i,y),N=t.length,w=0;w<N;w+=3){var O=t[w]+n[w],M=t[w+1]+n[w+1],I=t[w+2]+n[w+2];i.x=O,i.y=M,i.z=I,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),M<u.y&&e.clone(i,u),M>l.y&&e.clone(i,l),I<s.z&&e.clone(i,s),I>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),D=o,U=c,L=x;C>L&&(L=C,D=u,U=l),P>L&&(L=P,D=s,U=f);var F=A;F.x=.5*(D.x+U.x),F.y=.5*(D.y+U.y),F.z=.5*(D.z+U.z);var B=e.magnitudeSquared(e.subtract(U,F,R)),b=Math.sqrt(B),z=v;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(z,G,R),.5,g),W=0;for(w=0;w<N;w+=3){i.x=t[w]+n[w],i.y=t[w+1]+n[w+1],i.z=t[w+2]+n[w+2];var V=e.magnitude(e.subtract(i,q,R));V>W&&(W=V);var X=e.magnitudeSquared(e.subtract(i,F,R));if(X>B){var H=Math.sqrt(X);b=.5*(b+H),B=b*b;var Y=H-b;F.x=(b*F.x+Y*i.x)/H,F.y=(b*F.y+Y*i.y)/H,F.z=(b*F.z+Y*i.z)/H}}return b<W?(e.clone(F,r.center),r.radius=b):(e.clone(q,r.center),r.radius=W),r},d.fromCornerPoints=function(t,n,r){a(r)||(r=new d);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},d.fromEllipsoid=function(t,n){return a(n)||(n=new d),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;d.fromBoundingSpheres=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return d.clone(t[0],n);if(2===r)return d.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,U=new e;d.fromOrientedBoundingBox=function(t,n){a(n)||(n=new d);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,D),u=c.getColumn(r,2,U);return e.add(i,o,i),e.add(i,u,i),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(i),n},d.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},d.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new d);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;d.union=function(t,n,r){a(r)||(r=new d);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(h,i,h),e.clone(h,r.center),r.radius=f,r};var B=new e;d.expand=function(t,n,r){r=d.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},d.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var b=new e;d.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,b);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var z=new e;d.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,z),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,V=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return d.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,V),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var p=E.length,_=0;_<p;++_){var y=E[_];e.add(o,y,y);var T=i.cartesianToCartographic(y,H);n.project(T,y)}a=d.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){return d.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=r(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,g=r(e[1]))}return S}function u(){return o()&&g}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(N=!0,w=r(e[1]),w.isNightly=!!e[2])}return N}function c(){return s()&&w}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent), +null!==e&&(O=!0,M=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,M=r(e[1])))}return O}function f(){return l()&&M}function d(){if(!t(I)){I=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(I=!0,x=r(e[1]))}return I}function h(){return d()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function p(){return E()&&P}function _(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,S,g,N,w,O,M,I,x,C,P,D,U,L,F,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:y,imageRenderingValue:T};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,d=f*f,h=1-d,E=Math.sqrt(h),m=t/4,p=m*m,_=p*m,y=p*p,T=1+m-3*p/4+5*_/4-175*y/64,R=1-m+15*p/8-35*_/8,A=1-3*m+35*p/4,v=1-5*m,S=T*l-R*Math.sin(2*l)*m/2-A*Math.sin(4*l)*p/16-v*Math.sin(6*l)*_/48-5*Math.sin(8*l)*y/512,g=e._constants;g.a=n,g.b=r,g.f=a,g.cosineHeading=i,g.sineHeading=o,g.tanU=u,g.cosineU=s,g.sineU=c,g.sigma=l,g.sineAlpha=f,g.sineSquaredAlpha=d,g.cosineSquaredAlpha=h,g.cosineAlpha=E,g.u2Over4=m,g.u4Over16=p,g.u6Over64=_,g.u8Over256=y,g.a0=T,g.a1=R,g.a2=A,g.a3=v,g.distanceRatio=S}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,d,h,E=(t-n)/t,m=i-r,p=Math.atan((1-E)*Math.tan(a)),_=Math.atan((1-E)*Math.tan(o)),y=Math.cos(p),T=Math.sin(p),R=Math.cos(_),A=Math.sin(_),v=y*R,S=y*A,g=T*A,N=T*R,w=m,O=u.TWO_PI,M=Math.cos(w),I=Math.sin(w);do{M=Math.cos(w),I=Math.sin(w);var x=S-N*M;f=Math.sqrt(R*R*I*I+x*x),c=g+v*M,s=Math.atan2(f,c);var C;0===f?(C=0,d=1):(C=v*I/f,d=1-C*C),O=w,h=c-2*g/d,isNaN(h)&&(h=0),w=m+l(E,C,d,s,f,c,h)}while(Math.abs(w-O)>u.EPSILON12);var P=d*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,U=P*(256+P*(P*(74-47*P)-128))/1024,L=h*h,F=U*f*(h+U*(c*(2*L-1)-U*h*(4*f*f-3)*(4*L-3)/6)/4),B=n*D*(s-F),b=Math.atan2(R*I,S-N*M),z=Math.atan2(y*I,S*M-N);e._distance=B,e._startHeading=b,e._endHeading=z,e._uSquared=P}function d(n,r,a,i){e.normalize(i.cartographicToCartesian(r,m),E),e.normalize(i.cartographicToCartesian(a,m),m);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function h(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&d(this,e,a,u)}var E=new e,m=new e;return a(h.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}}}),h.prototype.setEndPoints=function(e,t){d(this,e,t,this._ellipsoid)},h.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},h.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),d=Math.sin(6*i),h=Math.sin(8*i),E=i*i,m=i*E,p=a.u8Over256,_=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*m*p*o/3+i*(1-_+7*T/4-15*y/4+579*p/64-(T-15*y/4+187*p/16)*o-(5*y/4-115*p/16)*u-29*p*s/16)+(_/2-T+71*y/32-85*p/16)*c+(5*T/16-5*y/4+383*p/96)*f-E*((y-11*p/2)*c+5*p*f/2)+(29*y/96-29*p/16)*d+539*p*h/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),v=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var S=Math.cos(2*a.sigma+R),g=Math.sin(R),N=Math.cos(R),w=a.cosineU*N,O=a.sineU*g,M=Math.atan2(g*a.sineHeading,w-O*a.cosineHeading),I=M-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,g,N,S);return r(n)?(n.longitude=this._start.longitude+I,n.latitude=v,n.height=0,n):new t(this._start.longitude+I,v,0)},h}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[d/e,a/d]:[a/d,d/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,p=u*c-h,_=4*E*p-m*m;if(_<0){var y,T,R;d*f>=l*h?(y=o,T=E,R=-2*u*E+o*m):(y=c,T=p,R=-c*m+2*s*p);var A=R<0?-1:1,v=-A*Math.abs(y)*Math.sqrt(-_);i=-R+v;var S=i/2,g=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),N=i===v?-g:-T/g;return a=T<=0?g+N:-R/(g*g+N*N+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var w=E,O=-2*u*E+o*m,M=p,I=-c*m+2*s*p,x=Math.sqrt(_),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-w);var D=Math.cos(P);i=a*D;var U=a*(-D/2-C*Math.sin(P)),L=i+U>2*u?i-u:U-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*x,-I)/3),a=2*Math.sqrt(-M),D=Math.cos(P),i=a*D,U=a*(-D/2-C*Math.sin(P));var b=-c,z=i+U<2*s?i+s:U+s,G=b/z,q=F*z,W=-L*z-F*b,V=L*b,X=(s*W-u*V)/(-u*W+s*q);return B<=X?B<=G?X<=G?[B,X,G]:[B,G,X]:[G,B,X]:B<=G?[X,B,G]:X<=G?[X,G,B]:[G,X,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],_=E[1];if(p>=0&&_>=0){var y=Math.sqrt(p),T=Math.sqrt(_);return[d-T,d-y,d+y,d+T]}if(p>=0&&_<0)return m=Math.sqrt(p),[d-m,d+m];if(p<0&&_>=0)return m=Math.sqrt(_),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,S=r.computeRealRoots(1,R,A),g=r.computeRealRoots(1,-R,v);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==g.length?(g[0]+=d,g[1]+=d,S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>g[0]&&S[0]<g[1]?[g[0],S[0],g[1],S[1]]:[S[0],g[0],S[1],g[1]]):S):0!==g.length?(g[0]+=d,g[1]+=d,g):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,p=h[0],_=a-p,y=_*_,T=t/2,R=_/2,A=y-4*o,v=y+4*Math.abs(o),S=c-4*p,g=c+4*Math.abs(p);if(p<0||A*g<S*v){var N=Math.sqrt(S);E=N/2,m=0===N?0:(t*R-i)/N}else{var w=Math.sqrt(A);E=0===w?0:(t*R-i)/w,m=w/2}var O,M;0===T&&0===E?(O=0,M=0):n.sign(T)===n.sign(E)?(O=T+E,M=p/O):(M=T-E,O=p/M);var I,x;0===R&&0===m?(I=0,x=0):n.sign(R)===n.sign(m)?(I=R+m,x=o/I):(x=R-m,I=o/x);var C=r.computeRealRoots(1,O,I),P=r.computeRealRoots(1,M,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,d=f*r,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*n*d-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function d(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(d,h,E,v);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),p=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*n.x+r,_=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===_){if(l=s.computeRealRoots(E,m,p),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var v=l[1],S=Math.sqrt(Math.max(1-v*v,0));T.push(new e(a,i*v,i*-S)),T.push(new e(a,i*v,i*S))}return T}var g=y*y,N=_*_,w=E*E,O=y*_,M=w+N,I=2*(m*E+O),x=2*p*E+m*m-N+g,C=2*(p*m-O),P=p*p-g;if(0===M&&0===I&&0===x&&0===C)return T;l=c.computeRealRoots(M,I,x,C,P);var D=l.length;if(0===D)return T;for(var U=0;U<D;++U){var L,F=l[U],B=F*F,b=Math.max(1-B,0),z=Math.sqrt(b);L=o.sign(E)===o.sign(p)?h(E*B+p,m*F,o.EPSILON12):o.sign(p)===o.sign(m*F)?h(E*B,m*F+p,o.EPSILON12):h(E*B+m*F,p,o.EPSILON12);var G=h(_*F,y,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*z)):q>0?T.push(new e(a,i*F,i*-z)):0!==z?(T.push(new e(a,i*F,i*-z)),T.push(new e(a,i*F,i*z)),++U):T.push(new e(a,i*F,i*z))}return T}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,_=new e,y=new e,T=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,m=e.subtract(a,r,p),A=e.subtract(i,r,_),v=e.cross(E,A,y),S=e.dot(m,v);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,r,T),l=e.dot(s,v),l<0||l>S)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(A,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var g=1/S;if(s=e.subtract(h,r,T),l=e.dot(s,v)*g,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*g,f<0||l+f>1)return;d=e.dot(A,c)*g}return d},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=d(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new l;m.lineSegmentSphere=function(t,n,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var g=new e,N=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,g),f=e.multiplyComponents(c,t.direction,N),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(r=d-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,p=r/s;return m<p?new i(m,p):{start:p,stop:m}}var _=Math.sqrt(r/a);return new i(_,_)}return d<1?(r=d-1,a=e.magnitudeSquared(f),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var w=new e,O=new e,M=new e,I=new e,x=new e,C=new u,P=new u,D=new u,U=new u,L=new u,F=new u,B=new u,b=new e,z=new e,G=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,w);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,w),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,I),h=e.normalize(e.cross(d,f,O),O),m=e.normalize(e.cross(f,h,M),M),p=C;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=h.x,p[4]=h.y,p[5]=h.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var _=u.transpose(p,P),y=u.fromScale(n.radii,D),T=u.fromScale(n.oneOverRadii,U),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,v,S=u.multiply(u.multiply(_,T,F),R,F),g=u.multiply(u.multiply(S,y,B),p,B),N=u.multiplyByVector(S,a,x),q=E(g,e.negate(N,w),0,0,1),W=q.length;if(W>0){for(var V=e.clone(e.ZERO,z),X=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(y,u.multiplyByVector(p,q[H],b),b);var Y=e.normalize(e.subtract(A,a,I),I),k=e.dot(Y,i);k>X&&(X=k,V=e.clone(A,V))}var Z=n.cartesianToCartographic(V,G);return X=o.clamp(X,0,1),v=e.magnitude(e.subtract(V,a,I))*Math.sqrt(1-X*X),v=c?-v:v,Z.height=v,n.cartographicToCartesian(Z,new e)}};var q=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u); +if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,d),{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,d),{positions:[t,n,r,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,n,r,a){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var o=new e;return i.fromCartesian4=function(n,r){var a=e.fromCartesian4(n,o),u=n.w;return t(r)?(e.clone(a,r.normal),r.distance=u,r):new i(a,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(e,t,n){var r=g;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function h(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,M),l=a.scaleToGeodeticSurface(n,I),f=E.numberOfPoints(t,n,r),h=a.cartesianToCartographic(c,N),m=a.cartesianToCartographic(l,w),p=d(f,i,o);x.setEndPoints(h,m);var _=x.surfaceDistance/f,y=s;h.height=i;var T=a.cartographicToCartesian(h,O);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=x.interpolateUsingSurfaceDistance(R*_,w);A.height=p[R],T=a.cartographicToCartesian(A,O),e.pack(T,u,y),y+=3}return y}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var m=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,m).height}return r};var p=new l,_=new e,y=new e,T=new f(e.UNIT_X,0),R=new e,A=new f(e.UNIT_X,0),v=new e,S=new e,g=[],N=new t,w=new t,O=new e,M=new e,I=new e,x=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,p),c=l.multiplyByPoint(s,e.ZERO,_),d=e.normalize(l.multiplyByPointAsVector(s,e.UNIT_Y,y),y),h=f.fromPointNormal(c,d,T),E=e.normalize(l.multiplyByPointAsVector(s,e.UNIT_X,R),R),m=f.fromPointNormal(c,E,A),g=1;i.push(e.clone(t[0]));for(var N=i[0],w=t.length,O=1;O<w;++O){var M=t[O];if(f.getPointDistance(m,N)<0||f.getPointDistance(m,M)<0){var I=u.lineSegmentPlane(N,M,h,v);if(r(I)){var x=e.multiplyByScalar(d,5e-9,S);f.getPointDistance(h,N)<0&&e.negate(x,x),i.push(e.add(I,x,new e)),o.push(g+1),e.negate(x,x),i.push(e.add(I,x,new e)),g=1}}i.push(e.clone(t[O])),g++,N=M}o.push(g)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var d=u.scaleToGeodeticSurface(a[0],M);if(l=f?l[0]:l,0!==l){var m=u.geodeticSurfaceNormal(d,O);e.multiplyByScalar(m,l,m),e.add(d,m,d)}return[d.x,d.y,d.z]}var p=t.minDistance;if(!r(p)){var _=n(t.granularity,c.RADIANS_PER_DEGREE);p=c.chordLength(_,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=E.numberOfPoints(a[y],a[y+1],p);var R=3*(T+1),A=new Array(R),v=0;for(y=0;y<o-1;y++){var S=a[y],w=a[y+1],I=f?l[y]:l,x=f?l[y+1]:l;v=h(S,w,p,u,I,x,A,v)}g.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,N);P.height=f?l[o-1]:l;var D=u.cartographicToCartesian(P,O);return e.pack(D,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,n,r,a){"use strict";function i(t,a,i){this.minimum=e.clone(n(t,e.ZERO)),this.maximum=e.clone(n(a,e.ZERO)),r(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,n){if(r(n)||(n=new i),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,d=1;d<f;d++){var h=t[d],E=h.x,m=h.y,p=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(p,u),l=Math.max(p,l)}var _=n.minimum;_.x=a,_.y=o,_.z=u;var y=n.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(_,y,n.center);return e.multiplyByScalar(T,.5,T),n},i.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new i(t.minimum,t.maximum)},i.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],d=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=_,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,p,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,d=[],h=o(),c)for(p=h.progress,m=function(e){d.push(e),--l||(E=m=_,h.reject(d))},E=function(e){f.push(e),--c||(E=m=_,h.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,p);else h.resolve(f);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return p(1,arguments),d(e,y).then(t,n,r)}function f(){return d(arguments,y)}function d(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function p(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function _(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,d){var h,E,m,p,_;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,v=" ",S=s.length,g=0;s&&g<S;g++)switch(s.charAt(g)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":v=s.charAt(g+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,_=r?t[r.slice(0,-1)]:t[n++],d){case"s":return u(String(_),y,c,f,R,v);case"c":return u(String.fromCharCode(+_),y,c,f,R);case"b":return o(_,2,A,y,c,f,R);case"o":return o(_,8,A,y,c,f,R);case"x":return o(_,16,A,y,c,f,R);case"X":return o(_,16,A,y,c,f,R).toUpperCase();case"u":return o(_,10,A,y,c,f,R);case"i":case"d":return h=+_||0,h=Math.round(h-h%1),E=h<0?"-":T,_=E+a(String(Math.abs(h)),f,"0",!1),i(_,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+_,E=h<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],_=E+Math.abs(h)[m](f),i(_,E,y,c,R)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function d(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&f(this)}var p=new i,_=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,v=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,g=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,w=/^(\d{2})(\.\d+)?/.source+N.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,d=0,p=0,T=0,N=0,I=u[0],x=u[1];if(u=I.match(g),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=I.match(A),null!==u)n=+u[1],s=+u[2];else if(u=I.match(R),null!==u)n=+u[1];else{var C;if(u=I.match(v),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=I.match(S),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,U=new Date(Date.UTC(n,0,4));C=7*P+D-U.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(x)){u=x.match(M),null!==u?(d=+u[1],p=+u[2],T=+u[3],N=1e3*+(u[4]||0),L=5):(u=x.match(O),null!==u?(d=+u[1],p=+u[2],T=60*+(u[3]||0),L=4):(u=x.match(w),null!==u&&(d=+u[1],p=60*+(u[2]||0),L=3)));var F=u[L],B=+u[L+1],b=+(u[L+2]||0);switch(F){case"+":d-=B,p-=b;break;case"-":d+=B,p+=b;break;case"Z":break;default:p+=new Date(Date.UTC(n,s-1,l,d,p)).getTimezoneOffset()}}else p+=new Date(n,s-1,l).getTimezoneOffset();var z=60===T;for(z&&T--;p>=60;)p-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?y:_[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:_[s-1];for(;p<0;)p+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:_[s-1],l+=a;var G=E(n,s,l,d,p,T,N);return r(t)?(h(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),z&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var I=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=d(e,I);r(a)||(m.addSeconds(e,-1,I),a=d(I,I),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var p=h+2-12*c|0,_=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,v=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=_,t.month=p,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=v,t.isLeapSecond=n,t):new i(_,p,E,y,R,A,v,n)},m.toDate=function(e){var t=m.toGregorianDate(e,p),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(d)&&n(E.overrideMimeType)&&E.overrideMimeType(d),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns"); +var p=e._samples=n.samples,_=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=p.length;R<A;R+=e._columnCount){var v=p[R+a],S=p[R+m],g=v+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(_.push(N),T){if(S!==y&&r(y)){var w=o.leapSeconds,O=t(w,N,h);if(O<0){var M=new u(N,S);w.splice(~O,0,M)}}y=S}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,n){return t+e*(n-t)}function _(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=n[d+e._ut1MinusUtcSecondsColumn],_=n[h+e._ut1MinusUtcSecondsColumn],y=_-E;if(y>.5||y<-.5){var T=n[d+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=_:_-=R-T)}return u.xPoleWander=p(f,n[d+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,n[d+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,_),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!r(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,_(this,i,this._samples,e,s,l,n),n}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,_(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},d}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){if(i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),"data"===r.scheme)return r.toString();if("data"===a.scheme)return a.toString();n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=d(e);return h.href=n,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),r(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,p=i-s*this._stepSizeDays,_=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)_[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=_[m]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*h[A++],n.y+=T[E]*h[A++],n.s+=T[E]*h[A]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,d=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=d,a):new l(u,s,c,d)};var d=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+f+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var p=d,_=0;f>s&&(_=1),E>s&&E>f&&(_=2);var y=p[_],T=p[y];n=Math.sqrt(e[c.getElementIndex(_,_)]-e[c.getElementIndex(y,y)]-e[c.getElementIndex(T,T)]+1);var R=h;R[_]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,y)]-e[c.getElementIndex(y,T)])*n,R[y]=(e[c.getElementIndex(y,_)]+e[c.getElementIndex(_,y)])*n,R[T]=(e[c.getElementIndex(T,_)]+e[c.getElementIndex(_,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,p=new l,_=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),_=l.fromAxisAngle(e.UNIT_X,o.roll,E),p=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(p,_,p),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var y=new e,T=new e,R=new l,A=new l,v=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,v),l.conjugate(v,v);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,v,R),R.w<0&&l.negate(R,R),l.computeAxis(R,y);var u=l.computeAngle(R);r[o]=y.x*u,r[o+1]=y.y*u,r[o+2]=y.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,d=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=d,n.z=h,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var S=new l;l.lerp=function(e,t,n,r){return S=l.multiplyByScalar(t,n,S),r=l.multiplyByScalar(e,1-n,r),l.add(S,r,r)};var g=new l,N=new l,w=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=g=l.negate(t,g)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return N=l.multiplyByScalar(e,Math.sin((1-n)*o),N),w=l.multiplyByScalar(i,Math.sin(n*o),w),r=l.add(N,w,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var O=new e,M=new e,I=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,I);l.multiply(i,r,x);var o=l.log(x,O);l.multiply(i,t,x);var u=l.log(x,M);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,I),l.multiply(n,I,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,I),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var b=B+1,z=2*b+1;D[B]=1/(b*z),U[B]=b/z}return D[7]=P/136,U[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)L[f]=(D[f]*s-U[f])*o,F[f]=(D[f]*c-U[f])*o;var d=a*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),h=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,h,C);return l.multiplyByScalar(t,d,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,I),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,p,_,y,T,R){"use strict";var A={},v={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},S={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},g={},N={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},w=new n,O=new n,M=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!v.hasOwnProperty(e)||!v[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=v[e][t],i=e+t;return u(g[i])?r=g[i]:(r=function(r,i,s){if(u(s)||(s=new y),p.equalsEpsilon(r.x,0,p.EPSILON14)&&p.equalsEpsilon(r.y,0,p.EPSILON14)){var c=p.sign(r.z);n.unpack(S[e],0,w),"east"!==e&&"west"!==e&&n.multiplyByScalar(w,c,w),n.unpack(S[t],0,O),"east"!==t&&"west"!==t&&n.multiplyByScalar(O,c,O),n.unpack(S[a],0,M),"east"!==a&&"west"!==a&&n.multiplyByScalar(M,c,M)}else{i=o(i,d.WGS84),i.geodeticSurfaceNormal(r,N.up);var l=N.up,f=N.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,N.east),n.cross(l,f,N.north),n.multiplyByScalar(N.up,-1,N.down),n.multiplyByScalar(N.east,-1,N.west),n.multiplyByScalar(N.north,-1,N.south),w=N[e],O=N[t],M=N[a]}return s[0]=w.x,s[1]=w.y,s[2]=w.z,s[3]=0,s[4]=O.x,s[5]=O.y,s[6]=O.z,s[7]=0,s[8]=M.x,s[9]=M.y,s[10]=M.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},g[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var I=new T,x=new n(1,1,1),C=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof y&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,I),c=y.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),y.multiply(i,c,i)};var P=new y,D=new _;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=y.getRotation(i,D);return T.fromRotationMatrix(o,a)};var U=24110.54841,L=8640184.812866,F=.093104,B=-62e-7,b=1.1772758384668e-19,z=72921158553e-15,G=p.TWO_PI/86400,q=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=U+n*(L+n*(F+n*B)),s=o*G%p.TWO_PI,c=z+b*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new _(d,h,0,-h,d,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=l.NONE;var W=32.184,V=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new _);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return _.transpose(n,t)};var X=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new _,k=new _;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new _);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,X);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=_.fromRotationZ(-i.s,k),d=_.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=h-2451545,T=E/R.SECONDS_PER_DAY,v=.779057273264+T+.00273781191135448*(y+T);v=v%1*p.TWO_PI;var S=_.fromRotationZ(v,k),g=_.multiply(d,S,Y),N=Math.cos(n.xPoleWander),w=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander),I=r-V+a/R.SECONDS_PER_DAY;I/=36525;var x=-47e-6*I*p.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=k;return D[0]=N*C,D[1]=N*P,D[2]=O,D[3]=-w*P+M*O*C,D[4]=w*C+M*O*P,D[5]=-M*N,D[6]=-M*P-w*O*C,D[7]=M*C-w*O*P,D[8]=w*N,_.multiply(g,D,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,Q=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,d.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,p.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,Q);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new _),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new n,te=new n,ne=new _,re=new y,ae=new y;return A.basisTo2D=function(e,t,r){var a=y.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);n.fromElements(u.z,u.x,u.y,u);var s=A.eastNorthUpToFixedFrame(a,i,re),c=y.inverseTransformation(s,ae),l=y.getRotation(t,ne),f=y.multiplyByMatrix3(c,l,r);return y.multiply(J,f,r),y.setTranslation(r,u,r),r},A.wgs84To2DModelMatrix=function(e,t,r){var a=e.ellipsoid,i=A.eastNorthUpToFixedFrame(t,a,re),o=y.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);n.fromElements(s.z,s.x,s.y,s);var c=y.fromTranslation(s,re);return y.multiply(J,o,r),y.multiply(c,r,r),r},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var p=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new E(r.center,n)};var _=new d,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=_;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=_;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var d=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},E}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];D=t.cartesianToCartographic(a,D),n[r]=D.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function h(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,d=f/c;for(i=1;i<c;i++){var h=n+i*d;l[i]=h}return l[0]=n,l.push(r),l}function E(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function m(e,n,r,a,i,o,c,l){var d=z,h=G;L=f.eastNorthUpToFixedFrame(e,i,L),d=s.multiplyByPointAsVector(L,U,d),d=t.normalize(d,d);var m=E(d,n,e,i);B=u.fromRotationZ(m,B),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(B,q,F),L);var p=b;p[0]=c;for(var _=0;_<l;_++)for(var y=0;y<r.length;y+=3)h=t.fromArray(r,y,h),h=u.multiplyByVector(p,h,h),h=s.multiplyByPoint(L,h,h),a.push(h.x,h.y,h.z);return a}function p(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=m(c,n,r,a,i,o[s/3],u,1)}return a}function _(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function y(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,d,h,E){var p,_=t.angleBetween(t.subtract(n,e,x),t.subtract(r,e,C)),y=i===a.BEVELED?0:Math.ceil(_/o.toRadians(5));p=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,x),_/(y+1),V),H):u.fromQuaternion(l.fromAxisAngle(e,_/(y+1),V),H);var T,R;if(n=t.clone(n,X),y>0)for(var A=E?2:1,v=0;v<y;v++)n=u.multiplyByVector(p,n,n),T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=m(R,T,d,f,c,h,1,A);else T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=m(R,T,d,f,c,h,1,1),r=t.clone(r,X),T=t.subtract(r,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,C),f=m(R,T,d,f,c,h,1,1);return f}var R=[new t,new t],A=new t,v=new t,S=new t,g=new t,N=new t,w=new t,O=new t,M=new t,I=new t,x=new t,C=new t,P={},D=new r,U=new t(-1,0,0),L=new s,F=new s,B=new u,b=u.IDENTITY.clone(),z=new t,G=new n,q=new t,W=new t,V=new l,X=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=d(e,s),f=i._granularity,E=i._cornerType,C=u?_(n,r):y(n,r),D=u?y(n,r):void 0,U=r.height/2,L=r.width/2,F=e.length,B=[],b=u?[]:void 0,z=A,G=v,q=S,W=g,V=N,X=w,H=O,Y=M,k=I,K=e[0],Q=e[1];W=s.geodeticSurfaceNormal(K,W),z=t.subtract(Q,K,z),z=t.normalize(z,z),Y=t.cross(W,z,Y),Y=t.normalize(Y,Y);var J=l[0],$=l[1];u&&(b=m(K,Y,D,b,s,J+U,1,1)),k=t.clone(K,k),K=Q,G=t.negate(z,G);for(var ee,te,ne=1;ne<F-1;ne++){var re=u?2:1;Q=e[ne+1],z=t.subtract(Q,K,z),z=t.normalize(z,z),q=t.add(z,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(z,W),Z);t.subtract(z,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,x))),se=P.angleIsGreaterThanPi(z,G,K,s);se?(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,L,X),X),R[0]=t.clone(k,R[0]),R[1]=t.clone(X,R[1]),ee=h(R,J+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=p(te,Y,C,B,s,ee,1),Y=t.cross(W,z,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,L,H),H),E===a.ROUNDED||E===a.BEVELED?T(V,X,H,E,se,s,B,C,$+U,u):(q=t.negate(q,q),B=m(K,q,C,B,s,$+U,ue,re)),k=t.clone(H,k)):(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,-L,X),X),R[0]=t.clone(k,R[0]),R[1]=t.clone(X,R[1]),ee=h(R,J+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=p(te,Y,C,B,s,ee,1),Y=t.cross(W,z,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,-L,H),H),E===a.ROUNDED||E===a.BEVELED?T(V,X,H,E,se,s,B,C,$+U,u):B=m(K,q,C,B,s,$+U,ue,re),k=t.clone(H,k)),G=t.negate(z,G)}else B=m(k,Y,C,B,s,J+U,1,1),k=K;J=$,$=l[ne+1],K=Q}R[0]=t.clone(k,R[0]),R[1]=t.clone(K,R[1]),ee=h(R,J+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=p(te,Y,C,B,s,ee,1),u&&(b=m(K,Y,D,b,s,$+U,1,1)),F=B.length;var ce=u?F+b.length:F,le=new Float64Array(ce);return le.set(B),u&&le.set(b,F),le},P}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,n,r,a,i,o,u){"use strict";function s(n,i,o,s,c){var l=e.angleBetween(e.subtract(i,n,E),e.subtract(o,n,m)),f=s===t.BEVELED?1:Math.ceil(l/r.toRadians(5))+1,d=3*f,h=new Array(d);h[d-3]=o.x,h[d-2]=o.y,h[d-1]=o.z;var p;p=c?a.fromQuaternion(u.fromAxisAngle(e.negate(n,E),l/f,I),x):a.fromQuaternion(u.fromAxisAngle(n,l/f,I),x);var _=0;i=e.clone(i,E);for(var y=0;y<f;y++)i=a.multiplyByVector(p,i,i),h[_++]=i.x,h[_++]=i.y,h[_++]=i.z;return h}function c(n){var r=T,a=R,i=A,o=n[1];a=e.fromArray(n[1],o.length-3,a),i=e.fromArray(n[0],0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var u=s(r,a,i,t.ROUNDED,!1),c=n.length-1,l=n[c-1];o=n[c],a=e.fromArray(l,l.length-3,a),i=e.fromArray(o,0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var f=s(r,a,i,t.ROUNDED,!1);return[u,f]}function l(t,n,r,a){var i=E;return a?i=e.add(t,n,i):(n=e.negate(n,n),i=e.add(t,n,i)),[i.x,i.y,i.z,r.x,r.y,r.z]}function f(t,n,r,a){for(var i=new Array(t.length),o=new Array(t.length),u=e.multiplyByScalar(n,r,E),s=e.negate(u,m),c=0,l=t.length-1,f=0;f<t.length;f+=3){var d=e.fromArray(t,f,p),h=e.add(d,s,_);i[c++]=h.x,i[c++]=h.y,i[c++]=h.z;var y=e.add(d,u,_);o[l--]=y.z,o[l--]=y.y,o[l--]=y.x}return a.push(i,o),a}function d(e,t){for(var n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}var h={},E=new e,m=new e,p=new e,_=new e,y=[new e,new e],T=new e,R=new e,A=new e,v=new e,S=new e,g=new e,N=new e,w=new e,O=new e,M=new e,I=new u,x=new a;h.addAttribute=function(e,t,r,a){var i=t.x,o=t.y,u=t.z;n(r)&&(e[r]=i,e[r+1]=o,e[r+2]=u),n(a)&&(e[a]=u,e[a-1]=o,e[a-2]=i)};var C=new e,P=new e;return h.computePositions=function(n){var a=n.granularity,u=n.positions,h=n.ellipsoid;u=d(u,h);var m=n.width/2,p=n.cornerType,_=n.saveAttributes,I=T,x=R,D=A,U=v,L=S,F=g,B=N,b=w,z=O,G=M,q=[],W=_?[]:void 0,V=_?[]:void 0,X=u[0],H=u[1];x=e.normalize(e.subtract(H,X,x),x),I=h.geodeticSurfaceNormal(X,I),U=e.normalize(e.cross(I,x,U),U),_&&(W.push(U.x,U.y,U.z),V.push(I.x,I.y,I.z)),B=e.clone(X,B),X=H,D=e.negate(x,D);var Y,k,Z=[],j=u.length;for(k=1;k<j-1;k++){I=h.geodeticSurfaceNormal(X,I),H=u[k+1],x=e.normalize(e.subtract(H,X,x),x), +L=e.normalize(e.add(x,D,L),L);var K=e.multiplyByScalar(I,e.dot(x,I),C);e.subtract(x,K,K),e.normalize(K,K);var Q=e.multiplyByScalar(I,e.dot(D,I),P);e.subtract(D,Q,Q),e.normalize(Q,Q);var J=!r.equalsEpsilon(Math.abs(e.dot(K,Q)),1,r.EPSILON7);if(J){L=e.cross(L,I,L),L=e.cross(I,L,L),L=e.normalize(L,L);var $=m/Math.max(.25,e.magnitude(e.cross(L,D,E))),ee=o.angleIsGreaterThanPi(x,D,X,h);L=e.multiplyByScalar(L,$,L),ee?(b=e.add(X,L,b),G=e.add(b,e.multiplyByScalar(U,m,G),G),z=e.add(b,e.multiplyByScalar(U,2*m,z),z),y[0]=e.clone(B,y[0]),y[1]=e.clone(G,y[1]),Y=i.generateArc({positions:y,granularity:a,ellipsoid:h}),q=f(Y,U,m,q),_&&(W.push(U.x,U.y,U.z),V.push(I.x,I.y,I.z)),F=e.clone(z,F),U=e.normalize(e.cross(I,x,U),U),z=e.add(b,e.multiplyByScalar(U,2*m,z),z),B=e.add(b,e.multiplyByScalar(U,m,B),B),p===t.ROUNDED||p===t.BEVELED?Z.push({leftPositions:s(b,F,z,p,ee)}):Z.push({leftPositions:l(X,e.negate(L,L),z,ee)})):(z=e.add(X,L,z),G=e.add(z,e.negate(e.multiplyByScalar(U,m,G),G),G),b=e.add(z,e.negate(e.multiplyByScalar(U,2*m,b),b),b),y[0]=e.clone(B,y[0]),y[1]=e.clone(G,y[1]),Y=i.generateArc({positions:y,granularity:a,ellipsoid:h}),q=f(Y,U,m,q),_&&(W.push(U.x,U.y,U.z),V.push(I.x,I.y,I.z)),F=e.clone(b,F),U=e.normalize(e.cross(I,x,U),U),b=e.add(z,e.negate(e.multiplyByScalar(U,2*m,b),b),b),B=e.add(z,e.negate(e.multiplyByScalar(U,m,B),B),B),p===t.ROUNDED||p===t.BEVELED?Z.push({rightPositions:s(z,F,b,p,ee)}):Z.push({rightPositions:l(X,L,b,ee)})),D=e.negate(x,D)}X=H}I=h.geodeticSurfaceNormal(X,I),y[0]=e.clone(B,y[0]),y[1]=e.clone(X,y[1]),Y=i.generateArc({positions:y,granularity:a,ellipsoid:h}),q=f(Y,U,m,q),_&&(W.push(U.x,U.y,U.z),V.push(I.x,I.y,I.z));var te;return p===t.ROUNDED&&(te=c(q)),{positions:q,corners:Z,lefts:W,normals:V,endPositions:te}},h}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,d,h,E,m,p;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=d=e[0],f=h=e[1];for(var _=a;_<o;_+=a)E=e[_],m=e[_+1],E<l&&(l=E),m<f&&(f=m),E>d&&(d=E),m>h&&(h=m);p=Math.max(d-l,h-f)}return r(u,c,a,l,f,p),c}function t(e,t,n,r,a){var i,o;if(a===M(e,t,n,r)>0)for(i=t;i<n;i+=r)o=N(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=N(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(w(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(w(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,h){if(e){!h&&f&&d(e,c,l,f);for(var E,m,p=e;e.prev!==e.next;)if(E=e.prev,m=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(m.i/s),w(e),e=m.next,p=m.next;else if(e=m,e===p){h?1===h?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===h&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(p(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),d=E(c,l,t,n,r),h=e.nextZ;h&&h.z<=d;){if(h!==e.prev&&h!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&y(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(h=e.prevZ;h&&h.z>=f;){if(h!==e.prev&&h!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&y(h.prev,h,h.next)>=0)return!1;h=h.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&v(a,i)&&v(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),w(r),w(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&_(s,c)){var l=g(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,d,h=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,d=t(e,s,f,i,!1),d===d.next&&(d.steiner=!0),h.push(m(d));for(h.sort(c),o=0;o<h.length;o++)l(h[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=g(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,d=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&p(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<d||s===d&&r.x>n.x)&&v(r,e)&&(n=r,d=s)),r=r.next;return n}function d(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,h(a)}function h(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function p(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&v(e,t)&&v(t,e)&&S(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function v(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function S(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function g(e,t){var n=new O(e.i,e.x,e.y),r=new O(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function N(e,t,n,r){var a=new O(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function w(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,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(M(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(M(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var d=r[u]*n,h=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[d]-e[E])*(e[h+1]-e[d+1])-(e[d]-e[h])*(e[E+1]-e[d+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,d){"use strict";var h=new n,E=new n,m={};m.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},m.computeWindingOrder2D=function(e){var t=m.computeArea2D(e);return t>0?d.COUNTER_CLOCKWISE:d.CLOCKWISE},m.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var p=new n,_=new n,y=new n,T=new n,R=new n,A=new n,v=new n;return m.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var d,h=o.slice(0),E=t.length,m=new Array(3*E),S=0;for(d=0;d<E;d++){var g=t[d];m[S++]=g.x,m[S++]=g.y,m[S++]=g.z}for(var N=[],w={},O=e.maximumRadius,M=l.chordLength(u,O),I=M*M;h.length>0;){var x,C,P=h.pop(),D=h.pop(),U=h.pop(),L=n.fromArray(m,3*U,p),F=n.fromArray(m,3*D,_),B=n.fromArray(m,3*P,y),b=n.multiplyByScalar(n.normalize(L,T),O,T),z=n.multiplyByScalar(n.normalize(F,R),O,R),G=n.multiplyByScalar(n.normalize(B,A),O,A),q=n.magnitudeSquared(n.subtract(b,z,v)),W=n.magnitudeSquared(n.subtract(z,G,v)),V=n.magnitudeSquared(n.subtract(G,b,v)),X=Math.max(q,W,V);X>I?q===X?(x=Math.min(U,D)+" "+Math.max(U,D),d=w[x],i(d)||(C=n.add(L,F,v),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),d=m.length/3-1,w[x]=d),h.push(U,d,P),h.push(d,D,P)):W===X?(x=Math.min(D,P)+" "+Math.max(D,P),d=w[x],i(d)||(C=n.add(F,B,v),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),d=m.length/3-1,w[x]=d),h.push(D,d,U),h.push(d,P,U)):V===X&&(x=Math.min(P,U)+" "+Math.max(P,U),d=w[x],i(d)||(C=n.add(B,L,v),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),d=m.length/3-1,w[x]=d),h.push(P,d,D),h.push(d,U,D)):(N.push(U),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m})},indices:N,primitiveType:f.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=h,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},m}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/CorridorGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./VertexFormat"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,p,_,y,T,R){"use strict";function A(e,t,r,a,i,u){var s=e.normals,c=e.tangents,l=e.bitangents,f=n.normalize(n.cross(r,t,L),L);u.normal&&o.addAttribute(s,t,a,i),u.tangent&&o.addAttribute(c,f,a,i),u.bitangent&&o.addAttribute(l,r,a,i)}function v(e,t,r){var i,u,c,l=e.positions,f=e.corners,d=e.endPositions,_=e.lefts,y=e.normals,T=new E,R=0,v=0,S=0;for(u=0;u<l.length;u+=2)c=l[u].length-3,R+=c,S+=2*c,v+=l[u+1].length-3;for(R+=3,v+=3,u=0;u<f.length;u++){i=f[u];var g=f[u].leftPositions;s(g)?(c=g.length,R+=c,S+=c):(c=f[u].rightPositions.length,v+=c,S+=c)}var N,w=s(d);w&&(N=d[0].length-3,R+=N,v+=N,N/=3,S+=6*N);var O,M,D,B,b,z,G=R+v,q=new Float64Array(G),W=t.normal?new Float32Array(G):void 0,V=t.tangent?new Float32Array(G):void 0,X=t.bitangent?new Float32Array(G):void 0,H={normals:W,tangents:V,bitangents:X},Y=0,k=G-1,Z=I,j=x,K=N/2,Q=m.createTypedArray(G/3,S),J=0;if(w){z=C,b=P;var $=d[0];for(Z=n.fromArray(y,0,Z),j=n.fromArray(_,0,j),u=0;u<K;u++)z=n.fromArray($,3*(K-1-u),z),b=n.fromArray($,3*(K+u),b),o.addAttribute(q,b,Y),o.addAttribute(q,z,void 0,k),A(H,Z,j,Y,k,t),M=Y/3,B=M+1,O=(k-2)/3,D=O-1,Q[J++]=O,Q[J++]=M,Q[J++]=D,Q[J++]=D,Q[J++]=M,Q[J++]=B,Y+=3,k-=3}var ee=0,te=0,ne=l[ee++],re=l[ee++];q.set(ne,Y),q.set(re,k-re.length+1),j=n.fromArray(_,te,j);var ae,ie;for(c=re.length-3,u=0;u<c;u+=3)ae=r.geodeticSurfaceNormal(n.fromArray(ne,u,L),L),ie=r.geodeticSurfaceNormal(n.fromArray(re,c-u,F),F),Z=n.normalize(n.add(ae,ie,Z),Z),A(H,Z,j,Y,k,t),M=Y/3,B=M+1,O=(k-2)/3,D=O-1,Q[J++]=O,Q[J++]=M,Q[J++]=D,Q[J++]=D,Q[J++]=M,Q[J++]=B,Y+=3,k-=3;for(ae=r.geodeticSurfaceNormal(n.fromArray(ne,c,L),L),ie=r.geodeticSurfaceNormal(n.fromArray(re,c,F),F),Z=n.normalize(n.add(ae,ie,Z),Z),te+=3,u=0;u<f.length;u++){var oe;i=f[u];var ue,se,ce=i.leftPositions,le=i.rightPositions,fe=U,de=C,he=P;if(Z=n.fromArray(y,te,Z),s(ce)){for(A(H,Z,j,void 0,k,t),k-=3,ue=B,se=D,oe=0;oe<ce.length/3;oe++)fe=n.fromArray(ce,3*oe,fe),Q[J++]=ue,Q[J++]=se-oe-1,Q[J++]=se-oe,o.addAttribute(q,fe,void 0,k),de=n.fromArray(q,3*(se-oe-1),de),he=n.fromArray(q,3*ue,he),j=n.normalize(n.subtract(de,he,j),j),A(H,Z,j,void 0,k,t),k-=3;fe=n.fromArray(q,3*ue,fe),de=n.subtract(n.fromArray(q,3*se,de),fe,de),he=n.subtract(n.fromArray(q,3*(se-oe),he),fe,he),j=n.normalize(n.add(de,he,j),j),A(H,Z,j,Y,void 0,t),Y+=3}else{for(A(H,Z,j,Y,void 0,t),Y+=3,ue=D,se=B,oe=0;oe<le.length/3;oe++)fe=n.fromArray(le,3*oe,fe),Q[J++]=ue,Q[J++]=se+oe,Q[J++]=se+oe+1,o.addAttribute(q,fe,Y),de=n.fromArray(q,3*ue,de),he=n.fromArray(q,3*(se+oe),he),j=n.normalize(n.subtract(de,he,j),j),A(H,Z,j,Y,void 0,t),Y+=3;fe=n.fromArray(q,3*ue,fe),de=n.subtract(n.fromArray(q,3*(se+oe),de),fe,de),he=n.subtract(n.fromArray(q,3*se,he),fe,he),j=n.normalize(n.negate(n.add(he,de,j),j),j),A(H,Z,j,void 0,k,t),k-=3}for(ne=l[ee++],re=l[ee++],ne.splice(0,3),re.splice(re.length-3,3),q.set(ne,Y),q.set(re,k-re.length+1),c=re.length-3,te+=3,j=n.fromArray(_,te,j),oe=0;oe<re.length;oe+=3)ae=r.geodeticSurfaceNormal(n.fromArray(ne,oe,L),L),ie=r.geodeticSurfaceNormal(n.fromArray(re,c-oe,F),F),Z=n.normalize(n.add(ae,ie,Z),Z),A(H,Z,j,Y,k,t),B=Y/3,M=B-1,D=(k-2)/3,O=D+1,Q[J++]=O,Q[J++]=M,Q[J++]=D,Q[J++]=D,Q[J++]=M,Q[J++]=B,Y+=3,k-=3;Y-=3,k+=3}if(Z=n.fromArray(y,y.length-3,Z),A(H,Z,j,Y,k,t),w){Y+=3,k-=3,z=C,b=P;var Ee=d[1];for(u=0;u<K;u++)z=n.fromArray(Ee,3*(N-u-1),z),b=n.fromArray(Ee,3*u,b),o.addAttribute(q,z,void 0,k),o.addAttribute(q,b,Y),A(H,Z,j,Y,k,t),B=Y/3,M=B-1,D=(k-2)/3,O=D+1,Q[J++]=O,Q[J++]=M,Q[J++]=D,Q[J++]=D,Q[J++]=M,Q[J++]=B,Y+=3,k-=3}if(T.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:q}),t.st){var me,pe,_e=new Float32Array(G/3*2),ye=0;if(w){R/=3,v/=3;var Te=Math.PI/(N+1);pe=1/(R-N+1),me=1/(v-N+1);var Re,Ae=N/2;for(u=Ae+1;u<N+1;u++)Re=p.PI_OVER_TWO+Te*u,_e[ye++]=me*(1+Math.cos(Re)),_e[ye++]=.5*(1+Math.sin(Re));for(u=1;u<v-N+1;u++)_e[ye++]=u*me,_e[ye++]=0;for(u=N;u>Ae;u--)Re=p.PI_OVER_TWO-u*Te,_e[ye++]=1-me*(1+Math.cos(Re)),_e[ye++]=.5*(1+Math.sin(Re));for(u=Ae;u>0;u--)Re=p.PI_OVER_TWO-Te*u,_e[ye++]=1-pe*(1+Math.cos(Re)),_e[ye++]=.5*(1+Math.sin(Re));for(u=R-N;u>0;u--)_e[ye++]=u*pe,_e[ye++]=1;for(u=1;u<Ae+1;u++)Re=p.PI_OVER_TWO+Te*u,_e[ye++]=pe*(1+Math.cos(Re)),_e[ye++]=.5*(1+Math.sin(Re))}else{for(R/=3,v/=3,pe=1/(R-1),me=1/(v-1),u=0;u<v;u++)_e[ye++]=u*me,_e[ye++]=0;for(u=R;u>0;u--)_e[ye++]=(u-1)*pe,_e[ye++]=1}T.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_e})}return t.normal&&(T.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.normals})),t.tangent&&(T.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.tangents})),t.bitangent&&(T.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:H.bitangents})),{attributes:T,indices:Q}}function S(e,t){if(!(t.normal||t.tangent||t.bitangent||t.st))return e;var r,a,i=e.position.values;(t.normal||t.bitangent)&&(r=e.normal.values,a=e.bitangent.values);var u,s=e.position.values.length/18,c=3*s,l=2*s,f=2*c;if(t.normal||t.bitangent||t.tangent){var d=t.normal?new Float32Array(6*c):void 0,h=t.tangent?new Float32Array(6*c):void 0,E=t.bitangent?new Float32Array(6*c):void 0,m=I,p=x,_=C,y=P,T=D,R=U,A=f;for(u=0;u<c;u+=3){var v=A+f;m=n.fromArray(i,u,m),p=n.fromArray(i,u+c,p),_=n.fromArray(i,(u+3)%c,_),p=n.subtract(p,m,p),_=n.subtract(_,m,_),y=n.normalize(n.cross(p,_,y),y),t.normal&&(o.addAttribute(d,y,v),o.addAttribute(d,y,v+3),o.addAttribute(d,y,A),o.addAttribute(d,y,A+3)),(t.tangent||t.bitangent)&&(R=n.fromArray(r,u,R),t.bitangent&&(o.addAttribute(E,R,v),o.addAttribute(E,R,v+3),o.addAttribute(E,R,A),o.addAttribute(E,R,A+3)),t.tangent&&(T=n.normalize(n.cross(R,y,T),T),o.addAttribute(h,T,v),o.addAttribute(h,T,v+3),o.addAttribute(h,T,A),o.addAttribute(h,T,A+3))),A+=6}if(t.normal){for(d.set(r),u=0;u<c;u+=3)d[u+c]=-r[u],d[u+c+1]=-r[u+1],d[u+c+2]=-r[u+2];e.normal.values=d}else e.normal=void 0;if(t.bitangent?(E.set(a),E.set(a,c),e.bitangent.values=E):e.bitangent=void 0,t.tangent){var S=e.tangent.values;h.set(S),h.set(S,c),e.tangent.values=h}}if(t.st){var g=e.st.values,N=new Float32Array(6*l);N.set(g),N.set(g,l);for(var w=2*l,O=0;O<2;O++){for(N[w++]=g[0],N[w++]=g[1],u=2;u<l;u+=2){var M=g[u],L=g[u+1];N[w++]=M,N[w++]=L,N[w++]=M,N[w++]=L}N[w++]=g[0],N[w++]=g[1]}e.st.values=N}return e}function g(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(var r=3;r<e.length;r+=3){var a=e[r],i=e[r+1],o=e[r+2];n[t++]=a,n[t++]=i,n[t++]=o,n[t++]=a,n[t++]=i,n[t++]=o}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function N(e,t){var n=new R({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),r=e.ellipsoid,i=o.computePositions(e),u=v(i,n,r),s=e.height,c=e.extrudedHeight,l=u.attributes,f=u.indices,d=l.position.values,E=d.length,p=new Float64Array(6*E),y=new Float64Array(E);y.set(d);var T=new Float64Array(4*E);d=_.scaleToGeodeticHeight(d,s,r),T=g(d,0,T),y=_.scaleToGeodeticHeight(y,c,r),T=g(y,2*E,T),p.set(d),p.set(y,E),p.set(T,2*E),l.position.values=p,l=S(l,t);var A=E/3;if(e.shadowVolume){var N=l.normal.values;E=N.length;var w=new Float32Array(6*E);for(O=0;O<E;O++)N[O]=-N[O];w.set(N,E),w=g(N,4*E,w),l.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:w}),t.normal||(l.normal=void 0)}var O,M=f.length,I=A+A,x=m.createTypedArray(p.length/3,2*M+3*I);x.set(f);var C=M;for(O=0;O<M;O+=3){var P=f[O],D=f[O+1],U=f[O+2];x[C++]=U+A,x[C++]=D+A,x[C++]=P+A}var L,F,B,b;for(O=0;O<I;O+=2)L=O+I,F=L+I,B=L+1,b=F+1,x[C++]=L,x[C++]=F,x[C++]=B,x[C++]=B,x[C++]=F,x[C++]=b;return{attributes:l,indices:x}}function w(e,t,r,a,i,o){var u=n.subtract(t,e,B);n.normalize(u,u);var s=r.geodeticSurfaceNormal(e,b),c=n.cross(u,s,B);n.multiplyByScalar(c,a,c);var l=i.latitude,f=i.longitude,d=o.latitude,h=o.longitude;n.add(e,c,b),r.cartesianToCartographic(b,z);var E=z.latitude,m=z.longitude;l=Math.min(l,E),f=Math.min(f,m),d=Math.max(d,E),h=Math.max(h,m),n.subtract(e,c,b),r.cartesianToCartographic(b,z),E=z.latitude,m=z.longitude,l=Math.min(l,E),f=Math.min(f,m),d=Math.max(d,E),h=Math.max(h,m),i.latitude=l,i.longitude=f,o.latitude=d,o.longitude=h}function O(t,r,a,o){var u=e(t,n.equalsEpsilon),s=u.length;if(s<2||a<=0)return new T;var c=.5*a;W.latitude=Number.POSITIVE_INFINITY,W.longitude=Number.POSITIVE_INFINITY,V.latitude=Number.NEGATIVE_INFINITY,V.longitude=Number.NEGATIVE_INFINITY;var l,f;if(o===i.ROUNDED){var d=u[0];n.subtract(d,u[1],G),n.normalize(G,G),n.multiplyByScalar(G,c,G),n.add(d,G,q),r.cartesianToCartographic(q,z),l=z.latitude,f=z.longitude,W.latitude=Math.min(W.latitude,l),W.longitude=Math.min(W.longitude,f),V.latitude=Math.max(V.latitude,l),V.longitude=Math.max(V.longitude,f)}for(var h=0;h<s-1;++h)w(u[h],u[h+1],r,c,W,V);var E=u[s-1];n.subtract(E,u[s-2],G),n.normalize(G,G),n.multiplyByScalar(G,c,G),n.add(E,G,q),w(E,q,r,c,W,V),o===i.ROUNDED&&(r.cartesianToCartographic(q,z),l=z.latitude,f=z.longitude,W.latitude=Math.min(W.latitude,l),W.longitude=Math.min(W.longitude,f),V.latitude=Math.max(V.latitude,l),V.longitude=Math.max(V.longitude,f));var m=new T;return m.north=V.latitude,m.south=W.latitude,m.east=V.longitude,m.west=W.longitude,m}function M(e){e=u(e,u.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=f.clone(u(e.ellipsoid,f.WGS84)),this._vertexFormat=R.clone(u(e.vertexFormat,R.DEFAULT)),this._width=r,this._height=u(e.height,0),this._extrudedHeight=u(e.extrudedHeight,this._height),this._cornerType=u(e.cornerType,i.ROUNDED),this._granularity=u(e.granularity,p.RADIANS_PER_DEGREE),this._shadowVolume=u(e.shadowVolume,!1),this._workerName="createCorridorGeometry",this._rectangle=O(t,this._ellipsoid,r,this._cornerType),this.packedLength=1+t.length*n.packedLength+f.packedLength+R.packedLength+T.packedLength+6}var I=new n,x=new n,C=new n,P=new n,D=new n,U=new n,L=new n,F=new n,B=new n,b=new n,z=new r,G=new n,q=new n,W=new r,V=new r;M.pack=function(e,t,r){r=u(r,0);var a=e._positions,i=a.length;t[r++]=i;for(var o=0;o<i;++o,r+=n.packedLength)n.pack(a[o],t,r);return f.pack(e._ellipsoid,t,r),r+=f.packedLength,R.pack(e._vertexFormat,t,r),r+=R.packedLength,T.pack(e._rectangle,t,r),r+=T.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r++]=e._granularity,t[r]=e._shadowVolume?1:0,t};var X=f.clone(f.UNIT_SPHERE),H=new R,Y=new T,k={positions:void 0,ellipsoid:X,vertexFormat:H,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0};return M.unpack=function(e,t,r){t=u(t,0);for(var a=e[t++],i=new Array(a),o=0;o<a;++o,t+=n.packedLength)i[o]=n.unpack(e,t);var c=f.unpack(e,t,X);t+=f.packedLength;var l=R.unpack(e,t,H);t+=R.packedLength;var d=T.unpack(e,t,Y);t+=T.packedLength;var h=e[t++],E=e[t++],m=e[t++],p=e[t++],_=e[t++],y=1===e[t];return s(r)?(r._positions=i,r._ellipsoid=f.clone(c,r._ellipsoid),r._vertexFormat=R.clone(l,r._vertexFormat),r._width=h,r._height=E,r._extrudedHeight=m,r._cornerType=p,r._granularity=_,r._rectangle=T.clone(d),r._shadowVolume=y,r):(k.positions=i,k.width=h,k.height=E,k.extrudedHeight=m,k.cornerType=p,k.granularity=_,k.shadowVolume=y,new M(k))},M.createGeometry=function(r){var a=r._positions,i=r._height,u=r._width,s=r._extrudedHeight,c=i!==s,l=e(a,n.equalsEpsilon);if(!(l.length<2||u<=0)){var f,h=r._ellipsoid,E=r._vertexFormat,m={ellipsoid:h,positions:l,width:u,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!0};if(c){var p=Math.max(i,s);s=Math.min(i,s),i=p,m.height=i,m.extrudedHeight=s,m.shadowVolume=r._shadowVolume,f=N(m,E)}else{var T=o.computePositions(m);f=v(T,E,h),f.attributes.position.values=_.scaleToGeodeticHeight(f.attributes.position.values,i,h)}var R=f.attributes,A=t.fromVertices(R.position.values,void 0,3);return E.position||(f.attributes.position.values=void 0),new d({attributes:R,indices:f.indices,primitiveType:y.TRIANGLES,boundingSphere:A})}},M.createShadowVolume=function(e,t,n){var r=e._granularity,a=e._ellipsoid,i=t(r,a),o=n(r,a);return new M({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:a,granularity:r,extrudedHeight:i,height:o,vertexFormat:R.POSITION_ONLY,shadowVolume:!0})},c(M.prototype,{rectangle:{get:function(){return this._rectangle}}}),M}),define("Workers/createCorridorGeometry",["../Core/CorridorGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,n){"use strict";function r(r,a){return t(a)&&(r=e.unpack(r,a)),r._ellipsoid=n.clone(r._ellipsoid),e.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createCorridorOutlineGeometry.js b/engines/Cesium/Workers/createCorridorOutlineGeometry.js index a4b12f9..b69bc93 100644 --- a/engines/Cesium/Workers/createCorridorOutlineGeometry.js +++ b/engines/Cesium/Workers/createCorridorOutlineGeometry.js @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,p=a.z,m=l*l*d*d,_=f*f*E*E,y=h*h*p*p,T=m+_+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,g=o;g.x=A.x*S*2,g.y=A.y*v*2,g.z=A.z*N*2;var M,O,w,I,x,C,P,D,U,L,F,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(g)),z=0;do{B-=z,w=1/(1+B*S),I=1/(1+B*v),x=1/(1+B*N),C=w*w,P=I*I,D=x*x,U=C*w,L=P*I,F=D*x,M=m*C+_*P+y*D-1,O=m*U*S+_*L*v+y*F*N;var b=-2*O;z=M/b}while(Math.abs(M)>r.EPSILON12);return t(c)?(c.x=l*w,c.y=f*I,c.z=h*x,c):new e(l*w,f*I,h*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,p=n(r)?r.oneOverRadiiSquared:h,m=n(r)?r._centerToleranceSquared:d,_=o(t,E,p,m,c);if(n(_)){var y=e.multiplyComponents(_,p,s);y=e.normalize(y,y);var T=e.subtract(t,_,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,p=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(p[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(p[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],h=p[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,m=e[s.getElementIndex(h,h)],_=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(h,f)],T=(m-_)/2/y;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=n-u-f+d,p=2*(a-h),m=2*(i+l),_=2*(a+h),y=-n+u-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+d;return r(t)?(t[0]=E,t[1]=_,t[2]=R,t[3]=p,t[4]=y,t[5]=A,t[6]=m,t[7]=T,t[8]=S,t):new s(E,p,m,_,y,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,E=i*a+c*o*u,p=-o*i+i*o*u,m=-o,_=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=m,t[3]=f,t[4]=E,t[5]=_,t[6]=h,t[7]=p,t[8]=y,t):new s(l,f,h,d,E,p,m,_,y)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],p=[2,2,1],m=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)f(d,m),s.transpose(m,_),s.multiply(d,m,d),s.multiply(_,d,d),s.multiply(h,m,h),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){ -this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,h,d,E,p,m){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(p,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(m,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,p=t.y*t.w,m=t.z*t.z,_=t.z*t.w,y=t.w*t.w,T=s-d-m+y,R=2*(c-_),A=2*(f+p),S=2*(c+_),v=-s+d-m+y,N=2*(E-h),g=2*(f-p),M=2*(E+h),O=-s-d+m+y;return r[0]=T*i,r[1]=S*i,r[2]=g*i,r[3]=0,r[4]=R*o,r[5]=v*o,r[6]=M*o,r[7]=0,r[8]=A*u,r[9]=N*u,r[10]=O*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,E=f.x,p=f.y,m=f.z,_=d.x,y=d.y,T=d.z,R=r.x,A=r.y,S=r.z,v=u*-R+s*-A+c*-S,N=_*-R+y*-A+T*-S,g=E*R+p*A+m*S;return a(n)?(n[0]=u,n[1]=_,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-p,n[7]=0,n[8]=c,n[9]=T,n[10]=-m,n[11]=0,n[12]=v,n[13]=N,n[14]=g,n[15]=1,n):new l(u,s,c,v,_,y,T,N,-E,-p,-m,g,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,E=f,p=i+c,m=o+l,_=t+f,y=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=p,a[13]=m,a[14]=_,a[15]=y,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],p=e[12],m=e[13],_=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],g=t[6],M=t[7],O=t[8],w=t[9],I=t[10],x=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=r*T+u*R+f*A+p*S,F=a*T+s*R+h*A+m*S,B=i*T+c*R+d*A+_*S,z=o*T+l*R+E*A+y*S,b=r*v+u*N+f*g+p*M,G=a*v+s*N+h*g+m*M,q=i*v+c*N+d*g+_*M,W=o*v+l*N+E*g+y*M,X=r*O+u*w+f*I+p*x,V=a*O+s*w+h*I+m*x,H=i*O+c*w+d*I+_*x,Y=o*O+l*w+E*I+y*x,k=r*C+u*P+f*D+p*U,Z=a*C+s*P+h*D+m*U,j=i*C+c*P+d*D+_*U,K=o*C+l*P+E*D+y*U;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],p=t[0],m=t[1],_=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],g=t[13],M=t[14],O=r*p+o*m+c*_,w=a*p+u*m+l*_,I=i*p+s*m+f*_,x=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,D=r*A+o*S+c*v,U=a*A+u*S+l*v,L=i*A+s*S+f*v,F=r*N+o*g+c*M+h,B=a*N+u*g+l*M+d,z=i*N+s*g+f*M+E;return n[0]=O,n[1]=w,n[2]=I,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],p=t[3],m=t[4],_=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,S=a*h+u*d+l*E,v=i*h+s*d+f*E,N=r*p+o*m+c*_,g=a*p+u*m+l*_,M=i*p+s*m+f*_,O=r*y+o*T+c*R,w=a*y+u*T+l*R,I=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=g,n[6]=M,n[7]=0,n[8]=O,n[9]=w,n[10]=I,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var m=new e;l.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var _=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,_),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],E=e[13],p=e[2],m=e[6],A=e[10],S=e[14],v=e[3],N=e[7],g=e[11],M=e[15],O=A*M,w=S*g,I=m*M,x=S*N,C=m*g,P=A*N,D=p*M,U=S*v,L=p*g,F=A*v,B=p*N,z=m*v,b=O*h+x*d+C*E-(w*h+I*d+P*E),G=w*f+D*d+F*E-(O*f+U*d+L*E),q=I*f+U*h+B*E-(x*f+D*h+z*E),W=P*f+L*h+z*d-(C*f+F*h+B*d),X=w*a+I*i+P*o-(O*a+x*i+C*o),V=O*r+U*i+L*o-(w*r+D*i+F*o),H=x*r+D*a+z*o-(I*r+U*a+B*o),Y=C*r+F*a+B*i-(P*r+L*a+z*i);O=i*E,w=o*d,I=a*E,x=o*h,C=a*d,P=i*h,D=r*E,U=o*f,L=r*d,F=i*f,B=r*h,z=a*f;var k=O*N+x*g+C*M-(w*N+I*g+P*M),Z=w*v+D*g+F*M-(O*v+U*g+L*M),j=I*v+U*N+B*M-(x*v+D*N+z*M),K=P*v+L*N+z*g-(C*v+F*N+B*g),Q=I*A+P*S+w*m-(C*S+O*m+x*A),J=L*S+O*p+U*A-(D*A+F*S+w*p),$=D*m+z*S+x*p-(B*S+I*p+U*m),ee=B*A+C*p+F*m-(L*m+z*A+P*p),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,p=-i*f-o*h-u*d,m=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=p,t[14]=m,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var p=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,E=e.west,p=c;p.height=a,p.longitude=E,p.latitude=f,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.latitude=h,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=E,o[l]=t.cartographicToCartesian(p,o[l]),l++,f<0?p.latitude=f:h>0?p.latitude=h:p.latitude=0;for(var m=1;m<8;++m)p.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=t.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=E,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=t.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,p=new e,m=new e,_=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,p),s=e.clone(r,m),c=e.clone(r,_),l=e.clone(r,y),f=t.length,g=1;g<f;g++){e.clone(t[g],r);var M=r.x,O=r.y,w=r.z;M<i.x&&e.clone(r,i),M>s.x&&e.clone(r,s),O<o.y&&e.clone(r,o),O>c.y&&e.clone(r,c),w<u.z&&e.clone(r,u),w>l.z&&e.clone(r,l)}var I=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,D=s,U=I;x>U&&(U=x,P=o,D=c),C>U&&(U=C,P=u,D=l);var L=A;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var F=e.magnitudeSquared(e.subtract(D,L,R)),B=Math.sqrt(F),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,R),.5,N),q=0;for(g=0;g<f;g++){e.clone(t[g],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var V=Math.sqrt(X);B=.5*(B+V),F=B*B;var H=V-B;L.x=(B*L.x+H*r.x)/V,L.y=(B*L.y+H*r.y)/V,L.z=(B*L.z+H*r.z)/V}}return B<q?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var g=new o,M=new e,O=new e,w=new t,I=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,g),f.southwest(t,w),w.height=i,f.northeast(t,I),I.height=o;var s=n.project(w,M),c=n.project(I,O),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*d,p.z=s.z+.5*E,u};var x=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,p),f=e.clone(u,m),g=e.clone(u,_),M=e.clone(u,y),O=t.length,w=0;w<O;w+=i){var I=t[w]+n.x,x=t[w+1]+n.y,C=t[w+2]+n.z;u.x=I,u.y=x,u.z=C,I<s.x&&e.clone(u,s),I>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>g.y&&e.clone(u,g),C<l.z&&e.clone(u,l),C>M.z&&e.clone(u,M)}var P=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(g,c,R)),U=e.magnitudeSquared(e.subtract(M,l,R)),L=s,F=f,B=P;D>B&&(B=D,L=c,F=g),U>B&&(B=U,L=l,F=M);var z=A;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=g.y,W.z=M.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),V=0;for(w=0;w<O;w+=i){u.x=t[w]+n.x,u.y=t[w+1]+n.y,u.z=t[w+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);G=.5*(G+k),b=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<V?(e.clone(z,o.center),o.radius=G):(e.clone(X,o.center),o.radius=V),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,p),c=e.clone(i,m),l=e.clone(i,_),f=e.clone(i,y),g=t.length,M=0;M<g;M+=3){var O=t[M]+n[M],w=t[M+1]+n[M+1],I=t[M+2]+n[M+2];i.x=O,i.y=w,i.z=I,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),w<u.y&&e.clone(i,u),w>l.y&&e.clone(i,l),I<s.z&&e.clone(i,s),I>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),D=o,U=c,L=x;C>L&&(L=C,D=u,U=l),P>L&&(L=P,D=s,U=f);var F=A;F.x=.5*(D.x+U.x),F.y=.5*(D.y+U.y),F.z=.5*(D.z+U.z);var B=e.magnitudeSquared(e.subtract(U,F,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(M=0;M<g;M+=3){i.x=t[M]+n[M],i.y=t[M+1]+n[M+1],i.z=t[M+2]+n[M+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;F.x=(z*F.x+Y*i.x)/H,F.y=(z*F.y+Y*i.y)/H,F.z=(z*F.z+Y*i.z)/H}}return z<W?(e.clone(F,r.center),r.radius=z):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,U=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,D),u=c.getColumn(r,2,U),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var B=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),d=e.negate(c,X),E=Y,p=E[0];e.add(s,l,p),e.add(p,c,p),p=E[1],e.add(s,l,p),e.add(p,d,p),p=E[2],e.add(s,f,p),e.add(p,d,p),p=E[3],e.add(s,f,p),e.add(p,c,p),e.negate(s,s),p=E[4],e.add(s,l,p),e.add(p,c,p),p=E[5],e.add(s,l,p),e.add(p,d,p),p=E[6],e.add(s,f,p),e.add(p,d,p),p=E[7],e.add(s,f,p),e.add(p,c,p);for(var m=E.length,_=0;_<m;++_){var y=E[_];e.add(o,y,y);var T=i.cartesianToCartographic(y,H);n.project(T,y)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(v)&&(v=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(g=!0,M=r(e[1]),M.isNightly=!!e[2])}return g}function c(){return s()&&M; -}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,w=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,w=r(e[1])))}return O}function f(){return l()&&w}function h(){if(!t(I)){I=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(I=!0,x=r(e[1]))}return I}function d(){return h()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function p(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function m(){return E()&&P}function _(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,g,M,O,w,I,x,C,P,D,U,L,F,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:y,imageRenderingValue:T};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,E=Math.sqrt(d),p=t/4,m=p*p,_=m*p,y=m*m,T=1+p-3*m/4+5*_/4-175*y/64,R=1-p+15*m/8-35*_/8,A=1-3*p+35*m/4,S=1-5*p,v=T*l-R*Math.sin(2*l)*p/2-A*Math.sin(4*l)*m/16-S*Math.sin(6*l)*_/48-5*Math.sin(8*l)*y/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=d,N.cosineAlpha=E,N.u2Over4=p,N.u4Over16=m,N.u6Over64=_,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,E=(t-n)/t,p=i-r,m=Math.atan((1-E)*Math.tan(a)),_=Math.atan((1-E)*Math.tan(o)),y=Math.cos(m),T=Math.sin(m),R=Math.cos(_),A=Math.sin(_),S=y*R,v=y*A,N=T*A,g=T*R,M=p,O=u.TWO_PI,w=Math.cos(M),I=Math.sin(M);do{w=Math.cos(M),I=Math.sin(M);var x=v-g*w;f=Math.sqrt(R*R*I*I+x*x),c=N+S*w,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*I/f,h=1-C*C),O=M,d=c-2*N/h,isNaN(d)&&(d=0),M=p+l(E,C,h,s,f,c,d)}while(Math.abs(M-O)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,U=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,F=U*f*(d+U*(c*(2*L-1)-U*d*(4*f*f-3)*(4*L-3)/6)/4),B=n*D*(s-F),z=Math.atan2(R*I,v-g*w),b=Math.atan2(y*I,v*w-g);e._distance=B,e._startHeading=z,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,p),E),e.normalize(i.cartographicToCartesian(a,p),p);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var E=new e,p=new e;return a(d.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}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),E=i*i,p=i*E,m=a.u8Over256,_=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*p*m*o/3+i*(1-_+7*T/4-15*y/4+579*m/64-(T-15*y/4+187*m/16)*o-(5*y/4-115*m/16)*u-29*m*s/16)+(_/2-T+71*y/32-85*m/16)*c+(5*T/16-5*y/4+383*m/96)*f-E*((y-11*m/2)*c+5*m*f/2)+(29*y/96-29*m/16)*h+539*m*d/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var v=Math.cos(2*a.sigma+R),N=Math.sin(R),g=Math.cos(R),M=a.cosineU*g,O=a.sineU*N,w=Math.atan2(N*a.sineHeading,M-O*a.cosineHeading),I=w-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,g,v);return r(n)?(n.longitude=this._start.longitude+I,n.latitude=S,n.height=0,n):new t(this._start.longitude+I,S,0)},d}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,p=o*c-u*s,m=u*c-d,_=4*E*m-p*p;if(_<0){var y,T,R;h*f>=l*d?(y=o,T=E,R=-2*u*E+o*p):(y=c,T=m,R=-c*p+2*s*m);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-_);i=-R+S;var v=i/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),g=i===S?-N:-T/N;return a=T<=0?N+g:-R/(N*N+g*g+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var M=E,O=-2*u*E+o*p,w=m,I=-c*p+2*s*m,x=Math.sqrt(_),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-M);var D=Math.cos(P);i=a*D;var U=a*(-D/2-C*Math.sin(P)),L=i+U>2*u?i-u:U-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*x,-I)/3),a=2*Math.sqrt(-w),D=Math.cos(P),i=a*D,U=a*(-D/2-C*Math.sin(P));var z=-c,b=i+U<2*s?i+s:U+s,G=z/b,q=F*b,W=-L*b-F*z,X=L*z,V=(s*W-u*X)/(-u*W+s*q);return B<=V?B<=G?V<=G?[B,V,G]:[B,G,V]:[G,B,V]:B<=G?[V,B,G]:V<=G?[V,G,B]:[G,V,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var p,m=E[0],_=E[1];if(m>=0&&_>=0){var y=Math.sqrt(m),T=Math.sqrt(_);return[h-T,h-y,h+y,h+T]}if(m>=0&&_<0)return p=Math.sqrt(m),[h-p,h+p];if(m<0&&_>=0)return p=Math.sqrt(_),[h-p,h+p]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,p,m=d[0],_=a-m,y=_*_,T=t/2,R=_/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*m,N=c+4*Math.abs(m);if(m<0||A*N<v*S){var g=Math.sqrt(v);E=g/2,p=0===g?0:(t*R-i)/g}else{var M=Math.sqrt(A);E=0===M?0:(t*R-i)/M,p=M/2}var O,w;0===T&&0===E?(O=0,w=0):n.sign(T)===n.sign(E)?(O=T+E,w=m/O):(w=T-E,O=m/w);var I,x;0===R&&0===p?(I=0,x=0):n.sign(R)===n.sign(p)?(I=R+p,x=o/I):(x=R-p,I=o/x);var C=r.computeRealRoots(1,O,I),P=r.computeRealRoots(1,w,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,p=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return p},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),h=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,p=f(h,d,E,S);if(r(p))return a.start=p.root0,a.stop=p.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,h=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,p=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),m=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,_=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===_){if(l=s.computeRealRoots(E,p,m),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-v)),T.push(new e(a,i*S,i*v))}return T}var N=y*y,g=_*_,M=E*E,O=y*_,w=M+g,I=2*(p*E+O),x=2*m*E+p*p-g+N,C=2*(m*p-O),P=m*m-N;if(0===w&&0===I&&0===x&&0===C)return T;l=c.computeRealRoots(w,I,x,C,P);var D=l.length;if(0===D)return T;for(var U=0;U<D;++U){var L,F=l[U],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=o.sign(E)===o.sign(m)?d(E*B+m,p*F,o.EPSILON12):o.sign(m)===o.sign(p*F)?d(E*B,p*F+m,o.EPSILON12):d(E*B+p*F,m,o.EPSILON12);var G=d(_*F,y,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++U):T.push(new e(a,i*F,i*b))}return T}var p={};p.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var m=new e,_=new e,y=new e,T=new e,R=new e;p.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,p=e.subtract(a,r,m),A=e.subtract(i,r,_),S=e.cross(E,A,y),v=e.dot(p,S);if(u){if(v<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,p,R),f=e.dot(E,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<o.EPSILON6)return;var N=1/v;if(s=e.subtract(d,r,T),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,p,R),f=e.dot(E,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},p.rayTriangle=function(t,n,a,i,o,u){var s=p.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;p.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};p.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new l;p.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,g=new e;p.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,g),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var E=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var p=s/a,m=r/s;return p<m?new i(p,m):{start:m,stop:p}}var _=Math.sqrt(r/a);return new i(_,_)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var M=new e,O=new e,w=new e,I=new e,x=new e,C=new u,P=new u,D=new u,U=new u,L=new u,F=new u,B=new u,z=new e,b=new e,G=new t;p.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,M);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,M),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,I),d=e.normalize(e.cross(h,f,O),O),p=e.normalize(e.cross(f,d,w),w),m=C;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=p.x,m[7]=p.y,m[8]=p.z;var _=u.transpose(m,P),y=u.fromScale(n.radii,D),T=u.fromScale(n.oneOverRadii,U),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,v=u.multiply(u.multiply(_,T,F),R,F),N=u.multiply(u.multiply(v,y,B),m,B),g=u.multiplyByVector(v,a,x),q=E(N,e.negate(g,M),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(y,u.multiplyByVector(m,q[H],z),z);var Y=e.normalize(e.subtract(A,a,I),I),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,G);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,I))*Math.sqrt(1-V*V),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e); -}};var q=new e;return p.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},p.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return p.lineSegmentPlane(t,n,a,f),p.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(n,r,a,f),p.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(r,t,a,f),p.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(n,t,a,f),p.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(r,n,a,f),p.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,r,a,f),p.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,w),l=a.scaleToGeodeticSurface(n,I),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,g),p=a.cartesianToCartographic(l,M),m=h(f,i,o);x.setEndPoints(d,p);var _=x.surfaceDistance/f,y=s;d.height=i;var T=a.cartographicToCartesian(d,O);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=x.interpolateUsingSurfaceDistance(R*_,M);A.height=m[R],T=a.cartographicToCartesian(A,O),e.pack(T,u,y),y+=3}return y}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var p=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,p).height}return r};var m=new l,_=new e,y=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],g=new t,M=new t,O=new e,w=new e,I=new e,x=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,m),c=l.multiplyByPoint(s,e.ZERO,_),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),d=f.fromPointNormal(c,h,T),E=l.multiplyByPointAsVector(s,e.UNIT_X,R),p=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var g=i[0],M=t.length,O=1;O<M;++O){var w=t[O];if(f.getPointDistance(p,g)<0||f.getPointDistance(p,w)<0){var I=u.lineSegmentPlane(g,w,d,S);if(r(I)){var x=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,g)<0&&e.negate(x,x),i.push(e.add(I,x,new e)),o.push(N+1),e.negate(x,x),i.push(e.add(I,x,new e)),N=1}}i.push(e.clone(t[O])),N++,g=w}o.push(N)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],w);if(l=f?l[0]:l,0!==l){var p=u.geodeticSurfaceNormal(h,O);e.multiplyByScalar(p,l,p),e.add(h,p,h)}return[h.x,h.y,h.z]}var m=t.minDistance;if(!r(m)){var _=n(t.granularity,c.RADIANS_PER_DEGREE);m=c.chordLength(_,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=E.numberOfPoints(a[y],a[y+1],m);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=a[y],M=a[y+1],I=f?l[y]:l,x=f?l[y+1]:l;S=d(v,M,m,u,I,x,A,S)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,g);P.height=f?l[o-1]:l;var D=u.cartographicToCartesian(P,O);return e.pack(D,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,p=d.y,m=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(p,o),c=Math.max(p,c),u=Math.min(m,u),l=Math.max(m,l)}var _=r.minimum;_.x=a,_.y=o,_.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(_,y,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return p(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=_,p(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return m(2,arguments),e(t,function(t){function u(e){p(e)}function s(e){E(e)}var c,l,f,h,d,E,p,m,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(m=d.progress,p=function(e){h.push(e),--l||(E=p=_,d.reject(h))},E=function(e){f.push(e),--c||(E=p=_,d.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,m);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return m(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function p(e,t){for(var n,r=0;n=e[r++];)n(t)}function m(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function _(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,p,m,_;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,_=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(_),y,c,f,R,S);case"c":return u(String.fromCharCode(+_),y,c,f,R);case"b":return o(_,2,A,y,c,f,R);case"o":return o(_,8,A,y,c,f,R);case"x":return o(_,16,A,y,c,f,R);case"X":return o(_,16,A,y,c,f,R).toUpperCase();case"u":return o(_,10,A,y,c,f,R);case"i":case"d":return d=+_||0,d=Math.round(d-d%1),E=d<0?"-":T,_=E+a(String(Math.abs(d)),f,"0",!1),i(_,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+_,E=d<0?"-":T,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],_=E+Math.abs(d)[p](f),i(_,E,y,c,R)[m]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return p.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=p.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=p.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}p.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=p.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return p.addSeconds(e,-r[0].offset,n);if(a>=r.length)return p.addSeconds(e,-r[a-1].offset,n);var i=p.secondsDifference(r[a].julianDate,e);return 0===i?p.addSeconds(e,-r[a].offset,n):i<=1?void 0:p.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function p(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var m=new i,_=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,g=/([Z+\-])?(\d{2})?:?(\d{2})?$/,M=/^(\d{2})(\.\d+)?/.source+g.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+g.source,w=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+g.source;p.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new p(n[0],n[1],c.UTC)},p.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,m=0,T=0,g=0,I=u[0],x=u[1];if(u=I.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=I.match(A),null!==u)n=+u[1],s=+u[2];else if(u=I.match(R),null!==u)n=+u[1];else{var C;if(u=I.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=I.match(v),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,U=new Date(Date.UTC(n,0,4));C=7*P+D-U.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(x)){u=x.match(w),null!==u?(h=+u[1],m=+u[2],T=+u[3],g=1e3*+(u[4]||0),L=5):(u=x.match(O),null!==u?(h=+u[1],m=+u[2],T=60*+(u[3]||0),L=4):(u=x.match(M),null!==u&&(h=+u[1],m=60*+(u[2]||0),L=3)));var F=u[L],B=+u[L+1],z=+(u[L+2]||0);switch(F){case"+":h-=B,m-=z;break;case"-":h+=B,m+=z;break;case"Z":break;default:m+=new Date(Date.UTC(n,s-1,l,h,m)).getTimezoneOffset()}}else m+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;m>=60;)m-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?y:_[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:_[s-1];for(;m<0;)m+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:_[s-1],l+=a;var G=E(n,s,l,h,m,T,g);return r(t)?(d(G[0],G[1],t),f(t)):t=new p(G[0],G[1],c.UTC),b&&p.addSeconds(t,1,t),t},p.now=function(e){return p.fromDate(new Date,e)};var I=new p(0,0,c.TAI);return p.toGregorianDate=function(e,t){var n=!1,a=h(e,I);r(a)||(p.addSeconds(e,-1,I),a=h(I,I),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var m=d+2-12*c|0,_=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=_,t.month=m,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(_,m,E,y,R,A,S,n)},p.toDate=function(e){var t=p.toGregorianDate(e,m),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},p.toIso8601=function(t,n){var a,i=p.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},p.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new p(e.dayNumber,e.secondsOfDay,c.TAI)},p.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},p.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},p.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(p.secondsDifference(e,t))<=n},p.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},p.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},p.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},p.computeTaiMinusUtc=function(e){T.julianDate=e;var n=p.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},p.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},p.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},p.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},p.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},p.lessThan=function(e,t){return p.compare(e,t)<0},p.lessThanOrEquals=function(e,t){return p.compare(e,t)<=0},p.greaterThan=function(e,t){return p.compare(e,t)>0},p.greaterThanOrEquals=function(e,t){return p.compare(e,t)>=0},p.prototype.clone=function(e){return p.clone(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.equalsEpsilon=function(e,t){return p.equalsEpsilon(this,e,t)},p.prototype.toString=function(){return p.toIso8601(this)},p.leapSeconds=[new u(new p(2441317,43210,c.TAI),10),new u(new p(2441499,43211,c.TAI),11),new u(new p(2441683,43212,c.TAI),12),new u(new p(2442048,43213,c.TAI),13),new u(new p(2442413,43214,c.TAI),14),new u(new p(2442778,43215,c.TAI),15),new u(new p(2443144,43216,c.TAI),16),new u(new p(2443509,43217,c.TAI),17),new u(new p(2443874,43218,c.TAI),18),new u(new p(2444239,43219,c.TAI),19),new u(new p(2444786,43220,c.TAI),20),new u(new p(2445151,43221,c.TAI),21),new u(new p(2445516,43222,c.TAI),22),new u(new p(2446247,43223,c.TAI),23),new u(new p(2447161,43224,c.TAI),24),new u(new p(2447892,43225,c.TAI),25),new u(new p(2448257,43226,c.TAI),26),new u(new p(2448804,43227,c.TAI),27),new u(new p(2449169,43228,c.TAI),28),new u(new p(2449534,43229,c.TAI),29),new u(new p(2450083,43230,c.TAI),30),new u(new p(2450630,43231,c.TAI),31),new u(new p(2451179,43232,c.TAI),32),new u(new p(2453736,43233,c.TAI),33),new u(new p(2454832,43234,c.TAI),34),new u(new p(2456109,43235,c.TAI),35),new u(new p(2457204,43236,c.TAI),36),new u(new p(2457754,43237,c.TAI),37)],p}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var p in s)s.hasOwnProperty(p)&&E.setRequestHeader(p,s[p]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("taiMinusUtcSeconds"); -if(a<0||i<0||s<0||c<0||h<0||E<0||p<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var m=e._samples=n.samples,_=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=p,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=m.length;R<A;R+=e._columnCount){var S=m[R+a],v=m[R+p],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,g=new o(N,v,f.TAI);if(_.push(g),T){if(v!==y&&r(y)){var M=o.leapSeconds,O=t(M,g,d);if(O<0){var w=new u(g,v);M.splice(~O,0,w)}}y=v}}}function p(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function m(e,t,n){return t+e*(n-t)}function _(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return p(e,n,a,s,u),u;if(r.equals(l))return p(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],_=n[d+e._ut1MinusUtcSecondsColumn],y=_-E;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=_:_-=R-T)}return u.xPoleWander=m(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,E,_),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),p=E||o.greaterThanOrEquals(h,e);if(d&&p)return s=u,!E&&h.equals(e)&&++s,l=s+1,_(this,i,this._samples,e,s,l,n),n}var m=t(i,e,o.compare,this._dateColumn);return m>=0?(m<i.length-1&&i[m+1].equals(e)&&++m,s=m,l=m):(l=~m,s=l-1,s<0&&(s=0)),this._lastIndex=s,_(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,p,m=i-s*this._stepSizeDays,_=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)_[E]=m-R[E];for(E=0;E<=u;++E){for(T[E]=1,p=0;p<=u;++p)p!==E&&(T[E]*=_[p]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=h,a):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],p=s+f+E;if(p>0)n=Math.sqrt(p+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var m=h,_=0;f>s&&(_=1),E>s&&E>f&&(_=2);var y=m[_],T=m[y];n=Math.sqrt(e[c.getElementIndex(_,_)]-e[c.getElementIndex(y,y)]-e[c.getElementIndex(T,T)]+1);var R=d;R[_]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,y)]-e[c.getElementIndex(y,T)])*n,R[y]=(e[c.getElementIndex(y,_)]+e[c.getElementIndex(_,y)])*n,R[T]=(e[c.getElementIndex(T,_)]+e[c.getElementIndex(_,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,p=new l,m=new l,_=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),_=l.fromAxisAngle(e.UNIT_X,o.roll,E),m=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(m,_,m),p=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(p,i,i)};var y=new e,T=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,y);var u=l.computeAngle(R);r[o]=y.x*u,r[o+1]=y.y*u,r[o+2]=y.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var v=new l;l.lerp=function(e,t,n,r){return v=l.multiplyByScalar(t,n,v),r=l.multiplyByScalar(e,1-n,r),l.add(v,r,r)};var N=new l,g=new l,M=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return g=l.multiplyByScalar(e,Math.sin((1-n)*o),g),M=l.multiplyByScalar(i,Math.sin(n*o),M),r=l.add(g,M,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var O=new e,w=new e,I=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,I);l.multiply(i,r,x);var o=l.log(x,O);l.multiply(i,t,x);var u=l.log(x,w);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,I),l.multiply(n,I,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,I),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;D[B]=1/(z*b),U[B]=z/b}return D[7]=P/136,U[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)L[f]=(D[f]*s-U[f])*o,F[f]=(D[f]*c-U[f])*o;var h=a*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),d=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,h,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,I),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p,m,_,y,T,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},v={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},N={},g={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},M=new n,O=new n,w=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(N[i])?r=N[i]:(r=function(r,i,s){if(u(s)||(s=new y),m.equalsEpsilon(r.x,0,m.EPSILON14)&&m.equalsEpsilon(r.y,0,m.EPSILON14)){var c=m.sign(r.z);n.unpack(v[e],0,M),"east"!==e&&"west"!==e&&n.multiplyByScalar(M,c,M),n.unpack(v[t],0,O),"east"!==t&&"west"!==t&&n.multiplyByScalar(O,c,O),n.unpack(v[a],0,w),"east"!==a&&"west"!==a&&n.multiplyByScalar(w,c,w)}else{i=o(i,h.WGS84),i.geodeticSurfaceNormal(r,g.up);var l=g.up,f=g.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,g.east),n.cross(l,f,g.north),n.multiplyByScalar(g.up,-1,g.down),n.multiplyByScalar(g.east,-1,g.west),n.multiplyByScalar(g.north,-1,g.south),M=g[e],O=g[t],w=g[a]}return s[0]=M.x,s[1]=M.y,s[2]=M.z,s[3]=0,s[4]=O.x,s[5]=O.y,s[6]=O.z,s[7]=0,s[8]=w.x,s[9]=w.y,s[10]=w.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},N[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var I=new T,x=new n(1,1,1),C=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof y&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,I),c=y.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),y.multiply(i,c,i)};var P=new y,D=new _;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=y.getRotation(i,D);return T.fromRotationMatrix(o,a)};var U=24110.54841,L=8640184.812866,F=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,G=m.TWO_PI/86400,q=new p;A.computeTemeToPseudoFixedMatrix=function(e,t){q=p.addSeconds(e,-p.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=U+n*(L+n*(F+n*B)),s=o*G%m.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new _(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new _);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return _.transpose(n,t)};var V=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new _,k=new _;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new _);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=_.fromRotationZ(-i.s,k),h=_.multiply(l,f,Y),d=e.dayNumber,E=e.secondsOfDay-p.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=d-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*m.TWO_PI;var v=_.fromRotationZ(S,k),N=_.multiply(h,v,Y),g=Math.cos(n.xPoleWander),M=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),w=Math.sin(n.yPoleWander),I=r-X+a/R.SECONDS_PER_DAY;I/=36525;var x=-47e-6*I*m.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=k;return D[0]=g*C,D[1]=g*P,D[2]=O,D[3]=-M*P+w*O*C,D[4]=M*C+w*O*P,D[5]=-w*g,D[6]=-w*P-M*O*C,D[7]=w*C-M*O*P,D[8]=M*g,_.multiply(N,D,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,Q=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,h.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,m.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,Q);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new _),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new y,ue=new y;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=y.getColumn(t,3,te),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,oe),c=y.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=y.getColumn(t,0,ee),d=n.magnitude(h),E=y.multiplyByVector(c,h,re);r.fromElements(E.z,E.x,E.y,0,E);var p=y.getColumn(t,1,ee),m=n.magnitude(p),_=y.multiplyByVector(c,p,ae);r.fromElements(_.z,_.x,_.y,0,_);var T=y.getColumn(t,2,ee),R=n.magnitude(T),S=ie;return n.cross(E,_,S),n.normalize(S,S),n.cross(_,S,E),n.normalize(E,E),n.cross(S,E,_),n.normalize(_,_),n.multiplyByScalar(E,d,E),n.multiplyByScalar(_,m,_),n.multiplyByScalar(S,R,S),y.setColumn(a,0,E,a),y.setColumn(a,1,_,a),y.setColumn(a,2,S,a),y.setColumn(a,3,f,a),a};var se=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,oe),i=y.inverseTransformation(a,ue),o=r.cartesianToCartographic(t,J),u=e.project(o,$),s=ne;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=y.fromTranslation(s,oe);return y.multiply(se,i,n),y.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,p)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,p));var i=n.fromCartesian4(l.getColumn(r,2,p));this._plane=f.fromPointNormal(e,i)}var p=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var m=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,m);return new E(r.center,n)};var _=new h,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=_;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=_;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];D=t.cartesianToCartographic(a,D),n[r]=D.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function d(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;i<c;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function E(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function p(e,n,r,a,i,o,c,l){var h=b,d=G;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,U,h),h=t.normalize(h,h);var p=E(h,n,e,i);B=u.fromRotationZ(p,B),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(B,q,F),L);var m=z;m[0]=c;for(var _=0;_<l;_++)for(var y=0;y<r.length;y+=3)d=t.fromArray(r,y,d),d=u.multiplyByVector(m,d,d),d=s.multiplyByPoint(L,d,d),a.push(d.x,d.y,d.z);return a}function m(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=p(c,n,r,a,i,o[s/3],u,1)}return a}function _(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function y(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,h,d,E){var m,_=t.angleBetween(t.subtract(n,e,x),t.subtract(r,e,C)),y=i===a.BEVELED?0:Math.ceil(_/o.toRadians(5));m=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,x),_/(y+1),X),H):u.fromQuaternion(l.fromAxisAngle(e,_/(y+1),X),H);var T,R;if(n=t.clone(n,V),y>0)for(var A=E?2:1,S=0;S<y;S++)n=u.multiplyByVector(m,n,n),T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=p(R,T,h,f,c,d,1,A);else T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=p(R,T,h,f,c,d,1,1),r=t.clone(r,V),T=t.subtract(r,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,C),f=p(R,T,h,f,c,d,1,1);return f}var R=[new t,new t],A=new t,S=new t,v=new t,N=new t,g=new t,M=new t,O=new t,w=new t,I=new t,x=new t,C=new t,P={},D=new r,U=new t(-1,0,0),L=new s,F=new s,B=new u,z=u.IDENTITY.clone(),b=new t,G=new n,q=new t,W=new t,X=new l,V=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,E=i._cornerType,C=u?_(n,r):y(n,r),D=u?y(n,r):void 0,U=r.height/2,L=r.width/2,F=e.length,B=[],z=u?[]:void 0,b=A,G=S,q=v,W=N,X=g,V=M,H=O,Y=w,k=I,K=e[0],Q=e[1];W=s.geodeticSurfaceNormal(K,W),b=t.subtract(Q,K,b),b=t.normalize(b,b),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y);var J=l[0],$=l[1];u&&(z=p(K,Y,D,z,s,J+U,1,1)),k=t.clone(K,k),K=Q,G=t.negate(b,G);for(var ee,te,ne=1;ne<F-1;ne++){var re=u?2:1;Q=e[ne+1],b=t.subtract(Q,K,b),b=t.normalize(b,b),q=t.add(b,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(b,W),Z);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,x))),se=P.angleIsGreaterThanPi(b,G,K,s);se?(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,L,V),V),R[0]=t.clone(k,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,J+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=m(te,Y,C,B,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,B,C,$+U,u):(q=t.negate(q,q),B=p(K,q,C,B,s,$+U,ue,re)),k=t.clone(H,k)):(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,-L,V),V),R[0]=t.clone(k,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,J+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=m(te,Y,C,B,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,-L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,B,C,$+U,u):B=p(K,q,C,B,s,$+U,ue,re),k=t.clone(H,k)),G=t.negate(b,G)}else B=p(k,Y,C,B,s,J+U,1,1),k=K;J=$,$=l[ne+1],K=Q}R[0]=t.clone(k,R[0]),R[1]=t.clone(K,R[1]),ee=d(R,J+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=m(te,Y,C,B,s,ee,1),u&&(z=p(K,Y,D,z,s,$+U,1,1)),F=B.length;var ce=u?F+z.length:F,le=new Float64Array(ce);return le.set(B),u&&le.set(z,F),le},P}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,n,r,a,i,o,u){"use strict";function s(n,i,o,s,c){var l=e.angleBetween(e.subtract(i,n,E),e.subtract(o,n,p)),f=s===t.BEVELED?1:Math.ceil(l/r.toRadians(5))+1,h=3*f,d=new Array(h);d[h-3]=o.x,d[h-2]=o.y,d[h-1]=o.z;var m;m=c?a.fromQuaternion(u.fromAxisAngle(e.negate(n,E),l/f,I),x):a.fromQuaternion(u.fromAxisAngle(n,l/f,I),x);var _=0;i=e.clone(i,E);for(var y=0;y<f;y++)i=a.multiplyByVector(m,i,i),d[_++]=i.x,d[_++]=i.y,d[_++]=i.z;return d}function c(n){var r=T,a=R,i=A,o=n[1];a=e.fromArray(n[1],o.length-3,a),i=e.fromArray(n[0],0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var u=s(r,a,i,t.ROUNDED,!1),c=n.length-1,l=n[c-1];o=n[c],a=e.fromArray(l,l.length-3,a),i=e.fromArray(o,0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var f=s(r,a,i,t.ROUNDED,!1);return[u,f]}function l(t,n,r,a){var i=E;return a?i=e.add(t,n,i):(n=e.negate(n,n),i=e.add(t,n,i)),[i.x,i.y,i.z,r.x,r.y,r.z]}function f(t,n,r,a){for(var i=new Array(t.length),o=new Array(t.length),u=e.multiplyByScalar(n,r,E),s=e.negate(u,p),c=0,l=t.length-1,f=0;f<t.length;f+=3){var h=e.fromArray(t,f,m),d=e.add(h,s,_);i[c++]=d.x,i[c++]=d.y,i[c++]=d.z;var y=e.add(h,u,_);o[l--]=y.z,o[l--]=y.y,o[l--]=y.x}return a.push(i,o),a}function h(e,t){for(var n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}var d={},E=new e,p=new e,m=new e,_=new e,y=[new e,new e],T=new e,R=new e,A=new e,S=new e,v=new e,N=new e,g=new e,M=new e,O=new e,w=new e,I=new u,x=new a; -d.addAttribute=function(e,t,r,a){var i=t.x,o=t.y,u=t.z;n(r)&&(e[r]=i,e[r+1]=o,e[r+2]=u),n(a)&&(e[a]=u,e[a-1]=o,e[a-2]=i)};var C=new e,P=new e;return d.computePositions=function(n){var a=n.granularity,u=n.positions,d=n.ellipsoid;u=h(u,d);var p=n.width/2,m=n.cornerType,_=n.saveAttributes,I=T,x=R,D=A,U=S,L=v,F=N,B=g,z=M,b=O,G=w,q=[],W=_?[]:void 0,X=_?[]:void 0,V=u[0],H=u[1];x=e.normalize(e.subtract(H,V,x),x),I=d.geodeticSurfaceNormal(V,I),U=e.normalize(e.cross(I,x,U),U),_&&(W.push(U.x,U.y,U.z),X.push(I.x,I.y,I.z)),B=e.clone(V,B),V=H,D=e.negate(x,D);var Y,k,Z=[],j=u.length;for(k=1;k<j-1;k++){I=d.geodeticSurfaceNormal(V,I),H=u[k+1],x=e.normalize(e.subtract(H,V,x),x),L=e.normalize(e.add(x,D,L),L);var K=e.multiplyByScalar(I,e.dot(x,I),C);e.subtract(x,K,K),e.normalize(K,K);var Q=e.multiplyByScalar(I,e.dot(D,I),P);e.subtract(D,Q,Q),e.normalize(Q,Q);var J=!r.equalsEpsilon(Math.abs(e.dot(K,Q)),1,r.EPSILON7);if(J){L=e.cross(L,I,L),L=e.cross(I,L,L),L=e.normalize(L,L);var $=p/Math.max(.25,e.magnitude(e.cross(L,D,E))),ee=o.angleIsGreaterThanPi(x,D,V,d);L=e.multiplyByScalar(L,$,L),ee?(z=e.add(V,L,z),G=e.add(z,e.multiplyByScalar(U,p,G),G),b=e.add(z,e.multiplyByScalar(U,2*p,b),b),y[0]=e.clone(B,y[0]),y[1]=e.clone(G,y[1]),Y=i.generateArc({positions:y,granularity:a,ellipsoid:d}),q=f(Y,U,p,q),_&&(W.push(U.x,U.y,U.z),X.push(I.x,I.y,I.z)),F=e.clone(b,F),U=e.normalize(e.cross(I,x,U),U),b=e.add(z,e.multiplyByScalar(U,2*p,b),b),B=e.add(z,e.multiplyByScalar(U,p,B),B),m===t.ROUNDED||m===t.BEVELED?Z.push({leftPositions:s(z,F,b,m,ee)}):Z.push({leftPositions:l(V,e.negate(L,L),b,ee)})):(b=e.add(V,L,b),G=e.add(b,e.negate(e.multiplyByScalar(U,p,G),G),G),z=e.add(b,e.negate(e.multiplyByScalar(U,2*p,z),z),z),y[0]=e.clone(B,y[0]),y[1]=e.clone(G,y[1]),Y=i.generateArc({positions:y,granularity:a,ellipsoid:d}),q=f(Y,U,p,q),_&&(W.push(U.x,U.y,U.z),X.push(I.x,I.y,I.z)),F=e.clone(z,F),U=e.normalize(e.cross(I,x,U),U),z=e.add(b,e.negate(e.multiplyByScalar(U,2*p,z),z),z),B=e.add(b,e.negate(e.multiplyByScalar(U,p,B),B),B),m===t.ROUNDED||m===t.BEVELED?Z.push({rightPositions:s(b,F,z,m,ee)}):Z.push({rightPositions:l(V,L,z,ee)})),D=e.negate(x,D)}V=H}I=d.geodeticSurfaceNormal(V,I),y[0]=e.clone(B,y[0]),y[1]=e.clone(V,y[1]),Y=i.generateArc({positions:y,granularity:a,ellipsoid:d}),q=f(Y,U,p,q),_&&(W.push(U.x,U.y,U.z),X.push(I.x,I.y,I.z));var te;return m===t.ROUNDED&&(te=c(q)),{positions:q,corners:Z,lefts:W,normals:X,endPositions:te}},d}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,E,p,m;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var _=a;_<o;_+=a)E=e[_],p=e[_+1],E<l&&(l=E),p<f&&(f=p),E>h&&(h=E),p>d&&(d=p);m=Math.max(h-l,d-f)}return r(u,c,a,l,f,m),c}function t(e,t,n,r,a){var i,o;if(a===w(e,t,n,r)>0)for(i=t;i<n;i+=r)o=g(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=g(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(M(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(M(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,p,m=e;e.prev!==e.next;)if(E=e.prev,p=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(p.i/s),M(e),e=p.next,m=p.next;else if(e=p,e===m){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(m(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),h=E(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&S(a,i)&&S(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),M(r),M(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&_(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(p(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&m(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function p(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function m(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new O(e.i,e.x,e.y),r=new O(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function g(e,t,n,r){var a=new O(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function M(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,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function w(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(w(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(w(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,E=new n,p={};p.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},p.computeWindingOrder2D=function(e){var t=p.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},p.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var m=new n,_=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return p.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,p=new Array(3*E),v=0;for(h=0;h<E;h++){var N=t[h];p[v++]=N.x,p[v++]=N.y,p[v++]=N.z}for(var g=[],M={},O=e.maximumRadius,w=l.chordLength(u,O),I=w*w;d.length>0;){var x,C,P=d.pop(),D=d.pop(),U=d.pop(),L=n.fromArray(p,3*U,m),F=n.fromArray(p,3*D,_),B=n.fromArray(p,3*P,y),z=n.multiplyByScalar(n.normalize(L,T),O,T),b=n.multiplyByScalar(n.normalize(F,R),O,R),G=n.multiplyByScalar(n.normalize(B,A),O,A),q=n.magnitudeSquared(n.subtract(z,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),X=n.magnitudeSquared(n.subtract(G,z,S)),V=Math.max(q,W,X);V>I?q===V?(x=Math.min(U,D)+" "+Math.max(U,D),h=M[x],i(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,M[x]=h),d.push(U,h,P),d.push(h,D,P)):W===V?(x=Math.min(D,P)+" "+Math.max(D,P),h=M[x],i(h)||(C=n.add(F,B,S),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,M[x]=h),d.push(D,h,U),d.push(h,P,U)):X===V&&(x=Math.min(P,U)+" "+Math.max(P,U),h=M[x],i(h)||(C=n.add(B,L,S),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,M[x]=h),d.push(P,h,D),d.push(h,U,D)):(g.push(U),g.push(D),g.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})},indices:g,primitiveType:f.TRIANGLES})},p.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},p}),define("Core/CorridorOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p,m){"use strict";function _(e,t){var o,s,c,l=[],E=e.positions,p=e.corners,m=e.endPositions,_=new h,y=0,T=0,v=0;for(s=0;s<E.length;s+=2)c=E[s].length-3,y+=c,v+=c/3*4,T+=E[s+1].length-3;for(y+=3,T+=3,s=0;s<p.length;s++){o=p[s];var N=p[s].leftPositions;u(N)?(c=N.length,y+=c,v+=c/3*2):(c=p[s].rightPositions.length,T+=c,v+=c/3*2)}var g,M=u(m);M&&(g=m[0].length-3,y+=g,T+=g,g/=3,v+=4*g);var O,w,I,x,C,P,D=y+T,U=new Float64Array(D),L=0,F=D-1,B=g/2,z=d.createTypedArray(D/3,v+4),b=0;if(z[b++]=L/3,z[b++]=(F-2)/3,M){l.push(L/3),P=R,C=A;var G=m[0];for(s=0;s<B;s++)P=n.fromArray(G,3*(B-1-s),P),C=n.fromArray(G,3*(B+s),C),i.addAttribute(U,C,L),i.addAttribute(U,P,void 0,F),w=L/3,x=w+1,O=(F-2)/3,I=O-1,z[b++]=O,z[b++]=I,z[b++]=w,z[b++]=x,L+=3,F-=3}var q=0,W=E[q++],X=E[q++];for(U.set(W,L),U.set(X,F-X.length+1),c=X.length-3,l.push(L/3,(F-2)/3),s=0;s<c;s+=3)w=L/3,x=w+1,O=(F-2)/3,I=O-1,z[b++]=O,z[b++]=I,z[b++]=w,z[b++]=x,L+=3,F-=3;for(s=0;s<p.length;s++){var V;o=p[s];var H,Y=o.leftPositions,k=o.rightPositions,Z=S;if(u(Y)){for(F-=3,H=I,l.push(x),V=0;V<Y.length/3;V++)Z=n.fromArray(Y,3*V,Z),z[b++]=H-V-1,z[b++]=H-V,i.addAttribute(U,Z,void 0,F),F-=3;l.push(H-Math.floor(Y.length/6)),t===a.BEVELED&&l.push((F-2)/3+1),L+=3}else{for(L+=3,H=x,l.push(I),V=0;V<k.length/3;V++)Z=n.fromArray(k,3*V,Z),z[b++]=H+V,z[b++]=H+V+1,i.addAttribute(U,Z,L),L+=3;l.push(H+Math.floor(k.length/6)),t===a.BEVELED&&l.push(L/3-1),F-=3}for(W=E[q++],X=E[q++],W.splice(0,3),X.splice(X.length-3,3),U.set(W,L),U.set(X,F-X.length+1),c=X.length-3,V=0;V<X.length;V+=3)x=L/3,w=x-1,I=(F-2)/3,O=I+1,z[b++]=O,z[b++]=I,z[b++]=w,z[b++]=x,L+=3,F-=3;L-=3,F+=3,l.push(L/3,(F-2)/3)}if(M){L+=3,F-=3,P=R,C=A;var j=m[1];for(s=0;s<B;s++)P=n.fromArray(j,3*(g-s-1),P),C=n.fromArray(j,3*s,C),i.addAttribute(U,P,void 0,F),i.addAttribute(U,C,L),x=L/3,w=x-1,I=(F-2)/3,O=I+1,z[b++]=O,z[b++]=I,z[b++]=w,z[b++]=x,L+=3,F-=3;l.push(L/3)}else l.push(L/3,(F-2)/3);return z[b++]=L/3,z[b++]=(F-2)/3,_.position=new f({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:U}),{attributes:_,indices:z,wallIndices:l}}function y(e){var t=e.ellipsoid,n=i.computePositions(e),r=_(n,e.cornerType),a=r.wallIndices,o=e.height,u=e.extrudedHeight,s=r.attributes,c=r.indices,l=s.position.values,f=l.length,h=new Float64Array(f);h.set(l);var E=new Float64Array(2*f);l=p.scaleToGeodeticHeight(l,o,t),h=p.scaleToGeodeticHeight(h,u,t),E.set(l),E.set(h,f),s.position.values=E,f/=3;var m,y=c.length,T=d.createTypedArray(E.length/3,2*(y+a.length));T.set(c);var R=y;for(m=0;m<y;m+=2){var A=c[m],S=c[m+1];T[R++]=A+f,T[R++]=S+f}var v,N;for(m=0;m<a.length;m++)v=a[m],N=v+f,T[R++]=v,T[R++]=N;return{attributes:s,indices:T}}function T(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=c.clone(o(e.ellipsoid,c.WGS84)),this._width=r,this._height=o(e.height,0),this._extrudedHeight=o(e.extrudedHeight,this._height),this._cornerType=o(e.cornerType,a.ROUNDED),this._granularity=o(e.granularity,E.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*n.packedLength+c.packedLength+5}var R=new n,A=new n,S=new n;T.pack=function(e,t,r){r=o(r,0);var a=e._positions,i=a.length;t[r++]=i;for(var u=0;u<i;++u,r+=n.packedLength)n.pack(a[u],t,r);return c.pack(e._ellipsoid,t,r),r+=c.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r]=e._granularity,t};var v=c.clone(c.UNIT_SPHERE),N={positions:void 0,ellipsoid:v,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return T.unpack=function(e,t,r){t=o(t,0);for(var a=e[t++],i=new Array(a),s=0;s<a;++s,t+=n.packedLength)i[s]=n.unpack(e,t);var l=c.unpack(e,t,v);t+=c.packedLength;var f=e[t++],h=e[t++],d=e[t++],E=e[t++],p=e[t];return u(r)?(r._positions=i,r._ellipsoid=c.clone(l,r._ellipsoid),r._width=f,r._height=h,r._extrudedHeight=d,r._cornerType=E,r._granularity=p,r):(N.positions=i,N.width=f,N.height=h,N.extrudedHeight=d,N.cornerType=E,N.granularity=p,new T(N))},T.createGeometry=function(r){var a=r._positions,o=r._height,u=r._width,s=r._extrudedHeight,c=o!==s,f=e(a,n.equalsEpsilon);if(!(f.length<2||u<=0)){var h,d=r._ellipsoid,E={ellipsoid:d,positions:f,width:u,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!1};if(c){var T=Math.max(o,s);s=Math.min(o,s),o=T,E.height=o,E.extrudedHeight=s,h=y(E)}else{var R=i.computePositions(E);h=_(R,E.cornerType),h.attributes.position.values=p.scaleToGeodeticHeight(h.attributes.position.values,o,d)}var A=h.attributes,S=t.fromVertices(A.position.values,void 0,3);return new l({attributes:A,indices:h.indices,primitiveType:m.LINES,boundingSphere:S})}},T}),define("Workers/createCorridorOutlineGeometry",["../Core/CorridorOutlineGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,n){"use strict";function r(r,a){return t(a)&&(r=e.unpack(r,a)),r._ellipsoid=n.clone(r._ellipsoid),e.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/arrayRemoveDuplicates",["./Check","./defaultValue","./defined","./Math"],function(e,t,n,r){"use strict";function a(e,r,a){if(n(e)){a=t(a,!1);var o=e.length;if(o<2)return e;var u,s,c;for(u=1;u<o&&(s=e[u-1],c=e[u],!r(s,c,i));++u);if(u===o)return a&&r(e[0],e[e.length-1],i)?e.slice(1):e;for(var l=e.slice(0,u);u<o;++u)c=e[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,p=a.z,_=l*l*d*d,m=f*f*E*E,y=h*h*p*p,T=_+m+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,g=o;g.x=A.x*S*2,g.y=A.y*v*2,g.z=A.z*N*2;var M,O,I,w,x,C,P,D,U,L,F,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(g)),z=0;do{B-=z,I=1/(1+B*S),w=1/(1+B*v),x=1/(1+B*N),C=I*I,P=w*w,D=x*x,U=C*I,L=P*w,F=D*x,M=_*C+m*P+y*D-1,O=_*U*S+m*L*v+y*F*N;var b=-2*O;z=M/b}while(Math.abs(M)>r.EPSILON12);return t(c)?(c.x=l*I,c.y=f*w,c.z=h*x,c):new e(l*I,f*w,h*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,a,i){return a=n(a,0),r(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,p=r(n)?n.oneOverRadiiSquared:h,_=r(n)?n._centerToleranceSquared:d,m=o(t,E,p,_,c);if(r(m)){var y=e.multiplyComponents(m,p,s);y=e.normalize(y,y);var T=e.subtract(t,m,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,p=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(p[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(p[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],h=p[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,_=e[s.getElementIndex(h,h)],m=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(h,f)],T=(_-m)/2/y;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=n-u-f+d,p=2*(a-h),_=2*(i+l),m=2*(a+h),y=-n+u-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+d;return r(t)?(t[0]=E,t[1]=m,t[2]=R,t[3]=p,t[4]=y,t[5]=A,t[6]=_,t[7]=T,t[8]=S,t):new s(E,p,_,m,y,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,E=i*a+c*o*u,p=-c*a+i*o*u,_=-o,m=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=_,t[3]=f,t[4]=E,t[5]=m,t[6]=h,t[7]=p,t[8]=y,t):new s(l,f,h,d,E,p,_,m,y)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],p=[2,2,1],_=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)f(d,_),s.transpose(_,m),s.multiply(d,_,d),s.multiply(m,d,d),s.multiply(h,_,h),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError", +this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,h,d,E,p,_){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(p,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(_,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,p=t.y*t.w,_=t.z*t.z,m=t.z*t.w,y=t.w*t.w,T=s-d-_+y,R=2*(c-m),A=2*(f+p),S=2*(c+m),v=-s+d-_+y,N=2*(E-h),g=2*(f-p),M=2*(E+h),O=-s-d+_+y;return r[0]=T*i,r[1]=S*i,r[2]=g*i,r[3]=0,r[4]=R*o,r[5]=v*o,r[6]=M*o,r[7]=0,r[8]=A*u,r[9]=N*u,r[10]=O*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,E=f.x,p=f.y,_=f.z,m=d.x,y=d.y,T=d.z,R=r.x,A=r.y,S=r.z,v=u*-R+s*-A+c*-S,N=m*-R+y*-A+T*-S,g=E*R+p*A+_*S;return a(n)?(n[0]=u,n[1]=m,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-p,n[7]=0,n[8]=c,n[9]=T,n[10]=-_,n[11]=0,n[12]=v,n[13]=N,n[14]=g,n[15]=1,n):new l(u,s,c,v,m,y,T,N,-E,-p,-_,g,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,E=f,p=i+c,_=o+l,m=t+f,y=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=p,a[13]=_,a[14]=m,a[15]=y,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],p=e[12],_=e[13],m=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],g=t[6],M=t[7],O=t[8],I=t[9],w=t[10],x=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=r*T+u*R+f*A+p*S,F=a*T+s*R+h*A+_*S,B=i*T+c*R+d*A+m*S,z=o*T+l*R+E*A+y*S,b=r*v+u*N+f*g+p*M,G=a*v+s*N+h*g+_*M,q=i*v+c*N+d*g+m*M,W=o*v+l*N+E*g+y*M,X=r*O+u*I+f*w+p*x,V=a*O+s*I+h*w+_*x,H=i*O+c*I+d*w+m*x,Y=o*O+l*I+E*w+y*x,k=r*C+u*P+f*D+p*U,Z=a*C+s*P+h*D+_*U,j=i*C+c*P+d*D+m*U,K=o*C+l*P+E*D+y*U;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],p=t[0],_=t[1],m=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],g=t[13],M=t[14],O=r*p+o*_+c*m,I=a*p+u*_+l*m,w=i*p+s*_+f*m,x=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,D=r*A+o*S+c*v,U=a*A+u*S+l*v,L=i*A+s*S+f*v,F=r*N+o*g+c*M+h,B=a*N+u*g+l*M+d,z=i*N+s*g+f*M+E;return n[0]=O,n[1]=I,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],p=t[3],_=t[4],m=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,S=a*h+u*d+l*E,v=i*h+s*d+f*E,N=r*p+o*_+c*m,g=a*p+u*_+l*m,M=i*p+s*_+f*m,O=r*y+o*T+c*R,I=a*y+u*T+l*R,w=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=g,n[6]=M,n[7]=0,n[8]=O,n[9]=I,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var m=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,m),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],E=e[13],p=e[2],_=e[6],A=e[10],S=e[14],v=e[3],N=e[7],g=e[11],M=e[15],O=A*M,I=S*g,w=_*M,x=S*N,C=_*g,P=A*N,D=p*M,U=S*v,L=p*g,F=A*v,B=p*N,z=_*v,b=O*h+x*d+C*E-(I*h+w*d+P*E),G=I*f+D*d+F*E-(O*f+U*d+L*E),q=w*f+U*h+B*E-(x*f+D*h+z*E),W=P*f+L*h+z*d-(C*f+F*h+B*d),X=I*a+w*i+P*o-(O*a+x*i+C*o),V=O*r+U*i+L*o-(I*r+D*i+F*o),H=x*r+D*a+z*o-(w*r+U*a+B*o),Y=C*r+F*a+B*i-(P*r+L*a+z*i);O=i*E,I=o*d,w=a*E,x=o*h,C=a*d,P=i*h,D=r*E,U=o*f,L=r*d,F=i*f,B=r*h,z=a*f;var k=O*N+x*g+C*M-(I*N+w*g+P*M),Z=I*v+D*g+F*M-(O*v+U*g+L*M),j=w*v+U*N+B*M-(x*v+D*N+z*M),K=P*v+L*N+z*g-(C*v+F*N+B*g),Q=w*A+P*S+I*_-(C*S+O*_+x*A),J=L*S+O*p+U*A-(D*A+F*S+I*p),$=D*_+z*S+x*p-(B*S+w*p+U*_),ee=B*A+C*p+F*_-(L*_+z*A+P*p),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,p=-i*f-o*h-u*d,_=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=p,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var p=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,E=e.west,p=c;p.height=a,p.longitude=E,p.latitude=f,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.latitude=h,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=E,o[l]=t.cartographicToCartesian(p,o[l]),l++,f<0?p.latitude=f:h>0?p.latitude=h:p.latitude=0;for(var _=1;_<8;++_)p.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=t.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=E,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=t.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,p=new e,_=new e,m=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,p),s=e.clone(r,_),c=e.clone(r,m),l=e.clone(r,y),f=t.length,g=1;g<f;g++){e.clone(t[g],r);var M=r.x,O=r.y,I=r.z;M<i.x&&e.clone(r,i),M>s.x&&e.clone(r,s),O<o.y&&e.clone(r,o),O>c.y&&e.clone(r,c),I<u.z&&e.clone(r,u),I>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,D=s,U=w;x>U&&(U=x,P=o,D=c),C>U&&(U=C,P=u,D=l);var L=A;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var F=e.magnitudeSquared(e.subtract(D,L,R)),B=Math.sqrt(F),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,R),.5,N),q=0;for(g=0;g<f;g++){e.clone(t[g],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var V=Math.sqrt(X);B=.5*(B+V),F=B*B;var H=V-B;L.x=(B*L.x+H*r.x)/V,L.y=(B*L.y+H*r.y)/V,L.z=(B*L.z+H*r.z)/V}}return B<q?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var g=new o,M=new e,O=new e,I=new t,w=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,g),f.southwest(t,I),I.height=i,f.northeast(t,w),w.height=o;var s=n.project(I,M),c=n.project(w,O),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*d,p.z=s.z+.5*E,u};var x=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,p),f=e.clone(u,_),g=e.clone(u,m),M=e.clone(u,y),O=t.length,I=0;I<O;I+=i){var w=t[I]+n.x,x=t[I+1]+n.y,C=t[I+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>g.y&&e.clone(u,g),C<l.z&&e.clone(u,l),C>M.z&&e.clone(u,M)}var P=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(g,c,R)),U=e.magnitudeSquared(e.subtract(M,l,R)),L=s,F=f,B=P;D>B&&(B=D,L=c,F=g),U>B&&(B=U,L=l,F=M);var z=A;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=g.y,W.z=M.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),V=0;for(I=0;I<O;I+=i){u.x=t[I]+n.x,u.y=t[I+1]+n.y,u.z=t[I+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);G=.5*(G+k),b=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<V?(e.clone(z,o.center),o.radius=G):(e.clone(X,o.center),o.radius=V),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,p),c=e.clone(i,_),l=e.clone(i,m),f=e.clone(i,y),g=t.length,M=0;M<g;M+=3){var O=t[M]+n[M],I=t[M+1]+n[M+1],w=t[M+2]+n[M+2];i.x=O,i.y=I,i.z=w,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),I<u.y&&e.clone(i,u),I>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),D=o,U=c,L=x;C>L&&(L=C,D=u,U=l),P>L&&(L=P,D=s,U=f);var F=A;F.x=.5*(D.x+U.x),F.y=.5*(D.y+U.y),F.z=.5*(D.z+U.z);var B=e.magnitudeSquared(e.subtract(U,F,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(M=0;M<g;M+=3){i.x=t[M]+n[M],i.y=t[M+1]+n[M+1],i.z=t[M+2]+n[M+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;F.x=(z*F.x+Y*i.x)/H,F.y=(z*F.y+Y*i.y)/H,F.z=(z*F.z+Y*i.z)/H}}return z<W?(e.clone(F,r.center),r.radius=z):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,U=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,D),u=c.getColumn(r,2,U);return e.add(i,o,i),e.add(i,u,i),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(i),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var B=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),d=e.negate(c,X),E=Y,p=E[0];e.add(s,l,p),e.add(p,c,p),p=E[1],e.add(s,l,p),e.add(p,d,p),p=E[2],e.add(s,f,p),e.add(p,d,p),p=E[3],e.add(s,f,p),e.add(p,c,p),e.negate(s,s),p=E[4],e.add(s,l,p),e.add(p,c,p),p=E[5],e.add(s,l,p),e.add(p,d,p),p=E[6],e.add(s,f,p),e.add(p,d,p),p=E[7],e.add(s,f,p),e.add(p,c,p);for(var _=E.length,m=0;m<_;++m){var y=E[m];e.add(o,y,y);var T=i.cartesianToCartographic(y,H);n.project(T,y)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(v)&&(v=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(g=!0,M=r(e[1]),M.isNightly=!!e[2])}return g}function c(){return s()&&M}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent), +null!==e&&(O=!0,I=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,I=r(e[1])))}return O}function f(){return l()&&I}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function d(){return h()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function p(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function _(){return E()&&P}function m(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,g,M,O,I,w,x,C,P,D,U,L,F,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:_,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:y,imageRenderingValue:T};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,E=Math.sqrt(d),p=t/4,_=p*p,m=_*p,y=_*_,T=1+p-3*_/4+5*m/4-175*y/64,R=1-p+15*_/8-35*m/8,A=1-3*p+35*_/4,S=1-5*p,v=T*l-R*Math.sin(2*l)*p/2-A*Math.sin(4*l)*_/16-S*Math.sin(6*l)*m/48-5*Math.sin(8*l)*y/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=d,N.cosineAlpha=E,N.u2Over4=p,N.u4Over16=_,N.u6Over64=m,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,E=(t-n)/t,p=i-r,_=Math.atan((1-E)*Math.tan(a)),m=Math.atan((1-E)*Math.tan(o)),y=Math.cos(_),T=Math.sin(_),R=Math.cos(m),A=Math.sin(m),S=y*R,v=y*A,N=T*A,g=T*R,M=p,O=u.TWO_PI,I=Math.cos(M),w=Math.sin(M);do{I=Math.cos(M),w=Math.sin(M);var x=v-g*I;f=Math.sqrt(R*R*w*w+x*x),c=N+S*I,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*w/f,h=1-C*C),O=M,d=c-2*N/h,isNaN(d)&&(d=0),M=p+l(E,C,h,s,f,c,d)}while(Math.abs(M-O)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,U=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,F=U*f*(d+U*(c*(2*L-1)-U*d*(4*f*f-3)*(4*L-3)/6)/4),B=n*D*(s-F),z=Math.atan2(R*w,v-g*I),b=Math.atan2(y*w,v*I-g);e._distance=B,e._startHeading=z,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,p),E),e.normalize(i.cartographicToCartesian(a,p),p);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var E=new e,p=new e;return a(d.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}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),E=i*i,p=i*E,_=a.u8Over256,m=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*p*_*o/3+i*(1-m+7*T/4-15*y/4+579*_/64-(T-15*y/4+187*_/16)*o-(5*y/4-115*_/16)*u-29*_*s/16)+(m/2-T+71*y/32-85*_/16)*c+(5*T/16-5*y/4+383*_/96)*f-E*((y-11*_/2)*c+5*_*f/2)+(29*y/96-29*_/16)*h+539*_*d/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var v=Math.cos(2*a.sigma+R),N=Math.sin(R),g=Math.cos(R),M=a.cosineU*g,O=a.sineU*N,I=Math.atan2(N*a.sineHeading,M-O*a.cosineHeading),w=I-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,g,v);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=S,n.height=0,n):new t(this._start.longitude+w,S,0)},d}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,p=o*c-u*s,_=u*c-d,m=4*E*_-p*p;if(m<0){var y,T,R;h*f>=l*d?(y=o,T=E,R=-2*u*E+o*p):(y=c,T=_,R=-c*p+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-m);i=-R+S;var v=i/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),g=i===S?-N:-T/N;return a=T<=0?N+g:-R/(N*N+g*g+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var M=E,O=-2*u*E+o*p,I=_,w=-c*p+2*s*_,x=Math.sqrt(m),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-M);var D=Math.cos(P);i=a*D;var U=a*(-D/2-C*Math.sin(P)),L=i+U>2*u?i-u:U-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-I),D=Math.cos(P),i=a*D,U=a*(-D/2-C*Math.sin(P));var z=-c,b=i+U<2*s?i+s:U+s,G=z/b,q=F*b,W=-L*b-F*z,X=L*z,V=(s*W-u*X)/(-u*W+s*q);return B<=V?B<=G?V<=G?[B,V,G]:[B,G,V]:[G,B,V]:B<=G?[V,B,G]:V<=G?[V,G,B]:[G,V,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var p,_=E[0],m=E[1];if(_>=0&&m>=0){var y=Math.sqrt(_),T=Math.sqrt(m);return[h-T,h-y,h+y,h+T]}if(_>=0&&m<0)return p=Math.sqrt(_),[h-p,h+p];if(_<0&&m>=0)return p=Math.sqrt(m),[h-p,h+p]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,p,_=d[0],m=a-_,y=m*m,T=t/2,R=m/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*_,N=c+4*Math.abs(_);if(_<0||A*N<v*S){var g=Math.sqrt(v);E=g/2,p=0===g?0:(t*R-i)/g}else{var M=Math.sqrt(A);E=0===M?0:(t*R-i)/M,p=M/2}var O,I;0===T&&0===E?(O=0,I=0):n.sign(T)===n.sign(E)?(O=T+E,I=_/O):(I=T-E,O=_/I);var w,x;0===R&&0===p?(w=0,x=0):n.sign(R)===n.sign(p)?(w=R+p,x=o/w):(x=R-p,w=o/x);var C=r.computeRealRoots(1,O,w),P=r.computeRealRoots(1,I,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,p=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return p},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),h=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,p=f(h,d,E,S);if(r(p))return a.start=p.root0,a.stop=p.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,h=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,p=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),_=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,m=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===m){if(l=s.computeRealRoots(E,p,_),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-v)),T.push(new e(a,i*S,i*v))}return T}var N=y*y,g=m*m,M=E*E,O=y*m,I=M+g,w=2*(p*E+O),x=2*_*E+p*p-g+N,C=2*(_*p-O),P=_*_-N;if(0===I&&0===w&&0===x&&0===C)return T;l=c.computeRealRoots(I,w,x,C,P);var D=l.length;if(0===D)return T;for(var U=0;U<D;++U){var L,F=l[U],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=o.sign(E)===o.sign(_)?d(E*B+_,p*F,o.EPSILON12):o.sign(_)===o.sign(p*F)?d(E*B,p*F+_,o.EPSILON12):d(E*B+p*F,_,o.EPSILON12);var G=d(m*F,y,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++U):T.push(new e(a,i*F,i*b))}return T}var p={};p.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var _=new e,m=new e,y=new e,T=new e,R=new e;p.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,p=e.subtract(a,r,_),A=e.subtract(i,r,m),S=e.cross(E,A,y),v=e.dot(p,S);if(u){if(v<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,p,R),f=e.dot(E,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<o.EPSILON6)return;var N=1/v;if(s=e.subtract(d,r,T),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,p,R),f=e.dot(E,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},p.rayTriangle=function(t,n,a,i,o,u){var s=p.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;p.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};p.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new l;p.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,g=new e;p.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,g),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var E=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var p=s/a,_=r/s;return p<_?new i(p,_):{start:_,stop:p}}var m=Math.sqrt(r/a);return new i(m,m)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var M=new e,O=new e,I=new e,w=new e,x=new e,C=new u,P=new u,D=new u,U=new u,L=new u,F=new u,B=new u,z=new e,b=new e,G=new t;p.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,M);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,M),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,O),O),p=e.normalize(e.cross(f,d,I),I),_=C;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=d.x,_[4]=d.y,_[5]=d.z,_[6]=p.x,_[7]=p.y,_[8]=p.z;var m=u.transpose(_,P),y=u.fromScale(n.radii,D),T=u.fromScale(n.oneOverRadii,U),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,v=u.multiply(u.multiply(m,T,F),R,F),N=u.multiply(u.multiply(v,y,B),_,B),g=u.multiplyByVector(v,a,x),q=E(N,e.negate(g,M),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(y,u.multiplyByVector(_,q[H],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,G);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-V*V),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var q=new e;return p.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u); +if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},p.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return p.lineSegmentPlane(t,n,a,f),p.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(n,r,a,f),p.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(r,t,a,f),p.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(n,t,a,f),p.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(r,n,a,f),p.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,r,a,f),p.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,n,r,a){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var o=new e;return i.fromCartesian4=function(n,r){var a=e.fromCartesian4(n,o),u=n.w;return t(r)?(e.clone(a,r.normal),r.distance=u,r):new i(a,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,I),l=a.scaleToGeodeticSurface(n,w),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,g),p=a.cartesianToCartographic(l,M),_=h(f,i,o);x.setEndPoints(d,p);var m=x.surfaceDistance/f,y=s;d.height=i;var T=a.cartographicToCartesian(d,O);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=x.interpolateUsingSurfaceDistance(R*m,M);A.height=_[R],T=a.cartographicToCartesian(A,O),e.pack(T,u,y),y+=3}return y}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var p=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,p).height}return r};var _=new l,m=new e,y=new e,T=new f(e.UNIT_X,0),R=new e,A=new f(e.UNIT_X,0),S=new e,v=new e,N=[],g=new t,M=new t,O=new e,I=new e,w=new e,x=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,_),c=l.multiplyByPoint(s,e.ZERO,m),h=e.normalize(l.multiplyByPointAsVector(s,e.UNIT_Y,y),y),d=f.fromPointNormal(c,h,T),E=e.normalize(l.multiplyByPointAsVector(s,e.UNIT_X,R),R),p=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var g=i[0],M=t.length,O=1;O<M;++O){var I=t[O];if(f.getPointDistance(p,g)<0||f.getPointDistance(p,I)<0){var w=u.lineSegmentPlane(g,I,d,S);if(r(w)){var x=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,g)<0&&e.negate(x,x),i.push(e.add(w,x,new e)),o.push(N+1),e.negate(x,x),i.push(e.add(w,x,new e)),N=1}}i.push(e.clone(t[O])),N++,g=I}o.push(N)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],I);if(l=f?l[0]:l,0!==l){var p=u.geodeticSurfaceNormal(h,O);e.multiplyByScalar(p,l,p),e.add(h,p,h)}return[h.x,h.y,h.z]}var _=t.minDistance;if(!r(_)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(m,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=E.numberOfPoints(a[y],a[y+1],_);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=a[y],M=a[y+1],w=f?l[y]:l,x=f?l[y+1]:l;S=d(v,M,_,u,w,x,A,S)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,g);P.height=f?l[o-1]:l;var D=u.cartographicToCartesian(P,O);return e.pack(D,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,n,r,a){"use strict";function i(t,a,i){this.minimum=e.clone(n(t,e.ZERO)),this.maximum=e.clone(n(a,e.ZERO)),r(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,n){if(r(n)||(n=new i),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,p=d.y,_=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(p,o),c=Math.max(p,c),u=Math.min(_,u),l=Math.max(_,l)}var m=n.minimum;m.x=a,m.y=o,m.z=u;var y=n.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(m,y,n.center);return e.multiplyByScalar(T,.5,T),n},i.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new i(t.minimum,t.maximum)},i.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return p(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=m,p(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){p(e)}function s(e){E(e)}var c,l,f,h,d,E,p,_,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(_=d.progress,p=function(e){h.push(e),--l||(E=p=m,d.reject(h))},E=function(e){f.push(e),--c||(E=p=m,d.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,_);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function p(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function m(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,p,_,m;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(m),y,c,f,R,S);case"c":return u(String.fromCharCode(+m),y,c,f,R);case"b":return o(m,2,A,y,c,f,R);case"o":return o(m,8,A,y,c,f,R);case"x":return o(m,16,A,y,c,f,R);case"X":return o(m,16,A,y,c,f,R).toUpperCase();case"u":return o(m,10,A,y,c,f,R);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),E=d<0?"-":T,m=E+a(String(Math.abs(d)),f,"0",!1),i(m,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,E=d<0?"-":T,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=E+Math.abs(d)[p](f),i(m,E,y,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return p.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=p.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=p.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}p.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=p.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return p.addSeconds(e,-r[0].offset,n);if(a>=r.length)return p.addSeconds(e,-r[a-1].offset,n);var i=p.secondsDifference(r[a].julianDate,e);return 0===i?p.addSeconds(e,-r[a].offset,n):i<=1?void 0:p.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function p(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var _=new i,m=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,g=/([Z+\-])?(\d{2})?:?(\d{2})?$/,M=/^(\d{2})(\.\d+)?/.source+g.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+g.source,I=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+g.source;p.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new p(n[0],n[1],c.UTC)},p.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,_=0,T=0,g=0,w=u[0],x=u[1];if(u=w.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(v),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,U=new Date(Date.UTC(n,0,4));C=7*P+D-U.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(x)){u=x.match(I),null!==u?(h=+u[1],_=+u[2],T=+u[3],g=1e3*+(u[4]||0),L=5):(u=x.match(O),null!==u?(h=+u[1],_=+u[2],T=60*+(u[3]||0),L=4):(u=x.match(M),null!==u&&(h=+u[1],_=60*+(u[2]||0),L=3)));var F=u[L],B=+u[L+1],z=+(u[L+2]||0);switch(F){case"+":h-=B,_-=z;break;case"-":h+=B,_+=z;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,h,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;_>=60;)_-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?y:m[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:m[s-1];for(;_<0;)_+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:m[s-1],l+=a;var G=E(n,s,l,h,_,T,g);return r(t)?(d(G[0],G[1],t),f(t)):t=new p(G[0],G[1],c.UTC),b&&p.addSeconds(t,1,t),t},p.now=function(e){return p.fromDate(new Date,e)};var w=new p(0,0,c.TAI);return p.toGregorianDate=function(e,t){var n=!1,a=h(e,w);r(a)||(p.addSeconds(e,-1,w),a=h(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var _=d+2-12*c|0,m=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=m,t.month=_,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(m,_,E,y,R,A,S,n)},p.toDate=function(e){var t=p.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},p.toIso8601=function(t,n){var a,i=p.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},p.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new p(e.dayNumber,e.secondsOfDay,c.TAI)},p.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},p.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},p.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(p.secondsDifference(e,t))<=n},p.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},p.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},p.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},p.computeTaiMinusUtc=function(e){T.julianDate=e;var n=p.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},p.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},p.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},p.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},p.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},p.lessThan=function(e,t){return p.compare(e,t)<0},p.lessThanOrEquals=function(e,t){return p.compare(e,t)<=0},p.greaterThan=function(e,t){return p.compare(e,t)>0},p.greaterThanOrEquals=function(e,t){return p.compare(e,t)>=0},p.prototype.clone=function(e){return p.clone(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.equalsEpsilon=function(e,t){return p.equalsEpsilon(this,e,t)},p.prototype.toString=function(){return p.toIso8601(this)},p.leapSeconds=[new u(new p(2441317,43210,c.TAI),10),new u(new p(2441499,43211,c.TAI),11),new u(new p(2441683,43212,c.TAI),12),new u(new p(2442048,43213,c.TAI),13),new u(new p(2442413,43214,c.TAI),14),new u(new p(2442778,43215,c.TAI),15),new u(new p(2443144,43216,c.TAI),16),new u(new p(2443509,43217,c.TAI),17),new u(new p(2443874,43218,c.TAI),18),new u(new p(2444239,43219,c.TAI),19),new u(new p(2444786,43220,c.TAI),20),new u(new p(2445151,43221,c.TAI),21),new u(new p(2445516,43222,c.TAI),22),new u(new p(2446247,43223,c.TAI),23),new u(new p(2447161,43224,c.TAI),24),new u(new p(2447892,43225,c.TAI),25),new u(new p(2448257,43226,c.TAI),26),new u(new p(2448804,43227,c.TAI),27),new u(new p(2449169,43228,c.TAI),28),new u(new p(2449534,43229,c.TAI),29),new u(new p(2450083,43230,c.TAI),30),new u(new p(2450630,43231,c.TAI),31),new u(new p(2451179,43232,c.TAI),32),new u(new p(2453736,43233,c.TAI),33),new u(new p(2454832,43234,c.TAI),34),new u(new p(2456109,43235,c.TAI),35),new u(new p(2457204,43236,c.TAI),36),new u(new p(2457754,43237,c.TAI),37)],p}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var p in s)s.hasOwnProperty(p)&&E.setRequestHeader(p,s[p]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||E<0||p<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns"); +var _=e._samples=n.samples,m=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=p,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],v=_[R+p],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,g=new o(N,v,f.TAI);if(m.push(g),T){if(v!==y&&r(y)){var M=o.leapSeconds,O=t(M,g,d);if(O<0){var I=new u(g,v);M.splice(~O,0,I)}}y=v}}}function p(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function m(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return p(e,n,a,s,u),u;if(r.equals(l))return p(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],m=n[d+e._ut1MinusUtcSecondsColumn],y=m-E;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=m:m-=R-T)}return u.xPoleWander=_(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,E,m),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),p=E||o.greaterThanOrEquals(h,e);if(d&&p)return s=u,!E&&h.equals(e)&&++s,l=s+1,m(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){if(i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),"data"===r.scheme)return r.toString();if("data"===a.scheme)return a.toString();n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,p,_=i-s*this._stepSizeDays,m=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)m[E]=_-R[E];for(E=0;E<=u;++E){for(T[E]=1,p=0;p<=u;++p)p!==E&&(T[E]*=m[p]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=h,a):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],p=s+f+E;if(p>0)n=Math.sqrt(p+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var _=h,m=0;f>s&&(m=1),E>s&&E>f&&(m=2);var y=_[m],T=_[y];n=Math.sqrt(e[c.getElementIndex(m,m)]-e[c.getElementIndex(y,y)]-e[c.getElementIndex(T,T)]+1);var R=d;R[m]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,y)]-e[c.getElementIndex(y,T)])*n,R[y]=(e[c.getElementIndex(y,m)]+e[c.getElementIndex(m,y)])*n,R[T]=(e[c.getElementIndex(T,m)]+e[c.getElementIndex(m,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,p=new l,_=new l,m=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),m=l.fromAxisAngle(e.UNIT_X,o.roll,E),_=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(_,m,_),p=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(p,i,i)};var y=new e,T=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,y);var u=l.computeAngle(R);r[o]=y.x*u,r[o+1]=y.y*u,r[o+2]=y.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var v=new l;l.lerp=function(e,t,n,r){return v=l.multiplyByScalar(t,n,v),r=l.multiplyByScalar(e,1-n,r),l.add(v,r,r)};var N=new l,g=new l,M=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return g=l.multiplyByScalar(e,Math.sin((1-n)*o),g),M=l.multiplyByScalar(i,Math.sin(n*o),M),r=l.add(g,M,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var O=new e,I=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,O);l.multiply(i,t,x);var u=l.log(x,I);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;D[B]=1/(z*b),U[B]=z/b}return D[7]=P/136,U[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)L[f]=(D[f]*s-U[f])*o,F[f]=(D[f]*c-U[f])*o;var h=a*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),d=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,h,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p,_,m,y,T,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},v={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},N={},g={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},M=new n,O=new n,I=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(N[i])?r=N[i]:(r=function(r,i,s){if(u(s)||(s=new y),_.equalsEpsilon(r.x,0,_.EPSILON14)&&_.equalsEpsilon(r.y,0,_.EPSILON14)){var c=_.sign(r.z);n.unpack(v[e],0,M),"east"!==e&&"west"!==e&&n.multiplyByScalar(M,c,M),n.unpack(v[t],0,O),"east"!==t&&"west"!==t&&n.multiplyByScalar(O,c,O),n.unpack(v[a],0,I),"east"!==a&&"west"!==a&&n.multiplyByScalar(I,c,I)}else{i=o(i,h.WGS84),i.geodeticSurfaceNormal(r,g.up);var l=g.up,f=g.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,g.east),n.cross(l,f,g.north),n.multiplyByScalar(g.up,-1,g.down),n.multiplyByScalar(g.east,-1,g.west),n.multiplyByScalar(g.north,-1,g.south),M=g[e],O=g[t],I=g[a]}return s[0]=M.x,s[1]=M.y,s[2]=M.z,s[3]=0,s[4]=O.x,s[5]=O.y,s[6]=O.z,s[7]=0,s[8]=I.x,s[9]=I.y,s[10]=I.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},N[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new T,x=new n(1,1,1),C=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof y&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,w),c=y.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),y.multiply(i,c,i)};var P=new y,D=new m;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=y.getRotation(i,D);return T.fromRotationMatrix(o,a)};var U=24110.54841,L=8640184.812866,F=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,G=_.TWO_PI/86400,q=new p;A.computeTemeToPseudoFixedMatrix=function(e,t){q=p.addSeconds(e,-p.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=U+n*(L+n*(F+n*B)),s=o*G%_.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new m);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return m.transpose(n,t)};var V=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new m,k=new m;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new m);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=m.fromRotationZ(-i.s,k),h=m.multiply(l,f,Y),d=e.dayNumber,E=e.secondsOfDay-p.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=d-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*_.TWO_PI;var v=m.fromRotationZ(S,k),N=m.multiply(h,v,Y),g=Math.cos(n.xPoleWander),M=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*_.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=k;return D[0]=g*C,D[1]=g*P,D[2]=O,D[3]=-M*P+I*O*C,D[4]=M*C+I*O*P,D[5]=-I*g,D[6]=-I*P-M*O*C,D[7]=I*C-M*O*P,D[8]=M*g,m.multiply(N,D,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,Q=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,h.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,Q);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new m),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new n,te=new n,ne=new m,re=new y,ae=new y;return A.basisTo2D=function(e,t,r){var a=y.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);n.fromElements(u.z,u.x,u.y,u);var s=A.eastNorthUpToFixedFrame(a,i,re),c=y.inverseTransformation(s,ae),l=y.getRotation(t,ne),f=y.multiplyByMatrix3(c,l,r);return y.multiply(J,f,r),y.setTranslation(r,u,r),r},A.wgs84To2DModelMatrix=function(e,t,r){var a=e.ellipsoid,i=A.eastNorthUpToFixedFrame(t,a,re),o=y.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);n.fromElements(s.z,s.x,s.y,s);var c=y.fromTranslation(s,re);return y.multiply(J,o,r),y.multiply(c,r,r),r},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,p)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,p));var i=n.fromCartesian4(l.getColumn(r,2,p));this._plane=f.fromPointNormal(e,i)}var p=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var m=new h,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=m;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=m;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];D=t.cartesianToCartographic(a,D),n[r]=D.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function d(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;i<c;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function E(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function p(e,n,r,a,i,o,c,l){var h=b,d=G;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,U,h),h=t.normalize(h,h);var p=E(h,n,e,i);B=u.fromRotationZ(p,B),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(B,q,F),L);var _=z;_[0]=c;for(var m=0;m<l;m++)for(var y=0;y<r.length;y+=3)d=t.fromArray(r,y,d),d=u.multiplyByVector(_,d,d),d=s.multiplyByPoint(L,d,d),a.push(d.x,d.y,d.z);return a}function _(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=p(c,n,r,a,i,o[s/3],u,1)}return a}function m(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function y(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,h,d,E){var _,m=t.angleBetween(t.subtract(n,e,x),t.subtract(r,e,C)),y=i===a.BEVELED?0:Math.ceil(m/o.toRadians(5));_=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,x),m/(y+1),X),H):u.fromQuaternion(l.fromAxisAngle(e,m/(y+1),X),H);var T,R;if(n=t.clone(n,V),y>0)for(var A=E?2:1,S=0;S<y;S++)n=u.multiplyByVector(_,n,n),T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=p(R,T,h,f,c,d,1,A);else T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=p(R,T,h,f,c,d,1,1),r=t.clone(r,V),T=t.subtract(r,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,C),f=p(R,T,h,f,c,d,1,1);return f}var R=[new t,new t],A=new t,S=new t,v=new t,N=new t,g=new t,M=new t,O=new t,I=new t,w=new t,x=new t,C=new t,P={},D=new r,U=new t(-1,0,0),L=new s,F=new s,B=new u,z=u.IDENTITY.clone(),b=new t,G=new n,q=new t,W=new t,X=new l,V=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,E=i._cornerType,C=u?m(n,r):y(n,r),D=u?y(n,r):void 0,U=r.height/2,L=r.width/2,F=e.length,B=[],z=u?[]:void 0,b=A,G=S,q=v,W=N,X=g,V=M,H=O,Y=I,k=w,K=e[0],Q=e[1];W=s.geodeticSurfaceNormal(K,W),b=t.subtract(Q,K,b),b=t.normalize(b,b),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y);var J=l[0],$=l[1];u&&(z=p(K,Y,D,z,s,J+U,1,1)),k=t.clone(K,k),K=Q,G=t.negate(b,G);for(var ee,te,ne=1;ne<F-1;ne++){var re=u?2:1;Q=e[ne+1],b=t.subtract(Q,K,b),b=t.normalize(b,b),q=t.add(b,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(b,W),Z);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,x))),se=P.angleIsGreaterThanPi(b,G,K,s);se?(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,L,V),V),R[0]=t.clone(k,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,J+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=_(te,Y,C,B,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,B,C,$+U,u):(q=t.negate(q,q),B=p(K,q,C,B,s,$+U,ue,re)),k=t.clone(H,k)):(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,-L,V),V),R[0]=t.clone(k,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,J+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=_(te,Y,C,B,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,-L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,B,C,$+U,u):B=p(K,q,C,B,s,$+U,ue,re),k=t.clone(H,k)),G=t.negate(b,G)}else B=p(k,Y,C,B,s,J+U,1,1),k=K;J=$,$=l[ne+1],K=Q}R[0]=t.clone(k,R[0]),R[1]=t.clone(K,R[1]),ee=d(R,J+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=_(te,Y,C,B,s,ee,1),u&&(z=p(K,Y,D,z,s,$+U,1,1)),F=B.length;var ce=u?F+z.length:F,le=new Float64Array(ce);return le.set(B),u&&le.set(z,F),le},P}),define("Core/CorridorGeometryLibrary",["./Cartesian3","./CornerType","./defined","./Math","./Matrix3","./PolylinePipeline","./PolylineVolumeGeometryLibrary","./Quaternion"],function(e,t,n,r,a,i,o,u){"use strict";function s(n,i,o,s,c){var l=e.angleBetween(e.subtract(i,n,E),e.subtract(o,n,p)),f=s===t.BEVELED?1:Math.ceil(l/r.toRadians(5))+1,h=3*f,d=new Array(h);d[h-3]=o.x,d[h-2]=o.y,d[h-1]=o.z;var _;_=c?a.fromQuaternion(u.fromAxisAngle(e.negate(n,E),l/f,w),x):a.fromQuaternion(u.fromAxisAngle(n,l/f,w),x);var m=0;i=e.clone(i,E);for(var y=0;y<f;y++)i=a.multiplyByVector(_,i,i),d[m++]=i.x,d[m++]=i.y,d[m++]=i.z;return d}function c(n){var r=T,a=R,i=A,o=n[1];a=e.fromArray(n[1],o.length-3,a),i=e.fromArray(n[0],0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var u=s(r,a,i,t.ROUNDED,!1),c=n.length-1,l=n[c-1];o=n[c],a=e.fromArray(l,l.length-3,a),i=e.fromArray(o,0,i),r=e.multiplyByScalar(e.add(a,i,r),.5,r);var f=s(r,a,i,t.ROUNDED,!1);return[u,f]}function l(t,n,r,a){var i=E;return a?i=e.add(t,n,i):(n=e.negate(n,n),i=e.add(t,n,i)),[i.x,i.y,i.z,r.x,r.y,r.z]}function f(t,n,r,a){for(var i=new Array(t.length),o=new Array(t.length),u=e.multiplyByScalar(n,r,E),s=e.negate(u,p),c=0,l=t.length-1,f=0;f<t.length;f+=3){var h=e.fromArray(t,f,_),d=e.add(h,s,m);i[c++]=d.x,i[c++]=d.y,i[c++]=d.z;var y=e.add(h,u,m);o[l--]=y.z,o[l--]=y.y,o[l--]=y.x}return a.push(i,o),a}function h(e,t){for(var n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}var d={},E=new e,p=new e,_=new e,m=new e,y=[new e,new e],T=new e,R=new e,A=new e,S=new e,v=new e,N=new e,g=new e,M=new e,O=new e,I=new e,w=new u,x=new a;d.addAttribute=function(e,t,r,a){var i=t.x,o=t.y,u=t.z;n(r)&&(e[r]=i,e[r+1]=o,e[r+2]=u),n(a)&&(e[a]=u,e[a-1]=o,e[a-2]=i)};var C=new e,P=new e;return d.computePositions=function(n){var a=n.granularity,u=n.positions,d=n.ellipsoid;u=h(u,d);var p=n.width/2,_=n.cornerType,m=n.saveAttributes,w=T,x=R,D=A,U=S,L=v,F=N,B=g,z=M,b=O,G=I,q=[],W=m?[]:void 0,X=m?[]:void 0,V=u[0],H=u[1];x=e.normalize(e.subtract(H,V,x),x),w=d.geodeticSurfaceNormal(V,w),U=e.normalize(e.cross(w,x,U),U),m&&(W.push(U.x,U.y,U.z),X.push(w.x,w.y,w.z)),B=e.clone(V,B),V=H,D=e.negate(x,D);var Y,k,Z=[],j=u.length;for(k=1;k<j-1;k++){w=d.geodeticSurfaceNormal(V,w),H=u[k+1],x=e.normalize(e.subtract(H,V,x),x), +L=e.normalize(e.add(x,D,L),L);var K=e.multiplyByScalar(w,e.dot(x,w),C);e.subtract(x,K,K),e.normalize(K,K);var Q=e.multiplyByScalar(w,e.dot(D,w),P);e.subtract(D,Q,Q),e.normalize(Q,Q);var J=!r.equalsEpsilon(Math.abs(e.dot(K,Q)),1,r.EPSILON7);if(J){L=e.cross(L,w,L),L=e.cross(w,L,L),L=e.normalize(L,L);var $=p/Math.max(.25,e.magnitude(e.cross(L,D,E))),ee=o.angleIsGreaterThanPi(x,D,V,d);L=e.multiplyByScalar(L,$,L),ee?(z=e.add(V,L,z),G=e.add(z,e.multiplyByScalar(U,p,G),G),b=e.add(z,e.multiplyByScalar(U,2*p,b),b),y[0]=e.clone(B,y[0]),y[1]=e.clone(G,y[1]),Y=i.generateArc({positions:y,granularity:a,ellipsoid:d}),q=f(Y,U,p,q),m&&(W.push(U.x,U.y,U.z),X.push(w.x,w.y,w.z)),F=e.clone(b,F),U=e.normalize(e.cross(w,x,U),U),b=e.add(z,e.multiplyByScalar(U,2*p,b),b),B=e.add(z,e.multiplyByScalar(U,p,B),B),_===t.ROUNDED||_===t.BEVELED?Z.push({leftPositions:s(z,F,b,_,ee)}):Z.push({leftPositions:l(V,e.negate(L,L),b,ee)})):(b=e.add(V,L,b),G=e.add(b,e.negate(e.multiplyByScalar(U,p,G),G),G),z=e.add(b,e.negate(e.multiplyByScalar(U,2*p,z),z),z),y[0]=e.clone(B,y[0]),y[1]=e.clone(G,y[1]),Y=i.generateArc({positions:y,granularity:a,ellipsoid:d}),q=f(Y,U,p,q),m&&(W.push(U.x,U.y,U.z),X.push(w.x,w.y,w.z)),F=e.clone(z,F),U=e.normalize(e.cross(w,x,U),U),z=e.add(b,e.negate(e.multiplyByScalar(U,2*p,z),z),z),B=e.add(b,e.negate(e.multiplyByScalar(U,p,B),B),B),_===t.ROUNDED||_===t.BEVELED?Z.push({rightPositions:s(b,F,z,_,ee)}):Z.push({rightPositions:l(V,L,z,ee)})),D=e.negate(x,D)}V=H}w=d.geodeticSurfaceNormal(V,w),y[0]=e.clone(B,y[0]),y[1]=e.clone(V,y[1]),Y=i.generateArc({positions:y,granularity:a,ellipsoid:d}),q=f(Y,U,p,q),m&&(W.push(U.x,U.y,U.z),X.push(w.x,w.y,w.z));var te;return _===t.ROUNDED&&(te=c(q)),{positions:q,corners:Z,lefts:W,normals:X,endPositions:te}},d}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,E,p,_;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var m=a;m<o;m+=a)E=e[m],p=e[m+1],E<l&&(l=E),p<f&&(f=p),E>h&&(h=E),p>d&&(d=p);_=Math.max(h-l,d-f)}return r(u,c,a,l,f,_),c}function t(e,t,n,r,a){var i,o;if(a===I(e,t,n,r)>0)for(i=t;i<n;i+=r)o=g(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=g(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(M(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(M(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,p,_=e;e.prev!==e.next;)if(E=e.prev,p=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(p.i/s),M(e),e=p.next,_=p.next;else if(e=p,e===_){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(_(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),h=E(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&_(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&_(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&S(a,i)&&S(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),M(r),M(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(p(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&_(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function p(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function _(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new O(e.i,e.x,e.y),r=new O(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function g(e,t,n,r){var a=new O(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function M(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,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(I(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(I(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,E=new n,p={};p.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},p.computeWindingOrder2D=function(e){var t=p.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},p.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var _=new n,m=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return p.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,p=new Array(3*E),v=0;for(h=0;h<E;h++){var N=t[h];p[v++]=N.x,p[v++]=N.y,p[v++]=N.z}for(var g=[],M={},O=e.maximumRadius,I=l.chordLength(u,O),w=I*I;d.length>0;){var x,C,P=d.pop(),D=d.pop(),U=d.pop(),L=n.fromArray(p,3*U,_),F=n.fromArray(p,3*D,m),B=n.fromArray(p,3*P,y),z=n.multiplyByScalar(n.normalize(L,T),O,T),b=n.multiplyByScalar(n.normalize(F,R),O,R),G=n.multiplyByScalar(n.normalize(B,A),O,A),q=n.magnitudeSquared(n.subtract(z,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),X=n.magnitudeSquared(n.subtract(G,z,S)),V=Math.max(q,W,X);V>w?q===V?(x=Math.min(U,D)+" "+Math.max(U,D),h=M[x],i(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,M[x]=h),d.push(U,h,P),d.push(h,D,P)):W===V?(x=Math.min(D,P)+" "+Math.max(D,P),h=M[x],i(h)||(C=n.add(F,B,S),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,M[x]=h),d.push(D,h,U),d.push(h,P,U)):X===V&&(x=Math.min(P,U)+" "+Math.max(P,U),h=M[x],i(h)||(C=n.add(B,L,S),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),h=p.length/3-1,M[x]=h),d.push(P,h,D),d.push(h,U,D)):(g.push(U),g.push(D),g.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})},indices:g,primitiveType:f.TRIANGLES})},p.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},p}),define("Core/CorridorOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./ComponentDatatype","./CornerType","./CorridorGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,p,_){"use strict";function m(e,t){var o,s,c,l=[],E=e.positions,p=e.corners,_=e.endPositions,m=new h,y=0,T=0,v=0;for(s=0;s<E.length;s+=2)c=E[s].length-3,y+=c,v+=c/3*4,T+=E[s+1].length-3;for(y+=3,T+=3,s=0;s<p.length;s++){o=p[s];var N=p[s].leftPositions;u(N)?(c=N.length,y+=c,v+=c/3*2):(c=p[s].rightPositions.length,T+=c,v+=c/3*2)}var g,M=u(_);M&&(g=_[0].length-3,y+=g,T+=g,g/=3,v+=4*g);var O,I,w,x,C,P,D=y+T,U=new Float64Array(D),L=0,F=D-1,B=g/2,z=d.createTypedArray(D/3,v+4),b=0;if(z[b++]=L/3,z[b++]=(F-2)/3,M){l.push(L/3),P=R,C=A;var G=_[0];for(s=0;s<B;s++)P=n.fromArray(G,3*(B-1-s),P),C=n.fromArray(G,3*(B+s),C),i.addAttribute(U,C,L),i.addAttribute(U,P,void 0,F),I=L/3,x=I+1,O=(F-2)/3,w=O-1,z[b++]=O,z[b++]=w,z[b++]=I,z[b++]=x,L+=3,F-=3}var q=0,W=E[q++],X=E[q++];for(U.set(W,L),U.set(X,F-X.length+1),c=X.length-3,l.push(L/3,(F-2)/3),s=0;s<c;s+=3)I=L/3,x=I+1,O=(F-2)/3,w=O-1,z[b++]=O,z[b++]=w,z[b++]=I,z[b++]=x,L+=3,F-=3;for(s=0;s<p.length;s++){var V;o=p[s];var H,Y=o.leftPositions,k=o.rightPositions,Z=S;if(u(Y)){for(F-=3,H=w,l.push(x),V=0;V<Y.length/3;V++)Z=n.fromArray(Y,3*V,Z),z[b++]=H-V-1,z[b++]=H-V,i.addAttribute(U,Z,void 0,F),F-=3;l.push(H-Math.floor(Y.length/6)),t===a.BEVELED&&l.push((F-2)/3+1),L+=3}else{for(L+=3,H=x,l.push(w),V=0;V<k.length/3;V++)Z=n.fromArray(k,3*V,Z),z[b++]=H+V,z[b++]=H+V+1,i.addAttribute(U,Z,L),L+=3;l.push(H+Math.floor(k.length/6)),t===a.BEVELED&&l.push(L/3-1),F-=3}for(W=E[q++],X=E[q++],W.splice(0,3),X.splice(X.length-3,3),U.set(W,L),U.set(X,F-X.length+1),c=X.length-3,V=0;V<X.length;V+=3)x=L/3,I=x-1,w=(F-2)/3,O=w+1,z[b++]=O,z[b++]=w,z[b++]=I,z[b++]=x,L+=3,F-=3;L-=3,F+=3,l.push(L/3,(F-2)/3)}if(M){L+=3,F-=3,P=R,C=A;var j=_[1];for(s=0;s<B;s++)P=n.fromArray(j,3*(g-s-1),P),C=n.fromArray(j,3*s,C),i.addAttribute(U,P,void 0,F),i.addAttribute(U,C,L),x=L/3,I=x-1,w=(F-2)/3,O=w+1,z[b++]=O,z[b++]=w,z[b++]=I,z[b++]=x,L+=3,F-=3;l.push(L/3)}else l.push(L/3,(F-2)/3);return z[b++]=L/3,z[b++]=(F-2)/3,m.position=new f({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:U}),{attributes:m,indices:z,wallIndices:l}}function y(e){var t=e.ellipsoid,n=i.computePositions(e),r=m(n,e.cornerType),a=r.wallIndices,o=e.height,u=e.extrudedHeight,s=r.attributes,c=r.indices,l=s.position.values,f=l.length,h=new Float64Array(f);h.set(l);var E=new Float64Array(2*f);l=p.scaleToGeodeticHeight(l,o,t),h=p.scaleToGeodeticHeight(h,u,t),E.set(l),E.set(h,f),s.position.values=E,f/=3;var _,y=c.length,T=d.createTypedArray(E.length/3,2*(y+a.length));T.set(c);var R=y;for(_=0;_<y;_+=2){var A=c[_],S=c[_+1];T[R++]=A+f,T[R++]=S+f}var v,N;for(_=0;_<a.length;_++)v=a[_],N=v+f,T[R++]=v,T[R++]=N;return{attributes:s,indices:T}}function T(e){e=o(e,o.EMPTY_OBJECT);var t=e.positions,r=e.width;this._positions=t,this._ellipsoid=c.clone(o(e.ellipsoid,c.WGS84)),this._width=r,this._height=o(e.height,0),this._extrudedHeight=o(e.extrudedHeight,this._height),this._cornerType=o(e.cornerType,a.ROUNDED),this._granularity=o(e.granularity,E.RADIANS_PER_DEGREE),this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*n.packedLength+c.packedLength+5}var R=new n,A=new n,S=new n;T.pack=function(e,t,r){r=o(r,0);var a=e._positions,i=a.length;t[r++]=i;for(var u=0;u<i;++u,r+=n.packedLength)n.pack(a[u],t,r);return c.pack(e._ellipsoid,t,r),r+=c.packedLength,t[r++]=e._width,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._cornerType,t[r]=e._granularity,t};var v=c.clone(c.UNIT_SPHERE),N={positions:void 0,ellipsoid:v,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0};return T.unpack=function(e,t,r){t=o(t,0);for(var a=e[t++],i=new Array(a),s=0;s<a;++s,t+=n.packedLength)i[s]=n.unpack(e,t);var l=c.unpack(e,t,v);t+=c.packedLength;var f=e[t++],h=e[t++],d=e[t++],E=e[t++],p=e[t];return u(r)?(r._positions=i,r._ellipsoid=c.clone(l,r._ellipsoid),r._width=f,r._height=h,r._extrudedHeight=d,r._cornerType=E,r._granularity=p,r):(N.positions=i,N.width=f,N.height=h,N.extrudedHeight=d,N.cornerType=E,N.granularity=p,new T(N))},T.createGeometry=function(r){var a=r._positions,o=r._height,u=r._width,s=r._extrudedHeight,c=o!==s,f=e(a,n.equalsEpsilon);if(!(f.length<2||u<=0)){var h,d=r._ellipsoid,E={ellipsoid:d,positions:f,width:u,cornerType:r._cornerType,granularity:r._granularity,saveAttributes:!1};if(c){var T=Math.max(o,s);s=Math.min(o,s),o=T,E.height=o,E.extrudedHeight=s,h=y(E)}else{var R=i.computePositions(E);h=m(R,E.cornerType),h.attributes.position.values=p.scaleToGeodeticHeight(h.attributes.position.values,o,d)}var A=h.attributes,S=t.fromVertices(A.position.values,void 0,3);return new l({attributes:A,indices:h.indices,primitiveType:_.LINES,boundingSphere:S})}},T}),define("Workers/createCorridorOutlineGeometry",["../Core/CorridorOutlineGeometry","../Core/defined","../Core/Ellipsoid"],function(e,t,n){"use strict";function r(r,a){return t(a)&&(r=e.unpack(r,a)),r._ellipsoid=n.clone(r._ellipsoid),e.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createCylinderGeometry.js b/engines/Cesium/Workers/createCylinderGeometry.js index 5314080..d6cefe9 100644 --- a/engines/Cesium/Workers/createCylinderGeometry.js +++ b/engines/Cesium/Workers/createCylinderGeometry.js @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(r,a){if(!t(a))throw new e(n(r))},a.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},a.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},a.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},a.typeOf.number.lessThan=function(t,n,r){if(a.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(t,n,r){if(a.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},a.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*a.clamp(t,-1,1)+.5)*n)},a.fromSNorm=function(t,n){return n=e(n,255),a.clamp(t,0,n)/n*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},a.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},a.lerp=function(t,e,n){return(1-n)*t+n*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,n,r,a){a=e(a,r);var i=Math.abs(t-n);return i<=a||i<=r*Math.max(Math.abs(t),Math.abs(n))};var i=[1];a.factorial=function(t){var e=i.length;if(t>=e)for(var n=i[e-1],r=e;r<=t;r++)i.push(n*r);return i[t]},a.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return a.setRandomNumberSeed=function(e){o=new t(e)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var a=t.clock,i=t.cone,u=e(t.magnitude,1),E=u*Math.sin(i);return r.x=E*Math.cos(a),r.y=E*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(t,e,r,a){return n(a)?(a.x=t,a.y=e,a.z=r,a):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var a=0;a<r;++a)o.pack(t[a],e,3*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)},o.cross=function(t,e,n){var r=t.x,a=t.y,i=t.z,o=e.x,u=e.y,E=e.z,s=a*E-i*u,c=i*o-r*E,_=r*u-a*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,a){return t=i.toRadians(t),e=i.toRadians(e),o.fromRadians(t,e,n,r,a)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,a,i,u){a=e(a,0);var E=n(i)?i.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,a,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function a(n,a,u,E,s){var c=n.x,_=n.y,T=n.z,R=a.x,l=a.y,f=a.z,A=c*c*R*R,h=_*_*l*l,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,i);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var m=u.x,M=u.y,O=u.z,y=o;y.x=S.x*m*2,y.y=S.y*M*2,y.z=S.z*O*2;var p,C,U,L,F,P,g,w,v,x,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*m),L=1/(1+B*M),F=1/(1+B*O),P=U*U,g=L*L,w=F*F,v=P*U,x=g*L,D=w*F,p=A*P+h*g+N*w-1,C=A*v*m+h*x*M+N*D*O;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var i=new t,o=new t;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,a,i){return a=e(a,0),n(i)?(i.longitude=t,i.latitude=r,i.height=a,i):new u(t,r,a)},u.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=i.EPSILON1;return u.fromCartesian=function(e,r,a){var l=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:T,A=n(r)?r._centerToleranceSquared:R,h=o(e,l,f,A,s);if(n(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=i.sign(t.dot(d,e))*t.magnitude(d);return n(a)?(a.longitude=I,a.latitude=S,a.height=m,a):new u(I,S,m)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o,u,E){"use strict";function s(e,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),e._radii=new t(r,a,i),e._radiiSquared=new t(r*r,a*a,i*i),e._radiiToTheFourth=new t(r*r*r*r,a*a*a*a,i*i*i*i),e._oneOverRadii=new t(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),e._minimumRadius=Math.min(r,a,i),e._maximumRadius=Math.max(r,a,i),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}a(c.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}}}),c.clone=function(e,n){if(r(e)){var a=e._radii;return r(n)?(t.clone(a,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(a.x,a.y,a.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,a){return a=n(a,0),t.pack(e._radii,r,a),r},c.unpack=function(e,r,a){r=n(r,0);var i=t.unpack(e,r);return c.fromCartesian3(i,a)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var a=e.longitude,i=e.latitude,o=Math.cos(i),u=o*Math.cos(a),E=o*Math.sin(a),s=Math.sin(i);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var a=_,i=T;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(t.dot(a,i));return t.divideByScalar(i,o,i),t.multiplyByScalar(a,e.height,a),r(n)||(n=new t),t.add(i,a,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var R=new t,l=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,l);if(r(i)){var o=this.geodeticSurfaceNormal(i,R),E=t.subtract(n,i,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(a)?(a.longitude=s,a.latitude=c,a.height=_,a):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var a=e.x,i=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new t),i.x=0,i.y=0,i.z=e.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,a,i,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var a=this._semimajorAxis,i=e.longitude*a,o=e.latitude*a,u=e.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new t(i,o,u)},u.prototype.unproject=function(t,n){var a=this._oneOverSemimajorAxis,i=t.x*a,o=t.y*a,u=t.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new e(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a,i,o,u,E,s){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(i,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(f[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(t[E.getElementIndex(f[i],l[i])]);o>r&&(a=i,r=o)}var s=1,c=0,_=l[a],T=f[a];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,A=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(A-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,a=t.x*t.y,i=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,f=2*(a-T),A=2*(i+c),h=2*(a+T),N=-n+u-_+R,d=2*(s-o),I=2*(i-c),S=2*(s+o),m=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=m,e):new E(l,f,A,h,N,d,I,S,m)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),a=Math.cos(-t.heading),i=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*a,_=-i*u+s*o*a,T=s*u+i*o*a,R=n*u,l=i*a+s*o*u,f=-o*i+i*o*u,A=-o,h=s*n,N=i*n;return r(e)?(e[0]=c,e[1]=R,e[2]=A,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new E(c,_,T,R,l,f,A,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=a,e[6]=0,e[7]=-a,e[8]=n,e):new E(1,0,0,0,n,-a,0,a,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=n,e):new E(n,0,a,0,1,0,-a,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=a,e[2]=0,e[3]=-a,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-a,0,a,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,a=t[r],i=t[r+1],o=t[r+2];return n.x=a,n.y=i,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var a=3*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],a=t[e+3],i=t[e+6];return n.x=r,n.y=a,n.z=i,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],i=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[3]*a+t[6]*i,u=t[1]*r+t[4]*a+t[7]*i,E=t[2]*r+t[5]*a+t[8]*i;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],a=t[6],i=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],f=[2,2,1],A=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,a=10,i=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<a&&c(R)>l;)_(R,A),E.transpose(A,h),E.multiply(R,A,R),E.multiply(h,R,R),E.multiply(T,A,T),++i>2&&(++o,i=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],a=t[1],i=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(i*s-E*o)+a*(E*r-n*s)+u*(n*o-i*r)},E.inverse=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*a-r*_,e[2]=r*u-o*a,e[3]=s*u-i*_,e[4]=n*_-s*a,e[5]=i*a-n*u,e[6]=i*c-s*o,e[7]=s*r-n*c,e[8]=n*o-i*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,a(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}o.fromElements=function(t,e,r,a,i){return n(i)?(i.x=t,i.y=e,i.z=r,i.w=a,i):new o(t,e,r,a)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r++],a.w=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var a=0;a<r;++a)o.pack(t[a],e,4*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)&&i.equalsEpsilon(t.w,e.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,a,i,o,u,E,s){ -"use strict";function c(t,e,n,a,i,o,u,E,s,c,_,T,R,l,f,A){this[0]=r(t,0),this[1]=r(i,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(a,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(A,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),a(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(a(t))return a(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,i){return n=r(n,t.ZERO),a(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){a(r)||(r=new c);var i=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-A+N,I=2*(s-h),S=2*(_+f),m=2*(s+h),M=-E+R-A+N,O=2*(l-T),y=2*(_-f),p=2*(l+T),C=-E-R+A+N;return r[0]=d*i,r[1]=m*i,r[2]=y*i,r[3]=0,r[4]=I*o,r[5]=M*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=O*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var r=e.position,i=e.direction,o=e.up;t.normalize(i,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,f=_.y,A=_.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,m=r.z,M=u*-I+E*-S+s*-m,O=h*-I+N*-S+d*-m,y=l*I+f*S+A*m;return a(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=M,n[13]=O,n[14]=y,n[15]=1,n):new c(u,E,s,M,h,N,d,O,-l,-f,-A,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,a){var i=Math.tan(.5*t),o=1/i,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=-1,a[12]=0,a[13]=0,a[14]=s,a[15]=0,a},c.computeOrthographicOffCenter=function(t,e,n,r,a,i,o){var u=1/(e-t),E=1/(r-n),s=1/(i-a),c=-(e+t)*u,_=-(r+n)*E,T=-(i+a)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,a,i,o){var u=2*a/(e-t),E=2*a/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(i+a)/(i-a),T=-1,R=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,a,i){var o=2*a/(e-t),u=2*a/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=E,i[9]=s,i[10]=c,i[11]=_,i[12]=0,i[13]=0,i[14]=T,i[15]=0,i},c.computeViewportTransformation=function(t,e,n,a){t=r(t,r.EMPTY_OBJECT);var i=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,f=i+s,A=o+c,h=e+_,N=1;return a[0]=T,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=R,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=l,a[11]=0,a[12]=f,a[13]=A,a[14]=h,a[15]=N,a},c.computeView=function(e,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-t.dot(a,e),i[13]=-t.dot(r,e),i[14]=t.dot(n,e),i[15]=1,i},c.toArray=function(t,e){return a(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,a=t[r],i=t[r+1],o=t[r+2],u=t[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var a=4*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],a=t[e+4],i=t[e+8],o=t[e+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var f=new t;c.getMaximumScale=function(e){return c.getScale(e,f),t.maximumComponent(f)},c.multiply=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],m=e[3],M=e[4],O=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],g=e[13],w=e[14],v=e[15],x=r*d+u*I+_*S+f*m,D=a*d+E*I+T*S+A*m,B=i*d+s*I+R*S+h*m,z=o*d+c*I+l*S+N*m,G=r*M+u*O+_*y+f*p,b=a*M+E*O+T*y+A*p,X=i*M+s*O+R*y+h*p,V=o*M+c*O+l*y+N*p,q=r*C+u*U+_*L+f*F,H=a*C+E*U+T*L+A*F,W=i*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,k=r*P+u*g+_*w+f*v,K=a*P+E*g+T*w+A*v,Z=i*P+s*g+R*w+h*v,j=o*P+c*g+l*w+N*v;return n[0]=x,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],m=e[9],M=e[10],O=e[12],y=e[13],p=e[14],C=r*f+o*A+s*h,U=a*f+u*A+c*h,L=i*f+E*A+_*h,F=r*N+o*d+s*I,P=a*N+u*d+c*I,g=i*N+E*d+_*I,w=r*S+o*m+s*M,v=a*S+u*m+c*M,x=i*S+E*m+_*M,D=r*O+o*y+s*p+T,B=a*O+u*y+c*p+R,z=i*O+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=g,n[7]=0,n[8]=w,n[9]=v,n[10]=x,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,m=a*T+u*R+c*l,M=i*T+E*R+_*l,O=r*f+o*A+s*h,y=a*f+u*A+c*h,p=i*f+E*A+_*h,C=r*N+o*d+s*I,U=a*N+u*d+c*I,L=i*N+E*d+_*I;return n[0]=S,n[1]=m,n[2]=M,n[3]=0,n[4]=O,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=r*t[0]+a*t[4]+i*t[8]+t[12],u=r*t[1]+a*t[5]+i*t[9]+t[13],E=r*t[2]+a*t[6]+i*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var A=new t;c.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,c.multiplyByScale(t,A,n)},c.multiplyByScale=function(t,e,n){var r=e.x,a=e.y,i=e.z;return 1===r&&1===a&&1===i?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=a*t[4],n[5]=a*t[5],n[6]=a*t[6],n[7]=0,n[8]=i*t[8],n[9]=i*t[9],n[10]=i*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t[0]*r+t[4]*a+t[8]*i+t[12]*o,E=t[1]*r+t[5]*a+t[9]*i+t[13]*o,s=t[2]*r+t[6]*a+t[10]*i+t[14]*o,c=t[3]*r+t[7]*a+t[11]*i+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i,u=t[1]*r+t[5]*a+t[9]*i,E=t[2]*r+t[6]*a+t[10]*i;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i+t[12],u=t[1]*r+t[5]*a+t[9]*i+t[13],E=t[2]*r+t[6]*a+t[10]*i+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],a=t[3],i=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=i,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],a=t[4],i=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],f=t[2],A=t[6],S=t[10],m=t[14],M=t[3],O=t[7],y=t[11],p=t[15],C=S*p,U=m*y,L=A*p,F=m*O,P=A*y,g=S*O,w=f*p,v=m*M,x=f*y,D=S*M,B=f*O,z=A*M,G=C*T+F*R+P*l-(U*T+L*R+g*l),b=U*_+w*R+D*l-(C*_+v*R+x*l),X=L*_+v*T+B*l-(F*_+w*T+z*l),V=g*_+x*T+z*R-(P*_+D*T+B*R),q=U*a+L*i+g*o-(C*a+F*i+P*o),H=C*r+v*i+x*o-(U*r+w*i+D*o),W=F*r+w*a+z*o-(L*r+v*a+B*o),Y=P*r+D*a+B*i-(g*r+x*a+z*i);C=i*l,U=o*R,L=a*l,F=o*T,P=a*R,g=i*T,w=r*l,v=o*_,x=r*R,D=i*_,B=r*T,z=a*_;var k=C*O+F*y+P*p-(U*O+L*y+g*p),K=U*M+w*y+D*p-(C*M+v*y+x*p),Z=L*M+v*O+B*p-(F*M+w*O+z*p),j=g*M+x*O+z*y-(P*M+D*O+B*y),Q=L*S+g*m+U*A-(P*m+C*A+F*S),J=x*m+C*f+v*S-(w*S+D*m+U*f),$=w*A+z*m+F*f-(B*m+L*f+v*A),tt=B*S+P*f+D*A-(x*A+z*S+g*f),et=r*G+a*b+i*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-a*R,f=-i*_-o*T-u*R,A=-E*_-s*T-c*R;return e[0]=n,e[1]=i,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=a,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=f,e[14]=A,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(a,0)}a(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,a,i,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=t,o.south=e,o.east=a,o.north=i,o):new E(t,e,a,i)},E.fromRadians=function(t,e,a,i,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(a,0),o.north=n(i,0),o):new E(t,e,a,i)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),a=Math.max(a,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;i=Math.min(i,l),o=Math.max(o,l)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=a,e.north=c,e):new E(n,s,a,c)},E.fromCartesianArray=function(t,e,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);a=Math.min(a,l.longitude),i=Math.max(i,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var f=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return i-a>s-o&&(a=o,i=s,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=c,n.east=i,n.north=_,n):new E(a,c,i,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var a=e.east,i=e.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var a=t.east,i=t.west,o=e.east,s=e.west;a<i&&o>0?a+=u.TWO_PI:o<s&&a>0&&(o+=u.TWO_PI),a<i&&s<0?s+=u.TWO_PI:o<s&&i<0&&(i+=u.TWO_PI);var c=u.negativePiToPi(Math.max(i,s)),_=u.negativePiToPi(Math.min(a,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,n){var a=Math.max(t.west,e.west),i=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new E(a,i,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var a=t.east,i=t.west,o=e.east,s=e.west;a<i&&o>0?a+=u.TWO_PI:o<s&&a>0&&(o+=u.TWO_PI),a<i&&s<0?s+=u.TWO_PI:o<s&&i<0&&(i+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(i,s)),_=u.convertLongitudeRange(Math.max(a,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,a=t.west,i=t.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,a,o){e=n(e,i.WGS84),a=n(a,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,f=s;f.height=a,f.longitude=l,f.latitude=_,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.latitude=T,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=e.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,a,i,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,m=new t,M=new t,O=new t;T.fromPoints=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),i=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,f),E=t.clone(r,A),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<i.x&&t.clone(r,i),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,i,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),g=i,w=E,v=L;F>v&&(v=F,g=o,w=s),P>v&&(v=P,g=u,w=c);var x=S;x.x=.5*(g.x+w.x),x.y=.5*(g.y+w.y),x.z=.5*(g.z+w.z);var D=t.magnitudeSquared(t.subtract(w,x,I)),B=Math.sqrt(D),z=m;z.x=i.x,z.y=o.y,z.z=u.z;var G=M;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,O),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*r.x)/H,x.y=(B*x.y+W*r.y)/H,x.z=(B*x.z+W*r.z)/H}}return B<X?(t.clone(x,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,i,o,u){if(a(u)||(u=new T),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=i,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*R,f.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,i.WGS84),n=r(n,0);var u;return a(t)&&(u=_.subsample(t,e,n,F)),T.fromPoints(u,o)},T.fromVertices=function(e,n,i,o){if(a(o)||(o=new T),!a(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),i=r(i,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,f),_=t.clone(u,A),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=i){var L=e[U]+n.x,F=e[U+1]+n.y,P=e[U+2]+n.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>y.y&&t.clone(u,y),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var g=t.magnitudeSquared(t.subtract(_,E,I)),w=t.magnitudeSquared(t.subtract(y,s,I)),v=t.magnitudeSquared(t.subtract(p,c,I)),x=E,D=_,B=g;w>B&&(B=w,x=s,D=y),v>B&&(B=v,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=M;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,O),H=0;for(U=0;U<C;U+=i){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(a(r)||(r=new T),!a(e)||!a(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var i=d;i.x=e[0]+n[0],i.y=e[1]+n[1],i.z=e[2]+n[2];for(var o=t.clone(i,R),u=t.clone(i,l),E=t.clone(i,f),s=t.clone(i,A),c=t.clone(i,h),_=t.clone(i,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];i.x=C,i.y=U,i.z=L,C<o.x&&t.clone(i,o),C>s.x&&t.clone(i,s),U<u.y&&t.clone(i,u),U>c.y&&t.clone(i,c),L<E.z&&t.clone(i,E),L>_.z&&t.clone(i,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),g=t.magnitudeSquared(t.subtract(_,E,I)),w=o,v=s,x=F;P>x&&(x=P,w=u,v=c),g>x&&(x=g,w=E,v=_);var D=S;D.x=.5*(w.x+v.x),D.y=.5*(w.y+v.y),D.z=.5*(w.z+v.z);var B=t.magnitudeSquared(t.subtract(v,D,I)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=M;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,O),V=0;for(p=0;p<y;p+=3){i.x=e[p]+n[p],i.y=e[p+1]+n[p+1],i.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(i,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(i,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*i.x)/W,D.y=(z*D.y+Y*i.y)/W,D.z=(z*D.z+Y*i.z)/W}}return z<V?(t.clone(D,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){a(r)||(r=new T);var i=r.center;return t.add(e,n,i),t.multiplyByScalar(i,.5,i),r.radius=t.distance(i,n),r},T.fromEllipsoid=function(e,n){return a(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var i=[],o=0;o<r;o++)i.push(e[o].center);n=T.fromPoints(i,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var g=new t,w=new t,v=new t;T.fromOrientedBoundingBox=function(e,n){a(n)||(n=new T);var r=e.halfAxes,i=s.getColumn(r,0,g),o=s.getColumn(r,1,w),u=s.getColumn(r,2,v),E=t.magnitude(i),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(a(e))return a(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var a=t.center;return e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),a(n)||(n=new T);var i=n.center;return i.x=t[e++],i.y=t[e++],i.z=t[e++],n.radius=t[e],n};var x=new t,D=new t;T.union=function(e,n,r){a(r)||(r=new T);var i=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,i,x),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(R,i,R),t.clone(R,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var a=t.magnitude(t.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},T.intersectPlane=function(e,n){var r=e.center,a=e.radius,i=n.normal,o=t.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,i){a(i)||(i=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return i.start=u-e.radius,i.stop=u+e.radius,i};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,a){n=r(n,K);var i=n.ellipsoid,o=e.center,u=e.radius,E=i.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),R=t.negate(s,q),l=Y,f=l[0];t.add(E,c,f),t.add(f,s,f),f=l[1],t.add(E,c,f),t.add(f,R,f),f=l[2],t.add(E,_,f),t.add(f,R,f),f=l[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=l[4],t.add(E,c,f),t.add(f,s,f),f=l[5],t.add(E,c,f),t.add(f,R,f),f=l[6],t.add(E,_,f),t.add(f,R,f),f=l[7],t.add(E,_,f),t.add(f,s,f);for(var A=l.length,h=0;h<A;++h){var N=l[h];t.add(o,N,N);var d=i.cartesianToCartographic(N,W);n.project(d,N)}a=T.fromPoints(l,a),o=a.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,a},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||a(e)&&a(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n){this.x=e(t,0),this.y=e(n,0)}o.fromElements=function(t,e,r){return n(r)?(r.x=t,r.y=e,r):new o(t,e)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e):new o(t.x,t.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=2*r:e=new Array(2*r);for(var a=0;a<r;++a)o.pack(t[a],e,2*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/2:e=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y)},o.minimumComponent=function(t){return Math.min(t.x,t.y)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){return o.normalize(t,s),o.normalize(e,c),i.acosClamped(o.dot(s,c))};var _=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Y,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]; -}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var E=i[o];a=E+"RequestFullscreen","function"==typeof e[a]?(r.requestFullscreen=a,n=!0):(a=E+"RequestFullScreen","function"==typeof e[a]&&(r.requestFullscreen=a,n=!0)),a=E+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=E+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=E+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=E+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=E+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=E+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=E+"fullscreenchange",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=E+"fullscreenerror",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function a(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function i(){return a()&&m}function o(){if(!e(M)&&(M=!1,!a()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(M=!0,O=r(t[1]))}return M}function u(){return o()&&O}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function R(){return T()&&F}function l(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,g=r(t[1]))}return P}function f(){return e(w)||(w=/Windows/i.test(I.appVersion)),w}function A(){return l()&&g}function h(){return e(v)||(v="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),v}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(x=n)}return D}function d(){return N()?x:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,M,O,y,p,C,U,L,F,P,g,w,v,x,D,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,a){switch(r=t(r,0),a=t(a,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CylinderGeometryLibrary",["./Math"],function(t){"use strict";var e={};return e.computePositions=function(e,n,r,a,i){var o,u=.5*e,E=-u,s=a+a,c=i?2*s:s,_=new Float64Array(3*c),T=0,R=0,l=i?3*s:0,f=i?3*(s+a):3*a;for(o=0;o<a;o++){var A=o/a*t.TWO_PI,h=Math.cos(A),N=Math.sin(A),d=h*r,I=N*r,S=h*n,m=N*n;_[R+l]=d,_[R+l+1]=I,_[R+l+2]=E,_[R+f]=S,_[R+f+1]=m,_[R+f+2]=u,R+=3,i&&(_[T++]=d,_[T++]=I,_[T++]=E,_[T++]=S,_[T++]=m,_[T++]=u)}return _},e}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,a){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return i.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var a=t.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(t){switch(t){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},i.createTypedArrayFromArrayBuffer=function(t,e,n,a){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,a):new Uint16Array(e,n,a)},n(i)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.tangent?1:0,n[r++]=e.bitangent?1:0,n[r++]=e.color?1:0,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(t,n){if(e(t))return e(n)||(n=new a),n.position=t.position,n.normal=t.normal,n.st=t.st,n.tangent=t.tangent,n.bitangent=t.bitangent,n.color=t.color,n},a}),define("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,a,i,o,u,E,s,c,_,T,R,l){"use strict";function f(t){t=i(t,i.EMPTY_OBJECT);var e=t.length,n=t.topRadius,r=t.bottomRadius,a=i(t.vertexFormat,l.DEFAULT),o=i(t.slices,128);this._length=e,this._topRadius=n,this._bottomRadius=r,this._vertexFormat=l.clone(a),this._slices=o,this._workerName="createCylinderGeometry"}var A=new e,h=new n,N=new n,d=new n,I=new n;f.packedLength=l.packedLength+4,f.pack=function(t,e,n){return n=i(n,0),l.pack(t._vertexFormat,e,n),n+=l.packedLength,e[n++]=t._length,e[n++]=t._topRadius,e[n++]=t._bottomRadius,e[n]=t._slices,e};var S=new l,m={vertexFormat:S,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return f.unpack=function(t,e,n){e=i(e,0);var r=l.unpack(t,e,S);e+=l.packedLength;var a=t[e++],u=t[e++],E=t[e++],s=t[e];return o(n)?(n._vertexFormat=l.clone(r,n._vertexFormat),n._length=a,n._topRadius=u,n._bottomRadius=E,n._slices=s,n):(m.length=a,m.topRadius=u,m.bottomRadius=E,m.slices=s,new f(m))},f.createGeometry=function(i){var o=i._length,u=i._topRadius,l=i._bottomRadius,f=i._vertexFormat,S=i._slices;if(!(o<=0||u<0||l<0||0===u&&0===l)){var m,M=S+S,O=S+M,y=M+M,p=a.computePositions(o,u,l,S,!0),C=f.st?new Float32Array(2*y):void 0,U=f.normal?new Float32Array(3*y):void 0,L=f.tangent?new Float32Array(3*y):void 0,F=f.bitangent?new Float32Array(3*y):void 0,P=f.normal||f.tangent||f.bitangent;if(P){var g=f.tangent||f.bitangent,w=0,v=0,x=0,D=h;D.z=0;var B=d,z=N;for(m=0;m<S;m++){var G=m/S*T.TWO_PI,b=Math.cos(G),X=Math.sin(G);P&&(D.x=b,D.y=X,g&&(B=n.normalize(n.cross(n.UNIT_Z,D,B),B)),f.normal&&(U[w++]=b,U[w++]=X,U[w++]=0,U[w++]=b,U[w++]=X,U[w++]=0),f.tangent&&(L[v++]=B.x,L[v++]=B.y,L[v++]=B.z,L[v++]=B.x,L[v++]=B.y,L[v++]=B.z),f.bitangent&&(z=n.normalize(n.cross(D,B,z),z),F[x++]=z.x,F[x++]=z.y,F[x++]=z.z,F[x++]=z.x,F[x++]=z.y,F[x++]=z.z))}for(m=0;m<S;m++)f.normal&&(U[w++]=0,U[w++]=0,U[w++]=-1),f.tangent&&(L[v++]=1,L[v++]=0,L[v++]=0),f.bitangent&&(F[x++]=0,F[x++]=-1,F[x++]=0);for(m=0;m<S;m++)f.normal&&(U[w++]=0,U[w++]=0,U[w++]=1),f.tangent&&(L[v++]=1,L[v++]=0,L[v++]=0),f.bitangent&&(F[x++]=0,F[x++]=1,F[x++]=0)}var V=12*S-12,q=_.createTypedArray(y,V),H=0,W=0;for(m=0;m<S-1;m++)q[H++]=W,q[H++]=W+2,q[H++]=W+3,q[H++]=W,q[H++]=W+3,q[H++]=W+1,W+=2;for(q[H++]=M-2,q[H++]=0,q[H++]=1,q[H++]=M-2,q[H++]=1,q[H++]=M-1,m=1;m<S-1;m++)q[H++]=M+m+1,q[H++]=M+m,q[H++]=M;for(m=1;m<S-1;m++)q[H++]=O,q[H++]=O+m,q[H++]=O+m+1;var Y=0;if(f.st){var k=Math.max(u,l);for(m=0;m<y;m++){var K=n.fromArray(p,3*m,I);C[Y++]=(K.x+k)/(2*k),C[Y++]=(K.y+k)/(2*k)}}var Z=new c;f.position&&(Z.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})),f.normal&&(Z.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:U})),f.tangent&&(Z.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:L})),f.bitangent&&(Z.bitangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),f.st&&(Z.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:C})),A.x=.5*o,A.y=Math.max(l,u);var j=new t(n.ZERO,e.magnitude(A));return new E({attributes:Z,indices:q,primitiveType:R.TRIANGLES,boundingSphere:j})}},f}),define("Workers/createCylinderGeometry",["../Core/CylinderGeometry","../Core/defined"],function(t,e){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(r,a){if(!t(a))throw new e(n(r))},a.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},a.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},a.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},a.typeOf.number.lessThan=function(t,n,r){if(a.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(t,n,r){if(a.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},a.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*a.clamp(t,-1,1)+.5)*n)},a.fromSNorm=function(t,n){return n=e(n,255),a.clamp(t,0,n)/n*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},a.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},a.lerp=function(t,e,n){return(1-n)*t+n*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,n,r,a){a=e(a,r);var i=Math.abs(t-n);return i<=a||i<=r*Math.max(Math.abs(t),Math.abs(n))};var i=[1];a.factorial=function(t){var e=i.length;if(t>=e)for(var n=i[e-1],r=e;r<=t;r++)i.push(n*r);return i[t]},a.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return a.setRandomNumberSeed=function(e){o=new t(e)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var a=t.clock,i=t.cone,u=e(t.magnitude,1),E=u*Math.sin(i);return r.x=E*Math.cos(a),r.y=E*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(t,e,r,a){return n(a)?(a.x=t,a.y=e,a.z=r,a):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var a=0;a<r;++a)o.pack(t[a],e,3*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)},o.cross=function(t,e,n){var r=t.x,a=t.y,i=t.z,o=e.x,u=e.y,E=e.z,s=a*E-i*u,c=i*o-r*E,_=r*u-a*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,a){return t=i.toRadians(t),e=i.toRadians(e),o.fromRadians(t,e,n,r,a)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,a,i,u){a=e(a,0);var E=n(i)?i.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,a,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function a(n,a,u,E,s){var c=n.x,_=n.y,T=n.z,R=a.x,l=a.y,f=a.z,A=c*c*R*R,h=_*_*l*l,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,i);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var m=u.x,M=u.y,O=u.z,y=o;y.x=S.x*m*2,y.y=S.y*M*2,y.z=S.z*O*2;var p,C,U,L,F,P,g,w,v,x,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*m),L=1/(1+B*M),F=1/(1+B*O),P=U*U,g=L*L,w=F*F,v=P*U,x=g*L,D=w*F,p=A*P+h*g+N*w-1,C=A*v*m+h*x*M+N*D*O;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*F,s):new t(c*U,_*L,T*F)}var i=new t,o=new t;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o){"use strict";function u(t,e,r){this.longitude=n(t,0),this.latitude=n(e,0),this.height=n(r,0)}u.fromRadians=function(t,e,a,i){return a=n(a,0),r(i)?(i.longitude=t,i.latitude=e,i.height=a,i):new u(t,e,a)},u.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=i.EPSILON1;return u.fromCartesian=function(e,n,a){var l=r(n)?n.oneOverRadii:_,f=r(n)?n.oneOverRadiiSquared:T,A=r(n)?n._centerToleranceSquared:R,h=o(e,l,f,A,s);if(r(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=i.sign(t.dot(d,e))*t.magnitude(d);return r(a)?(a.longitude=I,a.latitude=S,a.height=m,a):new u(I,S,m)}},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o,u,E){"use strict";function s(e,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),e._radii=new t(r,a,i),e._radiiSquared=new t(r*r,a*a,i*i),e._radiiToTheFourth=new t(r*r*r*r,a*a*a*a,i*i*i*i),e._oneOverRadii=new t(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),e._minimumRadius=Math.min(r,a,i),e._maximumRadius=Math.max(r,a,i),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}a(c.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}}}),c.clone=function(e,n){if(r(e)){var a=e._radii;return r(n)?(t.clone(a,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(a.x,a.y,a.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,a){return a=n(a,0),t.pack(e._radii,r,a),r},c.unpack=function(e,r,a){r=n(r,0);var i=t.unpack(e,r);return c.fromCartesian3(i,a)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var a=e.longitude,i=e.latitude,o=Math.cos(i),u=o*Math.cos(a),E=o*Math.sin(a),s=Math.sin(i);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var a=_,i=T;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(t.dot(a,i));return t.divideByScalar(i,o,i),t.multiplyByScalar(a,e.height,a),r(n)||(n=new t),t.add(i,a,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var R=new t,l=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,l);if(r(i)){var o=this.geodeticSurfaceNormal(i,R),E=t.subtract(n,i,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(a)?(a.longitude=s,a.latitude=c,a.height=_,a):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var a=e.x,i=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new t),i.x=0,i.y=0,i.z=e.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,a,i,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var a=this._semimajorAxis,i=e.longitude*a,o=e.latitude*a,u=e.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new t(i,o,u)},u.prototype.unproject=function(t,n){var a=this._oneOverSemimajorAxis,i=t.x*a,o=t.y*a,u=t.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new e(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a,i,o,u,E,s){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(i,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(f[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(t[E.getElementIndex(f[i],l[i])]);o>r&&(a=i,r=o)}var s=1,c=0,_=l[a],T=f[a];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,A=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(A-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,a=t.x*t.y,i=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,f=2*(a-T),A=2*(i+c),h=2*(a+T),N=-n+u-_+R,d=2*(s-o),I=2*(i-c),S=2*(s+o),m=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=m,e):new E(l,f,A,h,N,d,I,S,m)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),a=Math.cos(-t.heading),i=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*a,_=-i*u+s*o*a,T=s*u+i*o*a,R=n*u,l=i*a+s*o*u,f=-s*a+i*o*u,A=-o,h=s*n,N=i*n;return r(e)?(e[0]=c,e[1]=R,e[2]=A,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new E(c,_,T,R,l,f,A,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=a,e[6]=0,e[7]=-a,e[8]=n,e):new E(1,0,0,0,n,-a,0,a,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=n,e):new E(n,0,a,0,1,0,-a,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=a,e[2]=0,e[3]=-a,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-a,0,a,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,a=t[r],i=t[r+1],o=t[r+2];return n.x=a,n.y=i,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var a=3*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],a=t[e+3],i=t[e+6];return n.x=r,n.y=a,n.z=i,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],i=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[3]*a+t[6]*i,u=t[1]*r+t[4]*a+t[7]*i,E=t[2]*r+t[5]*a+t[8]*i;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],a=t[6],i=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],f=[2,2,1],A=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,a=10,i=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<a&&c(R)>l;)_(R,A),E.transpose(A,h),E.multiply(R,A,R),E.multiply(h,R,R),E.multiply(T,A,T),++i>2&&(++o,i=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],a=t[1],i=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(i*s-E*o)+a*(E*r-n*s)+u*(n*o-i*r)},E.inverse=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*a-r*_,e[2]=r*u-o*a,e[3]=s*u-i*_,e[4]=n*_-s*a,e[5]=i*a-n*u,e[6]=i*c-s*o,e[7]=s*r-n*c,e[8]=n*o-i*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,a(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}o.fromElements=function(t,e,r,a,i){return n(i)?(i.x=t,i.y=e,i.z=r,i.w=a,i):new o(t,e,r,a)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r++],a.w=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var a=0;a<r;++a)o.pack(t[a],e,4*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)&&i.equalsEpsilon(t.w,e.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,a,i,o,u,E,s){ +"use strict";function c(t,e,n,a,i,o,u,E,s,c,_,T,R,l,f,A){this[0]=r(t,0),this[1]=r(i,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(a,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(A,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),a(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(a(t))return a(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,i){return n=r(n,t.ZERO),a(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){a(r)||(r=new c);var i=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-A+N,I=2*(s-h),S=2*(_+f),m=2*(s+h),M=-E+R-A+N,O=2*(l-T),y=2*(_-f),p=2*(l+T),C=-E-R+A+N;return r[0]=d*i,r[1]=m*i,r[2]=y*i,r[3]=0,r[4]=I*o,r[5]=M*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=O*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var r=e.position,i=e.direction,o=e.up;t.normalize(i,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,f=_.y,A=_.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,m=r.z,M=u*-I+E*-S+s*-m,O=h*-I+N*-S+d*-m,y=l*I+f*S+A*m;return a(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=M,n[13]=O,n[14]=y,n[15]=1,n):new c(u,E,s,M,h,N,d,O,-l,-f,-A,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,a){var i=Math.tan(.5*t),o=1/i,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=-1,a[12]=0,a[13]=0,a[14]=s,a[15]=0,a},c.computeOrthographicOffCenter=function(t,e,n,r,a,i,o){var u=1/(e-t),E=1/(r-n),s=1/(i-a),c=-(e+t)*u,_=-(r+n)*E,T=-(i+a)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,a,i,o){var u=2*a/(e-t),E=2*a/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(i+a)/(i-a),T=-1,R=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,a,i){var o=2*a/(e-t),u=2*a/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=E,i[9]=s,i[10]=c,i[11]=_,i[12]=0,i[13]=0,i[14]=T,i[15]=0,i},c.computeViewportTransformation=function(t,e,n,a){t=r(t,r.EMPTY_OBJECT);var i=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,f=i+s,A=o+c,h=e+_,N=1;return a[0]=T,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=R,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=l,a[11]=0,a[12]=f,a[13]=A,a[14]=h,a[15]=N,a},c.computeView=function(e,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-t.dot(a,e),i[13]=-t.dot(r,e),i[14]=t.dot(n,e),i[15]=1,i},c.toArray=function(t,e){return a(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,a=t[r],i=t[r+1],o=t[r+2],u=t[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var a=4*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],a=t[e+4],i=t[e+8],o=t[e+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var f=new t;c.getMaximumScale=function(e){return c.getScale(e,f),t.maximumComponent(f)},c.multiply=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],m=e[3],M=e[4],O=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],F=e[11],P=e[12],g=e[13],w=e[14],v=e[15],x=r*d+u*I+_*S+f*m,D=a*d+E*I+T*S+A*m,B=i*d+s*I+R*S+h*m,z=o*d+c*I+l*S+N*m,G=r*M+u*O+_*y+f*p,b=a*M+E*O+T*y+A*p,X=i*M+s*O+R*y+h*p,V=o*M+c*O+l*y+N*p,q=r*C+u*U+_*L+f*F,H=a*C+E*U+T*L+A*F,W=i*C+s*U+R*L+h*F,Y=o*C+c*U+l*L+N*F,k=r*P+u*g+_*w+f*v,K=a*P+E*g+T*w+A*v,Z=i*P+s*g+R*w+h*v,j=o*P+c*g+l*w+N*v;return n[0]=x,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],m=e[9],M=e[10],O=e[12],y=e[13],p=e[14],C=r*f+o*A+s*h,U=a*f+u*A+c*h,L=i*f+E*A+_*h,F=r*N+o*d+s*I,P=a*N+u*d+c*I,g=i*N+E*d+_*I,w=r*S+o*m+s*M,v=a*S+u*m+c*M,x=i*S+E*m+_*M,D=r*O+o*y+s*p+T,B=a*O+u*y+c*p+R,z=i*O+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=F,n[5]=P,n[6]=g,n[7]=0,n[8]=w,n[9]=v,n[10]=x,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,m=a*T+u*R+c*l,M=i*T+E*R+_*l,O=r*f+o*A+s*h,y=a*f+u*A+c*h,p=i*f+E*A+_*h,C=r*N+o*d+s*I,U=a*N+u*d+c*I,L=i*N+E*d+_*I;return n[0]=S,n[1]=m,n[2]=M,n[3]=0,n[4]=O,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=r*t[0]+a*t[4]+i*t[8]+t[12],u=r*t[1]+a*t[5]+i*t[9]+t[13],E=r*t[2]+a*t[6]+i*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var A=new t;c.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,c.multiplyByScale(t,A,n)},c.multiplyByScale=function(t,e,n){var r=e.x,a=e.y,i=e.z;return 1===r&&1===a&&1===i?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=a*t[4],n[5]=a*t[5],n[6]=a*t[6],n[7]=0,n[8]=i*t[8],n[9]=i*t[9],n[10]=i*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t[0]*r+t[4]*a+t[8]*i+t[12]*o,E=t[1]*r+t[5]*a+t[9]*i+t[13]*o,s=t[2]*r+t[6]*a+t[10]*i+t[14]*o,c=t[3]*r+t[7]*a+t[11]*i+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i,u=t[1]*r+t[5]*a+t[9]*i,E=t[2]*r+t[6]*a+t[10]*i;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i+t[12],u=t[1]*r+t[5]*a+t[9]*i+t[13],E=t[2]*r+t[6]*a+t[10]*i+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],a=t[3],i=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=i,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],a=t[4],i=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],f=t[2],A=t[6],S=t[10],m=t[14],M=t[3],O=t[7],y=t[11],p=t[15],C=S*p,U=m*y,L=A*p,F=m*O,P=A*y,g=S*O,w=f*p,v=m*M,x=f*y,D=S*M,B=f*O,z=A*M,G=C*T+F*R+P*l-(U*T+L*R+g*l),b=U*_+w*R+D*l-(C*_+v*R+x*l),X=L*_+v*T+B*l-(F*_+w*T+z*l),V=g*_+x*T+z*R-(P*_+D*T+B*R),q=U*a+L*i+g*o-(C*a+F*i+P*o),H=C*r+v*i+x*o-(U*r+w*i+D*o),W=F*r+w*a+z*o-(L*r+v*a+B*o),Y=P*r+D*a+B*i-(g*r+x*a+z*i);C=i*l,U=o*R,L=a*l,F=o*T,P=a*R,g=i*T,w=r*l,v=o*_,x=r*R,D=i*_,B=r*T,z=a*_;var k=C*O+F*y+P*p-(U*O+L*y+g*p),K=U*M+w*y+D*p-(C*M+v*y+x*p),Z=L*M+v*O+B*p-(F*M+w*O+z*p),j=g*M+x*O+z*y-(P*M+D*O+B*y),Q=L*S+g*m+U*A-(P*m+C*A+F*S),J=x*m+C*f+v*S-(w*S+D*m+U*f),$=w*A+z*m+F*f-(B*m+L*f+v*A),tt=B*S+P*f+D*A-(x*A+z*S+g*f),et=r*G+a*b+i*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-a*R,f=-i*_-o*T-u*R,A=-E*_-s*T-c*R;return e[0]=n,e[1]=i,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=a,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=f,e[14]=A,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(a,0)}a(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,a,i,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=t,o.south=e,o.east=a,o.north=i,o):new E(t,e,a,i)},E.fromRadians=function(t,e,a,i,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(a,0),o.north=n(i,0),o):new E(t,e,a,i)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),a=Math.max(a,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;i=Math.min(i,l),o=Math.max(o,l)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=a,e.north=c,e):new E(n,s,a,c)},E.fromCartesianArray=function(t,e,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);a=Math.min(a,l.longitude),i=Math.max(i,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var f=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return i-a>s-o&&(a=o,i=s,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=c,n.east=i,n.north=_,n):new E(a,c,i,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var a=e.east,i=e.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var a=t.east,i=t.west,o=e.east,s=e.west;a<i&&o>0?a+=u.TWO_PI:o<s&&a>0&&(o+=u.TWO_PI),a<i&&s<0?s+=u.TWO_PI:o<s&&i<0&&(i+=u.TWO_PI);var c=u.negativePiToPi(Math.max(i,s)),_=u.negativePiToPi(Math.min(a,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,n){var a=Math.max(t.west,e.west),i=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new E(a,i,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var a=t.east,i=t.west,o=e.east,s=e.west;a<i&&o>0?a+=u.TWO_PI:o<s&&a>0&&(o+=u.TWO_PI),a<i&&s<0?s+=u.TWO_PI:o<s&&i<0&&(i+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(i,s)),_=u.convertLongitudeRange(Math.max(a,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,a=t.west,i=t.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,a,o){e=n(e,i.WGS84),a=n(a,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,f=s;f.height=a,f.longitude=l,f.latitude=_,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.latitude=T,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=e.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,a,i,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,m=new t,M=new t,O=new t;T.fromPoints=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),i=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,f),E=t.clone(r,A),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<i.x&&t.clone(r,i),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,i,I)),F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),g=i,w=E,v=L;F>v&&(v=F,g=o,w=s),P>v&&(v=P,g=u,w=c);var x=S;x.x=.5*(g.x+w.x),x.y=.5*(g.y+w.y),x.z=.5*(g.z+w.z);var D=t.magnitudeSquared(t.subtract(w,x,I)),B=Math.sqrt(D),z=m;z.x=i.x,z.y=o.y,z.z=u.z;var G=M;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,O),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*r.x)/H,x.y=(B*x.y+W*r.y)/H,x.z=(B*x.z+W*r.z)/H}}return B<X?(t.clone(x,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,i,o,u){if(a(u)||(u=new T),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=i,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*R,f.z=E.z+.5*l,u};var F=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,i.WGS84),n=r(n,0);var u;return a(t)&&(u=_.subsample(t,e,n,F)),T.fromPoints(u,o)},T.fromVertices=function(e,n,i,o){if(a(o)||(o=new T),!a(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),i=r(i,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,f),_=t.clone(u,A),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=i){var L=e[U]+n.x,F=e[U+1]+n.y,P=e[U+2]+n.z;u.x=L,u.y=F,u.z=P,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),F<s.y&&t.clone(u,s),F>y.y&&t.clone(u,y),P<c.z&&t.clone(u,c),P>p.z&&t.clone(u,p)}var g=t.magnitudeSquared(t.subtract(_,E,I)),w=t.magnitudeSquared(t.subtract(y,s,I)),v=t.magnitudeSquared(t.subtract(p,c,I)),x=E,D=_,B=g;w>B&&(B=w,x=s,D=y),v>B&&(B=v,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=M;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,O),H=0;for(U=0;U<C;U+=i){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(a(r)||(r=new T),!a(e)||!a(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var i=d;i.x=e[0]+n[0],i.y=e[1]+n[1],i.z=e[2]+n[2];for(var o=t.clone(i,R),u=t.clone(i,l),E=t.clone(i,f),s=t.clone(i,A),c=t.clone(i,h),_=t.clone(i,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];i.x=C,i.y=U,i.z=L,C<o.x&&t.clone(i,o),C>s.x&&t.clone(i,s),U<u.y&&t.clone(i,u),U>c.y&&t.clone(i,c),L<E.z&&t.clone(i,E),L>_.z&&t.clone(i,_)}var F=t.magnitudeSquared(t.subtract(s,o,I)),P=t.magnitudeSquared(t.subtract(c,u,I)),g=t.magnitudeSquared(t.subtract(_,E,I)),w=o,v=s,x=F;P>x&&(x=P,w=u,v=c),g>x&&(x=g,w=E,v=_);var D=S;D.x=.5*(w.x+v.x),D.y=.5*(w.y+v.y),D.z=.5*(w.z+v.z);var B=t.magnitudeSquared(t.subtract(v,D,I)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=M;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,O),V=0;for(p=0;p<y;p+=3){i.x=e[p]+n[p],i.y=e[p+1]+n[p+1],i.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(i,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(i,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*i.x)/W,D.y=(z*D.y+Y*i.y)/W,D.z=(z*D.z+Y*i.z)/W}}return z<V?(t.clone(D,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){a(r)||(r=new T);var i=r.center;return t.add(e,n,i),t.multiplyByScalar(i,.5,i),r.radius=t.distance(i,n),r},T.fromEllipsoid=function(e,n){return a(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var P=new t;T.fromBoundingSpheres=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var i=[],o=0;o<r;o++)i.push(e[o].center);n=T.fromPoints(i,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,P)+s.radius)}return n.radius=E,n};var g=new t,w=new t,v=new t;T.fromOrientedBoundingBox=function(e,n){a(n)||(n=new T);var r=e.halfAxes,i=s.getColumn(r,0,g),o=s.getColumn(r,1,w),u=s.getColumn(r,2,v);return t.add(i,o,i),t.add(i,u,i),n.center=t.clone(e.center,n.center),n.radius=t.magnitude(i),n},T.clone=function(e,n){if(a(e))return a(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var a=t.center;return e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),a(n)||(n=new T);var i=n.center;return i.x=t[e++],i.y=t[e++],i.z=t[e++],n.radius=t[e],n};var x=new t,D=new t;T.union=function(e,n,r){a(r)||(r=new T);var i=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,i,x),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(R,i,R),t.clone(R,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var a=t.magnitude(t.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},T.intersectPlane=function(e,n){var r=e.center,a=e.radius,i=n.normal,o=t.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,i){a(i)||(i=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return i.start=u-e.radius,i.stop=u+e.radius,i};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,a){n=r(n,K);var i=n.ellipsoid,o=e.center,u=e.radius,E=i.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),R=t.negate(s,q),l=Y,f=l[0];t.add(E,c,f),t.add(f,s,f),f=l[1],t.add(E,c,f),t.add(f,R,f),f=l[2],t.add(E,_,f),t.add(f,R,f),f=l[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=l[4],t.add(E,c,f),t.add(f,s,f),f=l[5],t.add(E,c,f),t.add(f,R,f),f=l[6],t.add(E,_,f),t.add(f,R,f),f=l[7],t.add(E,_,f),t.add(f,s,f);for(var A=l.length,h=0;h<A;++h){var N=l[h];t.add(o,N,N);var d=i.cartesianToCartographic(N,W);n.project(d,N)}a=T.fromPoints(l,a),o=a.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,a},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||a(e)&&a(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n){this.x=e(t,0),this.y=e(n,0)}o.fromElements=function(t,e,r){return n(r)?(r.x=t,r.y=e,r):new o(t,e)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e):new o(t.x,t.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=2*r:e=new Array(2*r);for(var a=0;a<r;++a)o.pack(t[a],e,2*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/2:e=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y)},o.minimumComponent=function(t){return Math.min(t.x,t.y)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){return o.normalize(t,s),o.normalize(e,c),i.acosClamped(o.dot(s,c))};var _=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Y,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{ +get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var E=i[o];a=E+"RequestFullscreen","function"==typeof e[a]?(r.requestFullscreen=a,n=!0):(a=E+"RequestFullScreen","function"==typeof e[a]&&(r.requestFullscreen=a,n=!0)),a=E+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=E+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=E+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=E+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=E+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=E+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=E+"fullscreenchange",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=E+"fullscreenerror",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function a(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function i(){return a()&&m}function o(){if(!e(M)&&(M=!1,!a()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(M=!0,O=r(t[1]))}return M}function u(){return o()&&O}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,F=r(t[1]))}return L}function R(){return T()&&F}function l(){if(!e(P)){P=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,g=r(t[1]))}return P}function f(){return e(w)||(w=/Windows/i.test(I.appVersion)),w}function A(){return l()&&g}function h(){return e(v)||(v="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),v}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(x=n)}return D}function d(){return N()?x:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,M,O,y,p,C,U,L,F,P,g,w,v,x,D,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,a){switch(r=t(r,0),a=t(a,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CylinderGeometryLibrary",["./Math"],function(t){"use strict";var e={};return e.computePositions=function(e,n,r,a,i){var o,u=.5*e,E=-u,s=a+a,c=i?2*s:s,_=new Float64Array(3*c),T=0,R=0,l=i?3*s:0,f=i?3*(s+a):3*a;for(o=0;o<a;o++){var A=o/a*t.TWO_PI,h=Math.cos(A),N=Math.sin(A),d=h*r,I=N*r,S=h*n,m=N*n;_[R+l]=d,_[R+l+1]=I,_[R+l+2]=E,_[R+f]=S,_[R+f+1]=m,_[R+f+2]=u,R+=3,i&&(_[T++]=d,_[T++]=I,_[T++]=E,_[T++]=S,_[T++]=m,_[T++]=u)}return _},e}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,a){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return i.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var a=t.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(t){switch(t){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},i.createTypedArrayFromArrayBuffer=function(t,e,n,a){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,a):new Uint16Array(e,n,a)},n(i)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.tangent?1:0,n[r++]=e.bitangent?1:0,n[r++]=e.color?1:0,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(t,n){if(e(t))return e(n)||(n=new a),n.position=t.position,n.normal=t.normal,n.st=t.st,n.tangent=t.tangent,n.bitangent=t.bitangent,n.color=t.color,n},a}),define("Core/CylinderGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,a,i,o,u,E,s,c,_,T,R,l){"use strict";function f(t){t=i(t,i.EMPTY_OBJECT);var e=t.length,n=t.topRadius,r=t.bottomRadius,a=i(t.vertexFormat,l.DEFAULT),o=i(t.slices,128);this._length=e,this._topRadius=n,this._bottomRadius=r,this._vertexFormat=l.clone(a),this._slices=o,this._workerName="createCylinderGeometry"}var A=new e,h=new n,N=new n,d=new n,I=new n;f.packedLength=l.packedLength+4,f.pack=function(t,e,n){return n=i(n,0),l.pack(t._vertexFormat,e,n),n+=l.packedLength,e[n++]=t._length,e[n++]=t._topRadius,e[n++]=t._bottomRadius,e[n]=t._slices,e};var S=new l,m={vertexFormat:S,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0};return f.unpack=function(t,e,n){e=i(e,0);var r=l.unpack(t,e,S);e+=l.packedLength;var a=t[e++],u=t[e++],E=t[e++],s=t[e];return o(n)?(n._vertexFormat=l.clone(r,n._vertexFormat),n._length=a,n._topRadius=u,n._bottomRadius=E,n._slices=s,n):(m.length=a,m.topRadius=u,m.bottomRadius=E,m.slices=s,new f(m))},f.createGeometry=function(i){var o=i._length,u=i._topRadius,l=i._bottomRadius,f=i._vertexFormat,S=i._slices;if(!(o<=0||u<0||l<0||0===u&&0===l)){var m,M=S+S,O=S+M,y=M+M,p=a.computePositions(o,u,l,S,!0),C=f.st?new Float32Array(2*y):void 0,U=f.normal?new Float32Array(3*y):void 0,L=f.tangent?new Float32Array(3*y):void 0,F=f.bitangent?new Float32Array(3*y):void 0,P=f.normal||f.tangent||f.bitangent;if(P){var g=f.tangent||f.bitangent,w=0,v=0,x=0,D=h;D.z=0;var B=d,z=N;for(m=0;m<S;m++){var G=m/S*T.TWO_PI,b=Math.cos(G),X=Math.sin(G);P&&(D.x=b,D.y=X,g&&(B=n.normalize(n.cross(n.UNIT_Z,D,B),B)),f.normal&&(U[w++]=b,U[w++]=X,U[w++]=0,U[w++]=b,U[w++]=X,U[w++]=0),f.tangent&&(L[v++]=B.x,L[v++]=B.y,L[v++]=B.z,L[v++]=B.x,L[v++]=B.y,L[v++]=B.z),f.bitangent&&(z=n.normalize(n.cross(D,B,z),z),F[x++]=z.x,F[x++]=z.y,F[x++]=z.z,F[x++]=z.x,F[x++]=z.y,F[x++]=z.z))}for(m=0;m<S;m++)f.normal&&(U[w++]=0,U[w++]=0,U[w++]=-1),f.tangent&&(L[v++]=1,L[v++]=0,L[v++]=0),f.bitangent&&(F[x++]=0,F[x++]=-1,F[x++]=0);for(m=0;m<S;m++)f.normal&&(U[w++]=0,U[w++]=0,U[w++]=1),f.tangent&&(L[v++]=1,L[v++]=0,L[v++]=0),f.bitangent&&(F[x++]=0,F[x++]=1,F[x++]=0)}var V=12*S-12,q=_.createTypedArray(y,V),H=0,W=0;for(m=0;m<S-1;m++)q[H++]=W,q[H++]=W+2,q[H++]=W+3,q[H++]=W,q[H++]=W+3,q[H++]=W+1,W+=2;for(q[H++]=M-2,q[H++]=0,q[H++]=1,q[H++]=M-2,q[H++]=1,q[H++]=M-1,m=1;m<S-1;m++)q[H++]=M+m+1,q[H++]=M+m,q[H++]=M;for(m=1;m<S-1;m++)q[H++]=O,q[H++]=O+m,q[H++]=O+m+1;var Y=0;if(f.st){var k=Math.max(u,l);for(m=0;m<y;m++){var K=n.fromArray(p,3*m,I);C[Y++]=(K.x+k)/(2*k),C[Y++]=(K.y+k)/(2*k)}}var Z=new c;f.position&&(Z.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})),f.normal&&(Z.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:U})),f.tangent&&(Z.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:L})),f.bitangent&&(Z.bitangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),f.st&&(Z.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:C})),A.x=.5*o,A.y=Math.max(l,u);var j=new t(n.ZERO,e.magnitude(A));return new E({attributes:Z,indices:q,primitiveType:R.TRIANGLES,boundingSphere:j})}},f}),define("Workers/createCylinderGeometry",["../Core/CylinderGeometry","../Core/defined"],function(t,e){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createCylinderOutlineGeometry.js b/engines/Cesium/Workers/createCylinderOutlineGeometry.js index 9556cbb..1e579ef 100644 --- a/engines/Cesium/Workers/createCylinderOutlineGeometry.js +++ b/engines/Cesium/Workers/createCylinderOutlineGeometry.js @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var i={};return i.typeOf={},i.defined=function(r,i){if(!t(i))throw new e(n(r))},i.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},i.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},i.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},i.typeOf.number.lessThan=function(t,n,r){if(i.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(t,n,r){if(i.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},i.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},i}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,f=i.z,A=c*c*R*R,h=_*_*l*l,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,P,F,w,v,g,x,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*M),L=1/(1+B*O),P=1/(1+B*m),F=U*U,w=L*L,v=P*P,g=F*U,x=w*L,D=v*P,p=A*F+h*w+N*v-1,C=A*g*M+h*x*O+N*D*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*P,s):new t(c*U,_*L,T*P)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,i,a){return i=e(i,0),n(a)?(a.longitude=t,a.latitude=r,a.height=i,a):new u(t,r,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(e,r,i){var l=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:T,A=n(r)?r._centerToleranceSquared:R,h=o(e,l,f,A,s);if(n(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(t.dot(d,e))*t.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(c.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}}}),c.clone=function(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,l=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=t.subtract(n,a,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i,a,o,u,E,s){this[0]=n(t,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(f[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(t[E.getElementIndex(f[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=f[i];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,A=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(A-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5],i[6]=t[e+6],i[7]=t[e+7],i[8]=t[e+8],i},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,f=2*(i-T),A=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=M,e):new E(l,f,A,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,f=-o*a+a*o*u,A=-o,h=s*n,N=a*n;return r(e)?(e[0]=c,e[1]=R,e[2]=A,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new E(c,_,T,R,l,f,A,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=i,e[6]=0,e[7]=-i,e[8]=n,e):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=n,e):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],f=[2,2,1],A=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,i=10,a=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,A),E.transpose(A,h),E.multiply(R,A,R),E.multiply(h,R,R),E.multiply(T,A,T),++a>2&&(++o,a=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*i-r*_,e[2]=r*u-o*i,e[3]=s*u-a*_,e[4]=n*_-s*i,e[5]=a*i-n*u,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}o.fromElements=function(t,e,r,i,a){return n(a)?(a.x=t,a.y=e,a.z=r,a.w=i,a):new o(t,e,r,i)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r++],i.w=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var i=0;i<r;++i)o.pack(t[i],e,4*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)&&a.equalsEpsilon(t.w,e.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){ -"use strict";function c(t,e,n,i,a,o,u,E,s,c,_,T,R,l,f,A){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(A,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),i(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(i(t))return i(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return i(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,a){return n=r(n,t.ZERO),i(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-A+N,I=2*(s-h),S=2*(_+f),M=2*(s+h),O=-E+R-A+N,m=2*(l-T),y=2*(_-f),p=2*(l+T),C=-E-R+A+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return i(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return i(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var r=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,f=_.y,A=_.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=l*I+f*S+A*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,d,m,-l,-f,-A,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(t,e,n,i){t=r(t,r.EMPTY_OBJECT);var a=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,f=a+s,A=o+c,h=e+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=f,i[13]=A,i[14]=h,i[15]=N,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return i(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var f=new t;c.getMaximumScale=function(e){return c.getScale(e,f),t.maximumComponent(f)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],M=e[3],O=e[4],m=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],P=e[11],F=e[12],w=e[13],v=e[14],g=e[15],x=r*d+u*I+_*S+f*M,D=i*d+E*I+T*S+A*M,B=a*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+f*p,b=i*O+E*m+T*y+A*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,q=r*C+u*U+_*L+f*P,H=i*C+E*U+T*L+A*P,W=a*C+s*U+R*L+h*P,Y=o*C+c*U+l*L+N*P,K=r*F+u*w+_*v+f*g,k=i*F+E*w+T*v+A*g,Z=a*F+s*w+R*v+h*g,j=o*F+c*w+l*v+N*g;return n[0]=x,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],M=e[9],O=e[10],m=e[12],y=e[13],p=e[14],C=r*f+o*A+s*h,U=i*f+u*A+c*h,L=a*f+E*A+_*h,P=r*N+o*d+s*I,F=i*N+u*d+c*I,w=a*N+E*d+_*I,v=r*S+o*M+s*O,g=i*S+u*M+c*O,x=a*S+E*M+_*O,D=r*m+o*y+s*p+T,B=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=P,n[5]=F,n[6]=w,n[7]=0,n[8]=v,n[9]=g,n[10]=x,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*f+o*A+s*h,y=i*f+u*A+c*h,p=a*f+E*A+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var A=new t;c.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,c.multiplyByScale(t,A,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||i(t)&&i(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||i(t)&&i(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],f=t[2],A=t[6],S=t[10],M=t[14],O=t[3],m=t[7],y=t[11],p=t[15],C=S*p,U=M*y,L=A*p,P=M*m,F=A*y,w=S*m,v=f*p,g=M*O,x=f*y,D=S*O,B=f*m,z=A*O,G=C*T+P*R+F*l-(U*T+L*R+w*l),b=U*_+v*R+D*l-(C*_+g*R+x*l),X=L*_+g*T+B*l-(P*_+v*T+z*l),V=w*_+x*T+z*R-(F*_+D*T+B*R),q=U*i+L*a+w*o-(C*i+P*a+F*o),H=C*r+g*a+x*o-(U*r+v*a+D*o),W=P*r+v*i+z*o-(L*r+g*i+B*o),Y=F*r+D*i+B*a-(w*r+x*i+z*a);C=a*l,U=o*R,L=i*l,P=o*T,F=i*R,w=a*T,v=r*l,g=o*_,x=r*R,D=a*_,B=r*T,z=i*_;var K=C*m+P*y+F*p-(U*m+L*y+w*p),k=U*O+v*y+D*p-(C*O+g*y+x*p),Z=L*O+g*m+B*p-(P*O+v*m+z*p),j=w*O+x*m+z*y-(F*O+D*m+B*y),Q=L*S+w*M+U*A-(F*M+C*A+P*S),J=x*M+C*f+g*S-(v*S+D*M+U*f),$=v*A+z*M+P*f-(B*M+L*f+g*A),tt=B*S+F*f+D*A-(x*A+z*S+w*f),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=K*et,n[9]=k*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-i*R,f=-a*_-o*T-u*R,A=-E*_-s*T-c*R;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=f,e[14]=A,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i.west=t[e++],i.south=t[e++],i.east=t[e++],i.north=t[e],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,i,a,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=t,o.south=e,o.east=i,o.north=a,o):new E(t,e,i,a)},E.fromRadians=function(t,e,i,a,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(i,0),o.north=n(a,0),o):new E(t,e,i,a)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=i,e.north=c,e):new E(n,s,i,c)},E.fromCartesianArray=function(t,e,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var f=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,n){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,f=s;f.height=i,f.longitude=l,f.latitude=_,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.latitude=T,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=e.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,M=new t,O=new t,m=new t;T.fromPoints=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),a=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,f),E=t.clone(r,A),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&t.clone(r,a),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,a,I)),P=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),w=a,v=E,g=L;P>g&&(g=P,w=o,v=s),F>g&&(g=F,w=u,v=c);var x=S;x.x=.5*(w.x+v.x),x.y=.5*(w.y+v.y),x.z=.5*(w.z+v.z);var D=t.magnitudeSquared(t.subtract(v,x,I)),B=Math.sqrt(D),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*r.x)/H,x.y=(B*x.y+W*r.y)/H,x.z=(B*x.z+W*r.z)/H}}return B<X?(t.clone(x,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,a,o,u){if(i(u)||(u=new T),!i(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=a,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*R,f.z=E.z+.5*l,u};var P=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,a.WGS84),n=r(n,0);var u;return i(t)&&(u=_.subsample(t,e,n,P)),T.fromPoints(u,o)},T.fromVertices=function(e,n,a,o){if(i(o)||(o=new T),!i(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),a=r(a,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,f),_=t.clone(u,A),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=a){var L=e[U]+n.x,P=e[U+1]+n.y,F=e[U+2]+n.z;u.x=L,u.y=P,u.z=F,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),P<s.y&&t.clone(u,s),P>y.y&&t.clone(u,y),F<c.z&&t.clone(u,c),F>p.z&&t.clone(u,p)}var w=t.magnitudeSquared(t.subtract(_,E,I)),v=t.magnitudeSquared(t.subtract(y,s,I)),g=t.magnitudeSquared(t.subtract(p,c,I)),x=E,D=_,B=w;v>B&&(B=v,x=s,D=y),g>B&&(B=g,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,m),H=0;for(U=0;U<C;U+=a){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var k=K-b;z.x=(b*z.x+k*u.x)/K,z.y=(b*z.y+k*u.y)/K,z.z=(b*z.z+k*u.z)/K}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(i(r)||(r=new T),!i(e)||!i(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,R),u=t.clone(a,l),E=t.clone(a,f),s=t.clone(a,A),c=t.clone(a,h),_=t.clone(a,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var P=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),w=t.magnitudeSquared(t.subtract(_,E,I)),v=o,g=s,x=P;F>x&&(x=F,v=u,g=c),w>x&&(x=w,v=E,g=_);var D=S;D.x=.5*(v.x+g.x),D.y=.5*(v.y+g.y),D.z=.5*(v.z+g.z);var B=t.magnitudeSquared(t.subtract(g,D,I)),z=Math.sqrt(B),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(a,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<V?(t.clone(D,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){i(r)||(r=new T);var a=r.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),r.radius=t.distance(a,n),r},T.fromEllipsoid=function(e,n){return i(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var F=new t;T.fromBoundingSpheres=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var a=[],o=0;o<r;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var w=new t,v=new t,g=new t;T.fromOrientedBoundingBox=function(e,n){i(n)||(n=new T);var r=e.halfAxes,a=s.getColumn(r,0,w),o=s.getColumn(r,1,v),u=s.getColumn(r,2,g),E=t.magnitude(a),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(i(e))return i(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var i=t.center;return e[n++]=i.x,e[n++]=i.y,e[n++]=i.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),i(n)||(n=new T);var a=n.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],n.radius=t[e],n};var x=new t,D=new t;T.union=function(e,n,r){i(r)||(r=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,x),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(R,a,R),t.clone(R,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,a){i(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),K=0;K<8;++K)Y[K]=new t;var k=new o;return T.projectTo2D=function(e,n,i){n=r(n,k);var a=n.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),R=t.negate(s,q),l=Y,f=l[0];t.add(E,c,f),t.add(f,s,f),f=l[1],t.add(E,c,f),t.add(f,R,f),f=l[2],t.add(E,_,f),t.add(f,R,f),f=l[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=l[4],t.add(E,c,f),t.add(f,s,f),f=l[5],t.add(E,c,f),t.add(f,R,f),f=l[6],t.add(E,_,f),t.add(f,R,f),f=l[7],t.add(E,_,f),t.add(f,s,f);for(var A=l.length,h=0;h<A;++h){var N=l[h];t.add(o,N,N);var d=a.cartesianToCartographic(N,W);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||i(e)&&i(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n){this.x=e(t,0),this.y=e(n,0)}o.fromElements=function(t,e,r){return n(r)?(r.x=t,r.y=e,r):new o(t,e)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e):new o(t.x,t.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=2*r:e=new Array(2*r);for(var i=0;i<r;++i)o.pack(t[i],e,2*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/2:e=new Array(r/2);for(var i=0;i<r;i+=2){var a=i/2;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y)},o.minimumComponent=function(t){return Math.min(t.x,t.y)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){return o.normalize(t,s),o.normalize(e,c),a.acosClamped(o.dot(s,c))};var _=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Y,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)},o.ZERO=i(new o(0,0)),o.UNIT_X=i(new o(1,0)),o.UNIT_Y=i(new o(0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]; -}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,M=r(t[1]))}return S}function a(){return i()&&M}function o(){if(!e(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(O=!0,m=r(t[1]))}return O}function u(){return o()&&m}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,P=r(t[1]))}return L}function R(){return T()&&P}function l(){if(!e(F)){F=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(F=!0,w=r(t[1]))}return F}function f(){return e(v)||(v=/Windows/i.test(I.appVersion)),v}function A(){return l()&&w}function h(){return e(g)||(g="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),g}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(x=n)}return D}function d(){return N()?x:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,P,F,w,v,g,x,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/CylinderGeometryLibrary",["./Math"],function(t){"use strict";var e={};return e.computePositions=function(e,n,r,i,a){var o,u=.5*e,E=-u,s=i+i,c=a?2*s:s,_=new Float64Array(3*c),T=0,R=0,l=a?3*s:0,f=a?3*(s+i):3*i;for(o=0;o<i;o++){var A=o/i*t.TWO_PI,h=Math.cos(A),N=Math.sin(A),d=h*r,I=N*r,S=h*n,M=N*n;_[R+l]=d,_[R+l+1]=I,_[R+l+2]=E,_[R+f]=S,_[R+f+1]=M,_[R+f+2]=u,R+=3,a&&(_[T++]=d,_[T++]=I,_[T++]=E,_[T++]=S,_[T++]=M,_[T++]=u)}return _},e}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(t){switch(t){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,i){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(a)}),define("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(t,e,n,r,i,a,o,u,E,s,c,_,T){"use strict";function R(t){t=a(t,a.EMPTY_OBJECT);var e=t.length,n=t.topRadius,r=t.bottomRadius,i=a(t.slices,128),o=Math.max(a(t.numberOfVerticalLines,16),0);this._length=e,this._topRadius=n,this._bottomRadius=r,this._slices=i,this._numberOfVerticalLines=o,this._workerName="createCylinderOutlineGeometry"}var l=new e;R.packedLength=5,R.pack=function(t,e,n){return n=a(n,0),e[n++]=t._length,e[n++]=t._topRadius,e[n++]=t._bottomRadius,e[n++]=t._slices,e[n]=t._numberOfVerticalLines,e};var f={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return R.unpack=function(t,e,n){e=a(e,0);var r=t[e++],i=t[e++],u=t[e++],E=t[e++],s=t[e];return o(n)?(n._length=r,n._topRadius=i,n._bottomRadius=u,n._slices=E,n._numberOfVerticalLines=s,n):(f.length=r,f.topRadius=i,f.bottomRadius=u,f.slices=E,f.numberOfVerticalLines=s,new R(f))},R.createGeometry=function(a){var o=a._length,u=a._topRadius,R=a._bottomRadius,f=a._slices,A=a._numberOfVerticalLines;if(!(o<=0||u<0||R<0||0===u&&0===R)){var h,N=2*f,d=i.computePositions(o,u,R,f,!1),I=2*f;if(A>0){var S=Math.min(A,f);h=Math.round(f/S),I+=S}for(var M=_.createTypedArray(N,2*I),O=0,m=0;m<f-1;m++)M[O++]=m,M[O++]=m+1,M[O++]=m+f,M[O++]=m+1+f;if(M[O++]=f-1,M[O++]=0,M[O++]=f+f-1,M[O++]=f,A>0)for(m=0;m<f;m+=h)M[O++]=m,M[O++]=m+f;var y=new c;y.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:d}),l.x=.5*o,l.y=Math.max(R,u);var p=new t(n.ZERO,e.magnitude(l));return new E({attributes:y,indices:M,primitiveType:T.LINES,boundingSphere:p})}},R}),define("Workers/createCylinderOutlineGeometry",["../Core/CylinderOutlineGeometry","../Core/defined"],function(t,e){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var i={};return i.typeOf={},i.defined=function(r,i){if(!t(i))throw new e(n(r))},i.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},i.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},i.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},i.typeOf.number.lessThan=function(t,n,r){if(i.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(t,n,r){if(i.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},i.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},i}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,f=i.z,A=c*c*R*R,h=_*_*l*l,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,P,F,w,v,x,g,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*M),L=1/(1+B*O),P=1/(1+B*m),F=U*U,w=L*L,v=P*P,x=F*U,g=w*L,D=v*P,p=A*F+h*w+N*v-1,C=A*x*M+h*g*O+N*D*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*P,s):new t(c*U,_*L,T*P)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,e,r){this.longitude=n(t,0),this.latitude=n(e,0),this.height=n(r,0)}u.fromRadians=function(t,e,i,a){return i=n(i,0),r(a)?(a.longitude=t,a.latitude=e,a.height=i,a):new u(t,e,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(e,n,i){var l=r(n)?n.oneOverRadii:_,f=r(n)?n.oneOverRadiiSquared:T,A=r(n)?n._centerToleranceSquared:R,h=o(e,l,f,A,s);if(r(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(t.dot(d,e))*t.magnitude(d);return r(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(c.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}}}),c.clone=function(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,l=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=t.subtract(n,a,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i,a,o,u,E,s){this[0]=n(t,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(f[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(t[E.getElementIndex(f[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=f[i];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,A=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(A-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5],i[6]=t[e+6],i[7]=t[e+7],i[8]=t[e+8],i},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,f=2*(i-T),A=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=M,e):new E(l,f,A,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,f=-s*i+a*o*u,A=-o,h=s*n,N=a*n;return r(e)?(e[0]=c,e[1]=R,e[2]=A,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new E(c,_,T,R,l,f,A,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=i,e[6]=0,e[7]=-i,e[8]=n,e):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=n,e):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],f=[2,2,1],A=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,i=10,a=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,A),E.transpose(A,h),E.multiply(R,A,R),E.multiply(h,R,R),E.multiply(T,A,T),++a>2&&(++o,a=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*i-r*_,e[2]=r*u-o*i,e[3]=s*u-a*_,e[4]=n*_-s*i,e[5]=a*i-n*u,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}o.fromElements=function(t,e,r,i,a){return n(a)?(a.x=t,a.y=e,a.z=r,a.w=i,a):new o(t,e,r,i)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r++],i.w=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var i=0;i<r;++i)o.pack(t[i],e,4*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)&&a.equalsEpsilon(t.w,e.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){ +"use strict";function c(t,e,n,i,a,o,u,E,s,c,_,T,R,l,f,A){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(A,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),i(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(i(t))return i(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return i(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,a){return n=r(n,t.ZERO),i(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-A+N,I=2*(s-h),S=2*(_+f),M=2*(s+h),O=-E+R-A+N,m=2*(l-T),y=2*(_-f),p=2*(l+T),C=-E-R+A+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return i(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return i(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var r=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,f=_.y,A=_.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=l*I+f*S+A*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,d,m,-l,-f,-A,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(t,e,n,i){t=r(t,r.EMPTY_OBJECT);var a=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,f=a+s,A=o+c,h=e+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=f,i[13]=A,i[14]=h,i[15]=N,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return i(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var f=new t;c.getMaximumScale=function(e){return c.getScale(e,f),t.maximumComponent(f)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],M=e[3],O=e[4],m=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],P=e[11],F=e[12],w=e[13],v=e[14],x=e[15],g=r*d+u*I+_*S+f*M,D=i*d+E*I+T*S+A*M,B=a*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+f*p,b=i*O+E*m+T*y+A*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,q=r*C+u*U+_*L+f*P,H=i*C+E*U+T*L+A*P,W=a*C+s*U+R*L+h*P,Y=o*C+c*U+l*L+N*P,K=r*F+u*w+_*v+f*x,k=i*F+E*w+T*v+A*x,Z=a*F+s*w+R*v+h*x,j=o*F+c*w+l*v+N*x;return n[0]=g,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],M=e[9],O=e[10],m=e[12],y=e[13],p=e[14],C=r*f+o*A+s*h,U=i*f+u*A+c*h,L=a*f+E*A+_*h,P=r*N+o*d+s*I,F=i*N+u*d+c*I,w=a*N+E*d+_*I,v=r*S+o*M+s*O,x=i*S+u*M+c*O,g=a*S+E*M+_*O,D=r*m+o*y+s*p+T,B=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=P,n[5]=F,n[6]=w,n[7]=0,n[8]=v,n[9]=x,n[10]=g,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*f+o*A+s*h,y=i*f+u*A+c*h,p=a*f+E*A+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,L=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var A=new t;c.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,c.multiplyByScale(t,A,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||i(t)&&i(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||i(t)&&i(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],f=t[2],A=t[6],S=t[10],M=t[14],O=t[3],m=t[7],y=t[11],p=t[15],C=S*p,U=M*y,L=A*p,P=M*m,F=A*y,w=S*m,v=f*p,x=M*O,g=f*y,D=S*O,B=f*m,z=A*O,G=C*T+P*R+F*l-(U*T+L*R+w*l),b=U*_+v*R+D*l-(C*_+x*R+g*l),X=L*_+x*T+B*l-(P*_+v*T+z*l),V=w*_+g*T+z*R-(F*_+D*T+B*R),q=U*i+L*a+w*o-(C*i+P*a+F*o),H=C*r+x*a+g*o-(U*r+v*a+D*o),W=P*r+v*i+z*o-(L*r+x*i+B*o),Y=F*r+D*i+B*a-(w*r+g*i+z*a);C=a*l,U=o*R,L=i*l,P=o*T,F=i*R,w=a*T,v=r*l,x=o*_,g=r*R,D=a*_,B=r*T,z=i*_;var K=C*m+P*y+F*p-(U*m+L*y+w*p),k=U*O+v*y+D*p-(C*O+x*y+g*p),Z=L*O+x*m+B*p-(P*O+v*m+z*p),j=w*O+g*m+z*y-(F*O+D*m+B*y),Q=L*S+w*M+U*A-(F*M+C*A+P*S),J=g*M+C*f+x*S-(v*S+D*M+U*f),$=v*A+z*M+P*f-(B*M+L*f+x*A),tt=B*S+F*f+D*A-(g*A+z*S+w*f),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=K*et,n[9]=k*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-i*R,f=-a*_-o*T-u*R,A=-E*_-s*T-c*R;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=f,e[14]=A,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i.west=t[e++],i.south=t[e++],i.east=t[e++],i.north=t[e],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,i,a,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=t,o.south=e,o.east=i,o.north=a,o):new E(t,e,i,a)},E.fromRadians=function(t,e,i,a,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(i,0),o.north=n(a,0),o):new E(t,e,i,a)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=i,e.north=c,e):new E(n,s,i,c)},E.fromCartesianArray=function(t,e,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var f=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,n){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,f=s;f.height=i,f.longitude=l,f.latitude=_,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.latitude=T,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=e.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,M=new t,O=new t,m=new t;T.fromPoints=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),a=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,f),E=t.clone(r,A),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&t.clone(r,a),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,a,I)),P=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),w=a,v=E,x=L;P>x&&(x=P,w=o,v=s),F>x&&(x=F,w=u,v=c);var g=S;g.x=.5*(w.x+v.x),g.y=.5*(w.y+v.y),g.z=.5*(w.z+v.z);var D=t.magnitudeSquared(t.subtract(v,g,I)),B=Math.sqrt(D),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,g,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;g.x=(B*g.x+W*r.x)/H,g.y=(B*g.y+W*r.y)/H,g.z=(B*g.z+W*r.z)/H}}return B<X?(t.clone(g,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,a,o,u){if(i(u)||(u=new T),!i(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=a,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*R,f.z=E.z+.5*l,u};var P=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,a.WGS84),n=r(n,0);var u;return i(t)&&(u=_.subsample(t,e,n,P)),T.fromPoints(u,o)},T.fromVertices=function(e,n,a,o){if(i(o)||(o=new T),!i(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),a=r(a,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,f),_=t.clone(u,A),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=a){var L=e[U]+n.x,P=e[U+1]+n.y,F=e[U+2]+n.z;u.x=L,u.y=P,u.z=F,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),P<s.y&&t.clone(u,s),P>y.y&&t.clone(u,y),F<c.z&&t.clone(u,c),F>p.z&&t.clone(u,p)}var w=t.magnitudeSquared(t.subtract(_,E,I)),v=t.magnitudeSquared(t.subtract(y,s,I)),x=t.magnitudeSquared(t.subtract(p,c,I)),g=E,D=_,B=w;v>B&&(B=v,g=s,D=y),x>B&&(B=x,g=c,D=p);var z=S;z.x=.5*(g.x+D.x),z.y=.5*(g.y+D.y),z.z=.5*(g.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,m),H=0;for(U=0;U<C;U+=a){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var k=K-b;z.x=(b*z.x+k*u.x)/K,z.y=(b*z.y+k*u.y)/K,z.z=(b*z.z+k*u.z)/K}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(i(r)||(r=new T),!i(e)||!i(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,R),u=t.clone(a,l),E=t.clone(a,f),s=t.clone(a,A),c=t.clone(a,h),_=t.clone(a,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),L<E.z&&t.clone(a,E),L>_.z&&t.clone(a,_)}var P=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),w=t.magnitudeSquared(t.subtract(_,E,I)),v=o,x=s,g=P;F>g&&(g=F,v=u,x=c),w>g&&(g=w,v=E,x=_);var D=S;D.x=.5*(v.x+x.x),D.y=.5*(v.y+x.y),D.z=.5*(v.z+x.z);var B=t.magnitudeSquared(t.subtract(x,D,I)),z=Math.sqrt(B),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(a,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(a,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<V?(t.clone(D,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){i(r)||(r=new T);var a=r.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),r.radius=t.distance(a,n),r},T.fromEllipsoid=function(e,n){return i(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var F=new t;T.fromBoundingSpheres=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var a=[],o=0;o<r;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var w=new t,v=new t,x=new t;T.fromOrientedBoundingBox=function(e,n){i(n)||(n=new T);var r=e.halfAxes,a=s.getColumn(r,0,w),o=s.getColumn(r,1,v),u=s.getColumn(r,2,x);return t.add(a,o,a),t.add(a,u,a),n.center=t.clone(e.center,n.center),n.radius=t.magnitude(a),n},T.clone=function(e,n){if(i(e))return i(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var i=t.center;return e[n++]=i.x,e[n++]=i.y,e[n++]=i.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),i(n)||(n=new T);var a=n.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],n.radius=t[e],n};var g=new t,D=new t;T.union=function(e,n,r){i(r)||(r=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,g),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(R,a,R),t.clone(R,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,a){i(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),K=0;K<8;++K)Y[K]=new t;var k=new o;return T.projectTo2D=function(e,n,i){n=r(n,k);var a=n.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),R=t.negate(s,q),l=Y,f=l[0];t.add(E,c,f),t.add(f,s,f),f=l[1],t.add(E,c,f),t.add(f,R,f),f=l[2],t.add(E,_,f),t.add(f,R,f),f=l[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=l[4],t.add(E,c,f),t.add(f,s,f),f=l[5],t.add(E,c,f),t.add(f,R,f),f=l[6],t.add(E,_,f),t.add(f,R,f),f=l[7],t.add(E,_,f),t.add(f,s,f);for(var A=l.length,h=0;h<A;++h){var N=l[h];t.add(o,N,N);var d=a.cartesianToCartographic(N,W);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||i(e)&&i(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n){this.x=e(t,0),this.y=e(n,0)}o.fromElements=function(t,e,r){return n(r)?(r.x=t,r.y=e,r):new o(t,e)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e):new o(t.x,t.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=2*r:e=new Array(2*r);for(var i=0;i<r;++i)o.pack(t[i],e,2*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/2:e=new Array(r/2);for(var i=0;i<r;i+=2){var a=i/2;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y)},o.minimumComponent=function(t){return Math.min(t.x,t.y)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){return o.normalize(t,s),o.normalize(e,c),a.acosClamped(o.dot(s,c))};var _=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Y,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)},o.ZERO=i(new o(0,0)),o.UNIT_X=i(new o(1,0)),o.UNIT_Y=i(new o(0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{ +get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,M=r(t[1]))}return S}function a(){return i()&&M}function o(){if(!e(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(O=!0,m=r(t[1]))}return O}function u(){return o()&&m}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,P=r(t[1]))}return L}function R(){return T()&&P}function l(){if(!e(F)){F=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(F=!0,w=r(t[1]))}return F}function f(){return e(v)||(v=/Windows/i.test(I.appVersion)),v}function A(){return l()&&w}function h(){return e(x)||(x="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),x}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(g=n)}return D}function d(){return N()?g:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,P,F,w,v,x,g,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/CylinderGeometryLibrary",["./Math"],function(t){"use strict";var e={};return e.computePositions=function(e,n,r,i,a){var o,u=.5*e,E=-u,s=i+i,c=a?2*s:s,_=new Float64Array(3*c),T=0,R=0,l=a?3*s:0,f=a?3*(s+i):3*i;for(o=0;o<i;o++){var A=o/i*t.TWO_PI,h=Math.cos(A),N=Math.sin(A),d=h*r,I=N*r,S=h*n,M=N*n;_[R+l]=d,_[R+l+1]=I,_[R+l+2]=E,_[R+f]=S,_[R+f+1]=M,_[R+f+2]=u,R+=3,a&&(_[T++]=d,_[T++]=I,_[T++]=E,_[T++]=S,_[T++]=M,_[T++]=u)}return _},e}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(t){switch(t){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,i){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(a)}),define("Core/CylinderOutlineGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CylinderGeometryLibrary","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./PrimitiveType"],function(t,e,n,r,i,a,o,u,E,s,c,_,T){"use strict";function R(t){t=a(t,a.EMPTY_OBJECT);var e=t.length,n=t.topRadius,r=t.bottomRadius,i=a(t.slices,128),o=Math.max(a(t.numberOfVerticalLines,16),0);this._length=e,this._topRadius=n,this._bottomRadius=r,this._slices=i,this._numberOfVerticalLines=o,this._workerName="createCylinderOutlineGeometry"}var l=new e;R.packedLength=5,R.pack=function(t,e,n){return n=a(n,0),e[n++]=t._length,e[n++]=t._topRadius,e[n++]=t._bottomRadius,e[n++]=t._slices,e[n]=t._numberOfVerticalLines,e};var f={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0};return R.unpack=function(t,e,n){e=a(e,0);var r=t[e++],i=t[e++],u=t[e++],E=t[e++],s=t[e];return o(n)?(n._length=r,n._topRadius=i,n._bottomRadius=u,n._slices=E,n._numberOfVerticalLines=s,n):(f.length=r,f.topRadius=i,f.bottomRadius=u,f.slices=E,f.numberOfVerticalLines=s,new R(f))},R.createGeometry=function(a){var o=a._length,u=a._topRadius,R=a._bottomRadius,f=a._slices,A=a._numberOfVerticalLines;if(!(o<=0||u<0||R<0||0===u&&0===R)){var h,N=2*f,d=i.computePositions(o,u,R,f,!1),I=2*f;if(A>0){var S=Math.min(A,f);h=Math.round(f/S),I+=S}for(var M=_.createTypedArray(N,2*I),O=0,m=0;m<f-1;m++)M[O++]=m,M[O++]=m+1,M[O++]=m+f,M[O++]=m+1+f;if(M[O++]=f-1,M[O++]=0,M[O++]=f+f-1,M[O++]=f,A>0)for(m=0;m<f;m+=h)M[O++]=m,M[O++]=m+f;var y=new c;y.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:d}),l.x=.5*o,l.y=Math.max(R,u);var p=new t(n.ZERO,e.magnitude(l));return new E({attributes:y,indices:M,primitiveType:T.LINES,boundingSphere:p})}},R}),define("Workers/createCylinderOutlineGeometry",["../Core/CylinderOutlineGeometry","../Core/defined"],function(t,e){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createEllipseGeometry.js b/engines/Cesium/Workers/createEllipseGeometry.js index fc54a09..b1e75a0 100644 --- a/engines/Cesium/Workers/createEllipseGeometry.js +++ b/engines/Cesium/Workers/createEllipseGeometry.js @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var f=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,f=n*u-a*o;return r.x=c,r.y=l,r.z=f,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:E,c=Math.cos(n);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(n),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),r(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,f=r.y,d=r.z,h=a.x,E=a.y,p=a.z,m=l*l*h*h,y=f*f*E*E,_=d*d*p*p,T=m+y+_,R=Math.sqrt(1/T),v=e.multiplyByScalar(r,R,i);if(T<s)return isFinite(R)?e.clone(v,c):void 0;var A=u.x,S=u.y,N=u.z,I=o;I.x=v.x*A*2,I.y=v.y*S*2,I.z=v.z*N*2;var g,O,w,M,x,C,P,D,L,U,F,b=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),z=0;do{b-=z,w=1/(1+b*A),M=1/(1+b*S),x=1/(1+b*N),C=w*w,P=M*M,D=x*x,L=C*w,U=P*M,F=D*x,g=m*C+y*P+_*D-1,O=m*L*A+y*U*S+_*F*N;var B=-2*O;z=g/B}while(Math.abs(g)>n.EPSILON12);return t(c)?(c.x=l*w,c.y=f*M,c.z=d*x,c):new e(l*w,f*M,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,p=r(n)?n.oneOverRadiiSquared:d,m=r(n)?n._centerToleranceSquared:h,y=o(t,E,p,m,c);if(r(y)){var _=e.multiplyComponents(y,p,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),R=Math.atan2(_.y,_.x),v=Math.asin(_.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=R,a.latitude=v,a.height=A,a):new u(R,v,A)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,r){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._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,r){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,p=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,E);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(p[r],E[r])];t+=2*n*n}return Math.sqrt(t)}function f(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(p[i],E[i])]);o>n&&(a=i,n=o)}var c=1,l=0,f=E[a],d=p[a];if(Math.abs(e[s.getElementIndex(d,f)])>r){var h,m=e[s.getElementIndex(d,d)],y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(d,f)],T=(m-y)/2/_;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=r-u-f+h,p=2*(a-d),m=2*(i+l),y=2*(a+d),_=-r+u-f+h,T=2*(c-o),R=2*(i-l),v=2*(c+o),A=-r-u+f+h;return n(t)?(t[0]=E,t[1]=y,t[2]=R,t[3]=p,t[4]=_,t[5]=v,t[6]=m,t[7]=T,t[8]=A,t):new s(E,p,m,y,_,T,R,v,A)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=r*u,E=i*a+c*o*u,p=-o*i+i*o*u,m=-o,y=c*r,_=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=m,t[3]=f,t[4]=E,t[5]=y,t[6]=d,t[7]=p,t[8]=_,t):new s(l,f,d,h,E,p,m,y,_)},s.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var d=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),r};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},s.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},s.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},s.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],p=[2,2,1],m=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,i=0,o=0;n(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=r*c(h);o<a&&l(h)>E;)f(h,m),s.transpose(m,y),s.multiply(h,m,h),s.multiply(y,h,h),s.multiply(d,m,d),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-n*f,t[2]=n*u-o*a,t[3]=c*u-i*f,t[4]=r*f-c*a,t[5]=i*a-r*u,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/d;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){ -"use strict";function l(e,t,r,a,i,o,u,s,c,l,f,d,h,E,p,m){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(p,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(d,0),this[15]=n(m,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new l),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,r,i){return r=n(r,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,i):new l(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,p=t.y*t.w,m=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-h-m+_,R=2*(c-y),v=2*(f+p),A=2*(c+y),S=-s+h-m+_,N=2*(E-d),I=2*(f-p),g=2*(E+d),O=-s-h+m+_;return n[0]=T*i,n[1]=A*i,n[2]=I*i,n[3]=0,n[4]=R*o,n[5]=S*o,n[6]=g*o,n[7]=0,n[8]=v*u,n[9]=N*u,n[10]=O*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,r){var n=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,p=f.y,m=f.z,y=h.x,_=h.y,T=h.z,R=n.x,v=n.y,A=n.z,S=u*-R+s*-v+c*-A,N=y*-R+_*-v+T*-A,I=E*R+p*v+m*A;return a(r)?(r[0]=u,r[1]=y,r[2]=-E,r[3]=0,r[4]=s,r[5]=_,r[6]=-p,r[7]=0,r[8]=c,r[9]=T,r[10]=-m,r[11]=0,r[12]=S,r[13]=N,r[14]=I,r[15]=1,r):new l(u,s,c,S,y,_,T,N,-E,-p,-m,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,f=-(n+r)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),d=c,h=l,E=f,p=i+c,m=o+l,y=t+f,_=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=p,a[13]=m,a[14]=y,a[15]=_,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var E=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),r};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],p=e[12],m=e[13],y=e[14],_=e[15],T=t[0],R=t[1],v=t[2],A=t[3],S=t[4],N=t[5],I=t[6],g=t[7],O=t[8],w=t[9],M=t[10],x=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=n*T+u*R+f*v+p*A,F=a*T+s*R+d*v+m*A,b=i*T+c*R+h*v+y*A,z=o*T+l*R+E*v+_*A,B=n*S+u*N+f*I+p*g,G=a*S+s*N+d*I+m*g,q=i*S+c*N+h*I+y*g,V=o*S+l*N+E*I+_*g,W=n*O+u*w+f*M+p*x,X=a*O+s*w+d*M+m*x,H=i*O+c*w+h*M+y*x,Y=o*O+l*w+E*M+_*x,k=n*C+u*P+f*D+p*L,j=a*C+s*P+d*D+m*L,Z=i*C+c*P+h*D+y*L,K=o*C+l*P+E*D+_*L;return r[0]=U,r[1]=F,r[2]=b,r[3]=z,r[4]=B,r[5]=G,r[6]=q,r[7]=V,r[8]=W,r[9]=X,r[10]=H,r[11]=Y,r[12]=k,r[13]=j,r[14]=Z,r[15]=K,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],p=t[0],m=t[1],y=t[2],_=t[4],T=t[5],R=t[6],v=t[8],A=t[9],S=t[10],N=t[12],I=t[13],g=t[14],O=n*p+o*m+c*y,w=a*p+u*m+l*y,M=i*p+s*m+f*y,x=n*_+o*T+c*R,C=a*_+u*T+l*R,P=i*_+s*T+f*R,D=n*v+o*A+c*S,L=a*v+u*A+l*S,U=i*v+s*A+f*S,F=n*N+o*I+c*g+d,b=a*N+u*I+l*g+h,z=i*N+s*I+f*g+E;return r[0]=O,r[1]=w,r[2]=M,r[3]=0,r[4]=x,r[5]=C,r[6]=P,r[7]=0,r[8]=D,r[9]=L,r[10]=U,r[11]=0,r[12]=F,r[13]=b,r[14]=z,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],p=t[3],m=t[4],y=t[5],_=t[6],T=t[7],R=t[8],v=n*d+o*h+c*E,A=a*d+u*h+l*E,S=i*d+s*h+f*E,N=n*p+o*m+c*y,I=a*p+u*m+l*y,g=i*p+s*m+f*y,O=n*_+o*T+c*R,w=a*_+u*T+l*R,M=i*_+s*T+f*R;return r[0]=v,r[1]=A,r[2]=S,r[3]=0,r[4]=N,r[5]=I,r[6]=g,r[7]=0,r[8]=O,r[9]=w,r[10]=M,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var m=new e;l.multiplyByUniformScale=function(e,t,r){return m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var y=new s,_=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,y),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],p=e[2],m=e[6],v=e[10],A=e[14],S=e[3],N=e[7],I=e[11],g=e[15],O=v*g,w=A*I,M=m*g,x=A*N,C=m*I,P=v*N,D=p*g,L=A*S,U=p*I,F=v*S,b=p*N,z=m*S,B=O*d+x*h+C*E-(w*d+M*h+P*E),G=w*f+D*h+F*E-(O*f+L*h+U*E),q=M*f+L*d+b*E-(x*f+D*d+z*E),V=P*f+U*d+z*h-(C*f+F*d+b*h),W=w*a+M*i+P*o-(O*a+x*i+C*o),X=O*n+L*i+U*o-(w*n+D*i+F*o),H=x*n+D*a+z*o-(M*n+L*a+b*o),Y=C*n+F*a+b*i-(P*n+U*a+z*i);O=i*E,w=o*h,M=a*E,x=o*d,C=a*h,P=i*d,D=n*E,L=o*f,U=n*h,F=i*f,b=n*d,z=a*f;var k=O*N+x*I+C*g-(w*N+M*I+P*g),j=w*S+D*I+F*g-(O*S+L*I+U*g),Z=M*S+L*N+b*g-(x*S+D*N+z*g),K=P*S+U*N+z*I-(C*S+F*N+b*I),J=M*v+P*A+w*m-(C*A+O*m+x*v),Q=U*A+O*p+L*v-(D*v+F*A+w*p),$=D*m+z*A+x*p-(b*A+M*p+L*m),ee=b*v+C*p+F*m-(U*m+z*v+P*p),te=n*B+a*G+i*q+o*V;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=B*te,r[1]=G*te,r[2]=q*te,r[3]=V*te,r[4]=W*te,r[5]=X*te,r[6]=H*te,r[7]=Y*te,r[8]=k*te,r[9]=j*te,r[10]=Z*te,r[11]=K*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-r*f-n*d-a*h,p=-i*f-o*d-u*h,m=-s*f-c*d-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=p,t[14]=m,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(r(e,0)),t=u.toRadians(r(t,0)),a=u.toRadians(r(a,0)),i=u.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var p=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=f,r):new s(a,l,i,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return n(r)?(r.west=l,r.south=d,r.east=f,r.north=h,r):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0),n(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,p=c;p.height=a,p.longitude=E,p.latitude=f,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.latitude=d,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=E,o[l]=t.cartographicToCartesian(p,o[l]),l++,f<0?p.latitude=f:d>0?p.latitude=d:p.latitude=0;for(var m=1;m<8;++m)p.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=t.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=E,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=t.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,E=new e,p=new e,m=new e,y=new e,_=new e,T=new e,R=new e,v=new e,A=new e,S=new e,N=new e;d.fromPoints=function(t,r){if(a(r)||(r=new d),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],T),i=e.clone(n,h),o=e.clone(n,E),u=e.clone(n,p),s=e.clone(n,m),c=e.clone(n,y),l=e.clone(n,_),f=t.length,I=1;I<f;I++){e.clone(t[I],n);var g=n.x,O=n.y,w=n.z;g<i.x&&e.clone(n,i),g>s.x&&e.clone(n,s),O<o.y&&e.clone(n,o),O>c.y&&e.clone(n,c),w<u.z&&e.clone(n,u),w>l.z&&e.clone(n,l)}var M=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,D=s,L=M;x>L&&(L=x,P=o,D=c),C>L&&(L=C,P=u,D=l);var U=v;U.x=.5*(P.x+D.x),U.y=.5*(P.y+D.y),U.z=.5*(P.z+D.z);var F=e.magnitudeSquared(e.subtract(D,U,R)),b=Math.sqrt(F),z=A;z.x=i.x,z.y=o.y,z.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,R),.5,N),q=0;for(I=0;I<f;I++){e.clone(t[I],n);var V=e.magnitude(e.subtract(n,G,R));V>q&&(q=V);var W=e.magnitudeSquared(e.subtract(n,U,R));if(W>F){var X=Math.sqrt(W);b=.5*(b+X),F=b*b;var H=X-b;U.x=(b*U.x+H*n.x)/X,U.y=(b*U.y+H*n.y)/X,U.z=(b*U.z+H*n.z)/X}}return b<q?(e.clone(U,r.center),r.radius=b):(e.clone(G,r.center),r.radius=q),r};var I=new o,g=new e,O=new e,w=new t,M=new t;d.fromRectangle2D=function(e,t,r){return d.fromRectangleWithHeights2D(e,t,0,0,r)},d.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,I),f.southwest(t,w),w.height=i,f.northeast(t,M),M.height=o;var s=r.project(w,g),c=r.project(M,O),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*h,p.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,r,o){t=n(t,i.WGS84),r=n(r,0);var u;return a(e)&&(u=f.subsample(e,t,r,x)),d.fromPoints(u,o)},d.fromVertices=function(t,r,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),i=n(i,3);var u=T;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,p),f=e.clone(u,m),I=e.clone(u,y),g=e.clone(u,_),O=t.length,w=0;w<O;w+=i){var M=t[w]+r.x,x=t[w+1]+r.y,C=t[w+2]+r.z;u.x=M,u.y=x,u.z=C,M<s.x&&e.clone(u,s),M>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>g.z&&e.clone(u,g)}var P=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(I,c,R)),L=e.magnitudeSquared(e.subtract(g,l,R)),U=s,F=f,b=P;D>b&&(b=D,U=c,F=I),L>b&&(b=L,U=l,F=g);var z=v;z.x=.5*(U.x+F.x),z.y=.5*(U.y+F.y),z.z=.5*(U.z+F.z);var B=e.magnitudeSquared(e.subtract(F,z,R)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var V=S;V.x=f.x,V.y=I.y,V.z=g.z;var W=e.multiplyByScalar(e.add(q,V,R),.5,N),X=0;for(w=0;w<O;w+=i){u.x=t[w]+r.x,u.y=t[w+1]+r.y,u.z=t[w+2]+r.z;var H=e.magnitude(e.subtract(u,W,R));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var j=k-G;z.x=(G*z.x+j*u.x)/k,z.y=(G*z.y+j*u.y)/k,z.z=(G*z.z+j*u.z)/k}}return G<X?(e.clone(z,o.center),o.radius=G):(e.clone(W,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new d),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=T;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,p),c=e.clone(i,m),l=e.clone(i,y),f=e.clone(i,_),I=t.length,g=0;g<I;g+=3){var O=t[g]+r[g],w=t[g+1]+r[g+1],M=t[g+2]+r[g+2];i.x=O,i.y=w,i.z=M,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),w<u.y&&e.clone(i,u),w>l.y&&e.clone(i,l),M<s.z&&e.clone(i,s),M>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),D=o,L=c,U=x;C>U&&(U=C,D=u,L=l),P>U&&(U=P,D=s,L=f);var F=v;F.x=.5*(D.x+L.x),F.y=.5*(D.y+L.y),F.z=.5*(D.z+L.z);var b=e.magnitudeSquared(e.subtract(L,F,R)),z=Math.sqrt(b),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,R),.5,N),V=0;for(g=0;g<I;g+=3){i.x=t[g]+r[g],i.y=t[g+1]+r[g+1],i.z=t[g+2]+r[g+2];var W=e.magnitude(e.subtract(i,q,R));W>V&&(V=W);var X=e.magnitudeSquared(e.subtract(i,F,R));if(X>b){var H=Math.sqrt(X);z=.5*(z+H),b=z*z;var Y=H-z;F.x=(z*F.x+Y*i.x)/H,F.y=(z*F.y+Y*i.y)/H,F.z=(z*F.z+Y*i.z)/H}}return z<V?(e.clone(F,n.center),n.radius=z):(e.clone(q,n.center),n.radius=V),n},d.fromCornerPoints=function(t,r,n){a(n)||(n=new d);var i=n.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),n.radius=e.distance(i,r),n},d.fromEllipsoid=function(t,r){return a(r)||(r=new d),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var C=new e;d.fromBoundingSpheres=function(t,r){if(a(r)||(r=new d),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return d.clone(t[0],r);if(2===n)return d.union(t[0],t[1],r);for(var i=[],o=0;o<n;o++)i.push(t[o].center);r=d.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return r.radius=s,r};var P=new e,D=new e,L=new e;d.fromOrientedBoundingBox=function(t,r){a(r)||(r=new d);var n=t.halfAxes,i=c.getColumn(n,0,P),o=c.getColumn(n,1,D),u=c.getColumn(n,2,L),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,f),r},d.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},d.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new d);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var U=new e,F=new e;d.union=function(t,r,n){a(n)||(n=new d);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(h,i,h),e.clone(h,n.center),n.radius=f,n};var b=new e;d.expand=function(t,r,n){n=d.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,b));return a>n.radius&&(n.radius=a),n},d.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,r){return a(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var z=new e;d.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},d.transformWithoutScale=function(e,t,r){return a(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var B=new e;d.computePlaneDistances=function(t,r,n,i){a(i)||(i=new s);var o=e.subtract(t.center,r,B),u=e.dot(n,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,W=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,r,a){r=n(r,j);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,W),E=Y,p=E[0];e.add(s,l,p),e.add(p,c,p),p=E[1],e.add(s,l,p),e.add(p,h,p),p=E[2],e.add(s,f,p),e.add(p,h,p),p=E[3],e.add(s,f,p),e.add(p,c,p),e.negate(s,s),p=E[4],e.add(s,l,p),e.add(p,c,p),p=E[5],e.add(s,l,p),e.add(p,h,p),p=E[6],e.add(s,f,p),e.add(p,h,p),p=E[7],e.add(s,f,p),e.add(p,c,p);for(var m=E.length,y=0;y<m;++y){var _=E[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);r.project(T,_)}a=d.fromPoints(E,a),o=a.center;var R=o.x,v=o.y,A=o.z;return o.x=A,o.y=R,o.z=v,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,r){return d.computePlaneDistances(this,e,t,r)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var a=0;a<n;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]; -}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(v)&&(v=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,A=n(e[1]))}return v}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=n(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,g=n(e[1]),g.isNightly=!!e[2])}return I}function c(){return s()&&g}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,w=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,w=n(e[1])))}return O}function f(){return l()&&w}function d(){if(!t(M)){M=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(M=!0,x=n(e[1]))}return M}function h(){return d()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=n(e[1]))}return C}function p(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function m(){return E()&&P}function y(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),L}function _(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(U=r)}return F}function T(){return _()?U:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var v,A,S,N,I,g,O,w,M,x,C,P,D,L,U,F,b={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return b.supportsFullscreen=function(){return r.supportsFullscreen()},b.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},b.supportsWebWorkers=function(){return"undefined"!=typeof Worker},b}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(a[r])||(a[r]=!0,console.warn(e(n,r)))}var a={};return n.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.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(t,r,n){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(n,0)}return a.fromQuaternion=function(e,r){t(r)||(r=new a);var n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(s,u),r.roll=Math.atan2(o,i),r.pitch=-Math.asin(n),r},a.fromDegrees=function(e,r,i,o){return t(o)||(o=new a),o.heading=e*n.RADIANS_PER_DEGREE,o.pitch=r*n.RADIANS_PER_DEGREE,o.roll=i*n.RADIANS_PER_DEGREE,o},a.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},a.equalsEpsilon=function(e,r,a,i){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,a,i)&&n.equalsEpsilon(e.pitch,r.pitch,a,i)&&n.equalsEpsilon(e.roll,r.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.z=r(n,0),this.w=r(a,0)}var f=new e;l.fromAxisAngle=function(t,r,a){var i=r/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,d=Math.cos(i);return n(a)?(a.x=u,a.y=s,a.z=c,a.w=d,a):new l(u,s,c,d)};var d=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var r,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],p=s+f+E;if(p>0)r=Math.sqrt(p+1),u=.5*r,r=.5/r,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*r,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*r,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*r;else{var m=d,y=0;f>s&&(y=1),E>s&&E>f&&(y=2);var _=m[y],T=m[_];r=Math.sqrt(e[c.getElementIndex(y,y)]-e[c.getElementIndex(_,_)]-e[c.getElementIndex(T,T)]+1);var R=h;R[y]=.5*r,r=.5/r,u=(e[c.getElementIndex(T,_)]-e[c.getElementIndex(_,T)])*r,R[_]=(e[c.getElementIndex(_,y)]+e[c.getElementIndex(y,_)])*r,R[T]=(e[c.getElementIndex(T,y)]+e[c.getElementIndex(y,T)])*r,a=-R[0],i=-R[1],o=-R[2]}return n(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,p=new l,m=new l,y=new l;l.fromHeadingPitchRoll=function(t,r,n,i){var o;return t instanceof u?(o=t,i=r):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,r,n)),y=l.fromAxisAngle(e.UNIT_X,o.roll,E),m=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(m,y,m),p=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(p,i,i)};var _=new e,T=new e,R=new l,v=new l,A=new l;l.packedLength=4,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},l.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,r,n){l.unpack(e,4*r,A),l.conjugate(A,A);for(var a=0,i=r-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,A,R),R.w<0&&l.negate(R,R),l.computeAxis(R,_);var u=l.computeAngle(R);n[o]=_.x*u,n[o+1]=_.y*u,n[o+2]=_.z*u}},l.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(r,4*i,v),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,v,o)},l.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var r=1/l.magnitude(e),n=e.x*r,a=e.y*r,i=e.z*r,o=e.w*r;return t.x=n,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var r=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/r,t)},l.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},l.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+n*l+a*c-i*s,d=o*s-n*c+a*l+i*u,h=o*c+n*s-a*u+i*l,E=o*l-n*u-a*s-i*c;return r.x=f,r.y=d,r.z=h,r.w=E,r},l.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},l.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},l.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var S=new l;l.lerp=function(e,t,r,n){return S=l.multiplyByScalar(t,r,S),n=l.multiplyByScalar(e,1-r,n),l.add(S,n,n)};var N=new l,I=new l,g=new l;l.slerp=function(e,t,r,n){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,r,n);var o=Math.acos(a);return I=l.multiplyByScalar(e,Math.sin((1-r)*o),I),g=l.multiplyByScalar(i,Math.sin(r*o),g),n=l.add(I,g,n),l.multiplyByScalar(n,1/Math.sin(o),n)},l.log=function(t,r){var n=s.acosClamped(t.w),a=0;return 0!==n&&(a=n/Math.sin(n)),e.multiplyByScalar(t,a,r)},l.exp=function(t,r){var n=e.magnitude(t),a=0;return 0!==n&&(a=Math.sin(n)/n),r.x=t.x*a,r.y=t.y*a,r.z=t.z*a,r.w=Math.cos(n),r};var O=new e,w=new e,M=new l,x=new l;l.computeInnerQuadrangle=function(t,r,n,a){var i=l.conjugate(r,M);l.multiply(i,n,x);var o=l.log(x,O);l.multiply(i,t,x);var u=l.log(x,w);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,M),l.multiply(r,M,a)},l.squad=function(e,t,r,n,a,i){var o=l.slerp(e,t,a,M),u=l.slerp(r,n,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],b=0;b<7;++b){var z=b+1,B=2*z+1;D[b]=1/(z*B),L[b]=z/B}return D[7]=P/136,L[7]=8*P/17,l.fastSlerp=function(e,t,r,n){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-r,s=r*r,c=u*u,f=7;f>=0;--f)U[f]=(D[f]*s-L[f])*o,F[f]=(D[f]*c-L[f])*o;var d=a*r*(1+U[0]*(1+U[1]*(1+U[2]*(1+U[3]*(1+U[4]*(1+U[5]*(1+U[6]*(1+U[7])))))))),h=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,h,C);return l.multiplyByScalar(t,d,n),l.add(E,n,n)},l.fastSquad=function(e,t,r,n,a,i){var o=l.fastSlerp(e,t,a,M),u=l.fastSlerp(r,n,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,n){"use strict";function a(t,a,i,l,f,d,h,E,p,m){var y=t+a;e.multiplyByScalar(l,Math.cos(y),o),e.multiplyByScalar(i,Math.sin(y),u),e.add(o,u,o);var _=Math.cos(t);_*=_;var T=Math.sin(t);T*=T;var R=d/Math.sqrt(h*_+f*T),v=R/E;return n.fromAxisAngle(o,v,s),r.fromQuaternion(s,c),r.multiplyByVector(c,p,m),e.normalize(m,m),e.multiplyByScalar(m,E,m),m}var i={},o=new e,u=new e,s=new n,c=new r,l=new e,f=new e,d=new e,h=new e;i.raisePositionsToHeight=function(t,r,n){for(var a=r.ellipsoid,i=r.height,o=r.extrudedHeight,u=n?t.length/3*2:t.length/3,s=new Float64Array(3*u),c=t.length,E=n?c:0,p=0;p<c;p+=3){var m=p+1,y=p+2,_=e.fromArray(t,p,l);a.scaleToGeodeticSurface(_,_);var T=e.clone(_,f),R=a.geodeticSurfaceNormal(_,h),v=e.multiplyByScalar(R,i,d);e.add(_,v,_),n&&(e.multiplyByScalar(R,o,v),e.add(T,v,T),s[p+E]=T.x,s[m+E]=T.y,s[y+E]=T.z),s[p]=_.x,s[m]=_.y,s[y]=_.z}return s};var E=new e,p=new e,m=new e;return i.computeEllipsePositions=function(r,n,i){var o=r.semiMinorAxis,u=r.semiMajorAxis,s=r.rotation,c=r.center,h=8*r.granularity,y=o*o,_=u*u,T=u*o,R=e.magnitude(c),v=e.normalize(c,E),A=e.cross(e.UNIT_Z,c,p);A=e.normalize(A,A);var S=e.cross(v,A,m),N=1+Math.ceil(t.PI_OVER_TWO/h),I=t.PI_OVER_TWO/(N-1),g=t.PI_OVER_TWO-N*I;g<0&&(N-=Math.ceil(Math.abs(g)/I));var O,w,M,x,C,P=2*(N*(N+2)),D=n?new Array(3*P):void 0,L=0,U=l,F=f,b=4*N*3,z=b-1,B=0,G=i?new Array(b):void 0;for(g=t.PI_OVER_TWO,U=a(g,s,S,A,y,T,_,R,v,U),n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x),g=t.PI_OVER_TWO-I,O=1;O<N+1;++O){if(U=a(g,s,S,A,y,T,_,R,v,U),F=a(Math.PI-g,s,S,A,y,T,_,R,v,F),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,M=2*O+2,w=1;w<M-1;++w)x=w/(M-1),C=e.lerp(U,F,x,d),D[L++]=C.x,D[L++]=C.y,D[L++]=C.z;D[L++]=F.x,D[L++]=F.y,D[L++]=F.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=F.x,G[B++]=F.y,G[B++]=F.z),g=t.PI_OVER_TWO-(O+1)*I}for(O=N;O>1;--O){if(g=t.PI_OVER_TWO-(O-1)*I,U=a(-g,s,S,A,y,T,_,R,v,U),F=a(g+Math.PI,s,S,A,y,T,_,R,v,F),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,M=2*(O-1)+2,w=1;w<M-1;++w)x=w/(M-1),C=e.lerp(U,F,x,d),D[L++]=C.x,D[L++]=C.y,D[L++]=C.z;D[L++]=F.x,D[L++]=F.y,D[L++]=F.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=F.x,G[B++]=F.y,G[B++]=F.z)}g=t.PI_OVER_TWO,U=a(-g,s,S,A,y,T,_,R,v,U);var q={};return n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,q.positions=D,q.numPts=N),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,q.outerPositions=G),q},i}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1), -this.values=t.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var f,d,h,E,p,m,y,_;r(a.z)?(f=t.subtract(s,a,i),d=t.subtract(c,a,o),h=t.subtract(n,a,u),E=t.dot(f,f),p=t.dot(f,d),m=t.dot(f,h),y=t.dot(d,d),_=t.dot(d,h)):(f=e.subtract(s,a,i),d=e.subtract(c,a,o),h=e.subtract(n,a,u),E=e.dot(f,f),p=e.dot(f,d),m=e.dot(f,h),y=e.dot(d,d),_=e.dot(d,h));var T=1/(E*y-p*p);return l.y=(y*m-p*_)*T,l.z=(E*_-p*m)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[d/e,a/d]:[a/d,d/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,p=o*c-u*s,m=u*c-h,y=4*E*m-p*p;if(y<0){var _,T,R;d*f>=l*h?(_=o,T=E,R=-2*u*E+o*p):(_=c,T=m,R=-c*p+2*s*m);var v=R<0?-1:1,A=-v*Math.abs(_)*Math.sqrt(-y);i=-R+A;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),I=i===A?-N:-T/N;return a=T<=0?N+I:-R/(N*N+I*I+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var g=E,O=-2*u*E+o*p,w=m,M=-c*p+2*s*m,x=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-g);var D=Math.cos(P);i=a*D;var L=a*(-D/2-C*Math.sin(P)),U=i+L>2*u?i-u:L-u,F=o,b=U/F;P=Math.abs(Math.atan2(c*x,-M)/3),a=2*Math.sqrt(-w),D=Math.cos(P),i=a*D,L=a*(-D/2-C*Math.sin(P));var z=-c,B=i+L<2*s?i+s:L+s,G=z/B,q=F*B,V=-U*B-F*z,W=U*z,X=(s*V-u*W)/(-u*V+s*q);return b<=X?b<=G?X<=G?[b,X,G]:[b,G,X]:[G,b,X]:b<=G?[X,b,G]:X<=G?[X,G,b]:[G,X,b]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var E=n.computeRealRoots(1,s,l);if(2===E.length){var p,m=E[0],y=E[1];if(m>=0&&y>=0){var _=Math.sqrt(m),T=Math.sqrt(y);return[d-T,d-_,d+_,d+T]}if(m>=0&&y<0)return p=Math.sqrt(m),[d-p,d+p];if(m<0&&y>=0)return p=Math.sqrt(y),[d-p,d+p]}return[]}if(h>0){var R=Math.sqrt(h),v=(s+h-c/R)/2,A=(s+h+c/R)/2,S=n.computeRealRoots(1,R,v),N=n.computeRealRoots(1,-R,A);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==N.length?(N[0]+=d,N[1]+=d,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=d,N[1]+=d,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,p,m=h[0],y=a-m,_=y*y,T=t/2,R=y/2,v=_-4*o,A=_+4*Math.abs(o),S=c-4*m,N=c+4*Math.abs(m);if(m<0||v*N<S*A){var I=Math.sqrt(S);E=I/2,p=0===I?0:(t*R-i)/I}else{var g=Math.sqrt(v);E=0===g?0:(t*R-i)/g,p=g/2}var O,w;0===T&&0===E?(O=0,w=0):r.sign(T)===r.sign(E)?(O=T+E,w=m/O):(w=T-E,O=m/w);var M,x;0===R&&0===p?(M=0,x=0):r.sign(R)===r.sign(p)?(M=R+p,x=o/M):(x=R-p,M=o/x);var C=n.computeRealRoots(1,O,M),P=n.computeRealRoots(1,w,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,d=f*n,h=a*a,E=h*a,p=u*c*f-4*s*d-4*e*l*f+18*e*t*r*d-27*i*f*f+256*o*E+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*i*r*f)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return p},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n}return a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";function f(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function d(t,r,a){n(a)||(a=new i);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,_),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,p=f(d,h,E,A);if(n(p))return a.start=p.root0,a.stop=p.root1,a}function h(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function E(t,r,n,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,p=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),m=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*r.x+n,y=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),T=[];if(0===_&&0===y){if(l=s.computeRealRoots(E,p,m),0===l.length)return T;var R=l[0],v=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-v)),T.push(new e(a,i*R,i*v)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,i*A,i*-S)),T.push(new e(a,i*A,i*S))}return T}var N=_*_,I=y*y,g=E*E,O=_*y,w=g+I,M=2*(p*E+O),x=2*m*E+p*p-I+N,C=2*(m*p-O),P=m*m-N;if(0===w&&0===M&&0===x&&0===C)return T;l=c.computeRealRoots(w,M,x,C,P);var D=l.length;if(0===D)return T;for(var L=0;L<D;++L){var U,F=l[L],b=F*F,z=Math.max(1-b,0),B=Math.sqrt(z);U=o.sign(E)===o.sign(m)?h(E*b+m,p*F,o.EPSILON12):o.sign(m)===o.sign(p*F)?h(E*b,p*F+m,o.EPSILON12):h(E*b+p*F,m,o.EPSILON12);var G=h(y*F,_,o.EPSILON15),q=U*G;q<0?T.push(new e(a,i*F,i*B)):q>0?T.push(new e(a,i*F,i*-B)):0!==B?(T.push(new e(a,i*F,i*-B)),T.push(new e(a,i*F,i*B)),++L):T.push(new e(a,i*F,i*B))}return T}var p={};p.rayPlane=function(t,r,a){n(a)||(a=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var m=new e,y=new e,_=new e,T=new e,R=new e;p.rayTriangleParametric=function(t,n,a,i,u){u=r(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,p=e.subtract(a,n,m),v=e.subtract(i,n,y),A=e.cross(E,v,_),S=e.dot(p,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,n,T),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,p,R),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(v,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(h,n,T),l=e.dot(s,A)*N,l<0||l>1)return;if(c=e.cross(s,p,R),f=e.dot(E,c)*N,f<0||l+f>1)return;d=e.dot(v,c)*N}return d},p.rayTriangle=function(t,r,a,i,o,u){var s=p.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var v=new l;p.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=v;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};p.raySphere=function(e,t,r){if(r=d(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new l;p.lineSegmentSphere=function(t,r,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,I=new e;p.rayEllipsoid=function(t,r){var n,a,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,I),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(n=d-1,a=e.magnitudeSquared(f),o=a*n,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var p=s/a,m=n/s;return p<m?new i(p,m):{start:m,stop:p}}var y=Math.sqrt(n/a);return new i(y,y)}return d<1?(n=d-1,a=e.magnitudeSquared(f),o=a*n,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var g=new e,O=new e,w=new e,M=new e,x=new e,C=new u,P=new u,D=new u,L=new u,U=new u,F=new u,b=new u,z=new e,B=new e,G=new t;p.grazingAltitudeLocation=function(t,r){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,g);if(e.dot(i,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(i,g),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,M),h=e.normalize(e.cross(d,f,O),O),p=e.normalize(e.cross(f,h,w),w),m=C;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=h.x,m[4]=h.y,m[5]=h.z,m[6]=p.x,m[7]=p.y,m[8]=p.z;var y=u.transpose(m,P),_=u.fromScale(r.radii,D),T=u.fromScale(r.oneOverRadii,L),R=U;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var v,A,S=u.multiply(u.multiply(y,T,F),R,F),N=u.multiply(u.multiply(S,_,b),m,b),I=u.multiplyByVector(S,a,x),q=E(N,e.negate(I,g),0,0,1),V=q.length;if(V>0){for(var W=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,H=0;H<V;++H){v=u.multiplyByVector(_,u.multiplyByVector(m,q[H],z),z);var Y=e.normalize(e.subtract(v,a,M),M),k=e.dot(Y,i);k>X&&(X=k,W=e.clone(v,W))}var j=r.cartesianToCartographic(W,G);return X=o.clamp(X,0,1),A=e.magnitude(e.subtract(W,a,M))*Math.sqrt(1-X*X),A=c?-A:A,j.height=A,r.cartographicToCartesian(j,new e)}};var q=new e;return p.lineSegmentPlane=function(t,r,a,i){n(i)||(i=new e);var u=e.subtract(r,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},p.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return p.lineSegmentPlane(t,r,a,f),p.lineSegmentPlane(t,n,a,d),{positions:[t,r,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(r,n,a,f),p.lineSegmentPlane(r,t,a,d),{positions:[t,r,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(n,t,a,f),p.lineSegmentPlane(n,r,a,d),{positions:[t,r,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(r,t,a,f),p.lineSegmentPlane(n,t,a,d),{positions:[t,r,n,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(n,r,a,f),p.lineSegmentPlane(t,r,a,d),{positions:[t,r,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,n,a,f),p.lineSegmentPlane(r,n,a,d),{positions:[t,r,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,d=0;d<o;++d)f-c[n[d]]>i&&(c[n[d]]=f,++f);return(f-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var d=r[f];a[d].numLiveTriangles&&(s=0,i-a[d].timeStamp+2*a[d].numLiveTriangles<=t&&(s=i-a[d].timeStamp),(s>l||l===-1)&&(l=s,c=d)),++f}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,f=0,d=o[f],h=c;if(t(u))l=u+1;else{for(;f<h;)d>l&&(l=d),++f,d=o[f];if(l===-1)return 0;++l}for(var E=[],p=0;p<l;p++)E[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var m=0;f<h;)E[o[f]].vertexTriangles.push(m),++E[o[f]].numLiveTriangles,E[o[f+1]].vertexTriangles.push(m),++E[o[f+1]].numLiveTriangles,E[o[f+2]].vertexTriangles.push(m),++E[o[f+2]].numLiveTriangles,++m,f+=3;var y=0,_=s+1;i=1;var T,R,v=[],A=[],S=0,N=[],I=c/3,g=[];for(p=0;p<I;p++)g[p]=!1;for(var O,w;y!==-1;){v=[],R=E[y],w=R.vertexTriangles.length;for(var M=0;M<w;++M)if(m=R.vertexTriangles[M],!g[m]){g[m]=!0,f=m+m+m;for(var x=0;x<3;++x)O=o[f],v.push(O),A.push(O),N[S]=O,++S,T=E[O],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}y=a(o,s,v,E,_,A,l)}return N},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,p,m,y,_,T,R,v,A,S,N){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function g(e){for(var t=e.length,r=t/3*6,n=m.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=m.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function w(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=m.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function M(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new E({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function x(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function C(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),v.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function D(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,f=1;f<n;++f){var d=e[f][t].attributes[r];if(!c(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){l=!1;break}s+=d.values.length}l&&(a[r]=new E({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function L(e,t){var n,i,o,u,s,l,f,d=e.length,E=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,y=D(e,t);for(n in y)if(y.hasOwnProperty(n))for(s=y[n].values,u=0,i=0;i<d;++i)for(l=e[i][t].attributes[n].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(E){var T=0;for(i=0;i<d;++i)T+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:y,primitiveType:S.POINTS})),v=m.createTypedArray(R,T),A=0,N=0;for(i=0;i<d;++i){var I=e[i][t].indices,g=I.length;for(u=0;u<g;++u)v[A++]=N+I[u];N+=h.computeNumberOfVertices(e[i][t])}_=v}var O,w=new a,M=0;for(i=0;i<d;++i){if(O=e[i][t].boundingSphere,!c(O)){w=void 0;break}a.add(O.center,w,w)}if(c(w))for(a.divideByScalar(w,d,w),i=0;i<d;++i){O=e[i][t].boundingSphere;var x=a.magnitude(a.subtract(O.center,w,se))+O.radius;x>M&&(M=x)}return new h({attributes:y,indices:_,primitiveType:p,boundingSphere:c(w)?new r(w,M):void 0})}function U(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function b(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function B(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return F(e);case S.TRIANGLE_STRIP:return b(e);case S.TRIANGLES:return U(e);case S.LINE_STRIP:return B(e);case S.LINE_LOOP:return G(e);case S.LINES:return z(e)}return e}function V(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function W(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return V(e,e.y<0),V(t,t.y<0),void V(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?T.sign(e.y):T.sign(r.y):i>o?T.sign(t.y):T.sign(r.y);var u=n<0;V(e,u),V(t,u),V(r,u)}function X(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,ve),e.y/(e.y-t.y),ve),r),a.clone(r,n),V(r,!0),V(n,!1)}function H(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){W(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=ge.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(X(e,t,Ae,Ne),X(e,r,Se,Ie),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(X(t,r,Ae,Ne),X(t,e,Se,Ie),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(X(r,e,Ae,Ne),X(r,t,Se,Ie),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(X(r,e,Ae,Ne),X(r,t,Se,Ie),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(X(t,r,Ae,Ne),X(t,e,Se,Ie),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(X(e,t,Ae,Ne),X(e,r,Se,Ie),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=ge.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=Se,s[5]=Ne,s[6]=Ie,s.length=7),ge}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function k(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new E({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function j(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Z(e,r,i,o,u,s,l,f,d,h,E,p){if(c(s)||c(l)||c(f)||c(d)||c(h)){var m=a.fromArray(u,3*e,Oe),y=a.fromArray(u,3*r,we),_=a.fromArray(u,3*i,Me),T=t(o,m,y,_,xe);if(c(s)){var R=a.fromArray(s,3*e,Oe),v=a.fromArray(s,3*r,we),A=a.fromArray(s,3*i,Me);a.multiplyByScalar(R,T.x,R),a.multiplyByScalar(v,T.y,v),a.multiplyByScalar(A,T.z,A);var S=a.add(R,v,R);a.add(S,A,S),a.normalize(S,S),a.pack(S,E.normal.values,3*p)}if(c(h)){var N=a.fromArray(h,3*e,Oe),I=a.fromArray(h,3*r,we),g=a.fromArray(h,3*i,Me);a.multiplyByScalar(N,T.x,N),a.multiplyByScalar(I,T.y,I),a.multiplyByScalar(g,T.z,g);var O;a.equals(N,a.ZERO)&&a.equals(I,a.ZERO)&&a.equals(g,a.ZERO)?(O=Oe,O.x=0,O.y=0,O.z=0):(O=a.add(N,I,N),a.add(O,g,O),a.normalize(O,O)),a.pack(O,E.extrudeDirection.values,3*p)}if(c(l)){var w=a.fromArray(l,3*e,Oe),M=a.fromArray(l,3*r,we),x=a.fromArray(l,3*i,Me);a.multiplyByScalar(w,T.x,w),a.multiplyByScalar(M,T.y,M),a.multiplyByScalar(x,T.z,x);var C=a.add(w,M,w);a.add(C,x,C),a.normalize(C,C),a.pack(C,E.tangent.values,3*p)}if(c(f)){var P=a.fromArray(f,3*e,Oe),D=a.fromArray(f,3*r,we),L=a.fromArray(f,3*i,Me);a.multiplyByScalar(P,T.x,P),a.multiplyByScalar(D,T.y,D),a.multiplyByScalar(L,T.z,L);var U=a.add(P,D,P);a.add(U,L,U),a.normalize(U,U),a.pack(U,E.bitangent.values,3*p)}if(c(d)){var F=n.fromArray(d,2*e,Ce),b=n.fromArray(d,2*r,Pe),z=n.fromArray(d,2*i,De);n.multiplyByScalar(F,T.x,F),n.multiplyByScalar(b,T.y,b),n.multiplyByScalar(z,T.z,z);var B=n.add(F,b,F);n.add(B,z,B),n.pack(B,E.st.values,2*p)}}}function K(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,d=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,E=c(s.st)?s.st.values:void 0,p=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,m=u.indices,y=k(u),_=k(u),T=[];T.length=l.length/3;var R=[];for(R.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,R[o]=-1;var v=m.length;for(o=0;o<v;o+=3){var A=m[o],S=m[o+1],N=m[o+2],I=a.fromArray(l,3*A),g=a.fromArray(l,3*S),O=a.fromArray(l,3*N),w=H(I,g,O);if(c(w)&&w.positions.length>3)for(var M=w.positions,x=w.indices,C=x.length,P=0;P<C;++P){var D=x[P],L=M[D];L.y<0?(t=_.attributes,r=_.indices,n=T):(t=y.attributes,r=y.indices,n=R),i=K(t,r,n,m,D<3?o+D:-1,L),Z(A,S,N,L,l,f,h,d,E,p,t,i)}else c(w)&&(I=w.positions[0],g=w.positions[1],O=w.positions[2]),I.y<0?(t=_.attributes,r=_.indices,n=T):(t=y.attributes,r=y.indices,n=R),i=K(t,r,n,m,o,I),Z(A,S,N,I,l,f,h,d,E,p,t,i),i=K(t,r,n,m,o+1,g),Z(A,S,N,g,l,f,h,d,E,p,t,i),i=K(t,r,n,m,o+2,O),Z(A,S,N,O,l,f,h,d,E,p,t,i)}j(e,_,y)}function Q(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=k(r),s=k(r),l=o.length,f=[];f.length=i.length/3;var d=[];for(d.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,d[t]=-1;for(t=0;t<l;t+=2){var h=o[t],E=o[t+1],p=a.fromArray(i,3*h,Oe),m=a.fromArray(i,3*E,we);Math.abs(p.y)<T.EPSILON6&&(p.y<0?p.y=-T.EPSILON6:p.y=T.EPSILON6),Math.abs(m.y)<T.EPSILON6&&(m.y<0?m.y=-T.EPSILON6:m.y=T.EPSILON6);var y=u.attributes,R=u.indices,v=d,A=s.attributes,S=s.indices,N=f,I=_.lineSegmentPlane(p,m,Le,Me);if(c(I)){var g=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Ue);p.y<0&&(a.negate(g,g),y=s.attributes,R=s.indices,v=f,A=u.attributes,S=u.indices,N=d);var O=a.add(I,g,Fe);K(y,R,v,o,t,p),K(y,R,v,o,-1,O),a.negate(g,g),a.add(I,g,O),K(A,S,N,o,-1,O),K(A,S,N,o,t+1,m)}else{var w,M,x;p.y<0?(w=s.attributes,M=s.indices,x=f):(w=u.attributes,M=u.indices,x=d),K(w,M,x,o,t,p),K(w,M,x,o,t+1,m)}}j(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,Be);if(!(s.x>0)){var c=a.unpack(n,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,d=s.nextPosition.values,h=s.expandAndWidth.values,E=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,m=k(u),y=k(u),R=!1,v=l.length/3;for(t=0;t<v;t+=4){var A=t,S=t+2,N=a.fromArray(l,3*A,Be),I=a.fromArray(l,3*S,Ge);if(Math.abs(N.y)<ke)for(N.y=ke*(I.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(I.y)<ke)for(I.y=ke*(N.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*A;r<3*A+12;r+=3)d[r]=l[3*(t+2)],d[r+1]=l[3*(t+2)+1],d[r+2]=l[3*(t+2)+2];var g=m.attributes,O=m.indices,w=y.attributes,M=y.indices,x=_.lineSegmentPlane(N,I,Le,Ve);if(c(x)){R=!0;var C=a.multiplyByScalar(a.UNIT_Y,Ye,We);N.y<0&&(a.negate(C,C),g=y.attributes,O=y.indices,w=m.attributes,M=m.indices);var P=a.add(x,C,Xe);g.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),g.position.values.push(P.x,P.y,P.z),g.position.values.push(P.x,P.y,P.z),g.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),g.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),g.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),g.nextPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(P.x,P.y,P.z),g.nextPosition.values.push(P.x,P.y,P.z),a.negate(C,C),a.add(x,C,P),w.position.values.push(P.x,P.y,P.z),w.position.values.push(P.x,P.y,P.z),w.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),w.prevPosition.values.push(P.x,P.y,P.z),w.prevPosition.values.push(P.x,P.y,P.z),w.prevPosition.values.push(P.x,P.y,P.z),w.prevPosition.values.push(P.x,P.y,P.z),w.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),w.nextPosition.values.push(d[3*S],d[3*S+1],d[3*S+2]),w.nextPosition.values.push(d[3*S+3],d[3*S+4],d[3*S+5]);var D=n.fromArray(h,2*A,be),L=Math.abs(D.y);g.expandAndWidth.values.push(-1,L,1,L),g.expandAndWidth.values.push(-1,-L,1,-L),w.expandAndWidth.values.push(-1,L,1,L),w.expandAndWidth.values.push(-1,-L,1,-L);var U=a.magnitudeSquared(a.subtract(x,N,qe));if(U/=a.magnitudeSquared(a.subtract(I,N,qe)),c(p)){var F=i.fromArray(p,4*A,He),b=i.fromArray(p,4*S,He),z=T.lerp(F.x,b.x,U),B=T.lerp(F.y,b.y,U),G=T.lerp(F.z,b.z,U),q=T.lerp(F.w,b.w,U);for(r=4*A;r<4*A+8;++r)g.color.values.push(p[r]);for(g.color.values.push(z,B,G,q),g.color.values.push(z,B,G,q),w.color.values.push(z,B,G,q),w.color.values.push(z,B,G,q),r=4*S;r<4*S+8;++r)w.color.values.push(p[r])}if(c(E)){var V=n.fromArray(E,2*A,be),W=n.fromArray(E,2*(t+3),ze),X=T.lerp(V.x,W.x,U);for(r=2*A;r<2*A+4;++r)g.st.values.push(E[r]);for(g.st.values.push(X,V.y),g.st.values.push(X,W.y),w.st.values.push(X,V.y),w.st.values.push(X,W.y),r=2*S;r<2*S+4;++r)w.st.values.push(E[r])}o=g.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=w.position.values.length/3-4,M.push(o,o+2,o+1), -M.push(o+1,o+2,o+3)}else{var H,Y;for(N.y<0?(H=y.attributes,Y=y.indices):(H=m.attributes,Y=m.indices),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(I.x,I.y,I.z),H.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)H.prevPosition.values.push(f[r]),H.nextPosition.values.push(d[r]);for(r=2*t;r<2*t+8;++r)H.expandAndWidth.values.push(h[r]),c(E)&&H.st.values.push(E[r]);if(c(p))for(r=4*t;r<4*t+16;++r)H.color.values.push(p[r]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}R&&($(y),$(m)),j(e,y,m)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=g(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=w(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,d=0;d<o;d+=3)l[f++]=a[d],l[f++]=a[d+1],l[f++]=a[d+2],l[f++]=a[d]+i[d]*n,l[f++]=a[d+1]+i[d+1]*n,l[f++]=a[d+2]+i[d+2]*n;var p,m=e.boundingSphere;return c(m)&&(p=new r(m.center,m.radius+n)),new h({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:p})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=m.createTypedArray(t,s),f=0,d=0,E=0;f<s;)i=n[o[f]],i!==-1?l[d]=i:(i=o[f],n[i]=E,l[d]=E,++E),++f,++d;e.indices=l;var p=e.attributes;for(var y in p)if(p.hasOwnProperty(y)&&c(p[y])&&c(p[y].values)){for(var _=p[y],T=_.values,R=0,v=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,E*v);R<t;){var S=n[R];if(S!==-1)for(a=0;a<v;a++)A[v*S+a]=T[v*R+a];++R}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=N.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=T.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=M(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var f=0;f<l;f+=n){for(var d=0;d<n;++d){var E=s[f+d],p=a[E];c(p)||(p=o++,a[E]=p,x(u,e.attributes,E)),i.push(p)}o+n>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=M(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new d;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),h=0,p=0;p<l.length;p+=3){var m=a.fromArray(l,p,re),y=s.cartesianToCartographic(m,ne),_=i.project(y,re);f[h++]=_.x,f[h++]=_.y,f[h++]=_.z}return e.attributes[r]=o,e.attributes[n]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var d=a.componentsPerAttribute;return e.attributes[r]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:s}),e.attributes[n]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var ie=new a,oe=new v,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(v.equals(t,v.IDENTITY))return e;var n=e.geometry.attributes;C(t,n.position),C(t,n.prevPosition),C(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(v.inverse(t,oe),v.transpose(oe,oe),v.getRotation(oe,ue),P(ue,n.normal),P(ue,n.tangent),P(ue,n.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=v.clone(v.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(L(t,"geometry")),r.length>0&&(o.push(L(r,"westHemisphereGeometry")),o.push(L(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,fe=new a,de=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var d=0;for(f=0;f<o;f+=3){var h=t[f],p=t[f+1],m=t[f+2],y=3*h,_=3*p,R=3*m;le.x=n[y],le.y=n[y+1],le.z=n[y+2],fe.x=n[_],fe.y=n[_+1],fe.z=n[_+2],de.x=n[R],de.y=n[R+1],de.z=n[R+2],s[h].count++,s[p].count++,s[m].count++,a.subtract(fe,le,fe),a.subtract(de,le,de),c[d]=a.cross(fe,de,new a),d++}var v=0;for(f=0;f<i;f++)s[f].indexOffset+=v,v+=s[f].count;d=0;var A;for(f=0;f<o;f+=3){A=s[t[f]];var S=A.indexOffset+A.currentCount;l[S]=d,A.currentCount++,A=s[t[f+1]],S=A.indexOffset+A.currentCount,l[S]=d,A.currentCount++,A=s[t[f+2]],S=A.indexOffset+A.currentCount,l[S]=d,A.currentCount++,d++}var N=new Float32Array(3*i);for(f=0;f<i;f++){var I=3*f;if(A=s[f],a.clone(a.ZERO,ce),A.count>0){for(d=0;d<A.count;d++)a.add(ce,c[l[A.indexOffset+d]],ce);a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&a.clone(c[l[A.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),N[I]=ce.x,N[I+1]=ce.y,N[I+2]=ce.z}return e.attributes.normal=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,Ee=new a,pe=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,d,h;for(l=0;l<s;l+=3){var p=t[l],m=t[l+1],y=t[l+2];f=3*p,d=3*m,h=3*y;var _=2*p,T=2*m,R=2*y,v=r[f],A=r[f+1],S=r[f+2],N=i[_],I=i[_+1],g=i[T+1]-I,O=i[R+1]-I,w=1/((i[T]-N)*O-(i[R]-N)*g),M=(O*(r[d]-v)-g*(r[h]-v))*w,x=(O*(r[d+1]-A)-g*(r[h+1]-A))*w,C=(O*(r[d+2]-S)-g*(r[h+2]-S))*w;c[f]+=M,c[f+1]+=x,c[f+2]+=C,c[d]+=M,c[d+1]+=x,c[d+2]+=C,c[h]+=M,c[h+1]+=x,c[h+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,d=f+1,h=f+2;var L=a.fromArray(n,f,he),U=a.fromArray(c,f,pe),F=a.dot(L,U);a.multiplyByScalar(L,F,Ee),a.normalize(a.subtract(U,Ee,U),U),P[f]=U.x,P[d]=U.y,P[h]=U.z,a.normalize(a.cross(L,U,U),U),D[f]=U.x,D[d]=U.y,D[h]=U.z}return e.attributes.tangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e};var me=new n,ye=new a,_e=new a,Te=new a,Re=new n;te.compressVertices=function(t){var r,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),f=0;for(r=0;r<i;++r)a.fromArray(s,3*r,ye),a.equals(ye,a.ZERO)?f+=2:(Re=e.octEncodeInRange(ye,65535,Re),l[f++]=Re.x,l[f++]=Re.y);return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var d=t.attributes.normal,h=t.attributes.st,p=c(d),m=c(h);if(!p&&!m)return t;var y,_,T,R,v=t.attributes.tangent,A=t.attributes.bitangent,S=c(v),N=c(A);p&&(y=d.values),m&&(_=h.values),S&&(T=v.values),N&&(R=A.values);var I=p?y.length:_.length,g=p?3:2;i=I/g;var O=i,w=m&&p?2:1;w+=S||N?1:0,O*=w;var M=new Float32Array(O),x=0;for(r=0;r<i;++r){m&&(n.fromArray(_,2*r,me),M[x++]=e.compressTextureCoordinates(me));var C=3*r;p&&c(T)&&c(R)?(a.fromArray(y,C,ye),a.fromArray(T,C,_e),a.fromArray(R,C,Te),e.octPack(ye,_e,Te,me),M[x++]=me.x,M[x++]=me.y):(p&&(a.fromArray(y,C,ye),M[x++]=e.octEncodeFloat(ye)),S&&(a.fromArray(T,C,ye),M[x++]=e.octEncodeFloat(ye)),N&&(a.fromArray(R,C,ye),M[x++]=e.octEncodeFloat(ye)))}return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:w,values:M}),p&&delete t.attributes.normal,m&&delete t.attributes.st,N&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var ve=new a,Ae=new a,Se=new a,Ne=new a,Ie=new a,ge={positions:new Array(7),indices:new Array(9)},Oe=new a,we=new a,Me=new a,xe=new a,Ce=new n,Pe=new n,De=new n,Le=A.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,Fe=new a,be=new n,ze=new n,Be=new a,Ge=new a,qe=new a,Ve=new a,We=new a,Xe=new a,He=new i,Ye=5*T.EPSILON9,ke=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,A.ORIGIN_ZX_PLANE)!==y.INTERSECTING)return e}if(t.geometryType!==p.NONE)switch(t.geometryType){case p.POLYLINES:ee(e);break;case p.TRIANGLES:J(e);break;case p.LINES:Q(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&Q(e);return e},te}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,a){return t(e).then(r,n,a)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=o(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=a(e),t}function r(t){return e(t,i)}function n(e){this.then=e}function a(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(e){return i(e)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(e){return i(e)}});return r}function o(){function e(e,t,r){return d(e,t,r)}function r(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new n(e),s={then:e,resolve:r,reject:a,progress:u,promise:c,resolver:{resolve:r,reject:a,progress:u}},l=[],f=[],d=function(e,t,r){var n,a;return n=o(),a="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,a)}),f.push(a),n.promise},h=function(e){return p(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=y,p(l,e),f=l=v,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,a,i){return m(2,arguments),e(t,function(t){function u(e){p(e)}function s(e){E(e)}var c,l,f,d,h,E,p,m,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),f=[],l=_-c+1,d=[],h=o(),c)for(m=h.progress,p=function(e){d.push(e),--l||(E=p=y,h.reject(d))},E=function(e){f.push(e),--c||(E=p=y,h.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,m);else h.resolve(f);return h.then(n,a,i)})}function c(e,t,r,n){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,r,n)}function l(e,t,r,n){return m(1,arguments),d(e,_).then(t,r,n)}function f(){return d(arguments,_)}function d(t,r){return e(t,function(t){var n,a,i,u,s,c;if(i=a=t.length>>>0,n=[],c=o(),i)for(u=function(t,a){e(t,r).then(function(e){n[a]=e,--i||c.resolve(n)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function h(t,r){var n=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,n[0]=function(t,n,i){return e(t,function(t){return e(n,function(e){return r(t,e,i,a)})})},T.apply(t,n)})}function E(t,r,n){var a=arguments.length>2;return e(t,function(e){return e=a?n:e,r.resolve(e),e},function(e){return r.reject(e),i(e)},r.progress)}function p(e,t){for(var r,n=0;r=e[n++];)r(t)}function m(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function y(){}function _(e){return e}var T,R,v;return e.defer=o,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(v,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(v,t)})})}},R=[].slice,T=[].reduce||function(e){var t,r,n,a,i;if(i=0,t=Object(this),a=t.length>>>0,r=arguments,r.length<=1)for(;;){if(i in t){n=t[i++];break}if(++i>=a)throw new TypeError}else n=r[1];for(;i<a;++i)i in t&&(n=e(n,t[i],i,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r){for(var n,a,i=0,o=e.length-1;i<=o;)if(n=~~((i+o)/2),a=r(e[n],t),a<0)i=n+1;else{if(!(a>0))return n;o=n-1}return~(o+1)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,n,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,n=t[r++],a=function(e,t,r,n){r||(r=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return n?e+a:a+e},i=function(e,t,r,n,i,o){var u=n-e.length;return u>0&&(e=r||!i?a(e,n,o,r):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,r,n,o,u,s){var c=e>>>0;return r=r&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+a(c.toString(t),u||0,"0",!1),i(e,r,n,o,s)},u=function(e,t,r,n,a,o){return null!=n&&(e=e.slice(0,n)),i(e,"",t,r,a,o)},s=function(e,n,s,c,l,f,d){var h,E,p,m,y;if("%%"==e)return"%";for(var _=!1,T="",R=!1,v=!1,A=" ",S=s.length,N=0;s&&N<S;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":A=s.charAt(N+1);break;case"0":R=!0;break;case"#":v=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[r++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=n?t[n.slice(0,-1)]:t[r++],d){case"s":return u(String(y),_,c,f,R,A);case"c":return u(String.fromCharCode(+y),_,c,f,R);case"b":return o(y,2,v,_,c,f,R);case"o":return o(y,8,v,_,c,f,R);case"x":return o(y,16,v,_,c,f,R);case"X":return o(y,16,v,_,c,f,R).toUpperCase();case"u":return o(y,10,v,_,c,f,R);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=h<0?"-":T,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,_,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=h<0?"-":T,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=E+Math.abs(h)[p](f),i(y,E,_,c,R)[m]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,a,i,o,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t){return p.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var r=p.leapSeconds,n=t(r,T,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var a=r[n].offset;if(n>0){var i=p.secondsDifference(r[n].julianDate,e);i>a&&(n--,a=r[n].offset)}p.addSeconds(e,a,e)}function d(e,r){T.julianDate=e;var n=p.leapSeconds,a=t(n,T,l);if(a<0&&(a=~a),0===a)return p.addSeconds(e,-n[0].offset,r);if(a>=n.length)return p.addSeconds(e,-n[a-1].offset,r);var i=p.secondsDifference(n[a].julianDate,e);return 0===i?p.addSeconds(e,-n[a].offset,r):i<=1?void 0:p.addSeconds(e,-n[--a].offset,r)}function h(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,t<0&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function E(e,t,r,n,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+r-32075;n-=12,n<0&&(n+=24);var f=i+(n*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function p(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),n=r(n,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),n===c.UTC&&f(this)}var m=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,R=/^(\d{4})$/,v=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,g=/^(\d{2})(\.\d+)?/.source+I.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,w=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;p.fromDate=function(e,t){var r=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n(t)?(h(r[0],r[1],t),f(t),t):new p(r[0],r[1],c.UTC)},p.fromIso8601=function(e,t){e=e.replace(",",".");var r,a,i,u=e.split("T"),s=1,l=1,d=0,m=0,T=0,I=0,M=u[0],x=u[1];if(u=M.match(N),null!==u)r=+u[1],s=+u[2],l=+u[3];else if(u=M.match(v),null!==u)r=+u[1],s=+u[2];else if(u=M.match(R),null!==u)r=+u[1];else{var C;if(u=M.match(A),null!==u)r=+u[1],C=+u[2],i=o(r);else if(u=M.match(S),null!==u){r=+u[1];var P=+u[2],D=+u[3]||0,L=new Date(Date.UTC(r,0,4));C=7*P+D-L.getUTCDay()-3}a=new Date(Date.UTC(r,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(r);var U;if(n(x)){u=x.match(w),null!==u?(d=+u[1],m=+u[2],T=+u[3],I=1e3*+(u[4]||0),U=5):(u=x.match(O),null!==u?(d=+u[1],m=+u[2],T=60*+(u[3]||0),U=4):(u=x.match(g),null!==u&&(d=+u[1],m=60*+(u[2]||0),U=3)));var F=u[U],b=+u[U+1],z=+(u[U+2]||0);switch(F){case"+":d-=b,m-=z;break;case"-":d+=b,m+=z;break;case"Z":break;default:m+=new Date(Date.UTC(r,s-1,l,d,m)).getTimezoneOffset()}}else m+=new Date(r,s-1,l).getTimezoneOffset();var B=60===T;for(B&&T--;m>=60;)m-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,r++),a=i&&2===s?_:y[s-1];for(;m<0;)m+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,r--),a=i&&2===s?_:y[s-1],l+=a;var G=E(r,s,l,d,m,T,I);return n(t)?(h(G[0],G[1],t),f(t)):t=new p(G[0],G[1],c.UTC),B&&p.addSeconds(t,1,t),t},p.now=function(e){return p.fromDate(new Date,e)};var M=new p(0,0,c.TAI);return p.toGregorianDate=function(e,t){var r=!1,a=d(e,M);n(a)||(p.addSeconds(e,-1,M),a=d(M,M),r=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var m=h+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var v=0|T,A=(T-v)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(v+=1),n(t)?(t.year=y,t.month=m,t.day=E,t.hour=_,t.minute=R,t.second=v,t.millisecond=A,t.isLeapSecond=r,t):new i(y,m,E,_,R,v,A,r)},p.toDate=function(e){var t=p.toGregorianDate(e,m),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},p.toIso8601=function(t,r){var a,i=p.toGregorianDate(t,i);return n(r)||0===i.millisecond?n(r)&&0!==r?(a=(.01*i.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},p.clone=function(e,t){if(n(e))return n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new p(e.dayNumber,e.secondsOfDay,c.TAI)},p.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},p.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},p.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(p.secondsDifference(e,t))<=r},p.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},p.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},p.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},p.computeTaiMinusUtc=function(e){T.julianDate=e;var r=p.leapSeconds,n=t(r,T,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},p.addSeconds=function(e,t,r){return h(e.dayNumber,e.secondsOfDay+t,r)},p.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,n,r)},p.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,n,r)},p.addDays=function(e,t,r){var n=e.dayNumber+t;return h(n,e.secondsOfDay,r)},p.lessThan=function(e,t){return p.compare(e,t)<0},p.lessThanOrEquals=function(e,t){return p.compare(e,t)<=0},p.greaterThan=function(e,t){return p.compare(e,t)>0},p.greaterThanOrEquals=function(e,t){return p.compare(e,t)>=0},p.prototype.clone=function(e){return p.clone(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.equalsEpsilon=function(e,t){return p.equalsEpsilon(this,e,t)},p.prototype.toString=function(){return p.toIso8601(this)},p.leapSeconds=[new u(new p(2441317,43210,c.TAI),10),new u(new p(2441499,43211,c.TAI),11),new u(new p(2441683,43212,c.TAI),12),new u(new p(2442048,43213,c.TAI),13),new u(new p(2442413,43214,c.TAI),14),new u(new p(2442778,43215,c.TAI),15),new u(new p(2443144,43216,c.TAI),16),new u(new p(2443509,43217,c.TAI),17),new u(new p(2443874,43218,c.TAI),18),new u(new p(2444239,43219,c.TAI),19),new u(new p(2444786,43220,c.TAI),20),new u(new p(2445151,43221,c.TAI),21),new u(new p(2445516,43222,c.TAI),22),new u(new p(2446247,43223,c.TAI),23),new u(new p(2447161,43224,c.TAI),24),new u(new p(2447892,43225,c.TAI),25),new u(new p(2448257,43226,c.TAI),26),new u(new p(2448804,43227,c.TAI),27),new u(new p(2449169,43228,c.TAI),28),new u(new p(2449534,43229,c.TAI),29),new u(new p(2450083,43230,c.TAI),30),new u(new p(2450630,43231,c.TAI),31),new u(new p(2451179,43232,c.TAI),32),new u(new p(2453736,43233,c.TAI),33),new u(new p(2454832,43234,c.TAI),34),new u(new p(2456109,43235,c.TAI),35),new u(new p(2457204,43236,c.TAI),36),new u(new p(2457754,43237,c.TAI),37)],p}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var a=new r.constructor;for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];n&&(o=t(o,n)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var a=r[n],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,n){this.statusCode=e,this.response=r,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=n.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function r(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var n=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,r).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var a=n.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])||(i[n]=!0)},a.remove=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])&&delete i[n]},a.contains=function(e){var r=n(e);return!(!t(r)||!t(i[r]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,n,a,i,o){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,a=t(r.method,"GET"),i=r.data,o=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,n,a,i,o,r,s),r.promise})}function s(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function c(e,t){for(var r=s(e,t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return n}function l(e,r){r=t(r,"");var n=e[1],a=!!e[2],i=e[3];switch(r){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:n});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),n);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,n,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),r(d)&&r(E.overrideMimeType)&&E.overrideMimeType(d),E.open(n,e,!0),r(s))for(var p in s)s.hasOwnProperty(p)&&E.setRequestHeader(p,s[p]);r(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,n=E.responseType;if(!r(e)||r(t)&&n!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===n||"document"===n)&&r(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==n&&"text"!==n||!r(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function a(r,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,n(r,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))E(this,t.data);else if(n(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=r.columnNames.indexOf("modifiedJulianDateUtc"),i=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),d=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=r.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||p<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var m=e._samples=r.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c, -e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=p,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,R=0,v=m.length;R<v;R+=e._columnCount){var A=m[R+a],S=m[R+p],N=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(N,S,f.TAI);if(y.push(I),T){if(S!==_&&n(_)){var g=o.leapSeconds,O=t(g,I,h);if(O<0){var w=new u(I,S);g.splice(~O,0,w)}}_=S}}}function p(e,t,r,n,a){var i=r*n;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function m(e,t,r){return t+e*(r-t)}function y(e,t,r,n,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||n.equals(c))return p(e,r,a,s,u),u;if(n.equals(l))return p(e,r,i,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=r[d+e._ut1MinusUtcSecondsColumn],y=r[h+e._ut1MinusUtcSecondsColumn],_=y-E;if(_>.5||_<-.5){var T=r[d+e._taiMinusUtcSecondsColumn],R=r[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(n)?E=y:y-=R-T)}return u.xPoleWander=m(f,r[d+e._xPoleWanderRadiansColumn],r[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,r[d+e._yPoleWanderRadiansColumn],r[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,r[d+e._xCelestialPoleOffsetRadiansColumn],r[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,r[d+e._yCelestialPoleOffsetRadiansColumn],r[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,E,y),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return n(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,r){if(n(this._samples)){if(n(r)||(r=new a(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var i=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!n(d),p=E||o.greaterThanOrEquals(d,e);if(h&&p)return s=u,!E&&d.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,r),r}var m=t(i,e,o.compare,this._dateColumn);return m>=0?(m<i.length-1&&i[m+1].equals(e)&&++m,s=m,l=m):(l=~m,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},d}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=t(n,document.location.href);var a=new e(n),i=new e(r);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,i){i=t(i,!0),n instanceof e||(n=new e(n)),a instanceof e||(a=new e(a)),r(a.authority)&&!r(a.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=n.scheme);var o=n;a.isAbsolute()&&(o=a);var u="";r(o.scheme)&&(u+=o.scheme+":"),r(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===n?i?n.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):n.path+a.path:a.path;var s=r(n.query),c=r(a.query);s&&c?u+="?"+n.query+"&"+a.query:s&&!c?u+="?"+n.query:!s&&c&&(u+="?"+a.query);var l=r(a.fragment);return r(n.fragment)&&!l?u+="#"+n.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,n,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),a=E.exec(n);if(null!==a)return a[1]}}function u(){if(t(f))return f;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(n(r))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var r=d(e);return h.href=r,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){n[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,i.daysDifference(n,e._sampleZeroDateTT)}function l(r,a){if(r._chunkDownloadsInProgress[a])return r._chunkDownloadsInProgress[a];var i=e.defer();r._chunkDownloadsInProgress[a]=i;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){r._chunkDownloadsInProgress[a]=!1;for(var t=r._samples,n=e.samples,o=a*r._samplesPerXysFile*3,u=0,s=n.length;u<s;++u)t[o+u]=n[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,r,n,a){var i=c(this,t,r),o=c(this,n,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,r){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(n(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),n(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){n(r)?(r.x=0,r.y=0,r.s=0):r=new a(0,0,0);var E,p,m=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)y[E]=m-R[E];for(E=0;E<=u;++E){for(T[E]=1,p=0;p<=u;++p)p!==E&&(T[E]*=y[p]);T[E]*=_[E];var v=3*(s+E);r.x+=T[E]*h[v++],r.y+=T[E]*h[v++],r.s+=T[E]*h[v]}return r}}}},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,p,m,y,_,T,R){"use strict";var v={},A={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},S={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},N={},I={east:new r,north:new r,up:new r,west:new r,south:new r,down:new r},g=new r,O=new r,w=new r;v.localFrameToFixedFrameGenerator=function(e,t){if(!A.hasOwnProperty(e)||!A[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var n,a=A[e][t],i=e+t;return u(N[i])?n=N[i]:(n=function(n,i,s){if(u(s)||(s=new _),m.equalsEpsilon(n.x,0,m.EPSILON14)&&m.equalsEpsilon(n.y,0,m.EPSILON14)){var c=m.sign(n.z);r.unpack(S[e],0,g),"east"!==e&&"west"!==e&&r.multiplyByScalar(g,c,g),r.unpack(S[t],0,O),"east"!==t&&"west"!==t&&r.multiplyByScalar(O,c,O),r.unpack(S[a],0,w),"east"!==a&&"west"!==a&&r.multiplyByScalar(w,c,w)}else{i=o(i,d.WGS84),i.geodeticSurfaceNormal(n,I.up);var l=I.up,f=I.east;f.x=-n.y,f.y=n.x,f.z=0,r.normalize(f,I.east),r.cross(l,f,I.north),r.multiplyByScalar(I.up,-1,I.down),r.multiplyByScalar(I.east,-1,I.west),r.multiplyByScalar(I.north,-1,I.south),g=I[e],O=I[t],w=I[a]}return s[0]=g.x,s[1]=g.y,s[2]=g.z,s[3]=0,s[4]=O.x,s[5]=O.y,s[6]=O.z,s[7]=0,s[8]=w.x,s[9]=w.y,s[10]=w.z,s[11]=0,s[12]=n.x,s[13]=n.y,s[14]=n.z,s[15]=1,s},N[i]=n),n},v.eastNorthUpToFixedFrame=v.localFrameToFixedFrameGenerator("east","north"),v.northEastDownToFixedFrame=v.localFrameToFixedFrameGenerator("north","east"),v.northUpEastToFixedFrame=v.localFrameToFixedFrameGenerator("north","up"),v.northWestUpToFixedFrame=v.localFrameToFixedFrameGenerator("north","west");var M=new T,x=new r(1,1,1),C=new _;v.headingPitchRollToFixedFrame=function(e,t,n,a,i){a instanceof _&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,v.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,M),c=_.fromTranslationQuaternionRotationScale(r.ZERO,u,x,C);return i=a(e,n,i),_.multiply(i,c,i)};var P=new _,D=new y;v.headingPitchRollQuaternion=function(e,t,r,n,a){n instanceof T&&(a=n,n=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=v.headingPitchRollToFixedFrame(e,t,r,n,P),o=_.getRotation(i,D);return T.fromRotationMatrix(o,a)};var L=24110.54841,U=8640184.812866,F=.093104,b=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,G=m.TWO_PI/86400,q=new p;v.computeTemeToPseudoFixedMatrix=function(e,t){q=p.addSeconds(e,-p.computeTaiMinusUtc(e),q);var r,n=q.dayNumber,a=q.secondsOfDay,i=n-2451545;r=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=L+r*(U+r*(F+r*b)),s=o*G%m.TWO_PI,c=B+z*(n-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(d,h,0,-h,d,0,0,0,1)},v.iau2006XysData=new h,v.earthOrientationParameters=l.NONE;var V=32.184,W=2451545;v.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+V,a=t.stop.dayNumber,i=t.stop.secondsOfDay+V,o=v.iau2006XysData.preload(r,n,a,i),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var r=v.computeFixedToIcrfMatrix(e,t);if(u(r))return y.transpose(r,t)};var X=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new y,k=new y;v.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var r=v.earthOrientationParameters.compute(e,H);if(u(r)){var n=e.dayNumber,a=e.secondsOfDay+V,i=v.iau2006XysData.computeXysRadians(n,a,X);if(u(i)){var o=i.x+r.xPoleOffset,s=i.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,k),d=y.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-p.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=h-2451545,T=E/R.SECONDS_PER_DAY,A=.779057273264+T+.00273781191135448*(_+T);A=A%1*m.TWO_PI;var S=y.fromRotationZ(A,k),N=y.multiply(d,S,Y),I=Math.cos(r.xPoleWander),g=Math.cos(r.yPoleWander),O=Math.sin(r.xPoleWander),w=Math.sin(r.yPoleWander),M=n-W+a/R.SECONDS_PER_DAY;M/=36525;var x=-47e-6*M*m.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=k;return D[0]=I*C,D[1]=I*P,D[2]=O,D[3]=-g*P+w*O*C,D[4]=g*C+w*O*P,D[5]=-w*I,D[6]=-w*P-g*O*C,D[7]=w*C-g*O*P,D[8]=g*I,y.multiply(N,D,t)}}};var j=new n;v.pointToWindowCoordinates=function(e,t,r,n){return n=v.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},v.pointToGLWindowCoordinates=function(e,r,a,i){u(i)||(i=new t);var o=j;return _.multiplyByVector(e,n.fromElements(a.x,a.y,a.z,1,o),o),n.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(r,o,o),t.fromCartesian4(o,i)};var Z=new r,K=new r,J=new r;v.rotationMatrixFromPositionVelocity=function(e,t,n,a){var i=o(n,d.WGS84).geodeticSurfaceNormal(e,Z),s=r.cross(t,i,K);r.equalsEpsilon(s,r.ZERO,m.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var c=r.cross(s,t,J);return r.cross(t,c,s),r.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new r,ee=new r,te=new n,re=new n,ne=new n,ae=new n,ie=new n,oe=new _,ue=new _;v.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=v.eastNorthUpToFixedFrame(o,i,oe),c=_.inverseTransformation(s,ue),l=e.project(u,$),f=re;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=_.getColumn(t,0,ee),h=r.magnitude(d),E=_.multiplyByVector(c,d,ne);n.fromElements(E.z,E.x,E.y,0,E);var p=_.getColumn(t,1,ee),m=r.magnitude(p),y=_.multiplyByVector(c,p,ae);n.fromElements(y.z,y.x,y.y,0,y);var T=_.getColumn(t,2,ee),R=r.magnitude(T),A=ie;return r.cross(E,y,A),r.normalize(A,A),r.cross(y,A,E),r.normalize(E,E),r.cross(A,E,y),r.normalize(y,y),r.multiplyByScalar(E,h,E),r.multiplyByScalar(y,m,y),r.multiplyByScalar(A,R,A),_.setColumn(a,0,E,a),_.setColumn(a,1,y,a),_.setColumn(a,2,A,a),_.setColumn(a,3,f,a),a};var se=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return v.wgs84To2DModelMatrix=function(e,t,r){var n=e.ellipsoid,a=v.eastNorthUpToFixedFrame(t,n,oe),i=_.inverseTransformation(a,ue),o=n.cartesianToCartographic(t,Q),u=e.project(o,$),s=re;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=_.fromTranslation(s,oe);return _.multiply(se,i,r),_.multiply(c,r,r),r},v}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=n(new a({position:!0})),a.POSITION_AND_NORMAL=n(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=n(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=n(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=n(new a({position:!0,color:!0})),a.ALL=n(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.position?1:0,r[n++]=t.normal?1:0,r[n++]=t.st?1:0,r[n++]=t.tangent?1:0,r[n++]=t.bitangent?1:0,r[n++]=t.color?1:0,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.position=1===r[n++],i.normal=1===r[n++],i.st=1===r[n++],i.tangent=1===r[n++],i.bitangent=1===r[n++],i.color=1===r[n++],i},a.clone=function(e,r){if(t(e))return t(r)||(r=new a),r.position=e.position,r.normal=e.normal,r.st=e.st,r.tangent=e.tangent,r.bitangent=e.bitangent,r.color=e.color,r},a}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,p,m,y,_,T,R,v,A,S,N,I){"use strict";function g(e,n,i){var o=n.vertexFormat,u=n.center,s=n.semiMajorAxis,l=n.semiMinorAxis,d=n.ellipsoid,p=n.stRotation,m=i?e.length/3*2:e.length/3,y=n.shadowVolume,_=o.st?new Float32Array(2*m):void 0,R=o.normal?new Float32Array(3*m):void 0,v=o.tangent?new Float32Array(3*m):void 0,S=o.bitangent?new Float32Array(3*m):void 0,N=y?new Float32Array(3*m):void 0,I=0,g=q,O=V,w=W,M=new f(d),x=M.project(d.cartesianToCartographic(u,X),H),C=d.scaleToGeodeticSurface(u,L);d.geodeticSurfaceNormal(C,C);for(var P=A.fromAxisAngle(C,p,G),D=T.fromQuaternion(P,B),b=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),j=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),Z=e.length,K=i?Z:0,J=K/3*2,Q=0;Q<Z;Q+=3){var $=Q+1,ee=Q+2,te=r.fromArray(e,Q,L);if(o.st){var re=T.multiplyByVector(D,te,U),ne=M.project(d.cartesianToCartographic(re,X),F);r.subtract(ne,x,ne),z.x=(ne.x+s)/(2*s),z.y=(ne.y+l)/(2*l),b.x=Math.min(z.x,b.x),b.y=Math.min(z.y,b.y),j.x=Math.max(z.x,j.x),j.y=Math.max(z.y,j.y),i&&(_[I+J]=z.x,_[I+1+J]=z.y),_[I++]=z.x,_[I++]=z.y}(o.normal||o.tangent||o.bitangent||y)&&(g=d.geodeticSurfaceNormal(te,g),y&&(N[Q+K]=-g.x,N[$+K]=-g.y,N[ee+K]=-g.z),(o.normal||o.tangent||o.bitangent)&&((o.tangent||o.bitangent)&&(O=r.normalize(r.cross(r.UNIT_Z,g,O),O),T.multiplyByVector(D,O,O)),o.normal&&(R[Q]=g.x,R[$]=g.y,R[ee]=g.z,i&&(R[Q+K]=-g.x,R[$+K]=-g.y,R[ee+K]=-g.z)),o.tangent&&(v[Q]=O.x,v[$]=O.y,v[ee]=O.z,i&&(v[Q+K]=-O.x,v[$+K]=-O.y,v[ee+K]=-O.z)),o.bitangent&&(w=r.normalize(r.cross(g,O,w),w),S[Q]=w.x,S[$]=w.y,S[ee]=w.z,i&&(S[Q+K]=w.x,S[$+K]=w.y,S[ee+K]=w.z))))}if(o.st){Z=_.length;for(var ae=0;ae<Z;ae+=2)_[ae]=(_[ae]-b.x)/(j.x-b.x),_[ae+1]=(_[ae+1]-b.y)/(j.y-b.y)}var ie=new E;if(o.position){var oe=c.raisePositionsToHeight(e,n,i);ie.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:oe})}return o.st&&(ie.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),o.normal&&(ie.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),o.tangent&&(ie.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),o.bitangent&&(ie.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),y&&(ie.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:N})),ie}function O(e){var t,r,n,a,i,o=new Array(12*(e*(e+1))-6),u=0;for(t=0,n=1,a=0;a<3;a++)o[u++]=n++,o[u++]=t,o[u++]=n;for(a=2;a<e+1;++a){for(n=a*(a+1)-1,t=(a-1)*a-1,o[u++]=n++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=n++,o[u++]=t,o[u++]=n}for(r=2*e,++n,++t,a=0;a<r-1;++a)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;for(o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t++,o[u++]=t,++t,a=e-1;a>1;--a){for(o[u++]=t++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=t++,o[u++]=t++,o[u++]=n++}for(a=0;a<3;a++)o[u++]=t++,o[u++]=t,o[u++]=n;return o}function w(t){var n=t.center;j=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(n,j),t.height,j),j=r.add(n,j,j);var a=new e(j,t.semiMajorAxis),i=c.computeEllipsePositions(t,!0,!1),o=i.positions,u=i.numPts,s=g(o,t,!1),l=O(u);return l=y.createTypedArray(o.length/3,l),{boundingSphere:a,attributes:s,indices:l}}function M(e,n){var i=n.vertexFormat,o=n.center,u=n.semiMajorAxis,s=n.semiMinorAxis,c=n.ellipsoid,l=n.height,d=n.extrudedHeight,p=n.stRotation,m=e.length/3*2,y=new Float64Array(3*m),_=i.st?new Float32Array(2*m):void 0,R=i.normal?new Float32Array(3*m):void 0,v=i.tangent?new Float32Array(3*m):void 0,S=i.bitangent?new Float32Array(3*m):void 0,N=n.shadowVolume,I=N?new Float32Array(3*m):void 0,g=0,O=q,w=V,M=W,x=new f(c),C=x.project(c.cartesianToCartographic(o,X),H),P=c.scaleToGeodeticSurface(o,L);c.geodeticSurfaceNormal(P,P);for(var D=A.fromAxisAngle(P,p,G),j=T.fromQuaternion(D,B),Z=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),K=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),J=e.length,Q=J/3*2,$=0;$<J;$+=3){var ee,te=$+1,re=$+2,ne=r.fromArray(e,$,L);if(i.st){var ae=T.multiplyByVector(j,ne,U),ie=x.project(c.cartesianToCartographic(ae,X),F);r.subtract(ie,C,ie),z.x=(ie.x+u)/(2*u),z.y=(ie.y+s)/(2*s),Z.x=Math.min(z.x,Z.x),Z.y=Math.min(z.y,Z.y),K.x=Math.max(z.x,K.x),K.y=Math.max(z.y,K.y),_[g+Q]=z.x,_[g+1+Q]=z.y,_[g++]=z.x,_[g++]=z.y}ne=c.scaleToGeodeticSurface(ne,ne),ee=r.clone(ne,U),O=c.geodeticSurfaceNormal(ne,O),N&&(I[$+J]=-O.x,I[te+J]=-O.y,I[re+J]=-O.z);var oe=r.multiplyByScalar(O,l,b);if(ne=r.add(ne,oe,ne),oe=r.multiplyByScalar(O,d,oe),ee=r.add(ee,oe,ee),i.position&&(y[$+J]=ee.x,y[te+J]=ee.y,y[re+J]=ee.z,y[$]=ne.x,y[te]=ne.y,y[re]=ne.z),i.normal||i.tangent||i.bitangent){M=r.clone(O,M);var ue=r.fromArray(e,($+3)%J,b);r.subtract(ue,ne,ue);var se=r.subtract(ee,ne,F);O=r.normalize(r.cross(se,ue,O),O),i.normal&&(R[$]=O.x,R[te]=O.y,R[re]=O.z,R[$+J]=O.x,R[te+J]=O.y,R[re+J]=O.z),i.tangent&&(w=r.normalize(r.cross(M,O,w),w),v[$]=w.x,v[te]=w.y,v[re]=w.z,v[$+J]=w.x,v[$+1+J]=w.y,v[$+2+J]=w.z),i.bitangent&&(S[$]=M.x,S[te]=M.y,S[re]=M.z,S[$+J]=M.x,S[te+J]=M.y,S[re+J]=M.z)}}if(i.st){J=_.length;for(var ce=0;ce<J;ce+=2)_[ce]=(_[ce]-Z.x)/(K.x-Z.x),_[ce+1]=(_[ce+1]-Z.y)/(K.y-Z.y)}var le=new E;return i.position&&(le.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:y})),i.st&&(le.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),i.normal&&(le.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),i.tangent&&(le.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),i.bitangent&&(le.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),N&&(le.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:I})),le}function x(e){for(var t=e.length/3,r=y.createTypedArray(t,6*t),n=0,a=0;a<t;a++){var i=a,o=a+t,u=(i+1)%t,s=u+t;r[n++]=i,r[n++]=o,r[n++]=u,r[n++]=u,r[n++]=o,r[n++]=s}return r}function C(t){var n=t.center,a=t.ellipsoid,i=t.semiMajorAxis,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,L),t.height,L);Z.center=r.add(n,o,Z.center),Z.radius=i,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,o),t.extrudedHeight,o),K.center=r.add(n,o,K.center),K.radius=i;var u=c.computeEllipsePositions(t,!0,!0),s=u.positions,l=u.numPts,f=u.outerPositions,h=e.union(Z,K),E=g(s,t,!0),_=O(l),T=_.length;_.length=2*T;for(var R=s.length/3,A=0;A<T;A+=3)_[A+T]=_[A+2]+R,_[A+1+T]=_[A+1]+R,_[A+2+T]=_[A]+R;var S=y.createTypedArray(2*R/3,_),N=new d({attributes:E,indices:S,primitiveType:v.TRIANGLES}),I=M(f,t);_=x(f);var w=y.createTypedArray(2*f.length/3,_),C=new d({attributes:I,indices:w,primitiveType:v.TRIANGLES}),P=m.combineInstances([new p({geometry:N}),new p({geometry:C})]);return{boundingSphere:h,attributes:P[0].attributes,indices:P[0].indices}}function P(e,t,n,a,i){N.eastNorthUpToFixedFrame(e,t,J),R.inverseTransformation(J,Q);for(var o=0;o<4;++o)r.clone(r.ZERO,ee[o]);for(ee[0].x+=n,ee[1].x-=n,ee[2].y+=a,ee[3].y-=a,T.fromRotationZ(i,$),o=0;o<4;++o)T.multiplyByVector($,ee[o],ee[o]),R.multiplyByPoint(J,ee[o],ee[o]),t.cartesianToCartographic(ee[o],te[o]);return S.fromCartographicArray(te)}function D(e){e=i(e,i.EMPTY_OBJECT);var t=e.center,n=i(e.ellipsoid,l.WGS84),a=e.semiMajorAxis,u=e.semiMinorAxis,s=i(e.granularity,_.RADIANS_PER_DEGREE),c=i(e.height,0),f=e.extrudedHeight,d=o(f)&&Math.abs(c-f)>1,h=i(e.vertexFormat,I.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=a,this._semiMinorAxis=u,this._ellipsoid=l.clone(n),this._rotation=i(e.rotation,0),this._stRotation=i(e.stRotation,0),this._height=c,this._granularity=s,this._vertexFormat=I.clone(h),this._extrudedHeight=i(f,c),this._extrude=d,this._shadowVolume=i(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._rectangle=P(this._center,this._ellipsoid,a,u,this._rotation)}var L=new r,U=new r,F=new r,b=new r,z=new t,B=new T,G=new A,q=new r,V=new r,W=new r,X=new n,H=new r,Y=new t,k=new t,j=new r,Z=new e,K=new e,J=new R,Q=new R,$=new T,ee=[new r,new r,new r,new r],te=[new n,new n,new n,new n];D.packedLength=r.packedLength+l.packedLength+I.packedLength+S.packedLength+9,D.pack=function(e,t,n){return n=i(n,0),r.pack(e._center,t,n),n+=r.packedLength,l.pack(e._ellipsoid,t,n),n+=l.packedLength,I.pack(e._vertexFormat,t,n),n+=I.packedLength,S.pack(e._rectangle,t,n),n+=S.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._extrude?1:0,t[n]=e._shadowVolume?1:0,t};var re=new r,ne=new l,ae=new I,ie=new S,oe={center:re,ellipsoid:ne,vertexFormat:ae,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0};return D.unpack=function(e,t,n){t=i(t,0);var a=r.unpack(e,t,re);t+=r.packedLength;var u=l.unpack(e,t,ne);t+=l.packedLength;var s=I.unpack(e,t,ae);t+=I.packedLength;var c=S.unpack(e,t,ie);t+=S.packedLength;var f=e[t++],d=e[t++],h=e[t++],E=e[t++],p=e[t++],m=e[t++],y=e[t++],_=1===e[t++],T=1===e[t];return o(n)?(n._center=r.clone(a,n._center),n._ellipsoid=l.clone(u,n._ellipsoid),n._vertexFormat=I.clone(s,n._vertexFormat),n._semiMajorAxis=f,n._semiMinorAxis=d,n._rotation=h,n._stRotation=E,n._height=p,n._granularity=m,n._extrudedHeight=y,n._extrude=_,n._shadowVolume=T,n._rectangle=S.clone(c),n):(oe.height=p,oe.extrudedHeight=y,oe.granularity=m,oe.stRotation=E,oe.rotation=h,oe.semiMajorAxis=f,oe.semiMinorAxis=d,oe.shadowVolume=T,new D(oe))},D.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),r.shadowVolume=e._shadowVolume,t=C(r)):t=w(r),new d({attributes:t.attributes,indices:t.indices,primitiveType:v.TRIANGLES,boundingSphere:t.boundingSphere})}},D.createShadowVolume=function(e,t,r){var n=e._granularity,a=e._ellipsoid,i=t(n,a),o=r(n,a);return new D({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:a,rotation:e._rotation,stRotation:e._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:I.POSITION_ONLY,shadowVolume:!0})},u(D.prototype,{rectangle:{get:function(){return this._rectangle}}}),D}),define("Workers/createEllipseGeometry",["../Core/Cartesian3","../Core/defined","../Core/EllipseGeometry","../Core/Ellipsoid"],function(e,t,r,n){"use strict";function a(a,i){return t(i)&&(a=r.unpack(a,i)),a._center=e.clone(a._center),a._ellipsoid=n.clone(a._ellipsoid),r.createGeometry(a)}return a})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var f=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,f=n*u-a*o;return r.x=c,r.y=l,r.z=f,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:E,c=Math.cos(n);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(n),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),r(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,f=r.y,d=r.z,h=a.x,E=a.y,p=a.z,m=l*l*h*h,y=f*f*E*E,_=d*d*p*p,T=m+y+_,R=Math.sqrt(1/T),v=e.multiplyByScalar(r,R,i);if(T<s)return isFinite(R)?e.clone(v,c):void 0;var A=u.x,S=u.y,N=u.z,I=o;I.x=v.x*A*2,I.y=v.y*S*2,I.z=v.z*N*2;var g,O,w,M,x,P,C,D,L,U,F,b=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),z=0;do{b-=z,w=1/(1+b*A),M=1/(1+b*S),x=1/(1+b*N),P=w*w,C=M*M,D=x*x,L=P*w,U=C*M,F=D*x,g=m*P+y*C+_*D-1,O=m*L*A+y*U*S+_*F*N;var B=-2*O;z=g/B}while(Math.abs(g)>n.EPSILON12);return t(c)?(c.x=l*w,c.y=f*M,c.z=d*x,c):new e(l*w,f*M,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,t,n){this.longitude=r(e,0),this.latitude=r(t,0),this.height=r(n,0)}u.fromRadians=function(e,t,a,i){return a=r(a,0),n(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,p=n(r)?r.oneOverRadiiSquared:d,m=n(r)?r._centerToleranceSquared:h,y=o(t,E,p,m,c);if(n(y)){var _=e.multiplyComponents(y,p,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),R=Math.atan2(_.y,_.x),v=Math.asin(_.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=v,a.height=A,a):new u(R,v,A)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,r){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._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,r){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,p=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,E);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(p[r],E[r])];t+=2*n*n}return Math.sqrt(t)}function f(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(p[i],E[i])]);o>n&&(a=i,n=o)}var c=1,l=0,f=E[a],d=p[a];if(Math.abs(e[s.getElementIndex(d,f)])>r){var h,m=e[s.getElementIndex(d,d)],y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(d,f)],T=(m-y)/2/_;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=r-u-f+h,p=2*(a-d),m=2*(i+l),y=2*(a+d),_=-r+u-f+h,T=2*(c-o),R=2*(i-l),v=2*(c+o),A=-r-u+f+h;return n(t)?(t[0]=E,t[1]=y,t[2]=R,t[3]=p,t[4]=_,t[5]=v,t[6]=m,t[7]=T,t[8]=A,t):new s(E,p,m,y,_,T,R,v,A)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=r*u,E=i*a+c*o*u,p=-c*a+i*o*u,m=-o,y=c*r,_=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=m,t[3]=f,t[4]=E,t[5]=y,t[6]=d,t[7]=p,t[8]=_,t):new s(l,f,d,h,E,p,m,y,_)},s.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var d=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),r};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},s.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},s.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},s.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],p=[2,2,1],m=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,i=0,o=0;n(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=r*c(h);o<a&&l(h)>E;)f(h,m),s.transpose(m,y),s.multiply(h,m,h),s.multiply(y,h,h),s.multiply(d,m,d),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-n*f,t[2]=n*u-o*a,t[3]=c*u-i*f,t[4]=r*f-c*a,t[5]=i*a-r*u,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/d;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){ +"use strict";function l(e,t,r,a,i,o,u,s,c,l,f,d,h,E,p,m){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(E,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(p,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(d,0),this[15]=n(m,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new l),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,r,i){return r=n(r,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,i):new l(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,p=t.y*t.w,m=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-h-m+_,R=2*(c-y),v=2*(f+p),A=2*(c+y),S=-s+h-m+_,N=2*(E-d),I=2*(f-p),g=2*(E+d),O=-s-h+m+_;return n[0]=T*i,n[1]=A*i,n[2]=I*i,n[3]=0,n[4]=R*o,n[5]=S*o,n[6]=g*o,n[7]=0,n[8]=v*u,n[9]=N*u,n[10]=O*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,r){var n=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,p=f.y,m=f.z,y=h.x,_=h.y,T=h.z,R=n.x,v=n.y,A=n.z,S=u*-R+s*-v+c*-A,N=y*-R+_*-v+T*-A,I=E*R+p*v+m*A;return a(r)?(r[0]=u,r[1]=y,r[2]=-E,r[3]=0,r[4]=s,r[5]=_,r[6]=-p,r[7]=0,r[8]=c,r[9]=T,r[10]=-m,r[11]=0,r[12]=S,r[13]=N,r[14]=I,r[15]=1,r):new l(u,s,c,S,y,_,T,N,-E,-p,-m,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,f=-(n+r)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),d=c,h=l,E=f,p=i+c,m=o+l,y=t+f,_=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=p,a[13]=m,a[14]=y,a[15]=_,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var E=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),r};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],p=e[12],m=e[13],y=e[14],_=e[15],T=t[0],R=t[1],v=t[2],A=t[3],S=t[4],N=t[5],I=t[6],g=t[7],O=t[8],w=t[9],M=t[10],x=t[11],P=t[12],C=t[13],D=t[14],L=t[15],U=n*T+u*R+f*v+p*A,F=a*T+s*R+d*v+m*A,b=i*T+c*R+h*v+y*A,z=o*T+l*R+E*v+_*A,B=n*S+u*N+f*I+p*g,G=a*S+s*N+d*I+m*g,q=i*S+c*N+h*I+y*g,V=o*S+l*N+E*I+_*g,W=n*O+u*w+f*M+p*x,X=a*O+s*w+d*M+m*x,H=i*O+c*w+h*M+y*x,Y=o*O+l*w+E*M+_*x,k=n*P+u*C+f*D+p*L,j=a*P+s*C+d*D+m*L,Z=i*P+c*C+h*D+y*L,K=o*P+l*C+E*D+_*L;return r[0]=U,r[1]=F,r[2]=b,r[3]=z,r[4]=B,r[5]=G,r[6]=q,r[7]=V,r[8]=W,r[9]=X,r[10]=H,r[11]=Y,r[12]=k,r[13]=j,r[14]=Z,r[15]=K,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],p=t[0],m=t[1],y=t[2],_=t[4],T=t[5],R=t[6],v=t[8],A=t[9],S=t[10],N=t[12],I=t[13],g=t[14],O=n*p+o*m+c*y,w=a*p+u*m+l*y,M=i*p+s*m+f*y,x=n*_+o*T+c*R,P=a*_+u*T+l*R,C=i*_+s*T+f*R,D=n*v+o*A+c*S,L=a*v+u*A+l*S,U=i*v+s*A+f*S,F=n*N+o*I+c*g+d,b=a*N+u*I+l*g+h,z=i*N+s*I+f*g+E;return r[0]=O,r[1]=w,r[2]=M,r[3]=0,r[4]=x,r[5]=P,r[6]=C,r[7]=0,r[8]=D,r[9]=L,r[10]=U,r[11]=0,r[12]=F,r[13]=b,r[14]=z,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],p=t[3],m=t[4],y=t[5],_=t[6],T=t[7],R=t[8],v=n*d+o*h+c*E,A=a*d+u*h+l*E,S=i*d+s*h+f*E,N=n*p+o*m+c*y,I=a*p+u*m+l*y,g=i*p+s*m+f*y,O=n*_+o*T+c*R,w=a*_+u*T+l*R,M=i*_+s*T+f*R;return r[0]=v,r[1]=A,r[2]=S,r[3]=0,r[4]=N,r[5]=I,r[6]=g,r[7]=0,r[8]=O,r[9]=w,r[10]=M,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var m=new e;l.multiplyByUniformScale=function(e,t,r){return m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var y=new s,_=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,y),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],p=e[2],m=e[6],v=e[10],A=e[14],S=e[3],N=e[7],I=e[11],g=e[15],O=v*g,w=A*I,M=m*g,x=A*N,P=m*I,C=v*N,D=p*g,L=A*S,U=p*I,F=v*S,b=p*N,z=m*S,B=O*d+x*h+P*E-(w*d+M*h+C*E),G=w*f+D*h+F*E-(O*f+L*h+U*E),q=M*f+L*d+b*E-(x*f+D*d+z*E),V=C*f+U*d+z*h-(P*f+F*d+b*h),W=w*a+M*i+C*o-(O*a+x*i+P*o),X=O*n+L*i+U*o-(w*n+D*i+F*o),H=x*n+D*a+z*o-(M*n+L*a+b*o),Y=P*n+F*a+b*i-(C*n+U*a+z*i);O=i*E,w=o*h,M=a*E,x=o*d,P=a*h,C=i*d,D=n*E,L=o*f,U=n*h,F=i*f,b=n*d,z=a*f;var k=O*N+x*I+P*g-(w*N+M*I+C*g),j=w*S+D*I+F*g-(O*S+L*I+U*g),Z=M*S+L*N+b*g-(x*S+D*N+z*g),K=C*S+U*N+z*I-(P*S+F*N+b*I),J=M*v+C*A+w*m-(P*A+O*m+x*v),Q=U*A+O*p+L*v-(D*v+F*A+w*p),$=D*m+z*A+x*p-(b*A+M*p+L*m),ee=b*v+P*p+F*m-(U*m+z*v+C*p),te=n*B+a*G+i*q+o*V;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=B*te,r[1]=G*te,r[2]=q*te,r[3]=V*te,r[4]=W*te,r[5]=X*te,r[6]=H*te,r[7]=Y*te,r[8]=k*te,r[9]=j*te,r[10]=Z*te,r[11]=K*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-r*f-n*d-a*h,p=-i*f-o*d-u*h,m=-s*f-c*d-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=p,t[14]=m,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(r(e,0)),t=u.toRadians(r(t,0)),a=u.toRadians(r(a,0)),i=u.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var p=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=f,r):new s(a,l,i,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return n(r)?(r.west=l,r.south=d,r.east=f,r.north=h,r):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0),n(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,p=c;p.height=a,p.longitude=E,p.latitude=f,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.latitude=d,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=E,o[l]=t.cartographicToCartesian(p,o[l]),l++,f<0?p.latitude=f:d>0?p.latitude=d:p.latitude=0;for(var m=1;m<8;++m)p.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=t.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=E,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=t.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,E=new e,p=new e,m=new e,y=new e,_=new e,T=new e,R=new e,v=new e,A=new e,S=new e,N=new e;d.fromPoints=function(t,r){if(a(r)||(r=new d),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],T),i=e.clone(n,h),o=e.clone(n,E),u=e.clone(n,p),s=e.clone(n,m),c=e.clone(n,y),l=e.clone(n,_),f=t.length,I=1;I<f;I++){e.clone(t[I],n);var g=n.x,O=n.y,w=n.z;g<i.x&&e.clone(n,i),g>s.x&&e.clone(n,s),O<o.y&&e.clone(n,o),O>c.y&&e.clone(n,c),w<u.z&&e.clone(n,u),w>l.z&&e.clone(n,l)}var M=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),C=i,D=s,L=M;x>L&&(L=x,C=o,D=c),P>L&&(L=P,C=u,D=l);var U=v;U.x=.5*(C.x+D.x),U.y=.5*(C.y+D.y),U.z=.5*(C.z+D.z);var F=e.magnitudeSquared(e.subtract(D,U,R)),b=Math.sqrt(F),z=A;z.x=i.x,z.y=o.y,z.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,R),.5,N),q=0;for(I=0;I<f;I++){e.clone(t[I],n);var V=e.magnitude(e.subtract(n,G,R));V>q&&(q=V);var W=e.magnitudeSquared(e.subtract(n,U,R));if(W>F){var X=Math.sqrt(W);b=.5*(b+X),F=b*b;var H=X-b;U.x=(b*U.x+H*n.x)/X,U.y=(b*U.y+H*n.y)/X,U.z=(b*U.z+H*n.z)/X}}return b<q?(e.clone(U,r.center),r.radius=b):(e.clone(G,r.center),r.radius=q),r};var I=new o,g=new e,O=new e,w=new t,M=new t;d.fromRectangle2D=function(e,t,r){return d.fromRectangleWithHeights2D(e,t,0,0,r)},d.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,I),f.southwest(t,w),w.height=i,f.northeast(t,M),M.height=o;var s=r.project(w,g),c=r.project(M,O),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*h,p.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,r,o){t=n(t,i.WGS84),r=n(r,0);var u;return a(e)&&(u=f.subsample(e,t,r,x)),d.fromPoints(u,o)},d.fromVertices=function(t,r,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),i=n(i,3);var u=T;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,p),f=e.clone(u,m),I=e.clone(u,y),g=e.clone(u,_),O=t.length,w=0;w<O;w+=i){var M=t[w]+r.x,x=t[w+1]+r.y,P=t[w+2]+r.z;u.x=M,u.y=x,u.z=P,M<s.x&&e.clone(u,s),M>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>I.y&&e.clone(u,I),P<l.z&&e.clone(u,l),P>g.z&&e.clone(u,g)}var C=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(I,c,R)),L=e.magnitudeSquared(e.subtract(g,l,R)),U=s,F=f,b=C;D>b&&(b=D,U=c,F=I),L>b&&(b=L,U=l,F=g);var z=v;z.x=.5*(U.x+F.x),z.y=.5*(U.y+F.y),z.z=.5*(U.z+F.z);var B=e.magnitudeSquared(e.subtract(F,z,R)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var V=S;V.x=f.x,V.y=I.y,V.z=g.z;var W=e.multiplyByScalar(e.add(q,V,R),.5,N),X=0;for(w=0;w<O;w+=i){u.x=t[w]+r.x,u.y=t[w+1]+r.y,u.z=t[w+2]+r.z;var H=e.magnitude(e.subtract(u,W,R));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var j=k-G;z.x=(G*z.x+j*u.x)/k,z.y=(G*z.y+j*u.y)/k,z.z=(G*z.z+j*u.z)/k}}return G<X?(e.clone(z,o.center),o.radius=G):(e.clone(W,o.center),o.radius=X),o},d.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new d),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=T;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,p),c=e.clone(i,m),l=e.clone(i,y),f=e.clone(i,_),I=t.length,g=0;g<I;g+=3){var O=t[g]+r[g],w=t[g+1]+r[g+1],M=t[g+2]+r[g+2];i.x=O,i.y=w,i.z=M,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),w<u.y&&e.clone(i,u),w>l.y&&e.clone(i,l),M<s.z&&e.clone(i,s),M>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),C=e.magnitudeSquared(e.subtract(f,s,R)),D=o,L=c,U=x;P>U&&(U=P,D=u,L=l),C>U&&(U=C,D=s,L=f);var F=v;F.x=.5*(D.x+L.x),F.y=.5*(D.y+L.y),F.z=.5*(D.z+L.z);var b=e.magnitudeSquared(e.subtract(L,F,R)),z=Math.sqrt(b),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,R),.5,N),V=0;for(g=0;g<I;g+=3){i.x=t[g]+r[g],i.y=t[g+1]+r[g+1],i.z=t[g+2]+r[g+2];var W=e.magnitude(e.subtract(i,q,R));W>V&&(V=W);var X=e.magnitudeSquared(e.subtract(i,F,R));if(X>b){var H=Math.sqrt(X);z=.5*(z+H),b=z*z;var Y=H-z;F.x=(z*F.x+Y*i.x)/H,F.y=(z*F.y+Y*i.y)/H,F.z=(z*F.z+Y*i.z)/H}}return z<V?(e.clone(F,n.center),n.radius=z):(e.clone(q,n.center),n.radius=V),n},d.fromCornerPoints=function(t,r,n){a(n)||(n=new d);var i=n.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),n.radius=e.distance(i,r),n},d.fromEllipsoid=function(t,r){return a(r)||(r=new d),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var P=new e;d.fromBoundingSpheres=function(t,r){if(a(r)||(r=new d),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return d.clone(t[0],r);if(2===n)return d.union(t[0],t[1],r);for(var i=[],o=0;o<n;o++)i.push(t[o].center);r=d.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var C=new e,D=new e,L=new e;d.fromOrientedBoundingBox=function(t,r){a(r)||(r=new d);var n=t.halfAxes,i=c.getColumn(n,0,C),o=c.getColumn(n,1,D),u=c.getColumn(n,2,L);return e.add(i,o,i),e.add(i,u,i),r.center=e.clone(t.center,r.center),r.radius=e.magnitude(i),r},d.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},d.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new d);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var U=new e,F=new e;d.union=function(t,r,n){a(n)||(n=new d);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(h,i,h),e.clone(h,n.center),n.radius=f,n};var b=new e;d.expand=function(t,r,n){n=d.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,b));return a>n.radius&&(n.radius=a),n},d.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,r){return a(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var z=new e;d.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},d.transformWithoutScale=function(e,t,r){return a(r)||(r=new d),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var B=new e;d.computePlaneDistances=function(t,r,n,i){a(i)||(i=new s);var o=e.subtract(t.center,r,B),u=e.dot(n,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,W=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,r,a){r=n(r,j);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),h=e.negate(c,W),E=Y,p=E[0];e.add(s,l,p),e.add(p,c,p),p=E[1],e.add(s,l,p),e.add(p,h,p),p=E[2],e.add(s,f,p),e.add(p,h,p),p=E[3],e.add(s,f,p),e.add(p,c,p),e.negate(s,s),p=E[4],e.add(s,l,p),e.add(p,c,p),p=E[5],e.add(s,l,p),e.add(p,h,p),p=E[6],e.add(s,f,p),e.add(p,h,p),p=E[7],e.add(s,f,p),e.add(p,c,p);for(var m=E.length,y=0;y<m;++y){var _=E[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);r.project(T,_)}a=d.fromPoints(E,a),o=a.center;var R=o.x,v=o.y,A=o.z;return o.x=A,o.y=R,o.z=v,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,r){return d.computePlaneDistances(this,e,t,r)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var a=0;a<n;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{ +get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(v)&&(v=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,A=n(e[1]))}return v}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=n(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,g=n(e[1]),g.isNightly=!!e[2])}return I}function c(){return s()&&g}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,w=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,w=n(e[1])))}return O}function f(){return l()&&w}function d(){if(!t(M)){M=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(M=!0,x=n(e[1]))}return M}function h(){return d()&&x}function E(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(P=!0,C=n(e[1]))}return P}function p(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function m(){return E()&&C}function y(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),L}function _(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(U=r)}return F}function T(){return _()?U:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var v,A,S,N,I,g,O,w,M,x,P,C,D,L,U,F,b={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:m,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return b.supportsFullscreen=function(){return r.supportsFullscreen()},b.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},b.supportsWebWorkers=function(){return"undefined"!=typeof Worker},b}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(a[r])||(a[r]=!0,console.warn(e(n,r)))}var a={};return n.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.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(t,r,n){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(n,0)}return a.fromQuaternion=function(e,r){t(r)||(r=new a);var n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(s,u),r.roll=Math.atan2(o,i),r.pitch=-Math.asin(n),r},a.fromDegrees=function(e,r,i,o){return t(o)||(o=new a),o.heading=e*n.RADIANS_PER_DEGREE,o.pitch=r*n.RADIANS_PER_DEGREE,o.roll=i*n.RADIANS_PER_DEGREE,o},a.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},a.equalsEpsilon=function(e,r,a,i){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,a,i)&&n.equalsEpsilon(e.pitch,r.pitch,a,i)&&n.equalsEpsilon(e.roll,r.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,r){return a.equalsEpsilon(this,e,t,r)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.z=r(n,0),this.w=r(a,0)}var f=new e;l.fromAxisAngle=function(t,r,a){var i=r/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,d=Math.cos(i);return n(a)?(a.x=u,a.y=s,a.z=c,a.w=d,a):new l(u,s,c,d)};var d=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var r,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],p=s+f+E;if(p>0)r=Math.sqrt(p+1),u=.5*r,r=.5/r,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*r,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*r,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*r;else{var m=d,y=0;f>s&&(y=1),E>s&&E>f&&(y=2);var _=m[y],T=m[_];r=Math.sqrt(e[c.getElementIndex(y,y)]-e[c.getElementIndex(_,_)]-e[c.getElementIndex(T,T)]+1);var R=h;R[y]=.5*r,r=.5/r,u=(e[c.getElementIndex(T,_)]-e[c.getElementIndex(_,T)])*r,R[_]=(e[c.getElementIndex(_,y)]+e[c.getElementIndex(y,_)])*r,R[T]=(e[c.getElementIndex(T,y)]+e[c.getElementIndex(y,T)])*r,a=-R[0],i=-R[1],o=-R[2]}return n(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,p=new l,m=new l,y=new l;l.fromHeadingPitchRoll=function(t,r,n,i){var o;return t instanceof u?(o=t,i=r):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,r,n)),y=l.fromAxisAngle(e.UNIT_X,o.roll,E),m=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(m,y,m),p=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(p,i,i)};var _=new e,T=new e,R=new l,v=new l,A=new l;l.packedLength=4,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},l.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,r,n){l.unpack(e,4*r,A),l.conjugate(A,A);for(var a=0,i=r-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,A,R),R.w<0&&l.negate(R,R),l.computeAxis(R,_);var u=l.computeAngle(R);n[o]=_.x*u,n[o+1]=_.y*u,n[o+2]=_.z*u}},l.unpackInterpolationResult=function(t,r,a,i,o){n(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(r,4*i,v),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,v,o)},l.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var r=1/l.magnitude(e),n=e.x*r,a=e.y*r,i=e.z*r,o=e.w*r;return t.x=n,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var r=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/r,t)},l.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},l.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+n*l+a*c-i*s,d=o*s-n*c+a*l+i*u,h=o*c+n*s-a*u+i*l,E=o*l-n*u-a*s-i*c;return r.x=f,r.y=d,r.z=h,r.w=E,r},l.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},l.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},l.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var S=new l;l.lerp=function(e,t,r,n){return S=l.multiplyByScalar(t,r,S),n=l.multiplyByScalar(e,1-r,n),l.add(S,n,n)};var N=new l,I=new l,g=new l;l.slerp=function(e,t,r,n){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,r,n);var o=Math.acos(a);return I=l.multiplyByScalar(e,Math.sin((1-r)*o),I),g=l.multiplyByScalar(i,Math.sin(r*o),g),n=l.add(I,g,n),l.multiplyByScalar(n,1/Math.sin(o),n)},l.log=function(t,r){var n=s.acosClamped(t.w),a=0;return 0!==n&&(a=n/Math.sin(n)),e.multiplyByScalar(t,a,r)},l.exp=function(t,r){var n=e.magnitude(t),a=0;return 0!==n&&(a=Math.sin(n)/n),r.x=t.x*a,r.y=t.y*a,r.z=t.z*a,r.w=Math.cos(n),r};var O=new e,w=new e,M=new l,x=new l;l.computeInnerQuadrangle=function(t,r,n,a){var i=l.conjugate(r,M);l.multiply(i,n,x);var o=l.log(x,O);l.multiply(i,t,x);var u=l.log(x,w);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,M),l.multiply(r,M,a)},l.squad=function(e,t,r,n,a,i){var o=l.slerp(e,t,a,M),u=l.slerp(r,n,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var P=new l,C=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],b=0;b<7;++b){var z=b+1,B=2*z+1;D[b]=1/(z*B),L[b]=z/B}return D[7]=C/136,L[7]=8*C/17,l.fastSlerp=function(e,t,r,n){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-r,s=r*r,c=u*u,f=7;f>=0;--f)U[f]=(D[f]*s-L[f])*o,F[f]=(D[f]*c-L[f])*o;var d=a*r*(1+U[0]*(1+U[1]*(1+U[2]*(1+U[3]*(1+U[4]*(1+U[5]*(1+U[6]*(1+U[7])))))))),h=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,h,P);return l.multiplyByScalar(t,d,n),l.add(E,n,n)},l.fastSquad=function(e,t,r,n,a,i){var o=l.fastSlerp(e,t,a,M),u=l.fastSlerp(r,n,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,r,n){"use strict";function a(t,a,i,l,f,d,h,E,p,m){var y=t+a;e.multiplyByScalar(l,Math.cos(y),o),e.multiplyByScalar(i,Math.sin(y),u),e.add(o,u,o);var _=Math.cos(t);_*=_;var T=Math.sin(t);T*=T;var R=d/Math.sqrt(h*_+f*T),v=R/E;return n.fromAxisAngle(o,v,s),r.fromQuaternion(s,c),r.multiplyByVector(c,p,m),e.normalize(m,m),e.multiplyByScalar(m,E,m),m}var i={},o=new e,u=new e,s=new n,c=new r,l=new e,f=new e,d=new e,h=new e;i.raisePositionsToHeight=function(t,r,n){for(var a=r.ellipsoid,i=r.height,o=r.extrudedHeight,u=n?t.length/3*2:t.length/3,s=new Float64Array(3*u),c=t.length,E=n?c:0,p=0;p<c;p+=3){var m=p+1,y=p+2,_=e.fromArray(t,p,l);a.scaleToGeodeticSurface(_,_);var T=e.clone(_,f),R=a.geodeticSurfaceNormal(_,h),v=e.multiplyByScalar(R,i,d);e.add(_,v,_),n&&(e.multiplyByScalar(R,o,v),e.add(T,v,T),s[p+E]=T.x,s[m+E]=T.y,s[y+E]=T.z),s[p]=_.x,s[m]=_.y,s[y]=_.z}return s};var E=new e,p=new e,m=new e;return i.computeEllipsePositions=function(r,n,i){var o=r.semiMinorAxis,u=r.semiMajorAxis,s=r.rotation,c=r.center,h=8*r.granularity,y=o*o,_=u*u,T=u*o,R=e.magnitude(c),v=e.normalize(c,E),A=e.cross(e.UNIT_Z,c,p);A=e.normalize(A,A);var S=e.cross(v,A,m),N=1+Math.ceil(t.PI_OVER_TWO/h),I=t.PI_OVER_TWO/(N-1),g=t.PI_OVER_TWO-N*I;g<0&&(N-=Math.ceil(Math.abs(g)/I));var O,w,M,x,P,C=2*(N*(N+2)),D=n?new Array(3*C):void 0,L=0,U=l,F=f,b=4*N*3,z=b-1,B=0,G=i?new Array(b):void 0;for(g=t.PI_OVER_TWO,U=a(g,s,S,A,y,T,_,R,v,U),n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x),g=t.PI_OVER_TWO-I,O=1;O<N+1;++O){if(U=a(g,s,S,A,y,T,_,R,v,U),F=a(Math.PI-g,s,S,A,y,T,_,R,v,F),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,M=2*O+2,w=1;w<M-1;++w)x=w/(M-1),P=e.lerp(U,F,x,d),D[L++]=P.x,D[L++]=P.y,D[L++]=P.z;D[L++]=F.x,D[L++]=F.y,D[L++]=F.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=F.x,G[B++]=F.y,G[B++]=F.z),g=t.PI_OVER_TWO-(O+1)*I}for(O=N;O>1;--O){if(g=t.PI_OVER_TWO-(O-1)*I,U=a(-g,s,S,A,y,T,_,R,v,U),F=a(g+Math.PI,s,S,A,y,T,_,R,v,F),n){for(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,M=2*(O-1)+2,w=1;w<M-1;++w)x=w/(M-1),P=e.lerp(U,F,x,d),D[L++]=P.x,D[L++]=P.y,D[L++]=P.z;D[L++]=F.x,D[L++]=F.y,D[L++]=F.z}i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,G[B++]=F.x,G[B++]=F.y,G[B++]=F.z)}g=t.PI_OVER_TWO,U=a(-g,s,S,A,y,T,_,R,v,U);var q={};return n&&(D[L++]=U.x,D[L++]=U.y,D[L++]=U.z,q.positions=D,q.numPts=N),i&&(G[z--]=U.z,G[z--]=U.y,G[z--]=U.x,q.outerPositions=G),q},i}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values; +}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,r,n,a,i){"use strict";var o={};o.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,a=r.y;r.x=(1-Math.abs(a))*i.signNotZero(n),r.y=(1-Math.abs(n))*i.signNotZero(a)}return r.x=i.toSNorm(r.x,t),r.y=i.toSNorm(r.y,t),r},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,r,n,a){if(a.x=i.fromSNorm(e,n),a.y=i.fromSNorm(r,n),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},o.octDecode=function(e,t,r){return o.octDecodeInRange(e,t,255,r)},o.octPackFloat=function(e){return 256*e.x+e.y};var u=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,u),o.octPackFloat(u)},o.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return o.octDecode(n,a,t)},o.octPack=function(e,t,r,n){var a=o.octEncodeFloat(e),i=o.octEncodeFloat(t),s=o.octEncode(r,u);return n.x=65536*s.x+a,n.y=65536*s.y+i,n},o.octUnpack=function(e,t,r,n){var a=e.x/65536,i=Math.floor(a),u=65536*(a-i);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);o.octDecodeFloat(u,t),o.octDecodeFloat(c,r),o.octDecode(i,s,n)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},o.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},o}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined"],function(e,t,r,n){"use strict";function a(r,a,s,c,l){n(l)||(l=new t);var f,d,h,E,p,m,y,_;n(a.z)?(f=t.subtract(s,a,i),d=t.subtract(c,a,o),h=t.subtract(r,a,u),E=t.dot(f,f),p=t.dot(f,d),m=t.dot(f,h),y=t.dot(d,d),_=t.dot(d,h)):(f=e.subtract(s,a,i),d=e.subtract(c,a,o),h=e.subtract(r,a,u),E=e.dot(f,f),p=e.dot(f,d),m=e.dot(f,h),y=e.dot(d,d),_=e.dot(d,h));var T=1/(E*y-p*p);return l.y=(y*m-p*_)*T,l.z=(E*_-p*m)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,f=r(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[d/e,a/d]:[a/d,d/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,p=o*c-u*s,m=u*c-h,y=4*E*m-p*p;if(y<0){var _,T,R;d*f>=l*h?(_=o,T=E,R=-2*u*E+o*p):(_=c,T=m,R=-c*p+2*s*m);var v=R<0?-1:1,A=-v*Math.abs(_)*Math.sqrt(-y);i=-R+A;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),I=i===A?-N:-T/N;return a=T<=0?N+I:-R/(N*N+I*I+T),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var g=E,O=-2*u*E+o*p,w=m,M=-c*p+2*s*m,x=Math.sqrt(y),P=Math.sqrt(3)/2,C=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-g);var D=Math.cos(C);i=a*D;var L=a*(-D/2-P*Math.sin(C)),U=i+L>2*u?i-u:L-u,F=o,b=U/F;C=Math.abs(Math.atan2(c*x,-M)/3),a=2*Math.sqrt(-w),D=Math.cos(C),i=a*D,L=a*(-D/2-P*Math.sin(C));var z=-c,B=i+L<2*s?i+s:L+s,G=z/B,q=F*B,V=-U*B-F*z,W=U*z,X=(s*V-u*W)/(-u*V+s*q);return b<=X?b<=G?X<=G?[b,X,G]:[b,G,X]:[G,b,X]:b<=G?[X,b,G]:X<=G?[X,G,b]:[G,X,b]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<r.EPSILON14){var E=n.computeRealRoots(1,s,l);if(2===E.length){var p,m=E[0],y=E[1];if(m>=0&&y>=0){var _=Math.sqrt(m),T=Math.sqrt(y);return[d-T,d-_,d+_,d+T]}if(m>=0&&y<0)return p=Math.sqrt(m),[d-p,d+p];if(m<0&&y>=0)return p=Math.sqrt(y),[d-p,d+p]}return[]}if(h>0){var R=Math.sqrt(h),v=(s+h-c/R)/2,A=(s+h+c/R)/2,S=n.computeRealRoots(1,R,v),N=n.computeRealRoots(1,-R,A);return 0!==S.length?(S[0]+=d,S[1]+=d,0!==N.length?(N[0]+=d,N[1]+=d,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=d,N[1]+=d,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,p,m=h[0],y=a-m,_=y*y,T=t/2,R=y/2,v=_-4*o,A=_+4*Math.abs(o),S=c-4*m,N=c+4*Math.abs(m);if(m<0||v*N<S*A){var I=Math.sqrt(S);E=I/2,p=0===I?0:(t*R-i)/I}else{var g=Math.sqrt(v);E=0===g?0:(t*R-i)/g,p=g/2}var O,w;0===T&&0===E?(O=0,w=0):r.sign(T)===r.sign(E)?(O=T+E,w=m/O):(w=T-E,O=m/w);var M,x;0===R&&0===p?(M=0,x=0):r.sign(R)===r.sign(p)?(M=R+p,x=o/M):(x=R-p,M=o/x);var P=n.computeRealRoots(1,O,M),C=n.computeRealRoots(1,w,x);if(0!==P.length)return 0!==C.length?P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>C[0]&&P[0]<C[1]?[C[0],P[0],C[1],P[1]]:[P[0],C[0],P[1],C[1]]:P;if(0!==C.length)return C}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,d=f*n,h=a*a,E=h*a,p=u*c*f-4*s*d-4*e*l*f+18*e*t*r*d-27*i*f*f+256*o*E+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*i*r*f)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return p},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n}return a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";function f(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function d(t,r,a){n(a)||(a=new i);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,_),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,p=f(d,h,E,A);if(n(p))return a.start=p.root0,a.stop=p.root1,a}function h(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function E(t,r,n,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,p=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),m=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*r.x+n,y=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),T=[];if(0===_&&0===y){if(l=s.computeRealRoots(E,p,m),0===l.length)return T;var R=l[0],v=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-v)),T.push(new e(a,i*R,i*v)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,i*A,i*-S)),T.push(new e(a,i*A,i*S))}return T}var N=_*_,I=y*y,g=E*E,O=_*y,w=g+I,M=2*(p*E+O),x=2*m*E+p*p-I+N,P=2*(m*p-O),C=m*m-N;if(0===w&&0===M&&0===x&&0===P)return T;l=c.computeRealRoots(w,M,x,P,C);var D=l.length;if(0===D)return T;for(var L=0;L<D;++L){var U,F=l[L],b=F*F,z=Math.max(1-b,0),B=Math.sqrt(z);U=o.sign(E)===o.sign(m)?h(E*b+m,p*F,o.EPSILON12):o.sign(m)===o.sign(p*F)?h(E*b,p*F+m,o.EPSILON12):h(E*b+p*F,m,o.EPSILON12);var G=h(y*F,_,o.EPSILON15),q=U*G;q<0?T.push(new e(a,i*F,i*B)):q>0?T.push(new e(a,i*F,i*-B)):0!==B?(T.push(new e(a,i*F,i*-B)),T.push(new e(a,i*F,i*B)),++L):T.push(new e(a,i*F,i*B))}return T}var p={};p.rayPlane=function(t,r,a){n(a)||(a=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var m=new e,y=new e,_=new e,T=new e,R=new e;p.rayTriangleParametric=function(t,n,a,i,u){u=r(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,p=e.subtract(a,n,m),v=e.subtract(i,n,y),A=e.cross(E,v,_),S=e.dot(p,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,n,T),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,p,R),f=e.dot(E,c),f<0||l+f>S)return;d=e.dot(v,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(h,n,T),l=e.dot(s,A)*N,l<0||l>1)return;if(c=e.cross(s,p,R),f=e.dot(E,c)*N,f<0||l+f>1)return;d=e.dot(v,c)*N}return d},p.rayTriangle=function(t,r,a,i,o,u){var s=p.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var v=new l;p.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=v;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};p.raySphere=function(e,t,r){if(r=d(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new l;p.lineSegmentSphere=function(t,r,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,I=new e;p.rayEllipsoid=function(t,r){var n,a,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,I),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(n=d-1,a=e.magnitudeSquared(f),o=a*n,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var p=s/a,m=n/s;return p<m?new i(p,m):{start:m,stop:p}}var y=Math.sqrt(n/a);return new i(y,y)}return d<1?(n=d-1,a=e.magnitudeSquared(f),o=a*n,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var g=new e,O=new e,w=new e,M=new e,x=new e,P=new u,C=new u,D=new u,L=new u,U=new u,F=new u,b=new u,z=new e,B=new e,G=new t;p.grazingAltitudeLocation=function(t,r){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,g);if(e.dot(i,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(i,g),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,M),h=e.normalize(e.cross(d,f,O),O),p=e.normalize(e.cross(f,h,w),w),m=P;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=h.x,m[4]=h.y,m[5]=h.z,m[6]=p.x,m[7]=p.y,m[8]=p.z;var y=u.transpose(m,C),_=u.fromScale(r.radii,D),T=u.fromScale(r.oneOverRadii,L),R=U;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var v,A,S=u.multiply(u.multiply(y,T,F),R,F),N=u.multiply(u.multiply(S,_,b),m,b),I=u.multiplyByVector(S,a,x),q=E(N,e.negate(I,g),0,0,1),V=q.length;if(V>0){for(var W=e.clone(e.ZERO,B),X=Number.NEGATIVE_INFINITY,H=0;H<V;++H){v=u.multiplyByVector(_,u.multiplyByVector(m,q[H],z),z);var Y=e.normalize(e.subtract(v,a,M),M),k=e.dot(Y,i);k>X&&(X=k,W=e.clone(v,W))}var j=r.cartesianToCartographic(W,G);return X=o.clamp(X,0,1),A=e.magnitude(e.subtract(W,a,M))*Math.sqrt(1-X*X),A=c?-A:A,j.height=A,r.cartographicToCartesian(j,new e)}};var q=new e;return p.lineSegmentPlane=function(t,r,a,i){n(i)||(i=new e);var u=e.subtract(r,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},p.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return p.lineSegmentPlane(t,r,a,f),p.lineSegmentPlane(t,n,a,d),{positions:[t,r,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(r,n,a,f),p.lineSegmentPlane(r,t,a,d),{positions:[t,r,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(n,t,a,f),p.lineSegmentPlane(n,r,a,d),{positions:[t,r,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(r,t,a,f),p.lineSegmentPlane(n,t,a,d),{positions:[t,r,n,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(n,r,a,f),p.lineSegmentPlane(t,r,a,d),{positions:[t,r,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,n,a,f),p.lineSegmentPlane(r,n,a,d),{positions:[t,r,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,r,n,a){"use strict";function i(t,r){this.normal=e.clone(t),this.distance=r}i.fromPointNormal=function(r,n,a){var o=-e.dot(n,r);return t(a)?(e.clone(n,a.normal),a.distance=o,a):new i(n,o)};var o=new e;return i.fromCartesian4=function(r,n){var a=e.fromCartesian4(r,o),u=r.w;return t(n)?(e.clone(a,n.normal),n.distance=u,n):new i(a,u)},i.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,d=0;d<o;++d)f-c[n[d]]>i&&(c[n[d]]=f,++f);return(f-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var d=r[f];a[d].numLiveTriangles&&(s=0,i-a[d].timeStamp+2*a[d].numLiveTriangles<=t&&(s=i-a[d].timeStamp),(s>l||l===-1)&&(l=s,c=d)),++f}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,f=0,d=o[f],h=c;if(t(u))l=u+1;else{for(;f<h;)d>l&&(l=d),++f,d=o[f];if(l===-1)return 0;++l}for(var E=[],p=0;p<l;p++)E[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var m=0;f<h;)E[o[f]].vertexTriangles.push(m),++E[o[f]].numLiveTriangles,E[o[f+1]].vertexTriangles.push(m),++E[o[f+1]].numLiveTriangles,E[o[f+2]].vertexTriangles.push(m),++E[o[f+2]].numLiveTriangles,++m,f+=3;var y=0,_=s+1;i=1;var T,R,v=[],A=[],S=0,N=[],I=c/3,g=[];for(p=0;p<I;p++)g[p]=!1;for(var O,w;y!==-1;){v=[],R=E[y],w=R.vertexTriangles.length;for(var M=0;M<w;++M)if(m=R.vertexTriangles[M],!g[m]){g[m]=!0,f=m+m+m;for(var x=0;x<3;++x)O=o[f],v.push(O),A.push(O),N[S]=O,++S,T=E[O],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}y=a(o,s,v,E,_,A,l)}return N},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,p,m,y,_,T,R,v,A,S,N){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function g(e){for(var t=e.length,r=t/3*6,n=m.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=m.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function w(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=m.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function M(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new E({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function x(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),v.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function C(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function D(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,f=1;f<n;++f){var d=e[f][t].attributes[r];if(!c(d)||o.componentDatatype!==d.componentDatatype||o.componentsPerAttribute!==d.componentsPerAttribute||o.normalize!==d.normalize){l=!1;break}s+=d.values.length}l&&(a[r]=new E({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function L(e,t){var n,i,o,u,s,l,f,d=e.length,E=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,y=D(e,t);for(n in y)if(y.hasOwnProperty(n))for(s=y[n].values,u=0,i=0;i<d;++i)for(l=e[i][t].attributes[n].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(E){var T=0;for(i=0;i<d;++i)T+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:y,primitiveType:S.POINTS})),v=m.createTypedArray(R,T),A=0,N=0;for(i=0;i<d;++i){var I=e[i][t].indices,g=I.length;for(u=0;u<g;++u)v[A++]=N+I[u];N+=h.computeNumberOfVertices(e[i][t])}_=v}var O,w=new a,M=0;for(i=0;i<d;++i){if(O=e[i][t].boundingSphere,!c(O)){w=void 0;break}a.add(O.center,w,w)}if(c(w))for(a.divideByScalar(w,d,w),i=0;i<d;++i){O=e[i][t].boundingSphere;var x=a.magnitude(a.subtract(O.center,w,se))+O.radius;x>M&&(M=x)}return new h({attributes:y,indices:_,primitiveType:p,boundingSphere:c(w)?new r(w,M):void 0})}function U(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function b(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function B(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=m.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return F(e);case S.TRIANGLE_STRIP:return b(e);case S.TRIANGLES:return U(e);case S.LINE_STRIP:return B(e);case S.LINE_LOOP:return G(e);case S.LINES:return z(e)}return e}function V(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function W(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return V(e,e.y<0),V(t,t.y<0),void V(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?T.sign(e.y):T.sign(r.y):i>o?T.sign(t.y):T.sign(r.y);var u=n<0;V(e,u),V(t,u),V(r,u)}function X(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,ve),e.y/(e.y-t.y),ve),r),a.clone(r,n),V(r,!0),V(n,!1)}function H(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){W(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=ge.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(X(e,t,Ae,Ne),X(e,r,Se,Ie),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(X(t,r,Ae,Ne),X(t,e,Se,Ie),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(X(r,e,Ae,Ne),X(r,t,Se,Ie),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(X(r,e,Ae,Ne),X(r,t,Se,Ie),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(X(t,r,Ae,Ne),X(t,e,Se,Ie),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(X(e,t,Ae,Ne),X(e,r,Se,Ie),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=ge.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=Se,s[5]=Ne,s[6]=Ie,s.length=7),ge}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function k(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new E({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function j(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function Z(e,r,i,o,u,s,l,f,d,h,E,p){if(c(s)||c(l)||c(f)||c(d)||c(h)){var m=a.fromArray(u,3*e,Oe),y=a.fromArray(u,3*r,we),_=a.fromArray(u,3*i,Me),T=t(o,m,y,_,xe);if(c(s)){var R=a.fromArray(s,3*e,Oe),v=a.fromArray(s,3*r,we),A=a.fromArray(s,3*i,Me);a.multiplyByScalar(R,T.x,R),a.multiplyByScalar(v,T.y,v),a.multiplyByScalar(A,T.z,A);var S=a.add(R,v,R);a.add(S,A,S),a.normalize(S,S),a.pack(S,E.normal.values,3*p)}if(c(h)){var N=a.fromArray(h,3*e,Oe),I=a.fromArray(h,3*r,we),g=a.fromArray(h,3*i,Me);a.multiplyByScalar(N,T.x,N),a.multiplyByScalar(I,T.y,I),a.multiplyByScalar(g,T.z,g);var O;a.equals(N,a.ZERO)&&a.equals(I,a.ZERO)&&a.equals(g,a.ZERO)?(O=Oe,O.x=0,O.y=0,O.z=0):(O=a.add(N,I,N),a.add(O,g,O),a.normalize(O,O)),a.pack(O,E.extrudeDirection.values,3*p)}if(c(l)){var w=a.fromArray(l,3*e,Oe),M=a.fromArray(l,3*r,we),x=a.fromArray(l,3*i,Me);a.multiplyByScalar(w,T.x,w),a.multiplyByScalar(M,T.y,M),a.multiplyByScalar(x,T.z,x);var P=a.add(w,M,w);a.add(P,x,P),a.normalize(P,P),a.pack(P,E.tangent.values,3*p)}if(c(f)){var C=a.fromArray(f,3*e,Oe),D=a.fromArray(f,3*r,we),L=a.fromArray(f,3*i,Me);a.multiplyByScalar(C,T.x,C),a.multiplyByScalar(D,T.y,D),a.multiplyByScalar(L,T.z,L);var U=a.add(C,D,C);a.add(U,L,U),a.normalize(U,U),a.pack(U,E.bitangent.values,3*p)}if(c(d)){var F=n.fromArray(d,2*e,Pe),b=n.fromArray(d,2*r,Ce),z=n.fromArray(d,2*i,De);n.multiplyByScalar(F,T.x,F),n.multiplyByScalar(b,T.y,b),n.multiplyByScalar(z,T.z,z);var B=n.add(F,b,F);n.add(B,z,B),n.pack(B,E.st.values,2*p)}}}function K(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,d=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,E=c(s.st)?s.st.values:void 0,p=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,m=u.indices,y=k(u),_=k(u),T=[];T.length=l.length/3;var R=[];for(R.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,R[o]=-1;var v=m.length;for(o=0;o<v;o+=3){var A=m[o],S=m[o+1],N=m[o+2],I=a.fromArray(l,3*A),g=a.fromArray(l,3*S),O=a.fromArray(l,3*N),w=H(I,g,O);if(c(w)&&w.positions.length>3)for(var M=w.positions,x=w.indices,P=x.length,C=0;C<P;++C){var D=x[C],L=M[D];L.y<0?(t=_.attributes,r=_.indices,n=T):(t=y.attributes,r=y.indices,n=R),i=K(t,r,n,m,D<3?o+D:-1,L),Z(A,S,N,L,l,f,h,d,E,p,t,i)}else c(w)&&(I=w.positions[0],g=w.positions[1],O=w.positions[2]),I.y<0?(t=_.attributes,r=_.indices,n=T):(t=y.attributes,r=y.indices,n=R),i=K(t,r,n,m,o,I),Z(A,S,N,I,l,f,h,d,E,p,t,i),i=K(t,r,n,m,o+1,g),Z(A,S,N,g,l,f,h,d,E,p,t,i),i=K(t,r,n,m,o+2,O),Z(A,S,N,O,l,f,h,d,E,p,t,i)}j(e,_,y)}function Q(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=k(r),s=k(r),l=o.length,f=[];f.length=i.length/3;var d=[];for(d.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,d[t]=-1;for(t=0;t<l;t+=2){var h=o[t],E=o[t+1],p=a.fromArray(i,3*h,Oe),m=a.fromArray(i,3*E,we);Math.abs(p.y)<T.EPSILON6&&(p.y<0?p.y=-T.EPSILON6:p.y=T.EPSILON6),Math.abs(m.y)<T.EPSILON6&&(m.y<0?m.y=-T.EPSILON6:m.y=T.EPSILON6);var y=u.attributes,R=u.indices,v=d,A=s.attributes,S=s.indices,N=f,I=_.lineSegmentPlane(p,m,Le,Me);if(c(I)){var g=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Ue);p.y<0&&(a.negate(g,g),y=s.attributes,R=s.indices,v=f,A=u.attributes,S=u.indices,N=d);var O=a.add(I,g,Fe);K(y,R,v,o,t,p),K(y,R,v,o,-1,O),a.negate(g,g),a.add(I,g,O),K(A,S,N,o,-1,O),K(A,S,N,o,t+1,m)}else{var w,M,x;p.y<0?(w=s.attributes,M=s.indices,x=f):(w=u.attributes,M=u.indices,x=d),K(w,M,x,o,t,p),K(w,M,x,o,t+1,m)}}j(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,Be);if(!(s.x>0)){var c=a.unpack(n,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,d=s.nextPosition.values,h=s.expandAndWidth.values,E=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,m=k(u),y=k(u),R=!1,v=l.length/3;for(t=0;t<v;t+=4){var A=t,S=t+2,N=a.fromArray(l,3*A,Be),I=a.fromArray(l,3*S,Ge);if(Math.abs(N.y)<ke)for(N.y=ke*(I.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(I.y)<ke)for(I.y=ke*(N.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*A;r<3*A+12;r+=3)d[r]=l[3*(t+2)],d[r+1]=l[3*(t+2)+1],d[r+2]=l[3*(t+2)+2];var g=m.attributes,O=m.indices,w=y.attributes,M=y.indices,x=_.lineSegmentPlane(N,I,Le,Ve);if(c(x)){R=!0;var P=a.multiplyByScalar(a.UNIT_Y,Ye,We);N.y<0&&(a.negate(P,P),g=y.attributes,O=y.indices,w=m.attributes,M=m.indices);var C=a.add(x,P,Xe);g.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),g.position.values.push(C.x,C.y,C.z),g.position.values.push(C.x,C.y,C.z),g.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),g.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),g.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),g.nextPosition.values.push(C.x,C.y,C.z),g.nextPosition.values.push(C.x,C.y,C.z),g.nextPosition.values.push(C.x,C.y,C.z),g.nextPosition.values.push(C.x,C.y,C.z),a.negate(P,P),a.add(x,P,C),w.position.values.push(C.x,C.y,C.z),w.position.values.push(C.x,C.y,C.z),w.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),w.prevPosition.values.push(C.x,C.y,C.z),w.prevPosition.values.push(C.x,C.y,C.z),w.prevPosition.values.push(C.x,C.y,C.z),w.prevPosition.values.push(C.x,C.y,C.z),w.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),w.nextPosition.values.push(d[3*S],d[3*S+1],d[3*S+2]),w.nextPosition.values.push(d[3*S+3],d[3*S+4],d[3*S+5]);var D=n.fromArray(h,2*A,be),L=Math.abs(D.y);g.expandAndWidth.values.push(-1,L,1,L),g.expandAndWidth.values.push(-1,-L,1,-L),w.expandAndWidth.values.push(-1,L,1,L),w.expandAndWidth.values.push(-1,-L,1,-L);var U=a.magnitudeSquared(a.subtract(x,N,qe));if(U/=a.magnitudeSquared(a.subtract(I,N,qe)),c(p)){var F=i.fromArray(p,4*A,He),b=i.fromArray(p,4*S,He),z=T.lerp(F.x,b.x,U),B=T.lerp(F.y,b.y,U),G=T.lerp(F.z,b.z,U),q=T.lerp(F.w,b.w,U);for(r=4*A;r<4*A+8;++r)g.color.values.push(p[r]);for(g.color.values.push(z,B,G,q),g.color.values.push(z,B,G,q),w.color.values.push(z,B,G,q),w.color.values.push(z,B,G,q),r=4*S;r<4*S+8;++r)w.color.values.push(p[r])}if(c(E)){var V=n.fromArray(E,2*A,be),W=n.fromArray(E,2*(t+3),ze),X=T.lerp(V.x,W.x,U);for(r=2*A;r<2*A+4;++r)g.st.values.push(E[r]);for(g.st.values.push(X,V.y),g.st.values.push(X,W.y),w.st.values.push(X,V.y),w.st.values.push(X,W.y),r=2*S;r<2*S+4;++r)w.st.values.push(E[r])}o=g.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=w.position.values.length/3-4,M.push(o,o+2,o+1),M.push(o+1,o+2,o+3); +}else{var H,Y;for(N.y<0?(H=y.attributes,Y=y.indices):(H=m.attributes,Y=m.indices),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(I.x,I.y,I.z),H.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)H.prevPosition.values.push(f[r]),H.nextPosition.values.push(d[r]);for(r=2*t;r<2*t+8;++r)H.expandAndWidth.values.push(h[r]),c(E)&&H.st.values.push(E[r]);if(c(p))for(r=4*t;r<4*t+16;++r)H.color.values.push(p[r]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}R&&($(y),$(m)),j(e,y,m)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=g(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=w(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,d=0;d<o;d+=3)l[f++]=a[d],l[f++]=a[d+1],l[f++]=a[d+2],l[f++]=a[d]+i[d]*n,l[f++]=a[d+1]+i[d+1]*n,l[f++]=a[d+2]+i[d+2]*n;var p,m=e.boundingSphere;return c(m)&&(p=new r(m.center,m.radius+n)),new h({attributes:{position:new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:p})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=m.createTypedArray(t,s),f=0,d=0,E=0;f<s;)i=n[o[f]],i!==-1?l[d]=i:(i=o[f],n[i]=E,l[d]=E,++E),++f,++d;e.indices=l;var p=e.attributes;for(var y in p)if(p.hasOwnProperty(y)&&c(p[y])&&c(p[y].values)){for(var _=p[y],T=_.values,R=0,v=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,E*v);R<t;){var S=n[R];if(S!==-1)for(a=0;a<v;a++)A[v*S+a]=T[v*R+a];++R}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=N.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=T.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=M(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var f=0;f<l;f+=n){for(var d=0;d<n;++d){var E=s[f+d],p=a[E];c(p)||(p=o++,a[E]=p,x(u,e.attributes,E)),i.push(p)}o+n>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=M(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new d;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),h=0,p=0;p<l.length;p+=3){var m=a.fromArray(l,p,re),y=s.cartesianToCartographic(m,ne),_=i.project(y,re);f[h++]=_.x,f[h++]=_.y,f[h++]=_.z}return e.attributes[r]=o,e.attributes[n]=new E({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var d=a.componentsPerAttribute;return e.attributes[r]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:s}),e.attributes[n]=new E({componentDatatype:u.FLOAT,componentsPerAttribute:d,values:c}),delete e.attributes[t],e};var ie=new a,oe=new v,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(v.equals(t,v.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(v.inverse(t,oe),v.transpose(oe,oe),v.getRotation(oe,ue),C(ue,n.normal),C(ue,n.tangent),C(ue,n.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=v.clone(v.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(L(t,"geometry")),r.length>0&&(o.push(L(r,"westHemisphereGeometry")),o.push(L(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,fe=new a,de=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var d=0;for(f=0;f<o;f+=3){var h=t[f],p=t[f+1],m=t[f+2],y=3*h,_=3*p,R=3*m;le.x=n[y],le.y=n[y+1],le.z=n[y+2],fe.x=n[_],fe.y=n[_+1],fe.z=n[_+2],de.x=n[R],de.y=n[R+1],de.z=n[R+2],s[h].count++,s[p].count++,s[m].count++,a.subtract(fe,le,fe),a.subtract(de,le,de),c[d]=a.cross(fe,de,new a),d++}var v=0;for(f=0;f<i;f++)s[f].indexOffset+=v,v+=s[f].count;d=0;var A;for(f=0;f<o;f+=3){A=s[t[f]];var S=A.indexOffset+A.currentCount;l[S]=d,A.currentCount++,A=s[t[f+1]],S=A.indexOffset+A.currentCount,l[S]=d,A.currentCount++,A=s[t[f+2]],S=A.indexOffset+A.currentCount,l[S]=d,A.currentCount++,d++}var N=new Float32Array(3*i);for(f=0;f<i;f++){var I=3*f;if(A=s[f],a.clone(a.ZERO,ce),A.count>0){for(d=0;d<A.count;d++)a.add(ce,c[l[A.indexOffset+d]],ce);a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&a.clone(c[l[A.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),N[I]=ce.x,N[I+1]=ce.y,N[I+2]=ce.z}return e.attributes.normal=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,Ee=new a,pe=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,d,h;for(l=0;l<s;l+=3){var p=t[l],m=t[l+1],y=t[l+2];f=3*p,d=3*m,h=3*y;var _=2*p,T=2*m,R=2*y,v=r[f],A=r[f+1],S=r[f+2],N=i[_],I=i[_+1],g=i[T+1]-I,O=i[R+1]-I,w=1/((i[T]-N)*O-(i[R]-N)*g),M=(O*(r[d]-v)-g*(r[h]-v))*w,x=(O*(r[d+1]-A)-g*(r[h+1]-A))*w,P=(O*(r[d+2]-S)-g*(r[h+2]-S))*w;c[f]+=M,c[f+1]+=x,c[f+2]+=P,c[d]+=M,c[d+1]+=x,c[d+2]+=P,c[h]+=M,c[h+1]+=x,c[h+2]+=P}var C=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,d=f+1,h=f+2;var L=a.fromArray(n,f,he),U=a.fromArray(c,f,pe),F=a.dot(L,U);a.multiplyByScalar(L,F,Ee),a.normalize(a.subtract(U,Ee,U),U),C[f]=U.x,C[d]=U.y,C[h]=U.z,a.normalize(a.cross(L,U,U),U),D[f]=U.x,D[d]=U.y,D[h]=U.z}return e.attributes.tangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:C}),e.attributes.bitangent=new E({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e};var me=new n,ye=new a,_e=new a,Te=new a,Re=new n;te.compressVertices=function(t){var r,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),f=0;for(r=0;r<i;++r)a.fromArray(s,3*r,ye),a.equals(ye,a.ZERO)?f+=2:(Re=e.octEncodeInRange(ye,65535,Re),l[f++]=Re.x,l[f++]=Re.y);return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var d=t.attributes.normal,h=t.attributes.st,p=c(d),m=c(h);if(!p&&!m)return t;var y,_,T,R,v=t.attributes.tangent,A=t.attributes.bitangent,S=c(v),N=c(A);p&&(y=d.values),m&&(_=h.values),S&&(T=v.values),N&&(R=A.values);var I=p?y.length:_.length,g=p?3:2;i=I/g;var O=i,w=m&&p?2:1;w+=S||N?1:0,O*=w;var M=new Float32Array(O),x=0;for(r=0;r<i;++r){m&&(n.fromArray(_,2*r,me),M[x++]=e.compressTextureCoordinates(me));var P=3*r;p&&c(T)&&c(R)?(a.fromArray(y,P,ye),a.fromArray(T,P,_e),a.fromArray(R,P,Te),e.octPack(ye,_e,Te,me),M[x++]=me.x,M[x++]=me.y):(p&&(a.fromArray(y,P,ye),M[x++]=e.octEncodeFloat(ye)),S&&(a.fromArray(T,P,ye),M[x++]=e.octEncodeFloat(ye)),N&&(a.fromArray(R,P,ye),M[x++]=e.octEncodeFloat(ye)))}return t.attributes.compressedAttributes=new E({componentDatatype:u.FLOAT,componentsPerAttribute:w,values:M}),p&&delete t.attributes.normal,m&&delete t.attributes.st,N&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var ve=new a,Ae=new a,Se=new a,Ne=new a,Ie=new a,ge={positions:new Array(7),indices:new Array(9)},Oe=new a,we=new a,Me=new a,xe=new a,Pe=new n,Ce=new n,De=new n,Le=A.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,Fe=new a,be=new n,ze=new n,Be=new a,Ge=new a,qe=new a,Ve=new a,We=new a,Xe=new a,He=new i,Ye=5*T.EPSILON9,ke=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,A.ORIGIN_ZX_PLANE)!==y.INTERSECTING)return e}if(t.geometryType!==p.NONE)switch(t.geometryType){case p.POLYLINES:ee(e);break;case p.TRIANGLES:J(e);break;case p.LINES:Q(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&Q(e);return e},te}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,a){return t(e).then(r,n,a)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=o(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=a(e),t}function r(t){return e(t,i)}function n(e){this.then=e}function a(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(e){return i(e)}});return r}function i(e){var r=new n(function(r,n){try{return n?t(n(e)):i(e)}catch(e){return i(e)}});return r}function o(){function e(e,t,r){return d(e,t,r)}function r(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new n(e),s={then:e,resolve:r,reject:a,progress:u,promise:c,resolver:{resolve:r,reject:a,progress:u}},l=[],f=[],d=function(e,t,r){var n,a;return n=o(),a="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,a)}),f.push(a),n.promise},h=function(e){return p(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=y,p(l,e),f=l=v,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,a,i){return m(2,arguments),e(t,function(t){function u(e){p(e)}function s(e){E(e)}var c,l,f,d,h,E,p,m,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),f=[],l=_-c+1,d=[],h=o(),c)for(m=h.progress,p=function(e){d.push(e),--l||(E=p=y,h.reject(d))},E=function(e){f.push(e),--c||(E=p=y,h.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,m);else h.resolve(f);return h.then(n,a,i)})}function c(e,t,r,n){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,r,n)}function l(e,t,r,n){return m(1,arguments),d(e,_).then(t,r,n)}function f(){return d(arguments,_)}function d(t,r){return e(t,function(t){var n,a,i,u,s,c;if(i=a=t.length>>>0,n=[],c=o(),i)for(u=function(t,a){e(t,r).then(function(e){n[a]=e,--i||c.resolve(n)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(n);return c.promise})}function h(t,r){var n=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,n[0]=function(t,n,i){return e(t,function(t){return e(n,function(e){return r(t,e,i,a)})})},T.apply(t,n)})}function E(t,r,n){var a=arguments.length>2;return e(t,function(e){return e=a?n:e,r.resolve(e),e},function(e){return r.reject(e),i(e)},r.progress)}function p(e,t){for(var r,n=0;r=e[n++];)r(t)}function m(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function y(){}function _(e){return e}var T,R,v;return e.defer=o,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(v,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(v,t)})})}},R=[].slice,T=[].reduce||function(e){var t,r,n,a,i;if(i=0,t=Object(this),a=t.length>>>0,r=arguments,r.length<=1)for(;;){if(i in t){n=t[i++];break}if(++i>=a)throw new TypeError}else n=r[1];for(;i<a;++i)i in t&&(n=e(n,t[i],i,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function r(e,t,r){for(var n,a,i=0,o=e.length-1;i<=o;)if(n=~~((i+o)/2),a=r(e[n],t),a<0)i=n+1;else{if(!(a>0))return n;o=n-1}return~(o+1)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,n,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,n=t[r++],a=function(e,t,r,n){r||(r=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return n?e+a:a+e},i=function(e,t,r,n,i,o){var u=n-e.length;return u>0&&(e=r||!i?a(e,n,o,r):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,r,n,o,u,s){var c=e>>>0;return r=r&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+a(c.toString(t),u||0,"0",!1),i(e,r,n,o,s)},u=function(e,t,r,n,a,o){return null!=n&&(e=e.slice(0,n)),i(e,"",t,r,a,o)},s=function(e,n,s,c,l,f,d){var h,E,p,m,y;if("%%"==e)return"%";for(var _=!1,T="",R=!1,v=!1,A=" ",S=s.length,N=0;s&&N<S;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":A=s.charAt(N+1);break;case"0":R=!0;break;case"#":v=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[r++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,y=n?t[n.slice(0,-1)]:t[r++],d){case"s":return u(String(y),_,c,f,R,A);case"c":return u(String.fromCharCode(+y),_,c,f,R);case"b":return o(y,2,v,_,c,f,R);case"o":return o(y,8,v,_,c,f,R);case"x":return o(y,16,v,_,c,f,R);case"X":return o(y,16,v,_,c,f,R).toUpperCase();case"u":return o(y,10,v,_,c,f,R);case"i":case"d":return h=+y||0,h=Math.round(h-h%1),E=h<0?"-":T,y=E+a(String(Math.abs(h)),f,"0",!1),i(y,E,_,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+y,E=h<0?"-":T,p=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],y=E+Math.abs(h)[p](f),i(y,E,_,c,R)[m]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,a,i,o,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c){"use strict";function l(e,t){return p.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var r=p.leapSeconds,n=t(r,T,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var a=r[n].offset;if(n>0){var i=p.secondsDifference(r[n].julianDate,e);i>a&&(n--,a=r[n].offset)}p.addSeconds(e,a,e)}function d(e,r){T.julianDate=e;var n=p.leapSeconds,a=t(n,T,l);if(a<0&&(a=~a),0===a)return p.addSeconds(e,-n[0].offset,r);if(a>=n.length)return p.addSeconds(e,-n[a-1].offset,r);var i=p.secondsDifference(n[a].julianDate,e);return 0===i?p.addSeconds(e,-n[a].offset,r):i<=1?void 0:p.addSeconds(e,-n[--a].offset,r)}function h(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,t<0&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function E(e,t,r,n,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+r-32075;n-=12,n<0&&(n+=24);var f=i+(n*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function p(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),n=r(n,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),n===c.UTC&&f(this)}var m=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,R=/^(\d{4})$/,v=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,g=/^(\d{2})(\.\d+)?/.source+I.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,w=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;p.fromDate=function(e,t){var r=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n(t)?(h(r[0],r[1],t),f(t),t):new p(r[0],r[1],c.UTC)},p.fromIso8601=function(e,t){e=e.replace(",",".");var r,a,i,u=e.split("T"),s=1,l=1,d=0,m=0,T=0,I=0,M=u[0],x=u[1];if(u=M.match(N),null!==u)r=+u[1],s=+u[2],l=+u[3];else if(u=M.match(v),null!==u)r=+u[1],s=+u[2];else if(u=M.match(R),null!==u)r=+u[1];else{var P;if(u=M.match(A),null!==u)r=+u[1],P=+u[2],i=o(r);else if(u=M.match(S),null!==u){r=+u[1];var C=+u[2],D=+u[3]||0,L=new Date(Date.UTC(r,0,4));P=7*C+D-L.getUTCDay()-3}a=new Date(Date.UTC(r,0,1)),a.setUTCDate(P),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(r);var U;if(n(x)){u=x.match(w),null!==u?(d=+u[1],m=+u[2],T=+u[3],I=1e3*+(u[4]||0),U=5):(u=x.match(O),null!==u?(d=+u[1],m=+u[2],T=60*+(u[3]||0),U=4):(u=x.match(g),null!==u&&(d=+u[1],m=60*+(u[2]||0),U=3)));var F=u[U],b=+u[U+1],z=+(u[U+2]||0);switch(F){case"+":d-=b,m-=z;break;case"-":d+=b,m+=z;break;case"Z":break;default:m+=new Date(Date.UTC(r,s-1,l,d,m)).getTimezoneOffset()}}else m+=new Date(r,s-1,l).getTimezoneOffset();var B=60===T;for(B&&T--;m>=60;)m-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,r++),a=i&&2===s?_:y[s-1];for(;m<0;)m+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,r--),a=i&&2===s?_:y[s-1],l+=a;var G=E(r,s,l,d,m,T,I);return n(t)?(h(G[0],G[1],t),f(t)):t=new p(G[0],G[1],c.UTC),B&&p.addSeconds(t,1,t),t},p.now=function(e){return p.fromDate(new Date,e)};var M=new p(0,0,c.TAI);return p.toGregorianDate=function(e,t){var r=!1,a=d(e,M);n(a)||(p.addSeconds(e,-1,M),a=d(M,M),r=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var m=h+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var v=0|T,A=(T-v)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(v+=1),n(t)?(t.year=y,t.month=m,t.day=E,t.hour=_,t.minute=R,t.second=v,t.millisecond=A,t.isLeapSecond=r,t):new i(y,m,E,_,R,v,A,r)},p.toDate=function(e){var t=p.toGregorianDate(e,m),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},p.toIso8601=function(t,r){var a,i=p.toGregorianDate(t,i);return n(r)||0===i.millisecond?n(r)&&0!==r?(a=(.01*i.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},p.clone=function(e,t){if(n(e))return n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new p(e.dayNumber,e.secondsOfDay,c.TAI)},p.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},p.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},p.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(p.secondsDifference(e,t))<=r},p.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},p.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},p.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},p.computeTaiMinusUtc=function(e){T.julianDate=e;var r=p.leapSeconds,n=t(r,T,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},p.addSeconds=function(e,t,r){return h(e.dayNumber,e.secondsOfDay+t,r)},p.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,n,r)},p.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,n,r)},p.addDays=function(e,t,r){var n=e.dayNumber+t;return h(n,e.secondsOfDay,r)},p.lessThan=function(e,t){return p.compare(e,t)<0},p.lessThanOrEquals=function(e,t){return p.compare(e,t)<=0},p.greaterThan=function(e,t){return p.compare(e,t)>0},p.greaterThanOrEquals=function(e,t){return p.compare(e,t)>=0},p.prototype.clone=function(e){return p.clone(this,e)},p.prototype.equals=function(e){return p.equals(this,e)},p.prototype.equalsEpsilon=function(e,t){return p.equalsEpsilon(this,e,t)},p.prototype.toString=function(){return p.toIso8601(this)},p.leapSeconds=[new u(new p(2441317,43210,c.TAI),10),new u(new p(2441499,43211,c.TAI),11),new u(new p(2441683,43212,c.TAI),12),new u(new p(2442048,43213,c.TAI),13),new u(new p(2442413,43214,c.TAI),14),new u(new p(2442778,43215,c.TAI),15),new u(new p(2443144,43216,c.TAI),16),new u(new p(2443509,43217,c.TAI),17),new u(new p(2443874,43218,c.TAI),18),new u(new p(2444239,43219,c.TAI),19),new u(new p(2444786,43220,c.TAI),20),new u(new p(2445151,43221,c.TAI),21),new u(new p(2445516,43222,c.TAI),22),new u(new p(2446247,43223,c.TAI),23),new u(new p(2447161,43224,c.TAI),24),new u(new p(2447892,43225,c.TAI),25),new u(new p(2448257,43226,c.TAI),26),new u(new p(2448804,43227,c.TAI),27),new u(new p(2449169,43228,c.TAI),28),new u(new p(2449534,43229,c.TAI),29),new u(new p(2450083,43230,c.TAI),30),new u(new p(2450630,43231,c.TAI),31),new u(new p(2451179,43232,c.TAI),32),new u(new p(2453736,43233,c.TAI),33),new u(new p(2454832,43234,c.TAI),34),new u(new p(2456109,43235,c.TAI),35),new u(new p(2457204,43236,c.TAI),36),new u(new p(2457754,43237,c.TAI),37)],p}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var a=new r.constructor;for(var i in r)if(r.hasOwnProperty(i)){var o=r[i];n&&(o=t(o,n)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var a=r[n],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,n){this.statusCode=e,this.response=r,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=n.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function r(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var n=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,r).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var a=n.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])||(i[n]=!0)},a.remove=function(e,r){var n=e.toLowerCase()+":"+r;t(i[n])&&delete i[n]},a.contains=function(e){var r=n(e);return!(!t(r)||!t(i[r]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,n,a,i,o){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,a=t(r.method,"GET"),i=r.data,o=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,n,a,i,o,r,s),r.promise})}function s(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function c(e,t){for(var r=s(e,t),n=new ArrayBuffer(r.length),a=new Uint8Array(n),i=0;i<r.length;i++)a[i]=r.charCodeAt(i);return n}function l(e,r){r=t(r,"");var n=e[1],a=!!e[2],i=e[3];switch(r){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:n});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),n);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,n,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),r(d)&&r(E.overrideMimeType)&&E.overrideMimeType(d),E.open(n,e,!0),r(s))for(var p in s)s.hasOwnProperty(p)&&E.setRequestHeader(p,s[p]);r(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,n=E.responseType;if(!r(e)||r(t)&&n!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===n||"document"===n)&&r(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==n&&"text"!==n||!r(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function a(r,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,n(r,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))E(this,t.data);else if(n(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=r.columnNames.indexOf("modifiedJulianDateUtc"),i=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),d=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),p=r.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||p<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var m=e._samples=r.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d, +e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=p,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,R=0,v=m.length;R<v;R+=e._columnCount){var A=m[R+a],S=m[R+p],N=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(N,S,f.TAI);if(y.push(I),T){if(S!==_&&n(_)){var g=o.leapSeconds,O=t(g,I,h);if(O<0){var w=new u(I,S);g.splice(~O,0,w)}}_=S}}}function p(e,t,r,n,a){var i=r*n;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function m(e,t,r){return t+e*(r-t)}function y(e,t,r,n,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||n.equals(c))return p(e,r,a,s,u),u;if(n.equals(l))return p(e,r,i,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=r[d+e._ut1MinusUtcSecondsColumn],y=r[h+e._ut1MinusUtcSecondsColumn],_=y-E;if(_>.5||_<-.5){var T=r[d+e._taiMinusUtcSecondsColumn],R=r[h+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(n)?E=y:y-=R-T)}return u.xPoleWander=m(f,r[d+e._xPoleWanderRadiansColumn],r[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,r[d+e._yPoleWanderRadiansColumn],r[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,r[d+e._xCelestialPoleOffsetRadiansColumn],r[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,r[d+e._yCelestialPoleOffsetRadiansColumn],r[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,E,y),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return n(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,r){if(n(this._samples)){if(n(r)||(r=new a(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var i=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!n(d),p=E||o.greaterThanOrEquals(d,e);if(h&&p)return s=u,!E&&d.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,r),r}var m=t(i,e,o.compare,this._dateColumn);return m>=0?(m<i.length-1&&i[m+1].equals(e)&&++m,s=m,l=m):(l=~m,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},d}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=t(n,document.location.href);var a=new e(n),i=new e(r);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,i){if(i=t(i,!0),n instanceof e||(n=new e(n)),a instanceof e||(a=new e(a)),"data"===n.scheme)return n.toString();if("data"===a.scheme)return a.toString();r(a.authority)&&!r(a.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=n.scheme);var o=n;a.isAbsolute()&&(o=a);var u="";r(o.scheme)&&(u+=o.scheme+":"),r(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===n?i?n.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):n.path+a.path:a.path;var s=r(n.query),c=r(a.query);s&&c?u+="?"+n.query+"&"+a.query:s&&!c?u+="?"+n.query:!s&&c&&(u+="?"+a.query);var l=r(a.fragment);return r(n.fragment)&&!l?u+="#"+n.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,n,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),a=E.exec(n);if(null!==a)return a[1]}}function u(){if(t(f))return f;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(n(r))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var r=d(e);return h.href=r,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){n[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,i.daysDifference(n,e._sampleZeroDateTT)}function l(r,a){if(r._chunkDownloadsInProgress[a])return r._chunkDownloadsInProgress[a];var i=e.defer();r._chunkDownloadsInProgress[a]=i;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){r._chunkDownloadsInProgress[a]=!1;for(var t=r._samples,n=e.samples,o=a*r._samplesPerXysFile*3,u=0,s=n.length;u<s;++u)t[o+u]=n[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,r,n,a){var i=c(this,t,r),o=c(this,n,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,r){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(n(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),n(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){n(r)?(r.x=0,r.y=0,r.s=0):r=new a(0,0,0);var E,p,m=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)y[E]=m-R[E];for(E=0;E<=u;++E){for(T[E]=1,p=0;p<=u;++p)p!==E&&(T[E]*=y[p]);T[E]*=_[E];var v=3*(s+E);r.x+=T[E]*h[v++],r.y+=T[E]*h[v++],r.s+=T[E]*h[v]}return r}}}},s}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,p,m,y,_,T,R){"use strict";var v={},A={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},S={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},N={},I={east:new r,north:new r,up:new r,west:new r,south:new r,down:new r},g=new r,O=new r,w=new r;v.localFrameToFixedFrameGenerator=function(e,t){if(!A.hasOwnProperty(e)||!A[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var n,a=A[e][t],i=e+t;return u(N[i])?n=N[i]:(n=function(n,i,s){if(u(s)||(s=new _),m.equalsEpsilon(n.x,0,m.EPSILON14)&&m.equalsEpsilon(n.y,0,m.EPSILON14)){var c=m.sign(n.z);r.unpack(S[e],0,g),"east"!==e&&"west"!==e&&r.multiplyByScalar(g,c,g),r.unpack(S[t],0,O),"east"!==t&&"west"!==t&&r.multiplyByScalar(O,c,O),r.unpack(S[a],0,w),"east"!==a&&"west"!==a&&r.multiplyByScalar(w,c,w)}else{i=o(i,d.WGS84),i.geodeticSurfaceNormal(n,I.up);var l=I.up,f=I.east;f.x=-n.y,f.y=n.x,f.z=0,r.normalize(f,I.east),r.cross(l,f,I.north),r.multiplyByScalar(I.up,-1,I.down),r.multiplyByScalar(I.east,-1,I.west),r.multiplyByScalar(I.north,-1,I.south),g=I[e],O=I[t],w=I[a]}return s[0]=g.x,s[1]=g.y,s[2]=g.z,s[3]=0,s[4]=O.x,s[5]=O.y,s[6]=O.z,s[7]=0,s[8]=w.x,s[9]=w.y,s[10]=w.z,s[11]=0,s[12]=n.x,s[13]=n.y,s[14]=n.z,s[15]=1,s},N[i]=n),n},v.eastNorthUpToFixedFrame=v.localFrameToFixedFrameGenerator("east","north"),v.northEastDownToFixedFrame=v.localFrameToFixedFrameGenerator("north","east"),v.northUpEastToFixedFrame=v.localFrameToFixedFrameGenerator("north","up"),v.northWestUpToFixedFrame=v.localFrameToFixedFrameGenerator("north","west");var M=new T,x=new r(1,1,1),P=new _;v.headingPitchRollToFixedFrame=function(e,t,n,a,i){a instanceof _&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,v.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,M),c=_.fromTranslationQuaternionRotationScale(r.ZERO,u,x,P);return i=a(e,n,i),_.multiply(i,c,i)};var C=new _,D=new y;v.headingPitchRollQuaternion=function(e,t,r,n,a){n instanceof T&&(a=n,n=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=v.headingPitchRollToFixedFrame(e,t,r,n,C),o=_.getRotation(i,D);return T.fromRotationMatrix(o,a)};var L=24110.54841,U=8640184.812866,F=.093104,b=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,G=m.TWO_PI/86400,q=new p;v.computeTemeToPseudoFixedMatrix=function(e,t){q=p.addSeconds(e,-p.computeTaiMinusUtc(e),q);var r,n=q.dayNumber,a=q.secondsOfDay,i=n-2451545;r=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=L+r*(U+r*(F+r*b)),s=o*G%m.TWO_PI,c=B+z*(n-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(d,h,0,-h,d,0,0,0,1)},v.iau2006XysData=new h,v.earthOrientationParameters=l.NONE;var V=32.184,W=2451545;v.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+V,a=t.stop.dayNumber,i=t.stop.secondsOfDay+V,o=v.iau2006XysData.preload(r,n,a,i),u=v.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},v.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var r=v.computeFixedToIcrfMatrix(e,t);if(u(r))return y.transpose(r,t)};var X=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new y,k=new y;v.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var r=v.earthOrientationParameters.compute(e,H);if(u(r)){var n=e.dayNumber,a=e.secondsOfDay+V,i=v.iau2006XysData.computeXysRadians(n,a,X);if(u(i)){var o=i.x+r.xPoleOffset,s=i.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,k),d=y.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-p.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=h-2451545,T=E/R.SECONDS_PER_DAY,A=.779057273264+T+.00273781191135448*(_+T);A=A%1*m.TWO_PI;var S=y.fromRotationZ(A,k),N=y.multiply(d,S,Y),I=Math.cos(r.xPoleWander),g=Math.cos(r.yPoleWander),O=Math.sin(r.xPoleWander),w=Math.sin(r.yPoleWander),M=n-W+a/R.SECONDS_PER_DAY;M/=36525;var x=-47e-6*M*m.RADIANS_PER_DEGREE/3600,P=Math.cos(x),C=Math.sin(x),D=k;return D[0]=I*P,D[1]=I*C,D[2]=O,D[3]=-g*C+w*O*P,D[4]=g*P+w*O*C,D[5]=-w*I,D[6]=-w*C-g*O*P,D[7]=w*P-g*O*C,D[8]=g*I,y.multiply(N,D,t)}}};var j=new n;v.pointToWindowCoordinates=function(e,t,r,n){return n=v.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},v.pointToGLWindowCoordinates=function(e,r,a,i){u(i)||(i=new t);var o=j;return _.multiplyByVector(e,n.fromElements(a.x,a.y,a.z,1,o),o),n.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(r,o,o),t.fromCartesian4(o,i)};var Z=new r,K=new r,J=new r;v.rotationMatrixFromPositionVelocity=function(e,t,n,a){var i=o(n,d.WGS84).geodeticSurfaceNormal(e,Z),s=r.cross(t,i,K);r.equalsEpsilon(s,r.ZERO,m.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var c=r.cross(s,t,J);return r.cross(t,c,s),r.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new r,te=new r,re=new y,ne=new _,ae=new _;return v.basisTo2D=function(e,t,n){var a=_.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);r.fromElements(u.z,u.x,u.y,u);var s=v.eastNorthUpToFixedFrame(a,i,ne),c=_.inverseTransformation(s,ae),l=_.getRotation(t,re),f=_.multiplyByMatrix3(c,l,n);return _.multiply(Q,f,n),_.setTranslation(n,u,n),n},v.wgs84To2DModelMatrix=function(e,t,n){var a=e.ellipsoid,i=v.eastNorthUpToFixedFrame(t,a,ne),o=_.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);r.fromElements(s.z,s.x,s.y,s);var c=_.fromTranslation(s,ne);return _.multiply(Q,o,n),_.multiply(c,n,n),n},v}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=n(new a({position:!0})),a.POSITION_AND_NORMAL=n(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=n(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=n(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=n(new a({position:!0,color:!0})),a.ALL=n(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,r,n){return n=e(n,0),r[n++]=t.position?1:0,r[n++]=t.normal?1:0,r[n++]=t.st?1:0,r[n++]=t.tangent?1:0,r[n++]=t.bitangent?1:0,r[n++]=t.color?1:0,r},a.unpack=function(r,n,i){return n=e(n,0),t(i)||(i=new a),i.position=1===r[n++],i.normal=1===r[n++],i.st=1===r[n++],i.tangent=1===r[n++],i.bitangent=1===r[n++],i.color=1===r[n++],i},a.clone=function(e,r){if(t(e))return t(r)||(r=new a),r.position=e.position,r.normal=e.normal,r.st=e.st,r.tangent=e.tangent,r.bitangent=e.bitangent,r.color=e.color,r},a}),define("Core/EllipseGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./Matrix4","./PrimitiveType","./Quaternion","./Rectangle","./Transforms","./VertexFormat"],function(e,t,r,n,a,i,o,u,s,c,l,f,d,h,E,p,m,y,_,T,R,v,A,S,N,I){"use strict";function g(e,n,i){var o=n.vertexFormat,u=n.center,s=n.semiMajorAxis,l=n.semiMinorAxis,d=n.ellipsoid,p=n.stRotation,m=i?e.length/3*2:e.length/3,y=n.shadowVolume,_=o.st?new Float32Array(2*m):void 0,R=o.normal?new Float32Array(3*m):void 0,v=o.tangent?new Float32Array(3*m):void 0,S=o.bitangent?new Float32Array(3*m):void 0,N=y?new Float32Array(3*m):void 0,I=0,g=q,O=V,w=W,M=new f(d),x=M.project(d.cartesianToCartographic(u,X),H),P=d.scaleToGeodeticSurface(u,L);d.geodeticSurfaceNormal(P,P);for(var C=A.fromAxisAngle(P,p,G),D=T.fromQuaternion(C,B),b=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),j=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),Z=e.length,K=i?Z:0,J=K/3*2,Q=0;Q<Z;Q+=3){var $=Q+1,ee=Q+2,te=r.fromArray(e,Q,L);if(o.st){var re=T.multiplyByVector(D,te,U),ne=M.project(d.cartesianToCartographic(re,X),F);r.subtract(ne,x,ne),z.x=(ne.x+s)/(2*s),z.y=(ne.y+l)/(2*l),b.x=Math.min(z.x,b.x),b.y=Math.min(z.y,b.y),j.x=Math.max(z.x,j.x),j.y=Math.max(z.y,j.y),i&&(_[I+J]=z.x,_[I+1+J]=z.y),_[I++]=z.x,_[I++]=z.y}(o.normal||o.tangent||o.bitangent||y)&&(g=d.geodeticSurfaceNormal(te,g),y&&(N[Q+K]=-g.x,N[$+K]=-g.y,N[ee+K]=-g.z),(o.normal||o.tangent||o.bitangent)&&((o.tangent||o.bitangent)&&(O=r.normalize(r.cross(r.UNIT_Z,g,O),O),T.multiplyByVector(D,O,O)),o.normal&&(R[Q]=g.x,R[$]=g.y,R[ee]=g.z,i&&(R[Q+K]=-g.x,R[$+K]=-g.y,R[ee+K]=-g.z)),o.tangent&&(v[Q]=O.x,v[$]=O.y,v[ee]=O.z,i&&(v[Q+K]=-O.x,v[$+K]=-O.y,v[ee+K]=-O.z)),o.bitangent&&(w=r.normalize(r.cross(g,O,w),w),S[Q]=w.x,S[$]=w.y,S[ee]=w.z,i&&(S[Q+K]=w.x,S[$+K]=w.y,S[ee+K]=w.z))))}if(o.st){Z=_.length;for(var ae=0;ae<Z;ae+=2)_[ae]=(_[ae]-b.x)/(j.x-b.x),_[ae+1]=(_[ae+1]-b.y)/(j.y-b.y)}var ie=new E;if(o.position){var oe=c.raisePositionsToHeight(e,n,i);ie.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:oe})}return o.st&&(ie.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),o.normal&&(ie.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),o.tangent&&(ie.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),o.bitangent&&(ie.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),y&&(ie.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:N})),ie}function O(e){var t,r,n,a,i,o=new Array(12*(e*(e+1))-6),u=0;for(t=0,n=1,a=0;a<3;a++)o[u++]=n++,o[u++]=t,o[u++]=n;for(a=2;a<e+1;++a){for(n=a*(a+1)-1,t=(a-1)*a-1,o[u++]=n++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=n++,o[u++]=t,o[u++]=n}for(r=2*e,++n,++t,a=0;a<r-1;++a)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;for(o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t++,o[u++]=t,++t,a=e-1;a>1;--a){for(o[u++]=t++,o[u++]=t,o[u++]=n,r=2*a,i=0;i<r-1;++i)o[u++]=n,o[u++]=t++,o[u++]=t,o[u++]=n++,o[u++]=t,o[u++]=n;o[u++]=t++,o[u++]=t++,o[u++]=n++}for(a=0;a<3;a++)o[u++]=t++,o[u++]=t,o[u++]=n;return o}function w(t){var n=t.center;j=r.multiplyByScalar(t.ellipsoid.geodeticSurfaceNormal(n,j),t.height,j),j=r.add(n,j,j);var a=new e(j,t.semiMajorAxis),i=c.computeEllipsePositions(t,!0,!1),o=i.positions,u=i.numPts,s=g(o,t,!1),l=O(u);return l=y.createTypedArray(o.length/3,l),{boundingSphere:a,attributes:s,indices:l}}function M(e,n){var i=n.vertexFormat,o=n.center,u=n.semiMajorAxis,s=n.semiMinorAxis,c=n.ellipsoid,l=n.height,d=n.extrudedHeight,p=n.stRotation,m=e.length/3*2,y=new Float64Array(3*m),_=i.st?new Float32Array(2*m):void 0,R=i.normal?new Float32Array(3*m):void 0,v=i.tangent?new Float32Array(3*m):void 0,S=i.bitangent?new Float32Array(3*m):void 0,N=n.shadowVolume,I=N?new Float32Array(3*m):void 0,g=0,O=q,w=V,M=W,x=new f(c),P=x.project(c.cartesianToCartographic(o,X),H),C=c.scaleToGeodeticSurface(o,L);c.geodeticSurfaceNormal(C,C);for(var D=A.fromAxisAngle(C,p,G),j=T.fromQuaternion(D,B),Z=t.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Y),K=t.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,k),J=e.length,Q=J/3*2,$=0;$<J;$+=3){var ee,te=$+1,re=$+2,ne=r.fromArray(e,$,L);if(i.st){var ae=T.multiplyByVector(j,ne,U),ie=x.project(c.cartesianToCartographic(ae,X),F);r.subtract(ie,P,ie),z.x=(ie.x+u)/(2*u),z.y=(ie.y+s)/(2*s),Z.x=Math.min(z.x,Z.x),Z.y=Math.min(z.y,Z.y),K.x=Math.max(z.x,K.x),K.y=Math.max(z.y,K.y),_[g+Q]=z.x,_[g+1+Q]=z.y,_[g++]=z.x,_[g++]=z.y}ne=c.scaleToGeodeticSurface(ne,ne),ee=r.clone(ne,U),O=c.geodeticSurfaceNormal(ne,O),N&&(I[$+J]=-O.x,I[te+J]=-O.y,I[re+J]=-O.z);var oe=r.multiplyByScalar(O,l,b);if(ne=r.add(ne,oe,ne),oe=r.multiplyByScalar(O,d,oe),ee=r.add(ee,oe,ee),i.position&&(y[$+J]=ee.x,y[te+J]=ee.y,y[re+J]=ee.z,y[$]=ne.x,y[te]=ne.y,y[re]=ne.z),i.normal||i.tangent||i.bitangent){M=r.clone(O,M);var ue=r.fromArray(e,($+3)%J,b);r.subtract(ue,ne,ue);var se=r.subtract(ee,ne,F);O=r.normalize(r.cross(se,ue,O),O),i.normal&&(R[$]=O.x,R[te]=O.y,R[re]=O.z,R[$+J]=O.x,R[te+J]=O.y,R[re+J]=O.z),i.tangent&&(w=r.normalize(r.cross(M,O,w),w),v[$]=w.x,v[te]=w.y,v[re]=w.z,v[$+J]=w.x,v[$+1+J]=w.y,v[$+2+J]=w.z),i.bitangent&&(S[$]=M.x,S[te]=M.y,S[re]=M.z,S[$+J]=M.x,S[te+J]=M.y,S[re+J]=M.z)}}if(i.st){J=_.length;for(var ce=0;ce<J;ce+=2)_[ce]=(_[ce]-Z.x)/(K.x-Z.x),_[ce+1]=(_[ce+1]-Z.y)/(K.y-Z.y)}var le=new E;return i.position&&(le.position=new h({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:y})),i.st&&(le.st=new h({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:_})),i.normal&&(le.normal=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:R})),i.tangent&&(le.tangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:v})),i.bitangent&&(le.bitangent=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:S})),N&&(le.extrudeDirection=new h({componentDatatype:a.FLOAT,componentsPerAttribute:3,values:I})),le}function x(e){for(var t=e.length/3,r=y.createTypedArray(t,6*t),n=0,a=0;a<t;a++){var i=a,o=a+t,u=(i+1)%t,s=u+t;r[n++]=i,r[n++]=o,r[n++]=u,r[n++]=u,r[n++]=o,r[n++]=s}return r}function P(t){var n=t.center,a=t.ellipsoid,i=t.semiMajorAxis,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,L),t.height,L);Z.center=r.add(n,o,Z.center),Z.radius=i,o=r.multiplyByScalar(a.geodeticSurfaceNormal(n,o),t.extrudedHeight,o),K.center=r.add(n,o,K.center),K.radius=i;var u=c.computeEllipsePositions(t,!0,!0),s=u.positions,l=u.numPts,f=u.outerPositions,h=e.union(Z,K),E=g(s,t,!0),_=O(l),T=_.length;_.length=2*T;for(var R=s.length/3,A=0;A<T;A+=3)_[A+T]=_[A+2]+R,_[A+1+T]=_[A+1]+R,_[A+2+T]=_[A]+R;var S=y.createTypedArray(2*R/3,_),N=new d({attributes:E,indices:S,primitiveType:v.TRIANGLES}),I=M(f,t);_=x(f);var w=y.createTypedArray(2*f.length/3,_),P=new d({attributes:I,indices:w,primitiveType:v.TRIANGLES}),C=m.combineInstances([new p({geometry:N}),new p({geometry:P})]);return{boundingSphere:h,attributes:C[0].attributes,indices:C[0].indices}}function C(e,t,n,a,i){N.eastNorthUpToFixedFrame(e,t,J),R.inverseTransformation(J,Q);for(var o=0;o<4;++o)r.clone(r.ZERO,ee[o]);for(ee[0].x+=n,ee[1].x-=n,ee[2].y+=a,ee[3].y-=a,T.fromRotationZ(i,$),o=0;o<4;++o)T.multiplyByVector($,ee[o],ee[o]),R.multiplyByPoint(J,ee[o],ee[o]),t.cartesianToCartographic(ee[o],te[o]);return S.fromCartographicArray(te)}function D(e){e=i(e,i.EMPTY_OBJECT);var t=e.center,n=i(e.ellipsoid,l.WGS84),a=e.semiMajorAxis,u=e.semiMinorAxis,s=i(e.granularity,_.RADIANS_PER_DEGREE),c=i(e.height,0),f=e.extrudedHeight,d=o(f)&&Math.abs(c-f)>1,h=i(e.vertexFormat,I.DEFAULT);this._center=r.clone(t),this._semiMajorAxis=a,this._semiMinorAxis=u,this._ellipsoid=l.clone(n),this._rotation=i(e.rotation,0),this._stRotation=i(e.stRotation,0),this._height=c,this._granularity=s,this._vertexFormat=I.clone(h),this._extrudedHeight=i(f,c),this._extrude=d,this._shadowVolume=i(e.shadowVolume,!1),this._workerName="createEllipseGeometry",this._rectangle=C(this._center,this._ellipsoid,a,u,this._rotation)}var L=new r,U=new r,F=new r,b=new r,z=new t,B=new T,G=new A,q=new r,V=new r,W=new r,X=new n,H=new r,Y=new t,k=new t,j=new r,Z=new e,K=new e,J=new R,Q=new R,$=new T,ee=[new r,new r,new r,new r],te=[new n,new n,new n,new n];D.packedLength=r.packedLength+l.packedLength+I.packedLength+S.packedLength+9,D.pack=function(e,t,n){return n=i(n,0),r.pack(e._center,t,n),n+=r.packedLength,l.pack(e._ellipsoid,t,n),n+=l.packedLength,I.pack(e._vertexFormat,t,n),n+=I.packedLength,S.pack(e._rectangle,t,n),n+=S.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._extrude?1:0,t[n]=e._shadowVolume?1:0,t};var re=new r,ne=new l,ae=new I,ie=new S,oe={center:re,ellipsoid:ne,vertexFormat:ae,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0};return D.unpack=function(e,t,n){t=i(t,0);var a=r.unpack(e,t,re);t+=r.packedLength;var u=l.unpack(e,t,ne);t+=l.packedLength;var s=I.unpack(e,t,ae);t+=I.packedLength;var c=S.unpack(e,t,ie);t+=S.packedLength;var f=e[t++],d=e[t++],h=e[t++],E=e[t++],p=e[t++],m=e[t++],y=e[t++],_=1===e[t++],T=1===e[t];return o(n)?(n._center=r.clone(a,n._center),n._ellipsoid=l.clone(u,n._ellipsoid),n._vertexFormat=I.clone(s,n._vertexFormat),n._semiMajorAxis=f,n._semiMinorAxis=d,n._rotation=h,n._stRotation=E,n._height=p,n._granularity=m,n._extrudedHeight=y,n._extrude=_,n._shadowVolume=T,n._rectangle=S.clone(c),n):(oe.height=p,oe.extrudedHeight=y,oe.granularity=m,oe.stRotation=E,oe.rotation=h,oe.semiMajorAxis=f,oe.semiMinorAxis=d,oe.shadowVolume=T,new D(oe))},D.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation};return e._extrude?(r.extrudedHeight=Math.min(e._extrudedHeight,e._height),r.height=Math.max(e._extrudedHeight,e._height),r.shadowVolume=e._shadowVolume,t=P(r)):t=w(r),new d({attributes:t.attributes,indices:t.indices,primitiveType:v.TRIANGLES,boundingSphere:t.boundingSphere})}},D.createShadowVolume=function(e,t,r){var n=e._granularity,a=e._ellipsoid,i=t(n,a),o=r(n,a);return new D({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:a,rotation:e._rotation,stRotation:e._stRotation,granularity:n,extrudedHeight:i,height:o,vertexFormat:I.POSITION_ONLY,shadowVolume:!0})},u(D.prototype,{rectangle:{get:function(){return this._rectangle}}}),D}),define("Workers/createEllipseGeometry",["../Core/Cartesian3","../Core/defined","../Core/EllipseGeometry","../Core/Ellipsoid"],function(e,t,r,n){"use strict";function a(a,i){return t(i)&&(a=r.unpack(a,i)),a._center=e.clone(a._center),a._ellipsoid=n.clone(a._ellipsoid),r.createGeometry(a)}return a})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createEllipseOutlineGeometry.js b/engines/Cesium/Workers/createEllipseOutlineGeometry.js index 5d50f57..9cc2ea0 100644 --- a/engines/Cesium/Workers/createEllipseOutlineGeometry.js +++ b/engines/Cesium/Workers/createEllipseOutlineGeometry.js @@ -55,7 +55,7 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,E),o.normalize(t,c);var n=o.dot(E,c),r=o.magnitude(o.cross(E,c,E));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,E=i*s-a*u,c=a*o-r*s,_=r*u-i*o;return n.x=E,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var l=new o,T=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:R,E=Math.cos(r);l.x=E*Math.cos(e),l.y=E*Math.sin(e),l.z=Math.sin(r),l=o.normalize(l,l),o.multiplyComponents(s,l,T);var c=Math.sqrt(o.dot(l,T));return T=o.divideByScalar(T,c,T),l=o.multiplyByScalar(l,i,l),n(u)||(u=new o),o.add(T,l,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromDegrees(u,s,0,t,r[E])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromRadians(u,s,0,t,r[E])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromDegrees(u,s,E,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromRadians(u,s,E,t,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,E){var c=n.x,_=n.y,l=n.z,T=i.x,R=i.y,f=i.z,h=c*c*T*T,A=_*_*R*R,d=l*l*f*f,N=h+A+d,I=Math.sqrt(1/N),S=e.multiplyByScalar(n,I,a);if(N<s)return isFinite(I)?e.clone(S,E):void 0;var M=u.x,y=u.y,m=u.z,O=o;O.x=S.x*M*2,O.y=S.y*y*2,O.z=S.z*m*2;var p,C,g,U,w,L,x,P,v,F,D,B=(1-I)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{B-=z,g=1/(1+B*M),U=1/(1+B*y),w=1/(1+B*m),L=g*g,x=U*U,P=w*w,v=L*g,F=x*U,D=P*w,p=h*L+A*x+d*P-1,C=h*v*M+A*F*y+d*D*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(E)?(E.x=c*g,E.y=_*U,E.z=l*w,E):new e(c*g,_*U,l*w)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,E=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),l=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(t,r,i){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:l,h=n(r)?r._centerToleranceSquared:T,A=o(t,R,f,h,E);if(n(A)){var d=e.multiplyComponents(A,f,s);d=e.normalize(d,d);var N=e.subtract(t,A,c),I=Math.atan2(d.y,d.x),S=Math.asin(d.z),M=a.sign(e.dot(N,t))*e.magnitude(N);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,E(this,e,t,n)}i(c.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}}}),c.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(E(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),E=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=E,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,l=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=l;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var T=new e,R=new e,f=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,R);if(r(a)){var o=this.geodeticSurfaceNormal(a,T),s=e.subtract(n,a,f),E=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=E,i.latitude=c,i.height=_,i):new t(E,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i,a,o,u,s,E){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(E,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(f[n],R[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(f[a],R[a])]);o>r&&(i=a,r=o)}var E=1,c=0,_=R[i],l=f[i];if(Math.abs(e[s.getElementIndex(l,_)])>n){var T,h=e[s.getElementIndex(l,l)],A=e[s.getElementIndex(_,_)],d=e[s.getElementIndex(l,_)],N=(h-A)/2/d;T=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),E=1/Math.sqrt(1+T*T),c=T*E}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(_,_)]=t[s.getElementIndex(l,l)]=E,t[s.getElementIndex(l,_)]=c,t[s.getElementIndex(_,l)]=-c,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,E=e.y*e.z,c=e.y*e.w,_=e.z*e.z,l=e.z*e.w,T=e.w*e.w,R=n-u-_+T,f=2*(i-l),h=2*(a+c),A=2*(i+l),d=-n+u-_+T,N=2*(E-o),I=2*(a-c),S=2*(E+o),M=-n-u+_+T;return r(t)?(t[0]=R,t[1]=A,t[2]=I,t[3]=f,t[4]=d,t[5]=S,t[6]=h,t[7]=N,t[8]=M,t):new s(R,f,h,A,d,N,I,S,M)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),E=Math.sin(e.roll),c=n*i,_=-a*u+E*o*i,l=E*u+a*o*i,T=n*u,R=a*i+E*o*u,f=-o*a+a*o*u,h=-o,A=E*n,d=a*n;return r(t)?(t[0]=c,t[1]=T,t[2]=h,t[3]=_,t[4]=R,t[5]=A,t[6]=l,t[7]=f,t[8]=d,t):new s(c,_,l,T,R,f,h,A,d)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new s(1,0,0,0,n,-i,0,i,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new s(n,0,i,0,1,0,-i,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-i,0,i,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),n};var T=new e;s.getMaximumScale=function(t){return s.getScale(t,T),e.maximumComponent(T)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],E=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=E,n[7]=c,n[8]=_,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],E=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=E,t[8]=c,t};var R=[1,0,0],f=[2,2,1],h=new s,A=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var l=t.unitary=s.clone(s.IDENTITY,t.unitary),T=t.diagonal=s.clone(e,t.diagonal),R=n*E(T);o<i&&c(T)>R;)_(T,h),s.transpose(h,A),s.multiply(T,h,T),s.multiply(A,T,T),s.multiply(l,h,l),++a>2&&(++o,a=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],E=e[8];return t*(a*E-s*o)+i*(s*r-n*E)+u*(n*o-a*r)},s.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],E=e[6],c=e[7],_=e[8],l=s.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=E*u-a*_,t[4]=n*_-E*i,t[5]=a*i-n*u,t[6]=a*c-E*o,t[7]=E*r-n*c,t[8]=n*o-a*r;var T=1/l;return s.multiplyByScalar(t,T,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,E){ -"use strict";function c(e,t,n,i,a,o,u,s,E,c,_,l,T,R,f,h){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(E,0),this[3]=r(T,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(R,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(l,0),this[15]=r(h,0)}c.packedLength=16,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},c.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new c),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},c.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,E=t.x*t.y,_=t.x*t.z,l=t.x*t.w,T=t.y*t.y,R=t.y*t.z,f=t.y*t.w,h=t.z*t.z,A=t.z*t.w,d=t.w*t.w,N=s-T-h+d,I=2*(E-A),S=2*(_+f),M=2*(E+A),y=-s+T-h+d,m=2*(R-l),O=2*(_-f),p=2*(R+l),C=-s-T+h+d;return r[0]=N*a,r[1]=M*a,r[2]=O*a,r[3]=0,r[4]=I*o,r[5]=y*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(s.IDENTITY,e,t)},c.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,l=new e,T=new e;c.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,l),l),e.normalize(e.cross(l,_,T),T);var u=l.x,s=l.y,E=l.z,R=_.x,f=_.y,h=_.z,A=T.x,d=T.y,N=T.z,I=r.x,S=r.y,M=r.z,y=u*-I+s*-S+E*-M,m=A*-I+d*-S+N*-M,O=R*I+f*S+h*M;return i(n)?(n[0]=u,n[1]=A,n[2]=-R,n[3]=0,n[4]=s,n[5]=d,n[6]=-f,n[7]=0,n[8]=E,n[9]=N,n[10]=-h,n[11]=0,n[12]=y,n[13]=m,n[14]=O,n[15]=1,n):new c(u,s,E,y,A,d,N,m,-R,-f,-h,O,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),E=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=E,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),E=1/(a-i),c=-(t+e)*u,_=-(r+n)*s,l=-(a+i)*E;return u*=2,s*=2,E*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=E,o[11]=0,o[12]=c,o[13]=_,o[14]=l,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),E=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),l=-1,T=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=E,o[9]=c,o[10]=_,o[11]=l,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),E=(r+n)/(r-n),c=-1,_=-1,l=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=s,a[9]=E,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=l,a[15]=0,a},c.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var E=.5*u,c=.5*s,_=.5*(n-t),l=E,T=c,R=_,f=a+E,h=o+c,A=t+_,d=1;return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=T,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=R,i[11]=0,i[12]=f,i[13]=h,i[14]=A,i[15]=d,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},c.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var R=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],R)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],R)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],R)),n};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],E=e[6],c=e[7],_=e[8],l=e[9],T=e[10],R=e[11],f=e[12],h=e[13],A=e[14],d=e[15],N=t[0],I=t[1],S=t[2],M=t[3],y=t[4],m=t[5],O=t[6],p=t[7],C=t[8],g=t[9],U=t[10],w=t[11],L=t[12],x=t[13],P=t[14],v=t[15],F=r*N+u*I+_*S+f*M,D=i*N+s*I+l*S+h*M,B=a*N+E*I+T*S+A*M,z=o*N+c*I+R*S+d*M,G=r*y+u*m+_*O+f*p,b=i*y+s*m+l*O+h*p,X=a*y+E*m+T*O+A*p,V=o*y+c*m+R*O+d*p,H=r*C+u*g+_*U+f*w,q=i*C+s*g+l*U+h*w,W=a*C+E*g+T*U+A*w,Y=o*C+c*g+R*U+d*w,k=r*L+u*x+_*P+f*v,K=i*L+s*x+l*P+h*v,Z=a*L+E*x+T*P+A*v,j=o*L+c*x+R*P+d*v;return n[0]=F,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=q,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=e[12],T=e[13],R=e[14],f=t[0],h=t[1],A=t[2],d=t[4],N=t[5],I=t[6],S=t[8],M=t[9],y=t[10],m=t[12],O=t[13],p=t[14],C=r*f+o*h+E*A,g=i*f+u*h+c*A,U=a*f+s*h+_*A,w=r*d+o*N+E*I,L=i*d+u*N+c*I,x=a*d+s*N+_*I,P=r*S+o*M+E*y,v=i*S+u*M+c*y,F=a*S+s*M+_*y,D=r*m+o*O+E*p+l,B=i*m+u*O+c*p+T,z=a*m+s*O+_*p+R;return n[0]=C,n[1]=g,n[2]=U,n[3]=0,n[4]=w,n[5]=L,n[6]=x,n[7]=0,n[8]=P,n[9]=v,n[10]=F,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=t[0],T=t[1],R=t[2],f=t[3],h=t[4],A=t[5],d=t[6],N=t[7],I=t[8],S=r*l+o*T+E*R,M=i*l+u*T+c*R,y=a*l+s*T+_*R,m=r*f+o*h+E*A,O=i*f+u*h+c*A,p=a*f+s*h+_*A,C=r*d+o*N+E*I,g=i*d+u*N+c*I,U=a*d+s*N+_*I;return n[0]=S,n[1]=M,n[2]=y,n[3]=0,n[4]=m,n[5]=O,n[6]=p,n[7]=0,n[8]=C,n[9]=g,n[10]=U,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var h=new e;c.multiplyByUniformScale=function(e,t,n){return h.x=t,h.y=t,h.z=t,c.multiplyByScale(e,h,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,E=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=E,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var A=new s,d=new s,N=new t,I=new t(0,0,0,1);return c.inverse=function(e,n){if(s.equalsEpsilon(c.getRotation(e,A),d,u.EPSILON7)&&t.equals(c.getRow(e,3,N),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],l=e[5],T=e[9],R=e[13],f=e[2],h=e[6],S=e[10],M=e[14],y=e[3],m=e[7],O=e[11],p=e[15],C=S*p,g=M*O,U=h*p,w=M*m,L=h*O,x=S*m,P=f*p,v=M*y,F=f*O,D=S*y,B=f*m,z=h*y,G=C*l+w*T+L*R-(g*l+U*T+x*R),b=g*_+P*T+D*R-(C*_+v*T+F*R),X=U*_+v*l+B*R-(w*_+P*l+z*R),V=x*_+F*l+z*T-(L*_+D*l+B*T),H=g*i+U*a+x*o-(C*i+w*a+L*o),q=C*r+v*a+F*o-(g*r+P*a+D*o),W=w*r+P*i+z*o-(U*r+v*i+B*o),Y=L*r+D*i+B*a-(x*r+F*i+z*a);C=a*R,g=o*T,U=i*R,w=o*l,L=i*T,x=a*l,P=r*R,v=o*_,F=r*T,D=a*_,B=r*l,z=i*_;var k=C*m+w*O+L*p-(g*m+U*O+x*p),K=g*y+P*O+D*p-(C*y+v*O+F*p),Z=U*y+v*m+B*p-(w*y+P*m+z*p),j=x*y+F*m+z*O-(L*y+D*m+B*O),Q=U*S+x*M+g*h-(L*M+C*h+w*S),J=F*M+C*f+v*S-(P*S+D*M+g*f),$=P*h+z*M+w*f-(B*M+U*f+v*h),ee=B*S+L*f+D*h-(F*h+z*S+x*f),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=H*te,n[5]=q*te,n[6]=W*te,n[7]=Y*te,n[8]=k*te,n[9]=K*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],E=e[9],c=e[10],_=e[12],l=e[13],T=e[14],R=-n*_-r*l-i*T,f=-a*_-o*l-u*T,h=-s*_-E*l-c*T;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=E,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=R,t[13]=f,t[14]=h,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,i,a,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new s(e,t,i,a)},s.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new s(e,t,i,a)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,E=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,l=e.length;_<l;_++){var T=e[_];n=Math.min(n,T.longitude),i=Math.max(i,T.longitude),E=Math.min(E,T.latitude),c=Math.max(c,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+u.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=E,t.east=i,t.north=c,t):new s(n,E,i,c)},s.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,E=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,l=0,T=e.length;l<T;l++){var R=t.cartesianToCartographic(e[l]);i=Math.min(i,R.longitude),a=Math.max(a,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,f),E=Math.max(E,f)}return a-i>E-o&&(i=o,a=E,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new s(i,c,a,_)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,E)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var l=Math.max(e.south,t.south),T=Math.min(e.north,t.north);if(!(l>=T))return r(n)?(n.west=c,n.south=l,n.east=_,n.north=T,n):new s(c,l,_,T)}},s.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,E)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var E=new e;return s.subsample=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=e.north,l=e.south,T=e.east,R=e.west,f=E;f.height=i,f.longitude=R,f.latitude=_,o[c]=t.cartographicToCartesian(f,o[c]),c++,f.longitude=T,o[c]=t.cartographicToCartesian(f,o[c]),c++,f.latitude=l,o[c]=t.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=t.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:l>0?f.latitude=l:f.latitude=0;for(var h=1;h<8;++h)f.longitude=-Math.PI+h*u.PI_OVER_TWO,s.contains(e,f)&&(o[c]=t.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=R,o[c]=t.cartographicToCartesian(f,o[c]),c++,f.longitude=T,o[c]=t.cartographicToCartesian(f,o[c]),c++),o.length=c,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,E,c,_){"use strict";function l(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var T=new e,R=new e,f=new e,h=new e,A=new e,d=new e,N=new e,I=new e,S=new e,M=new e,y=new e,m=new e;l.fromPoints=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],N),a=e.clone(r,T),o=e.clone(r,R),u=e.clone(r,f),s=e.clone(r,h),E=e.clone(r,A),c=e.clone(r,d),_=t.length,O=1;O<_;O++){e.clone(t[O],r);var p=r.x,C=r.y,g=r.z;p<a.x&&e.clone(r,a),p>s.x&&e.clone(r,s),C<o.y&&e.clone(r,o),C>E.y&&e.clone(r,E),g<u.z&&e.clone(r,u),g>c.z&&e.clone(r,c)}var U=e.magnitudeSquared(e.subtract(s,a,I)),w=e.magnitudeSquared(e.subtract(E,o,I)),L=e.magnitudeSquared(e.subtract(c,u,I)),x=a,P=s,v=U;w>v&&(v=w,x=o,P=E),L>v&&(v=L,x=u,P=c);var F=S;F.x=.5*(x.x+P.x),F.y=.5*(x.y+P.y),F.z=.5*(x.z+P.z);var D=e.magnitudeSquared(e.subtract(P,F,I)),B=Math.sqrt(D),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=y;G.x=s.x,G.y=E.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),X=0;for(O=0;O<_;O++){e.clone(t[O],r);var V=e.magnitude(e.subtract(r,b,I));V>X&&(X=V);var H=e.magnitudeSquared(e.subtract(r,F,I));if(H>D){var q=Math.sqrt(H);B=.5*(B+q),D=B*B;var W=q-B;F.x=(B*F.x+W*r.x)/q,F.y=(B*F.y+W*r.y)/q,F.z=(B*F.z+W*r.z)/q}}return B<X?(e.clone(F,n.center),n.radius=B):(e.clone(b,n.center),n.radius=X),n};var O=new o,p=new e,C=new e,g=new t,U=new t;l.fromRectangle2D=function(e,t,n){return l.fromRectangleWithHeights2D(e,t,0,0,n)},l.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new l),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,O),_.southwest(t,g),g.height=a,_.northeast(t,U),U.height=o;var s=n.project(g,p),E=n.project(U,C),c=E.x-s.x,T=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(c*c+T*T+R*R);var f=u.center;return f.x=s.x+.5*c,f.y=s.y+.5*T,f.z=s.z+.5*R,u};var w=[];l.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,w)),l.fromPoints(u,o)},l.fromVertices=function(t,n,a,o){if(i(o)||(o=new l),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=N;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,T),E=e.clone(u,R),c=e.clone(u,f),_=e.clone(u,h),O=e.clone(u,A),p=e.clone(u,d),C=t.length,g=0;g<C;g+=a){var U=t[g]+n.x,w=t[g+1]+n.y,L=t[g+2]+n.z;u.x=U,u.y=w,u.z=L,U<s.x&&e.clone(u,s),U>_.x&&e.clone(u,_),w<E.y&&e.clone(u,E),w>O.y&&e.clone(u,O),L<c.z&&e.clone(u,c),L>p.z&&e.clone(u,p)}var x=e.magnitudeSquared(e.subtract(_,s,I)),P=e.magnitudeSquared(e.subtract(O,E,I)),v=e.magnitudeSquared(e.subtract(p,c,I)),F=s,D=_,B=x;P>B&&(B=P,F=E,D=O),v>B&&(B=v,F=c,D=p);var z=S;z.x=.5*(F.x+D.x),z.y=.5*(F.y+D.y),z.z=.5*(F.z+D.z);var G=e.magnitudeSquared(e.subtract(D,z,I)),b=Math.sqrt(G),X=M;X.x=s.x,X.y=E.y,X.z=c.z;var V=y;V.x=_.x,V.y=O.y,V.z=p.z;var H=e.multiplyByScalar(e.add(X,V,I),.5,m),q=0;for(g=0;g<C;g+=a){u.x=t[g]+n.x,u.y=t[g+1]+n.y,u.z=t[g+2]+n.z;var W=e.magnitude(e.subtract(u,H,I));W>q&&(q=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<q?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=q),o},l.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new l),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=N;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,T),u=e.clone(a,R),s=e.clone(a,f),E=e.clone(a,h),c=e.clone(a,A),_=e.clone(a,d),O=t.length,p=0;p<O;p+=3){var C=t[p]+n[p],g=t[p+1]+n[p+1],U=t[p+2]+n[p+2];a.x=C,a.y=g,a.z=U,C<o.x&&e.clone(a,o),C>E.x&&e.clone(a,E),g<u.y&&e.clone(a,u),g>c.y&&e.clone(a,c),U<s.z&&e.clone(a,s),U>_.z&&e.clone(a,_)}var w=e.magnitudeSquared(e.subtract(E,o,I)),L=e.magnitudeSquared(e.subtract(c,u,I)),x=e.magnitudeSquared(e.subtract(_,s,I)),P=o,v=E,F=w;L>F&&(F=L,P=u,v=c),x>F&&(F=x,P=s,v=_);var D=S;D.x=.5*(P.x+v.x),D.y=.5*(P.y+v.y),D.z=.5*(P.z+v.z);var B=e.magnitudeSquared(e.subtract(v,D,I)),z=Math.sqrt(B),G=M;G.x=o.x,G.y=u.y,G.z=s.z;var b=y;b.x=E.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,I),.5,m),V=0;for(p=0;p<O;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var H=e.magnitude(e.subtract(a,X,I));H>V&&(V=H);var q=e.magnitudeSquared(e.subtract(a,D,I));if(q>B){var W=Math.sqrt(q);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<V?(e.clone(D,r.center),r.radius=z):(e.clone(X,r.center),r.radius=V),r},l.fromCornerPoints=function(t,n,r){i(r)||(r=new l);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},l.fromEllipsoid=function(t,n){return i(n)||(n=new l),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var L=new e;l.fromBoundingSpheres=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return l.clone(t[0],n);if(2===r)return l.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=l.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var E=t[o];s=Math.max(s,e.distance(u,E.center,L)+E.radius)}return n.radius=s,n};var x=new e,P=new e,v=new e;l.fromOrientedBoundingBox=function(t,n){i(n)||(n=new l);var r=t.halfAxes,a=E.getColumn(r,0,x),o=E.getColumn(r,1,P),u=E.getColumn(r,2,v),s=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,c,_),n},l.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new l(t.center,t.radius)},l.packedLength=4,l.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},l.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new l);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var F=new e,D=new e;l.union=function(t,n,r){i(r)||(r=new l);var a=t.center,o=t.radius,u=n.center,s=n.radius,E=e.subtract(u,a,F),c=e.magnitude(E);if(o>=c+s)return t.clone(r),r;if(s>=c+o)return n.clone(r),r;var _=.5*(o+c+s),T=e.multiplyByScalar(E,(-o+_)/c,D);return e.add(T,a,T),e.clone(T,r.center),r.radius=_,r};var B=new e;l.expand=function(t,n,r){r=l.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},l.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},l.transform=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;l.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},l.transformWithoutScale=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;l.computePlaneDistances=function(t,n,r,a){i(a)||(a=new s);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,H=new e,q=new e,W=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var K=new o;return l.projectTo2D=function(t,n,i){n=r(n,K);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,b),E=e.cross(e.UNIT_Z,s,X);e.normalize(E,E);var c=e.cross(s,E,V);e.normalize(c,c),e.multiplyByScalar(s,u,s),e.multiplyByScalar(c,u,c),e.multiplyByScalar(E,u,E);var _=e.negate(c,q),T=e.negate(E,H),R=Y,f=R[0];e.add(s,c,f),e.add(f,E,f),f=R[1],e.add(s,c,f),e.add(f,T,f),f=R[2],e.add(s,_,f),e.add(f,T,f),f=R[3],e.add(s,_,f),e.add(f,E,f),e.negate(s,s),f=R[4],e.add(s,c,f),e.add(f,E,f),f=R[5],e.add(s,c,f),e.add(f,T,f),f=R[6],e.add(s,_,f),e.add(f,T,f),f=R[7],e.add(s,_,f),e.add(f,E,f);for(var h=R.length,A=0;A<h;++A){var d=R[A];e.add(o,d,d);var N=a.cartesianToCartographic(d,W);n.project(N,d)}i=l.fromPoints(R,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},l.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},l.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.distanceSquaredTo=function(e){return l.distanceSquaredTo(this,e)},l.prototype.computePlaneDistances=function(e,t,n){return l.computePlaneDistances(this,e,t,n)},l.prototype.isOccluded=function(e){return l.isOccluded(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.clone=function(e){return l.clone(this,e)},l}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!l())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(y)&&(y=!1,!i()&&!l()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(y=!0,m=r(e[1]))}return y}function u(){return o()&&m}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(O=!0,p=r(e[1]),p.isNightly=!!e[2])}return O}function E(){return s()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,g=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,g=r(e[1])))}return C}function _(){return c()&&g}function l(){if(!t(U)){U=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(U=!0,w=r(e[1]))}return U}function T(){return l()&&w}function R(){if(!t(L)){L=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent); -null!==e&&(L=!0,x=r(e[1]))}return L}function f(){return t(P)||(P=/Windows/i.test(I.appVersion)),P}function h(){return R()&&x}function A(){return t(v)||(v="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),v}function d(){if(!t(D)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;D=t(n)&&""!==n,D&&(F=n)}return D}function N(){return d()?F:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,y,m,O,p,C,g,U,w,L,x,P,v,F,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:_,isEdge:l,edgeVersion:T,isFirefox:R,firefoxVersion:h,isWindows:f,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:N};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(i[n])||(i[n]=!0,console.warn(e(r,n)))}var i={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return i.fromQuaternion=function(e,n){t(n)||(n=new i);var r=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,a),n.pitch=-Math.asin(r),n},i.fromDegrees=function(e,n,a,o){return t(o)||(o=new i),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=a*r.RADIANS_PER_DEGREE,o},i.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},i.equalsEpsilon=function(e,n,i,a){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,i,a)&&r.equalsEpsilon(e.pitch,n.pitch,i,a)&&r.equalsEpsilon(e.roll,n.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u,s,E){"use strict";function c(e,t,r,i){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(i,0)}var _=new e;c.fromAxisAngle=function(t,n,i){var a=n/2,o=Math.sin(a);_=e.normalize(t,_);var u=_.x*o,s=_.y*o,E=_.z*o,l=Math.cos(a);return r(i)?(i.x=u,i.y=s,i.z=E,i.w=l,i):new c(u,s,E,l)};var l=[1,2,0],T=new Array(3);c.fromRotationMatrix=function(e,t){var n,i,a,o,u,s=e[E.COLUMN0ROW0],_=e[E.COLUMN1ROW1],R=e[E.COLUMN2ROW2],f=s+_+R;if(f>0)n=Math.sqrt(f+1),u=.5*n,n=.5/n,i=(e[E.COLUMN1ROW2]-e[E.COLUMN2ROW1])*n,a=(e[E.COLUMN2ROW0]-e[E.COLUMN0ROW2])*n,o=(e[E.COLUMN0ROW1]-e[E.COLUMN1ROW0])*n;else{var h=l,A=0;_>s&&(A=1),R>s&&R>_&&(A=2);var d=h[A],N=h[d];n=Math.sqrt(e[E.getElementIndex(A,A)]-e[E.getElementIndex(d,d)]-e[E.getElementIndex(N,N)]+1);var I=T;I[A]=.5*n,n=.5/n,u=(e[E.getElementIndex(N,d)]-e[E.getElementIndex(d,N)])*n,I[d]=(e[E.getElementIndex(d,A)]+e[E.getElementIndex(A,d)])*n,I[N]=(e[E.getElementIndex(N,A)]+e[E.getElementIndex(A,N)])*n,i=-I[0],a=-I[1],o=-I[2]}return r(t)?(t.x=i,t.y=a,t.z=o,t.w=u,t):new c(i,a,o,u)};var R=new c,f=new c,h=new c,A=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var o;return t instanceof u?(o=t,a=n):(i("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),A=c.fromAxisAngle(e.UNIT_X,o.roll,R),h=c.fromAxisAngle(e.UNIT_Y,-o.pitch,a),a=c.multiply(h,A,h),f=c.fromAxisAngle(e.UNIT_Z,-o.heading,R),c.multiply(f,a,a)};var d=new e,N=new e,I=new c,S=new c,M=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,M),c.conjugate(M,M);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;c.unpack(e,4*(t+i),I),c.multiply(I,M,I),I.w<0&&c.negate(I,I),c.computeAxis(I,d);var u=c.computeAngle(I);r[o]=d.x*u,r[o+1]=d.y*u,r[o+2]=d.z*u}},c.unpackInterpolationResult=function(t,n,i,a,o){r(o)||(o=new c),e.fromArray(t,0,N);var u=e.magnitude(N);return c.unpack(n,4*a,S),0===u?c.clone(c.IDENTITY,I):c.fromAxisAngle(N,u,I),c.multiply(I,S,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,E=t.z,c=t.w,_=o*u+r*c+i*E-a*s,l=o*s-r*E+i*c+a*u,T=o*E+r*s-i*u+a*c,R=o*c-r*u-i*s-a*E;return n.x=_,n.y=l,n.z=T,n.w=R,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var y=new c;c.lerp=function(e,t,n,r){return y=c.multiplyByScalar(t,n,y),r=c.multiplyByScalar(e,1-n,r),c.add(y,r,r)};var m=new c,O=new c,p=new c;c.slerp=function(e,t,n,r){var i=c.dot(e,t),a=t;if(i<0&&(i=-i,a=m=c.negate(t,m)),1-i<s.EPSILON6)return c.lerp(e,a,n,r);var o=Math.acos(i);return O=c.multiplyByScalar(e,Math.sin((1-n)*o),O),p=c.multiplyByScalar(a,Math.sin(n*o),p),r=c.add(O,p,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=s.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},c.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var C=new e,g=new e,U=new c,w=new c;c.computeInnerQuadrangle=function(t,n,r,i){var a=c.conjugate(n,U);c.multiply(a,r,w);var o=c.log(w,C);c.multiply(a,t,w);var u=c.log(w,g);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,U),c.multiply(n,U,i)},c.squad=function(e,t,n,r,i,a){var o=c.slerp(e,t,i,U),u=c.slerp(n,r,i,w);return c.slerp(o,u,2*i*(1-i),a)};for(var L=new c,x=1.9011074535173003,P=a.supportsTypedArrays()?new Float32Array(8):[],v=a.supportsTypedArrays()?new Float32Array(8):[],F=a.supportsTypedArrays()?new Float32Array(8):[],D=a.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,G=2*z+1;P[B]=1/(z*G),v[B]=z/G}return P[7]=x/136,v[7]=8*x/17,c.fastSlerp=function(e,t,n,r){var i,a=c.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,s=n*n,E=u*u,_=7;_>=0;--_)F[_]=(P[_]*s-v[_])*o,D[_]=(P[_]*E-v[_])*o;var l=i*n*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),T=u*(1+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),R=c.multiplyByScalar(e,T,L);return c.multiplyByScalar(t,l,r),c.add(R,r,r)},c.fastSquad=function(e,t,n,r,i,a){var o=c.fastSlerp(e,t,i,U),u=c.fastSlerp(n,r,i,w);return c.fastSlerp(o,u,2*i*(1-i),a)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,n,r){"use strict";function i(t,i,a,c,_,l,T,R,f,h){var A=t+i;e.multiplyByScalar(c,Math.cos(A),o),e.multiplyByScalar(a,Math.sin(A),u),e.add(o,u,o);var d=Math.cos(t);d*=d;var N=Math.sin(t);N*=N;var I=l/Math.sqrt(T*d+_*N),S=I/R;return r.fromAxisAngle(o,S,s),n.fromQuaternion(s,E),n.multiplyByVector(E,f,h),e.normalize(h,h),e.multiplyByScalar(h,R,h),h}var a={},o=new e,u=new e,s=new r,E=new n,c=new e,_=new e,l=new e,T=new e;a.raisePositionsToHeight=function(t,n,r){for(var i=n.ellipsoid,a=n.height,o=n.extrudedHeight,u=r?t.length/3*2:t.length/3,s=new Float64Array(3*u),E=t.length,R=r?E:0,f=0;f<E;f+=3){var h=f+1,A=f+2,d=e.fromArray(t,f,c);i.scaleToGeodeticSurface(d,d);var N=e.clone(d,_),I=i.geodeticSurfaceNormal(d,T),S=e.multiplyByScalar(I,a,l);e.add(d,S,d),r&&(e.multiplyByScalar(I,o,S),e.add(N,S,N),s[f+R]=N.x,s[h+R]=N.y,s[A+R]=N.z),s[f]=d.x,s[h]=d.y,s[A]=d.z}return s};var R=new e,f=new e,h=new e;return a.computeEllipsePositions=function(n,r,a){var o=n.semiMinorAxis,u=n.semiMajorAxis,s=n.rotation,E=n.center,T=8*n.granularity,A=o*o,d=u*u,N=u*o,I=e.magnitude(E),S=e.normalize(E,R),M=e.cross(e.UNIT_Z,E,f);M=e.normalize(M,M);var y=e.cross(S,M,h),m=1+Math.ceil(t.PI_OVER_TWO/T),O=t.PI_OVER_TWO/(m-1),p=t.PI_OVER_TWO-m*O;p<0&&(m-=Math.ceil(Math.abs(p)/O));var C,g,U,w,L,x=2*(m*(m+2)),P=r?new Array(3*x):void 0,v=0,F=c,D=_,B=4*m*3,z=B-1,G=0,b=a?new Array(B):void 0;for(p=t.PI_OVER_TWO,F=i(p,s,y,M,A,N,d,I,S,F),r&&(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z),a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x),p=t.PI_OVER_TWO-O,C=1;C<m+1;++C){if(F=i(p,s,y,M,A,N,d,I,S,F),D=i(Math.PI-p,s,y,M,A,N,d,I,S,D),r){for(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z,U=2*C+2,g=1;g<U-1;++g)w=g/(U-1),L=e.lerp(F,D,w,l),P[v++]=L.x,P[v++]=L.y,P[v++]=L.z;P[v++]=D.x,P[v++]=D.y,P[v++]=D.z}a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,b[G++]=D.x,b[G++]=D.y,b[G++]=D.z),p=t.PI_OVER_TWO-(C+1)*O}for(C=m;C>1;--C){if(p=t.PI_OVER_TWO-(C-1)*O,F=i(-p,s,y,M,A,N,d,I,S,F),D=i(p+Math.PI,s,y,M,A,N,d,I,S,D),r){for(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z,U=2*(C-1)+2,g=1;g<U-1;++g)w=g/(U-1),L=e.lerp(F,D,w,l),P[v++]=L.x,P[v++]=L.y,P[v++]=L.z;P[v++]=D.x,P[v++]=D.y,P[v++]=D.z}a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,b[G++]=D.x,b[G++]=D.y,b[G++]=D.z)}p=t.PI_OVER_TWO,F=i(-p,s,y,M,A,N,d,I,S,F);var X={};return r&&(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z,X.positions=P,X.numPts=m),a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,X.outerPositions=b),X},a}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,n,r,i,a,o,u,s,E,c,_,l,T){"use strict";function R(r){var i=r.center;d=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(i,d),r.height,d),d=t.add(i,d,d);for(var a=new e(d,r.semiMajorAxis),u=o.computeEllipsePositions(r,!1,!0).outerPositions,s=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(u,r,!1)})}),l=u.length/3,T=_.createTypedArray(l,2*l),R=0,f=0;f<l;++f)T[R++]=f,T[R++]=(f+1)%l;return{boundingSphere:a,attributes:s,indices:T}}function f(i){var a=i.center,u=i.ellipsoid,s=i.semiMajorAxis,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,A),i.height,A);N.center=t.add(a,T,N.center),N.radius=s,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,T),i.extrudedHeight,T),I.center=t.add(a,T,I.center),I.radius=s;var R=o.computeEllipsePositions(i,!1,!0).outerPositions,f=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(R,i,!0)})});R=f.position.values;var h=e.union(N,I),d=R.length/3,S=r(i.numberOfVerticalLines,16);S=l.clamp(S,0,d/2);var M=_.createTypedArray(d,2*d+2*S);d/=2;var y,m=0;for(y=0;y<d;++y)M[m++]=y,M[m++]=(y+1)%d,M[m++]=y+d,M[m++]=(y+1)%d+d;var O;if(S>0){var p=Math.min(S,d);O=Math.round(d/p);var C=Math.min(O*S,d);for(y=0;y<C;y+=O)M[m++]=y,M[m++]=y+d}return{boundingSphere:h,attributes:f,indices:M}}function h(e){e=r(e,r.EMPTY_OBJECT);var n=e.center,a=r(e.ellipsoid,u.WGS84),o=e.semiMajorAxis,s=e.semiMinorAxis,E=r(e.granularity,l.RADIANS_PER_DEGREE),c=r(e.height,0),_=e.extrudedHeight,T=i(_)&&Math.abs(c-_)>1;this._center=t.clone(n),this._semiMajorAxis=o,this._semiMinorAxis=s, -this._ellipsoid=u.clone(a),this._rotation=r(e.rotation,0),this._height=c,this._granularity=E,this._extrudedHeight=_,this._extrude=T,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var A=new t,d=new t,N=new e,I=new e;h.packedLength=t.packedLength+u.packedLength+9,h.pack=function(e,n,a){return a=r(a,0),t.pack(e._center,n,a),a+=t.packedLength,u.pack(e._ellipsoid,n,a),a+=u.packedLength,n[a++]=e._semiMajorAxis,n[a++]=e._semiMinorAxis,n[a++]=e._rotation,n[a++]=e._height,n[a++]=e._granularity,n[a++]=i(e._extrudedHeight)?1:0,n[a++]=r(e._extrudedHeight,0),n[a++]=e._extrude?1:0,n[a]=e._numberOfVerticalLines,n};var S=new t,M=new u,y={center:S,ellipsoid:M,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return h.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,S);n+=t.packedLength;var s=u.unpack(e,n,M);n+=u.packedLength;var E=e[n++],c=e[n++],_=e[n++],l=e[n++],T=e[n++],R=e[n++],f=e[n++],A=1===e[n++],d=e[n];return i(a)?(a._center=t.clone(o,a._center),a._ellipsoid=u.clone(s,a._ellipsoid),a._semiMajorAxis=E,a._semiMinorAxis=c,a._rotation=_,a._height=l,a._granularity=T,a._extrudedHeight=R?f:void 0,a._extrude=A,a._numberOfVerticalLines=d,a):(y.height=l,y.extrudedHeight=R?f:void 0,y.granularity=T,y.rotation=_,y.semiMajorAxis=E,y.semiMinorAxis=c,y.numberOfVerticalLines=d,new h(y))},h.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,n={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(n.extrudedHeight=Math.min(e._extrudedHeight,e._height),n.height=Math.max(e._extrudedHeight,e._height),t=f(n)):t=R(n),new s({attributes:t.attributes,indices:t.indices,primitiveType:T.LINES,boundingSphere:t.boundingSphere})}},h}),define("Workers/createEllipseOutlineGeometry",["../Core/Cartesian3","../Core/defined","../Core/EllipseOutlineGeometry","../Core/Ellipsoid"],function(e,t,n,r){"use strict";function i(i,a){return t(a)&&(i=n.unpack(i,a)),i._center=e.clone(i._center),i._ellipsoid=r.clone(i._ellipsoid),n.createGeometry(i)}return i})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,E),o.normalize(t,c);var n=o.dot(E,c),r=o.magnitude(o.cross(E,c,E));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,E=i*s-a*u,c=a*o-r*s,_=r*u-i*o;return n.x=E,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var l=new o,T=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:R,E=Math.cos(r);l.x=E*Math.cos(e),l.y=E*Math.sin(e),l.z=Math.sin(r),l=o.normalize(l,l),o.multiplyComponents(s,l,T);var c=Math.sqrt(o.dot(l,T));return T=o.divideByScalar(T,c,T),l=o.multiplyByScalar(l,i,l),n(u)||(u=new o),o.add(T,l,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromDegrees(u,s,0,t,r[E])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromRadians(u,s,0,t,r[E])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromDegrees(u,s,E,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromRadians(u,s,E,t,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,E){var c=n.x,_=n.y,l=n.z,T=i.x,R=i.y,f=i.z,h=c*c*T*T,A=_*_*R*R,d=l*l*f*f,N=h+A+d,I=Math.sqrt(1/N),S=e.multiplyByScalar(n,I,a);if(N<s)return isFinite(I)?e.clone(S,E):void 0;var M=u.x,y=u.y,m=u.z,O=o;O.x=S.x*M*2,O.y=S.y*y*2,O.z=S.z*m*2;var p,C,g,U,w,L,x,P,v,F,D,B=(1-I)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{B-=z,g=1/(1+B*M),U=1/(1+B*y),w=1/(1+B*m),L=g*g,x=U*U,P=w*w,v=L*g,F=x*U,D=P*w,p=h*L+A*x+d*P-1,C=h*v*M+A*F*y+d*D*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(E)?(E.x=c*g,E.y=_*U,E.z=l*w,E):new e(c*g,_*U,l*w)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,i,a){return i=n(i,0),r(a)?(a.longitude=e,a.latitude=t,a.height=i,a):new u(e,t,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,E=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),l=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),T=a.EPSILON1;return u.fromCartesian=function(t,n,i){var R=r(n)?n.oneOverRadii:_,f=r(n)?n.oneOverRadiiSquared:l,h=r(n)?n._centerToleranceSquared:T,A=o(t,R,f,h,E);if(r(A)){var d=e.multiplyComponents(A,f,s);d=e.normalize(d,d);var N=e.subtract(t,A,c),I=Math.atan2(d.y,d.x),S=Math.asin(d.z),M=a.sign(e.dot(N,t))*e.magnitude(N);return r(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,E(this,e,t,n)}i(c.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}}}),c.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(E(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),E=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=E,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,l=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=l;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var T=new e,R=new e,f=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,R);if(r(a)){var o=this.geodeticSurfaceNormal(a,T),s=e.subtract(n,a,f),E=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=E,i.latitude=c,i.height=_,i):new t(E,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i,a,o,u,s,E){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(E,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(f[n],R[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(f[a],R[a])]);o>r&&(i=a,r=o)}var E=1,c=0,_=R[i],l=f[i];if(Math.abs(e[s.getElementIndex(l,_)])>n){var T,h=e[s.getElementIndex(l,l)],A=e[s.getElementIndex(_,_)],d=e[s.getElementIndex(l,_)],N=(h-A)/2/d;T=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),E=1/Math.sqrt(1+T*T),c=T*E}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(_,_)]=t[s.getElementIndex(l,l)]=E,t[s.getElementIndex(l,_)]=c,t[s.getElementIndex(_,l)]=-c,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,E=e.y*e.z,c=e.y*e.w,_=e.z*e.z,l=e.z*e.w,T=e.w*e.w,R=n-u-_+T,f=2*(i-l),h=2*(a+c),A=2*(i+l),d=-n+u-_+T,N=2*(E-o),I=2*(a-c),S=2*(E+o),M=-n-u+_+T;return r(t)?(t[0]=R,t[1]=A,t[2]=I,t[3]=f,t[4]=d,t[5]=S,t[6]=h,t[7]=N,t[8]=M,t):new s(R,f,h,A,d,N,I,S,M)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),E=Math.sin(e.roll),c=n*i,_=-a*u+E*o*i,l=E*u+a*o*i,T=n*u,R=a*i+E*o*u,f=-E*i+a*o*u,h=-o,A=E*n,d=a*n;return r(t)?(t[0]=c,t[1]=T,t[2]=h,t[3]=_,t[4]=R,t[5]=A,t[6]=l,t[7]=f,t[8]=d,t):new s(c,_,l,T,R,f,h,A,d)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new s(1,0,0,0,n,-i,0,i,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new s(n,0,i,0,1,0,-i,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-i,0,i,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),n};var T=new e;s.getMaximumScale=function(t){return s.getScale(t,T),e.maximumComponent(T)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],E=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=E,n[7]=c,n[8]=_,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],E=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=E,t[8]=c,t};var R=[1,0,0],f=[2,2,1],h=new s,A=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var l=t.unitary=s.clone(s.IDENTITY,t.unitary),T=t.diagonal=s.clone(e,t.diagonal),R=n*E(T);o<i&&c(T)>R;)_(T,h),s.transpose(h,A),s.multiply(T,h,T),s.multiply(A,T,T),s.multiply(l,h,l),++a>2&&(++o,a=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],E=e[8];return t*(a*E-s*o)+i*(s*r-n*E)+u*(n*o-a*r)},s.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],E=e[6],c=e[7],_=e[8],l=s.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=E*u-a*_,t[4]=n*_-E*i,t[5]=a*i-n*u,t[6]=a*c-E*o,t[7]=E*r-n*c,t[8]=n*o-a*r;var T=1/l;return s.multiplyByScalar(t,T,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,E){ +"use strict";function c(e,t,n,i,a,o,u,s,E,c,_,l,T,R,f,h){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(E,0),this[3]=r(T,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(R,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(l,0),this[15]=r(h,0)}c.packedLength=16,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},c.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new c),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},c.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,E=t.x*t.y,_=t.x*t.z,l=t.x*t.w,T=t.y*t.y,R=t.y*t.z,f=t.y*t.w,h=t.z*t.z,A=t.z*t.w,d=t.w*t.w,N=s-T-h+d,I=2*(E-A),S=2*(_+f),M=2*(E+A),y=-s+T-h+d,m=2*(R-l),O=2*(_-f),p=2*(R+l),C=-s-T+h+d;return r[0]=N*a,r[1]=M*a,r[2]=O*a,r[3]=0,r[4]=I*o,r[5]=y*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(s.IDENTITY,e,t)},c.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,l=new e,T=new e;c.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,l),l),e.normalize(e.cross(l,_,T),T);var u=l.x,s=l.y,E=l.z,R=_.x,f=_.y,h=_.z,A=T.x,d=T.y,N=T.z,I=r.x,S=r.y,M=r.z,y=u*-I+s*-S+E*-M,m=A*-I+d*-S+N*-M,O=R*I+f*S+h*M;return i(n)?(n[0]=u,n[1]=A,n[2]=-R,n[3]=0,n[4]=s,n[5]=d,n[6]=-f,n[7]=0,n[8]=E,n[9]=N,n[10]=-h,n[11]=0,n[12]=y,n[13]=m,n[14]=O,n[15]=1,n):new c(u,s,E,y,A,d,N,m,-R,-f,-h,O,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),E=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=E,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),E=1/(a-i),c=-(t+e)*u,_=-(r+n)*s,l=-(a+i)*E;return u*=2,s*=2,E*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=E,o[11]=0,o[12]=c,o[13]=_,o[14]=l,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),E=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),l=-1,T=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=E,o[9]=c,o[10]=_,o[11]=l,o[12]=0,o[13]=0,o[14]=T,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),E=(r+n)/(r-n),c=-1,_=-1,l=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=s,a[9]=E,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=l,a[15]=0,a},c.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var E=.5*u,c=.5*s,_=.5*(n-t),l=E,T=c,R=_,f=a+E,h=o+c,A=t+_,d=1;return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=T,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=R,i[11]=0,i[12]=f,i[13]=h,i[14]=A,i[15]=d,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},c.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var R=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],R)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],R)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],R)),n};var f=new e;c.getMaximumScale=function(t){return c.getScale(t,f),e.maximumComponent(f)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],E=e[6],c=e[7],_=e[8],l=e[9],T=e[10],R=e[11],f=e[12],h=e[13],A=e[14],d=e[15],N=t[0],I=t[1],S=t[2],M=t[3],y=t[4],m=t[5],O=t[6],p=t[7],C=t[8],g=t[9],U=t[10],w=t[11],L=t[12],x=t[13],P=t[14],v=t[15],F=r*N+u*I+_*S+f*M,D=i*N+s*I+l*S+h*M,B=a*N+E*I+T*S+A*M,z=o*N+c*I+R*S+d*M,G=r*y+u*m+_*O+f*p,b=i*y+s*m+l*O+h*p,X=a*y+E*m+T*O+A*p,V=o*y+c*m+R*O+d*p,H=r*C+u*g+_*U+f*w,q=i*C+s*g+l*U+h*w,W=a*C+E*g+T*U+A*w,Y=o*C+c*g+R*U+d*w,k=r*L+u*x+_*P+f*v,K=i*L+s*x+l*P+h*v,Z=a*L+E*x+T*P+A*v,j=o*L+c*x+R*P+d*v;return n[0]=F,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=q,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=e[12],T=e[13],R=e[14],f=t[0],h=t[1],A=t[2],d=t[4],N=t[5],I=t[6],S=t[8],M=t[9],y=t[10],m=t[12],O=t[13],p=t[14],C=r*f+o*h+E*A,g=i*f+u*h+c*A,U=a*f+s*h+_*A,w=r*d+o*N+E*I,L=i*d+u*N+c*I,x=a*d+s*N+_*I,P=r*S+o*M+E*y,v=i*S+u*M+c*y,F=a*S+s*M+_*y,D=r*m+o*O+E*p+l,B=i*m+u*O+c*p+T,z=a*m+s*O+_*p+R;return n[0]=C,n[1]=g,n[2]=U,n[3]=0,n[4]=w,n[5]=L,n[6]=x,n[7]=0,n[8]=P,n[9]=v,n[10]=F,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=t[0],T=t[1],R=t[2],f=t[3],h=t[4],A=t[5],d=t[6],N=t[7],I=t[8],S=r*l+o*T+E*R,M=i*l+u*T+c*R,y=a*l+s*T+_*R,m=r*f+o*h+E*A,O=i*f+u*h+c*A,p=a*f+s*h+_*A,C=r*d+o*N+E*I,g=i*d+u*N+c*I,U=a*d+s*N+_*I;return n[0]=S,n[1]=M,n[2]=y,n[3]=0,n[4]=m,n[5]=O,n[6]=p,n[7]=0,n[8]=C,n[9]=g,n[10]=U,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var h=new e;c.multiplyByUniformScale=function(e,t,n){return h.x=t,h.y=t,h.z=t,c.multiplyByScale(e,h,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,E=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=E,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var A=new s,d=new s,N=new t,I=new t(0,0,0,1);return c.inverse=function(e,n){if(s.equalsEpsilon(c.getRotation(e,A),d,u.EPSILON7)&&t.equals(c.getRow(e,3,N),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],l=e[5],T=e[9],R=e[13],f=e[2],h=e[6],S=e[10],M=e[14],y=e[3],m=e[7],O=e[11],p=e[15],C=S*p,g=M*O,U=h*p,w=M*m,L=h*O,x=S*m,P=f*p,v=M*y,F=f*O,D=S*y,B=f*m,z=h*y,G=C*l+w*T+L*R-(g*l+U*T+x*R),b=g*_+P*T+D*R-(C*_+v*T+F*R),X=U*_+v*l+B*R-(w*_+P*l+z*R),V=x*_+F*l+z*T-(L*_+D*l+B*T),H=g*i+U*a+x*o-(C*i+w*a+L*o),q=C*r+v*a+F*o-(g*r+P*a+D*o),W=w*r+P*i+z*o-(U*r+v*i+B*o),Y=L*r+D*i+B*a-(x*r+F*i+z*a);C=a*R,g=o*T,U=i*R,w=o*l,L=i*T,x=a*l,P=r*R,v=o*_,F=r*T,D=a*_,B=r*l,z=i*_;var k=C*m+w*O+L*p-(g*m+U*O+x*p),K=g*y+P*O+D*p-(C*y+v*O+F*p),Z=U*y+v*m+B*p-(w*y+P*m+z*p),j=x*y+F*m+z*O-(L*y+D*m+B*O),Q=U*S+x*M+g*h-(L*M+C*h+w*S),J=F*M+C*f+v*S-(P*S+D*M+g*f),$=P*h+z*M+w*f-(B*M+U*f+v*h),ee=B*S+L*f+D*h-(F*h+z*S+x*f),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=H*te,n[5]=q*te,n[6]=W*te,n[7]=Y*te,n[8]=k*te,n[9]=K*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],E=e[9],c=e[10],_=e[12],l=e[13],T=e[14],R=-n*_-r*l-i*T,f=-a*_-o*l-u*T,h=-s*_-E*l-c*T;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=E,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=R,t[13]=f,t[14]=h,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,i,a,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new s(e,t,i,a)},s.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new s(e,t,i,a)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,E=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,l=e.length;_<l;_++){var T=e[_];n=Math.min(n,T.longitude),i=Math.max(i,T.longitude),E=Math.min(E,T.latitude),c=Math.max(c,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+u.TWO_PI;a=Math.min(a,R),o=Math.max(o,R)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=E,t.east=i,t.north=c,t):new s(n,E,i,c)},s.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,E=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,l=0,T=e.length;l<T;l++){var R=t.cartesianToCartographic(e[l]);i=Math.min(i,R.longitude),a=Math.max(a,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,f),E=Math.max(E,f)}return a-i>E-o&&(i=o,a=E,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new s(i,c,a,_)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,E)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var l=Math.max(e.south,t.south),T=Math.min(e.north,t.north);if(!(l>=T))return r(n)?(n.west=c,n.south=l,n.east=_,n.north=T,n):new s(c,l,_,T)}},s.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,E)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var E=new e;return s.subsample=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=e.north,l=e.south,T=e.east,R=e.west,f=E;f.height=i,f.longitude=R,f.latitude=_,o[c]=t.cartographicToCartesian(f,o[c]),c++,f.longitude=T,o[c]=t.cartographicToCartesian(f,o[c]),c++,f.latitude=l,o[c]=t.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=t.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:l>0?f.latitude=l:f.latitude=0;for(var h=1;h<8;++h)f.longitude=-Math.PI+h*u.PI_OVER_TWO,s.contains(e,f)&&(o[c]=t.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=R,o[c]=t.cartographicToCartesian(f,o[c]),c++,f.longitude=T,o[c]=t.cartographicToCartesian(f,o[c]),c++),o.length=c,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,E,c,_){"use strict";function l(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var T=new e,R=new e,f=new e,h=new e,A=new e,d=new e,N=new e,I=new e,S=new e,M=new e,y=new e,m=new e;l.fromPoints=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],N),a=e.clone(r,T),o=e.clone(r,R),u=e.clone(r,f),s=e.clone(r,h),E=e.clone(r,A),c=e.clone(r,d),_=t.length,O=1;O<_;O++){e.clone(t[O],r);var p=r.x,C=r.y,g=r.z;p<a.x&&e.clone(r,a),p>s.x&&e.clone(r,s),C<o.y&&e.clone(r,o),C>E.y&&e.clone(r,E),g<u.z&&e.clone(r,u),g>c.z&&e.clone(r,c)}var U=e.magnitudeSquared(e.subtract(s,a,I)),w=e.magnitudeSquared(e.subtract(E,o,I)),L=e.magnitudeSquared(e.subtract(c,u,I)),x=a,P=s,v=U;w>v&&(v=w,x=o,P=E),L>v&&(v=L,x=u,P=c);var F=S;F.x=.5*(x.x+P.x),F.y=.5*(x.y+P.y),F.z=.5*(x.z+P.z);var D=e.magnitudeSquared(e.subtract(P,F,I)),B=Math.sqrt(D),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=y;G.x=s.x,G.y=E.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,I),.5,m),X=0;for(O=0;O<_;O++){e.clone(t[O],r);var V=e.magnitude(e.subtract(r,b,I));V>X&&(X=V);var H=e.magnitudeSquared(e.subtract(r,F,I));if(H>D){var q=Math.sqrt(H);B=.5*(B+q),D=B*B;var W=q-B;F.x=(B*F.x+W*r.x)/q,F.y=(B*F.y+W*r.y)/q,F.z=(B*F.z+W*r.z)/q}}return B<X?(e.clone(F,n.center),n.radius=B):(e.clone(b,n.center),n.radius=X),n};var O=new o,p=new e,C=new e,g=new t,U=new t;l.fromRectangle2D=function(e,t,n){return l.fromRectangleWithHeights2D(e,t,0,0,n)},l.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new l),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,O),_.southwest(t,g),g.height=a,_.northeast(t,U),U.height=o;var s=n.project(g,p),E=n.project(U,C),c=E.x-s.x,T=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(c*c+T*T+R*R);var f=u.center;return f.x=s.x+.5*c,f.y=s.y+.5*T,f.z=s.z+.5*R,u};var w=[];l.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,w)),l.fromPoints(u,o)},l.fromVertices=function(t,n,a,o){if(i(o)||(o=new l),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=N;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,T),E=e.clone(u,R),c=e.clone(u,f),_=e.clone(u,h),O=e.clone(u,A),p=e.clone(u,d),C=t.length,g=0;g<C;g+=a){var U=t[g]+n.x,w=t[g+1]+n.y,L=t[g+2]+n.z;u.x=U,u.y=w,u.z=L,U<s.x&&e.clone(u,s),U>_.x&&e.clone(u,_),w<E.y&&e.clone(u,E),w>O.y&&e.clone(u,O),L<c.z&&e.clone(u,c),L>p.z&&e.clone(u,p)}var x=e.magnitudeSquared(e.subtract(_,s,I)),P=e.magnitudeSquared(e.subtract(O,E,I)),v=e.magnitudeSquared(e.subtract(p,c,I)),F=s,D=_,B=x;P>B&&(B=P,F=E,D=O),v>B&&(B=v,F=c,D=p);var z=S;z.x=.5*(F.x+D.x),z.y=.5*(F.y+D.y),z.z=.5*(F.z+D.z);var G=e.magnitudeSquared(e.subtract(D,z,I)),b=Math.sqrt(G),X=M;X.x=s.x,X.y=E.y,X.z=c.z;var V=y;V.x=_.x,V.y=O.y,V.z=p.z;var H=e.multiplyByScalar(e.add(X,V,I),.5,m),q=0;for(g=0;g<C;g+=a){u.x=t[g]+n.x,u.y=t[g+1]+n.y,u.z=t[g+2]+n.z;var W=e.magnitude(e.subtract(u,H,I));W>q&&(q=W);var Y=e.magnitudeSquared(e.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<q?(e.clone(z,o.center),o.radius=b):(e.clone(H,o.center),o.radius=q),o},l.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new l),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=N;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,T),u=e.clone(a,R),s=e.clone(a,f),E=e.clone(a,h),c=e.clone(a,A),_=e.clone(a,d),O=t.length,p=0;p<O;p+=3){var C=t[p]+n[p],g=t[p+1]+n[p+1],U=t[p+2]+n[p+2];a.x=C,a.y=g,a.z=U,C<o.x&&e.clone(a,o),C>E.x&&e.clone(a,E),g<u.y&&e.clone(a,u),g>c.y&&e.clone(a,c),U<s.z&&e.clone(a,s),U>_.z&&e.clone(a,_)}var w=e.magnitudeSquared(e.subtract(E,o,I)),L=e.magnitudeSquared(e.subtract(c,u,I)),x=e.magnitudeSquared(e.subtract(_,s,I)),P=o,v=E,F=w;L>F&&(F=L,P=u,v=c),x>F&&(F=x,P=s,v=_);var D=S;D.x=.5*(P.x+v.x),D.y=.5*(P.y+v.y),D.z=.5*(P.z+v.z);var B=e.magnitudeSquared(e.subtract(v,D,I)),z=Math.sqrt(B),G=M;G.x=o.x,G.y=u.y,G.z=s.z;var b=y;b.x=E.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,I),.5,m),V=0;for(p=0;p<O;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var H=e.magnitude(e.subtract(a,X,I));H>V&&(V=H);var q=e.magnitudeSquared(e.subtract(a,D,I));if(q>B){var W=Math.sqrt(q);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<V?(e.clone(D,r.center),r.radius=z):(e.clone(X,r.center),r.radius=V),r},l.fromCornerPoints=function(t,n,r){i(r)||(r=new l);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},l.fromEllipsoid=function(t,n){return i(n)||(n=new l),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var L=new e;l.fromBoundingSpheres=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return l.clone(t[0],n);if(2===r)return l.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=l.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var E=t[o];s=Math.max(s,e.distance(u,E.center,L)+E.radius)}return n.radius=s,n};var x=new e,P=new e,v=new e;l.fromOrientedBoundingBox=function(t,n){i(n)||(n=new l);var r=t.halfAxes,a=E.getColumn(r,0,x),o=E.getColumn(r,1,P),u=E.getColumn(r,2,v);return e.add(a,o,a),e.add(a,u,a),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(a),n},l.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new l(t.center,t.radius)},l.packedLength=4,l.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},l.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new l);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var F=new e,D=new e;l.union=function(t,n,r){i(r)||(r=new l);var a=t.center,o=t.radius,u=n.center,s=n.radius,E=e.subtract(u,a,F),c=e.magnitude(E);if(o>=c+s)return t.clone(r),r;if(s>=c+o)return n.clone(r),r;var _=.5*(o+c+s),T=e.multiplyByScalar(E,(-o+_)/c,D);return e.add(T,a,T),e.clone(T,r.center),r.radius=_,r};var B=new e;l.expand=function(t,n,r){r=l.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},l.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},l.transform=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;l.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},l.transformWithoutScale=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;l.computePlaneDistances=function(t,n,r,a){i(a)||(a=new s);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,H=new e,q=new e,W=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var K=new o;return l.projectTo2D=function(t,n,i){n=r(n,K);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,b),E=e.cross(e.UNIT_Z,s,X);e.normalize(E,E);var c=e.cross(s,E,V);e.normalize(c,c),e.multiplyByScalar(s,u,s),e.multiplyByScalar(c,u,c),e.multiplyByScalar(E,u,E);var _=e.negate(c,q),T=e.negate(E,H),R=Y,f=R[0];e.add(s,c,f),e.add(f,E,f),f=R[1],e.add(s,c,f),e.add(f,T,f),f=R[2],e.add(s,_,f),e.add(f,T,f),f=R[3],e.add(s,_,f),e.add(f,E,f),e.negate(s,s),f=R[4],e.add(s,c,f),e.add(f,E,f),f=R[5],e.add(s,c,f),e.add(f,T,f),f=R[6],e.add(s,_,f),e.add(f,T,f),f=R[7],e.add(s,_,f),e.add(f,E,f);for(var h=R.length,A=0;A<h;++A){var d=R[A];e.add(o,d,d);var N=a.cartesianToCartographic(d,W);n.project(N,d)}i=l.fromPoints(R,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},l.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},l.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.distanceSquaredTo=function(e){return l.distanceSquaredTo(this,e)},l.prototype.computePlaneDistances=function(e,t,n){return l.computePlaneDistances(this,e,t,n)},l.prototype.isOccluded=function(e){return l.isOccluded(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.clone=function(e){return l.clone(this,e)},l}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!l())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(y)&&(y=!1,!i()&&!l()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(y=!0,m=r(e[1]))}return y}function u(){return o()&&m}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(O=!0,p=r(e[1]),p.isNightly=!!e[2])}return O}function E(){return s()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,g=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,g=r(e[1])))}return C}function _(){return c()&&g}function l(){if(!t(U)){U=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(U=!0,w=r(e[1]))}return U}function T(){return l()&&w}function R(){if(!t(L)){L=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(L=!0,x=r(e[1])); +}return L}function f(){return t(P)||(P=/Windows/i.test(I.appVersion)),P}function h(){return R()&&x}function A(){return t(v)||(v="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),v}function d(){if(!t(D)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;D=t(n)&&""!==n,D&&(F=n)}return D}function N(){return d()?F:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,y,m,O,p,C,g,U,w,L,x,P,v,F,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:_,isEdge:l,edgeVersion:T,isFirefox:R,firefoxVersion:h,isWindows:f,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:N};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(i[n])||(i[n]=!0,console.warn(e(r,n)))}var i={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return i.fromQuaternion=function(e,n){t(n)||(n=new i);var r=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,a),n.pitch=-Math.asin(r),n},i.fromDegrees=function(e,n,a,o){return t(o)||(o=new i),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=a*r.RADIANS_PER_DEGREE,o},i.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},i.equalsEpsilon=function(e,n,i,a){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,i,a)&&r.equalsEpsilon(e.pitch,n.pitch,i,a)&&r.equalsEpsilon(e.roll,n.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,n){return i.equalsEpsilon(this,e,t,n)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,i,a,o,u,s,E){"use strict";function c(e,t,r,i){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(i,0)}var _=new e;c.fromAxisAngle=function(t,n,i){var a=n/2,o=Math.sin(a);_=e.normalize(t,_);var u=_.x*o,s=_.y*o,E=_.z*o,l=Math.cos(a);return r(i)?(i.x=u,i.y=s,i.z=E,i.w=l,i):new c(u,s,E,l)};var l=[1,2,0],T=new Array(3);c.fromRotationMatrix=function(e,t){var n,i,a,o,u,s=e[E.COLUMN0ROW0],_=e[E.COLUMN1ROW1],R=e[E.COLUMN2ROW2],f=s+_+R;if(f>0)n=Math.sqrt(f+1),u=.5*n,n=.5/n,i=(e[E.COLUMN1ROW2]-e[E.COLUMN2ROW1])*n,a=(e[E.COLUMN2ROW0]-e[E.COLUMN0ROW2])*n,o=(e[E.COLUMN0ROW1]-e[E.COLUMN1ROW0])*n;else{var h=l,A=0;_>s&&(A=1),R>s&&R>_&&(A=2);var d=h[A],N=h[d];n=Math.sqrt(e[E.getElementIndex(A,A)]-e[E.getElementIndex(d,d)]-e[E.getElementIndex(N,N)]+1);var I=T;I[A]=.5*n,n=.5/n,u=(e[E.getElementIndex(N,d)]-e[E.getElementIndex(d,N)])*n,I[d]=(e[E.getElementIndex(d,A)]+e[E.getElementIndex(A,d)])*n,I[N]=(e[E.getElementIndex(N,A)]+e[E.getElementIndex(A,N)])*n,i=-I[0],a=-I[1],o=-I[2]}return r(t)?(t.x=i,t.y=a,t.z=o,t.w=u,t):new c(i,a,o,u)};var R=new c,f=new c,h=new c,A=new c;c.fromHeadingPitchRoll=function(t,n,r,a){var o;return t instanceof u?(o=t,a=n):(i("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),A=c.fromAxisAngle(e.UNIT_X,o.roll,R),h=c.fromAxisAngle(e.UNIT_Y,-o.pitch,a),a=c.multiply(h,A,h),f=c.fromAxisAngle(e.UNIT_Z,-o.heading,R),c.multiply(f,a,a)};var d=new e,N=new e,I=new c,S=new c,M=new c;c.packedLength=4,c.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},c.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new c),i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},c.packedInterpolationLength=3,c.convertPackedArrayForInterpolation=function(e,t,n,r){c.unpack(e,4*n,M),c.conjugate(M,M);for(var i=0,a=n-t+1;i<a;i++){var o=3*i;c.unpack(e,4*(t+i),I),c.multiply(I,M,I),I.w<0&&c.negate(I,I),c.computeAxis(I,d);var u=c.computeAngle(I);r[o]=d.x*u,r[o+1]=d.y*u,r[o+2]=d.z*u}},c.unpackInterpolationResult=function(t,n,i,a,o){r(o)||(o=new c),e.fromArray(t,0,N);var u=e.magnitude(N);return c.unpack(n,4*a,S),0===u?c.clone(c.IDENTITY,I):c.fromAxisAngle(N,u,I),c.multiply(I,S,o)},c.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new c(e.x,e.y,e.z,e.w)},c.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},c.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},c.magnitude=function(e){return Math.sqrt(c.magnitudeSquared(e))},c.normalize=function(e,t){var n=1/c.magnitude(e),r=e.x*n,i=e.y*n,a=e.z*n,o=e.w*n;return t.x=r,t.y=i,t.z=a,t.w=o,t},c.inverse=function(e,t){var n=c.magnitudeSquared(e);return t=c.conjugate(e,t),c.multiplyByScalar(t,1/n,t)},c.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},c.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},c.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},c.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},c.multiply=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,E=t.z,c=t.w,_=o*u+r*c+i*E-a*s,l=o*s-r*E+i*c+a*u,T=o*E+r*s-i*u+a*c,R=o*c-r*u-i*s-a*E;return n.x=_,n.y=l,n.z=T,n.w=R,n},c.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},c.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},c.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},c.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var y=new c;c.lerp=function(e,t,n,r){return y=c.multiplyByScalar(t,n,y),r=c.multiplyByScalar(e,1-n,r),c.add(y,r,r)};var m=new c,O=new c,p=new c;c.slerp=function(e,t,n,r){var i=c.dot(e,t),a=t;if(i<0&&(i=-i,a=m=c.negate(t,m)),1-i<s.EPSILON6)return c.lerp(e,a,n,r);var o=Math.acos(i);return O=c.multiplyByScalar(e,Math.sin((1-n)*o),O),p=c.multiplyByScalar(a,Math.sin(n*o),p),r=c.add(O,p,r),c.multiplyByScalar(r,1/Math.sin(o),r)},c.log=function(t,n){var r=s.acosClamped(t.w),i=0;return 0!==r&&(i=r/Math.sin(r)),e.multiplyByScalar(t,i,n)},c.exp=function(t,n){var r=e.magnitude(t),i=0;return 0!==r&&(i=Math.sin(r)/r),n.x=t.x*i,n.y=t.y*i,n.z=t.z*i,n.w=Math.cos(r),n};var C=new e,g=new e,U=new c,w=new c;c.computeInnerQuadrangle=function(t,n,r,i){var a=c.conjugate(n,U);c.multiply(a,r,w);var o=c.log(w,C);c.multiply(a,t,w);var u=c.log(w,g);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),c.exp(o,U),c.multiply(n,U,i)},c.squad=function(e,t,n,r,i,a){var o=c.slerp(e,t,i,U),u=c.slerp(n,r,i,w);return c.slerp(o,u,2*i*(1-i),a)};for(var L=new c,x=1.9011074535173003,P=a.supportsTypedArrays()?new Float32Array(8):[],v=a.supportsTypedArrays()?new Float32Array(8):[],F=a.supportsTypedArrays()?new Float32Array(8):[],D=a.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,G=2*z+1;P[B]=1/(z*G),v[B]=z/G}return P[7]=x/136,v[7]=8*x/17,c.fastSlerp=function(e,t,n,r){var i,a=c.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-n,s=n*n,E=u*u,_=7;_>=0;--_)F[_]=(P[_]*s-v[_])*o,D[_]=(P[_]*E-v[_])*o;var l=i*n*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),T=u*(1+D[0]*(1+D[1]*(1+D[2]*(1+D[3]*(1+D[4]*(1+D[5]*(1+D[6]*(1+D[7])))))))),R=c.multiplyByScalar(e,T,L);return c.multiplyByScalar(t,l,r),c.add(R,r,r)},c.fastSquad=function(e,t,n,r,i,a){var o=c.fastSlerp(e,t,i,U),u=c.fastSlerp(n,r,i,w);return c.fastSlerp(o,u,2*i*(1-i),a)},c.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},c.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},c.ZERO=o(new c(0,0,0,0)),c.IDENTITY=o(new c(0,0,0,1)),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},c}),define("Core/EllipseGeometryLibrary",["./Cartesian3","./Math","./Matrix3","./Quaternion"],function(e,t,n,r){"use strict";function i(t,i,a,c,_,l,T,R,f,h){var A=t+i;e.multiplyByScalar(c,Math.cos(A),o),e.multiplyByScalar(a,Math.sin(A),u),e.add(o,u,o);var d=Math.cos(t);d*=d;var N=Math.sin(t);N*=N;var I=l/Math.sqrt(T*d+_*N),S=I/R;return r.fromAxisAngle(o,S,s),n.fromQuaternion(s,E),n.multiplyByVector(E,f,h),e.normalize(h,h),e.multiplyByScalar(h,R,h),h}var a={},o=new e,u=new e,s=new r,E=new n,c=new e,_=new e,l=new e,T=new e;a.raisePositionsToHeight=function(t,n,r){for(var i=n.ellipsoid,a=n.height,o=n.extrudedHeight,u=r?t.length/3*2:t.length/3,s=new Float64Array(3*u),E=t.length,R=r?E:0,f=0;f<E;f+=3){var h=f+1,A=f+2,d=e.fromArray(t,f,c);i.scaleToGeodeticSurface(d,d);var N=e.clone(d,_),I=i.geodeticSurfaceNormal(d,T),S=e.multiplyByScalar(I,a,l);e.add(d,S,d),r&&(e.multiplyByScalar(I,o,S),e.add(N,S,N),s[f+R]=N.x,s[h+R]=N.y,s[A+R]=N.z),s[f]=d.x,s[h]=d.y,s[A]=d.z}return s};var R=new e,f=new e,h=new e;return a.computeEllipsePositions=function(n,r,a){var o=n.semiMinorAxis,u=n.semiMajorAxis,s=n.rotation,E=n.center,T=8*n.granularity,A=o*o,d=u*u,N=u*o,I=e.magnitude(E),S=e.normalize(E,R),M=e.cross(e.UNIT_Z,E,f);M=e.normalize(M,M);var y=e.cross(S,M,h),m=1+Math.ceil(t.PI_OVER_TWO/T),O=t.PI_OVER_TWO/(m-1),p=t.PI_OVER_TWO-m*O;p<0&&(m-=Math.ceil(Math.abs(p)/O));var C,g,U,w,L,x=2*(m*(m+2)),P=r?new Array(3*x):void 0,v=0,F=c,D=_,B=4*m*3,z=B-1,G=0,b=a?new Array(B):void 0;for(p=t.PI_OVER_TWO,F=i(p,s,y,M,A,N,d,I,S,F),r&&(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z),a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x),p=t.PI_OVER_TWO-O,C=1;C<m+1;++C){if(F=i(p,s,y,M,A,N,d,I,S,F),D=i(Math.PI-p,s,y,M,A,N,d,I,S,D),r){for(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z,U=2*C+2,g=1;g<U-1;++g)w=g/(U-1),L=e.lerp(F,D,w,l),P[v++]=L.x,P[v++]=L.y,P[v++]=L.z;P[v++]=D.x,P[v++]=D.y,P[v++]=D.z}a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,b[G++]=D.x,b[G++]=D.y,b[G++]=D.z),p=t.PI_OVER_TWO-(C+1)*O}for(C=m;C>1;--C){if(p=t.PI_OVER_TWO-(C-1)*O,F=i(-p,s,y,M,A,N,d,I,S,F),D=i(p+Math.PI,s,y,M,A,N,d,I,S,D),r){for(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z,U=2*(C-1)+2,g=1;g<U-1;++g)w=g/(U-1),L=e.lerp(F,D,w,l),P[v++]=L.x,P[v++]=L.y,P[v++]=L.z;P[v++]=D.x,P[v++]=D.y,P[v++]=D.z}a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,b[G++]=D.x,b[G++]=D.y,b[G++]=D.z)}p=t.PI_OVER_TWO,F=i(-p,s,y,M,A,N,d,I,S,F);var X={};return r&&(P[v++]=F.x,P[v++]=F.y,P[v++]=F.z,X.positions=P,X.numPts=m),a&&(b[z--]=F.z,b[z--]=F.y,b[z--]=F.x,X.outerPositions=b),X},a}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/EllipseOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EllipseGeometryLibrary","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,n,r,i,a,o,u,s,E,c,_,l,T){"use strict";function R(r){var i=r.center;d=t.multiplyByScalar(r.ellipsoid.geodeticSurfaceNormal(i,d),r.height,d),d=t.add(i,d,d);for(var a=new e(d,r.semiMajorAxis),u=o.computeEllipsePositions(r,!1,!0).outerPositions,s=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(u,r,!1)})}),l=u.length/3,T=_.createTypedArray(l,2*l),R=0,f=0;f<l;++f)T[R++]=f,T[R++]=(f+1)%l;return{boundingSphere:a,attributes:s,indices:T}}function f(i){var a=i.center,u=i.ellipsoid,s=i.semiMajorAxis,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,A),i.height,A);N.center=t.add(a,T,N.center),N.radius=s,T=t.multiplyByScalar(u.geodeticSurfaceNormal(a,T),i.extrudedHeight,T),I.center=t.add(a,T,I.center),I.radius=s;var R=o.computeEllipsePositions(i,!1,!0).outerPositions,f=new c({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:o.raisePositionsToHeight(R,i,!0)})});R=f.position.values;var h=e.union(N,I),d=R.length/3,S=r(i.numberOfVerticalLines,16);S=l.clamp(S,0,d/2);var M=_.createTypedArray(d,2*d+2*S);d/=2;var y,m=0;for(y=0;y<d;++y)M[m++]=y,M[m++]=(y+1)%d,M[m++]=y+d,M[m++]=(y+1)%d+d;var O;if(S>0){var p=Math.min(S,d);O=Math.round(d/p);var C=Math.min(O*S,d);for(y=0;y<C;y+=O)M[m++]=y,M[m++]=y+d}return{boundingSphere:h,attributes:f,indices:M}}function h(e){e=r(e,r.EMPTY_OBJECT);var n=e.center,a=r(e.ellipsoid,u.WGS84),o=e.semiMajorAxis,s=e.semiMinorAxis,E=r(e.granularity,l.RADIANS_PER_DEGREE),c=r(e.height,0),_=e.extrudedHeight,T=i(_)&&Math.abs(c-_)>1;this._center=t.clone(n),this._semiMajorAxis=o,this._semiMinorAxis=s,this._ellipsoid=u.clone(a), +this._rotation=r(e.rotation,0),this._height=c,this._granularity=E,this._extrudedHeight=_,this._extrude=T,this._numberOfVerticalLines=Math.max(r(e.numberOfVerticalLines,16),0),this._workerName="createEllipseOutlineGeometry"}var A=new t,d=new t,N=new e,I=new e;h.packedLength=t.packedLength+u.packedLength+9,h.pack=function(e,n,a){return a=r(a,0),t.pack(e._center,n,a),a+=t.packedLength,u.pack(e._ellipsoid,n,a),a+=u.packedLength,n[a++]=e._semiMajorAxis,n[a++]=e._semiMinorAxis,n[a++]=e._rotation,n[a++]=e._height,n[a++]=e._granularity,n[a++]=i(e._extrudedHeight)?1:0,n[a++]=r(e._extrudedHeight,0),n[a++]=e._extrude?1:0,n[a]=e._numberOfVerticalLines,n};var S=new t,M=new u,y={center:S,ellipsoid:M,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0};return h.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,S);n+=t.packedLength;var s=u.unpack(e,n,M);n+=u.packedLength;var E=e[n++],c=e[n++],_=e[n++],l=e[n++],T=e[n++],R=e[n++],f=e[n++],A=1===e[n++],d=e[n];return i(a)?(a._center=t.clone(o,a._center),a._ellipsoid=u.clone(s,a._ellipsoid),a._semiMajorAxis=E,a._semiMinorAxis=c,a._rotation=_,a._height=l,a._granularity=T,a._extrudedHeight=R?f:void 0,a._extrude=A,a._numberOfVerticalLines=d,a):(y.height=l,y.extrudedHeight=R?f:void 0,y.granularity=T,y.rotation=_,y.semiMajorAxis=E,y.semiMinorAxis=c,y.numberOfVerticalLines=d,new h(y))},h.createGeometry=function(e){if(!(e._semiMajorAxis<=0||e._semiMinorAxis<=0)){e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);var t,n={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:e._height,extrudedHeight:e._extrudedHeight,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines};return e._extrude?(n.extrudedHeight=Math.min(e._extrudedHeight,e._height),n.height=Math.max(e._extrudedHeight,e._height),t=f(n)):t=R(n),new s({attributes:t.attributes,indices:t.indices,primitiveType:T.LINES,boundingSphere:t.boundingSphere})}},h}),define("Workers/createEllipseOutlineGeometry",["../Core/Cartesian3","../Core/defined","../Core/EllipseOutlineGeometry","../Core/Ellipsoid"],function(e,t,n,r){"use strict";function i(i,a){return t(a)&&(i=n.unpack(i,a)),i._center=e.clone(i._center),i._ellipsoid=r.clone(i._ellipsoid),n.createGeometry(i)}return i})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createEllipsoidGeometry.js b/engines/Cesium/Workers/createEllipsoidGeometry.js index 66127cf..344ea67 100644 --- a/engines/Cesium/Workers/createEllipsoidGeometry.js +++ b/engines/Cesium/Workers/createEllipsoidGeometry.js @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(r,a){if(!t(a))throw new e(n(r))},a.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},a.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},a.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},a.typeOf.number.lessThan=function(t,n,r){if(a.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(t,n,r){if(a.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},a.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*a.clamp(t,-1,1)+.5)*n)},a.fromSNorm=function(t,n){return n=e(n,255),a.clamp(t,0,n)/n*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},a.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},a.lerp=function(t,e,n){return(1-n)*t+n*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,n,r,a){a=e(a,r);var i=Math.abs(t-n);return i<=a||i<=r*Math.max(Math.abs(t),Math.abs(n))};var i=[1];a.factorial=function(t){var e=i.length;if(t>=e)for(var n=i[e-1],r=e;r<=t;r++)i.push(n*r);return i[t]},a.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return a.setRandomNumberSeed=function(e){o=new t(e)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var a=t.clock,i=t.cone,u=e(t.magnitude,1),E=u*Math.sin(i);return r.x=E*Math.cos(a),r.y=E*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(t,e,r,a){return n(a)?(a.x=t,a.y=e,a.z=r,a):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var a=0;a<r;++a)o.pack(t[a],e,3*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)},o.cross=function(t,e,n){var r=t.x,a=t.y,i=t.z,o=e.x,u=e.y,E=e.z,s=a*E-i*u,c=i*o-r*E,_=r*u-a*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,a){return t=i.toRadians(t),e=i.toRadians(e),o.fromRadians(t,e,n,r,a)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,a,i,u){a=e(a,0);var E=n(i)?i.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,a,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function a(n,a,u,E,s){var c=n.x,_=n.y,T=n.z,R=a.x,l=a.y,f=a.z,A=c*c*R*R,h=_*_*l*l,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,i);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,P,F,g,w,v,x,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*M),L=1/(1+B*O),P=1/(1+B*m),F=U*U,g=L*L,w=P*P,v=F*U,x=g*L,D=w*P,p=A*F+h*g+N*w-1,C=A*v*M+h*x*O+N*D*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*P,s):new t(c*U,_*L,T*P)}var i=new t,o=new t;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,a,i){return a=e(a,0),n(i)?(i.longitude=t,i.latitude=r,i.height=a,i):new u(t,r,a)},u.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=i.EPSILON1;return u.fromCartesian=function(e,r,a){var l=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:T,A=n(r)?r._centerToleranceSquared:R,h=o(e,l,f,A,s);if(n(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=i.sign(t.dot(d,e))*t.magnitude(d);return n(a)?(a.longitude=I,a.latitude=S,a.height=M,a):new u(I,S,M)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o,u,E){"use strict";function s(e,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),e._radii=new t(r,a,i),e._radiiSquared=new t(r*r,a*a,i*i),e._radiiToTheFourth=new t(r*r*r*r,a*a*a*a,i*i*i*i),e._oneOverRadii=new t(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),e._minimumRadius=Math.min(r,a,i),e._maximumRadius=Math.max(r,a,i),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}a(c.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}}}),c.clone=function(e,n){if(r(e)){var a=e._radii;return r(n)?(t.clone(a,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(a.x,a.y,a.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,a){return a=n(a,0),t.pack(e._radii,r,a),r},c.unpack=function(e,r,a){r=n(r,0);var i=t.unpack(e,r);return c.fromCartesian3(i,a)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var a=e.longitude,i=e.latitude,o=Math.cos(i),u=o*Math.cos(a),E=o*Math.sin(a),s=Math.sin(i);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var a=_,i=T;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(t.dot(a,i));return t.divideByScalar(i,o,i),t.multiplyByScalar(a,e.height,a),r(n)||(n=new t),t.add(i,a,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var R=new t,l=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,l);if(r(i)){var o=this.geodeticSurfaceNormal(i,R),E=t.subtract(n,i,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(a)?(a.longitude=s,a.latitude=c,a.height=_,a):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var a=e.x,i=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new t),i.x=0,i.y=0,i.z=e.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,a,i,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var a=this._semimajorAxis,i=e.longitude*a,o=e.latitude*a,u=e.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new t(i,o,u)},u.prototype.unproject=function(t,n){var a=this._oneOverSemimajorAxis,i=t.x*a,o=t.y*a,u=t.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new e(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a,i,o,u,E,s){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(i,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(f[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(t[E.getElementIndex(f[i],l[i])]);o>r&&(a=i,r=o)}var s=1,c=0,_=l[a],T=f[a];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,A=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(A-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,a=t.x*t.y,i=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,f=2*(a-T),A=2*(i+c),h=2*(a+T),N=-n+u-_+R,d=2*(s-o),I=2*(i-c),S=2*(s+o),M=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=M,e):new E(l,f,A,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),a=Math.cos(-t.heading),i=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*a,_=-i*u+s*o*a,T=s*u+i*o*a,R=n*u,l=i*a+s*o*u,f=-o*i+i*o*u,A=-o,h=s*n,N=i*n;return r(e)?(e[0]=c,e[1]=R,e[2]=A,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new E(c,_,T,R,l,f,A,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=a,e[6]=0,e[7]=-a,e[8]=n,e):new E(1,0,0,0,n,-a,0,a,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=n,e):new E(n,0,a,0,1,0,-a,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=a,e[2]=0,e[3]=-a,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-a,0,a,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,a=t[r],i=t[r+1],o=t[r+2];return n.x=a,n.y=i,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var a=3*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],a=t[e+3],i=t[e+6];return n.x=r,n.y=a,n.z=i,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],i=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[3]*a+t[6]*i,u=t[1]*r+t[4]*a+t[7]*i,E=t[2]*r+t[5]*a+t[8]*i;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],a=t[6],i=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],f=[2,2,1],A=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,a=10,i=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<a&&c(R)>l;)_(R,A),E.transpose(A,h),E.multiply(R,A,R),E.multiply(h,R,R),E.multiply(T,A,T),++i>2&&(++o,i=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],a=t[1],i=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(i*s-E*o)+a*(E*r-n*s)+u*(n*o-i*r)},E.inverse=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*a-r*_,e[2]=r*u-o*a,e[3]=s*u-i*_,e[4]=n*_-s*a,e[5]=i*a-n*u,e[6]=i*c-s*o,e[7]=s*r-n*c,e[8]=n*o-i*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,a(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}o.fromElements=function(t,e,r,a,i){return n(i)?(i.x=t,i.y=e,i.z=r,i.w=a,i):new o(t,e,r,a)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r++],a.w=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var a=0;a<r;++a)o.pack(t[a],e,4*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)&&i.equalsEpsilon(t.w,e.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,a,i,o,u,E,s){ -"use strict";function c(t,e,n,a,i,o,u,E,s,c,_,T,R,l,f,A){this[0]=r(t,0),this[1]=r(i,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(a,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(A,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),a(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(a(t))return a(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,i){return n=r(n,t.ZERO),a(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){a(r)||(r=new c);var i=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-A+N,I=2*(s-h),S=2*(_+f),M=2*(s+h),O=-E+R-A+N,m=2*(l-T),y=2*(_-f),p=2*(l+T),C=-E-R+A+N;return r[0]=d*i,r[1]=M*i,r[2]=y*i,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var r=e.position,i=e.direction,o=e.up;t.normalize(i,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,f=_.y,A=_.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=l*I+f*S+A*M;return a(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,d,m,-l,-f,-A,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,a){var i=Math.tan(.5*t),o=1/i,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=-1,a[12]=0,a[13]=0,a[14]=s,a[15]=0,a},c.computeOrthographicOffCenter=function(t,e,n,r,a,i,o){var u=1/(e-t),E=1/(r-n),s=1/(i-a),c=-(e+t)*u,_=-(r+n)*E,T=-(i+a)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,a,i,o){var u=2*a/(e-t),E=2*a/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(i+a)/(i-a),T=-1,R=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,a,i){var o=2*a/(e-t),u=2*a/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=E,i[9]=s,i[10]=c,i[11]=_,i[12]=0,i[13]=0,i[14]=T,i[15]=0,i},c.computeViewportTransformation=function(t,e,n,a){t=r(t,r.EMPTY_OBJECT);var i=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,f=i+s,A=o+c,h=e+_,N=1;return a[0]=T,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=R,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=l,a[11]=0,a[12]=f,a[13]=A,a[14]=h,a[15]=N,a},c.computeView=function(e,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-t.dot(a,e),i[13]=-t.dot(r,e),i[14]=t.dot(n,e),i[15]=1,i},c.toArray=function(t,e){return a(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,a=t[r],i=t[r+1],o=t[r+2],u=t[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var a=4*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],a=t[e+4],i=t[e+8],o=t[e+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var f=new t;c.getMaximumScale=function(e){return c.getScale(e,f),t.maximumComponent(f)},c.multiply=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],M=e[3],O=e[4],m=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],P=e[11],F=e[12],g=e[13],w=e[14],v=e[15],x=r*d+u*I+_*S+f*M,D=a*d+E*I+T*S+A*M,B=i*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+f*p,b=a*O+E*m+T*y+A*p,X=i*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,q=r*C+u*U+_*L+f*P,H=a*C+E*U+T*L+A*P,W=i*C+s*U+R*L+h*P,Y=o*C+c*U+l*L+N*P,k=r*F+u*g+_*w+f*v,K=a*F+E*g+T*w+A*v,Z=i*F+s*g+R*w+h*v,j=o*F+c*g+l*w+N*v;return n[0]=x,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],M=e[9],O=e[10],m=e[12],y=e[13],p=e[14],C=r*f+o*A+s*h,U=a*f+u*A+c*h,L=i*f+E*A+_*h,P=r*N+o*d+s*I,F=a*N+u*d+c*I,g=i*N+E*d+_*I,w=r*S+o*M+s*O,v=a*S+u*M+c*O,x=i*S+E*M+_*O,D=r*m+o*y+s*p+T,B=a*m+u*y+c*p+R,z=i*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=P,n[5]=F,n[6]=g,n[7]=0,n[8]=w,n[9]=v,n[10]=x,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,M=a*T+u*R+c*l,O=i*T+E*R+_*l,m=r*f+o*A+s*h,y=a*f+u*A+c*h,p=i*f+E*A+_*h,C=r*N+o*d+s*I,U=a*N+u*d+c*I,L=i*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=r*t[0]+a*t[4]+i*t[8]+t[12],u=r*t[1]+a*t[5]+i*t[9]+t[13],E=r*t[2]+a*t[6]+i*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var A=new t;c.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,c.multiplyByScale(t,A,n)},c.multiplyByScale=function(t,e,n){var r=e.x,a=e.y,i=e.z;return 1===r&&1===a&&1===i?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=a*t[4],n[5]=a*t[5],n[6]=a*t[6],n[7]=0,n[8]=i*t[8],n[9]=i*t[9],n[10]=i*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t[0]*r+t[4]*a+t[8]*i+t[12]*o,E=t[1]*r+t[5]*a+t[9]*i+t[13]*o,s=t[2]*r+t[6]*a+t[10]*i+t[14]*o,c=t[3]*r+t[7]*a+t[11]*i+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i,u=t[1]*r+t[5]*a+t[9]*i,E=t[2]*r+t[6]*a+t[10]*i;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i+t[12],u=t[1]*r+t[5]*a+t[9]*i+t[13],E=t[2]*r+t[6]*a+t[10]*i+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],a=t[3],i=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=i,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],a=t[4],i=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],f=t[2],A=t[6],S=t[10],M=t[14],O=t[3],m=t[7],y=t[11],p=t[15],C=S*p,U=M*y,L=A*p,P=M*m,F=A*y,g=S*m,w=f*p,v=M*O,x=f*y,D=S*O,B=f*m,z=A*O,G=C*T+P*R+F*l-(U*T+L*R+g*l),b=U*_+w*R+D*l-(C*_+v*R+x*l),X=L*_+v*T+B*l-(P*_+w*T+z*l),V=g*_+x*T+z*R-(F*_+D*T+B*R),q=U*a+L*i+g*o-(C*a+P*i+F*o),H=C*r+v*i+x*o-(U*r+w*i+D*o),W=P*r+w*a+z*o-(L*r+v*a+B*o),Y=F*r+D*a+B*i-(g*r+x*a+z*i);C=i*l,U=o*R,L=a*l,P=o*T,F=a*R,g=i*T,w=r*l,v=o*_,x=r*R,D=i*_,B=r*T,z=a*_;var k=C*m+P*y+F*p-(U*m+L*y+g*p),K=U*O+w*y+D*p-(C*O+v*y+x*p),Z=L*O+v*m+B*p-(P*O+w*m+z*p),j=g*O+x*m+z*y-(F*O+D*m+B*y),Q=L*S+g*M+U*A-(F*M+C*A+P*S),J=x*M+C*f+v*S-(w*S+D*M+U*f),$=w*A+z*M+P*f-(B*M+L*f+v*A),tt=B*S+F*f+D*A-(x*A+z*S+g*f),et=r*G+a*b+i*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-a*R,f=-i*_-o*T-u*R,A=-E*_-s*T-c*R;return e[0]=n,e[1]=i,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=a,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=f,e[14]=A,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(a,0)}a(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,a,i,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=t,o.south=e,o.east=a,o.north=i,o):new E(t,e,a,i)},E.fromRadians=function(t,e,a,i,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(a,0),o.north=n(i,0),o):new E(t,e,a,i)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),a=Math.max(a,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;i=Math.min(i,l),o=Math.max(o,l)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=a,e.north=c,e):new E(n,s,a,c)},E.fromCartesianArray=function(t,e,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);a=Math.min(a,l.longitude),i=Math.max(i,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var f=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return i-a>s-o&&(a=o,i=s,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=c,n.east=i,n.north=_,n):new E(a,c,i,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var a=e.east,i=e.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var a=t.east,i=t.west,o=e.east,s=e.west;a<i&&o>0?a+=u.TWO_PI:o<s&&a>0&&(o+=u.TWO_PI),a<i&&s<0?s+=u.TWO_PI:o<s&&i<0&&(i+=u.TWO_PI);var c=u.negativePiToPi(Math.max(i,s)),_=u.negativePiToPi(Math.min(a,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,n){var a=Math.max(t.west,e.west),i=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new E(a,i,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var a=t.east,i=t.west,o=e.east,s=e.west;a<i&&o>0?a+=u.TWO_PI:o<s&&a>0&&(o+=u.TWO_PI),a<i&&s<0?s+=u.TWO_PI:o<s&&i<0&&(i+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(i,s)),_=u.convertLongitudeRange(Math.max(a,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,a=t.west,i=t.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,a,o){e=n(e,i.WGS84),a=n(a,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,f=s;f.height=a,f.longitude=l,f.latitude=_,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.latitude=T,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=e.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,a,i,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,M=new t,O=new t,m=new t;T.fromPoints=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),i=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,f),E=t.clone(r,A),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<i.x&&t.clone(r,i),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,i,I)),P=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),g=i,w=E,v=L;P>v&&(v=P,g=o,w=s),F>v&&(v=F,g=u,w=c);var x=S;x.x=.5*(g.x+w.x),x.y=.5*(g.y+w.y),x.z=.5*(g.z+w.z);var D=t.magnitudeSquared(t.subtract(w,x,I)),B=Math.sqrt(D),z=M;z.x=i.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*r.x)/H,x.y=(B*x.y+W*r.y)/H,x.z=(B*x.z+W*r.z)/H}}return B<X?(t.clone(x,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,i,o,u){if(a(u)||(u=new T),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=i,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*R,f.z=E.z+.5*l,u};var P=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,i.WGS84),n=r(n,0);var u;return a(t)&&(u=_.subsample(t,e,n,P)),T.fromPoints(u,o)},T.fromVertices=function(e,n,i,o){if(a(o)||(o=new T),!a(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),i=r(i,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,f),_=t.clone(u,A),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=i){var L=e[U]+n.x,P=e[U+1]+n.y,F=e[U+2]+n.z;u.x=L,u.y=P,u.z=F,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),P<s.y&&t.clone(u,s),P>y.y&&t.clone(u,y),F<c.z&&t.clone(u,c),F>p.z&&t.clone(u,p)}var g=t.magnitudeSquared(t.subtract(_,E,I)),w=t.magnitudeSquared(t.subtract(y,s,I)),v=t.magnitudeSquared(t.subtract(p,c,I)),x=E,D=_,B=g;w>B&&(B=w,x=s,D=y),v>B&&(B=v,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,m),H=0;for(U=0;U<C;U+=i){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(a(r)||(r=new T),!a(e)||!a(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var i=d;i.x=e[0]+n[0],i.y=e[1]+n[1],i.z=e[2]+n[2];for(var o=t.clone(i,R),u=t.clone(i,l),E=t.clone(i,f),s=t.clone(i,A),c=t.clone(i,h),_=t.clone(i,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];i.x=C,i.y=U,i.z=L,C<o.x&&t.clone(i,o),C>s.x&&t.clone(i,s),U<u.y&&t.clone(i,u),U>c.y&&t.clone(i,c),L<E.z&&t.clone(i,E),L>_.z&&t.clone(i,_)}var P=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),g=t.magnitudeSquared(t.subtract(_,E,I)),w=o,v=s,x=P;F>x&&(x=F,w=u,v=c),g>x&&(x=g,w=E,v=_);var D=S;D.x=.5*(w.x+v.x),D.y=.5*(w.y+v.y),D.z=.5*(w.z+v.z);var B=t.magnitudeSquared(t.subtract(v,D,I)),z=Math.sqrt(B),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){i.x=e[p]+n[p],i.y=e[p+1]+n[p+1],i.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(i,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(i,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*i.x)/W,D.y=(z*D.y+Y*i.y)/W,D.z=(z*D.z+Y*i.z)/W}}return z<V?(t.clone(D,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){a(r)||(r=new T);var i=r.center;return t.add(e,n,i),t.multiplyByScalar(i,.5,i),r.radius=t.distance(i,n),r},T.fromEllipsoid=function(e,n){return a(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var F=new t;T.fromBoundingSpheres=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var i=[],o=0;o<r;o++)i.push(e[o].center);n=T.fromPoints(i,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var g=new t,w=new t,v=new t;T.fromOrientedBoundingBox=function(e,n){a(n)||(n=new T);var r=e.halfAxes,i=s.getColumn(r,0,g),o=s.getColumn(r,1,w),u=s.getColumn(r,2,v),E=t.magnitude(i),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(a(e))return a(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var a=t.center;return e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),a(n)||(n=new T);var i=n.center;return i.x=t[e++],i.y=t[e++],i.z=t[e++],n.radius=t[e],n};var x=new t,D=new t;T.union=function(e,n,r){a(r)||(r=new T);var i=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,i,x),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(R,i,R),t.clone(R,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var a=t.magnitude(t.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},T.intersectPlane=function(e,n){var r=e.center,a=e.radius,i=n.normal,o=t.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,i){a(i)||(i=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return i.start=u-e.radius,i.stop=u+e.radius,i};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,a){n=r(n,K);var i=n.ellipsoid,o=e.center,u=e.radius,E=i.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),R=t.negate(s,q),l=Y,f=l[0];t.add(E,c,f),t.add(f,s,f),f=l[1],t.add(E,c,f),t.add(f,R,f),f=l[2],t.add(E,_,f),t.add(f,R,f),f=l[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=l[4],t.add(E,c,f),t.add(f,s,f),f=l[5],t.add(E,c,f),t.add(f,R,f),f=l[6],t.add(E,_,f),t.add(f,R,f),f=l[7],t.add(E,_,f),t.add(f,s,f);for(var A=l.length,h=0;h<A;++h){var N=l[h];t.add(o,N,N);var d=i.cartesianToCartographic(N,W);n.project(d,N)}a=T.fromPoints(l,a),o=a.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,a},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||a(e)&&a(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n){this.x=e(t,0),this.y=e(n,0)}o.fromElements=function(t,e,r){return n(r)?(r.x=t,r.y=e,r):new o(t,e)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e):new o(t.x,t.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=2*r:e=new Array(2*r);for(var a=0;a<r;++a)o.pack(t[a],e,2*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/2:e=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y)},o.minimumComponent=function(t){return Math.min(t.x,t.y)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){return o.normalize(t,s),o.normalize(e,c),i.acosClamped(o.dot(s,c))};var _=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Y,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]; -}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var E=i[o];a=E+"RequestFullscreen","function"==typeof e[a]?(r.requestFullscreen=a,n=!0):(a=E+"RequestFullScreen","function"==typeof e[a]&&(r.requestFullscreen=a,n=!0)),a=E+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=E+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=E+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=E+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=E+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=E+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=E+"fullscreenchange",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=E+"fullscreenerror",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function a(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,M=r(t[1]))}return S}function i(){return a()&&M}function o(){if(!e(O)&&(O=!1,!a()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(O=!0,m=r(t[1]))}return O}function u(){return o()&&m}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,P=r(t[1]))}return L}function R(){return T()&&P}function l(){if(!e(F)){F=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(F=!0,g=r(t[1]))}return F}function f(){return e(w)||(w=/Windows/i.test(I.appVersion)),w}function A(){return l()&&g}function h(){return e(v)||(v="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),v}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(x=n)}return D}function d(){return N()?x:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,P,F,g,w,v,x,D,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,a){switch(r=t(r,0),a=t(a,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,a){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return i.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var a=t.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(t){switch(t){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},i.createTypedArrayFromArrayBuffer=function(t,e,n,a){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,a):new Uint16Array(e,n,a)},n(i)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.tangent?1:0,n[r++]=e.bitangent?1:0,n[r++]=e.color?1:0,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(t,n){if(e(t))return e(n)||(n=new a),n.position=t.position,n.normal=t.normal,n.st=t.st,n.tangent=t.tangent,n.bitangent=t.bitangent,n.color=t.color,n},a}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,a,i,o,u,E,s,c,_,T,R,l){"use strict";function f(t){t=a(t,a.EMPTY_OBJECT);var e=a(t.radii,S),r=a(t.stackPartitions,64),i=a(t.slicePartitions,64),o=a(t.vertexFormat,l.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=i,this._vertexFormat=l.clone(o),this._workerName="createEllipsoidGeometry"}var A=new n,h=new n,N=new n,d=new n,I=new n,S=new n(1,1,1),M=Math.cos,O=Math.sin;f.packedLength=n.packedLength+l.packedLength+2,f.pack=function(t,e,r){return r=a(r,0),n.pack(t._radii,e,r),r+=n.packedLength,l.pack(t._vertexFormat,e,r),r+=l.packedLength,e[r++]=t._stackPartitions,e[r]=t._slicePartitions,e};var m=new n,y=new l,p={radii:m,vertexFormat:y,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(t,e,r){e=a(e,0);var o=n.unpack(t,e,m);e+=n.packedLength;var u=l.unpack(t,e,y);e+=l.packedLength;var E=t[e++],s=t[e];return i(r)?(r._radii=n.clone(o,r._radii),r._vertexFormat=l.clone(u,r._vertexFormat),r._stackPartitions=E,r._slicePartitions=s,r):(p.stackPartitions=E,p.slicePartitions=s,new f(p))},f.createGeometry=function(a){var i=a._radii;if(!(i.x<=0||i.y<=0||i.z<=0)){var o,l,f=u.fromCartesian3(i),S=a._vertexFormat,m=a._slicePartitions+1,y=a._stackPartitions+1,p=y*m,C=new Float64Array(3*p),U=6*(m-1)*(y-2),L=_.createTypedArray(p,U),P=S.normal?new Float32Array(3*p):void 0,F=S.tangent?new Float32Array(3*p):void 0,g=S.bitangent?new Float32Array(3*p):void 0,w=S.st?new Float32Array(2*p):void 0,v=new Array(m),x=new Array(m),D=0;for(o=0;o<m;o++){var B=T.TWO_PI*o/(m-1);v[o]=M(B),x[o]=O(B),C[D++]=0,C[D++]=0,C[D++]=i.z}for(o=1;o<y-1;o++){var z=Math.PI*o/(y-1),G=O(z),b=i.x*G,X=i.y*G,V=i.z*M(z);for(l=0;l<m;l++)C[D++]=v[l]*b,C[D++]=x[l]*X,C[D++]=V}for(o=0;o<m;o++)C[D++]=0,C[D++]=0,C[D++]=-i.z;var q=new c;S.position&&(q.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:C}));var H=0,W=0,Y=0,k=0;if(S.st||S.normal||S.tangent||S.bitangent){for(o=0;o<p;o++){var K=n.fromArray(C,3*o,A),Z=f.geodeticSurfaceNormal(K,h);if(S.st){var j=e.negate(Z,I);e.magnitude(j)<T.EPSILON6&&(D=3*(o+m*Math.floor(.5*y)),D>C.length&&(D=3*(o-m*Math.floor(.5*y))),n.fromArray(C,D,j),f.geodeticSurfaceNormal(j,j),e.negate(j,j)),w[H++]=Math.atan2(j.y,j.x)/T.TWO_PI+.5,w[H++]=Math.asin(Z.z)/Math.PI+.5}if(S.normal&&(P[W++]=Z.x,P[W++]=Z.y,P[W++]=Z.z),S.tangent||S.bitangent){var Q=N;if(o<m||o>p-m-1?(n.cross(n.UNIT_X,Z,Q),n.normalize(Q,Q)):(n.cross(n.UNIT_Z,Z,Q),n.normalize(Q,Q)),S.tangent&&(F[Y++]=Q.x,F[Y++]=Q.y,F[Y++]=Q.z),S.bitangent){var J=n.cross(Z,Q,d);n.normalize(J,J),g[k++]=J.x,g[k++]=J.y,g[k++]=J.z}}}S.st&&(q.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:w})),S.normal&&(q.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),S.tangent&&(q.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),S.bitangent&&(q.bitangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:g}))}for(D=0,l=0;l<m-1;l++)L[D++]=m+l,L[D++]=m+l+1,L[D++]=l+1;var $,tt;for(o=1;o<y-2;o++)for($=o*m,tt=(o+1)*m,l=0;l<m-1;l++)L[D++]=tt+l,L[D++]=tt+l+1,L[D++]=$+l+1,L[D++]=tt+l,L[D++]=$+l+1,L[D++]=$+l;for(o=y-2,$=o*m,tt=(o+1)*m,l=0;l<m-1;l++)L[D++]=tt+l,L[D++]=$+l+1,L[D++]=$+l;return new E({attributes:q,indices:L,primitiveType:R.TRIANGLES,boundingSphere:t.fromEllipsoid(f)})}},f}),define("Workers/createEllipsoidGeometry",["../Core/defined","../Core/EllipsoidGeometry"],function(t,e){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(r,a){if(!t(a))throw new e(n(r))},a.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},a.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},a.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},a.typeOf.number.lessThan=function(t,n,r){if(a.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(t,n,r){if(a.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},a.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*a.clamp(t,-1,1)+.5)*n)},a.fromSNorm=function(t,n){return n=e(n,255),a.clamp(t,0,n)/n*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},a.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},a.lerp=function(t,e,n){return(1-n)*t+n*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,n,r,a){a=e(a,r);var i=Math.abs(t-n);return i<=a||i<=r*Math.max(Math.abs(t),Math.abs(n))};var i=[1];a.factorial=function(t){var e=i.length;if(t>=e)for(var n=i[e-1],r=e;r<=t;r++)i.push(n*r);return i[t]},a.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return a.setRandomNumberSeed=function(e){o=new t(e)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var a=t.clock,i=t.cone,u=e(t.magnitude,1),E=u*Math.sin(i);return r.x=E*Math.cos(a),r.y=E*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(t,e,r,a){return n(a)?(a.x=t,a.y=e,a.z=r,a):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var a=0;a<r;++a)o.pack(t[a],e,3*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)},o.cross=function(t,e,n){var r=t.x,a=t.y,i=t.z,o=e.x,u=e.y,E=e.z,s=a*E-i*u,c=i*o-r*E,_=r*u-a*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,a){return t=i.toRadians(t),e=i.toRadians(e),o.fromRadians(t,e,n,r,a)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,a,i,u){a=e(a,0);var E=n(i)?i.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,a,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function a(n,a,u,E,s){var c=n.x,_=n.y,T=n.z,R=a.x,l=a.y,f=a.z,A=c*c*R*R,h=_*_*l*l,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,i);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,P,F,g,w,v,x,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*M),L=1/(1+B*O),P=1/(1+B*m),F=U*U,g=L*L,w=P*P,v=F*U,x=g*L,D=w*P,p=A*F+h*g+N*w-1,C=A*v*M+h*x*O+N*D*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*L,s.z=T*P,s):new t(c*U,_*L,T*P)}var i=new t,o=new t;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o){"use strict";function u(t,e,r){this.longitude=n(t,0),this.latitude=n(e,0),this.height=n(r,0)}u.fromRadians=function(t,e,a,i){return a=n(a,0),r(i)?(i.longitude=t,i.latitude=e,i.height=a,i):new u(t,e,a)},u.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=i.EPSILON1;return u.fromCartesian=function(e,n,a){var l=r(n)?n.oneOverRadii:_,f=r(n)?n.oneOverRadiiSquared:T,A=r(n)?n._centerToleranceSquared:R,h=o(e,l,f,A,s);if(r(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=i.sign(t.dot(d,e))*t.magnitude(d);return r(a)?(a.longitude=I,a.latitude=S,a.height=M,a):new u(I,S,M)}},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o,u,E){"use strict";function s(e,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),e._radii=new t(r,a,i),e._radiiSquared=new t(r*r,a*a,i*i),e._radiiToTheFourth=new t(r*r*r*r,a*a*a*a,i*i*i*i),e._oneOverRadii=new t(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),e._minimumRadius=Math.min(r,a,i),e._maximumRadius=Math.max(r,a,i),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}a(c.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}}}),c.clone=function(e,n){if(r(e)){var a=e._radii;return r(n)?(t.clone(a,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(a.x,a.y,a.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,a){return a=n(a,0),t.pack(e._radii,r,a),r},c.unpack=function(e,r,a){r=n(r,0);var i=t.unpack(e,r);return c.fromCartesian3(i,a)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var a=e.longitude,i=e.latitude,o=Math.cos(i),u=o*Math.cos(a),E=o*Math.sin(a),s=Math.sin(i);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var a=_,i=T;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(t.dot(a,i));return t.divideByScalar(i,o,i),t.multiplyByScalar(a,e.height,a),r(n)||(n=new t),t.add(i,a,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var R=new t,l=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,l);if(r(i)){var o=this.geodeticSurfaceNormal(i,R),E=t.subtract(n,i,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(a)?(a.longitude=s,a.latitude=c,a.height=_,a):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var a=e.x,i=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new t),i.x=0,i.y=0,i.z=e.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,a,i,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var a=this._semimajorAxis,i=e.longitude*a,o=e.latitude*a,u=e.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new t(i,o,u)},u.prototype.unproject=function(t,n){var a=this._oneOverSemimajorAxis,i=t.x*a,o=t.y*a,u=t.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new e(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a,i,o,u,E,s){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(i,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(f[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(t[E.getElementIndex(f[i],l[i])]);o>r&&(a=i,r=o)}var s=1,c=0,_=l[a],T=f[a];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,A=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(A-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,a=t.x*t.y,i=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,f=2*(a-T),A=2*(i+c),h=2*(a+T),N=-n+u-_+R,d=2*(s-o),I=2*(i-c),S=2*(s+o),M=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=M,e):new E(l,f,A,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),a=Math.cos(-t.heading),i=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*a,_=-i*u+s*o*a,T=s*u+i*o*a,R=n*u,l=i*a+s*o*u,f=-s*a+i*o*u,A=-o,h=s*n,N=i*n;return r(e)?(e[0]=c,e[1]=R,e[2]=A,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new E(c,_,T,R,l,f,A,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=a,e[6]=0,e[7]=-a,e[8]=n,e):new E(1,0,0,0,n,-a,0,a,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=n,e):new E(n,0,a,0,1,0,-a,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=a,e[2]=0,e[3]=-a,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-a,0,a,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,a=t[r],i=t[r+1],o=t[r+2];return n.x=a,n.y=i,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var a=3*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],a=t[e+3],i=t[e+6];return n.x=r,n.y=a,n.z=i,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],i=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[3]*a+t[6]*i,u=t[1]*r+t[4]*a+t[7]*i,E=t[2]*r+t[5]*a+t[8]*i;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],a=t[6],i=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],f=[2,2,1],A=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,a=10,i=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<a&&c(R)>l;)_(R,A),E.transpose(A,h),E.multiply(R,A,R),E.multiply(h,R,R),E.multiply(T,A,T),++i>2&&(++o,i=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],a=t[1],i=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(i*s-E*o)+a*(E*r-n*s)+u*(n*o-i*r)},E.inverse=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*a-r*_,e[2]=r*u-o*a,e[3]=s*u-i*_,e[4]=n*_-s*a,e[5]=i*a-n*u,e[6]=i*c-s*o,e[7]=s*r-n*c,e[8]=n*o-i*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,a(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}o.fromElements=function(t,e,r,a,i){return n(i)?(i.x=t,i.y=e,i.z=r,i.w=a,i):new o(t,e,r,a)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r++],a.w=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var a=0;a<r;++a)o.pack(t[a],e,4*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)&&i.equalsEpsilon(t.w,e.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,a,i,o,u,E,s){ +"use strict";function c(t,e,n,a,i,o,u,E,s,c,_,T,R,l,f,A){this[0]=r(t,0),this[1]=r(i,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(a,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(A,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),a(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(a(t))return a(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,i){return n=r(n,t.ZERO),a(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){a(r)||(r=new c);var i=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-A+N,I=2*(s-h),S=2*(_+f),M=2*(s+h),O=-E+R-A+N,m=2*(l-T),y=2*(_-f),p=2*(l+T),C=-E-R+A+N;return r[0]=d*i,r[1]=M*i,r[2]=y*i,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var r=e.position,i=e.direction,o=e.up;t.normalize(i,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,f=_.y,A=_.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=l*I+f*S+A*M;return a(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,d,m,-l,-f,-A,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,a){var i=Math.tan(.5*t),o=1/i,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=-1,a[12]=0,a[13]=0,a[14]=s,a[15]=0,a},c.computeOrthographicOffCenter=function(t,e,n,r,a,i,o){var u=1/(e-t),E=1/(r-n),s=1/(i-a),c=-(e+t)*u,_=-(r+n)*E,T=-(i+a)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,a,i,o){var u=2*a/(e-t),E=2*a/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(i+a)/(i-a),T=-1,R=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,a,i){var o=2*a/(e-t),u=2*a/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=E,i[9]=s,i[10]=c,i[11]=_,i[12]=0,i[13]=0,i[14]=T,i[15]=0,i},c.computeViewportTransformation=function(t,e,n,a){t=r(t,r.EMPTY_OBJECT);var i=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,f=i+s,A=o+c,h=e+_,N=1;return a[0]=T,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=R,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=l,a[11]=0,a[12]=f,a[13]=A,a[14]=h,a[15]=N,a},c.computeView=function(e,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-t.dot(a,e),i[13]=-t.dot(r,e),i[14]=t.dot(n,e),i[15]=1,i},c.toArray=function(t,e){return a(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,a=t[r],i=t[r+1],o=t[r+2],u=t[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var a=4*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],a=t[e+4],i=t[e+8],o=t[e+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var f=new t;c.getMaximumScale=function(e){return c.getScale(e,f),t.maximumComponent(f)},c.multiply=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],M=e[3],O=e[4],m=e[5],y=e[6],p=e[7],C=e[8],U=e[9],L=e[10],P=e[11],F=e[12],g=e[13],w=e[14],v=e[15],x=r*d+u*I+_*S+f*M,D=a*d+E*I+T*S+A*M,B=i*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+f*p,b=a*O+E*m+T*y+A*p,X=i*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,q=r*C+u*U+_*L+f*P,H=a*C+E*U+T*L+A*P,W=i*C+s*U+R*L+h*P,Y=o*C+c*U+l*L+N*P,k=r*F+u*g+_*w+f*v,K=a*F+E*g+T*w+A*v,Z=i*F+s*g+R*w+h*v,j=o*F+c*g+l*w+N*v;return n[0]=x,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],M=e[9],O=e[10],m=e[12],y=e[13],p=e[14],C=r*f+o*A+s*h,U=a*f+u*A+c*h,L=i*f+E*A+_*h,P=r*N+o*d+s*I,F=a*N+u*d+c*I,g=i*N+E*d+_*I,w=r*S+o*M+s*O,v=a*S+u*M+c*O,x=i*S+E*M+_*O,D=r*m+o*y+s*p+T,B=a*m+u*y+c*p+R,z=i*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=P,n[5]=F,n[6]=g,n[7]=0,n[8]=w,n[9]=v,n[10]=x,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,M=a*T+u*R+c*l,O=i*T+E*R+_*l,m=r*f+o*A+s*h,y=a*f+u*A+c*h,p=i*f+E*A+_*h,C=r*N+o*d+s*I,U=a*N+u*d+c*I,L=i*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=r*t[0]+a*t[4]+i*t[8]+t[12],u=r*t[1]+a*t[5]+i*t[9]+t[13],E=r*t[2]+a*t[6]+i*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var A=new t;c.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,c.multiplyByScale(t,A,n)},c.multiplyByScale=function(t,e,n){var r=e.x,a=e.y,i=e.z;return 1===r&&1===a&&1===i?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=a*t[4],n[5]=a*t[5],n[6]=a*t[6],n[7]=0,n[8]=i*t[8],n[9]=i*t[9],n[10]=i*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t[0]*r+t[4]*a+t[8]*i+t[12]*o,E=t[1]*r+t[5]*a+t[9]*i+t[13]*o,s=t[2]*r+t[6]*a+t[10]*i+t[14]*o,c=t[3]*r+t[7]*a+t[11]*i+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i,u=t[1]*r+t[5]*a+t[9]*i,E=t[2]*r+t[6]*a+t[10]*i;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i+t[12],u=t[1]*r+t[5]*a+t[9]*i+t[13],E=t[2]*r+t[6]*a+t[10]*i+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],a=t[3],i=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=i,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],a=t[4],i=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],f=t[2],A=t[6],S=t[10],M=t[14],O=t[3],m=t[7],y=t[11],p=t[15],C=S*p,U=M*y,L=A*p,P=M*m,F=A*y,g=S*m,w=f*p,v=M*O,x=f*y,D=S*O,B=f*m,z=A*O,G=C*T+P*R+F*l-(U*T+L*R+g*l),b=U*_+w*R+D*l-(C*_+v*R+x*l),X=L*_+v*T+B*l-(P*_+w*T+z*l),V=g*_+x*T+z*R-(F*_+D*T+B*R),q=U*a+L*i+g*o-(C*a+P*i+F*o),H=C*r+v*i+x*o-(U*r+w*i+D*o),W=P*r+w*a+z*o-(L*r+v*a+B*o),Y=F*r+D*a+B*i-(g*r+x*a+z*i);C=i*l,U=o*R,L=a*l,P=o*T,F=a*R,g=i*T,w=r*l,v=o*_,x=r*R,D=i*_,B=r*T,z=a*_;var k=C*m+P*y+F*p-(U*m+L*y+g*p),K=U*O+w*y+D*p-(C*O+v*y+x*p),Z=L*O+v*m+B*p-(P*O+w*m+z*p),j=g*O+x*m+z*y-(F*O+D*m+B*y),Q=L*S+g*M+U*A-(F*M+C*A+P*S),J=x*M+C*f+v*S-(w*S+D*M+U*f),$=w*A+z*M+P*f-(B*M+L*f+v*A),tt=B*S+F*f+D*A-(x*A+z*S+g*f),et=r*G+a*b+i*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-a*R,f=-i*_-o*T-u*R,A=-E*_-s*T-c*R;return e[0]=n,e[1]=i,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=a,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=f,e[14]=A,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(a,0)}a(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,a,i,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=t,o.south=e,o.east=a,o.north=i,o):new E(t,e,a,i)},E.fromRadians=function(t,e,a,i,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(a,0),o.north=n(i,0),o):new E(t,e,a,i)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),a=Math.max(a,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;i=Math.min(i,l),o=Math.max(o,l)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=a,e.north=c,e):new E(n,s,a,c)},E.fromCartesianArray=function(t,e,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);a=Math.min(a,l.longitude),i=Math.max(i,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var f=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return i-a>s-o&&(a=o,i=s,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=c,n.east=i,n.north=_,n):new E(a,c,i,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var a=e.east,i=e.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var a=t.east,i=t.west,o=e.east,s=e.west;a<i&&o>0?a+=u.TWO_PI:o<s&&a>0&&(o+=u.TWO_PI),a<i&&s<0?s+=u.TWO_PI:o<s&&i<0&&(i+=u.TWO_PI);var c=u.negativePiToPi(Math.max(i,s)),_=u.negativePiToPi(Math.min(a,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,n){var a=Math.max(t.west,e.west),i=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new E(a,i,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var a=t.east,i=t.west,o=e.east,s=e.west;a<i&&o>0?a+=u.TWO_PI:o<s&&a>0&&(o+=u.TWO_PI),a<i&&s<0?s+=u.TWO_PI:o<s&&i<0&&(i+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(i,s)),_=u.convertLongitudeRange(Math.max(a,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,a=t.west,i=t.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,a,o){e=n(e,i.WGS84),a=n(a,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,f=s;f.height=a,f.longitude=l,f.latitude=_,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.latitude=T,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=e.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,a,i,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,M=new t,O=new t,m=new t;T.fromPoints=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),i=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,f),E=t.clone(r,A),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<i.x&&t.clone(r,i),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var L=t.magnitudeSquared(t.subtract(E,i,I)),P=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),g=i,w=E,v=L;P>v&&(v=P,g=o,w=s),F>v&&(v=F,g=u,w=c);var x=S;x.x=.5*(g.x+w.x),x.y=.5*(g.y+w.y),x.z=.5*(g.z+w.z);var D=t.magnitudeSquared(t.subtract(w,x,I)),B=Math.sqrt(D),z=M;z.x=i.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*r.x)/H,x.y=(B*x.y+W*r.y)/H,x.z=(B*x.z+W*r.z)/H}}return B<X?(t.clone(x,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,L=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,i,o,u){if(a(u)||(u=new T),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=i,_.northeast(e,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*R,f.z=E.z+.5*l,u};var P=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,i.WGS84),n=r(n,0);var u;return a(t)&&(u=_.subsample(t,e,n,P)),T.fromPoints(u,o)},T.fromVertices=function(e,n,i,o){if(a(o)||(o=new T),!a(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),i=r(i,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,f),_=t.clone(u,A),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=i){var L=e[U]+n.x,P=e[U+1]+n.y,F=e[U+2]+n.z;u.x=L,u.y=P,u.z=F,L<E.x&&t.clone(u,E),L>_.x&&t.clone(u,_),P<s.y&&t.clone(u,s),P>y.y&&t.clone(u,y),F<c.z&&t.clone(u,c),F>p.z&&t.clone(u,p)}var g=t.magnitudeSquared(t.subtract(_,E,I)),w=t.magnitudeSquared(t.subtract(y,s,I)),v=t.magnitudeSquared(t.subtract(p,c,I)),x=E,D=_,B=g;w>B&&(B=w,x=s,D=y),v>B&&(B=v,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,m),H=0;for(U=0;U<C;U+=i){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(a(r)||(r=new T),!a(e)||!a(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var i=d;i.x=e[0]+n[0],i.y=e[1]+n[1],i.z=e[2]+n[2];for(var o=t.clone(i,R),u=t.clone(i,l),E=t.clone(i,f),s=t.clone(i,A),c=t.clone(i,h),_=t.clone(i,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],L=e[p+2]+n[p+2];i.x=C,i.y=U,i.z=L,C<o.x&&t.clone(i,o),C>s.x&&t.clone(i,s),U<u.y&&t.clone(i,u),U>c.y&&t.clone(i,c),L<E.z&&t.clone(i,E),L>_.z&&t.clone(i,_)}var P=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),g=t.magnitudeSquared(t.subtract(_,E,I)),w=o,v=s,x=P;F>x&&(x=F,w=u,v=c),g>x&&(x=g,w=E,v=_);var D=S;D.x=.5*(w.x+v.x),D.y=.5*(w.y+v.y),D.z=.5*(w.z+v.z);var B=t.magnitudeSquared(t.subtract(v,D,I)),z=Math.sqrt(B),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){i.x=e[p]+n[p],i.y=e[p+1]+n[p+1],i.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(i,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(i,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*i.x)/W,D.y=(z*D.y+Y*i.y)/W,D.z=(z*D.z+Y*i.z)/W}}return z<V?(t.clone(D,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){a(r)||(r=new T);var i=r.center;return t.add(e,n,i),t.multiplyByScalar(i,.5,i),r.radius=t.distance(i,n),r},T.fromEllipsoid=function(e,n){return a(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var F=new t;T.fromBoundingSpheres=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var i=[],o=0;o<r;o++)i.push(e[o].center);n=T.fromPoints(i,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var g=new t,w=new t,v=new t;T.fromOrientedBoundingBox=function(e,n){a(n)||(n=new T);var r=e.halfAxes,i=s.getColumn(r,0,g),o=s.getColumn(r,1,w),u=s.getColumn(r,2,v);return t.add(i,o,i),t.add(i,u,i),n.center=t.clone(e.center,n.center),n.radius=t.magnitude(i),n},T.clone=function(e,n){if(a(e))return a(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var a=t.center;return e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),a(n)||(n=new T);var i=n.center;return i.x=t[e++],i.y=t[e++],i.z=t[e++],n.radius=t[e],n};var x=new t,D=new t;T.union=function(e,n,r){a(r)||(r=new T);var i=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,i,x),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(R,i,R),t.clone(R,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var a=t.magnitude(t.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},T.intersectPlane=function(e,n){var r=e.center,a=e.radius,i=n.normal,o=t.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,i){a(i)||(i=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return i.start=u-e.radius,i.stop=u+e.radius,i};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,a){n=r(n,K);var i=n.ellipsoid,o=e.center,u=e.radius,E=i.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),R=t.negate(s,q),l=Y,f=l[0];t.add(E,c,f),t.add(f,s,f),f=l[1],t.add(E,c,f),t.add(f,R,f),f=l[2],t.add(E,_,f),t.add(f,R,f),f=l[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=l[4],t.add(E,c,f),t.add(f,s,f),f=l[5],t.add(E,c,f),t.add(f,R,f),f=l[6],t.add(E,_,f),t.add(f,R,f),f=l[7],t.add(E,_,f),t.add(f,s,f);for(var A=l.length,h=0;h<A;++h){var N=l[h];t.add(o,N,N);var d=i.cartesianToCartographic(N,W);n.project(d,N)}a=T.fromPoints(l,a),o=a.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,a},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||a(e)&&a(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n){this.x=e(t,0),this.y=e(n,0)}o.fromElements=function(t,e,r){return n(r)?(r.x=t,r.y=e,r):new o(t,e)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e):new o(t.x,t.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=2*r:e=new Array(2*r);for(var a=0;a<r;++a)o.pack(t[a],e,2*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/2:e=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y)},o.minimumComponent=function(t){return Math.min(t.x,t.y)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){return o.normalize(t,s),o.normalize(e,c),i.acosClamped(o.dot(s,c))};var _=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Y,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{ +get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var E=i[o];a=E+"RequestFullscreen","function"==typeof e[a]?(r.requestFullscreen=a,n=!0):(a=E+"RequestFullScreen","function"==typeof e[a]&&(r.requestFullscreen=a,n=!0)),a=E+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=E+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=E+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=E+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=E+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=E+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=E+"fullscreenchange",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=E+"fullscreenerror",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function a(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,M=r(t[1]))}return S}function i(){return a()&&M}function o(){if(!e(O)&&(O=!1,!a()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(O=!0,m=r(t[1]))}return O}function u(){return o()&&m}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(L)){L=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(L=!0,P=r(t[1]))}return L}function R(){return T()&&P}function l(){if(!e(F)){F=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(F=!0,g=r(t[1]))}return F}function f(){return e(w)||(w=/Windows/i.test(I.appVersion)),w}function A(){return l()&&g}function h(){return e(v)||(v="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),v}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(x=n)}return D}function d(){return N()?x:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,P,F,g,w,v,x,D,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,a){switch(r=t(r,0),a=t(a,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,a){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return i.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var a=t.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(t){switch(t){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},i.createTypedArrayFromArrayBuffer=function(t,e,n,a){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,a):new Uint16Array(e,n,a)},n(i)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.tangent?1:0,n[r++]=e.bitangent?1:0,n[r++]=e.color?1:0,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(t,n){if(e(t))return e(n)||(n=new a),n.position=t.position,n.normal=t.normal,n.st=t.st,n.tangent=t.tangent,n.bitangent=t.bitangent,n.color=t.color,n},a}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,a,i,o,u,E,s,c,_,T,R,l){"use strict";function f(t){t=a(t,a.EMPTY_OBJECT);var e=a(t.radii,S),r=Math.round(a(t.stackPartitions,64)),i=Math.round(a(t.slicePartitions,64)),o=a(t.vertexFormat,l.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=i,this._vertexFormat=l.clone(o),this._workerName="createEllipsoidGeometry"}var A=new n,h=new n,N=new n,d=new n,I=new n,S=new n(1,1,1),M=Math.cos,O=Math.sin;f.packedLength=n.packedLength+l.packedLength+2,f.pack=function(t,e,r){return r=a(r,0),n.pack(t._radii,e,r),r+=n.packedLength,l.pack(t._vertexFormat,e,r),r+=l.packedLength,e[r++]=t._stackPartitions,e[r]=t._slicePartitions,e};var m=new n,y=new l,p={radii:m,vertexFormat:y,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(t,e,r){e=a(e,0);var o=n.unpack(t,e,m);e+=n.packedLength;var u=l.unpack(t,e,y);e+=l.packedLength;var E=t[e++],s=t[e];return i(r)?(r._radii=n.clone(o,r._radii),r._vertexFormat=l.clone(u,r._vertexFormat),r._stackPartitions=E,r._slicePartitions=s,r):(p.stackPartitions=E,p.slicePartitions=s,new f(p))},f.createGeometry=function(a){var i=a._radii;if(!(i.x<=0||i.y<=0||i.z<=0)){var o,l,f=u.fromCartesian3(i),S=a._vertexFormat,m=a._slicePartitions+1,y=a._stackPartitions+1,p=y*m,C=new Float64Array(3*p),U=6*(m-1)*(y-2),L=_.createTypedArray(p,U),P=S.normal?new Float32Array(3*p):void 0,F=S.tangent?new Float32Array(3*p):void 0,g=S.bitangent?new Float32Array(3*p):void 0,w=S.st?new Float32Array(2*p):void 0,v=new Array(m),x=new Array(m),D=0;for(o=0;o<m;o++){var B=T.TWO_PI*o/(m-1);v[o]=M(B),x[o]=O(B),C[D++]=0,C[D++]=0,C[D++]=i.z}for(o=1;o<y-1;o++){var z=Math.PI*o/(y-1),G=O(z),b=i.x*G,X=i.y*G,V=i.z*M(z);for(l=0;l<m;l++)C[D++]=v[l]*b,C[D++]=x[l]*X,C[D++]=V}for(o=0;o<m;o++)C[D++]=0,C[D++]=0,C[D++]=-i.z;var q=new c;S.position&&(q.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:C}));var H=0,W=0,Y=0,k=0;if(S.st||S.normal||S.tangent||S.bitangent){for(o=0;o<p;o++){var K=n.fromArray(C,3*o,A),Z=f.geodeticSurfaceNormal(K,h);if(S.st){var j=e.negate(Z,I);e.magnitude(j)<T.EPSILON6&&(D=3*(o+m*Math.floor(.5*y)),D>C.length&&(D=3*(o-m*Math.floor(.5*y))),n.fromArray(C,D,j),f.geodeticSurfaceNormal(j,j),e.negate(j,j)),w[H++]=Math.atan2(j.y,j.x)/T.TWO_PI+.5,w[H++]=Math.asin(Z.z)/Math.PI+.5}if(S.normal&&(P[W++]=Z.x,P[W++]=Z.y,P[W++]=Z.z),S.tangent||S.bitangent){var Q=N;if(o<m||o>p-m-1?(n.cross(n.UNIT_X,Z,Q),n.normalize(Q,Q)):(n.cross(n.UNIT_Z,Z,Q),n.normalize(Q,Q)),S.tangent&&(F[Y++]=Q.x,F[Y++]=Q.y,F[Y++]=Q.z),S.bitangent){var J=n.cross(Z,Q,d);n.normalize(J,J),g[k++]=J.x,g[k++]=J.y,g[k++]=J.z}}}S.st&&(q.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:w})),S.normal&&(q.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:P})),S.tangent&&(q.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),S.bitangent&&(q.bitangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:g}))}for(D=0,l=0;l<m-1;l++)L[D++]=m+l,L[D++]=m+l+1,L[D++]=l+1;var $,tt;for(o=1;o<y-2;o++)for($=o*m,tt=(o+1)*m,l=0;l<m-1;l++)L[D++]=tt+l,L[D++]=tt+l+1,L[D++]=$+l+1,L[D++]=tt+l,L[D++]=$+l+1,L[D++]=$+l;for(o=y-2,$=o*m,tt=(o+1)*m,l=0;l<m-1;l++)L[D++]=tt+l,L[D++]=$+l+1,L[D++]=$+l;return new E({attributes:q,indices:L,primitiveType:R.TRIANGLES,boundingSphere:t.fromEllipsoid(f)})}},f}),define("Workers/createEllipsoidGeometry",["../Core/defined","../Core/EllipsoidGeometry"],function(t,e){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createEllipsoidOutlineGeometry.js b/engines/Cesium/Workers/createEllipsoidOutlineGeometry.js index db2d962..2337424 100644 --- a/engines/Cesium/Workers/createEllipsoidOutlineGeometry.js +++ b/engines/Cesium/Workers/createEllipsoidOutlineGeometry.js @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var i={};return i.typeOf={},i.defined=function(r,i){if(!t(i))throw new e(n(r))},i.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},i.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},i.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},i.typeOf.number.lessThan=function(t,n,r){if(i.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(t,n,r){if(i.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},i.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},i}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,P,L,F,D,v,w,B,g,x=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{x-=z,U=1/(1+x*M),P=1/(1+x*O),L=1/(1+x*m),F=U*U,D=P*P,v=L*L,w=F*U,B=D*P,g=v*L,p=f*F+h*D+N*v-1,C=f*w*M+h*B*O+N*g*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*P,s.z=T*L,s):new t(c*U,_*P,T*L)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,i,a){return i=e(i,0),n(a)?(a.longitude=t,a.latitude=r,a.height=i,a):new u(t,r,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(e,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,h=o(e,l,A,f,s);if(n(h)){var N=t.multiplyComponents(h,A,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(t.dot(d,e))*t.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(c.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}}}),c.clone=function(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,l=new t,A=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=t.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i,a,o,u,E,s){this[0]=n(t,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(A[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(t[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,f=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(f-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5],i[6]=t[e+6],i[7]=t[e+7],i[8]=t[e+8],i},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=A,e[4]=N,e[5]=S,e[6]=f,e[7]=d,e[8]=M,e):new E(l,A,f,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-o*a+a*o*u,f=-o,h=s*n,N=a*n;return r(e)?(e[0]=c,e[1]=R,e[2]=f,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=A,e[8]=N,e):new E(c,_,T,R,l,A,f,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=i,e[6]=0,e[7]=-i,e[8]=n,e):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=n,e):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,i=10,a=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*i-r*_,e[2]=r*u-o*i,e[3]=s*u-a*_,e[4]=n*_-s*i,e[5]=a*i-n*u,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}o.fromElements=function(t,e,r,i,a){return n(a)?(a.x=t,a.y=e,a.z=r,a.w=i,a):new o(t,e,r,i)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r++],i.w=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var i=0;i<r;++i)o.pack(t[i],e,4*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)&&a.equalsEpsilon(t.w,e.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){ -"use strict";function c(t,e,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),i(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(i(t))return i(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return i(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,a){return n=r(n,t.ZERO),i(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,A=e.y*e.w,f=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-f+N,I=2*(s-h),S=2*(_+A),M=2*(s+h),O=-E+R-f+N,m=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return i(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return i(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var r=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=l*I+A*S+f*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,d,m,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(t,e,n,i){t=r(t,r.EMPTY_OBJECT);var a=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,A=a+s,f=o+c,h=e+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return i(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var A=new t;c.getMaximumScale=function(e){return c.getScale(e,A),t.maximumComponent(A)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],A=t[12],f=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],M=e[3],O=e[4],m=e[5],y=e[6],p=e[7],C=e[8],U=e[9],P=e[10],L=e[11],F=e[12],D=e[13],v=e[14],w=e[15],B=r*d+u*I+_*S+A*M,g=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,H=r*C+u*U+_*P+A*L,W=i*C+E*U+T*P+f*L,q=a*C+s*U+R*P+h*L,Y=o*C+c*U+l*P+N*L,k=r*F+u*D+_*v+A*w,K=i*F+E*D+T*v+f*w,Z=a*F+s*D+R*v+h*w,j=o*F+c*D+l*v+N*w;return n[0]=B,n[1]=g,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=W,n[10]=q,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],A=e[0],f=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],M=e[9],O=e[10],m=e[12],y=e[13],p=e[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,P=a*A+E*f+_*h,L=r*N+o*d+s*I,F=i*N+u*d+c*I,D=a*N+E*d+_*I,v=r*S+o*M+s*O,w=i*S+u*M+c*O,B=a*S+E*M+_*O,g=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=P,n[3]=0,n[4]=L,n[5]=F,n[6]=D,n[7]=0,n[8]=v,n[9]=w,n[10]=B,n[11]=0,n[12]=g,n[13]=x,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],A=e[3],f=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,P=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=P,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var f=new t;c.multiplyByUniformScale=function(t,e,n){return f.x=e,f.y=e,f.z=e,c.multiplyByScale(t,f,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||i(t)&&i(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||i(t)&&i(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],A=t[2],f=t[6],S=t[10],M=t[14],O=t[3],m=t[7],y=t[11],p=t[15],C=S*p,U=M*y,P=f*p,L=M*m,F=f*y,D=S*m,v=A*p,w=M*O,B=A*y,g=S*O,x=A*m,z=f*O,G=C*T+L*R+F*l-(U*T+P*R+D*l),b=U*_+v*R+g*l-(C*_+w*R+B*l),X=P*_+w*T+x*l-(L*_+v*T+z*l),V=D*_+B*T+z*R-(F*_+g*T+x*R),H=U*i+P*a+D*o-(C*i+L*a+F*o),W=C*r+w*a+B*o-(U*r+v*a+g*o),q=L*r+v*i+z*o-(P*r+w*i+x*o),Y=F*r+g*i+x*a-(D*r+B*i+z*a);C=a*l,U=o*R,P=i*l,L=o*T,F=i*R,D=a*T,v=r*l,w=o*_,B=r*R,g=a*_,x=r*T,z=i*_;var k=C*m+L*y+F*p-(U*m+P*y+D*p),K=U*O+v*y+g*p-(C*O+w*y+B*p),Z=P*O+w*m+x*p-(L*O+v*m+z*p),j=D*O+B*m+z*y-(F*O+g*m+x*y),Q=P*S+D*M+U*f-(F*M+C*f+L*S),J=B*M+C*A+w*S-(v*S+g*M+U*A),$=v*f+z*M+L*A-(x*M+P*A+w*f),tt=x*S+F*A+g*f-(B*f+z*S+D*A),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=H*et,n[5]=W*et,n[6]=q*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=A,e[14]=f,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i.west=t[e++],i.south=t[e++],i.east=t[e++],i.north=t[e],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,i,a,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=t,o.south=e,o.east=i,o.north=a,o):new E(t,e,i,a)},E.fromRadians=function(t,e,i,a,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(i,0),o.north=n(a,0),o):new E(t,e,i,a)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=i,e.north=c,e):new E(n,s,i,c)},E.fromCartesianArray=function(t,e,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,n){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=e.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(t,A)&&(o[c]=e.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=e.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,A=new t,f=new t,h=new t,N=new t,d=new t,I=new t,S=new t,M=new t,O=new t,m=new t;T.fromPoints=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),a=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,A),E=t.clone(r,f),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&t.clone(r,a),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var P=t.magnitudeSquared(t.subtract(E,a,I)),L=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),D=a,v=E,w=P;L>w&&(w=L,D=o,v=s),F>w&&(w=F,D=u,v=c);var B=S;B.x=.5*(D.x+v.x),B.y=.5*(D.y+v.y),B.z=.5*(D.z+v.z);var g=t.magnitudeSquared(t.subtract(v,B,I)),x=Math.sqrt(g),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var H=t.magnitudeSquared(t.subtract(r,B,I));if(H>g){var W=Math.sqrt(H);x=.5*(x+W),g=x*x;var q=W-x;B.x=(x*B.x+q*r.x)/W,B.y=(x*B.y+q*r.y)/W,B.z=(x*B.z+q*r.z)/W}}return x<X?(t.clone(B,n.center),n.radius=x):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,P=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,a,o,u){if(i(u)||(u=new T),!i(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=a,_.northeast(e,P),P.height=o;var E=n.project(U,p),s=n.project(P,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var L=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,a.WGS84),n=r(n,0);var u;return i(t)&&(u=_.subsample(t,e,n,L)),T.fromPoints(u,o)},T.fromVertices=function(e,n,a,o){if(i(o)||(o=new T),!i(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),a=r(a,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,A),_=t.clone(u,f),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=a){var P=e[U]+n.x,L=e[U+1]+n.y,F=e[U+2]+n.z;u.x=P,u.y=L,u.z=F,P<E.x&&t.clone(u,E),P>_.x&&t.clone(u,_),L<s.y&&t.clone(u,s),L>y.y&&t.clone(u,y),F<c.z&&t.clone(u,c),F>p.z&&t.clone(u,p)}var D=t.magnitudeSquared(t.subtract(_,E,I)),v=t.magnitudeSquared(t.subtract(y,s,I)),w=t.magnitudeSquared(t.subtract(p,c,I)),B=E,g=_,x=D;v>x&&(x=v,B=s,g=y),w>x&&(x=w,B=c,g=p);var z=S;z.x=.5*(B.x+g.x),z.y=.5*(B.y+g.y),z.z=.5*(B.z+g.z);var G=t.magnitudeSquared(t.subtract(g,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var H=t.multiplyByScalar(t.add(X,V,I),.5,m),W=0;for(U=0;U<C;U+=a){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var q=t.magnitude(t.subtract(u,H,I));q>W&&(W=q);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<W?(t.clone(z,o.center),o.radius=b):(t.clone(H,o.center),o.radius=W),o},T.fromEncodedCartesianVertices=function(e,n,r){if(i(r)||(r=new T),!i(e)||!i(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,R),u=t.clone(a,l),E=t.clone(a,A),s=t.clone(a,f),c=t.clone(a,h),_=t.clone(a,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],P=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=P,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),P<E.z&&t.clone(a,E),P>_.z&&t.clone(a,_)}var L=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),D=t.magnitudeSquared(t.subtract(_,E,I)),v=o,w=s,B=L;F>B&&(B=F,v=u,w=c),D>B&&(B=D,v=E,w=_);var g=S;g.x=.5*(v.x+w.x),g.y=.5*(v.y+w.y),g.z=.5*(v.z+w.z);var x=t.magnitudeSquared(t.subtract(w,g,I)),z=Math.sqrt(x),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var H=t.magnitude(t.subtract(a,X,I));H>V&&(V=H);var W=t.magnitudeSquared(t.subtract(a,g,I));if(W>x){var q=Math.sqrt(W);z=.5*(z+q),x=z*z;var Y=q-z;g.x=(z*g.x+Y*a.x)/q,g.y=(z*g.y+Y*a.y)/q,g.z=(z*g.z+Y*a.z)/q}}return z<V?(t.clone(g,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){i(r)||(r=new T);var a=r.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),r.radius=t.distance(a,n),r},T.fromEllipsoid=function(e,n){return i(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var F=new t;T.fromBoundingSpheres=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var a=[],o=0;o<r;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var D=new t,v=new t,w=new t;T.fromOrientedBoundingBox=function(e,n){i(n)||(n=new T);var r=e.halfAxes,a=s.getColumn(r,0,D),o=s.getColumn(r,1,v),u=s.getColumn(r,2,w),E=t.magnitude(a),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(i(e))return i(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var i=t.center;return e[n++]=i.x,e[n++]=i.y,e[n++]=i.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),i(n)||(n=new T);var a=n.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],n.radius=t[e],n};var B=new t,g=new t;T.union=function(e,n,r){i(r)||(r=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,B),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,g);return t.add(R,a,R),t.clone(R,r.center),r.radius=_,r};var x=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,a){i(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,H=new t,W=new t,q=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,i){n=r(n,K);var a=n.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,W),R=t.negate(s,H),l=Y,A=l[0];t.add(E,c,A),t.add(A,s,A),A=l[1],t.add(E,c,A),t.add(A,R,A),A=l[2],t.add(E,_,A),t.add(A,R,A),A=l[3],t.add(E,_,A),t.add(A,s,A),t.negate(E,E),A=l[4],t.add(E,c,A),t.add(A,s,A),A=l[5],t.add(E,c,A),t.add(A,R,A),A=l[6],t.add(E,_,A),t.add(A,R,A),A=l[7],t.add(E,_,A),t.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];t.add(o,N,N);var d=a.cartesianToCartographic(N,q);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||i(e)&&i(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,M=r(t[1]))}return S}function a(){return i()&&M}function o(){if(!e(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(O=!0,m=r(t[1]))}return O}function u(){return o()&&m}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(P)){P=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,L=r(t[1]))}return P}function R(){return T()&&L}function l(){if(!e(F)){F=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent); -null!==t&&(F=!0,D=r(t[1]))}return F}function A(){return e(v)||(v=/Windows/i.test(I.appVersion)),v}function f(){return l()&&D}function h(){return e(w)||(w="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),w}function N(){if(!e(g)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;g=e(n)&&""!==n,g&&(B=n)}return g}function d(){return N()?B:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,P,L,F,D,v,w,B,g,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(t){switch(t){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,i){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(a)}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(t,e,n,r,i,a,o,u,E,s,c,_,T){"use strict";function R(t){t=r(t,r.EMPTY_OBJECT);var n=r(t.radii,l),i=r(t.stackPartitions,10),a=r(t.slicePartitions,8),o=r(t.subdivisions,128);this._radii=e.clone(n),this._stackPartitions=i,this._slicePartitions=a,this._subdivisions=o,this._workerName="createEllipsoidOutlineGeometry"}var l=new e(1,1,1),A=Math.cos,f=Math.sin;R.packedLength=e.packedLength+3,R.pack=function(t,n,i){return i=r(i,0),e.pack(t._radii,n,i),i+=e.packedLength,n[i++]=t._stackPartitions,n[i++]=t._slicePartitions,n[i]=t._subdivisions,n};var h=new e,N={radii:h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return R.unpack=function(t,n,a){n=r(n,0);var o=e.unpack(t,n,h);n+=e.packedLength;var u=t[n++],E=t[n++],s=t[n++];return i(a)?(a._radii=e.clone(o,a._radii),a._stackPartitions=u,a._slicePartitions=E,a._subdivisions=s,a):(N.stackPartitions=u,N.slicePartitions=E,N.subdivisions=s,new R(N))},R.createGeometry=function(e){var r=e._radii;if(!(r.x<=0||r.y<=0||r.z<=0)){var i,a,R,l,h,N,d=o.fromCartesian3(r),I=e._stackPartitions,S=e._slicePartitions,M=e._subdivisions,O=M*(I+S-1),m=O-S+2,y=new Float64Array(3*m),p=c.createTypedArray(m,2*O),C=0,U=new Array(M),P=new Array(M);for(i=0;i<M;i++)R=_.TWO_PI*i/M,U[i]=A(R),P[i]=f(R);for(i=1;i<I;i++)for(l=Math.PI*i/I,h=A(l),N=f(l),a=0;a<M;a++)y[C++]=r.x*U[a]*N,y[C++]=r.y*P[a]*N,y[C++]=r.z*h;for(U.length=S,P.length=S,i=0;i<S;i++)R=_.TWO_PI*i/S,U[i]=A(R),P[i]=f(R);for(y[C++]=0,y[C++]=0,y[C++]=r.z,i=1;i<M;i++)for(l=Math.PI*i/M,h=A(l),N=f(l),a=0;a<S;a++)y[C++]=r.x*U[a]*N,y[C++]=r.y*P[a]*N,y[C++]=r.z*h;for(y[C++]=0,y[C++]=0,y[C++]=-r.z,C=0,i=0;i<I-1;++i){var L=i*M;for(a=0;a<M-1;++a)p[C++]=L+a,p[C++]=L+a+1;p[C++]=L+M-1,p[C++]=L}var F=M*(I-1);for(a=1;a<S+1;++a)p[C++]=F,p[C++]=F+a;for(i=0;i<M-2;++i){var D=i*S+1+F,v=(i+1)*S+1+F;for(a=0;a<S-1;++a)p[C++]=v+a,p[C++]=D+a;p[C++]=v+S-1,p[C++]=D+S-1}var w=y.length/3-1;for(a=w-1;a>w-S-1;--a)p[C++]=w,p[C++]=a;var B=new s({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y})});return new u({attributes:B,indices:p,primitiveType:T.LINES,boundingSphere:t.fromEllipsoid(d)})}},R}),define("Workers/createEllipsoidOutlineGeometry",["../Core/defined","../Core/EllipsoidOutlineGeometry"],function(t,e){"use strict";return function(n,r){return t(n.buffer,r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var i={};return i.typeOf={},i.defined=function(r,i){if(!t(i))throw new e(n(r))},i.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},i.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},i.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},i.typeOf.number.lessThan=function(t,n,r){if(i.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(t,n,r){if(i.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},i.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},i}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,P,L,F,D,v,w,B,g,x=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{x-=z,U=1/(1+x*M),P=1/(1+x*O),L=1/(1+x*m),F=U*U,D=P*P,v=L*L,w=F*U,B=D*P,g=v*L,p=f*F+h*D+N*v-1,C=f*w*M+h*B*O+N*g*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*P,s.z=T*L,s):new t(c*U,_*P,T*L)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,e,r){this.longitude=n(t,0),this.latitude=n(e,0),this.height=n(r,0)}u.fromRadians=function(t,e,i,a){return i=n(i,0),r(a)?(a.longitude=t,a.latitude=e,a.height=i,a):new u(t,e,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(e,n,i){var l=r(n)?n.oneOverRadii:_,A=r(n)?n.oneOverRadiiSquared:T,f=r(n)?n._centerToleranceSquared:R,h=o(e,l,A,f,s);if(r(h)){var N=t.multiplyComponents(h,A,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(t.dot(d,e))*t.magnitude(d);return r(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(c.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}}}),c.clone=function(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,l=new t,A=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=t.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i,a,o,u,E,s){this[0]=n(t,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(A[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(t[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,f=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(f-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5],i[6]=t[e+6],i[7]=t[e+7],i[8]=t[e+8],i},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=A,e[4]=N,e[5]=S,e[6]=f,e[7]=d,e[8]=M,e):new E(l,A,f,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-s*i+a*o*u,f=-o,h=s*n,N=a*n;return r(e)?(e[0]=c,e[1]=R,e[2]=f,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=A,e[8]=N,e):new E(c,_,T,R,l,A,f,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=i,e[6]=0,e[7]=-i,e[8]=n,e):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=n,e):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,i=10,a=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*i-r*_,e[2]=r*u-o*i,e[3]=s*u-a*_,e[4]=n*_-s*i,e[5]=a*i-n*u,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}o.fromElements=function(t,e,r,i,a){return n(a)?(a.x=t,a.y=e,a.z=r,a.w=i,a):new o(t,e,r,i)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r++],i.w=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var i=0;i<r;++i)o.pack(t[i],e,4*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)&&a.equalsEpsilon(t.w,e.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){ +"use strict";function c(t,e,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),i(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(i(t))return i(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return i(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,a){return n=r(n,t.ZERO),i(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,A=e.y*e.w,f=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-f+N,I=2*(s-h),S=2*(_+A),M=2*(s+h),O=-E+R-f+N,m=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return i(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return i(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var r=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=l*I+A*S+f*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,d,m,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(t,e,n,i){t=r(t,r.EMPTY_OBJECT);var a=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,A=a+s,f=o+c,h=e+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return i(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var A=new t;c.getMaximumScale=function(e){return c.getScale(e,A),t.maximumComponent(A)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],A=t[12],f=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],M=e[3],O=e[4],m=e[5],y=e[6],p=e[7],C=e[8],U=e[9],P=e[10],L=e[11],F=e[12],D=e[13],v=e[14],w=e[15],B=r*d+u*I+_*S+A*M,g=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+h*M,z=o*d+c*I+l*S+N*M,G=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,H=r*C+u*U+_*P+A*L,W=i*C+E*U+T*P+f*L,q=a*C+s*U+R*P+h*L,Y=o*C+c*U+l*P+N*L,k=r*F+u*D+_*v+A*w,K=i*F+E*D+T*v+f*w,Z=a*F+s*D+R*v+h*w,j=o*F+c*D+l*v+N*w;return n[0]=B,n[1]=g,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=W,n[10]=q,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],A=e[0],f=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],M=e[9],O=e[10],m=e[12],y=e[13],p=e[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,P=a*A+E*f+_*h,L=r*N+o*d+s*I,F=i*N+u*d+c*I,D=a*N+E*d+_*I,v=r*S+o*M+s*O,w=i*S+u*M+c*O,B=a*S+E*M+_*O,g=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=P,n[3]=0,n[4]=L,n[5]=F,n[6]=D,n[7]=0,n[8]=v,n[9]=w,n[10]=B,n[11]=0,n[12]=g,n[13]=x,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],A=e[3],f=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,P=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=P,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var f=new t;c.multiplyByUniformScale=function(t,e,n){return f.x=e,f.y=e,f.z=e,c.multiplyByScale(t,f,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||i(t)&&i(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||i(t)&&i(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],A=t[2],f=t[6],S=t[10],M=t[14],O=t[3],m=t[7],y=t[11],p=t[15],C=S*p,U=M*y,P=f*p,L=M*m,F=f*y,D=S*m,v=A*p,w=M*O,B=A*y,g=S*O,x=A*m,z=f*O,G=C*T+L*R+F*l-(U*T+P*R+D*l),b=U*_+v*R+g*l-(C*_+w*R+B*l),X=P*_+w*T+x*l-(L*_+v*T+z*l),V=D*_+B*T+z*R-(F*_+g*T+x*R),H=U*i+P*a+D*o-(C*i+L*a+F*o),W=C*r+w*a+B*o-(U*r+v*a+g*o),q=L*r+v*i+z*o-(P*r+w*i+x*o),Y=F*r+g*i+x*a-(D*r+B*i+z*a);C=a*l,U=o*R,P=i*l,L=o*T,F=i*R,D=a*T,v=r*l,w=o*_,B=r*R,g=a*_,x=r*T,z=i*_;var k=C*m+L*y+F*p-(U*m+P*y+D*p),K=U*O+v*y+g*p-(C*O+w*y+B*p),Z=P*O+w*m+x*p-(L*O+v*m+z*p),j=D*O+B*m+z*y-(F*O+g*m+x*y),Q=P*S+D*M+U*f-(F*M+C*f+L*S),J=B*M+C*A+w*S-(v*S+g*M+U*A),$=v*f+z*M+L*A-(x*M+P*A+w*f),tt=x*S+F*A+g*f-(B*f+z*S+D*A),et=r*G+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=H*et,n[5]=W*et,n[6]=q*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=A,e[14]=f,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i.west=t[e++],i.south=t[e++],i.east=t[e++],i.north=t[e],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,i,a,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=t,o.south=e,o.east=i,o.north=a,o):new E(t,e,i,a)},E.fromRadians=function(t,e,i,a,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(i,0),o.north=n(a,0),o):new E(t,e,i,a)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=i,e.north=c,e):new E(n,s,i,c)},E.fromCartesianArray=function(t,e,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,n){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=e.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(t,A)&&(o[c]=e.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=e.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,A=new t,f=new t,h=new t,N=new t,d=new t,I=new t,S=new t,M=new t,O=new t,m=new t;T.fromPoints=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),a=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,A),E=t.clone(r,f),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&t.clone(r,a),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var P=t.magnitudeSquared(t.subtract(E,a,I)),L=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),D=a,v=E,w=P;L>w&&(w=L,D=o,v=s),F>w&&(w=F,D=u,v=c);var B=S;B.x=.5*(D.x+v.x),B.y=.5*(D.y+v.y),B.z=.5*(D.z+v.z);var g=t.magnitudeSquared(t.subtract(v,B,I)),x=Math.sqrt(g),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,m),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var H=t.magnitudeSquared(t.subtract(r,B,I));if(H>g){var W=Math.sqrt(H);x=.5*(x+W),g=x*x;var q=W-x;B.x=(x*B.x+q*r.x)/W,B.y=(x*B.y+q*r.y)/W,B.z=(x*B.z+q*r.z)/W}}return x<X?(t.clone(B,n.center),n.radius=x):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,P=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,a,o,u){if(i(u)||(u=new T),!i(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=a,_.northeast(e,P),P.height=o;var E=n.project(U,p),s=n.project(P,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var L=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,a.WGS84),n=r(n,0);var u;return i(t)&&(u=_.subsample(t,e,n,L)),T.fromPoints(u,o)},T.fromVertices=function(e,n,a,o){if(i(o)||(o=new T),!i(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),a=r(a,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,A),_=t.clone(u,f),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=a){var P=e[U]+n.x,L=e[U+1]+n.y,F=e[U+2]+n.z;u.x=P,u.y=L,u.z=F,P<E.x&&t.clone(u,E),P>_.x&&t.clone(u,_),L<s.y&&t.clone(u,s),L>y.y&&t.clone(u,y),F<c.z&&t.clone(u,c),F>p.z&&t.clone(u,p)}var D=t.magnitudeSquared(t.subtract(_,E,I)),v=t.magnitudeSquared(t.subtract(y,s,I)),w=t.magnitudeSquared(t.subtract(p,c,I)),B=E,g=_,x=D;v>x&&(x=v,B=s,g=y),w>x&&(x=w,B=c,g=p);var z=S;z.x=.5*(B.x+g.x),z.y=.5*(B.y+g.y),z.z=.5*(B.z+g.z);var G=t.magnitudeSquared(t.subtract(g,z,I)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var H=t.multiplyByScalar(t.add(X,V,I),.5,m),W=0;for(U=0;U<C;U+=a){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var q=t.magnitude(t.subtract(u,H,I));q>W&&(W=q);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<W?(t.clone(z,o.center),o.radius=b):(t.clone(H,o.center),o.radius=W),o},T.fromEncodedCartesianVertices=function(e,n,r){if(i(r)||(r=new T),!i(e)||!i(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,R),u=t.clone(a,l),E=t.clone(a,A),s=t.clone(a,f),c=t.clone(a,h),_=t.clone(a,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],P=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=P,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),P<E.z&&t.clone(a,E),P>_.z&&t.clone(a,_)}var L=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),D=t.magnitudeSquared(t.subtract(_,E,I)),v=o,w=s,B=L;F>B&&(B=F,v=u,w=c),D>B&&(B=D,v=E,w=_);var g=S;g.x=.5*(v.x+w.x),g.y=.5*(v.y+w.y),g.z=.5*(v.z+w.z);var x=t.magnitudeSquared(t.subtract(w,g,I)),z=Math.sqrt(x),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var H=t.magnitude(t.subtract(a,X,I));H>V&&(V=H);var W=t.magnitudeSquared(t.subtract(a,g,I));if(W>x){var q=Math.sqrt(W);z=.5*(z+q),x=z*z;var Y=q-z;g.x=(z*g.x+Y*a.x)/q,g.y=(z*g.y+Y*a.y)/q,g.z=(z*g.z+Y*a.z)/q}}return z<V?(t.clone(g,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){i(r)||(r=new T);var a=r.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),r.radius=t.distance(a,n),r},T.fromEllipsoid=function(e,n){return i(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var F=new t;T.fromBoundingSpheres=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var a=[],o=0;o<r;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var D=new t,v=new t,w=new t;T.fromOrientedBoundingBox=function(e,n){i(n)||(n=new T);var r=e.halfAxes,a=s.getColumn(r,0,D),o=s.getColumn(r,1,v),u=s.getColumn(r,2,w);return t.add(a,o,a),t.add(a,u,a),n.center=t.clone(e.center,n.center),n.radius=t.magnitude(a),n},T.clone=function(e,n){if(i(e))return i(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var i=t.center;return e[n++]=i.x,e[n++]=i.y,e[n++]=i.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),i(n)||(n=new T);var a=n.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],n.radius=t[e],n};var B=new t,g=new t;T.union=function(e,n,r){i(r)||(r=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,B),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,g);return t.add(R,a,R),t.clone(R,r.center),r.radius=_,r};var x=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,a){i(a)||(a=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,H=new t,W=new t,q=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,i){n=r(n,K);var a=n.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,W),R=t.negate(s,H),l=Y,A=l[0];t.add(E,c,A),t.add(A,s,A),A=l[1],t.add(E,c,A),t.add(A,R,A),A=l[2],t.add(E,_,A),t.add(A,R,A),A=l[3],t.add(E,_,A),t.add(A,s,A),t.negate(E,E),A=l[4],t.add(E,c,A),t.add(A,s,A),A=l[5],t.add(E,c,A),t.add(A,R,A),A=l[6],t.add(E,_,A),t.add(A,R,A),A=l[7],t.add(E,_,A),t.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];t.add(o,N,N);var d=a.cartesianToCartographic(N,q);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||i(e)&&i(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,M=r(t[1]))}return S}function a(){return i()&&M}function o(){if(!e(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(O=!0,m=r(t[1]))}return O}function u(){return o()&&m}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(P)){P=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,L=r(t[1]))}return P}function R(){return T()&&L}function l(){if(!e(F)){F=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(F=!0,D=r(t[1])); +}return F}function A(){return e(v)||(v=/Windows/i.test(I.appVersion)),v}function f(){return l()&&D}function h(){return e(w)||(w="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),w}function N(){if(!e(g)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;g=e(n)&&""!==n,g&&(B=n)}return g}function d(){return N()?B:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,P,L,F,D,v,w,B,g,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(t){switch(t){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,i){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(a)}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(t,e,n,r,i,a,o,u,E,s,c,_,T){"use strict";function R(t){t=r(t,r.EMPTY_OBJECT);var n=r(t.radii,l),i=Math.round(r(t.stackPartitions,10)),a=Math.round(r(t.slicePartitions,8)),o=Math.round(r(t.subdivisions,128));this._radii=e.clone(n),this._stackPartitions=i,this._slicePartitions=a,this._subdivisions=o,this._workerName="createEllipsoidOutlineGeometry"}var l=new e(1,1,1),A=Math.cos,f=Math.sin;R.packedLength=e.packedLength+3,R.pack=function(t,n,i){return i=r(i,0),e.pack(t._radii,n,i),i+=e.packedLength,n[i++]=t._stackPartitions,n[i++]=t._slicePartitions,n[i]=t._subdivisions,n};var h=new e,N={radii:h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return R.unpack=function(t,n,a){n=r(n,0);var o=e.unpack(t,n,h);n+=e.packedLength;var u=t[n++],E=t[n++],s=t[n++];return i(a)?(a._radii=e.clone(o,a._radii),a._stackPartitions=u,a._slicePartitions=E,a._subdivisions=s,a):(N.stackPartitions=u,N.slicePartitions=E,N.subdivisions=s,new R(N))},R.createGeometry=function(e){var r=e._radii;if(!(r.x<=0||r.y<=0||r.z<=0)){var i,a,R,l,h,N,d=o.fromCartesian3(r),I=e._stackPartitions,S=e._slicePartitions,M=e._subdivisions,O=M*(I+S-1),m=O-S+2,y=new Float64Array(3*m),p=c.createTypedArray(m,2*O),C=0,U=new Array(M),P=new Array(M);for(i=0;i<M;i++)R=_.TWO_PI*i/M,U[i]=A(R),P[i]=f(R);for(i=1;i<I;i++)for(l=Math.PI*i/I,h=A(l),N=f(l),a=0;a<M;a++)y[C++]=r.x*U[a]*N,y[C++]=r.y*P[a]*N,y[C++]=r.z*h;for(U.length=S,P.length=S,i=0;i<S;i++)R=_.TWO_PI*i/S,U[i]=A(R),P[i]=f(R);for(y[C++]=0,y[C++]=0,y[C++]=r.z,i=1;i<M;i++)for(l=Math.PI*i/M,h=A(l),N=f(l),a=0;a<S;a++)y[C++]=r.x*U[a]*N,y[C++]=r.y*P[a]*N,y[C++]=r.z*h;for(y[C++]=0,y[C++]=0,y[C++]=-r.z,C=0,i=0;i<I-1;++i){var L=i*M;for(a=0;a<M-1;++a)p[C++]=L+a,p[C++]=L+a+1;p[C++]=L+M-1,p[C++]=L}var F=M*(I-1);for(a=1;a<S+1;++a)p[C++]=F,p[C++]=F+a;for(i=0;i<M-2;++i){var D=i*S+1+F,v=(i+1)*S+1+F;for(a=0;a<S-1;++a)p[C++]=v+a,p[C++]=D+a;p[C++]=v+S-1,p[C++]=D+S-1}var w=y.length/3-1;for(a=w-1;a>w-S-1;--a)p[C++]=w,p[C++]=a;var B=new s({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y})});return new u({attributes:B,indices:p,primitiveType:T.LINES,boundingSphere:t.fromEllipsoid(d)})}},R}),define("Workers/createEllipsoidOutlineGeometry",["../Core/defined","../Core/EllipsoidOutlineGeometry"],function(t,e){"use strict";return function(n,r){return t(n.buffer,r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createGeometry.js b/engines/Cesium/Workers/createGeometry.js index 6168781..1d4e6b9 100644 --- a/engines/Cesium/Workers/createGeometry.js +++ b/engines/Cesium/Workers/createGeometry.js @@ -55,8 +55,8 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var E=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,E=n*u-a*o;return r.x=c,r.y=l,r.z=E,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(n),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),r(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,E=r.y,f=r.z,h=a.x,d=a.y,_=a.z,p=l*l*h*h,m=E*E*d*d,T=f*f*_*_,y=p+m+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(r,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,S=u.y,N=u.z,I=o;I.x=A.x*v*2,I.y=A.y*S*2,I.z=A.z*N*2;var M,O,g,C,w,P,x,L,U,b,F,D=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),B=0;do{D-=B,g=1/(1+D*v),C=1/(1+D*S),w=1/(1+D*N),P=g*g,x=C*C,L=w*w,U=P*g,b=x*C,F=L*w,M=p*P+m*x+T*L-1,O=p*U*v+m*b*S+T*F*N;var z=-2*O;B=M/z}while(Math.abs(M)>n.EPSILON12);return t(c)?(c.x=l*g,c.y=E*C,c.z=f*w,c):new e(l*g,E*C,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,a,i){return a=t(a,0),r(i)?(i.longitude=e,i.latitude=n,i.height=a,i):new u(e,n,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var d=r(n)?n.oneOverRadii:E,_=r(n)?n.oneOverRadiiSquared:f,p=r(n)?n._centerToleranceSquared:h,m=o(t,d,_,p,c);if(r(m)){var T=e.multiplyComponents(m,_,s);T=e.normalize(T,T);var y=e.subtract(t,m,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),v=i.sign(e.dot(y,t))*e.magnitude(y);return r(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,r){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._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,r){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,_=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,_),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(_[r],d[r])];t+=2*n*n}return Math.sqrt(t)}function E(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(_[i],d[i])]);o>n&&(a=i,n=o)}var c=1,l=0,E=d[a],f=_[a];if(Math.abs(e[s.getElementIndex(f,E)])>r){var h,p=e[s.getElementIndex(f,f)],m=e[s.getElementIndex(E,E)],T=e[s.getElementIndex(f,E)],y=(p-m)/2/T;h=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(E,E)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,E)]=l,t[s.getElementIndex(E,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=r-u-E+h,_=2*(a-f),p=2*(i+l),m=2*(a+f),T=-r+u-E+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),v=-r-u+E+h;return n(t)?(t[0]=d,t[1]=m,t[2]=R,t[3]=_,t[4]=T,t[5]=A,t[6]=p,t[7]=y,t[8]=v,t):new s(d,_,p,m,T,y,R,A,v)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,E=-i*u+c*o*a,f=c*u+i*o*a,h=r*u,d=i*a+c*o*u,_=-o*i+i*o*u,p=-o,m=c*r,T=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=E,t[4]=d,t[5]=m,t[6]=f,t[7]=_,t[8]=T,t):new s(l,E,f,h,d,_,p,m,T)},s.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var f=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),r};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=E,r},s.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},s.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},s.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],_=[2,2,1],p=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,i=0,o=0;n(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),d=r*c(h);o<a&&l(h)>d;)E(h,p),s.transpose(p,m),s.multiply(h,p,h),s.multiply(m,h,h),s.multiply(f,p,f),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],E=e[8],f=s.determinant(e);t[0]=o*E-l*u,t[1]=l*a-n*E,t[2]=n*u-o*a,t[3]=c*u-i*E,t[4]=r*E-c*a,t[5]=i*a-r*u,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/f;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){ -"use strict";function l(e,t,r,a,i,o,u,s,c,l,E,f,h,d,_,p){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(d,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(E,0),this[11]=n(_,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(p,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new l),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,r,i){return r=n(r,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,i):new l(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,E=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,_=t.y*t.w,p=t.z*t.z,m=t.z*t.w,T=t.w*t.w,y=s-h-p+T,R=2*(c-m),A=2*(E+_),v=2*(c+m),S=-s+h-p+T,N=2*(d-f),I=2*(E-_),M=2*(d+f),O=-s-h+p+T;return n[0]=y*i,n[1]=v*i,n[2]=I*i,n[3]=0,n[4]=R*o,n[5]=S*o,n[6]=M*o,n[7]=0,n[8]=A*u,n[9]=N*u,n[10]=O*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var E=new e,f=new e,h=new e;l.fromCamera=function(t,r){var n=t.position,i=t.direction,o=t.up;e.normalize(i,E),e.normalize(e.cross(E,o,f),f),e.normalize(e.cross(f,E,h),h);var u=f.x,s=f.y,c=f.z,d=E.x,_=E.y,p=E.z,m=h.x,T=h.y,y=h.z,R=n.x,A=n.y,v=n.z,S=u*-R+s*-A+c*-v,N=m*-R+T*-A+y*-v,I=d*R+_*A+p*v;return a(r)?(r[0]=u,r[1]=m,r[2]=-d,r[3]=0,r[4]=s,r[5]=T,r[6]=-_,r[7]=0,r[8]=c,r[9]=y,r[10]=-p,r[11]=0,r[12]=S,r[13]=N,r[14]=I,r[15]=1,r):new l(u,s,c,S,m,T,y,N,-d,-_,-p,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,E=-(n+r)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,E=.5*(r-t),f=c,h=l,d=E,_=i+c,p=o+l,m=t+E,T=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=_,a[13]=p,a[14]=m,a[15]=T,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var d=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),r};var _=new e;l.getMaximumScale=function(t){return l.getScale(t,_),e.maximumComponent(_)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],_=e[12],p=e[13],m=e[14],T=e[15],y=t[0],R=t[1],A=t[2],v=t[3],S=t[4],N=t[5],I=t[6],M=t[7],O=t[8],g=t[9],C=t[10],w=t[11],P=t[12],x=t[13],L=t[14],U=t[15],b=n*y+u*R+E*A+_*v,F=a*y+s*R+f*A+p*v,D=i*y+c*R+h*A+m*v,B=o*y+l*R+d*A+T*v,z=n*S+u*N+E*I+_*M,G=a*S+s*N+f*I+p*M,V=i*S+c*N+h*I+m*M,q=o*S+l*N+d*I+T*M,X=n*O+u*g+E*C+_*w,H=a*O+s*g+f*C+p*w,W=i*O+c*g+h*C+m*w,k=o*O+l*g+d*C+T*w,Y=n*P+u*x+E*L+_*U,Z=a*P+s*x+f*L+p*U,K=i*P+c*x+h*L+m*U,j=o*P+l*x+d*L+T*U;return r[0]=b,r[1]=F,r[2]=D,r[3]=B,r[4]=z,r[5]=G,r[6]=V,r[7]=q,r[8]=X,r[9]=H,r[10]=W,r[11]=k,r[12]=Y,r[13]=Z,r[14]=K,r[15]=j,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],_=t[0],p=t[1],m=t[2],T=t[4],y=t[5],R=t[6],A=t[8],v=t[9],S=t[10],N=t[12],I=t[13],M=t[14],O=n*_+o*p+c*m,g=a*_+u*p+l*m,C=i*_+s*p+E*m,w=n*T+o*y+c*R,P=a*T+u*y+l*R,x=i*T+s*y+E*R,L=n*A+o*v+c*S,U=a*A+u*v+l*S,b=i*A+s*v+E*S,F=n*N+o*I+c*M+f,D=a*N+u*I+l*M+h,B=i*N+s*I+E*M+d;return r[0]=O,r[1]=g,r[2]=C,r[3]=0,r[4]=w,r[5]=P,r[6]=x,r[7]=0,r[8]=L,r[9]=U,r[10]=b,r[11]=0,r[12]=F,r[13]=D,r[14]=B,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],_=t[3],p=t[4],m=t[5],T=t[6],y=t[7],R=t[8],A=n*f+o*h+c*d,v=a*f+u*h+l*d,S=i*f+s*h+E*d,N=n*_+o*p+c*m,I=a*_+u*p+l*m,M=i*_+s*p+E*m,O=n*T+o*y+c*R,g=a*T+u*y+l*R,C=i*T+s*y+E*R;return r[0]=A,r[1]=v,r[2]=S,r[3]=0,r[4]=N,r[5]=I,r[6]=M,r[7]=0,r[8]=O,r[9]=g,r[10]=C,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var p=new e;l.multiplyByUniformScale=function(e,t,r){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var m=new s,T=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,m),T,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],E=e[1],f=e[5],h=e[9],d=e[13],_=e[2],p=e[6],A=e[10],v=e[14],S=e[3],N=e[7],I=e[11],M=e[15],O=A*M,g=v*I,C=p*M,w=v*N,P=p*I,x=A*N,L=_*M,U=v*S,b=_*I,F=A*S,D=_*N,B=p*S,z=O*f+w*h+P*d-(g*f+C*h+x*d),G=g*E+L*h+F*d-(O*E+U*h+b*d),V=C*E+U*f+D*d-(w*E+L*f+B*d),q=x*E+b*f+B*h-(P*E+F*f+D*h),X=g*a+C*i+x*o-(O*a+w*i+P*o),H=O*n+U*i+b*o-(g*n+L*i+F*o),W=w*n+L*a+B*o-(C*n+U*a+D*o),k=P*n+F*a+D*i-(x*n+b*a+B*i);O=i*d,g=o*h,C=a*d,w=o*f,P=a*h,x=i*f,L=n*d,U=o*E,b=n*h,F=i*E,D=n*f,B=a*E;var Y=O*N+w*I+P*M-(g*N+C*I+x*M),Z=g*S+L*I+F*M-(O*S+U*I+b*M),K=C*S+U*N+D*M-(w*S+L*N+B*M),j=x*S+b*N+B*I-(P*S+F*N+D*I),Q=C*A+x*v+g*p-(P*v+O*p+w*A),J=b*v+O*_+U*A-(L*A+F*v+g*_),$=L*p+B*v+w*_-(D*v+C*_+U*p),ee=D*A+P*_+F*p-(b*p+B*A+x*_),te=n*z+a*G+i*V+o*q;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=z*te,r[1]=G*te,r[2]=V*te,r[3]=q*te,r[4]=X*te,r[5]=H*te,r[6]=W*te,r[7]=k*te,r[8]=Y*te,r[9]=Z*te,r[10]=K*te,r[11]=j*te,r[12]=Q*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-r*E-n*f-a*h,_=-i*E-o*f-u*h,p=-s*E-c*f-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=_,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(r(e,0)),t=u.toRadians(r(t,0)),a=u.toRadians(r(a,0)),i=u.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var _=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,_),c=Math.max(c,_)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=E,r):new s(a,l,i,E)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),E=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return n(r)?(r.west=l,r.south=f,r.east=E,r.north=h,r):new s(l,f,E,h)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),E=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=E,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0),n(o)||(o=[]);var l=0,E=e.north,f=e.south,h=e.east,d=e.west,_=c;_.height=a,_.longitude=d,_.latitude=E,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=h,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.latitude=f,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++,E<0?_.latitude=E:f>0?_.latitude=f:_.latitude=0;for(var p=1;p<8;++p)_.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=t.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=h,o[l]=t.cartographicToCartesian(_,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,E){"use strict";function f(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,d=new e,_=new e,p=new e,m=new e,T=new e,y=new e,R=new e,A=new e,v=new e,S=new e,N=new e;f.fromPoints=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],y),i=e.clone(n,h),o=e.clone(n,d),u=e.clone(n,_),s=e.clone(n,p),c=e.clone(n,m),l=e.clone(n,T),E=t.length,I=1;I<E;I++){e.clone(t[I],n);var M=n.x,O=n.y,g=n.z;M<i.x&&e.clone(n,i),M>s.x&&e.clone(n,s),O<o.y&&e.clone(n,o),O>c.y&&e.clone(n,c),g<u.z&&e.clone(n,u),g>l.z&&e.clone(n,l)}var C=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=i,L=s,U=C;w>U&&(U=w,x=o,L=c),P>U&&(U=P,x=u,L=l);var b=A;b.x=.5*(x.x+L.x),b.y=.5*(x.y+L.y),b.z=.5*(x.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,R)),D=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,R),.5,N),V=0;for(I=0;I<E;I++){e.clone(t[I],n);var q=e.magnitude(e.subtract(n,G,R));q>V&&(V=q);var X=e.magnitudeSquared(e.subtract(n,b,R));if(X>F){var H=Math.sqrt(X);D=.5*(D+H),F=D*D;var W=H-D;b.x=(D*b.x+W*n.x)/H,b.y=(D*b.y+W*n.y)/H,b.z=(D*b.z+W*n.z)/H}}return D<V?(e.clone(b,r.center),r.radius=D):(e.clone(G,r.center),r.radius=V),r};var I=new o,M=new e,O=new e,g=new t,C=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,I),E.southwest(t,g),g.height=i,E.northeast(t,C),C.height=o;var s=r.project(g,M),c=r.project(C,O),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*h,_.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,r,o){t=n(t,i.WGS84),r=n(r,0);var u;return a(e)&&(u=E.subsample(e,t,r,w)),f.fromPoints(u,o)},f.fromVertices=function(t,r,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),i=n(i,3);var u=y;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,_),E=e.clone(u,p),I=e.clone(u,m),M=e.clone(u,T),O=t.length,g=0;g<O;g+=i){var C=t[g]+r.x,w=t[g+1]+r.y,P=t[g+2]+r.z;u.x=C,u.y=w,u.z=P,C<s.x&&e.clone(u,s),C>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),P<l.z&&e.clone(u,l),P>M.z&&e.clone(u,M)}var x=e.magnitudeSquared(e.subtract(E,s,R)),L=e.magnitudeSquared(e.subtract(I,c,R)),U=e.magnitudeSquared(e.subtract(M,l,R)),b=s,F=E,D=x;L>D&&(D=L,b=c,F=I),U>D&&(D=U,b=l,F=M);var B=A;B.x=.5*(b.x+F.x),B.y=.5*(b.y+F.y),B.z=.5*(b.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(z),V=v;V.x=s.x,V.y=c.y,V.z=l.z;var q=S;q.x=E.x,q.y=I.y,q.z=M.z;var X=e.multiplyByScalar(e.add(V,q,R),.5,N),H=0;for(g=0;g<O;g+=i){u.x=t[g]+r.x,u.y=t[g+1]+r.y,u.z=t[g+2]+r.z;var W=e.magnitude(e.subtract(u,X,R));W>H&&(H=W);var k=e.magnitudeSquared(e.subtract(u,B,R));if(k>z){var Y=Math.sqrt(k);G=.5*(G+Y),z=G*G;var Z=Y-G;B.x=(G*B.x+Z*u.x)/Y,B.y=(G*B.y+Z*u.y)/Y,B.z=(G*B.z+Z*u.z)/Y}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},f.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new f),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=y;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,_),c=e.clone(i,p),l=e.clone(i,m),E=e.clone(i,T),I=t.length,M=0;M<I;M+=3){var O=t[M]+r[M],g=t[M+1]+r[M+1],C=t[M+2]+r[M+2];i.x=O,i.y=g,i.z=C,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),C<s.z&&e.clone(i,s),C>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=e.magnitudeSquared(e.subtract(E,s,R)),L=o,U=c,b=w;P>b&&(b=P,L=u,U=l),x>b&&(b=x,L=s,U=E);var F=A;F.x=.5*(L.x+U.x),F.y=.5*(L.y+U.y),F.z=.5*(L.z+U.z);var D=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(D),z=v;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=E.z;var V=e.multiplyByScalar(e.add(z,G,R),.5,N),q=0;for(M=0;M<I;M+=3){i.x=t[M]+r[M],i.y=t[M+1]+r[M+1],i.z=t[M+2]+r[M+2];var X=e.magnitude(e.subtract(i,V,R));X>q&&(q=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>D){var W=Math.sqrt(H);B=.5*(B+W),D=B*B;var k=W-B;F.x=(B*F.x+k*i.x)/W,F.y=(B*F.y+k*i.y)/W,F.z=(B*F.z+k*i.z)/W}}return B<q?(e.clone(F,n.center),n.radius=B):(e.clone(V,n.center),n.radius=q),n},f.fromCornerPoints=function(t,r,n){a(n)||(n=new f);var i=n.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),n.radius=e.distance(i,r),n},f.fromEllipsoid=function(t,r){return a(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var P=new e;f.fromBoundingSpheres=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return f.clone(t[0],r);if(2===n)return f.union(t[0],t[1],r);for(var i=[],o=0;o<n;o++)i.push(t[o].center);r=f.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var x=new e,L=new e,U=new e;f.fromOrientedBoundingBox=function(t,r){a(r)||(r=new f);var n=t.halfAxes,i=c.getColumn(n,0,x),o=c.getColumn(n,1,L),u=c.getColumn(n,2,U),s=e.magnitude(i),l=e.magnitude(o),E=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,E),r},f.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},f.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new f);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var b=new e,F=new e;f.union=function(t,r,n){a(n)||(n=new f);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,b),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,n.center),n.radius=E,n};var D=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,D));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var B=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,B);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;f.computePlaneDistances=function(t,r,n,i){a(i)||(i=new s);var o=e.subtract(t.center,r,z),u=e.dot(n,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,V=new e,q=new e,X=new e,H=new e,W=new t,k=new Array(8),Y=0;Y<8;++Y)k[Y]=new e;var Z=new o;return f.projectTo2D=function(t,r,a){r=n(r,Z);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,V);e.normalize(c,c);var l=e.cross(s,c,q);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,H),h=e.negate(c,X),d=k,_=d[0];e.add(s,l,_),e.add(_,c,_),_=d[1],e.add(s,l,_),e.add(_,h,_),_=d[2],e.add(s,E,_),e.add(_,h,_),_=d[3],e.add(s,E,_),e.add(_,c,_),e.negate(s,s),_=d[4],e.add(s,l,_),e.add(_,c,_),_=d[5],e.add(s,l,_),e.add(_,h,_),_=d[6],e.add(s,E,_),e.add(_,h,_),_=d[7],e.add(s,E,_),e.add(_,c,_);for(var p=d.length,m=0;m<p;++m){var T=d[m];e.add(o,T,T);var y=i.cartesianToCartographic(T,W);r.project(y,T)}a=f.fromPoints(d,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,r){return f.computePlaneDistances(this,e,t,r)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=n(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(S)&&(S=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=n(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,M=n(e[1]),M.isNightly=!!e[2])}return I}function c(){return s()&&M}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1])))}return O}function E(){return l()&&g}function f(){if(!t(C)){C=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,w=n(e[1]))}return C}function h(){return f()&&w}function d(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent); -null!==e&&(P=!0,x=n(e[1]))}return P}function _(){return t(L)||(L=/Windows/i.test(R.appVersion)),L}function p(){return d()&&x}function m(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function T(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(b=r)}return F}function y(){return T()?b:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,S,N,I,M,O,g,C,w,P,x,L,U,b,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:p,isWindows:_,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:T,imageRenderingValue:y};return D.supportsFullscreen=function(){return r.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var a=0;a<n;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var E=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,a){"use strict";var i={};i.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,r){return i.octDecodeInRange(e,t,255,r)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return i.octDecode(n,a,t)},i.octPack=function(e,t,r,n){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(r,o);return n.x=65536*s.x+a,n.y=65536*s.y+u,n},i.octUnpack=function(e,t,r,n){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,r),i.octDecode(o,s,n)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},i.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var E,f,h,d,_,p,m,T;r(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(n,a,u),d=t.dot(E,E),_=t.dot(E,f),p=t.dot(E,h),m=t.dot(f,f),T=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(n,a,u),d=e.dot(E,E),_=e.dot(E,f),p=e.dot(E,h),m=e.dot(f,f),T=e.dot(f,h));var y=1/(d*m-_*_);return l.y=(m*p-_*T)*y,l.z=(d*T-_*p)*y,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,E=r(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(E),t.EPSILON14);return n>0?[f/e,a/f]:[a/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,_=o*c-u*s,p=u*c-h,m=4*d*p-_*_;if(m<0){var T,y,R;f*E>=l*h?(T=o,y=d,R=-2*u*d+o*_):(T=c,y=p,R=-c*_+2*s*p);var A=R<0?-1:1,v=-A*Math.abs(T)*Math.sqrt(-m);i=-R+v;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),I=i===v?-N:-y/N;return a=y<=0?N+I:-R/(N*N+I*I+y),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var M=d,O=-2*u*d+o*_,g=p,C=-c*_+2*s*p,w=Math.sqrt(m),P=Math.sqrt(3)/2,x=Math.abs(Math.atan2(o*w,-O)/3);a=2*Math.sqrt(-M);var L=Math.cos(x);i=a*L;var U=a*(-L/2-P*Math.sin(x)),b=i+U>2*u?i-u:U-u,F=o,D=b/F;x=Math.abs(Math.atan2(c*w,-C)/3),a=2*Math.sqrt(-g),L=Math.cos(x),i=a*L,U=a*(-L/2-P*Math.sin(x));var B=-c,z=i+U<2*s?i+s:U+s,G=B/z,V=F*z,q=-b*z-F*B,X=b*B,H=(s*q-u*X)/(-u*q+s*V);return D<=H?D<=G?H<=G?[D,H,G]:[D,G,H]:[G,D,H]:D<=G?[H,D,G]:H<=G?[H,G,D]:[G,H,D]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var _,p=d[0],m=d[1];if(p>=0&&m>=0){var T=Math.sqrt(p),y=Math.sqrt(m);return[f-y,f-T,f+T,f+y]}if(p>=0&&m<0)return _=Math.sqrt(p),[f-_,f+_];if(p<0&&m>=0)return _=Math.sqrt(m),[f-_,f+_]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,S=n.computeRealRoots(1,R,A),N=n.computeRealRoots(1,-R,v);return 0!==S.length?(S[0]+=f,S[1]+=f,0!==N.length?(N[0]+=f,N[1]+=f,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=f,N[1]+=f,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,_,p=h[0],m=a-p,T=m*m,y=t/2,R=m/2,A=T-4*o,v=T+4*Math.abs(o),S=c-4*p,N=c+4*Math.abs(p);if(p<0||A*N<S*v){var I=Math.sqrt(S);d=I/2,_=0===I?0:(t*R-i)/I}else{var M=Math.sqrt(A);d=0===M?0:(t*R-i)/M,_=M/2}var O,g;0===y&&0===d?(O=0,g=0):r.sign(y)===r.sign(d)?(O=y+d,g=p/O):(g=y-d,O=p/g);var C,w;0===R&&0===_?(C=0,w=0):r.sign(R)===r.sign(_)?(C=R+_,w=o/C):(w=R-_,C=o/w);var P=n.computeRealRoots(1,O,C),x=n.computeRealRoots(1,g,w);if(0!==P.length)return 0!==x.length?P[1]<=x[0]?[P[0],P[1],x[0],x[1]]:x[1]<=P[0]?[x[0],x[1],P[0],P[1]]:P[0]>=x[0]&&P[1]<=x[1]?[x[0],P[0],P[1],x[1]]:x[0]>=P[0]&&x[1]<=P[1]?[P[0],x[0],x[1],P[1]]:P[0]>x[0]&&P[0]<x[1]?[x[0],P[0],x[1],P[1]]:[P[0],x[0],P[1],x[1]]:P;if(0!==x.length)return x}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,E=n*n,f=E*n,h=a*a,d=h*a,_=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*o*d+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*E+144*i*r*E)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return _},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n}return a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";function E(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function f(t,r,a){n(a)||(a=new i);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,T),f=e.dot(u,u),h=2*e.dot(u,l),d=e.magnitudeSquared(l)-c,_=E(f,h,d,v);if(n(_))return a.start=_.root0,a.stop=_.root1,a}function h(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function d(t,r,n,a,i){var l,E=a*a,f=i*i,d=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,_=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),p=t[u.COLUMN0ROW0]*E+t[u.COLUMN2ROW2]*f+a*r.x+n,m=f*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),T=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),y=[];if(0===T&&0===m){if(l=s.computeRealRoots(d,_,p),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)), -2===l.length){var v=l[1],S=Math.sqrt(Math.max(1-v*v,0));y.push(new e(a,i*v,i*-S)),y.push(new e(a,i*v,i*S))}return y}var N=T*T,I=m*m,M=d*d,O=T*m,g=M+I,C=2*(_*d+O),w=2*p*d+_*_-I+N,P=2*(p*_-O),x=p*p-N;if(0===g&&0===C&&0===w&&0===P)return y;l=c.computeRealRoots(g,C,w,P,x);var L=l.length;if(0===L)return y;for(var U=0;U<L;++U){var b,F=l[U],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B);b=o.sign(d)===o.sign(p)?h(d*D+p,_*F,o.EPSILON12):o.sign(p)===o.sign(_*F)?h(d*D,_*F+p,o.EPSILON12):h(d*D+_*F,p,o.EPSILON12);var G=h(m*F,T,o.EPSILON15),V=b*G;V<0?y.push(new e(a,i*F,i*z)):V>0?y.push(new e(a,i*F,i*-z)):0!==z?(y.push(new e(a,i*F,i*-z)),y.push(new e(a,i*F,i*z)),++U):y.push(new e(a,i*F,i*z))}return y}var _={};_.rayPlane=function(t,r,a){n(a)||(a=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,m=new e,T=new e,y=new e,R=new e;_.rayTriangleParametric=function(t,n,a,i,u){u=r(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,_=e.subtract(a,n,p),A=e.subtract(i,n,m),v=e.cross(d,A,T),S=e.dot(_,v);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,n,y),l=e.dot(s,v),l<0||l>S)return;if(c=e.cross(s,_,R),E=e.dot(d,c),E<0||l+E>S)return;f=e.dot(A,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(h,n,y),l=e.dot(s,v)*N,l<0||l>1)return;if(c=e.cross(s,_,R),E=e.dot(d,c)*N,E<0||l+E>1)return;f=e.dot(A,c)*N}return f},_.rayTriangle=function(t,r,a,i,o,u){var s=_.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;_.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=_.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};_.raySphere=function(e,t,r){if(r=f(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new l;_.lineSegmentSphere=function(t,r,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,I=new e;_.rayEllipsoid=function(t,r){var n,a,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),E=e.multiplyComponents(c,t.direction,I),f=e.magnitudeSquared(l),h=e.dot(l,E);if(f>1){if(h>=0)return;var d=h*h;if(n=f-1,a=e.magnitudeSquared(E),o=a*n,d<o)return;if(d>o){u=h*h-o,s=-h+Math.sqrt(u);var _=s/a,p=n/s;return _<p?new i(_,p):{start:p,stop:_}}var m=Math.sqrt(n/a);return new i(m,m)}return f<1?(n=f-1,a=e.magnitudeSquared(E),o=a*n,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(E),new i(0,-h/a)):void 0};var M=new e,O=new e,g=new e,C=new e,w=new e,P=new u,x=new u,L=new u,U=new u,b=new u,F=new u,D=new u,B=new e,z=new e,G=new t;_.grazingAltitudeLocation=function(t,r){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,M);if(e.dot(i,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(i,M),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,C),h=e.normalize(e.cross(f,E,O),O),_=e.normalize(e.cross(E,h,g),g),p=P;p[0]=E.x,p[1]=E.y,p[2]=E.z,p[3]=h.x,p[4]=h.y,p[5]=h.z,p[6]=_.x,p[7]=_.y,p[8]=_.z;var m=u.transpose(p,x),T=u.fromScale(r.radii,L),y=u.fromScale(r.oneOverRadii,U),R=b;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,v,S=u.multiply(u.multiply(m,y,F),R,F),N=u.multiply(u.multiply(S,T,D),p,D),I=u.multiplyByVector(S,a,w),V=d(N,e.negate(I,M),0,0,1),q=V.length;if(q>0){for(var X=e.clone(e.ZERO,z),H=Number.NEGATIVE_INFINITY,W=0;W<q;++W){A=u.multiplyByVector(T,u.multiplyByVector(p,V[W],B),B);var k=e.normalize(e.subtract(A,a,C),C),Y=e.dot(k,i);Y>H&&(H=Y,X=e.clone(A,X))}var Z=r.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),v=e.magnitude(e.subtract(X,a,C))*Math.sqrt(1-H*H),v=c?-v:v,Z.height=v,r.cartographicToCartesian(Z,new e)}};var V=new e;return _.lineSegmentPlane=function(t,r,a,i){n(i)||(i=new e);var u=e.subtract(r,t,V),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,i),e.add(t,i,i),i}},_.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return _.lineSegmentPlane(t,r,a,E),_.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return _.lineSegmentPlane(r,n,a,E),_.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return _.lineSegmentPlane(n,t,a,E),_.lineSegmentPlane(n,r,a,f),{positions:[t,r,n,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return _.lineSegmentPlane(r,t,a,E),_.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return _.lineSegmentPlane(n,r,a,E),_.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return _.lineSegmentPlane(t,n,a,E),_.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},_}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var i=new e;return a.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,i),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new a(o,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=n(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[n[f]]>i&&(c[n[f]]=E,++E);return(E-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<r.length;){var f=r[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],_=0;_<l;_++)d[_]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var p=0;E<h;)d[o[E]].vertexTriangles.push(p),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(p),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(p),++d[o[E+2]].numLiveTriangles,++p,E+=3;var m=0,T=s+1;i=1;var y,R,A=[],v=[],S=0,N=[],I=c/3,M=[];for(_=0;_<I;_++)M[_]=!1;for(var O,g;m!==-1;){A=[],R=d[m],g=R.vertexTriangles.length;for(var C=0;C<g;++C)if(p=R.vertexTriangles[C],!M[p]){M[p]=!0,E=p+p+p;for(var w=0;w<3;++w)O=o[E],A.push(O),v.push(O),N[S]=O,++S,y=d[O],--y.numLiveTriangles,T-y.timeStamp>s&&(y.timeStamp=T,++T),++E}m=a(o,s,A,d,T,v,l)}return N},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h,d,_,p,m,T,y,R,A,v,S,N){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function M(e){for(var t=e.length,r=t/3*6,n=p.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function g(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=p.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function C(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new d({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function w(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),A.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function x(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function L(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,E=1;E<n;++E){var f=e[E][t].attributes[r];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[r]=new d({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var n,i,o,u,s,l,E,f=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),_=e[0][t].primitiveType,m=L(e,t);for(n in m)if(m.hasOwnProperty(n))for(s=m[n].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[n].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var T;if(d){var y=0;for(i=0;i<f;++i)y+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:m,primitiveType:S.POINTS})),A=p.createTypedArray(R,y),v=0,N=0;for(i=0;i<f;++i){var I=e[i][t].indices,M=I.length;for(u=0;u<M;++u)A[v++]=N+I[u];N+=h.computeNumberOfVertices(e[i][t])}T=A}var O,g=new a,C=0;for(i=0;i<f;++i){if(O=e[i][t].boundingSphere,!c(O)){g=void 0;break}a.add(O.center,g,g)}if(c(g))for(a.divideByScalar(g,f,g),i=0;i<f;++i){O=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(O.center,g,se))+O.radius;w>C&&(C=w)}return new h({attributes:m,indices:T,primitiveType:_,boundingSphere:c(g)?new r(g,C):void 0})}function b(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function D(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function z(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function V(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return F(e);case S.TRIANGLE_STRIP:return D(e);case S.TRIANGLES:return b(e);case S.LINE_STRIP:return z(e);case S.LINE_LOOP:return G(e);case S.LINES:return B(e)}return e}function q(e,t){Math.abs(e.y)<y.EPSILON6&&(t?e.y=-y.EPSILON6:e.y=y.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return q(e,e.y<0),q(t,t.y<0),void q(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?y.sign(e.y):y.sign(r.y):i>o?y.sign(t.y):y.sign(r.y);var u=n<0;q(e,u),q(t,u),q(r,u)}function H(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Ae),e.y/(e.y-t.y),Ae),r),a.clone(r,n),q(r,!0),q(n,!1)}function W(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){X(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Me.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(H(e,t,ve,Ne),H(e,r,Se,Ie),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,r,ve,Ne),H(t,e,Se,Ie),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(r,e,ve,Ne),H(r,t,Se,Ie),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(H(r,e,ve,Ne),H(r,t,Se,Ie),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,r,ve,Ne),H(t,e,Se,Ie),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,ve,Ne),H(e,r,Se,Ie),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Me.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=ve,s[4]=Se,s[5]=Ne,s[6]=Ie,s.length=7),Me}}function k(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=p.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function Y(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function Z(e,t,r){var n=c(e.geometry.boundingSphere);t=k(t,n),r=k(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function K(e,r,i,o,u,s,l,E,f,h,d,_){if(c(s)||c(l)||c(E)||c(f)||c(h)){var p=a.fromArray(u,3*e,Oe),m=a.fromArray(u,3*r,ge),T=a.fromArray(u,3*i,Ce),y=t(o,p,m,T,we);if(c(s)){var R=a.fromArray(s,3*e,Oe),A=a.fromArray(s,3*r,ge),v=a.fromArray(s,3*i,Ce);a.multiplyByScalar(R,y.x,R),a.multiplyByScalar(A,y.y,A),a.multiplyByScalar(v,y.z,v);var S=a.add(R,A,R);a.add(S,v,S),a.normalize(S,S),a.pack(S,d.normal.values,3*_)}if(c(h)){var N=a.fromArray(h,3*e,Oe),I=a.fromArray(h,3*r,ge),M=a.fromArray(h,3*i,Ce);a.multiplyByScalar(N,y.x,N),a.multiplyByScalar(I,y.y,I),a.multiplyByScalar(M,y.z,M);var O;a.equals(N,a.ZERO)&&a.equals(I,a.ZERO)&&a.equals(M,a.ZERO)?(O=Oe,O.x=0,O.y=0,O.z=0):(O=a.add(N,I,N),a.add(O,M,O),a.normalize(O,O)),a.pack(O,d.extrudeDirection.values,3*_)}if(c(l)){var g=a.fromArray(l,3*e,Oe),C=a.fromArray(l,3*r,ge),w=a.fromArray(l,3*i,Ce);a.multiplyByScalar(g,y.x,g),a.multiplyByScalar(C,y.y,C),a.multiplyByScalar(w,y.z,w);var P=a.add(g,C,g);a.add(P,w,P),a.normalize(P,P),a.pack(P,d.tangent.values,3*_)}if(c(E)){var x=a.fromArray(E,3*e,Oe),L=a.fromArray(E,3*r,ge),U=a.fromArray(E,3*i,Ce);a.multiplyByScalar(x,y.x,x),a.multiplyByScalar(L,y.y,L),a.multiplyByScalar(U,y.z,U);var b=a.add(x,L,x);a.add(b,U,b),a.normalize(b,b),a.pack(b,d.bitangent.values,3*_)}if(c(f)){var F=n.fromArray(f,2*e,Pe),D=n.fromArray(f,2*r,xe),B=n.fromArray(f,2*i,Le);n.multiplyByScalar(F,y.x,F),n.multiplyByScalar(D,y.y,D),n.multiplyByScalar(B,y.z,B);var z=n.add(F,D,F);n.add(z,B,z),n.pack(z,d.st.values,2*_)}}}function j(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,_=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,p=u.indices,m=Y(u),T=Y(u),y=[];y.length=l.length/3;var R=[];for(R.length=l.length/3,o=0;o<y.length;++o)y[o]=-1,R[o]=-1;var A=p.length;for(o=0;o<A;o+=3){var v=p[o],S=p[o+1],N=p[o+2],I=a.fromArray(l,3*v),M=a.fromArray(l,3*S),O=a.fromArray(l,3*N),g=W(I,M,O);if(c(g)&&g.positions.length>3)for(var C=g.positions,w=g.indices,P=w.length,x=0;x<P;++x){var L=w[x],U=C[L];U.y<0?(t=T.attributes,r=T.indices,n=y):(t=m.attributes,r=m.indices,n=R),i=j(t,r,n,p,L<3?o+L:-1,U),K(v,S,N,U,l,E,h,f,d,_,t,i)}else c(g)&&(I=g.positions[0],M=g.positions[1],O=g.positions[2]),I.y<0?(t=T.attributes,r=T.indices,n=y):(t=m.attributes,r=m.indices,n=R),i=j(t,r,n,p,o,I),K(v,S,N,I,l,E,h,f,d,_,t,i),i=j(t,r,n,p,o+1,M),K(v,S,N,M,l,E,h,f,d,_,t,i),i=j(t,r,n,p,o+2,O),K(v,S,N,O,l,E,h,f,d,_,t,i)}Z(e,T,m)}function J(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=Y(r),s=Y(r),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],_=a.fromArray(i,3*h,Oe),p=a.fromArray(i,3*d,ge);Math.abs(_.y)<y.EPSILON6&&(_.y<0?_.y=-y.EPSILON6:_.y=y.EPSILON6),Math.abs(p.y)<y.EPSILON6&&(p.y<0?p.y=-y.EPSILON6:p.y=y.EPSILON6);var m=u.attributes,R=u.indices,A=f,v=s.attributes,S=s.indices,N=E,I=T.lineSegmentPlane(_,p,Ue,Ce);if(c(I)){var M=a.multiplyByScalar(a.UNIT_Y,5*y.EPSILON9,be);_.y<0&&(a.negate(M,M),m=s.attributes,R=s.indices,A=E,v=u.attributes,S=u.indices,N=f);var O=a.add(I,M,Fe);j(m,R,A,o,t,_),j(m,R,A,o,-1,O),a.negate(M,M),a.add(I,M,O),j(v,S,N,o,-1,O),j(v,S,N,o,t+1,p)}else{var g,C,w;_.y<0?(g=s.attributes,C=s.indices,w=E):(g=u.attributes,C=u.indices,w=f),j(g,C,w,o,t,_),j(g,C,w,o,t+1,p)}}Z(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,ze);if(!(s.x>0)){var c=a.unpack(n,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,Ve);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,_=c(s.color)?s.color.values:void 0,p=Y(u),m=Y(u),R=!1,A=l.length/3;for(t=0;t<A;t+=4){var v=t,S=t+2,N=a.fromArray(l,3*v,ze),I=a.fromArray(l,3*S,Ge);if(Math.abs(N.y)<Ye)for(N.y=Ye*(I.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,r=3*v;r<3*v+12;r+=3)E[r]=l[3*t],E[r+1]=l[3*t+1],E[r+2]=l[3*t+2];if(Math.abs(I.y)<Ye)for(I.y=Ye*(N.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*v;r<3*v+12;r+=3)f[r]=l[3*(t+2)],f[r+1]=l[3*(t+2)+1],f[r+2]=l[3*(t+2)+2];var M=p.attributes,O=p.indices,g=m.attributes,C=m.indices,w=T.lineSegmentPlane(N,I,Ue,qe);if(c(w)){R=!0;var P=a.multiplyByScalar(a.UNIT_Y,ke,Xe);N.y<0&&(a.negate(P,P),M=m.attributes,O=m.indices,g=p.attributes,C=p.indices);var x=a.add(w,P,He);M.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),M.position.values.push(x.x,x.y,x.z),M.position.values.push(x.x,x.y,x.z),M.prevPosition.values.push(E[3*v],E[3*v+1],E[3*v+2]),M.prevPosition.values.push(E[3*v+3],E[3*v+4],E[3*v+5]),M.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),a.negate(P,P),a.add(w,P,x),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.nextPosition.values.push(f[3*S],f[3*S+1],f[3*S+2]),g.nextPosition.values.push(f[3*S+3],f[3*S+4],f[3*S+5]);var L=n.fromArray(h,2*v,De),U=Math.abs(L.y);M.expandAndWidth.values.push(-1,U,1,U),M.expandAndWidth.values.push(-1,-U,1,-U),g.expandAndWidth.values.push(-1,U,1,U),g.expandAndWidth.values.push(-1,-U,1,-U);var b=a.magnitudeSquared(a.subtract(w,N,Ve));if(b/=a.magnitudeSquared(a.subtract(I,N,Ve)),c(_)){var F=i.fromArray(_,4*v,We),D=i.fromArray(_,4*S,We),B=y.lerp(F.x,D.x,b),z=y.lerp(F.y,D.y,b),G=y.lerp(F.z,D.z,b),V=y.lerp(F.w,D.w,b);for(r=4*v;r<4*v+8;++r)M.color.values.push(_[r]);for(M.color.values.push(B,z,G,V),M.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),r=4*S;r<4*S+8;++r)g.color.values.push(_[r])}if(c(d)){var q=n.fromArray(d,2*v,De),X=n.fromArray(d,2*(t+3),Be),H=y.lerp(q.x,X.x,b);for(r=2*v;r<2*v+4;++r)M.st.values.push(d[r]);for(M.st.values.push(H,q.y),M.st.values.push(H,X.y),g.st.values.push(H,q.y),g.st.values.push(H,X.y),r=2*S;r<2*S+4;++r)g.st.values.push(d[r])}o=M.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=g.position.values.length/3-4,C.push(o,o+2,o+1),C.push(o+1,o+2,o+3)}else{var W,k;for(N.y<0?(W=m.attributes,k=m.indices):(W=p.attributes,k=p.indices),W.position.values.push(N.x,N.y,N.z),W.position.values.push(N.x,N.y,N.z),W.position.values.push(I.x,I.y,I.z),W.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)W.prevPosition.values.push(E[r]),W.nextPosition.values.push(f[r]);for(r=2*t;r<2*t+8;++r)W.expandAndWidth.values.push(h[r]),c(d)&&W.st.values.push(d[r]);if(c(_))for(r=4*t;r<4*t+16;++r)W.color.values.push(_[r]);o=W.position.values.length/3-4,k.push(o,o+2,o+1),k.push(o+1,o+2,o+3)}}R&&($(m),$(p)),Z(e,m,p)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=M(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=g(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*n,l[E++]=a[f+1]+i[f+1]*n,l[E++]=a[f+2]+i[f+2]*n;var _,p=e.boundingSphere;return c(p)&&(_=new r(p.center,p.radius+n)),new h({attributes:{position:new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:_})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=p.createTypedArray(t,s),E=0,f=0,d=0;E<s;)i=n[o[E]],i!==-1?l[f]=i:(i=o[E],n[i]=d,l[f]=d,++d),++E,++f;e.indices=l;var _=e.attributes;for(var m in _)if(_.hasOwnProperty(m)&&c(_[m])&&c(_[m].values)){for(var T=_[m],y=T.values,R=0,A=T.componentsPerAttribute,v=u.createTypedArray(T.componentDatatype,d*A);R<t;){var S=n[R];if(S!==-1)for(a=0;a<A;a++)v[A*S+a]=y[A*R+a];++R}T.values=v}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=N.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=y.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=C(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var E=0;E<l;E+=n){for(var f=0;f<n;++f){var d=s[E+f],_=a[d];c(_)||(_=o++,a[d]=_,w(u,e.attributes,d)),i.push(_)}o+n>=y.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=C(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new f;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),h=0,_=0;_<l.length;_+=3){var p=a.fromArray(l,_,re),m=s.cartesianToCartographic(p,ne),T=i.project(m,re);E[h++]=T.x,E[h++]=T.y,E[h++]=T.z}return e.attributes[r]=o,e.attributes[n]=new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)E.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var f=a.componentsPerAttribute;return e.attributes[r]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[n]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var ie=new a,oe=new A,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(A.inverse(t,oe),A.transpose(oe,oe),A.getRotation(oe,ue),x(ue,n.normal),x(ue,n.tangent),x(ue,n.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),r.length>0&&(o.push(U(r,"westHemisphereGeometry")),o.push(U(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,Ee=new a,fe=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],_=t[E+1],p=t[E+2],m=3*h,T=3*_,R=3*p;le.x=n[m],le.y=n[m+1],le.z=n[m+2],Ee.x=n[T],Ee.y=n[T+1],Ee.z=n[T+2],fe.x=n[R],fe.y=n[R+1],fe.z=n[R+2],s[h].count++,s[_].count++,s[p].count++,a.subtract(Ee,le,Ee),a.subtract(fe,le,fe),c[f]=a.cross(Ee,fe,new a),f++}var A=0;for(E=0;E<i;E++)s[E].indexOffset+=A,A+=s[E].count;f=0;var v;for(E=0;E<o;E+=3){v=s[t[E]];var S=v.indexOffset+v.currentCount;l[S]=f,v.currentCount++,v=s[t[E+1]],S=v.indexOffset+v.currentCount,l[S]=f,v.currentCount++,v=s[t[E+2]],S=v.indexOffset+v.currentCount,l[S]=f,v.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var I=3*E;if(v=s[E],a.clone(a.ZERO,ce),v.count>0){for(f=0;f<v.count;f++)a.add(ce,c[l[v.indexOffset+f]],ce);a.equalsEpsilon(a.ZERO,ce,y.EPSILON10)&&a.clone(c[l[v.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,y.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),N[I]=ce.x,N[I+1]=ce.y,N[I+2]=ce.z}return e.attributes.normal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,de=new a,_e=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var _=t[l],p=t[l+1],m=t[l+2];E=3*_,f=3*p,h=3*m;var T=2*_,y=2*p,R=2*m,A=r[E],v=r[E+1],S=r[E+2],N=i[T],I=i[T+1],M=i[y+1]-I,O=i[R+1]-I,g=1/((i[y]-N)*O-(i[R]-N)*M),C=(O*(r[f]-A)-M*(r[h]-A))*g,w=(O*(r[f+1]-v)-M*(r[h+1]-v))*g,P=(O*(r[f+2]-S)-M*(r[h+2]-S))*g;c[E]+=C,c[E+1]+=w,c[E+2]+=P,c[f]+=C,c[f+1]+=w,c[f+2]+=P,c[h]+=C,c[h+1]+=w,c[h+2]+=P}var x=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var U=a.fromArray(n,E,he),b=a.fromArray(c,E,_e),F=a.dot(U,b);a.multiplyByScalar(U,F,de),a.normalize(a.subtract(b,de,b),b),x[E]=b.x,x[f]=b.y,x[h]=b.z,a.normalize(a.cross(U,b,b),b),L[E]=b.x,L[f]=b.y,L[h]=b.z}return e.attributes.tangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:x}),e.attributes.bitangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e};var pe=new n,me=new a,Te=new a,ye=new a,Re=new n;te.compressVertices=function(t){var r,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),E=0;for(r=0;r<i;++r)a.fromArray(s,3*r,me),a.equals(me,a.ZERO)?E+=2:(Re=e.octEncodeInRange(me,65535,Re),l[E++]=Re.x,l[E++]=Re.y);return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var f=t.attributes.normal,h=t.attributes.st,_=c(f),p=c(h);if(!_&&!p)return t;var m,T,y,R,A=t.attributes.tangent,v=t.attributes.bitangent,S=c(A),N=c(v);_&&(m=f.values),p&&(T=h.values),S&&(y=A.values),N&&(R=v.values);var I=_?m.length:T.length,M=_?3:2;i=I/M;var O=i,g=p&&_?2:1;g+=S||N?1:0,O*=g;var C=new Float32Array(O),w=0;for(r=0;r<i;++r){p&&(n.fromArray(T,2*r,pe),C[w++]=e.compressTextureCoordinates(pe));var P=3*r;_&&c(y)&&c(R)?(a.fromArray(m,P,me),a.fromArray(y,P,Te),a.fromArray(R,P,ye),e.octPack(me,Te,ye,pe),C[w++]=pe.x,C[w++]=pe.y):(_&&(a.fromArray(m,P,me),C[w++]=e.octEncodeFloat(me)),S&&(a.fromArray(y,P,me),C[w++]=e.octEncodeFloat(me)),N&&(a.fromArray(R,P,me),C[w++]=e.octEncodeFloat(me)))}return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:g,values:C}),_&&delete t.attributes.normal,p&&delete t.attributes.st,N&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Ae=new a,ve=new a,Se=new a,Ne=new a,Ie=new a,Me={positions:new Array(7),indices:new Array(9)},Oe=new a,ge=new a,Ce=new a,we=new a,Pe=new n,xe=new n,Le=new n,Ue=v.fromPointNormal(a.ZERO,a.UNIT_Y),be=new a,Fe=new a,De=new n,Be=new n,ze=new a,Ge=new a,Ve=new a,qe=new a,Xe=new a,He=new a,We=new i,ke=5*y.EPSILON9,Ye=y.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,v.ORIGIN_ZX_PLANE)!==m.INTERSECTING)return e}if(t.geometryType!==_.NONE)switch(t.geometryType){case _.POLYLINES:ee(e);break;case _.TRIANGLES:Q(e);break;case _.LINES:J(e)}else V(t),t.primitiveType===S.TRIANGLES?Q(e):t.primitiveType===S.LINES&&J(e);return e},te}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},s.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h){ -"use strict";function d(e,t,n){var a,i=!n,o=e.length;if(!i&&o>1){var u=e[0].modelMatrix;for(a=1;a<o;++a)if(!f.equals(u,e[a].modelMatrix)){i=!0;break}}if(i)for(a=0;a<o;++a)r(e[a].geometry)&&l.transformToWorldCoordinates(e[a]);else f.multiplyTransformation(t,e[0].modelMatrix,t)}function _(e,r){var n=e.attributes,a=n.position,i=a.values.length/a.componentsPerAttribute;n.batchId=new s({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(i)});for(var o=n.batchId.values,u=0;u<i;++u)o[u]=r}function p(e){for(var t=e.length,n=0;n<t;++n){var a=e[n];r(a.geometry)?_(a.geometry,n):r(a.westHemisphereGeometry)&&r(a.eastHemisphereGeometry)&&(_(a.westHemisphereGeometry,n),_(a.eastHemisphereGeometry,n))}}function m(n){var a,i,o,u=n.instances,s=n.projection,c=n.elementIndexUintSupported,E=n.scene3DOnly,f=n.vertexCacheOptimize,h=n.compressVertices,_=n.modelMatrix,m=u.length;for(a=0;a<m;++a)if(r(u[a].geometry)){o=u[a].geometry.primitiveType;break}if(d(u,_,E),!E)for(a=0;a<m;++a)r(u[a].geometry)&&l.splitLongitude(u[a]);if(p(u),f)for(a=0;a<m;++a){var T=u[a];r(T.geometry)?(l.reorderForPostVertexCache(T.geometry),l.reorderForPreVertexCache(T.geometry)):r(T.westHemisphereGeometry)&&r(T.eastHemisphereGeometry)&&(l.reorderForPostVertexCache(T.westHemisphereGeometry),l.reorderForPreVertexCache(T.westHemisphereGeometry),l.reorderForPostVertexCache(T.eastHemisphereGeometry),l.reorderForPreVertexCache(T.eastHemisphereGeometry))}var y=l.combineInstances(u);for(m=y.length,a=0;a<m;++a){i=y[a];var R,A=i.attributes;if(E)for(R in A)A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE&&l.encodeAttribute(i,R,R+"3DHigh",R+"3DLow");else for(R in A)if(A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE){var v=R+"3D",S=R+"2D";l.projectTo2D(i,R,v,S,s),r(i.boundingSphere)&&"position"===R&&(i.boundingSphereCV=e.fromVertices(i.attributes.position2D.values)),l.encodeAttribute(i,v,v+"High",v+"Low"),l.encodeAttribute(i,S,S+"High",S+"Low")}h&&l.compressVertices(i)}if(!c){var N=[];for(m=y.length,a=0;a<m;++a)i=y[a],N=N.concat(l.fitToUnsignedShortIndices(i));y=N}return y}function T(e,t,n,a){var i,o,u,s=a.length-1;if(s>=0){var c=a[s];i=c.offset+c.count,u=c.index,o=n[u].indices.length}else i=0,u=0,o=n[u].indices.length;for(var l=e.length,E=0;E<l;++E){var f=e[E],h=f[t];if(r(h)){var d=h.indices.length;i+d>o&&(i=0,o=n[++u].indices.length),a.push({index:u,offset:i,count:d}),i+=d}}}function y(e,t){var r=[];return T(e,"geometry",t,r),T(e,"westHemisphereGeometry",t,r),T(e,"eastHemisphereGeometry",t,r),r}function R(e,t){var n=e.attributes;for(var a in n)if(n.hasOwnProperty(a)){var i=n[a];r(i)&&r(i.values)&&t.push(i.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function A(e,t){for(var r=e.length,n=0;n<r;++n)R(e[n],t)}function v(t){for(var n=1,a=t.length,i=0;i<a;i++){var o=t[i];if(++n,r(o)){var u=o.attributes;n+=6+2*e.packedLength+(r(o.indices)?o.indices.length:0);for(var s in u)if(u.hasOwnProperty(s)&&r(u[s])){var c=u[s];n+=5+c.values.length}}}return n}function S(e,t){var r=e.length,n=new Float64Array(1+16*r),a=0;n[a++]=r;for(var i=0;i<r;i++){var o=e[i];f.pack(o.modelMatrix,n,a),a+=f.packedLength}return t.push(n.buffer),n}function N(e){for(var t=e,r=new Array(t[0]),n=0,a=1;a<t.length;){var i=f.unpack(t,a);a+=f.packedLength,r[n++]={modelMatrix:i}}return r}function I(t){var n=t.length,a=1+(e.packedLength+1)*n,i=new Float32Array(a),o=0;i[o++]=n;for(var u=0;u<n;++u){var s=t[u];r(s)?(i[o++]=1,e.pack(t[u],i,o)):i[o++]=0,o+=e.packedLength}return i}function M(t){for(var r=new Array(t[0]),n=0,a=1;a<t.length;)1===t[a++]&&(r[n]=e.unpack(t,a)),++n,a+=e.packedLength;return r}if(!i.supportsTypedArrays())return{};var O={};return O.combineGeometry=function(t){var n,a,i=t.instances,o=i.length;o>0&&(n=m(t),n.length>0&&(a=l.createAttributeLocations(n[0])));var u;t.createPickOffsets&&n.length>0&&(u=y(i,n));for(var s=new Array(o),c=new Array(o),E=0;E<o;++E){var f=i[E],h=f.geometry;r(h)&&(s[E]=h.boundingSphere,c[E]=h.boundingSphereCV);var d=f.eastHemisphereGeometry,_=f.westHemisphereGeometry;r(d)&&r(_)&&(r(d.boundingSphere)&&r(_.boundingSphere)&&(s[E]=e.union(d.boundingSphere,_.boundingSphere)),r(d.boundingSphereCV)&&r(_.boundingSphereCV)&&(c[E]=e.union(d.boundingSphereCV,_.boundingSphereCV)))}return{geometries:n,modelMatrix:t.modelMatrix,attributeLocations:a,pickOffsets:u,boundingSpheres:s,boundingSpheresCV:c}},O.packCreateGeometryResults=function(t,n){var a=new Float64Array(v(t)),i=[],o={},u=t.length,s=0;a[s++]=u;for(var c=0;c<u;c++){var l=t[c],E=r(l);if(a[s++]=E?1:0,E){a[s++]=l.primitiveType,a[s++]=l.geometryType;var f=r(l.boundingSphere)?1:0;a[s++]=f,f&&e.pack(l.boundingSphere,a,s),s+=e.packedLength;var h=r(l.boundingSphereCV)?1:0;a[s++]=h,h&&e.pack(l.boundingSphereCV,a,s),s+=e.packedLength;var d=l.attributes,_=[];for(var p in d)d.hasOwnProperty(p)&&r(d[p])&&(_.push(p),r(o[p])||(o[p]=i.length,i.push(p)));a[s++]=_.length;for(var m=0;m<_.length;m++){var T=_[m],y=d[T];a[s++]=o[T],a[s++]=y.componentDatatype,a[s++]=y.componentsPerAttribute,a[s++]=y.normalize?1:0,a[s++]=y.values.length,a.set(y.values,s),s+=y.values.length}var R=r(l.indices)?l.indices.length:0;a[s++]=R,R>0&&(a.set(l.indices,s),s+=R)}}return n.push(a.buffer),{stringTable:i,packedData:a}},O.unpackCreateGeometryResults=function(r){for(var n,a=r.stringTable,i=r.packedData,o=new Array(i[0]),l=0,f=1;f<i.length;){var h=1===i[f++];if(h){var d,_,p=i[f++],m=i[f++],T=1===i[f++];T&&(d=e.unpack(i,f)),f+=e.packedLength;var y=1===i[f++];y&&(_=e.unpack(i,f)),f+=e.packedLength;var R,A,v,S=new c,N=i[f++];for(n=0;n<N;n++){var I=a[i[f++]],M=i[f++];v=i[f++];var O=0!==i[f++];R=i[f++],A=t.createTypedArray(M,R);for(var g=0;g<R;g++)A[g]=i[f++];S[I]=new s({componentDatatype:M,componentsPerAttribute:v,normalize:O,values:A})}var C;if(R=i[f++],R>0){var w=A.length/v;for(C=E.createTypedArray(w,R),n=0;n<R;n++)C[n]=i[f++]}o[l++]=new u({primitiveType:p,geometryType:m,boundingSphere:d,boundingSphereCV:_,indices:C,attributes:S})}else o[l++]=void 0}return o},O.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,a=0;a<n;a++)t.push(r[a].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:S(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},O.unpackCombineGeometryParameters=function(e){for(var t=N(e.packedInstances),r=e.createGeometryResults,n=r.length,i=0,u=0;u<n;u++)for(var s=O.unpackCreateGeometryResults(r[u]),c=s.length,l=0;l<c;l++){var E=s[l],d=t[i];d.geometry=E,++i}var _=a.clone(e.ellipsoid),p=e.isGeographic?new o(_):new h(_);return{instances:t,ellipsoid:_,projection:p,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:f.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},O.packCombineGeometryResults=function(e,t){r(e.geometries)&&A(e.geometries,t);var n=I(e.boundingSpheres),a=I(e.boundingSpheresCV);return t.push(n.buffer,a.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:n,boundingSpheresCV:a}},O.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:M(e.boundingSpheres),boundingSpheresCV:M(e.boundingSpheresCV)}},O}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,n=t.name,a=t.message;r=e(n)&&e(a)?n+": "+a:t.toString();var i=t.stack;return e(i)&&(r+="\n"+i),r}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function n(n){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=n(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return n}),define("Workers/createGeometry",["../Core/defined","../Scene/PrimitivePipeline","./createTaskProcessorWorker","require"],function(e,t,r,n){"use strict";function a(t){var r=o[t];return e(r)||("object"==typeof exports?o[r]=r=n("Workers/"+t):n(["./"+t],function(e){r=e,o[r]=e})),r}function i(r,n){for(var i=r.subTasks,o=i.length,u=new Array(o),s=0;s<o;s++){var c=i[s],l=c.geometry,E=c.moduleName;if(e(E)){var f=a(E);u[s]=f(l,c.offset)}else u[s]=l}return t.packCreateGeometryResults(u,n)}var o={};return r(i)})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(n,a){if(!e(a))throw new t(r(n))},a.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},a.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},a.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},a.typeOf.number.lessThan=function(e,r,n){if(a.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(e,r,n){if(a.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(e,r,n){if(a.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},a.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*a.clamp(e,-1,1)+.5)*r)},a.fromSNorm=function(e,r){return r=t(r,255),a.clamp(e,0,r)/r*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},a.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},a.lerp=function(e,t,r){return(1-r)*e+r*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,r,n,a){a=t(a,n);var i=Math.abs(e-r);return i<=a||i<=n*Math.max(Math.abs(e),Math.abs(r))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var r=i[t-1],n=t;n<=e;n++)i.push(r*n);return i[e]},a.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(i),n},o.fromElements=function(e,t,n,a){return r(a)?(a.x=e,a.y=t,a.z=n,a):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var a=0;a<n;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var a=0;a<n;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var E=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)},o.cross=function(e,t,r){var n=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-n*s,E=n*u-a*o;return r.x=c,r.y=l,r.z=E,r},o.fromDegrees=function(e,t,r,n,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,r,n,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,a,i,u){a=t(a,0);var s=r(i)?i.radiiSquared:d,c=Math.cos(n);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(n),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),r(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var a=e.length;r(n)?n.length=a/2:n=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var a=e.length;r(n)?n.length=a/3:n=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function a(r,a,u,s,c){var l=r.x,E=r.y,f=r.z,h=a.x,d=a.y,_=a.z,p=l*l*h*h,T=E*E*d*d,m=f*f*_*_,y=p+T+m,R=Math.sqrt(1/y),A=e.multiplyByScalar(r,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var v=u.x,S=u.y,N=u.z,I=o;I.x=A.x*v*2,I.y=A.y*S*2,I.z=A.z*N*2;var M,O,g,C,w,P,x,L,U,b,F,D=(1-R)*e.magnitude(r)/(.5*e.magnitude(I)),B=0;do{D-=B,g=1/(1+D*v),C=1/(1+D*S),w=1/(1+D*N),P=g*g,x=C*C,L=w*w,U=P*g,b=x*C,F=L*w,M=p*P+T*x+m*L-1,O=p*U*v+T*b*S+m*F*N;var z=-2*O;B=M/z}while(Math.abs(M)>n.EPSILON12);return t(c)?(c.x=l*g,c.y=E*C,c.z=f*w,c):new e(l*g,E*C,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o){"use strict";function u(e,t,n){this.longitude=r(e,0),this.latitude=r(t,0),this.height=r(n,0)}u.fromRadians=function(e,t,a,i){return a=r(a,0),n(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,r,n){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var d=n(r)?r.oneOverRadii:E,_=n(r)?r.oneOverRadiiSquared:f,p=n(r)?r._centerToleranceSquared:h,T=o(t,d,_,p,c);if(n(T)){var m=e.multiplyComponents(T,_,s);m=e.normalize(m,m);var y=e.subtract(t,T,l),R=Math.atan2(m.y,m.x),A=Math.asin(m.z),v=i.sign(e.dot(y,t))*e.magnitude(y);return n(a)?(a.longitude=R,a.latitude=A,a.height=v,a):new u(R,A,v)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,a,i,o,u,s){"use strict";function c(t,n,a,i){n=r(n,0),a=r(a,0),i=r(i,0),t._radii=new e(n,a,i),t._radiiSquared=new e(n*n,a*a,i*i),t._radiiToTheFourth=new e(n*n*n*n,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===n?0:1/n,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(n,a,i),t._maximumRadius=Math.max(n,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,r){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._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}a(l.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}}}),l.clone=function(t,r){if(n(t)){var a=t._radii;return n(r)?(e.clone(a,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,a){return a=r(a,0),e.pack(t._radii,n,a),n},l.unpack=function(t,n,a){n=r(n,0);var i=e.unpack(t,n);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,r){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),n(r)||(r=new e),e.add(i,a,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,_=new e;return l.prototype.cartesianToCartographic=function(r,a){var i=this.scaleToGeodeticSurface(r,d);if(n(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(r,i,_),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,r))*e.magnitude(s);return n(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var a=0;a<r;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=r(a,0);var o=this._sqauredXOverSquaredZ;if(n(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,a,i,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},u.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a,i,o,u,s,c){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(i,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(_[r],d[r])];t+=2*n*n}return Math.sqrt(t)}function E(e,t){for(var r=u.EPSILON15,n=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(_[i],d[i])]);o>n&&(a=i,n=o)}var c=1,l=0,E=d[a],f=_[a];if(Math.abs(e[s.getElementIndex(f,E)])>r){var h,p=e[s.getElementIndex(f,f)],T=e[s.getElementIndex(E,E)],m=e[s.getElementIndex(f,E)],y=(p-T)/2/m;h=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(E,E)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,E)]=l,t[s.getElementIndex(E,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=r-u-E+h,_=2*(a-f),p=2*(i+l),T=2*(a+f),m=-r+u-E+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),v=-r-u+E+h;return n(t)?(t[0]=d,t[1]=T,t[2]=R,t[3]=_,t[4]=m,t[5]=A,t[6]=p,t[7]=y,t[8]=v,t):new s(d,_,p,T,m,y,R,A,v)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*a,E=-i*u+c*o*a,f=c*u+i*o*a,h=r*u,d=i*a+c*o*u,_=-c*a+i*o*u,p=-o,T=c*r,m=i*r;return n(t)?(t[0]=l,t[1]=h,t[2]=p,t[3]=E,t[4]=d,t[5]=T,t[6]=f,t[7]=_,t[8]=m,t):new s(l,E,f,h,d,_,p,T,m)},s.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=a,t[6]=0,t[7]=-a,t[8]=r,t):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=r,t):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),a=Math.sin(e);return n(t)?(t[0]=r,t[1]=a,t[2]=0,t[3]=-a,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,a=e[n],i=e[n+1],o=e[n+2];return r.x=a,r.y=i,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var a=3*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],a=e[t+3],i=e[t+6];return r.x=n,r.y=a,r.z=i,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var f=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),r};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=a,r[2]=i,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=E,r},s.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},s.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},s.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[3]*a+e[6]*i,u=e[1]*n+e[4]*a+e[7]*i,s=e[2]*n+e[5]*a+e[8]*i;return r.x=o,r.y=u,r.z=s,r},s.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var r=e[0],n=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],_=[2,2,1],p=new s,T=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,a=10,i=0,o=0;n(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),d=r*c(h);o<a&&l(h)>d;)E(h,p),s.transpose(p,T),s.multiply(h,p,h),s.multiply(T,h,h),s.multiply(f,p,f),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*n-r*c)+u*(r*o-i*n)},s.inverse=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],E=e[8],f=s.determinant(e);t[0]=o*E-l*u,t[1]=l*a-n*E,t[2]=n*u-o*a,t[3]=c*u-i*E,t[4]=r*E-c*a,t[5]=i*a-r*u,t[6]=i*l-c*o,t[7]=c*n-r*l,t[8]=r*o-i*n;var h=1/f;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r,n,a){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(a,0)}o.fromElements=function(e,t,n,a,i){return r(i)?(i.x=e,i.y=t,i.z=n,i.w=a,i):new o(e,t,n,a)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n++],a.z=e[n++],a.w=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var a=0;a<n;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var a=0;a<n;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)&&i.equalsEpsilon(e.z,t.z,n,a)&&i.equalsEpsilon(e.w,t.w,n,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,a,i,o,u,s,c){ +"use strict";function l(e,t,r,a,i,o,u,s,c,l,E,f,h,d,_,p){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(c,0),this[3]=n(h,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(d,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(E,0),this[11]=n(_,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(p,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,r){return t=n(t,0),a(r)||(r=new l),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,r,i){return r=n(r,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=r.x,i[13]=r.y,i[14]=r.z,i[15]=1,i):new l(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,n){a(n)||(n=new l);var i=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,E=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,_=t.y*t.w,p=t.z*t.z,T=t.z*t.w,m=t.w*t.w,y=s-h-p+m,R=2*(c-T),A=2*(E+_),v=2*(c+T),S=-s+h-p+m,N=2*(d-f),I=2*(E-_),M=2*(d+f),O=-s-h+p+m;return n[0]=y*i,n[1]=v*i,n[2]=I*i,n[3]=0,n[4]=R*o,n[5]=S*o,n[6]=M*o,n[7]=0,n[8]=A*u,n[9]=N*u,n[10]=O*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var E=new e,f=new e,h=new e;l.fromCamera=function(t,r){var n=t.position,i=t.direction,o=t.up;e.normalize(i,E),e.normalize(e.cross(E,o,f),f),e.normalize(e.cross(f,E,h),h);var u=f.x,s=f.y,c=f.z,d=E.x,_=E.y,p=E.z,T=h.x,m=h.y,y=h.z,R=n.x,A=n.y,v=n.z,S=u*-R+s*-A+c*-v,N=T*-R+m*-A+y*-v,I=d*R+_*A+p*v;return a(r)?(r[0]=u,r[1]=T,r[2]=-d,r[3]=0,r[4]=s,r[5]=m,r[6]=-_,r[7]=0,r[8]=c,r[9]=y,r[10]=-p,r[11]=0,r[12]=S,r[13]=N,r[14]=I,r[15]=1,r):new l(u,s,c,S,T,m,y,N,-d,-_,-p,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,r,n,a,i,o){var u=1/(t-e),s=1/(n-r),c=1/(i-a),l=-(t+e)*u,E=-(n+r)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,a,i,o){var u=2*a/(t-e),s=2*a/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,a,i){var o=2*a/(t-e),u=2*a/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,r,a){e=n(e,n.EMPTY_OBJECT);var i=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,E=.5*(r-t),f=c,h=l,d=E,_=i+c,p=o+l,T=t+E,m=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=_,a[13]=p,a[14]=T,a[15]=m,a},l.computeView=function(t,r,n,a,i){return i[0]=a.x,i[1]=n.x,i[2]=-r.x,i[3]=0,i[4]=a.y,i[5]=n.y,i[6]=-r.y,i[7]=0,i[8]=a.z,i[9]=n.z,i[10]=-r.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(n,t),i[14]=e.dot(r,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,a=e[n],i=e[n+1],o=e[n+2],u=e[n+3];return r.x=a,r.y=i,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var a=4*t;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return r.x=n,r.y=a,r.z=i,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var d=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),r};var _=new e;l.getMaximumScale=function(t){return l.getScale(t,_),e.maximumComponent(_)},l.multiply=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],_=e[12],p=e[13],T=e[14],m=e[15],y=t[0],R=t[1],A=t[2],v=t[3],S=t[4],N=t[5],I=t[6],M=t[7],O=t[8],g=t[9],C=t[10],w=t[11],P=t[12],x=t[13],L=t[14],U=t[15],b=n*y+u*R+E*A+_*v,F=a*y+s*R+f*A+p*v,D=i*y+c*R+h*A+T*v,B=o*y+l*R+d*A+m*v,z=n*S+u*N+E*I+_*M,G=a*S+s*N+f*I+p*M,V=i*S+c*N+h*I+T*M,q=o*S+l*N+d*I+m*M,X=n*O+u*g+E*C+_*w,H=a*O+s*g+f*C+p*w,W=i*O+c*g+h*C+T*w,k=o*O+l*g+d*C+m*w,Y=n*P+u*x+E*L+_*U,Z=a*P+s*x+f*L+p*U,K=i*P+c*x+h*L+T*U,j=o*P+l*x+d*L+m*U;return r[0]=b,r[1]=F,r[2]=D,r[3]=B,r[4]=z,r[5]=G,r[6]=V,r[7]=q,r[8]=X,r[9]=H,r[10]=W,r[11]=k,r[12]=Y,r[13]=Z,r[14]=K,r[15]=j,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},l.multiplyTransformation=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],_=t[0],p=t[1],T=t[2],m=t[4],y=t[5],R=t[6],A=t[8],v=t[9],S=t[10],N=t[12],I=t[13],M=t[14],O=n*_+o*p+c*T,g=a*_+u*p+l*T,C=i*_+s*p+E*T,w=n*m+o*y+c*R,P=a*m+u*y+l*R,x=i*m+s*y+E*R,L=n*A+o*v+c*S,U=a*A+u*v+l*S,b=i*A+s*v+E*S,F=n*N+o*I+c*M+f,D=a*N+u*I+l*M+h,B=i*N+s*I+E*M+d;return r[0]=O,r[1]=g,r[2]=C,r[3]=0,r[4]=w,r[5]=P,r[6]=x,r[7]=0,r[8]=L,r[9]=U,r[10]=b,r[11]=0,r[12]=F,r[13]=D,r[14]=B,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],_=t[3],p=t[4],T=t[5],m=t[6],y=t[7],R=t[8],A=n*f+o*h+c*d,v=a*f+u*h+l*d,S=i*f+s*h+E*d,N=n*_+o*p+c*T,I=a*_+u*p+l*T,M=i*_+s*p+E*T,O=n*m+o*y+c*R,g=a*m+u*y+l*R,C=i*m+s*y+E*R;return r[0]=A,r[1]=v,r[2]=S,r[3]=0,r[4]=N,r[5]=I,r[6]=M,r[7]=0,r[8]=O,r[9]=g,r[10]=C,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=n*e[0]+a*e[4]+i*e[8]+e[12],u=n*e[1]+a*e[5]+i*e[9]+e[13],s=n*e[2]+a*e[6]+i*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var p=new e;l.multiplyByUniformScale=function(e,t,r){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,r)},l.multiplyByScale=function(e,t,r){var n=t.x,a=t.y,i=t.z;return 1===n&&1===a&&1===i?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=a*e[4],r[5]=a*e[5],r[6]=a*e[6],r[7]=0,r[8]=i*e[8],r[9]=i*e[9],r[10]=i*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*n+e[4]*a+e[8]*i+e[12]*o,s=e[1]*n+e[5]*a+e[9]*i+e[13]*o,c=e[2]*n+e[6]*a+e[10]*i+e[14]*o,l=e[3]*n+e[7]*a+e[11]*i+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i,u=e[1]*n+e[5]*a+e[9]*i,s=e[2]*n+e[6]*a+e[10]*i;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,a=t.y,i=t.z,o=e[0]*n+e[4]*a+e[8]*i+e[12],u=e[1]*n+e[5]*a+e[9]*i+e[13],s=e[2]*n+e[6]*a+e[10]*i+e[14];return r.x=o,r.y=u,r.z=s,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var r=e[1],n=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var T=new s,m=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,T),m,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],a=e[4],i=e[8],o=e[12],E=e[1],f=e[5],h=e[9],d=e[13],_=e[2],p=e[6],A=e[10],v=e[14],S=e[3],N=e[7],I=e[11],M=e[15],O=A*M,g=v*I,C=p*M,w=v*N,P=p*I,x=A*N,L=_*M,U=v*S,b=_*I,F=A*S,D=_*N,B=p*S,z=O*f+w*h+P*d-(g*f+C*h+x*d),G=g*E+L*h+F*d-(O*E+U*h+b*d),V=C*E+U*f+D*d-(w*E+L*f+B*d),q=x*E+b*f+B*h-(P*E+F*f+D*h),X=g*a+C*i+x*o-(O*a+w*i+P*o),H=O*n+U*i+b*o-(g*n+L*i+F*o),W=w*n+L*a+B*o-(C*n+U*a+D*o),k=P*n+F*a+D*i-(x*n+b*a+B*i);O=i*d,g=o*h,C=a*d,w=o*f,P=a*h,x=i*f,L=n*d,U=o*E,b=n*h,F=i*E,D=n*f,B=a*E;var Y=O*N+w*I+P*M-(g*N+C*I+x*M),Z=g*S+L*I+F*M-(O*S+U*I+b*M),K=C*S+U*N+D*M-(w*S+L*N+B*M),j=x*S+b*N+B*I-(P*S+F*N+D*I),Q=C*A+x*v+g*p-(P*v+O*p+w*A),J=b*v+O*_+U*A-(L*A+F*v+g*_),$=L*p+B*v+w*_-(D*v+C*_+U*p),ee=D*A+P*_+F*p-(b*p+B*A+x*_),te=n*z+a*G+i*V+o*q;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=z*te,r[1]=G*te,r[2]=V*te,r[3]=q*te,r[4]=X*te,r[5]=H*te,r[6]=W*te,r[7]=k*te,r[8]=Y*te,r[9]=Z*te,r[10]=K*te,r[11]=j*te,r[12]=Q*te,r[13]=J*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-r*E-n*f-a*h,_=-i*E-o*f-u*h,p=-s*E-c*f-l*h;return t[0]=r,t[1]=i,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=_,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e,t,n,a){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},s.unpack=function(e,t,a){return t=r(t,0),n(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(r(e,0)),t=u.toRadians(r(t,0)),a=u.toRadians(r(a,0)),i=u.toRadians(r(i,0)),n(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(a,0),o.north=r(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];r=Math.min(r,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-r>o-i&&(r=i,a=o,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=a,t.north=l,t):new s(r,c,a,l)},s.fromCartesianArray=function(e,t,r){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var _=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,_),c=Math.max(c,_)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=i,r.north=E,r):new s(a,l,i,E)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),E=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return n(r)?(r.west=l,r.south=f,r.east=E,r.north=h,r):new s(l,f,E,h)}},s.simpleIntersection=function(e,t,r){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return n(r)?(r.west=a,r.south=i,r.east=o,r.north=u,r):new s(a,i,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),E=u.convertLongitudeRange(Math.max(a,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=E,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var r=t.longitude,n=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<i||u.equalsEpsilon(r,i,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=r(t,i.WGS84),a=r(a,0),n(o)||(o=[]);var l=0,E=e.north,f=e.south,h=e.east,d=e.west,_=c;_.height=a,_.longitude=d,_.latitude=E,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=h,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.latitude=f,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++,E<0?_.latitude=E:f>0?_.latitude=f:_.latitude=0;for(var p=1;p<8;++p)_.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=t.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=h,o[l]=t.cartographicToCartesian(_,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,a,i,o,u,s,c,l,E){"use strict";function f(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var h=new e,d=new e,_=new e,p=new e,T=new e,m=new e,y=new e,R=new e,A=new e,v=new e,S=new e,N=new e;f.fromPoints=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],y),i=e.clone(n,h),o=e.clone(n,d),u=e.clone(n,_),s=e.clone(n,p),c=e.clone(n,T),l=e.clone(n,m),E=t.length,I=1;I<E;I++){e.clone(t[I],n);var M=n.x,O=n.y,g=n.z;M<i.x&&e.clone(n,i),M>s.x&&e.clone(n,s),O<o.y&&e.clone(n,o),O>c.y&&e.clone(n,c),g<u.z&&e.clone(n,u),g>l.z&&e.clone(n,l)}var C=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=i,L=s,U=C;w>U&&(U=w,x=o,L=c),P>U&&(U=P,x=u,L=l);var b=A;b.x=.5*(x.x+L.x),b.y=.5*(x.y+L.y),b.z=.5*(x.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,R)),D=Math.sqrt(F),B=v;B.x=i.x,B.y=o.y,B.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,R),.5,N),V=0;for(I=0;I<E;I++){e.clone(t[I],n);var q=e.magnitude(e.subtract(n,G,R));q>V&&(V=q);var X=e.magnitudeSquared(e.subtract(n,b,R));if(X>F){var H=Math.sqrt(X);D=.5*(D+H),F=D*D;var W=H-D;b.x=(D*b.x+W*n.x)/H,b.y=(D*b.y+W*n.y)/H,b.z=(D*b.z+W*n.z)/H}}return D<V?(e.clone(b,r.center),r.radius=D):(e.clone(G,r.center),r.radius=V),r};var I=new o,M=new e,O=new e,g=new t,C=new t;f.fromRectangle2D=function(e,t,r){return f.fromRectangleWithHeights2D(e,t,0,0,r)},f.fromRectangleWithHeights2D=function(t,r,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,I),E.southwest(t,g),g.height=i,E.northeast(t,C),C.height=o;var s=r.project(g,M),c=r.project(C,O),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*h,_.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,r,o){t=n(t,i.WGS84),r=n(r,0);var u;return a(e)&&(u=E.subsample(e,t,r,w)),f.fromPoints(u,o)},f.fromVertices=function(t,r,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),i=n(i,3);var u=y;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,_),E=e.clone(u,p),I=e.clone(u,T),M=e.clone(u,m),O=t.length,g=0;g<O;g+=i){var C=t[g]+r.x,w=t[g+1]+r.y,P=t[g+2]+r.z;u.x=C,u.y=w,u.z=P,C<s.x&&e.clone(u,s),C>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>I.y&&e.clone(u,I),P<l.z&&e.clone(u,l),P>M.z&&e.clone(u,M)}var x=e.magnitudeSquared(e.subtract(E,s,R)),L=e.magnitudeSquared(e.subtract(I,c,R)),U=e.magnitudeSquared(e.subtract(M,l,R)),b=s,F=E,D=x;L>D&&(D=L,b=c,F=I),U>D&&(D=U,b=l,F=M);var B=A;B.x=.5*(b.x+F.x),B.y=.5*(b.y+F.y),B.z=.5*(b.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(z),V=v;V.x=s.x,V.y=c.y,V.z=l.z;var q=S;q.x=E.x,q.y=I.y,q.z=M.z;var X=e.multiplyByScalar(e.add(V,q,R),.5,N),H=0;for(g=0;g<O;g+=i){u.x=t[g]+r.x,u.y=t[g+1]+r.y,u.z=t[g+2]+r.z;var W=e.magnitude(e.subtract(u,X,R));W>H&&(H=W);var k=e.magnitudeSquared(e.subtract(u,B,R));if(k>z){var Y=Math.sqrt(k);G=.5*(G+Y),z=G*G;var Z=Y-G;B.x=(G*B.x+Z*u.x)/Y,B.y=(G*B.y+Z*u.y)/Y,B.z=(G*B.z+Z*u.z)/Y}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},f.fromEncodedCartesianVertices=function(t,r,n){if(a(n)||(n=new f),!a(t)||!a(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var i=y;i.x=t[0]+r[0],i.y=t[1]+r[1],i.z=t[2]+r[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,_),c=e.clone(i,p),l=e.clone(i,T),E=e.clone(i,m),I=t.length,M=0;M<I;M+=3){var O=t[M]+r[M],g=t[M+1]+r[M+1],C=t[M+2]+r[M+2];i.x=O,i.y=g,i.z=C,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),C<s.z&&e.clone(i,s),C>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,R)),P=e.magnitudeSquared(e.subtract(l,u,R)),x=e.magnitudeSquared(e.subtract(E,s,R)),L=o,U=c,b=w;P>b&&(b=P,L=u,U=l),x>b&&(b=x,L=s,U=E);var F=A;F.x=.5*(L.x+U.x),F.y=.5*(L.y+U.y),F.z=.5*(L.z+U.z);var D=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(D),z=v;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=E.z;var V=e.multiplyByScalar(e.add(z,G,R),.5,N),q=0;for(M=0;M<I;M+=3){i.x=t[M]+r[M],i.y=t[M+1]+r[M+1],i.z=t[M+2]+r[M+2];var X=e.magnitude(e.subtract(i,V,R));X>q&&(q=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>D){var W=Math.sqrt(H);B=.5*(B+W),D=B*B;var k=W-B;F.x=(B*F.x+k*i.x)/W,F.y=(B*F.y+k*i.y)/W,F.z=(B*F.z+k*i.z)/W}}return B<q?(e.clone(F,n.center),n.radius=B):(e.clone(V,n.center),n.radius=q),n},f.fromCornerPoints=function(t,r,n){a(n)||(n=new f);var i=n.center;return e.add(t,r,i),e.multiplyByScalar(i,.5,i),n.radius=e.distance(i,r),n},f.fromEllipsoid=function(t,r){return a(r)||(r=new f),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var P=new e;f.fromBoundingSpheres=function(t,r){if(a(r)||(r=new f),!a(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return f.clone(t[0],r);if(2===n)return f.union(t[0],t[1],r);for(var i=[],o=0;o<n;o++)i.push(t[o].center);r=f.fromPoints(i,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return r.radius=s,r};var x=new e,L=new e,U=new e;f.fromOrientedBoundingBox=function(t,r){a(r)||(r=new f);var n=t.halfAxes,i=c.getColumn(n,0,x),o=c.getColumn(n,1,L),u=c.getColumn(n,2,U);return e.add(i,o,i),e.add(i,u,i),r.center=e.clone(t.center,r.center),r.radius=e.magnitude(i),r},f.clone=function(t,r){if(a(t))return a(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,r){r=n(r,0);var a=e.center;return t[r++]=a.x,t[r++]=a.y,t[r++]=a.z,t[r]=e.radius,t},f.unpack=function(e,t,r){t=n(t,0),a(r)||(r=new f);var i=r.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],r.radius=e[t],r};var b=new e,F=new e;f.union=function(t,r,n){a(n)||(n=new f);var i=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,i,b),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,n.center),n.radius=E,n};var D=new e;f.expand=function(t,r,n){n=f.clone(t,n);var a=e.magnitude(e.subtract(r,n.center,D));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(t,r){var n=t.center,a=t.radius,i=r.normal,o=e.dot(i,n)+r.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var B=new e;f.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,B);return e.magnitudeSquared(n)-t.radius*t.radius},f.transformWithoutScale=function(e,t,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;f.computePlaneDistances=function(t,r,n,i){a(i)||(i=new s);var o=e.subtract(t.center,r,z),u=e.dot(n,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,V=new e,q=new e,X=new e,H=new e,W=new t,k=new Array(8),Y=0;Y<8;++Y)k[Y]=new e;var Z=new o;return f.projectTo2D=function(t,r,a){r=n(r,Z);var i=r.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,V);e.normalize(c,c);var l=e.cross(s,c,q);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,H),h=e.negate(c,X),d=k,_=d[0];e.add(s,l,_),e.add(_,c,_),_=d[1],e.add(s,l,_),e.add(_,h,_),_=d[2],e.add(s,E,_),e.add(_,h,_),_=d[3],e.add(s,E,_),e.add(_,c,_),e.negate(s,s),_=d[4],e.add(s,l,_),e.add(_,c,_),_=d[5],e.add(s,l,_),e.add(_,h,_),_=d[6],e.add(s,E,_),e.add(_,h,_),_=d[7],e.add(s,E,_),e.add(_,c,_);for(var p=d.length,T=0;T<p;++T){var m=d[T];e.add(o,m,m);var y=i.cartesianToCartographic(m,W);r.project(y,m)}a=f.fromPoints(d,a),o=a.center;var R=o.x,A=o.y,v=o.z;return o.x=v,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,r){return t===r||a(t)&&a(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,r){return f.computePlaneDistances(this,e,t,r)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;r<n;++r)t[r]=parseInt(t[r],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,v=n(e[1]))}return A}function i(){return a()&&v}function o(){if(!t(S)&&(S=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=n(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,M=n(e[1]),M.isNightly=!!e[2])}return I}function c(){return s()&&M}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,g=n(e[1])))}return O}function E(){return l()&&g}function f(){if(!t(C)){C=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,w=n(e[1]))}return C}function h(){return f()&&w}function d(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(P=!0,x=n(e[1])); +}return P}function _(){return t(L)||(L=/Windows/i.test(R.appVersion)),L}function p(){return d()&&x}function T(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function m(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;F=t(r)&&""!==r,F&&(b=r)}return F}function y(){return m()?b:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,v,S,N,I,M,O,g,C,w,P,x,L,U,b,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:p,isWindows:_,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:T,supportsImageRenderingPixelated:m,imageRenderingValue:y};return D.supportsFullscreen=function(){return r.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,a,i){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,a){switch(n=e(n,0),a=e(a,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,a);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case o.SHORT:return new Int16Array(r,n,a);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case o.INT:return new Int32Array(r,n,a);case o.UNSIGNED_INT:return new Uint32Array(r,n,a);case o.FLOAT:return new Float32Array(r,n,a);case o.DOUBLE:return new Float64Array(r,n,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var a=e.attributes[n],i=a.values.length/a.componentsPerAttribute;r=i}return r},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,a,i){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,a){return n=t(n,0),r(a)||(a=new o),a.x=e[n++],a.y=e[n],a},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var a=0;a<n;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var a=0;a<n;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var E=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,E);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,a){return e===t||r(e)&&r(t)&&i.equalsEpsilon(e.x,t.x,n,a)&&i.equalsEpsilon(e.y,t.y,n,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,r,n,a,i){"use strict";var o={};o.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,a=r.y;r.x=(1-Math.abs(a))*i.signNotZero(n),r.y=(1-Math.abs(n))*i.signNotZero(a)}return r.x=i.toSNorm(r.x,t),r.y=i.toSNorm(r.y,t),r},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,r,n,a){if(a.x=i.fromSNorm(e,n),a.y=i.fromSNorm(r,n),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},o.octDecode=function(e,t,r){return o.octDecodeInRange(e,t,255,r)},o.octPackFloat=function(e){return 256*e.x+e.y};var u=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,u),o.octPackFloat(u)},o.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),a=256*(r-n);return o.octDecode(n,a,t)},o.octPack=function(e,t,r,n){var a=o.octEncodeFloat(e),i=o.octEncodeFloat(t),s=o.octEncode(r,u);return n.x=65536*s.x+a,n.y=65536*s.y+i,n},o.octUnpack=function(e,t,r,n){var a=e.x/65536,i=Math.floor(a),u=65536*(a-i);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);o.octDecodeFloat(u,t),o.octDecodeFloat(c,r),o.octDecode(i,s,n)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},o.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},o}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined"],function(e,t,r,n){"use strict";function a(r,a,s,c,l){n(l)||(l=new t);var E,f,h,d,_,p,T,m;n(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(r,a,u),d=t.dot(E,E),_=t.dot(E,f),p=t.dot(E,h),T=t.dot(f,f),m=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(r,a,u),d=e.dot(E,E),_=e.dot(E,f),p=e.dot(E,h),T=e.dot(f,f),m=e.dot(f,h));var y=1/(d*T-_*_);return l.y=(T*p-_*m)*y,l.z=(d*m-_*p)*y,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var a={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var i=r.high,o=r.low;return n.encode(e.x,a),i.x=a.high,o.x=a.low,n.encode(e.y,a),i.y=a.high,o.y=a.low,n.encode(e.z,a),i.z=a.high,o.z=a.low,r};var i=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,i);var a=i.high,o=i.low;t[r]=a.x,t[r+1]=a.y,t[r+2]=a.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,r,a){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,a):new Uint16Array(t,r,a)},r(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var a=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,a){var i;if(0===e)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-n/e,i<0?[i,0]:[0,i];var c=n*n,l=4*e*a,E=r(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*r(n,t.sign(n)*Math.sqrt(E),t.EPSILON14);return n>0?[f/e,a/f]:[a/f,f/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var a,i,o=e,u=t/3,s=r/3,c=n,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,_=o*c-u*s,p=u*c-h,T=4*d*p-_*_;if(T<0){var m,y,R;f*E>=l*h?(m=o,y=d,R=-2*u*d+o*_):(m=c,y=p,R=-c*_+2*s*p);var A=R<0?-1:1,v=-A*Math.abs(m)*Math.sqrt(-T);i=-R+v;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),I=i===v?-N:-y/N;return a=y<=0?N+I:-R/(N*N+I*I+y),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var M=d,O=-2*u*d+o*_,g=p,C=-c*_+2*s*p,w=Math.sqrt(T),P=Math.sqrt(3)/2,x=Math.abs(Math.atan2(o*w,-O)/3);a=2*Math.sqrt(-M);var L=Math.cos(x);i=a*L;var U=a*(-L/2-P*Math.sin(x)),b=i+U>2*u?i-u:U-u,F=o,D=b/F;x=Math.abs(Math.atan2(c*w,-C)/3),a=2*Math.sqrt(-g),L=Math.cos(x),i=a*L,U=a*(-L/2-P*Math.sin(x));var B=-c,z=i+U<2*s?i+s:U+s,G=B/z,V=F*z,q=-b*z-F*B,X=b*B,H=(s*q-u*X)/(-u*q+s*V);return D<=H?D<=G?H<=G?[D,H,G]:[D,G,H]:[G,D,H]:D<=G?[H,D,G]:H<=G?[H,G,D]:[G,H,D]}var n={};return n.computeDiscriminant=function(e,t,r,n){var a=e*e,i=t*t,o=r*r,u=n*n,s=18*e*t*r*n+i*o-27*a*u-4*(e*o*r+i*t*n);return s},n.computeRealRoots=function(e,n,a,i){var o,u;if(0===e)return t.computeRealRoots(n,a,i);if(0===n){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,a,i)}return 0===a?0===i?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,i):0===i?(o=t.computeRealRoots(e,n,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,a,i)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<r.EPSILON14){var d=n.computeRealRoots(1,s,l);if(2===d.length){var _,p=d[0],T=d[1];if(p>=0&&T>=0){var m=Math.sqrt(p),y=Math.sqrt(T);return[f-y,f-m,f+m,f+y]}if(p>=0&&T<0)return _=Math.sqrt(p),[f-_,f+_];if(p<0&&T>=0)return _=Math.sqrt(T),[f-_,f+_]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,v=(s+h+c/R)/2,S=n.computeRealRoots(1,R,A),N=n.computeRealRoots(1,-R,v);return 0!==S.length?(S[0]+=f,S[1]+=f,0!==N.length?(N[0]+=f,N[1]+=f,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=f,N[1]+=f,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,_,p=h[0],T=a-p,m=T*T,y=t/2,R=T/2,A=m-4*o,v=m+4*Math.abs(o),S=c-4*p,N=c+4*Math.abs(p);if(p<0||A*N<S*v){var I=Math.sqrt(S);d=I/2,_=0===I?0:(t*R-i)/I}else{var M=Math.sqrt(A);d=0===M?0:(t*R-i)/M,_=M/2}var O,g;0===y&&0===d?(O=0,g=0):r.sign(y)===r.sign(d)?(O=y+d,g=p/O):(g=y-d,O=p/g);var C,w;0===R&&0===_?(C=0,w=0):r.sign(R)===r.sign(_)?(C=R+_,w=o/C):(w=R-_,C=o/w);var P=n.computeRealRoots(1,O,C),x=n.computeRealRoots(1,g,w);if(0!==P.length)return 0!==x.length?P[1]<=x[0]?[P[0],P[1],x[0],x[1]]:x[1]<=P[0]?[x[0],x[1],P[0],P[1]]:P[0]>=x[0]&&P[1]<=x[1]?[x[0],P[0],P[1],x[1]]:x[0]>=P[0]&&x[1]<=P[1]?[P[0],x[0],x[1],P[1]]:P[0]>x[0]&&P[0]<x[1]?[x[0],P[0],x[1],P[1]]:[P[0],x[0],P[1],x[1]]:P;if(0!==x.length)return x}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=r*r,l=c*r,E=n*n,f=E*n,h=a*a,d=h*a,_=u*c*E-4*s*f-4*e*l*E+18*e*t*r*f-27*i*E*E+256*o*d+a*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*E+144*i*r*E)+h*(144*e*u*r-27*u*u-128*i*c-192*i*t*n);return _},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function a(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n}return a.getPoint=function(t,n,a){return r(a)||(a=new e),a=e.multiplyByScalar(t.direction,n,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,a,i,o,u,s,c,l){"use strict";function E(e,t,r,n){var a=t*t-4*e*r;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function f(t,r,a){n(a)||(a=new i);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,m),f=e.dot(u,u),h=2*e.dot(u,l),d=e.magnitudeSquared(l)-c,_=E(f,h,d,v);if(n(_))return a.start=_.root0,a.stop=_.root1,a}function h(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function d(t,r,n,a,i){var l,E=a*a,f=i*i,d=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,_=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),p=t[u.COLUMN0ROW0]*E+t[u.COLUMN2ROW2]*f+a*r.x+n,T=f*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),m=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),y=[];if(0===m&&0===T){if(l=s.computeRealRoots(d,_,p),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)),2===l.length){var v=l[1],S=Math.sqrt(Math.max(1-v*v,0)); +y.push(new e(a,i*v,i*-S)),y.push(new e(a,i*v,i*S))}return y}var N=m*m,I=T*T,M=d*d,O=m*T,g=M+I,C=2*(_*d+O),w=2*p*d+_*_-I+N,P=2*(p*_-O),x=p*p-N;if(0===g&&0===C&&0===w&&0===P)return y;l=c.computeRealRoots(g,C,w,P,x);var L=l.length;if(0===L)return y;for(var U=0;U<L;++U){var b,F=l[U],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B);b=o.sign(d)===o.sign(p)?h(d*D+p,_*F,o.EPSILON12):o.sign(p)===o.sign(_*F)?h(d*D,_*F+p,o.EPSILON12):h(d*D+_*F,p,o.EPSILON12);var G=h(T*F,m,o.EPSILON15),V=b*G;V<0?y.push(new e(a,i*F,i*z)):V>0?y.push(new e(a,i*F,i*-z)):0!==z?(y.push(new e(a,i*F,i*-z)),y.push(new e(a,i*F,i*z)),++U):y.push(new e(a,i*F,i*z))}return y}var _={};_.rayPlane=function(t,r,a){n(a)||(a=new e);var i=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,T=new e,m=new e,y=new e,R=new e;_.rayTriangleParametric=function(t,n,a,i,u){u=r(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,_=e.subtract(a,n,p),A=e.subtract(i,n,T),v=e.cross(d,A,m),S=e.dot(_,v);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,n,y),l=e.dot(s,v),l<0||l>S)return;if(c=e.cross(s,_,R),E=e.dot(d,c),E<0||l+E>S)return;f=e.dot(A,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(h,n,y),l=e.dot(s,v)*N,l<0||l>1)return;if(c=e.cross(s,_,R),E=e.dot(d,c)*N,E<0||l+E>1)return;f=e.dot(A,c)*N}return f},_.rayTriangle=function(t,r,a,i,o,u){var s=_.rayTriangleParametric(t,r,a,i,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;_.lineSegmentTriangle=function(t,r,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=_.rayTriangleParametric(c,a,i,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var v={root0:0,root1:0};_.raySphere=function(e,t,r){if(r=f(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new l;_.lineSegmentSphere=function(t,r,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!n(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,I=new e;_.rayEllipsoid=function(t,r){var n,a,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),E=e.multiplyComponents(c,t.direction,I),f=e.magnitudeSquared(l),h=e.dot(l,E);if(f>1){if(h>=0)return;var d=h*h;if(n=f-1,a=e.magnitudeSquared(E),o=a*n,d<o)return;if(d>o){u=h*h-o,s=-h+Math.sqrt(u);var _=s/a,p=n/s;return _<p?new i(_,p):{start:p,stop:_}}var T=Math.sqrt(n/a);return new i(T,T)}return f<1?(n=f-1,a=e.magnitudeSquared(E),o=a*n,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(E),new i(0,-h/a)):void 0};var M=new e,O=new e,g=new e,C=new e,w=new e,P=new u,x=new u,L=new u,U=new u,b=new u,F=new u,D=new u,B=new e,z=new e,G=new t;_.grazingAltitudeLocation=function(t,r){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=r.geodeticSurfaceNormal(a,M);if(e.dot(i,s)>=0)return a}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(i,M),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,C),h=e.normalize(e.cross(f,E,O),O),_=e.normalize(e.cross(E,h,g),g),p=P;p[0]=E.x,p[1]=E.y,p[2]=E.z,p[3]=h.x,p[4]=h.y,p[5]=h.z,p[6]=_.x,p[7]=_.y,p[8]=_.z;var T=u.transpose(p,x),m=u.fromScale(r.radii,L),y=u.fromScale(r.oneOverRadii,U),R=b;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,v,S=u.multiply(u.multiply(T,y,F),R,F),N=u.multiply(u.multiply(S,m,D),p,D),I=u.multiplyByVector(S,a,w),V=d(N,e.negate(I,M),0,0,1),q=V.length;if(q>0){for(var X=e.clone(e.ZERO,z),H=Number.NEGATIVE_INFINITY,W=0;W<q;++W){A=u.multiplyByVector(m,u.multiplyByVector(p,V[W],B),B);var k=e.normalize(e.subtract(A,a,C),C),Y=e.dot(k,i);Y>H&&(H=Y,X=e.clone(A,X))}var Z=r.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),v=e.magnitude(e.subtract(X,a,C))*Math.sqrt(1-H*H),v=c?-v:v,Z.height=v,r.cartographicToCartesian(Z,new e)}};var V=new e;return _.lineSegmentPlane=function(t,r,a,i){n(i)||(i=new e);var u=e.subtract(r,t,V),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,i),e.add(t,i,i),i}},_.trianglePlaneIntersection=function(t,r,n,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,r)+o<0,c=e.dot(i,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return _.lineSegmentPlane(t,r,a,E),_.lineSegmentPlane(t,n,a,f),{positions:[t,r,n,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return _.lineSegmentPlane(r,n,a,E),_.lineSegmentPlane(r,t,a,f),{positions:[t,r,n,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return _.lineSegmentPlane(n,t,a,E),_.lineSegmentPlane(n,r,a,f),{positions:[t,r,n,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return _.lineSegmentPlane(r,t,a,E),_.lineSegmentPlane(n,t,a,f),{positions:[t,r,n,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return _.lineSegmentPlane(n,r,a,E),_.lineSegmentPlane(t,r,a,f),{positions:[t,r,n,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return _.lineSegmentPlane(t,n,a,E),_.lineSegmentPlane(r,n,a,f),{positions:[t,r,n,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},_}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,r,n,a){"use strict";function i(t,r){this.normal=e.clone(t),this.distance=r}i.fromPointNormal=function(r,n,a){var o=-e.dot(n,r);return t(a)?(e.clone(n,a.normal),a.distance=o,a):new i(n,o)};var o=new e;return i.fromCartesian4=function(r,n){var a=e.fromCartesian4(r,o),u=r.w;return t(n)?(e.clone(a,n.normal),n.distance=u,n):new i(a,u)},i.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,a=r.maximumIndex,i=e(r.cacheSize,24),o=n.length;if(!t(a)){a=0;for(var u=0,s=n[u];u<o;)s>a&&(a=s),++u,s=n[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[n[f]]>i&&(c[n[f]]=E,++E);return(E-i+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<n;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,r,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<r.length;){var f=r[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?n(a,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var i,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],_=0;_<l;_++)d[_]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var p=0;E<h;)d[o[E]].vertexTriangles.push(p),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(p),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(p),++d[o[E+2]].numLiveTriangles,++p,E+=3;var T=0,m=s+1;i=1;var y,R,A=[],v=[],S=0,N=[],I=c/3,M=[];for(_=0;_<I;_++)M[_]=!1;for(var O,g;T!==-1;){A=[],R=d[T],g=R.vertexTriangles.length;for(var C=0;C<g;++C)if(p=R.vertexTriangles[C],!M[p]){M[p]=!0,E=p+p+p;for(var w=0;w<3;++w)O=o[E],A.push(O),v.push(O),N[S]=O,++S,y=d[O],--y.numLiveTriangles,m-y.timeStamp>s&&(y.timeStamp=m,++m),++E}T=a(o,s,A,d,m,v,l)}return N},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h,d,_,p,T,m,y,R,A,v,S,N){"use strict";function I(e,t,r,n,a){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=a,e[t++]=a,e[t]=r}function M(e){for(var t=e.length,r=t/3*6,n=p.createTypedArray(t,r),a=0,i=0;i<t;i+=3,a+=6)I(n,a,e[i],e[i+1],e[i+2]);return n}function O(e){var t=e.length;if(t>=3){var r=6*(t-2),n=p.createTypedArray(t,r);I(n,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)I(n,a,e[i-1],e[i],e[i-2]);return n}return new Uint16Array}function g(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=p.createTypedArray(t,r),a=e[0],i=0,o=1;o<t;++o,i+=6)I(n,i,a,e[o],e[o+1]);return n}return new Uint16Array}function C(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new d({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function w(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var a=t[n],i=0;i<a.componentsPerAttribute;++i)e[n].values.push(a.values[r*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),A.multiplyByPoint(e,ie,ie),a.pack(ie,r,i)}function x(e,t){if(c(t))for(var r=t.values,n=r.length,i=0;i<n;i+=3)a.unpack(r,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,r,i)}function L(e,t){var r,n=e.length,a={},i=e[0][t].attributes;for(r in i)if(i.hasOwnProperty(r)&&c(i[r])&&c(i[r].values)){for(var o=i[r],s=o.values.length,l=!0,E=1;E<n;++E){var f=e[E][t].attributes[r];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[r]=new d({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var n,i,o,u,s,l,E,f=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),_=e[0][t].primitiveType,T=L(e,t);for(n in T)if(T.hasOwnProperty(n))for(s=T[n].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[n].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var m;if(d){var y=0;for(i=0;i<f;++i)y+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:T,primitiveType:S.POINTS})),A=p.createTypedArray(R,y),v=0,N=0;for(i=0;i<f;++i){var I=e[i][t].indices,M=I.length;for(u=0;u<M;++u)A[v++]=N+I[u];N+=h.computeNumberOfVertices(e[i][t])}m=A}var O,g=new a,C=0;for(i=0;i<f;++i){if(O=e[i][t].boundingSphere,!c(O)){g=void 0;break}a.add(O.center,g,g)}if(c(g))for(a.divideByScalar(g,f,g),i=0;i<f;++i){O=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(O.center,g,se))+O.radius;w>C&&(C=w)}return new h({attributes:T,indices:m,primitiveType:_,boundingSphere:c(g)?new r(g,C):void 0})}function b(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function F(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,a=3;a<t;++a)r[n++]=a-1,r[n++]=0,r[n++]=a;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function D(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,a=3;a<t-1;a+=2)r[n++]=a,r[n++]=a-1,r[n++]=a+1,a+2<t&&(r[n++]=a,r[n++]=a+1,r[n++]=a+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function z(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),r=p.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,a=2;a<t;++a)r[n++]=a-1,r[n++]=a;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function V(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return F(e);case S.TRIANGLE_STRIP:return D(e);case S.TRIANGLES:return b(e);case S.LINE_STRIP:return z(e);case S.LINE_LOOP:return G(e);case S.LINES:return B(e)}return e}function q(e,t){Math.abs(e.y)<y.EPSILON6&&(t?e.y=-y.EPSILON6:e.y=y.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return q(e,e.y<0),q(t,t.y<0),void q(r,r.y<0);var n,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(r.y);n=a>i?a>o?y.sign(e.y):y.sign(r.y):i>o?y.sign(t.y):y.sign(r.y);var u=n<0;q(e,u),q(t,u),q(r,u)}function H(e,t,r,n){a.add(e,a.multiplyByScalar(a.subtract(t,e,Ae),e.y/(e.y-t.y),Ae),r),a.clone(r,n),q(r,!0),q(n,!1)}function W(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){X(e,t,r);var n=e.y<0,a=t.y<0,i=r.y<0,o=0;o+=n?1:0,o+=a?1:0,o+=i?1:0;var u=Me.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(H(e,t,ve,Ne),H(e,r,Se,Ie),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,r,ve,Ne),H(t,e,Se,Ie),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(r,e,ve,Ne),H(r,t,Se,Ie),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?a?i||(H(r,e,ve,Ne),H(r,t,Se,Ie),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,r,ve,Ne),H(t,e,Se,Ie),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,ve,Ne),H(e,r,Se,Ie),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Me.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=ve,s[4]=Se,s[5]=Ne,s[6]=Ie,s.length=7),Me}}function k(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var a in n)if(n.hasOwnProperty(a)&&c(n[a])&&c(n[a].values)){var i=n[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=p.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function Y(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var a=t[n];r[n]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:r,indices:[],primitiveType:e.primitiveType})}function Z(e,t,r){var n=c(e.geometry.boundingSphere);t=k(t,n),r=k(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function K(e,r,i,o,u,s,l,E,f,h,d,_){if(c(s)||c(l)||c(E)||c(f)||c(h)){var p=a.fromArray(u,3*e,Oe),T=a.fromArray(u,3*r,ge),m=a.fromArray(u,3*i,Ce),y=t(o,p,T,m,we);if(c(s)){var R=a.fromArray(s,3*e,Oe),A=a.fromArray(s,3*r,ge),v=a.fromArray(s,3*i,Ce);a.multiplyByScalar(R,y.x,R),a.multiplyByScalar(A,y.y,A),a.multiplyByScalar(v,y.z,v);var S=a.add(R,A,R);a.add(S,v,S),a.normalize(S,S),a.pack(S,d.normal.values,3*_)}if(c(h)){var N=a.fromArray(h,3*e,Oe),I=a.fromArray(h,3*r,ge),M=a.fromArray(h,3*i,Ce);a.multiplyByScalar(N,y.x,N),a.multiplyByScalar(I,y.y,I),a.multiplyByScalar(M,y.z,M);var O;a.equals(N,a.ZERO)&&a.equals(I,a.ZERO)&&a.equals(M,a.ZERO)?(O=Oe,O.x=0,O.y=0,O.z=0):(O=a.add(N,I,N),a.add(O,M,O),a.normalize(O,O)),a.pack(O,d.extrudeDirection.values,3*_)}if(c(l)){var g=a.fromArray(l,3*e,Oe),C=a.fromArray(l,3*r,ge),w=a.fromArray(l,3*i,Ce);a.multiplyByScalar(g,y.x,g),a.multiplyByScalar(C,y.y,C),a.multiplyByScalar(w,y.z,w);var P=a.add(g,C,g);a.add(P,w,P),a.normalize(P,P),a.pack(P,d.tangent.values,3*_)}if(c(E)){var x=a.fromArray(E,3*e,Oe),L=a.fromArray(E,3*r,ge),U=a.fromArray(E,3*i,Ce);a.multiplyByScalar(x,y.x,x),a.multiplyByScalar(L,y.y,L),a.multiplyByScalar(U,y.z,U);var b=a.add(x,L,x);a.add(b,U,b),a.normalize(b,b),a.pack(b,d.bitangent.values,3*_)}if(c(f)){var F=n.fromArray(f,2*e,Pe),D=n.fromArray(f,2*r,xe),B=n.fromArray(f,2*i,Le);n.multiplyByScalar(F,y.x,F),n.multiplyByScalar(D,y.y,D),n.multiplyByScalar(B,y.z,B);var z=n.add(F,D,F);n.add(z,B,z),n.pack(z,d.st.values,2*_)}}}function j(e,t,r,n,a,i){var o=e.position.values.length/3;if(a!==-1){var u=n[a],s=r[u];return s===-1?(r[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,r,n,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,_=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,p=u.indices,T=Y(u),m=Y(u),y=[];y.length=l.length/3;var R=[];for(R.length=l.length/3,o=0;o<y.length;++o)y[o]=-1,R[o]=-1;var A=p.length;for(o=0;o<A;o+=3){var v=p[o],S=p[o+1],N=p[o+2],I=a.fromArray(l,3*v),M=a.fromArray(l,3*S),O=a.fromArray(l,3*N),g=W(I,M,O);if(c(g)&&g.positions.length>3)for(var C=g.positions,w=g.indices,P=w.length,x=0;x<P;++x){var L=w[x],U=C[L];U.y<0?(t=m.attributes,r=m.indices,n=y):(t=T.attributes,r=T.indices,n=R),i=j(t,r,n,p,L<3?o+L:-1,U),K(v,S,N,U,l,E,h,f,d,_,t,i)}else c(g)&&(I=g.positions[0],M=g.positions[1],O=g.positions[2]),I.y<0?(t=m.attributes,r=m.indices,n=y):(t=T.attributes,r=T.indices,n=R),i=j(t,r,n,p,o,I),K(v,S,N,I,l,E,h,f,d,_,t,i),i=j(t,r,n,p,o+1,M),K(v,S,N,M,l,E,h,f,d,_,t,i),i=j(t,r,n,p,o+2,O),K(v,S,N,O,l,E,h,f,d,_,t,i)}Z(e,m,T)}function J(e){var t,r=e.geometry,n=r.attributes,i=n.position.values,o=r.indices,u=Y(r),s=Y(r),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],_=a.fromArray(i,3*h,Oe),p=a.fromArray(i,3*d,ge);Math.abs(_.y)<y.EPSILON6&&(_.y<0?_.y=-y.EPSILON6:_.y=y.EPSILON6),Math.abs(p.y)<y.EPSILON6&&(p.y<0?p.y=-y.EPSILON6:p.y=y.EPSILON6);var T=u.attributes,R=u.indices,A=f,v=s.attributes,S=s.indices,N=E,I=m.lineSegmentPlane(_,p,Ue,Ce);if(c(I)){var M=a.multiplyByScalar(a.UNIT_Y,5*y.EPSILON9,be);_.y<0&&(a.negate(M,M),T=s.attributes,R=s.indices,A=E,v=u.attributes,S=u.indices,N=f);var O=a.add(I,M,Fe);j(T,R,A,o,t,_),j(T,R,A,o,-1,O),a.negate(M,M),a.add(I,M,O),j(v,S,N,o,-1,O),j(v,S,N,o,t+1,p)}else{var g,C,w;_.y<0?(g=s.attributes,C=s.indices,w=E):(g=u.attributes,C=u.indices,w=f),j(g,C,w,o,t,_),j(g,C,w,o,t+1,p)}}Z(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,i=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=a.unpack(r,u,ze);if(!(s.x>0)){var c=a.unpack(n,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):a.pack(s,n,u));var l=a.unpack(i,u,Ve);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=r[u+3],i[u+1]=r[u+4],i[u+2]=r[u+5]):a.pack(s,i,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,_=c(s.color)?s.color.values:void 0,p=Y(u),T=Y(u),R=!1,A=l.length/3;for(t=0;t<A;t+=4){var v=t,S=t+2,N=a.fromArray(l,3*v,ze),I=a.fromArray(l,3*S,Ge);if(Math.abs(N.y)<Ye)for(N.y=Ye*(I.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,r=3*v;r<3*v+12;r+=3)E[r]=l[3*t],E[r+1]=l[3*t+1],E[r+2]=l[3*t+2];if(Math.abs(I.y)<Ye)for(I.y=Ye*(N.y<0?-1:1),l[3*(t+2)+1]=I.y,l[3*(t+3)+1]=I.y,r=3*v;r<3*v+12;r+=3)f[r]=l[3*(t+2)],f[r+1]=l[3*(t+2)+1],f[r+2]=l[3*(t+2)+2];var M=p.attributes,O=p.indices,g=T.attributes,C=T.indices,w=m.lineSegmentPlane(N,I,Ue,qe);if(c(w)){R=!0;var P=a.multiplyByScalar(a.UNIT_Y,ke,Xe);N.y<0&&(a.negate(P,P),M=T.attributes,O=T.indices,g=p.attributes,C=p.indices);var x=a.add(w,P,He);M.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),M.position.values.push(x.x,x.y,x.z),M.position.values.push(x.x,x.y,x.z),M.prevPosition.values.push(E[3*v],E[3*v+1],E[3*v+2]),M.prevPosition.values.push(E[3*v+3],E[3*v+4],E[3*v+5]),M.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),M.nextPosition.values.push(x.x,x.y,x.z),a.negate(P,P),a.add(w,P,x),g.position.values.push(x.x,x.y,x.z),g.position.values.push(x.x,x.y,x.z),g.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.prevPosition.values.push(x.x,x.y,x.z),g.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),g.nextPosition.values.push(f[3*S],f[3*S+1],f[3*S+2]),g.nextPosition.values.push(f[3*S+3],f[3*S+4],f[3*S+5]);var L=n.fromArray(h,2*v,De),U=Math.abs(L.y);M.expandAndWidth.values.push(-1,U,1,U),M.expandAndWidth.values.push(-1,-U,1,-U),g.expandAndWidth.values.push(-1,U,1,U),g.expandAndWidth.values.push(-1,-U,1,-U);var b=a.magnitudeSquared(a.subtract(w,N,Ve));if(b/=a.magnitudeSquared(a.subtract(I,N,Ve)),c(_)){var F=i.fromArray(_,4*v,We),D=i.fromArray(_,4*S,We),B=y.lerp(F.x,D.x,b),z=y.lerp(F.y,D.y,b),G=y.lerp(F.z,D.z,b),V=y.lerp(F.w,D.w,b);for(r=4*v;r<4*v+8;++r)M.color.values.push(_[r]);for(M.color.values.push(B,z,G,V),M.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),g.color.values.push(B,z,G,V),r=4*S;r<4*S+8;++r)g.color.values.push(_[r])}if(c(d)){var q=n.fromArray(d,2*v,De),X=n.fromArray(d,2*(t+3),Be),H=y.lerp(q.x,X.x,b);for(r=2*v;r<2*v+4;++r)M.st.values.push(d[r]);for(M.st.values.push(H,q.y),M.st.values.push(H,X.y),g.st.values.push(H,q.y),g.st.values.push(H,X.y),r=2*S;r<2*S+4;++r)g.st.values.push(d[r])}o=M.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=g.position.values.length/3-4,C.push(o,o+2,o+1),C.push(o+1,o+2,o+3)}else{var W,k;for(N.y<0?(W=T.attributes,k=T.indices):(W=p.attributes,k=p.indices),W.position.values.push(N.x,N.y,N.z),W.position.values.push(N.x,N.y,N.z),W.position.values.push(I.x,I.y,I.z),W.position.values.push(I.x,I.y,I.z),r=3*t;r<3*t+12;++r)W.prevPosition.values.push(E[r]),W.nextPosition.values.push(f[r]);for(r=2*t;r<2*t+8;++r)W.expandAndWidth.values.push(h[r]),c(d)&&W.st.values.push(d[r]);if(c(_))for(r=4*t;r<4*t+16;++r)W.color.values.push(_[r]);o=W.position.values.length/3-4,k.push(o,o+2,o+1),k.push(o+1,o+2,o+3)}}R&&($(T),$(p)),Z(e,T,p)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=M(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=g(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*n,l[E++]=a[f+1]+i[f+1]*n,l[E++]=a[f+2]+i[f+2]*n;var _,p=e.boundingSphere;return c(p)&&(_=new r(p.center,p.radius+n)),new h({attributes:{position:new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:_})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,a={},i=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(a[u]=i++)}for(var s in n)n.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),a=0;a<t;a++)n[a]=-1;for(var i,o=r,s=o.length,l=p.createTypedArray(t,s),E=0,f=0,d=0;E<s;)i=n[o[E]],i!==-1?l[f]=i:(i=o[E],n[i]=d,l[f]=d,++d),++E,++f;e.indices=l;var _=e.attributes;for(var T in _)if(_.hasOwnProperty(T)&&c(_[T])&&c(_[T].values)){for(var m=_[T],y=m.values,R=0,A=m.componentsPerAttribute,v=u.createTypedArray(m.componentDatatype,d*A);R<t;){var S=n[R];if(S!==-1)for(a=0;a<A;a++)v[A*S+a]=y[A*R+a];++R}m.values=v}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,a=0,i=0;i<n;i++)r[i]>a&&(a=r[i]);e.indices=N.tipsify({indices:r,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=h.computeNumberOfVertices(e);if(c(e.indices)&&r>=y.SIXTY_FOUR_KILOBYTES){var n,a=[],i=[],o=0,u=C(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var E=0;E<l;E+=n){for(var f=0;f<n;++f){var d=s[E+f],_=a[d];c(_)||(_=o++,a[d]=_,w(u,e.attributes,d)),i.push(_)}o+n>=y.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=C(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new a,ne=new o;te.projectTo2D=function(e,t,r,n,i){var o=e.attributes[t];i=c(i)?i:new f;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),h=0,_=0;_<l.length;_+=3){var p=a.fromArray(l,_,re),T=s.cartesianToCartographic(p,ne),m=i.project(T,re);E[h++]=m.x,E[h++]=m.y,E[h++]=m.z}return e.attributes[r]=o,e.attributes[n]=new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)E.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var f=a.componentsPerAttribute;return e.attributes[r]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[n]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var ie=new a,oe=new A,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(A.equals(t,A.IDENTITY))return e;var n=e.geometry.attributes;P(t,n.position),P(t,n.prevPosition),P(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(A.inverse(t,oe),A.transpose(oe,oe),A.getRotation(oe,ue),x(ue,n.normal),x(ue,n.tangent),x(ue,n.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=r.transform(a,t,a)),e.modelMatrix=A.clone(A.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,a=0;a<n;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&r.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),r.length>0&&(o.push(U(r,"westHemisphereGeometry")),o.push(U(r,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,Ee=new a,fe=new a;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,i=r.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],_=t[E+1],p=t[E+2],T=3*h,m=3*_,R=3*p;le.x=n[T],le.y=n[T+1],le.z=n[T+2],Ee.x=n[m],Ee.y=n[m+1],Ee.z=n[m+2],fe.x=n[R],fe.y=n[R+1],fe.z=n[R+2],s[h].count++,s[_].count++,s[p].count++,a.subtract(Ee,le,Ee),a.subtract(fe,le,fe),c[f]=a.cross(Ee,fe,new a),f++}var A=0;for(E=0;E<i;E++)s[E].indexOffset+=A,A+=s[E].count;f=0;var v;for(E=0;E<o;E+=3){v=s[t[E]];var S=v.indexOffset+v.currentCount;l[S]=f,v.currentCount++,v=s[t[E+1]],S=v.indexOffset+v.currentCount,l[S]=f,v.currentCount++,v=s[t[E+2]],S=v.indexOffset+v.currentCount,l[S]=f,v.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var I=3*E;if(v=s[E],a.clone(a.ZERO,ce),v.count>0){for(f=0;f<v.count;f++)a.add(ce,c[l[v.indexOffset+f]],ce);a.equalsEpsilon(a.ZERO,ce,y.EPSILON10)&&a.clone(c[l[v.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,y.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),N[I]=ce.x,N[I+1]=ce.y,N[I+2]=ce.z}return e.attributes.normal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,de=new a,_e=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var _=t[l],p=t[l+1],T=t[l+2];E=3*_,f=3*p,h=3*T;var m=2*_,y=2*p,R=2*T,A=r[E],v=r[E+1],S=r[E+2],N=i[m],I=i[m+1],M=i[y+1]-I,O=i[R+1]-I,g=1/((i[y]-N)*O-(i[R]-N)*M),C=(O*(r[f]-A)-M*(r[h]-A))*g,w=(O*(r[f+1]-v)-M*(r[h+1]-v))*g,P=(O*(r[f+2]-S)-M*(r[h+2]-S))*g;c[E]+=C,c[E+1]+=w,c[E+2]+=P,c[f]+=C,c[f+1]+=w,c[f+2]+=P,c[h]+=C,c[h+1]+=w,c[h+2]+=P}var x=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var U=a.fromArray(n,E,he),b=a.fromArray(c,E,_e),F=a.dot(U,b);a.multiplyByScalar(U,F,de),a.normalize(a.subtract(b,de,b),b),x[E]=b.x,x[f]=b.y,x[h]=b.z,a.normalize(a.cross(U,b,b),b),L[E]=b.x,L[f]=b.y,L[h]=b.z}return e.attributes.tangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:x}),e.attributes.bitangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e};var pe=new n,Te=new a,me=new a,ye=new a,Re=new n;te.compressVertices=function(t){var r,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),E=0;for(r=0;r<i;++r)a.fromArray(s,3*r,Te),a.equals(Te,a.ZERO)?E+=2:(Re=e.octEncodeInRange(Te,65535,Re),l[E++]=Re.x,l[E++]=Re.y);return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var f=t.attributes.normal,h=t.attributes.st,_=c(f),p=c(h);if(!_&&!p)return t;var T,m,y,R,A=t.attributes.tangent,v=t.attributes.bitangent,S=c(A),N=c(v);_&&(T=f.values),p&&(m=h.values),S&&(y=A.values),N&&(R=v.values);var I=_?T.length:m.length,M=_?3:2;i=I/M;var O=i,g=p&&_?2:1;g+=S||N?1:0,O*=g;var C=new Float32Array(O),w=0;for(r=0;r<i;++r){p&&(n.fromArray(m,2*r,pe),C[w++]=e.compressTextureCoordinates(pe));var P=3*r;_&&c(y)&&c(R)?(a.fromArray(T,P,Te),a.fromArray(y,P,me),a.fromArray(R,P,ye),e.octPack(Te,me,ye,pe),C[w++]=pe.x,C[w++]=pe.y):(_&&(a.fromArray(T,P,Te),C[w++]=e.octEncodeFloat(Te)),S&&(a.fromArray(y,P,Te),C[w++]=e.octEncodeFloat(Te)),N&&(a.fromArray(R,P,Te),C[w++]=e.octEncodeFloat(Te)))}return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:g,values:C}),_&&delete t.attributes.normal,p&&delete t.attributes.st,N&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Ae=new a,ve=new a,Se=new a,Ne=new a,Ie=new a,Me={positions:new Array(7),indices:new Array(9)},Oe=new a,ge=new a,Ce=new a,we=new a,Pe=new n,xe=new n,Le=new n,Ue=v.fromPointNormal(a.ZERO,a.UNIT_Y),be=new a,Fe=new a,De=new n,Be=new n,ze=new a,Ge=new a,Ve=new a,qe=new a,Xe=new a,He=new a,We=new i,ke=5*y.EPSILON9,Ye=y.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var a=n.center.x-n.radius;if(a>0||r.intersectPlane(n,v.ORIGIN_ZX_PLANE)!==T.INTERSECTING)return e}if(t.geometryType!==_.NONE)switch(t.geometryType){case _.POLYLINES:ee(e);break;case _.TRIANGLES:Q(e);break;case _.LINES:J(e)}else V(t),t.primitiveType===S.TRIANGLES?Q(e):t.primitiveType===S.LINES&&J(e);return e},te}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,r,n,a,i,o,u){"use strict";function s(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,r){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return n(r)?(r.x=i,r.y=o,r.z=u,r):new e(i,o,u)},s.prototype.unproject=function(e,r){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return n(r)?(r.longitude=i,r.latitude=o,r.height=u,r):new t(i,o,u)},s}),define("Scene/PrimitivePipeline",["../Core/BoundingSphere","../Core/ComponentDatatype","../Core/defined","../Core/DeveloperError","../Core/Ellipsoid","../Core/FeatureDetection","../Core/GeographicProjection","../Core/Geometry","../Core/GeometryAttribute","../Core/GeometryAttributes","../Core/GeometryPipeline","../Core/IndexDatatype","../Core/Matrix4","../Core/WebMercatorProjection"],function(e,t,r,n,a,i,o,u,s,c,l,E,f,h){ +"use strict";function d(e,t,n){var a,i=!n,o=e.length;if(!i&&o>1){var u=e[0].modelMatrix;for(a=1;a<o;++a)if(!f.equals(u,e[a].modelMatrix)){i=!0;break}}if(i)for(a=0;a<o;++a)r(e[a].geometry)&&l.transformToWorldCoordinates(e[a]);else f.multiplyTransformation(t,e[0].modelMatrix,t)}function _(e,r){var n=e.attributes,a=n.position,i=a.values.length/a.componentsPerAttribute;n.batchId=new s({componentDatatype:t.FLOAT,componentsPerAttribute:1,values:new Float32Array(i)});for(var o=n.batchId.values,u=0;u<i;++u)o[u]=r}function p(e){for(var t=e.length,n=0;n<t;++n){var a=e[n];r(a.geometry)?_(a.geometry,n):r(a.westHemisphereGeometry)&&r(a.eastHemisphereGeometry)&&(_(a.westHemisphereGeometry,n),_(a.eastHemisphereGeometry,n))}}function T(n){var a,i,o,u=n.instances,s=n.projection,c=n.elementIndexUintSupported,E=n.scene3DOnly,f=n.vertexCacheOptimize,h=n.compressVertices,_=n.modelMatrix,T=u.length;for(a=0;a<T;++a)if(r(u[a].geometry)){o=u[a].geometry.primitiveType;break}if(d(u,_,E),!E)for(a=0;a<T;++a)r(u[a].geometry)&&l.splitLongitude(u[a]);if(p(u),f)for(a=0;a<T;++a){var m=u[a];r(m.geometry)?(l.reorderForPostVertexCache(m.geometry),l.reorderForPreVertexCache(m.geometry)):r(m.westHemisphereGeometry)&&r(m.eastHemisphereGeometry)&&(l.reorderForPostVertexCache(m.westHemisphereGeometry),l.reorderForPreVertexCache(m.westHemisphereGeometry),l.reorderForPostVertexCache(m.eastHemisphereGeometry),l.reorderForPreVertexCache(m.eastHemisphereGeometry))}var y=l.combineInstances(u);for(T=y.length,a=0;a<T;++a){i=y[a];var R,A=i.attributes;if(E)for(R in A)A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE&&l.encodeAttribute(i,R,R+"3DHigh",R+"3DLow");else for(R in A)if(A.hasOwnProperty(R)&&A[R].componentDatatype===t.DOUBLE){var v=R+"3D",S=R+"2D";l.projectTo2D(i,R,v,S,s),r(i.boundingSphere)&&"position"===R&&(i.boundingSphereCV=e.fromVertices(i.attributes.position2D.values)),l.encodeAttribute(i,v,v+"High",v+"Low"),l.encodeAttribute(i,S,S+"High",S+"Low")}h&&l.compressVertices(i)}if(!c){var N=[];for(T=y.length,a=0;a<T;++a)i=y[a],N=N.concat(l.fitToUnsignedShortIndices(i));y=N}return y}function m(e,t,n,a){var i,o,u,s=a.length-1;if(s>=0){var c=a[s];i=c.offset+c.count,u=c.index,o=n[u].indices.length}else i=0,u=0,o=n[u].indices.length;for(var l=e.length,E=0;E<l;++E){var f=e[E],h=f[t];if(r(h)){var d=h.indices.length;i+d>o&&(i=0,o=n[++u].indices.length),a.push({index:u,offset:i,count:d}),i+=d}}}function y(e,t){var r=[];return m(e,"geometry",t,r),m(e,"westHemisphereGeometry",t,r),m(e,"eastHemisphereGeometry",t,r),r}function R(e,t){var n=e.attributes;for(var a in n)if(n.hasOwnProperty(a)){var i=n[a];r(i)&&r(i.values)&&t.push(i.values.buffer)}r(e.indices)&&t.push(e.indices.buffer)}function A(e,t){for(var r=e.length,n=0;n<r;++n)R(e[n],t)}function v(t){for(var n=1,a=t.length,i=0;i<a;i++){var o=t[i];if(++n,r(o)){var u=o.attributes;n+=6+2*e.packedLength+(r(o.indices)?o.indices.length:0);for(var s in u)if(u.hasOwnProperty(s)&&r(u[s])){var c=u[s];n+=5+c.values.length}}}return n}function S(e,t){var r=e.length,n=new Float64Array(1+16*r),a=0;n[a++]=r;for(var i=0;i<r;i++){var o=e[i];f.pack(o.modelMatrix,n,a),a+=f.packedLength}return t.push(n.buffer),n}function N(e){for(var t=e,r=new Array(t[0]),n=0,a=1;a<t.length;){var i=f.unpack(t,a);a+=f.packedLength,r[n++]={modelMatrix:i}}return r}function I(t){var n=t.length,a=1+(e.packedLength+1)*n,i=new Float32Array(a),o=0;i[o++]=n;for(var u=0;u<n;++u){var s=t[u];r(s)?(i[o++]=1,e.pack(t[u],i,o)):i[o++]=0,o+=e.packedLength}return i}function M(t){for(var r=new Array(t[0]),n=0,a=1;a<t.length;)1===t[a++]&&(r[n]=e.unpack(t,a)),++n,a+=e.packedLength;return r}if(!i.supportsTypedArrays())return{};var O={};return O.combineGeometry=function(t){var n,a,i=t.instances,o=i.length;o>0&&(n=T(t),n.length>0&&(a=l.createAttributeLocations(n[0])));var u;t.createPickOffsets&&n.length>0&&(u=y(i,n));for(var s=new Array(o),c=new Array(o),E=0;E<o;++E){var f=i[E],h=f.geometry;r(h)&&(s[E]=h.boundingSphere,c[E]=h.boundingSphereCV);var d=f.eastHemisphereGeometry,_=f.westHemisphereGeometry;r(d)&&r(_)&&(r(d.boundingSphere)&&r(_.boundingSphere)&&(s[E]=e.union(d.boundingSphere,_.boundingSphere)),r(d.boundingSphereCV)&&r(_.boundingSphereCV)&&(c[E]=e.union(d.boundingSphereCV,_.boundingSphereCV)))}return{geometries:n,modelMatrix:t.modelMatrix,attributeLocations:a,pickOffsets:u,boundingSpheres:s,boundingSpheresCV:c}},O.packCreateGeometryResults=function(t,n){var a=new Float64Array(v(t)),i=[],o={},u=t.length,s=0;a[s++]=u;for(var c=0;c<u;c++){var l=t[c],E=r(l);if(a[s++]=E?1:0,E){a[s++]=l.primitiveType,a[s++]=l.geometryType;var f=r(l.boundingSphere)?1:0;a[s++]=f,f&&e.pack(l.boundingSphere,a,s),s+=e.packedLength;var h=r(l.boundingSphereCV)?1:0;a[s++]=h,h&&e.pack(l.boundingSphereCV,a,s),s+=e.packedLength;var d=l.attributes,_=[];for(var p in d)d.hasOwnProperty(p)&&r(d[p])&&(_.push(p),r(o[p])||(o[p]=i.length,i.push(p)));a[s++]=_.length;for(var T=0;T<_.length;T++){var m=_[T],y=d[m];a[s++]=o[m],a[s++]=y.componentDatatype,a[s++]=y.componentsPerAttribute,a[s++]=y.normalize?1:0,a[s++]=y.values.length,a.set(y.values,s),s+=y.values.length}var R=r(l.indices)?l.indices.length:0;a[s++]=R,R>0&&(a.set(l.indices,s),s+=R)}}return n.push(a.buffer),{stringTable:i,packedData:a}},O.unpackCreateGeometryResults=function(r){for(var n,a=r.stringTable,i=r.packedData,o=new Array(i[0]),l=0,f=1;f<i.length;){var h=1===i[f++];if(h){var d,_,p=i[f++],T=i[f++],m=1===i[f++];m&&(d=e.unpack(i,f)),f+=e.packedLength;var y=1===i[f++];y&&(_=e.unpack(i,f)),f+=e.packedLength;var R,A,v,S=new c,N=i[f++];for(n=0;n<N;n++){var I=a[i[f++]],M=i[f++];v=i[f++];var O=0!==i[f++];R=i[f++],A=t.createTypedArray(M,R);for(var g=0;g<R;g++)A[g]=i[f++];S[I]=new s({componentDatatype:M,componentsPerAttribute:v,normalize:O,values:A})}var C;if(R=i[f++],R>0){var w=A.length/v;for(C=E.createTypedArray(w,R),n=0;n<R;n++)C[n]=i[f++]}o[l++]=new u({primitiveType:p,geometryType:T,boundingSphere:d,boundingSphereCV:_,indices:C,attributes:S})}else o[l++]=void 0}return o},O.packCombineGeometryParameters=function(e,t){for(var r=e.createGeometryResults,n=r.length,a=0;a<n;a++)t.push(r[a].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:S(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof o,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}},O.unpackCombineGeometryParameters=function(e){for(var t=N(e.packedInstances),r=e.createGeometryResults,n=r.length,i=0,u=0;u<n;u++)for(var s=O.unpackCreateGeometryResults(r[u]),c=s.length,l=0;l<c;l++){var E=s[l],d=t[i];d.geometry=E,++i}var _=a.clone(e.ellipsoid),p=e.isGeographic?new o(_):new h(_);return{instances:t,ellipsoid:_,projection:p,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:f.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}},O.packCombineGeometryResults=function(e,t){r(e.geometries)&&A(e.geometries,t);var n=I(e.boundingSpheres),a=I(e.boundingSpheresCV);return t.push(n.buffer,a.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:n,boundingSpheresCV:a}},O.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,boundingSpheres:M(e.boundingSpheres),boundingSpheresCV:M(e.boundingSpheresCV)}},O}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,n=t.name,a=t.message;r=e(n)&&e(a)?n+": "+a:t.toString();var i=t.stack;return e(i)&&(r+="\n"+i),r}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function n(n){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=n(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return n}),define("Workers/createGeometry",["../Core/defined","../Scene/PrimitivePipeline","./createTaskProcessorWorker","require"],function(e,t,r,n){"use strict";function a(t){var r=o[t];return e(r)||("object"==typeof exports?o[r]=r=n("Workers/"+t):n(["./"+t],function(e){r=e,o[r]=e})),r}function i(r,n){for(var i=r.subTasks,o=i.length,u=new Array(o),s=0;s<o;s++){var c=i[s],l=c.geometry,E=c.moduleName;if(e(E)){var f=a(E);u[s]=f(l,c.offset)}else u[s]=l}return t.packCreateGeometryResults(u,n)}var o={};return r(i)})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createPointGeometry.js b/engines/Cesium/Workers/createPointGeometry.js deleted file mode 100644 index ac6a3e1..0000000 --- a/engines/Cesium/Workers/createPointGeometry.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Cesium - https://github.com/AnalyticalGraphicsInc/cesium - * - * Copyright 2011-2017 Cesium Contributors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * Columbus View (Pat. Pend.) - * - * Portions licensed separately. - * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details. - */ -/** -@license -mersenne-twister.js - https://gist.github.com/banksean/300494 - - Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The names of its contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,s),o.normalize(t,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,E=t.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(e),T.y=s*Math.sin(e),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,t,r[s])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,t,r[s])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,t,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,I=f+h+N,d=Math.sqrt(1/I),S=e.multiplyByScalar(n,d,a);if(I<E)return isFinite(d)?e.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,L,P,F,D,g,w,B,v,x=(1-d)*e.magnitude(n)/(.5*e.magnitude(y)),z=0;do{x-=z,U=1/(1+x*M),L=1/(1+x*O),P=1/(1+x*m),F=U*U,D=L*L,g=P*P,w=F*U,B=D*L,v=g*P,p=f*F+h*D+N*g-1,C=f*w*M+h*B*O+N*v*m;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*L,s.z=T*P,s):new e(c*U,_*L,T*P)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),T=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(t,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,h=o(t,l,A,f,s);if(n(h)){var N=e.multiplyComponents(h,A,E);N=e.normalize(N,N);var I=e.subtract(t,h,c),d=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(e.dot(I,t))*e.magnitude(I);return n(i)?(i.longitude=d,i.latitude=S,i.height=M,i):new u(d,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(c.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}}}),c.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,T=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,l=new e,A=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=e.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(E,n))*e.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new t(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,E,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,t,r,i,a,o,u,E,s){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[E.getElementIndex(A[n],l[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(e[E.getElementIndex(T,_)])>n){var R,f=e[E.getElementIndex(T,T)],h=e[E.getElementIndex(_,_)],N=e[E.getElementIndex(T,_)],I=(f-h)/2/N;R=I<0?-1/(-I+Math.sqrt(1+I*I)):1/(I+Math.sqrt(1+I*I)),s=1/Math.sqrt(1+R*R),c=R*s}return t=E.clone(E.IDENTITY,t),t[E.getElementIndex(_,_)]=t[E.getElementIndex(T,T)]=s,t[E.getElementIndex(T,_)]=c,t[E.getElementIndex(_,T)]=-c,t}E.packedLength=9,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},E.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new E(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},E.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},E.fromColumnMajorArray=function(e,t){return E.clone(e,t)},E.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new E(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},E.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,T=e.z*e.w,R=e.w*e.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,I=2*(s-o),d=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(t)?(t[0]=l,t[1]=h,t[2]=d,t[3]=A,t[4]=N,t[5]=S,t[6]=f,t[7]=I,t[8]=M,t):new E(l,A,f,h,N,I,d,S,M)},E.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),s=Math.sin(e.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-o*a+a*o*u,f=-o,h=s*n,N=a*n;return r(t)?(t[0]=c,t[1]=R,t[2]=f,t[3]=_,t[4]=l,t[5]=h,t[6]=T,t[7]=A,t[8]=N,t):new E(c,_,T,R,l,A,f,h,N)},E.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new E(e.x,0,0,0,e.y,0,0,0,e.z)},E.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new E(e,0,0,0,e,0,0,0,e)},E.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new E(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},E.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},E.getElementIndex=function(e,t){return 3*e+t},E.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(e,t,n,r){r=E.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(e,t,n,r){return r=E.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var T=new e;E.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],T)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],T)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],T)),n};var R=new e;E.getMaximumScale=function(t){return E.getScale(t,R),e.maximumComponent(R)},E.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},E.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},E.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},E.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},E.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},E.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var T=t.unitary=E.clone(E.IDENTITY,t.unitary),R=t.diagonal=E.clone(e,t.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return t},E.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},E.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],s=e[6],c=e[7],_=e[8],T=E.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=s*u-a*_,t[4]=n*_-s*i,t[5]=a*i-n*u,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(t,R,t)},E.equals=function(e,t){return e===t||r(e)&&r(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]},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,s);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E,s){ -"use strict";function c(e,t,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}c.packedLength=16,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},c.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new c),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},c.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,s=t.x*t.y,_=t.x*t.z,T=t.x*t.w,R=t.y*t.y,l=t.y*t.z,A=t.y*t.w,f=t.z*t.z,h=t.z*t.w,N=t.w*t.w,I=E-R-f+N,d=2*(s-h),S=2*(_+A),M=2*(s+h),O=-E+R-f+N,m=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+N;return r[0]=I*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=d*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(E.IDENTITY,e,t)},c.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,T=new e,R=new e;c.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,T),T),e.normalize(e.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,h=R.x,N=R.y,I=R.z,d=r.x,S=r.y,M=r.z,O=u*-d+E*-S+s*-M,m=h*-d+N*-S+I*-M,y=l*d+A*S+f*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=I,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,I,m,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),E=1/(r-n),s=1/(a-i),c=-(t+e)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),E=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),E=(t+e)/(t-e),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),E=r(e.height,0);t=r(t,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-t),T=s,R=c,l=_,A=a+s,f=o+c,h=t+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},c.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var l=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],l)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],l)),n};var A=new e;c.getMaximumScale=function(t){return c.getScale(t,A),e.maximumComponent(A)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=e[9],R=e[10],l=e[11],A=e[12],f=e[13],h=e[14],N=e[15],I=t[0],d=t[1],S=t[2],M=t[3],O=t[4],m=t[5],y=t[6],p=t[7],C=t[8],U=t[9],L=t[10],P=t[11],F=t[12],D=t[13],g=t[14],w=t[15],B=r*I+u*d+_*S+A*M,v=i*I+E*d+T*S+f*M,x=a*I+s*d+R*S+h*M,z=o*I+c*d+l*S+N*M,G=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,q=r*C+u*U+_*L+A*P,H=i*C+E*U+T*L+f*P,W=a*C+s*U+R*L+h*P,Y=o*C+c*U+l*L+N*P,K=r*F+u*D+_*g+A*w,k=i*F+E*D+T*g+f*w,Z=a*F+s*D+R*g+h*w,j=o*F+c*D+l*g+N*w;return n[0]=B,n[1]=v,n[2]=x,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=K,n[13]=k,n[14]=Z,n[15]=j,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=e[12],R=e[13],l=e[14],A=t[0],f=t[1],h=t[2],N=t[4],I=t[5],d=t[6],S=t[8],M=t[9],O=t[10],m=t[12],y=t[13],p=t[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,L=a*A+E*f+_*h,P=r*N+o*I+s*d,F=i*N+u*I+c*d,D=a*N+E*I+_*d,g=r*S+o*M+s*O,w=i*S+u*M+c*O,B=a*S+E*M+_*O,v=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,z=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=L,n[3]=0,n[4]=P,n[5]=F,n[6]=D,n[7]=0,n[8]=g,n[9]=w,n[10]=B,n[11]=0,n[12]=v,n[13]=x,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=t[0],R=t[1],l=t[2],A=t[3],f=t[4],h=t[5],N=t[6],I=t[7],d=t[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*I+s*d,U=i*N+u*I+c*d,L=a*N+E*I+_*d;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=L,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],E=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=E,n[15]=e[15],n};var f=new e;c.multiplyByUniformScale=function(e,t,n){return f.x=t,f.y=t,f.z=t,c.multiplyByScale(e,f,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,E=e[1]*r+e[5]*i+e[9]*a+e[13]*o,s=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,E=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],E=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var h=new E,N=new E,I=new t,d=new t(0,0,0,1);return c.inverse=function(e,n){if(E.equalsEpsilon(c.getRotation(e,h),N,u.EPSILON7)&&t.equals(c.getRow(e,3,I),d))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],T=e[5],R=e[9],l=e[13],A=e[2],f=e[6],S=e[10],M=e[14],O=e[3],m=e[7],y=e[11],p=e[15],C=S*p,U=M*y,L=f*p,P=M*m,F=f*y,D=S*m,g=A*p,w=M*O,B=A*y,v=S*O,x=A*m,z=f*O,G=C*T+P*R+F*l-(U*T+L*R+D*l),b=U*_+g*R+v*l-(C*_+w*R+B*l),X=L*_+w*T+x*l-(P*_+g*T+z*l),V=D*_+B*T+z*R-(F*_+v*T+x*R),q=U*i+L*a+D*o-(C*i+P*a+F*o),H=C*r+w*a+B*o-(U*r+g*a+v*o),W=P*r+g*i+z*o-(L*r+w*i+x*o),Y=F*r+v*i+x*a-(D*r+B*i+z*a);C=a*l,U=o*R,L=i*l,P=o*T,F=i*R,D=a*T,g=r*l,w=o*_,B=r*R,v=a*_,x=r*T,z=i*_;var K=C*m+P*y+F*p-(U*m+L*y+D*p),k=U*O+g*y+v*p-(C*O+w*y+B*p),Z=L*O+w*m+x*p-(P*O+g*m+z*p),j=D*O+B*m+z*y-(F*O+v*m+x*y),Q=L*S+D*M+U*f-(F*M+C*f+P*S),J=B*M+C*A+w*S-(g*S+v*M+U*A),$=g*f+z*M+P*A-(x*M+L*A+w*f),ee=x*S+F*A+v*f-(B*f+z*S+D*A),te=r*G+i*b+a*X+o*V;if(Math.abs(te)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=q*te,n[5]=H*te,n[6]=W*te,n[7]=Y*te,n[8]=K*te,n[9]=k*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],E=e[8],s=e[9],c=e[10],_=e[12],T=e[13],R=e[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return t[0]=n,t[1]=a,t[2]=E,t[3]=0,t[4]=r,t[5]=o,t[6]=s,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=l,t[13]=A,t[14]=f,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},E.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,t,i,a,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new E(e,t,i,a)},E.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new E(e,t,i,a)},E.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=e.length;_<T;_++){var R=e[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=s,t.east=i,t.north=c,t):new E(n,s,i,c)},E.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=e.length;T<R;T++){var l=t.cartesianToCartographic(e[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},E.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},E.validate=function(e){},E.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},E.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},E.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},E.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},E.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new e(o,E)},E.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var T=Math.max(e.south,t.south),R=Math.min(e.north,t.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(e,t,n){r(n)||(n=new E);var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},E.expand=function(e,t,n){return r(n)||(n=new E),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},E.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var s=new e;return E.subsample=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=e.north,T=e.south,R=e.east,l=e.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=t.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(e,A)&&(o[c]=t.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=t.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function T(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var R=new e,l=new e,A=new e,f=new e,h=new e,N=new e,I=new e,d=new e,S=new e,M=new e,O=new e,m=new e;T.fromPoints=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],I),a=e.clone(r,R),o=e.clone(r,l),u=e.clone(r,A),E=e.clone(r,f),s=e.clone(r,h),c=e.clone(r,N),_=t.length,y=1;y<_;y++){e.clone(t[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&e.clone(r,a),p>E.x&&e.clone(r,E),C<o.y&&e.clone(r,o),C>s.y&&e.clone(r,s),U<u.z&&e.clone(r,u),U>c.z&&e.clone(r,c)}var L=e.magnitudeSquared(e.subtract(E,a,d)),P=e.magnitudeSquared(e.subtract(s,o,d)),F=e.magnitudeSquared(e.subtract(c,u,d)),D=a,g=E,w=L;P>w&&(w=P,D=o,g=s),F>w&&(w=F,D=u,g=c);var B=S;B.x=.5*(D.x+g.x),B.y=.5*(D.y+g.y),B.z=.5*(D.z+g.z);var v=e.magnitudeSquared(e.subtract(g,B,d)),x=Math.sqrt(v),z=M;z.x=a.x,z.y=o.y,z.z=u.z;var G=O;G.x=E.x,G.y=s.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,d),.5,m),X=0;for(y=0;y<_;y++){e.clone(t[y],r);var V=e.magnitude(e.subtract(r,b,d));V>X&&(X=V);var q=e.magnitudeSquared(e.subtract(r,B,d));if(q>v){var H=Math.sqrt(q);x=.5*(x+H),v=x*x;var W=H-x;B.x=(x*B.x+W*r.x)/H,B.y=(x*B.y+W*r.y)/H,B.z=(x*B.z+W*r.z)/H}}return x<X?(e.clone(B,n.center),n.radius=x):(e.clone(b,n.center),n.radius=X),n};var y=new o,p=new e,C=new e,U=new t,L=new t;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new T),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(t,U),U.height=a,_.northeast(t,L),L.height=o;var E=n.project(U,p),s=n.project(L,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var P=[];T.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,P)),T.fromPoints(u,o)},T.fromVertices=function(t,n,a,o){if(i(o)||(o=new T),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=I;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var E=e.clone(u,R),s=e.clone(u,l),c=e.clone(u,A),_=e.clone(u,f),y=e.clone(u,h),p=e.clone(u,N),C=t.length,U=0;U<C;U+=a){var L=t[U]+n.x,P=t[U+1]+n.y,F=t[U+2]+n.z;u.x=L,u.y=P,u.z=F,L<E.x&&e.clone(u,E),L>_.x&&e.clone(u,_),P<s.y&&e.clone(u,s),P>y.y&&e.clone(u,y),F<c.z&&e.clone(u,c),F>p.z&&e.clone(u,p)}var D=e.magnitudeSquared(e.subtract(_,E,d)),g=e.magnitudeSquared(e.subtract(y,s,d)),w=e.magnitudeSquared(e.subtract(p,c,d)),B=E,v=_,x=D;g>x&&(x=g,B=s,v=y),w>x&&(x=w,B=c,v=p);var z=S;z.x=.5*(B.x+v.x),z.y=.5*(B.y+v.y),z.z=.5*(B.z+v.z);var G=e.magnitudeSquared(e.subtract(v,z,d)),b=Math.sqrt(G),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var q=e.multiplyByScalar(e.add(X,V,d),.5,m),H=0;for(U=0;U<C;U+=a){u.x=t[U]+n.x,u.y=t[U+1]+n.y,u.z=t[U+2]+n.z;var W=e.magnitude(e.subtract(u,q,d));W>H&&(H=W);var Y=e.magnitudeSquared(e.subtract(u,z,d));if(Y>G){var K=Math.sqrt(Y);b=.5*(b+K),G=b*b;var k=K-b;z.x=(b*z.x+k*u.x)/K,z.y=(b*z.y+k*u.y)/K,z.z=(b*z.z+k*u.z)/K}}return b<H?(e.clone(z,o.center),o.radius=b):(e.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new T),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=I;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,R),u=e.clone(a,l),E=e.clone(a,A),s=e.clone(a,f),c=e.clone(a,h),_=e.clone(a,N),y=t.length,p=0;p<y;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],L=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=L,C<o.x&&e.clone(a,o),C>s.x&&e.clone(a,s),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),L<E.z&&e.clone(a,E),L>_.z&&e.clone(a,_)}var P=e.magnitudeSquared(e.subtract(s,o,d)),F=e.magnitudeSquared(e.subtract(c,u,d)),D=e.magnitudeSquared(e.subtract(_,E,d)),g=o,w=s,B=P;F>B&&(B=F,g=u,w=c),D>B&&(B=D,g=E,w=_);var v=S;v.x=.5*(g.x+w.x),v.y=.5*(g.y+w.y),v.z=.5*(g.z+w.z);var x=e.magnitudeSquared(e.subtract(w,v,d)),z=Math.sqrt(x),G=M;G.x=o.x,G.y=u.y,G.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,d),.5,m),V=0;for(p=0;p<y;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var q=e.magnitude(e.subtract(a,X,d));q>V&&(V=q);var H=e.magnitudeSquared(e.subtract(a,v,d));if(H>x){var W=Math.sqrt(H);z=.5*(z+W),x=z*z;var Y=W-z;v.x=(z*v.x+Y*a.x)/W,v.y=(z*v.y+Y*a.y)/W,v.z=(z*v.z+Y*a.z)/W}}return z<V?(e.clone(v,r.center),r.radius=z):(e.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(t,n,r){i(r)||(r=new T);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},T.fromEllipsoid=function(t,n){return i(n)||(n=new T),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var F=new e;T.fromBoundingSpheres=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return T.clone(t[0],n);if(2===r)return T.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var D=new e,g=new e,w=new e;T.fromOrientedBoundingBox=function(t,n){i(n)||(n=new T);var r=t.halfAxes,a=s.getColumn(r,0,D),o=s.getColumn(r,1,g),u=s.getColumn(r,2,w),E=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius)},T.packedLength=4,T.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},T.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new T);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var B=new e,v=new e;T.union=function(t,n,r){i(r)||(r=new T);var a=t.center,o=t.radius,u=n.center,E=n.radius,s=e.subtract(u,a,B),c=e.magnitude(s);if(o>=c+E)return t.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=e.multiplyByScalar(s,(-o+_)/c,v);return e.add(R,a,R),e.clone(R,r.center),r.radius=_,r};var x=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},T.transformWithoutScale=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;T.computePlaneDistances=function(t,n,r,a){i(a)||(a=new E);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,q=new e,H=new e,W=new t,Y=new Array(8),K=0;K<8;++K)Y[K]=new e;var k=new o;return T.projectTo2D=function(t,n,i){n=r(n,k);var a=n.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,b),s=e.cross(e.UNIT_Z,E,X);e.normalize(s,s);var c=e.cross(E,s,V);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,H),R=e.negate(s,q),l=Y,A=l[0];e.add(E,c,A),e.add(A,s,A),A=l[1],e.add(E,c,A),e.add(A,R,A),A=l[2],e.add(E,_,A),e.add(A,R,A),A=l[3],e.add(E,_,A),e.add(A,s,A),e.negate(E,E),A=l[4],e.add(E,c,A),e.add(A,s,A),A=l[5],e.add(E,c,A),e.add(A,R,A),A=l[6],e.add(E,_,A),e.add(A,R,A),A=l[7],e.add(E,_,A),e.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];e.add(o,N,N);var I=a.cartesianToCartographic(N,W);n.project(I,N)}i=T.fromPoints(l,i),o=i.center;var d=o.x,S=o.y,M=o.z;return o.x=M,o.y=d,o.z=S,i},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!T())){var e=/ Chrome\/([\.0-9]+)/.exec(d.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(d.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(d.userAgent);null!==e&&(O=!0,m=r(e[1]))}return O}function u(){return o()&&m}function E(){if(!t(y)){y=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(d.userAgent);null!==e&&(y=!0,p=r(e[1]),p.isNightly=!!e[2])}return y}function s(){return E()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===d.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===d.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(d.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function T(){if(!t(L)){L=!1;var e=/ Edge\/([\.0-9]+)/.exec(d.userAgent);null!==e&&(L=!0,P=r(e[1]))}return L}function R(){return T()&&P}function l(){if(!t(F)){F=!1;var e=/Firefox\/([\.0-9]+)/.exec(d.userAgent); -null!==e&&(F=!0,D=r(e[1]))}return F}function A(){return t(g)||(g=/Windows/i.test(d.appVersion)),g}function f(){return l()&&D}function h(){return t(w)||(w="undefined"!=typeof PointerEvent&&(!t(d.pointerEnabled)||d.pointerEnabled)),w}function N(){if(!t(v)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;v=t(n)&&""!==n,v&&(B=n)}return v}function I(){return N()?B:void 0}var d;d="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,L,P,F,D,g,w,B,v,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:e(d.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:I};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/PointGeometry",["./BoundingSphere","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Geometry","./GeometryAttribute","./GeometryAttributes","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t){t=n(t,n.EMPTY_OBJECT),this._positionsTypedArray=t.positionsTypedArray,this._colorsTypedArray=t.colorsTypedArray,this._boundingSphere=e.clone(t.boundingSphere),this._workerName="createPointGeometry"}return s.createGeometry=function(n){var i=n._positionsTypedArray,s=i.byteLength/i.length,c=4===s?t.FLOAT:t.DOUBLE,_=new u;_.position=new o({componentDatatype:c,componentsPerAttribute:3,values:i}),_.color=new o({componentDatatype:t.UNSIGNED_BYTE,componentsPerAttribute:3,values:n._colorsTypedArray,normalize:!0});var T=n._boundingSphere;return r(T)||(T=e.fromVertices(i)),new a({attributes:_,primitiveType:E.POINTS,boundingSphere:T})},s}),define("Workers/createPointGeometry",["../Core/PointGeometry"],function(e){"use strict";return e.createGeometry})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createPolygonGeometry.js b/engines/Cesium/Workers/createPolygonGeometry.js index 1e08be8..9b58c24 100644 --- a/engines/Cesium/Workers/createPolygonGeometry.js +++ b/engines/Cesium/Workers/createPolygonGeometry.js @@ -222,10 +222,10 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:p,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,p=a.y,E=a.z,m=l*l*d*d,y=f*f*p*p,_=h*h*E*E,v=m+y+_,T=Math.sqrt(1/v),R=e.multiplyByScalar(n,T,i);if(v<s)return isFinite(T)?e.clone(R,c):void 0;var g=u.x,A=u.y,S=u.z,N=o;N.x=R.x*g*2,N.y=R.y*A*2,N.z=R.z*S*2;var x,w,I,O,M,P,C,D,L,U,b,F=(1-T)*e.magnitude(n)/(.5*e.magnitude(N)),B=0;do{F-=B,I=1/(1+F*g),O=1/(1+F*A),M=1/(1+F*S),P=I*I,C=O*O,D=M*M,L=P*I,U=C*O,b=D*M,x=m*P+y*C+_*D-1,w=m*L*g+y*U*A+_*b*S;var z=-2*w;B=x/z}while(Math.abs(x)>r.EPSILON12);return t(c)?(c.x=l*I,c.y=f*O,c.z=h*M,c):new e(l*I,f*O,h*M)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var p=n(r)?r.oneOverRadii:f,E=n(r)?r.oneOverRadiiSquared:h,m=n(r)?r._centerToleranceSquared:d,y=o(t,p,E,m,c);if(n(y)){var _=e.multiplyComponents(y,E,s);_=e.normalize(_,_);var v=e.subtract(t,y,l),T=Math.atan2(_.y,_.x),R=Math.asin(_.z),g=i.sign(e.dot(v,t))*e.magnitude(v);return n(a)?(a.longitude=T,a.latitude=R,a.height=g,a):new u(T,R,g)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,p=new e,E=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,p);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,E),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,p),o=Math.max(o,p)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=t.cartesianToCartographic(e[h]);a=Math.min(a,p.longitude),i=Math.max(i,p.longitude),l=Math.min(l,p.latitude),f=Math.max(f,p.latitude);var E=p.longitude>=0?p.longitude:p.longitude+u.TWO_PI;o=Math.min(o,E),c=Math.max(c,E)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,p=e.west,E=c;E.height=a,E.longitude=p,E.latitude=f,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.latitude=h,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=p,o[l]=t.cartographicToCartesian(E,o[l]),l++,f<0?E.latitude=f:h>0?E.latitude=h:E.latitude=0;for(var m=1;m<8;++m)E.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,E)&&(o[l]=t.cartographicToCartesian(E,o[l]),l++);return 0===E.latitude&&(E.longitude=p,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=t.cartographicToCartesian(E,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.width=r(n,0),this.height=r(a,0)}s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},s.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new s),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},s.fromPoints=function(e,t){if(a(t)||(t=new s),!a(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var n=e.length,r=e[0].x,i=e[0].y,o=e[0].x,u=e[0].y,c=1;c<n;c++){var l=e[c],f=l.x,h=l.y;r=Math.min(f,r),o=Math.max(f,o),i=Math.min(h,i),u=Math.max(h,u)}return t.x=r,t.y=i,t.width=o-r,t.height=u-i,t};var c=new i,l=new t,f=new t;return s.fromRectangle=function(t,n,i){if(a(i)||(i=new s),!a(t))return i.x=0,i.y=0,i.width=0,i.height=0,i;n=r(n,c);var o=n.project(u.southwest(t,l)),h=n.project(u.northeast(t,f));return e.subtract(h,o,h),i.x=o.x,i.y=o.y,i.width=h.x,i.height=h.y,i},s.clone=function(e,t){if(a(e))return a(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new s(e.x,e.y,e.width,e.height)},s.union=function(e,t,n){a(n)||(n=new s);var r=Math.min(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return n.x=r,n.y=i,n.width=o-r,n.height=u-i,n},s.expand=function(e,t,n){n=s.clone(e,n);var r=t.x-n.x,a=t.y-n.y;return r>n.width?n.width=r:r<0&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:a<0&&(n.height-=a,n.y=t.y),n},s.intersect=function(e,t){var n=e.x,r=e.y,a=t.x,i=t.y;return n>a+t.width||n+e.width<a||r+e.height<i||r>i+t.height?o.OUTSIDE:o.INTERSECTING},s.equals=function(e,t){return e===t||a(e)&&a(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(E[n],p[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(E[i],p[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=p[a],h=E[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,m=e[s.getElementIndex(h,h)],y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(h,f)],v=(m-y)/2/_;d=v<0?-1/(-v+Math.sqrt(1+v*v)):1/(v+Math.sqrt(1+v*v)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]); -},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,p=n-u-f+d,E=2*(a-h),m=2*(i+l),y=2*(a+h),_=-n+u-f+d,v=2*(c-o),T=2*(i-l),R=2*(c+o),g=-n-u+f+d;return r(t)?(t[0]=p,t[1]=y,t[2]=T,t[3]=E,t[4]=_,t[5]=R,t[6]=m,t[7]=v,t[8]=g,t):new s(p,E,m,y,_,v,T,R,g)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,p=i*a+c*o*u,E=-o*i+i*o*u,m=-o,y=c*n,_=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=m,t[3]=f,t[4]=p,t[5]=y,t[6]=h,t[7]=E,t[8]=_,t):new s(l,f,h,d,p,E,m,y,_)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var p=[1,0,0],E=[2,2,1],m=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),p=n*c(d);o<a&&l(d)>p;)f(d,m),s.transpose(m,y),s.multiply(d,m,d),s.multiply(y,d,d),s.multiply(h,m,h),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,h,d,p,E,m){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(p,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(E,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(m,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,p=t.y*t.z,E=t.y*t.w,m=t.z*t.z,y=t.z*t.w,_=t.w*t.w,v=s-d-m+_,T=2*(c-y),R=2*(f+E),g=2*(c+y),A=-s+d-m+_,S=2*(p-h),N=2*(f-E),x=2*(p+h),w=-s-d+m+_;return r[0]=v*i,r[1]=g*i,r[2]=N*i,r[3]=0,r[4]=T*o,r[5]=A*o,r[6]=x*o,r[7]=0,r[8]=R*u,r[9]=S*u,r[10]=w*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,p=f.x,E=f.y,m=f.z,y=d.x,_=d.y,v=d.z,T=r.x,R=r.y,g=r.z,A=u*-T+s*-R+c*-g,S=y*-T+_*-R+v*-g,N=p*T+E*R+m*g;return a(n)?(n[0]=u,n[1]=y,n[2]=-p,n[3]=0,n[4]=s,n[5]=_,n[6]=-E,n[7]=0,n[8]=c,n[9]=v,n[10]=-m,n[11]=0,n[12]=A,n[13]=S,n[14]=N,n[15]=1,n):new l(u,s,c,A,y,_,v,S,-p,-E,-m,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,p=f,E=i+c,m=o+l,y=t+f,_=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=p,a[11]=0,a[12]=E,a[13]=m,a[14]=y,a[15]=_,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var p=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),n};var E=new e;l.getMaximumScale=function(t){return l.getScale(t,E),e.maximumComponent(E)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],E=e[12],m=e[13],y=e[14],_=e[15],v=t[0],T=t[1],R=t[2],g=t[3],A=t[4],S=t[5],N=t[6],x=t[7],w=t[8],I=t[9],O=t[10],M=t[11],P=t[12],C=t[13],D=t[14],L=t[15],U=r*v+u*T+f*R+E*g,b=a*v+s*T+h*R+m*g,F=i*v+c*T+d*R+y*g,B=o*v+l*T+p*R+_*g,z=r*A+u*S+f*N+E*x,G=a*A+s*S+h*N+m*x,q=i*A+c*S+d*N+y*x,W=o*A+l*S+p*N+_*x,V=r*w+u*I+f*O+E*M,H=a*w+s*I+h*O+m*M,X=i*w+c*I+d*O+y*M,Y=o*w+l*I+p*O+_*M,k=r*P+u*C+f*D+E*L,Z=a*P+s*C+h*D+m*L,j=i*P+c*C+d*D+y*L,K=o*P+l*C+p*D+_*L;return n[0]=U,n[1]=b,n[2]=F,n[3]=B,n[4]=z,n[5]=G,n[6]=q,n[7]=W,n[8]=V,n[9]=H,n[10]=X,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],p=e[14],E=t[0],m=t[1],y=t[2],_=t[4],v=t[5],T=t[6],R=t[8],g=t[9],A=t[10],S=t[12],N=t[13],x=t[14],w=r*E+o*m+c*y,I=a*E+u*m+l*y,O=i*E+s*m+f*y,M=r*_+o*v+c*T,P=a*_+u*v+l*T,C=i*_+s*v+f*T,D=r*R+o*g+c*A,L=a*R+u*g+l*A,U=i*R+s*g+f*A,b=r*S+o*N+c*x+h,F=a*S+u*N+l*x+d,B=i*S+s*N+f*x+p;return n[0]=w,n[1]=I,n[2]=O,n[3]=0,n[4]=M,n[5]=P,n[6]=C,n[7]=0,n[8]=D,n[9]=L,n[10]=U,n[11]=0,n[12]=b,n[13]=F,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],p=t[2],E=t[3],m=t[4],y=t[5],_=t[6],v=t[7],T=t[8],R=r*h+o*d+c*p,g=a*h+u*d+l*p,A=i*h+s*d+f*p,S=r*E+o*m+c*y,N=a*E+u*m+l*y,x=i*E+s*m+f*y,w=r*_+o*v+c*T,I=a*_+u*v+l*T,O=i*_+s*v+f*T;return n[0]=R,n[1]=g,n[2]=A,n[3]=0,n[4]=S,n[5]=N,n[6]=x,n[7]=0,n[8]=w,n[9]=I,n[10]=O,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var m=new e;l.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var y=new s,_=new s,v=new t,T=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,y),_,u.EPSILON7)&&t.equals(l.getRow(e,3,v),T))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],p=e[13],E=e[2],m=e[6],R=e[10],g=e[14],A=e[3],S=e[7],N=e[11],x=e[15],w=R*x,I=g*N,O=m*x,M=g*S,P=m*N,C=R*S,D=E*x,L=g*A,U=E*N,b=R*A,F=E*S,B=m*A,z=w*h+M*d+P*p-(I*h+O*d+C*p),G=I*f+D*d+b*p-(w*f+L*d+U*p),q=O*f+L*h+F*p-(M*f+D*h+B*p),W=C*f+U*h+B*d-(P*f+b*h+F*d),V=I*a+O*i+C*o-(w*a+M*i+P*o),H=w*r+L*i+U*o-(I*r+D*i+b*o),X=M*r+D*a+B*o-(O*r+L*a+F*o),Y=P*r+b*a+F*i-(C*r+U*a+B*i);w=i*p,I=o*d,O=a*p,M=o*h,P=a*d,C=i*h,D=r*p,L=o*f,U=r*d,b=i*f,F=r*h,B=a*f;var k=w*S+M*N+P*x-(I*S+O*N+C*x),Z=I*A+D*N+b*x-(w*A+L*N+U*x),j=O*A+L*S+F*x-(M*A+D*S+B*x),K=C*A+U*S+B*N-(P*A+b*S+F*N),J=O*R+C*g+I*m-(P*g+w*m+M*R),Q=U*g+w*E+L*R-(D*R+b*g+I*E),$=D*m+B*g+M*E-(F*g+O*E+L*m),ee=F*R+P*E+b*m-(U*m+B*R+C*E),te=r*z+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=z*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=V*te,n[5]=H*te,n[6]=X*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],p=-n*f-r*h-a*d,E=-i*f-o*h-u*d,m=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=p,t[13]=E,t[14]=m,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,p=new e,E=new e,m=new e,y=new e,_=new e,v=new e,T=new e,R=new e,g=new e,A=new e,S=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],v),i=e.clone(r,d),o=e.clone(r,p),u=e.clone(r,E),s=e.clone(r,m),c=e.clone(r,y),l=e.clone(r,_),f=t.length,N=1;N<f;N++){e.clone(t[N],r);var x=r.x,w=r.y,I=r.z;x<i.x&&e.clone(r,i),x>s.x&&e.clone(r,s),w<o.y&&e.clone(r,o),w>c.y&&e.clone(r,c),I<u.z&&e.clone(r,u),I>l.z&&e.clone(r,l)}var O=e.magnitudeSquared(e.subtract(s,i,T)),M=e.magnitudeSquared(e.subtract(c,o,T)),P=e.magnitudeSquared(e.subtract(l,u,T)),C=i,D=s,L=O;M>L&&(L=M,C=o,D=c),P>L&&(L=P,C=u,D=l);var U=R;U.x=.5*(C.x+D.x),U.y=.5*(C.y+D.y),U.z=.5*(C.z+D.z);var b=e.magnitudeSquared(e.subtract(D,U,T)),F=Math.sqrt(b),B=g;B.x=i.x,B.y=o.y,B.z=u.z;var z=A;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,T),.5,S),q=0;for(N=0;N<f;N++){e.clone(t[N],r);var W=e.magnitude(e.subtract(r,G,T));W>q&&(q=W);var V=e.magnitudeSquared(e.subtract(r,U,T));if(V>b){var H=Math.sqrt(V);F=.5*(F+H),b=F*F;var X=H-F;U.x=(F*U.x+X*r.x)/H,U.y=(F*U.y+X*r.y)/H,U.z=(F*U.z+X*r.z)/H}}return F<q?(e.clone(U,n.center),n.radius=F):(e.clone(G,n.center),n.radius=q),n};var N=new o,x=new e,w=new e,I=new t,O=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,N),f.southwest(t,I),I.height=i,f.northeast(t,O),O.height=o;var s=n.project(I,x),c=n.project(O,w),l=c.x-s.x,d=c.y-s.y,p=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+p*p);var E=u.center;return E.x=s.x+.5*l,E.y=s.y+.5*d,E.z=s.z+.5*p,u};var M=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,M)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=v;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,p),l=e.clone(u,E),f=e.clone(u,m),N=e.clone(u,y),x=e.clone(u,_),w=t.length,I=0;I<w;I+=i){var O=t[I]+n.x,M=t[I+1]+n.y,P=t[I+2]+n.z;u.x=O,u.y=M,u.z=P,O<s.x&&e.clone(u,s),O>f.x&&e.clone(u,f),M<c.y&&e.clone(u,c),M>N.y&&e.clone(u,N),P<l.z&&e.clone(u,l),P>x.z&&e.clone(u,x)}var C=e.magnitudeSquared(e.subtract(f,s,T)),D=e.magnitudeSquared(e.subtract(N,c,T)),L=e.magnitudeSquared(e.subtract(x,l,T)),U=s,b=f,F=C;D>F&&(F=D,U=c,b=N),L>F&&(F=L,U=l,b=x);var B=R;B.x=.5*(U.x+b.x),B.y=.5*(U.y+b.y),B.z=.5*(U.z+b.z);var z=e.magnitudeSquared(e.subtract(b,B,T)),G=Math.sqrt(z),q=g;q.x=s.x,q.y=c.y,q.z=l.z;var W=A;W.x=f.x,W.y=N.y,W.z=x.z;var V=e.multiplyByScalar(e.add(q,W,T),.5,S),H=0;for(I=0;I<w;I+=i){u.x=t[I]+n.x,u.y=t[I+1]+n.y,u.z=t[I+2]+n.z;var X=e.magnitude(e.subtract(u,V,T));X>H&&(H=X);var Y=e.magnitudeSquared(e.subtract(u,B,T));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(V,o.center),o.radius=H),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=v;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,p),s=e.clone(i,E),c=e.clone(i,m),l=e.clone(i,y),f=e.clone(i,_),N=t.length,x=0;x<N;x+=3){var w=t[x]+n[x],I=t[x+1]+n[x+1],O=t[x+2]+n[x+2];i.x=w,i.y=I,i.z=O,w<o.x&&e.clone(i,o),w>c.x&&e.clone(i,c),I<u.y&&e.clone(i,u),I>l.y&&e.clone(i,l),O<s.z&&e.clone(i,s),O>f.z&&e.clone(i,f)}var M=e.magnitudeSquared(e.subtract(c,o,T)),P=e.magnitudeSquared(e.subtract(l,u,T)),C=e.magnitudeSquared(e.subtract(f,s,T)),D=o,L=c,U=M;P>U&&(U=P,D=u,L=l),C>U&&(U=C,D=s,L=f);var b=R;b.x=.5*(D.x+L.x),b.y=.5*(D.y+L.y),b.z=.5*(D.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,T)),B=Math.sqrt(F),z=g;z.x=o.x,z.y=u.y,z.z=s.z;var G=A;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(z,G,T),.5,S),W=0;for(x=0;x<N;x+=3){i.x=t[x]+n[x],i.y=t[x+1]+n[x+1],i.z=t[x+2]+n[x+2];var V=e.magnitude(e.subtract(i,q,T));V>W&&(W=V);var H=e.magnitudeSquared(e.subtract(i,b,T));if(H>F){var X=Math.sqrt(H);B=.5*(B+X),F=B*B;var Y=X-B;b.x=(B*b.x+Y*i.x)/X,b.y=(B*b.y+Y*i.y)/X,b.z=(B*b.z+Y*i.z)/X}}return B<W?(e.clone(b,r.center),r.radius=B):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var P=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return n.radius=s,n};var C=new e,D=new e,L=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,C),o=c.getColumn(r,1,D),u=c.getColumn(r,2,L),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var U=new e,b=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var F=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,F));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h), -n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var z=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,z),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,V=new e,H=new e,X=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,H),d=e.negate(c,V),p=Y,E=p[0];e.add(s,l,E),e.add(E,c,E),E=p[1],e.add(s,l,E),e.add(E,d,E),E=p[2],e.add(s,f,E),e.add(E,d,E),E=p[3],e.add(s,f,E),e.add(E,c,E),e.negate(s,s),E=p[4],e.add(s,l,E),e.add(E,c,E),E=p[5],e.add(s,l,E),e.add(E,d,E),E=p[6],e.add(s,f,E),e.add(E,d,E),E=p[7],e.add(s,f,E),e.add(E,c,E);for(var m=p.length,y=0;y<m;++y){var _=p[y];e.add(o,_,_);var v=i.cartesianToCartographic(_,X);n.project(v,_)}a=h.fromPoints(p,a),o=a.center;var T=o.x,R=o.y,g=o.z;return o.x=g,o.y=T,o.z=R,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(R)&&(R=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(R=!0,g=r(e[1]))}return R}function i(){return a()&&g}function o(){if(!t(A)&&(A=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(T.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function u(){return o()&&S}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(T.userAgent);null!==e&&(N=!0,x=r(e[1]),x.isNightly=!!e[2])}return N}function c(){return s()&&x}function l(){if(!t(w)){w=!1;var e;"Microsoft Internet Explorer"===T.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(w=!0,I=r(e[1]))):"Netscape"===T.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(T.userAgent),null!==e&&(w=!0,I=r(e[1])))}return w}function f(){return l()&&I}function h(){if(!t(O)){O=!1;var e=/ Edge\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(O=!0,M=r(e[1]))}return O}function d(){return h()&&M}function p(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(T.userAgent);null!==e&&(P=!0,C=r(e[1]))}return P}function E(){return t(D)||(D=/Windows/i.test(T.appVersion)),D}function m(){return p()&&C}function y(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(T.pointerEnabled)||T.pointerEnabled)),L}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;b=t(n)&&""!==n,b&&(U=n)}return b}function v(){return _()?U:void 0}var T;T="undefined"!=typeof navigator?navigator:{};var R,g,A,S,N,x,w,I,O,M,P,C,D,L,U,b,F={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:p,firefoxVersion:m,isWindows:E,hardwareConcurrency:e(T.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:v};return F.supportsFullscreen=function(){return n.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],p=d.x,E=d.y,m=d.z;a=Math.min(p,a),s=Math.max(p,s),o=Math.min(E,o),c=Math.max(E,c),u=Math.min(m,u),l=Math.max(m,l)}var y=r.minimum;y.x=a,y.y=o,y.z=u;var _=r.maximum;_.x=s,_.y=c,_.z=l;var v=e.add(y,_,r.center);return e.multiplyByScalar(v,.5,v),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,p=o*s-h,E=o*c-u*s,m=u*c-d,y=4*p*m-E*E;if(y<0){var _,v,T;h*f>=l*d?(_=o,v=p,T=-2*u*p+o*E):(_=c,v=m,T=-c*E+2*s*m);var R=T<0?-1:1,g=-R*Math.abs(_)*Math.sqrt(-y);i=-T+g;var A=i/2,S=A<0?-Math.pow(-A,1/3):Math.pow(A,1/3),N=i===g?-S:-v/S;return a=v<=0?S+N:-T/(S*S+N*N+v),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var x=p,w=-2*u*p+o*E,I=m,O=-c*E+2*s*m,M=Math.sqrt(y),P=Math.sqrt(3)/2,C=Math.abs(Math.atan2(o*M,-w)/3);a=2*Math.sqrt(-x);var D=Math.cos(C);i=a*D;var L=a*(-D/2-P*Math.sin(C)),U=i+L>2*u?i-u:L-u,b=o,F=U/b;C=Math.abs(Math.atan2(c*M,-O)/3),a=2*Math.sqrt(-I),D=Math.cos(C),i=a*D,L=a*(-D/2-P*Math.sin(C));var B=-c,z=i+L<2*s?i+s:L+s,G=B/z,q=b*z,W=-U*z-b*B,V=U*B,H=(s*W-u*V)/(-u*W+s*q);return F<=H?F<=G?H<=G?[F,H,G]:[F,G,H]:[G,F,H]:F<=G?[H,F,G]:H<=G?[H,G,F]:[G,H,F]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var p=r.computeRealRoots(1,s,l);if(2===p.length){var E,m=p[0],y=p[1];if(m>=0&&y>=0){var _=Math.sqrt(m),v=Math.sqrt(y);return[h-v,h-_,h+_,h+v]}if(m>=0&&y<0)return E=Math.sqrt(m),[h-E,h+E];if(m<0&&y>=0)return E=Math.sqrt(y),[h-E,h+E]}return[]}if(d>0){var T=Math.sqrt(d),R=(s+d-c/T)/2,g=(s+d+c/T)/2,A=r.computeRealRoots(1,T,R),S=r.computeRealRoots(1,-T,g);return 0!==A.length?(A[0]+=h,A[1]+=h,0!==S.length?(S[0]+=h,S[1]+=h,A[1]<=S[0]?[A[0],A[1],S[0],S[1]]:S[1]<=A[0]?[S[0],S[1],A[0],A[1]]:A[0]>=S[0]&&A[1]<=S[1]?[S[0],A[0],A[1],S[1]]:S[0]>=A[0]&&S[1]<=A[1]?[A[0],S[0],S[1],A[1]]:A[0]>S[0]&&A[0]<S[1]?[S[0],A[0],S[1],A[1]]:[A[0],S[0],A[1],S[1]]):A):0!==S.length?(S[0]+=h,S[1]+=h,S):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var p,E,m=d[0],y=a-m,_=y*y,v=t/2,T=y/2,R=_-4*o,g=_+4*Math.abs(o),A=c-4*m,S=c+4*Math.abs(m);if(m<0||R*S<A*g){var N=Math.sqrt(A);p=N/2,E=0===N?0:(t*T-i)/N}else{var x=Math.sqrt(R);p=0===x?0:(t*T-i)/x,E=x/2}var w,I;0===v&&0===p?(w=0,I=0):n.sign(v)===n.sign(p)?(w=v+p,I=m/w):(I=v-p,w=m/I);var O,M;0===T&&0===E?(O=0,M=0):n.sign(T)===n.sign(E)?(O=T+E,M=o/O):(M=T-E,O=o/M);var P=r.computeRealRoots(1,w,O),C=r.computeRealRoots(1,I,M);if(0!==P.length)return 0!==C.length?P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>C[0]&&P[0]<C[1]?[C[0],P[0],C[1],P[1]]:[P[0],C[0],P[1],C[1]]:P;if(0!==C.length)return C}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,p=d*a,E=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*p+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return E},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,_),h=e.dot(u,u),d=2*e.dot(u,l),p=e.magnitudeSquared(l)-c,E=f(h,d,p,g);if(r(E))return a.start=E.root0,a.stop=E.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function p(t,n,r,a,i){var l,f=a*a,h=i*i,p=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,E=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),m=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,y=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),v=[];if(0===_&&0===y){if(l=s.computeRealRoots(p,E,m),0===l.length)return v;var T=l[0],R=Math.sqrt(Math.max(1-T*T,0));if(v.push(new e(a,i*T,i*-R)),v.push(new e(a,i*T,i*R)),2===l.length){var g=l[1],A=Math.sqrt(Math.max(1-g*g,0));v.push(new e(a,i*g,i*-A)),v.push(new e(a,i*g,i*A))}return v}var S=_*_,N=y*y,x=p*p,w=_*y,I=x+N,O=2*(E*p+w),M=2*m*p+E*E-N+S,P=2*(m*E-w),C=m*m-S;if(0===I&&0===O&&0===M&&0===P)return v;l=c.computeRealRoots(I,O,M,P,C);var D=l.length;if(0===D)return v;for(var L=0;L<D;++L){var U,b=l[L],F=b*b,B=Math.max(1-F,0),z=Math.sqrt(B);U=o.sign(p)===o.sign(m)?d(p*F+m,E*b,o.EPSILON12):o.sign(m)===o.sign(E*b)?d(p*F,E*b+m,o.EPSILON12):d(p*F+E*b,m,o.EPSILON12);var G=d(y*b,_,o.EPSILON15),q=U*G;q<0?v.push(new e(a,i*b,i*z)):q>0?v.push(new e(a,i*b,i*-z)):0!==z?(v.push(new e(a,i*b,i*-z)),v.push(new e(a,i*b,i*z)),++L):v.push(new e(a,i*b,i*z))}return v}var E={};E.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var m=new e,y=new e,_=new e,v=new e,T=new e;E.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,p=t.direction,E=e.subtract(a,r,m),R=e.subtract(i,r,y),g=e.cross(p,R,_),A=e.dot(E,g);if(u){if(A<o.EPSILON6)return;if(s=e.subtract(d,r,v),l=e.dot(s,g),l<0||l>A)return;if(c=e.cross(s,E,T),f=e.dot(p,c),f<0||l+f>A)return;h=e.dot(R,c)/A}else{if(Math.abs(A)<o.EPSILON6)return;var S=1/A;if(s=e.subtract(d,r,v),l=e.dot(s,g)*S,l<0||l>1)return;if(c=e.cross(s,E,T),f=e.dot(p,c)*S,f<0||l+f>1)return;h=e.dot(R,c)*S}return h},E.rayTriangle=function(t,n,a,i,o,u){var s=E.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new l;E.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction), -e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var g={root0:0,root1:0};E.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var A=new l;E.lineSegmentSphere=function(t,n,a,i){var o=A;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var S=new e,N=new e;E.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,S),f=e.multiplyComponents(c,t.direction,N),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var p=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,p<o)return;if(p>o){u=d*d-o,s=-d+Math.sqrt(u);var E=s/a,m=r/s;return E<m?new i(E,m):{start:m,stop:E}}var y=Math.sqrt(r/a);return new i(y,y)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var x=new e,w=new e,I=new e,O=new e,M=new e,P=new u,C=new u,D=new u,L=new u,U=new u,b=new u,F=new u,B=new e,z=new e,G=new t;E.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,x);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,x),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,O),d=e.normalize(e.cross(h,f,w),w),E=e.normalize(e.cross(f,d,I),I),m=P;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=E.x,m[7]=E.y,m[8]=E.z;var y=u.transpose(m,C),_=u.fromScale(n.radii,D),v=u.fromScale(n.oneOverRadii,L),T=U;T[0]=0,T[1]=-i.z,T[2]=i.y,T[3]=i.z,T[4]=0,T[5]=-i.x,T[6]=-i.y,T[7]=i.x,T[8]=0;var R,g,A=u.multiply(u.multiply(y,v,b),T,b),S=u.multiply(u.multiply(A,_,F),m,F),N=u.multiplyByVector(A,a,M),q=p(S,e.negate(N,x),0,0,1),W=q.length;if(W>0){for(var V=e.clone(e.ZERO,z),H=Number.NEGATIVE_INFINITY,X=0;X<W;++X){R=u.multiplyByVector(_,u.multiplyByVector(m,q[X],B),B);var Y=e.normalize(e.subtract(R,a,O),O),k=e.dot(Y,i);k>H&&(H=k,V=e.clone(R,V))}var Z=n.cartesianToCartographic(V,G);return H=o.clamp(H,0,1),g=e.magnitude(e.subtract(V,a,O))*Math.sqrt(1-H*H),g=c?-g:g,Z.height=g,n.cartographicToCartesian(Z,new e)}};var q=new e;return E.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},E.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return E.lineSegmentPlane(t,n,a,f),E.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(n,r,a,f),E.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(r,t,a,f),E.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(n,t,a,f),E.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(r,n,a,f),E.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,r,a,f),E.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return p(e)}function a(e){return p(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,p;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return E(f,e),e},p=function(e){return e=t(e),h=e.then,p=t,d=y,E(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return m(2,arguments),e(t,function(t){function u(e){E(e)}function s(e){p(e)}var c,l,f,h,d,p,E,m,_,v;if(_=t.length>>>0,c=Math.max(0,Math.min(n,_)),f=[],l=_-c+1,h=[],d=o(),c)for(m=d.progress,E=function(e){h.push(e),--l||(p=E=y,d.reject(h))},p=function(e){f.push(e),--c||(p=E=y,d.resolve(f))},v=0;v<_;++v)v in t&&e(t[v],s,u,m);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return m(1,arguments),h(e,_).then(t,n,r)}function f(){return h(arguments,_)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=T.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},v.apply(t,r)})}function p(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function E(e,t){for(var n,r=0;n=e[r++];)n(t)}function m(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function y(){}function _(e){return e}var v,T,R;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=p,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},T=[].slice,v=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,p,E,m,y;if("%%"==e)return"%";for(var _=!1,v="",T=!1,R=!1,g=" ",A=s.length,S=0;s&&S<A;S++)switch(s.charAt(S)){case" ":v=" ";break;case"+":v="+";break;case"-":_=!0;break;case"'":g=s.charAt(S+1);break;case"0":T=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(y),_,c,f,T,g);case"c":return u(String.fromCharCode(+y),_,c,f,T);case"b":return o(y,2,R,_,c,f,T);case"o":return o(y,8,R,_,c,f,T);case"x":return o(y,16,R,_,c,f,T);case"X":return o(y,16,R,_,c,f,T).toUpperCase();case"u":return o(y,10,R,_,c,f,T);case"i":case"d":return d=+y||0,d=Math.round(d-d%1),p=d<0?"-":v,y=p+a(String(Math.abs(d)),f,"0",!1),i(y,p,_,c,T);case"e":case"E":case"f":case"F":case"g":case"G":return d=+y,p=d<0?"-":v,E=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],y=p+Math.abs(d)[E](f),i(y,p,_,c,T)[m]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return E.compare(e.julianDate,t.julianDate)}function f(e){v.julianDate=e;var n=E.leapSeconds,r=t(n,v,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=E.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}E.addSeconds(e,a,e)}function h(e,n){v.julianDate=e;var r=E.leapSeconds,a=t(r,v,l);if(a<0&&(a=~a),0===a)return E.addSeconds(e,-r[0].offset,n);if(a>=r.length)return E.addSeconds(e,-r[a-1].offset,n);var i=E.secondsDifference(r[a].julianDate,e);return 0===i?E.addSeconds(e,-r[a].offset,n):i<=1?void 0:E.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function p(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function E(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var m=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,v=new u,T=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,g=/^(\d{4})-?(\d{3})$/,A=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,S=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+N.source,w=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,I=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;E.fromDate=function(e,t){var n=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new E(n[0],n[1],c.UTC)},E.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,m=0,v=0,N=0,O=u[0],M=u[1];if(u=O.match(S),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=O.match(R),null!==u)n=+u[1],s=+u[2];else if(u=O.match(T),null!==u)n=+u[1];else{var P;if(u=O.match(g),null!==u)n=+u[1],P=+u[2],i=o(n);else if(u=O.match(A),null!==u){n=+u[1];var C=+u[2],D=+u[3]||0,L=new Date(Date.UTC(n,0,4));P=7*C+D-L.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(P),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var U;if(r(M)){u=M.match(I),null!==u?(h=+u[1],m=+u[2],v=+u[3],N=1e3*+(u[4]||0),U=5):(u=M.match(w),null!==u?(h=+u[1],m=+u[2],v=60*+(u[3]||0),U=4):(u=M.match(x),null!==u&&(h=+u[1],m=60*+(u[2]||0),U=3)));var b=u[U],F=+u[U+1],B=+(u[U+2]||0);switch(b){case"+":h-=F,m-=B;break;case"-":h+=F,m+=B;break;case"Z":break;default:m+=new Date(Date.UTC(n,s-1,l,h,m)).getTimezoneOffset()}}else m+=new Date(n,s-1,l).getTimezoneOffset();var z=60===v;for(z&&v--;m>=60;)m-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?_:y[s-1];for(;m<0;)m+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?_:y[s-1],l+=a;var G=p(n,s,l,h,m,v,N);return r(t)?(d(G[0],G[1],t),f(t)):t=new E(G[0],G[1],c.UTC),z&&E.addSeconds(t,1,t),t},E.now=function(e){return E.fromDate(new Date,e)};var O=new E(0,0,c.TAI);return E.toGregorianDate=function(e,t){var n=!1,a=h(e,O);r(a)||(E.addSeconds(e,-1,O),a=h(O,O),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,p=c-(2447*d/80|0)|0;c=d/11|0;var m=d+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,v=u-_*s.SECONDS_PER_HOUR,T=v/s.SECONDS_PER_MINUTE|0;v-=T*s.SECONDS_PER_MINUTE;var R=0|v,g=(v-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(R+=1),r(t)?(t.year=y,t.month=m,t.day=p,t.hour=_,t.minute=T,t.second=R,t.millisecond=g,t.isLeapSecond=n,t):new i(y,m,p,_,T,R,g,n)},E.toDate=function(e){var t=E.toGregorianDate(e,m),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},E.toIso8601=function(t,n){var a,i=E.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},E.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new E(e.dayNumber,e.secondsOfDay,c.TAI)},E.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},E.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(E.secondsDifference(e,t))<=n},E.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},E.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},E.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},E.computeTaiMinusUtc=function(e){v.julianDate=e;var n=E.leapSeconds,r=t(n,v,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},E.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},E.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},E.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},E.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},E.lessThan=function(e,t){return E.compare(e,t)<0},E.lessThanOrEquals=function(e,t){return E.compare(e,t)<=0},E.greaterThan=function(e,t){return E.compare(e,t)>0},E.greaterThanOrEquals=function(e,t){return E.compare(e,t)>=0},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return E.toIso8601(this)},E.leapSeconds=[new u(new E(2441317,43210,c.TAI),10),new u(new E(2441499,43211,c.TAI),11),new u(new E(2441683,43212,c.TAI),12),new u(new E(2442048,43213,c.TAI),13),new u(new E(2442413,43214,c.TAI),14),new u(new E(2442778,43215,c.TAI),15),new u(new E(2443144,43216,c.TAI),16),new u(new E(2443509,43217,c.TAI),17),new u(new E(2443874,43218,c.TAI),18),new u(new E(2444239,43219,c.TAI),19),new u(new E(2444786,43220,c.TAI),20),new u(new E(2445151,43221,c.TAI),21),new u(new E(2445516,43222,c.TAI),22),new u(new E(2446247,43223,c.TAI),23),new u(new E(2447161,43224,c.TAI),24),new u(new E(2447892,43225,c.TAI),25),new u(new E(2448257,43226,c.TAI),26),new u(new E(2448804,43227,c.TAI),27),new u(new E(2449169,43228,c.TAI),28),new u(new E(2449534,43229,c.TAI),29),new u(new E(2450083,43230,c.TAI),30),new u(new E(2450630,43231,c.TAI),31),new u(new E(2451179,43232,c.TAI),32),new u(new E(2453736,43233,c.TAI),33),new u(new E(2454832,43234,c.TAI),34),new u(new E(2456109,43235,c.TAI),35),new u(new E(2457204,43236,c.TAI),36),new u(new E(2457754,43237,c.TAI),37)],E}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var p=new XMLHttpRequest;if(o.contains(e)&&(p.withCredentials=!0),n(h)&&n(p.overrideMimeType)&&p.overrideMimeType(h),p.open(r,e,!0),n(s))for(var E in s)s.hasOwnProperty(E)&&p.setRequestHeader(E,s[E]);n(t)&&(p.responseType=t),p.onload=function(){if(p.status<200||p.status>=300)return void c.reject(new a(p.status,p.response,p.getAllResponseHeaders()));var e=p.response,r=p.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(p.responseXML)&&p.responseXML.hasChildNodes()?c.resolve(p.responseXML):""!==r&&"text"!==r||!n(p.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(p.responseText);else c.resolve(e)},p.onerror=function(e){c.reject(new a)},p.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))p(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){p(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function p(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||p<0||E<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var m=e._samples=n.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=E,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var _,v=e._addNewLeapSeconds,T=0,R=m.length;T<R;T+=e._columnCount){var g=m[T+a],A=m[T+E],S=g+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(S,A,f.TAI);if(y.push(N),v){if(A!==_&&r(_)){var x=o.leapSeconds,w=t(x,N,d);if(w<0){var I=new u(N,A);x.splice(~w,0,I)}}_=A}}}function E(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function m(e,t,n){return t+e*(n-t)}function y(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return E(e,n,a,s,u),u;if(r.equals(l))return E(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,p=n[h+e._ut1MinusUtcSecondsColumn],y=n[d+e._ut1MinusUtcSecondsColumn],_=y-p;if(_>.5||_<-.5){var v=n[h+e._taiMinusUtcSecondsColumn],T=n[d+e._taiMinusUtcSecondsColumn];v!==T&&(l.equals(r)?p=y:y-=T-v)}return u.xPoleWander=m(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,p,y),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),p=!r(h),E=p||o.greaterThanOrEquals(h,e);if(d&&E)return s=u,!p&&h.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,n),n}var m=t(i,e,o.compare,this._dateColumn);return m>=0?(m<i.length-1&&i[m+1].equals(e)&&++m,s=m,l=m):(l=~m,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=p.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=p,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){ -"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],p=f;p<=h;++p)d.push(l(this,p));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var p,E,m=i-s*this._stepSizeDays,y=this._work,_=this._denominators,v=this._coef,T=this._xTable;for(p=0;p<=u;++p)y[p]=m-T[p];for(p=0;p<=u;++p){for(v[p]=1,E=0;E<=u;++E)E!==p&&(v[p]*=y[E]);v[p]*=_[p];var R=3*(s+p);n.x+=v[p]*d[R++],n.y+=v[p]*d[R++],n.s+=v[p]*d[R]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=h,a):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],p=e[c.COLUMN2ROW2],E=s+f+p;if(E>0)n=Math.sqrt(E+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var m=h,y=0;f>s&&(y=1),p>s&&p>f&&(y=2);var _=m[y],v=m[_];n=Math.sqrt(e[c.getElementIndex(y,y)]-e[c.getElementIndex(_,_)]-e[c.getElementIndex(v,v)]+1);var T=d;T[y]=.5*n,n=.5/n,u=(e[c.getElementIndex(v,_)]-e[c.getElementIndex(_,v)])*n,T[_]=(e[c.getElementIndex(_,y)]+e[c.getElementIndex(y,_)])*n,T[v]=(e[c.getElementIndex(v,y)]+e[c.getElementIndex(y,v)])*n,a=-T[0],i=-T[1],o=-T[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var p=new l,E=new l,m=new l,y=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),y=l.fromAxisAngle(e.UNIT_X,o.roll,p),m=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(m,y,m),E=l.fromAxisAngle(e.UNIT_Z,-o.heading,p),l.multiply(E,i,i)};var _=new e,v=new e,T=new l,R=new l,g=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,g),l.conjugate(g,g);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),T),l.multiply(T,g,T),T.w<0&&l.negate(T,T),l.computeAxis(T,_);var u=l.computeAngle(T);r[o]=_.x*u,r[o+1]=_.y*u,r[o+2]=_.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,v);var u=e.magnitude(v);return l.unpack(n,4*i,R),0===u?l.clone(l.IDENTITY,T):l.fromAxisAngle(v,u,T),l.multiply(T,R,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,p=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=p,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var A=new l;l.lerp=function(e,t,n,r){return A=l.multiplyByScalar(t,n,A),r=l.multiplyByScalar(e,1-n,r),l.add(A,r,r)};var S=new l,N=new l,x=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=S=l.negate(t,S)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return N=l.multiplyByScalar(e,Math.sin((1-n)*o),N),x=l.multiplyByScalar(i,Math.sin(n*o),x),r=l.add(N,x,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var w=new e,I=new e,O=new l,M=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,O);l.multiply(i,r,M);var o=l.log(M,w);l.multiply(i,t,M);var u=l.log(M,I);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,O),l.multiply(n,O,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,O),u=l.slerp(n,r,a,M);return l.slerp(o,u,2*a*(1-a),i)};for(var P=new l,C=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],b=i.supportsTypedArrays()?new Float32Array(8):[],F=0;F<7;++F){var B=F+1,z=2*B+1;D[F]=1/(B*z),L[F]=B/z}return D[7]=C/136,L[7]=8*C/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)U[f]=(D[f]*s-L[f])*o,b[f]=(D[f]*c-L[f])*o;var h=a*n*(1+U[0]*(1+U[1]*(1+U[2]*(1+U[3]*(1+U[4]*(1+U[5]*(1+U[6]*(1+U[7])))))))),d=u*(1+b[0]*(1+b[1]*(1+b[2]*(1+b[3]*(1+b[4]*(1+b[5]*(1+b[6]*(1+b[7])))))))),p=l.multiplyByScalar(e,d,P);return l.multiplyByScalar(t,h,r),l.add(p,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,O),u=l.fastSlerp(n,r,a,M);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,m,y,_,v,T){"use strict";var R={},g={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},A={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},S={},N={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},x=new n,w=new n,I=new n;R.localFrameToFixedFrameGenerator=function(e,t){if(!g.hasOwnProperty(e)||!g[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=g[e][t],i=e+t;return u(S[i])?r=S[i]:(r=function(r,i,s){if(u(s)||(s=new _),m.equalsEpsilon(r.x,0,m.EPSILON14)&&m.equalsEpsilon(r.y,0,m.EPSILON14)){var c=m.sign(r.z);n.unpack(A[e],0,x),"east"!==e&&"west"!==e&&n.multiplyByScalar(x,c,x),n.unpack(A[t],0,w),"east"!==t&&"west"!==t&&n.multiplyByScalar(w,c,w),n.unpack(A[a],0,I),"east"!==a&&"west"!==a&&n.multiplyByScalar(I,c,I)}else{i=o(i,h.WGS84),i.geodeticSurfaceNormal(r,N.up);var l=N.up,f=N.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,N.east),n.cross(l,f,N.north),n.multiplyByScalar(N.up,-1,N.down),n.multiplyByScalar(N.east,-1,N.west),n.multiplyByScalar(N.north,-1,N.south),x=N[e],w=N[t],I=N[a]}return s[0]=x.x,s[1]=x.y,s[2]=x.z,s[3]=0,s[4]=w.x,s[5]=w.y,s[6]=w.z,s[7]=0,s[8]=I.x,s[9]=I.y,s[10]=I.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},S[i]=r),r},R.eastNorthUpToFixedFrame=R.localFrameToFixedFrameGenerator("east","north"),R.northEastDownToFixedFrame=R.localFrameToFixedFrameGenerator("north","east"),R.northUpEastToFixedFrame=R.localFrameToFixedFrameGenerator("north","up"),R.northWestUpToFixedFrame=R.localFrameToFixedFrameGenerator("north","west");var O=new v,M=new n(1,1,1),P=new _;R.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof _&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,R.eastNorthUpToFixedFrame);var u=v.fromHeadingPitchRoll(t,O),c=_.fromTranslationQuaternionRotationScale(n.ZERO,u,M,P);return i=a(e,r,i),_.multiply(i,c,i)};var C=new _,D=new y;R.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof v&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=R.headingPitchRollToFixedFrame(e,t,n,r,C),o=_.getRotation(i,D);return v.fromRotationMatrix(o,a)};var L=24110.54841,U=8640184.812866,b=.093104,F=-62e-7,B=1.1772758384668e-19,z=72921158553e-15,G=m.TWO_PI/86400,q=new E;R.computeTemeToPseudoFixedMatrix=function(e,t){q=E.addSeconds(e,-E.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/T.DAYS_PER_JULIAN_CENTURY:(i-.5)/T.DAYS_PER_JULIAN_CENTURY;var o=L+n*(U+n*(b+n*F)),s=o*G%m.TWO_PI,c=z+B*(r-2451545.5),l=(a+.5*T.SECONDS_PER_DAY)%T.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(h,d,0,-d,h,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=l.NONE;var W=32.184,V=2451545;R.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=R.iau2006XysData.preload(n,r,a,i),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var n=R.computeFixedToIcrfMatrix(e,t);if(u(n))return y.transpose(n,t)};var H=new p(0,0,0),X=new f(0,0,0,0,0,0),Y=new y,k=new y;R.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var n=R.earthOrientationParameters.compute(e,X);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=R.iau2006XysData.computeXysRadians(r,a,H);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,k),h=y.multiply(l,f,Y),d=e.dayNumber,p=e.secondsOfDay-E.computeTaiMinusUtc(e)+n.ut1MinusUtc,_=d-2451545,v=p/T.SECONDS_PER_DAY,g=.779057273264+v+.00273781191135448*(_+v);g=g%1*m.TWO_PI;var A=y.fromRotationZ(g,k),S=y.multiply(h,A,Y),N=Math.cos(n.xPoleWander),x=Math.cos(n.yPoleWander),w=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),O=r-V+a/T.SECONDS_PER_DAY;O/=36525;var M=-47e-6*O*m.RADIANS_PER_DEGREE/3600,P=Math.cos(M),C=Math.sin(M),D=k;return D[0]=N*P,D[1]=N*C,D[2]=w,D[3]=-x*C+I*w*P,D[4]=x*P+I*w*C,D[5]=-I*N,D[6]=-I*C-x*w*P,D[7]=I*P-x*w*C,D[8]=x*N,y.multiply(S,D,t)}}};var Z=new r;R.pointToWindowCoordinates=function(e,t,n,r){return r=R.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},R.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return _.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,J=new n;R.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,h.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,m.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new _,ue=new _;R.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=R.eastNorthUpToFixedFrame(o,i,oe),c=_.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=_.getColumn(t,0,ee),d=n.magnitude(h),p=_.multiplyByVector(c,h,re);r.fromElements(p.z,p.x,p.y,0,p);var E=_.getColumn(t,1,ee),m=n.magnitude(E),y=_.multiplyByVector(c,E,ae);r.fromElements(y.z,y.x,y.y,0,y);var v=_.getColumn(t,2,ee),T=n.magnitude(v),g=ie;return n.cross(p,y,g),n.normalize(g,g),n.cross(y,g,p),n.normalize(p,p),n.cross(g,p,y),n.normalize(y,y),n.multiplyByScalar(p,d,p),n.multiplyByScalar(y,m,y),n.multiplyByScalar(g,T,g),_.setColumn(a,0,p,a),_.setColumn(a,1,y,a),_.setColumn(a,2,g,a),_.setColumn(a,3,f,a),a};var se=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return R.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=R.eastNorthUpToFixedFrame(t,r,oe),i=_.inverseTransformation(a,ue),o=r.cartesianToCartographic(t,Q),u=e.project(o,$),s=ne;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=_.fromTranslation(s,oe);return _.multiply(se,i,n),_.multiply(c,n,n),n},R}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function p(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,E)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,E));var i=n.fromCartesian4(l.getColumn(r,2,E));this._plane=f.fromPointNormal(e,i)}var E=new r;o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var m=new e;p.fromPoints=function(t,n){var r=e.fromPoints(t,m);return new p(r.center,n)};var y=new h,_=new n;p.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,_);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},p.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},p.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=y;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,_);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},p.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var v=new n;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=v,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=r.clone(e(t.modelMatrix,r.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,s,c,l){n(l)||(l=new t);var f,h,d,p,E,m,y,_;n(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(r,a,u),p=t.dot(f,f),E=t.dot(f,h),m=t.dot(f,d),y=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,a,i),h=e.subtract(c,a,o),d=e.subtract(r,a,u),p=e.dot(f,f),E=e.dot(f,h),m=e.dot(f,d),y=e.dot(h,h),_=e.dot(h,d));var v=1/(p*y-E*E);return l.y=(y*m-E*_)*v,l.z=(p*_-E*m)*v,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,n){t(n)||(n={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),n.high=r,n.low=e-r):(r=65536*Math.floor(-e/65536),n.high=-r,n.low=e+r),n};var a={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var i=n.high,o=n.low;return r.encode(e.x,a),i.x=a.high,o.x=a.low,r.encode(e.y,a),i.y=a.high,o.y=a.low,r.encode(e.z,a),i.z=a.high,o.z=a.low,n};var i=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,i);var a=i.high,o=i.low;t[n]=a.x,t[n+1]=a.y,t[n+2]=a.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.calculateACMR=function(n){n=e(n,e.EMPTY_OBJECT);var r=n.indices,a=n.maximumIndex,i=e(n.cacheSize,24),o=r.length;if(!t(a)){a=0;for(var u=0,s=r[u];u<o;)s>a&&(a=s),++u,s=r[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,h=0;h<o;++h)f-c[r[h]]>i&&(c[r[h]]=f,++f);return(f-i+1)/(o/3)},r.tipsify=function(n){function r(e,t,n,r){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<r;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,n,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<n.length;){var h=n[f];a[h].numLiveTriangles&&(s=0,i-a[h].timeStamp+2*a[h].numLiveTriangles<=t&&(s=i-a[h].timeStamp),(s>l||l===-1)&&(l=s,c=h)),++f}return c===-1?r(a,o,e,u):c}n=e(n,e.EMPTY_OBJECT);var i,o=n.indices,u=n.maximumIndex,s=e(n.cacheSize,24),c=o.length,l=0,f=0,h=o[f],d=c;if(t(u))l=u+1;else{for(;f<d;)h>l&&(l=h),++f,h=o[f];if(l===-1)return 0;++l}for(var p=[],E=0;E<l;E++)p[E]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var m=0;f<d;)p[o[f]].vertexTriangles.push(m),++p[o[f]].numLiveTriangles,p[o[f+1]].vertexTriangles.push(m),++p[o[f+1]].numLiveTriangles,p[o[f+2]].vertexTriangles.push(m),++p[o[f+2]].numLiveTriangles,++m,f+=3;var y=0,_=s+1;i=1;var v,T,R=[],g=[],A=0,S=[],N=c/3,x=[];for(E=0;E<N;E++)x[E]=!1;for(var w,I;y!==-1;){R=[],T=p[y],I=T.vertexTriangles.length;for(var O=0;O<I;++O)if(m=T.vertexTriangles[O],!x[m]){x[m]=!0,f=m+m+m;for(var M=0;M<3;++M)w=o[f],R.push(w),g.push(w),S[A]=w,++A,v=p[w],--v.numLiveTriangles,_-v.timeStamp>s&&(v.timeStamp=_,++_),++f}y=a(o,s,R,p,_,g,l)}return S},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,m,y,_,v,T,R,g,A,S){"use strict";function N(e,t,n,r,a){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=a,e[t++]=a,e[t]=n}function x(e){for(var t=e.length,n=t/3*6,r=m.createTypedArray(t,n),a=0,i=0;i<t;i+=3,a+=6)N(r,a,e[i],e[i+1],e[i+2]);return r}function w(e){var t=e.length;if(t>=3){var n=6*(t-2),r=m.createTypedArray(t,n);N(r,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)N(r,a,e[i-1],e[i],e[i-2]);return r}return new Uint16Array}function I(e){if(e.length>0){for(var t=e.length-1,n=6*(t-1),r=m.createTypedArray(t,n),a=e[0],i=0,o=1;o<t;++o,i+=6)N(r,i,a,e[o],e[o+1]);return r}return new Uint16Array}function O(e){var t={};for(var n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){var r=e[n];t[n]=new p({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function M(e,t,n){for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values))for(var a=t[r],i=0;i<a.componentsPerAttribute;++i)e[r].values.push(a.values[n*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),R.multiplyByPoint(e,ie,ie),a.pack(ie,n,i)}function C(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),T.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,n,i)}function D(e,t){var n,r=e.length,a={},i=e[0][t].attributes;for(n in i)if(i.hasOwnProperty(n)&&c(i[n])&&c(i[n].values)){for(var o=i[n],s=o.values.length,l=!0,f=1;f<r;++f){var h=e[f][t].attributes[n];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(a[n]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function L(e,t){var r,i,o,u,s,l,f,h=e.length,p=(e[0].modelMatrix,c(e[0][t].indices)),E=e[0][t].primitiveType,y=D(e,t);for(r in y)if(y.hasOwnProperty(r))for(s=y[r].values,u=0,i=0;i<h;++i)for(l=e[i][t].attributes[r].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(p){var v=0;for(i=0;i<h;++i)v+=e[i][t].indices.length;var T=d.computeNumberOfVertices(new d({attributes:y,primitiveType:A.POINTS})),R=m.createTypedArray(T,v),g=0,S=0;for(i=0;i<h;++i){var N=e[i][t].indices,x=N.length;for(u=0;u<x;++u)R[g++]=S+N[u];S+=d.computeNumberOfVertices(e[i][t])}_=R}var w,I=new a,O=0;for(i=0;i<h;++i){if(w=e[i][t].boundingSphere,!c(w)){I=void 0;break}a.add(w.center,I,I)}if(c(I))for(a.divideByScalar(I,h,I),i=0;i<h;++i){w=e[i][t].boundingSphere;var M=a.magnitude(a.subtract(w.center,I,se))+w.radius;M>O&&(O=M)}return new d({attributes:y,indices:_,primitiveType:E,boundingSphere:c(I)?new n(I,O):void 0})}function U(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function b(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;for(var r=3,a=3;a<t;++a)n[r++]=a-1,n[r++]=0,n[r++]=a;return e.indices=n,e.primitiveType=A.TRIANGLES,e}function F(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);for(var r=6,a=3;a<t-1;a+=2)n[r++]=a,n[r++]=a-1,n[r++]=a+1,a+2<t&&(n[r++]=a,n[r++]=a+1,n[r++]=a+2);return e.indices=n,e.primitiveType=A.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function z(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return e.indices=n,e.primitiveType=A.LINES,e}function G(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return n[r++]=t-1,n[r]=0,e.indices=n,e.primitiveType=A.LINES,e}function q(e){switch(e.primitiveType){case A.TRIANGLE_FAN:return b(e);case A.TRIANGLE_STRIP:return F(e);case A.TRIANGLES:return U(e);case A.LINE_STRIP:return z(e);case A.LINE_LOOP:return G(e);case A.LINES:return B(e)}return e}function W(e,t){Math.abs(e.y)<v.EPSILON6&&(t?e.y=-v.EPSILON6:e.y=v.EPSILON6)}function V(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return W(e,e.y<0),W(t,t.y<0),void W(n,n.y<0);var r,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(n.y); -r=a>i?a>o?v.sign(e.y):v.sign(n.y):i>o?v.sign(t.y):v.sign(n.y);var u=r<0;W(e,u),W(t,u),W(n,u)}function H(e,t,n,r){a.add(e,a.multiplyByScalar(a.subtract(t,e,Re),e.y/(e.y-t.y),Re),n),a.clone(n,r),W(n,!0),W(r,!1)}function X(e,t,n){if(!(e.x>=0||t.x>=0||n.x>=0)){V(e,t,n);var r=e.y<0,a=t.y<0,i=n.y<0,o=0;o+=r?1:0,o+=a?1:0,o+=i?1:0;var u=xe.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,r?(H(e,t,ge,Se),H(e,n,Ae,Ne),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,n,ge,Se),H(t,e,Ae,Ne),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(n,e,ge,Se),H(n,t,Ae,Ne),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,r?a?i||(H(n,e,ge,Se),H(n,t,Ae,Ne),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,n,ge,Se),H(t,e,Ae,Ne),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,ge,Se),H(e,n,Ae,Ne),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=xe.positions;return s[0]=e,s[1]=t,s[2]=n,s.length=3,1!==o&&2!==o||(s[3]=ge,s[4]=Ae,s[5]=Se,s[6]=Ne,s.length=7),xe}}function Y(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var a in r)if(r.hasOwnProperty(a)&&c(r[a])&&c(r[a].values)){var i=r[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=d.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function k(e){var t=e.attributes,n={};for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values)){var a=t[r];n[r]=new p({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new d({attributes:n,indices:[],primitiveType:e.primitiveType})}function Z(e,t,n){var r=c(e.geometry.boundingSphere);t=Y(t,r),n=Y(n,r),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function j(e,n,i,o,u,s,l,f,h,d,p,E){if(c(s)||c(l)||c(f)||c(h)||c(d)){var m=a.fromArray(u,3*e,we),y=a.fromArray(u,3*n,Ie),_=a.fromArray(u,3*i,Oe),v=t(o,m,y,_,Me);if(c(s)){var T=a.fromArray(s,3*e,we),R=a.fromArray(s,3*n,Ie),g=a.fromArray(s,3*i,Oe);a.multiplyByScalar(T,v.x,T),a.multiplyByScalar(R,v.y,R),a.multiplyByScalar(g,v.z,g);var A=a.add(T,R,T);a.add(A,g,A),a.normalize(A,A),a.pack(A,p.normal.values,3*E)}if(c(d)){var S=a.fromArray(d,3*e,we),N=a.fromArray(d,3*n,Ie),x=a.fromArray(d,3*i,Oe);a.multiplyByScalar(S,v.x,S),a.multiplyByScalar(N,v.y,N),a.multiplyByScalar(x,v.z,x);var w;a.equals(S,a.ZERO)&&a.equals(N,a.ZERO)&&a.equals(x,a.ZERO)?(w=we,w.x=0,w.y=0,w.z=0):(w=a.add(S,N,S),a.add(w,x,w),a.normalize(w,w)),a.pack(w,p.extrudeDirection.values,3*E)}if(c(l)){var I=a.fromArray(l,3*e,we),O=a.fromArray(l,3*n,Ie),M=a.fromArray(l,3*i,Oe);a.multiplyByScalar(I,v.x,I),a.multiplyByScalar(O,v.y,O),a.multiplyByScalar(M,v.z,M);var P=a.add(I,O,I);a.add(P,M,P),a.normalize(P,P),a.pack(P,p.tangent.values,3*E)}if(c(f)){var C=a.fromArray(f,3*e,we),D=a.fromArray(f,3*n,Ie),L=a.fromArray(f,3*i,Oe);a.multiplyByScalar(C,v.x,C),a.multiplyByScalar(D,v.y,D),a.multiplyByScalar(L,v.z,L);var U=a.add(C,D,C);a.add(U,L,U),a.normalize(U,U),a.pack(U,p.bitangent.values,3*E)}if(c(h)){var b=r.fromArray(h,2*e,Pe),F=r.fromArray(h,2*n,Ce),B=r.fromArray(h,2*i,De);r.multiplyByScalar(b,v.x,b),r.multiplyByScalar(F,v.y,F),r.multiplyByScalar(B,v.z,B);var z=r.add(b,F,b);r.add(z,B,z),r.pack(z,p.st.values,2*E)}}}function K(e,t,n,r,a,i){var o=e.position.values.length/3;if(a!==-1){var u=r[a],s=n[u];return s===-1?(n[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,n,r,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,h=c(s.bitangent)?s.bitangent.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,p=c(s.st)?s.st.values:void 0,E=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,m=u.indices,y=k(u),_=k(u),v=[];v.length=l.length/3;var T=[];for(T.length=l.length/3,o=0;o<v.length;++o)v[o]=-1,T[o]=-1;var R=m.length;for(o=0;o<R;o+=3){var g=m[o],A=m[o+1],S=m[o+2],N=a.fromArray(l,3*g),x=a.fromArray(l,3*A),w=a.fromArray(l,3*S),I=X(N,x,w);if(c(I)&&I.positions.length>3)for(var O=I.positions,M=I.indices,P=M.length,C=0;C<P;++C){var D=M[C],L=O[D];L.y<0?(t=_.attributes,n=_.indices,r=v):(t=y.attributes,n=y.indices,r=T),i=K(t,n,r,m,D<3?o+D:-1,L),j(g,A,S,L,l,f,d,h,p,E,t,i)}else c(I)&&(N=I.positions[0],x=I.positions[1],w=I.positions[2]),N.y<0?(t=_.attributes,n=_.indices,r=v):(t=y.attributes,n=y.indices,r=T),i=K(t,n,r,m,o,N),j(g,A,S,N,l,f,d,h,p,E,t,i),i=K(t,n,r,m,o+1,x),j(g,A,S,x,l,f,d,h,p,E,t,i),i=K(t,n,r,m,o+2,w),j(g,A,S,w,l,f,d,h,p,E,t,i)}Z(e,_,y)}function Q(e){var t,n=e.geometry,r=n.attributes,i=r.position.values,o=n.indices,u=k(n),s=k(n),l=o.length,f=[];f.length=i.length/3;var h=[];for(h.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,h[t]=-1;for(t=0;t<l;t+=2){var d=o[t],p=o[t+1],E=a.fromArray(i,3*d,we),m=a.fromArray(i,3*p,Ie);Math.abs(E.y)<v.EPSILON6&&(E.y<0?E.y=-v.EPSILON6:E.y=v.EPSILON6),Math.abs(m.y)<v.EPSILON6&&(m.y<0?m.y=-v.EPSILON6:m.y=v.EPSILON6);var y=u.attributes,T=u.indices,R=h,g=s.attributes,A=s.indices,S=f,N=_.lineSegmentPlane(E,m,Le,Oe);if(c(N)){var x=a.multiplyByScalar(a.UNIT_Y,5*v.EPSILON9,Ue);E.y<0&&(a.negate(x,x),y=s.attributes,T=s.indices,R=f,g=u.attributes,A=u.indices,S=h);var w=a.add(N,x,be);K(y,T,R,o,t,E),K(y,T,R,o,-1,w),a.negate(x,x),a.add(N,x,w),K(g,A,S,o,-1,w),K(g,A,S,o,t+1,m)}else{var I,O,M;E.y<0?(I=s.attributes,O=s.indices,M=f):(I=u.attributes,O=u.indices,M=h),K(I,O,M,o,t,E),K(I,O,M,o,t+1,m)}}Z(e,s,u)}function $(e){for(var t=e.attributes,n=t.position.values,r=t.prevPosition.values,i=t.nextPosition.values,o=n.length,u=0;u<o;u+=3){var s=a.unpack(n,u,ze);if(!(s.x>0)){var c=a.unpack(r,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(r[u]=n[u-3],r[u+1]=n[u-2],r[u+2]=n[u-1]):a.pack(s,r,u));var l=a.unpack(i,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=n[u+3],i[u+1]=n[u+4],i[u+2]=n[u+5]):a.pack(s,i,u))}}}function ee(e){var t,n,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,h=s.nextPosition.values,d=s.expandAndWidth.values,p=c(s.st)?s.st.values:void 0,E=c(s.color)?s.color.values:void 0,m=k(u),y=k(u),T=!1,R=l.length/3;for(t=0;t<R;t+=4){var g=t,A=t+2,S=a.fromArray(l,3*g,ze),N=a.fromArray(l,3*A,Ge);if(Math.abs(S.y)<ke)for(S.y=ke*(N.y<0?-1:1),l[3*t+1]=S.y,l[3*(t+1)+1]=S.y,n=3*g;n<3*g+12;n+=3)f[n]=l[3*t],f[n+1]=l[3*t+1],f[n+2]=l[3*t+2];if(Math.abs(N.y)<ke)for(N.y=ke*(S.y<0?-1:1),l[3*(t+2)+1]=N.y,l[3*(t+3)+1]=N.y,n=3*g;n<3*g+12;n+=3)h[n]=l[3*(t+2)],h[n+1]=l[3*(t+2)+1],h[n+2]=l[3*(t+2)+2];var x=m.attributes,w=m.indices,I=y.attributes,O=y.indices,M=_.lineSegmentPlane(S,N,Le,We);if(c(M)){T=!0;var P=a.multiplyByScalar(a.UNIT_Y,Ye,Ve);S.y<0&&(a.negate(P,P),x=y.attributes,w=y.indices,I=m.attributes,O=m.indices);var C=a.add(M,P,He);x.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),x.position.values.push(C.x,C.y,C.z),x.position.values.push(C.x,C.y,C.z),x.prevPosition.values.push(f[3*g],f[3*g+1],f[3*g+2]),x.prevPosition.values.push(f[3*g+3],f[3*g+4],f[3*g+5]),x.prevPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),x.nextPosition.values.push(C.x,C.y,C.z),x.nextPosition.values.push(C.x,C.y,C.z),x.nextPosition.values.push(C.x,C.y,C.z),x.nextPosition.values.push(C.x,C.y,C.z),a.negate(P,P),a.add(M,P,C),I.position.values.push(C.x,C.y,C.z),I.position.values.push(C.x,C.y,C.z),I.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.prevPosition.values.push(C.x,C.y,C.z),I.prevPosition.values.push(C.x,C.y,C.z),I.prevPosition.values.push(C.x,C.y,C.z),I.prevPosition.values.push(C.x,C.y,C.z),I.nextPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.nextPosition.values.push(h[3*A],h[3*A+1],h[3*A+2]),I.nextPosition.values.push(h[3*A+3],h[3*A+4],h[3*A+5]);var D=r.fromArray(d,2*g,Fe),L=Math.abs(D.y);x.expandAndWidth.values.push(-1,L,1,L),x.expandAndWidth.values.push(-1,-L,1,-L),I.expandAndWidth.values.push(-1,L,1,L),I.expandAndWidth.values.push(-1,-L,1,-L);var U=a.magnitudeSquared(a.subtract(M,S,qe));if(U/=a.magnitudeSquared(a.subtract(N,S,qe)),c(E)){var b=i.fromArray(E,4*g,Xe),F=i.fromArray(E,4*A,Xe),B=v.lerp(b.x,F.x,U),z=v.lerp(b.y,F.y,U),G=v.lerp(b.z,F.z,U),q=v.lerp(b.w,F.w,U);for(n=4*g;n<4*g+8;++n)x.color.values.push(E[n]);for(x.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),I.color.values.push(B,z,G,q),I.color.values.push(B,z,G,q),n=4*A;n<4*A+8;++n)I.color.values.push(E[n])}if(c(p)){var W=r.fromArray(p,2*g,Fe),V=r.fromArray(p,2*(t+3),Be),H=v.lerp(W.x,V.x,U);for(n=2*g;n<2*g+4;++n)x.st.values.push(p[n]);for(x.st.values.push(H,W.y),x.st.values.push(H,V.y),I.st.values.push(H,W.y),I.st.values.push(H,V.y),n=2*A;n<2*A+4;++n)I.st.values.push(p[n])}o=x.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3),o=I.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3)}else{var X,Y;for(S.y<0?(X=y.attributes,Y=y.indices):(X=m.attributes,Y=m.indices),X.position.values.push(S.x,S.y,S.z),X.position.values.push(S.x,S.y,S.z),X.position.values.push(N.x,N.y,N.z),X.position.values.push(N.x,N.y,N.z),n=3*t;n<3*t+12;++n)X.prevPosition.values.push(f[n]),X.nextPosition.values.push(h[n]);for(n=2*t;n<2*t+8;++n)X.expandAndWidth.values.push(d[n]),c(p)&&X.st.values.push(p[n]);if(c(E))for(n=4*t;n<4*t+16;++n)X.color.values.push(E[n]);o=X.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}T&&($(y),$(m)),Z(e,y,m)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case A.TRIANGLES:e.indices=x(t);break;case A.TRIANGLE_STRIP:e.indices=w(t);break;case A.TRIANGLE_FAN:e.indices=I(t)}e.primitiveType=A.LINES}return e},te.createLineSegmentsForVectors=function(e,t,r){t=s(t,"normal"),r=s(r,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,h=0;h<o;h+=3)l[f++]=a[h],l[f++]=a[h+1],l[f++]=a[h+2],l[f++]=a[h]+i[h]*r,l[f++]=a[h+1]+i[h+1]*r,l[f++]=a[h+2]+i[h+2]*r;var E,m=e.boundingSphere;return c(m)&&(E=new n(m.center,m.radius+r)),new d({attributes:{position:new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:A.LINES,boundingSphere:E})},te.createAttributeLocations=function(e){var t,n=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,a={},i=0,o=n.length;for(t=0;t<o;++t){var u=n[t];c(r[u])&&(a[u]=i++)}for(var s in r)r.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),n=e.indices;if(c(n)){for(var r=new Int32Array(t),a=0;a<t;a++)r[a]=-1;for(var i,o=n,s=o.length,l=m.createTypedArray(t,s),f=0,h=0,p=0;f<s;)i=r[o[f]],i!==-1?l[h]=i:(i=o[f],r[i]=p,l[h]=p,++p),++f,++h;e.indices=l;var E=e.attributes;for(var y in E)if(E.hasOwnProperty(y)&&c(E[y])&&c(E[y].values)){for(var _=E[y],v=_.values,T=0,R=_.componentsPerAttribute,g=u.createTypedArray(_.componentDatatype,p*R);T<t;){var A=r[T];if(A!==-1)for(a=0;a<R;a++)g[R*A+a]=v[R*T+a];++T}_.values=g}}return e},te.reorderForPostVertexCache=function(e,t){var n=e.indices;if(e.primitiveType===A.TRIANGLES&&c(n)){for(var r=n.length,a=0,i=0;i<r;i++)n[i]>a&&(a=n[i]);e.indices=S.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],n=d.computeNumberOfVertices(e);if(c(e.indices)&&n>=v.SIXTY_FOUR_KILOBYTES){var r,a=[],i=[],o=0,u=O(e.attributes),s=e.indices,l=s.length;e.primitiveType===A.TRIANGLES?r=3:e.primitiveType===A.LINES?r=2:e.primitiveType===A.POINTS&&(r=1);for(var f=0;f<l;f+=r){for(var h=0;h<r;++h){var p=s[f+h],E=a[p];c(E)||(E=o++,a[p]=E,M(u,e.attributes,p)),i.push(E)}o+r>=v.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=O(e.attributes))}0!==i.length&&t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ne=new a,re=new o;te.projectTo2D=function(e,t,n,r,i){var o=e.attributes[t];i=c(i)?i:new h;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),d=0,E=0;E<l.length;E+=3){var m=a.fromArray(l,E,ne),y=s.cartesianToCartographic(m,re),_=i.project(y,ne);f[d++]=_.x,f[d++]=_.y,f[d++]=_.z}return e.attributes[n]=o,e.attributes[r]=new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,n,r){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var h=a.componentsPerAttribute;return e.attributes[n]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[r]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};var ie=new a,oe=new R,ue=new T;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(R.equals(t,R.IDENTITY))return e;var r=e.geometry.attributes;P(t,r.position),P(t,r.prevPosition),P(t,r.nextPosition),(c(r.normal)||c(r.tangent)||c(r.bitangent))&&(R.inverse(t,oe),R.transpose(oe,oe),R.getRotation(oe,ue),C(ue,r.normal),C(ue,r.tangent),C(ue,r.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=n.transform(a,t,a)),e.modelMatrix=R.clone(R.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],n=[],r=e.length,a=0;a<r;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&n.push(i)}var o=[];return t.length>0&&o.push(L(t,"geometry")),n.length>0&&(o.push(L(n,"westHemisphereGeometry")),o.push(L(n,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,fe=new a,he=new a;te.computeNormal=function(e){for(var t=e.indices,n=e.attributes,r=n.position.values,i=n.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;f<o;f+=3){var d=t[f],E=t[f+1],m=t[f+2],y=3*d,_=3*E,T=3*m;le.x=r[y],le.y=r[y+1],le.z=r[y+2],fe.x=r[_],fe.y=r[_+1],fe.z=r[_+2],he.x=r[T],he.y=r[T+1],he.z=r[T+2],s[d].count++,s[E].count++,s[m].count++,a.subtract(fe,le,fe),a.subtract(he,le,he),c[h]=a.cross(fe,he,new a),h++}var R=0;for(f=0;f<i;f++)s[f].indexOffset+=R,R+=s[f].count;h=0;var g;for(f=0;f<o;f+=3){g=s[t[f]];var A=g.indexOffset+g.currentCount;l[A]=h,g.currentCount++,g=s[t[f+1]],A=g.indexOffset+g.currentCount,l[A]=h,g.currentCount++,g=s[t[f+2]],A=g.indexOffset+g.currentCount,l[A]=h,g.currentCount++,h++}var S=new Float32Array(3*i);for(f=0;f<i;f++){var N=3*f;if(g=s[f],a.clone(a.ZERO,ce),g.count>0){for(h=0;h<g.count;h++)a.add(ce,c[l[g.indexOffset+h]],ce);a.equalsEpsilon(a.ZERO,ce,v.EPSILON10)&&a.clone(c[l[g.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,v.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),S[N]=ce.x,S[N+1]=ce.y,S[N+2]=ce.z}return e.attributes.normal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:S}),e};var de=new a,pe=new a,Ee=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),n=e.attributes.position.values,r=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,h,d;for(l=0;l<s;l+=3){var E=t[l],m=t[l+1],y=t[l+2];f=3*E,h=3*m,d=3*y;var _=2*E,v=2*m,T=2*y,R=n[f],g=n[f+1],A=n[f+2],S=i[_],N=i[_+1],x=i[v+1]-N,w=i[T+1]-N,I=1/((i[v]-S)*w-(i[T]-S)*x),O=(w*(n[h]-R)-x*(n[d]-R))*I,M=(w*(n[h+1]-g)-x*(n[d+1]-g))*I,P=(w*(n[h+2]-A)-x*(n[d+2]-A))*I;c[f]+=O,c[f+1]+=M,c[f+2]+=P,c[h]+=O,c[h+1]+=M,c[h+2]+=P,c[d]+=O,c[d+1]+=M,c[d+2]+=P}var C=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,h=f+1,d=f+2;var L=a.fromArray(r,f,de),U=a.fromArray(c,f,Ee),b=a.dot(L,U);a.multiplyByScalar(L,b,pe),a.normalize(a.subtract(U,pe,U),U),C[f]=U.x,C[h]=U.y,C[d]=U.z,a.normalize(a.cross(L,U,U),U),D[f]=U.x,D[h]=U.y,D[d]=U.z}return e.attributes.tangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:C}),e.attributes.bitangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e};var me=new r,ye=new a,_e=new a,ve=new a,Te=new r;te.compressVertices=function(t){var n,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),f=0;for(n=0;n<i;++n)a.fromArray(s,3*n,ye),a.equals(ye,a.ZERO)?f+=2:(Te=e.octEncodeInRange(ye,65535,Te),l[f++]=Te.x,l[f++]=Te.y);return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,d=t.attributes.st,E=c(h),m=c(d);if(!E&&!m)return t;var y,_,v,T,R=t.attributes.tangent,g=t.attributes.bitangent,A=c(R),S=c(g);E&&(y=h.values),m&&(_=d.values),A&&(v=R.values),S&&(T=g.values);var N=E?y.length:_.length,x=E?3:2;i=N/x;var w=i,I=m&&E?2:1;I+=A||S?1:0,w*=I;var O=new Float32Array(w),M=0;for(n=0;n<i;++n){m&&(r.fromArray(_,2*n,me),O[M++]=e.compressTextureCoordinates(me));var P=3*n;E&&c(v)&&c(T)?(a.fromArray(y,P,ye),a.fromArray(v,P,_e),a.fromArray(T,P,ve),e.octPack(ye,_e,ve,me),O[M++]=me.x,O[M++]=me.y):(E&&(a.fromArray(y,P,ye),O[M++]=e.octEncodeFloat(ye)),A&&(a.fromArray(v,P,ye),O[M++]=e.octEncodeFloat(ye)),S&&(a.fromArray(T,P,ye),O[M++]=e.octEncodeFloat(ye)))}return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:I,values:O}),E&&delete t.attributes.normal,m&&delete t.attributes.st,S&&delete t.attributes.bitangent,A&&delete t.attributes.tangent,t};var Re=new a,ge=new a,Ae=new a,Se=new a,Ne=new a,xe={positions:new Array(7),indices:new Array(9)},we=new a,Ie=new a,Oe=new a,Me=new a,Pe=new r,Ce=new r,De=new r,Le=g.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,be=new a,Fe=new r,Be=new r,ze=new a,Ge=new a,qe=new a,We=new a,Ve=new a,He=new a,Xe=new i,Ye=5*v.EPSILON9,ke=v.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(c(r)){var a=r.center.x-r.radius;if(a>0||n.intersectPlane(r,g.ORIGIN_ZX_PLANE)!==y.INTERSECTING)return e}if(t.geometryType!==E.NONE)switch(t.geometryType){case E.POLYLINES:ee(e);break;case E.TRIANGLES:J(e);break;case E.LINES:Q(e)}else q(t),t.primitiveType===A.TRIANGLES?J(e):t.primitiveType===A.LINES&&Q(e);return e},te}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,p,E,m;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var y=a;y<o;y+=a)p=e[y],E=e[y+1],p<l&&(l=p),E<f&&(f=E),p>h&&(h=p),E>d&&(d=E);m=Math.max(h-l,d-f)}return r(u,c,a,l,f,m),c}function t(e,t,n,r,a){var i,o;if(a===I(e,t,n,r)>0)for(i=t;i<n;i+=r)o=N(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=N(i,e[i],e[i+1],o);return o&&v(o,o.next)&&(x(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!v(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(x(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var p,E,m=e;e.prev!==e.next;)if(p=e.prev,E=e.next,f?i(e,c,l,f):a(e))t.push(p.i/s),t.push(e.i/s),t.push(E.i/s),x(e),e=E.next,m=E.next;else if(e=E,e===m){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(m(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&_(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(_(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=p(u,s,t,n,r),h=p(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!v(a,i)&&T(a,r,r.next,i)&&g(a,i)&&g(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),x(r),x(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&y(s,c)){var l=S(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(E(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=S(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&m(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&g(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=p(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function p(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function E(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function m(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function y(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&g(e,t)&&g(t,e)&&A(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function T(e,t,n,r){return!!(v(e,t)&&v(n,r)||v(e,r)&&v(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function R(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&T(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function g(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function A(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function S(e,t){var n=new w(e.i,e.x,e.y),r=new w(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function N(e,t,n,r){var a=new w(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function x(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 w(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(I(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(I(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,p=r[u+2]*n;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,p=new n,E={};E.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},E.computeWindingOrder2D=function(e){var t=E.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},E.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var m=new n,y=new n,_=new n,v=new n,T=new n,R=new n,g=new n;return E.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),p=t.length,E=new Array(3*p),A=0;for(h=0;h<p;h++){var S=t[h];E[A++]=S.x,E[A++]=S.y,E[A++]=S.z}for(var N=[],x={},w=e.maximumRadius,I=l.chordLength(u,w),O=I*I;d.length>0;){var M,P,C=d.pop(),D=d.pop(),L=d.pop(),U=n.fromArray(E,3*L,m),b=n.fromArray(E,3*D,y),F=n.fromArray(E,3*C,_),B=n.multiplyByScalar(n.normalize(U,v),w,v),z=n.multiplyByScalar(n.normalize(b,T),w,T),G=n.multiplyByScalar(n.normalize(F,R),w,R),q=n.magnitudeSquared(n.subtract(B,z,g)),W=n.magnitudeSquared(n.subtract(z,G,g)),V=n.magnitudeSquared(n.subtract(G,B,g)),H=Math.max(q,W,V);H>O?q===H?(M=Math.min(L,D)+" "+Math.max(L,D),h=x[M],i(h)||(P=n.add(U,b,g),n.multiplyByScalar(P,.5,P),E.push(P.x,P.y,P.z),h=E.length/3-1,x[M]=h),d.push(L,h,C),d.push(h,D,C)):W===H?(M=Math.min(D,C)+" "+Math.max(D,C),h=x[M],i(h)||(P=n.add(b,F,g),n.multiplyByScalar(P,.5,P),E.push(P.x,P.y,P.z),h=E.length/3-1,x[M]=h),d.push(D,h,L),d.push(h,C,L)):V===H&&(M=Math.min(C,L)+" "+Math.max(C,L),h=x[M],i(h)||(P=n.add(F,U,g),n.multiplyByScalar(P,.5,P),E.push(P.x,P.y,P.z),h=E.length/3-1,x[M]=h),d.push(C,h,D),d.push(h,L,D)):(N.push(L),N.push(D),N.push(C))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:E})},indices:N,primitiveType:f.TRIANGLES})},E.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=p;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},E}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E){"use strict";function m(e,n,r,a){return t.subtract(n,e,_),t.multiplyByScalar(_,r/a,_),t.add(e,_,_),[_.x,_.y,_.z]}var y={};y.computeHierarchyPackedLength=function(e){for(var n=0,r=[e];r.length>0;){var i=r.pop();if(a(i)){n+=2;var o=i.positions,u=i.holes;if(a(o)&&(n+=o.length*t.packedLength),a(u))for(var s=u.length,c=0;c<s;++c)r.push(u[c])}}return n},y.packPolygonHierarchy=function(e,n,r){for(var i=[e];i.length>0;){var o=i.pop();if(a(o)){var u=o.positions,s=o.holes;if(n[r++]=a(u)?u.length:0,n[r++]=a(s)?s.length:0,a(u))for(var c=u.length,l=0;l<c;++l,r+=3)t.pack(u[l],n,r);if(a(s))for(var f=s.length,h=0;h<f;++h)i.push(s[h])}}return r},y.unpackPolygonHierarchy=function(e,n){for(var r=e[n++],a=e[n++],i=new Array(r),o=a>0?new Array(a):void 0,u=0;u<r;++u,n+=t.packedLength)i[u]=t.unpack(e,n);for(var s=0;s<a;++s)o[s]=y.unpackPolygonHierarchy(e,n),n=o[s].startingIndex,delete o[s].startingIndex;return{positions:i,holes:o,startingIndex:n}};var _=new t;y.subdivideLineCount=function(e,n,r){var a=t.distance(e,n),i=a/r,o=Math.max(0,Math.ceil(Math.log(i)/Math.log(2)));return Math.pow(2,o)},y.subdivideLine=function(e,n,r,i){var o=y.subdivideLineCount(e,n,r),u=t.distance(e,n),s=u/o;a(i)||(i=[]);var c=i;c.length=3*o;for(var l=0,f=0;f<o;f++){var h=m(e,n,f*s,u);c[l++]=h[0],c[l++]=h[1],c[l++]=h[2]}return c};var v=new t,T=new t,R=new t,g=new t;y.scaleToGeodeticHeightExtruded=function(e,n,o,u,s){u=r(u,i.WGS84);var c=v,l=T,f=R,h=g;if(a(e)&&a(e.attributes)&&a(e.attributes.position))for(var d=e.attributes.position.values,p=d.length/2,E=0;E<p;E+=3)t.fromArray(d,E,f),u.geodeticSurfaceNormal(f,c),h=u.scaleToGeodeticSurface(f,h),l=t.multiplyByScalar(c,o,l),l=t.add(h,l,l),d[E+p]=l.x,d[E+1+p]=l.y,d[E+2+p]=l.z,s&&(h=t.clone(f,h)),l=t.multiplyByScalar(c,n,l),l=t.add(h,l,l),d[E]=l.x,d[E+1]=l.y,d[E+2]=l.z;return e},y.polygonsFromHierarchy=function(n,r,i,o){var u=[],s=[],c=new p;for(c.enqueue(n);0!==c.length;){var l=c.dequeue(),f=l.positions,d=l.holes;if(f=e(f,t.equalsEpsilon,!0),!(f.length<3)){var m=i.projectPointsOntoPlane(f),y=[],_=h.computeWindingOrder2D(m);_===E.CLOCKWISE&&(m.reverse(),f=f.slice().reverse());var v,T,R=f.slice(),g=a(d)?d.length:0,A=[];for(v=0;v<g;v++){var S=d[v],N=e(S.positions,t.equalsEpsilon,!0);if(!(N.length<3)){var x=i.projectPointsOntoPlane(N);_=h.computeWindingOrder2D(x),_===E.CLOCKWISE&&(x.reverse(),N=N.slice().reverse()),A.push(N),y.push(R.length),R=R.concat(N),m=m.concat(x);var w=0;for(a(S.holes)&&(w=S.holes.length),T=0;T<w;T++)c.enqueue(S.holes[T])}}if(!r){for(v=0;v<f.length;v++)o.scaleToGeodeticSurface(f[v],f[v]);for(v=0;v<A.length;v++){var I=A[v];for(T=0;T<I.length;++T)o.scaleToGeodeticSurface(I[T],I[T])}}u.push({outerRing:f,holes:A}),s.push({positions:R,positions2D:m,holes:y})}}return{hierarchy:u,polygons:s}},y.createGeometryFromPositions=function(e,t,r,a,i){var s=h.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);var l=t.positions;if(a){for(var f=l.length,p=new Array(3*f),E=0,m=0;m<f;m++){var y=l[m];p[E++]=y.x,p[E++]=y.y,p[E++]=y.z}var _=new o({attributes:{position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:p})},indices:s,primitiveType:d.TRIANGLES});return i.normal?c.computeNormal(_):_}return h.computeSubdivision(e,l,s,r)};var A=[],S=new t,N=new t;return y.computeWallGeometry=function(e,r,a,i){var c,h,p,E,m,_=e.length,v=0;if(i)for(h=3*_*2,c=new Array(2*h),p=0;p<_;p++)E=e[p],m=e[(p+1)%_],c[v]=c[v+h]=E.x,++v,c[v]=c[v+h]=E.y,++v,c[v]=c[v+h]=E.z,++v,c[v]=c[v+h]=m.x,++v,c[v]=c[v+h]=m.y,++v,c[v]=c[v+h]=m.z,++v;else{var T=f.chordLength(a,r.maximumRadius),R=0;for(p=0;p<_;p++)R+=y.subdivideLineCount(e[p],e[(p+1)%_],T);for(h=3*(R+_),c=new Array(2*h),p=0;p<_;p++){E=e[p],m=e[(p+1)%_];for(var g=y.subdivideLine(E,m,T,A),x=g.length,w=0;w<x;++w, -++v)c[v]=g[w],c[v+h]=g[w];c[v]=m.x,c[v+h]=m.x,++v,c[v]=m.y,c[v+h]=m.y,++v,c[v]=m.z,c[v+h]=m.z,++v}}_=c.length;var I=l.createTypedArray(_/3,_-6*e.length),O=0;for(_/=6,p=0;p<_;p++){var M=p,P=M+1,C=M+_,D=C+1;E=t.fromArray(c,3*M,S),m=t.fromArray(c,3*P,N),t.equalsEpsilon(E,m,f.EPSILON14)||(I[O++]=M,I[O++]=C,I[O++]=P,I[O++]=P,I[O++]=C,I[O++]=D)}return new o({attributes:new s({position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:c})}),indices:I,primitiveType:d.TRIANGLES})},y}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./Rectangle","./VertexFormat","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,m,y,_,v,T,R,g,A,S,N){"use strict";function x(e,t,n,a){for(var i=g.fromAxisAngle(e._plane.normal,n,D),o=v.fromQuaternion(i,L),u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=t.length,d=0;d<h;++d){var p=r.clone(t[d],C);v.multiplyByVector(o,p,p);var E=e.projectPointOntoPlane(p,P);s(E)&&(u=Math.min(u,E.x),c=Math.max(c,E.x),l=Math.min(l,E.y),f=Math.max(f,E.y))}return a.x=u,a.y=l,a.width=c-u,a.height=f-l,a}function w(e,t,n,r){var a=r.cartesianToCartographic(e,U),i=a.height,o=r.cartesianToCartographic(t,b);o.height=i,r.cartographicToCartesian(o,t);var u=r.cartesianToCartographic(n,b);u.height=i-100,r.cartographicToCartesian(u,n)}function I(e){var t=e.vertexFormat,a=e.geometry,i=e.shadowVolume;if(t.st||t.normal||t.tangent||t.bitangent||i){var u=e.boundingRectangle,s=e.tangentPlane,c=e.ellipsoid,l=e.stRotation,f=e.wall,h=e.top||f,d=e.bottom||f,E=e.perPositionHeight,m=k;m.x=u.x,m.y=u.y;var y,T=a.attributes.position.values,R=T.length,A=t.st?new Float32Array(2*(R/3)):void 0;t.normal&&(y=E&&h&&!f?a.attributes.normal.values:new Float32Array(R));var S=t.tangent?new Float32Array(R):void 0,N=t.bitangent?new Float32Array(R):void 0,x=i?new Float32Array(R):void 0,I=0,O=0,M=z,P=G,C=q,D=!0,L=g.fromAxisAngle(s._plane.normal,l,K),U=v.fromQuaternion(L,J),b=0,F=0;h&&d&&(b=R/2,F=R/3,R/=2);for(var Q=0;Q<R;Q+=3){var $=r.fromArray(T,Q,j);if(t.st){var ee=v.multiplyByVector(U,$,B);ee=c.scaleToGeodeticSurface(ee,ee);var te=s.projectPointOntoPlane(ee,Z);n.subtract(te,m,te);var ne=_.clamp(te.x/u.width,0,1),re=_.clamp(te.y/u.height,0,1);d&&(A[I+F]=ne,A[I+1+F]=re),h&&(A[I]=ne,A[I+1]=re),I+=2}if(t.normal||t.tangent||t.bitangent||i){var ae=O+1,ie=O+2;if(f){if(Q+3<R){var oe=r.fromArray(T,Q+3,W);if(D){var ue=r.fromArray(T,Q+R,V);E&&w($,oe,ue,c),r.subtract(oe,$,oe),r.subtract(ue,$,ue),M=r.normalize(r.cross(ue,oe,M),M),D=!1}r.equalsEpsilon(oe,$,_.EPSILON10)&&(D=!0)}(t.tangent||t.bitangent)&&(C=c.geodeticSurfaceNormal($,C),t.tangent&&(P=r.normalize(r.cross(C,M,P),P)))}else M=c.geodeticSurfaceNormal($,M),(t.tangent||t.bitangent)&&(E&&(H=r.fromArray(y,O,H),X=r.cross(r.UNIT_Z,H,X),X=r.normalize(v.multiplyByVector(U,X,X),X),t.bitangent&&(Y=r.normalize(r.cross(H,X,Y),Y))),P=r.cross(r.UNIT_Z,M,P),P=r.normalize(v.multiplyByVector(U,P,P),P),t.bitangent&&(C=r.normalize(r.cross(M,P,C),C)));t.normal&&(e.wall?(y[O+b]=M.x,y[ae+b]=M.y,y[ie+b]=M.z):d&&(y[O+b]=-M.x,y[ae+b]=-M.y,y[ie+b]=-M.z),(h&&!E||f)&&(y[O]=M.x,y[ae]=M.y,y[ie]=M.z)),i&&(f&&(M=c.geodeticSurfaceNormal($,M)),x[O+b]=-M.x,x[ae+b]=-M.y,x[ie+b]=-M.z),t.tangent&&(e.wall?(S[O+b]=P.x,S[ae+b]=P.y,S[ie+b]=P.z):d&&(S[O+b]=-P.x,S[ae+b]=-P.y,S[ie+b]=-P.z),h&&(E?(S[O]=X.x,S[ae]=X.y,S[ie]=X.z):(S[O]=P.x,S[ae]=P.y,S[ie]=P.z))),t.bitangent&&(d&&(N[O+b]=C.x,N[ae+b]=C.y,N[ie+b]=C.z),h&&(E?(N[O]=Y.x,N[ae]=Y.y,N[ie]=Y.z):(N[O]=C.x,N[ae]=C.y,N[ie]=C.z))),O+=3}}t.st&&(a.attributes.st=new p({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:A})),t.normal&&(a.attributes.normal=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:y})),t.tangent&&(a.attributes.tangent=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:S})),t.bitangent&&(a.attributes.bitangent=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:N})),i&&(a.attributes.extrudeDirection=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:x}))}return a}function O(e,t,n,r,a,i,o,u){var s,c={walls:[]};if(i||o){var l,f,d=T.createGeometryFromPositions(e,t,n,a,u),p=d.attributes.position.values,m=d.indices;if(i&&o){var _=p.concat(p);l=_.length/3,f=y.createTypedArray(l,2*m.length),f.set(m);var v=m.length,g=l/2;for(s=0;s<v;s+=3){var A=f[s]+g,S=f[s+1]+g,x=f[s+2]+g;f[s+v]=x,f[s+1+v]=S,f[s+2+v]=A}if(d.attributes.position.values=_,a){var w=d.attributes.normal.values;d.attributes.normal.values=new Float32Array(_.length),d.attributes.normal.values.set(w)}d.indices=f}else if(o){for(l=p.length/3,f=y.createTypedArray(l,m.length),s=0;s<m.length;s+=3)f[s]=m[s+2],f[s+1]=m[s+1],f[s+2]=m[s];d.indices=f}c.topAndBottom=new E({geometry:d})}var I=r.outerRing,O=h.fromPoints(I,e),M=O.projectPointsOntoPlane(I,Q),P=R.computeWindingOrder2D(M);P===N.CLOCKWISE&&(I=I.slice().reverse());var C=T.computeWallGeometry(I,e,n,a);c.walls.push(new E({geometry:C}));var D=r.holes;for(s=0;s<D.length;s++){var L=D[s];O=h.fromPoints(L,e),M=O.projectPointsOntoPlane(L,Q),P=R.computeWindingOrder2D(M),P===N.COUNTER_CLOCKWISE&&(L=L.slice().reverse()),C=T.computeWallGeometry(L,e,n),c.walls.push(new E({geometry:C}))}return c}function M(e){var t=e.polygonHierarchy,n=u(e.vertexFormat,S.DEFAULT),r=u(e.ellipsoid,f.WGS84),a=u(e.granularity,_.RADIANS_PER_DEGREE),i=u(e.stRotation,0),o=u(e.height,0),c=u(e.perPositionHeight,!1),l=e.extrudedHeight,h=s(l);if(!c&&h)if(_.equalsEpsilon(o,l,_.EPSILON10))l=void 0,h=!1;else{var d=l;l=Math.min(d,o),o=Math.max(d,o)}this._vertexFormat=S.clone(n),this._ellipsoid=f.clone(r),this._granularity=a,this._stRotation=i,this._height=o,this._extrudedHeight=u(l,0),this._extrude=h,this._closeTop=u(e.closeTop,!0),this._closeBottom=u(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=c,this._shadowVolume=u(e.shadowVolume,!1),this._workerName="createPolygonGeometry";var p=t.positions;!s(p)||p.length<3?this._rectangle=new A:this._rectangle=A.fromCartesianArray(p,r),this.packedLength=T.computeHierarchyPackedLength(t)+f.packedLength+S.packedLength+A.packedLength+10}var P=new n,C=new r,D=new g,L=new v,U=new a,b=new a,F=new e,B=new r,z=new r,G=new r,q=new r,W=new r,V=new r,H=new r,X=new r,Y=new r,k=new n,Z=new n,j=new r,K=new g,J=new v,Q=[];M.fromPositions=function(e){e=u(e,u.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.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};return new M(t)},M.pack=function(e,t,n){return n=u(n,0),n=T.packPolygonHierarchy(e._polygonHierarchy,t,n),f.pack(e._ellipsoid,t,n),n+=f.packedLength,S.pack(e._vertexFormat,t,n),n+=S.packedLength,A.pack(e._rectangle,t,n),n+=A.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._extrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n]=e.packedLength,t};var $=f.clone(f.UNIT_SPHERE),ee=new S,te=new A,ne={polygonHierarchy:{}};return M.unpack=function(e,t,n){t=u(t,0);var r=T.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var a=f.unpack(e,t,$);t+=f.packedLength;var i=S.unpack(e,t,ee);t+=S.packedLength;var o=A.unpack(e,t,te);t+=A.packedLength;var c=e[t++],l=e[t++],h=e[t++],d=e[t++],p=1===e[t++],E=1===e[t++],m=1===e[t++],y=1===e[t++],_=1===e[t++],v=e[t];return s(n)||(n=new M(ne)),n._polygonHierarchy=r,n._ellipsoid=f.clone(a,n._ellipsoid),n._vertexFormat=S.clone(i,n._vertexFormat),n._height=c,n._extrudedHeight=l,n._granularity=h,n._stRotation=d,n._extrude=p,n._perPositionHeight=E,n._closeTop=m,n._closeBottom=y,n._rectangle=A.clone(o),n._shadowVolume=_,n.packedLength=v,n},M.createGeometry=function(e){var n=e._vertexFormat,r=e._ellipsoid,a=e._granularity,i=e._stRotation,o=e._height,u=e._extrudedHeight,s=e._extrude,c=e._polygonHierarchy,l=e._perPositionHeight,f=e._closeTop,p=e._closeBottom,_=c.positions;if(!(_.length<3)){var v=h.fromPoints(_,r),g=T.polygonsFromHierarchy(c,l,v,r),A=g.hierarchy,S=g.polygons;if(0!==A.length){_=A[0].outerRing;var N,w,M=x(v,_,i,F),P=[],C={perPositionHeight:l,vertexFormat:n,geometry:void 0,tangentPlane:v,boundingRectangle:M,ellipsoid:r,stRotation:i,bottom:!1,top:!0,wall:!1};if(s)for(C.top=f,C.bottom=p,C.shadowVolume=e._shadowVolume,w=0;w<S.length;w++){N=O(r,S[w],a,A[w],l,f,p,n);var D;f&&p?(D=N.topAndBottom,C.geometry=T.scaleToGeodeticHeightExtruded(D.geometry,o,u,r,l)):f?(D=N.topAndBottom,D.geometry.attributes.position.values=R.scaleToGeodeticHeight(D.geometry.attributes.position.values,o,r,!l),C.geometry=D.geometry):p&&(D=N.topAndBottom,D.geometry.attributes.position.values=R.scaleToGeodeticHeight(D.geometry.attributes.position.values,u,r,!0),C.geometry=D.geometry),(f||p)&&(C.wall=!1,D.geometry=I(C),P.push(D));var L=N.walls;C.wall=!0;for(var U=0;U<L.length;U++){var b=L[U];C.geometry=T.scaleToGeodeticHeightExtruded(b.geometry,o,u,r,l),b.geometry=I(C),P.push(b)}}else for(w=0;w<S.length;w++)N=new E({geometry:T.createGeometryFromPositions(r,S[w],a,l,n)}),N.geometry.attributes.position.values=R.scaleToGeodeticHeight(N.geometry.attributes.position.values,o,r,!l),C.geometry=N.geometry,N.geometry=I(C),P.push(N);N=m.combineInstances(P)[0],N.attributes.position.values=new Float64Array(N.attributes.position.values),N.indices=y.createTypedArray(N.attributes.position.values.length/3,N.indices);var B=N.attributes,z=t.fromVertices(B.position.values);return n.position||delete B.position,new d({attributes:B,indices:N.indices,primitiveType:N.primitiveType,boundingSphere:z})}}},M.createShadowVolume=function(e,t,n){var r=e._granularity,a=e._ellipsoid,i=t(r,a),o=n(r,a);return new M({polygonHierarchy:e._polygonHierarchy,ellipsoid:a,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:i,height:o,vertexFormat:S.POSITION_ONLY,shadowVolume:!0})},c(M.prototype,{rectangle:{get:function(){return this._rectangle}}}),M}),define("Workers/createPolygonGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolygonGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:p,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,p=a.y,E=a.z,m=l*l*d*d,y=f*f*p*p,_=h*h*E*E,T=m+y+_,v=Math.sqrt(1/T),R=e.multiplyByScalar(n,v,i);if(T<s)return isFinite(v)?e.clone(R,c):void 0;var g=u.x,A=u.y,S=u.z,N=o;N.x=R.x*g*2,N.y=R.y*A*2,N.z=R.z*S*2;var x,w,I,O,M,P,C,D,L,U,b,F=(1-v)*e.magnitude(n)/(.5*e.magnitude(N)),B=0;do{F-=B,I=1/(1+F*g),O=1/(1+F*A),M=1/(1+F*S),P=I*I,C=O*O,D=M*M,L=P*I,U=C*O,b=D*M,x=m*P+y*C+_*D-1,w=m*L*g+y*U*A+_*b*S;var z=-2*w;B=x/z}while(Math.abs(x)>r.EPSILON12);return t(c)?(c.x=l*I,c.y=f*O,c.z=h*M,c):new e(l*I,f*O,h*M)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,a,i){return a=n(a,0),r(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,n,a){var p=r(n)?n.oneOverRadii:f,E=r(n)?n.oneOverRadiiSquared:h,m=r(n)?n._centerToleranceSquared:d,y=o(t,p,E,m,c);if(r(y)){var _=e.multiplyComponents(y,E,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),v=Math.atan2(_.y,_.x),R=Math.asin(_.z),g=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=v,a.latitude=R,a.height=g,a):new u(v,R,g)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,p=new e,E=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,p);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,E),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,p),o=Math.max(o,p)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=t.cartesianToCartographic(e[h]);a=Math.min(a,p.longitude),i=Math.max(i,p.longitude),l=Math.min(l,p.latitude),f=Math.max(f,p.latitude);var E=p.longitude>=0?p.longitude:p.longitude+u.TWO_PI;o=Math.min(o,E),c=Math.max(c,E)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,p=e.west,E=c;E.height=a,E.longitude=p,E.latitude=f,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.latitude=h,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=p,o[l]=t.cartographicToCartesian(E,o[l]),l++,f<0?E.latitude=f:h>0?E.latitude=h:E.latitude=0;for(var m=1;m<8;++m)E.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,E)&&(o[l]=t.cartographicToCartesian(E,o[l]),l++);return 0===E.latitude&&(E.longitude=p,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=t.cartographicToCartesian(E,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.width=r(n,0),this.height=r(a,0)}s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},s.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new s),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},s.fromPoints=function(e,t){if(a(t)||(t=new s),!a(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var n=e.length,r=e[0].x,i=e[0].y,o=e[0].x,u=e[0].y,c=1;c<n;c++){var l=e[c],f=l.x,h=l.y;r=Math.min(f,r),o=Math.max(f,o),i=Math.min(h,i),u=Math.max(h,u)}return t.x=r,t.y=i,t.width=o-r,t.height=u-i,t};var c=new i,l=new t,f=new t;return s.fromRectangle=function(t,n,i){if(a(i)||(i=new s),!a(t))return i.x=0,i.y=0,i.width=0,i.height=0,i;n=r(n,c);var o=n.project(u.southwest(t,l)),h=n.project(u.northeast(t,f));return e.subtract(h,o,h),i.x=o.x,i.y=o.y,i.width=h.x,i.height=h.y,i},s.clone=function(e,t){if(a(e))return a(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new s(e.x,e.y,e.width,e.height)},s.union=function(e,t,n){a(n)||(n=new s);var r=Math.min(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return n.x=r,n.y=i,n.width=o-r,n.height=u-i,n},s.expand=function(e,t,n){n=s.clone(e,n);var r=t.x-n.x,a=t.y-n.y;return r>n.width?n.width=r:r<0&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:a<0&&(n.height-=a,n.y=t.y),n},s.intersect=function(e,t){var n=e.x,r=e.y,a=t.x,i=t.y;return n>a+t.width||n+e.width<a||r+e.height<i||r>i+t.height?o.OUTSIDE:o.INTERSECTING},s.equals=function(e,t){return e===t||a(e)&&a(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(E[n],p[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(E[i],p[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=p[a],h=E[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,m=e[s.getElementIndex(h,h)],y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(h,f)],T=(m-y)/2/_;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]); +},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,p=n-u-f+d,E=2*(a-h),m=2*(i+l),y=2*(a+h),_=-n+u-f+d,T=2*(c-o),v=2*(i-l),R=2*(c+o),g=-n-u+f+d;return r(t)?(t[0]=p,t[1]=y,t[2]=v,t[3]=E,t[4]=_,t[5]=R,t[6]=m,t[7]=T,t[8]=g,t):new s(p,E,m,y,_,T,v,R,g)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,p=i*a+c*o*u,E=-c*a+i*o*u,m=-o,y=c*n,_=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=m,t[3]=f,t[4]=p,t[5]=y,t[6]=h,t[7]=E,t[8]=_,t):new s(l,f,h,d,p,E,m,y,_)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var p=[1,0,0],E=[2,2,1],m=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),p=n*c(d);o<a&&l(d)>p;)f(d,m),s.transpose(m,y),s.multiply(d,m,d),s.multiply(y,d,d),s.multiply(h,m,h),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,h,d,p,E,m){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(p,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(E,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(m,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,p=t.y*t.z,E=t.y*t.w,m=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-d-m+_,v=2*(c-y),R=2*(f+E),g=2*(c+y),A=-s+d-m+_,S=2*(p-h),N=2*(f-E),x=2*(p+h),w=-s-d+m+_;return r[0]=T*i,r[1]=g*i,r[2]=N*i,r[3]=0,r[4]=v*o,r[5]=A*o,r[6]=x*o,r[7]=0,r[8]=R*u,r[9]=S*u,r[10]=w*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,p=f.x,E=f.y,m=f.z,y=d.x,_=d.y,T=d.z,v=r.x,R=r.y,g=r.z,A=u*-v+s*-R+c*-g,S=y*-v+_*-R+T*-g,N=p*v+E*R+m*g;return a(n)?(n[0]=u,n[1]=y,n[2]=-p,n[3]=0,n[4]=s,n[5]=_,n[6]=-E,n[7]=0,n[8]=c,n[9]=T,n[10]=-m,n[11]=0,n[12]=A,n[13]=S,n[14]=N,n[15]=1,n):new l(u,s,c,A,y,_,T,S,-p,-E,-m,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,p=f,E=i+c,m=o+l,y=t+f,_=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=p,a[11]=0,a[12]=E,a[13]=m,a[14]=y,a[15]=_,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var p=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),n};var E=new e;l.getMaximumScale=function(t){return l.getScale(t,E),e.maximumComponent(E)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],E=e[12],m=e[13],y=e[14],_=e[15],T=t[0],v=t[1],R=t[2],g=t[3],A=t[4],S=t[5],N=t[6],x=t[7],w=t[8],I=t[9],O=t[10],M=t[11],P=t[12],C=t[13],D=t[14],L=t[15],U=r*T+u*v+f*R+E*g,b=a*T+s*v+h*R+m*g,F=i*T+c*v+d*R+y*g,B=o*T+l*v+p*R+_*g,z=r*A+u*S+f*N+E*x,G=a*A+s*S+h*N+m*x,q=i*A+c*S+d*N+y*x,W=o*A+l*S+p*N+_*x,V=r*w+u*I+f*O+E*M,H=a*w+s*I+h*O+m*M,X=i*w+c*I+d*O+y*M,Y=o*w+l*I+p*O+_*M,k=r*P+u*C+f*D+E*L,Z=a*P+s*C+h*D+m*L,j=i*P+c*C+d*D+y*L,K=o*P+l*C+p*D+_*L;return n[0]=U,n[1]=b,n[2]=F,n[3]=B,n[4]=z,n[5]=G,n[6]=q,n[7]=W,n[8]=V,n[9]=H,n[10]=X,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],p=e[14],E=t[0],m=t[1],y=t[2],_=t[4],T=t[5],v=t[6],R=t[8],g=t[9],A=t[10],S=t[12],N=t[13],x=t[14],w=r*E+o*m+c*y,I=a*E+u*m+l*y,O=i*E+s*m+f*y,M=r*_+o*T+c*v,P=a*_+u*T+l*v,C=i*_+s*T+f*v,D=r*R+o*g+c*A,L=a*R+u*g+l*A,U=i*R+s*g+f*A,b=r*S+o*N+c*x+h,F=a*S+u*N+l*x+d,B=i*S+s*N+f*x+p;return n[0]=w,n[1]=I,n[2]=O,n[3]=0,n[4]=M,n[5]=P,n[6]=C,n[7]=0,n[8]=D,n[9]=L,n[10]=U,n[11]=0,n[12]=b,n[13]=F,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],p=t[2],E=t[3],m=t[4],y=t[5],_=t[6],T=t[7],v=t[8],R=r*h+o*d+c*p,g=a*h+u*d+l*p,A=i*h+s*d+f*p,S=r*E+o*m+c*y,N=a*E+u*m+l*y,x=i*E+s*m+f*y,w=r*_+o*T+c*v,I=a*_+u*T+l*v,O=i*_+s*T+f*v;return n[0]=R,n[1]=g,n[2]=A,n[3]=0,n[4]=S,n[5]=N,n[6]=x,n[7]=0,n[8]=w,n[9]=I,n[10]=O,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var m=new e;l.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var y=new s,_=new s,T=new t,v=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,y),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),v))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],p=e[13],E=e[2],m=e[6],R=e[10],g=e[14],A=e[3],S=e[7],N=e[11],x=e[15],w=R*x,I=g*N,O=m*x,M=g*S,P=m*N,C=R*S,D=E*x,L=g*A,U=E*N,b=R*A,F=E*S,B=m*A,z=w*h+M*d+P*p-(I*h+O*d+C*p),G=I*f+D*d+b*p-(w*f+L*d+U*p),q=O*f+L*h+F*p-(M*f+D*h+B*p),W=C*f+U*h+B*d-(P*f+b*h+F*d),V=I*a+O*i+C*o-(w*a+M*i+P*o),H=w*r+L*i+U*o-(I*r+D*i+b*o),X=M*r+D*a+B*o-(O*r+L*a+F*o),Y=P*r+b*a+F*i-(C*r+U*a+B*i);w=i*p,I=o*d,O=a*p,M=o*h,P=a*d,C=i*h,D=r*p,L=o*f,U=r*d,b=i*f,F=r*h,B=a*f;var k=w*S+M*N+P*x-(I*S+O*N+C*x),Z=I*A+D*N+b*x-(w*A+L*N+U*x),j=O*A+L*S+F*x-(M*A+D*S+B*x),K=C*A+U*S+B*N-(P*A+b*S+F*N),J=O*R+C*g+I*m-(P*g+w*m+M*R),Q=U*g+w*E+L*R-(D*R+b*g+I*E),$=D*m+B*g+M*E-(F*g+O*E+L*m),ee=F*R+P*E+b*m-(U*m+B*R+C*E),te=r*z+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=z*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=V*te,n[5]=H*te,n[6]=X*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],p=-n*f-r*h-a*d,E=-i*f-o*h-u*d,m=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=p,t[13]=E,t[14]=m,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,p=new e,E=new e,m=new e,y=new e,_=new e,T=new e,v=new e,R=new e,g=new e,A=new e,S=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,p),u=e.clone(r,E),s=e.clone(r,m),c=e.clone(r,y),l=e.clone(r,_),f=t.length,N=1;N<f;N++){e.clone(t[N],r);var x=r.x,w=r.y,I=r.z;x<i.x&&e.clone(r,i),x>s.x&&e.clone(r,s),w<o.y&&e.clone(r,o),w>c.y&&e.clone(r,c),I<u.z&&e.clone(r,u),I>l.z&&e.clone(r,l)}var O=e.magnitudeSquared(e.subtract(s,i,v)),M=e.magnitudeSquared(e.subtract(c,o,v)),P=e.magnitudeSquared(e.subtract(l,u,v)),C=i,D=s,L=O;M>L&&(L=M,C=o,D=c),P>L&&(L=P,C=u,D=l);var U=R;U.x=.5*(C.x+D.x),U.y=.5*(C.y+D.y),U.z=.5*(C.z+D.z);var b=e.magnitudeSquared(e.subtract(D,U,v)),F=Math.sqrt(b),B=g;B.x=i.x,B.y=o.y,B.z=u.z;var z=A;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,v),.5,S),q=0;for(N=0;N<f;N++){e.clone(t[N],r);var W=e.magnitude(e.subtract(r,G,v));W>q&&(q=W);var V=e.magnitudeSquared(e.subtract(r,U,v));if(V>b){var H=Math.sqrt(V);F=.5*(F+H),b=F*F;var X=H-F;U.x=(F*U.x+X*r.x)/H,U.y=(F*U.y+X*r.y)/H,U.z=(F*U.z+X*r.z)/H}}return F<q?(e.clone(U,n.center),n.radius=F):(e.clone(G,n.center),n.radius=q),n};var N=new o,x=new e,w=new e,I=new t,O=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,N),f.southwest(t,I),I.height=i,f.northeast(t,O),O.height=o;var s=n.project(I,x),c=n.project(O,w),l=c.x-s.x,d=c.y-s.y,p=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+p*p);var E=u.center;return E.x=s.x+.5*l,E.y=s.y+.5*d,E.z=s.z+.5*p,u};var M=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,M)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,p),l=e.clone(u,E),f=e.clone(u,m),N=e.clone(u,y),x=e.clone(u,_),w=t.length,I=0;I<w;I+=i){var O=t[I]+n.x,M=t[I+1]+n.y,P=t[I+2]+n.z;u.x=O,u.y=M,u.z=P,O<s.x&&e.clone(u,s),O>f.x&&e.clone(u,f),M<c.y&&e.clone(u,c),M>N.y&&e.clone(u,N),P<l.z&&e.clone(u,l),P>x.z&&e.clone(u,x)}var C=e.magnitudeSquared(e.subtract(f,s,v)),D=e.magnitudeSquared(e.subtract(N,c,v)),L=e.magnitudeSquared(e.subtract(x,l,v)),U=s,b=f,F=C;D>F&&(F=D,U=c,b=N),L>F&&(F=L,U=l,b=x);var B=R;B.x=.5*(U.x+b.x),B.y=.5*(U.y+b.y),B.z=.5*(U.z+b.z);var z=e.magnitudeSquared(e.subtract(b,B,v)),G=Math.sqrt(z),q=g;q.x=s.x,q.y=c.y,q.z=l.z;var W=A;W.x=f.x,W.y=N.y,W.z=x.z;var V=e.multiplyByScalar(e.add(q,W,v),.5,S),H=0;for(I=0;I<w;I+=i){u.x=t[I]+n.x,u.y=t[I+1]+n.y,u.z=t[I+2]+n.z;var X=e.magnitude(e.subtract(u,V,v));X>H&&(H=X);var Y=e.magnitudeSquared(e.subtract(u,B,v));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(V,o.center),o.radius=H),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,p),s=e.clone(i,E),c=e.clone(i,m),l=e.clone(i,y),f=e.clone(i,_),N=t.length,x=0;x<N;x+=3){var w=t[x]+n[x],I=t[x+1]+n[x+1],O=t[x+2]+n[x+2];i.x=w,i.y=I,i.z=O,w<o.x&&e.clone(i,o),w>c.x&&e.clone(i,c),I<u.y&&e.clone(i,u),I>l.y&&e.clone(i,l),O<s.z&&e.clone(i,s),O>f.z&&e.clone(i,f)}var M=e.magnitudeSquared(e.subtract(c,o,v)),P=e.magnitudeSquared(e.subtract(l,u,v)),C=e.magnitudeSquared(e.subtract(f,s,v)),D=o,L=c,U=M;P>U&&(U=P,D=u,L=l),C>U&&(U=C,D=s,L=f);var b=R;b.x=.5*(D.x+L.x),b.y=.5*(D.y+L.y),b.z=.5*(D.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,v)),B=Math.sqrt(F),z=g;z.x=o.x,z.y=u.y,z.z=s.z;var G=A;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(z,G,v),.5,S),W=0;for(x=0;x<N;x+=3){i.x=t[x]+n[x],i.y=t[x+1]+n[x+1],i.z=t[x+2]+n[x+2];var V=e.magnitude(e.subtract(i,q,v));V>W&&(W=V);var H=e.magnitudeSquared(e.subtract(i,b,v));if(H>F){var X=Math.sqrt(H);B=.5*(B+X),F=B*B;var Y=X-B;b.x=(B*b.x+Y*i.x)/X,b.y=(B*b.y+Y*i.y)/X,b.z=(B*b.z+Y*i.z)/X}}return B<W?(e.clone(b,r.center),r.radius=B):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var P=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,P)+c.radius)}return n.radius=s,n};var C=new e,D=new e,L=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,C),o=c.getColumn(r,1,D),u=c.getColumn(r,2,L);return e.add(i,o,i),e.add(i,u,i),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(i),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var U=new e,b=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var F=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,F));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center), +n.radius=e.radius,n};var z=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,z),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,V=new e,H=new e,X=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,H),d=e.negate(c,V),p=Y,E=p[0];e.add(s,l,E),e.add(E,c,E),E=p[1],e.add(s,l,E),e.add(E,d,E),E=p[2],e.add(s,f,E),e.add(E,d,E),E=p[3],e.add(s,f,E),e.add(E,c,E),e.negate(s,s),E=p[4],e.add(s,l,E),e.add(E,c,E),E=p[5],e.add(s,l,E),e.add(E,d,E),E=p[6],e.add(s,f,E),e.add(E,d,E),E=p[7],e.add(s,f,E),e.add(E,c,E);for(var m=p.length,y=0;y<m;++y){var _=p[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,X);n.project(T,_)}a=h.fromPoints(p,a),o=a.center;var v=o.x,R=o.y,g=o.z;return o.x=g,o.y=v,o.z=R,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(R)&&(R=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(R=!0,g=r(e[1]))}return R}function i(){return a()&&g}function o(){if(!t(A)&&(A=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(v.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function u(){return o()&&S}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(v.userAgent);null!==e&&(N=!0,x=r(e[1]),x.isNightly=!!e[2])}return N}function c(){return s()&&x}function l(){if(!t(w)){w=!1;var e;"Microsoft Internet Explorer"===v.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(w=!0,I=r(e[1]))):"Netscape"===v.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(w=!0,I=r(e[1])))}return w}function f(){return l()&&I}function h(){if(!t(O)){O=!1;var e=/ Edge\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(O=!0,M=r(e[1]))}return O}function d(){return h()&&M}function p(){if(!t(P)){P=!1;var e=/Firefox\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(P=!0,C=r(e[1]))}return P}function E(){return t(D)||(D=/Windows/i.test(v.appVersion)),D}function m(){return p()&&C}function y(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(v.pointerEnabled)||v.pointerEnabled)),L}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;b=t(n)&&""!==n,b&&(U=n)}return b}function T(){return _()?U:void 0}var v;v="undefined"!=typeof navigator?navigator:{};var R,g,A,S,N,x,w,I,O,M,P,C,D,L,U,b,F={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:p,firefoxVersion:m,isWindows:E,hardwareConcurrency:e(v.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return F.supportsFullscreen=function(){return n.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,n,r,a){"use strict";function i(t,a,i){this.minimum=e.clone(n(t,e.ZERO)),this.maximum=e.clone(n(a,e.ZERO)),r(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,n){if(r(n)||(n=new i),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],p=d.x,E=d.y,m=d.z;a=Math.min(p,a),s=Math.max(p,s),o=Math.min(E,o),c=Math.max(E,c),u=Math.min(m,u),l=Math.max(m,l)}var y=n.minimum;y.x=a,y.y=o,y.z=u;var _=n.maximum;_.x=s,_.y=c,_.z=l;var T=e.add(y,_,n.center);return e.multiplyByScalar(T,.5,T),n},i.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new i(t.minimum,t.maximum)},i.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,p=o*s-h,E=o*c-u*s,m=u*c-d,y=4*p*m-E*E;if(y<0){var _,T,v;h*f>=l*d?(_=o,T=p,v=-2*u*p+o*E):(_=c,T=m,v=-c*E+2*s*m);var R=v<0?-1:1,g=-R*Math.abs(_)*Math.sqrt(-y);i=-v+g;var A=i/2,S=A<0?-Math.pow(-A,1/3):Math.pow(A,1/3),N=i===g?-S:-T/S;return a=T<=0?S+N:-v/(S*S+N*N+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var x=p,w=-2*u*p+o*E,I=m,O=-c*E+2*s*m,M=Math.sqrt(y),P=Math.sqrt(3)/2,C=Math.abs(Math.atan2(o*M,-w)/3);a=2*Math.sqrt(-x);var D=Math.cos(C);i=a*D;var L=a*(-D/2-P*Math.sin(C)),U=i+L>2*u?i-u:L-u,b=o,F=U/b;C=Math.abs(Math.atan2(c*M,-O)/3),a=2*Math.sqrt(-I),D=Math.cos(C),i=a*D,L=a*(-D/2-P*Math.sin(C));var B=-c,z=i+L<2*s?i+s:L+s,G=B/z,q=b*z,W=-U*z-b*B,V=U*B,H=(s*W-u*V)/(-u*W+s*q);return F<=H?F<=G?H<=G?[F,H,G]:[F,G,H]:[G,F,H]:F<=G?[H,F,G]:H<=G?[H,G,F]:[G,H,F]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var p=r.computeRealRoots(1,s,l);if(2===p.length){var E,m=p[0],y=p[1];if(m>=0&&y>=0){var _=Math.sqrt(m),T=Math.sqrt(y);return[h-T,h-_,h+_,h+T]}if(m>=0&&y<0)return E=Math.sqrt(m),[h-E,h+E];if(m<0&&y>=0)return E=Math.sqrt(y),[h-E,h+E]}return[]}if(d>0){var v=Math.sqrt(d),R=(s+d-c/v)/2,g=(s+d+c/v)/2,A=r.computeRealRoots(1,v,R),S=r.computeRealRoots(1,-v,g);return 0!==A.length?(A[0]+=h,A[1]+=h,0!==S.length?(S[0]+=h,S[1]+=h,A[1]<=S[0]?[A[0],A[1],S[0],S[1]]:S[1]<=A[0]?[S[0],S[1],A[0],A[1]]:A[0]>=S[0]&&A[1]<=S[1]?[S[0],A[0],A[1],S[1]]:S[0]>=A[0]&&S[1]<=A[1]?[A[0],S[0],S[1],A[1]]:A[0]>S[0]&&A[0]<S[1]?[S[0],A[0],S[1],A[1]]:[A[0],S[0],A[1],S[1]]):A):0!==S.length?(S[0]+=h,S[1]+=h,S):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var p,E,m=d[0],y=a-m,_=y*y,T=t/2,v=y/2,R=_-4*o,g=_+4*Math.abs(o),A=c-4*m,S=c+4*Math.abs(m);if(m<0||R*S<A*g){var N=Math.sqrt(A);p=N/2,E=0===N?0:(t*v-i)/N}else{var x=Math.sqrt(R);p=0===x?0:(t*v-i)/x,E=x/2}var w,I;0===T&&0===p?(w=0,I=0):n.sign(T)===n.sign(p)?(w=T+p,I=m/w):(I=T-p,w=m/I);var O,M;0===v&&0===E?(O=0,M=0):n.sign(v)===n.sign(E)?(O=v+E,M=o/O):(M=v-E,O=o/M);var P=r.computeRealRoots(1,w,O),C=r.computeRealRoots(1,I,M);if(0!==P.length)return 0!==C.length?P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>C[0]&&P[0]<C[1]?[C[0],P[0],C[1],P[1]]:[P[0],C[0],P[1],C[1]]:P;if(0!==C.length)return C}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,p=d*a,E=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*p+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return E},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,_),h=e.dot(u,u),d=2*e.dot(u,l),p=e.magnitudeSquared(l)-c,E=f(h,d,p,g);if(r(E))return a.start=E.root0,a.stop=E.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function p(t,n,r,a,i){var l,f=a*a,h=i*i,p=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,E=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),m=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,y=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===_&&0===y){if(l=s.computeRealRoots(p,E,m),0===l.length)return T;var v=l[0],R=Math.sqrt(Math.max(1-v*v,0));if(T.push(new e(a,i*v,i*-R)),T.push(new e(a,i*v,i*R)),2===l.length){var g=l[1],A=Math.sqrt(Math.max(1-g*g,0));T.push(new e(a,i*g,i*-A)),T.push(new e(a,i*g,i*A))}return T}var S=_*_,N=y*y,x=p*p,w=_*y,I=x+N,O=2*(E*p+w),M=2*m*p+E*E-N+S,P=2*(m*E-w),C=m*m-S;if(0===I&&0===O&&0===M&&0===P)return T;l=c.computeRealRoots(I,O,M,P,C);var D=l.length;if(0===D)return T;for(var L=0;L<D;++L){var U,b=l[L],F=b*b,B=Math.max(1-F,0),z=Math.sqrt(B);U=o.sign(p)===o.sign(m)?d(p*F+m,E*b,o.EPSILON12):o.sign(m)===o.sign(E*b)?d(p*F,E*b+m,o.EPSILON12):d(p*F+E*b,m,o.EPSILON12);var G=d(y*b,_,o.EPSILON15),q=U*G;q<0?T.push(new e(a,i*b,i*z)):q>0?T.push(new e(a,i*b,i*-z)):0!==z?(T.push(new e(a,i*b,i*-z)),T.push(new e(a,i*b,i*z)),++L):T.push(new e(a,i*b,i*z))}return T}var E={};E.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var m=new e,y=new e,_=new e,T=new e,v=new e;E.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,p=t.direction,E=e.subtract(a,r,m),R=e.subtract(i,r,y),g=e.cross(p,R,_),A=e.dot(E,g);if(u){if(A<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,g),l<0||l>A)return;if(c=e.cross(s,E,v),f=e.dot(p,c),f<0||l+f>A)return;h=e.dot(R,c)/A}else{if(Math.abs(A)<o.EPSILON6)return;var S=1/A;if(s=e.subtract(d,r,T),l=e.dot(s,g)*S,l<0||l>1)return;if(c=e.cross(s,E,v),f=e.dot(p,c)*S,f<0||l+f>1)return;h=e.dot(R,c)*S}return h},E.rayTriangle=function(t,n,a,i,o,u){var s=E.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new l;E.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,a,i,o,u); +if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var g={root0:0,root1:0};E.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var A=new l;E.lineSegmentSphere=function(t,n,a,i){var o=A;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var S=new e,N=new e;E.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,S),f=e.multiplyComponents(c,t.direction,N),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var p=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,p<o)return;if(p>o){u=d*d-o,s=-d+Math.sqrt(u);var E=s/a,m=r/s;return E<m?new i(E,m):{start:m,stop:E}}var y=Math.sqrt(r/a);return new i(y,y)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var x=new e,w=new e,I=new e,O=new e,M=new e,P=new u,C=new u,D=new u,L=new u,U=new u,b=new u,F=new u,B=new e,z=new e,G=new t;E.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,x);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,x),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,O),d=e.normalize(e.cross(h,f,w),w),E=e.normalize(e.cross(f,d,I),I),m=P;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=E.x,m[7]=E.y,m[8]=E.z;var y=u.transpose(m,C),_=u.fromScale(n.radii,D),T=u.fromScale(n.oneOverRadii,L),v=U;v[0]=0,v[1]=-i.z,v[2]=i.y,v[3]=i.z,v[4]=0,v[5]=-i.x,v[6]=-i.y,v[7]=i.x,v[8]=0;var R,g,A=u.multiply(u.multiply(y,T,b),v,b),S=u.multiply(u.multiply(A,_,F),m,F),N=u.multiplyByVector(A,a,M),q=p(S,e.negate(N,x),0,0,1),W=q.length;if(W>0){for(var V=e.clone(e.ZERO,z),H=Number.NEGATIVE_INFINITY,X=0;X<W;++X){R=u.multiplyByVector(_,u.multiplyByVector(m,q[X],B),B);var Y=e.normalize(e.subtract(R,a,O),O),k=e.dot(Y,i);k>H&&(H=k,V=e.clone(R,V))}var Z=n.cartesianToCartographic(V,G);return H=o.clamp(H,0,1),g=e.magnitude(e.subtract(V,a,O))*Math.sqrt(1-H*H),g=c?-g:g,Z.height=g,n.cartographicToCartesian(Z,new e)}};var q=new e;return E.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},E.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return E.lineSegmentPlane(t,n,a,f),E.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(n,r,a,f),E.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(r,t,a,f),E.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(n,t,a,f),E.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(r,n,a,f),E.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,r,a,f),E.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,n,r,a){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var o=new e;return i.fromCartesian4=function(n,r){var a=e.fromCartesian4(n,o),u=n.w;return t(r)?(e.clone(a,r.normal),r.distance=u,r):new i(a,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return p(e)}function a(e){return p(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,p;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return E(f,e),e},p=function(e){return e=t(e),h=e.then,p=t,d=y,E(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return m(2,arguments),e(t,function(t){function u(e){E(e)}function s(e){p(e)}var c,l,f,h,d,p,E,m,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(n,_)),f=[],l=_-c+1,h=[],d=o(),c)for(m=d.progress,E=function(e){h.push(e),--l||(p=E=y,d.reject(h))},p=function(e){f.push(e),--c||(p=E=y,d.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,m);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return m(1,arguments),h(e,_).then(t,n,r)}function f(){return h(arguments,_)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=v.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function p(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function E(e,t){for(var n,r=0;n=e[r++];)n(t)}function m(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function y(){}function _(e){return e}var T,v,R;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=p,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},v=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,p,E,m,y;if("%%"==e)return"%";for(var _=!1,T="",v=!1,R=!1,g=" ",A=s.length,S=0;s&&S<A;S++)switch(s.charAt(S)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":g=s.charAt(S+1);break;case"0":v=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(y),_,c,f,v,g);case"c":return u(String.fromCharCode(+y),_,c,f,v);case"b":return o(y,2,R,_,c,f,v);case"o":return o(y,8,R,_,c,f,v);case"x":return o(y,16,R,_,c,f,v);case"X":return o(y,16,R,_,c,f,v).toUpperCase();case"u":return o(y,10,R,_,c,f,v);case"i":case"d":return d=+y||0,d=Math.round(d-d%1),p=d<0?"-":T,y=p+a(String(Math.abs(d)),f,"0",!1),i(y,p,_,c,v);case"e":case"E":case"f":case"F":case"g":case"G":return d=+y,p=d<0?"-":T,E=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],y=p+Math.abs(d)[E](f),i(y,p,_,c,v)[m]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return E.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=E.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=E.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}E.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=E.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return E.addSeconds(e,-r[0].offset,n);if(a>=r.length)return E.addSeconds(e,-r[a-1].offset,n);var i=E.secondsDifference(r[a].julianDate,e);return 0===i?E.addSeconds(e,-r[a].offset,n):i<=1?void 0:E.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function p(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function E(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var m=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,v=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,g=/^(\d{4})-?(\d{3})$/,A=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,S=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,x=/^(\d{2})(\.\d+)?/.source+N.source,w=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,I=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;E.fromDate=function(e,t){var n=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new E(n[0],n[1],c.UTC)},E.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,m=0,T=0,N=0,O=u[0],M=u[1];if(u=O.match(S),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=O.match(R),null!==u)n=+u[1],s=+u[2];else if(u=O.match(v),null!==u)n=+u[1];else{var P;if(u=O.match(g),null!==u)n=+u[1],P=+u[2],i=o(n);else if(u=O.match(A),null!==u){n=+u[1];var C=+u[2],D=+u[3]||0,L=new Date(Date.UTC(n,0,4));P=7*C+D-L.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(P),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var U;if(r(M)){u=M.match(I),null!==u?(h=+u[1],m=+u[2],T=+u[3],N=1e3*+(u[4]||0),U=5):(u=M.match(w),null!==u?(h=+u[1],m=+u[2],T=60*+(u[3]||0),U=4):(u=M.match(x),null!==u&&(h=+u[1],m=60*+(u[2]||0),U=3)));var b=u[U],F=+u[U+1],B=+(u[U+2]||0);switch(b){case"+":h-=F,m-=B;break;case"-":h+=F,m+=B;break;case"Z":break;default:m+=new Date(Date.UTC(n,s-1,l,h,m)).getTimezoneOffset()}}else m+=new Date(n,s-1,l).getTimezoneOffset();var z=60===T;for(z&&T--;m>=60;)m-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?_:y[s-1];for(;m<0;)m+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?_:y[s-1],l+=a;var G=p(n,s,l,h,m,T,N);return r(t)?(d(G[0],G[1],t),f(t)):t=new E(G[0],G[1],c.UTC),z&&E.addSeconds(t,1,t),t},E.now=function(e){return E.fromDate(new Date,e)};var O=new E(0,0,c.TAI);return E.toGregorianDate=function(e,t){var n=!1,a=h(e,O);r(a)||(E.addSeconds(e,-1,O),a=h(O,O),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,p=c-(2447*d/80|0)|0;c=d/11|0;var m=d+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,v=T/s.SECONDS_PER_MINUTE|0;T-=v*s.SECONDS_PER_MINUTE;var R=0|T,g=(T-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(R+=1),r(t)?(t.year=y,t.month=m,t.day=p,t.hour=_,t.minute=v,t.second=R,t.millisecond=g,t.isLeapSecond=n,t):new i(y,m,p,_,v,R,g,n)},E.toDate=function(e){var t=E.toGregorianDate(e,m),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},E.toIso8601=function(t,n){var a,i=E.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},E.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new E(e.dayNumber,e.secondsOfDay,c.TAI)},E.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},E.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(E.secondsDifference(e,t))<=n},E.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},E.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},E.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},E.computeTaiMinusUtc=function(e){T.julianDate=e;var n=E.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},E.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},E.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},E.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},E.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},E.lessThan=function(e,t){return E.compare(e,t)<0},E.lessThanOrEquals=function(e,t){return E.compare(e,t)<=0},E.greaterThan=function(e,t){return E.compare(e,t)>0},E.greaterThanOrEquals=function(e,t){return E.compare(e,t)>=0},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return E.toIso8601(this)},E.leapSeconds=[new u(new E(2441317,43210,c.TAI),10),new u(new E(2441499,43211,c.TAI),11),new u(new E(2441683,43212,c.TAI),12),new u(new E(2442048,43213,c.TAI),13),new u(new E(2442413,43214,c.TAI),14),new u(new E(2442778,43215,c.TAI),15),new u(new E(2443144,43216,c.TAI),16),new u(new E(2443509,43217,c.TAI),17),new u(new E(2443874,43218,c.TAI),18),new u(new E(2444239,43219,c.TAI),19),new u(new E(2444786,43220,c.TAI),20),new u(new E(2445151,43221,c.TAI),21),new u(new E(2445516,43222,c.TAI),22),new u(new E(2446247,43223,c.TAI),23),new u(new E(2447161,43224,c.TAI),24),new u(new E(2447892,43225,c.TAI),25),new u(new E(2448257,43226,c.TAI),26),new u(new E(2448804,43227,c.TAI),27),new u(new E(2449169,43228,c.TAI),28),new u(new E(2449534,43229,c.TAI),29),new u(new E(2450083,43230,c.TAI),30),new u(new E(2450630,43231,c.TAI),31),new u(new E(2451179,43232,c.TAI),32),new u(new E(2453736,43233,c.TAI),33),new u(new E(2454832,43234,c.TAI),34),new u(new E(2456109,43235,c.TAI),35),new u(new E(2457204,43236,c.TAI),36),new u(new E(2457754,43237,c.TAI),37)],E}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var p=new XMLHttpRequest;if(o.contains(e)&&(p.withCredentials=!0),n(h)&&n(p.overrideMimeType)&&p.overrideMimeType(h),p.open(r,e,!0),n(s))for(var E in s)s.hasOwnProperty(E)&&p.setRequestHeader(E,s[E]);n(t)&&(p.responseType=t),p.onload=function(){if(p.status<200||p.status>=300)return void c.reject(new a(p.status,p.response,p.getAllResponseHeaders()));var e=p.response,r=p.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(p.responseXML)&&p.responseXML.hasChildNodes()?c.resolve(p.responseXML):""!==r&&"text"!==r||!n(p.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(p.responseText);else c.resolve(e)},p.onerror=function(e){c.reject(new a)},p.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))p(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){p(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function p(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||p<0||E<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var m=e._samples=n.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=E,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,v=0,R=m.length;v<R;v+=e._columnCount){var g=m[v+a],A=m[v+E],S=g+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(S,A,f.TAI);if(y.push(N),T){if(A!==_&&r(_)){var x=o.leapSeconds,w=t(x,N,d);if(w<0){var I=new u(N,A);x.splice(~w,0,I)}}_=A}}}function E(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function m(e,t,n){return t+e*(n-t)}function y(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return E(e,n,a,s,u),u;if(r.equals(l))return E(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,p=n[h+e._ut1MinusUtcSecondsColumn],y=n[d+e._ut1MinusUtcSecondsColumn],_=y-p;if(_>.5||_<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],v=n[d+e._taiMinusUtcSecondsColumn];T!==v&&(l.equals(r)?p=y:y-=v-T)}return u.xPoleWander=m(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,p,y),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),p=!r(h),E=p||o.greaterThanOrEquals(h,e);if(d&&E)return s=u,!p&&h.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,n),n}var m=t(i,e,o.compare,this._dateColumn);return m>=0?(m<i.length-1&&i[m+1].equals(e)&&++m,s=m,l=m):(l=~m,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){if(i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),"data"===r.scheme)return r.toString();if("data"===a.scheme)return a.toString();n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=p.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=p,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){ +"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],p=f;p<=h;++p)d.push(l(this,p));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var p,E,m=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,v=this._xTable;for(p=0;p<=u;++p)y[p]=m-v[p];for(p=0;p<=u;++p){for(T[p]=1,E=0;E<=u;++E)E!==p&&(T[p]*=y[E]);T[p]*=_[p];var R=3*(s+p);n.x+=T[p]*d[R++],n.y+=T[p]*d[R++],n.s+=T[p]*d[R]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=h,a):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],p=e[c.COLUMN2ROW2],E=s+f+p;if(E>0)n=Math.sqrt(E+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var m=h,y=0;f>s&&(y=1),p>s&&p>f&&(y=2);var _=m[y],T=m[_];n=Math.sqrt(e[c.getElementIndex(y,y)]-e[c.getElementIndex(_,_)]-e[c.getElementIndex(T,T)]+1);var v=d;v[y]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,_)]-e[c.getElementIndex(_,T)])*n,v[_]=(e[c.getElementIndex(_,y)]+e[c.getElementIndex(y,_)])*n,v[T]=(e[c.getElementIndex(T,y)]+e[c.getElementIndex(y,T)])*n,a=-v[0],i=-v[1],o=-v[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var p=new l,E=new l,m=new l,y=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),y=l.fromAxisAngle(e.UNIT_X,o.roll,p),m=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(m,y,m),E=l.fromAxisAngle(e.UNIT_Z,-o.heading,p),l.multiply(E,i,i)};var _=new e,T=new e,v=new l,R=new l,g=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,g),l.conjugate(g,g);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),v),l.multiply(v,g,v),v.w<0&&l.negate(v,v),l.computeAxis(v,_);var u=l.computeAngle(v);r[o]=_.x*u,r[o+1]=_.y*u,r[o+2]=_.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,R),0===u?l.clone(l.IDENTITY,v):l.fromAxisAngle(T,u,v),l.multiply(v,R,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,p=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=p,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var A=new l;l.lerp=function(e,t,n,r){return A=l.multiplyByScalar(t,n,A),r=l.multiplyByScalar(e,1-n,r),l.add(A,r,r)};var S=new l,N=new l,x=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=S=l.negate(t,S)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return N=l.multiplyByScalar(e,Math.sin((1-n)*o),N),x=l.multiplyByScalar(i,Math.sin(n*o),x),r=l.add(N,x,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var w=new e,I=new e,O=new l,M=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,O);l.multiply(i,r,M);var o=l.log(M,w);l.multiply(i,t,M);var u=l.log(M,I);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,O),l.multiply(n,O,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,O),u=l.slerp(n,r,a,M);return l.slerp(o,u,2*a*(1-a),i)};for(var P=new l,C=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],b=i.supportsTypedArrays()?new Float32Array(8):[],F=0;F<7;++F){var B=F+1,z=2*B+1;D[F]=1/(B*z),L[F]=B/z}return D[7]=C/136,L[7]=8*C/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)U[f]=(D[f]*s-L[f])*o,b[f]=(D[f]*c-L[f])*o;var h=a*n*(1+U[0]*(1+U[1]*(1+U[2]*(1+U[3]*(1+U[4]*(1+U[5]*(1+U[6]*(1+U[7])))))))),d=u*(1+b[0]*(1+b[1]*(1+b[2]*(1+b[3]*(1+b[4]*(1+b[5]*(1+b[6]*(1+b[7])))))))),p=l.multiplyByScalar(e,d,P);return l.multiplyByScalar(t,h,r),l.add(p,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,O),u=l.fastSlerp(n,r,a,M);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,m,y,_,T,v){"use strict";var R={},g={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},A={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},S={},N={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},x=new n,w=new n,I=new n;R.localFrameToFixedFrameGenerator=function(e,t){if(!g.hasOwnProperty(e)||!g[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=g[e][t],i=e+t;return u(S[i])?r=S[i]:(r=function(r,i,s){if(u(s)||(s=new _),m.equalsEpsilon(r.x,0,m.EPSILON14)&&m.equalsEpsilon(r.y,0,m.EPSILON14)){var c=m.sign(r.z);n.unpack(A[e],0,x),"east"!==e&&"west"!==e&&n.multiplyByScalar(x,c,x),n.unpack(A[t],0,w),"east"!==t&&"west"!==t&&n.multiplyByScalar(w,c,w),n.unpack(A[a],0,I),"east"!==a&&"west"!==a&&n.multiplyByScalar(I,c,I)}else{i=o(i,h.WGS84),i.geodeticSurfaceNormal(r,N.up);var l=N.up,f=N.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,N.east),n.cross(l,f,N.north),n.multiplyByScalar(N.up,-1,N.down),n.multiplyByScalar(N.east,-1,N.west),n.multiplyByScalar(N.north,-1,N.south),x=N[e],w=N[t],I=N[a]}return s[0]=x.x,s[1]=x.y,s[2]=x.z,s[3]=0,s[4]=w.x,s[5]=w.y,s[6]=w.z,s[7]=0,s[8]=I.x,s[9]=I.y,s[10]=I.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},S[i]=r),r},R.eastNorthUpToFixedFrame=R.localFrameToFixedFrameGenerator("east","north"),R.northEastDownToFixedFrame=R.localFrameToFixedFrameGenerator("north","east"),R.northUpEastToFixedFrame=R.localFrameToFixedFrameGenerator("north","up"),R.northWestUpToFixedFrame=R.localFrameToFixedFrameGenerator("north","west");var O=new T,M=new n(1,1,1),P=new _;R.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof _&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,R.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,O),c=_.fromTranslationQuaternionRotationScale(n.ZERO,u,M,P);return i=a(e,r,i),_.multiply(i,c,i)};var C=new _,D=new y;R.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=R.headingPitchRollToFixedFrame(e,t,n,r,C),o=_.getRotation(i,D);return T.fromRotationMatrix(o,a)};var L=24110.54841,U=8640184.812866,b=.093104,F=-62e-7,B=1.1772758384668e-19,z=72921158553e-15,G=m.TWO_PI/86400,q=new E;R.computeTemeToPseudoFixedMatrix=function(e,t){q=E.addSeconds(e,-E.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/v.DAYS_PER_JULIAN_CENTURY:(i-.5)/v.DAYS_PER_JULIAN_CENTURY;var o=L+n*(U+n*(b+n*F)),s=o*G%m.TWO_PI,c=z+B*(r-2451545.5),l=(a+.5*v.SECONDS_PER_DAY)%v.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(h,d,0,-d,h,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=l.NONE;var W=32.184,V=2451545;R.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=R.iau2006XysData.preload(n,r,a,i),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var n=R.computeFixedToIcrfMatrix(e,t);if(u(n))return y.transpose(n,t)};var H=new p(0,0,0),X=new f(0,0,0,0,0,0),Y=new y,k=new y;R.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var n=R.earthOrientationParameters.compute(e,X);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=R.iau2006XysData.computeXysRadians(r,a,H);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,k),h=y.multiply(l,f,Y),d=e.dayNumber,p=e.secondsOfDay-E.computeTaiMinusUtc(e)+n.ut1MinusUtc,_=d-2451545,T=p/v.SECONDS_PER_DAY,g=.779057273264+T+.00273781191135448*(_+T);g=g%1*m.TWO_PI;var A=y.fromRotationZ(g,k),S=y.multiply(h,A,Y),N=Math.cos(n.xPoleWander),x=Math.cos(n.yPoleWander),w=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),O=r-V+a/v.SECONDS_PER_DAY;O/=36525;var M=-47e-6*O*m.RADIANS_PER_DEGREE/3600,P=Math.cos(M),C=Math.sin(M),D=k;return D[0]=N*P,D[1]=N*C,D[2]=w,D[3]=-x*C+I*w*P,D[4]=x*P+I*w*C,D[5]=-I*N,D[6]=-I*C-x*w*P,D[7]=I*P-x*w*C,D[8]=x*N,y.multiply(S,D,t)}}};var Z=new r;R.pointToWindowCoordinates=function(e,t,n,r){return r=R.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},R.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return _.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,J=new n;R.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,h.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,m.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new n,te=new n,ne=new y,re=new _,ae=new _;return R.basisTo2D=function(e,t,r){var a=_.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);n.fromElements(u.z,u.x,u.y,u);var s=R.eastNorthUpToFixedFrame(a,i,re),c=_.inverseTransformation(s,ae),l=_.getRotation(t,ne),f=_.multiplyByMatrix3(c,l,r);return _.multiply(Q,f,r),_.setTranslation(r,u,r),r},R.wgs84To2DModelMatrix=function(e,t,r){var a=e.ellipsoid,i=R.eastNorthUpToFixedFrame(t,a,re),o=_.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);n.fromElements(s.z,s.x,s.y,s);var c=_.fromTranslation(s,re);return _.multiply(Q,o,r),_.multiply(c,r,r),r},R}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function p(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,E)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,E));var i=n.fromCartesian4(l.getColumn(r,2,E));this._plane=f.fromPointNormal(e,i)}var E=new r;o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var m=new e;p.fromPoints=function(t,n){var r=e.fromPoints(t,m);return new p(r.center,n)};var y=new h,_=new n;p.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,_);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},p.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},p.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=y;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,_);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},p.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=r.clone(e(t.modelMatrix,r.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,n,r,a,i){"use strict";var o={};o.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,a=n.y;n.x=(1-Math.abs(a))*i.signNotZero(r),n.y=(1-Math.abs(r))*i.signNotZero(a)}return n.x=i.toSNorm(n.x,t),n.y=i.toSNorm(n.y,t),n},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,n,r,a){if(a.x=i.fromSNorm(e,r),a.y=i.fromSNorm(n,r),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},o.octDecode=function(e,t,n){return o.octDecodeInRange(e,t,255,n)},o.octPackFloat=function(e){return 256*e.x+e.y};var u=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,u),o.octPackFloat(u)},o.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return o.octDecode(r,a,t)},o.octPack=function(e,t,n,r){var a=o.octEncodeFloat(e),i=o.octEncodeFloat(t),s=o.octEncode(n,u);return r.x=65536*s.x+a,r.y=65536*s.y+i,r},o.octUnpack=function(e,t,n,r){var a=e.x/65536,i=Math.floor(a),u=65536*(a-i);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);o.octDecodeFloat(u,t),o.octDecodeFloat(c,n),o.octDecode(i,s,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},o.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined"],function(e,t,n,r){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var f,h,d,p,E,m,y,_;r(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(n,a,u),p=t.dot(f,f),E=t.dot(f,h),m=t.dot(f,d),y=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,a,i),h=e.subtract(c,a,o),d=e.subtract(n,a,u),p=e.dot(f,f),E=e.dot(f,h),m=e.dot(f,d),y=e.dot(h,h),_=e.dot(h,d));var T=1/(p*y-E*E);return l.y=(y*m-E*_)*T,l.z=(p*_-E*m)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,n){t(n)||(n={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),n.high=r,n.low=e-r):(r=65536*Math.floor(-e/65536),n.high=-r,n.low=e+r),n};var a={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var i=n.high,o=n.low;return r.encode(e.x,a),i.x=a.high,o.x=a.low,r.encode(e.y,a),i.y=a.high,o.y=a.low,r.encode(e.z,a),i.z=a.high,o.z=a.low,n};var i=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,i);var a=i.high,o=i.low;t[n]=a.x,t[n+1]=a.y,t[n+2]=a.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.calculateACMR=function(n){n=e(n,e.EMPTY_OBJECT);var r=n.indices,a=n.maximumIndex,i=e(n.cacheSize,24),o=r.length;if(!t(a)){a=0;for(var u=0,s=r[u];u<o;)s>a&&(a=s),++u,s=r[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,h=0;h<o;++h)f-c[r[h]]>i&&(c[r[h]]=f,++f);return(f-i+1)/(o/3)},r.tipsify=function(n){function r(e,t,n,r){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<r;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,n,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<n.length;){var h=n[f];a[h].numLiveTriangles&&(s=0,i-a[h].timeStamp+2*a[h].numLiveTriangles<=t&&(s=i-a[h].timeStamp),(s>l||l===-1)&&(l=s,c=h)),++f}return c===-1?r(a,o,e,u):c}n=e(n,e.EMPTY_OBJECT);var i,o=n.indices,u=n.maximumIndex,s=e(n.cacheSize,24),c=o.length,l=0,f=0,h=o[f],d=c;if(t(u))l=u+1;else{for(;f<d;)h>l&&(l=h),++f,h=o[f];if(l===-1)return 0;++l}for(var p=[],E=0;E<l;E++)p[E]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var m=0;f<d;)p[o[f]].vertexTriangles.push(m),++p[o[f]].numLiveTriangles,p[o[f+1]].vertexTriangles.push(m),++p[o[f+1]].numLiveTriangles,p[o[f+2]].vertexTriangles.push(m),++p[o[f+2]].numLiveTriangles,++m,f+=3;var y=0,_=s+1;i=1;var T,v,R=[],g=[],A=0,S=[],N=c/3,x=[];for(E=0;E<N;E++)x[E]=!1;for(var w,I;y!==-1;){R=[],v=p[y],I=v.vertexTriangles.length;for(var O=0;O<I;++O)if(m=v.vertexTriangles[O],!x[m]){x[m]=!0,f=m+m+m;for(var M=0;M<3;++M)w=o[f],R.push(w),g.push(w),S[A]=w,++A,T=p[w],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}y=a(o,s,R,p,_,g,l)}return S},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,m,y,_,T,v,R,g,A,S){"use strict";function N(e,t,n,r,a){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=a,e[t++]=a,e[t]=n}function x(e){for(var t=e.length,n=t/3*6,r=m.createTypedArray(t,n),a=0,i=0;i<t;i+=3,a+=6)N(r,a,e[i],e[i+1],e[i+2]);return r}function w(e){var t=e.length;if(t>=3){var n=6*(t-2),r=m.createTypedArray(t,n);N(r,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)N(r,a,e[i-1],e[i],e[i-2]);return r}return new Uint16Array}function I(e){if(e.length>0){for(var t=e.length-1,n=6*(t-1),r=m.createTypedArray(t,n),a=e[0],i=0,o=1;o<t;++o,i+=6)N(r,i,a,e[o],e[o+1]);return r}return new Uint16Array}function O(e){var t={};for(var n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){var r=e[n];t[n]=new p({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function M(e,t,n){for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values))for(var a=t[r],i=0;i<a.componentsPerAttribute;++i)e[r].values.push(a.values[n*a.componentsPerAttribute+i])}function P(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),R.multiplyByPoint(e,ie,ie),a.pack(ie,n,i)}function C(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),v.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,n,i)}function D(e,t){var n,r=e.length,a={},i=e[0][t].attributes;for(n in i)if(i.hasOwnProperty(n)&&c(i[n])&&c(i[n].values)){for(var o=i[n],s=o.values.length,l=!0,f=1;f<r;++f){var h=e[f][t].attributes[n];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(a[n]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function L(e,t){var r,i,o,u,s,l,f,h=e.length,p=(e[0].modelMatrix,c(e[0][t].indices)),E=e[0][t].primitiveType,y=D(e,t);for(r in y)if(y.hasOwnProperty(r))for(s=y[r].values,u=0,i=0;i<h;++i)for(l=e[i][t].attributes[r].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(p){var T=0;for(i=0;i<h;++i)T+=e[i][t].indices.length;var v=d.computeNumberOfVertices(new d({attributes:y,primitiveType:A.POINTS})),R=m.createTypedArray(v,T),g=0,S=0;for(i=0;i<h;++i){var N=e[i][t].indices,x=N.length;for(u=0;u<x;++u)R[g++]=S+N[u];S+=d.computeNumberOfVertices(e[i][t])}_=R}var w,I=new a,O=0;for(i=0;i<h;++i){if(w=e[i][t].boundingSphere,!c(w)){I=void 0;break}a.add(w.center,I,I)}if(c(I))for(a.divideByScalar(I,h,I),i=0;i<h;++i){w=e[i][t].boundingSphere;var M=a.magnitude(a.subtract(w.center,I,se))+w.radius;M>O&&(O=M)}return new d({attributes:y,indices:_,primitiveType:E,boundingSphere:c(I)?new n(I,O):void 0})}function U(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function b(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;for(var r=3,a=3;a<t;++a)n[r++]=a-1,n[r++]=0,n[r++]=a;return e.indices=n,e.primitiveType=A.TRIANGLES,e}function F(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);for(var r=6,a=3;a<t-1;a+=2)n[r++]=a,n[r++]=a-1,n[r++]=a+1,a+2<t&&(n[r++]=a,n[r++]=a+1,n[r++]=a+2);return e.indices=n,e.primitiveType=A.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function z(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return e.indices=n,e.primitiveType=A.LINES,e}function G(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return n[r++]=t-1,n[r]=0,e.indices=n,e.primitiveType=A.LINES,e}function q(e){switch(e.primitiveType){case A.TRIANGLE_FAN:return b(e);case A.TRIANGLE_STRIP:return F(e);case A.TRIANGLES:return U(e);case A.LINE_STRIP:return z(e);case A.LINE_LOOP:return G(e);case A.LINES:return B(e)}return e}function W(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function V(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return W(e,e.y<0),W(t,t.y<0),void W(n,n.y<0);var r,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(n.y);r=a>i?a>o?T.sign(e.y):T.sign(n.y):i>o?T.sign(t.y):T.sign(n.y);var u=r<0;W(e,u),W(t,u),W(n,u)}function H(e,t,n,r){a.add(e,a.multiplyByScalar(a.subtract(t,e,Re),e.y/(e.y-t.y),Re),n),a.clone(n,r),W(n,!0),W(r,!1)}function X(e,t,n){if(!(e.x>=0||t.x>=0||n.x>=0)){V(e,t,n);var r=e.y<0,a=t.y<0,i=n.y<0,o=0;o+=r?1:0,o+=a?1:0,o+=i?1:0;var u=xe.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,r?(H(e,t,ge,Se),H(e,n,Ae,Ne), +u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(H(t,n,ge,Se),H(t,e,Ae,Ne),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(H(n,e,ge,Se),H(n,t,Ae,Ne),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,r?a?i||(H(n,e,ge,Se),H(n,t,Ae,Ne),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,n,ge,Se),H(t,e,Ae,Ne),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,ge,Se),H(e,n,Ae,Ne),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=xe.positions;return s[0]=e,s[1]=t,s[2]=n,s.length=3,1!==o&&2!==o||(s[3]=ge,s[4]=Ae,s[5]=Se,s[6]=Ne,s.length=7),xe}}function Y(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var a in r)if(r.hasOwnProperty(a)&&c(r[a])&&c(r[a].values)){var i=r[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=d.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function k(e){var t=e.attributes,n={};for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values)){var a=t[r];n[r]=new p({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new d({attributes:n,indices:[],primitiveType:e.primitiveType})}function Z(e,t,n){var r=c(e.geometry.boundingSphere);t=Y(t,r),n=Y(n,r),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function j(e,n,i,o,u,s,l,f,h,d,p,E){if(c(s)||c(l)||c(f)||c(h)||c(d)){var m=a.fromArray(u,3*e,we),y=a.fromArray(u,3*n,Ie),_=a.fromArray(u,3*i,Oe),T=t(o,m,y,_,Me);if(c(s)){var v=a.fromArray(s,3*e,we),R=a.fromArray(s,3*n,Ie),g=a.fromArray(s,3*i,Oe);a.multiplyByScalar(v,T.x,v),a.multiplyByScalar(R,T.y,R),a.multiplyByScalar(g,T.z,g);var A=a.add(v,R,v);a.add(A,g,A),a.normalize(A,A),a.pack(A,p.normal.values,3*E)}if(c(d)){var S=a.fromArray(d,3*e,we),N=a.fromArray(d,3*n,Ie),x=a.fromArray(d,3*i,Oe);a.multiplyByScalar(S,T.x,S),a.multiplyByScalar(N,T.y,N),a.multiplyByScalar(x,T.z,x);var w;a.equals(S,a.ZERO)&&a.equals(N,a.ZERO)&&a.equals(x,a.ZERO)?(w=we,w.x=0,w.y=0,w.z=0):(w=a.add(S,N,S),a.add(w,x,w),a.normalize(w,w)),a.pack(w,p.extrudeDirection.values,3*E)}if(c(l)){var I=a.fromArray(l,3*e,we),O=a.fromArray(l,3*n,Ie),M=a.fromArray(l,3*i,Oe);a.multiplyByScalar(I,T.x,I),a.multiplyByScalar(O,T.y,O),a.multiplyByScalar(M,T.z,M);var P=a.add(I,O,I);a.add(P,M,P),a.normalize(P,P),a.pack(P,p.tangent.values,3*E)}if(c(f)){var C=a.fromArray(f,3*e,we),D=a.fromArray(f,3*n,Ie),L=a.fromArray(f,3*i,Oe);a.multiplyByScalar(C,T.x,C),a.multiplyByScalar(D,T.y,D),a.multiplyByScalar(L,T.z,L);var U=a.add(C,D,C);a.add(U,L,U),a.normalize(U,U),a.pack(U,p.bitangent.values,3*E)}if(c(h)){var b=r.fromArray(h,2*e,Pe),F=r.fromArray(h,2*n,Ce),B=r.fromArray(h,2*i,De);r.multiplyByScalar(b,T.x,b),r.multiplyByScalar(F,T.y,F),r.multiplyByScalar(B,T.z,B);var z=r.add(b,F,b);r.add(z,B,z),r.pack(z,p.st.values,2*E)}}}function K(e,t,n,r,a,i){var o=e.position.values.length/3;if(a!==-1){var u=r[a],s=n[u];return s===-1?(n[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,n,r,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,h=c(s.bitangent)?s.bitangent.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,p=c(s.st)?s.st.values:void 0,E=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,m=u.indices,y=k(u),_=k(u),T=[];T.length=l.length/3;var v=[];for(v.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,v[o]=-1;var R=m.length;for(o=0;o<R;o+=3){var g=m[o],A=m[o+1],S=m[o+2],N=a.fromArray(l,3*g),x=a.fromArray(l,3*A),w=a.fromArray(l,3*S),I=X(N,x,w);if(c(I)&&I.positions.length>3)for(var O=I.positions,M=I.indices,P=M.length,C=0;C<P;++C){var D=M[C],L=O[D];L.y<0?(t=_.attributes,n=_.indices,r=T):(t=y.attributes,n=y.indices,r=v),i=K(t,n,r,m,D<3?o+D:-1,L),j(g,A,S,L,l,f,d,h,p,E,t,i)}else c(I)&&(N=I.positions[0],x=I.positions[1],w=I.positions[2]),N.y<0?(t=_.attributes,n=_.indices,r=T):(t=y.attributes,n=y.indices,r=v),i=K(t,n,r,m,o,N),j(g,A,S,N,l,f,d,h,p,E,t,i),i=K(t,n,r,m,o+1,x),j(g,A,S,x,l,f,d,h,p,E,t,i),i=K(t,n,r,m,o+2,w),j(g,A,S,w,l,f,d,h,p,E,t,i)}Z(e,_,y)}function Q(e){var t,n=e.geometry,r=n.attributes,i=r.position.values,o=n.indices,u=k(n),s=k(n),l=o.length,f=[];f.length=i.length/3;var h=[];for(h.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,h[t]=-1;for(t=0;t<l;t+=2){var d=o[t],p=o[t+1],E=a.fromArray(i,3*d,we),m=a.fromArray(i,3*p,Ie);Math.abs(E.y)<T.EPSILON6&&(E.y<0?E.y=-T.EPSILON6:E.y=T.EPSILON6),Math.abs(m.y)<T.EPSILON6&&(m.y<0?m.y=-T.EPSILON6:m.y=T.EPSILON6);var y=u.attributes,v=u.indices,R=h,g=s.attributes,A=s.indices,S=f,N=_.lineSegmentPlane(E,m,Le,Oe);if(c(N)){var x=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Ue);E.y<0&&(a.negate(x,x),y=s.attributes,v=s.indices,R=f,g=u.attributes,A=u.indices,S=h);var w=a.add(N,x,be);K(y,v,R,o,t,E),K(y,v,R,o,-1,w),a.negate(x,x),a.add(N,x,w),K(g,A,S,o,-1,w),K(g,A,S,o,t+1,m)}else{var I,O,M;E.y<0?(I=s.attributes,O=s.indices,M=f):(I=u.attributes,O=u.indices,M=h),K(I,O,M,o,t,E),K(I,O,M,o,t+1,m)}}Z(e,s,u)}function $(e){for(var t=e.attributes,n=t.position.values,r=t.prevPosition.values,i=t.nextPosition.values,o=n.length,u=0;u<o;u+=3){var s=a.unpack(n,u,ze);if(!(s.x>0)){var c=a.unpack(r,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(r[u]=n[u-3],r[u+1]=n[u-2],r[u+2]=n[u-1]):a.pack(s,r,u));var l=a.unpack(i,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=n[u+3],i[u+1]=n[u+4],i[u+2]=n[u+5]):a.pack(s,i,u))}}}function ee(e){var t,n,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,h=s.nextPosition.values,d=s.expandAndWidth.values,p=c(s.st)?s.st.values:void 0,E=c(s.color)?s.color.values:void 0,m=k(u),y=k(u),v=!1,R=l.length/3;for(t=0;t<R;t+=4){var g=t,A=t+2,S=a.fromArray(l,3*g,ze),N=a.fromArray(l,3*A,Ge);if(Math.abs(S.y)<ke)for(S.y=ke*(N.y<0?-1:1),l[3*t+1]=S.y,l[3*(t+1)+1]=S.y,n=3*g;n<3*g+12;n+=3)f[n]=l[3*t],f[n+1]=l[3*t+1],f[n+2]=l[3*t+2];if(Math.abs(N.y)<ke)for(N.y=ke*(S.y<0?-1:1),l[3*(t+2)+1]=N.y,l[3*(t+3)+1]=N.y,n=3*g;n<3*g+12;n+=3)h[n]=l[3*(t+2)],h[n+1]=l[3*(t+2)+1],h[n+2]=l[3*(t+2)+2];var x=m.attributes,w=m.indices,I=y.attributes,O=y.indices,M=_.lineSegmentPlane(S,N,Le,We);if(c(M)){v=!0;var P=a.multiplyByScalar(a.UNIT_Y,Ye,Ve);S.y<0&&(a.negate(P,P),x=y.attributes,w=y.indices,I=m.attributes,O=m.indices);var C=a.add(M,P,He);x.position.values.push(S.x,S.y,S.z,S.x,S.y,S.z),x.position.values.push(C.x,C.y,C.z),x.position.values.push(C.x,C.y,C.z),x.prevPosition.values.push(f[3*g],f[3*g+1],f[3*g+2]),x.prevPosition.values.push(f[3*g+3],f[3*g+4],f[3*g+5]),x.prevPosition.values.push(S.x,S.y,S.z,S.x,S.y,S.z),x.nextPosition.values.push(C.x,C.y,C.z),x.nextPosition.values.push(C.x,C.y,C.z),x.nextPosition.values.push(C.x,C.y,C.z),x.nextPosition.values.push(C.x,C.y,C.z),a.negate(P,P),a.add(M,P,C),I.position.values.push(C.x,C.y,C.z),I.position.values.push(C.x,C.y,C.z),I.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.prevPosition.values.push(C.x,C.y,C.z),I.prevPosition.values.push(C.x,C.y,C.z),I.prevPosition.values.push(C.x,C.y,C.z),I.prevPosition.values.push(C.x,C.y,C.z),I.nextPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.nextPosition.values.push(h[3*A],h[3*A+1],h[3*A+2]),I.nextPosition.values.push(h[3*A+3],h[3*A+4],h[3*A+5]);var D=r.fromArray(d,2*g,Fe),L=Math.abs(D.y);x.expandAndWidth.values.push(-1,L,1,L),x.expandAndWidth.values.push(-1,-L,1,-L),I.expandAndWidth.values.push(-1,L,1,L),I.expandAndWidth.values.push(-1,-L,1,-L);var U=a.magnitudeSquared(a.subtract(M,S,qe));if(U/=a.magnitudeSquared(a.subtract(N,S,qe)),c(E)){var b=i.fromArray(E,4*g,Xe),F=i.fromArray(E,4*A,Xe),B=T.lerp(b.x,F.x,U),z=T.lerp(b.y,F.y,U),G=T.lerp(b.z,F.z,U),q=T.lerp(b.w,F.w,U);for(n=4*g;n<4*g+8;++n)x.color.values.push(E[n]);for(x.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),I.color.values.push(B,z,G,q),I.color.values.push(B,z,G,q),n=4*A;n<4*A+8;++n)I.color.values.push(E[n])}if(c(p)){var W=r.fromArray(p,2*g,Fe),V=r.fromArray(p,2*(t+3),Be),H=T.lerp(W.x,V.x,U);for(n=2*g;n<2*g+4;++n)x.st.values.push(p[n]);for(x.st.values.push(H,W.y),x.st.values.push(H,V.y),I.st.values.push(H,W.y),I.st.values.push(H,V.y),n=2*A;n<2*A+4;++n)I.st.values.push(p[n])}o=x.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3),o=I.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3)}else{var X,Y;for(S.y<0?(X=y.attributes,Y=y.indices):(X=m.attributes,Y=m.indices),X.position.values.push(S.x,S.y,S.z),X.position.values.push(S.x,S.y,S.z),X.position.values.push(N.x,N.y,N.z),X.position.values.push(N.x,N.y,N.z),n=3*t;n<3*t+12;++n)X.prevPosition.values.push(f[n]),X.nextPosition.values.push(h[n]);for(n=2*t;n<2*t+8;++n)X.expandAndWidth.values.push(d[n]),c(p)&&X.st.values.push(p[n]);if(c(E))for(n=4*t;n<4*t+16;++n)X.color.values.push(E[n]);o=X.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}v&&($(y),$(m)),Z(e,y,m)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case A.TRIANGLES:e.indices=x(t);break;case A.TRIANGLE_STRIP:e.indices=w(t);break;case A.TRIANGLE_FAN:e.indices=I(t)}e.primitiveType=A.LINES}return e},te.createLineSegmentsForVectors=function(e,t,r){t=s(t,"normal"),r=s(r,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,h=0;h<o;h+=3)l[f++]=a[h],l[f++]=a[h+1],l[f++]=a[h+2],l[f++]=a[h]+i[h]*r,l[f++]=a[h+1]+i[h+1]*r,l[f++]=a[h+2]+i[h+2]*r;var E,m=e.boundingSphere;return c(m)&&(E=new n(m.center,m.radius+r)),new d({attributes:{position:new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:A.LINES,boundingSphere:E})},te.createAttributeLocations=function(e){var t,n=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,a={},i=0,o=n.length;for(t=0;t<o;++t){var u=n[t];c(r[u])&&(a[u]=i++)}for(var s in r)r.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),n=e.indices;if(c(n)){for(var r=new Int32Array(t),a=0;a<t;a++)r[a]=-1;for(var i,o=n,s=o.length,l=m.createTypedArray(t,s),f=0,h=0,p=0;f<s;)i=r[o[f]],i!==-1?l[h]=i:(i=o[f],r[i]=p,l[h]=p,++p),++f,++h;e.indices=l;var E=e.attributes;for(var y in E)if(E.hasOwnProperty(y)&&c(E[y])&&c(E[y].values)){for(var _=E[y],T=_.values,v=0,R=_.componentsPerAttribute,g=u.createTypedArray(_.componentDatatype,p*R);v<t;){var A=r[v];if(A!==-1)for(a=0;a<R;a++)g[R*A+a]=T[R*v+a];++v}_.values=g}}return e},te.reorderForPostVertexCache=function(e,t){var n=e.indices;if(e.primitiveType===A.TRIANGLES&&c(n)){for(var r=n.length,a=0,i=0;i<r;i++)n[i]>a&&(a=n[i]);e.indices=S.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],n=d.computeNumberOfVertices(e);if(c(e.indices)&&n>=T.SIXTY_FOUR_KILOBYTES){var r,a=[],i=[],o=0,u=O(e.attributes),s=e.indices,l=s.length;e.primitiveType===A.TRIANGLES?r=3:e.primitiveType===A.LINES?r=2:e.primitiveType===A.POINTS&&(r=1);for(var f=0;f<l;f+=r){for(var h=0;h<r;++h){var p=s[f+h],E=a[p];c(E)||(E=o++,a[p]=E,M(u,e.attributes,p)),i.push(E)}o+r>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=O(e.attributes))}0!==i.length&&t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ne=new a,re=new o;te.projectTo2D=function(e,t,n,r,i){var o=e.attributes[t];i=c(i)?i:new h;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),d=0,E=0;E<l.length;E+=3){var m=a.fromArray(l,E,ne),y=s.cartesianToCartographic(m,re),_=i.project(y,ne);f[d++]=_.x,f[d++]=_.y,f[d++]=_.z}return e.attributes[n]=o,e.attributes[r]=new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,n,r){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var h=a.componentsPerAttribute;return e.attributes[n]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[r]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};var ie=new a,oe=new R,ue=new v;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(R.equals(t,R.IDENTITY))return e;var r=e.geometry.attributes;P(t,r.position),P(t,r.prevPosition),P(t,r.nextPosition),(c(r.normal)||c(r.tangent)||c(r.bitangent))&&(R.inverse(t,oe),R.transpose(oe,oe),R.getRotation(oe,ue),C(ue,r.normal),C(ue,r.tangent),C(ue,r.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=n.transform(a,t,a)),e.modelMatrix=R.clone(R.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],n=[],r=e.length,a=0;a<r;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&n.push(i)}var o=[];return t.length>0&&o.push(L(t,"geometry")),n.length>0&&(o.push(L(n,"westHemisphereGeometry")),o.push(L(n,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,fe=new a,he=new a;te.computeNormal=function(e){for(var t=e.indices,n=e.attributes,r=n.position.values,i=n.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;f<o;f+=3){var d=t[f],E=t[f+1],m=t[f+2],y=3*d,_=3*E,v=3*m;le.x=r[y],le.y=r[y+1],le.z=r[y+2],fe.x=r[_],fe.y=r[_+1],fe.z=r[_+2],he.x=r[v],he.y=r[v+1],he.z=r[v+2],s[d].count++,s[E].count++,s[m].count++,a.subtract(fe,le,fe),a.subtract(he,le,he),c[h]=a.cross(fe,he,new a),h++}var R=0;for(f=0;f<i;f++)s[f].indexOffset+=R,R+=s[f].count;h=0;var g;for(f=0;f<o;f+=3){g=s[t[f]];var A=g.indexOffset+g.currentCount;l[A]=h,g.currentCount++,g=s[t[f+1]],A=g.indexOffset+g.currentCount,l[A]=h,g.currentCount++,g=s[t[f+2]],A=g.indexOffset+g.currentCount,l[A]=h,g.currentCount++,h++}var S=new Float32Array(3*i);for(f=0;f<i;f++){var N=3*f;if(g=s[f],a.clone(a.ZERO,ce),g.count>0){for(h=0;h<g.count;h++)a.add(ce,c[l[g.indexOffset+h]],ce);a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&a.clone(c[l[g.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),S[N]=ce.x,S[N+1]=ce.y,S[N+2]=ce.z}return e.attributes.normal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:S}),e};var de=new a,pe=new a,Ee=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),n=e.attributes.position.values,r=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,h,d;for(l=0;l<s;l+=3){var E=t[l],m=t[l+1],y=t[l+2];f=3*E,h=3*m,d=3*y;var _=2*E,T=2*m,v=2*y,R=n[f],g=n[f+1],A=n[f+2],S=i[_],N=i[_+1],x=i[T+1]-N,w=i[v+1]-N,I=1/((i[T]-S)*w-(i[v]-S)*x),O=(w*(n[h]-R)-x*(n[d]-R))*I,M=(w*(n[h+1]-g)-x*(n[d+1]-g))*I,P=(w*(n[h+2]-A)-x*(n[d+2]-A))*I;c[f]+=O,c[f+1]+=M,c[f+2]+=P,c[h]+=O,c[h+1]+=M,c[h+2]+=P,c[d]+=O,c[d+1]+=M,c[d+2]+=P}var C=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,h=f+1,d=f+2;var L=a.fromArray(r,f,de),U=a.fromArray(c,f,Ee),b=a.dot(L,U);a.multiplyByScalar(L,b,pe),a.normalize(a.subtract(U,pe,U),U),C[f]=U.x,C[h]=U.y,C[d]=U.z,a.normalize(a.cross(L,U,U),U),D[f]=U.x,D[h]=U.y,D[d]=U.z}return e.attributes.tangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:C}),e.attributes.bitangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e};var me=new r,ye=new a,_e=new a,Te=new a,ve=new r;te.compressVertices=function(t){var n,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),f=0;for(n=0;n<i;++n)a.fromArray(s,3*n,ye),a.equals(ye,a.ZERO)?f+=2:(ve=e.octEncodeInRange(ye,65535,ve),l[f++]=ve.x,l[f++]=ve.y);return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,d=t.attributes.st,E=c(h),m=c(d);if(!E&&!m)return t;var y,_,T,v,R=t.attributes.tangent,g=t.attributes.bitangent,A=c(R),S=c(g);E&&(y=h.values),m&&(_=d.values),A&&(T=R.values),S&&(v=g.values);var N=E?y.length:_.length,x=E?3:2;i=N/x;var w=i,I=m&&E?2:1;I+=A||S?1:0,w*=I;var O=new Float32Array(w),M=0;for(n=0;n<i;++n){m&&(r.fromArray(_,2*n,me),O[M++]=e.compressTextureCoordinates(me));var P=3*n;E&&c(T)&&c(v)?(a.fromArray(y,P,ye),a.fromArray(T,P,_e),a.fromArray(v,P,Te),e.octPack(ye,_e,Te,me),O[M++]=me.x,O[M++]=me.y):(E&&(a.fromArray(y,P,ye),O[M++]=e.octEncodeFloat(ye)),A&&(a.fromArray(T,P,ye),O[M++]=e.octEncodeFloat(ye)),S&&(a.fromArray(v,P,ye),O[M++]=e.octEncodeFloat(ye)))}return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:I,values:O}),E&&delete t.attributes.normal,m&&delete t.attributes.st,S&&delete t.attributes.bitangent,A&&delete t.attributes.tangent,t};var Re=new a,ge=new a,Ae=new a,Se=new a,Ne=new a,xe={positions:new Array(7),indices:new Array(9)},we=new a,Ie=new a,Oe=new a,Me=new a,Pe=new r,Ce=new r,De=new r,Le=g.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,be=new a,Fe=new r,Be=new r,ze=new a,Ge=new a,qe=new a,We=new a,Ve=new a,He=new a,Xe=new i,Ye=5*T.EPSILON9,ke=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(c(r)){var a=r.center.x-r.radius;if(a>0||n.intersectPlane(r,g.ORIGIN_ZX_PLANE)!==y.INTERSECTING)return e}if(t.geometryType!==E.NONE)switch(t.geometryType){case E.POLYLINES:ee(e);break;case E.TRIANGLES:J(e);break;case E.LINES:Q(e)}else q(t),t.primitiveType===A.TRIANGLES?J(e):t.primitiveType===A.LINES&&Q(e);return e},te}),define("Core/arrayRemoveDuplicates",["./Check","./defaultValue","./defined","./Math"],function(e,t,n,r){"use strict";function a(e,r,a){if(n(e)){a=t(a,!1);var o=e.length;if(o<2)return e;var u,s,c;for(u=1;u<o&&(s=e[u-1],c=e[u],!r(s,c,i));++u);if(u===o)return a&&r(e[0],e[e.length-1],i)?e.slice(1):e;for(var l=e.slice(0,u);u<o;++u)c=e[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,p,E,m;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var y=a;y<o;y+=a)p=e[y],E=e[y+1],p<l&&(l=p),E<f&&(f=E),p>h&&(h=p),E>d&&(d=E);m=Math.max(h-l,d-f)}return r(u,c,a,l,f,m),c}function t(e,t,n,r,a){var i,o;if(a===I(e,t,n,r)>0)for(i=t;i<n;i+=r)o=N(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=N(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(x(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(x(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var p,E,m=e;e.prev!==e.next;)if(p=e.prev,E=e.next,f?i(e,c,l,f):a(e))t.push(p.i/s),t.push(e.i/s),t.push(E.i/s),x(e),e=E.next,m=E.next;else if(e=E,e===m){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(m(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&_(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(_(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=p(u,s,t,n,r),h=p(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&v(a,r,r.next,i)&&g(a,i)&&g(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),x(r),x(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&y(s,c)){var l=S(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(E(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=S(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&m(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&g(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=p(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function p(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function E(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function m(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function y(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&g(e,t)&&g(t,e)&&A(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function v(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function R(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&v(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function g(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function A(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function S(e,t){var n=new w(e.i,e.x,e.y),r=new w(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function N(e,t,n,r){var a=new w(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function x(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 w(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(I(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(I(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,p=r[u+2]*n;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,p=new n,E={};E.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},E.computeWindingOrder2D=function(e){var t=E.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},E.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var m=new n,y=new n,_=new n,T=new n,v=new n,R=new n,g=new n;return E.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),p=t.length,E=new Array(3*p),A=0;for(h=0;h<p;h++){var S=t[h];E[A++]=S.x,E[A++]=S.y,E[A++]=S.z}for(var N=[],x={},w=e.maximumRadius,I=l.chordLength(u,w),O=I*I;d.length>0;){var M,P,C=d.pop(),D=d.pop(),L=d.pop(),U=n.fromArray(E,3*L,m),b=n.fromArray(E,3*D,y),F=n.fromArray(E,3*C,_),B=n.multiplyByScalar(n.normalize(U,T),w,T),z=n.multiplyByScalar(n.normalize(b,v),w,v),G=n.multiplyByScalar(n.normalize(F,R),w,R),q=n.magnitudeSquared(n.subtract(B,z,g)),W=n.magnitudeSquared(n.subtract(z,G,g)),V=n.magnitudeSquared(n.subtract(G,B,g)),H=Math.max(q,W,V);H>O?q===H?(M=Math.min(L,D)+" "+Math.max(L,D),h=x[M],i(h)||(P=n.add(U,b,g),n.multiplyByScalar(P,.5,P),E.push(P.x,P.y,P.z),h=E.length/3-1,x[M]=h),d.push(L,h,C),d.push(h,D,C)):W===H?(M=Math.min(D,C)+" "+Math.max(D,C),h=x[M],i(h)||(P=n.add(b,F,g),n.multiplyByScalar(P,.5,P),E.push(P.x,P.y,P.z),h=E.length/3-1,x[M]=h),d.push(D,h,L),d.push(h,C,L)):V===H&&(M=Math.min(C,L)+" "+Math.max(C,L),h=x[M],i(h)||(P=n.add(F,U,g),n.multiplyByScalar(P,.5,P),E.push(P.x,P.y,P.z),h=E.length/3-1,x[M]=h),d.push(C,h,D),d.push(h,L,D)):(N.push(L),N.push(D),N.push(C))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:E})},indices:N,primitiveType:f.TRIANGLES})},E.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=p;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},E}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E){"use strict";function m(e,n,r,a){return t.subtract(n,e,_),t.multiplyByScalar(_,r/a,_),t.add(e,_,_),[_.x,_.y,_.z]}var y={};y.computeHierarchyPackedLength=function(e){for(var n=0,r=[e];r.length>0;){var i=r.pop();if(a(i)){n+=2;var o=i.positions,u=i.holes;if(a(o)&&(n+=o.length*t.packedLength),a(u))for(var s=u.length,c=0;c<s;++c)r.push(u[c])}}return n},y.packPolygonHierarchy=function(e,n,r){for(var i=[e];i.length>0;){var o=i.pop();if(a(o)){var u=o.positions,s=o.holes;if(n[r++]=a(u)?u.length:0,n[r++]=a(s)?s.length:0,a(u))for(var c=u.length,l=0;l<c;++l,r+=3)t.pack(u[l],n,r);if(a(s))for(var f=s.length,h=0;h<f;++h)i.push(s[h])}}return r},y.unpackPolygonHierarchy=function(e,n){for(var r=e[n++],a=e[n++],i=new Array(r),o=a>0?new Array(a):void 0,u=0;u<r;++u,n+=t.packedLength)i[u]=t.unpack(e,n);for(var s=0;s<a;++s)o[s]=y.unpackPolygonHierarchy(e,n),n=o[s].startingIndex,delete o[s].startingIndex;return{positions:i,holes:o,startingIndex:n}};var _=new t;y.subdivideLineCount=function(e,n,r){var a=t.distance(e,n),i=a/r,o=Math.max(0,Math.ceil(Math.log(i)/Math.log(2)));return Math.pow(2,o)},y.subdivideLine=function(e,n,r,i){var o=y.subdivideLineCount(e,n,r),u=t.distance(e,n),s=u/o;a(i)||(i=[]);var c=i;c.length=3*o;for(var l=0,f=0;f<o;f++){var h=m(e,n,f*s,u);c[l++]=h[0],c[l++]=h[1],c[l++]=h[2]}return c};var T=new t,v=new t,R=new t,g=new t;y.scaleToGeodeticHeightExtruded=function(e,n,o,u,s){u=r(u,i.WGS84);var c=T,l=v,f=R,h=g;if(a(e)&&a(e.attributes)&&a(e.attributes.position))for(var d=e.attributes.position.values,p=d.length/2,E=0;E<p;E+=3)t.fromArray(d,E,f),u.geodeticSurfaceNormal(f,c),h=u.scaleToGeodeticSurface(f,h),l=t.multiplyByScalar(c,o,l),l=t.add(h,l,l),d[E+p]=l.x,d[E+1+p]=l.y,d[E+2+p]=l.z,s&&(h=t.clone(f,h)),l=t.multiplyByScalar(c,n,l),l=t.add(h,l,l),d[E]=l.x,d[E+1]=l.y,d[E+2]=l.z;return e},y.polygonsFromHierarchy=function(n,r,i,o){var u=[],s=[],c=new p;for(c.enqueue(n);0!==c.length;){var l=c.dequeue(),f=l.positions,d=l.holes;if(f=e(f,t.equalsEpsilon,!0),!(f.length<3)){var m=i.projectPointsOntoPlane(f),y=[],_=h.computeWindingOrder2D(m);_===E.CLOCKWISE&&(m.reverse(),f=f.slice().reverse());var T,v,R=f.slice(),g=a(d)?d.length:0,A=[];for(T=0;T<g;T++){var S=d[T],N=e(S.positions,t.equalsEpsilon,!0);if(!(N.length<3)){var x=i.projectPointsOntoPlane(N);_=h.computeWindingOrder2D(x),_===E.CLOCKWISE&&(x.reverse(),N=N.slice().reverse()),A.push(N),y.push(R.length),R=R.concat(N),m=m.concat(x);var w=0;for(a(S.holes)&&(w=S.holes.length),v=0;v<w;v++)c.enqueue(S.holes[v])}}if(!r){for(T=0;T<f.length;T++)o.scaleToGeodeticSurface(f[T],f[T]);for(T=0;T<A.length;T++){var I=A[T];for(v=0;v<I.length;++v)o.scaleToGeodeticSurface(I[v],I[v])}}u.push({outerRing:f,holes:A}),s.push({positions:R,positions2D:m,holes:y})}}return{hierarchy:u,polygons:s}},y.createGeometryFromPositions=function(e,t,r,a,i){var s=h.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);var l=t.positions;if(a){for(var f=l.length,p=new Array(3*f),E=0,m=0;m<f;m++){var y=l[m];p[E++]=y.x,p[E++]=y.y,p[E++]=y.z}var _=new o({attributes:{position:new u({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:p})},indices:s,primitiveType:d.TRIANGLES});return i.normal?c.computeNormal(_):_}return h.computeSubdivision(e,l,s,r)};var A=[],S=new t,N=new t;return y.computeWallGeometry=function(e,r,a,i){var c,h,p,E,m,_=e.length,T=0;if(i)for(h=3*_*2,c=new Array(2*h),p=0;p<_;p++)E=e[p],m=e[(p+1)%_],c[T]=c[T+h]=E.x,++T,c[T]=c[T+h]=E.y,++T,c[T]=c[T+h]=E.z,++T,c[T]=c[T+h]=m.x,++T,c[T]=c[T+h]=m.y,++T,c[T]=c[T+h]=m.z,++T;else{var v=f.chordLength(a,r.maximumRadius),R=0;for(p=0;p<_;p++)R+=y.subdivideLineCount(e[p],e[(p+1)%_],v);for(h=3*(R+_),c=new Array(2*h),p=0;p<_;p++){E=e[p],m=e[(p+1)%_];for(var g=y.subdivideLine(E,m,v,A),x=g.length,w=0;w<x;++w,++T)c[T]=g[w],c[T+h]=g[w];c[T]=m.x,c[T+h]=m.x,++T,c[T]=m.y,c[T+h]=m.y,++T,c[T]=m.z,c[T+h]=m.z,++T}}_=c.length;var I=l.createTypedArray(_/3,_-6*e.length),O=0;for(_/=6,p=0;p<_;p++){var M=p,P=M+1,C=M+_,D=C+1;E=t.fromArray(c,3*M,S),m=t.fromArray(c,3*P,N),t.equalsEpsilon(E,m,f.EPSILON14)||(I[O++]=M,I[O++]=C,I[O++]=P,I[O++]=P,I[O++]=C,I[O++]=D)}return new o({attributes:new s({position:new u({componentDatatype:n.DOUBLE, +componentsPerAttribute:3,values:c})}),indices:I,primitiveType:d.TRIANGLES})},y}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/PolygonGeometry",["./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonGeometryLibrary","./PolygonPipeline","./Quaternion","./Rectangle","./VertexFormat","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,m,y,_,T,v,R,g,A,S,N){"use strict";function x(e,t,n,a){for(var i=g.fromAxisAngle(e._plane.normal,n,D),o=T.fromQuaternion(i,L),u=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=t.length,d=0;d<h;++d){var p=r.clone(t[d],C);T.multiplyByVector(o,p,p);var E=e.projectPointOntoPlane(p,P);s(E)&&(u=Math.min(u,E.x),c=Math.max(c,E.x),l=Math.min(l,E.y),f=Math.max(f,E.y))}return a.x=u,a.y=l,a.width=c-u,a.height=f-l,a}function w(e,t,n,r){var a=r.cartesianToCartographic(e,U),i=a.height,o=r.cartesianToCartographic(t,b);o.height=i,r.cartographicToCartesian(o,t);var u=r.cartesianToCartographic(n,b);u.height=i-100,r.cartographicToCartesian(u,n)}function I(e){var t=e.vertexFormat,a=e.geometry,i=e.shadowVolume;if(t.st||t.normal||t.tangent||t.bitangent||i){var u=e.boundingRectangle,s=e.tangentPlane,c=e.ellipsoid,l=e.stRotation,f=e.wall,h=e.top||f,d=e.bottom||f,E=e.perPositionHeight,m=k;m.x=u.x,m.y=u.y;var y,v=a.attributes.position.values,R=v.length,A=t.st?new Float32Array(2*(R/3)):void 0;t.normal&&(y=E&&h&&!f?a.attributes.normal.values:new Float32Array(R));var S=t.tangent?new Float32Array(R):void 0,N=t.bitangent?new Float32Array(R):void 0,x=i?new Float32Array(R):void 0,I=0,O=0,M=z,P=G,C=q,D=!0,L=g.fromAxisAngle(s._plane.normal,l,K),U=T.fromQuaternion(L,J),b=0,F=0;h&&d&&(b=R/2,F=R/3,R/=2);for(var Q=0;Q<R;Q+=3){var $=r.fromArray(v,Q,j);if(t.st){var ee=T.multiplyByVector(U,$,B);ee=c.scaleToGeodeticSurface(ee,ee);var te=s.projectPointOntoPlane(ee,Z);n.subtract(te,m,te);var ne=_.clamp(te.x/u.width,0,1),re=_.clamp(te.y/u.height,0,1);d&&(A[I+F]=ne,A[I+1+F]=re),h&&(A[I]=ne,A[I+1]=re),I+=2}if(t.normal||t.tangent||t.bitangent||i){var ae=O+1,ie=O+2;if(f){if(Q+3<R){var oe=r.fromArray(v,Q+3,W);if(D){var ue=r.fromArray(v,Q+R,V);E&&w($,oe,ue,c),r.subtract(oe,$,oe),r.subtract(ue,$,ue),M=r.normalize(r.cross(ue,oe,M),M),D=!1}r.equalsEpsilon(oe,$,_.EPSILON10)&&(D=!0)}(t.tangent||t.bitangent)&&(C=c.geodeticSurfaceNormal($,C),t.tangent&&(P=r.normalize(r.cross(C,M,P),P)))}else M=c.geodeticSurfaceNormal($,M),(t.tangent||t.bitangent)&&(E&&(H=r.fromArray(y,O,H),X=r.cross(r.UNIT_Z,H,X),X=r.normalize(T.multiplyByVector(U,X,X),X),t.bitangent&&(Y=r.normalize(r.cross(H,X,Y),Y))),P=r.cross(r.UNIT_Z,M,P),P=r.normalize(T.multiplyByVector(U,P,P),P),t.bitangent&&(C=r.normalize(r.cross(M,P,C),C)));t.normal&&(e.wall?(y[O+b]=M.x,y[ae+b]=M.y,y[ie+b]=M.z):d&&(y[O+b]=-M.x,y[ae+b]=-M.y,y[ie+b]=-M.z),(h&&!E||f)&&(y[O]=M.x,y[ae]=M.y,y[ie]=M.z)),i&&(f&&(M=c.geodeticSurfaceNormal($,M)),x[O+b]=-M.x,x[ae+b]=-M.y,x[ie+b]=-M.z),t.tangent&&(e.wall?(S[O+b]=P.x,S[ae+b]=P.y,S[ie+b]=P.z):d&&(S[O+b]=-P.x,S[ae+b]=-P.y,S[ie+b]=-P.z),h&&(E?(S[O]=X.x,S[ae]=X.y,S[ie]=X.z):(S[O]=P.x,S[ae]=P.y,S[ie]=P.z))),t.bitangent&&(d&&(N[O+b]=C.x,N[ae+b]=C.y,N[ie+b]=C.z),h&&(E?(N[O]=Y.x,N[ae]=Y.y,N[ie]=Y.z):(N[O]=C.x,N[ae]=C.y,N[ie]=C.z))),O+=3}}t.st&&(a.attributes.st=new p({componentDatatype:o.FLOAT,componentsPerAttribute:2,values:A})),t.normal&&(a.attributes.normal=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:y})),t.tangent&&(a.attributes.tangent=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:S})),t.bitangent&&(a.attributes.bitangent=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:N})),i&&(a.attributes.extrudeDirection=new p({componentDatatype:o.FLOAT,componentsPerAttribute:3,values:x}))}return a}function O(e,t,n,r,a,i,o,u){var s,c={walls:[]};if(i||o){var l,f,d=v.createGeometryFromPositions(e,t,n,a,u),p=d.attributes.position.values,m=d.indices;if(i&&o){var _=p.concat(p);l=_.length/3,f=y.createTypedArray(l,2*m.length),f.set(m);var T=m.length,g=l/2;for(s=0;s<T;s+=3){var A=f[s]+g,S=f[s+1]+g,x=f[s+2]+g;f[s+T]=x,f[s+1+T]=S,f[s+2+T]=A}if(d.attributes.position.values=_,a){var w=d.attributes.normal.values;d.attributes.normal.values=new Float32Array(_.length),d.attributes.normal.values.set(w)}d.indices=f}else if(o){for(l=p.length/3,f=y.createTypedArray(l,m.length),s=0;s<m.length;s+=3)f[s]=m[s+2],f[s+1]=m[s+1],f[s+2]=m[s];d.indices=f}c.topAndBottom=new E({geometry:d})}var I=r.outerRing,O=h.fromPoints(I,e),M=O.projectPointsOntoPlane(I,Q),P=R.computeWindingOrder2D(M);P===N.CLOCKWISE&&(I=I.slice().reverse());var C=v.computeWallGeometry(I,e,n,a);c.walls.push(new E({geometry:C}));var D=r.holes;for(s=0;s<D.length;s++){var L=D[s];O=h.fromPoints(L,e),M=O.projectPointsOntoPlane(L,Q),P=R.computeWindingOrder2D(M),P===N.COUNTER_CLOCKWISE&&(L=L.slice().reverse()),C=v.computeWallGeometry(L,e,n),c.walls.push(new E({geometry:C}))}return c}function M(e){var t=e.polygonHierarchy,n=u(e.vertexFormat,S.DEFAULT),r=u(e.ellipsoid,f.WGS84),a=u(e.granularity,_.RADIANS_PER_DEGREE),i=u(e.stRotation,0),o=u(e.height,0),c=u(e.perPositionHeight,!1),l=e.extrudedHeight,h=s(l);if(!c&&h)if(_.equalsEpsilon(o,l,_.EPSILON10))l=void 0,h=!1;else{var d=l;l=Math.min(d,o),o=Math.max(d,o)}this._vertexFormat=S.clone(n),this._ellipsoid=f.clone(r),this._granularity=a,this._stRotation=i,this._height=o,this._extrudedHeight=u(l,0),this._extrude=h,this._closeTop=u(e.closeTop,!0),this._closeBottom=u(e.closeBottom,!0),this._polygonHierarchy=t,this._perPositionHeight=c,this._shadowVolume=u(e.shadowVolume,!1),this._workerName="createPolygonGeometry";var p=t.positions;!s(p)||p.length<3?this._rectangle=new A:this._rectangle=A.fromCartesianArray(p,r),this.packedLength=v.computeHierarchyPackedLength(t)+f.packedLength+S.packedLength+A.packedLength+10}var P=new n,C=new r,D=new g,L=new T,U=new a,b=new a,F=new e,B=new r,z=new r,G=new r,q=new r,W=new r,V=new r,H=new r,X=new r,Y=new r,k=new n,Z=new n,j=new r,K=new g,J=new T,Q=[];M.fromPositions=function(e){e=u(e,u.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.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};return new M(t)},M.pack=function(e,t,n){return n=u(n,0),n=v.packPolygonHierarchy(e._polygonHierarchy,t,n),f.pack(e._ellipsoid,t,n),n+=f.packedLength,S.pack(e._vertexFormat,t,n),n+=S.packedLength,A.pack(e._rectangle,t,n),n+=A.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._extrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n]=e.packedLength,t};var $=f.clone(f.UNIT_SPHERE),ee=new S,te=new A,ne={polygonHierarchy:{}};return M.unpack=function(e,t,n){t=u(t,0);var r=v.unpackPolygonHierarchy(e,t);t=r.startingIndex,delete r.startingIndex;var a=f.unpack(e,t,$);t+=f.packedLength;var i=S.unpack(e,t,ee);t+=S.packedLength;var o=A.unpack(e,t,te);t+=A.packedLength;var c=e[t++],l=e[t++],h=e[t++],d=e[t++],p=1===e[t++],E=1===e[t++],m=1===e[t++],y=1===e[t++],_=1===e[t++],T=e[t];return s(n)||(n=new M(ne)),n._polygonHierarchy=r,n._ellipsoid=f.clone(a,n._ellipsoid),n._vertexFormat=S.clone(i,n._vertexFormat),n._height=c,n._extrudedHeight=l,n._granularity=h,n._stRotation=d,n._extrude=p,n._perPositionHeight=E,n._closeTop=m,n._closeBottom=y,n._rectangle=A.clone(o),n._shadowVolume=_,n.packedLength=T,n},M.createGeometry=function(e){var n=e._vertexFormat,r=e._ellipsoid,a=e._granularity,i=e._stRotation,o=e._height,u=e._extrudedHeight,s=e._extrude,c=e._polygonHierarchy,l=e._perPositionHeight,f=e._closeTop,p=e._closeBottom,_=c.positions;if(!(_.length<3)){var T=h.fromPoints(_,r),g=v.polygonsFromHierarchy(c,l,T,r),A=g.hierarchy,S=g.polygons;if(0!==A.length){_=A[0].outerRing;var N,w,M=x(T,_,i,F),P=[],C={perPositionHeight:l,vertexFormat:n,geometry:void 0,tangentPlane:T,boundingRectangle:M,ellipsoid:r,stRotation:i,bottom:!1,top:!0,wall:!1};if(s)for(C.top=f,C.bottom=p,C.shadowVolume=e._shadowVolume,w=0;w<S.length;w++){N=O(r,S[w],a,A[w],l,f,p,n);var D;f&&p?(D=N.topAndBottom,C.geometry=v.scaleToGeodeticHeightExtruded(D.geometry,o,u,r,l)):f?(D=N.topAndBottom,D.geometry.attributes.position.values=R.scaleToGeodeticHeight(D.geometry.attributes.position.values,o,r,!l),C.geometry=D.geometry):p&&(D=N.topAndBottom,D.geometry.attributes.position.values=R.scaleToGeodeticHeight(D.geometry.attributes.position.values,u,r,!0),C.geometry=D.geometry),(f||p)&&(C.wall=!1,D.geometry=I(C),P.push(D));var L=N.walls;C.wall=!0;for(var U=0;U<L.length;U++){var b=L[U];C.geometry=v.scaleToGeodeticHeightExtruded(b.geometry,o,u,r,l),b.geometry=I(C),P.push(b)}}else for(w=0;w<S.length;w++)N=new E({geometry:v.createGeometryFromPositions(r,S[w],a,l,n)}),N.geometry.attributes.position.values=R.scaleToGeodeticHeight(N.geometry.attributes.position.values,o,r,!l),C.geometry=N.geometry,N.geometry=I(C),P.push(N);N=m.combineInstances(P)[0],N.attributes.position.values=new Float64Array(N.attributes.position.values),N.indices=y.createTypedArray(N.attributes.position.values.length/3,N.indices);var B=N.attributes,z=t.fromVertices(B.position.values);return n.position||delete B.position,new d({attributes:B,indices:N.indices,primitiveType:N.primitiveType,boundingSphere:z})}}},M.createShadowVolume=function(e,t,n){var r=e._granularity,a=e._ellipsoid,i=t(r,a),o=n(r,a);return new M({polygonHierarchy:e._polygonHierarchy,ellipsoid:a,stRotation:e._stRotation,granularity:r,perPositionHeight:!1,extrudedHeight:i,height:o,vertexFormat:S.POSITION_ONLY,shadowVolume:!0})},c(M.prototype,{rectangle:{get:function(){return this._rectangle}}}),M}),define("Workers/createPolygonGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolygonGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createPolygonOutlineGeometry.js b/engines/Cesium/Workers/createPolygonOutlineGeometry.js index 335478f..4191c89 100644 --- a/engines/Cesium/Workers/createPolygonOutlineGeometry.js +++ b/engines/Cesium/Workers/createPolygonOutlineGeometry.js @@ -222,10 +222,10 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(n,i){if(!e(i))throw new t(r(n))},i.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},i.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},i.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},i.typeOf.number.lessThan=function(e,r,n){if(i.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},i.typeOf.number.lessThanOrEquals=function(e,r,n){if(i.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},i.typeOf.number.greaterThan=function(e,r,n){if(i.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},i.typeOf.number.greaterThanOrEquals=function(e,r,n){if(i.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},i.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},i.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*i.clamp(e,-1,1)+.5)*r)},i.fromSNorm=function(e,r){return r=t(r,255),i.clamp(e,0,r)/r*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},i.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},i.lerp=function(e,t,r){return(1-r)*e+r*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,r,n,i){i=t(i,n);var a=Math.abs(e-r);return a<=i||a<=n*Math.max(Math.abs(e),Math.abs(r))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var r=a[t-1],n=t;n<=e;n++)a.push(r*n);return a[e]},i.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=u*Math.cos(a),n},o.fromElements=function(e,t,n,i){return r(i)?(i.x=e,i.y=t,i.z=n,i):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new o),i.x=e[n++],i.y=e[n++],i.z=e[n],i},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var i=0;i<n;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var i=0;i<n;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var f=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,i){return e===t||r(e)&&r(t)&&a.equalsEpsilon(e.x,t.x,n,i)&&a.equalsEpsilon(e.y,t.y,n,i)&&a.equalsEpsilon(e.z,t.z,n,i)},o.cross=function(e,t,r){var n=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,c=i*s-a*u,l=a*o-n*s,f=n*u-i*o;return r.x=c,r.y=l,r.z=f,r},o.fromDegrees=function(e,t,r,n,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,r,n,i)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,i,a,u){i=t(i,0);var s=r(a)?a.radiiSquared:p,c=Math.cos(n);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(n),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,i,h),r(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,n){var i=e.length;r(n)?n.length=i/2:n=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var i=e.length;r(n)?n.length=i/2:n=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var i=e.length;r(n)?n.length=i/3:n=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var i=e.length;r(n)?n.length=i/3:n=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function i(r,i,u,s,c){var l=r.x,f=r.y,h=r.z,d=i.x,p=i.y,E=i.z,y=l*l*d*d,m=f*f*p*p,_=h*h*E*E,T=y+m+_,v=Math.sqrt(1/T),R=e.multiplyByScalar(r,v,a);if(T<s)return isFinite(v)?e.clone(R,c):void 0;var A=u.x,S=u.y,g=u.z,N=o;N.x=R.x*A*2,N.y=R.y*S*2,N.z=R.z*g*2;var O,x,I,w,M,C,P,D,L,U,b,F=(1-v)*e.magnitude(r)/(.5*e.magnitude(N)),z=0;do{F-=z,I=1/(1+F*A),w=1/(1+F*S),M=1/(1+F*g),C=I*I,P=w*w,D=M*M,L=C*I,U=P*w,b=D*M,O=y*C+m*P+_*D-1,x=y*L*A+m*U*S+_*b*g;var B=-2*x;z=O/B}while(Math.abs(O)>n.EPSILON12);return t(c)?(c.x=l*I,c.y=f*w,c.z=h*M,c):new e(l*I,f*w,h*M)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,i,a,o){"use strict";function u(e,r,n){this.longitude=t(e,0),this.latitude=t(r,0),this.height=t(n,0)}u.fromRadians=function(e,n,i,a){return i=t(i,0),r(a)?(a.longitude=e,a.latitude=n,a.height=i,a):new u(e,n,i)},u.fromDegrees=function(e,t,r,n){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=a.EPSILON1;return u.fromCartesian=function(t,n,i){var p=r(n)?n.oneOverRadii:f,E=r(n)?n.oneOverRadiiSquared:h,y=r(n)?n._centerToleranceSquared:d,m=o(t,p,E,y,c);if(r(m)){var _=e.multiplyComponents(m,E,s);_=e.normalize(_,_);var T=e.subtract(t,m,l),v=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=a.sign(e.dot(T,t))*e.magnitude(T);return r(i)?(i.longitude=v,i.latitude=R,i.height=A,i):new u(v,R,A)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,i,a,o,u,s){"use strict";function c(t,n,i,a){n=r(n,0),i=r(i,0),a=r(a,0),t._radii=new e(n,i,a),t._radiiSquared=new e(n*n,i*i,a*a),t._radiiToTheFourth=new e(n*n*n*n,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===n?0:1/n,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(n,i,a),t._maximumRadius=Math.max(n,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,r){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._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}i(l.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}}}),l.clone=function(t,r){if(n(t)){var i=t._radii;return n(r)?(e.clone(i,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(i.x,i.y,i.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,i){return i=r(i,0),e.pack(t._radii,n,i),n},l.unpack=function(t,n,i){n=r(n,0);var a=e.unpack(t,n);return l.fromCartesian3(a,i)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(a);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,r){var i=f,a=h;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),n(r)||(r=new e),e.add(a,i,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;i<r;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var d=new e,p=new e,E=new e;return l.prototype.cartesianToCartographic=function(r,i){var a=this.scaleToGeodeticSurface(r,p);if(n(a)){var o=this.geodeticSurfaceNormal(a,d),s=e.subtract(r,a,E),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;i<r;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=r(i,0);var o=this._sqauredXOverSquaredZ;if(n(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},l}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function i(r,n,i){if(t(r)){i=e(i,!1);var o=r.length;if(o<2)return r;var u,s,c;for(u=1;u<o&&(s=r[u-1],c=r[u],!n(s,c,a));++u);if(u===o)return i&&n(r[0],r[r.length-1],a)?r.slice(1):r;for(var l=r.slice(0,u);u<o;++u)c=r[u],n(s,c,a)||(l.push(c),s=c);return i&&l.length>1&&n(l[0],l[l.length-1],a)&&l.shift(),l}}var a=n.EPSILON10;return i}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,i,a,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return n(r)?(r.x=a,r.y=o,r.z=u,r):new e(a,o,u)},u.prototype.unproject=function(e,r){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return n(r)?(r.longitude=a,r.latitude=o,r.height=u,r):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a,o,u){"use strict";function s(e,t,n,i,a,o,u,s,c){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(a,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(E[r],p[r])];t+=2*n*n}return Math.sqrt(t)}function f(e,t){for(var r=u.EPSILON15,n=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(E[a],p[a])]);o>n&&(i=a,n=o)}var c=1,l=0,f=p[i],h=E[i];if(Math.abs(e[s.getElementIndex(h,f)])>r){var d,y=e[s.getElementIndex(h,h)],m=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(h,f)],T=(y-m)/2/_;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=r(t,0),n(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,p=r-u-f+d,E=2*(i-h),y=2*(a+l),m=2*(i+h),_=-r+u-f+d,T=2*(c-o),v=2*(a-l),R=2*(c+o),A=-r-u+f+d;return n(t)?(t[0]=p,t[1]=m,t[2]=v,t[3]=E,t[4]=_,t[5]=R,t[6]=y,t[7]=T,t[8]=A,t):new s(p,E,y,m,_,T,v,R,A)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*i,f=-a*u+c*o*i,h=c*u+a*o*i,d=r*u,p=a*i+c*o*u,E=-o*a+a*o*u,y=-o,m=c*r,_=a*r;return n(t)?(t[0]=l,t[1]=d,t[2]=y,t[3]=f,t[4]=p,t[5]=m,t[6]=h,t[7]=E,t[8]=_,t):new s(l,f,h,d,p,E,y,m,_)},s.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=i,t[6]=0,t[7]=-i,t[8]=r,t):new s(1,0,0,0,r,-i,0,i,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=r,t):new s(r,0,i,0,1,0,-i,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-i,0,i,r,0,0,0,1)},s.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,i=e[n],a=e[n+1],o=e[n+2];return r.x=i,r.y=a,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var i=3*t;return n[i]=r.x,n[i+1]=r.y,n[i+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],i=e[t+3],a=e[t+6];return r.x=n,r.y=i,r.z=a,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var h=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),r};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},s.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},s.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},s.multiplyByVector=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=e[0]*n+e[3]*i+e[6]*a,u=e[1]*n+e[4]*i+e[7]*a,s=e[2]*n+e[5]*i+e[8]*a;return r.x=o,r.y=u,r.z=s,r},s.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var r=e[0],n=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var p=[1,0,0],E=[2,2,1],y=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,i=10,a=0,o=0;n(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),p=r*c(d);o<i&&l(d)>p;)f(d,y),s.transpose(y,m),s.multiply(d,y,d),s.multiply(m,d,d),s.multiply(h,y,h),++a>2&&(++o,a=0);return t},s.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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*o)+i*(s*n-r*c)+u*(r*o-a*n)},s.inverse=function(e,t){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*i-n*f,t[2]=n*u-o*i,t[3]=c*u-a*f,t[4]=r*f-c*i,t[5]=a*i-r*u,t[6]=a*l-c*o,t[7]=c*n-r*l,t[8]=r*o-a*n;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a){"use strict";function o(e,r,n,i){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(i,0)}o.fromElements=function(e,t,n,i,a){return r(a)?(a.x=e,a.y=t,a.z=n,a.w=i,a):new o(e,t,n,i)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new o),i.x=e[n++],i.y=e[n++],i.z=e[n++],i.w=e[n],i},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var i=0;i<n;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var i=0;i<n;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,i){return e===t||r(e)&&r(t)&&a.equalsEpsilon(e.x,t.x,n,i)&&a.equalsEpsilon(e.y,t.y,n,i)&&a.equalsEpsilon(e.z,t.z,n,i)&&a.equalsEpsilon(e.w,t.w,n,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){ -this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(e,t,r,i,a,o,u,s,c,l,f,h,d,p,E,y){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(p,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(E,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(y,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,r){return t=n(t,0),i(r)||(r=new l),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},l.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,r,a){return r=n(r,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a):new l(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,n){i(n)||(n=new l);var a=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,p=t.y*t.z,E=t.y*t.w,y=t.z*t.z,m=t.z*t.w,_=t.w*t.w,T=s-d-y+_,v=2*(c-m),R=2*(f+E),A=2*(c+m),S=-s+d-y+_,g=2*(p-h),N=2*(f-E),O=2*(p+h),x=-s-d+y+_;return n[0]=T*a,n[1]=A*a,n[2]=N*a,n[3]=0,n[4]=v*o,n[5]=S*o,n[6]=O*o,n[7]=0,n[8]=R*u,n[9]=g*u,n[10]=x*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,r){var n=t.position,a=t.direction,o=t.up;e.normalize(a,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,p=f.x,E=f.y,y=f.z,m=d.x,_=d.y,T=d.z,v=n.x,R=n.y,A=n.z,S=u*-v+s*-R+c*-A,g=m*-v+_*-R+T*-A,N=p*v+E*R+y*A;return i(r)?(r[0]=u,r[1]=m,r[2]=-p,r[3]=0,r[4]=s,r[5]=_,r[6]=-E,r[7]=0,r[8]=c,r[9]=T,r[10]=-y,r[11]=0,r[12]=S,r[13]=g,r[14]=N,r[15]=1,r):new l(u,s,c,S,m,_,T,g,-p,-E,-y,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=c,i[15]=0,i},l.computeOrthographicOffCenter=function(e,t,r,n,i,a,o){var u=1/(t-e),s=1/(n-r),c=1/(a-i),l=-(t+e)*u,f=-(n+r)*s,h=-(a+i)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,i,a,o){var u=2*i/(t-e),s=2*i/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(a+i)/(a-i),h=-1,d=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,i,a){var o=2*i/(t-e),u=2*i/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,h=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=s,a[9]=c,a[10]=l,a[11]=f,a[12]=0,a[13]=0,a[14]=h,a[15]=0,a},l.computeViewportTransformation=function(e,t,r,i){e=n(e,n.EMPTY_OBJECT);var a=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),h=c,d=l,p=f,E=a+c,y=o+l,m=t+f,_=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=d,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=p,i[11]=0,i[12]=E,i[13]=y,i[14]=m,i[15]=_,i},l.computeView=function(t,r,n,i,a){return a[0]=i.x,a[1]=n.x,a[2]=-r.x,a[3]=0,a[4]=i.y,a[5]=n.y,a[6]=-r.y,a[7]=0,a[8]=i.z,a[9]=n.z,a[10]=-r.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(n,t),a[14]=e.dot(r,t),a[15]=1,a},l.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,i=e[n],a=e[n+1],o=e[n+2],u=e[n+3];return r.x=i,r.y=a,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var i=4*t;return n[i]=r.x,n[i+1]=r.y,n[i+2]=r.z,n[i+3]=r.w,n},l.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return r.x=n,r.y=i,r.z=a,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var p=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),r};var E=new e;l.getMaximumScale=function(t){return l.getScale(t,E),e.maximumComponent(E)},l.multiply=function(e,t,r){var n=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],E=e[12],y=e[13],m=e[14],_=e[15],T=t[0],v=t[1],R=t[2],A=t[3],S=t[4],g=t[5],N=t[6],O=t[7],x=t[8],I=t[9],w=t[10],M=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=n*T+u*v+f*R+E*A,b=i*T+s*v+h*R+y*A,F=a*T+c*v+d*R+m*A,z=o*T+l*v+p*R+_*A,B=n*S+u*g+f*N+E*O,G=i*S+s*g+h*N+y*O,q=a*S+c*g+d*N+m*O,W=o*S+l*g+p*N+_*O,X=n*x+u*I+f*w+E*M,V=i*x+s*I+h*w+y*M,H=a*x+c*I+d*w+m*M,Y=o*x+l*I+p*w+_*M,k=n*C+u*P+f*D+E*L,Z=i*C+s*P+h*D+y*L,j=a*C+c*P+d*D+m*L,K=o*C+l*P+p*D+_*L;return r[0]=U,r[1]=b,r[2]=F,r[3]=z,r[4]=B,r[5]=G,r[6]=q,r[7]=W,r[8]=X,r[9]=V,r[10]=H,r[11]=Y,r[12]=k,r[13]=Z,r[14]=j,r[15]=K,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},l.multiplyTransformation=function(e,t,r){var n=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],p=e[14],E=t[0],y=t[1],m=t[2],_=t[4],T=t[5],v=t[6],R=t[8],A=t[9],S=t[10],g=t[12],N=t[13],O=t[14],x=n*E+o*y+c*m,I=i*E+u*y+l*m,w=a*E+s*y+f*m,M=n*_+o*T+c*v,C=i*_+u*T+l*v,P=a*_+s*T+f*v,D=n*R+o*A+c*S,L=i*R+u*A+l*S,U=a*R+s*A+f*S,b=n*g+o*N+c*O+h,F=i*g+u*N+l*O+d,z=a*g+s*N+f*O+p;return r[0]=x,r[1]=I,r[2]=w,r[3]=0,r[4]=M,r[5]=C,r[6]=P,r[7]=0,r[8]=D,r[9]=L,r[10]=U,r[11]=0,r[12]=b,r[13]=F,r[14]=z,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],p=t[2],E=t[3],y=t[4],m=t[5],_=t[6],T=t[7],v=t[8],R=n*h+o*d+c*p,A=i*h+u*d+l*p,S=a*h+s*d+f*p,g=n*E+o*y+c*m,N=i*E+u*y+l*m,O=a*E+s*y+f*m,x=n*_+o*T+c*v,I=i*_+u*T+l*v,w=a*_+s*T+f*v;return r[0]=R,r[1]=A,r[2]=S,r[3]=0,r[4]=g,r[5]=N,r[6]=O,r[7]=0,r[8]=x,r[9]=I,r[10]=w,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=n*e[0]+i*e[4]+a*e[8]+e[12],u=n*e[1]+i*e[5]+a*e[9]+e[13],s=n*e[2]+i*e[6]+a*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var y=new e;l.multiplyByUniformScale=function(e,t,r){return y.x=t,y.y=t,y.z=t,l.multiplyByScale(e,y,r)},l.multiplyByScale=function(e,t,r){var n=t.x,i=t.y,a=t.z;return 1===n&&1===i&&1===a?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=i*e[4],r[5]=i*e[5],r[6]=i*e[6],r[7]=0,r[8]=a*e[8],r[9]=a*e[9],r[10]=a*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*n+e[4]*i+e[8]*a+e[12]*o,s=e[1]*n+e[5]*i+e[9]*a+e[13]*o,c=e[2]*n+e[6]*i+e[10]*a+e[14]*o,l=e[3]*n+e[7]*i+e[11]*a+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=e[0]*n+e[4]*i+e[8]*a,u=e[1]*n+e[5]*i+e[9]*a,s=e[2]*n+e[6]*i+e[10]*a;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=e[0]*n+e[4]*i+e[8]*a+e[12],u=e[1]*n+e[5]*i+e[9]*a+e[13],s=e[2]*n+e[6]*i+e[10]*a+e[14];return r.x=o,r.y=u,r.z=s,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var m=new s,_=new s,T=new t,v=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,m),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),v))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],i=e[4],a=e[8],o=e[12],f=e[1],h=e[5],d=e[9],p=e[13],E=e[2],y=e[6],R=e[10],A=e[14],S=e[3],g=e[7],N=e[11],O=e[15],x=R*O,I=A*N,w=y*O,M=A*g,C=y*N,P=R*g,D=E*O,L=A*S,U=E*N,b=R*S,F=E*g,z=y*S,B=x*h+M*d+C*p-(I*h+w*d+P*p),G=I*f+D*d+b*p-(x*f+L*d+U*p),q=w*f+L*h+F*p-(M*f+D*h+z*p),W=P*f+U*h+z*d-(C*f+b*h+F*d),X=I*i+w*a+P*o-(x*i+M*a+C*o),V=x*n+L*a+U*o-(I*n+D*a+b*o),H=M*n+D*i+z*o-(w*n+L*i+F*o),Y=C*n+b*i+F*a-(P*n+U*i+z*a);x=a*p,I=o*d,w=i*p,M=o*h,C=i*d,P=a*h,D=n*p,L=o*f,U=n*d,b=a*f,F=n*h,z=i*f;var k=x*g+M*N+C*O-(I*g+w*N+P*O),Z=I*S+D*N+b*O-(x*S+L*N+U*O),j=w*S+L*g+F*O-(M*S+D*g+z*O),K=P*S+U*g+z*N-(C*S+b*g+F*N),J=w*R+P*A+I*y-(C*A+x*y+M*R),Q=U*A+x*E+L*R-(D*R+b*A+I*E),$=D*y+z*A+M*E-(F*A+w*E+L*y),ee=F*R+C*E+b*y-(U*y+z*R+P*E),te=n*B+i*G+a*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=B*te,r[1]=G*te,r[2]=q*te,r[3]=W*te,r[4]=X*te,r[5]=V*te,r[6]=H*te,r[7]=Y*te,r[8]=k*te,r[9]=Z*te,r[10]=j*te,r[11]=K*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],p=-r*f-n*h-i*d,E=-a*f-o*h-u*d,y=-s*f-c*h-l*d;return t[0]=r,t[1]=a,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=p,t[13]=E,t[14]=y,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,i,a,o,u){"use strict";function s(e,t,n,i){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(i,0)}i(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},s.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new s),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,i,a,o){return e=u.toRadians(r(e,0)),t=u.toRadians(r(t,0)),i=u.toRadians(r(i,0)),a=u.toRadians(r(a,0)),n(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new s(e,t,i,a)},s.fromRadians=function(e,t,i,a,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(i,0),o.north=r(a,0),o):new s(e,t,i,a)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];r=Math.min(r,d.longitude),i=Math.max(i,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;a=Math.min(a,p),o=Math.max(o,p)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=i,t.north=l,t):new s(r,c,i,l)},s.fromCartesianArray=function(e,t,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=t.cartesianToCartographic(e[h]);i=Math.min(i,p.longitude),a=Math.max(a,p.longitude),l=Math.min(l,p.latitude),f=Math.max(f,p.latitude);var E=p.longitude>=0?p.longitude:p.longitude+u.TWO_PI;o=Math.min(o,E),c=Math.max(c,E)}return a-i>c-o&&(i=o,a=c,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=l,r.east=a,r.north=f,r):new s(i,l,a,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.negativePiToPi(Math.max(a,c)),f=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return n(r)?(r.west=l,r.south=h,r.east=f,r.north=d,r):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,r){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new s(i,a,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(a,c)),f=u.convertLongitudeRange(Math.max(i,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var r=t.longitude,n=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>i||u.equalsEpsilon(r,i,u.EPSILON14))&&(r<a||u.equalsEpsilon(r,a,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,t,i,o){t=r(t,a.WGS84),i=r(i,0),n(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,p=e.west,E=c;E.height=i,E.longitude=p,E.latitude=f,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.latitude=h,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=p,o[l]=t.cartographicToCartesian(E,o[l]),l++,f<0?E.latitude=f:h>0?E.latitude=h:E.latitude=0;for(var y=1;y<8;++y)E.longitude=-Math.PI+y*u.PI_OVER_TWO,s.contains(e,E)&&(o[l]=t.cartographicToCartesian(E,o[l]),l++);return 0===E.latitude&&(E.longitude=p,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=t.cartographicToCartesian(E,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,i,a,o,u,s,c,l,f){"use strict";function h(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var d=new e,p=new e,E=new e,y=new e,m=new e,_=new e,T=new e,v=new e,R=new e,A=new e,S=new e,g=new e;h.fromPoints=function(t,r){if(i(r)||(r=new h),!i(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],T),a=e.clone(n,d),o=e.clone(n,p),u=e.clone(n,E),s=e.clone(n,y),c=e.clone(n,m),l=e.clone(n,_),f=t.length,N=1;N<f;N++){e.clone(t[N],n);var O=n.x,x=n.y,I=n.z;O<a.x&&e.clone(n,a),O>s.x&&e.clone(n,s),x<o.y&&e.clone(n,o),x>c.y&&e.clone(n,c),I<u.z&&e.clone(n,u),I>l.z&&e.clone(n,l)}var w=e.magnitudeSquared(e.subtract(s,a,v)),M=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),P=a,D=s,L=w;M>L&&(L=M,P=o,D=c),C>L&&(L=C,P=u,D=l);var U=R;U.x=.5*(P.x+D.x),U.y=.5*(P.y+D.y),U.z=.5*(P.z+D.z);var b=e.magnitudeSquared(e.subtract(D,U,v)),F=Math.sqrt(b),z=A;z.x=a.x,z.y=o.y,z.z=u.z;var B=S;B.x=s.x,B.y=c.y,B.z=l.z;var G=e.multiplyByScalar(e.add(z,B,v),.5,g),q=0;for(N=0;N<f;N++){e.clone(t[N],n);var W=e.magnitude(e.subtract(n,G,v));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(n,U,v));if(X>b){var V=Math.sqrt(X);F=.5*(F+V),b=F*F;var H=V-F;U.x=(F*U.x+H*n.x)/V,U.y=(F*U.y+H*n.y)/V,U.z=(F*U.z+H*n.z)/V}}return F<q?(e.clone(U,r.center),r.radius=F):(e.clone(G,r.center),r.radius=q),r};var N=new o,O=new e,x=new e,I=new t,w=new t;h.fromRectangle2D=function(e,t,r){return h.fromRectangleWithHeights2D(e,t,0,0,r)},h.fromRectangleWithHeights2D=function(t,r,a,o,u){if(i(u)||(u=new h),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,N),f.southwest(t,I),I.height=a,f.northeast(t,w),w.height=o;var s=r.project(I,O),c=r.project(w,x),l=c.x-s.x,d=c.y-s.y,p=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+p*p);var E=u.center;return E.x=s.x+.5*l,E.y=s.y+.5*d,E.z=s.z+.5*p,u};var M=[];h.fromRectangle3D=function(e,t,r,o){t=n(t,a.WGS84),r=n(r,0);var u;return i(e)&&(u=f.subsample(e,t,r,M)),h.fromPoints(u,o)},h.fromVertices=function(t,r,a,o){if(i(o)||(o=new h),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),a=n(a,3);var u=T;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,d),c=e.clone(u,p),l=e.clone(u,E),f=e.clone(u,y),N=e.clone(u,m),O=e.clone(u,_),x=t.length,I=0;I<x;I+=a){var w=t[I]+r.x,M=t[I+1]+r.y,C=t[I+2]+r.z;u.x=w,u.y=M,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),M<c.y&&e.clone(u,c),M>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,v)),D=e.magnitudeSquared(e.subtract(N,c,v)),L=e.magnitudeSquared(e.subtract(O,l,v)),U=s,b=f,F=P;D>F&&(F=D,U=c,b=N),L>F&&(F=L,U=l,b=O);var z=R;z.x=.5*(U.x+b.x),z.y=.5*(U.y+b.y),z.z=.5*(U.z+b.z);var B=e.magnitudeSquared(e.subtract(b,z,v)),G=Math.sqrt(B),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=N.y,W.z=O.z;var X=e.multiplyByScalar(e.add(q,W,v),.5,g),V=0;for(I=0;I<x;I+=a){u.x=t[I]+r.x,u.y=t[I+1]+r.y,u.z=t[I+2]+r.z;var H=e.magnitude(e.subtract(u,X,v));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,v));if(Y>B){var k=Math.sqrt(Y);G=.5*(G+k),B=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<V?(e.clone(z,o.center),o.radius=G):(e.clone(X,o.center),o.radius=V),o},h.fromEncodedCartesianVertices=function(t,r,n){if(i(n)||(n=new h),!i(t)||!i(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var a=T;a.x=t[0]+r[0],a.y=t[1]+r[1],a.z=t[2]+r[2];for(var o=e.clone(a,d),u=e.clone(a,p),s=e.clone(a,E),c=e.clone(a,y),l=e.clone(a,m),f=e.clone(a,_),N=t.length,O=0;O<N;O+=3){var x=t[O]+r[O],I=t[O+1]+r[O+1],w=t[O+2]+r[O+2];a.x=x,a.y=I,a.z=w,x<o.x&&e.clone(a,o),x>c.x&&e.clone(a,c),I<u.y&&e.clone(a,u),I>l.y&&e.clone(a,l),w<s.z&&e.clone(a,s),w>f.z&&e.clone(a,f)}var M=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),P=e.magnitudeSquared(e.subtract(f,s,v)),D=o,L=c,U=M;C>U&&(U=C,D=u,L=l),P>U&&(U=P,D=s,L=f);var b=R;b.x=.5*(D.x+L.x),b.y=.5*(D.y+L.y),b.z=.5*(D.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,v)),z=Math.sqrt(F),B=A;B.x=o.x,B.y=u.y,B.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(B,G,v),.5,g),W=0;for(O=0;O<N;O+=3){a.x=t[O]+r[O],a.y=t[O+1]+r[O+1],a.z=t[O+2]+r[O+2];var X=e.magnitude(e.subtract(a,q,v));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(a,b,v));if(V>F){var H=Math.sqrt(V);z=.5*(z+H),F=z*z;var Y=H-z;b.x=(z*b.x+Y*a.x)/H,b.y=(z*b.y+Y*a.y)/H,b.z=(z*b.z+Y*a.z)/H}}return z<W?(e.clone(b,n.center),n.radius=z):(e.clone(q,n.center),n.radius=W),n},h.fromCornerPoints=function(t,r,n){i(n)||(n=new h);var a=n.center;return e.add(t,r,a),e.multiplyByScalar(a,.5,a),n.radius=e.distance(a,r),n},h.fromEllipsoid=function(t,r){return i(r)||(r=new h),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var C=new e;h.fromBoundingSpheres=function(t,r){if(i(r)||(r=new h),!i(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return h.clone(t[0],r);if(2===n)return h.union(t[0],t[1],r);for(var a=[],o=0;o<n;o++)a.push(t[o].center);r=h.fromPoints(a,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return r.radius=s,r};var P=new e,D=new e,L=new e;h.fromOrientedBoundingBox=function(t,r){i(r)||(r=new h);var n=t.halfAxes,a=c.getColumn(n,0,P),o=c.getColumn(n,1,D),u=c.getColumn(n,2,L),s=e.magnitude(a),l=e.magnitude(o),f=e.magnitude(u);return r.center=e.clone(t.center,r.center),r.radius=Math.max(s,l,f),r},h.clone=function(t,r){if(i(t))return i(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,r){r=n(r,0);var i=e.center;return t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius,t},h.unpack=function(e,t,r){t=n(t,0),i(r)||(r=new h);var a=r.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],r.radius=e[t],r};var U=new e,b=new e;h.union=function(t,r,n){i(n)||(n=new h);var a=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,a,U),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(d,a,d),e.clone(d,n.center),n.radius=f,n};var F=new e;h.expand=function(t,r,n){n=h.clone(t,n);var i=e.magnitude(e.subtract(r,n.center,F));return i>n.radius&&(n.radius=i),n},h.intersectPlane=function(t,r){var n=t.center,i=t.radius,a=r.normal,o=e.dot(a,n)+r.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,r){return i(r)||(r=new h),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var z=new e;h.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,z);return e.magnitudeSquared(n)-t.radius*t.radius},h.transformWithoutScale=function(e,t,r){return i(r)||(r=new h),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var B=new e;h.computePlaneDistances=function(t,r,n,a){i(a)||(a=new s);var o=e.subtract(t.center,r,B),u=e.dot(n,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var G=new e,q=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,r,i){r=n(r,Z);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),d=e.negate(c,X),p=Y,E=p[0];e.add(s,l,E),e.add(E,c,E),E=p[1],e.add(s,l,E),e.add(E,d,E),E=p[2],e.add(s,f,E),e.add(E,d,E),E=p[3],e.add(s,f,E),e.add(E,c,E),e.negate(s,s),E=p[4],e.add(s,l,E),e.add(E,c,E),E=p[5],e.add(s,l,E),e.add(E,d,E),E=p[6],e.add(s,f,E),e.add(E,d,E),E=p[7],e.add(s,f,E),e.add(E,c,E);for(var y=p.length,m=0;m<y;++m){var _=p[m];e.add(o,_,_);var T=a.cartesianToCartographic(_,H);r.project(T,_)}i=h.fromPoints(p,i),o=i.center;var v=o.x,R=o.y,A=o.z;return o.x=A,o.y=v,o.z=R,i},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,r){return h.computePlaneDistances(this,e,t,r)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(n.requestFullscreen=i,r=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(n.requestFullscreen=i,r=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?n.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(n.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?n.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(n.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?n.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(n.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),n.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),n.fullscreenerror=i)}return r},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[n.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;r<n;++r)t[r]=parseInt(t[r],10);return t}function i(){if(!t(R)&&(R=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(R=!0,A=n(e[1]))}return R}function a(){return i()&&A}function o(){if(!t(S)&&(S=!1,!i()&&!h()&&/ Safari\/[\.0-9]+/.test(v.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(S=!0,g=n(e[1]))}return S}function u(){return o()&&g}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(v.userAgent);null!==e&&(N=!0,O=n(e[1]),O.isNightly=!!e[2])}return N}function c(){return s()&&O; -}function l(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===v.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(x=!0,I=n(e[1]))):"Netscape"===v.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(x=!0,I=n(e[1])))}return x}function f(){return l()&&I}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(w=!0,M=n(e[1]))}return w}function d(){return h()&&M}function p(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(C=!0,P=n(e[1]))}return C}function E(){return t(D)||(D=/Windows/i.test(v.appVersion)),D}function y(){return p()&&P}function m(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(v.pointerEnabled)||v.pointerEnabled)),L}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;b=t(r)&&""!==r,b&&(U=r)}return b}function T(){return _()?U:void 0}var v;v="undefined"!=typeof navigator?navigator:{};var R,A,S,g,N,O,x,I,w,M,C,P,D,L,U,b,F={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:p,firefoxVersion:y,isWindows:E,hardwareConcurrency:e(v.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:T};return F.supportsFullscreen=function(){return r.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,i,a){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,i){switch(n=e(n,0),i=e(i,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,i);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,i);case o.SHORT:return new Int16Array(r,n,i);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,i);case o.INT:return new Int32Array(r,n,i);case o.UNSIGNED_INT:return new Uint32Array(r,n,i);case o.FLOAT:return new Float32Array(r,n,i);case o.DOUBLE:return new Float64Array(r,n,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,r,n,i){"use strict";function a(n,i,a){this.minimum=e.clone(t(n,e.ZERO)),this.maximum=e.clone(t(i,e.ZERO)),r(a)?a=e.clone(a):(a=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(a,.5,a)),this.center=a}a.fromPoints=function(t,n){if(r(n)||(n=new a),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var i=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],p=d.x,E=d.y,y=d.z;i=Math.min(p,i),s=Math.max(p,s),o=Math.min(E,o),c=Math.max(E,c),u=Math.min(y,u),l=Math.max(y,l)}var m=n.minimum;m.x=i,m.y=o,m.z=u;var _=n.maximum;_.x=s,_.y=c,_.z=l;var T=e.add(m,_,n.center);return e.multiplyByScalar(T,.5,T),n},a.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new a(t.minimum,t.maximum)},a.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return a.intersectPlane=function(t,r){o=e.subtract(t.maximum,t.minimum,o);var n=e.multiplyByScalar(o,.5,o),a=r.normal,u=n.x*Math.abs(a.x)+n.y*Math.abs(a.y)+n.z*Math.abs(a.z),s=e.dot(t.center,a)+r.distance;return s-u>0?i.INSIDE:s+u<0?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new o),i.x=e[n++],i.y=e[n],i},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var i=0;i<n;++i)o.pack(e[i],t,2*i);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var i=0;i<n;i+=2){var a=i/2;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),a.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,i){return e===t||r(e)&&r(t)&&a.equalsEpsilon(e.x,t.x,n,i)&&a.equalsEpsilon(e.y,t.y,n,i)},o.ZERO=i(new o(0,0)),o.UNIT_X=i(new o(1,0)),o.UNIT_Y=i(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var i=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(r)))<n?0:i}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,i){var a;if(0===e)return 0===n?[]:[-i/n];if(0===n){if(0===i)return[0,0];var o=Math.abs(i),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,a<0)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-n/e,a<0?[a,0]:[0,a];var c=n*n,l=4*e*i,f=r(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[h/e,i/h]:[i/h,h/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var i,a,o=e,u=t/3,s=r/3,c=n,l=o*s,f=u*c,h=u*u,d=s*s,p=o*s-h,E=o*c-u*s,y=u*c-d,m=4*p*y-E*E;if(m<0){var _,T,v;h*f>=l*d?(_=o,T=p,v=-2*u*p+o*E):(_=c,T=y,v=-c*E+2*s*y);var R=v<0?-1:1,A=-R*Math.abs(_)*Math.sqrt(-m);a=-v+A;var S=a/2,g=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),N=a===A?-g:-T/g;return i=T<=0?g+N:-v/(g*g+N*N+T),h*f>=l*d?[(i-u)/o]:[-c/(i+s)]}var O=p,x=-2*u*p+o*E,I=y,w=-c*E+2*s*y,M=Math.sqrt(m),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*M,-x)/3);i=2*Math.sqrt(-O);var D=Math.cos(P);a=i*D;var L=i*(-D/2-C*Math.sin(P)),U=a+L>2*u?a-u:L-u,b=o,F=U/b;P=Math.abs(Math.atan2(c*M,-w)/3),i=2*Math.sqrt(-I),D=Math.cos(P),a=i*D,L=i*(-D/2-C*Math.sin(P));var z=-c,B=a+L<2*s?a+s:L+s,G=z/B,q=b*B,W=-U*B-b*z,X=U*z,V=(s*W-u*X)/(-u*W+s*q);return F<=V?F<=G?V<=G?[F,V,G]:[F,G,V]:[G,F,V]:F<=G?[V,F,G]:V<=G?[V,G,F]:[G,V,F]}var n={};return n.computeDiscriminant=function(e,t,r,n){var i=e*e,a=t*t,o=r*r,u=n*n,s=18*e*t*r*n+a*o-27*i*u-4*(e*o*r+a*t*n);return s},n.computeRealRoots=function(e,n,i,a){var o,u;if(0===e)return t.computeRealRoots(n,i,a);if(0===n){if(0===i){if(0===a)return[0,0,0];u=-a/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(o=t.computeRealRoots(e,0,i),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,i,a)}return 0===i?0===a?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,a):0===a?(o=t.computeRealRoots(e,n,i),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,i,a)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function i(t,i,a,o){var u=t*t,s=i-3*u/8,c=a-i*t/2+u*t/8,l=o-a*t/4+i*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<r.EPSILON14){var p=n.computeRealRoots(1,s,l);if(2===p.length){var E,y=p[0],m=p[1];if(y>=0&&m>=0){var _=Math.sqrt(y),T=Math.sqrt(m);return[h-T,h-_,h+_,h+T]}if(y>=0&&m<0)return E=Math.sqrt(y),[h-E,h+E];if(y<0&&m>=0)return E=Math.sqrt(m),[h-E,h+E]}return[]}if(d>0){var v=Math.sqrt(d),R=(s+d-c/v)/2,A=(s+d+c/v)/2,S=n.computeRealRoots(1,v,R),g=n.computeRealRoots(1,-v,A);return 0!==S.length?(S[0]+=h,S[1]+=h,0!==g.length?(g[0]+=h,g[1]+=h,S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>g[0]&&S[0]<g[1]?[g[0],S[0],g[1],S[1]]:[S[0],g[0],S[1],g[1]]):S):0!==g.length?(g[0]+=h,g[1]+=h,g):[]}}return[]}function a(t,i,a,o){var u=a*a,s=i*i,c=t*t,l=-2*i,f=a*t+s-4*o,h=c*o-a*i*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var p,E,y=d[0],m=i-y,_=m*m,T=t/2,v=m/2,R=_-4*o,A=_+4*Math.abs(o),S=c-4*y,g=c+4*Math.abs(y);if(y<0||R*g<S*A){var N=Math.sqrt(S);p=N/2,E=0===N?0:(t*v-a)/N}else{var O=Math.sqrt(R);p=0===O?0:(t*v-a)/O,E=O/2}var x,I;0===T&&0===p?(x=0,I=0):r.sign(T)===r.sign(p)?(x=T+p,I=y/x):(I=T-p,x=y/I);var w,M;0===v&&0===E?(w=0,M=0):r.sign(v)===r.sign(E)?(w=v+E,M=o/w):(M=v-E,w=o/M);var C=n.computeRealRoots(1,x,w),P=n.computeRealRoots(1,I,M);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,i){var a=e*e,o=a*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,h=f*n,d=i*i,p=d*i,E=u*c*f-4*s*h-4*e*l*f+18*e*t*r*h-27*a*f*f+256*o*p+i*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*a*r*f)+d*(144*e*u*r-27*u*u-128*a*c-192*a*t*n);return E},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return i(c,l,f,h);case 1:return a(c,l,f,h);case 2:return a(c,l,f,h);case 3:return i(c,l,f,h);case 4:return i(c,l,f,h);case 5:return a(c,l,f,h);case 6:return i(c,l,f,h);case 7:return i(c,l,f,h);case 8:return a(c,l,f,h);case 9:return i(c,l,f,h);case 10:return i(c,l,f,h);case 11:return a(c,l,f,h);case 12:return i(c,l,f,h);case 13:return i(c,l,f,h);case 14:return i(c,l,f,h);case 15:return i(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n}return i.getPoint=function(t,n,i){return r(i)||(i=new e),i=e.multiplyByScalar(t.direction,n,i),e.add(t.origin,i,i)},i}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,i,a,o,u,s,c,l){"use strict";function f(e,t,r,n){var i=t*t-4*e*r;if(!(i<0)){if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function h(t,r,i){n(i)||(i=new a);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,_),h=e.dot(u,u),d=2*e.dot(u,l),p=e.magnitudeSquared(l)-c,E=f(h,d,p,A);if(n(E))return i.start=E.root0,i.stop=E.root1,i}function d(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function p(t,r,n,i,a){var l,f=i*i,h=a*a,p=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,E=a*(i*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),y=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+i*r.x+n,m=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=a*(i*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),T=[];if(0===_&&0===m){if(l=s.computeRealRoots(p,E,y),0===l.length)return T;var v=l[0],R=Math.sqrt(Math.max(1-v*v,0));if(T.push(new e(i,a*v,a*-R)),T.push(new e(i,a*v,a*R)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(i,a*A,a*-S)),T.push(new e(i,a*A,a*S))}return T}var g=_*_,N=m*m,O=p*p,x=_*m,I=O+N,w=2*(E*p+x),M=2*y*p+E*E-N+g,C=2*(y*E-x),P=y*y-g;if(0===I&&0===w&&0===M&&0===C)return T;l=c.computeRealRoots(I,w,M,C,P);var D=l.length;if(0===D)return T;for(var L=0;L<D;++L){var U,b=l[L],F=b*b,z=Math.max(1-F,0),B=Math.sqrt(z);U=o.sign(p)===o.sign(y)?d(p*F+y,E*b,o.EPSILON12):o.sign(y)===o.sign(E*b)?d(p*F,E*b+y,o.EPSILON12):d(p*F+E*b,y,o.EPSILON12);var G=d(m*b,_,o.EPSILON15),q=U*G;q<0?T.push(new e(i,a*b,a*B)):q>0?T.push(new e(i,a*b,a*-B)):0!==B?(T.push(new e(i,a*b,a*-B)),T.push(new e(i,a*b,a*B)),++L):T.push(new e(i,a*b,a*B))}return T}var E={};E.rayPlane=function(t,r,i){n(i)||(i=new e);var a=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,a))/c;if(!(l<0))return i=e.multiplyByScalar(u,l,i),e.add(a,i,i)}};var y=new e,m=new e,_=new e,T=new e,v=new e;E.rayTriangleParametric=function(t,n,i,a,u){u=r(u,!1);var s,c,l,f,h,d=t.origin,p=t.direction,E=e.subtract(i,n,y),R=e.subtract(a,n,m),A=e.cross(p,R,_),S=e.dot(E,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(d,n,T),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,E,v),f=e.dot(p,c),f<0||l+f>S)return;h=e.dot(R,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var g=1/S;if(s=e.subtract(d,n,T),l=e.dot(s,A)*g,l<0||l>1)return;if(c=e.cross(s,E,v),f=e.dot(p,c)*g,f<0||l+f>1)return;h=e.dot(R,c)*g}return h},E.rayTriangle=function(t,r,i,a,o,u){var s=E.rayTriangleParametric(t,r,i,a,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new l;E.lineSegmentTriangle=function(t,r,i,a,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,i,a,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};E.raySphere=function(e,t,r){if(r=h(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new l;E.lineSegmentSphere=function(t,r,i,a){var o=S;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),a=h(o,i,a),!(!n(a)||a.stop<0||a.start>s))return a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a};var g=new e,N=new e;E.rayEllipsoid=function(t,r){var n,i,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,g),f=e.multiplyComponents(c,t.direction,N),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var p=d*d;if(n=h-1,i=e.magnitudeSquared(f),o=i*n,p<o)return;if(p>o){u=d*d-o,s=-d+Math.sqrt(u);var E=s/i,y=n/s;return E<y?new a(E,y):{start:y,stop:E}}var m=Math.sqrt(n/i);return new a(m,m)}return h<1?(n=h-1,i=e.magnitudeSquared(f),o=i*n,u=d*d-o,s=-d+Math.sqrt(u),new a(0,s/i)):d<0?(i=e.magnitudeSquared(f),new a(0,-d/i)):void 0};var O=new e,x=new e,I=new e,w=new e,M=new e,C=new u,P=new u,D=new u,L=new u,U=new u,b=new u,F=new u,z=new e,B=new e,G=new t;E.grazingAltitudeLocation=function(t,r){var i=t.origin,a=t.direction;if(!e.equals(i,e.ZERO)){var s=r.geodeticSurfaceNormal(i,O);if(e.dot(a,s)>=0)return i}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(a,O),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,x),x),E=e.normalize(e.cross(f,d,I),I),y=C; -y[0]=f.x,y[1]=f.y,y[2]=f.z,y[3]=d.x,y[4]=d.y,y[5]=d.z,y[6]=E.x,y[7]=E.y,y[8]=E.z;var m=u.transpose(y,P),_=u.fromScale(r.radii,D),T=u.fromScale(r.oneOverRadii,L),v=U;v[0]=0,v[1]=-a.z,v[2]=a.y,v[3]=a.z,v[4]=0,v[5]=-a.x,v[6]=-a.y,v[7]=a.x,v[8]=0;var R,A,S=u.multiply(u.multiply(m,T,b),v,b),g=u.multiply(u.multiply(S,_,F),y,F),N=u.multiplyByVector(S,i,M),q=p(g,e.negate(N,O),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,B),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){R=u.multiplyByVector(_,u.multiplyByVector(y,q[H],z),z);var Y=e.normalize(e.subtract(R,i,w),w),k=e.dot(Y,a);k>V&&(V=k,X=e.clone(R,X))}var Z=r.cartesianToCartographic(X,G);return V=o.clamp(V,0,1),A=e.magnitude(e.subtract(X,i,w))*Math.sqrt(1-V*V),A=c?-A:A,Z.height=A,r.cartographicToCartesian(Z,new e)}};var q=new e;return E.lineSegmentPlane=function(t,r,i,a){n(a)||(a=new e);var u=e.subtract(r,t,q),s=i.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(i.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,a),e.add(t,a,a),a}},E.trianglePlaneIntersection=function(t,r,n,i){var a=i.normal,o=i.distance,u=e.dot(a,t)+o<0,s=e.dot(a,r)+o<0,c=e.dot(a,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return E.lineSegmentPlane(t,r,i,f),E.lineSegmentPlane(t,n,i,h),{positions:[t,r,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(r,n,i,f),E.lineSegmentPlane(r,t,i,h),{positions:[t,r,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(n,t,i,f),E.lineSegmentPlane(n,r,i,h),{positions:[t,r,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(r,t,i,f),E.lineSegmentPlane(n,t,i,h),{positions:[t,r,n,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(n,r,i,f),E.lineSegmentPlane(t,r,i,h),{positions:[t,r,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,n,i,f),E.lineSegmentPlane(r,n,i,h),{positions:[t,r,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,r,n){"use strict";function i(t,r){this.normal=e.clone(t),this.distance=r}i.fromPointNormal=function(r,n,a){var o=-e.dot(n,r);return t(a)?(e.clone(n,a.normal),a.distance=o,a):new i(n,o)};var a=new e;return i.fromCartesian4=function(r,n){var o=e.fromCartesian4(r,a),u=r.w;return t(n)?(e.clone(o,n.normal),n.distance=u,n):new i(o,u)},i.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},i.ORIGIN_XY_PLANE=n(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=n(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=n(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,i){return t(e).then(r,n,i)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=o(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=i(e),t}function r(t){return e(t,a)}function n(e){this.then=e}function i(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(e){return a(e)}});return r}function a(e){var r=new n(function(r,n){try{return n?t(n(e)):a(e)}catch(e){return a(e)}});return r}function o(){function e(e,t,r){return h(e,t,r)}function r(e){return p(e)}function i(e){return p(a(e))}function u(e){return d(e)}var s,c,l,f,h,d,p;return c=new n(e),s={then:e,resolve:r,reject:i,progress:u,promise:c,resolver:{resolve:r,reject:i,progress:u}},l=[],f=[],h=function(e,t,r){var n,i;return n=o(),i="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,i)}),f.push(i),n.promise},d=function(e){return E(f,e),e},p=function(e){return e=t(e),h=e.then,p=t,d=m,E(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,i,a){return y(2,arguments),e(t,function(t){function u(e){E(e)}function s(e){p(e)}var c,l,f,h,d,p,E,y,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),f=[],l=_-c+1,h=[],d=o(),c)for(y=d.progress,E=function(e){h.push(e),--l||(p=E=m,d.reject(h))},p=function(e){f.push(e),--c||(p=E=m,d.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,y);else d.resolve(f);return d.then(n,i,a)})}function c(e,t,r,n){function i(e){return t?t(e[0]):e[0]}return s(e,1,i,r,n)}function l(e,t,r,n){return y(1,arguments),h(e,_).then(t,r,n)}function f(){return h(arguments,_)}function h(t,r){return e(t,function(t){var n,i,a,u,s,c;if(a=i=t.length>>>0,n=[],c=o(),a)for(u=function(t,i){e(t,r).then(function(e){n[i]=e,--a||c.resolve(n)},c.reject)},s=0;s<i;s++)s in t?u(t[s],s):--a;else c.resolve(n);return c.promise})}function d(t,r){var n=v.call(arguments,1);return e(t,function(t){var i;return i=t.length,n[0]=function(t,n,a){return e(t,function(t){return e(n,function(e){return r(t,e,a,i)})})},T.apply(t,n)})}function p(t,r,n){var i=arguments.length>2;return e(t,function(e){return e=i?n:e,r.resolve(e),e},function(e){return r.reject(e),a(e)},r.progress)}function E(e,t){for(var r,n=0;r=e[n++];)r(t)}function y(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function m(){}function _(e){return e}var T,v,R;return e.defer=o,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=p,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},v=[].slice,T=[].reduce||function(e){var t,r,n,i,a;if(a=0,t=Object(this),i=t.length>>>0,r=arguments,r.length<=1)for(;;){if(a in t){n=t[a++];break}if(++a>=i)throw new TypeError}else n=r[1];for(;a<i;++a)a in t&&(n=e(n,t[a],a,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(i[r])||(i[r]=!0,console.warn(e(n,r)))}var i={};return n.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.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e,t,r){for(var n,i,a=0,o=e.length-1;a<=o;)if(n=~~((a+o)/2),i=r(e[n],t),i<0)a=n+1;else{if(!(i>0))return n;o=n-1}return~(o+1)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,n,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=i}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,n=t[r++],i=function(e,t,r,n){r||(r=" ");var i=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return n?e+i:i+e},a=function(e,t,r,n,a,o){var u=n-e.length;return u>0&&(e=r||!a?i(e,n,o,r):e.slice(0,t.length)+i("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,r,n,o,u,s){var c=e>>>0;return r=r&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+i(c.toString(t),u||0,"0",!1),a(e,r,n,o,s)},u=function(e,t,r,n,i,o){return null!=n&&(e=e.slice(0,n)),a(e,"",t,r,i,o)},s=function(e,n,s,c,l,f,h){var d,p,E,y,m;if("%%"==e)return"%";for(var _=!1,T="",v=!1,R=!1,A=" ",S=s.length,g=0;s&&g<S;g++)switch(s.charAt(g)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":A=s.charAt(g+1);break;case"0":v=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[r++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=n?t[n.slice(0,-1)]:t[r++],h){case"s":return u(String(m),_,c,f,v,A);case"c":return u(String.fromCharCode(+m),_,c,f,v);case"b":return o(m,2,R,_,c,f,v);case"o":return o(m,8,R,_,c,f,v);case"x":return o(m,16,R,_,c,f,v);case"X":return o(m,16,R,_,c,f,v).toUpperCase();case"u":return o(m,10,R,_,c,f,v);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),p=d<0?"-":T,m=p+i(String(Math.abs(d)),f,"0",!1),a(m,p,_,c,v);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,p=d<0?"-":T,E=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=p+Math.abs(d)[E](f),a(m,p,_,c,v)[y]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,i,a,o,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=i,this.second=a,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(e,t){return E.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var r=E.leapSeconds,n=t(r,T,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var i=r[n].offset;if(n>0){var a=E.secondsDifference(r[n].julianDate,e);a>i&&(n--,i=r[n].offset)}E.addSeconds(e,i,e)}function h(e,r){T.julianDate=e;var n=E.leapSeconds,i=t(n,T,l);if(i<0&&(i=~i),0===i)return E.addSeconds(e,-n[0].offset,r);if(i>=n.length)return E.addSeconds(e,-n[i-1].offset,r);var a=E.secondsDifference(n[i].julianDate,e);return 0===a?E.addSeconds(e,-n[i].offset,r):a<=1?void 0:E.addSeconds(e,-n[--i].offset,r)}function d(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,t<0&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function p(e,t,r,n,i,a,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+r-32075;n-=12,n<0&&(n+=24);var f=a+(n*s.SECONDS_PER_HOUR+i*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function E(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),n=r(n,c.UTC);var i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,d(i,t,this),n===c.UTC&&f(this)}var y=new a,m=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,v=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,g=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+N.source,x=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,I=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;E.fromDate=function(e,t){var r=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n(t)?(d(r[0],r[1],t),f(t),t):new E(r[0],r[1],c.UTC)},E.fromIso8601=function(e,t){e=e.replace(",",".");var r,i,a,u=e.split("T"),s=1,l=1,h=0,y=0,T=0,N=0,w=u[0],M=u[1];if(u=w.match(g),null!==u)r=+u[1],s=+u[2],l=+u[3];else if(u=w.match(R),null!==u)r=+u[1],s=+u[2];else if(u=w.match(v),null!==u)r=+u[1];else{var C;if(u=w.match(A),null!==u)r=+u[1],C=+u[2],a=o(r);else if(u=w.match(S),null!==u){r=+u[1];var P=+u[2],D=+u[3]||0,L=new Date(Date.UTC(r,0,4));C=7*P+D-L.getUTCDay()-3}i=new Date(Date.UTC(r,0,1)),i.setUTCDate(C),s=i.getUTCMonth()+1,l=i.getUTCDate()}a=o(r);var U;if(n(M)){u=M.match(I),null!==u?(h=+u[1],y=+u[2],T=+u[3],N=1e3*+(u[4]||0),U=5):(u=M.match(x),null!==u?(h=+u[1],y=+u[2],T=60*+(u[3]||0),U=4):(u=M.match(O),null!==u&&(h=+u[1],y=60*+(u[2]||0),U=3)));var b=u[U],F=+u[U+1],z=+(u[U+2]||0);switch(b){case"+":h-=F,y-=z;break;case"-":h+=F,y+=z;break;case"Z":break;default:y+=new Date(Date.UTC(r,s-1,l,h,y)).getTimezoneOffset()}}else y+=new Date(r,s-1,l).getTimezoneOffset();var B=60===T;for(B&&T--;y>=60;)y-=60,h++;for(;h>=24;)h-=24,l++;for(i=a&&2===s?_:m[s-1];l>i;)l-=i,s++,s>12&&(s-=12,r++),i=a&&2===s?_:m[s-1];for(;y<0;)y+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,r--),i=a&&2===s?_:m[s-1],l+=i;var G=p(r,s,l,h,y,T,N);return n(t)?(d(G[0],G[1],t),f(t)):t=new E(G[0],G[1],c.UTC),B&&E.addSeconds(t,1,t),t},E.now=function(e){return E.fromDate(new Date,e)};var w=new E(0,0,c.TAI);return E.toGregorianDate=function(e,t){var r=!1,i=h(e,w);n(i)||(E.addSeconds(e,-1,w),i=h(w,w),r=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,p=c-(2447*d/80|0)|0;c=d/11|0;var y=d+2-12*c|0,m=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,v=T/s.SECONDS_PER_MINUTE|0;T-=v*s.SECONDS_PER_MINUTE;var R=0|T,A=(T-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(R+=1),n(t)?(t.year=m,t.month=y,t.day=p,t.hour=_,t.minute=v,t.second=R,t.millisecond=A,t.isLeapSecond=r,t):new a(m,y,p,_,v,R,A,r)},E.toDate=function(e){var t=E.toGregorianDate(e,y),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},E.toIso8601=function(t,r){var i,a=E.toGregorianDate(t,a);return n(r)||0===a.millisecond?n(r)&&0!==r?(i=(.01*a.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",a.year,a.month,a.day,a.hour,a.minute,a.second):(i=(.01*a.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i))},E.clone=function(e,t){if(n(e))return n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new E(e.dayNumber,e.secondsOfDay,c.TAI)},E.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},E.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},E.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(E.secondsDifference(e,t))<=r},E.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},E.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},E.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},E.computeTaiMinusUtc=function(e){T.julianDate=e;var r=E.leapSeconds,n=t(r,T,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},E.addSeconds=function(e,t,r){return d(e.dayNumber,e.secondsOfDay+t,r)},E.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,n,r)},E.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,n,r)},E.addDays=function(e,t,r){var n=e.dayNumber+t;return d(n,e.secondsOfDay,r)},E.lessThan=function(e,t){return E.compare(e,t)<0},E.lessThanOrEquals=function(e,t){return E.compare(e,t)<=0},E.greaterThan=function(e,t){return E.compare(e,t)>0},E.greaterThanOrEquals=function(e,t){return E.compare(e,t)>=0},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return E.toIso8601(this)},E.leapSeconds=[new u(new E(2441317,43210,c.TAI),10),new u(new E(2441499,43211,c.TAI),11),new u(new E(2441683,43212,c.TAI),12),new u(new E(2442048,43213,c.TAI),13),new u(new E(2442413,43214,c.TAI),14),new u(new E(2442778,43215,c.TAI),15),new u(new E(2443144,43216,c.TAI),16),new u(new E(2443509,43217,c.TAI),17),new u(new E(2443874,43218,c.TAI),18),new u(new E(2444239,43219,c.TAI),19),new u(new E(2444786,43220,c.TAI),20),new u(new E(2445151,43221,c.TAI),21),new u(new E(2445516,43222,c.TAI),22),new u(new E(2446247,43223,c.TAI),23),new u(new E(2447161,43224,c.TAI),24),new u(new E(2447892,43225,c.TAI),25),new u(new E(2448257,43226,c.TAI),26),new u(new E(2448804,43227,c.TAI),27),new u(new E(2449169,43228,c.TAI),28),new u(new E(2449534,43229,c.TAI),29),new u(new E(2450083,43230,c.TAI),30),new u(new E(2450630,43231,c.TAI),31),new u(new E(2451179,43232,c.TAI),32),new u(new E(2453736,43233,c.TAI),33),new u(new E(2454832,43234,c.TAI),34),new u(new E(2456109,43235,c.TAI),35),new u(new E(2457204,43236,c.TAI),36),new u(new E(2457754,43237,c.TAI),37)],E}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var i=new r.constructor;for(var a in r)if(r.hasOwnProperty(a)){var o=r[a];n&&(o=t(o,n)),i[a]=o}return i}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var i=r[n],a=i.indexOf(": ");if(a>0){var o=i.substring(0,a),u=i.substring(a+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,n){this.statusCode=e,this.response=r,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=n.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return a.test(t)?t:e.toUpperCase()}function r(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var n=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,r).replace(i,t)),this.path&&(this.path=this.path.replace(i,t)),this.query&&(this.query=this.query.replace(i,t)),this.fragment&&(this.fragment=this.fragment.replace(i,t))};var i=/%[0-9a-z]{2}/gi,a=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var i=n.getAuthority();if(t(i)){if(i.indexOf("@")!==-1){var a=i.split("@");i=a[1]}if(i.indexOf(":")===-1){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)i+=":80";else{if("https"!==o)return;i+=":443"}}return i}}var i={},a={};return i.add=function(e,r){var n=e.toLowerCase()+":"+r;t(a[n])||(a[n]=!0)},i.remove=function(e,r){var n=e.toLowerCase()+":"+r;t(a[n])&&delete a[n]},i.contains=function(e){var r=n(e);return!(!t(r)||!t(a[r]))},i.clear=function(){a={}},i}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,n,i,a,o){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,i=t(r.method,"GET"),a=r.data,o=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,n,i,a,o,r,s),r.promise})}function s(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function c(e,t){for(var r=s(e,t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a<r.length;a++)i[a]=r.charCodeAt(a);return n}function l(e,r){r=t(r,"");var n=e[1],i=!!e[2],a=e[3];switch(r){case"":case"text":return s(i,a);case"arraybuffer":return c(i,a);case"blob":var o=c(i,a);return new Blob([o],{type:n});case"document":var u=new DOMParser;return u.parseFromString(s(i,a),n);case"json":return JSON.parse(s(i,a))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,n,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var p=new XMLHttpRequest;if(o.contains(e)&&(p.withCredentials=!0),r(h)&&r(p.overrideMimeType)&&p.overrideMimeType(h),p.open(n,e,!0),r(s))for(var E in s)s.hasOwnProperty(E)&&p.setRequestHeader(E,s[E]);r(t)&&(p.responseType=t),p.onload=function(){if(p.status<200||p.status>=300)return void c.reject(new i(p.status,p.response,p.getAllResponseHeaders()));var e=p.response,n=p.responseType;if(!r(e)||r(t)&&n!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===n||"document"===n)&&r(p.responseXML)&&p.responseXML.hasChildNodes()?c.resolve(p.responseXML):""!==n&&"text"!==n||!r(p.responseText)?c.reject(new a("Invalid XMLHttpRequest response type.")):c.resolve(p.responseText);else c.resolve(e)},p.onerror=function(e){c.reject(new i)},p.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function i(r,i){return t(i)?t(i.Accept)||(i=e(i),i.Accept=a.Accept):i=a,n(r,i).then(function(e){return JSON.parse(e)})}var a={Accept:"application/json,*/*;q=0.01"};return i}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,i,a,o,u,s,c,l,f){"use strict";function h(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))p(this,t.data);else if(n(t.url)){var i=this;this._downloadPromise=e(s(t.url),function(e){p(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function p(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var i=r.columnNames.indexOf("modifiedJulianDateUtc"),a=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),h=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),E=r.columnNames.indexOf("taiMinusUtcSeconds");if(i<0||a<0||s<0||c<0||h<0||p<0||E<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var y=e._samples=r.samples,m=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=E,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,v=0,R=y.length;v<R;v+=e._columnCount){var A=y[v+i],S=y[v+E],g=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(m.push(N),T){if(S!==_&&n(_)){var O=o.leapSeconds,x=t(O,N,d);if(x<0){var I=new u(N,S);O.splice(~x,0,I)}}_=S}}}function E(e,t,r,n,i){var a=r*n;i.xPoleWander=t[a+e._xPoleWanderRadiansColumn],i.yPoleWander=t[a+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[a+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[a+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[a+e._ut1MinusUtcSecondsColumn]}function y(e,t,r){return t+e*(r-t)}function m(e,t,r,n,i,a,u){var s=e._columnCount;if(a>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[i],l=t[a];if(c.equals(l)||n.equals(c))return E(e,r,i,s,u),u;if(n.equals(l))return E(e,r,a,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),h=i*s,d=a*s,p=r[h+e._ut1MinusUtcSecondsColumn],m=r[d+e._ut1MinusUtcSecondsColumn],_=m-p;if(_>.5||_<-.5){var T=r[h+e._taiMinusUtcSecondsColumn],v=r[d+e._taiMinusUtcSecondsColumn];T!==v&&(l.equals(n)?p=m:m-=v-T)}return u.xPoleWander=y(f,r[h+e._xPoleWanderRadiansColumn],r[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=y(f,r[h+e._yPoleWanderRadiansColumn],r[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=y(f,r[h+e._xCelestialPoleOffsetRadiansColumn],r[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=y(f,r[h+e._yCelestialPoleOffsetRadiansColumn],r[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=y(f,p,m),u}return h.NONE=a({getPromiseToLoad:function(){return e()},compute:function(e,t){return n(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new i(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,r){if(n(this._samples)){if(n(r)||(r=new i(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var a=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=a[u],h=a[u+1],d=o.lessThanOrEquals(f,e),p=!n(h),E=p||o.greaterThanOrEquals(h,e);if(d&&E)return s=u,!p&&h.equals(e)&&++s,l=s+1,m(this,a,this._samples,e,s,l,r),r}var y=t(a,e,o.compare,this._dateColumn);return y>=0?(y<a.length-1&&a[y+1].equals(e)&&++y,s=y,l=y):(l=~y,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,a,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(r,n){n=t(n,document.location.href);var i=new e(n),a=new e(r);return a.resolve(i).toString()}return i}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(n,i,a){a=t(a,!0),n instanceof e||(n=new e(n)),i instanceof e||(i=new e(i)),r(i.authority)&&!r(i.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?i.scheme=new e(document.location.href).scheme:i.scheme=n.scheme);var o=n;i.isAbsolute()&&(o=i);var u="";r(o.scheme)&&(u+=o.scheme+":"),r(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===n?a?n.path.replace(/\/?$/,"/")+i.path.replace(/^\/?/g,""):n.path+i.path:i.path;var s=r(n.query),c=r(i.query);s&&c?u+="?"+n.query+"&"+i.query:s&&!c?u+="?"+n.query:!s&&c&&(u+="?"+i.query);var l=r(i.fragment);return r(n.fragment)&&!l?u+="#"+n.fragment:l&&(u+="#"+i.fragment),u}return i}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,n,i,a){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),i=p.exec(n);if(null!==i)return i[1]}}function u(){if(t(f))return f;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(n(r))}function s(e){return a.toUrl("../"+e)}function c(e){return i(u(),e)}function l(e){t(h)||(h=t(a.toUrl)?s:c),t(d)||(d=document.createElement("a"));var r=h(e);return d.href=r,d.href=d.href,d.href}var f,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=p,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,n,i,a,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new a(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){n[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,a.daysDifference(n,e._sampleZeroDateTT)}function l(r,i){if(r._chunkDownloadsInProgress[i])return r._chunkDownloadsInProgress[i];var a=e.defer();r._chunkDownloadsInProgress[i]=a;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.replace("{0}",i):t("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json"),e(o(u),function(e){r._chunkDownloadsInProgress[i]=!1;for(var t=r._samples,n=e.samples,o=i*r._samplesPerXysFile*3,u=0,s=n.length;u<s;++u)t[o+u]=n[u];a.resolve()}),a.promise}var f=new a(0,0,u.TAI);return s.prototype.preload=function(t,r,n,i){var a=c(this,t,r),o=c(this,n,i),u=a/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1); -for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],p=f;p<=h;++p)d.push(l(this,p));return e.all(d)},s.prototype.computeXysRadians=function(e,t,r){var a=c(this,e,t);if(!(a<0)){var o=a/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(n(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),n(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){n(r)?(r.x=0,r.y=0,r.s=0):r=new i(0,0,0);var p,E,y=a-s*this._stepSizeDays,m=this._work,_=this._denominators,T=this._coef,v=this._xTable;for(p=0;p<=u;++p)m[p]=y-v[p];for(p=0;p<=u;++p){for(T[p]=1,E=0;E<=u;++E)E!==p&&(T[p]*=m[E]);T[p]*=_[p];var R=3*(s+p);r.x+=T[p]*d[R++],r.y+=T[p]*d[R++],r.s+=T[p]*d[R]}return r}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function i(t,r,n){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(n,0)}return i.fromQuaternion=function(e,r){t(r)||(r=new i);var n=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(s,u),r.roll=Math.atan2(o,a),r.pitch=-Math.asin(n),r},i.fromDegrees=function(e,r,a,o){return t(o)||(o=new i),o.heading=e*n.RADIANS_PER_DEGREE,o.pitch=r*n.RADIANS_PER_DEGREE,o.roll=a*n.RADIANS_PER_DEGREE,o},i.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},i.equalsEpsilon=function(e,r,i,a){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,i,a)&&n.equalsEpsilon(e.pitch,r.pitch,i,a)&&n.equalsEpsilon(e.roll,r.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(e,t,n,i){this.x=r(e,0),this.y=r(t,0),this.z=r(n,0),this.w=r(i,0)}var f=new e;l.fromAxisAngle=function(t,r,i){var a=r/2,o=Math.sin(a);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(a);return n(i)?(i.x=u,i.y=s,i.z=c,i.w=h,i):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var r,i,a,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],p=e[c.COLUMN2ROW2],E=s+f+p;if(E>0)r=Math.sqrt(E+1),u=.5*r,r=.5/r,i=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*r,a=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*r,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*r;else{var y=h,m=0;f>s&&(m=1),p>s&&p>f&&(m=2);var _=y[m],T=y[_];r=Math.sqrt(e[c.getElementIndex(m,m)]-e[c.getElementIndex(_,_)]-e[c.getElementIndex(T,T)]+1);var v=d;v[m]=.5*r,r=.5/r,u=(e[c.getElementIndex(T,_)]-e[c.getElementIndex(_,T)])*r,v[_]=(e[c.getElementIndex(_,m)]+e[c.getElementIndex(m,_)])*r,v[T]=(e[c.getElementIndex(T,m)]+e[c.getElementIndex(m,T)])*r,i=-v[0],a=-v[1],o=-v[2]}return n(t)?(t.x=i,t.y=a,t.z=o,t.w=u,t):new l(i,a,o,u)};var p=new l,E=new l,y=new l,m=new l;l.fromHeadingPitchRoll=function(t,r,n,a){var o;return t instanceof u?(o=t,a=r):(i("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,r,n)),m=l.fromAxisAngle(e.UNIT_X,o.roll,p),y=l.fromAxisAngle(e.UNIT_Y,-o.pitch,a),a=l.multiply(y,m,y),E=l.fromAxisAngle(e.UNIT_Z,-o.heading,p),l.multiply(E,a,a)};var _=new e,T=new e,v=new l,R=new l,A=new l;l.packedLength=4,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},l.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new l),i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,r,n){l.unpack(e,4*r,A),l.conjugate(A,A);for(var i=0,a=r-t+1;i<a;i++){var o=3*i;l.unpack(e,4*(t+i),v),l.multiply(v,A,v),v.w<0&&l.negate(v,v),l.computeAxis(v,_);var u=l.computeAngle(v);n[o]=_.x*u,n[o+1]=_.y*u,n[o+2]=_.z*u}},l.unpackInterpolationResult=function(t,r,i,a,o){n(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(r,4*a,R),0===u?l.clone(l.IDENTITY,v):l.fromAxisAngle(T,u,v),l.multiply(v,R,o)},l.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var r=1/l.magnitude(e),n=e.x*r,i=e.y*r,a=e.z*r,o=e.w*r;return t.x=n,t.y=i,t.z=a,t.w=o,t},l.inverse=function(e,t){var r=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/r,t)},l.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},l.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,r){var n=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+n*l+i*c-a*s,h=o*s-n*c+i*l+a*u,d=o*c+n*s-i*u+a*l,p=o*l-n*u-i*s-a*c;return r.x=f,r.y=h,r.z=d,r.w=p,r},l.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},l.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},l.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var S=new l;l.lerp=function(e,t,r,n){return S=l.multiplyByScalar(t,r,S),n=l.multiplyByScalar(e,1-r,n),l.add(S,n,n)};var g=new l,N=new l,O=new l;l.slerp=function(e,t,r,n){var i=l.dot(e,t),a=t;if(i<0&&(i=-i,a=g=l.negate(t,g)),1-i<s.EPSILON6)return l.lerp(e,a,r,n);var o=Math.acos(i);return N=l.multiplyByScalar(e,Math.sin((1-r)*o),N),O=l.multiplyByScalar(a,Math.sin(r*o),O),n=l.add(N,O,n),l.multiplyByScalar(n,1/Math.sin(o),n)},l.log=function(t,r){var n=s.acosClamped(t.w),i=0;return 0!==n&&(i=n/Math.sin(n)),e.multiplyByScalar(t,i,r)},l.exp=function(t,r){var n=e.magnitude(t),i=0;return 0!==n&&(i=Math.sin(n)/n),r.x=t.x*i,r.y=t.y*i,r.z=t.z*i,r.w=Math.cos(n),r};var x=new e,I=new e,w=new l,M=new l;l.computeInnerQuadrangle=function(t,r,n,i){var a=l.conjugate(r,w);l.multiply(a,n,M);var o=l.log(M,x);l.multiply(a,t,M);var u=l.log(M,I);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(r,w,i)},l.squad=function(e,t,r,n,i,a){var o=l.slerp(e,t,i,w),u=l.slerp(r,n,i,M);return l.slerp(o,u,2*i*(1-i),a)};for(var C=new l,P=1.9011074535173003,D=a.supportsTypedArrays()?new Float32Array(8):[],L=a.supportsTypedArrays()?new Float32Array(8):[],U=a.supportsTypedArrays()?new Float32Array(8):[],b=a.supportsTypedArrays()?new Float32Array(8):[],F=0;F<7;++F){var z=F+1,B=2*z+1;D[F]=1/(z*B),L[F]=z/B}return D[7]=P/136,L[7]=8*P/17,l.fastSlerp=function(e,t,r,n){var i,a=l.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-r,s=r*r,c=u*u,f=7;f>=0;--f)U[f]=(D[f]*s-L[f])*o,b[f]=(D[f]*c-L[f])*o;var h=i*r*(1+U[0]*(1+U[1]*(1+U[2]*(1+U[3]*(1+U[4]*(1+U[5]*(1+U[6]*(1+U[7])))))))),d=u*(1+b[0]*(1+b[1]*(1+b[2]*(1+b[3]*(1+b[4]*(1+b[5]*(1+b[6]*(1+b[7])))))))),p=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,h,n),l.add(p,n,n)},l.fastSquad=function(e,t,r,n,i,a){var o=l.fastSlerp(e,t,i,w),u=l.fastSlerp(r,n,i,M);return l.fastSlerp(o,u,2*i*(1-i),a)},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,E,y,m,_,T,v){"use strict";var R={},A={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},S={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},g={},N={east:new r,north:new r,up:new r,west:new r,south:new r,down:new r},O=new r,x=new r,I=new r;R.localFrameToFixedFrameGenerator=function(e,t){if(!A.hasOwnProperty(e)||!A[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var n,i=A[e][t],a=e+t;return u(g[a])?n=g[a]:(n=function(n,a,s){if(u(s)||(s=new _),y.equalsEpsilon(n.x,0,y.EPSILON14)&&y.equalsEpsilon(n.y,0,y.EPSILON14)){var c=y.sign(n.z);r.unpack(S[e],0,O),"east"!==e&&"west"!==e&&r.multiplyByScalar(O,c,O),r.unpack(S[t],0,x),"east"!==t&&"west"!==t&&r.multiplyByScalar(x,c,x),r.unpack(S[i],0,I),"east"!==i&&"west"!==i&&r.multiplyByScalar(I,c,I)}else{a=o(a,h.WGS84),a.geodeticSurfaceNormal(n,N.up);var l=N.up,f=N.east;f.x=-n.y,f.y=n.x,f.z=0,r.normalize(f,N.east),r.cross(l,f,N.north),r.multiplyByScalar(N.up,-1,N.down),r.multiplyByScalar(N.east,-1,N.west),r.multiplyByScalar(N.north,-1,N.south),O=N[e],x=N[t],I=N[i]}return s[0]=O.x,s[1]=O.y,s[2]=O.z,s[3]=0,s[4]=x.x,s[5]=x.y,s[6]=x.z,s[7]=0,s[8]=I.x,s[9]=I.y,s[10]=I.z,s[11]=0,s[12]=n.x,s[13]=n.y,s[14]=n.z,s[15]=1,s},g[a]=n),n},R.eastNorthUpToFixedFrame=R.localFrameToFixedFrameGenerator("east","north"),R.northEastDownToFixedFrame=R.localFrameToFixedFrameGenerator("north","east"),R.northUpEastToFixedFrame=R.localFrameToFixedFrameGenerator("north","up"),R.northWestUpToFixedFrame=R.localFrameToFixedFrameGenerator("north","west");var w=new T,M=new r(1,1,1),C=new _;R.headingPitchRollToFixedFrame=function(e,t,n,i,a){i instanceof _&&(a=i,i=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),i=o(i,R.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,w),c=_.fromTranslationQuaternionRotationScale(r.ZERO,u,M,C);return a=i(e,n,a),_.multiply(a,c,a)};var P=new _,D=new m;R.headingPitchRollQuaternion=function(e,t,r,n,i){n instanceof T&&(i=n,n=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var a=R.headingPitchRollToFixedFrame(e,t,r,n,P),o=_.getRotation(a,D);return T.fromRotationMatrix(o,i)};var L=24110.54841,U=8640184.812866,b=.093104,F=-62e-7,z=1.1772758384668e-19,B=72921158553e-15,G=y.TWO_PI/86400,q=new E;R.computeTemeToPseudoFixedMatrix=function(e,t){q=E.addSeconds(e,-E.computeTaiMinusUtc(e),q);var r,n=q.dayNumber,i=q.secondsOfDay,a=n-2451545;r=i>=43200?(a+.5)/v.DAYS_PER_JULIAN_CENTURY:(a-.5)/v.DAYS_PER_JULIAN_CENTURY;var o=L+r*(U+r*(b+r*F)),s=o*G%y.TWO_PI,c=B+z*(n-2451545.5),l=(i+.5*v.SECONDS_PER_DAY)%v.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;R.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+W,i=t.stop.dayNumber,a=t.stop.secondsOfDay+W,o=R.iau2006XysData.preload(r,n,i,a),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new m);var r=R.computeFixedToIcrfMatrix(e,t);if(u(r))return m.transpose(r,t)};var V=new p(0,0,0),H=new f(0,0,0,0,0,0),Y=new m,k=new m;R.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new m);var r=R.earthOrientationParameters.compute(e,H);if(u(r)){var n=e.dayNumber,i=e.secondsOfDay+W,a=R.iau2006XysData.computeXysRadians(n,i,V);if(u(a)){var o=a.x+r.xPoleOffset,s=a.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=m.fromRotationZ(-a.s,k),h=m.multiply(l,f,Y),d=e.dayNumber,p=e.secondsOfDay-E.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=d-2451545,T=p/v.SECONDS_PER_DAY,A=.779057273264+T+.00273781191135448*(_+T);A=A%1*y.TWO_PI;var S=m.fromRotationZ(A,k),g=m.multiply(h,S,Y),N=Math.cos(r.xPoleWander),O=Math.cos(r.yPoleWander),x=Math.sin(r.xPoleWander),I=Math.sin(r.yPoleWander),w=n-X+i/v.SECONDS_PER_DAY;w/=36525;var M=-47e-6*w*y.RADIANS_PER_DEGREE/3600,C=Math.cos(M),P=Math.sin(M),D=k;return D[0]=N*C,D[1]=N*P,D[2]=x,D[3]=-O*P+I*x*C,D[4]=O*C+I*x*P,D[5]=-I*N,D[6]=-I*P-O*x*C,D[7]=I*C-O*x*P,D[8]=O*N,m.multiply(g,D,t)}}};var Z=new n;R.pointToWindowCoordinates=function(e,t,r,n){return n=R.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},R.pointToGLWindowCoordinates=function(e,r,i,a){u(a)||(a=new t);var o=Z;return _.multiplyByVector(e,n.fromElements(i.x,i.y,i.z,1,o),o),n.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(r,o,o),t.fromCartesian4(o,a)};var j=new r,K=new r,J=new r;R.rotationMatrixFromPositionVelocity=function(e,t,n,i){var a=o(n,h.WGS84).geodeticSurfaceNormal(e,j),s=r.cross(t,a,K);r.equalsEpsilon(s,r.ZERO,y.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var c=r.cross(s,t,J);return r.cross(t,c,s),r.negate(s,s),u(i)||(i=new m),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=s.x,i[4]=s.y,i[5]=s.z,i[6]=c.x,i[7]=c.y,i[8]=c.z,i};var Q=new i,$=new r,ee=new r,te=new n,re=new n,ne=new n,ie=new n,ae=new n,oe=new _,ue=new _;R.basisTo2D=function(e,t,i){var a=e.ellipsoid,o=_.getColumn(t,3,te),u=a.cartesianToCartographic(o,Q),s=R.eastNorthUpToFixedFrame(o,a,oe),c=_.inverseTransformation(s,ue),l=e.project(u,$),f=re;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=_.getColumn(t,0,ee),d=r.magnitude(h),p=_.multiplyByVector(c,h,ne);n.fromElements(p.z,p.x,p.y,0,p);var E=_.getColumn(t,1,ee),y=r.magnitude(E),m=_.multiplyByVector(c,E,ie);n.fromElements(m.z,m.x,m.y,0,m);var T=_.getColumn(t,2,ee),v=r.magnitude(T),A=ae;return r.cross(p,m,A),r.normalize(A,A),r.cross(m,A,p),r.normalize(p,p),r.cross(A,p,m),r.normalize(m,m),r.multiplyByScalar(p,d,p),r.multiplyByScalar(m,y,m),r.multiplyByScalar(A,v,A),_.setColumn(i,0,p,i),_.setColumn(i,1,m,i),_.setColumn(i,2,A,i),_.setColumn(i,3,f,i),i};var se=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return R.wgs84To2DModelMatrix=function(e,t,r){var n=e.ellipsoid,i=R.eastNorthUpToFixedFrame(t,n,oe),a=_.inverseTransformation(i,ue),o=n.cartesianToCartographic(t,Q),u=e.project(o,$),s=re;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=_.fromTranslation(s,oe);return _.multiply(se,a,r),_.multiply(c,r,r),r},R}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d){"use strict";function p(e,t){t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var n=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(l.getColumn(n,0,E)),this._yAxis=r.fromCartesian4(l.getColumn(n,1,E));var a=r.fromCartesian4(l.getColumn(n,2,E));this._plane=f.fromPointNormal(e,a)}var E=new n;o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var y=new e;p.fromPoints=function(t,r){var n=e.fromPoints(t,y);return new p(n.center,r)};var m=new h,_=new r;p.prototype.projectPointOntoPlane=function(e,n){var i=m;i.origin=e,r.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,_);if(a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,_)),a(o)){var u=r.subtract(o,this._origin,o),s=r.dot(this._xAxis,u),l=r.dot(this._yAxis,u);return a(n)?(n.x=s,n.y=l,n):new t(s,l)}},p.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var r=0,n=e.length,i=0;i<n;i++){var o=this.projectPointOntoPlane(e[i],t[r]);a(o)&&(t[r]=o,r++)}return t.length=r,t},p.prototype.projectPointToNearestOnPlane=function(e,n){a(n)||(n=new t);var i=m;i.origin=e,r.clone(this._plane.normal,i.direction);var o=c.rayPlane(i,this._plane,_);a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,_));var u=r.subtract(o,this._origin,o),s=r.dot(this._xAxis,u),l=r.dot(this._yAxis,u);return n.x=s,n.y=l,n},p.prototype.projectPointsToNearestOnPlane=function(e,t){a(t)||(t=[]);var r=e.length;t.length=r;for(var n=0;n<r;n++)t[n]=this.projectPointToNearestOnPlane(e[n],t[n]);return t};var T=new r;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var n=e.length;a(t)?t.length=n:t=new Array(n);for(var i=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<n;++l){var f=e[l];r.multiplyByScalar(u,f.x,c),a(t[l])||(t[l]=new r);var h=r.add(o,c,t[l]);r.multiplyByScalar(s,f.y,c),r.add(h,c,h),i.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var i=e.attributes[n],a=i.values.length/i.componentsPerAttribute;r=a}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n,i){"use strict";var a={};a.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,a=r.y;r.x=(1-Math.abs(a))*i.signNotZero(n),r.y=(1-Math.abs(n))*i.signNotZero(a)}return r.x=i.toSNorm(r.x,t),r.y=i.toSNorm(r.y,t),r},a.octEncode=function(e,t){return a.octEncodeInRange(e,255,t)},a.octDecodeInRange=function(e,r,n,a){if(a.x=i.fromSNorm(e,n),a.y=i.fromSNorm(r,n),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},a.octDecode=function(e,t,r){return a.octDecodeInRange(e,t,255,r)},a.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return a.octEncodeFloat=function(e){return a.octEncode(e,o),a.octPackFloat(o)},a.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),i=256*(r-n);return a.octDecode(n,i,t)},a.octPack=function(e,t,r,n){var i=a.octEncodeFloat(e),u=a.octEncodeFloat(t),s=a.octEncode(r,o);return n.x=65536*s.x+i,n.y=65536*s.y+u,n},a.octUnpack=function(e,t,r,n){var i=e.x/65536,o=Math.floor(i),u=65536*(i-o);i=e.y/65536;var s=Math.floor(i),c=65536*(i-s);a.octDecodeFloat(u,t),a.octDecodeFloat(c,r),a.octDecode(o,s,n)},a.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},a.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},a}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(n,i,s,c,l){r(l)||(l=new t);var f,h,d,p,E,y,m,_;r(i.z)?(f=t.subtract(s,i,a),h=t.subtract(c,i,o),d=t.subtract(n,i,u),p=t.dot(f,f),E=t.dot(f,h),y=t.dot(f,d),m=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,i,a),h=e.subtract(c,i,o),d=e.subtract(n,i,u),p=e.dot(f,f),E=e.dot(f,h),y=e.dot(f,d),m=e.dot(h,h),_=e.dot(h,d));var T=1/(p*m-E*E);return l.y=(m*y-E*_)*T,l.z=(p*_-E*y)*T,l.x=1-l.y-l.z,l}var a=new t,o=new t,u=new t;return i}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var i={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var a=r.high,o=r.low;return n.encode(e.x,i),a.x=i.high,o.x=i.low,n.encode(e.y,i),a.y=i.high,o.y=i.low,n.encode(e.z,i),a.z=i.high,o.z=i.low,r};var a=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,a);var i=a.high,o=a.low;t[r]=i.x,t[r+1]=i.y,t[r+2]=i.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,r,i){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,i):new Uint16Array(t,r,i)},r(a)}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,i=r.maximumIndex,a=e(r.cacheSize,24),o=n.length;if(!t(i)){i=0;for(var u=0,s=n[u];u<o;)s>i&&(i=s),++u,s=n[u]}for(var c=[],l=0;l<i+1;l++)c[l]=0;for(var f=a+1,h=0;h<o;++h)f-c[n[h]]>a&&(c[n[h]]=f,++f);return(f-a+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var i=t[t.length-1];if(t.splice(t.length-1,1),e[i].numLiveTriangles>0)return i}for(;a<n;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}function i(e,t,r,i,a,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var h=r[f];i[h].numLiveTriangles&&(s=0,a-i[h].timeStamp+2*i[h].numLiveTriangles<=t&&(s=a-i[h].timeStamp),(s>l||l===-1)&&(l=s,c=h)),++f}return c===-1?n(i,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var a,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,f=0,h=o[f],d=c;if(t(u))l=u+1;else{for(;f<d;)h>l&&(l=h),++f,h=o[f];if(l===-1)return 0;++l}for(var p=[],E=0;E<l;E++)p[E]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var y=0;f<d;)p[o[f]].vertexTriangles.push(y),++p[o[f]].numLiveTriangles,p[o[f+1]].vertexTriangles.push(y),++p[o[f+1]].numLiveTriangles,p[o[f+2]].vertexTriangles.push(y),++p[o[f+2]].numLiveTriangles,++y,f+=3;var m=0,_=s+1;a=1;var T,v,R=[],A=[],S=0,g=[],N=c/3,O=[];for(E=0;E<N;E++)O[E]=!1;for(var x,I;m!==-1;){R=[],v=p[m],I=v.vertexTriangles.length;for(var w=0;w<I;++w)if(y=v.vertexTriangles[w],!O[y]){O[y]=!0,f=y+y+y;for(var M=0;M<3;++M)x=o[f],R.push(x),A.push(x),g[S]=x,++S,T=p[x],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}m=i(o,s,R,p,_,A,l)}return g},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,E,y,m,_,T,v,R,A,S,g){"use strict";function N(e,t,r,n,i){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=i,e[t++]=i,e[t]=r}function O(e){for(var t=e.length,r=t/3*6,n=y.createTypedArray(t,r),i=0,a=0;a<t;a+=3,i+=6)N(n,i,e[a],e[a+1],e[a+2]);return n}function x(e){var t=e.length;if(t>=3){var r=6*(t-2),n=y.createTypedArray(t,r);N(n,0,e[0],e[1],e[2]);for(var i=6,a=3;a<t;++a,i+=6)N(n,i,e[a-1],e[a],e[a-2]);return n}return new Uint16Array}function I(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=y.createTypedArray(t,r),i=e[0],a=0,o=1;o<t;++o,a+=6)N(n,a,i,e[o],e[o+1]);return n}return new Uint16Array}function w(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new p({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function M(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var i=t[n],a=0;a<i.componentsPerAttribute;++a)e[n].values.push(i.values[r*i.componentsPerAttribute+a])}function C(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;a<n;a+=3)i.unpack(r,a,ae),R.multiplyByPoint(e,ae,ae),i.pack(ae,r,a)}function P(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;a<n;a+=3)i.unpack(r,a,ae),v.multiplyByVector(e,ae,ae),ae=i.normalize(ae,ae),i.pack(ae,r,a)}function D(e,t){var r,n=e.length,i={},a=e[0][t].attributes;for(r in a)if(a.hasOwnProperty(r)&&c(a[r])&&c(a[r].values)){for(var o=a[r],s=o.values.length,l=!0,f=1;f<n;++f){var h=e[f][t].attributes[r];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(i[r]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return i}function L(e,t){var n,a,o,u,s,l,f,h=e.length,p=(e[0].modelMatrix,c(e[0][t].indices)),E=e[0][t].primitiveType,m=D(e,t);for(n in m)if(m.hasOwnProperty(n))for(s=m[n].values,u=0,a=0;a<h;++a)for(l=e[a][t].attributes[n].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(p){var T=0;for(a=0;a<h;++a)T+=e[a][t].indices.length;var v=d.computeNumberOfVertices(new d({attributes:m,primitiveType:S.POINTS})),R=y.createTypedArray(v,T),A=0,g=0;for(a=0;a<h;++a){var N=e[a][t].indices,O=N.length;for(u=0;u<O;++u)R[A++]=g+N[u];g+=d.computeNumberOfVertices(e[a][t])}_=R}var x,I=new i,w=0;for(a=0;a<h;++a){if(x=e[a][t].boundingSphere,!c(x)){I=void 0;break}i.add(x.center,I,I)}if(c(I))for(i.divideByScalar(I,h,I),a=0;a<h;++a){x=e[a][t].boundingSphere;var M=i.magnitude(i.subtract(x.center,I,se))+x.radius;M>w&&(w=M)}return new d({attributes:m,indices:_,primitiveType:E,boundingSphere:c(I)?new r(I,w):void 0})}function U(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function b(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,i=3;i<t;++i)r[n++]=i-1,r[n++]=0,r[n++]=i;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function F(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,i=3;i<t-1;i+=2)r[n++]=i,r[n++]=i-1,r[n++]=i+1,i+2<t&&(r[n++]=i,r[n++]=i+1,r[n++]=i+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function z(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function B(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,i=2;i<t;++i)r[n++]=i-1,r[n++]=i;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,i=2;i<t;++i)r[n++]=i-1,r[n++]=i;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return b(e);case S.TRIANGLE_STRIP:return F(e);case S.TRIANGLES:return U(e);case S.LINE_STRIP:return B(e);case S.LINE_LOOP:return G(e);case S.LINES:return z(e)}return e}function W(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return W(e,e.y<0),W(t,t.y<0),void W(r,r.y<0);var n,i=Math.abs(e.y),a=Math.abs(t.y),o=Math.abs(r.y);n=i>a?i>o?T.sign(e.y):T.sign(r.y):a>o?T.sign(t.y):T.sign(r.y);var u=n<0;W(e,u),W(t,u),W(r,u)}function V(e,t,r,n){i.add(e,i.multiplyByScalar(i.subtract(t,e,Re),e.y/(e.y-t.y),Re),r),i.clone(r,n),W(r,!0),W(n,!1)}function H(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){X(e,t,r);var n=e.y<0,i=t.y<0,a=r.y<0,o=0;o+=n?1:0,o+=i?1:0,o+=a?1:0;var u=Oe.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(V(e,t,Ae,ge),V(e,r,Se,Ne),u[0]=0,u[3]=1,u[4]=2,u[6]=1):i?(V(t,r,Ae,ge),V(t,e,Se,Ne),u[0]=1,u[3]=2,u[4]=0,u[6]=2):a&&(V(r,e,Ae,ge),V(r,t,Se,Ne),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?i?a||(V(r,e,Ae,ge),V(r,t,Se,Ne),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(V(t,r,Ae,ge),V(t,e,Se,Ne),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(V(e,t,Ae,ge),V(e,r,Se,Ne),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Oe.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=Se,s[5]=ge,s[6]=Ne,s.length=7),Oe}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var i in n)if(n.hasOwnProperty(i)&&c(n[i])&&c(n[i].values)){var a=n[i];a.values=u.createTypedArray(a.componentDatatype,a.values)}var o=d.computeNumberOfVertices(e);return e.indices=y.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function k(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){ -var i=t[n];r[n]=new p({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new d({attributes:r,indices:[],primitiveType:e.primitiveType})}function Z(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r,e.geometry=void 0)}function j(e,r,a,o,u,s,l,f,h,d,p,E){if(c(s)||c(l)||c(f)||c(h)||c(d)){var y=i.fromArray(u,3*e,xe),m=i.fromArray(u,3*r,Ie),_=i.fromArray(u,3*a,we),T=t(o,y,m,_,Me);if(c(s)){var v=i.fromArray(s,3*e,xe),R=i.fromArray(s,3*r,Ie),A=i.fromArray(s,3*a,we);i.multiplyByScalar(v,T.x,v),i.multiplyByScalar(R,T.y,R),i.multiplyByScalar(A,T.z,A);var S=i.add(v,R,v);i.add(S,A,S),i.normalize(S,S),i.pack(S,p.normal.values,3*E)}if(c(d)){var g=i.fromArray(d,3*e,xe),N=i.fromArray(d,3*r,Ie),O=i.fromArray(d,3*a,we);i.multiplyByScalar(g,T.x,g),i.multiplyByScalar(N,T.y,N),i.multiplyByScalar(O,T.z,O);var x;i.equals(g,i.ZERO)&&i.equals(N,i.ZERO)&&i.equals(O,i.ZERO)?(x=xe,x.x=0,x.y=0,x.z=0):(x=i.add(g,N,g),i.add(x,O,x),i.normalize(x,x)),i.pack(x,p.extrudeDirection.values,3*E)}if(c(l)){var I=i.fromArray(l,3*e,xe),w=i.fromArray(l,3*r,Ie),M=i.fromArray(l,3*a,we);i.multiplyByScalar(I,T.x,I),i.multiplyByScalar(w,T.y,w),i.multiplyByScalar(M,T.z,M);var C=i.add(I,w,I);i.add(C,M,C),i.normalize(C,C),i.pack(C,p.tangent.values,3*E)}if(c(f)){var P=i.fromArray(f,3*e,xe),D=i.fromArray(f,3*r,Ie),L=i.fromArray(f,3*a,we);i.multiplyByScalar(P,T.x,P),i.multiplyByScalar(D,T.y,D),i.multiplyByScalar(L,T.z,L);var U=i.add(P,D,P);i.add(U,L,U),i.normalize(U,U),i.pack(U,p.bitangent.values,3*E)}if(c(h)){var b=n.fromArray(h,2*e,Ce),F=n.fromArray(h,2*r,Pe),z=n.fromArray(h,2*a,De);n.multiplyByScalar(b,T.x,b),n.multiplyByScalar(F,T.y,F),n.multiplyByScalar(z,T.z,z);var B=n.add(b,F,b);n.add(B,z,B),n.pack(B,p.st.values,2*E)}}}function K(e,t,r,n,i,a){var o=e.position.values.length/3;if(i!==-1){var u=n[i],s=r[u];return s===-1?(r[u]=o,e.position.values.push(a.x,a.y,a.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(a.x,a.y,a.z),t.push(o),o}function J(e){var t,r,n,a,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,h=c(s.bitangent)?s.bitangent.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,p=c(s.st)?s.st.values:void 0,E=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,y=u.indices,m=k(u),_=k(u),T=[];T.length=l.length/3;var v=[];for(v.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,v[o]=-1;var R=y.length;for(o=0;o<R;o+=3){var A=y[o],S=y[o+1],g=y[o+2],N=i.fromArray(l,3*A),O=i.fromArray(l,3*S),x=i.fromArray(l,3*g),I=H(N,O,x);if(c(I)&&I.positions.length>3)for(var w=I.positions,M=I.indices,C=M.length,P=0;P<C;++P){var D=M[P],L=w[D];L.y<0?(t=_.attributes,r=_.indices,n=T):(t=m.attributes,r=m.indices,n=v),a=K(t,r,n,y,D<3?o+D:-1,L),j(A,S,g,L,l,f,d,h,p,E,t,a)}else c(I)&&(N=I.positions[0],O=I.positions[1],x=I.positions[2]),N.y<0?(t=_.attributes,r=_.indices,n=T):(t=m.attributes,r=m.indices,n=v),a=K(t,r,n,y,o,N),j(A,S,g,N,l,f,d,h,p,E,t,a),a=K(t,r,n,y,o+1,O),j(A,S,g,O,l,f,d,h,p,E,t,a),a=K(t,r,n,y,o+2,x),j(A,S,g,x,l,f,d,h,p,E,t,a)}Z(e,_,m)}function Q(e){var t,r=e.geometry,n=r.attributes,a=n.position.values,o=r.indices,u=k(r),s=k(r),l=o.length,f=[];f.length=a.length/3;var h=[];for(h.length=a.length/3,t=0;t<f.length;++t)f[t]=-1,h[t]=-1;for(t=0;t<l;t+=2){var d=o[t],p=o[t+1],E=i.fromArray(a,3*d,xe),y=i.fromArray(a,3*p,Ie);Math.abs(E.y)<T.EPSILON6&&(E.y<0?E.y=-T.EPSILON6:E.y=T.EPSILON6),Math.abs(y.y)<T.EPSILON6&&(y.y<0?y.y=-T.EPSILON6:y.y=T.EPSILON6);var m=u.attributes,v=u.indices,R=h,A=s.attributes,S=s.indices,g=f,N=_.lineSegmentPlane(E,y,Le,we);if(c(N)){var O=i.multiplyByScalar(i.UNIT_Y,5*T.EPSILON9,Ue);E.y<0&&(i.negate(O,O),m=s.attributes,v=s.indices,R=f,A=u.attributes,S=u.indices,g=h);var x=i.add(N,O,be);K(m,v,R,o,t,E),K(m,v,R,o,-1,x),i.negate(O,O),i.add(N,O,x),K(A,S,g,o,-1,x),K(A,S,g,o,t+1,y)}else{var I,w,M;E.y<0?(I=s.attributes,w=s.indices,M=f):(I=u.attributes,w=u.indices,M=h),K(I,w,M,o,t,E),K(I,w,M,o,t+1,y)}}Z(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,a=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=i.unpack(r,u,Be);if(!(s.x>0)){var c=i.unpack(n,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):i.pack(s,n,u));var l=i.unpack(a,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(a[u]=r[u+3],a[u+1]=r[u+4],a[u+2]=r[u+5]):i.pack(s,a,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,h=s.nextPosition.values,d=s.expandAndWidth.values,p=c(s.st)?s.st.values:void 0,E=c(s.color)?s.color.values:void 0,y=k(u),m=k(u),v=!1,R=l.length/3;for(t=0;t<R;t+=4){var A=t,S=t+2,g=i.fromArray(l,3*A,Be),N=i.fromArray(l,3*S,Ge);if(Math.abs(g.y)<ke)for(g.y=ke*(N.y<0?-1:1),l[3*t+1]=g.y,l[3*(t+1)+1]=g.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(N.y)<ke)for(N.y=ke*(g.y<0?-1:1),l[3*(t+2)+1]=N.y,l[3*(t+3)+1]=N.y,r=3*A;r<3*A+12;r+=3)h[r]=l[3*(t+2)],h[r+1]=l[3*(t+2)+1],h[r+2]=l[3*(t+2)+2];var O=y.attributes,x=y.indices,I=m.attributes,w=m.indices,M=_.lineSegmentPlane(g,N,Le,We);if(c(M)){v=!0;var C=i.multiplyByScalar(i.UNIT_Y,Ye,Xe);g.y<0&&(i.negate(C,C),O=m.attributes,x=m.indices,I=y.attributes,w=y.indices);var P=i.add(M,C,Ve);O.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),O.position.values.push(P.x,P.y,P.z),O.position.values.push(P.x,P.y,P.z),O.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),O.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),O.prevPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),O.nextPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(P.x,P.y,P.z),i.negate(C,C),i.add(M,C,P),I.position.values.push(P.x,P.y,P.z),I.position.values.push(P.x,P.y,P.z),I.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.prevPosition.values.push(P.x,P.y,P.z),I.prevPosition.values.push(P.x,P.y,P.z),I.prevPosition.values.push(P.x,P.y,P.z),I.prevPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.nextPosition.values.push(h[3*S],h[3*S+1],h[3*S+2]),I.nextPosition.values.push(h[3*S+3],h[3*S+4],h[3*S+5]);var D=n.fromArray(d,2*A,Fe),L=Math.abs(D.y);O.expandAndWidth.values.push(-1,L,1,L),O.expandAndWidth.values.push(-1,-L,1,-L),I.expandAndWidth.values.push(-1,L,1,L),I.expandAndWidth.values.push(-1,-L,1,-L);var U=i.magnitudeSquared(i.subtract(M,g,qe));if(U/=i.magnitudeSquared(i.subtract(N,g,qe)),c(E)){var b=a.fromArray(E,4*A,He),F=a.fromArray(E,4*S,He),z=T.lerp(b.x,F.x,U),B=T.lerp(b.y,F.y,U),G=T.lerp(b.z,F.z,U),q=T.lerp(b.w,F.w,U);for(r=4*A;r<4*A+8;++r)O.color.values.push(E[r]);for(O.color.values.push(z,B,G,q),O.color.values.push(z,B,G,q),I.color.values.push(z,B,G,q),I.color.values.push(z,B,G,q),r=4*S;r<4*S+8;++r)I.color.values.push(E[r])}if(c(p)){var W=n.fromArray(p,2*A,Fe),X=n.fromArray(p,2*(t+3),ze),V=T.lerp(W.x,X.x,U);for(r=2*A;r<2*A+4;++r)O.st.values.push(p[r]);for(O.st.values.push(V,W.y),O.st.values.push(V,X.y),I.st.values.push(V,W.y),I.st.values.push(V,X.y),r=2*S;r<2*S+4;++r)I.st.values.push(p[r])}o=O.position.values.length/3-4,x.push(o,o+2,o+1),x.push(o+1,o+2,o+3),o=I.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3)}else{var H,Y;for(g.y<0?(H=m.attributes,Y=m.indices):(H=y.attributes,Y=y.indices),H.position.values.push(g.x,g.y,g.z),H.position.values.push(g.x,g.y,g.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),r=3*t;r<3*t+12;++r)H.prevPosition.values.push(f[r]),H.nextPosition.values.push(h[r]);for(r=2*t;r<2*t+8;++r)H.expandAndWidth.values.push(d[r]),c(p)&&H.st.values.push(p[r]);if(c(E))for(r=4*t;r<4*t+16;++r)H.color.values.push(E[r]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}v&&($(m),$(y)),Z(e,m,y)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=O(t);break;case S.TRIANGLE_STRIP:e.indices=x(t);break;case S.TRIANGLE_FAN:e.indices=I(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var i=e.attributes.position.values,a=e.attributes[t].values,o=i.length,l=new Float64Array(2*o),f=0,h=0;h<o;h+=3)l[f++]=i[h],l[f++]=i[h+1],l[f++]=i[h+2],l[f++]=i[h]+a[h]*n,l[f++]=i[h+1]+a[h+1]*n,l[f++]=i[h+2]+a[h+2]*n;var E,y=e.boundingSphere;return c(y)&&(E=new r(y.center,y.radius+n)),new d({attributes:{position:new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:E})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},a=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(i[u]=a++)}for(var s in n)n.hasOwnProperty(s)&&!c(i[s])&&(i[s]=a++);return i},te.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),i=0;i<t;i++)n[i]=-1;for(var a,o=r,s=o.length,l=y.createTypedArray(t,s),f=0,h=0,p=0;f<s;)a=n[o[f]],a!==-1?l[h]=a:(a=o[f],n[a]=p,l[h]=p,++p),++f,++h;e.indices=l;var E=e.attributes;for(var m in E)if(E.hasOwnProperty(m)&&c(E[m])&&c(E[m].values)){for(var _=E[m],T=_.values,v=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,p*R);v<t;){var S=n[v];if(S!==-1)for(i=0;i<R;i++)A[R*S+i]=T[R*v+i];++v}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,i=0,a=0;a<n;a++)r[a]>i&&(i=r[a]);e.indices=g.tipsify({indices:r,maximumIndex:i,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=d.computeNumberOfVertices(e);if(c(e.indices)&&r>=T.SIXTY_FOUR_KILOBYTES){var n,i=[],a=[],o=0,u=w(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var f=0;f<l;f+=n){for(var h=0;h<n;++h){var p=s[f+h],E=i[p];c(E)||(E=o++,i[p]=E,M(u,e.attributes,p)),a.push(E)}o+n>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],a=[],o=0,u=w(e.attributes))}0!==a.length&&t.push(new d({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new i,ne=new o;te.projectTo2D=function(e,t,r,n,a){var o=e.attributes[t];a=c(a)?a:new h;for(var s=a.ellipsoid,l=o.values,f=new Float64Array(l.length),d=0,E=0;E<l.length;E+=3){var y=i.fromArray(l,E,re),m=s.cartesianToCartographic(y,ne),_=a.project(m,re);f[d++]=_.x,f[d++]=_.y,f[d++]=_.z}return e.attributes[r]=o,e.attributes[n]=new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ie={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var i=e.attributes[t],a=i.values,o=a.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(a[l],ie),s[l]=ie.high,c[l]=ie.low;var h=i.componentsPerAttribute;return e.attributes[r]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[n]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};var ae=new i,oe=new R,ue=new v;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(R.equals(t,R.IDENTITY))return e;var n=e.geometry.attributes;C(t,n.position),C(t,n.prevPosition),C(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(R.inverse(t,oe),R.transpose(oe,oe),R.getRotation(oe,ue),P(ue,n.normal),P(ue,n.tangent),P(ue,n.bitangent));var i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=r.transform(i,t,i)),e.modelMatrix=R.clone(R.IDENTITY),e};var se=new i;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,i=0;i<n;++i){var a=e[i];c(a.geometry)?t.push(a):c(a.westHemisphereGeometry)&&c(a.eastHemisphereGeometry)&&r.push(a)}var o=[];return t.length>0&&o.push(L(t,"geometry")),r.length>0&&(o.push(L(r,"westHemisphereGeometry")),o.push(L(r,"eastHemisphereGeometry"))),o};var ce=new i,le=new i,fe=new i,he=new i;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,a=r.position.values.length/3,o=t.length,s=new Array(a),c=new Array(o/3),l=new Array(o),f=0;f<a;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;f<o;f+=3){var d=t[f],E=t[f+1],y=t[f+2],m=3*d,_=3*E,v=3*y;le.x=n[m],le.y=n[m+1],le.z=n[m+2],fe.x=n[_],fe.y=n[_+1],fe.z=n[_+2],he.x=n[v],he.y=n[v+1],he.z=n[v+2],s[d].count++,s[E].count++,s[y].count++,i.subtract(fe,le,fe),i.subtract(he,le,he),c[h]=i.cross(fe,he,new i),h++}var R=0;for(f=0;f<a;f++)s[f].indexOffset+=R,R+=s[f].count;h=0;var A;for(f=0;f<o;f+=3){A=s[t[f]];var S=A.indexOffset+A.currentCount;l[S]=h,A.currentCount++,A=s[t[f+1]],S=A.indexOffset+A.currentCount,l[S]=h,A.currentCount++,A=s[t[f+2]],S=A.indexOffset+A.currentCount,l[S]=h,A.currentCount++,h++}var g=new Float32Array(3*a);for(f=0;f<a;f++){var N=3*f;if(A=s[f],i.clone(i.ZERO,ce),A.count>0){for(h=0;h<A.count;h++)i.add(ce,c[l[A.indexOffset+h]],ce);i.equalsEpsilon(i.ZERO,ce,T.EPSILON10)&&i.clone(c[l[A.indexOffset]],ce)}i.equalsEpsilon(i.ZERO,ce,T.EPSILON10)&&(ce.z=1),i.normalize(ce,ce),g[N]=ce.x,g[N+1]=ce.y,g[N+2]=ce.z}return e.attributes.normal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:g}),e};var de=new i,pe=new i,Ee=new i;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,a=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,h,d;for(l=0;l<s;l+=3){var E=t[l],y=t[l+1],m=t[l+2];f=3*E,h=3*y,d=3*m;var _=2*E,T=2*y,v=2*m,R=r[f],A=r[f+1],S=r[f+2],g=a[_],N=a[_+1],O=a[T+1]-N,x=a[v+1]-N,I=1/((a[T]-g)*x-(a[v]-g)*O),w=(x*(r[h]-R)-O*(r[d]-R))*I,M=(x*(r[h+1]-A)-O*(r[d+1]-A))*I,C=(x*(r[h+2]-S)-O*(r[d+2]-S))*I;c[f]+=w,c[f+1]+=M,c[f+2]+=C,c[h]+=w,c[h+1]+=M,c[h+2]+=C,c[d]+=w,c[d+1]+=M,c[d+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,h=f+1,d=f+2;var L=i.fromArray(n,f,de),U=i.fromArray(c,f,Ee),b=i.dot(L,U);i.multiplyByScalar(L,b,pe),i.normalize(i.subtract(U,pe,U),U),P[f]=U.x,P[h]=U.y,P[d]=U.z,i.normalize(i.cross(L,U,U),U),D[f]=U.x,D[h]=U.y,D[d]=U.z}return e.attributes.tangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e};var ye=new n,me=new i,_e=new i,Te=new i,ve=new n;te.compressVertices=function(t){var r,a,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;a=s.length/3;var l=new Float32Array(2*a),f=0;for(r=0;r<a;++r)i.fromArray(s,3*r,me),i.equals(me,i.ZERO)?f+=2:(ve=e.octEncodeInRange(me,65535,ve),l[f++]=ve.x,l[f++]=ve.y);return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,d=t.attributes.st,E=c(h),y=c(d);if(!E&&!y)return t;var m,_,T,v,R=t.attributes.tangent,A=t.attributes.bitangent,S=c(R),g=c(A);E&&(m=h.values),y&&(_=d.values),S&&(T=R.values),g&&(v=A.values);var N=E?m.length:_.length,O=E?3:2;a=N/O;var x=a,I=y&&E?2:1;I+=S||g?1:0,x*=I;var w=new Float32Array(x),M=0;for(r=0;r<a;++r){y&&(n.fromArray(_,2*r,ye),w[M++]=e.compressTextureCoordinates(ye));var C=3*r;E&&c(T)&&c(v)?(i.fromArray(m,C,me),i.fromArray(T,C,_e),i.fromArray(v,C,Te),e.octPack(me,_e,Te,ye),w[M++]=ye.x,w[M++]=ye.y):(E&&(i.fromArray(m,C,me),w[M++]=e.octEncodeFloat(me)),S&&(i.fromArray(T,C,me),w[M++]=e.octEncodeFloat(me)),g&&(i.fromArray(v,C,me),w[M++]=e.octEncodeFloat(me)))}return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:I,values:w}),E&&delete t.attributes.normal,y&&delete t.attributes.st,g&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Re=new i,Ae=new i,Se=new i,ge=new i,Ne=new i,Oe={positions:new Array(7),indices:new Array(9)},xe=new i,Ie=new i,we=new i,Me=new i,Ce=new n,Pe=new n,De=new n,Le=A.fromPointNormal(i.ZERO,i.UNIT_Y),Ue=new i,be=new i,Fe=new n,ze=new n,Be=new i,Ge=new i,qe=new i,We=new i,Xe=new i,Ve=new i,He=new a,Ye=5*T.EPSILON9,ke=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var i=n.center.x-n.radius;if(i>0||r.intersectPlane(n,A.ORIGIN_ZX_PLANE)!==m.INTERSECTING)return e}if(t.geometryType!==E.NONE)switch(t.geometryType){case E.POLYLINES:ee(e);break;case E.TRIANGLES:J(e);break;case E.LINES:Q(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&Q(e);return e},te}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,r,i){i=i||2;var a=r&&r.length,o=a?r[0]*i:e.length,u=t(e,0,o,i,!0),c=[];if(!u)return c;var l,f,h,d,p,E,y;if(a&&(u=s(e,r,u,i)),e.length>80*i){l=h=e[0],f=d=e[1];for(var m=i;m<o;m+=i)p=e[m],E=e[m+1],p<l&&(l=p),E<f&&(f=E),p>h&&(h=p),E>d&&(d=E);y=Math.max(h-l,d-f)}return n(u,c,i,l,f,y),c}function t(e,t,r,n,i){var a,o;if(i===I(e,t,r,n)>0)for(a=t;a<r;a+=n)o=N(a,e[a],e[a+1],o);else for(a=r-n;a>=t;a-=n)o=N(a,e[a],e[a+1],o);return o&&T(o,o.next)&&(O(o),o=o.next),o}function r(e,t){if(!e)return e;t||(t=e);var r,n=e;do if(r=!1,n.steiner||!T(n,n.next)&&0!==_(n.prev,n,n.next))n=n.next;else{if(O(n),n=t=n.prev,n===n.next)return null;r=!0}while(r||n!==t);return t}function n(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var p,E,y=e;e.prev!==e.next;)if(p=e.prev,E=e.next,f?a(e,c,l,f):i(e))t.push(p.i/s),t.push(e.i/s),t.push(E.i/s),O(e),e=E.next,y=E.next;else if(e=E,e===y){d?1===d?(e=o(e,t,s),n(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):n(r(e),t,s,c,l,f,1);break}}}function i(e){var t=e.prev,r=e,n=e.next;if(_(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(y(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(e,t,r,n){var i=e.prev,a=e,o=e.next;if(_(i,a,o)>=0)return!1;for(var u=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,s=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=p(u,s,t,r,n),h=p(c,l,t,r,n),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&y(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&y(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!T(i,a)&&v(i,n,n.next,a)&&A(i,a)&&A(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),O(n),O(n.next),n=e=a),n=n.next}while(n!==e);return n}function u(e,t,i,a,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=g(s,c);return s=r(s,s.next),l=r(l,l.next),n(s,t,i,a,o,u),void n(l,t,i,a,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,n,i,a){var o,u,s,f,h,d=[];for(o=0,u=n.length;o<u;o++)s=n[o]*a,f=o<u-1?n[o+1]*a:e.length,h=t(e,s,f,a,!1),h===h.next&&(h.steiner=!0),d.push(E(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],i),i=r(i,i.next);return i}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var n=g(t,e);r(n,n.next)}}function f(e,t){var r,n=t,i=e.x,a=e.y,o=-(1/0);do{if(a<=n.y&&a>=n.next.y){var u=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(u<=i&&u>o){if(o=u,u===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===o)return r.prev;var s,c=r,l=r.x,f=r.y,h=1/0;for(n=r.next;n!==c;)i>=n.x&&n.x>=l&&y(a<f?i:o,a,l,f,a<f?o:i,a,n.x,n.y)&&(s=Math.abs(a-n.y)/(i-n.x),(s<h||s===h&&n.x>r.x)&&A(n,e)&&(r=n,h=s)),n=n.next;return r}function h(e,t,r,n){var i=e;do null===i.z&&(i.z=p(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,d(i)}function d(e){var t,r,n,i,a,o,u,s,c=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,u=0,t=0;t<c&&(u++,n=n.nextZ,n);t++);for(s=c;u>0||s>0&&n;)0===u?(i=n,n=n.nextZ,s--):0!==s&&n?r.z<=n.z?(i=r,r=r.nextZ,u--):(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1);return e}function p(e,t,r,n,i){return e=32767*(e-r)/i,t=32767*(t-n)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function E(e){var t=e,r=e;do t.x<r.x&&(r=t),t=t.next;while(t!==e);return r}function y(e,t,r,n,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(n-u)-(r-o)*(t-u)>=0&&(r-o)*(a-u)-(i-o)*(n-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&A(e,t)&&A(t,e)&&S(e,t)}function _(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function v(e,t,r,n){return!!(T(e,t)&&T(r,n)||T(e,n)&&T(r,t))||_(e,t,r)>0!=_(e,t,n)>0&&_(r,n,e)>0!=_(r,n,t)>0}function R(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&v(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function A(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function g(e,t){var r=new x(e.i,e.x,e.y),n=new x(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function N(e,t,r,n){var i=new x(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function O(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 x(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(e,t,r,n){for(var i=0,a=t,o=r-n;a<r;a+=n)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,r,n){var i=t&&t.length,a=i?t[0]*r:e.length,o=Math.abs(I(e,0,a,r));if(i)for(var u=0,s=t.length;u<s;u++){var c=t[u]*r,l=u<s-1?t[u+1]*r:e.length;o-=Math.abs(I(e,c,l,r))}var f=0;for(u=0;u<n.length;u+=3){var h=n[u]*r,d=n[u+1]*r,p=n[u+2]*r;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)r.vertices.push(e[i][a][o]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return e(r)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h){"use strict";var d=new r,p=new r,E={};E.computeArea2D=function(e){for(var t=e.length,r=0,n=t-1,i=0;i<t;n=i++){var a=e[n],o=e[i];r+=a.x*o.y-o.x*a.y}return.5*r},E.computeWindingOrder2D=function(e){var t=E.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},E.triangulate=function(r,n){var i=t.packArray(r);return e(i,n,2)};var y=new r,m=new r,_=new r,T=new r,v=new r,R=new r,A=new r;return E.computeSubdivision=function(e,t,o,u){u=i(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),p=t.length,E=new Array(3*p),S=0;for(h=0;h<p;h++){var g=t[h];E[S++]=g.x,E[S++]=g.y,E[S++]=g.z}for(var N=[],O={},x=e.maximumRadius,I=l.chordLength(u,x),w=I*I;d.length>0;){var M,C,P=d.pop(),D=d.pop(),L=d.pop(),U=r.fromArray(E,3*L,y),b=r.fromArray(E,3*D,m),F=r.fromArray(E,3*P,_),z=r.multiplyByScalar(r.normalize(U,T),x,T),B=r.multiplyByScalar(r.normalize(b,v),x,v),G=r.multiplyByScalar(r.normalize(F,R),x,R),q=r.magnitudeSquared(r.subtract(z,B,A)),W=r.magnitudeSquared(r.subtract(B,G,A)),X=r.magnitudeSquared(r.subtract(G,z,A)),V=Math.max(q,W,X);V>w?q===V?(M=Math.min(L,D)+" "+Math.max(L,D),h=O[M],a(h)||(C=r.add(U,b,A),r.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,O[M]=h),d.push(L,h,P),d.push(h,D,P)):W===V?(M=Math.min(D,P)+" "+Math.max(D,P),h=O[M],a(h)||(C=r.add(b,F,A),r.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,O[M]=h),d.push(D,h,L),d.push(h,P,L)):X===V&&(M=Math.min(P,L)+" "+Math.max(P,L),h=O[M],a(h)||(C=r.add(F,U,A),r.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,O[M]=h),d.push(P,h,D),d.push(h,L,D)):(N.push(L),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:E})},indices:N,primitiveType:f.TRIANGLES})},E.scaleToGeodeticHeight=function(e,t,n,o){n=i(n,u.WGS84);var s=d,c=p;if(t=i(t,0),o=i(o,!0),a(e))for(var l=e.length,f=0;f<l;f+=3)r.fromArray(e,f,c),o&&(c=n.scaleToGeodeticSurface(c,c)),0!==t&&(s=n.geodeticSurfaceNormal(c,s),r.multiplyByScalar(s,t,s),r.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},E}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,r=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,r}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,E){"use strict";function y(e,r,n,i){return t.subtract(r,e,_),t.multiplyByScalar(_,n/i,_),t.add(e,_,_),[_.x,_.y,_.z]}var m={};m.computeHierarchyPackedLength=function(e){for(var r=0,n=[e];n.length>0;){var a=n.pop();if(i(a)){r+=2;var o=a.positions,u=a.holes;if(i(o)&&(r+=o.length*t.packedLength),i(u))for(var s=u.length,c=0;c<s;++c)n.push(u[c])}}return r},m.packPolygonHierarchy=function(e,r,n){for(var a=[e];a.length>0;){var o=a.pop();if(i(o)){var u=o.positions,s=o.holes;if(r[n++]=i(u)?u.length:0,r[n++]=i(s)?s.length:0,i(u))for(var c=u.length,l=0;l<c;++l,n+=3)t.pack(u[l],r,n);if(i(s))for(var f=s.length,h=0;h<f;++h)a.push(s[h])}}return n},m.unpackPolygonHierarchy=function(e,r){for(var n=e[r++],i=e[r++],a=new Array(n),o=i>0?new Array(i):void 0,u=0;u<n;++u,r+=t.packedLength)a[u]=t.unpack(e,r);for(var s=0;s<i;++s)o[s]=m.unpackPolygonHierarchy(e,r),r=o[s].startingIndex,delete o[s].startingIndex;return{positions:a,holes:o,startingIndex:r}};var _=new t;m.subdivideLineCount=function(e,r,n){var i=t.distance(e,r),a=i/n,o=Math.max(0,Math.ceil(Math.log(a)/Math.log(2)));return Math.pow(2,o)},m.subdivideLine=function(e,r,n,a){var o=m.subdivideLineCount(e,r,n),u=t.distance(e,r),s=u/o;i(a)||(a=[]);var c=a;c.length=3*o;for(var l=0,f=0;f<o;f++){var h=y(e,r,f*s,u);c[l++]=h[0],c[l++]=h[1],c[l++]=h[2]}return c};var T=new t,v=new t,R=new t,A=new t;m.scaleToGeodeticHeightExtruded=function(e,r,o,u,s){u=n(u,a.WGS84);var c=T,l=v,f=R,h=A;if(i(e)&&i(e.attributes)&&i(e.attributes.position))for(var d=e.attributes.position.values,p=d.length/2,E=0;E<p;E+=3)t.fromArray(d,E,f),u.geodeticSurfaceNormal(f,c),h=u.scaleToGeodeticSurface(f,h),l=t.multiplyByScalar(c,o,l),l=t.add(h,l,l),d[E+p]=l.x,d[E+1+p]=l.y,d[E+2+p]=l.z,s&&(h=t.clone(f,h)),l=t.multiplyByScalar(c,r,l),l=t.add(h,l,l),d[E]=l.x,d[E+1]=l.y,d[E+2]=l.z;return e},m.polygonsFromHierarchy=function(r,n,a,o){var u=[],s=[],c=new p;for(c.enqueue(r);0!==c.length;){var l=c.dequeue(),f=l.positions,d=l.holes;if(f=e(f,t.equalsEpsilon,!0),!(f.length<3)){var y=a.projectPointsOntoPlane(f),m=[],_=h.computeWindingOrder2D(y);_===E.CLOCKWISE&&(y.reverse(),f=f.slice().reverse());var T,v,R=f.slice(),A=i(d)?d.length:0,S=[];for(T=0;T<A;T++){var g=d[T],N=e(g.positions,t.equalsEpsilon,!0);if(!(N.length<3)){var O=a.projectPointsOntoPlane(N);_=h.computeWindingOrder2D(O),_===E.CLOCKWISE&&(O.reverse(),N=N.slice().reverse()),S.push(N),m.push(R.length),R=R.concat(N),y=y.concat(O);var x=0;for(i(g.holes)&&(x=g.holes.length),v=0;v<x;v++)c.enqueue(g.holes[v])}}if(!n){for(T=0;T<f.length;T++)o.scaleToGeodeticSurface(f[T],f[T]);for(T=0;T<S.length;T++){var I=S[T];for(v=0;v<I.length;++v)o.scaleToGeodeticSurface(I[v],I[v])}}u.push({outerRing:f,holes:S}),s.push({positions:R,positions2D:y,holes:m})}}return{hierarchy:u,polygons:s}},m.createGeometryFromPositions=function(e,t,n,i,a){var s=h.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);var l=t.positions;if(i){for(var f=l.length,p=new Array(3*f),E=0,y=0;y<f;y++){var m=l[y];p[E++]=m.x,p[E++]=m.y,p[E++]=m.z}var _=new o({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})},indices:s,primitiveType:d.TRIANGLES});return a.normal?c.computeNormal(_):_}return h.computeSubdivision(e,l,s,n)};var S=[],g=new t,N=new t;return m.computeWallGeometry=function(e,n,i,a){var c,h,p,E,y,_=e.length,T=0;if(a)for(h=3*_*2,c=new Array(2*h),p=0;p<_;p++)E=e[p],y=e[(p+1)%_],c[T]=c[T+h]=E.x,++T,c[T]=c[T+h]=E.y,++T,c[T]=c[T+h]=E.z,++T,c[T]=c[T+h]=y.x,++T,c[T]=c[T+h]=y.y,++T,c[T]=c[T+h]=y.z,++T;else{var v=f.chordLength(i,n.maximumRadius),R=0;for(p=0;p<_;p++)R+=m.subdivideLineCount(e[p],e[(p+1)%_],v);for(h=3*(R+_),c=new Array(2*h),p=0;p<_;p++){E=e[p],y=e[(p+1)%_];for(var A=m.subdivideLine(E,y,v,S),O=A.length,x=0;x<O;++x,++T)c[T]=A[x],c[T+h]=A[x];c[T]=y.x,c[T+h]=y.x,++T,c[T]=y.y,c[T+h]=y.y,++T,c[T]=y.z,c[T+h]=y.z,++T}}_=c.length;var I=l.createTypedArray(_/3,_-6*e.length),w=0;for(_/=6,p=0;p<_;p++){var M=p,C=M+1,P=M+_,D=P+1;E=t.fromArray(c,3*M,g),y=t.fromArray(c,3*C,N),t.equalsEpsilon(E,y,f.EPSILON14)||(I[w++]=M,I[w++]=P,I[w++]=C,I[w++]=C,I[w++]=P,I[w++]=D)}return new o({attributes:new s({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:c})}),indices:I,primitiveType:d.TRIANGLES})},m}),define("Core/PolygonOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,E,y,m,_,T,v,R){"use strict";function A(e,t,r,n){var a=c.fromPoints(t,e),o=a.projectPointsOntoPlane(t,N),u=_.computeWindingOrder2D(o);u===R.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());var s,p,y=t.length,v=0;if(n)for(s=new Float64Array(2*y*3),p=0;p<y;p++){var A=t[p],S=t[(p+1)%y];s[v++]=A.x,s[v++]=A.y,s[v++]=A.z,s[v++]=S.x,s[v++]=S.y,s[v++]=S.z}else{var g=0;for(p=0;p<y;p++)g+=m.subdivideLineCount(t[p],t[(p+1)%y],r);for(s=new Float64Array(3*g),p=0;p<y;p++)for(var x=m.subdivideLine(t[p],t[(p+1)%y],r,O),I=x.length,w=0;w<I;++w)s[v++]=x[w]}y=s.length/3;var M=2*y,C=E.createTypedArray(y,M);for(v=0,p=0;p<y-1;p++)C[v++]=p,C[v++]=p+1;return C[v++]=y-1,C[v++]=0,new d({geometry:new l({attributes:new h({position:new f({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:s})}),indices:C,primitiveType:T.LINES})})}function S(e,t,r,n){var a=c.fromPoints(t,e),o=a.projectPointsOntoPlane(t,N),u=_.computeWindingOrder2D(o);u===R.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());var s,p,y=t.length,v=new Array(y),A=0;if(n)for(s=new Float64Array(2*y*3*2),p=0;p<y;++p){ -v[p]=A/3;var S=t[p],g=t[(p+1)%y];s[A++]=S.x,s[A++]=S.y,s[A++]=S.z,s[A++]=g.x,s[A++]=g.y,s[A++]=g.z}else{var x=0;for(p=0;p<y;p++)x+=m.subdivideLineCount(t[p],t[(p+1)%y],r);for(s=new Float64Array(3*x*2),p=0;p<y;++p){v[p]=A/3;for(var I=m.subdivideLine(t[p],t[(p+1)%y],r,O),w=I.length,M=0;M<w;++M)s[A++]=I[M]}}y=s.length/6;var C=v.length,P=2*(2*y+C),D=E.createTypedArray(y,P);for(A=0,p=0;p<y;++p)D[A++]=p,D[A++]=(p+1)%y,D[A++]=p+y,D[A++]=(p+1)%y+y;for(p=0;p<C;p++){var L=v[p];D[A++]=L,D[A++]=L+y}return new d({geometry:new l({attributes:new h({position:new f({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:s})}),indices:D,primitiveType:T.LINES})})}function g(e){var t=e.polygonHierarchy,r=a(e.ellipsoid,s.WGS84),n=a(e.granularity,y.RADIANS_PER_DEGREE),i=a(e.height,0),u=a(e.perPositionHeight,!1),c=e.extrudedHeight,l=o(c);if(l&&!u){var f=c;c=Math.min(f,i),i=Math.max(f,i)}this._ellipsoid=s.clone(r),this._granularity=n,this._height=i,this._extrudedHeight=a(c,0),this._extrude=l,this._polygonHierarchy=t,this._perPositionHeight=u,this._workerName="createPolygonOutlineGeometry",this.packedLength=m.computeHierarchyPackedLength(t)+s.packedLength+6}var N=[],O=[];g.pack=function(e,t,r){return r=a(r,0),r=m.packPolygonHierarchy(e._polygonHierarchy,t,r),s.pack(e._ellipsoid,t,r),r+=s.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e.packedLength,t};var x=s.clone(s.UNIT_SPHERE),I={polygonHierarchy:{}};return g.unpack=function(e,t,r){t=a(t,0);var n=m.unpackPolygonHierarchy(e,t);t=n.startingIndex,delete n.startingIndex;var i=s.unpack(e,t,x);t+=s.packedLength;var u=e[t++],c=e[t++],l=e[t++],f=1===e[t++],h=1===e[t++],d=e[t++];return o(r)||(r=new g(I)),r._polygonHierarchy=n,r._ellipsoid=s.clone(i,r._ellipsoid),r._height=u,r._extrudedHeight=c,r._granularity=l,r._extrude=f,r._perPositionHeight=h,r.packedLength=d,r},g.fromPositions=function(e){e=a(e,a.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight};return new g(t)},g.createGeometry=function(n){var i=n._ellipsoid,a=n._granularity,u=n._height,s=n._extrudedHeight,c=n._extrude,f=n._polygonHierarchy,h=n._perPositionHeight,d=[],E=new v;E.enqueue(f);for(var T;0!==E.length;){var R=E.dequeue(),g=R.positions;if(g=e(g,r.equalsEpsilon,!0),!(g.length<3)){var N=R.holes?R.holes.length:0;for(T=0;T<N;T++){var O=R.holes[T];if(O.positions=e(O.positions,r.equalsEpsilon,!0),!(O.positions.length<3)){d.push(O.positions);var x=0;o(O.holes)&&(x=O.holes.length);for(var I=0;I<x;I++)E.enqueue(O.holes[I])}}d.push(g)}}if(0!==d.length){var w,M=[],C=y.chordLength(a,i.maximumRadius);if(c)for(T=0;T<d.length;T++)w=S(i,d[T],C,h),w.geometry=m.scaleToGeodeticHeightExtruded(w.geometry,u,s,i,h),M.push(w);else for(T=0;T<d.length;T++)w=A(i,d[T],C,h),w.geometry.attributes.position.values=_.scaleToGeodeticHeight(w.geometry.attributes.position.values,u,i,!h),M.push(w);w=p.combineInstances(M)[0];var P=t.fromVertices(w.attributes.position.values);return new l({attributes:w.attributes,indices:w.indices,primitiveType:w.primitiveType,boundingSphere:P})}},g}),define("Workers/createPolygonOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolygonOutlineGeometry"],function(e,t,r){"use strict";function n(n,i){return e(i)&&(n=r.unpack(n,i)),n._ellipsoid=t.clone(n._ellipsoid),r.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(n,i){if(!e(i))throw new t(r(n))},i.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},i.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},i.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},i.typeOf.number.lessThan=function(e,r,n){if(i.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},i.typeOf.number.lessThanOrEquals=function(e,r,n){if(i.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},i.typeOf.number.greaterThan=function(e,r,n){if(i.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},i.typeOf.number.greaterThanOrEquals=function(e,r,n){if(i.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},i.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},i.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^e>>>1^t[1&e];for(;r<this.N-1;r++)e=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,r){return r=t(r,255),Math.round((.5*i.clamp(e,-1,1)+.5)*r)},i.fromSNorm=function(e,r){return r=t(r,255),i.clamp(e,0,r)/r*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t-r)},i.cosh=function(e){var t=Math.pow(Math.E,e),r=Math.pow(Math.E,-1*e);return.5*(t+r)},i.lerp=function(e,t,r){return(1-r)*e+r*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,r=e-Math.floor(e/t)*t;return r<-Math.PI?r+t:r>=Math.PI?r-t:r},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,r,n,i){i=t(i,n);var a=Math.abs(e-r);return a<=i||a<=n*Math.max(Math.abs(e),Math.abs(r))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var r=a[t-1],n=t;n<=e;n++)a.push(r*n);return a[e]},i.incrementWrap=function(e,r,n){return n=t(n,0),++e,e>r&&(e=n),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,r){return e<t?t:e>r?r:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var r=e*t;return 1-Math.exp(-(r*r))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a){"use strict";function o(e,r,n){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0)}o.fromSpherical=function(e,n){r(n)||(n=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=u*Math.cos(a),n},o.fromElements=function(e,t,n,i){return r(i)?(i.x=e,i.y=t,i.z=n,i):new o(e,t,n)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n]=e.z,r},o.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new o),i.x=e[n++],i.y=e[n++],i.z=e[n],i},o.packArray=function(e,t){var n=e.length;r(t)?t.length=3*n:t=new Array(3*n);for(var i=0;i<n;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/3:t=new Array(n/3);for(var i=0;i<n;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var r=o.dot(c,l),n=o.magnitude(o.cross(c,l,c));return Math.atan2(n,r)};var f=new o;o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):r.y<=r.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]},o.equalsEpsilon=function(e,t,n,i){return e===t||r(e)&&r(t)&&a.equalsEpsilon(e.x,t.x,n,i)&&a.equalsEpsilon(e.y,t.y,n,i)&&a.equalsEpsilon(e.z,t.z,n,i)},o.cross=function(e,t,r){var n=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,c=i*s-a*u,l=a*o-n*s,f=n*u-i*o;return r.x=c,r.y=l,r.z=f,r},o.fromDegrees=function(e,t,r,n,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,r,n,i)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,n,i,a,u){i=t(i,0);var s=r(a)?a.radiiSquared:p,c=Math.cos(n);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(n),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,i,h),r(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,n){var i=e.length;r(n)?n.length=i/2:n=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;n[c]=o.fromDegrees(u,s,0,t,n[c])}return n},o.fromRadiansArray=function(e,t,n){var i=e.length;r(n)?n.length=i/2:n=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],c=a/2;n[c]=o.fromRadians(u,s,0,t,n[c])}return n},o.fromDegreesArrayHeights=function(e,t,n){var i=e.length;r(n)?n.length=i/3:n=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;n[l]=o.fromDegrees(u,s,c,t,n[l])}return n},o.fromRadiansArrayHeights=function(e,t,n){var i=e.length;r(n)?n.length=i/3:n=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],c=e[a+2],l=a/3;n[l]=o.fromRadians(u,s,c,t,n[l])}return n},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function i(r,i,u,s,c){var l=r.x,f=r.y,h=r.z,d=i.x,p=i.y,E=i.z,y=l*l*d*d,m=f*f*p*p,_=h*h*E*E,T=y+m+_,v=Math.sqrt(1/T),R=e.multiplyByScalar(r,v,a);if(T<s)return isFinite(v)?e.clone(R,c):void 0;var A=u.x,S=u.y,g=u.z,N=o;N.x=R.x*A*2,N.y=R.y*S*2,N.z=R.z*g*2;var O,I,x,w,M,C,P,D,L,U,b,F=(1-v)*e.magnitude(r)/(.5*e.magnitude(N)),B=0;do{F-=B,x=1/(1+F*A),w=1/(1+F*S),M=1/(1+F*g),C=x*x,P=w*w,D=M*M,L=C*x,U=P*w,b=D*M,O=y*C+m*P+_*D-1,I=y*L*A+m*U*S+_*b*g;var z=-2*I;B=O/z}while(Math.abs(O)>n.EPSILON12);return t(c)?(c.x=l*x,c.y=f*w,c.z=h*M,c):new e(l*x,f*w,h*M)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,i,a,o){"use strict";function u(e,t,n){this.longitude=r(e,0),this.latitude=r(t,0),this.height=r(n,0)}u.fromRadians=function(e,t,i,a){return i=r(i,0),n(a)?(a.longitude=e,a.latitude=t,a.height=i,a):new u(e,t,i)},u.fromDegrees=function(e,t,r,n){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,r,n)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=a.EPSILON1;return u.fromCartesian=function(t,r,i){var p=n(r)?r.oneOverRadii:f,E=n(r)?r.oneOverRadiiSquared:h,y=n(r)?r._centerToleranceSquared:d,m=o(t,p,E,y,c);if(n(m)){var _=e.multiplyComponents(m,E,s);_=e.normalize(_,_);var T=e.subtract(t,m,l),v=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=a.sign(e.dot(T,t))*e.magnitude(T);return n(i)?(i.longitude=v,i.latitude=R,i.height=A,i):new u(v,R,A)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),r=Object.defineProperties;return t&&e(r)||(r=function(e){return e}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,r,n,i,a,o,u,s){"use strict";function c(t,n,i,a){n=r(n,0),i=r(i,0),a=r(a,0),t._radii=new e(n,i,a),t._radiiSquared=new e(n*n,i*i,a*a),t._radiiToTheFourth=new e(n*n*n*n,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===n?0:1/n,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===n?0:1/(n*n),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(n,i,a),t._maximumRadius=Math.max(n,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,r){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._sqauredXOverSquaredZ=void 0,c(this,e,t,r)}i(l.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}}}),l.clone=function(t,r){if(n(t)){var i=t._radii;return n(r)?(e.clone(i,r._radii),e.clone(t._radiiSquared,r._radiiSquared),e.clone(t._radiiToTheFourth,r._radiiToTheFourth),e.clone(t._oneOverRadii,r._oneOverRadii),e.clone(t._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=t._minimumRadius,r._maximumRadius=t._maximumRadius,r._centerToleranceSquared=t._centerToleranceSquared,r):new l(i.x,i.y,i.z)}},l.fromCartesian3=function(e,t){return n(t)||(t=new l),n(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,n,i){return i=r(i,0),e.pack(t._radii,n,i),n},l.unpack=function(t,n,i){n=r(n,0);var a=e.unpack(t,n);return l.fromCartesian3(a,i)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,r){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),c=Math.sin(a);return n(r)||(r=new e),r.x=u,r.y=s,r.z=c,e.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(t,r){return n(r)||(r=new e),r=e.multiplyComponents(t,this._oneOverRadiiSquared,r),e.normalize(r,r)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,r){var i=f,a=h;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),n(r)||(r=new e),e.add(a,i,r)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;i<r;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var d=new e,p=new e,E=new e;return l.prototype.cartesianToCartographic=function(r,i){var a=this.scaleToGeodeticSurface(r,p);if(n(a)){var o=this.geodeticSurfaceNormal(a,d),s=e.subtract(r,a,E),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,r))*e.magnitude(s);return n(i)?(i.longitude=c,i.latitude=l,i.height=f,i):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var r=e.length;n(t)?t.length=r:t=new Array(r);for(var i=0;i<r;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,r){n(r)||(r=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,r)},l.prototype.transformPositionToScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(t,r){return n(r)||(r=new e),e.multiplyComponents(t,this._radii,r)},l.prototype.equals=function(t){return this===t||n(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=r(i,0);var o=this._sqauredXOverSquaredZ;if(n(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},l}),define("Core/arrayRemoveDuplicates",["./Check","./defaultValue","./defined","./Math"],function(e,t,r,n){"use strict";function i(e,n,i){if(r(e)){i=t(i,!1);var o=e.length;if(o<2)return e;var u,s,c;for(u=1;u<o&&(s=e[u-1],c=e[u],!n(s,c,a));++u);if(u===o)return i&&n(e[0],e[e.length-1],a)?e.slice(1):e;for(var l=e.slice(0,u);u<o;++u)c=e[u],n(s,c,a)||(l.push(c),s=c);return i&&l.length>1&&n(l[0],l[l.length-1],a)&&l.shift(),l}}var a=n.EPSILON10;return i}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,r,n,i,a,o){"use strict";function u(e){this._ellipsoid=r(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,r){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return n(r)?(r.x=a,r.y=o,r.z=u,r):new e(a,o,u)},u.prototype.unproject=function(e,r){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return n(r)?(r.longitude=a,r.latitude=o,r.height=u,r):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,r){this.start=e(t,0),this.stop=e(r,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a,o,u){"use strict";function s(e,t,n,i,a,o,u,s,c){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(u,0),this[3]=r(t,0),this[4]=r(a,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(o,0),this[8]=r(c,0)}function c(e){for(var t=0,r=0;r<9;++r){var n=e[r];t+=n*n}return Math.sqrt(t)}function l(e){for(var t=0,r=0;r<3;++r){var n=e[s.getElementIndex(E[r],p[r])];t+=2*n*n}return Math.sqrt(t)}function f(e,t){for(var r=u.EPSILON15,n=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(E[a],p[a])]);o>n&&(i=a,n=o)}var c=1,l=0,f=p[i],h=E[i];if(Math.abs(e[s.getElementIndex(h,f)])>r){var d,y=e[s.getElementIndex(h,h)],m=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(h,f)],T=(y-m)/2/_;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t},s.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(n(e))return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=r(t,0),n(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var r=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,p=r-u-f+d,E=2*(i-h),y=2*(a+l),m=2*(i+h),_=-r+u-f+d,T=2*(c-o),v=2*(a-l),R=2*(c+o),A=-r-u+f+d;return n(t)?(t[0]=p,t[1]=m,t[2]=v,t[3]=E,t[4]=_,t[5]=R,t[6]=y,t[7]=T,t[8]=A,t):new s(p,E,y,m,_,T,v,R,A)},s.fromHeadingPitchRoll=function(e,t){var r=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=r*i,f=-a*u+c*o*i,h=c*u+a*o*i,d=r*u,p=a*i+c*o*u,E=-c*i+a*o*u,y=-o,m=c*r,_=a*r;return n(t)?(t[0]=l,t[1]=d,t[2]=y,t[3]=f,t[4]=p,t[5]=m,t[6]=h,t[7]=E,t[8]=_,t):new s(l,f,h,d,p,E,y,m,_)},s.fromScale=function(e,t){return n(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return n(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return n(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=r,t[5]=i,t[6]=0,t[7]=-i,t[8]=r,t):new s(1,0,0,0,r,-i,0,i,r)},s.fromRotationY=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=r,t):new s(r,0,i,0,1,0,-i,0,r)},s.fromRotationZ=function(e,t){var r=Math.cos(e),i=Math.sin(e);return n(t)?(t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(r,-i,0,i,r,0,0,0,1)},s.toArray=function(e,t){return n(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,r){var n=3*t,i=e[n],a=e[n+1],o=e[n+2];return r.x=i,r.y=a,r.z=o,r},s.setColumn=function(e,t,r,n){n=s.clone(e,n);var i=3*t;return n[i]=r.x,n[i+1]=r.y,n[i+2]=r.z,n},s.getRow=function(e,t,r){var n=e[t],i=e[t+3],a=e[t+6];return r.x=n,r.y=i,r.z=a,r},s.setRow=function(e,t,r,n){return n=s.clone(e,n),n[t]=r.x,n[t+3]=r.y,n[t+6]=r.z,n};var h=new e;s.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),r.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),r.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),r};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,r){var n=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=u,r[5]=s,r[6]=c,r[7]=l,r[8]=f,r},s.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r},s.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r},s.multiplyByVector=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=e[0]*n+e[3]*i+e[6]*a,u=e[1]*n+e[4]*i+e[7]*a,s=e[2]*n+e[5]*i+e[8]*a;return r.x=o,r.y=u,r.z=s,r},s.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r},s.multiplyByScale=function(e,t,r){return r[0]=e[0]*t.x,r[1]=e[1]*t.x,r[2]=e[2]*t.x,r[3]=e[3]*t.y,r[4]=e[4]*t.y,r[5]=e[5]*t.y,r[6]=e[6]*t.z,r[7]=e[7]*t.z,r[8]=e[8]*t.z,r},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var r=e[0],n=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var p=[1,0,0],E=[2,2,1],y=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var r=u.EPSILON20,i=10,a=0,o=0;n(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),p=r*c(d);o<i&&l(d)>p;)f(d,y),s.transpose(y,m),s.multiply(d,y,d),s.multiply(m,d,d),s.multiply(h,y,h),++a>2&&(++o,a=0);return t},s.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},s.determinant=function(e){var t=e[0],r=e[3],n=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(a*c-s*o)+i*(s*n-r*c)+u*(r*o-a*n)},s.inverse=function(e,t){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*i-n*f,t[2]=n*u-o*i,t[3]=c*u-a*f,t[4]=r*f-c*i,t[5]=a*i-r*u,t[6]=a*l-c*o,t[7]=c*n-r*l,t[8]=r*o-a*n;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||n(e)&&n(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]},s.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a){"use strict";function o(e,r,n,i){this.x=t(e,0),this.y=t(r,0),this.z=t(n,0),this.w=t(i,0)}o.fromElements=function(e,t,n,i,a){return r(a)?(a.x=e,a.y=t,a.z=n,a.w=i,a):new o(e,t,n,i)},o.fromColor=function(e,t){return r(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n++]=e.y,r[n++]=e.z,r[n]=e.w,r},o.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new o),i.x=e[n++],i.y=e[n++],i.z=e[n++],i.w=e[n],i},o.packArray=function(e,t){var n=e.length;r(t)?t.length=4*n:t=new Array(4*n);for(var i=0;i<n;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/4:t=new Array(n/4);for(var i=0;i<n;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r.z=Math.min(e.z,t.z),r.w=Math.min(e.w,t.w),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r.z=Math.max(e.z,t.z),r.w=Math.max(e.w,t.w),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t.z=e.z/r,t.w=e.w/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r.z=e.z*t.z,r.w=e.w*t.w,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r.z=e.z/t.z,r.w=e.w/t.w,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,c);return o.abs(r,r),t=r.x<=r.y?r.x<=r.z?r.x<=r.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):r.y<=r.z?r.y<=r.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):r.z<=r.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]&&e.z===t[r+2]&&e.w===t[r+3]},o.equalsEpsilon=function(e,t,n,i){return e===t||r(e)&&r(t)&&a.equalsEpsilon(e.x,t.x,n,i)&&a.equalsEpsilon(e.y,t.y,n,i)&&a.equalsEpsilon(e.z,t.z,n,i)&&a.equalsEpsilon(e.w,t.w,n,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError", +this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(e,t,r,i,a,o,u,s,c,l,f,h,d,p,E,y){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(c,0),this[3]=n(d,0),this[4]=n(t,0),this[5]=n(o,0),this[6]=n(l,0),this[7]=n(p,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(f,0),this[11]=n(E,0),this[12]=n(i,0),this[13]=n(s,0),this[14]=n(h,0),this[15]=n(y,0)}l.packedLength=16,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t[r++]=e[9],t[r++]=e[10],t[r++]=e[11],t[r++]=e[12],t[r++]=e[13],t[r++]=e[14],t[r]=e[15],t},l.unpack=function(e,t,r){return t=n(t,0),i(r)||(r=new l),r[0]=e[t++],r[1]=e[t++],r[2]=e[t++],r[3]=e[t++],r[4]=e[t++],r[5]=e[t++],r[6]=e[t++],r[7]=e[t++],r[8]=e[t++],r[9]=e[t++],r[10]=e[t++],r[11]=e[t++],r[12]=e[t++],r[13]=e[t++],r[14]=e[t++],r[15]=e[t],r},l.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,r,a){return r=n(r,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a):new l(t[0],t[3],t[6],r.x,t[1],t[4],t[7],r.y,t[2],t[5],t[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,r,n){i(n)||(n=new l);var a=r.x,o=r.y,u=r.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,p=t.y*t.z,E=t.y*t.w,y=t.z*t.z,m=t.z*t.w,_=t.w*t.w,T=s-d-y+_,v=2*(c-m),R=2*(f+E),A=2*(c+m),S=-s+d-y+_,g=2*(p-h),N=2*(f-E),O=2*(p+h),I=-s-d+y+_;return n[0]=T*a,n[1]=A*a,n[2]=N*a,n[3]=0,n[4]=v*o,n[5]=S*o,n[6]=O*o,n[7]=0,n[8]=R*u,n[9]=g*u,n[10]=I*u,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,n},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,r){var n=t.position,a=t.direction,o=t.up;e.normalize(a,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,p=f.x,E=f.y,y=f.z,m=d.x,_=d.y,T=d.z,v=n.x,R=n.y,A=n.z,S=u*-v+s*-R+c*-A,g=m*-v+_*-R+T*-A,N=p*v+E*R+y*A;return i(r)?(r[0]=u,r[1]=m,r[2]=-p,r[3]=0,r[4]=s,r[5]=_,r[6]=-E,r[7]=0,r[8]=c,r[9]=T,r[10]=-y,r[11]=0,r[12]=S,r[13]=g,r[14]=N,r[15]=1,r):new l(u,s,c,S,m,_,T,g,-p,-E,-y,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,r,n,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(n+r)/(r-n),c=2*n*r/(r-n);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=c,i[15]=0,i},l.computeOrthographicOffCenter=function(e,t,r,n,i,a,o){var u=1/(t-e),s=1/(n-r),c=1/(a-i),l=-(t+e)*u,f=-(n+r)*s,h=-(a+i)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,r,n,i,a,o){var u=2*i/(t-e),s=2*i/(n-r),c=(t+e)/(t-e),l=(n+r)/(n-r),f=-(a+i)/(a-i),h=-1,d=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,r,n,i,a){var o=2*i/(t-e),u=2*i/(n-r),s=(t+e)/(t-e),c=(n+r)/(n-r),l=-1,f=-1,h=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=s,a[9]=c,a[10]=l,a[11]=f,a[12]=0,a[13]=0,a[14]=h,a[15]=0,a},l.computeViewportTransformation=function(e,t,r,i){e=n(e,n.EMPTY_OBJECT);var a=n(e.x,0),o=n(e.y,0),u=n(e.width,0),s=n(e.height,0);t=n(t,0),r=n(r,1);var c=.5*u,l=.5*s,f=.5*(r-t),h=c,d=l,p=f,E=a+c,y=o+l,m=t+f,_=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=d,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=p,i[11]=0,i[12]=E,i[13]=y,i[14]=m,i[15]=_,i},l.computeView=function(t,r,n,i,a){return a[0]=i.x,a[1]=n.x,a[2]=-r.x,a[3]=0,a[4]=i.y,a[5]=n.y,a[6]=-r.y,a[7]=0,a[8]=i.z,a[9]=n.z,a[10]=-r.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(n,t),a[14]=e.dot(r,t),a[15]=1,a},l.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,r){var n=4*t,i=e[n],a=e[n+1],o=e[n+2],u=e[n+3];return r.x=i,r.y=a,r.z=o,r.w=u,r},l.setColumn=function(e,t,r,n){n=l.clone(e,n);var i=4*t;return n[i]=r.x,n[i+1]=r.y,n[i+2]=r.z,n[i+3]=r.w,n},l.setTranslation=function(e,t,r){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=e[15],r},l.getRow=function(e,t,r){var n=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return r.x=n,r.y=i,r.z=a,r.w=o,r},l.setRow=function(e,t,r,n){return n=l.clone(e,n),n[t]=r.x,n[t+4]=r.y,n[t+8]=r.z,n[t+12]=r.w,n};var p=new e;l.getScale=function(t,r){return r.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),r.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),r.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),r};var E=new e;l.getMaximumScale=function(t){return l.getScale(t,E),e.maximumComponent(E)},l.multiply=function(e,t,r){var n=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],E=e[12],y=e[13],m=e[14],_=e[15],T=t[0],v=t[1],R=t[2],A=t[3],S=t[4],g=t[5],N=t[6],O=t[7],I=t[8],x=t[9],w=t[10],M=t[11],C=t[12],P=t[13],D=t[14],L=t[15],U=n*T+u*v+f*R+E*A,b=i*T+s*v+h*R+y*A,F=a*T+c*v+d*R+m*A,B=o*T+l*v+p*R+_*A,z=n*S+u*g+f*N+E*O,G=i*S+s*g+h*N+y*O,q=a*S+c*g+d*N+m*O,W=o*S+l*g+p*N+_*O,X=n*I+u*x+f*w+E*M,H=i*I+s*x+h*w+y*M,V=a*I+c*x+d*w+m*M,Y=o*I+l*x+p*w+_*M,k=n*C+u*P+f*D+E*L,Z=i*C+s*P+h*D+y*L,j=a*C+c*P+d*D+m*L,K=o*C+l*P+p*D+_*L;return r[0]=U,r[1]=b,r[2]=F,r[3]=B,r[4]=z,r[5]=G,r[6]=q,r[7]=W,r[8]=X,r[9]=H,r[10]=V,r[11]=Y,r[12]=k,r[13]=Z,r[14]=j,r[15]=K,r},l.add=function(e,t,r){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r[4]=e[4]+t[4],r[5]=e[5]+t[5],r[6]=e[6]+t[6],r[7]=e[7]+t[7],r[8]=e[8]+t[8],r[9]=e[9]+t[9],r[10]=e[10]+t[10],r[11]=e[11]+t[11],r[12]=e[12]+t[12],r[13]=e[13]+t[13],r[14]=e[14]+t[14],r[15]=e[15]+t[15],r},l.subtract=function(e,t,r){return r[0]=e[0]-t[0],r[1]=e[1]-t[1],r[2]=e[2]-t[2],r[3]=e[3]-t[3],r[4]=e[4]-t[4],r[5]=e[5]-t[5],r[6]=e[6]-t[6],r[7]=e[7]-t[7],r[8]=e[8]-t[8],r[9]=e[9]-t[9],r[10]=e[10]-t[10],r[11]=e[11]-t[11],r[12]=e[12]-t[12],r[13]=e[13]-t[13],r[14]=e[14]-t[14],r[15]=e[15]-t[15],r},l.multiplyTransformation=function(e,t,r){var n=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],p=e[14],E=t[0],y=t[1],m=t[2],_=t[4],T=t[5],v=t[6],R=t[8],A=t[9],S=t[10],g=t[12],N=t[13],O=t[14],I=n*E+o*y+c*m,x=i*E+u*y+l*m,w=a*E+s*y+f*m,M=n*_+o*T+c*v,C=i*_+u*T+l*v,P=a*_+s*T+f*v,D=n*R+o*A+c*S,L=i*R+u*A+l*S,U=a*R+s*A+f*S,b=n*g+o*N+c*O+h,F=i*g+u*N+l*O+d,B=a*g+s*N+f*O+p;return r[0]=I,r[1]=x,r[2]=w,r[3]=0,r[4]=M,r[5]=C,r[6]=P,r[7]=0,r[8]=D,r[9]=L,r[10]=U,r[11]=0,r[12]=b,r[13]=F,r[14]=B,r[15]=1,r},l.multiplyByMatrix3=function(e,t,r){var n=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],p=t[2],E=t[3],y=t[4],m=t[5],_=t[6],T=t[7],v=t[8],R=n*h+o*d+c*p,A=i*h+u*d+l*p,S=a*h+s*d+f*p,g=n*E+o*y+c*m,N=i*E+u*y+l*m,O=a*E+s*y+f*m,I=n*_+o*T+c*v,x=i*_+u*T+l*v,w=a*_+s*T+f*v;return r[0]=R,r[1]=A,r[2]=S,r[3]=0,r[4]=g,r[5]=N,r[6]=O,r[7]=0,r[8]=I,r[9]=x,r[10]=w,r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r},l.multiplyByTranslation=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=n*e[0]+i*e[4]+a*e[8]+e[12],u=n*e[1]+i*e[5]+a*e[9]+e[13],s=n*e[2]+i*e[6]+a*e[10]+e[14];return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=o,r[13]=u,r[14]=s,r[15]=e[15],r};var y=new e;l.multiplyByUniformScale=function(e,t,r){return y.x=t,y.y=t,y.z=t,l.multiplyByScale(e,y,r)},l.multiplyByScale=function(e,t,r){var n=t.x,i=t.y,a=t.z;return 1===n&&1===i&&1===a?l.clone(e,r):(r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=0,r[4]=i*e[4],r[5]=i*e[5],r[6]=i*e[6],r[7]=0,r[8]=a*e[8],r[9]=a*e[9],r[10]=a*e[10],r[11]=0,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=1,r)},l.multiplyByVector=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*n+e[4]*i+e[8]*a+e[12]*o,s=e[1]*n+e[5]*i+e[9]*a+e[13]*o,c=e[2]*n+e[6]*i+e[10]*a+e[14]*o,l=e[3]*n+e[7]*i+e[11]*a+e[15]*o;return r.x=u,r.y=s,r.z=c,r.w=l,r},l.multiplyByPointAsVector=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=e[0]*n+e[4]*i+e[8]*a,u=e[1]*n+e[5]*i+e[9]*a,s=e[2]*n+e[6]*i+e[10]*a;return r.x=o,r.y=u,r.z=s,r},l.multiplyByPoint=function(e,t,r){var n=t.x,i=t.y,a=t.z,o=e[0]*n+e[4]*i+e[8]*a+e[12],u=e[1]*n+e[5]*i+e[9]*a+e[13],s=e[2]*n+e[6]*i+e[10]*a+e[14];return r.x=o,r.y=u,r.z=s,r},l.multiplyByScalar=function(e,t,r){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r[4]=e[4]*t,r[5]=e[5]*t,r[6]=e[6]*t,r[7]=e[7]*t,r[8]=e[8]*t,r[9]=e[9]*t,r[10]=e[10]*t,r[11]=e[11]*t,r[12]=e[12]*t,r[13]=e[13]*t,r[14]=e[14]*t,r[15]=e[15]*t,r},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var r=e[1],n=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,r){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r&&Math.abs(e[2]-t[2])<=r&&Math.abs(e[3]-t[3])<=r&&Math.abs(e[4]-t[4])<=r&&Math.abs(e[5]-t[5])<=r&&Math.abs(e[6]-t[6])<=r&&Math.abs(e[7]-t[7])<=r&&Math.abs(e[8]-t[8])<=r&&Math.abs(e[9]-t[9])<=r&&Math.abs(e[10]-t[10])<=r&&Math.abs(e[11]-t[11])<=r&&Math.abs(e[12]-t[12])<=r&&Math.abs(e[13]-t[13])<=r&&Math.abs(e[14]-t[14])<=r&&Math.abs(e[15]-t[15])<=r},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var m=new s,_=new s,T=new t,v=new t(0,0,0,1);return l.inverse=function(e,r){if(s.equalsEpsilon(l.getRotation(e,m),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),v))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-e[12],r[13]=-e[13],r[14]=-e[14],r[15]=1,r;var n=e[0],i=e[4],a=e[8],o=e[12],f=e[1],h=e[5],d=e[9],p=e[13],E=e[2],y=e[6],R=e[10],A=e[14],S=e[3],g=e[7],N=e[11],O=e[15],I=R*O,x=A*N,w=y*O,M=A*g,C=y*N,P=R*g,D=E*O,L=A*S,U=E*N,b=R*S,F=E*g,B=y*S,z=I*h+M*d+C*p-(x*h+w*d+P*p),G=x*f+D*d+b*p-(I*f+L*d+U*p),q=w*f+L*h+F*p-(M*f+D*h+B*p),W=P*f+U*h+B*d-(C*f+b*h+F*d),X=x*i+w*a+P*o-(I*i+M*a+C*o),H=I*n+L*a+U*o-(x*n+D*a+b*o),V=M*n+D*i+B*o-(w*n+L*i+F*o),Y=C*n+b*i+F*a-(P*n+U*i+B*a);I=a*p,x=o*d,w=i*p,M=o*h,C=i*d,P=a*h,D=n*p,L=o*f,U=n*d,b=a*f,F=n*h,B=i*f;var k=I*g+M*N+C*O-(x*g+w*N+P*O),Z=x*S+D*N+b*O-(I*S+L*N+U*O),j=w*S+L*g+F*O-(M*S+D*g+B*O),K=P*S+U*g+B*N-(C*S+b*g+F*N),J=w*R+P*A+x*y-(C*A+I*y+M*R),Q=U*A+I*E+L*R-(D*R+b*A+x*E),$=D*y+B*A+M*E-(F*A+w*E+L*y),ee=F*R+C*E+b*y-(U*y+B*R+P*E),te=n*z+i*G+a*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,r[0]=z*te,r[1]=G*te,r[2]=q*te,r[3]=W*te,r[4]=X*te,r[5]=H*te,r[6]=V*te,r[7]=Y*te,r[8]=k*te,r[9]=Z*te,r[10]=j*te,r[11]=K*te,r[12]=J*te,r[13]=Q*te,r[14]=$*te,r[15]=ee*te,r},l.inverseTransformation=function(e,t){var r=e[0],n=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],p=-r*f-n*h-i*d,E=-a*f-o*h-u*d,y=-s*f-c*h-l*d;return t[0]=r,t[1]=a,t[2]=s,t[3]=0,t[4]=n,t[5]=o,t[6]=c,t[7]=0,t[8]=i,t[9]=u,t[10]=l,t[11]=0,t[12]=p,t[13]=E,t[14]=y,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,a(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,r){return e[0]===t[r]&&e[1]===t[r+1]&&e[2]===t[r+2]&&e[3]===t[r+3]&&e[4]===t[r+4]&&e[5]===t[r+5]&&e[6]===t[r+6]&&e[7]===t[r+7]&&e[8]===t[r+8]&&e[9]===t[r+9]&&e[10]===t[r+10]&&e[11]===t[r+11]&&e[12]===t[r+12]&&e[13]===t[r+13]&&e[14]===t[r+14]&&e[15]===t[r+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,r,n,i,a,o,u){"use strict";function s(e,t,n,i){this.west=r(e,0),this.south=r(t,0),this.east=r(n,0),this.north=r(i,0)}i(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t},s.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new s),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},s.computeWidth=function(e){var t=e.east,r=e.west;return t<r&&(t+=u.TWO_PI),t-r},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,i,a,o){return e=u.toRadians(r(e,0)),t=u.toRadians(r(t,0)),i=u.toRadians(r(i,0)),a=u.toRadians(r(a,0)),n(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new s(e,t,i,a)},s.fromRadians=function(e,t,i,a,o){return n(o)?(o.west=r(e,0),o.south=r(t,0),o.east=r(i,0),o.north=r(a,0),o):new s(e,t,i,a)},s.fromCartographicArray=function(e,t){for(var r=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];r=Math.min(r,d.longitude),i=Math.max(i,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;a=Math.min(a,p),o=Math.max(o,p)}return i-r>o-a&&(r=a,i=o,i>u.PI&&(i-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(t)?(t.west=r,t.south=c,t.east=i,t.north=l,t):new s(r,c,i,l)},s.fromCartesianArray=function(e,t,r){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=t.cartesianToCartographic(e[h]);i=Math.min(i,p.longitude),a=Math.max(a,p.longitude),l=Math.min(l,p.latitude),f=Math.max(f,p.latitude);var E=p.longitude>=0?p.longitude:p.longitude+u.TWO_PI;o=Math.min(o,E),c=Math.max(c,E)}return a-i>c-o&&(i=o,a=c,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),n(r)?(r.west=i,r.south=l,r.east=a,r.north=f,r):new s(i,l,a,f)},s.clone=function(e,t){if(n(e))return n(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||n(e)&&n(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return n(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.south,r.height=0,r):new e(t.west,t.south)},s.northwest=function(t,r){return n(r)?(r.longitude=t.west,r.latitude=t.north,r.height=0,r):new e(t.west,t.north)},s.northeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.north,r.height=0,r):new e(t.east,t.north)},s.southeast=function(t,r){return n(r)?(r.longitude=t.east,r.latitude=t.south,r.height=0,r):new e(t.east,t.south)},s.center=function(t,r){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return n(r)?(r.longitude=o,r.latitude=s,r.height=0,r):new e(o,s)},s.intersection=function(e,t,r){var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.negativePiToPi(Math.max(a,c)),f=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return n(r)?(r.west=l,r.south=h,r.east=f,r.north=d,r):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,r){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return n(r)?(r.west=i,r.south=a,r.east=o,r.north=u,r):new s(i,a,o,u)},s.union=function(e,t,r){n(r)||(r=new s);var i=e.east,a=e.west,o=t.east,c=t.west;i<a&&o>0?i+=u.TWO_PI:o<c&&i>0&&(o+=u.TWO_PI),i<a&&c<0?c+=u.TWO_PI:o<c&&a<0&&(a+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(a,c)),f=u.convertLongitudeRange(Math.max(i,o));return r.west=l,r.south=Math.min(e.south,t.south),r.east=f,r.north=Math.max(e.north,t.north),r},s.expand=function(e,t,r){return n(r)||(r=new s),r.west=Math.min(e.west,t.longitude),r.south=Math.min(e.south,t.latitude),r.east=Math.max(e.east,t.longitude),r.north=Math.max(e.north,t.latitude),r},s.contains=function(e,t){var r=t.longitude,n=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>i||u.equalsEpsilon(r,i,u.EPSILON14))&&(r<a||u.equalsEpsilon(r,a,u.EPSILON14))&&n>=e.south&&n<=e.north};var c=new e;return s.subsample=function(e,t,i,o){t=r(t,a.WGS84),i=r(i,0),n(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,p=e.west,E=c;E.height=i,E.longitude=p,E.latitude=f,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.latitude=h,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=p,o[l]=t.cartographicToCartesian(E,o[l]),l++,f<0?E.latitude=f:h>0?E.latitude=h:E.latitude=0;for(var y=1;y<8;++y)E.longitude=-Math.PI+y*u.PI_OVER_TWO,s.contains(e,E)&&(o[l]=t.cartographicToCartesian(E,o[l]),l++);return 0===E.latitude&&(E.longitude=p,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=t.cartographicToCartesian(E,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,r,n,i,a,o,u,s,c,l,f){"use strict";function h(t,r){this.center=e.clone(n(t,e.ZERO)),this.radius=n(r,0)}var d=new e,p=new e,E=new e,y=new e,m=new e,_=new e,T=new e,v=new e,R=new e,A=new e,S=new e,g=new e;h.fromPoints=function(t,r){if(i(r)||(r=new h),!i(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;for(var n=e.clone(t[0],T),a=e.clone(n,d),o=e.clone(n,p),u=e.clone(n,E),s=e.clone(n,y),c=e.clone(n,m),l=e.clone(n,_),f=t.length,N=1;N<f;N++){e.clone(t[N],n);var O=n.x,I=n.y,x=n.z;O<a.x&&e.clone(n,a),O>s.x&&e.clone(n,s),I<o.y&&e.clone(n,o),I>c.y&&e.clone(n,c),x<u.z&&e.clone(n,u),x>l.z&&e.clone(n,l)}var w=e.magnitudeSquared(e.subtract(s,a,v)),M=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),P=a,D=s,L=w;M>L&&(L=M,P=o,D=c),C>L&&(L=C,P=u,D=l);var U=R;U.x=.5*(P.x+D.x),U.y=.5*(P.y+D.y),U.z=.5*(P.z+D.z);var b=e.magnitudeSquared(e.subtract(D,U,v)),F=Math.sqrt(b),B=A;B.x=a.x,B.y=o.y,B.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,v),.5,g),q=0;for(N=0;N<f;N++){e.clone(t[N],n);var W=e.magnitude(e.subtract(n,G,v));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(n,U,v));if(X>b){var H=Math.sqrt(X);F=.5*(F+H),b=F*F;var V=H-F;U.x=(F*U.x+V*n.x)/H,U.y=(F*U.y+V*n.y)/H,U.z=(F*U.z+V*n.z)/H}}return F<q?(e.clone(U,r.center),r.radius=F):(e.clone(G,r.center),r.radius=q),r};var N=new o,O=new e,I=new e,x=new t,w=new t;h.fromRectangle2D=function(e,t,r){return h.fromRectangleWithHeights2D(e,t,0,0,r)},h.fromRectangleWithHeights2D=function(t,r,a,o,u){if(i(u)||(u=new h),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;r=n(r,N),f.southwest(t,x),x.height=a,f.northeast(t,w),w.height=o;var s=r.project(x,O),c=r.project(w,I),l=c.x-s.x,d=c.y-s.y,p=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+p*p);var E=u.center;return E.x=s.x+.5*l,E.y=s.y+.5*d,E.z=s.z+.5*p,u};var M=[];h.fromRectangle3D=function(e,t,r,o){t=n(t,a.WGS84),r=n(r,0);var u;return i(e)&&(u=f.subsample(e,t,r,M)),h.fromPoints(u,o)},h.fromVertices=function(t,r,a,o){if(i(o)||(o=new h),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;r=n(r,e.ZERO),a=n(a,3);var u=T;u.x=t[0]+r.x,u.y=t[1]+r.y,u.z=t[2]+r.z;for(var s=e.clone(u,d),c=e.clone(u,p),l=e.clone(u,E),f=e.clone(u,y),N=e.clone(u,m),O=e.clone(u,_),I=t.length,x=0;x<I;x+=a){var w=t[x]+r.x,M=t[x+1]+r.y,C=t[x+2]+r.z;u.x=w,u.y=M,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),M<c.y&&e.clone(u,c),M>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,v)),D=e.magnitudeSquared(e.subtract(N,c,v)),L=e.magnitudeSquared(e.subtract(O,l,v)),U=s,b=f,F=P;D>F&&(F=D,U=c,b=N),L>F&&(F=L,U=l,b=O);var B=R;B.x=.5*(U.x+b.x),B.y=.5*(U.y+b.y),B.z=.5*(U.z+b.z);var z=e.magnitudeSquared(e.subtract(b,B,v)),G=Math.sqrt(z),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=N.y,W.z=O.z;var X=e.multiplyByScalar(e.add(q,W,v),.5,g),H=0;for(x=0;x<I;x+=a){u.x=t[x]+r.x,u.y=t[x+1]+r.y,u.z=t[x+2]+r.z;var V=e.magnitude(e.subtract(u,X,v));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,B,v));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<H?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},h.fromEncodedCartesianVertices=function(t,r,n){if(i(n)||(n=new h),!i(t)||!i(r)||t.length!==r.length||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var a=T;a.x=t[0]+r[0],a.y=t[1]+r[1],a.z=t[2]+r[2];for(var o=e.clone(a,d),u=e.clone(a,p),s=e.clone(a,E),c=e.clone(a,y),l=e.clone(a,m),f=e.clone(a,_),N=t.length,O=0;O<N;O+=3){var I=t[O]+r[O],x=t[O+1]+r[O+1],w=t[O+2]+r[O+2];a.x=I,a.y=x,a.z=w,I<o.x&&e.clone(a,o),I>c.x&&e.clone(a,c),x<u.y&&e.clone(a,u),x>l.y&&e.clone(a,l),w<s.z&&e.clone(a,s),w>f.z&&e.clone(a,f)}var M=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),P=e.magnitudeSquared(e.subtract(f,s,v)),D=o,L=c,U=M;C>U&&(U=C,D=u,L=l),P>U&&(U=P,D=s,L=f);var b=R;b.x=.5*(D.x+L.x),b.y=.5*(D.y+L.y),b.z=.5*(D.z+L.z);var F=e.magnitudeSquared(e.subtract(L,b,v)),B=Math.sqrt(F),z=A;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(z,G,v),.5,g),W=0;for(O=0;O<N;O+=3){a.x=t[O]+r[O],a.y=t[O+1]+r[O+1],a.z=t[O+2]+r[O+2];var X=e.magnitude(e.subtract(a,q,v));X>W&&(W=X);var H=e.magnitudeSquared(e.subtract(a,b,v));if(H>F){var V=Math.sqrt(H);B=.5*(B+V),F=B*B;var Y=V-B;b.x=(B*b.x+Y*a.x)/V,b.y=(B*b.y+Y*a.y)/V,b.z=(B*b.z+Y*a.z)/V}}return B<W?(e.clone(b,n.center),n.radius=B):(e.clone(q,n.center),n.radius=W),n},h.fromCornerPoints=function(t,r,n){i(n)||(n=new h);var a=n.center;return e.add(t,r,a),e.multiplyByScalar(a,.5,a),n.radius=e.distance(a,r),n},h.fromEllipsoid=function(t,r){return i(r)||(r=new h),e.clone(e.ZERO,r.center),r.radius=t.maximumRadius,r};var C=new e;h.fromBoundingSpheres=function(t,r){if(i(r)||(r=new h),!i(t)||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var n=t.length;if(1===n)return h.clone(t[0],r);if(2===n)return h.union(t[0],t[1],r);for(var a=[],o=0;o<n;o++)a.push(t[o].center);r=h.fromPoints(a,r);var u=r.center,s=r.radius;for(o=0;o<n;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return r.radius=s,r};var P=new e,D=new e,L=new e;h.fromOrientedBoundingBox=function(t,r){i(r)||(r=new h);var n=t.halfAxes,a=c.getColumn(n,0,P),o=c.getColumn(n,1,D),u=c.getColumn(n,2,L);return e.add(a,o,a),e.add(a,u,a),r.center=e.clone(t.center,r.center),r.radius=e.magnitude(a),r},h.clone=function(t,r){if(i(t))return i(r)?(r.center=e.clone(t.center,r.center),r.radius=t.radius,r):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,r){r=n(r,0);var i=e.center;return t[r++]=i.x,t[r++]=i.y,t[r++]=i.z,t[r]=e.radius,t},h.unpack=function(e,t,r){t=n(t,0),i(r)||(r=new h);var a=r.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],r.radius=e[t],r};var U=new e,b=new e;h.union=function(t,r,n){i(n)||(n=new h);var a=t.center,o=t.radius,u=r.center,s=r.radius,c=e.subtract(u,a,U),l=e.magnitude(c);if(o>=l+s)return t.clone(n),n;if(s>=l+o)return r.clone(n),n;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(d,a,d),e.clone(d,n.center),n.radius=f,n};var F=new e;h.expand=function(t,r,n){n=h.clone(t,n);var i=e.magnitude(e.subtract(r,n.center,F));return i>n.radius&&(n.radius=i),n},h.intersectPlane=function(t,r){var n=t.center,i=t.radius,a=r.normal,o=e.dot(a,n)+r.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,r){return i(r)||(r=new h),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=l.getMaximumScale(t)*e.radius,r};var B=new e;h.distanceSquaredTo=function(t,r){var n=e.subtract(t.center,r,B);return e.magnitudeSquared(n)-t.radius*t.radius},h.transformWithoutScale=function(e,t,r){return i(r)||(r=new h),r.center=l.multiplyByPoint(t,e.center,r.center),r.radius=e.radius,r};var z=new e;h.computePlaneDistances=function(t,r,n,a){i(a)||(a=new s);var o=e.subtract(t.center,r,z),u=e.dot(n,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var G=new e,q=new e,W=new e,X=new e,H=new e,V=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,r,i){r=n(r,Z);var a=r.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,H),d=e.negate(c,X),p=Y,E=p[0];e.add(s,l,E),e.add(E,c,E),E=p[1],e.add(s,l,E),e.add(E,d,E),E=p[2],e.add(s,f,E),e.add(E,d,E),E=p[3],e.add(s,f,E),e.add(E,c,E),e.negate(s,s),E=p[4],e.add(s,l,E),e.add(E,c,E),E=p[5],e.add(s,l,E),e.add(E,d,E),E=p[6],e.add(s,f,E),e.add(E,d,E),E=p[7],e.add(s,f,E),e.add(E,c,E);for(var y=p.length,m=0;m<y;++m){var _=p[m];e.add(o,_,_);var T=a.cartesianToCartographic(_,V);r.project(T,_)}i=h.fromPoints(p,i),o=i.center;var v=o.x,R=o.y,A=o.z;return o.x=A,o.y=v,o.z=R,i},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,r){return t===r||i(t)&&i(r)&&e.equals(t.center,r.center)&&t.radius===r.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,r){return h.computePlaneDistances(this,e,t,r)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(r))return r;r=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(n.requestFullscreen=i,r=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(n.requestFullscreen=i,r=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?n.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(n.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?n.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(n.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?n.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(n.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),n.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),n.fullscreenerror=i)}return r},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[n.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[n.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,r){"use strict";function n(e){for(var t=e.split("."),r=0,n=t.length;r<n;++r)t[r]=parseInt(t[r],10);return t}function i(){if(!t(R)&&(R=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(R=!0,A=n(e[1]))}return R}function a(){return i()&&A}function o(){if(!t(S)&&(S=!1,!i()&&!h()&&/ Safari\/[\.0-9]+/.test(v.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(S=!0,g=n(e[1]))}return S}function u(){return o()&&g}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(v.userAgent);null!==e&&(N=!0,O=n(e[1]),O.isNightly=!!e[2])}return N}function c(){return s()&&O}function l(){if(!t(I)){I=!1;var e;"Microsoft Internet Explorer"===v.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent), +null!==e&&(I=!0,x=n(e[1]))):"Netscape"===v.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(I=!0,x=n(e[1])))}return I}function f(){return l()&&x}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(w=!0,M=n(e[1]))}return w}function d(){return h()&&M}function p(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(C=!0,P=n(e[1]))}return C}function E(){return t(D)||(D=/Windows/i.test(v.appVersion)),D}function y(){return p()&&P}function m(){return t(L)||(L="undefined"!=typeof PointerEvent&&(!t(v.pointerEnabled)||v.pointerEnabled)),L}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=e.style.imageRendering;b=t(r)&&""!==r,b&&(U=r)}return b}function T(){return _()?U:void 0}var v;v="undefined"!=typeof navigator?navigator:{};var R,A,S,g,N,O,I,x,w,M,C,P,D,L,U,b,F={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:p,firefoxVersion:y,isWindows:E,hardwareConcurrency:e(v.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:_,imageRenderingValue:T};return F.supportsFullscreen=function(){return r.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,r,n,i,a){"use strict";if(!n.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,r,n,i){switch(n=e(n,0),i=e(i,(r.byteLength-n)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(r,n,i);case o.UNSIGNED_BYTE:return new Uint8Array(r,n,i);case o.SHORT:return new Int16Array(r,n,i);case o.UNSIGNED_SHORT:return new Uint16Array(r,n,i);case o.INT:return new Int32Array(r,n,i);case o.UNSIGNED_INT:return new Uint32Array(r,n,i);case o.FLOAT:return new Float32Array(r,n,i);case o.DOUBLE:return new Float64Array(r,n,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,r,n,i){"use strict";function a(t,i,a){this.minimum=e.clone(r(t,e.ZERO)),this.maximum=e.clone(r(i,e.ZERO)),n(a)?a=e.clone(a):(a=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(a,.5,a)),this.center=a}a.fromPoints=function(t,r){if(n(r)||(r=new a),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var i=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],p=d.x,E=d.y,y=d.z;i=Math.min(p,i),s=Math.max(p,s),o=Math.min(E,o),c=Math.max(E,c),u=Math.min(y,u),l=Math.max(y,l)}var m=r.minimum;m.x=i,m.y=o,m.z=u;var _=r.maximum;_.x=s,_.y=c,_.z=l;var T=e.add(m,_,r.center);return e.multiplyByScalar(T,.5,T),r},a.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new a(t.minimum,t.maximum)},a.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return a.intersectPlane=function(t,r){o=e.subtract(t.maximum,t.minimum,o);var n=e.multiplyByScalar(o,.5,o),a=r.normal,u=n.x*Math.abs(a.x)+n.y*Math.abs(a.y)+n.z*Math.abs(a.z),s=e.dot(t.center,a)+r.distance;return s-u>0?i.INSIDE:s+u<0?i.OUTSIDE:i.INTERSECTING},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.intersectPlane=function(e){return a.intersectPlane(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,r,n,i,a){"use strict";function o(e,r){this.x=t(e,0),this.y=t(r,0)}o.fromElements=function(e,t,n){return r(n)?(n.x=e,n.y=t,n):new o(e,t)},o.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,r,n){return n=t(n,0),r[n++]=e.x,r[n]=e.y,r},o.unpack=function(e,n,i){return n=t(n,0),r(i)||(i=new o),i.x=e[n++],i.y=e[n],i},o.packArray=function(e,t){var n=e.length;r(t)?t.length=2*n:t=new Array(2*n);for(var i=0;i<n;++i)o.pack(e[i],t,2*i);return t},o.unpackArray=function(e,t){var n=e.length;r(t)?t.length=n/2:t=new Array(n/2);for(var i=0;i<n;i+=2){var a=i/2;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,r){return r.x=Math.min(e.x,t.x),r.y=Math.min(e.y,t.y),r},o.maximumByComponent=function(e,t,r){return r.x=Math.max(e.x,t.x),r.y=Math.max(e.y,t.y),r},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var r=o.magnitude(e);return t.x=e.x/r,t.y=e.y/r,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,r){return r.x=e.x*t.x,r.y=e.y*t.y,r},o.divideComponents=function(e,t,r){return r.x=e.x/t.x,r.y=e.y/t.y,r},o.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r},o.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r},o.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r},o.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,r,n){return o.multiplyByScalar(t,r,s),n=o.multiplyByScalar(e,1-r,n),o.add(s,n,n)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),a.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var r=o.normalize(e,f);return o.abs(r,r),t=r.x<=r.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,r){return e.x===t[r]&&e.y===t[r+1]},o.equalsEpsilon=function(e,t,n,i){return e===t||r(e)&&r(t)&&a.equalsEpsilon(e.x,t.x,n,i)&&a.equalsEpsilon(e.y,t.y,n,i)},o.ZERO=i(new o(0,0)),o.UNIT_X=i(new o(1,0)),o.UNIT_Y=i(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,r){return o.equalsEpsilon(this,e,t,r)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function r(e,r,n){var i=e+r;return t.sign(e)!==t.sign(r)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(r)))<n?0:i}var n={};return n.computeDiscriminant=function(e,t,r){var n=t*t-4*e*r;return n},n.computeRealRoots=function(e,n,i){var a;if(0===e)return 0===n?[]:[-i/n];if(0===n){if(0===i)return[0,0];var o=Math.abs(i),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(a=-i/e,a<0)return[];var s=Math.sqrt(a);return[-s,s]}if(0===i)return a=-n/e,a<0?[a,0]:[0,a];var c=n*n,l=4*e*i,f=r(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*r(n,t.sign(n)*Math.sqrt(f),t.EPSILON14);return n>0?[h/e,i/h]:[i/h,h/e]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function r(e,t,r,n){var i,a,o=e,u=t/3,s=r/3,c=n,l=o*s,f=u*c,h=u*u,d=s*s,p=o*s-h,E=o*c-u*s,y=u*c-d,m=4*p*y-E*E;if(m<0){var _,T,v;h*f>=l*d?(_=o,T=p,v=-2*u*p+o*E):(_=c,T=y,v=-c*E+2*s*y);var R=v<0?-1:1,A=-R*Math.abs(_)*Math.sqrt(-m);a=-v+A;var S=a/2,g=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),N=a===A?-g:-T/g;return i=T<=0?g+N:-v/(g*g+N*N+T),h*f>=l*d?[(i-u)/o]:[-c/(i+s)]}var O=p,I=-2*u*p+o*E,x=y,w=-c*E+2*s*y,M=Math.sqrt(m),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*M,-I)/3);i=2*Math.sqrt(-O);var D=Math.cos(P);a=i*D;var L=i*(-D/2-C*Math.sin(P)),U=a+L>2*u?a-u:L-u,b=o,F=U/b;P=Math.abs(Math.atan2(c*M,-w)/3),i=2*Math.sqrt(-x),D=Math.cos(P),a=i*D,L=i*(-D/2-C*Math.sin(P));var B=-c,z=a+L<2*s?a+s:L+s,G=B/z,q=b*z,W=-U*z-b*B,X=U*B,H=(s*W-u*X)/(-u*W+s*q);return F<=H?F<=G?H<=G?[F,H,G]:[F,G,H]:[G,F,H]:F<=G?[H,F,G]:H<=G?[H,G,F]:[G,H,F]}var n={};return n.computeDiscriminant=function(e,t,r,n){var i=e*e,a=t*t,o=r*r,u=n*n,s=18*e*t*r*n+a*o-27*i*u-4*(e*o*r+a*t*n);return s},n.computeRealRoots=function(e,n,i,a){var o,u;if(0===e)return t.computeRealRoots(n,i,a);if(0===n){if(0===i){if(0===a)return[0,0,0];u=-a/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===a?(o=t.computeRealRoots(e,0,i),0===o.Length?[0]:[o[0],0,o[1]]):r(e,0,i,a)}return 0===i?0===a?(u=-n/e,u<0?[u,0,0]:[0,0,u]):r(e,n,0,a):0===a?(o=t.computeRealRoots(e,n,i),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):r(e,n,i,a)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,r,n){"use strict";function i(t,i,a,o){var u=t*t,s=i-3*u/8,c=a-i*t/2+u*t/8,l=o-a*t/4+i*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<r.EPSILON14){var p=n.computeRealRoots(1,s,l);if(2===p.length){var E,y=p[0],m=p[1];if(y>=0&&m>=0){var _=Math.sqrt(y),T=Math.sqrt(m);return[h-T,h-_,h+_,h+T]}if(y>=0&&m<0)return E=Math.sqrt(y),[h-E,h+E];if(y<0&&m>=0)return E=Math.sqrt(m),[h-E,h+E]}return[]}if(d>0){var v=Math.sqrt(d),R=(s+d-c/v)/2,A=(s+d+c/v)/2,S=n.computeRealRoots(1,v,R),g=n.computeRealRoots(1,-v,A);return 0!==S.length?(S[0]+=h,S[1]+=h,0!==g.length?(g[0]+=h,g[1]+=h,S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>g[0]&&S[0]<g[1]?[g[0],S[0],g[1],S[1]]:[S[0],g[0],S[1],g[1]]):S):0!==g.length?(g[0]+=h,g[1]+=h,g):[]}}return[]}function a(t,i,a,o){var u=a*a,s=i*i,c=t*t,l=-2*i,f=a*t+s-4*o,h=c*o-a*i*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var p,E,y=d[0],m=i-y,_=m*m,T=t/2,v=m/2,R=_-4*o,A=_+4*Math.abs(o),S=c-4*y,g=c+4*Math.abs(y);if(y<0||R*g<S*A){var N=Math.sqrt(S);p=N/2,E=0===N?0:(t*v-a)/N}else{var O=Math.sqrt(R);p=0===O?0:(t*v-a)/O,E=O/2}var I,x;0===T&&0===p?(I=0,x=0):r.sign(T)===r.sign(p)?(I=T+p,x=y/I):(x=T-p,I=y/x);var w,M;0===v&&0===E?(w=0,M=0):r.sign(v)===r.sign(E)?(w=v+E,M=o/w):(M=v-E,w=o/M);var C=n.computeRealRoots(1,I,w),P=n.computeRealRoots(1,x,M);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,r,n,i){var a=e*e,o=a*e,u=t*t,s=u*t,c=r*r,l=c*r,f=n*n,h=f*n,d=i*i,p=d*i,E=u*c*f-4*s*h-4*e*l*f+18*e*t*r*h-27*a*f*f+256*o*p+i*(18*s*r*n-4*u*l+16*e*c*c-80*e*t*c*n-6*e*u*f+144*a*r*f)+d*(144*e*u*r-27*u*u-128*a*c-192*a*t*n);return E},o.computeRealRoots=function(t,n,o,u,s){if(Math.abs(t)<r.EPSILON15)return e.computeRealRoots(n,o,u,s);var c=n/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return i(c,l,f,h);case 1:return a(c,l,f,h);case 2:return a(c,l,f,h);case 3:return i(c,l,f,h);case 4:return i(c,l,f,h);case 5:return a(c,l,f,h);case 6:return i(c,l,f,h);case 7:return i(c,l,f,h);case 8:return a(c,l,f,h);case 9:return i(c,l,f,h);case 10:return i(c,l,f,h);case 11:return a(c,l,f,h);case 12:return i(c,l,f,h);case 13:return i(c,l,f,h);case 14:return i(c,l,f,h);case 15:return i(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(r,n){n=e.clone(t(n,e.ZERO)),e.equals(n,e.ZERO)||e.normalize(n,n),this.origin=e.clone(t(r,e.ZERO)),this.direction=n}return i.getPoint=function(t,n,i){return r(i)||(i=new e),i=e.multiplyByScalar(t.direction,n,i),e.add(t.origin,i,i)},i}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,r,n,i,a,o,u,s,c,l){"use strict";function f(e,t,r,n){var i=t*t-4*e*r;if(!(i<0)){if(i>0){var a=1/(2*e),o=Math.sqrt(i),u=(-t+o)*a,s=(-t-o)*a;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var c=-t/(2*e);if(0!==c)return n.root0=n.root1=c,n}}function h(t,r,i){n(i)||(i=new a);var o=t.origin,u=t.direction,s=r.center,c=r.radius*r.radius,l=e.subtract(o,s,_),h=e.dot(u,u),d=2*e.dot(u,l),p=e.magnitudeSquared(l)-c,E=f(h,d,p,A);if(n(E))return i.start=E.root0,i.stop=E.root1,i}function d(e,t,r){var n=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(n/Math.max(Math.abs(e),Math.abs(t)))<r?0:n}function p(t,r,n,i,a){var l,f=i*i,h=a*a,p=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,E=a*(i*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+r.y),y=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+i*r.x+n,m=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=a*(i*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+r.z),T=[];if(0===_&&0===m){if(l=s.computeRealRoots(p,E,y),0===l.length)return T;var v=l[0],R=Math.sqrt(Math.max(1-v*v,0));if(T.push(new e(i,a*v,a*-R)),T.push(new e(i,a*v,a*R)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(i,a*A,a*-S)),T.push(new e(i,a*A,a*S))}return T}var g=_*_,N=m*m,O=p*p,I=_*m,x=O+N,w=2*(E*p+I),M=2*y*p+E*E-N+g,C=2*(y*E-I),P=y*y-g;if(0===x&&0===w&&0===M&&0===C)return T;l=c.computeRealRoots(x,w,M,C,P);var D=l.length;if(0===D)return T;for(var L=0;L<D;++L){var U,b=l[L],F=b*b,B=Math.max(1-F,0),z=Math.sqrt(B);U=o.sign(p)===o.sign(y)?d(p*F+y,E*b,o.EPSILON12):o.sign(y)===o.sign(E*b)?d(p*F,E*b+y,o.EPSILON12):d(p*F+E*b,y,o.EPSILON12);var G=d(m*b,_,o.EPSILON15),q=U*G;q<0?T.push(new e(i,a*b,a*z)):q>0?T.push(new e(i,a*b,a*-z)):0!==z?(T.push(new e(i,a*b,a*-z)),T.push(new e(i,a*b,a*z)),++L):T.push(new e(i,a*b,a*z))}return T}var E={};E.rayPlane=function(t,r,i){n(i)||(i=new e);var a=t.origin,u=t.direction,s=r.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-r.distance-e.dot(s,a))/c;if(!(l<0))return i=e.multiplyByScalar(u,l,i),e.add(a,i,i)}};var y=new e,m=new e,_=new e,T=new e,v=new e;E.rayTriangleParametric=function(t,n,i,a,u){u=r(u,!1);var s,c,l,f,h,d=t.origin,p=t.direction,E=e.subtract(i,n,y),R=e.subtract(a,n,m),A=e.cross(p,R,_),S=e.dot(E,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(d,n,T),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,E,v),f=e.dot(p,c),f<0||l+f>S)return;h=e.dot(R,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var g=1/S;if(s=e.subtract(d,n,T),l=e.dot(s,A)*g,l<0||l>1)return;if(c=e.cross(s,E,v),f=e.dot(p,c)*g,f<0||l+f>1)return;h=e.dot(R,c)*g}return h},E.rayTriangle=function(t,r,i,a,o,u){var s=E.rayTriangleParametric(t,r,i,a,o);if(n(s)&&!(s<0))return n(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new l;E.lineSegmentTriangle=function(t,r,i,a,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(r,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,i,a,o,u);if(!(!n(l)||l<0||l>e.distance(t,r)))return n(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};E.raySphere=function(e,t,r){if(r=h(e,t,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var S=new l;E.lineSegmentSphere=function(t,r,i,a){var o=S;e.clone(t,o.origin);var u=e.subtract(r,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),a=h(o,i,a),!(!n(a)||a.stop<0||a.start>s))return a.start=Math.max(a.start,0),a.stop=Math.min(a.stop,s),a};var g=new e,N=new e;E.rayEllipsoid=function(t,r){var n,i,o,u,s,c=r.oneOverRadii,l=e.multiplyComponents(c,t.origin,g),f=e.multiplyComponents(c,t.direction,N),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var p=d*d;if(n=h-1,i=e.magnitudeSquared(f),o=i*n,p<o)return;if(p>o){u=d*d-o,s=-d+Math.sqrt(u);var E=s/i,y=n/s;return E<y?new a(E,y):{start:y,stop:E}}var m=Math.sqrt(n/i);return new a(m,m)}return h<1?(n=h-1,i=e.magnitudeSquared(f),o=i*n,u=d*d-o,s=-d+Math.sqrt(u),new a(0,s/i)):d<0?(i=e.magnitudeSquared(f),new a(0,-d/i)):void 0};var O=new e,I=new e,x=new e,w=new e,M=new e,C=new u,P=new u,D=new u,L=new u,U=new u,b=new u,F=new u,B=new e,z=new e,G=new t;E.grazingAltitudeLocation=function(t,r){var i=t.origin,a=t.direction;if(!e.equals(i,e.ZERO)){var s=r.geodeticSurfaceNormal(i,O);if(e.dot(a,s)>=0)return i}var c=n(this.rayEllipsoid(t,r)),l=r.transformPositionToScaledSpace(a,O),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,I),I),E=e.normalize(e.cross(f,d,x),x),y=C;y[0]=f.x,y[1]=f.y,y[2]=f.z,y[3]=d.x,y[4]=d.y,y[5]=d.z,y[6]=E.x,y[7]=E.y, +y[8]=E.z;var m=u.transpose(y,P),_=u.fromScale(r.radii,D),T=u.fromScale(r.oneOverRadii,L),v=U;v[0]=0,v[1]=-a.z,v[2]=a.y,v[3]=a.z,v[4]=0,v[5]=-a.x,v[6]=-a.y,v[7]=a.x,v[8]=0;var R,A,S=u.multiply(u.multiply(m,T,b),v,b),g=u.multiply(u.multiply(S,_,F),y,F),N=u.multiplyByVector(S,i,M),q=p(g,e.negate(N,O),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,z),H=Number.NEGATIVE_INFINITY,V=0;V<W;++V){R=u.multiplyByVector(_,u.multiplyByVector(y,q[V],B),B);var Y=e.normalize(e.subtract(R,i,w),w),k=e.dot(Y,a);k>H&&(H=k,X=e.clone(R,X))}var Z=r.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),A=e.magnitude(e.subtract(X,i,w))*Math.sqrt(1-H*H),A=c?-A:A,Z.height=A,r.cartographicToCartesian(Z,new e)}};var q=new e;return E.lineSegmentPlane=function(t,r,i,a){n(a)||(a=new e);var u=e.subtract(r,t,q),s=i.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(i.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,a),e.add(t,a,a),a}},E.trianglePlaneIntersection=function(t,r,n,i){var a=i.normal,o=i.distance,u=e.dot(a,t)+o<0,s=e.dot(a,r)+o<0,c=e.dot(a,n)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return E.lineSegmentPlane(t,r,i,f),E.lineSegmentPlane(t,n,i,h),{positions:[t,r,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(r,n,i,f),E.lineSegmentPlane(r,t,i,h),{positions:[t,r,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(n,t,i,f),E.lineSegmentPlane(n,r,i,h),{positions:[t,r,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(r,t,i,f),E.lineSegmentPlane(n,t,i,h),{positions:[t,r,n,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(n,r,i,f),E.lineSegmentPlane(t,r,i,h),{positions:[t,r,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,n,i,f),E.lineSegmentPlane(r,n,i,h),{positions:[t,r,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,r,n,i){"use strict";function a(t,r){this.normal=e.clone(t),this.distance=r}a.fromPointNormal=function(r,n,i){var o=-e.dot(n,r);return t(i)?(e.clone(n,i.normal),i.distance=o,i):new a(n,o)};var o=new e;return a.fromCartesian4=function(r,n){var i=e.fromCartesian4(r,o),u=r.w;return t(n)?(e.clone(i,n.normal),n.distance=u,n):new a(i,u)},a.getPointDistance=function(t,r){return e.dot(t.normal,r)+t.distance},a.ORIGIN_XY_PLANE=i(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=i(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=i(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,r,n,i){return t(e).then(r,n,i)}function t(e){var t,r;return e instanceof n?t=e:u(e)?(r=o(),e.then(function(e){r.resolve(e)},function(e){r.reject(e)},function(e){r.progress(e)}),t=r.promise):t=i(e),t}function r(t){return e(t,a)}function n(e){this.then=e}function i(e){var r=new n(function(r){try{return t(r?r(e):e)}catch(e){return a(e)}});return r}function a(e){var r=new n(function(r,n){try{return n?t(n(e)):a(e)}catch(e){return a(e)}});return r}function o(){function e(e,t,r){return h(e,t,r)}function r(e){return p(e)}function i(e){return p(a(e))}function u(e){return d(e)}var s,c,l,f,h,d,p;return c=new n(e),s={then:e,resolve:r,reject:i,progress:u,promise:c,resolver:{resolve:r,reject:i,progress:u}},l=[],f=[],h=function(e,t,r){var n,i;return n=o(),i="function"==typeof r?function(e){try{n.progress(r(e))}catch(e){n.progress(e)}}:function(e){n.progress(e)},l.push(function(r){r.then(e,t).then(n.resolve,n.reject,i)}),f.push(i),n.promise},d=function(e){return E(f,e),e},p=function(e){return e=t(e),h=e.then,p=t,d=m,E(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,r,n,i,a){return y(2,arguments),e(t,function(t){function u(e){E(e)}function s(e){p(e)}var c,l,f,h,d,p,E,y,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(r,_)),f=[],l=_-c+1,h=[],d=o(),c)for(y=d.progress,E=function(e){h.push(e),--l||(p=E=m,d.reject(h))},p=function(e){f.push(e),--c||(p=E=m,d.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,y);else d.resolve(f);return d.then(n,i,a)})}function c(e,t,r,n){function i(e){return t?t(e[0]):e[0]}return s(e,1,i,r,n)}function l(e,t,r,n){return y(1,arguments),h(e,_).then(t,r,n)}function f(){return h(arguments,_)}function h(t,r){return e(t,function(t){var n,i,a,u,s,c;if(a=i=t.length>>>0,n=[],c=o(),a)for(u=function(t,i){e(t,r).then(function(e){n[i]=e,--a||c.resolve(n)},c.reject)},s=0;s<i;s++)s in t?u(t[s],s):--a;else c.resolve(n);return c.promise})}function d(t,r){var n=v.call(arguments,1);return e(t,function(t){var i;return i=t.length,n[0]=function(t,n,a){return e(t,function(t){return e(n,function(e){return r(t,e,a,i)})})},T.apply(t,n)})}function p(t,r,n){var i=arguments.length>2;return e(t,function(e){return e=i?n:e,r.resolve(e),e},function(e){return r.reject(e),a(e)},r.progress)}function E(e,t){for(var r,n=0;r=e[n++];)r(t)}function y(e,t){for(var r,n=t.length;n>e;)if(r=t[--n],null!=r&&"function"!=typeof r)throw new Error("arg "+n+" must be a function")}function m(){}function _(e){return e}var T,v,R;return e.defer=o,e.resolve=t,e.reject=r,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=p,e.isPromise=u,n.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},v=[].slice,T=[].reduce||function(e){var t,r,n,i,a;if(a=0,t=Object(this),i=t.length>>>0,r=arguments,r.length<=1)for(;;){if(a in t){n=t[a++];break}if(++a>=i)throw new TypeError}else n=r[1];for(;a<i;++a)a in t&&(n=e(n,t[a],a,t));return n},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r,n){t(i[r])||(i[r]=!0,console.warn(e(n,r)))}var i={};return n.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.",n}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,r){"use strict";function n(e,t){r(e,t)}return n}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function r(e,t,r){for(var n,i,a=0,o=e.length-1;a<=o;)if(n=~~((a+o)/2),i=r(e[n],t),i<0)a=n+1;else{if(!(i>0))return n;o=n-1}return~(o+1)}return r}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,r,n,i){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=r,this.yPoleOffset=n,this.ut1MinusUtc=i}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,r=0,n=t[r++],i=function(e,t,r,n){r||(r=" ");var i=e.length>=t?"":Array(1+t-e.length>>>0).join(r);return n?e+i:i+e},a=function(e,t,r,n,a,o){var u=n-e.length;return u>0&&(e=r||!a?i(e,n,o,r):e.slice(0,t.length)+i("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,r,n,o,u,s){var c=e>>>0;return r=r&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+i(c.toString(t),u||0,"0",!1),a(e,r,n,o,s)},u=function(e,t,r,n,i,o){return null!=n&&(e=e.slice(0,n)),a(e,"",t,r,i,o)},s=function(e,n,s,c,l,f,h){var d,p,E,y,m;if("%%"==e)return"%";for(var _=!1,T="",v=!1,R=!1,A=" ",S=s.length,g=0;s&&g<S;g++)switch(s.charAt(g)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":A=s.charAt(g+1);break;case"0":v=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[r++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[r++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=n?t[n.slice(0,-1)]:t[r++],h){case"s":return u(String(m),_,c,f,v,A);case"c":return u(String.fromCharCode(+m),_,c,f,v);case"b":return o(m,2,R,_,c,f,v);case"o":return o(m,8,R,_,c,f,v);case"x":return o(m,16,R,_,c,f,v);case"X":return o(m,16,R,_,c,f,v).toUpperCase();case"u":return o(m,10,R,_,c,f,v);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),p=d<0?"-":T,m=p+i(String(Math.abs(d)),f,"0",!1),a(m,p,_,c,v);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,p=d<0?"-":T,E=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],y=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=p+Math.abs(d)[E](f),a(m,p,_,c,v)[y]();default:return e}};return n.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,r,n,i,a,o,u){this.year=e,this.month=t,this.day=r,this.hour=n,this.minute=i,this.second=a,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(e,t){return E.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var r=E.leapSeconds,n=t(r,T,l);n<0&&(n=~n),n>=r.length&&(n=r.length-1);var i=r[n].offset;if(n>0){var a=E.secondsDifference(r[n].julianDate,e);a>i&&(n--,i=r[n].offset)}E.addSeconds(e,i,e)}function h(e,r){T.julianDate=e;var n=E.leapSeconds,i=t(n,T,l);if(i<0&&(i=~i),0===i)return E.addSeconds(e,-n[0].offset,r);if(i>=n.length)return E.addSeconds(e,-n[i-1].offset,r);var a=E.secondsDifference(n[i].julianDate,e);return 0===a?E.addSeconds(e,-n[i].offset,r):a<=1?void 0:E.addSeconds(e,-n[--i].offset,r)}function d(e,t,r){var n=t/s.SECONDS_PER_DAY|0;return e+=n,t-=s.SECONDS_PER_DAY*n,t<0&&(e--,t+=s.SECONDS_PER_DAY),r.dayNumber=e,r.secondsOfDay=t,r}function p(e,t,r,n,i,a,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+r-32075;n-=12,n<0&&(n+=24);var f=a+(n*s.SECONDS_PER_HOUR+i*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function E(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=r(e,0),t=r(t,0),n=r(n,c.UTC);var i=0|e;t+=(e-i)*s.SECONDS_PER_DAY,d(i,t,this),n===c.UTC&&f(this)}var y=new a,m=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,v=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,g=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+N.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,x=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;E.fromDate=function(e,t){var r=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return n(t)?(d(r[0],r[1],t),f(t),t):new E(r[0],r[1],c.UTC)},E.fromIso8601=function(e,t){e=e.replace(",",".");var r,i,a,u=e.split("T"),s=1,l=1,h=0,y=0,T=0,N=0,w=u[0],M=u[1];if(u=w.match(g),null!==u)r=+u[1],s=+u[2],l=+u[3];else if(u=w.match(R),null!==u)r=+u[1],s=+u[2];else if(u=w.match(v),null!==u)r=+u[1];else{var C;if(u=w.match(A),null!==u)r=+u[1],C=+u[2],a=o(r);else if(u=w.match(S),null!==u){r=+u[1];var P=+u[2],D=+u[3]||0,L=new Date(Date.UTC(r,0,4));C=7*P+D-L.getUTCDay()-3}i=new Date(Date.UTC(r,0,1)),i.setUTCDate(C),s=i.getUTCMonth()+1,l=i.getUTCDate()}a=o(r);var U;if(n(M)){u=M.match(x),null!==u?(h=+u[1],y=+u[2],T=+u[3],N=1e3*+(u[4]||0),U=5):(u=M.match(I),null!==u?(h=+u[1],y=+u[2],T=60*+(u[3]||0),U=4):(u=M.match(O),null!==u&&(h=+u[1],y=60*+(u[2]||0),U=3)));var b=u[U],F=+u[U+1],B=+(u[U+2]||0);switch(b){case"+":h-=F,y-=B;break;case"-":h+=F,y+=B;break;case"Z":break;default:y+=new Date(Date.UTC(r,s-1,l,h,y)).getTimezoneOffset()}}else y+=new Date(r,s-1,l).getTimezoneOffset();var z=60===T;for(z&&T--;y>=60;)y-=60,h++;for(;h>=24;)h-=24,l++;for(i=a&&2===s?_:m[s-1];l>i;)l-=i,s++,s>12&&(s-=12,r++),i=a&&2===s?_:m[s-1];for(;y<0;)y+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,r--),i=a&&2===s?_:m[s-1],l+=i;var G=p(r,s,l,h,y,T,N);return n(t)?(d(G[0],G[1],t),f(t)):t=new E(G[0],G[1],c.UTC),z&&E.addSeconds(t,1,t),t},E.now=function(e){return E.fromDate(new Date,e)};var w=new E(0,0,c.TAI);return E.toGregorianDate=function(e,t){var r=!1,i=h(e,w);n(i)||(E.addSeconds(e,-1,w),i=h(w,w),r=!0);var o=i.dayNumber,u=i.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,p=c-(2447*d/80|0)|0;c=d/11|0;var y=d+2-12*c|0,m=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,v=T/s.SECONDS_PER_MINUTE|0;T-=v*s.SECONDS_PER_MINUTE;var R=0|T,A=(T-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),r&&(R+=1),n(t)?(t.year=m,t.month=y,t.day=p,t.hour=_,t.minute=v,t.second=R,t.millisecond=A,t.isLeapSecond=r,t):new a(m,y,p,_,v,R,A,r)},E.toDate=function(e){var t=E.toGregorianDate(e,y),r=t.second;return t.isLeapSecond&&(r-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,r,t.millisecond))},E.toIso8601=function(t,r){var i,a=E.toGregorianDate(t,a);return n(r)||0===a.millisecond?n(r)&&0!==r?(i=(.01*a.millisecond).toFixed(r).replace(".","").slice(0,r),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",a.year,a.month,a.day,a.hour,a.minute,a.second):(i=(.01*a.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",a.year,a.month,a.day,a.hour,a.minute,a.second,i))},E.clone=function(e,t){if(n(e))return n(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new E(e.dayNumber,e.secondsOfDay,c.TAI)},E.compare=function(e,t){var r=e.dayNumber-t.dayNumber;return 0!==r?r:e.secondsOfDay-t.secondsOfDay},E.equals=function(e,t){return e===t||n(e)&&n(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},E.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(E.secondsDifference(e,t))<=r},E.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},E.secondsDifference=function(e,t){var r=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return r+(e.secondsOfDay-t.secondsOfDay)},E.daysDifference=function(e,t){var r=e.dayNumber-t.dayNumber,n=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return r+n},E.computeTaiMinusUtc=function(e){T.julianDate=e;var r=E.leapSeconds,n=t(r,T,l);return n<0&&(n=~n,--n,n<0&&(n=0)),r[n].offset},E.addSeconds=function(e,t,r){return d(e.dayNumber,e.secondsOfDay+t,r)},E.addMinutes=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,n,r)},E.addHours=function(e,t,r){var n=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,n,r)},E.addDays=function(e,t,r){var n=e.dayNumber+t;return d(n,e.secondsOfDay,r)},E.lessThan=function(e,t){return E.compare(e,t)<0},E.lessThanOrEquals=function(e,t){return E.compare(e,t)<=0},E.greaterThan=function(e,t){return E.compare(e,t)>0},E.greaterThanOrEquals=function(e,t){return E.compare(e,t)>=0},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return E.toIso8601(this)},E.leapSeconds=[new u(new E(2441317,43210,c.TAI),10),new u(new E(2441499,43211,c.TAI),11),new u(new E(2441683,43212,c.TAI),12),new u(new E(2442048,43213,c.TAI),13),new u(new E(2442413,43214,c.TAI),14),new u(new E(2442778,43215,c.TAI),15),new u(new E(2443144,43216,c.TAI),16),new u(new E(2443509,43217,c.TAI),17),new u(new E(2443874,43218,c.TAI),18),new u(new E(2444239,43219,c.TAI),19),new u(new E(2444786,43220,c.TAI),20),new u(new E(2445151,43221,c.TAI),21),new u(new E(2445516,43222,c.TAI),22),new u(new E(2446247,43223,c.TAI),23),new u(new E(2447161,43224,c.TAI),24),new u(new E(2447892,43225,c.TAI),25),new u(new E(2448257,43226,c.TAI),26),new u(new E(2448804,43227,c.TAI),27),new u(new E(2449169,43228,c.TAI),28),new u(new E(2449534,43229,c.TAI),29),new u(new E(2450083,43230,c.TAI),30),new u(new E(2450630,43231,c.TAI),31),new u(new E(2451179,43232,c.TAI),32),new u(new E(2453736,43233,c.TAI),33),new u(new E(2454832,43234,c.TAI),34),new u(new E(2456109,43235,c.TAI),35),new u(new E(2457204,43236,c.TAI),36),new u(new E(2457754,43237,c.TAI),37)],E}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(r,n){if(null===r||"object"!=typeof r)return r;n=e(n,!1);var i=new r.constructor;for(var a in r)if(r.hasOwnProperty(a)){var o=r[a];n&&(o=t(o,n)),i[a]=o}return i}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var r=e.split("\r\n"),n=0;n<r.length;++n){var i=r[n],a=i.indexOf(": ");if(a>0){var o=i.substring(0,a),u=i.substring(a+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function r(e,r,n){this.statusCode=e,this.response=r,this.responseHeaders=n,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return r.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},r}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var r=n.exec(t);this.scheme=r[1],this.authority=r[2],this.path=r[3],this.query=r[4],this.fragment=r[5]}}function t(e){var t=unescape(e);return a.test(t)?t:e.toUpperCase()}function r(e,t,r,n){return(t||"")+r.toLowerCase()+(n||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var n=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,r).replace(i,t)),this.path&&(this.path=this.path.replace(i,t)),this.query&&(this.query=this.query.replace(i,t)),this.fragment&&(this.fragment=this.fragment.replace(i,t))};var i=/%[0-9a-z]{2}/gi,a=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var r=new e;return this.scheme?(r.scheme=this.scheme,r.authority=this.authority,r.path=this.path,r.query=this.query):(r.scheme=t.scheme,this.authority?(r.authority=this.authority,r.path=this.path,r.query=this.query):(r.authority=t.authority,""==this.path?(r.path=t.path,r.query=this.query||t.query):("/"==this.path.charAt(0)?(r.path=this.path,r.removeDotSegments()):(t.authority&&""==t.path?r.path="/"+this.path:r.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,r.removeDotSegments()),r.query=this.query))),r.fragment=this.fragment,r},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),r=[],n=""==t[0];n&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?r.pop():"."!=e&&r.push(e);"."!=e&&".."!=e||r.push(""),n&&r.unshift(""),this.path=r.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(r){var n=new e(r);n.normalize();var i=n.getAuthority();if(t(i)){if(i.indexOf("@")!==-1){var a=i.split("@");i=a[1]}if(i.indexOf(":")===-1){var o=n.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)i+=":80";else{if("https"!==o)return;i+=":443"}}return i}}var i={},a={};return i.add=function(e,r){var n=e.toLowerCase()+":"+r;t(a[n])||(a[n]=!0)},i.remove=function(e,r){var n=e.toLowerCase()+":"+r;t(a[n])&&delete a[n]},i.contains=function(e){var r=n(e);return!(!t(r)||!t(a[r]))},i.clear=function(){a={}},i}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,r,n,i,a,o){"use strict";function u(r){r=t(r,t.EMPTY_OBJECT);var n=r.responseType,i=t(r.method,"GET"),a=r.data,o=r.headers,s=r.overrideMimeType;return e(r.url,function(t){var r=e.defer();return u.load(t,n,i,a,o,r,s),r.promise})}function s(e,t){var r=decodeURIComponent(t);return e?atob(r):r}function c(e,t){for(var r=s(e,t),n=new ArrayBuffer(r.length),i=new Uint8Array(n),a=0;a<r.length;a++)i[a]=r.charCodeAt(a);return n}function l(e,r){r=t(r,"");var n=e[1],i=!!e[2],a=e[3];switch(r){case"":case"text":return s(i,a);case"arraybuffer":return c(i,a);case"blob":var o=c(i,a);return new Blob([o],{type:n});case"document":var u=new DOMParser;return u.parseFromString(s(i,a),n);case"json":return JSON.parse(s(i,a))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,n,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var p=new XMLHttpRequest;if(o.contains(e)&&(p.withCredentials=!0),r(h)&&r(p.overrideMimeType)&&p.overrideMimeType(h),p.open(n,e,!0),r(s))for(var E in s)s.hasOwnProperty(E)&&p.setRequestHeader(E,s[E]);r(t)&&(p.responseType=t),p.onload=function(){if(p.status<200||p.status>=300)return void c.reject(new i(p.status,p.response,p.getAllResponseHeaders()));var e=p.response,n=p.responseType;if(!r(e)||r(t)&&n!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===n||"document"===n)&&r(p.responseXML)&&p.responseXML.hasChildNodes()?c.resolve(p.responseXML):""!==n&&"text"!==n||!r(p.responseText)?c.reject(new a("Invalid XMLHttpRequest response type.")):c.resolve(p.responseText);else c.resolve(e)},p.onerror=function(e){c.reject(new i)},p.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,r){return e({url:t,headers:r})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,r,n){"use strict";function i(r,i){return t(i)?t(i.Accept)||(i=e(i),i.Accept=a.Accept):i=a,n(r,i).then(function(e){return JSON.parse(e)})}var a={Accept:"application/json,*/*;q=0.01"};return i}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,r,n,i,a,o,u,s,c,l,f){"use strict";function h(t){if(t=r(t,r.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=r(t.addNewLeapSeconds,!0),n(t.data))p(this,t.data);else if(n(t.url)){var i=this;this._downloadPromise=e(s(t.url),function(e){p(i,e)},function(){i._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function p(e,r){if(!n(r.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!n(r.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var i=r.columnNames.indexOf("modifiedJulianDateUtc"),a=r.columnNames.indexOf("xPoleWanderRadians"),s=r.columnNames.indexOf("yPoleWanderRadians"),c=r.columnNames.indexOf("ut1MinusUtcSeconds"),h=r.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=r.columnNames.indexOf("yCelestialPoleOffsetRadians"),E=r.columnNames.indexOf("taiMinusUtcSeconds");if(i<0||a<0||s<0||c<0||h<0||p<0||E<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var y=e._samples=r.samples,m=e._dates=[];e._dateColumn=i,e._xPoleWanderRadiansColumn=a,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=E,e._columnCount=r.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,v=0,R=y.length;v<R;v+=e._columnCount){var A=y[v+i],S=y[v+E],g=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(m.push(N),T){if(S!==_&&n(_)){var O=o.leapSeconds,I=t(O,N,d);if(I<0){var x=new u(N,S);O.splice(~I,0,x)}}_=S}}}function E(e,t,r,n,i){var a=r*n;i.xPoleWander=t[a+e._xPoleWanderRadiansColumn],i.yPoleWander=t[a+e._yPoleWanderRadiansColumn],i.xPoleOffset=t[a+e._xCelestialPoleOffsetRadiansColumn],i.yPoleOffset=t[a+e._yCelestialPoleOffsetRadiansColumn],i.ut1MinusUtc=t[a+e._ut1MinusUtcSecondsColumn]}function y(e,t,r){return t+e*(r-t)}function m(e,t,r,n,i,a,u){var s=e._columnCount;if(a>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[i],l=t[a];if(c.equals(l)||n.equals(c))return E(e,r,i,s,u),u;if(n.equals(l))return E(e,r,a,s,u),u;var f=o.secondsDifference(n,c)/o.secondsDifference(l,c),h=i*s,d=a*s,p=r[h+e._ut1MinusUtcSecondsColumn],m=r[d+e._ut1MinusUtcSecondsColumn],_=m-p;if(_>.5||_<-.5){var T=r[h+e._taiMinusUtcSecondsColumn],v=r[d+e._taiMinusUtcSecondsColumn];T!==v&&(l.equals(n)?p=m:m-=v-T)}return u.xPoleWander=y(f,r[h+e._xPoleWanderRadiansColumn],r[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=y(f,r[h+e._yPoleWanderRadiansColumn],r[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=y(f,r[h+e._xCelestialPoleOffsetRadiansColumn],r[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=y(f,r[h+e._yCelestialPoleOffsetRadiansColumn],r[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=y(f,p,m),u}return h.NONE=a({getPromiseToLoad:function(){return e()},compute:function(e,t){return n(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new i(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,r){if(n(this._samples)){if(n(r)||(r=new i(0,0,0,0,0)),0===this._samples.length)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;var a=this._dates,u=this._lastIndex,s=0,l=0;if(n(u)){var f=a[u],h=a[u+1],d=o.lessThanOrEquals(f,e),p=!n(h),E=p||o.greaterThanOrEquals(h,e);if(d&&E)return s=u,!p&&h.equals(e)&&++s,l=s+1,m(this,a,this._samples,e,s,l,r),r}var y=t(a,e,o.compare,this._dateColumn);return y>=0?(y<a.length-1&&a[y+1].equals(e)&&++y,s=y,l=y):(l=~y,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,a,this._samples,e,s,l,r),r}if(n(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(r,n){n=t(n,document.location.href);var i=new e(n),a=new e(r);return a.resolve(i).toString()}return i}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,r,n){"use strict";function i(n,i,a){if(a=t(a,!0),n instanceof e||(n=new e(n)),i instanceof e||(i=new e(i)),"data"===n.scheme)return n.toString();if("data"===i.scheme)return i.toString();r(i.authority)&&!r(i.scheme)&&("undefined"!=typeof document&&r(document.location)&&r(document.location.href)?i.scheme=new e(document.location.href).scheme:i.scheme=n.scheme);var o=n;i.isAbsolute()&&(o=i);var u="";r(o.scheme)&&(u+=o.scheme+":"),r(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===n?a?n.path.replace(/\/?$/,"/")+i.path.replace(/^\/?/g,""):n.path+i.path:i.path;var s=r(n.query),c=r(i.query);s&&c?u+="?"+n.query+"&"+i.query:s&&!c?u+="?"+n.query:!s&&c&&(u+="?"+i.query);var l=r(i.fragment);return r(n.fragment)&&!l?u+="#"+n.fragment:l&&(u+="#"+i.fragment),u}return i}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,r,n,i,a){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,r=e.length;t<r;++t){var n=e[t].getAttribute("src"),i=p.exec(n);if(null!==i)return i[1]}}function u(){if(t(f))return f;var r;return r="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(n(r))}function s(e){return a.toUrl("../"+e)}function c(e){return i(u(),e)}function l(e){t(h)||(h=t(a.toUrl)?s:c),t(d)||(d=document.createElement("a"));var r=h(e);return d.href=r,d.href=d.href,d.href}var f,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=p,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,r){this.x=e,this.y=t,this.s=r}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,r,n,i,a,o,u){"use strict";function s(e){e=r(e,r.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=r(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=r(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new a(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=r(e.stepSizeDays,1),this._samplesPerXysFile=r(e.samplesPerXysFile,1e3),this._totalSamples=r(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){n[s]=o,i[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(n[s]*=s-c);n[s]=1/n[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,r){var n=f;return n.dayNumber=t,n.secondsOfDay=r,a.daysDifference(n,e._sampleZeroDateTT)}function l(r,i){if(r._chunkDownloadsInProgress[i])return r._chunkDownloadsInProgress[i];var a=e.defer();r._chunkDownloadsInProgress[i]=a;var u,s=r._xysFileUrlTemplate;return u=n(s)?s.replace("{0}",i):t("Assets/IAU2006_XYS/IAU2006_XYS_"+i+".json"),e(o(u),function(e){r._chunkDownloadsInProgress[i]=!1;for(var t=r._samples,n=e.samples,o=i*r._samplesPerXysFile*3,u=0,s=n.length;u<s;++u)t[o+u]=n[u];a.resolve()}),a.promise}var f=new a(0,0,u.TAI);return s.prototype.preload=function(t,r,n,i){var a=c(this,t,r),o=c(this,n,i),u=a/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder; +s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],p=f;p<=h;++p)d.push(l(this,p));return e.all(d)},s.prototype.computeXysRadians=function(e,t,r){var a=c(this,e,t);if(!(a<0)){var o=a/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(n(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),n(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){n(r)?(r.x=0,r.y=0,r.s=0):r=new i(0,0,0);var p,E,y=a-s*this._stepSizeDays,m=this._work,_=this._denominators,T=this._coef,v=this._xTable;for(p=0;p<=u;++p)m[p]=y-v[p];for(p=0;p<=u;++p){for(T[p]=1,E=0;E<=u;++E)E!==p&&(T[p]*=m[E]);T[p]*=_[p];var R=3*(s+p);r.x+=T[p]*d[R++],r.y+=T[p]*d[R++],r.s+=T[p]*d[R]}return r}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,r,n){"use strict";function i(t,r,n){this.heading=e(t,0),this.pitch=e(r,0),this.roll=e(n,0)}return i.fromQuaternion=function(e,r){t(r)||(r=new i);var n=2*(e.w*e.y-e.z*e.x),a=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return r.heading=-Math.atan2(s,u),r.roll=Math.atan2(o,a),r.pitch=-Math.asin(n),r},i.fromDegrees=function(e,r,a,o){return t(o)||(o=new i),o.heading=e*n.RADIANS_PER_DEGREE,o.pitch=r*n.RADIANS_PER_DEGREE,o.roll=a*n.RADIANS_PER_DEGREE,o},i.clone=function(e,r){if(t(e))return t(r)?(r.heading=e.heading,r.pitch=e.pitch,r.roll=e.roll,r):new i(e.heading,e.pitch,e.roll)},i.equals=function(e,r){return e===r||t(e)&&t(r)&&e.heading===r.heading&&e.pitch===r.pitch&&e.roll===r.roll},i.equalsEpsilon=function(e,r,i,a){return e===r||t(e)&&t(r)&&n.equalsEpsilon(e.heading,r.heading,i,a)&&n.equalsEpsilon(e.pitch,r.pitch,i,a)&&n.equalsEpsilon(e.roll,r.roll,i,a)},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i.prototype.equalsEpsilon=function(e,t,r){return i.equalsEpsilon(this,e,t,r)},i.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},i}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,r,n,i,a,o,u,s,c){"use strict";function l(e,t,n,i){this.x=r(e,0),this.y=r(t,0),this.z=r(n,0),this.w=r(i,0)}var f=new e;l.fromAxisAngle=function(t,r,i){var a=r/2,o=Math.sin(a);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(a);return n(i)?(i.x=u,i.y=s,i.z=c,i.w=h,i):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var r,i,a,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],p=e[c.COLUMN2ROW2],E=s+f+p;if(E>0)r=Math.sqrt(E+1),u=.5*r,r=.5/r,i=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*r,a=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*r,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*r;else{var y=h,m=0;f>s&&(m=1),p>s&&p>f&&(m=2);var _=y[m],T=y[_];r=Math.sqrt(e[c.getElementIndex(m,m)]-e[c.getElementIndex(_,_)]-e[c.getElementIndex(T,T)]+1);var v=d;v[m]=.5*r,r=.5/r,u=(e[c.getElementIndex(T,_)]-e[c.getElementIndex(_,T)])*r,v[_]=(e[c.getElementIndex(_,m)]+e[c.getElementIndex(m,_)])*r,v[T]=(e[c.getElementIndex(T,m)]+e[c.getElementIndex(m,T)])*r,i=-v[0],a=-v[1],o=-v[2]}return n(t)?(t.x=i,t.y=a,t.z=o,t.w=u,t):new l(i,a,o,u)};var p=new l,E=new l,y=new l,m=new l;l.fromHeadingPitchRoll=function(t,r,n,a){var o;return t instanceof u?(o=t,a=r):(i("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,r,n)),m=l.fromAxisAngle(e.UNIT_X,o.roll,p),y=l.fromAxisAngle(e.UNIT_Y,-o.pitch,a),a=l.multiply(y,m,y),E=l.fromAxisAngle(e.UNIT_Z,-o.heading,p),l.multiply(E,a,a)};var _=new e,T=new e,v=new l,R=new l,A=new l;l.packedLength=4,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t},l.unpack=function(e,t,i){return t=r(t,0),n(i)||(i=new l),i.x=e[t],i.y=e[t+1],i.z=e[t+2],i.w=e[t+3],i},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,r,n){l.unpack(e,4*r,A),l.conjugate(A,A);for(var i=0,a=r-t+1;i<a;i++){var o=3*i;l.unpack(e,4*(t+i),v),l.multiply(v,A,v),v.w<0&&l.negate(v,v),l.computeAxis(v,_);var u=l.computeAngle(v);n[o]=_.x*u,n[o+1]=_.y*u,n[o+2]=_.z*u}},l.unpackInterpolationResult=function(t,r,i,a,o){n(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(r,4*a,R),0===u?l.clone(l.IDENTITY,v):l.fromAxisAngle(T,u,v),l.multiply(v,R,o)},l.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var r=1/l.magnitude(e),n=e.x*r,i=e.y*r,a=e.z*r,o=e.w*r;return t.x=n,t.y=i,t.z=a,t.w=o,t},l.inverse=function(e,t){var r=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/r,t)},l.add=function(e,t,r){return r.x=e.x+t.x,r.y=e.y+t.y,r.z=e.z+t.z,r.w=e.w+t.w,r},l.subtract=function(e,t,r){return r.x=e.x-t.x,r.y=e.y-t.y,r.z=e.z-t.z,r.w=e.w-t.w,r},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,r){var n=e.x,i=e.y,a=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+n*l+i*c-a*s,h=o*s-n*c+i*l+a*u,d=o*c+n*s-i*u+a*l,p=o*l-n*u-i*s-a*c;return r.x=f,r.y=h,r.z=d,r.w=p,r},l.multiplyByScalar=function(e,t,r){return r.x=e.x*t,r.y=e.y*t,r.z=e.z*t,r.w=e.w*t,r},l.divideByScalar=function(e,t,r){return r.x=e.x/t,r.y=e.y/t,r.z=e.z/t,r.w=e.w/t,r},l.computeAxis=function(e,t){var r=e.w;if(Math.abs(r-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var n=1/Math.sqrt(1-r*r);return t.x=e.x*n,t.y=e.y*n,t.z=e.z*n,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var S=new l;l.lerp=function(e,t,r,n){return S=l.multiplyByScalar(t,r,S),n=l.multiplyByScalar(e,1-r,n),l.add(S,n,n)};var g=new l,N=new l,O=new l;l.slerp=function(e,t,r,n){var i=l.dot(e,t),a=t;if(i<0&&(i=-i,a=g=l.negate(t,g)),1-i<s.EPSILON6)return l.lerp(e,a,r,n);var o=Math.acos(i);return N=l.multiplyByScalar(e,Math.sin((1-r)*o),N),O=l.multiplyByScalar(a,Math.sin(r*o),O),n=l.add(N,O,n),l.multiplyByScalar(n,1/Math.sin(o),n)},l.log=function(t,r){var n=s.acosClamped(t.w),i=0;return 0!==n&&(i=n/Math.sin(n)),e.multiplyByScalar(t,i,r)},l.exp=function(t,r){var n=e.magnitude(t),i=0;return 0!==n&&(i=Math.sin(n)/n),r.x=t.x*i,r.y=t.y*i,r.z=t.z*i,r.w=Math.cos(n),r};var I=new e,x=new e,w=new l,M=new l;l.computeInnerQuadrangle=function(t,r,n,i){var a=l.conjugate(r,w);l.multiply(a,n,M);var o=l.log(M,I);l.multiply(a,t,M);var u=l.log(M,x);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(r,w,i)},l.squad=function(e,t,r,n,i,a){var o=l.slerp(e,t,i,w),u=l.slerp(r,n,i,M);return l.slerp(o,u,2*i*(1-i),a)};for(var C=new l,P=1.9011074535173003,D=a.supportsTypedArrays()?new Float32Array(8):[],L=a.supportsTypedArrays()?new Float32Array(8):[],U=a.supportsTypedArrays()?new Float32Array(8):[],b=a.supportsTypedArrays()?new Float32Array(8):[],F=0;F<7;++F){var B=F+1,z=2*B+1;D[F]=1/(B*z),L[F]=B/z}return D[7]=P/136,L[7]=8*P/17,l.fastSlerp=function(e,t,r,n){var i,a=l.dot(e,t);a>=0?i=1:(i=-1,a=-a);for(var o=a-1,u=1-r,s=r*r,c=u*u,f=7;f>=0;--f)U[f]=(D[f]*s-L[f])*o,b[f]=(D[f]*c-L[f])*o;var h=i*r*(1+U[0]*(1+U[1]*(1+U[2]*(1+U[3]*(1+U[4]*(1+U[5]*(1+U[6]*(1+U[7])))))))),d=u*(1+b[0]*(1+b[1]*(1+b[2]*(1+b[3]*(1+b[4]*(1+b[5]*(1+b[6]*(1+b[7])))))))),p=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,h,n),l.add(p,n,n)},l.fastSquad=function(e,t,r,n,i,a){var o=l.fastSlerp(e,t,i,w),u=l.fastSlerp(r,n,i,M);return l.fastSlerp(o,u,2*i*(1-i),a)},l.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.x-t.x)<=r&&Math.abs(e.y-t.y)<=r&&Math.abs(e.z-t.z)<=r&&Math.abs(e.w-t.w)<=r},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,E,y,m,_,T,v){"use strict";var R={},A={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},S={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},g={},N={east:new r,north:new r,up:new r,west:new r,south:new r,down:new r},O=new r,I=new r,x=new r;R.localFrameToFixedFrameGenerator=function(e,t){if(!A.hasOwnProperty(e)||!A[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var n,i=A[e][t],a=e+t;return u(g[a])?n=g[a]:(n=function(n,a,s){if(u(s)||(s=new _),y.equalsEpsilon(n.x,0,y.EPSILON14)&&y.equalsEpsilon(n.y,0,y.EPSILON14)){var c=y.sign(n.z);r.unpack(S[e],0,O),"east"!==e&&"west"!==e&&r.multiplyByScalar(O,c,O),r.unpack(S[t],0,I),"east"!==t&&"west"!==t&&r.multiplyByScalar(I,c,I),r.unpack(S[i],0,x),"east"!==i&&"west"!==i&&r.multiplyByScalar(x,c,x)}else{a=o(a,h.WGS84),a.geodeticSurfaceNormal(n,N.up);var l=N.up,f=N.east;f.x=-n.y,f.y=n.x,f.z=0,r.normalize(f,N.east),r.cross(l,f,N.north),r.multiplyByScalar(N.up,-1,N.down),r.multiplyByScalar(N.east,-1,N.west),r.multiplyByScalar(N.north,-1,N.south),O=N[e],I=N[t],x=N[i]}return s[0]=O.x,s[1]=O.y,s[2]=O.z,s[3]=0,s[4]=I.x,s[5]=I.y,s[6]=I.z,s[7]=0,s[8]=x.x,s[9]=x.y,s[10]=x.z,s[11]=0,s[12]=n.x,s[13]=n.y,s[14]=n.z,s[15]=1,s},g[a]=n),n},R.eastNorthUpToFixedFrame=R.localFrameToFixedFrameGenerator("east","north"),R.northEastDownToFixedFrame=R.localFrameToFixedFrameGenerator("north","east"),R.northUpEastToFixedFrame=R.localFrameToFixedFrameGenerator("north","up"),R.northWestUpToFixedFrame=R.localFrameToFixedFrameGenerator("north","west");var w=new T,M=new r(1,1,1),C=new _;R.headingPitchRollToFixedFrame=function(e,t,n,i,a){i instanceof _&&(a=i,i=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),i=o(i,R.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,w),c=_.fromTranslationQuaternionRotationScale(r.ZERO,u,M,C);return a=i(e,n,a),_.multiply(a,c,a)};var P=new _,D=new m;R.headingPitchRollQuaternion=function(e,t,r,n,i){n instanceof T&&(i=n,n=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var a=R.headingPitchRollToFixedFrame(e,t,r,n,P),o=_.getRotation(a,D);return T.fromRotationMatrix(o,i)};var L=24110.54841,U=8640184.812866,b=.093104,F=-62e-7,B=1.1772758384668e-19,z=72921158553e-15,G=y.TWO_PI/86400,q=new E;R.computeTemeToPseudoFixedMatrix=function(e,t){q=E.addSeconds(e,-E.computeTaiMinusUtc(e),q);var r,n=q.dayNumber,i=q.secondsOfDay,a=n-2451545;r=i>=43200?(a+.5)/v.DAYS_PER_JULIAN_CENTURY:(a-.5)/v.DAYS_PER_JULIAN_CENTURY;var o=L+r*(U+r*(b+r*F)),s=o*G%y.TWO_PI,c=z+B*(n-2451545.5),l=(i+.5*v.SECONDS_PER_DAY)%v.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;R.preloadIcrfFixed=function(t){var r=t.start.dayNumber,n=t.start.secondsOfDay+W,i=t.stop.dayNumber,a=t.stop.secondsOfDay+W,o=R.iau2006XysData.preload(r,n,i,a),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new m);var r=R.computeFixedToIcrfMatrix(e,t);if(u(r))return m.transpose(r,t)};var H=new p(0,0,0),V=new f(0,0,0,0,0,0),Y=new m,k=new m;R.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new m);var r=R.earthOrientationParameters.compute(e,V);if(u(r)){var n=e.dayNumber,i=e.secondsOfDay+W,a=R.iau2006XysData.computeXysRadians(n,i,H);if(u(a)){var o=a.x+r.xPoleOffset,s=a.y+r.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=m.fromRotationZ(-a.s,k),h=m.multiply(l,f,Y),d=e.dayNumber,p=e.secondsOfDay-E.computeTaiMinusUtc(e)+r.ut1MinusUtc,_=d-2451545,T=p/v.SECONDS_PER_DAY,A=.779057273264+T+.00273781191135448*(_+T);A=A%1*y.TWO_PI;var S=m.fromRotationZ(A,k),g=m.multiply(h,S,Y),N=Math.cos(r.xPoleWander),O=Math.cos(r.yPoleWander),I=Math.sin(r.xPoleWander),x=Math.sin(r.yPoleWander),w=n-X+i/v.SECONDS_PER_DAY;w/=36525;var M=-47e-6*w*y.RADIANS_PER_DEGREE/3600,C=Math.cos(M),P=Math.sin(M),D=k;return D[0]=N*C,D[1]=N*P,D[2]=I,D[3]=-O*P+x*I*C,D[4]=O*C+x*I*P,D[5]=-x*N,D[6]=-x*P-O*I*C,D[7]=x*C-O*I*P,D[8]=O*N,m.multiply(g,D,t)}}};var Z=new n;R.pointToWindowCoordinates=function(e,t,r,n){return n=R.pointToGLWindowCoordinates(e,t,r,n),n.y=2*t[5]-n.y,n},R.pointToGLWindowCoordinates=function(e,r,i,a){u(a)||(a=new t);var o=Z;return _.multiplyByVector(e,n.fromElements(i.x,i.y,i.z,1,o),o),n.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(r,o,o),t.fromCartesian4(o,a)};var j=new r,K=new r,J=new r;R.rotationMatrixFromPositionVelocity=function(e,t,n,i){var a=o(n,h.WGS84).geodeticSurfaceNormal(e,j),s=r.cross(t,a,K);r.equalsEpsilon(s,r.ZERO,y.EPSILON6)&&(s=r.clone(r.UNIT_X,s));var c=r.cross(s,t,J);return r.cross(t,c,s),r.negate(s,s),u(i)||(i=new m),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=s.x,i[4]=s.y,i[5]=s.z,i[6]=c.x,i[7]=c.y,i[8]=c.z,i};var Q=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new i,ee=new r,te=new r,re=new m,ne=new _,ie=new _;return R.basisTo2D=function(e,t,n){var i=_.getTranslation(t,te),a=e.ellipsoid,o=a.cartesianToCartographic(i,$),u=e.project(o,ee);r.fromElements(u.z,u.x,u.y,u);var s=R.eastNorthUpToFixedFrame(i,a,ne),c=_.inverseTransformation(s,ie),l=_.getRotation(t,re),f=_.multiplyByMatrix3(c,l,n);return _.multiply(Q,f,n),_.setTranslation(n,u,n),n},R.wgs84To2DModelMatrix=function(e,t,n){var i=e.ellipsoid,a=R.eastNorthUpToFixedFrame(t,i,ne),o=_.inverseTransformation(a,ie),u=i.cartesianToCartographic(t,$),s=e.project(u,ee);r.fromElements(s.z,s.x,s.y,s);var c=_.fromTranslation(s,ne);return _.multiply(Q,o,n),_.multiply(c,n,n),n},R}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d){"use strict";function p(e,t){t=i(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var n=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=r.fromCartesian4(l.getColumn(n,0,E)),this._yAxis=r.fromCartesian4(l.getColumn(n,1,E));var a=r.fromCartesian4(l.getColumn(n,2,E));this._plane=f.fromPointNormal(e,a)}var E=new n;o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var y=new e;p.fromPoints=function(t,r){var n=e.fromPoints(t,y);return new p(n.center,r)};var m=new h,_=new r;p.prototype.projectPointOntoPlane=function(e,n){var i=m;i.origin=e,r.normalize(e,i.direction);var o=c.rayPlane(i,this._plane,_);if(a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,_)),a(o)){var u=r.subtract(o,this._origin,o),s=r.dot(this._xAxis,u),l=r.dot(this._yAxis,u);return a(n)?(n.x=s,n.y=l,n):new t(s,l)}},p.prototype.projectPointsOntoPlane=function(e,t){a(t)||(t=[]);for(var r=0,n=e.length,i=0;i<n;i++){var o=this.projectPointOntoPlane(e[i],t[r]);a(o)&&(t[r]=o,r++)}return t.length=r,t},p.prototype.projectPointToNearestOnPlane=function(e,n){a(n)||(n=new t);var i=m;i.origin=e,r.clone(this._plane.normal,i.direction);var o=c.rayPlane(i,this._plane,_);a(o)||(r.negate(i.direction,i.direction),o=c.rayPlane(i,this._plane,_));var u=r.subtract(o,this._origin,o),s=r.dot(this._xAxis,u),l=r.dot(this._yAxis,u);return n.x=s,n.y=l,n},p.prototype.projectPointsToNearestOnPlane=function(e,t){a(t)||(t=[]);var r=e.length;t.length=r;for(var n=0;n<r;n++)t[n]=this.projectPointToNearestOnPlane(e[n],t[n]);return t};var T=new r;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var n=e.length;a(t)?t.length=n:t=new Array(n);for(var i=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<n;++l){var f=e[l];r.multiplyByScalar(u,f.x,c),a(t[l])||(t[l]=new r);var h=r.add(o,c,t[l]);r.multiplyByScalar(s,f.y,c),r.add(h,c,h),i.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===r.POINTS||e===r.LINES||e===r.LINE_LOOP||e===r.LINE_STRIP||e===r.TRIANGLES||e===r.TRIANGLE_STRIP||e===r.TRIANGLE_FAN}};return e(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,r,n,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,n.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var r=-1;for(var n in e.attributes)if(e.attributes.hasOwnProperty(n)&&t(e.attributes[n])&&t(e.attributes[n].values)){var i=e.attributes[n],a=i.values.length/i.componentsPerAttribute;r=a}return r},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,r,n){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=n.clone(e(t.modelMatrix,n.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return i}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,r,n,i,a){"use strict";var o={};o.octEncodeInRange=function(e,t,r){if(r.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),r.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var n=r.x,i=r.y;r.x=(1-Math.abs(i))*a.signNotZero(n),r.y=(1-Math.abs(n))*a.signNotZero(i)}return r.x=a.toSNorm(r.x,t),r.y=a.toSNorm(r.y,t),r},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,r,n,i){if(i.x=a.fromSNorm(e,n),i.y=a.fromSNorm(r,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},o.octDecode=function(e,t,r){return o.octDecodeInRange(e,t,255,r)},o.octPackFloat=function(e){return 256*e.x+e.y};var u=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,u),o.octPackFloat(u)},o.octDecodeFloat=function(e,t){var r=e/256,n=Math.floor(r),i=256*(r-n);return o.octDecode(n,i,t)},o.octPack=function(e,t,r,n){var i=o.octEncodeFloat(e),a=o.octEncodeFloat(t),s=o.octEncode(r,u);return n.x=65536*s.x+i,n.y=65536*s.y+a,n},o.octUnpack=function(e,t,r,n){var i=e.x/65536,a=Math.floor(i),u=65536*(i-a);i=e.y/65536;var s=Math.floor(i),c=65536*(i-s);o.octDecodeFloat(u,t),o.octDecodeFloat(c,r),o.octDecode(a,s,n)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,r=4095*e.y|0;return 4096*t+r},o.decompressTextureCoordinates=function(e,t){var r=e/4096,n=Math.floor(r);return t.x=n/4095,t.y=(e-4096*n)/4095,t},o}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined"],function(e,t,r,n){"use strict";function i(r,i,s,c,l){n(l)||(l=new t);var f,h,d,p,E,y,m,_;n(i.z)?(f=t.subtract(s,i,a),h=t.subtract(c,i,o),d=t.subtract(r,i,u),p=t.dot(f,f),E=t.dot(f,h),y=t.dot(f,d),m=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,i,a),h=e.subtract(c,i,o),d=e.subtract(r,i,u),p=e.dot(f,f),E=e.dot(f,h),y=e.dot(f,d),m=e.dot(h,h),_=e.dot(h,d));var T=1/(p*m-E*E);return l.y=(m*y-E*_)*T,l.z=(p*_-E*y)*T,l.x=1-l.y-l.z,l}var a=new t,o=new t,u=new t;return i}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,r){"use strict";function n(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}n.encode=function(e,r){t(r)||(r={high:0,low:0});var n;return e>=0?(n=65536*Math.floor(e/65536),r.high=n,r.low=e-n):(n=65536*Math.floor(-e/65536),r.high=-n,r.low=e+n),r};var i={high:0,low:0};n.fromCartesian=function(e,r){t(r)||(r=new n);var a=r.high,o=r.low;return n.encode(e.x,i),a.x=i.high,o.x=i.low,n.encode(e.y,i),a.y=i.high,o.y=i.low,n.encode(e.z,i),a.z=i.high,o.z=i.low,r};var a=new n;return n.writeElements=function(e,t,r){n.fromCartesian(e,a);var i=a.high,o=a.low;t[r]=i.x,t[r+1]=i.y,t[r+2]=i.z,t[r+3]=o.x,t[r+4]=o.y,t[r+5]=o.z},n}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,r,n,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,r,i){return e>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,r,i):new Uint16Array(t,r,i)},r(a)}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,r){"use strict";var n={};return n.calculateACMR=function(r){r=e(r,e.EMPTY_OBJECT);var n=r.indices,i=r.maximumIndex,a=e(r.cacheSize,24),o=n.length;if(!t(i)){i=0;for(var u=0,s=n[u];u<o;)s>i&&(i=s),++u,s=n[u]}for(var c=[],l=0;l<i+1;l++)c[l]=0;for(var f=a+1,h=0;h<o;++h)f-c[n[h]]>a&&(c[n[h]]=f,++f);return(f-a+1)/(o/3)},n.tipsify=function(r){function n(e,t,r,n){for(;t.length>=1;){var i=t[t.length-1];if(t.splice(t.length-1,1),e[i].numLiveTriangles>0)return i}for(;a<n;){if(e[a].numLiveTriangles>0)return++a,a-1;++a}return-1}function i(e,t,r,i,a,o,u){for(var s,c=-1,l=-1,f=0;f<r.length;){var h=r[f];i[h].numLiveTriangles&&(s=0,a-i[h].timeStamp+2*i[h].numLiveTriangles<=t&&(s=a-i[h].timeStamp),(s>l||l===-1)&&(l=s,c=h)),++f}return c===-1?n(i,o,e,u):c}r=e(r,e.EMPTY_OBJECT);var a,o=r.indices,u=r.maximumIndex,s=e(r.cacheSize,24),c=o.length,l=0,f=0,h=o[f],d=c;if(t(u))l=u+1;else{for(;f<d;)h>l&&(l=h),++f,h=o[f];if(l===-1)return 0;++l}for(var p=[],E=0;E<l;E++)p[E]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var y=0;f<d;)p[o[f]].vertexTriangles.push(y),++p[o[f]].numLiveTriangles,p[o[f+1]].vertexTriangles.push(y),++p[o[f+1]].numLiveTriangles,p[o[f+2]].vertexTriangles.push(y),++p[o[f+2]].numLiveTriangles,++y,f+=3;var m=0,_=s+1;a=1;var T,v,R=[],A=[],S=0,g=[],N=c/3,O=[];for(E=0;E<N;E++)O[E]=!1;for(var I,x;m!==-1;){R=[],v=p[m],x=v.vertexTriangles.length;for(var w=0;w<x;++w)if(y=v.vertexTriangles[w],!O[y]){O[y]=!0,f=y+y+y;for(var M=0;M<3;++M)I=o[f],R.push(I),A.push(I),g[S]=I,++S,T=p[I],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}m=i(o,s,R,p,_,A,l)}return g},n}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,E,y,m,_,T,v,R,A,S,g){"use strict";function N(e,t,r,n,i){e[t++]=r,e[t++]=n,e[t++]=n,e[t++]=i,e[t++]=i,e[t]=r}function O(e){for(var t=e.length,r=t/3*6,n=y.createTypedArray(t,r),i=0,a=0;a<t;a+=3,i+=6)N(n,i,e[a],e[a+1],e[a+2]);return n}function I(e){var t=e.length;if(t>=3){var r=6*(t-2),n=y.createTypedArray(t,r);N(n,0,e[0],e[1],e[2]);for(var i=6,a=3;a<t;++a,i+=6)N(n,i,e[a-1],e[a],e[a-2]);return n}return new Uint16Array}function x(e){if(e.length>0){for(var t=e.length-1,r=6*(t-1),n=y.createTypedArray(t,r),i=e[0],a=0,o=1;o<t;++o,a+=6)N(n,a,i,e[o],e[o+1]);return n}return new Uint16Array}function w(e){var t={};for(var r in e)if(e.hasOwnProperty(r)&&c(e[r])&&c(e[r].values)){var n=e[r];t[r]=new p({componentDatatype:n.componentDatatype,componentsPerAttribute:n.componentsPerAttribute,normalize:n.normalize,values:[]})}return t}function M(e,t,r){for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values))for(var i=t[n],a=0;a<i.componentsPerAttribute;++a)e[n].values.push(i.values[r*i.componentsPerAttribute+a])}function C(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;a<n;a+=3)i.unpack(r,a,ae),R.multiplyByPoint(e,ae,ae),i.pack(ae,r,a)}function P(e,t){if(c(t))for(var r=t.values,n=r.length,a=0;a<n;a+=3)i.unpack(r,a,ae),v.multiplyByVector(e,ae,ae),ae=i.normalize(ae,ae),i.pack(ae,r,a)}function D(e,t){var r,n=e.length,i={},a=e[0][t].attributes;for(r in a)if(a.hasOwnProperty(r)&&c(a[r])&&c(a[r].values)){for(var o=a[r],s=o.values.length,l=!0,f=1;f<n;++f){var h=e[f][t].attributes[r];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(i[r]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return i}function L(e,t){var n,a,o,u,s,l,f,h=e.length,p=(e[0].modelMatrix,c(e[0][t].indices)),E=e[0][t].primitiveType,m=D(e,t);for(n in m)if(m.hasOwnProperty(n))for(s=m[n].values,u=0,a=0;a<h;++a)for(l=e[a][t].attributes[n].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(p){var T=0;for(a=0;a<h;++a)T+=e[a][t].indices.length;var v=d.computeNumberOfVertices(new d({attributes:m,primitiveType:S.POINTS})),R=y.createTypedArray(v,T),A=0,g=0;for(a=0;a<h;++a){var N=e[a][t].indices,O=N.length;for(u=0;u<O;++u)R[A++]=g+N[u];g+=d.computeNumberOfVertices(e[a][t])}_=R}var I,x=new i,w=0;for(a=0;a<h;++a){if(I=e[a][t].boundingSphere,!c(I)){x=void 0;break}i.add(I.center,x,x)}if(c(x))for(i.divideByScalar(x,h,x),a=0;a<h;++a){I=e[a][t].boundingSphere;var M=i.magnitude(i.subtract(I.center,x,se))+I.radius;M>w&&(w=M)}return new d({attributes:m,indices:_,primitiveType:E,boundingSphere:c(x)?new r(x,w):void 0})}function U(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function b(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,3*(t-2));r[0]=1,r[1]=0,r[2]=2;for(var n=3,i=3;i<t;++i)r[n++]=i-1,r[n++]=0,r[n++]=i;return e.indices=r,e.primitiveType=S.TRIANGLES,e}function F(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,3*(t-2));r[0]=0,r[1]=1,r[2]=2,t>3&&(r[3]=0,r[4]=2,r[5]=3);for(var n=6,i=3;i<t-1;i+=2)r[n++]=i,r[n++]=i-1,r[n++]=i+1,i+2<t&&(r[n++]=i,r[n++]=i+1,r[n++]=i+2);return e.indices=r,e.primitiveType=S.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,t),n=0;n<t;++n)r[n]=n;return e.indices=r,e}function z(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,2*(t-1));r[0]=0,r[1]=1;for(var n=2,i=2;i<t;++i)r[n++]=i-1,r[n++]=i;return e.indices=r,e.primitiveType=S.LINES,e}function G(e){var t=d.computeNumberOfVertices(e),r=y.createTypedArray(t,2*t);r[0]=0,r[1]=1;for(var n=2,i=2;i<t;++i)r[n++]=i-1,r[n++]=i;return r[n++]=t-1,r[n]=0,e.indices=r,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return b(e);case S.TRIANGLE_STRIP:return F(e);case S.TRIANGLES:return U(e);case S.LINE_STRIP:return z(e);case S.LINE_LOOP:return G(e);case S.LINES:return B(e)}return e}function W(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function X(e,t,r){if(0!==e.y&&0!==t.y&&0!==r.y)return W(e,e.y<0),W(t,t.y<0),void W(r,r.y<0);var n,i=Math.abs(e.y),a=Math.abs(t.y),o=Math.abs(r.y);n=i>a?i>o?T.sign(e.y):T.sign(r.y):a>o?T.sign(t.y):T.sign(r.y);var u=n<0;W(e,u),W(t,u),W(r,u)}function H(e,t,r,n){i.add(e,i.multiplyByScalar(i.subtract(t,e,Re),e.y/(e.y-t.y),Re),r),i.clone(r,n),W(r,!0),W(n,!1)}function V(e,t,r){if(!(e.x>=0||t.x>=0||r.x>=0)){X(e,t,r);var n=e.y<0,i=t.y<0,a=r.y<0,o=0;o+=n?1:0,o+=i?1:0,o+=a?1:0;var u=Oe.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,n?(H(e,t,Ae,ge),H(e,r,Se,Ne),u[0]=0,u[3]=1,u[4]=2,u[6]=1):i?(H(t,r,Ae,ge),H(t,e,Se,Ne),u[0]=1,u[3]=2,u[4]=0,u[6]=2):a&&(H(r,e,Ae,ge),H(r,t,Se,Ne),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,n?i?a||(H(r,e,Ae,ge),H(r,t,Se,Ne),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(H(t,r,Ae,ge),H(t,e,Se,Ne),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(H(e,t,Ae,ge),H(e,r,Se,Ne),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Oe.positions;return s[0]=e,s[1]=t,s[2]=r,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=Se,s[5]=ge,s[6]=Ne,s.length=7),Oe}}function Y(e,t){var n=e.attributes;if(0!==n.position.values.length){for(var i in n)if(n.hasOwnProperty(i)&&c(n[i])&&c(n[i].values)){var a=n[i];a.values=u.createTypedArray(a.componentDatatype,a.values)}var o=d.computeNumberOfVertices(e);return e.indices=y.createTypedArray(o,e.indices),t&&(e.boundingSphere=r.fromVertices(n.position.values)),e}}function k(e){var t=e.attributes,r={};for(var n in t)if(t.hasOwnProperty(n)&&c(t[n])&&c(t[n].values)){var i=t[n];r[n]=new p({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return new d({attributes:r,indices:[],primitiveType:e.primitiveType})}function Z(e,t,r){var n=c(e.geometry.boundingSphere);t=Y(t,n),r=Y(r,n),c(r)&&!c(t)?e.geometry=r:!c(r)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=r, +e.geometry=void 0)}function j(e,r,a,o,u,s,l,f,h,d,p,E){if(c(s)||c(l)||c(f)||c(h)||c(d)){var y=i.fromArray(u,3*e,Ie),m=i.fromArray(u,3*r,xe),_=i.fromArray(u,3*a,we),T=t(o,y,m,_,Me);if(c(s)){var v=i.fromArray(s,3*e,Ie),R=i.fromArray(s,3*r,xe),A=i.fromArray(s,3*a,we);i.multiplyByScalar(v,T.x,v),i.multiplyByScalar(R,T.y,R),i.multiplyByScalar(A,T.z,A);var S=i.add(v,R,v);i.add(S,A,S),i.normalize(S,S),i.pack(S,p.normal.values,3*E)}if(c(d)){var g=i.fromArray(d,3*e,Ie),N=i.fromArray(d,3*r,xe),O=i.fromArray(d,3*a,we);i.multiplyByScalar(g,T.x,g),i.multiplyByScalar(N,T.y,N),i.multiplyByScalar(O,T.z,O);var I;i.equals(g,i.ZERO)&&i.equals(N,i.ZERO)&&i.equals(O,i.ZERO)?(I=Ie,I.x=0,I.y=0,I.z=0):(I=i.add(g,N,g),i.add(I,O,I),i.normalize(I,I)),i.pack(I,p.extrudeDirection.values,3*E)}if(c(l)){var x=i.fromArray(l,3*e,Ie),w=i.fromArray(l,3*r,xe),M=i.fromArray(l,3*a,we);i.multiplyByScalar(x,T.x,x),i.multiplyByScalar(w,T.y,w),i.multiplyByScalar(M,T.z,M);var C=i.add(x,w,x);i.add(C,M,C),i.normalize(C,C),i.pack(C,p.tangent.values,3*E)}if(c(f)){var P=i.fromArray(f,3*e,Ie),D=i.fromArray(f,3*r,xe),L=i.fromArray(f,3*a,we);i.multiplyByScalar(P,T.x,P),i.multiplyByScalar(D,T.y,D),i.multiplyByScalar(L,T.z,L);var U=i.add(P,D,P);i.add(U,L,U),i.normalize(U,U),i.pack(U,p.bitangent.values,3*E)}if(c(h)){var b=n.fromArray(h,2*e,Ce),F=n.fromArray(h,2*r,Pe),B=n.fromArray(h,2*a,De);n.multiplyByScalar(b,T.x,b),n.multiplyByScalar(F,T.y,F),n.multiplyByScalar(B,T.z,B);var z=n.add(b,F,b);n.add(z,B,z),n.pack(z,p.st.values,2*E)}}}function K(e,t,r,n,i,a){var o=e.position.values.length/3;if(i!==-1){var u=n[i],s=r[u];return s===-1?(r[u]=o,e.position.values.push(a.x,a.y,a.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(a.x,a.y,a.z),t.push(o),o}function J(e){var t,r,n,a,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,h=c(s.bitangent)?s.bitangent.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,p=c(s.st)?s.st.values:void 0,E=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,y=u.indices,m=k(u),_=k(u),T=[];T.length=l.length/3;var v=[];for(v.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,v[o]=-1;var R=y.length;for(o=0;o<R;o+=3){var A=y[o],S=y[o+1],g=y[o+2],N=i.fromArray(l,3*A),O=i.fromArray(l,3*S),I=i.fromArray(l,3*g),x=V(N,O,I);if(c(x)&&x.positions.length>3)for(var w=x.positions,M=x.indices,C=M.length,P=0;P<C;++P){var D=M[P],L=w[D];L.y<0?(t=_.attributes,r=_.indices,n=T):(t=m.attributes,r=m.indices,n=v),a=K(t,r,n,y,D<3?o+D:-1,L),j(A,S,g,L,l,f,d,h,p,E,t,a)}else c(x)&&(N=x.positions[0],O=x.positions[1],I=x.positions[2]),N.y<0?(t=_.attributes,r=_.indices,n=T):(t=m.attributes,r=m.indices,n=v),a=K(t,r,n,y,o,N),j(A,S,g,N,l,f,d,h,p,E,t,a),a=K(t,r,n,y,o+1,O),j(A,S,g,O,l,f,d,h,p,E,t,a),a=K(t,r,n,y,o+2,I),j(A,S,g,I,l,f,d,h,p,E,t,a)}Z(e,_,m)}function Q(e){var t,r=e.geometry,n=r.attributes,a=n.position.values,o=r.indices,u=k(r),s=k(r),l=o.length,f=[];f.length=a.length/3;var h=[];for(h.length=a.length/3,t=0;t<f.length;++t)f[t]=-1,h[t]=-1;for(t=0;t<l;t+=2){var d=o[t],p=o[t+1],E=i.fromArray(a,3*d,Ie),y=i.fromArray(a,3*p,xe);Math.abs(E.y)<T.EPSILON6&&(E.y<0?E.y=-T.EPSILON6:E.y=T.EPSILON6),Math.abs(y.y)<T.EPSILON6&&(y.y<0?y.y=-T.EPSILON6:y.y=T.EPSILON6);var m=u.attributes,v=u.indices,R=h,A=s.attributes,S=s.indices,g=f,N=_.lineSegmentPlane(E,y,Le,we);if(c(N)){var O=i.multiplyByScalar(i.UNIT_Y,5*T.EPSILON9,Ue);E.y<0&&(i.negate(O,O),m=s.attributes,v=s.indices,R=f,A=u.attributes,S=u.indices,g=h);var I=i.add(N,O,be);K(m,v,R,o,t,E),K(m,v,R,o,-1,I),i.negate(O,O),i.add(N,O,I),K(A,S,g,o,-1,I),K(A,S,g,o,t+1,y)}else{var x,w,M;E.y<0?(x=s.attributes,w=s.indices,M=f):(x=u.attributes,w=u.indices,M=h),K(x,w,M,o,t,E),K(x,w,M,o,t+1,y)}}Z(e,s,u)}function $(e){for(var t=e.attributes,r=t.position.values,n=t.prevPosition.values,a=t.nextPosition.values,o=r.length,u=0;u<o;u+=3){var s=i.unpack(r,u,ze);if(!(s.x>0)){var c=i.unpack(n,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(n[u]=r[u-3],n[u+1]=r[u-2],n[u+2]=r[u-1]):i.pack(s,n,u));var l=i.unpack(a,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(a[u]=r[u+3],a[u+1]=r[u+4],a[u+2]=r[u+5]):i.pack(s,a,u))}}}function ee(e){var t,r,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,h=s.nextPosition.values,d=s.expandAndWidth.values,p=c(s.st)?s.st.values:void 0,E=c(s.color)?s.color.values:void 0,y=k(u),m=k(u),v=!1,R=l.length/3;for(t=0;t<R;t+=4){var A=t,S=t+2,g=i.fromArray(l,3*A,ze),N=i.fromArray(l,3*S,Ge);if(Math.abs(g.y)<ke)for(g.y=ke*(N.y<0?-1:1),l[3*t+1]=g.y,l[3*(t+1)+1]=g.y,r=3*A;r<3*A+12;r+=3)f[r]=l[3*t],f[r+1]=l[3*t+1],f[r+2]=l[3*t+2];if(Math.abs(N.y)<ke)for(N.y=ke*(g.y<0?-1:1),l[3*(t+2)+1]=N.y,l[3*(t+3)+1]=N.y,r=3*A;r<3*A+12;r+=3)h[r]=l[3*(t+2)],h[r+1]=l[3*(t+2)+1],h[r+2]=l[3*(t+2)+2];var O=y.attributes,I=y.indices,x=m.attributes,w=m.indices,M=_.lineSegmentPlane(g,N,Le,We);if(c(M)){v=!0;var C=i.multiplyByScalar(i.UNIT_Y,Ye,Xe);g.y<0&&(i.negate(C,C),O=m.attributes,I=m.indices,x=y.attributes,w=y.indices);var P=i.add(M,C,He);O.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),O.position.values.push(P.x,P.y,P.z),O.position.values.push(P.x,P.y,P.z),O.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),O.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),O.prevPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),O.nextPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(P.x,P.y,P.z),O.nextPosition.values.push(P.x,P.y,P.z),i.negate(C,C),i.add(M,C,P),x.position.values.push(P.x,P.y,P.z),x.position.values.push(P.x,P.y,P.z),x.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),x.nextPosition.values.push(h[3*S],h[3*S+1],h[3*S+2]),x.nextPosition.values.push(h[3*S+3],h[3*S+4],h[3*S+5]);var D=n.fromArray(d,2*A,Fe),L=Math.abs(D.y);O.expandAndWidth.values.push(-1,L,1,L),O.expandAndWidth.values.push(-1,-L,1,-L),x.expandAndWidth.values.push(-1,L,1,L),x.expandAndWidth.values.push(-1,-L,1,-L);var U=i.magnitudeSquared(i.subtract(M,g,qe));if(U/=i.magnitudeSquared(i.subtract(N,g,qe)),c(E)){var b=a.fromArray(E,4*A,Ve),F=a.fromArray(E,4*S,Ve),B=T.lerp(b.x,F.x,U),z=T.lerp(b.y,F.y,U),G=T.lerp(b.z,F.z,U),q=T.lerp(b.w,F.w,U);for(r=4*A;r<4*A+8;++r)O.color.values.push(E[r]);for(O.color.values.push(B,z,G,q),O.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),r=4*S;r<4*S+8;++r)x.color.values.push(E[r])}if(c(p)){var W=n.fromArray(p,2*A,Fe),X=n.fromArray(p,2*(t+3),Be),H=T.lerp(W.x,X.x,U);for(r=2*A;r<2*A+4;++r)O.st.values.push(p[r]);for(O.st.values.push(H,W.y),O.st.values.push(H,X.y),x.st.values.push(H,W.y),x.st.values.push(H,X.y),r=2*S;r<2*S+4;++r)x.st.values.push(p[r])}o=O.position.values.length/3-4,I.push(o,o+2,o+1),I.push(o+1,o+2,o+3),o=x.position.values.length/3-4,w.push(o,o+2,o+1),w.push(o+1,o+2,o+3)}else{var V,Y;for(g.y<0?(V=m.attributes,Y=m.indices):(V=y.attributes,Y=y.indices),V.position.values.push(g.x,g.y,g.z),V.position.values.push(g.x,g.y,g.z),V.position.values.push(N.x,N.y,N.z),V.position.values.push(N.x,N.y,N.z),r=3*t;r<3*t+12;++r)V.prevPosition.values.push(f[r]),V.nextPosition.values.push(h[r]);for(r=2*t;r<2*t+8;++r)V.expandAndWidth.values.push(d[r]),c(p)&&V.st.values.push(p[r]);if(c(E))for(r=4*t;r<4*t+16;++r)V.color.values.push(E[r]);o=V.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}v&&($(m),$(y)),Z(e,m,y)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=O(t);break;case S.TRIANGLE_STRIP:e.indices=I(t);break;case S.TRIANGLE_FAN:e.indices=x(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,n){t=s(t,"normal"),n=s(n,1e4);for(var i=e.attributes.position.values,a=e.attributes[t].values,o=i.length,l=new Float64Array(2*o),f=0,h=0;h<o;h+=3)l[f++]=i[h],l[f++]=i[h+1],l[f++]=i[h+2],l[f++]=i[h]+a[h]*n,l[f++]=i[h+1]+a[h+1]*n,l[f++]=i[h+2]+a[h+2]*n;var E,y=e.boundingSphere;return c(y)&&(E=new r(y.center,y.radius+n)),new d({attributes:{position:new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:E})},te.createAttributeLocations=function(e){var t,r=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},a=0,o=r.length;for(t=0;t<o;++t){var u=r[t];c(n[u])&&(i[u]=a++)}for(var s in n)n.hasOwnProperty(s)&&!c(i[s])&&(i[s]=a++);return i},te.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),r=e.indices;if(c(r)){for(var n=new Int32Array(t),i=0;i<t;i++)n[i]=-1;for(var a,o=r,s=o.length,l=y.createTypedArray(t,s),f=0,h=0,p=0;f<s;)a=n[o[f]],a!==-1?l[h]=a:(a=o[f],n[a]=p,l[h]=p,++p),++f,++h;e.indices=l;var E=e.attributes;for(var m in E)if(E.hasOwnProperty(m)&&c(E[m])&&c(E[m].values)){for(var _=E[m],T=_.values,v=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,p*R);v<t;){var S=n[v];if(S!==-1)for(i=0;i<R;i++)A[R*S+i]=T[R*v+i];++v}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var r=e.indices;if(e.primitiveType===S.TRIANGLES&&c(r)){for(var n=r.length,i=0,a=0;a<n;a++)r[a]>i&&(i=r[a]);e.indices=g.tipsify({indices:r,maximumIndex:i,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],r=d.computeNumberOfVertices(e);if(c(e.indices)&&r>=T.SIXTY_FOUR_KILOBYTES){var n,i=[],a=[],o=0,u=w(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?n=3:e.primitiveType===S.LINES?n=2:e.primitiveType===S.POINTS&&(n=1);for(var f=0;f<l;f+=n){for(var h=0;h<n;++h){var p=s[f+h],E=i[p];c(E)||(E=o++,i[p]=E,M(u,e.attributes,p)),a.push(E)}o+n>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],a=[],o=0,u=w(e.attributes))}0!==a.length&&t.push(new d({attributes:u,indices:a,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var re=new i,ne=new o;te.projectTo2D=function(e,t,r,n,a){var o=e.attributes[t];a=c(a)?a:new h;for(var s=a.ellipsoid,l=o.values,f=new Float64Array(l.length),d=0,E=0;E<l.length;E+=3){var y=i.fromArray(l,E,re),m=s.cartesianToCartographic(y,ne),_=a.project(m,re);f[d++]=_.x,f[d++]=_.y,f[d++]=_.z}return e.attributes[r]=o,e.attributes[n]=new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ie={high:0,low:0};te.encodeAttribute=function(e,t,r,n){for(var i=e.attributes[t],a=i.values,o=a.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(a[l],ie),s[l]=ie.high,c[l]=ie.low;var h=i.componentsPerAttribute;return e.attributes[r]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[n]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};var ae=new i,oe=new R,ue=new v;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(R.equals(t,R.IDENTITY))return e;var n=e.geometry.attributes;C(t,n.position),C(t,n.prevPosition),C(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(R.inverse(t,oe),R.transpose(oe,oe),R.getRotation(oe,ue),P(ue,n.normal),P(ue,n.tangent),P(ue,n.bitangent));var i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=r.transform(i,t,i)),e.modelMatrix=R.clone(R.IDENTITY),e};var se=new i;te.combineInstances=function(e){for(var t=[],r=[],n=e.length,i=0;i<n;++i){var a=e[i];c(a.geometry)?t.push(a):c(a.westHemisphereGeometry)&&c(a.eastHemisphereGeometry)&&r.push(a)}var o=[];return t.length>0&&o.push(L(t,"geometry")),r.length>0&&(o.push(L(r,"westHemisphereGeometry")),o.push(L(r,"eastHemisphereGeometry"))),o};var ce=new i,le=new i,fe=new i,he=new i;te.computeNormal=function(e){for(var t=e.indices,r=e.attributes,n=r.position.values,a=r.position.values.length/3,o=t.length,s=new Array(a),c=new Array(o/3),l=new Array(o),f=0;f<a;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;f<o;f+=3){var d=t[f],E=t[f+1],y=t[f+2],m=3*d,_=3*E,v=3*y;le.x=n[m],le.y=n[m+1],le.z=n[m+2],fe.x=n[_],fe.y=n[_+1],fe.z=n[_+2],he.x=n[v],he.y=n[v+1],he.z=n[v+2],s[d].count++,s[E].count++,s[y].count++,i.subtract(fe,le,fe),i.subtract(he,le,he),c[h]=i.cross(fe,he,new i),h++}var R=0;for(f=0;f<a;f++)s[f].indexOffset+=R,R+=s[f].count;h=0;var A;for(f=0;f<o;f+=3){A=s[t[f]];var S=A.indexOffset+A.currentCount;l[S]=h,A.currentCount++,A=s[t[f+1]],S=A.indexOffset+A.currentCount,l[S]=h,A.currentCount++,A=s[t[f+2]],S=A.indexOffset+A.currentCount,l[S]=h,A.currentCount++,h++}var g=new Float32Array(3*a);for(f=0;f<a;f++){var N=3*f;if(A=s[f],i.clone(i.ZERO,ce),A.count>0){for(h=0;h<A.count;h++)i.add(ce,c[l[A.indexOffset+h]],ce);i.equalsEpsilon(i.ZERO,ce,T.EPSILON10)&&i.clone(c[l[A.indexOffset]],ce)}i.equalsEpsilon(i.ZERO,ce,T.EPSILON10)&&(ce.z=1),i.normalize(ce,ce),g[N]=ce.x,g[N+1]=ce.y,g[N+2]=ce.z}return e.attributes.normal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:g}),e};var de=new i,pe=new i,Ee=new i;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),r=e.attributes.position.values,n=e.attributes.normal.values,a=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,h,d;for(l=0;l<s;l+=3){var E=t[l],y=t[l+1],m=t[l+2];f=3*E,h=3*y,d=3*m;var _=2*E,T=2*y,v=2*m,R=r[f],A=r[f+1],S=r[f+2],g=a[_],N=a[_+1],O=a[T+1]-N,I=a[v+1]-N,x=1/((a[T]-g)*I-(a[v]-g)*O),w=(I*(r[h]-R)-O*(r[d]-R))*x,M=(I*(r[h+1]-A)-O*(r[d+1]-A))*x,C=(I*(r[h+2]-S)-O*(r[d+2]-S))*x;c[f]+=w,c[f+1]+=M,c[f+2]+=C,c[h]+=w,c[h+1]+=M,c[h+2]+=C,c[d]+=w,c[d+1]+=M,c[d+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,h=f+1,d=f+2;var L=i.fromArray(n,f,de),U=i.fromArray(c,f,Ee),b=i.dot(L,U);i.multiplyByScalar(L,b,pe),i.normalize(i.subtract(U,pe,U),U),P[f]=U.x,P[h]=U.y,P[d]=U.z,i.normalize(i.cross(L,U,U),U),D[f]=U.x,D[h]=U.y,D[d]=U.z}return e.attributes.tangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e};var ye=new n,me=new i,_e=new i,Te=new i,ve=new n;te.compressVertices=function(t){var r,a,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;a=s.length/3;var l=new Float32Array(2*a),f=0;for(r=0;r<a;++r)i.fromArray(s,3*r,me),i.equals(me,i.ZERO)?f+=2:(ve=e.octEncodeInRange(me,65535,ve),l[f++]=ve.x,l[f++]=ve.y);return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,d=t.attributes.st,E=c(h),y=c(d);if(!E&&!y)return t;var m,_,T,v,R=t.attributes.tangent,A=t.attributes.bitangent,S=c(R),g=c(A);E&&(m=h.values),y&&(_=d.values),S&&(T=R.values),g&&(v=A.values);var N=E?m.length:_.length,O=E?3:2;a=N/O;var I=a,x=y&&E?2:1;x+=S||g?1:0,I*=x;var w=new Float32Array(I),M=0;for(r=0;r<a;++r){y&&(n.fromArray(_,2*r,ye),w[M++]=e.compressTextureCoordinates(ye));var C=3*r;E&&c(T)&&c(v)?(i.fromArray(m,C,me),i.fromArray(T,C,_e),i.fromArray(v,C,Te),e.octPack(me,_e,Te,ye),w[M++]=ye.x,w[M++]=ye.y):(E&&(i.fromArray(m,C,me),w[M++]=e.octEncodeFloat(me)),S&&(i.fromArray(T,C,me),w[M++]=e.octEncodeFloat(me)),g&&(i.fromArray(v,C,me),w[M++]=e.octEncodeFloat(me)))}return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:x,values:w}),E&&delete t.attributes.normal,y&&delete t.attributes.st,g&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Re=new i,Ae=new i,Se=new i,ge=new i,Ne=new i,Oe={positions:new Array(7),indices:new Array(9)},Ie=new i,xe=new i,we=new i,Me=new i,Ce=new n,Pe=new n,De=new n,Le=A.fromPointNormal(i.ZERO,i.UNIT_Y),Ue=new i,be=new i,Fe=new n,Be=new n,ze=new i,Ge=new i,qe=new i,We=new i,Xe=new i,He=new i,Ve=new a,Ye=5*T.EPSILON9,ke=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,n=t.boundingSphere;if(c(n)){var i=n.center.x-n.radius;if(i>0||r.intersectPlane(n,A.ORIGIN_ZX_PLANE)!==m.INTERSECTING)return e}if(t.geometryType!==E.NONE)switch(t.geometryType){case E.POLYLINES:ee(e);break;case E.TRIANGLES:J(e);break;case E.LINES:Q(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&Q(e);return e},te}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,r,i){i=i||2;var a=r&&r.length,o=a?r[0]*i:e.length,u=t(e,0,o,i,!0),c=[];if(!u)return c;var l,f,h,d,p,E,y;if(a&&(u=s(e,r,u,i)),e.length>80*i){l=h=e[0],f=d=e[1];for(var m=i;m<o;m+=i)p=e[m],E=e[m+1],p<l&&(l=p),E<f&&(f=E),p>h&&(h=p),E>d&&(d=E);y=Math.max(h-l,d-f)}return n(u,c,i,l,f,y),c}function t(e,t,r,n,i){var a,o;if(i===x(e,t,r,n)>0)for(a=t;a<r;a+=n)o=N(a,e[a],e[a+1],o);else for(a=r-n;a>=t;a-=n)o=N(a,e[a],e[a+1],o);return o&&T(o,o.next)&&(O(o),o=o.next),o}function r(e,t){if(!e)return e;t||(t=e);var r,n=e;do if(r=!1,n.steiner||!T(n,n.next)&&0!==_(n.prev,n,n.next))n=n.next;else{if(O(n),n=t=n.prev,n===n.next)return null;r=!0}while(r||n!==t);return t}function n(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var p,E,y=e;e.prev!==e.next;)if(p=e.prev,E=e.next,f?a(e,c,l,f):i(e))t.push(p.i/s),t.push(e.i/s),t.push(E.i/s),O(e),e=E.next,y=E.next;else if(e=E,e===y){d?1===d?(e=o(e,t,s),n(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):n(r(e),t,s,c,l,f,1);break}}}function i(e){var t=e.prev,r=e,n=e.next;if(_(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(y(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(e,t,r,n){var i=e.prev,a=e,o=e.next;if(_(i,a,o)>=0)return!1;for(var u=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,s=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,l=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=p(u,s,t,r,n),h=p(c,l,t,r,n),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&y(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&y(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!T(i,a)&&v(i,n,n.next,a)&&A(i,a)&&A(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),O(n),O(n.next),n=e=a),n=n.next}while(n!==e);return n}function u(e,t,i,a,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=g(s,c);return s=r(s,s.next),l=r(l,l.next),n(s,t,i,a,o,u),void n(l,t,i,a,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,n,i,a){var o,u,s,f,h,d=[];for(o=0,u=n.length;o<u;o++)s=n[o]*a,f=o<u-1?n[o+1]*a:e.length,h=t(e,s,f,a,!1),h===h.next&&(h.steiner=!0),d.push(E(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],i),i=r(i,i.next);return i}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var n=g(t,e);r(n,n.next)}}function f(e,t){var r,n=t,i=e.x,a=e.y,o=-(1/0);do{if(a<=n.y&&a>=n.next.y){var u=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(u<=i&&u>o){if(o=u,u===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===o)return r.prev;var s,c=r,l=r.x,f=r.y,h=1/0;for(n=r.next;n!==c;)i>=n.x&&n.x>=l&&y(a<f?i:o,a,l,f,a<f?o:i,a,n.x,n.y)&&(s=Math.abs(a-n.y)/(i-n.x),(s<h||s===h&&n.x>r.x)&&A(n,e)&&(r=n,h=s)),n=n.next;return r}function h(e,t,r,n){var i=e;do null===i.z&&(i.z=p(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,d(i)}function d(e){var t,r,n,i,a,o,u,s,c=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,u=0,t=0;t<c&&(u++,n=n.nextZ,n);t++);for(s=c;u>0||s>0&&n;)0===u?(i=n,n=n.nextZ,s--):0!==s&&n?r.z<=n.z?(i=r,r=r.nextZ,u--):(i=n,n=n.nextZ,s--):(i=r,r=r.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1);return e}function p(e,t,r,n,i){return e=32767*(e-r)/i,t=32767*(t-n)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function E(e){var t=e,r=e;do t.x<r.x&&(r=t),t=t.next;while(t!==e);return r}function y(e,t,r,n,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(n-u)-(r-o)*(t-u)>=0&&(r-o)*(a-u)-(i-o)*(n-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&A(e,t)&&A(t,e)&&S(e,t)}function _(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function v(e,t,r,n){return!!(T(e,t)&&T(r,n)||T(e,n)&&T(r,t))||_(e,t,r)>0!=_(e,t,n)>0&&_(r,n,e)>0!=_(r,n,t)>0}function R(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&v(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function A(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next;while(r!==e);return n}function g(e,t){var r=new I(e.i,e.x,e.y),n=new I(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function N(e,t,r,n){var i=new I(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function O(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 I(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function x(e,t,r,n){for(var i=0,a=t,o=r-n;a<r;a+=n)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,r,n){var i=t&&t.length,a=i?t[0]*r:e.length,o=Math.abs(x(e,0,a,r));if(i)for(var u=0,s=t.length;u<s;u++){var c=t[u]*r,l=u<s-1?t[u+1]*r:e.length;o-=Math.abs(x(e,c,l,r))}var f=0;for(u=0;u<n.length;u+=3){var h=n[u]*r,d=n[u+1]*r,p=n[u+2]*r;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)r.vertices.push(e[i][a][o]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var r={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===r.CLOCKWISE||e===r.COUNTER_CLOCKWISE}};return e(r)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h){"use strict";var d=new r,p=new r,E={};E.computeArea2D=function(e){for(var t=e.length,r=0,n=t-1,i=0;i<t;n=i++){var a=e[n],o=e[i];r+=a.x*o.y-o.x*a.y}return.5*r},E.computeWindingOrder2D=function(e){var t=E.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},E.triangulate=function(r,n){var i=t.packArray(r);return e(i,n,2)};var y=new r,m=new r,_=new r,T=new r,v=new r,R=new r,A=new r;return E.computeSubdivision=function(e,t,o,u){u=i(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),p=t.length,E=new Array(3*p),S=0;for(h=0;h<p;h++){var g=t[h];E[S++]=g.x,E[S++]=g.y,E[S++]=g.z}for(var N=[],O={},I=e.maximumRadius,x=l.chordLength(u,I),w=x*x;d.length>0;){var M,C,P=d.pop(),D=d.pop(),L=d.pop(),U=r.fromArray(E,3*L,y),b=r.fromArray(E,3*D,m),F=r.fromArray(E,3*P,_),B=r.multiplyByScalar(r.normalize(U,T),I,T),z=r.multiplyByScalar(r.normalize(b,v),I,v),G=r.multiplyByScalar(r.normalize(F,R),I,R),q=r.magnitudeSquared(r.subtract(B,z,A)),W=r.magnitudeSquared(r.subtract(z,G,A)),X=r.magnitudeSquared(r.subtract(G,B,A)),H=Math.max(q,W,X);H>w?q===H?(M=Math.min(L,D)+" "+Math.max(L,D),h=O[M],a(h)||(C=r.add(U,b,A),r.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,O[M]=h),d.push(L,h,P),d.push(h,D,P)):W===H?(M=Math.min(D,P)+" "+Math.max(D,P),h=O[M],a(h)||(C=r.add(b,F,A),r.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,O[M]=h),d.push(D,h,L),d.push(h,P,L)):X===H&&(M=Math.min(P,L)+" "+Math.max(P,L),h=O[M],a(h)||(C=r.add(F,U,A),r.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,O[M]=h),d.push(P,h,D),d.push(h,L,D)):(N.push(L),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:E})},indices:N,primitiveType:f.TRIANGLES})},E.scaleToGeodeticHeight=function(e,t,n,o){n=i(n,u.WGS84);var s=d,c=p;if(t=i(t,0),o=i(o,!0),a(e))for(var l=e.length,f=0;f<l;f+=3)r.fromArray(e,f,c),o&&(c=n.scaleToGeodeticSurface(c,c)),0!==t&&(s=n.geodeticSurfaceNormal(c,s),r.multiplyByScalar(s,t,s),r.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},E}),define("Core/Queue",["./defineProperties"],function(e){"use strict";function t(){this._array=[],this._offset=0,this._length=0}return e(t.prototype,{length:{get:function(){return this._length}}}),t.prototype.enqueue=function(e){this._array.push(e),this._length++},t.prototype.dequeue=function(){if(0!==this._length){var e=this._array,t=this._offset,r=e[t];return e[t]=void 0,t++,t>10&&2*t>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,r}},t.prototype.peek=function(){if(0!==this._length)return this._array[this._offset]},t.prototype.contains=function(e){return this._array.indexOf(e)!==-1},t.prototype.clear=function(){this._array.length=this._offset=this._length=0},t.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)},t}),define("Core/PolygonGeometryLibrary",["./arrayRemoveDuplicates","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,E){"use strict";function y(e,r,n,i){return t.subtract(r,e,_),t.multiplyByScalar(_,n/i,_),t.add(e,_,_),[_.x,_.y,_.z]}var m={};m.computeHierarchyPackedLength=function(e){for(var r=0,n=[e];n.length>0;){var a=n.pop();if(i(a)){r+=2;var o=a.positions,u=a.holes;if(i(o)&&(r+=o.length*t.packedLength),i(u))for(var s=u.length,c=0;c<s;++c)n.push(u[c])}}return r},m.packPolygonHierarchy=function(e,r,n){for(var a=[e];a.length>0;){var o=a.pop();if(i(o)){var u=o.positions,s=o.holes;if(r[n++]=i(u)?u.length:0,r[n++]=i(s)?s.length:0,i(u))for(var c=u.length,l=0;l<c;++l,n+=3)t.pack(u[l],r,n);if(i(s))for(var f=s.length,h=0;h<f;++h)a.push(s[h])}}return n},m.unpackPolygonHierarchy=function(e,r){for(var n=e[r++],i=e[r++],a=new Array(n),o=i>0?new Array(i):void 0,u=0;u<n;++u,r+=t.packedLength)a[u]=t.unpack(e,r);for(var s=0;s<i;++s)o[s]=m.unpackPolygonHierarchy(e,r),r=o[s].startingIndex,delete o[s].startingIndex;return{positions:a,holes:o,startingIndex:r}};var _=new t;m.subdivideLineCount=function(e,r,n){var i=t.distance(e,r),a=i/n,o=Math.max(0,Math.ceil(Math.log(a)/Math.log(2)));return Math.pow(2,o)},m.subdivideLine=function(e,r,n,a){var o=m.subdivideLineCount(e,r,n),u=t.distance(e,r),s=u/o;i(a)||(a=[]);var c=a;c.length=3*o;for(var l=0,f=0;f<o;f++){var h=y(e,r,f*s,u);c[l++]=h[0],c[l++]=h[1],c[l++]=h[2]}return c};var T=new t,v=new t,R=new t,A=new t;m.scaleToGeodeticHeightExtruded=function(e,r,o,u,s){u=n(u,a.WGS84);var c=T,l=v,f=R,h=A;if(i(e)&&i(e.attributes)&&i(e.attributes.position))for(var d=e.attributes.position.values,p=d.length/2,E=0;E<p;E+=3)t.fromArray(d,E,f),u.geodeticSurfaceNormal(f,c),h=u.scaleToGeodeticSurface(f,h),l=t.multiplyByScalar(c,o,l),l=t.add(h,l,l),d[E+p]=l.x,d[E+1+p]=l.y,d[E+2+p]=l.z,s&&(h=t.clone(f,h)),l=t.multiplyByScalar(c,r,l),l=t.add(h,l,l),d[E]=l.x,d[E+1]=l.y,d[E+2]=l.z;return e},m.polygonsFromHierarchy=function(r,n,a,o){var u=[],s=[],c=new p;for(c.enqueue(r);0!==c.length;){var l=c.dequeue(),f=l.positions,d=l.holes;if(f=e(f,t.equalsEpsilon,!0),!(f.length<3)){var y=a.projectPointsOntoPlane(f),m=[],_=h.computeWindingOrder2D(y);_===E.CLOCKWISE&&(y.reverse(),f=f.slice().reverse());var T,v,R=f.slice(),A=i(d)?d.length:0,S=[];for(T=0;T<A;T++){var g=d[T],N=e(g.positions,t.equalsEpsilon,!0);if(!(N.length<3)){var O=a.projectPointsOntoPlane(N);_=h.computeWindingOrder2D(O),_===E.CLOCKWISE&&(O.reverse(),N=N.slice().reverse()),S.push(N),m.push(R.length),R=R.concat(N),y=y.concat(O);var I=0;for(i(g.holes)&&(I=g.holes.length),v=0;v<I;v++)c.enqueue(g.holes[v])}}if(!n){for(T=0;T<f.length;T++)o.scaleToGeodeticSurface(f[T],f[T]);for(T=0;T<S.length;T++){var x=S[T];for(v=0;v<x.length;++v)o.scaleToGeodeticSurface(x[v],x[v])}}u.push({outerRing:f,holes:S}),s.push({positions:R,positions2D:y,holes:m})}}return{hierarchy:u,polygons:s}},m.createGeometryFromPositions=function(e,t,n,i,a){var s=h.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);var l=t.positions;if(i){for(var f=l.length,p=new Array(3*f),E=0,y=0;y<f;y++){var m=l[y];p[E++]=m.x,p[E++]=m.y,p[E++]=m.z}var _=new o({attributes:{position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})},indices:s,primitiveType:d.TRIANGLES});return a.normal?c.computeNormal(_):_}return h.computeSubdivision(e,l,s,n)};var S=[],g=new t,N=new t;return m.computeWallGeometry=function(e,n,i,a){var c,h,p,E,y,_=e.length,T=0;if(a)for(h=3*_*2,c=new Array(2*h),p=0;p<_;p++)E=e[p],y=e[(p+1)%_],c[T]=c[T+h]=E.x,++T,c[T]=c[T+h]=E.y,++T,c[T]=c[T+h]=E.z,++T,c[T]=c[T+h]=y.x,++T,c[T]=c[T+h]=y.y,++T,c[T]=c[T+h]=y.z,++T;else{var v=f.chordLength(i,n.maximumRadius),R=0;for(p=0;p<_;p++)R+=m.subdivideLineCount(e[p],e[(p+1)%_],v);for(h=3*(R+_),c=new Array(2*h),p=0;p<_;p++){E=e[p],y=e[(p+1)%_];for(var A=m.subdivideLine(E,y,v,S),O=A.length,I=0;I<O;++I,++T)c[T]=A[I],c[T+h]=A[I];c[T]=y.x,c[T+h]=y.x,++T,c[T]=y.y,c[T+h]=y.y,++T,c[T]=y.z,c[T+h]=y.z,++T}}_=c.length;var x=l.createTypedArray(_/3,_-6*e.length),w=0;for(_/=6,p=0;p<_;p++){var M=p,C=M+1,P=M+_,D=P+1;E=t.fromArray(c,3*M,g),y=t.fromArray(c,3*C,N),t.equalsEpsilon(E,y,f.EPSILON14)||(x[w++]=M,x[w++]=P,x[w++]=C,x[w++]=C,x[w++]=P,x[w++]=D)}return new o({attributes:new s({position:new u({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:c})}),indices:x,primitiveType:d.TRIANGLES})},m}),define("Core/PolygonOutlineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Check","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./PolygonGeometryLibrary","./PolygonPipeline","./PrimitiveType","./Queue","./WindingOrder"],function(e,t,r,n,i,a,o,u,s,c,l,f,h,d,p,E,y,m,_,T,v,R){"use strict";function A(e,t,r,n){var a=c.fromPoints(t,e),o=a.projectPointsOntoPlane(t,N),u=_.computeWindingOrder2D(o);u===R.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());var s,p,y=t.length,v=0;if(n)for(s=new Float64Array(2*y*3),p=0;p<y;p++){var A=t[p],S=t[(p+1)%y];s[v++]=A.x,s[v++]=A.y,s[v++]=A.z,s[v++]=S.x,s[v++]=S.y,s[v++]=S.z}else{var g=0;for(p=0;p<y;p++)g+=m.subdivideLineCount(t[p],t[(p+1)%y],r);for(s=new Float64Array(3*g),p=0;p<y;p++)for(var I=m.subdivideLine(t[p],t[(p+1)%y],r,O),x=I.length,w=0;w<x;++w)s[v++]=I[w]}y=s.length/3;var M=2*y,C=E.createTypedArray(y,M);for(v=0,p=0;p<y-1;p++)C[v++]=p,C[v++]=p+1;return C[v++]=y-1,C[v++]=0,new d({geometry:new l({attributes:new h({position:new f({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:s})}),indices:C,primitiveType:T.LINES})})}function S(e,t,r,n){var a=c.fromPoints(t,e),o=a.projectPointsOntoPlane(t,N),u=_.computeWindingOrder2D(o);u===R.CLOCKWISE&&(o.reverse(),t=t.slice().reverse());var s,p,y=t.length,v=new Array(y),A=0;if(n)for(s=new Float64Array(2*y*3*2),p=0;p<y;++p){v[p]=A/3;var S=t[p],g=t[(p+1)%y];s[A++]=S.x,s[A++]=S.y,s[A++]=S.z,s[A++]=g.x,s[A++]=g.y,s[A++]=g.z}else{var I=0;for(p=0;p<y;p++)I+=m.subdivideLineCount(t[p],t[(p+1)%y],r);for(s=new Float64Array(3*I*2),p=0;p<y;++p){v[p]=A/3;for(var x=m.subdivideLine(t[p],t[(p+1)%y],r,O),w=x.length,M=0;M<w;++M)s[A++]=x[M]}}y=s.length/6;var C=v.length,P=2*(2*y+C),D=E.createTypedArray(y,P);for(A=0, +p=0;p<y;++p)D[A++]=p,D[A++]=(p+1)%y,D[A++]=p+y,D[A++]=(p+1)%y+y;for(p=0;p<C;p++){var L=v[p];D[A++]=L,D[A++]=L+y}return new d({geometry:new l({attributes:new h({position:new f({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:s})}),indices:D,primitiveType:T.LINES})})}function g(e){var t=e.polygonHierarchy,r=a(e.ellipsoid,s.WGS84),n=a(e.granularity,y.RADIANS_PER_DEGREE),i=a(e.height,0),u=a(e.perPositionHeight,!1),c=e.extrudedHeight,l=o(c);if(l&&!u){var f=c;c=Math.min(f,i),i=Math.max(f,i)}this._ellipsoid=s.clone(r),this._granularity=n,this._height=i,this._extrudedHeight=a(c,0),this._extrude=l,this._polygonHierarchy=t,this._perPositionHeight=u,this._workerName="createPolygonOutlineGeometry",this.packedLength=m.computeHierarchyPackedLength(t)+s.packedLength+6}var N=[],O=[];g.pack=function(e,t,r){return r=a(r,0),r=m.packPolygonHierarchy(e._polygonHierarchy,t,r),s.pack(e._ellipsoid,t,r),r+=s.packedLength,t[r++]=e._height,t[r++]=e._extrudedHeight,t[r++]=e._granularity,t[r++]=e._extrude?1:0,t[r++]=e._perPositionHeight?1:0,t[r++]=e.packedLength,t};var I=s.clone(s.UNIT_SPHERE),x={polygonHierarchy:{}};return g.unpack=function(e,t,r){t=a(t,0);var n=m.unpackPolygonHierarchy(e,t);t=n.startingIndex,delete n.startingIndex;var i=s.unpack(e,t,I);t+=s.packedLength;var u=e[t++],c=e[t++],l=e[t++],f=1===e[t++],h=1===e[t++],d=e[t++];return o(r)||(r=new g(x)),r._polygonHierarchy=n,r._ellipsoid=s.clone(i,r._ellipsoid),r._height=u,r._extrudedHeight=c,r._granularity=l,r._extrude=f,r._perPositionHeight=h,r.packedLength=d,r},g.fromPositions=function(e){e=a(e,a.EMPTY_OBJECT);var t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight};return new g(t)},g.createGeometry=function(n){var i=n._ellipsoid,a=n._granularity,u=n._height,s=n._extrudedHeight,c=n._extrude,f=n._polygonHierarchy,h=n._perPositionHeight,d=[],E=new v;E.enqueue(f);for(var T;0!==E.length;){var R=E.dequeue(),g=R.positions;if(g=e(g,r.equalsEpsilon,!0),!(g.length<3)){var N=R.holes?R.holes.length:0;for(T=0;T<N;T++){var O=R.holes[T];if(O.positions=e(O.positions,r.equalsEpsilon,!0),!(O.positions.length<3)){d.push(O.positions);var I=0;o(O.holes)&&(I=O.holes.length);for(var x=0;x<I;x++)E.enqueue(O.holes[x])}}d.push(g)}}if(0!==d.length){var w,M=[],C=y.chordLength(a,i.maximumRadius);if(c)for(T=0;T<d.length;T++)w=S(i,d[T],C,h),w.geometry=m.scaleToGeodeticHeightExtruded(w.geometry,u,s,i,h),M.push(w);else for(T=0;T<d.length;T++)w=A(i,d[T],C,h),w.geometry.attributes.position.values=_.scaleToGeodeticHeight(w.geometry.attributes.position.values,u,i,!h),M.push(w);w=p.combineInstances(M)[0];var P=t.fromVertices(w.attributes.position.values);return new l({attributes:w.attributes,indices:w.indices,primitiveType:w.primitiveType,boundingSphere:P})}},g}),define("Workers/createPolygonOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolygonOutlineGeometry"],function(e,t,r){"use strict";function n(n,i){return e(i)&&(n=r.unpack(n,i)),n._ellipsoid=t.clone(n._ellipsoid),r.createGeometry(n)}return n})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createPolylineGeometry.js b/engines/Cesium/Workers/createPolylineGeometry.js index bd2adf5..c08e40e 100644 --- a/engines/Cesium/Workers/createPolylineGeometry.js +++ b/engines/Cesium/Workers/createPolylineGeometry.js @@ -55,7 +55,7 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function r(t){return t+" is required, actual value was undefined"}function n(t,e,r){return"Expected "+r+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(n,a){if(!t(a))throw new e(r(n))},a.typeOf.func=function(t,r){if("function"!=typeof r)throw new e(n(typeof r,"function",t))},a.typeOf.string=function(t,r){if("string"!=typeof r)throw new e(n(typeof r,"string",t))},a.typeOf.number=function(t,r){if("number"!=typeof r)throw new e(n(typeof r,"number",t))},a.typeOf.number.lessThan=function(t,r,n){if(a.typeOf.number(t,r),r>=n)throw new e("Expected "+t+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(t,r,n){if(a.typeOf.number(t,r),r>n)throw new e("Expected "+t+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(t,r,n){if(a.typeOf.number(t,r),r<=n)throw new e("Expected "+t+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(t,r,n){if(a.typeOf.number(t,r),r<n)throw new e("Expected "+t+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(t,r){if("object"!=typeof r)throw new e(n(typeof r,"object",t))},a.typeOf.bool=function(t,r){if("boolean"!=typeof r)throw new e(n(typeof r,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^t>>>1^e[1&t];for(;r<this.N-1;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,r){return r=e(r,255),Math.round((.5*a.clamp(t,-1,1)+.5)*r)},a.fromSNorm=function(t,r){return r=e(r,255),a.clamp(t,0,r)/r*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e-r)},a.cosh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e+r)},a.lerp=function(t,e,r){return(1-r)*t+r*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,r,n,a){a=e(a,n);var o=Math.abs(t-r);return o<=a||o<=n*Math.max(Math.abs(t),Math.abs(r))};var o=[1];a.factorial=function(t){var e=o.length;if(t>=e)for(var r=o[e-1],n=e;n<=t;n++)o.push(r*n);return o[t]},a.incrementWrap=function(t,r,n){return n=e(n,0),++t,t>r&&(t=n),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,r){return t<e?e:t>r?r:t};var i=new t;return a.setRandomNumberSeed=function(e){i=new t(e)},a.nextRandomNumber=function(){return i.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var r=t*e;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)}i.fromSpherical=function(t,n){r(n)||(n=new i);var a=t.clock,o=t.cone,u=e(t.magnitude,1),s=u*Math.sin(o);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(o),n},i.fromElements=function(t,e,n,a){return r(a)?(a.x=t,a.y=e,a.z=n,a):new i(t,e,n)},i.clone=function(t,e){if(r(t))return r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new i(t.x,t.y,t.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z,r},i.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new i),a.x=t[n++],a.y=t[n++],a.z=t[n],a},i.packArray=function(t,e){var n=t.length;r(e)?e.length=3*n:e=new Array(3*n);for(var a=0;a<n;++a)i.pack(t[a],e,3*a);return e},i.unpackArray=function(t,e){var n=t.length;r(e)?e.length=n/3:e=new Array(n/3);for(var a=0;a<n;a+=3){var o=a/3;e[o]=i.unpack(t,a,e[o])}return e},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},i.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r},i.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};var u=new i;i.distance=function(t,e){return i.subtract(t,e,u),i.magnitude(u)},i.distanceSquared=function(t,e){return i.subtract(t,e,u),i.magnitudeSquared(u)},i.normalize=function(t,e){var r=i.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},i.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r},i.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r},i.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r},i.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r},i.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r},i.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var s=new i;i.lerp=function(t,e,r,n){return i.multiplyByScalar(e,r,s),n=i.multiplyByScalar(t,1-r,n),i.add(s,n,n)};var E=new i,c=new i;i.angleBetween=function(t,e){i.normalize(t,E),i.normalize(e,c);var r=i.dot(E,c),n=i.magnitude(i.cross(E,c,E));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,l);return i.abs(r,r),e=r.x<=r.y?r.x<=r.z?i.clone(i.UNIT_X,e):i.clone(i.UNIT_Z,e):r.y<=r.z?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_Z,e)},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},i.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]},i.equalsEpsilon=function(t,e,n,a){return t===e||r(t)&&r(e)&&o.equalsEpsilon(t.x,e.x,n,a)&&o.equalsEpsilon(t.y,e.y,n,a)&&o.equalsEpsilon(t.z,e.z,n,a)},i.cross=function(t,e,r){var n=t.x,a=t.y,o=t.z,i=e.x,u=e.y,s=e.z,E=a*s-o*u,c=o*i-n*s,l=n*u-a*i;return r.x=E,r.y=c,r.z=l,r},i.fromDegrees=function(t,e,r,n,a){return t=o.toRadians(t),e=o.toRadians(e),i.fromRadians(t,e,r,n,a)};var f=new i,_=new i,R=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(t,n,a,o,u){a=e(a,0);var s=r(o)?o.radiiSquared:R,E=Math.cos(n);f.x=E*Math.cos(t),f.y=E*Math.sin(t),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,_);var c=Math.sqrt(i.dot(f,_));return _=i.divideByScalar(_,c,_),f=i.multiplyByScalar(f,a,f),r(u)||(u=new i),i.add(_,f,u)},i.fromDegreesArray=function(t,e,n){var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=t[o],s=t[o+1],E=o/2;n[E]=i.fromDegrees(u,s,0,e,n[E])}return n},i.fromRadiansArray=function(t,e,n){var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=t[o],s=t[o+1],E=o/2;n[E]=i.fromRadians(u,s,0,e,n[E])}return n},i.fromDegreesArrayHeights=function(t,e,n){var a=t.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=t[o],s=t[o+1],E=t[o+2],c=o/3;n[c]=i.fromDegrees(u,s,E,e,n[c])}return n},i.fromRadiansArrayHeights=function(t,e,n){var a=t.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=t[o],s=t[o+1],E=t[o+2],c=o/3;n[c]=i.fromRadians(u,s,E,e,n[c])}return n},i.ZERO=a(new i(0,0,0)),i.UNIT_X=a(new i(1,0,0)),i.UNIT_Y=a(new i(0,1,0)),i.UNIT_Z=a(new i(0,0,1)),i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e,r){return i.equalsEpsilon(this,t,e,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,r,n){"use strict";function a(r,a,u,s,E){var c=r.x,l=r.y,f=r.z,_=a.x,R=a.y,T=a.z,h=c*c*_*_,A=l*l*R*R,d=f*f*T*T,S=h+A+d,m=Math.sqrt(1/S),N=t.multiplyByScalar(r,m,o);if(S<s)return isFinite(m)?t.clone(N,E):void 0;var C=u.x,I=u.y,p=u.z,M=i;M.x=N.x*C*2,M.y=N.y*I*2,M.z=N.z*p*2;var O,g,y,F,L,v,D,U,P,w,B,x=(1-m)*t.magnitude(r)/(.5*t.magnitude(M)),G=0;do{x-=G,y=1/(1+x*C),F=1/(1+x*I),L=1/(1+x*p),v=y*y,D=F*F,U=L*L,P=v*y,w=D*F,B=U*L,O=h*v+A*D+d*U-1,g=h*P*C+A*w*I+d*B*p;var b=-2*g;G=O/b}while(Math.abs(O)>n.EPSILON12);return e(E)?(E.x=c*y,E.y=l*F,E.z=f*L,E):new t(c*y,l*F,f*L)}var o=new t,i=new t;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,a,o,i){"use strict";function u(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)}u.fromRadians=function(t,n,a,o){return a=e(a,0),r(o)?(o.longitude=t,o.latitude=n,o.height=a,o):new u(t,n,a)},u.fromDegrees=function(t,e,r,n){return t=o.toRadians(t),e=o.toRadians(e),u.fromRadians(t,e,r,n)};var s=new t,E=new t,c=new t,l=new t(1/6378137,1/6378137,1/6356752.314245179),f=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),_=o.EPSILON1;return u.fromCartesian=function(e,n,a){var R=r(n)?n.oneOverRadii:l,T=r(n)?n.oneOverRadiiSquared:f,h=r(n)?n._centerToleranceSquared:_,A=i(e,R,T,h,E);if(r(A)){var d=t.multiplyComponents(A,T,s);d=t.normalize(d,d);var S=t.subtract(e,A,c),m=Math.atan2(d.y,d.x),N=Math.asin(d.z),C=o.sign(t.dot(S,e))*t.magnitude(S);return r(a)?(a.longitude=m,a.latitude=N,a.height=C,a):new u(m,N,C)}},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),r=Object.defineProperties;return e&&t(r)||(r=function(t){return t}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,a,o,i,u,s){"use strict";function E(e,n,a,o){n=r(n,0),a=r(a,0),o=r(o,0),e._radii=new t(n,a,o),e._radiiSquared=new t(n*n,a*a,o*o),e._radiiToTheFourth=new t(n*n*n*n,a*a*a*a,o*o*o*o),e._oneOverRadii=new t(0===n?0:1/n,0===a?0:1/a,0===o?0:1/o),e._oneOverRadiiSquared=new t(0===n?0:1/(n*n),0===a?0:1/(a*a),0===o?0:1/(o*o)),e._minimumRadius=Math.min(n,a,o),e._maximumRadius=Math.max(n,a,o),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,r){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._sqauredXOverSquaredZ=void 0,E(this,t,e,r)}a(c.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}}}),c.clone=function(e,r){if(n(e)){var a=e._radii;return n(r)?(t.clone(a,r._radii),t.clone(e._radiiSquared,r._radiiSquared),t.clone(e._radiiToTheFourth,r._radiiToTheFourth),t.clone(e._oneOverRadii,r._oneOverRadii),t.clone(e._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=e._minimumRadius,r._maximumRadius=e._maximumRadius,r._centerToleranceSquared=e._centerToleranceSquared,r):new c(a.x,a.y,a.z)}},c.fromCartesian3=function(t,e){return n(e)||(e=new c),n(t)?(E(e,t.x,t.y,t.z),e):e},c.WGS84=i(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=i(new c(1,1,1)),c.MOON=i(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,n,a){return a=r(a,0),t.pack(e._radii,n,a),n},c.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n);return c.fromCartesian3(o,a)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,r){var a=e.longitude,o=e.latitude,i=Math.cos(o),u=i*Math.cos(a),s=i*Math.sin(a),E=Math.sin(o);return n(r)||(r=new t),r.x=u,r.y=s,r.z=E,t.normalize(r,r)},c.prototype.geodeticSurfaceNormal=function(e,r){return n(r)||(r=new t),r=t.multiplyComponents(e,this._oneOverRadiiSquared,r),t.normalize(r,r)};var l=new t,f=new t;c.prototype.cartographicToCartesian=function(e,r){var a=l,o=f;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,o);var i=Math.sqrt(t.dot(a,o));return t.divideByScalar(o,i,o),t.multiplyByScalar(a,e.height,a),n(r)||(r=new t),t.add(o,a,r)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var a=0;a<r;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var _=new t,R=new t,T=new t;return c.prototype.cartesianToCartographic=function(r,a){var o=this.scaleToGeodeticSurface(r,R);if(n(o)){var i=this.geodeticSurfaceNormal(o,_),s=t.subtract(r,o,T),E=Math.atan2(i.y,i.x),c=Math.asin(i.z),l=u.sign(t.dot(s,r))*t.magnitude(s);return n(a)?(a.longitude=E,a.latitude=c,a.height=l,a):new e(E,c,l)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var a=0;a<r;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return s(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,r){n(r)||(r=new t);var a=e.x,o=e.y,i=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+o*o*u.y+i*i*u.z);return t.multiplyByScalar(e,s,r)},c.prototype.transformPositionToScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._radii,r)},c.prototype.equals=function(e){return this===e||n(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,o){a=r(a,0);var i=this._sqauredXOverSquaredZ;if(n(o)||(o=new t),o.x=0,o.y=0,o.z=e.z*(1-i),!(Math.abs(o.z)>=this._radii.z-a))return o},c}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(t,e,r,n){"use strict";function a(r,n,a){if(e(r)){a=t(a,!1);var i=r.length;if(i<2)return r;var u,s,E;for(u=1;u<i&&(s=r[u-1],E=r[u],!n(s,E,o));++u);if(u===i)return a&&n(r[0],r[r.length-1],o)?r.slice(1):r;for(var c=r.slice(0,u);u<i;++u)E=r[u],n(s,E,o)||(c.push(E),s=E);return a&&c.length>1&&n(c[0],c[c.length-1],o)&&c.shift(),c}}var o=n.EPSILON10;return a}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,r,n,a,o,i){"use strict";function u(t){this._ellipsoid=r(t,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,r){var a=this._semimajorAxis,o=e.longitude*a,i=e.latitude*a,u=e.height;return n(r)?(r.x=o,r.y=i,r.z=u,r):new t(o,i,u)},u.prototype.unproject=function(t,r){var a=this._oneOverSemimajorAxis,o=t.x*a,i=t.y*a,u=t.z;return n(r)?(r.longitude=o,r.latitude=i,r.height=u,r):new e(o,i,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,r){this.start=t(e,0),this.stop=t(r,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t,e,n,a,o,i,u,s,E){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(e,0),this[4]=r(o,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(i,0),this[8]=r(E,0)}function E(t){for(var e=0,r=0;r<9;++r){var n=t[r];e+=n*n}return Math.sqrt(e)}function c(t){for(var e=0,r=0;r<3;++r){var n=t[s.getElementIndex(T[r],R[r])];e+=2*n*n}return Math.sqrt(e)}function l(t,e){for(var r=u.EPSILON15,n=0,a=1,o=0;o<3;++o){var i=Math.abs(t[s.getElementIndex(T[o],R[o])]);i>n&&(a=o,n=i)}var E=1,c=0,l=R[a],f=T[a];if(Math.abs(t[s.getElementIndex(f,l)])>r){var _,h=t[s.getElementIndex(f,f)],A=t[s.getElementIndex(l,l)],d=t[s.getElementIndex(f,l)],S=(h-A)/2/d;_=S<0?-1/(-S+Math.sqrt(1+S*S)):1/(S+Math.sqrt(1+S*S)),E=1/Math.sqrt(1+_*_),c=_*E}return e=s.clone(s.IDENTITY,e),e[s.getElementIndex(l,l)]=e[s.getElementIndex(f,f)]=E,e[s.getElementIndex(f,l)]=c,e[s.getElementIndex(l,f)]=-c,e}s.packedLength=9,s.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e},s.unpack=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},s.clone=function(t,e){if(n(t))return n(e)?(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],e):new s(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},s.fromArray=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},s.fromColumnMajorArray=function(t,e){return s.clone(t,e)},s.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new s(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},s.fromQuaternion=function(t,e){var r=t.x*t.x,a=t.x*t.y,o=t.x*t.z,i=t.x*t.w,u=t.y*t.y,E=t.y*t.z,c=t.y*t.w,l=t.z*t.z,f=t.z*t.w,_=t.w*t.w,R=r-u-l+_,T=2*(a-f),h=2*(o+c),A=2*(a+f),d=-r+u-l+_,S=2*(E-i),m=2*(o-c),N=2*(E+i),C=-r-u+l+_;return n(e)?(e[0]=R,e[1]=A,e[2]=m,e[3]=T,e[4]=d,e[5]=N,e[6]=h,e[7]=S,e[8]=C,e):new s(R,T,h,A,d,S,m,N,C)},s.fromHeadingPitchRoll=function(t,e){var r=Math.cos(-t.pitch),a=Math.cos(-t.heading),o=Math.cos(t.roll),i=Math.sin(-t.pitch),u=Math.sin(-t.heading),E=Math.sin(t.roll),c=r*a,l=-o*u+E*i*a,f=E*u+o*i*a,_=r*u,R=o*a+E*i*u,T=-i*o+o*i*u,h=-i,A=E*r,d=o*r;return n(e)?(e[0]=c,e[1]=_,e[2]=h,e[3]=l,e[4]=R,e[5]=A,e[6]=f,e[7]=T,e[8]=d,e):new s(c,l,f,_,R,T,h,A,d)},s.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new s(t.x,0,0,0,t.y,0,0,0,t.z)},s.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new s(t,0,0,0,t,0,0,0,t)},s.fromCrossProduct=function(t,e){return n(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new s(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},s.fromRotationX=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=r,e[5]=a,e[6]=0,e[7]=-a,e[8]=r,e):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=r,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=r,e):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=r,e[1]=a,e[2]=0,e[3]=-a,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(t,e){return n(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},s.getElementIndex=function(t,e){return 3*t+e},s.getColumn=function(t,e,r){var n=3*e,a=t[n],o=t[n+1],i=t[n+2];return r.x=a,r.y=o,r.z=i,r},s.setColumn=function(t,e,r,n){n=s.clone(t,n);var a=3*e;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(t,e,r){var n=t[e],a=t[e+3],o=t[e+6];return r.x=n,r.y=a,r.z=o,r},s.setRow=function(t,e,r,n){return n=s.clone(t,n),n[e]=r.x,n[e+3]=r.y,n[e+6]=r.z,n};var f=new t;s.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],f)),r.y=t.magnitude(t.fromElements(e[3],e[4],e[5],f)),r.z=t.magnitude(t.fromElements(e[6],e[7],e[8],f)),r};var _=new t;s.getMaximumScale=function(e){return s.getScale(e,_),t.maximumComponent(_)},s.multiply=function(t,e,r){var n=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],o=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],i=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],E=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],l=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return r[0]=n,r[1]=a,r[2]=o,r[3]=i,r[4]=u,r[5]=s,r[6]=E,r[7]=c,r[8]=l,r},s.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r},s.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r},s.multiplyByVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[3]*a+t[6]*o,u=t[1]*n+t[4]*a+t[7]*o,s=t[2]*n+t[5]*a+t[8]*o;return r.x=i,r.y=u,r.z=s,r},s.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r},s.multiplyByScale=function(t,e,r){return r[0]=t[0]*e.x,r[1]=t[1]*e.x,r[2]=t[2]*e.x,r[3]=t[3]*e.y,r[4]=t[4]*e.y,r[5]=t[5]*e.y,r[6]=t[6]*e.z,r[7]=t[7]*e.z,r[8]=t[8]*e.z,r},s.negate=function(t,e){return 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],e},s.transpose=function(t,e){var r=t[0],n=t[3],a=t[6],o=t[1],i=t[4],u=t[7],s=t[2],E=t[5],c=t[8];return e[0]=r,e[1]=n,e[2]=a,e[3]=o,e[4]=i,e[5]=u,e[6]=s,e[7]=E,e[8]=c,e};var R=[1,0,0],T=[2,2,1],h=new s,A=new s;return s.computeEigenDecomposition=function(t,e){var r=u.EPSILON20,a=10,o=0,i=0;n(e)||(e={});for(var f=e.unitary=s.clone(s.IDENTITY,e.unitary),_=e.diagonal=s.clone(t,e.diagonal),R=r*E(_);i<a&&c(_)>R;)l(_,h),s.transpose(h,A),s.multiply(_,h,_),s.multiply(A,_,_),s.multiply(f,h,f),++o>2&&(++i,o=0);return e},s.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},s.determinant=function(t){var e=t[0],r=t[3],n=t[6],a=t[1],o=t[4],i=t[7],u=t[2],s=t[5],E=t[8];return e*(o*E-s*i)+a*(s*n-r*E)+u*(r*i-o*n)},s.inverse=function(t,e){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],u=t[5],E=t[6],c=t[7],l=t[8],f=s.determinant(t);e[0]=i*l-c*u,e[1]=c*a-n*l,e[2]=n*u-i*a,e[3]=E*u-o*l,e[4]=r*l-E*a,e[5]=o*a-r*u,e[6]=o*c-E*i,e[7]=E*n-r*c,e[8]=r*i-o*n;var _=1/f;return s.multiplyByScalar(e,_,e)},s.equals=function(t,e){return t===e||n(t)&&n(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},s.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},s.IDENTITY=i(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=i(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,0)}i.fromElements=function(t,e,n,a,o){return r(o)?(o.x=t,o.y=e,o.z=n,o.w=a,o):new i(t,e,n,a)},i.fromColor=function(t,e){return r(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,e){if(r(t))return r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new i(t.x,t.y,t.z,t.w)},i.packedLength=4,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},i.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new i),a.x=t[n++],a.y=t[n++],a.z=t[n++],a.w=t[n],a},i.packArray=function(t,e){var n=t.length;r(e)?e.length=4*n:e=new Array(4*n);for(var a=0;a<n;++a)i.pack(t[a],e,4*a);return e},i.unpackArray=function(t,e){var n=t.length;r(e)?e.length=n/4:e=new Array(n/4);for(var a=0;a<n;a+=4){var o=a/4;e[o]=i.unpack(t,a,e[o])}return e},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},i.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r.w=Math.min(t.w,e.w),r},i.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r.w=Math.max(t.w,e.w),r},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};var u=new i;i.distance=function(t,e){return i.subtract(t,e,u),i.magnitude(u)},i.distanceSquared=function(t,e){return i.subtract(t,e,u),i.magnitudeSquared(u)},i.normalize=function(t,e){var r=i.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e.w=t.w/r,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},i.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r.w=t.w*e.w,r},i.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r.w=t.w/e.w,r},i.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r.w=t.w+e.w,r},i.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r.w=t.w-e.w,r},i.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r.w=t.w*e,r},i.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r.w=t.w/e,r},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var s=new i;i.lerp=function(t,e,r,n){return i.multiplyByScalar(e,r,s),n=i.multiplyByScalar(t,1-r,n),i.add(s,n,n)};var E=new i;return i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,E);return i.abs(r,r),e=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):r.z<=r.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):r.z<=r.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},i.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]&&t.w===e[r+3]},i.equalsEpsilon=function(t,e,n,a){return t===e||r(t)&&r(e)&&o.equalsEpsilon(t.x,e.x,n,a)&&o.equalsEpsilon(t.y,e.y,n,a)&&o.equalsEpsilon(t.z,e.z,n,a)&&o.equalsEpsilon(t.w,e.w,n,a)},i.ZERO=a(new i(0,0,0,0)),i.UNIT_X=a(new i(1,0,0,0)),i.UNIT_Y=a(new i(0,1,0,0)),i.UNIT_Z=a(new i(0,0,1,0)),i.UNIT_W=a(new i(0,0,0,1)),i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e,r){return i.equalsEpsilon(this,t,e,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){ -this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,r,n,a,o,i,u,s,E){"use strict";function c(t,e,r,a,o,i,u,s,E,c,l,f,_,R,T,h){this[0]=n(t,0),this[1]=n(o,0),this[2]=n(E,0),this[3]=n(_,0),this[4]=n(e,0),this[5]=n(i,0),this[6]=n(c,0),this[7]=n(R,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(l,0),this[11]=n(T,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(h,0)}c.packedLength=16,c.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e[r++]=t[9],e[r++]=t[10],e[r++]=t[11],e[r++]=t[12],e[r++]=t[13],e[r++]=t[14],e[r]=t[15],e},c.unpack=function(t,e,r){return e=n(e,0),a(r)||(r=new c),r[0]=t[e++],r[1]=t[e++],r[2]=t[e++],r[3]=t[e++],r[4]=t[e++],r[5]=t[e++],r[6]=t[e++],r[7]=t[e++],r[8]=t[e++],r[9]=t[e++],r[10]=t[e++],r[11]=t[e++],r[12]=t[e++],r[13]=t[e++],r[14]=t[e++],r[15]=t[e],r},c.clone=function(t,e){if(a(t))return a(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,r,o){return r=n(r,t.ZERO),a(o)?(o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=0,o[4]=e[3],o[5]=e[4],o[6]=e[5],o[7]=0,o[8]=e[6],o[9]=e[7],o[10]=e[8],o[11]=0,o[12]=r.x,o[13]=r.y,o[14]=r.z,o[15]=1,o):new c(e[0],e[3],e[6],r.x,e[1],e[4],e[7],r.y,e[2],e[5],e[8],r.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,r,n){a(n)||(n=new c);var o=r.x,i=r.y,u=r.z,s=e.x*e.x,E=e.x*e.y,l=e.x*e.z,f=e.x*e.w,_=e.y*e.y,R=e.y*e.z,T=e.y*e.w,h=e.z*e.z,A=e.z*e.w,d=e.w*e.w,S=s-_-h+d,m=2*(E-A),N=2*(l+T),C=2*(E+A),I=-s+_-h+d,p=2*(R-f),M=2*(l-T),O=2*(R+f),g=-s-_+h+d;return n[0]=S*o,n[1]=C*o,n[2]=M*o,n[3]=0,n[4]=m*i,n[5]=I*i,n[6]=O*i,n[7]=0,n[8]=N*u,n[9]=p*u,n[10]=g*u,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(s.IDENTITY,t,e)},c.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var l=new t,f=new t,_=new t;c.fromCamera=function(e,r){var n=e.position,o=e.direction,i=e.up;t.normalize(o,l),t.normalize(t.cross(l,i,f),f),t.normalize(t.cross(f,l,_),_);var u=f.x,s=f.y,E=f.z,R=l.x,T=l.y,h=l.z,A=_.x,d=_.y,S=_.z,m=n.x,N=n.y,C=n.z,I=u*-m+s*-N+E*-C,p=A*-m+d*-N+S*-C,M=R*m+T*N+h*C;return a(r)?(r[0]=u,r[1]=A,r[2]=-R,r[3]=0,r[4]=s,r[5]=d,r[6]=-T,r[7]=0,r[8]=E,r[9]=S,r[10]=-h,r[11]=0,r[12]=I,r[13]=p,r[14]=M,r[15]=1,r):new c(u,s,E,I,A,d,S,p,-R,-T,-h,M,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,r,n,a){var o=Math.tan(.5*t),i=1/o,u=i/e,s=(n+r)/(r-n),E=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=E,a[15]=0,a},c.computeOrthographicOffCenter=function(t,e,r,n,a,o,i){var u=1/(e-t),s=1/(n-r),E=1/(o-a),c=-(e+t)*u,l=-(n+r)*s,f=-(o+a)*E;return u*=2,s*=2,E*=-2,i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=0,i[12]=c,i[13]=l,i[14]=f,i[15]=1,i},c.computePerspectiveOffCenter=function(t,e,r,n,a,o,i){var u=2*a/(e-t),s=2*a/(n-r),E=(e+t)/(e-t),c=(n+r)/(n-r),l=-(o+a)/(o-a),f=-1,_=-2*o*a/(o-a);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=E,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=_,i[15]=0,i},c.computeInfinitePerspectiveOffCenter=function(t,e,r,n,a,o){var i=2*a/(e-t),u=2*a/(n-r),s=(e+t)/(e-t),E=(n+r)/(n-r),c=-1,l=-1,f=-2*a;return o[0]=i,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=s,o[9]=E,o[10]=c,o[11]=l,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o},c.computeViewportTransformation=function(t,e,r,a){t=n(t,n.EMPTY_OBJECT);var o=n(t.x,0),i=n(t.y,0),u=n(t.width,0),s=n(t.height,0);e=n(e,0),r=n(r,1);var E=.5*u,c=.5*s,l=.5*(r-e),f=E,_=c,R=l,T=o+E,h=i+c,A=e+l,d=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=_,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=R,a[11]=0,a[12]=T,a[13]=h,a[14]=A,a[15]=d,a},c.computeView=function(e,r,n,a,o){return o[0]=a.x,o[1]=n.x,o[2]=-r.x,o[3]=0,o[4]=a.y,o[5]=n.y,o[6]=-r.y,o[7]=0,o[8]=a.z,o[9]=n.z,o[10]=-r.z,o[11]=0,o[12]=-t.dot(a,e),o[13]=-t.dot(n,e),o[14]=t.dot(r,e),o[15]=1,o},c.toArray=function(t,e){return a(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,r){var n=4*e,a=t[n],o=t[n+1],i=t[n+2],u=t[n+3];return r.x=a,r.y=o,r.z=i,r.w=u,r},c.setColumn=function(t,e,r,n){n=c.clone(t,n);var a=4*e;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},c.setTranslation=function(t,e,r){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=t[15],r},c.getRow=function(t,e,r){var n=t[e],a=t[e+4],o=t[e+8],i=t[e+12];return r.x=n,r.y=a,r.z=o,r.w=i,r},c.setRow=function(t,e,r,n){return n=c.clone(t,n),n[e]=r.x,n[e+4]=r.y,n[e+8]=r.z,n[e+12]=r.w,n};var R=new t;c.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],R)),r.y=t.magnitude(t.fromElements(e[4],e[5],e[6],R)),r.z=t.magnitude(t.fromElements(e[8],e[9],e[10],R)),r};var T=new t;c.getMaximumScale=function(e){return c.getScale(e,T),t.maximumComponent(T)},c.multiply=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[3],u=t[4],s=t[5],E=t[6],c=t[7],l=t[8],f=t[9],_=t[10],R=t[11],T=t[12],h=t[13],A=t[14],d=t[15],S=e[0],m=e[1],N=e[2],C=e[3],I=e[4],p=e[5],M=e[6],O=e[7],g=e[8],y=e[9],F=e[10],L=e[11],v=e[12],D=e[13],U=e[14],P=e[15],w=n*S+u*m+l*N+T*C,B=a*S+s*m+f*N+h*C,x=o*S+E*m+_*N+A*C,G=i*S+c*m+R*N+d*C,b=n*I+u*p+l*M+T*O,z=a*I+s*p+f*M+h*O,H=o*I+E*p+_*M+A*O,V=i*I+c*p+R*M+d*O,X=n*g+u*y+l*F+T*L,q=a*g+s*y+f*F+h*L,W=o*g+E*y+_*F+A*L,Y=i*g+c*y+R*F+d*L,K=n*v+u*D+l*U+T*P,k=a*v+s*D+f*U+h*P,Z=o*v+E*D+_*U+A*P,j=i*v+c*D+R*U+d*P;return r[0]=w,r[1]=B,r[2]=x,r[3]=G,r[4]=b,r[5]=z,r[6]=H,r[7]=V,r[8]=X,r[9]=q,r[10]=W,r[11]=Y,r[12]=K,r[13]=k,r[14]=Z,r[15]=j,r},c.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r},c.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r},c.multiplyTransformation=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[4],u=t[5],s=t[6],E=t[8],c=t[9],l=t[10],f=t[12],_=t[13],R=t[14],T=e[0],h=e[1],A=e[2],d=e[4],S=e[5],m=e[6],N=e[8],C=e[9],I=e[10],p=e[12],M=e[13],O=e[14],g=n*T+i*h+E*A,y=a*T+u*h+c*A,F=o*T+s*h+l*A,L=n*d+i*S+E*m,v=a*d+u*S+c*m,D=o*d+s*S+l*m,U=n*N+i*C+E*I,P=a*N+u*C+c*I,w=o*N+s*C+l*I,B=n*p+i*M+E*O+f,x=a*p+u*M+c*O+_,G=o*p+s*M+l*O+R;return r[0]=g,r[1]=y,r[2]=F,r[3]=0,r[4]=L,r[5]=v,r[6]=D,r[7]=0,r[8]=U,r[9]=P,r[10]=w,r[11]=0,r[12]=B,r[13]=x,r[14]=G,r[15]=1,r},c.multiplyByMatrix3=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[4],u=t[5],s=t[6],E=t[8],c=t[9],l=t[10],f=e[0],_=e[1],R=e[2],T=e[3],h=e[4],A=e[5],d=e[6],S=e[7],m=e[8],N=n*f+i*_+E*R,C=a*f+u*_+c*R,I=o*f+s*_+l*R,p=n*T+i*h+E*A,M=a*T+u*h+c*A,O=o*T+s*h+l*A,g=n*d+i*S+E*m,y=a*d+u*S+c*m,F=o*d+s*S+l*m;return r[0]=N,r[1]=C,r[2]=I,r[3]=0,r[4]=p,r[5]=M,r[6]=O,r[7]=0,r[8]=g,r[9]=y,r[10]=F,r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},c.multiplyByTranslation=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=n*t[0]+a*t[4]+o*t[8]+t[12],u=n*t[1]+a*t[5]+o*t[9]+t[13],s=n*t[2]+a*t[6]+o*t[10]+t[14];return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=i,r[13]=u,r[14]=s,r[15]=t[15],r};var h=new t;c.multiplyByUniformScale=function(t,e,r){return h.x=e,h.y=e,h.z=e,c.multiplyByScale(t,h,r)},c.multiplyByScale=function(t,e,r){var n=e.x,a=e.y,o=e.z;return 1===n&&1===a&&1===o?c.clone(t,r):(r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=0,r[4]=a*t[4],r[5]=a*t[5],r[6]=a*t[6],r[7]=0,r[8]=o*t[8],r[9]=o*t[9],r[10]=o*t[10],r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=1,r)},c.multiplyByVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=e.w,u=t[0]*n+t[4]*a+t[8]*o+t[12]*i,s=t[1]*n+t[5]*a+t[9]*o+t[13]*i,E=t[2]*n+t[6]*a+t[10]*o+t[14]*i,c=t[3]*n+t[7]*a+t[11]*o+t[15]*i;return r.x=u,r.y=s,r.z=E,r.w=c,r},c.multiplyByPointAsVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[4]*a+t[8]*o,u=t[1]*n+t[5]*a+t[9]*o,s=t[2]*n+t[6]*a+t[10]*o;return r.x=i,r.y=u,r.z=s,r},c.multiplyByPoint=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[4]*a+t[8]*o+t[12],u=t[1]*n+t[5]*a+t[9]*o+t[13],s=t[2]*n+t[6]*a+t[10]*o+t[14];return r.x=i,r.y=u,r.z=s,r},c.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var r=t[1],n=t[2],a=t[3],o=t[6],i=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=i,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,r){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r&&Math.abs(t[9]-e[9])<=r&&Math.abs(t[10]-e[10])<=r&&Math.abs(t[11]-e[11])<=r&&Math.abs(t[12]-e[12])<=r&&Math.abs(t[13]-e[13])<=r&&Math.abs(t[14]-e[14])<=r&&Math.abs(t[15]-e[15])<=r},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var A=new s,d=new s,S=new e,m=new e(0,0,0,1);return c.inverse=function(t,r){if(s.equalsEpsilon(c.getRotation(t,A),d,u.EPSILON7)&&e.equals(c.getRow(t,3,S),m))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-t[12],r[13]=-t[13],r[14]=-t[14],r[15]=1,r;var n=t[0],a=t[4],o=t[8],i=t[12],l=t[1],f=t[5],_=t[9],R=t[13],T=t[2],h=t[6],N=t[10],C=t[14],I=t[3],p=t[7],M=t[11],O=t[15],g=N*O,y=C*M,F=h*O,L=C*p,v=h*M,D=N*p,U=T*O,P=C*I,w=T*M,B=N*I,x=T*p,G=h*I,b=g*f+L*_+v*R-(y*f+F*_+D*R),z=y*l+U*_+B*R-(g*l+P*_+w*R),H=F*l+P*f+x*R-(L*l+U*f+G*R),V=D*l+w*f+G*_-(v*l+B*f+x*_),X=y*a+F*o+D*i-(g*a+L*o+v*i),q=g*n+P*o+w*i-(y*n+U*o+B*i),W=L*n+U*a+G*i-(F*n+P*a+x*i),Y=v*n+B*a+x*o-(D*n+w*a+G*o);g=o*R,y=i*_,F=a*R,L=i*f,v=a*_,D=o*f,U=n*R,P=i*l,w=n*_,B=o*l,x=n*f,G=a*l;var K=g*p+L*M+v*O-(y*p+F*M+D*O),k=y*I+U*M+B*O-(g*I+P*M+w*O),Z=F*I+P*p+x*O-(L*I+U*p+G*O),j=D*I+w*p+G*M-(v*I+B*p+x*M),Q=F*N+D*C+y*h-(v*C+g*h+L*N),J=w*C+g*T+P*N-(U*N+B*C+y*T),$=U*h+G*C+L*T-(x*C+F*T+P*h),tt=x*N+v*T+B*h-(w*h+G*N+D*T),et=n*b+a*z+o*H+i*V;if(Math.abs(et)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return et=1/et,r[0]=b*et,r[1]=z*et,r[2]=H*et,r[3]=V*et,r[4]=X*et,r[5]=q*et,r[6]=W*et,r[7]=Y*et,r[8]=K*et,r[9]=k*et,r[10]=Z*et,r[11]=j*et,r[12]=Q*et,r[13]=J*et,r[14]=$*et,r[15]=tt*et,r},c.inverseTransformation=function(t,e){var r=t[0],n=t[1],a=t[2],o=t[4],i=t[5],u=t[6],s=t[8],E=t[9],c=t[10],l=t[12],f=t[13],_=t[14],R=-r*l-n*f-a*_,T=-o*l-i*f-u*_,h=-s*l-E*f-c*_;return e[0]=r,e[1]=o,e[2]=s,e[3]=0,e[4]=n,e[5]=i,e[6]=E,e[7]=0,e[8]=a,e[9]=u,e[10]=c,e[11]=0,e[12]=R,e[13]=T,e[14]=h,e[15]=1,e},c.IDENTITY=i(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=i(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,o(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]&&t[9]===e[r+9]&&t[10]===e[r+10]&&t[11]===e[r+11]&&t[12]===e[r+12]&&t[13]===e[r+13]&&t[14]===e[r+14]&&t[15]===e[r+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t,e,n,a){this.west=r(t,0),this.south=r(e,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(t,e,n){return n=r(n,0),e[n++]=t.west,e[n++]=t.south,e[n++]=t.east,e[n]=t.north,e},s.unpack=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},s.computeWidth=function(t){var e=t.east,r=t.west;return e<r&&(e+=u.TWO_PI),e-r},s.computeHeight=function(t){return t.north-t.south},s.fromDegrees=function(t,e,a,o,i){return t=u.toRadians(r(t,0)),e=u.toRadians(r(e,0)),a=u.toRadians(r(a,0)),o=u.toRadians(r(o,0)),n(i)?(i.west=t,i.south=e,i.east=a,i.north=o,i):new s(t,e,a,o)},s.fromRadians=function(t,e,a,o,i){return n(i)?(i.west=r(t,0),i.south=r(e,0),i.east=r(a,0),i.north=r(o,0),i):new s(t,e,a,o)},s.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,i=-Number.MAX_VALUE,E=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=0,f=t.length;l<f;l++){var _=t[l];r=Math.min(r,_.longitude),a=Math.max(a,_.longitude),E=Math.min(E,_.latitude),c=Math.max(c,_.latitude);var R=_.longitude>=0?_.longitude:_.longitude+u.TWO_PI;o=Math.min(o,R),i=Math.max(i,R)}return a-r>i-o&&(r=o,a=i,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(e)?(e.west=r,e.south=E,e.east=a,e.north=c,e):new s(r,E,a,c)},s.fromCartesianArray=function(t,e,r){for(var a=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,E=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,_=t.length;f<_;f++){var R=e.cartesianToCartographic(t[f]);a=Math.min(a,R.longitude),o=Math.max(o,R.longitude),c=Math.min(c,R.latitude),l=Math.max(l,R.latitude);var T=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;i=Math.min(i,T),E=Math.max(E,T)}return o-a>E-i&&(a=i,o=E,o>u.PI&&(o-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=c,r.east=o,r.north=l,r):new s(a,c,o,l)},s.clone=function(t,e){if(n(t))return n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new s(t.west,t.south,t.east,t.north)},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,e){return t===e||n(t)&&n(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},s.prototype.equalsEpsilon=function(t,e){return n(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},s.validate=function(t){},s.southwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t(e.west,e.south)},s.northwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t(e.west,e.north)},s.northeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t(e.east,e.north)},s.southeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t(e.east,e.south)},s.center=function(e,r){var a=e.east,o=e.west;a<o&&(a+=u.TWO_PI);var i=u.negativePiToPi(.5*(o+a)),s=.5*(e.south+e.north);return n(r)?(r.longitude=i,r.latitude=s,r.height=0,r):new t(i,s)},s.intersection=function(t,e,r){var a=t.east,o=t.west,i=e.east,E=e.west;a<o&&i>0?a+=u.TWO_PI:i<E&&a>0&&(i+=u.TWO_PI),a<o&&E<0?E+=u.TWO_PI:i<E&&o<0&&(o+=u.TWO_PI);var c=u.negativePiToPi(Math.max(o,E)),l=u.negativePiToPi(Math.min(a,i));if(!((t.west<t.east||e.west<e.east)&&l<=c)){var f=Math.max(t.south,e.south),_=Math.min(t.north,e.north);if(!(f>=_))return n(r)?(r.west=c,r.south=f,r.east=l,r.north=_,r):new s(c,f,l,_)}},s.simpleIntersection=function(t,e,r){var a=Math.max(t.west,e.west),o=Math.max(t.south,e.south),i=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(o>=u||a>=i))return n(r)?(r.west=a,r.south=o,r.east=i,r.north=u,r):new s(a,o,i,u)},s.union=function(t,e,r){n(r)||(r=new s);var a=t.east,o=t.west,i=e.east,E=e.west;a<o&&i>0?a+=u.TWO_PI:i<E&&a>0&&(i+=u.TWO_PI),a<o&&E<0?E+=u.TWO_PI:i<E&&o<0&&(o+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(o,E)),l=u.convertLongitudeRange(Math.max(a,i));return r.west=c,r.south=Math.min(t.south,e.south),r.east=l,r.north=Math.max(t.north,e.north),r},s.expand=function(t,e,r){return n(r)||(r=new s),r.west=Math.min(t.west,e.longitude),r.south=Math.min(t.south,e.latitude),r.east=Math.max(t.east,e.longitude),r.north=Math.max(t.north,e.latitude),r},s.contains=function(t,e){var r=e.longitude,n=e.latitude,a=t.west,o=t.east;return o<a&&(o+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<o||u.equalsEpsilon(r,o,u.EPSILON14))&&n>=t.south&&n<=t.north};var E=new t;return s.subsample=function(t,e,a,i){e=r(e,o.WGS84),a=r(a,0),n(i)||(i=[]);var c=0,l=t.north,f=t.south,_=t.east,R=t.west,T=E;T.height=a,T.longitude=R,T.latitude=l,i[c]=e.cartographicToCartesian(T,i[c]),c++,T.longitude=_,i[c]=e.cartographicToCartesian(T,i[c]),c++,T.latitude=f,i[c]=e.cartographicToCartesian(T,i[c]),c++,T.longitude=R,i[c]=e.cartographicToCartesian(T,i[c]),c++,l<0?T.latitude=l:f>0?T.latitude=f:T.latitude=0;for(var h=1;h<8;++h)T.longitude=-Math.PI+h*u.PI_OVER_TWO,s.contains(t,T)&&(i[c]=e.cartographicToCartesian(T,i[c]),c++);return 0===T.latitude&&(T.longitude=R,i[c]=e.cartographicToCartesian(T,i[c]),c++,T.longitude=_,i[c]=e.cartographicToCartesian(T,i[c]),c++),i.length=c,i},s.MAX_VALUE=i(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,r,n,a,o,i,u,s,E,c,l){"use strict";function f(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var _=new t,R=new t,T=new t,h=new t,A=new t,d=new t,S=new t,m=new t,N=new t,C=new t,I=new t,p=new t;f.fromPoints=function(e,r){if(a(r)||(r=new f),!a(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;for(var n=t.clone(e[0],S),o=t.clone(n,_),i=t.clone(n,R),u=t.clone(n,T),s=t.clone(n,h),E=t.clone(n,A),c=t.clone(n,d),l=e.length,M=1;M<l;M++){t.clone(e[M],n);var O=n.x,g=n.y,y=n.z;O<o.x&&t.clone(n,o),O>s.x&&t.clone(n,s),g<i.y&&t.clone(n,i),g>E.y&&t.clone(n,E),y<u.z&&t.clone(n,u),y>c.z&&t.clone(n,c)}var F=t.magnitudeSquared(t.subtract(s,o,m)),L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(c,u,m)),D=o,U=s,P=F;L>P&&(P=L,D=i,U=E),v>P&&(P=v,D=u,U=c);var w=N;w.x=.5*(D.x+U.x),w.y=.5*(D.y+U.y),w.z=.5*(D.z+U.z);var B=t.magnitudeSquared(t.subtract(U,w,m)),x=Math.sqrt(B),G=C;G.x=o.x,G.y=i.y,G.z=u.z;var b=I;b.x=s.x,b.y=E.y,b.z=c.z;var z=t.multiplyByScalar(t.add(G,b,m),.5,p),H=0;for(M=0;M<l;M++){t.clone(e[M],n);var V=t.magnitude(t.subtract(n,z,m));V>H&&(H=V);var X=t.magnitudeSquared(t.subtract(n,w,m));if(X>B){var q=Math.sqrt(X);x=.5*(x+q),B=x*x;var W=q-x;w.x=(x*w.x+W*n.x)/q,w.y=(x*w.y+W*n.y)/q,w.z=(x*w.z+W*n.z)/q}}return x<H?(t.clone(w,r.center),r.radius=x):(t.clone(z,r.center),r.radius=H),r};var M=new i,O=new t,g=new t,y=new e,F=new e;f.fromRectangle2D=function(t,e,r){return f.fromRectangleWithHeights2D(t,e,0,0,r)},f.fromRectangleWithHeights2D=function(e,r,o,i,u){if(a(u)||(u=new f),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;r=n(r,M),l.southwest(e,y),y.height=o,l.northeast(e,F),F.height=i;var s=r.project(y,O),E=r.project(F,g),c=E.x-s.x,_=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(c*c+_*_+R*R);var T=u.center;return T.x=s.x+.5*c,T.y=s.y+.5*_,T.z=s.z+.5*R,u};var L=[];f.fromRectangle3D=function(t,e,r,i){e=n(e,o.WGS84),r=n(r,0);var u;return a(t)&&(u=l.subsample(t,e,r,L)),f.fromPoints(u,i)},f.fromVertices=function(e,r,o,i){if(a(i)||(i=new f),!a(e)||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;r=n(r,t.ZERO),o=n(o,3);var u=S;u.x=e[0]+r.x,u.y=e[1]+r.y,u.z=e[2]+r.z;for(var s=t.clone(u,_),E=t.clone(u,R),c=t.clone(u,T),l=t.clone(u,h),M=t.clone(u,A),O=t.clone(u,d),g=e.length,y=0;y<g;y+=o){var F=e[y]+r.x,L=e[y+1]+r.y,v=e[y+2]+r.z;u.x=F,u.y=L,u.z=v,F<s.x&&t.clone(u,s),F>l.x&&t.clone(u,l),L<E.y&&t.clone(u,E),L>M.y&&t.clone(u,M),v<c.z&&t.clone(u,c),v>O.z&&t.clone(u,O)}var D=t.magnitudeSquared(t.subtract(l,s,m)),U=t.magnitudeSquared(t.subtract(M,E,m)),P=t.magnitudeSquared(t.subtract(O,c,m)),w=s,B=l,x=D;U>x&&(x=U,w=E,B=M),P>x&&(x=P,w=c,B=O);var G=N;G.x=.5*(w.x+B.x),G.y=.5*(w.y+B.y),G.z=.5*(w.z+B.z);var b=t.magnitudeSquared(t.subtract(B,G,m)),z=Math.sqrt(b),H=C;H.x=s.x,H.y=E.y,H.z=c.z;var V=I;V.x=l.x,V.y=M.y,V.z=O.z;var X=t.multiplyByScalar(t.add(H,V,m),.5,p),q=0;for(y=0;y<g;y+=o){u.x=e[y]+r.x,u.y=e[y+1]+r.y,u.z=e[y+2]+r.z;var W=t.magnitude(t.subtract(u,X,m));W>q&&(q=W);var Y=t.magnitudeSquared(t.subtract(u,G,m));if(Y>b){var K=Math.sqrt(Y);z=.5*(z+K),b=z*z;var k=K-z;G.x=(z*G.x+k*u.x)/K,G.y=(z*G.y+k*u.y)/K,G.z=(z*G.z+k*u.z)/K}}return z<q?(t.clone(G,i.center),i.radius=z):(t.clone(X,i.center),i.radius=q),i},f.fromEncodedCartesianVertices=function(e,r,n){if(a(n)||(n=new f),!a(e)||!a(r)||e.length!==r.length||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var o=S;o.x=e[0]+r[0],o.y=e[1]+r[1],o.z=e[2]+r[2];for(var i=t.clone(o,_),u=t.clone(o,R),s=t.clone(o,T),E=t.clone(o,h),c=t.clone(o,A),l=t.clone(o,d),M=e.length,O=0;O<M;O+=3){var g=e[O]+r[O],y=e[O+1]+r[O+1],F=e[O+2]+r[O+2];o.x=g,o.y=y,o.z=F,g<i.x&&t.clone(o,i),g>E.x&&t.clone(o,E),y<u.y&&t.clone(o,u),y>c.y&&t.clone(o,c),F<s.z&&t.clone(o,s),F>l.z&&t.clone(o,l)}var L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(c,u,m)),D=t.magnitudeSquared(t.subtract(l,s,m)),U=i,P=E,w=L;v>w&&(w=v,U=u,P=c),D>w&&(w=D,U=s,P=l);var B=N;B.x=.5*(U.x+P.x),B.y=.5*(U.y+P.y),B.z=.5*(U.z+P.z);var x=t.magnitudeSquared(t.subtract(P,B,m)),G=Math.sqrt(x),b=C;b.x=i.x,b.y=u.y,b.z=s.z;var z=I;z.x=E.x,z.y=c.y,z.z=l.z;var H=t.multiplyByScalar(t.add(b,z,m),.5,p),V=0;for(O=0;O<M;O+=3){o.x=e[O]+r[O],o.y=e[O+1]+r[O+1],o.z=e[O+2]+r[O+2];var X=t.magnitude(t.subtract(o,H,m));X>V&&(V=X);var q=t.magnitudeSquared(t.subtract(o,B,m));if(q>x){var W=Math.sqrt(q);G=.5*(G+W),x=G*G;var Y=W-G;B.x=(G*B.x+Y*o.x)/W,B.y=(G*B.y+Y*o.y)/W,B.z=(G*B.z+Y*o.z)/W}}return G<V?(t.clone(B,n.center),n.radius=G):(t.clone(H,n.center),n.radius=V),n},f.fromCornerPoints=function(e,r,n){a(n)||(n=new f);var o=n.center;return t.add(e,r,o),t.multiplyByScalar(o,.5,o),n.radius=t.distance(o,r),n},f.fromEllipsoid=function(e,r){return a(r)||(r=new f),t.clone(t.ZERO,r.center),r.radius=e.maximumRadius,r};var v=new t;f.fromBoundingSpheres=function(e,r){if(a(r)||(r=new f),!a(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var n=e.length;if(1===n)return f.clone(e[0],r);if(2===n)return f.union(e[0],e[1],r);for(var o=[],i=0;i<n;i++)o.push(e[i].center);r=f.fromPoints(o,r);var u=r.center,s=r.radius;for(i=0;i<n;i++){var E=e[i];s=Math.max(s,t.distance(u,E.center,v)+E.radius)}return r.radius=s,r};var D=new t,U=new t,P=new t;f.fromOrientedBoundingBox=function(e,r){a(r)||(r=new f);var n=e.halfAxes,o=E.getColumn(n,0,D),i=E.getColumn(n,1,U),u=E.getColumn(n,2,P),s=t.magnitude(o),c=t.magnitude(i),l=t.magnitude(u);return r.center=t.clone(e.center,r.center),r.radius=Math.max(s,c,l),r},f.clone=function(e,r){if(a(e))return a(r)?(r.center=t.clone(e.center,r.center),r.radius=e.radius,r):new f(e.center,e.radius)},f.packedLength=4,f.pack=function(t,e,r){r=n(r,0);var a=t.center;return e[r++]=a.x,e[r++]=a.y,e[r++]=a.z,e[r]=t.radius,e},f.unpack=function(t,e,r){e=n(e,0),a(r)||(r=new f);var o=r.center;return o.x=t[e++],o.y=t[e++],o.z=t[e++],r.radius=t[e],r};var w=new t,B=new t;f.union=function(e,r,n){a(n)||(n=new f);var o=e.center,i=e.radius,u=r.center,s=r.radius,E=t.subtract(u,o,w),c=t.magnitude(E);if(i>=c+s)return e.clone(n),n;if(s>=c+i)return r.clone(n),n;var l=.5*(i+c+s),_=t.multiplyByScalar(E,(-i+l)/c,B);return t.add(_,o,_),t.clone(_,n.center),n.radius=l,n};var x=new t;f.expand=function(e,r,n){n=f.clone(e,n);var a=t.magnitude(t.subtract(r,n.center,x));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(e,r){var n=e.center,a=e.radius,o=r.normal,i=t.dot(o,n)+r.distance;return i<-a?u.OUTSIDE:i<a?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,r){return a(r)||(r=new f),r.center=c.multiplyByPoint(e,t.center,r.center),r.radius=c.getMaximumScale(e)*t.radius,r};var G=new t;f.distanceSquaredTo=function(e,r){var n=t.subtract(e.center,r,G);return t.magnitudeSquared(n)-e.radius*e.radius},f.transformWithoutScale=function(t,e,r){return a(r)||(r=new f),r.center=c.multiplyByPoint(e,t.center,r.center),r.radius=t.radius,r};var b=new t;f.computePlaneDistances=function(e,r,n,o){a(o)||(o=new s);var i=t.subtract(e.center,r,b),u=t.dot(n,i);return o.start=u-e.radius,o.stop=u+e.radius,o};for(var z=new t,H=new t,V=new t,X=new t,q=new t,W=new e,Y=new Array(8),K=0;K<8;++K)Y[K]=new t;var k=new i;return f.projectTo2D=function(e,r,a){r=n(r,k);var o=r.ellipsoid,i=e.center,u=e.radius,s=o.geodeticSurfaceNormal(i,z),E=t.cross(t.UNIT_Z,s,H);t.normalize(E,E);var c=t.cross(s,E,V);t.normalize(c,c),t.multiplyByScalar(s,u,s),t.multiplyByScalar(c,u,c),t.multiplyByScalar(E,u,E);var l=t.negate(c,q),_=t.negate(E,X),R=Y,T=R[0];t.add(s,c,T),t.add(T,E,T),T=R[1],t.add(s,c,T),t.add(T,_,T),T=R[2],t.add(s,l,T),t.add(T,_,T),T=R[3],t.add(s,l,T),t.add(T,E,T),t.negate(s,s),T=R[4],t.add(s,c,T),t.add(T,E,T),T=R[5],t.add(s,c,T),t.add(T,_,T),T=R[6],t.add(s,l,T),t.add(T,_,T),T=R[7],t.add(s,l,T),t.add(T,E,T);for(var h=R.length,A=0;A<h;++A){var d=R[A];t.add(i,d,d);var S=o.cartesianToCartographic(d,W);r.project(S,d)}a=f.fromPoints(R,a),i=a.center;var m=i.x,N=i.y,C=i.z;return i.x=C,i.y=m,i.z=N,a},f.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},f.equals=function(e,r){return e===r||a(e)&&a(r)&&t.equals(e.center,r.center)&&e.radius===r.radius},f.prototype.intersectPlane=function(t){return f.intersectPlane(this,t)},f.prototype.distanceSquaredTo=function(t){return f.distanceSquaredTo(this,t)},f.prototype.computePlaneDistances=function(t,e,r){return f.computePlaneDistances(this,t,e,r)},f.prototype.isOccluded=function(t){return f.isOccluded(this,t)},f.prototype.equals=function(t){return f.equals(this,t)},f.prototype.clone=function(t){return f.clone(this,t)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(r))return r;r=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,o=["webkit","moz","o","ms","khtml"],i=0,u=o.length;i<u;++i){var s=o[i];a=s+"RequestFullscreen","function"==typeof e[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof e[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[n.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,r){"use strict";function n(t){for(var e=t.split("."),r=0,n=e.length;r<n;++r)e[r]=parseInt(e[r],10);return e}function a(){if(!e(N)&&(N=!1,!f())){var t=/ Chrome\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(N=!0,C=n(t[1]))}return N}function o(){return a()&&C}function i(){if(!e(I)&&(I=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(m.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(I=!0,p=n(t[1]))}return I}function u(){return i()&&p}function s(){if(!e(M)){M=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(m.userAgent);null!==t&&(M=!0,O=n(t[1]),O.isNightly=!!t[2])}return M}function E(){return s()&&O; -}function c(){if(!e(g)){g=!1;var t;"Microsoft Internet Explorer"===m.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1]))):"Netscape"===m.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1])))}return g}function l(){return c()&&y}function f(){if(!e(F)){F=!1;var t=/ Edge\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(F=!0,L=n(t[1]))}return F}function _(){return f()&&L}function R(){if(!e(v)){v=!1;var t=/Firefox\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(v=!0,D=n(t[1]))}return v}function T(){return e(U)||(U=/Windows/i.test(m.appVersion)),U}function h(){return R()&&D}function A(){return e(P)||(P="undefined"!=typeof PointerEvent&&(!e(m.pointerEnabled)||m.pointerEnabled)),P}function d(){if(!e(B)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=t.style.imageRendering;B=e(r)&&""!==r,B&&(w=r)}return B}function S(){return d()?w:void 0}var m;m="undefined"!=typeof navigator?navigator:{};var N,C,I,p,M,O,g,y,F,L,v,D,U,P,w,B,x={isChrome:a,chromeVersion:o,isSafari:i,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:l,isEdge:f,edgeVersion:_,isFirefox:R,firefoxVersion:h,isWindows:T,hardwareConcurrency:t(m.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:S};return x.supportsFullscreen=function(){return r.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(e,r,n,a){this.red=t(e,1),this.green=t(r,1),this.blue=t(n,1),this.alpha=t(a,1)}u.fromCartesian4=function(t,r){return e(r)?(r.red=t.x,r.green=t.y,r.blue=t.z,r.alpha=t.w,r):new u(t.x,t.y,t.z,t.w)},u.fromBytes=function(r,n,a,o,i){return r=u.byteToFloat(t(r,255)),n=u.byteToFloat(t(n,255)),a=u.byteToFloat(t(a,255)),o=u.byteToFloat(t(o,255)),e(i)?(i.red=r,i.green=n,i.blue=a,i.alpha=o,i):new u(r,n,a,o)},u.fromAlpha=function(t,r,n){return e(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=r,n):new u(t.red,t.green,t.blue,r)};var s,E,c;n.supportsTypedArrays()&&(s=new ArrayBuffer(4),E=new Uint32Array(s),c=new Uint8Array(s)),u.fromRgba=function(t,e){return E[0]=t,u.fromBytes(c[0],c[1],c[2],c[3],e)},u.fromHsl=function(r,n,a,o,s){r=t(r,0)%1,n=t(n,0),a=t(a,0),o=t(o,1);var E=a,c=a,l=a;if(0!==n){var f;f=a<.5?a*(1+n):a+n-a*n;var _=2*a-f;E=i(_,f,r+1/3),c=i(_,f,r),l=i(_,f,r-1/3)}return e(s)?(s.red=E,s.green=c,s.blue=l,s.alpha=o,s):new u(E,c,l,o)},u.fromRandom=function(r,n){r=t(r,t.EMPTY_OBJECT);var a=r.red;if(!e(a)){var i=t(r.minimumRed,0),s=t(r.maximumRed,1);a=i+o.nextRandomNumber()*(s-i)}var E=r.green;if(!e(E)){var c=t(r.minimumGreen,0),l=t(r.maximumGreen,1);E=c+o.nextRandomNumber()*(l-c)}var f=r.blue;if(!e(f)){var _=t(r.minimumBlue,0),R=t(r.maximumBlue,1);f=_+o.nextRandomNumber()*(R-_)}var T=r.alpha;if(!e(T)){var h=t(r.minimumAlpha,0),A=t(r.maximumAlpha,1);T=h+o.nextRandomNumber()*(A-h)}return e(n)?(n.red=a,n.green=E,n.blue=f,n.alpha=T,n):new u(a,E,f,T)};var l=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,f=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,_=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return u.fromCssColorString=function(r,n){e(n)||(n=new u);var a=u[r.toUpperCase()];if(e(a))return u.clone(a,n),n;var o=l.exec(r);return null!==o?(n.red=parseInt(o[1],16)/15,n.green=parseInt(o[2],16)/15,n.blue=parseInt(o[3],16)/15,n.alpha=1,n):(o=f.exec(r),null!==o?(n.red=parseInt(o[1],16)/255,n.green=parseInt(o[2],16)/255,n.blue=parseInt(o[3],16)/255,n.alpha=1,n):(o=_.exec(r),null!==o?(n.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),n.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),n.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),n.alpha=parseFloat(t(o[4],"1.0")),n):(o=R.exec(r),null!==o?u.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0")),n):n=void 0)))},u.packedLength=4,u.pack=function(e,r,n){return n=t(n,0),r[n++]=e.red,r[n++]=e.green,r[n++]=e.blue,r[n]=e.alpha,r},u.unpack=function(r,n,a){return n=t(n,0),e(a)||(a=new u),a.red=r[n++],a.green=r[n++],a.blue=r[n++],a.alpha=r[n],a},u.byteToFloat=function(t){return t/255},u.floatToByte=function(t){return 1===t?255:256*t|0},u.clone=function(t,r){if(e(t))return e(r)?(r.red=t.red,r.green=t.green,r.blue=t.blue,r.alpha=t.alpha,r):new u(t.red,t.green,t.blue,t.alpha)},u.equals=function(t,r){return t===r||e(t)&&e(r)&&t.red===r.red&&t.green===r.green&&t.blue===r.blue&&t.alpha===r.alpha},u.equalsArray=function(t,e,r){return t.red===e[r]&&t.green===e[r+1]&&t.blue===e[r+2]&&t.alpha===e[r+3]},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,r){return this===t||e(t)&&Math.abs(this.red-t.red)<=r&&Math.abs(this.green-t.green)<=r&&Math.abs(this.blue-t.blue)<=r&&Math.abs(this.alpha-t.alpha)<=r},u.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},u.prototype.toCssColorString=function(){var t=u.floatToByte(this.red),e=u.floatToByte(this.green),r=u.floatToByte(this.blue);return 1===this.alpha?"rgb("+t+","+e+","+r+")":"rgba("+t+","+e+","+r+","+this.alpha+")"},u.prototype.toBytes=function(t){var r=u.floatToByte(this.red),n=u.floatToByte(this.green),a=u.floatToByte(this.blue),o=u.floatToByte(this.alpha);return e(t)?(t[0]=r,t[1]=n,t[2]=a,t[3]=o,t):[r,n,a,o]},u.prototype.toRgba=function(){return c[0]=u.floatToByte(this.red),c[1]=u.floatToByte(this.green),c[2]=u.floatToByte(this.blue),c[3]=u.floatToByte(this.alpha),E[0]},u.prototype.brighten=function(t,e){return t=1-t,e.red=1-(1-this.red)*t,e.green=1-(1-this.green)*t,e.blue=1-(1-this.blue)*t,e.alpha=this.alpha,e},u.prototype.darken=function(t,e){return t=1-t,e.red=this.red*t,e.green=this.green*t,e.blue=this.blue*t,e.alpha=this.alpha,e},u.prototype.withAlpha=function(t,e){return u.fromAlpha(this,t,e)},u.add=function(t,e,r){return r.red=t.red+e.red,r.green=t.green+e.green,r.blue=t.blue+e.blue,r.alpha=t.alpha+e.alpha,r},u.subtract=function(t,e,r){return r.red=t.red-e.red,r.green=t.green-e.green,r.blue=t.blue-e.blue,r.alpha=t.alpha-e.alpha,r},u.multiply=function(t,e,r){return r.red=t.red*e.red,r.green=t.green*e.green,r.blue=t.blue*e.blue,r.alpha=t.alpha*e.alpha,r},u.divide=function(t,e,r){return r.red=t.red/e.red,r.green=t.green/e.green,r.blue=t.blue/e.blue,r.alpha=t.alpha/e.alpha,r},u.mod=function(t,e,r){return r.red=t.red%e.red,r.green=t.green%e.green,r.blue=t.blue%e.blue,r.alpha=t.alpha%e.alpha,r},u.multiplyByScalar=function(t,e,r){return r.red=t.red*e,r.green=t.green*e,r.blue=t.blue*e,r.alpha=t.alpha*e,r},u.divideByScalar=function(t,e,r){return r.red=t.red/e,r.green=t.green/e,r.blue=t.blue/e,r.alpha=t.alpha/e,r},u.ALICEBLUE=a(u.fromCssColorString("#F0F8FF")),u.ANTIQUEWHITE=a(u.fromCssColorString("#FAEBD7")),u.AQUA=a(u.fromCssColorString("#00FFFF")),u.AQUAMARINE=a(u.fromCssColorString("#7FFFD4")),u.AZURE=a(u.fromCssColorString("#F0FFFF")),u.BEIGE=a(u.fromCssColorString("#F5F5DC")),u.BISQUE=a(u.fromCssColorString("#FFE4C4")),u.BLACK=a(u.fromCssColorString("#000000")),u.BLANCHEDALMOND=a(u.fromCssColorString("#FFEBCD")),u.BLUE=a(u.fromCssColorString("#0000FF")),u.BLUEVIOLET=a(u.fromCssColorString("#8A2BE2")),u.BROWN=a(u.fromCssColorString("#A52A2A")),u.BURLYWOOD=a(u.fromCssColorString("#DEB887")),u.CADETBLUE=a(u.fromCssColorString("#5F9EA0")),u.CHARTREUSE=a(u.fromCssColorString("#7FFF00")),u.CHOCOLATE=a(u.fromCssColorString("#D2691E")),u.CORAL=a(u.fromCssColorString("#FF7F50")),u.CORNFLOWERBLUE=a(u.fromCssColorString("#6495ED")),u.CORNSILK=a(u.fromCssColorString("#FFF8DC")),u.CRIMSON=a(u.fromCssColorString("#DC143C")),u.CYAN=a(u.fromCssColorString("#00FFFF")),u.DARKBLUE=a(u.fromCssColorString("#00008B")),u.DARKCYAN=a(u.fromCssColorString("#008B8B")),u.DARKGOLDENROD=a(u.fromCssColorString("#B8860B")),u.DARKGRAY=a(u.fromCssColorString("#A9A9A9")),u.DARKGREEN=a(u.fromCssColorString("#006400")),u.DARKGREY=u.DARKGRAY,u.DARKKHAKI=a(u.fromCssColorString("#BDB76B")),u.DARKMAGENTA=a(u.fromCssColorString("#8B008B")),u.DARKOLIVEGREEN=a(u.fromCssColorString("#556B2F")),u.DARKORANGE=a(u.fromCssColorString("#FF8C00")),u.DARKORCHID=a(u.fromCssColorString("#9932CC")),u.DARKRED=a(u.fromCssColorString("#8B0000")),u.DARKSALMON=a(u.fromCssColorString("#E9967A")),u.DARKSEAGREEN=a(u.fromCssColorString("#8FBC8F")),u.DARKSLATEBLUE=a(u.fromCssColorString("#483D8B")),u.DARKSLATEGRAY=a(u.fromCssColorString("#2F4F4F")),u.DARKSLATEGREY=u.DARKSLATEGRAY,u.DARKTURQUOISE=a(u.fromCssColorString("#00CED1")),u.DARKVIOLET=a(u.fromCssColorString("#9400D3")),u.DEEPPINK=a(u.fromCssColorString("#FF1493")),u.DEEPSKYBLUE=a(u.fromCssColorString("#00BFFF")),u.DIMGRAY=a(u.fromCssColorString("#696969")),u.DIMGREY=u.DIMGRAY,u.DODGERBLUE=a(u.fromCssColorString("#1E90FF")),u.FIREBRICK=a(u.fromCssColorString("#B22222")),u.FLORALWHITE=a(u.fromCssColorString("#FFFAF0")),u.FORESTGREEN=a(u.fromCssColorString("#228B22")),u.FUCHSIA=a(u.fromCssColorString("#FF00FF")),u.GAINSBORO=a(u.fromCssColorString("#DCDCDC")),u.GHOSTWHITE=a(u.fromCssColorString("#F8F8FF")),u.GOLD=a(u.fromCssColorString("#FFD700")),u.GOLDENROD=a(u.fromCssColorString("#DAA520")),u.GRAY=a(u.fromCssColorString("#808080")),u.GREEN=a(u.fromCssColorString("#008000")),u.GREENYELLOW=a(u.fromCssColorString("#ADFF2F")),u.GREY=u.GRAY,u.HONEYDEW=a(u.fromCssColorString("#F0FFF0")),u.HOTPINK=a(u.fromCssColorString("#FF69B4")),u.INDIANRED=a(u.fromCssColorString("#CD5C5C")),u.INDIGO=a(u.fromCssColorString("#4B0082")),u.IVORY=a(u.fromCssColorString("#FFFFF0")),u.KHAKI=a(u.fromCssColorString("#F0E68C")),u.LAVENDER=a(u.fromCssColorString("#E6E6FA")),u.LAVENDAR_BLUSH=a(u.fromCssColorString("#FFF0F5")),u.LAWNGREEN=a(u.fromCssColorString("#7CFC00")),u.LEMONCHIFFON=a(u.fromCssColorString("#FFFACD")),u.LIGHTBLUE=a(u.fromCssColorString("#ADD8E6")),u.LIGHTCORAL=a(u.fromCssColorString("#F08080")),u.LIGHTCYAN=a(u.fromCssColorString("#E0FFFF")),u.LIGHTGOLDENRODYELLOW=a(u.fromCssColorString("#FAFAD2")),u.LIGHTGRAY=a(u.fromCssColorString("#D3D3D3")),u.LIGHTGREEN=a(u.fromCssColorString("#90EE90")),u.LIGHTGREY=u.LIGHTGRAY,u.LIGHTPINK=a(u.fromCssColorString("#FFB6C1")),u.LIGHTSEAGREEN=a(u.fromCssColorString("#20B2AA")),u.LIGHTSKYBLUE=a(u.fromCssColorString("#87CEFA")),u.LIGHTSLATEGRAY=a(u.fromCssColorString("#778899")),u.LIGHTSLATEGREY=u.LIGHTSLATEGRAY,u.LIGHTSTEELBLUE=a(u.fromCssColorString("#B0C4DE")),u.LIGHTYELLOW=a(u.fromCssColorString("#FFFFE0")),u.LIME=a(u.fromCssColorString("#00FF00")),u.LIMEGREEN=a(u.fromCssColorString("#32CD32")),u.LINEN=a(u.fromCssColorString("#FAF0E6")),u.MAGENTA=a(u.fromCssColorString("#FF00FF")),u.MAROON=a(u.fromCssColorString("#800000")),u.MEDIUMAQUAMARINE=a(u.fromCssColorString("#66CDAA")),u.MEDIUMBLUE=a(u.fromCssColorString("#0000CD")),u.MEDIUMORCHID=a(u.fromCssColorString("#BA55D3")),u.MEDIUMPURPLE=a(u.fromCssColorString("#9370DB")),u.MEDIUMSEAGREEN=a(u.fromCssColorString("#3CB371")),u.MEDIUMSLATEBLUE=a(u.fromCssColorString("#7B68EE")),u.MEDIUMSPRINGGREEN=a(u.fromCssColorString("#00FA9A")),u.MEDIUMTURQUOISE=a(u.fromCssColorString("#48D1CC")),u.MEDIUMVIOLETRED=a(u.fromCssColorString("#C71585")),u.MIDNIGHTBLUE=a(u.fromCssColorString("#191970")),u.MINTCREAM=a(u.fromCssColorString("#F5FFFA")),u.MISTYROSE=a(u.fromCssColorString("#FFE4E1")),u.MOCCASIN=a(u.fromCssColorString("#FFE4B5")),u.NAVAJOWHITE=a(u.fromCssColorString("#FFDEAD")),u.NAVY=a(u.fromCssColorString("#000080")),u.OLDLACE=a(u.fromCssColorString("#FDF5E6")),u.OLIVE=a(u.fromCssColorString("#808000")),u.OLIVEDRAB=a(u.fromCssColorString("#6B8E23")),u.ORANGE=a(u.fromCssColorString("#FFA500")),u.ORANGERED=a(u.fromCssColorString("#FF4500")),u.ORCHID=a(u.fromCssColorString("#DA70D6")),u.PALEGOLDENROD=a(u.fromCssColorString("#EEE8AA")),u.PALEGREEN=a(u.fromCssColorString("#98FB98")),u.PALETURQUOISE=a(u.fromCssColorString("#AFEEEE")),u.PALEVIOLETRED=a(u.fromCssColorString("#DB7093")),u.PAPAYAWHIP=a(u.fromCssColorString("#FFEFD5")),u.PEACHPUFF=a(u.fromCssColorString("#FFDAB9")),u.PERU=a(u.fromCssColorString("#CD853F")),u.PINK=a(u.fromCssColorString("#FFC0CB")),u.PLUM=a(u.fromCssColorString("#DDA0DD")),u.POWDERBLUE=a(u.fromCssColorString("#B0E0E6")),u.PURPLE=a(u.fromCssColorString("#800080")),u.RED=a(u.fromCssColorString("#FF0000")),u.ROSYBROWN=a(u.fromCssColorString("#BC8F8F")),u.ROYALBLUE=a(u.fromCssColorString("#4169E1")),u.SADDLEBROWN=a(u.fromCssColorString("#8B4513")),u.SALMON=a(u.fromCssColorString("#FA8072")),u.SANDYBROWN=a(u.fromCssColorString("#F4A460")),u.SEAGREEN=a(u.fromCssColorString("#2E8B57")),u.SEASHELL=a(u.fromCssColorString("#FFF5EE")),u.SIENNA=a(u.fromCssColorString("#A0522D")),u.SILVER=a(u.fromCssColorString("#C0C0C0")),u.SKYBLUE=a(u.fromCssColorString("#87CEEB")),u.SLATEBLUE=a(u.fromCssColorString("#6A5ACD")),u.SLATEGRAY=a(u.fromCssColorString("#708090")),u.SLATEGREY=u.SLATEGRAY,u.SNOW=a(u.fromCssColorString("#FFFAFA")),u.SPRINGGREEN=a(u.fromCssColorString("#00FF7F")),u.STEELBLUE=a(u.fromCssColorString("#4682B4")),u.TAN=a(u.fromCssColorString("#D2B48C")),u.TEAL=a(u.fromCssColorString("#008080")),u.THISTLE=a(u.fromCssColorString("#D8BFD8")),u.TOMATO=a(u.fromCssColorString("#FF6347")),u.TURQUOISE=a(u.fromCssColorString("#40E0D0")),u.VIOLET=a(u.fromCssColorString("#EE82EE")),u.WHEAT=a(u.fromCssColorString("#F5DEB3")),u.WHITE=a(u.fromCssColorString("#FFFFFF")),u.WHITESMOKE=a(u.fromCssColorString("#F5F5F5")),u.YELLOW=a(u.fromCssColorString("#FFFF00")),u.YELLOWGREEN=a(u.fromCssColorString("#9ACD32")),u.TRANSPARENT=a(new u(0,0,0,0)),u}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,r,n,a,o){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return i.getSizeInBytes=function(t){switch(t){case i.BYTE:return Int8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.SHORT:return Int16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.INT:return Int32Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case i.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},i.fromTypedArray=function(t){return t instanceof Int8Array?i.BYTE:t instanceof Uint8Array?i.UNSIGNED_BYTE:t instanceof Int16Array?i.SHORT:t instanceof Uint16Array?i.UNSIGNED_SHORT:t instanceof Int32Array?i.INT:t instanceof Uint32Array?i.UNSIGNED_INT:t instanceof Float32Array?i.FLOAT:t instanceof Float64Array?i.DOUBLE:void 0},i.validate=function(t){return e(t)&&(t===i.BYTE||t===i.UNSIGNED_BYTE||t===i.SHORT||t===i.UNSIGNED_SHORT||t===i.INT||t===i.UNSIGNED_INT||t===i.FLOAT||t===i.DOUBLE)},i.createTypedArray=function(t,e){switch(t){case i.BYTE:return new Int8Array(e);case i.UNSIGNED_BYTE:return new Uint8Array(e);case i.SHORT:return new Int16Array(e);case i.UNSIGNED_SHORT:return new Uint16Array(e);case i.INT:return new Int32Array(e);case i.UNSIGNED_INT:return new Uint32Array(e);case i.FLOAT:return new Float32Array(e);case i.DOUBLE:return new Float64Array(e)}},i.createArrayBufferView=function(e,r,n,a){switch(n=t(n,0),a=t(a,(r.byteLength-n)/i.getSizeInBytes(e)),e){case i.BYTE:return new Int8Array(r,n,a);case i.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case i.SHORT:return new Int16Array(r,n,a);case i.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case i.INT:return new Int32Array(r,n,a);case i.UNSIGNED_INT:return new Uint32Array(r,n,a);case i.FLOAT:return new Float32Array(r,n,a);case i.DOUBLE:return new Float64Array(r,n,a)}},i.fromName=function(t){switch(t){case"BYTE":return i.BYTE;case"UNSIGNED_BYTE":return i.UNSIGNED_BYTE;case"SHORT":return i.SHORT;case"UNSIGNED_SHORT":return i.UNSIGNED_SHORT;case"INT":return i.INT;case"UNSIGNED_INT":return i.UNSIGNED_INT;case"FLOAT":return i.FLOAT;case"DOUBLE":return i.DOUBLE}},a(i)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var r={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN}};return t(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,r,n,a){"use strict";function o(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,n.NONE),this.boundingSphereCV=e.boundingSphereCV}return o.computeNumberOfVertices=function(t){var r=-1;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&e(t.attributes[n])&&e(t.attributes[n].values)){var a=t.attributes[n],o=a.values.length/a.componentsPerAttribute;r=o}return r},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,r){"use strict";function n(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,r,n,a){"use strict";var o={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return o.getSizeInBytes=function(t){switch(t){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(e){return t(e)&&(e===o.UNSIGNED_BYTE||e===o.UNSIGNED_SHORT||e===o.UNSIGNED_INT); -},o.createTypedArray=function(t,e){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},o.createTypedArrayFromArrayBuffer=function(t,e,r,a){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,r,a):new Uint16Array(e,r,a)},r(o)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t){var e=t._uSquared,r=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,a=(r-n)/r,o=Math.cos(t._startHeading),i=Math.sin(t._startHeading),u=(1-a)*Math.tan(t._start.latitude),s=1/Math.sqrt(1+u*u),E=s*u,c=Math.atan2(u,o),l=s*i,f=l*l,_=1-f,R=Math.sqrt(_),T=e/4,h=T*T,A=h*T,d=h*h,S=1+T-3*h/4+5*A/4-175*d/64,m=1-T+15*h/8-35*A/8,N=1-3*T+35*h/4,C=1-5*T,I=S*c-m*Math.sin(2*c)*T/2-N*Math.sin(4*c)*h/16-C*Math.sin(6*c)*A/48-5*Math.sin(8*c)*d/512,p=t._constants;p.a=r,p.b=n,p.f=a,p.cosineHeading=o,p.sineHeading=i,p.tanU=u,p.cosineU=s,p.sineU=E,p.sigma=c,p.sineAlpha=l,p.sineSquaredAlpha=f,p.cosineSquaredAlpha=_,p.cosineAlpha=R,p.u2Over4=T,p.u4Over16=h,p.u6Over64=A,p.u8Over256=d,p.a0=S,p.a1=m,p.a2=N,p.a3=C,p.distanceRatio=I}function E(t,e){return t*e*(4+t*(4-3*e))/16}function c(t,e,r,n,a,o,i){var u=E(t,r);return(1-u)*t*e*(n+u*a*(i+u*o*(2*i*i-1)))}function l(t,e,r,n,a,o,i){var s,E,l,f,_,R=(e-r)/e,T=o-n,h=Math.atan((1-R)*Math.tan(a)),A=Math.atan((1-R)*Math.tan(i)),d=Math.cos(h),S=Math.sin(h),m=Math.cos(A),N=Math.sin(A),C=d*m,I=d*N,p=S*N,M=S*m,O=T,g=u.TWO_PI,y=Math.cos(O),F=Math.sin(O);do{y=Math.cos(O),F=Math.sin(O);var L=I-M*y;l=Math.sqrt(m*m*F*F+L*L),E=p+C*y,s=Math.atan2(l,E);var v;0===l?(v=0,f=1):(v=C*F/l,f=1-v*v),g=O,_=E-2*p/f,isNaN(_)&&(_=0),O=T+c(R,v,f,s,l,E,_)}while(Math.abs(O-g)>u.EPSILON12);var D=f*(e*e-r*r)/(r*r),U=1+D*(4096+D*(D*(320-175*D)-768))/16384,P=D*(256+D*(D*(74-47*D)-128))/1024,w=_*_,B=P*l*(_+P*(E*(2*w-1)-P*_*(4*l*l-3)*(4*w-3)/6)/4),x=r*U*(s-B),G=Math.atan2(m*F,I-M*y),b=Math.atan2(d*F,I*y-M);t._distance=x,t._startHeading=G,t._endHeading=b,t._uSquared=D}function f(r,n,a,o){t.normalize(o.cartographicToCartesian(n,T),R),t.normalize(o.cartographicToCartesian(a,T),T);l(r,o.maximumRadius,o.minimumRadius,n.longitude,n.latitude,a.longitude,a.latitude),r._start=e.clone(n,r._start),r._end=e.clone(a,r._end),r._start.height=0,r._end.height=0,s(r)}function _(t,a,o){var u=r(o,i.WGS84);this._ellipsoid=u,this._start=new e,this._end=new e,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n(t)&&n(a)&&f(this,t,a,u)}var R=new t,T=new t;return a(_.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}}}),_.prototype.setEndPoints=function(t,e){f(this,t,e,this._ellipsoid)},_.prototype.interpolateUsingFraction=function(t,e){return this.interpolateUsingSurfaceDistance(this._distance*t,e)},_.prototype.interpolateUsingSurfaceDistance=function(t,r){var a=this._constants,o=a.distanceRatio+t/a.b,i=Math.cos(2*o),u=Math.cos(4*o),s=Math.cos(6*o),E=Math.sin(2*o),l=Math.sin(4*o),f=Math.sin(6*o),_=Math.sin(8*o),R=o*o,T=o*R,h=a.u8Over256,A=a.u2Over4,d=a.u6Over64,S=a.u4Over16,m=2*T*h*i/3+o*(1-A+7*S/4-15*d/4+579*h/64-(S-15*d/4+187*h/16)*i-(5*d/4-115*h/16)*u-29*h*s/16)+(A/2-S+71*d/32-85*h/16)*E+(5*S/16-5*d/4+383*h/96)*l-R*((d-11*h/2)*E+5*h*l/2)+(29*d/96-29*h/16)*f+539*h*_/1536,N=Math.asin(Math.sin(m)*a.cosineAlpha),C=Math.atan(a.a/a.b*Math.tan(N));m-=a.sigma;var I=Math.cos(2*a.sigma+m),p=Math.sin(m),M=Math.cos(m),O=a.cosineU*M,g=a.sineU*p,y=Math.atan2(p*a.sineHeading,O-g*a.cosineHeading),F=y-c(a.f,a.sineAlpha,a.cosineSquaredAlpha,m,p,M,I);return n(r)?(r.longitude=this._start.longitude+F,r.latitude=C,r.height=0,r):new e(this._start.longitude+F,C,0)},_}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(t,e){"use strict";function r(t,r,n){var a=t+r;return e.sign(t)!==e.sign(r)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(t,e,r){var n=e*e-4*t*r;return n},n.computeRealRoots=function(t,n,a){var o;if(0===t)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var i=Math.abs(a),u=Math.abs(t);if(i<u&&i/u<e.EPSILON14)return[0,0];if(i>u&&u/i<e.EPSILON14)return[];if(o=-a/t,o<0)return[];var s=Math.sqrt(o);return[-s,s]}if(0===a)return o=-n/t,o<0?[o,0]:[0,o];var E=n*n,c=4*t*a,l=r(E,-c,e.EPSILON14);if(l<0)return[];var f=-.5*r(n,e.sign(n)*Math.sqrt(l),e.EPSILON14);return n>0?[f/t,a/f]:[a/f,f/t]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(t,e){"use strict";function r(t,e,r,n){var a,o,i=t,u=e/3,s=r/3,E=n,c=i*s,l=u*E,f=u*u,_=s*s,R=i*s-f,T=i*E-u*s,h=u*E-_,A=4*R*h-T*T;if(A<0){var d,S,m;f*l>=c*_?(d=i,S=R,m=-2*u*R+i*T):(d=E,S=h,m=-E*T+2*s*h);var N=m<0?-1:1,C=-N*Math.abs(d)*Math.sqrt(-A);o=-m+C;var I=o/2,p=I<0?-Math.pow(-I,1/3):Math.pow(I,1/3),M=o===C?-p:-S/p;return a=S<=0?p+M:-m/(p*p+M*M+S),f*l>=c*_?[(a-u)/i]:[-E/(a+s)]}var O=R,g=-2*u*R+i*T,y=h,F=-E*T+2*s*h,L=Math.sqrt(A),v=Math.sqrt(3)/2,D=Math.abs(Math.atan2(i*L,-g)/3);a=2*Math.sqrt(-O);var U=Math.cos(D);o=a*U;var P=a*(-U/2-v*Math.sin(D)),w=o+P>2*u?o-u:P-u,B=i,x=w/B;D=Math.abs(Math.atan2(E*L,-F)/3),a=2*Math.sqrt(-y),U=Math.cos(D),o=a*U,P=a*(-U/2-v*Math.sin(D));var G=-E,b=o+P<2*s?o+s:P+s,z=G/b,H=B*b,V=-w*b-B*G,X=w*G,q=(s*V-u*X)/(-u*V+s*H);return x<=q?x<=z?q<=z?[x,q,z]:[x,z,q]:[z,x,q]:x<=z?[q,x,z]:q<=z?[q,z,x]:[z,q,x]}var n={};return n.computeDiscriminant=function(t,e,r,n){var a=t*t,o=e*e,i=r*r,u=n*n,s=18*t*e*r*n+o*i-27*a*u-4*(t*i*r+o*e*n);return s},n.computeRealRoots=function(t,n,a,o){var i,u;if(0===t)return e.computeRealRoots(n,a,o);if(0===n){if(0===a){if(0===o)return[0,0,0];u=-o/t;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===o?(i=e.computeRealRoots(t,0,a),0===i.Length?[0]:[i[0],0,i[1]]):r(t,0,a,o)}return 0===a?0===o?(u=-n/t,u<0?[u,0,0]:[0,0,u]):r(t,n,0,o):0===o?(i=e.computeRealRoots(t,n,a),0===i.length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]):r(t,n,a,o)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(t,e,r,n){"use strict";function a(e,a,o,i){var u=e*e,s=a-3*u/8,E=o-a*e/2+u*e/8,c=i-o*e/4+a*u/16-3*u*u/256,l=t.computeRealRoots(1,2*s,s*s-4*c,-E*E);if(l.length>0){var f=-e/4,_=l[l.length-1];if(Math.abs(_)<r.EPSILON14){var R=n.computeRealRoots(1,s,c);if(2===R.length){var T,h=R[0],A=R[1];if(h>=0&&A>=0){var d=Math.sqrt(h),S=Math.sqrt(A);return[f-S,f-d,f+d,f+S]}if(h>=0&&A<0)return T=Math.sqrt(h),[f-T,f+T];if(h<0&&A>=0)return T=Math.sqrt(A),[f-T,f+T]}return[]}if(_>0){var m=Math.sqrt(_),N=(s+_-E/m)/2,C=(s+_+E/m)/2,I=n.computeRealRoots(1,m,N),p=n.computeRealRoots(1,-m,C);return 0!==I.length?(I[0]+=f,I[1]+=f,0!==p.length?(p[0]+=f,p[1]+=f,I[1]<=p[0]?[I[0],I[1],p[0],p[1]]:p[1]<=I[0]?[p[0],p[1],I[0],I[1]]:I[0]>=p[0]&&I[1]<=p[1]?[p[0],I[0],I[1],p[1]]:p[0]>=I[0]&&p[1]<=I[1]?[I[0],p[0],p[1],I[1]]:I[0]>p[0]&&I[0]<p[1]?[p[0],I[0],p[1],I[1]]:[I[0],p[0],I[1],p[1]]):I):0!==p.length?(p[0]+=f,p[1]+=f,p):[]}}return[]}function o(e,a,o,i){var u=o*o,s=a*a,E=e*e,c=-2*a,l=o*e+s-4*i,f=E*i-o*a*e+u,_=t.computeRealRoots(1,c,l,f);if(_.length>0){var R,T,h=_[0],A=a-h,d=A*A,S=e/2,m=A/2,N=d-4*i,C=d+4*Math.abs(i),I=E-4*h,p=E+4*Math.abs(h);if(h<0||N*p<I*C){var M=Math.sqrt(I);R=M/2,T=0===M?0:(e*m-o)/M}else{var O=Math.sqrt(N);R=0===O?0:(e*m-o)/O,T=O/2}var g,y;0===S&&0===R?(g=0,y=0):r.sign(S)===r.sign(R)?(g=S+R,y=h/g):(y=S-R,g=h/y);var F,L;0===m&&0===T?(F=0,L=0):r.sign(m)===r.sign(T)?(F=m+T,L=i/F):(L=m-T,F=i/L);var v=n.computeRealRoots(1,g,F),D=n.computeRealRoots(1,y,L);if(0!==v.length)return 0!==D.length?v[1]<=D[0]?[v[0],v[1],D[0],D[1]]:D[1]<=v[0]?[D[0],D[1],v[0],v[1]]:v[0]>=D[0]&&v[1]<=D[1]?[D[0],v[0],v[1],D[1]]:D[0]>=v[0]&&D[1]<=v[1]?[v[0],D[0],D[1],v[1]]:v[0]>D[0]&&v[0]<D[1]?[D[0],v[0],D[1],v[1]]:[v[0],D[0],v[1],D[1]]:v;if(0!==D.length)return D}return[]}var i={};return i.computeDiscriminant=function(t,e,r,n,a){var o=t*t,i=o*t,u=e*e,s=u*e,E=r*r,c=E*r,l=n*n,f=l*n,_=a*a,R=_*a,T=u*E*l-4*s*f-4*t*c*l+18*t*e*r*f-27*o*l*l+256*i*R+a*(18*s*r*n-4*u*c+16*t*E*E-80*t*e*E*n-6*t*u*l+144*o*r*l)+_*(144*t*u*r-27*u*u-128*o*E-192*o*e*n);return T},i.computeRealRoots=function(e,n,i,u,s){if(Math.abs(e)<r.EPSILON15)return t.computeRealRoots(n,i,u,s);var E=n/e,c=i/e,l=u/e,f=s/e,_=E<0?1:0;switch(_+=c<0?_+1:_,_+=l<0?_+1:_,_+=f<0?_+1:_){case 0:return a(E,c,l,f);case 1:return o(E,c,l,f);case 2:return o(E,c,l,f);case 3:return a(E,c,l,f);case 4:return a(E,c,l,f);case 5:return o(E,c,l,f);case 6:return a(E,c,l,f);case 7:return a(E,c,l,f);case 8:return o(E,c,l,f);case 9:return a(E,c,l,f);case 10:return a(E,c,l,f);case 11:return o(E,c,l,f);case 12:return a(E,c,l,f);case 13:return a(E,c,l,f);case 14:return a(E,c,l,f);case 15:return a(E,c,l,f);default:return}},i}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";function a(r,n){n=t.clone(e(n,t.ZERO)),t.equals(n,t.ZERO)||t.normalize(n,n),this.origin=t.clone(e(r,t.ZERO)),this.direction=n}return a.getPoint=function(e,n,a){return r(a)||(a=new t),a=t.multiplyByScalar(e.direction,n,a),t.add(e.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(t,e,r,n,a,o,i,u,s,E,c){"use strict";function l(t,e,r,n){var a=e*e-4*t*r;if(!(a<0)){if(a>0){var o=1/(2*t),i=Math.sqrt(a),u=(-e+i)*o,s=(-e-i)*o;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var E=-e/(2*t);if(0!==E)return n.root0=n.root1=E,n}}function f(e,r,a){n(a)||(a=new o);var i=e.origin,u=e.direction,s=r.center,E=r.radius*r.radius,c=t.subtract(i,s,d),f=t.dot(u,u),_=2*t.dot(u,c),R=t.magnitudeSquared(c)-E,T=l(f,_,R,C);if(n(T))return a.start=T.root0,a.stop=T.root1,a}function _(t,e,r){var n=t+e;return i.sign(t)!==i.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}function R(e,r,n,a,o){var c,l=a*a,f=o*o,R=(e[u.COLUMN1ROW1]-e[u.COLUMN2ROW2])*f,T=o*(a*_(e[u.COLUMN1ROW0],e[u.COLUMN0ROW1],i.EPSILON15)+r.y),h=e[u.COLUMN0ROW0]*l+e[u.COLUMN2ROW2]*f+a*r.x+n,A=f*_(e[u.COLUMN2ROW1],e[u.COLUMN1ROW2],i.EPSILON15),d=o*(a*_(e[u.COLUMN2ROW0],e[u.COLUMN0ROW2])+r.z),S=[];if(0===d&&0===A){if(c=s.computeRealRoots(R,T,h),0===c.length)return S;var m=c[0],N=Math.sqrt(Math.max(1-m*m,0));if(S.push(new t(a,o*m,o*-N)),S.push(new t(a,o*m,o*N)),2===c.length){var C=c[1],I=Math.sqrt(Math.max(1-C*C,0));S.push(new t(a,o*C,o*-I)),S.push(new t(a,o*C,o*I))}return S}var p=d*d,M=A*A,O=R*R,g=d*A,y=O+M,F=2*(T*R+g),L=2*h*R+T*T-M+p,v=2*(h*T-g),D=h*h-p;if(0===y&&0===F&&0===L&&0===v)return S;c=E.computeRealRoots(y,F,L,v,D);var U=c.length;if(0===U)return S;for(var P=0;P<U;++P){var w,B=c[P],x=B*B,G=Math.max(1-x,0),b=Math.sqrt(G);w=i.sign(R)===i.sign(h)?_(R*x+h,T*B,i.EPSILON12):i.sign(h)===i.sign(T*B)?_(R*x,T*B+h,i.EPSILON12):_(R*x+T*B,h,i.EPSILON12);var z=_(A*B,d,i.EPSILON15),H=w*z;H<0?S.push(new t(a,o*B,o*b)):H>0?S.push(new t(a,o*B,o*-b)):0!==b?(S.push(new t(a,o*B,o*-b)),S.push(new t(a,o*B,o*b)),++P):S.push(new t(a,o*B,o*b))}return S}var T={};T.rayPlane=function(e,r,a){n(a)||(a=new t);var o=e.origin,u=e.direction,s=r.normal,E=t.dot(s,u);if(!(Math.abs(E)<i.EPSILON15)){var c=(-r.distance-t.dot(s,o))/E;if(!(c<0))return a=t.multiplyByScalar(u,c,a),t.add(o,a,a)}};var h=new t,A=new t,d=new t,S=new t,m=new t;T.rayTriangleParametric=function(e,n,a,o,u){u=r(u,!1);var s,E,c,l,f,_=e.origin,R=e.direction,T=t.subtract(a,n,h),N=t.subtract(o,n,A),C=t.cross(R,N,d),I=t.dot(T,C);if(u){if(I<i.EPSILON6)return;if(s=t.subtract(_,n,S),c=t.dot(s,C),c<0||c>I)return;if(E=t.cross(s,T,m),l=t.dot(R,E),l<0||c+l>I)return;f=t.dot(N,E)/I}else{if(Math.abs(I)<i.EPSILON6)return;var p=1/I;if(s=t.subtract(_,n,S),c=t.dot(s,C)*p,c<0||c>1)return;if(E=t.cross(s,T,m),l=t.dot(R,E)*p,l<0||c+l>1)return;f=t.dot(N,E)*p}return f},T.rayTriangle=function(e,r,a,o,i,u){var s=T.rayTriangleParametric(e,r,a,o,i);if(n(s)&&!(s<0))return n(u)||(u=new t),t.multiplyByScalar(e.direction,s,u),t.add(e.origin,u,u)};var N=new c;T.lineSegmentTriangle=function(e,r,a,o,i,u,s){var E=N;t.clone(e,E.origin),t.subtract(r,e,E.direction),t.normalize(E.direction,E.direction);var c=T.rayTriangleParametric(E,a,o,i,u);if(!(!n(c)||c<0||c>t.distance(e,r)))return n(s)||(s=new t),t.multiplyByScalar(E.direction,c,s),t.add(E.origin,s,s)};var C={root0:0,root1:0};T.raySphere=function(t,e,r){if(r=f(t,e,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var I=new c;T.lineSegmentSphere=function(e,r,a,o){var i=I;t.clone(e,i.origin);var u=t.subtract(r,e,i.direction),s=t.magnitude(u);if(t.normalize(u,u),o=f(i,a,o),!(!n(o)||o.stop<0||o.start>s))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,s),o};var p=new t,M=new t;T.rayEllipsoid=function(e,r){var n,a,i,u,s,E=r.oneOverRadii,c=t.multiplyComponents(E,e.origin,p),l=t.multiplyComponents(E,e.direction,M),f=t.magnitudeSquared(c),_=t.dot(c,l);if(f>1){if(_>=0)return;var R=_*_;if(n=f-1,a=t.magnitudeSquared(l),i=a*n,R<i)return;if(R>i){u=_*_-i,s=-_+Math.sqrt(u);var T=s/a,h=n/s;return T<h?new o(T,h):{start:h,stop:T}}var A=Math.sqrt(n/a);return new o(A,A)}return f<1?(n=f-1,a=t.magnitudeSquared(l),i=a*n,u=_*_-i,s=-_+Math.sqrt(u),new o(0,s/a)):_<0?(a=t.magnitudeSquared(l),new o(0,-_/a)):void 0};var O=new t,g=new t,y=new t,F=new t,L=new t,v=new u,D=new u,U=new u,P=new u,w=new u,B=new u,x=new u,G=new t,b=new t,z=new e;T.grazingAltitudeLocation=function(e,r){var a=e.origin,o=e.direction;if(!t.equals(a,t.ZERO)){var s=r.geodeticSurfaceNormal(a,O);if(t.dot(o,s)>=0)return a}var E=n(this.rayEllipsoid(e,r)),c=r.transformPositionToScaledSpace(o,O),l=t.normalize(c,c),f=t.mostOrthogonalAxis(c,F),_=t.normalize(t.cross(f,l,g),g),T=t.normalize(t.cross(l,_,y),y),h=v;h[0]=l.x,h[1]=l.y,h[2]=l.z,h[3]=_.x,h[4]=_.y,h[5]=_.z,h[6]=T.x,h[7]=T.y,h[8]=T.z;var A=u.transpose(h,D),d=u.fromScale(r.radii,U),S=u.fromScale(r.oneOverRadii,P),m=w;m[0]=0,m[1]=-o.z,m[2]=o.y,m[3]=o.z,m[4]=0,m[5]=-o.x,m[6]=-o.y,m[7]=o.x,m[8]=0;var N,C,I=u.multiply(u.multiply(A,S,B),m,B),p=u.multiply(u.multiply(I,d,x),h,x),M=u.multiplyByVector(I,a,L),H=R(p,t.negate(M,O),0,0,1),V=H.length;if(V>0){for(var X=t.clone(t.ZERO,b),q=Number.NEGATIVE_INFINITY,W=0;W<V;++W){N=u.multiplyByVector(d,u.multiplyByVector(h,H[W],G),G);var Y=t.normalize(t.subtract(N,a,F),F),K=t.dot(Y,o);K>q&&(q=K,X=t.clone(N,X))}var k=r.cartesianToCartographic(X,z);return q=i.clamp(q,0,1),C=t.magnitude(t.subtract(X,a,F))*Math.sqrt(1-q*q),C=E?-C:C,k.height=C,r.cartographicToCartesian(k,new t)}};var H=new t;return T.lineSegmentPlane=function(e,r,a,o){n(o)||(o=new t);var u=t.subtract(r,e,H),s=a.normal,E=t.dot(s,u);if(!(Math.abs(E)<i.EPSILON6)){var c=t.dot(s,e),l=-(a.distance+c)/E;if(!(l<0||l>1))return t.multiplyByScalar(u,l,o),t.add(e,o,o),o}},T.trianglePlaneIntersection=function(e,r,n,a){var o=a.normal,i=a.distance,u=t.dot(o,e)+i<0,s=t.dot(o,r)+i<0,E=t.dot(o,n)+i<0,c=0;c+=u?1:0,c+=s?1:0,c+=E?1:0;var l,f;if(1!==c&&2!==c||(l=new t,f=new t),1===c){if(u)return T.lineSegmentPlane(e,r,a,l),T.lineSegmentPlane(e,n,a,f),{positions:[e,r,n,l,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return T.lineSegmentPlane(r,n,a,l),T.lineSegmentPlane(r,e,a,f),{positions:[e,r,n,l,f],indices:[1,3,4,2,0,4,2,4,3]};if(E)return T.lineSegmentPlane(n,e,a,l),T.lineSegmentPlane(n,r,a,f),{positions:[e,r,n,l,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!u)return T.lineSegmentPlane(r,e,a,l),T.lineSegmentPlane(n,e,a,f),{positions:[e,r,n,l,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return T.lineSegmentPlane(n,r,a,l),T.lineSegmentPlane(e,r,a,f),{positions:[e,r,n,l,f],indices:[2,0,4,2,4,3,1,3,4]};if(!E)return T.lineSegmentPlane(e,n,a,l),T.lineSegmentPlane(r,n,a,f),{positions:[e,r,n,l,f],indices:[0,1,4,0,4,3,2,3,4]}}},T}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(t,e,r,n){"use strict";function a(e,r){this.normal=t.clone(e),this.distance=r}a.fromPointNormal=function(r,n,o){var i=-t.dot(n,r);return e(o)?(t.clone(n,o.normal),o.distance=i,o):new a(n,i)};var o=new t;return a.fromCartesian4=function(r,n){var i=t.fromCartesian4(r,o),u=r.w;return e(n)?(t.clone(i,n.normal),n.distance=u,n):new a(i,u)},a.getPointDistance=function(e,r){return t.dot(e.normal,r)+e.distance},a.ORIGIN_XY_PLANE=n(new a(t.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(t.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(t.UNIT_Y,0)),a}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(t,e,r,n,a,o,i,u,s,E,c,l){"use strict";function f(t,e,r){var n=p;n.length=t;var a;if(e===r){for(a=0;a<t;a++)n[a]=e;return n}var o=r-e,i=o/t;for(a=0;a<t;a++){var u=e+a*i;n[a]=u}return n}function _(e,r,n,a,o,i,u,s){var E=a.scaleToGeodeticSurface(e,y),c=a.scaleToGeodeticSurface(r,F),l=R.numberOfPoints(e,r,n),_=a.cartesianToCartographic(E,M),T=a.cartesianToCartographic(c,O),h=f(l,o,i);L.setEndPoints(_,T);var A=L.surfaceDistance/l,d=s;_.height=o;var S=a.cartographicToCartesian(_,g);t.pack(S,u,d),d+=3;for(var m=1;m<l;m++){var N=L.interpolateUsingSurfaceDistance(m*A,O);N.height=h[m],S=a.cartographicToCartesian(N,g),t.pack(S,u,d),d+=3}return d}var R={};R.numberOfPoints=function(e,r,n){var a=t.distance(e,r);return Math.ceil(a/n)};var T=new e;R.extractHeights=function(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;a++){var o=t[a];n[a]=e.cartesianToCartographic(o,T).height}return n};var h=new c,A=new t,d=new t,S=new l(t.ZERO,0),m=new t,N=new l(t.ZERO,0),C=new t,I=new t,p=[],M=new e,O=new e,g=new t,y=new t,F=new t,L=new i;return R.wrapLongitude=function(e,a){var o=[],i=[];if(n(e)&&e.length>0){a=r(a,c.IDENTITY);var s=c.inverseTransformation(a,h),E=c.multiplyByPoint(s,t.ZERO,A),f=c.multiplyByPointAsVector(s,t.UNIT_Y,d),_=l.fromPointNormal(E,f,S),R=c.multiplyByPointAsVector(s,t.UNIT_X,m),T=l.fromPointNormal(E,R,N),p=1;o.push(t.clone(e[0]));for(var M=o[0],O=e.length,g=1;g<O;++g){var y=e[g];if(l.getPointDistance(T,M)<0||l.getPointDistance(T,y)<0){var F=u.lineSegmentPlane(M,y,_,C);if(n(F)){var L=t.multiplyByScalar(f,5e-9,I);l.getPointDistance(_,M)<0&&t.negate(L,L),o.push(t.add(F,L,new t)),i.push(p+1),t.negate(L,L),o.push(t.add(F,L,new t)),p=1}}o.push(t.clone(e[g])),p++,M=y}i.push(p)}return{positions:o,lengths:i}},R.generateArc=function(e){n(e)||(e={});var a=e.positions,i=a.length,u=r(e.ellipsoid,o.WGS84),c=r(e.height,0),l=s(c);if(i<1)return[];if(1===i){var f=u.scaleToGeodeticSurface(a[0],y);if(c=l?c[0]:c,0!==c){var T=u.geodeticSurfaceNormal(f,g);t.multiplyByScalar(T,c,T),t.add(f,T,f)}return[f.x,f.y,f.z]}var h=e.minDistance;if(!n(h)){var A=r(e.granularity,E.RADIANS_PER_DEGREE);h=E.chordLength(A,u.maximumRadius)}var d,S=0;for(d=0;d<i-1;d++)S+=R.numberOfPoints(a[d],a[d+1],h);var m=3*(S+1),N=new Array(m),C=0;for(d=0;d<i-1;d++){var I=a[d],O=a[d+1],F=l?c[d]:c,L=l?c[d+1]:c;C=_(I,O,h,u,F,L,N,C)}p.length=0;var v=a[i-1],D=u.cartesianToCartographic(v,M);D.height=l?c[i-1]:c;var U=u.cartographicToCartesian(D,g);return t.pack(U,N,m-3),N},R.generateCartesianArc=function(e){for(var r=R.generateArc(e),n=r.length/3,a=new Array(n),o=0;o<n;o++)a[o]=t.unpack(r,3*o);return a},R}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,r,n){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return a.POSITION_ONLY=n(new a({position:!0})),a.POSITION_AND_NORMAL=n(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=n(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=n(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=n(new a({position:!0,color:!0})),a.ALL=n(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,r,n){return n=t(n,0),r[n++]=e.position?1:0,r[n++]=e.normal?1:0,r[n++]=e.st?1:0,r[n++]=e.tangent?1:0,r[n++]=e.bitangent?1:0,r[n++]=e.color?1:0,r},a.unpack=function(r,n,o){return n=t(n,0),e(o)||(o=new a),o.position=1===r[n++],o.normal=1===r[n++],o.st=1===r[n++],o.tangent=1===r[n++],o.bitangent=1===r[n++],o.color=1===r[n++],o},a.clone=function(t,r){if(e(t))return e(r)||(r=new a),r.position=t.position,r.normal=t.normal,r.st=t.st,r.tangent=t.tangent,r.bitangent=t.bitangent,r.color=t.color,r},a}),define("Core/PolylineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(t,e,r,n,a,o,i,u,s,E,c,l,f,_,R,T,h,A){"use strict";function d(t,e,r,a,o){var i=m;i.length=o;var u,s=r.red,E=r.green,c=r.blue,l=r.alpha,f=a.red,_=a.green,R=a.blue,T=a.alpha;if(n.equals(r,a)){for(u=0;u<o;u++)i[u]=n.clone(r);return i}var h=(f-s)/o,A=(_-E)/o,d=(R-c)/o,S=(T-l)/o;for(u=0;u<o;u++)i[u]=new n(s+u*h,E+u*A,c+u*d,l+u*S);return i}function S(t){t=o(t,o.EMPTY_OBJECT);var e=t.positions,a=t.colors,u=o(t.width,1),E=o(t.colorsPerVertex,!1);this._positions=e,this._colors=a,this._width=u,this._colorsPerVertex=E,this._vertexFormat=A.clone(o(t.vertexFormat,A.DEFAULT)),this._followSurface=o(t.followSurface,!0),this._granularity=o(t.granularity,R.RADIANS_PER_DEGREE),this._ellipsoid=s.clone(o(t.ellipsoid,s.WGS84)),this._workerName="createPolylineGeometry";var c=1+e.length*r.packedLength;c+=i(a)?1+a.length*n.packedLength:1,this.packedLength=c+s.packedLength+A.packedLength+4}var m=[];S.pack=function(t,e,a){a=o(a,0);var u,E=t._positions,c=E.length;for(e[a++]=c,u=0;u<c;++u,a+=r.packedLength)r.pack(E[u],e,a);var l=t._colors;for(c=i(l)?l.length:0,e[a++]=c,u=0;u<c;++u,a+=n.packedLength)n.pack(l[u],e,a);return s.pack(t._ellipsoid,e,a),a+=s.packedLength,A.pack(t._vertexFormat,e,a),a+=A.packedLength,e[a++]=t._width,e[a++]=t._colorsPerVertex?1:0,e[a++]=t._followSurface?1:0,e[a]=t._granularity,e};var N=s.clone(s.UNIT_SPHERE),C=new A,I={positions:void 0,colors:void 0,ellipsoid:N,vertexFormat:C,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};S.unpack=function(t,e,a){e=o(e,0);var u,E=t[e++],c=new Array(E);for(u=0;u<E;++u,e+=r.packedLength)c[u]=r.unpack(t,e);E=t[e++];var l=E>0?new Array(E):void 0;for(u=0;u<E;++u,e+=n.packedLength)l[u]=n.unpack(t,e);var f=s.unpack(t,e,N);e+=s.packedLength;var _=A.unpack(t,e,C);e+=A.packedLength;var R=t[e++],T=1===t[e++],h=1===t[e++],d=t[e];return i(a)?(a._positions=c,a._colors=l,a._ellipsoid=s.clone(f,a._ellipsoid),a._vertexFormat=A.clone(_,a._vertexFormat),a._width=R,a._colorsPerVertex=T,a._followSurface=h,a._granularity=d,a):(I.positions=c,I.colors=l,I.width=R,I.colorsPerVertex=T,I.followSurface=h,I.granularity=d,new S(I))};var p=new r,M=new r,O=new r,g=new r;return S.createGeometry=function(o){var u,s,A,S=o._width,N=o._vertexFormat,C=o._colors,I=o._colorsPerVertex,y=o._followSurface,F=o._granularity,L=o._ellipsoid,v=t(o._positions,r.equalsEpsilon),D=v.length;if(!(D<2||S<=0)){if(y){var U=T.extractHeights(v,L),P=R.chordLength(F,L.maximumRadius);if(i(C)){var w=1;for(u=0;u<D-1;++u)w+=T.numberOfPoints(v[u],v[u+1],P);var B=new Array(w),x=0;for(u=0;u<D-1;++u){var G=v[u],b=v[u+1],z=C[u],H=T.numberOfPoints(G,b,P);if(I&&u<w){var V=C[u+1],X=d(G,b,z,V,H),q=X.length;for(s=0;s<q;++s)B[x++]=X[s]}else for(s=0;s<H;++s)B[x++]=n.clone(z)}B[x]=n.clone(C[C.length-1]),C=B,m.length=0}v=T.generateCartesianArc({positions:v,minDistance:P,ellipsoid:L,height:U})}D=v.length;var W,Y=4*D-4,K=new Float64Array(3*Y),k=new Float64Array(3*Y),Z=new Float64Array(3*Y),j=new Float32Array(2*Y),Q=N.st?new Float32Array(2*Y):void 0,J=i(C)?new Uint8Array(4*Y):void 0,$=0,tt=0,et=0,rt=0;for(s=0;s<D;++s){0===s?(W=p,r.subtract(v[0],v[1],W),r.add(v[0],W,W)):W=v[s-1],r.clone(W,O),r.clone(v[s],M),s===D-1?(W=p,r.subtract(v[D-1],v[D-2],W),r.add(v[D-1],W,W)):W=v[s+1],r.clone(W,g);var nt,at;i(J)&&(nt=0===s||I?C[s]:C[s-1],s!==D-1&&(at=C[s]));var ot=0===s?2:0,it=s===D-1?2:4;for(A=ot;A<it;++A){r.pack(M,K,$),r.pack(O,k,$),r.pack(g,Z,$),$+=3;var ut=A-2<0?-1:1;if(j[tt++]=2*(A%2)-1,j[tt++]=ut*S,N.st&&(Q[et++]=s/(D-1),Q[et++]=Math.max(j[tt-2],0)),i(J)){var st=A<2?nt:at;J[rt++]=n.floatToByte(st.red),J[rt++]=n.floatToByte(st.green),J[rt++]=n.floatToByte(st.blue),J[rt++]=n.floatToByte(st.alpha)}}}var Et=new l;Et.position=new c({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:K}),Et.prevPosition=new c({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:k}),Et.nextPosition=new c({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:Z}),Et.expandAndWidth=new c({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:j}),N.st&&(Et.st=new c({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:Q})),i(J)&&(Et.color=new c({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:4,values:J,normalize:!0}));var ct=_.createTypedArray(Y,6*D-6),lt=0,ft=0,_t=D-1;for(s=0;s<_t;++s)ct[ft++]=lt,ct[ft++]=lt+2,ct[ft++]=lt+1,ct[ft++]=lt+1,ct[ft++]=lt+2,ct[ft++]=lt+3,lt+=4;return new E({attributes:Et,indices:ct,primitiveType:h.TRIANGLES,boundingSphere:e.fromPoints(v),geometryType:f.POLYLINES})}},S}),define("Workers/createPolylineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolylineGeometry"],function(t,e,r){"use strict";function n(n,a){return t(a)&&(n=r.unpack(n,a)),n._ellipsoid=e.clone(n._ellipsoid),r.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function r(t){return t+" is required, actual value was undefined"}function n(t,e,r){return"Expected "+r+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(n,a){if(!t(a))throw new e(r(n))},a.typeOf.func=function(t,r){if("function"!=typeof r)throw new e(n(typeof r,"function",t))},a.typeOf.string=function(t,r){if("string"!=typeof r)throw new e(n(typeof r,"string",t))},a.typeOf.number=function(t,r){if("number"!=typeof r)throw new e(n(typeof r,"number",t))},a.typeOf.number.lessThan=function(t,r,n){if(a.typeOf.number(t,r),r>=n)throw new e("Expected "+t+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(t,r,n){if(a.typeOf.number(t,r),r>n)throw new e("Expected "+t+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(t,r,n){if(a.typeOf.number(t,r),r<=n)throw new e("Expected "+t+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(t,r,n){if(a.typeOf.number(t,r),r<n)throw new e("Expected "+t+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(t,r){if("object"!=typeof r)throw new e(n(typeof r,"object",t))},a.typeOf.bool=function(t,r){if("boolean"!=typeof r)throw new e(n(typeof r,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^t>>>1^e[1&t];for(;r<this.N-1;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,r){return r=e(r,255),Math.round((.5*a.clamp(t,-1,1)+.5)*r)},a.fromSNorm=function(t,r){return r=e(r,255),a.clamp(t,0,r)/r*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e-r)},a.cosh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e+r)},a.lerp=function(t,e,r){return(1-r)*t+r*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,r,n,a){a=e(a,n);var o=Math.abs(t-r);return o<=a||o<=n*Math.max(Math.abs(t),Math.abs(r))};var o=[1];a.factorial=function(t){var e=o.length;if(t>=e)for(var r=o[e-1],n=e;n<=t;n++)o.push(r*n);return o[t]},a.incrementWrap=function(t,r,n){return n=e(n,0),++t,t>r&&(t=n),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,r){return t<e?e:t>r?r:t};var i=new t;return a.setRandomNumberSeed=function(e){i=new t(e)},a.nextRandomNumber=function(){return i.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var r=t*e;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)}i.fromSpherical=function(t,n){r(n)||(n=new i);var a=t.clock,o=t.cone,u=e(t.magnitude,1),s=u*Math.sin(o);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(o),n},i.fromElements=function(t,e,n,a){return r(a)?(a.x=t,a.y=e,a.z=n,a):new i(t,e,n)},i.clone=function(t,e){if(r(t))return r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new i(t.x,t.y,t.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z,r},i.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new i),a.x=t[n++],a.y=t[n++],a.z=t[n],a},i.packArray=function(t,e){var n=t.length;r(e)?e.length=3*n:e=new Array(3*n);for(var a=0;a<n;++a)i.pack(t[a],e,3*a);return e},i.unpackArray=function(t,e){var n=t.length;r(e)?e.length=n/3:e=new Array(n/3);for(var a=0;a<n;a+=3){var o=a/3;e[o]=i.unpack(t,a,e[o])}return e},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},i.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r},i.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};var u=new i;i.distance=function(t,e){return i.subtract(t,e,u),i.magnitude(u)},i.distanceSquared=function(t,e){return i.subtract(t,e,u),i.magnitudeSquared(u)},i.normalize=function(t,e){var r=i.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},i.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r},i.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r},i.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r},i.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r},i.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r},i.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var s=new i;i.lerp=function(t,e,r,n){return i.multiplyByScalar(e,r,s),n=i.multiplyByScalar(t,1-r,n),i.add(s,n,n)};var E=new i,c=new i;i.angleBetween=function(t,e){i.normalize(t,E),i.normalize(e,c);var r=i.dot(E,c),n=i.magnitude(i.cross(E,c,E));return Math.atan2(n,r)};var l=new i;i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,l);return i.abs(r,r),e=r.x<=r.y?r.x<=r.z?i.clone(i.UNIT_X,e):i.clone(i.UNIT_Z,e):r.y<=r.z?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_Z,e)},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},i.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]},i.equalsEpsilon=function(t,e,n,a){return t===e||r(t)&&r(e)&&o.equalsEpsilon(t.x,e.x,n,a)&&o.equalsEpsilon(t.y,e.y,n,a)&&o.equalsEpsilon(t.z,e.z,n,a)},i.cross=function(t,e,r){var n=t.x,a=t.y,o=t.z,i=e.x,u=e.y,s=e.z,E=a*s-o*u,c=o*i-n*s,l=n*u-a*i;return r.x=E,r.y=c,r.z=l,r},i.fromDegrees=function(t,e,r,n,a){return t=o.toRadians(t),e=o.toRadians(e),i.fromRadians(t,e,r,n,a)};var f=new i,_=new i,R=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(t,n,a,o,u){a=e(a,0);var s=r(o)?o.radiiSquared:R,E=Math.cos(n);f.x=E*Math.cos(t),f.y=E*Math.sin(t),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,_);var c=Math.sqrt(i.dot(f,_));return _=i.divideByScalar(_,c,_),f=i.multiplyByScalar(f,a,f),r(u)||(u=new i),i.add(_,f,u)},i.fromDegreesArray=function(t,e,n){var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=t[o],s=t[o+1],E=o/2;n[E]=i.fromDegrees(u,s,0,e,n[E])}return n},i.fromRadiansArray=function(t,e,n){var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=t[o],s=t[o+1],E=o/2;n[E]=i.fromRadians(u,s,0,e,n[E])}return n},i.fromDegreesArrayHeights=function(t,e,n){var a=t.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=t[o],s=t[o+1],E=t[o+2],c=o/3;n[c]=i.fromDegrees(u,s,E,e,n[c])}return n},i.fromRadiansArrayHeights=function(t,e,n){var a=t.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=t[o],s=t[o+1],E=t[o+2],c=o/3;n[c]=i.fromRadians(u,s,E,e,n[c])}return n},i.ZERO=a(new i(0,0,0)),i.UNIT_X=a(new i(1,0,0)),i.UNIT_Y=a(new i(0,1,0)),i.UNIT_Z=a(new i(0,0,1)),i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e,r){return i.equalsEpsilon(this,t,e,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,r,n){"use strict";function a(r,a,u,s,E){var c=r.x,l=r.y,f=r.z,_=a.x,R=a.y,T=a.z,h=c*c*_*_,A=l*l*R*R,d=f*f*T*T,S=h+A+d,m=Math.sqrt(1/S),N=t.multiplyByScalar(r,m,o);if(S<s)return isFinite(m)?t.clone(N,E):void 0;var C=u.x,I=u.y,p=u.z,M=i;M.x=N.x*C*2,M.y=N.y*I*2,M.z=N.z*p*2;var O,g,y,F,L,v,U,D,P,w,B,x=(1-m)*t.magnitude(r)/(.5*t.magnitude(M)),G=0;do{x-=G,y=1/(1+x*C),F=1/(1+x*I),L=1/(1+x*p),v=y*y,U=F*F,D=L*L,P=v*y,w=U*F,B=D*L,O=h*v+A*U+d*D-1,g=h*P*C+A*w*I+d*B*p;var b=-2*g;G=O/b}while(Math.abs(O)>n.EPSILON12);return e(E)?(E.x=c*y,E.y=l*F,E.z=f*L,E):new t(c*y,l*F,f*L)}var o=new t,i=new t;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,a,o,i){"use strict";function u(t,e,n){this.longitude=r(t,0),this.latitude=r(e,0),this.height=r(n,0)}u.fromRadians=function(t,e,a,o){return a=r(a,0),n(o)?(o.longitude=t,o.latitude=e,o.height=a,o):new u(t,e,a)},u.fromDegrees=function(t,e,r,n){return t=o.toRadians(t),e=o.toRadians(e),u.fromRadians(t,e,r,n)};var s=new t,E=new t,c=new t,l=new t(1/6378137,1/6378137,1/6356752.314245179),f=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),_=o.EPSILON1;return u.fromCartesian=function(e,r,a){var R=n(r)?r.oneOverRadii:l,T=n(r)?r.oneOverRadiiSquared:f,h=n(r)?r._centerToleranceSquared:_,A=i(e,R,T,h,E);if(n(A)){var d=t.multiplyComponents(A,T,s);d=t.normalize(d,d);var S=t.subtract(e,A,c),m=Math.atan2(d.y,d.x),N=Math.asin(d.z),C=o.sign(t.dot(S,e))*t.magnitude(S);return n(a)?(a.longitude=m,a.latitude=N,a.height=C,a):new u(m,N,C)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),r=Object.defineProperties;return e&&t(r)||(r=function(t){return t}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,a,o,i,u,s){"use strict";function E(e,n,a,o){n=r(n,0),a=r(a,0),o=r(o,0),e._radii=new t(n,a,o),e._radiiSquared=new t(n*n,a*a,o*o),e._radiiToTheFourth=new t(n*n*n*n,a*a*a*a,o*o*o*o),e._oneOverRadii=new t(0===n?0:1/n,0===a?0:1/a,0===o?0:1/o),e._oneOverRadiiSquared=new t(0===n?0:1/(n*n),0===a?0:1/(a*a),0===o?0:1/(o*o)),e._minimumRadius=Math.min(n,a,o),e._maximumRadius=Math.max(n,a,o),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,r){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._sqauredXOverSquaredZ=void 0,E(this,t,e,r)}a(c.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}}}),c.clone=function(e,r){if(n(e)){var a=e._radii;return n(r)?(t.clone(a,r._radii),t.clone(e._radiiSquared,r._radiiSquared),t.clone(e._radiiToTheFourth,r._radiiToTheFourth),t.clone(e._oneOverRadii,r._oneOverRadii),t.clone(e._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=e._minimumRadius,r._maximumRadius=e._maximumRadius,r._centerToleranceSquared=e._centerToleranceSquared,r):new c(a.x,a.y,a.z)}},c.fromCartesian3=function(t,e){return n(e)||(e=new c),n(t)?(E(e,t.x,t.y,t.z),e):e},c.WGS84=i(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=i(new c(1,1,1)),c.MOON=i(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,n,a){return a=r(a,0),t.pack(e._radii,n,a),n},c.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n);return c.fromCartesian3(o,a)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,r){var a=e.longitude,o=e.latitude,i=Math.cos(o),u=i*Math.cos(a),s=i*Math.sin(a),E=Math.sin(o);return n(r)||(r=new t),r.x=u,r.y=s,r.z=E,t.normalize(r,r)},c.prototype.geodeticSurfaceNormal=function(e,r){return n(r)||(r=new t),r=t.multiplyComponents(e,this._oneOverRadiiSquared,r),t.normalize(r,r)};var l=new t,f=new t;c.prototype.cartographicToCartesian=function(e,r){var a=l,o=f;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,o);var i=Math.sqrt(t.dot(a,o));return t.divideByScalar(o,i,o),t.multiplyByScalar(a,e.height,a),n(r)||(r=new t),t.add(o,a,r)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var a=0;a<r;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var _=new t,R=new t,T=new t;return c.prototype.cartesianToCartographic=function(r,a){var o=this.scaleToGeodeticSurface(r,R);if(n(o)){var i=this.geodeticSurfaceNormal(o,_),s=t.subtract(r,o,T),E=Math.atan2(i.y,i.x),c=Math.asin(i.z),l=u.sign(t.dot(s,r))*t.magnitude(s);return n(a)?(a.longitude=E,a.latitude=c,a.height=l,a):new e(E,c,l)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var a=0;a<r;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return s(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,r){n(r)||(r=new t);var a=e.x,o=e.y,i=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+o*o*u.y+i*i*u.z);return t.multiplyByScalar(e,s,r)},c.prototype.transformPositionToScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._oneOverRadii,r)},c.prototype.transformPositionFromScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._radii,r)},c.prototype.equals=function(e){return this===e||n(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,o){a=r(a,0);var i=this._sqauredXOverSquaredZ;if(n(o)||(o=new t),o.x=0,o.y=0,o.z=e.z*(1-i),!(Math.abs(o.z)>=this._radii.z-a))return o},c}),define("Core/arrayRemoveDuplicates",["./Check","./defaultValue","./defined","./Math"],function(t,e,r,n){"use strict";function a(t,n,a){if(r(t)){a=e(a,!1);var i=t.length;if(i<2)return t;var u,s,E;for(u=1;u<i&&(s=t[u-1],E=t[u],!n(s,E,o));++u);if(u===i)return a&&n(t[0],t[t.length-1],o)?t.slice(1):t;for(var c=t.slice(0,u);u<i;++u)E=t[u],n(s,E,o)||(c.push(E),s=E);return a&&c.length>1&&n(c[0],c[c.length-1],o)&&c.shift(),c}}var o=n.EPSILON10;return a}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,r,n,a,o,i){"use strict";function u(t){this._ellipsoid=r(t,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,r){var a=this._semimajorAxis,o=e.longitude*a,i=e.latitude*a,u=e.height;return n(r)?(r.x=o,r.y=i,r.z=u,r):new t(o,i,u)},u.prototype.unproject=function(t,r){var a=this._oneOverSemimajorAxis,o=t.x*a,i=t.y*a,u=t.z;return n(r)?(r.longitude=o,r.latitude=i,r.height=u,r):new e(o,i,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,r){this.start=t(e,0),this.stop=t(r,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t,e,n,a,o,i,u,s,E){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(e,0),this[4]=r(o,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(i,0),this[8]=r(E,0)}function E(t){for(var e=0,r=0;r<9;++r){var n=t[r];e+=n*n}return Math.sqrt(e)}function c(t){for(var e=0,r=0;r<3;++r){var n=t[s.getElementIndex(T[r],R[r])];e+=2*n*n}return Math.sqrt(e)}function l(t,e){for(var r=u.EPSILON15,n=0,a=1,o=0;o<3;++o){var i=Math.abs(t[s.getElementIndex(T[o],R[o])]);i>n&&(a=o,n=i)}var E=1,c=0,l=R[a],f=T[a];if(Math.abs(t[s.getElementIndex(f,l)])>r){var _,h=t[s.getElementIndex(f,f)],A=t[s.getElementIndex(l,l)],d=t[s.getElementIndex(f,l)],S=(h-A)/2/d;_=S<0?-1/(-S+Math.sqrt(1+S*S)):1/(S+Math.sqrt(1+S*S)),E=1/Math.sqrt(1+_*_),c=_*E}return e=s.clone(s.IDENTITY,e),e[s.getElementIndex(l,l)]=e[s.getElementIndex(f,f)]=E,e[s.getElementIndex(f,l)]=c,e[s.getElementIndex(l,f)]=-c,e}s.packedLength=9,s.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e},s.unpack=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},s.clone=function(t,e){if(n(t))return n(e)?(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],e):new s(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},s.fromArray=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},s.fromColumnMajorArray=function(t,e){return s.clone(t,e)},s.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new s(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},s.fromQuaternion=function(t,e){var r=t.x*t.x,a=t.x*t.y,o=t.x*t.z,i=t.x*t.w,u=t.y*t.y,E=t.y*t.z,c=t.y*t.w,l=t.z*t.z,f=t.z*t.w,_=t.w*t.w,R=r-u-l+_,T=2*(a-f),h=2*(o+c),A=2*(a+f),d=-r+u-l+_,S=2*(E-i),m=2*(o-c),N=2*(E+i),C=-r-u+l+_;return n(e)?(e[0]=R,e[1]=A,e[2]=m,e[3]=T,e[4]=d,e[5]=N,e[6]=h,e[7]=S,e[8]=C,e):new s(R,T,h,A,d,S,m,N,C)},s.fromHeadingPitchRoll=function(t,e){var r=Math.cos(-t.pitch),a=Math.cos(-t.heading),o=Math.cos(t.roll),i=Math.sin(-t.pitch),u=Math.sin(-t.heading),E=Math.sin(t.roll),c=r*a,l=-o*u+E*i*a,f=E*u+o*i*a,_=r*u,R=o*a+E*i*u,T=-E*a+o*i*u,h=-i,A=E*r,d=o*r;return n(e)?(e[0]=c,e[1]=_,e[2]=h,e[3]=l,e[4]=R,e[5]=A,e[6]=f,e[7]=T,e[8]=d,e):new s(c,l,f,_,R,T,h,A,d)},s.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new s(t.x,0,0,0,t.y,0,0,0,t.z)},s.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new s(t,0,0,0,t,0,0,0,t)},s.fromCrossProduct=function(t,e){return n(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new s(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},s.fromRotationX=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=r,e[5]=a,e[6]=0,e[7]=-a,e[8]=r,e):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=r,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=r,e):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=r,e[1]=a,e[2]=0,e[3]=-a,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(t,e){return n(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},s.getElementIndex=function(t,e){return 3*t+e},s.getColumn=function(t,e,r){var n=3*e,a=t[n],o=t[n+1],i=t[n+2];return r.x=a,r.y=o,r.z=i,r},s.setColumn=function(t,e,r,n){n=s.clone(t,n);var a=3*e;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(t,e,r){var n=t[e],a=t[e+3],o=t[e+6];return r.x=n,r.y=a,r.z=o,r},s.setRow=function(t,e,r,n){return n=s.clone(t,n),n[e]=r.x,n[e+3]=r.y,n[e+6]=r.z,n};var f=new t;s.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],f)),r.y=t.magnitude(t.fromElements(e[3],e[4],e[5],f)),r.z=t.magnitude(t.fromElements(e[6],e[7],e[8],f)),r};var _=new t;s.getMaximumScale=function(e){return s.getScale(e,_),t.maximumComponent(_)},s.multiply=function(t,e,r){var n=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],o=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],i=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],E=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],l=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return r[0]=n,r[1]=a,r[2]=o,r[3]=i,r[4]=u,r[5]=s,r[6]=E,r[7]=c,r[8]=l,r},s.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r},s.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r},s.multiplyByVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[3]*a+t[6]*o,u=t[1]*n+t[4]*a+t[7]*o,s=t[2]*n+t[5]*a+t[8]*o;return r.x=i,r.y=u,r.z=s,r},s.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r},s.multiplyByScale=function(t,e,r){return r[0]=t[0]*e.x,r[1]=t[1]*e.x,r[2]=t[2]*e.x,r[3]=t[3]*e.y,r[4]=t[4]*e.y,r[5]=t[5]*e.y,r[6]=t[6]*e.z,r[7]=t[7]*e.z,r[8]=t[8]*e.z,r},s.negate=function(t,e){return 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],e},s.transpose=function(t,e){var r=t[0],n=t[3],a=t[6],o=t[1],i=t[4],u=t[7],s=t[2],E=t[5],c=t[8];return e[0]=r,e[1]=n,e[2]=a,e[3]=o,e[4]=i,e[5]=u,e[6]=s,e[7]=E,e[8]=c,e};var R=[1,0,0],T=[2,2,1],h=new s,A=new s;return s.computeEigenDecomposition=function(t,e){var r=u.EPSILON20,a=10,o=0,i=0;n(e)||(e={});for(var f=e.unitary=s.clone(s.IDENTITY,e.unitary),_=e.diagonal=s.clone(t,e.diagonal),R=r*E(_);i<a&&c(_)>R;)l(_,h),s.transpose(h,A),s.multiply(_,h,_),s.multiply(A,_,_),s.multiply(f,h,f),++o>2&&(++i,o=0);return e},s.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},s.determinant=function(t){var e=t[0],r=t[3],n=t[6],a=t[1],o=t[4],i=t[7],u=t[2],s=t[5],E=t[8];return e*(o*E-s*i)+a*(s*n-r*E)+u*(r*i-o*n)},s.inverse=function(t,e){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],u=t[5],E=t[6],c=t[7],l=t[8],f=s.determinant(t);e[0]=i*l-c*u,e[1]=c*a-n*l,e[2]=n*u-i*a,e[3]=E*u-o*l,e[4]=r*l-E*a,e[5]=o*a-r*u,e[6]=o*c-E*i,e[7]=E*n-r*c,e[8]=r*i-o*n;var _=1/f;return s.multiplyByScalar(e,_,e)},s.equals=function(t,e){return t===e||n(t)&&n(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},s.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},s.IDENTITY=i(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=i(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,0)}i.fromElements=function(t,e,n,a,o){return r(o)?(o.x=t,o.y=e,o.z=n,o.w=a,o):new i(t,e,n,a)},i.fromColor=function(t,e){return r(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,e){if(r(t))return r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new i(t.x,t.y,t.z,t.w)},i.packedLength=4,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},i.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new i),a.x=t[n++],a.y=t[n++],a.z=t[n++],a.w=t[n],a},i.packArray=function(t,e){var n=t.length;r(e)?e.length=4*n:e=new Array(4*n);for(var a=0;a<n;++a)i.pack(t[a],e,4*a);return e},i.unpackArray=function(t,e){var n=t.length;r(e)?e.length=n/4:e=new Array(n/4);for(var a=0;a<n;a+=4){var o=a/4;e[o]=i.unpack(t,a,e[o])}return e},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},i.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r.w=Math.min(t.w,e.w),r},i.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r.w=Math.max(t.w,e.w),r},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};var u=new i;i.distance=function(t,e){return i.subtract(t,e,u),i.magnitude(u)},i.distanceSquared=function(t,e){return i.subtract(t,e,u),i.magnitudeSquared(u)},i.normalize=function(t,e){var r=i.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e.w=t.w/r,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},i.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r.w=t.w*e.w,r},i.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r.w=t.w/e.w,r},i.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r.w=t.w+e.w,r},i.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r.w=t.w-e.w,r},i.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r.w=t.w*e,r},i.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r.w=t.w/e,r},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var s=new i;i.lerp=function(t,e,r,n){return i.multiplyByScalar(e,r,s),n=i.multiplyByScalar(t,1-r,n),i.add(s,n,n)};var E=new i;return i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,E);return i.abs(r,r),e=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):r.z<=r.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):r.z<=r.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},i.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]&&t.w===e[r+3]},i.equalsEpsilon=function(t,e,n,a){return t===e||r(t)&&r(e)&&o.equalsEpsilon(t.x,e.x,n,a)&&o.equalsEpsilon(t.y,e.y,n,a)&&o.equalsEpsilon(t.z,e.z,n,a)&&o.equalsEpsilon(t.w,e.w,n,a)},i.ZERO=a(new i(0,0,0,0)),i.UNIT_X=a(new i(1,0,0,0)),i.UNIT_Y=a(new i(0,1,0,0)),i.UNIT_Z=a(new i(0,0,1,0)),i.UNIT_W=a(new i(0,0,0,1)),i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e,r){return i.equalsEpsilon(this,t,e,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError", +this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,r,n,a,o,i,u,s,E){"use strict";function c(t,e,r,a,o,i,u,s,E,c,l,f,_,R,T,h){this[0]=n(t,0),this[1]=n(o,0),this[2]=n(E,0),this[3]=n(_,0),this[4]=n(e,0),this[5]=n(i,0),this[6]=n(c,0),this[7]=n(R,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(l,0),this[11]=n(T,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(h,0)}c.packedLength=16,c.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e[r++]=t[9],e[r++]=t[10],e[r++]=t[11],e[r++]=t[12],e[r++]=t[13],e[r++]=t[14],e[r]=t[15],e},c.unpack=function(t,e,r){return e=n(e,0),a(r)||(r=new c),r[0]=t[e++],r[1]=t[e++],r[2]=t[e++],r[3]=t[e++],r[4]=t[e++],r[5]=t[e++],r[6]=t[e++],r[7]=t[e++],r[8]=t[e++],r[9]=t[e++],r[10]=t[e++],r[11]=t[e++],r[12]=t[e++],r[13]=t[e++],r[14]=t[e++],r[15]=t[e],r},c.clone=function(t,e){if(a(t))return a(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,r,o){return r=n(r,t.ZERO),a(o)?(o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=0,o[4]=e[3],o[5]=e[4],o[6]=e[5],o[7]=0,o[8]=e[6],o[9]=e[7],o[10]=e[8],o[11]=0,o[12]=r.x,o[13]=r.y,o[14]=r.z,o[15]=1,o):new c(e[0],e[3],e[6],r.x,e[1],e[4],e[7],r.y,e[2],e[5],e[8],r.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,r,n){a(n)||(n=new c);var o=r.x,i=r.y,u=r.z,s=e.x*e.x,E=e.x*e.y,l=e.x*e.z,f=e.x*e.w,_=e.y*e.y,R=e.y*e.z,T=e.y*e.w,h=e.z*e.z,A=e.z*e.w,d=e.w*e.w,S=s-_-h+d,m=2*(E-A),N=2*(l+T),C=2*(E+A),I=-s+_-h+d,p=2*(R-f),M=2*(l-T),O=2*(R+f),g=-s-_+h+d;return n[0]=S*o,n[1]=C*o,n[2]=M*o,n[3]=0,n[4]=m*i,n[5]=I*i,n[6]=O*i,n[7]=0,n[8]=N*u,n[9]=p*u,n[10]=g*u,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(s.IDENTITY,t,e)},c.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var l=new t,f=new t,_=new t;c.fromCamera=function(e,r){var n=e.position,o=e.direction,i=e.up;t.normalize(o,l),t.normalize(t.cross(l,i,f),f),t.normalize(t.cross(f,l,_),_);var u=f.x,s=f.y,E=f.z,R=l.x,T=l.y,h=l.z,A=_.x,d=_.y,S=_.z,m=n.x,N=n.y,C=n.z,I=u*-m+s*-N+E*-C,p=A*-m+d*-N+S*-C,M=R*m+T*N+h*C;return a(r)?(r[0]=u,r[1]=A,r[2]=-R,r[3]=0,r[4]=s,r[5]=d,r[6]=-T,r[7]=0,r[8]=E,r[9]=S,r[10]=-h,r[11]=0,r[12]=I,r[13]=p,r[14]=M,r[15]=1,r):new c(u,s,E,I,A,d,S,p,-R,-T,-h,M,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,r,n,a){var o=Math.tan(.5*t),i=1/o,u=i/e,s=(n+r)/(r-n),E=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=E,a[15]=0,a},c.computeOrthographicOffCenter=function(t,e,r,n,a,o,i){var u=1/(e-t),s=1/(n-r),E=1/(o-a),c=-(e+t)*u,l=-(n+r)*s,f=-(o+a)*E;return u*=2,s*=2,E*=-2,i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=0,i[12]=c,i[13]=l,i[14]=f,i[15]=1,i},c.computePerspectiveOffCenter=function(t,e,r,n,a,o,i){var u=2*a/(e-t),s=2*a/(n-r),E=(e+t)/(e-t),c=(n+r)/(n-r),l=-(o+a)/(o-a),f=-1,_=-2*o*a/(o-a);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=E,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=_,i[15]=0,i},c.computeInfinitePerspectiveOffCenter=function(t,e,r,n,a,o){var i=2*a/(e-t),u=2*a/(n-r),s=(e+t)/(e-t),E=(n+r)/(n-r),c=-1,l=-1,f=-2*a;return o[0]=i,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=s,o[9]=E,o[10]=c,o[11]=l,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o},c.computeViewportTransformation=function(t,e,r,a){t=n(t,n.EMPTY_OBJECT);var o=n(t.x,0),i=n(t.y,0),u=n(t.width,0),s=n(t.height,0);e=n(e,0),r=n(r,1);var E=.5*u,c=.5*s,l=.5*(r-e),f=E,_=c,R=l,T=o+E,h=i+c,A=e+l,d=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=_,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=R,a[11]=0,a[12]=T,a[13]=h,a[14]=A,a[15]=d,a},c.computeView=function(e,r,n,a,o){return o[0]=a.x,o[1]=n.x,o[2]=-r.x,o[3]=0,o[4]=a.y,o[5]=n.y,o[6]=-r.y,o[7]=0,o[8]=a.z,o[9]=n.z,o[10]=-r.z,o[11]=0,o[12]=-t.dot(a,e),o[13]=-t.dot(n,e),o[14]=t.dot(r,e),o[15]=1,o},c.toArray=function(t,e){return a(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,r){var n=4*e,a=t[n],o=t[n+1],i=t[n+2],u=t[n+3];return r.x=a,r.y=o,r.z=i,r.w=u,r},c.setColumn=function(t,e,r,n){n=c.clone(t,n);var a=4*e;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},c.setTranslation=function(t,e,r){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=t[15],r},c.getRow=function(t,e,r){var n=t[e],a=t[e+4],o=t[e+8],i=t[e+12];return r.x=n,r.y=a,r.z=o,r.w=i,r},c.setRow=function(t,e,r,n){return n=c.clone(t,n),n[e]=r.x,n[e+4]=r.y,n[e+8]=r.z,n[e+12]=r.w,n};var R=new t;c.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],R)),r.y=t.magnitude(t.fromElements(e[4],e[5],e[6],R)),r.z=t.magnitude(t.fromElements(e[8],e[9],e[10],R)),r};var T=new t;c.getMaximumScale=function(e){return c.getScale(e,T),t.maximumComponent(T)},c.multiply=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[3],u=t[4],s=t[5],E=t[6],c=t[7],l=t[8],f=t[9],_=t[10],R=t[11],T=t[12],h=t[13],A=t[14],d=t[15],S=e[0],m=e[1],N=e[2],C=e[3],I=e[4],p=e[5],M=e[6],O=e[7],g=e[8],y=e[9],F=e[10],L=e[11],v=e[12],U=e[13],D=e[14],P=e[15],w=n*S+u*m+l*N+T*C,B=a*S+s*m+f*N+h*C,x=o*S+E*m+_*N+A*C,G=i*S+c*m+R*N+d*C,b=n*I+u*p+l*M+T*O,z=a*I+s*p+f*M+h*O,H=o*I+E*p+_*M+A*O,V=i*I+c*p+R*M+d*O,X=n*g+u*y+l*F+T*L,q=a*g+s*y+f*F+h*L,W=o*g+E*y+_*F+A*L,Y=i*g+c*y+R*F+d*L,K=n*v+u*U+l*D+T*P,k=a*v+s*U+f*D+h*P,Z=o*v+E*U+_*D+A*P,j=i*v+c*U+R*D+d*P;return r[0]=w,r[1]=B,r[2]=x,r[3]=G,r[4]=b,r[5]=z,r[6]=H,r[7]=V,r[8]=X,r[9]=q,r[10]=W,r[11]=Y,r[12]=K,r[13]=k,r[14]=Z,r[15]=j,r},c.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r},c.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r},c.multiplyTransformation=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[4],u=t[5],s=t[6],E=t[8],c=t[9],l=t[10],f=t[12],_=t[13],R=t[14],T=e[0],h=e[1],A=e[2],d=e[4],S=e[5],m=e[6],N=e[8],C=e[9],I=e[10],p=e[12],M=e[13],O=e[14],g=n*T+i*h+E*A,y=a*T+u*h+c*A,F=o*T+s*h+l*A,L=n*d+i*S+E*m,v=a*d+u*S+c*m,U=o*d+s*S+l*m,D=n*N+i*C+E*I,P=a*N+u*C+c*I,w=o*N+s*C+l*I,B=n*p+i*M+E*O+f,x=a*p+u*M+c*O+_,G=o*p+s*M+l*O+R;return r[0]=g,r[1]=y,r[2]=F,r[3]=0,r[4]=L,r[5]=v,r[6]=U,r[7]=0,r[8]=D,r[9]=P,r[10]=w,r[11]=0,r[12]=B,r[13]=x,r[14]=G,r[15]=1,r},c.multiplyByMatrix3=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[4],u=t[5],s=t[6],E=t[8],c=t[9],l=t[10],f=e[0],_=e[1],R=e[2],T=e[3],h=e[4],A=e[5],d=e[6],S=e[7],m=e[8],N=n*f+i*_+E*R,C=a*f+u*_+c*R,I=o*f+s*_+l*R,p=n*T+i*h+E*A,M=a*T+u*h+c*A,O=o*T+s*h+l*A,g=n*d+i*S+E*m,y=a*d+u*S+c*m,F=o*d+s*S+l*m;return r[0]=N,r[1]=C,r[2]=I,r[3]=0,r[4]=p,r[5]=M,r[6]=O,r[7]=0,r[8]=g,r[9]=y,r[10]=F,r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},c.multiplyByTranslation=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=n*t[0]+a*t[4]+o*t[8]+t[12],u=n*t[1]+a*t[5]+o*t[9]+t[13],s=n*t[2]+a*t[6]+o*t[10]+t[14];return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=i,r[13]=u,r[14]=s,r[15]=t[15],r};var h=new t;c.multiplyByUniformScale=function(t,e,r){return h.x=e,h.y=e,h.z=e,c.multiplyByScale(t,h,r)},c.multiplyByScale=function(t,e,r){var n=e.x,a=e.y,o=e.z;return 1===n&&1===a&&1===o?c.clone(t,r):(r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=0,r[4]=a*t[4],r[5]=a*t[5],r[6]=a*t[6],r[7]=0,r[8]=o*t[8],r[9]=o*t[9],r[10]=o*t[10],r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=1,r)},c.multiplyByVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=e.w,u=t[0]*n+t[4]*a+t[8]*o+t[12]*i,s=t[1]*n+t[5]*a+t[9]*o+t[13]*i,E=t[2]*n+t[6]*a+t[10]*o+t[14]*i,c=t[3]*n+t[7]*a+t[11]*o+t[15]*i;return r.x=u,r.y=s,r.z=E,r.w=c,r},c.multiplyByPointAsVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[4]*a+t[8]*o,u=t[1]*n+t[5]*a+t[9]*o,s=t[2]*n+t[6]*a+t[10]*o;return r.x=i,r.y=u,r.z=s,r},c.multiplyByPoint=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[4]*a+t[8]*o+t[12],u=t[1]*n+t[5]*a+t[9]*o+t[13],s=t[2]*n+t[6]*a+t[10]*o+t[14];return r.x=i,r.y=u,r.z=s,r},c.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var r=t[1],n=t[2],a=t[3],o=t[6],i=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=i,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,r){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r&&Math.abs(t[9]-e[9])<=r&&Math.abs(t[10]-e[10])<=r&&Math.abs(t[11]-e[11])<=r&&Math.abs(t[12]-e[12])<=r&&Math.abs(t[13]-e[13])<=r&&Math.abs(t[14]-e[14])<=r&&Math.abs(t[15]-e[15])<=r},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var A=new s,d=new s,S=new e,m=new e(0,0,0,1);return c.inverse=function(t,r){if(s.equalsEpsilon(c.getRotation(t,A),d,u.EPSILON7)&&e.equals(c.getRow(t,3,S),m))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-t[12],r[13]=-t[13],r[14]=-t[14],r[15]=1,r;var n=t[0],a=t[4],o=t[8],i=t[12],l=t[1],f=t[5],_=t[9],R=t[13],T=t[2],h=t[6],N=t[10],C=t[14],I=t[3],p=t[7],M=t[11],O=t[15],g=N*O,y=C*M,F=h*O,L=C*p,v=h*M,U=N*p,D=T*O,P=C*I,w=T*M,B=N*I,x=T*p,G=h*I,b=g*f+L*_+v*R-(y*f+F*_+U*R),z=y*l+D*_+B*R-(g*l+P*_+w*R),H=F*l+P*f+x*R-(L*l+D*f+G*R),V=U*l+w*f+G*_-(v*l+B*f+x*_),X=y*a+F*o+U*i-(g*a+L*o+v*i),q=g*n+P*o+w*i-(y*n+D*o+B*i),W=L*n+D*a+G*i-(F*n+P*a+x*i),Y=v*n+B*a+x*o-(U*n+w*a+G*o);g=o*R,y=i*_,F=a*R,L=i*f,v=a*_,U=o*f,D=n*R,P=i*l,w=n*_,B=o*l,x=n*f,G=a*l;var K=g*p+L*M+v*O-(y*p+F*M+U*O),k=y*I+D*M+B*O-(g*I+P*M+w*O),Z=F*I+P*p+x*O-(L*I+D*p+G*O),j=U*I+w*p+G*M-(v*I+B*p+x*M),Q=F*N+U*C+y*h-(v*C+g*h+L*N),J=w*C+g*T+P*N-(D*N+B*C+y*T),$=D*h+G*C+L*T-(x*C+F*T+P*h),tt=x*N+v*T+B*h-(w*h+G*N+U*T),et=n*b+a*z+o*H+i*V;if(Math.abs(et)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return et=1/et,r[0]=b*et,r[1]=z*et,r[2]=H*et,r[3]=V*et,r[4]=X*et,r[5]=q*et,r[6]=W*et,r[7]=Y*et,r[8]=K*et,r[9]=k*et,r[10]=Z*et,r[11]=j*et,r[12]=Q*et,r[13]=J*et,r[14]=$*et,r[15]=tt*et,r},c.inverseTransformation=function(t,e){var r=t[0],n=t[1],a=t[2],o=t[4],i=t[5],u=t[6],s=t[8],E=t[9],c=t[10],l=t[12],f=t[13],_=t[14],R=-r*l-n*f-a*_,T=-o*l-i*f-u*_,h=-s*l-E*f-c*_;return e[0]=r,e[1]=o,e[2]=s,e[3]=0,e[4]=n,e[5]=i,e[6]=E,e[7]=0,e[8]=a,e[9]=u,e[10]=c,e[11]=0,e[12]=R,e[13]=T,e[14]=h,e[15]=1,e},c.IDENTITY=i(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=i(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,o(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]&&t[9]===e[r+9]&&t[10]===e[r+10]&&t[11]===e[r+11]&&t[12]===e[r+12]&&t[13]===e[r+13]&&t[14]===e[r+14]&&t[15]===e[r+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t,e,n,a){this.west=r(t,0),this.south=r(e,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(t,e,n){return n=r(n,0),e[n++]=t.west,e[n++]=t.south,e[n++]=t.east,e[n]=t.north,e},s.unpack=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},s.computeWidth=function(t){var e=t.east,r=t.west;return e<r&&(e+=u.TWO_PI),e-r},s.computeHeight=function(t){return t.north-t.south},s.fromDegrees=function(t,e,a,o,i){return t=u.toRadians(r(t,0)),e=u.toRadians(r(e,0)),a=u.toRadians(r(a,0)),o=u.toRadians(r(o,0)),n(i)?(i.west=t,i.south=e,i.east=a,i.north=o,i):new s(t,e,a,o)},s.fromRadians=function(t,e,a,o,i){return n(i)?(i.west=r(t,0),i.south=r(e,0),i.east=r(a,0),i.north=r(o,0),i):new s(t,e,a,o)},s.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,i=-Number.MAX_VALUE,E=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=0,f=t.length;l<f;l++){var _=t[l];r=Math.min(r,_.longitude),a=Math.max(a,_.longitude),E=Math.min(E,_.latitude),c=Math.max(c,_.latitude);var R=_.longitude>=0?_.longitude:_.longitude+u.TWO_PI;o=Math.min(o,R),i=Math.max(i,R)}return a-r>i-o&&(r=o,a=i,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(e)?(e.west=r,e.south=E,e.east=a,e.north=c,e):new s(r,E,a,c)},s.fromCartesianArray=function(t,e,r){for(var a=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,E=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,_=t.length;f<_;f++){var R=e.cartesianToCartographic(t[f]);a=Math.min(a,R.longitude),o=Math.max(o,R.longitude),c=Math.min(c,R.latitude),l=Math.max(l,R.latitude);var T=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;i=Math.min(i,T),E=Math.max(E,T)}return o-a>E-i&&(a=i,o=E,o>u.PI&&(o-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=c,r.east=o,r.north=l,r):new s(a,c,o,l)},s.clone=function(t,e){if(n(t))return n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new s(t.west,t.south,t.east,t.north)},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,e){return t===e||n(t)&&n(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},s.prototype.equalsEpsilon=function(t,e){return n(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},s.validate=function(t){},s.southwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t(e.west,e.south)},s.northwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t(e.west,e.north)},s.northeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t(e.east,e.north)},s.southeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t(e.east,e.south)},s.center=function(e,r){var a=e.east,o=e.west;a<o&&(a+=u.TWO_PI);var i=u.negativePiToPi(.5*(o+a)),s=.5*(e.south+e.north);return n(r)?(r.longitude=i,r.latitude=s,r.height=0,r):new t(i,s)},s.intersection=function(t,e,r){var a=t.east,o=t.west,i=e.east,E=e.west;a<o&&i>0?a+=u.TWO_PI:i<E&&a>0&&(i+=u.TWO_PI),a<o&&E<0?E+=u.TWO_PI:i<E&&o<0&&(o+=u.TWO_PI);var c=u.negativePiToPi(Math.max(o,E)),l=u.negativePiToPi(Math.min(a,i));if(!((t.west<t.east||e.west<e.east)&&l<=c)){var f=Math.max(t.south,e.south),_=Math.min(t.north,e.north);if(!(f>=_))return n(r)?(r.west=c,r.south=f,r.east=l,r.north=_,r):new s(c,f,l,_)}},s.simpleIntersection=function(t,e,r){var a=Math.max(t.west,e.west),o=Math.max(t.south,e.south),i=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(o>=u||a>=i))return n(r)?(r.west=a,r.south=o,r.east=i,r.north=u,r):new s(a,o,i,u)},s.union=function(t,e,r){n(r)||(r=new s);var a=t.east,o=t.west,i=e.east,E=e.west;a<o&&i>0?a+=u.TWO_PI:i<E&&a>0&&(i+=u.TWO_PI),a<o&&E<0?E+=u.TWO_PI:i<E&&o<0&&(o+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(o,E)),l=u.convertLongitudeRange(Math.max(a,i));return r.west=c,r.south=Math.min(t.south,e.south),r.east=l,r.north=Math.max(t.north,e.north),r},s.expand=function(t,e,r){return n(r)||(r=new s),r.west=Math.min(t.west,e.longitude),r.south=Math.min(t.south,e.latitude),r.east=Math.max(t.east,e.longitude),r.north=Math.max(t.north,e.latitude),r},s.contains=function(t,e){var r=e.longitude,n=e.latitude,a=t.west,o=t.east;return o<a&&(o+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<o||u.equalsEpsilon(r,o,u.EPSILON14))&&n>=t.south&&n<=t.north};var E=new t;return s.subsample=function(t,e,a,i){e=r(e,o.WGS84),a=r(a,0),n(i)||(i=[]);var c=0,l=t.north,f=t.south,_=t.east,R=t.west,T=E;T.height=a,T.longitude=R,T.latitude=l,i[c]=e.cartographicToCartesian(T,i[c]),c++,T.longitude=_,i[c]=e.cartographicToCartesian(T,i[c]),c++,T.latitude=f,i[c]=e.cartographicToCartesian(T,i[c]),c++,T.longitude=R,i[c]=e.cartographicToCartesian(T,i[c]),c++,l<0?T.latitude=l:f>0?T.latitude=f:T.latitude=0;for(var h=1;h<8;++h)T.longitude=-Math.PI+h*u.PI_OVER_TWO,s.contains(t,T)&&(i[c]=e.cartographicToCartesian(T,i[c]),c++);return 0===T.latitude&&(T.longitude=R,i[c]=e.cartographicToCartesian(T,i[c]),c++,T.longitude=_,i[c]=e.cartographicToCartesian(T,i[c]),c++),i.length=c,i},s.MAX_VALUE=i(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,r,n,a,o,i,u,s,E,c,l){"use strict";function f(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var _=new t,R=new t,T=new t,h=new t,A=new t,d=new t,S=new t,m=new t,N=new t,C=new t,I=new t,p=new t;f.fromPoints=function(e,r){if(a(r)||(r=new f),!a(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;for(var n=t.clone(e[0],S),o=t.clone(n,_),i=t.clone(n,R),u=t.clone(n,T),s=t.clone(n,h),E=t.clone(n,A),c=t.clone(n,d),l=e.length,M=1;M<l;M++){t.clone(e[M],n);var O=n.x,g=n.y,y=n.z;O<o.x&&t.clone(n,o),O>s.x&&t.clone(n,s),g<i.y&&t.clone(n,i),g>E.y&&t.clone(n,E),y<u.z&&t.clone(n,u),y>c.z&&t.clone(n,c)}var F=t.magnitudeSquared(t.subtract(s,o,m)),L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(c,u,m)),U=o,D=s,P=F;L>P&&(P=L,U=i,D=E),v>P&&(P=v,U=u,D=c);var w=N;w.x=.5*(U.x+D.x),w.y=.5*(U.y+D.y),w.z=.5*(U.z+D.z);var B=t.magnitudeSquared(t.subtract(D,w,m)),x=Math.sqrt(B),G=C;G.x=o.x,G.y=i.y,G.z=u.z;var b=I;b.x=s.x,b.y=E.y,b.z=c.z;var z=t.multiplyByScalar(t.add(G,b,m),.5,p),H=0;for(M=0;M<l;M++){t.clone(e[M],n);var V=t.magnitude(t.subtract(n,z,m));V>H&&(H=V);var X=t.magnitudeSquared(t.subtract(n,w,m));if(X>B){var q=Math.sqrt(X);x=.5*(x+q),B=x*x;var W=q-x;w.x=(x*w.x+W*n.x)/q,w.y=(x*w.y+W*n.y)/q,w.z=(x*w.z+W*n.z)/q}}return x<H?(t.clone(w,r.center),r.radius=x):(t.clone(z,r.center),r.radius=H),r};var M=new i,O=new t,g=new t,y=new e,F=new e;f.fromRectangle2D=function(t,e,r){return f.fromRectangleWithHeights2D(t,e,0,0,r)},f.fromRectangleWithHeights2D=function(e,r,o,i,u){if(a(u)||(u=new f),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;r=n(r,M),l.southwest(e,y),y.height=o,l.northeast(e,F),F.height=i;var s=r.project(y,O),E=r.project(F,g),c=E.x-s.x,_=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(c*c+_*_+R*R);var T=u.center;return T.x=s.x+.5*c,T.y=s.y+.5*_,T.z=s.z+.5*R,u};var L=[];f.fromRectangle3D=function(t,e,r,i){e=n(e,o.WGS84),r=n(r,0);var u;return a(t)&&(u=l.subsample(t,e,r,L)),f.fromPoints(u,i)},f.fromVertices=function(e,r,o,i){if(a(i)||(i=new f),!a(e)||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;r=n(r,t.ZERO),o=n(o,3);var u=S;u.x=e[0]+r.x,u.y=e[1]+r.y,u.z=e[2]+r.z;for(var s=t.clone(u,_),E=t.clone(u,R),c=t.clone(u,T),l=t.clone(u,h),M=t.clone(u,A),O=t.clone(u,d),g=e.length,y=0;y<g;y+=o){var F=e[y]+r.x,L=e[y+1]+r.y,v=e[y+2]+r.z;u.x=F,u.y=L,u.z=v,F<s.x&&t.clone(u,s),F>l.x&&t.clone(u,l),L<E.y&&t.clone(u,E),L>M.y&&t.clone(u,M),v<c.z&&t.clone(u,c),v>O.z&&t.clone(u,O)}var U=t.magnitudeSquared(t.subtract(l,s,m)),D=t.magnitudeSquared(t.subtract(M,E,m)),P=t.magnitudeSquared(t.subtract(O,c,m)),w=s,B=l,x=U;D>x&&(x=D,w=E,B=M),P>x&&(x=P,w=c,B=O);var G=N;G.x=.5*(w.x+B.x),G.y=.5*(w.y+B.y),G.z=.5*(w.z+B.z);var b=t.magnitudeSquared(t.subtract(B,G,m)),z=Math.sqrt(b),H=C;H.x=s.x,H.y=E.y,H.z=c.z;var V=I;V.x=l.x,V.y=M.y,V.z=O.z;var X=t.multiplyByScalar(t.add(H,V,m),.5,p),q=0;for(y=0;y<g;y+=o){u.x=e[y]+r.x,u.y=e[y+1]+r.y,u.z=e[y+2]+r.z;var W=t.magnitude(t.subtract(u,X,m));W>q&&(q=W);var Y=t.magnitudeSquared(t.subtract(u,G,m));if(Y>b){var K=Math.sqrt(Y);z=.5*(z+K),b=z*z;var k=K-z;G.x=(z*G.x+k*u.x)/K,G.y=(z*G.y+k*u.y)/K,G.z=(z*G.z+k*u.z)/K}}return z<q?(t.clone(G,i.center),i.radius=z):(t.clone(X,i.center),i.radius=q),i},f.fromEncodedCartesianVertices=function(e,r,n){if(a(n)||(n=new f),!a(e)||!a(r)||e.length!==r.length||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var o=S;o.x=e[0]+r[0],o.y=e[1]+r[1],o.z=e[2]+r[2];for(var i=t.clone(o,_),u=t.clone(o,R),s=t.clone(o,T),E=t.clone(o,h),c=t.clone(o,A),l=t.clone(o,d),M=e.length,O=0;O<M;O+=3){var g=e[O]+r[O],y=e[O+1]+r[O+1],F=e[O+2]+r[O+2];o.x=g,o.y=y,o.z=F,g<i.x&&t.clone(o,i),g>E.x&&t.clone(o,E),y<u.y&&t.clone(o,u),y>c.y&&t.clone(o,c),F<s.z&&t.clone(o,s),F>l.z&&t.clone(o,l)}var L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(c,u,m)),U=t.magnitudeSquared(t.subtract(l,s,m)),D=i,P=E,w=L;v>w&&(w=v,D=u,P=c),U>w&&(w=U,D=s,P=l);var B=N;B.x=.5*(D.x+P.x),B.y=.5*(D.y+P.y),B.z=.5*(D.z+P.z);var x=t.magnitudeSquared(t.subtract(P,B,m)),G=Math.sqrt(x),b=C;b.x=i.x,b.y=u.y,b.z=s.z;var z=I;z.x=E.x,z.y=c.y,z.z=l.z;var H=t.multiplyByScalar(t.add(b,z,m),.5,p),V=0;for(O=0;O<M;O+=3){o.x=e[O]+r[O],o.y=e[O+1]+r[O+1],o.z=e[O+2]+r[O+2];var X=t.magnitude(t.subtract(o,H,m));X>V&&(V=X);var q=t.magnitudeSquared(t.subtract(o,B,m));if(q>x){var W=Math.sqrt(q);G=.5*(G+W),x=G*G;var Y=W-G;B.x=(G*B.x+Y*o.x)/W,B.y=(G*B.y+Y*o.y)/W,B.z=(G*B.z+Y*o.z)/W}}return G<V?(t.clone(B,n.center),n.radius=G):(t.clone(H,n.center),n.radius=V),n},f.fromCornerPoints=function(e,r,n){a(n)||(n=new f);var o=n.center;return t.add(e,r,o),t.multiplyByScalar(o,.5,o),n.radius=t.distance(o,r),n},f.fromEllipsoid=function(e,r){return a(r)||(r=new f),t.clone(t.ZERO,r.center),r.radius=e.maximumRadius,r};var v=new t;f.fromBoundingSpheres=function(e,r){if(a(r)||(r=new f),!a(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var n=e.length;if(1===n)return f.clone(e[0],r);if(2===n)return f.union(e[0],e[1],r);for(var o=[],i=0;i<n;i++)o.push(e[i].center);r=f.fromPoints(o,r);var u=r.center,s=r.radius;for(i=0;i<n;i++){var E=e[i];s=Math.max(s,t.distance(u,E.center,v)+E.radius)}return r.radius=s,r};var U=new t,D=new t,P=new t;f.fromOrientedBoundingBox=function(e,r){a(r)||(r=new f);var n=e.halfAxes,o=E.getColumn(n,0,U),i=E.getColumn(n,1,D),u=E.getColumn(n,2,P);return t.add(o,i,o),t.add(o,u,o),r.center=t.clone(e.center,r.center),r.radius=t.magnitude(o),r},f.clone=function(e,r){if(a(e))return a(r)?(r.center=t.clone(e.center,r.center),r.radius=e.radius,r):new f(e.center,e.radius)},f.packedLength=4,f.pack=function(t,e,r){r=n(r,0);var a=t.center;return e[r++]=a.x,e[r++]=a.y,e[r++]=a.z,e[r]=t.radius,e},f.unpack=function(t,e,r){e=n(e,0),a(r)||(r=new f);var o=r.center;return o.x=t[e++],o.y=t[e++],o.z=t[e++],r.radius=t[e],r};var w=new t,B=new t;f.union=function(e,r,n){a(n)||(n=new f);var o=e.center,i=e.radius,u=r.center,s=r.radius,E=t.subtract(u,o,w),c=t.magnitude(E);if(i>=c+s)return e.clone(n),n;if(s>=c+i)return r.clone(n),n;var l=.5*(i+c+s),_=t.multiplyByScalar(E,(-i+l)/c,B);return t.add(_,o,_),t.clone(_,n.center),n.radius=l,n};var x=new t;f.expand=function(e,r,n){n=f.clone(e,n);var a=t.magnitude(t.subtract(r,n.center,x));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(e,r){var n=e.center,a=e.radius,o=r.normal,i=t.dot(o,n)+r.distance;return i<-a?u.OUTSIDE:i<a?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,r){return a(r)||(r=new f),r.center=c.multiplyByPoint(e,t.center,r.center),r.radius=c.getMaximumScale(e)*t.radius,r};var G=new t;f.distanceSquaredTo=function(e,r){var n=t.subtract(e.center,r,G);return t.magnitudeSquared(n)-e.radius*e.radius},f.transformWithoutScale=function(t,e,r){return a(r)||(r=new f),r.center=c.multiplyByPoint(e,t.center,r.center),r.radius=t.radius,r};var b=new t;f.computePlaneDistances=function(e,r,n,o){a(o)||(o=new s);var i=t.subtract(e.center,r,b),u=t.dot(n,i);return o.start=u-e.radius,o.stop=u+e.radius,o};for(var z=new t,H=new t,V=new t,X=new t,q=new t,W=new e,Y=new Array(8),K=0;K<8;++K)Y[K]=new t;var k=new i;return f.projectTo2D=function(e,r,a){r=n(r,k);var o=r.ellipsoid,i=e.center,u=e.radius,s=o.geodeticSurfaceNormal(i,z),E=t.cross(t.UNIT_Z,s,H);t.normalize(E,E);var c=t.cross(s,E,V);t.normalize(c,c),t.multiplyByScalar(s,u,s),t.multiplyByScalar(c,u,c),t.multiplyByScalar(E,u,E);var l=t.negate(c,q),_=t.negate(E,X),R=Y,T=R[0];t.add(s,c,T),t.add(T,E,T),T=R[1],t.add(s,c,T),t.add(T,_,T),T=R[2],t.add(s,l,T),t.add(T,_,T),T=R[3],t.add(s,l,T),t.add(T,E,T),t.negate(s,s),T=R[4],t.add(s,c,T),t.add(T,E,T),T=R[5],t.add(s,c,T),t.add(T,_,T),T=R[6],t.add(s,l,T),t.add(T,_,T),T=R[7],t.add(s,l,T),t.add(T,E,T);for(var h=R.length,A=0;A<h;++A){var d=R[A];t.add(i,d,d);var S=o.cartesianToCartographic(d,W);r.project(S,d)}a=f.fromPoints(R,a),i=a.center;var m=i.x,N=i.y,C=i.z;return i.x=C,i.y=m,i.z=N,a},f.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},f.equals=function(e,r){return e===r||a(e)&&a(r)&&t.equals(e.center,r.center)&&e.radius===r.radius},f.prototype.intersectPlane=function(t){return f.intersectPlane(this,t)},f.prototype.distanceSquaredTo=function(t){return f.distanceSquaredTo(this,t)},f.prototype.computePlaneDistances=function(t,e,r){return f.computePlaneDistances(this,t,e,r)},f.prototype.isOccluded=function(t){return f.isOccluded(this,t)},f.prototype.equals=function(t){return f.equals(this,t)},f.prototype.clone=function(t){return f.clone(this,t)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(r))return r;r=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,o=["webkit","moz","o","ms","khtml"],i=0,u=o.length;i<u;++i){var s=o[i];a=s+"RequestFullscreen","function"==typeof e[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof e[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[n.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,r){"use strict";function n(t){for(var e=t.split("."),r=0,n=e.length;r<n;++r)e[r]=parseInt(e[r],10);return e}function a(){if(!e(N)&&(N=!1,!f())){var t=/ Chrome\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(N=!0,C=n(t[1]))}return N}function o(){return a()&&C}function i(){if(!e(I)&&(I=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(m.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(I=!0,p=n(t[1]))}return I}function u(){return i()&&p}function s(){if(!e(M)){M=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(m.userAgent);null!==t&&(M=!0,O=n(t[1]),O.isNightly=!!t[2])}return M}function E(){return s()&&O}function c(){if(!e(g)){g=!1;var t;"Microsoft Internet Explorer"===m.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent), +null!==t&&(g=!0,y=n(t[1]))):"Netscape"===m.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1])))}return g}function l(){return c()&&y}function f(){if(!e(F)){F=!1;var t=/ Edge\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(F=!0,L=n(t[1]))}return F}function _(){return f()&&L}function R(){if(!e(v)){v=!1;var t=/Firefox\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(v=!0,U=n(t[1]))}return v}function T(){return e(D)||(D=/Windows/i.test(m.appVersion)),D}function h(){return R()&&U}function A(){return e(P)||(P="undefined"!=typeof PointerEvent&&(!e(m.pointerEnabled)||m.pointerEnabled)),P}function d(){if(!e(B)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=t.style.imageRendering;B=e(r)&&""!==r,B&&(w=r)}return B}function S(){return d()?w:void 0}var m;m="undefined"!=typeof navigator?navigator:{};var N,C,I,p,M,O,g,y,F,L,v,U,D,P,w,B,x={isChrome:a,chromeVersion:o,isSafari:i,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:l,isEdge:f,edgeVersion:_,isFirefox:R,firefoxVersion:h,isWindows:T,hardwareConcurrency:t(m.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:S};return x.supportsFullscreen=function(){return r.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(e,r,n,a){this.red=t(e,1),this.green=t(r,1),this.blue=t(n,1),this.alpha=t(a,1)}u.fromCartesian4=function(t,r){return e(r)?(r.red=t.x,r.green=t.y,r.blue=t.z,r.alpha=t.w,r):new u(t.x,t.y,t.z,t.w)},u.fromBytes=function(r,n,a,o,i){return r=u.byteToFloat(t(r,255)),n=u.byteToFloat(t(n,255)),a=u.byteToFloat(t(a,255)),o=u.byteToFloat(t(o,255)),e(i)?(i.red=r,i.green=n,i.blue=a,i.alpha=o,i):new u(r,n,a,o)},u.fromAlpha=function(t,r,n){return e(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=r,n):new u(t.red,t.green,t.blue,r)};var s,E,c;n.supportsTypedArrays()&&(s=new ArrayBuffer(4),E=new Uint32Array(s),c=new Uint8Array(s)),u.fromRgba=function(t,e){return E[0]=t,u.fromBytes(c[0],c[1],c[2],c[3],e)},u.fromHsl=function(r,n,a,o,s){r=t(r,0)%1,n=t(n,0),a=t(a,0),o=t(o,1);var E=a,c=a,l=a;if(0!==n){var f;f=a<.5?a*(1+n):a+n-a*n;var _=2*a-f;E=i(_,f,r+1/3),c=i(_,f,r),l=i(_,f,r-1/3)}return e(s)?(s.red=E,s.green=c,s.blue=l,s.alpha=o,s):new u(E,c,l,o)},u.fromRandom=function(r,n){r=t(r,t.EMPTY_OBJECT);var a=r.red;if(!e(a)){var i=t(r.minimumRed,0),s=t(r.maximumRed,1);a=i+o.nextRandomNumber()*(s-i)}var E=r.green;if(!e(E)){var c=t(r.minimumGreen,0),l=t(r.maximumGreen,1);E=c+o.nextRandomNumber()*(l-c)}var f=r.blue;if(!e(f)){var _=t(r.minimumBlue,0),R=t(r.maximumBlue,1);f=_+o.nextRandomNumber()*(R-_)}var T=r.alpha;if(!e(T)){var h=t(r.minimumAlpha,0),A=t(r.maximumAlpha,1);T=h+o.nextRandomNumber()*(A-h)}return e(n)?(n.red=a,n.green=E,n.blue=f,n.alpha=T,n):new u(a,E,f,T)};var l=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,f=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,_=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return u.fromCssColorString=function(r,n){e(n)||(n=new u);var a=u[r.toUpperCase()];if(e(a))return u.clone(a,n),n;var o=l.exec(r);return null!==o?(n.red=parseInt(o[1],16)/15,n.green=parseInt(o[2],16)/15,n.blue=parseInt(o[3],16)/15,n.alpha=1,n):(o=f.exec(r),null!==o?(n.red=parseInt(o[1],16)/255,n.green=parseInt(o[2],16)/255,n.blue=parseInt(o[3],16)/255,n.alpha=1,n):(o=_.exec(r),null!==o?(n.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),n.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),n.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),n.alpha=parseFloat(t(o[4],"1.0")),n):(o=R.exec(r),null!==o?u.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0")),n):n=void 0)))},u.packedLength=4,u.pack=function(e,r,n){return n=t(n,0),r[n++]=e.red,r[n++]=e.green,r[n++]=e.blue,r[n]=e.alpha,r},u.unpack=function(r,n,a){return n=t(n,0),e(a)||(a=new u),a.red=r[n++],a.green=r[n++],a.blue=r[n++],a.alpha=r[n],a},u.byteToFloat=function(t){return t/255},u.floatToByte=function(t){return 1===t?255:256*t|0},u.clone=function(t,r){if(e(t))return e(r)?(r.red=t.red,r.green=t.green,r.blue=t.blue,r.alpha=t.alpha,r):new u(t.red,t.green,t.blue,t.alpha)},u.equals=function(t,r){return t===r||e(t)&&e(r)&&t.red===r.red&&t.green===r.green&&t.blue===r.blue&&t.alpha===r.alpha},u.equalsArray=function(t,e,r){return t.red===e[r]&&t.green===e[r+1]&&t.blue===e[r+2]&&t.alpha===e[r+3]},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,r){return this===t||e(t)&&Math.abs(this.red-t.red)<=r&&Math.abs(this.green-t.green)<=r&&Math.abs(this.blue-t.blue)<=r&&Math.abs(this.alpha-t.alpha)<=r},u.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},u.prototype.toCssColorString=function(){var t=u.floatToByte(this.red),e=u.floatToByte(this.green),r=u.floatToByte(this.blue);return 1===this.alpha?"rgb("+t+","+e+","+r+")":"rgba("+t+","+e+","+r+","+this.alpha+")"},u.prototype.toBytes=function(t){var r=u.floatToByte(this.red),n=u.floatToByte(this.green),a=u.floatToByte(this.blue),o=u.floatToByte(this.alpha);return e(t)?(t[0]=r,t[1]=n,t[2]=a,t[3]=o,t):[r,n,a,o]},u.prototype.toRgba=function(){return c[0]=u.floatToByte(this.red),c[1]=u.floatToByte(this.green),c[2]=u.floatToByte(this.blue),c[3]=u.floatToByte(this.alpha),E[0]},u.prototype.brighten=function(t,e){return t=1-t,e.red=1-(1-this.red)*t,e.green=1-(1-this.green)*t,e.blue=1-(1-this.blue)*t,e.alpha=this.alpha,e},u.prototype.darken=function(t,e){return t=1-t,e.red=this.red*t,e.green=this.green*t,e.blue=this.blue*t,e.alpha=this.alpha,e},u.prototype.withAlpha=function(t,e){return u.fromAlpha(this,t,e)},u.add=function(t,e,r){return r.red=t.red+e.red,r.green=t.green+e.green,r.blue=t.blue+e.blue,r.alpha=t.alpha+e.alpha,r},u.subtract=function(t,e,r){return r.red=t.red-e.red,r.green=t.green-e.green,r.blue=t.blue-e.blue,r.alpha=t.alpha-e.alpha,r},u.multiply=function(t,e,r){return r.red=t.red*e.red,r.green=t.green*e.green,r.blue=t.blue*e.blue,r.alpha=t.alpha*e.alpha,r},u.divide=function(t,e,r){return r.red=t.red/e.red,r.green=t.green/e.green,r.blue=t.blue/e.blue,r.alpha=t.alpha/e.alpha,r},u.mod=function(t,e,r){return r.red=t.red%e.red,r.green=t.green%e.green,r.blue=t.blue%e.blue,r.alpha=t.alpha%e.alpha,r},u.multiplyByScalar=function(t,e,r){return r.red=t.red*e,r.green=t.green*e,r.blue=t.blue*e,r.alpha=t.alpha*e,r},u.divideByScalar=function(t,e,r){return r.red=t.red/e,r.green=t.green/e,r.blue=t.blue/e,r.alpha=t.alpha/e,r},u.ALICEBLUE=a(u.fromCssColorString("#F0F8FF")),u.ANTIQUEWHITE=a(u.fromCssColorString("#FAEBD7")),u.AQUA=a(u.fromCssColorString("#00FFFF")),u.AQUAMARINE=a(u.fromCssColorString("#7FFFD4")),u.AZURE=a(u.fromCssColorString("#F0FFFF")),u.BEIGE=a(u.fromCssColorString("#F5F5DC")),u.BISQUE=a(u.fromCssColorString("#FFE4C4")),u.BLACK=a(u.fromCssColorString("#000000")),u.BLANCHEDALMOND=a(u.fromCssColorString("#FFEBCD")),u.BLUE=a(u.fromCssColorString("#0000FF")),u.BLUEVIOLET=a(u.fromCssColorString("#8A2BE2")),u.BROWN=a(u.fromCssColorString("#A52A2A")),u.BURLYWOOD=a(u.fromCssColorString("#DEB887")),u.CADETBLUE=a(u.fromCssColorString("#5F9EA0")),u.CHARTREUSE=a(u.fromCssColorString("#7FFF00")),u.CHOCOLATE=a(u.fromCssColorString("#D2691E")),u.CORAL=a(u.fromCssColorString("#FF7F50")),u.CORNFLOWERBLUE=a(u.fromCssColorString("#6495ED")),u.CORNSILK=a(u.fromCssColorString("#FFF8DC")),u.CRIMSON=a(u.fromCssColorString("#DC143C")),u.CYAN=a(u.fromCssColorString("#00FFFF")),u.DARKBLUE=a(u.fromCssColorString("#00008B")),u.DARKCYAN=a(u.fromCssColorString("#008B8B")),u.DARKGOLDENROD=a(u.fromCssColorString("#B8860B")),u.DARKGRAY=a(u.fromCssColorString("#A9A9A9")),u.DARKGREEN=a(u.fromCssColorString("#006400")),u.DARKGREY=u.DARKGRAY,u.DARKKHAKI=a(u.fromCssColorString("#BDB76B")),u.DARKMAGENTA=a(u.fromCssColorString("#8B008B")),u.DARKOLIVEGREEN=a(u.fromCssColorString("#556B2F")),u.DARKORANGE=a(u.fromCssColorString("#FF8C00")),u.DARKORCHID=a(u.fromCssColorString("#9932CC")),u.DARKRED=a(u.fromCssColorString("#8B0000")),u.DARKSALMON=a(u.fromCssColorString("#E9967A")),u.DARKSEAGREEN=a(u.fromCssColorString("#8FBC8F")),u.DARKSLATEBLUE=a(u.fromCssColorString("#483D8B")),u.DARKSLATEGRAY=a(u.fromCssColorString("#2F4F4F")),u.DARKSLATEGREY=u.DARKSLATEGRAY,u.DARKTURQUOISE=a(u.fromCssColorString("#00CED1")),u.DARKVIOLET=a(u.fromCssColorString("#9400D3")),u.DEEPPINK=a(u.fromCssColorString("#FF1493")),u.DEEPSKYBLUE=a(u.fromCssColorString("#00BFFF")),u.DIMGRAY=a(u.fromCssColorString("#696969")),u.DIMGREY=u.DIMGRAY,u.DODGERBLUE=a(u.fromCssColorString("#1E90FF")),u.FIREBRICK=a(u.fromCssColorString("#B22222")),u.FLORALWHITE=a(u.fromCssColorString("#FFFAF0")),u.FORESTGREEN=a(u.fromCssColorString("#228B22")),u.FUCHSIA=a(u.fromCssColorString("#FF00FF")),u.GAINSBORO=a(u.fromCssColorString("#DCDCDC")),u.GHOSTWHITE=a(u.fromCssColorString("#F8F8FF")),u.GOLD=a(u.fromCssColorString("#FFD700")),u.GOLDENROD=a(u.fromCssColorString("#DAA520")),u.GRAY=a(u.fromCssColorString("#808080")),u.GREEN=a(u.fromCssColorString("#008000")),u.GREENYELLOW=a(u.fromCssColorString("#ADFF2F")),u.GREY=u.GRAY,u.HONEYDEW=a(u.fromCssColorString("#F0FFF0")),u.HOTPINK=a(u.fromCssColorString("#FF69B4")),u.INDIANRED=a(u.fromCssColorString("#CD5C5C")),u.INDIGO=a(u.fromCssColorString("#4B0082")),u.IVORY=a(u.fromCssColorString("#FFFFF0")),u.KHAKI=a(u.fromCssColorString("#F0E68C")),u.LAVENDER=a(u.fromCssColorString("#E6E6FA")),u.LAVENDAR_BLUSH=a(u.fromCssColorString("#FFF0F5")),u.LAWNGREEN=a(u.fromCssColorString("#7CFC00")),u.LEMONCHIFFON=a(u.fromCssColorString("#FFFACD")),u.LIGHTBLUE=a(u.fromCssColorString("#ADD8E6")),u.LIGHTCORAL=a(u.fromCssColorString("#F08080")),u.LIGHTCYAN=a(u.fromCssColorString("#E0FFFF")),u.LIGHTGOLDENRODYELLOW=a(u.fromCssColorString("#FAFAD2")),u.LIGHTGRAY=a(u.fromCssColorString("#D3D3D3")),u.LIGHTGREEN=a(u.fromCssColorString("#90EE90")),u.LIGHTGREY=u.LIGHTGRAY,u.LIGHTPINK=a(u.fromCssColorString("#FFB6C1")),u.LIGHTSEAGREEN=a(u.fromCssColorString("#20B2AA")),u.LIGHTSKYBLUE=a(u.fromCssColorString("#87CEFA")),u.LIGHTSLATEGRAY=a(u.fromCssColorString("#778899")),u.LIGHTSLATEGREY=u.LIGHTSLATEGRAY,u.LIGHTSTEELBLUE=a(u.fromCssColorString("#B0C4DE")),u.LIGHTYELLOW=a(u.fromCssColorString("#FFFFE0")),u.LIME=a(u.fromCssColorString("#00FF00")),u.LIMEGREEN=a(u.fromCssColorString("#32CD32")),u.LINEN=a(u.fromCssColorString("#FAF0E6")),u.MAGENTA=a(u.fromCssColorString("#FF00FF")),u.MAROON=a(u.fromCssColorString("#800000")),u.MEDIUMAQUAMARINE=a(u.fromCssColorString("#66CDAA")),u.MEDIUMBLUE=a(u.fromCssColorString("#0000CD")),u.MEDIUMORCHID=a(u.fromCssColorString("#BA55D3")),u.MEDIUMPURPLE=a(u.fromCssColorString("#9370DB")),u.MEDIUMSEAGREEN=a(u.fromCssColorString("#3CB371")),u.MEDIUMSLATEBLUE=a(u.fromCssColorString("#7B68EE")),u.MEDIUMSPRINGGREEN=a(u.fromCssColorString("#00FA9A")),u.MEDIUMTURQUOISE=a(u.fromCssColorString("#48D1CC")),u.MEDIUMVIOLETRED=a(u.fromCssColorString("#C71585")),u.MIDNIGHTBLUE=a(u.fromCssColorString("#191970")),u.MINTCREAM=a(u.fromCssColorString("#F5FFFA")),u.MISTYROSE=a(u.fromCssColorString("#FFE4E1")),u.MOCCASIN=a(u.fromCssColorString("#FFE4B5")),u.NAVAJOWHITE=a(u.fromCssColorString("#FFDEAD")),u.NAVY=a(u.fromCssColorString("#000080")),u.OLDLACE=a(u.fromCssColorString("#FDF5E6")),u.OLIVE=a(u.fromCssColorString("#808000")),u.OLIVEDRAB=a(u.fromCssColorString("#6B8E23")),u.ORANGE=a(u.fromCssColorString("#FFA500")),u.ORANGERED=a(u.fromCssColorString("#FF4500")),u.ORCHID=a(u.fromCssColorString("#DA70D6")),u.PALEGOLDENROD=a(u.fromCssColorString("#EEE8AA")),u.PALEGREEN=a(u.fromCssColorString("#98FB98")),u.PALETURQUOISE=a(u.fromCssColorString("#AFEEEE")),u.PALEVIOLETRED=a(u.fromCssColorString("#DB7093")),u.PAPAYAWHIP=a(u.fromCssColorString("#FFEFD5")),u.PEACHPUFF=a(u.fromCssColorString("#FFDAB9")),u.PERU=a(u.fromCssColorString("#CD853F")),u.PINK=a(u.fromCssColorString("#FFC0CB")),u.PLUM=a(u.fromCssColorString("#DDA0DD")),u.POWDERBLUE=a(u.fromCssColorString("#B0E0E6")),u.PURPLE=a(u.fromCssColorString("#800080")),u.RED=a(u.fromCssColorString("#FF0000")),u.ROSYBROWN=a(u.fromCssColorString("#BC8F8F")),u.ROYALBLUE=a(u.fromCssColorString("#4169E1")),u.SADDLEBROWN=a(u.fromCssColorString("#8B4513")),u.SALMON=a(u.fromCssColorString("#FA8072")),u.SANDYBROWN=a(u.fromCssColorString("#F4A460")),u.SEAGREEN=a(u.fromCssColorString("#2E8B57")),u.SEASHELL=a(u.fromCssColorString("#FFF5EE")),u.SIENNA=a(u.fromCssColorString("#A0522D")),u.SILVER=a(u.fromCssColorString("#C0C0C0")),u.SKYBLUE=a(u.fromCssColorString("#87CEEB")),u.SLATEBLUE=a(u.fromCssColorString("#6A5ACD")),u.SLATEGRAY=a(u.fromCssColorString("#708090")),u.SLATEGREY=u.SLATEGRAY,u.SNOW=a(u.fromCssColorString("#FFFAFA")),u.SPRINGGREEN=a(u.fromCssColorString("#00FF7F")),u.STEELBLUE=a(u.fromCssColorString("#4682B4")),u.TAN=a(u.fromCssColorString("#D2B48C")),u.TEAL=a(u.fromCssColorString("#008080")),u.THISTLE=a(u.fromCssColorString("#D8BFD8")),u.TOMATO=a(u.fromCssColorString("#FF6347")),u.TURQUOISE=a(u.fromCssColorString("#40E0D0")),u.VIOLET=a(u.fromCssColorString("#EE82EE")),u.WHEAT=a(u.fromCssColorString("#F5DEB3")),u.WHITE=a(u.fromCssColorString("#FFFFFF")),u.WHITESMOKE=a(u.fromCssColorString("#F5F5F5")),u.YELLOW=a(u.fromCssColorString("#FFFF00")),u.YELLOWGREEN=a(u.fromCssColorString("#9ACD32")),u.TRANSPARENT=a(new u(0,0,0,0)),u}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,r,n,a,o){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return i.getSizeInBytes=function(t){switch(t){case i.BYTE:return Int8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.SHORT:return Int16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.INT:return Int32Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case i.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},i.fromTypedArray=function(t){return t instanceof Int8Array?i.BYTE:t instanceof Uint8Array?i.UNSIGNED_BYTE:t instanceof Int16Array?i.SHORT:t instanceof Uint16Array?i.UNSIGNED_SHORT:t instanceof Int32Array?i.INT:t instanceof Uint32Array?i.UNSIGNED_INT:t instanceof Float32Array?i.FLOAT:t instanceof Float64Array?i.DOUBLE:void 0},i.validate=function(t){return e(t)&&(t===i.BYTE||t===i.UNSIGNED_BYTE||t===i.SHORT||t===i.UNSIGNED_SHORT||t===i.INT||t===i.UNSIGNED_INT||t===i.FLOAT||t===i.DOUBLE)},i.createTypedArray=function(t,e){switch(t){case i.BYTE:return new Int8Array(e);case i.UNSIGNED_BYTE:return new Uint8Array(e);case i.SHORT:return new Int16Array(e);case i.UNSIGNED_SHORT:return new Uint16Array(e);case i.INT:return new Int32Array(e);case i.UNSIGNED_INT:return new Uint32Array(e);case i.FLOAT:return new Float32Array(e);case i.DOUBLE:return new Float64Array(e)}},i.createArrayBufferView=function(e,r,n,a){switch(n=t(n,0),a=t(a,(r.byteLength-n)/i.getSizeInBytes(e)),e){case i.BYTE:return new Int8Array(r,n,a);case i.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case i.SHORT:return new Int16Array(r,n,a);case i.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case i.INT:return new Int32Array(r,n,a);case i.UNSIGNED_INT:return new Uint32Array(r,n,a);case i.FLOAT:return new Float32Array(r,n,a);case i.DOUBLE:return new Float64Array(r,n,a)}},i.fromName=function(t){switch(t){case"BYTE":return i.BYTE;case"UNSIGNED_BYTE":return i.UNSIGNED_BYTE;case"SHORT":return i.SHORT;case"UNSIGNED_SHORT":return i.UNSIGNED_SHORT;case"INT":return i.INT;case"UNSIGNED_INT":return i.UNSIGNED_INT;case"FLOAT":return i.FLOAT;case"DOUBLE":return i.DOUBLE}},a(i)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var r={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN}};return t(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,r,n,a){"use strict";function o(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,n.NONE),this.boundingSphereCV=e.boundingSphereCV}return o.computeNumberOfVertices=function(t){var r=-1;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&e(t.attributes[n])&&e(t.attributes[n].values)){var a=t.attributes[n],o=a.values.length/a.componentsPerAttribute;r=o}return r},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,r){"use strict";function n(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,r,n,a){"use strict";var o={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return o.getSizeInBytes=function(t){switch(t){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(e){return t(e)&&(e===o.UNSIGNED_BYTE||e===o.UNSIGNED_SHORT||e===o.UNSIGNED_INT)},o.createTypedArray=function(t,e){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e); +},o.createTypedArrayFromArrayBuffer=function(t,e,r,a){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,r,a):new Uint16Array(e,r,a)},r(o)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t){var e=t._uSquared,r=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,a=(r-n)/r,o=Math.cos(t._startHeading),i=Math.sin(t._startHeading),u=(1-a)*Math.tan(t._start.latitude),s=1/Math.sqrt(1+u*u),E=s*u,c=Math.atan2(u,o),l=s*i,f=l*l,_=1-f,R=Math.sqrt(_),T=e/4,h=T*T,A=h*T,d=h*h,S=1+T-3*h/4+5*A/4-175*d/64,m=1-T+15*h/8-35*A/8,N=1-3*T+35*h/4,C=1-5*T,I=S*c-m*Math.sin(2*c)*T/2-N*Math.sin(4*c)*h/16-C*Math.sin(6*c)*A/48-5*Math.sin(8*c)*d/512,p=t._constants;p.a=r,p.b=n,p.f=a,p.cosineHeading=o,p.sineHeading=i,p.tanU=u,p.cosineU=s,p.sineU=E,p.sigma=c,p.sineAlpha=l,p.sineSquaredAlpha=f,p.cosineSquaredAlpha=_,p.cosineAlpha=R,p.u2Over4=T,p.u4Over16=h,p.u6Over64=A,p.u8Over256=d,p.a0=S,p.a1=m,p.a2=N,p.a3=C,p.distanceRatio=I}function E(t,e){return t*e*(4+t*(4-3*e))/16}function c(t,e,r,n,a,o,i){var u=E(t,r);return(1-u)*t*e*(n+u*a*(i+u*o*(2*i*i-1)))}function l(t,e,r,n,a,o,i){var s,E,l,f,_,R=(e-r)/e,T=o-n,h=Math.atan((1-R)*Math.tan(a)),A=Math.atan((1-R)*Math.tan(i)),d=Math.cos(h),S=Math.sin(h),m=Math.cos(A),N=Math.sin(A),C=d*m,I=d*N,p=S*N,M=S*m,O=T,g=u.TWO_PI,y=Math.cos(O),F=Math.sin(O);do{y=Math.cos(O),F=Math.sin(O);var L=I-M*y;l=Math.sqrt(m*m*F*F+L*L),E=p+C*y,s=Math.atan2(l,E);var v;0===l?(v=0,f=1):(v=C*F/l,f=1-v*v),g=O,_=E-2*p/f,isNaN(_)&&(_=0),O=T+c(R,v,f,s,l,E,_)}while(Math.abs(O-g)>u.EPSILON12);var U=f*(e*e-r*r)/(r*r),D=1+U*(4096+U*(U*(320-175*U)-768))/16384,P=U*(256+U*(U*(74-47*U)-128))/1024,w=_*_,B=P*l*(_+P*(E*(2*w-1)-P*_*(4*l*l-3)*(4*w-3)/6)/4),x=r*D*(s-B),G=Math.atan2(m*F,I-M*y),b=Math.atan2(d*F,I*y-M);t._distance=x,t._startHeading=G,t._endHeading=b,t._uSquared=U}function f(r,n,a,o){t.normalize(o.cartographicToCartesian(n,T),R),t.normalize(o.cartographicToCartesian(a,T),T);l(r,o.maximumRadius,o.minimumRadius,n.longitude,n.latitude,a.longitude,a.latitude),r._start=e.clone(n,r._start),r._end=e.clone(a,r._end),r._start.height=0,r._end.height=0,s(r)}function _(t,a,o){var u=r(o,i.WGS84);this._ellipsoid=u,this._start=new e,this._end=new e,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n(t)&&n(a)&&f(this,t,a,u)}var R=new t,T=new t;return a(_.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}}}),_.prototype.setEndPoints=function(t,e){f(this,t,e,this._ellipsoid)},_.prototype.interpolateUsingFraction=function(t,e){return this.interpolateUsingSurfaceDistance(this._distance*t,e)},_.prototype.interpolateUsingSurfaceDistance=function(t,r){var a=this._constants,o=a.distanceRatio+t/a.b,i=Math.cos(2*o),u=Math.cos(4*o),s=Math.cos(6*o),E=Math.sin(2*o),l=Math.sin(4*o),f=Math.sin(6*o),_=Math.sin(8*o),R=o*o,T=o*R,h=a.u8Over256,A=a.u2Over4,d=a.u6Over64,S=a.u4Over16,m=2*T*h*i/3+o*(1-A+7*S/4-15*d/4+579*h/64-(S-15*d/4+187*h/16)*i-(5*d/4-115*h/16)*u-29*h*s/16)+(A/2-S+71*d/32-85*h/16)*E+(5*S/16-5*d/4+383*h/96)*l-R*((d-11*h/2)*E+5*h*l/2)+(29*d/96-29*h/16)*f+539*h*_/1536,N=Math.asin(Math.sin(m)*a.cosineAlpha),C=Math.atan(a.a/a.b*Math.tan(N));m-=a.sigma;var I=Math.cos(2*a.sigma+m),p=Math.sin(m),M=Math.cos(m),O=a.cosineU*M,g=a.sineU*p,y=Math.atan2(p*a.sineHeading,O-g*a.cosineHeading),F=y-c(a.f,a.sineAlpha,a.cosineSquaredAlpha,m,p,M,I);return n(r)?(r.longitude=this._start.longitude+F,r.latitude=C,r.height=0,r):new e(this._start.longitude+F,C,0)},_}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(t,e){"use strict";function r(t,r,n){var a=t+r;return e.sign(t)!==e.sign(r)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(t,e,r){var n=e*e-4*t*r;return n},n.computeRealRoots=function(t,n,a){var o;if(0===t)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var i=Math.abs(a),u=Math.abs(t);if(i<u&&i/u<e.EPSILON14)return[0,0];if(i>u&&u/i<e.EPSILON14)return[];if(o=-a/t,o<0)return[];var s=Math.sqrt(o);return[-s,s]}if(0===a)return o=-n/t,o<0?[o,0]:[0,o];var E=n*n,c=4*t*a,l=r(E,-c,e.EPSILON14);if(l<0)return[];var f=-.5*r(n,e.sign(n)*Math.sqrt(l),e.EPSILON14);return n>0?[f/t,a/f]:[a/f,f/t]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(t,e){"use strict";function r(t,e,r,n){var a,o,i=t,u=e/3,s=r/3,E=n,c=i*s,l=u*E,f=u*u,_=s*s,R=i*s-f,T=i*E-u*s,h=u*E-_,A=4*R*h-T*T;if(A<0){var d,S,m;f*l>=c*_?(d=i,S=R,m=-2*u*R+i*T):(d=E,S=h,m=-E*T+2*s*h);var N=m<0?-1:1,C=-N*Math.abs(d)*Math.sqrt(-A);o=-m+C;var I=o/2,p=I<0?-Math.pow(-I,1/3):Math.pow(I,1/3),M=o===C?-p:-S/p;return a=S<=0?p+M:-m/(p*p+M*M+S),f*l>=c*_?[(a-u)/i]:[-E/(a+s)]}var O=R,g=-2*u*R+i*T,y=h,F=-E*T+2*s*h,L=Math.sqrt(A),v=Math.sqrt(3)/2,U=Math.abs(Math.atan2(i*L,-g)/3);a=2*Math.sqrt(-O);var D=Math.cos(U);o=a*D;var P=a*(-D/2-v*Math.sin(U)),w=o+P>2*u?o-u:P-u,B=i,x=w/B;U=Math.abs(Math.atan2(E*L,-F)/3),a=2*Math.sqrt(-y),D=Math.cos(U),o=a*D,P=a*(-D/2-v*Math.sin(U));var G=-E,b=o+P<2*s?o+s:P+s,z=G/b,H=B*b,V=-w*b-B*G,X=w*G,q=(s*V-u*X)/(-u*V+s*H);return x<=q?x<=z?q<=z?[x,q,z]:[x,z,q]:[z,x,q]:x<=z?[q,x,z]:q<=z?[q,z,x]:[z,q,x]}var n={};return n.computeDiscriminant=function(t,e,r,n){var a=t*t,o=e*e,i=r*r,u=n*n,s=18*t*e*r*n+o*i-27*a*u-4*(t*i*r+o*e*n);return s},n.computeRealRoots=function(t,n,a,o){var i,u;if(0===t)return e.computeRealRoots(n,a,o);if(0===n){if(0===a){if(0===o)return[0,0,0];u=-o/t;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===o?(i=e.computeRealRoots(t,0,a),0===i.Length?[0]:[i[0],0,i[1]]):r(t,0,a,o)}return 0===a?0===o?(u=-n/t,u<0?[u,0,0]:[0,0,u]):r(t,n,0,o):0===o?(i=e.computeRealRoots(t,n,a),0===i.length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]):r(t,n,a,o)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(t,e,r,n){"use strict";function a(e,a,o,i){var u=e*e,s=a-3*u/8,E=o-a*e/2+u*e/8,c=i-o*e/4+a*u/16-3*u*u/256,l=t.computeRealRoots(1,2*s,s*s-4*c,-E*E);if(l.length>0){var f=-e/4,_=l[l.length-1];if(Math.abs(_)<r.EPSILON14){var R=n.computeRealRoots(1,s,c);if(2===R.length){var T,h=R[0],A=R[1];if(h>=0&&A>=0){var d=Math.sqrt(h),S=Math.sqrt(A);return[f-S,f-d,f+d,f+S]}if(h>=0&&A<0)return T=Math.sqrt(h),[f-T,f+T];if(h<0&&A>=0)return T=Math.sqrt(A),[f-T,f+T]}return[]}if(_>0){var m=Math.sqrt(_),N=(s+_-E/m)/2,C=(s+_+E/m)/2,I=n.computeRealRoots(1,m,N),p=n.computeRealRoots(1,-m,C);return 0!==I.length?(I[0]+=f,I[1]+=f,0!==p.length?(p[0]+=f,p[1]+=f,I[1]<=p[0]?[I[0],I[1],p[0],p[1]]:p[1]<=I[0]?[p[0],p[1],I[0],I[1]]:I[0]>=p[0]&&I[1]<=p[1]?[p[0],I[0],I[1],p[1]]:p[0]>=I[0]&&p[1]<=I[1]?[I[0],p[0],p[1],I[1]]:I[0]>p[0]&&I[0]<p[1]?[p[0],I[0],p[1],I[1]]:[I[0],p[0],I[1],p[1]]):I):0!==p.length?(p[0]+=f,p[1]+=f,p):[]}}return[]}function o(e,a,o,i){var u=o*o,s=a*a,E=e*e,c=-2*a,l=o*e+s-4*i,f=E*i-o*a*e+u,_=t.computeRealRoots(1,c,l,f);if(_.length>0){var R,T,h=_[0],A=a-h,d=A*A,S=e/2,m=A/2,N=d-4*i,C=d+4*Math.abs(i),I=E-4*h,p=E+4*Math.abs(h);if(h<0||N*p<I*C){var M=Math.sqrt(I);R=M/2,T=0===M?0:(e*m-o)/M}else{var O=Math.sqrt(N);R=0===O?0:(e*m-o)/O,T=O/2}var g,y;0===S&&0===R?(g=0,y=0):r.sign(S)===r.sign(R)?(g=S+R,y=h/g):(y=S-R,g=h/y);var F,L;0===m&&0===T?(F=0,L=0):r.sign(m)===r.sign(T)?(F=m+T,L=i/F):(L=m-T,F=i/L);var v=n.computeRealRoots(1,g,F),U=n.computeRealRoots(1,y,L);if(0!==v.length)return 0!==U.length?v[1]<=U[0]?[v[0],v[1],U[0],U[1]]:U[1]<=v[0]?[U[0],U[1],v[0],v[1]]:v[0]>=U[0]&&v[1]<=U[1]?[U[0],v[0],v[1],U[1]]:U[0]>=v[0]&&U[1]<=v[1]?[v[0],U[0],U[1],v[1]]:v[0]>U[0]&&v[0]<U[1]?[U[0],v[0],U[1],v[1]]:[v[0],U[0],v[1],U[1]]:v;if(0!==U.length)return U}return[]}var i={};return i.computeDiscriminant=function(t,e,r,n,a){var o=t*t,i=o*t,u=e*e,s=u*e,E=r*r,c=E*r,l=n*n,f=l*n,_=a*a,R=_*a,T=u*E*l-4*s*f-4*t*c*l+18*t*e*r*f-27*o*l*l+256*i*R+a*(18*s*r*n-4*u*c+16*t*E*E-80*t*e*E*n-6*t*u*l+144*o*r*l)+_*(144*t*u*r-27*u*u-128*o*E-192*o*e*n);return T},i.computeRealRoots=function(e,n,i,u,s){if(Math.abs(e)<r.EPSILON15)return t.computeRealRoots(n,i,u,s);var E=n/e,c=i/e,l=u/e,f=s/e,_=E<0?1:0;switch(_+=c<0?_+1:_,_+=l<0?_+1:_,_+=f<0?_+1:_){case 0:return a(E,c,l,f);case 1:return o(E,c,l,f);case 2:return o(E,c,l,f);case 3:return a(E,c,l,f);case 4:return a(E,c,l,f);case 5:return o(E,c,l,f);case 6:return a(E,c,l,f);case 7:return a(E,c,l,f);case 8:return o(E,c,l,f);case 9:return a(E,c,l,f);case 10:return a(E,c,l,f);case 11:return o(E,c,l,f);case 12:return a(E,c,l,f);case 13:return a(E,c,l,f);case 14:return a(E,c,l,f);case 15:return a(E,c,l,f);default:return}},i}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";function a(r,n){n=t.clone(e(n,t.ZERO)),t.equals(n,t.ZERO)||t.normalize(n,n),this.origin=t.clone(e(r,t.ZERO)),this.direction=n}return a.getPoint=function(e,n,a){return r(a)||(a=new t),a=t.multiplyByScalar(e.direction,n,a),t.add(e.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(t,e,r,n,a,o,i,u,s,E,c){"use strict";function l(t,e,r,n){var a=e*e-4*t*r;if(!(a<0)){if(a>0){var o=1/(2*t),i=Math.sqrt(a),u=(-e+i)*o,s=(-e-i)*o;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var E=-e/(2*t);if(0!==E)return n.root0=n.root1=E,n}}function f(e,r,a){n(a)||(a=new o);var i=e.origin,u=e.direction,s=r.center,E=r.radius*r.radius,c=t.subtract(i,s,d),f=t.dot(u,u),_=2*t.dot(u,c),R=t.magnitudeSquared(c)-E,T=l(f,_,R,C);if(n(T))return a.start=T.root0,a.stop=T.root1,a}function _(t,e,r){var n=t+e;return i.sign(t)!==i.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}function R(e,r,n,a,o){var c,l=a*a,f=o*o,R=(e[u.COLUMN1ROW1]-e[u.COLUMN2ROW2])*f,T=o*(a*_(e[u.COLUMN1ROW0],e[u.COLUMN0ROW1],i.EPSILON15)+r.y),h=e[u.COLUMN0ROW0]*l+e[u.COLUMN2ROW2]*f+a*r.x+n,A=f*_(e[u.COLUMN2ROW1],e[u.COLUMN1ROW2],i.EPSILON15),d=o*(a*_(e[u.COLUMN2ROW0],e[u.COLUMN0ROW2])+r.z),S=[];if(0===d&&0===A){if(c=s.computeRealRoots(R,T,h),0===c.length)return S;var m=c[0],N=Math.sqrt(Math.max(1-m*m,0));if(S.push(new t(a,o*m,o*-N)),S.push(new t(a,o*m,o*N)),2===c.length){var C=c[1],I=Math.sqrt(Math.max(1-C*C,0));S.push(new t(a,o*C,o*-I)),S.push(new t(a,o*C,o*I))}return S}var p=d*d,M=A*A,O=R*R,g=d*A,y=O+M,F=2*(T*R+g),L=2*h*R+T*T-M+p,v=2*(h*T-g),U=h*h-p;if(0===y&&0===F&&0===L&&0===v)return S;c=E.computeRealRoots(y,F,L,v,U);var D=c.length;if(0===D)return S;for(var P=0;P<D;++P){var w,B=c[P],x=B*B,G=Math.max(1-x,0),b=Math.sqrt(G);w=i.sign(R)===i.sign(h)?_(R*x+h,T*B,i.EPSILON12):i.sign(h)===i.sign(T*B)?_(R*x,T*B+h,i.EPSILON12):_(R*x+T*B,h,i.EPSILON12);var z=_(A*B,d,i.EPSILON15),H=w*z;H<0?S.push(new t(a,o*B,o*b)):H>0?S.push(new t(a,o*B,o*-b)):0!==b?(S.push(new t(a,o*B,o*-b)),S.push(new t(a,o*B,o*b)),++P):S.push(new t(a,o*B,o*b))}return S}var T={};T.rayPlane=function(e,r,a){n(a)||(a=new t);var o=e.origin,u=e.direction,s=r.normal,E=t.dot(s,u);if(!(Math.abs(E)<i.EPSILON15)){var c=(-r.distance-t.dot(s,o))/E;if(!(c<0))return a=t.multiplyByScalar(u,c,a),t.add(o,a,a)}};var h=new t,A=new t,d=new t,S=new t,m=new t;T.rayTriangleParametric=function(e,n,a,o,u){u=r(u,!1);var s,E,c,l,f,_=e.origin,R=e.direction,T=t.subtract(a,n,h),N=t.subtract(o,n,A),C=t.cross(R,N,d),I=t.dot(T,C);if(u){if(I<i.EPSILON6)return;if(s=t.subtract(_,n,S),c=t.dot(s,C),c<0||c>I)return;if(E=t.cross(s,T,m),l=t.dot(R,E),l<0||c+l>I)return;f=t.dot(N,E)/I}else{if(Math.abs(I)<i.EPSILON6)return;var p=1/I;if(s=t.subtract(_,n,S),c=t.dot(s,C)*p,c<0||c>1)return;if(E=t.cross(s,T,m),l=t.dot(R,E)*p,l<0||c+l>1)return;f=t.dot(N,E)*p}return f},T.rayTriangle=function(e,r,a,o,i,u){var s=T.rayTriangleParametric(e,r,a,o,i);if(n(s)&&!(s<0))return n(u)||(u=new t),t.multiplyByScalar(e.direction,s,u),t.add(e.origin,u,u)};var N=new c;T.lineSegmentTriangle=function(e,r,a,o,i,u,s){var E=N;t.clone(e,E.origin),t.subtract(r,e,E.direction),t.normalize(E.direction,E.direction);var c=T.rayTriangleParametric(E,a,o,i,u);if(!(!n(c)||c<0||c>t.distance(e,r)))return n(s)||(s=new t),t.multiplyByScalar(E.direction,c,s),t.add(E.origin,s,s)};var C={root0:0,root1:0};T.raySphere=function(t,e,r){if(r=f(t,e,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var I=new c;T.lineSegmentSphere=function(e,r,a,o){var i=I;t.clone(e,i.origin);var u=t.subtract(r,e,i.direction),s=t.magnitude(u);if(t.normalize(u,u),o=f(i,a,o),!(!n(o)||o.stop<0||o.start>s))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,s),o};var p=new t,M=new t;T.rayEllipsoid=function(e,r){var n,a,i,u,s,E=r.oneOverRadii,c=t.multiplyComponents(E,e.origin,p),l=t.multiplyComponents(E,e.direction,M),f=t.magnitudeSquared(c),_=t.dot(c,l);if(f>1){if(_>=0)return;var R=_*_;if(n=f-1,a=t.magnitudeSquared(l),i=a*n,R<i)return;if(R>i){u=_*_-i,s=-_+Math.sqrt(u);var T=s/a,h=n/s;return T<h?new o(T,h):{start:h,stop:T}}var A=Math.sqrt(n/a);return new o(A,A)}return f<1?(n=f-1,a=t.magnitudeSquared(l),i=a*n,u=_*_-i,s=-_+Math.sqrt(u),new o(0,s/a)):_<0?(a=t.magnitudeSquared(l),new o(0,-_/a)):void 0};var O=new t,g=new t,y=new t,F=new t,L=new t,v=new u,U=new u,D=new u,P=new u,w=new u,B=new u,x=new u,G=new t,b=new t,z=new e;T.grazingAltitudeLocation=function(e,r){var a=e.origin,o=e.direction;if(!t.equals(a,t.ZERO)){var s=r.geodeticSurfaceNormal(a,O);if(t.dot(o,s)>=0)return a}var E=n(this.rayEllipsoid(e,r)),c=r.transformPositionToScaledSpace(o,O),l=t.normalize(c,c),f=t.mostOrthogonalAxis(c,F),_=t.normalize(t.cross(f,l,g),g),T=t.normalize(t.cross(l,_,y),y),h=v;h[0]=l.x,h[1]=l.y,h[2]=l.z,h[3]=_.x,h[4]=_.y,h[5]=_.z,h[6]=T.x,h[7]=T.y,h[8]=T.z;var A=u.transpose(h,U),d=u.fromScale(r.radii,D),S=u.fromScale(r.oneOverRadii,P),m=w;m[0]=0,m[1]=-o.z,m[2]=o.y,m[3]=o.z,m[4]=0,m[5]=-o.x,m[6]=-o.y,m[7]=o.x,m[8]=0;var N,C,I=u.multiply(u.multiply(A,S,B),m,B),p=u.multiply(u.multiply(I,d,x),h,x),M=u.multiplyByVector(I,a,L),H=R(p,t.negate(M,O),0,0,1),V=H.length;if(V>0){for(var X=t.clone(t.ZERO,b),q=Number.NEGATIVE_INFINITY,W=0;W<V;++W){N=u.multiplyByVector(d,u.multiplyByVector(h,H[W],G),G);var Y=t.normalize(t.subtract(N,a,F),F),K=t.dot(Y,o);K>q&&(q=K,X=t.clone(N,X))}var k=r.cartesianToCartographic(X,z);return q=i.clamp(q,0,1),C=t.magnitude(t.subtract(X,a,F))*Math.sqrt(1-q*q),C=E?-C:C,k.height=C,r.cartographicToCartesian(k,new t)}};var H=new t;return T.lineSegmentPlane=function(e,r,a,o){n(o)||(o=new t);var u=t.subtract(r,e,H),s=a.normal,E=t.dot(s,u);if(!(Math.abs(E)<i.EPSILON6)){var c=t.dot(s,e),l=-(a.distance+c)/E;if(!(l<0||l>1))return t.multiplyByScalar(u,l,o),t.add(e,o,o),o}},T.trianglePlaneIntersection=function(e,r,n,a){var o=a.normal,i=a.distance,u=t.dot(o,e)+i<0,s=t.dot(o,r)+i<0,E=t.dot(o,n)+i<0,c=0;c+=u?1:0,c+=s?1:0,c+=E?1:0;var l,f;if(1!==c&&2!==c||(l=new t,f=new t),1===c){if(u)return T.lineSegmentPlane(e,r,a,l),T.lineSegmentPlane(e,n,a,f),{positions:[e,r,n,l,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return T.lineSegmentPlane(r,n,a,l),T.lineSegmentPlane(r,e,a,f),{positions:[e,r,n,l,f],indices:[1,3,4,2,0,4,2,4,3]};if(E)return T.lineSegmentPlane(n,e,a,l),T.lineSegmentPlane(n,r,a,f),{positions:[e,r,n,l,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===c){if(!u)return T.lineSegmentPlane(r,e,a,l),T.lineSegmentPlane(n,e,a,f),{positions:[e,r,n,l,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return T.lineSegmentPlane(n,r,a,l),T.lineSegmentPlane(e,r,a,f),{positions:[e,r,n,l,f],indices:[2,0,4,2,4,3,1,3,4]};if(!E)return T.lineSegmentPlane(e,n,a,l),T.lineSegmentPlane(r,n,a,f),{positions:[e,r,n,l,f],indices:[0,1,4,0,4,3,2,3,4]}}},T}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(t,e,r,n,a){"use strict";function o(e,r){this.normal=t.clone(e),this.distance=r}o.fromPointNormal=function(r,n,a){var i=-t.dot(n,r);return e(a)?(t.clone(n,a.normal),a.distance=i,a):new o(n,i)};var i=new t;return o.fromCartesian4=function(r,n){var a=t.fromCartesian4(r,i),u=r.w;return e(n)?(t.clone(a,n.normal),n.distance=u,n):new o(a,u)},o.getPointDistance=function(e,r){return t.dot(e.normal,r)+e.distance},o.ORIGIN_XY_PLANE=a(new o(t.UNIT_Z,0)),o.ORIGIN_YZ_PLANE=a(new o(t.UNIT_X,0)),o.ORIGIN_ZX_PLANE=a(new o(t.UNIT_Y,0)),o}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(t,e,r,n,a,o,i,u,s,E,c,l){"use strict";function f(t,e,r){var n=p;n.length=t;var a;if(e===r){for(a=0;a<t;a++)n[a]=e;return n}var o=r-e,i=o/t;for(a=0;a<t;a++){var u=e+a*i;n[a]=u}return n}function _(e,r,n,a,o,i,u,s){var E=a.scaleToGeodeticSurface(e,y),c=a.scaleToGeodeticSurface(r,F),l=R.numberOfPoints(e,r,n),_=a.cartesianToCartographic(E,M),T=a.cartesianToCartographic(c,O),h=f(l,o,i);L.setEndPoints(_,T);var A=L.surfaceDistance/l,d=s;_.height=o;var S=a.cartographicToCartesian(_,g);t.pack(S,u,d),d+=3;for(var m=1;m<l;m++){var N=L.interpolateUsingSurfaceDistance(m*A,O);N.height=h[m],S=a.cartographicToCartesian(N,g),t.pack(S,u,d),d+=3}return d}var R={};R.numberOfPoints=function(e,r,n){var a=t.distance(e,r);return Math.ceil(a/n)};var T=new e;R.extractHeights=function(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;a++){var o=t[a];n[a]=e.cartesianToCartographic(o,T).height}return n};var h=new c,A=new t,d=new t,S=new l(t.UNIT_X,0),m=new t,N=new l(t.UNIT_X,0),C=new t,I=new t,p=[],M=new e,O=new e,g=new t,y=new t,F=new t,L=new i;return R.wrapLongitude=function(e,a){var o=[],i=[];if(n(e)&&e.length>0){a=r(a,c.IDENTITY);var s=c.inverseTransformation(a,h),E=c.multiplyByPoint(s,t.ZERO,A),f=t.normalize(c.multiplyByPointAsVector(s,t.UNIT_Y,d),d),_=l.fromPointNormal(E,f,S),R=t.normalize(c.multiplyByPointAsVector(s,t.UNIT_X,m),m),T=l.fromPointNormal(E,R,N),p=1;o.push(t.clone(e[0]));for(var M=o[0],O=e.length,g=1;g<O;++g){var y=e[g];if(l.getPointDistance(T,M)<0||l.getPointDistance(T,y)<0){var F=u.lineSegmentPlane(M,y,_,C);if(n(F)){var L=t.multiplyByScalar(f,5e-9,I);l.getPointDistance(_,M)<0&&t.negate(L,L),o.push(t.add(F,L,new t)),i.push(p+1),t.negate(L,L),o.push(t.add(F,L,new t)),p=1}}o.push(t.clone(e[g])),p++,M=y}i.push(p)}return{positions:o,lengths:i}},R.generateArc=function(e){n(e)||(e={});var a=e.positions,i=a.length,u=r(e.ellipsoid,o.WGS84),c=r(e.height,0),l=s(c);if(i<1)return[];if(1===i){var f=u.scaleToGeodeticSurface(a[0],y);if(c=l?c[0]:c,0!==c){var T=u.geodeticSurfaceNormal(f,g);t.multiplyByScalar(T,c,T),t.add(f,T,f)}return[f.x,f.y,f.z]}var h=e.minDistance;if(!n(h)){var A=r(e.granularity,E.RADIANS_PER_DEGREE);h=E.chordLength(A,u.maximumRadius)}var d,S=0;for(d=0;d<i-1;d++)S+=R.numberOfPoints(a[d],a[d+1],h);var m=3*(S+1),N=new Array(m),C=0;for(d=0;d<i-1;d++){var I=a[d],O=a[d+1],F=l?c[d]:c,L=l?c[d+1]:c;C=_(I,O,h,u,F,L,N,C)}p.length=0;var v=a[i-1],U=u.cartesianToCartographic(v,M);U.height=l?c[i-1]:c;var D=u.cartographicToCartesian(U,g);return t.pack(D,N,m-3),N},R.generateCartesianArc=function(e){for(var r=R.generateArc(e),n=r.length/3,a=new Array(n),o=0;o<n;o++)a[o]=t.unpack(r,3*o);return a},R}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,r,n){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return a.POSITION_ONLY=n(new a({position:!0})),a.POSITION_AND_NORMAL=n(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=n(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=n(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=n(new a({position:!0,color:!0})),a.ALL=n(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,r,n){return n=t(n,0),r[n++]=e.position?1:0,r[n++]=e.normal?1:0,r[n++]=e.st?1:0,r[n++]=e.tangent?1:0,r[n++]=e.bitangent?1:0,r[n++]=e.color?1:0,r},a.unpack=function(r,n,o){return n=t(n,0),e(o)||(o=new a),o.position=1===r[n++],o.normal=1===r[n++],o.st=1===r[n++],o.tangent=1===r[n++],o.bitangent=1===r[n++],o.color=1===r[n++],o},a.clone=function(t,r){if(e(t))return e(r)||(r=new a),r.position=t.position,r.normal=t.normal,r.st=t.st,r.tangent=t.tangent,r.bitangent=t.bitangent,r.color=t.color,r},a}),define("Core/PolylineGeometry",["./arrayRemoveDuplicates","./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryType","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType","./VertexFormat"],function(t,e,r,n,a,o,i,u,s,E,c,l,f,_,R,T,h,A){"use strict";function d(t,e,r,a,o){var i=m;i.length=o;var u,s=r.red,E=r.green,c=r.blue,l=r.alpha,f=a.red,_=a.green,R=a.blue,T=a.alpha;if(n.equals(r,a)){for(u=0;u<o;u++)i[u]=n.clone(r);return i}var h=(f-s)/o,A=(_-E)/o,d=(R-c)/o,S=(T-l)/o;for(u=0;u<o;u++)i[u]=new n(s+u*h,E+u*A,c+u*d,l+u*S);return i}function S(t){t=o(t,o.EMPTY_OBJECT);var e=t.positions,a=t.colors,u=o(t.width,1),E=o(t.colorsPerVertex,!1);this._positions=e,this._colors=a,this._width=u,this._colorsPerVertex=E,this._vertexFormat=A.clone(o(t.vertexFormat,A.DEFAULT)),this._followSurface=o(t.followSurface,!0),this._granularity=o(t.granularity,R.RADIANS_PER_DEGREE),this._ellipsoid=s.clone(o(t.ellipsoid,s.WGS84)),this._workerName="createPolylineGeometry";var c=1+e.length*r.packedLength;c+=i(a)?1+a.length*n.packedLength:1,this.packedLength=c+s.packedLength+A.packedLength+4}var m=[];S.pack=function(t,e,a){a=o(a,0);var u,E=t._positions,c=E.length;for(e[a++]=c,u=0;u<c;++u,a+=r.packedLength)r.pack(E[u],e,a);var l=t._colors;for(c=i(l)?l.length:0,e[a++]=c,u=0;u<c;++u,a+=n.packedLength)n.pack(l[u],e,a);return s.pack(t._ellipsoid,e,a),a+=s.packedLength,A.pack(t._vertexFormat,e,a),a+=A.packedLength,e[a++]=t._width,e[a++]=t._colorsPerVertex?1:0,e[a++]=t._followSurface?1:0,e[a]=t._granularity,e};var N=s.clone(s.UNIT_SPHERE),C=new A,I={positions:void 0,colors:void 0,ellipsoid:N,vertexFormat:C,width:void 0,colorsPerVertex:void 0,followSurface:void 0,granularity:void 0};S.unpack=function(t,e,a){e=o(e,0);var u,E=t[e++],c=new Array(E);for(u=0;u<E;++u,e+=r.packedLength)c[u]=r.unpack(t,e);E=t[e++];var l=E>0?new Array(E):void 0;for(u=0;u<E;++u,e+=n.packedLength)l[u]=n.unpack(t,e);var f=s.unpack(t,e,N);e+=s.packedLength;var _=A.unpack(t,e,C);e+=A.packedLength;var R=t[e++],T=1===t[e++],h=1===t[e++],d=t[e];return i(a)?(a._positions=c,a._colors=l,a._ellipsoid=s.clone(f,a._ellipsoid),a._vertexFormat=A.clone(_,a._vertexFormat),a._width=R,a._colorsPerVertex=T,a._followSurface=h,a._granularity=d,a):(I.positions=c,I.colors=l,I.width=R,I.colorsPerVertex=T,I.followSurface=h,I.granularity=d,new S(I))};var p=new r,M=new r,O=new r,g=new r;return S.createGeometry=function(o){var u,s,A,S=o._width,N=o._vertexFormat,C=o._colors,I=o._colorsPerVertex,y=o._followSurface,F=o._granularity,L=o._ellipsoid,v=t(o._positions,r.equalsEpsilon),U=v.length;if(!(U<2||S<=0)){if(y){var D=T.extractHeights(v,L),P=R.chordLength(F,L.maximumRadius);if(i(C)){var w=1;for(u=0;u<U-1;++u)w+=T.numberOfPoints(v[u],v[u+1],P);var B=new Array(w),x=0;for(u=0;u<U-1;++u){var G=v[u],b=v[u+1],z=C[u],H=T.numberOfPoints(G,b,P);if(I&&u<w){var V=C[u+1],X=d(G,b,z,V,H),q=X.length;for(s=0;s<q;++s)B[x++]=X[s]}else for(s=0;s<H;++s)B[x++]=n.clone(z)}B[x]=n.clone(C[C.length-1]),C=B,m.length=0}v=T.generateCartesianArc({positions:v,minDistance:P,ellipsoid:L,height:D})}U=v.length;var W,Y=4*U-4,K=new Float64Array(3*Y),k=new Float64Array(3*Y),Z=new Float64Array(3*Y),j=new Float32Array(2*Y),Q=N.st?new Float32Array(2*Y):void 0,J=i(C)?new Uint8Array(4*Y):void 0,$=0,tt=0,et=0,rt=0;for(s=0;s<U;++s){0===s?(W=p,r.subtract(v[0],v[1],W),r.add(v[0],W,W)):W=v[s-1],r.clone(W,O),r.clone(v[s],M),s===U-1?(W=p,r.subtract(v[U-1],v[U-2],W),r.add(v[U-1],W,W)):W=v[s+1],r.clone(W,g);var nt,at;i(J)&&(nt=0===s||I?C[s]:C[s-1],s!==U-1&&(at=C[s]));var ot=0===s?2:0,it=s===U-1?2:4;for(A=ot;A<it;++A){r.pack(M,K,$),r.pack(O,k,$),r.pack(g,Z,$),$+=3;var ut=A-2<0?-1:1;if(j[tt++]=2*(A%2)-1,j[tt++]=ut*S,N.st&&(Q[et++]=s/(U-1),Q[et++]=Math.max(j[tt-2],0)),i(J)){var st=A<2?nt:at;J[rt++]=n.floatToByte(st.red),J[rt++]=n.floatToByte(st.green),J[rt++]=n.floatToByte(st.blue),J[rt++]=n.floatToByte(st.alpha)}}}var Et=new l;Et.position=new c({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:K}),Et.prevPosition=new c({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:k}),Et.nextPosition=new c({componentDatatype:a.DOUBLE,componentsPerAttribute:3,values:Z}),Et.expandAndWidth=new c({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:j}),N.st&&(Et.st=new c({componentDatatype:a.FLOAT,componentsPerAttribute:2,values:Q})),i(J)&&(Et.color=new c({componentDatatype:a.UNSIGNED_BYTE,componentsPerAttribute:4,values:J,normalize:!0}));var ct=_.createTypedArray(Y,6*U-6),lt=0,ft=0,_t=U-1;for(s=0;s<_t;++s)ct[ft++]=lt,ct[ft++]=lt+2,ct[ft++]=lt+1,ct[ft++]=lt+1,ct[ft++]=lt+2,ct[ft++]=lt+3,lt+=4;return new E({attributes:Et,indices:ct,primitiveType:h.TRIANGLES,boundingSphere:e.fromPoints(v),geometryType:f.POLYLINES})}},S}),define("Workers/createPolylineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolylineGeometry"],function(t,e,r){"use strict";function n(n,a){return t(a)&&(n=r.unpack(n,a)),n._ellipsoid=e.clone(n._ellipsoid),r.createGeometry(n)}return n})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createPolylineVolumeGeometry.js b/engines/Cesium/Workers/createPolylineVolumeGeometry.js index 452bea2..bac6bce 100644 --- a/engines/Cesium/Workers/createPolylineVolumeGeometry.js +++ b/engines/Cesium/Workers/createPolylineVolumeGeometry.js @@ -222,10 +222,10 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:p,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,p=a.y,E=a.z,m=l*l*d*d,y=f*f*p*p,_=h*h*E*E,T=m+y+_,v=Math.sqrt(1/T),R=e.multiplyByScalar(n,v,i);if(T<s)return isFinite(v)?e.clone(R,c):void 0;var A=u.x,S=u.y,g=u.z,N=o;N.x=R.x*A*2,N.y=R.y*S*2,N.z=R.z*g*2;var w,O,x,I,M,C,P,D,U,L,b,F=(1-v)*e.magnitude(n)/(.5*e.magnitude(N)),B=0;do{F-=B,x=1/(1+F*A),I=1/(1+F*S),M=1/(1+F*g),C=x*x,P=I*I,D=M*M,U=C*x,L=P*I,b=D*M,w=m*C+y*P+_*D-1,O=m*U*A+y*L*S+_*b*g;var z=-2*O;B=w/z}while(Math.abs(w)>r.EPSILON12);return t(c)?(c.x=l*x,c.y=f*I,c.z=h*M,c):new e(l*x,f*I,h*M)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var p=n(r)?r.oneOverRadii:f,E=n(r)?r.oneOverRadiiSquared:h,m=n(r)?r._centerToleranceSquared:d,y=o(t,p,E,m,c);if(n(y)){var _=e.multiplyComponents(y,E,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),v=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=v,a.latitude=R,a.height=A,a):new u(v,R,A)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,p=new e,E=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,p);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,E),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,p),o=Math.max(o,p)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=t.cartesianToCartographic(e[h]);a=Math.min(a,p.longitude),i=Math.max(i,p.longitude),l=Math.min(l,p.latitude),f=Math.max(f,p.latitude);var E=p.longitude>=0?p.longitude:p.longitude+u.TWO_PI;o=Math.min(o,E),c=Math.max(c,E)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,p=e.west,E=c;E.height=a,E.longitude=p,E.latitude=f,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.latitude=h,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=p,o[l]=t.cartographicToCartesian(E,o[l]),l++,f<0?E.latitude=f:h>0?E.latitude=h:E.latitude=0;for(var m=1;m<8;++m)E.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,E)&&(o[l]=t.cartographicToCartesian(E,o[l]),l++);return 0===E.latitude&&(E.longitude=p,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=t.cartographicToCartesian(E,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.width=r(n,0),this.height=r(a,0)}s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},s.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new s),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},s.fromPoints=function(e,t){if(a(t)||(t=new s),!a(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var n=e.length,r=e[0].x,i=e[0].y,o=e[0].x,u=e[0].y,c=1;c<n;c++){var l=e[c],f=l.x,h=l.y;r=Math.min(f,r),o=Math.max(f,o),i=Math.min(h,i),u=Math.max(h,u)}return t.x=r,t.y=i,t.width=o-r,t.height=u-i,t};var c=new i,l=new t,f=new t;return s.fromRectangle=function(t,n,i){if(a(i)||(i=new s),!a(t))return i.x=0,i.y=0,i.width=0,i.height=0,i;n=r(n,c);var o=n.project(u.southwest(t,l)),h=n.project(u.northeast(t,f));return e.subtract(h,o,h),i.x=o.x,i.y=o.y,i.width=h.x,i.height=h.y,i},s.clone=function(e,t){if(a(e))return a(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new s(e.x,e.y,e.width,e.height)},s.union=function(e,t,n){a(n)||(n=new s);var r=Math.min(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return n.x=r,n.y=i,n.width=o-r,n.height=u-i,n},s.expand=function(e,t,n){n=s.clone(e,n);var r=t.x-n.x,a=t.y-n.y;return r>n.width?n.width=r:r<0&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:a<0&&(n.height-=a,n.y=t.y),n},s.intersect=function(e,t){var n=e.x,r=e.y,a=t.x,i=t.y;return n>a+t.width||n+e.width<a||r+e.height<i||r>i+t.height?o.OUTSIDE:o.INTERSECTING},s.equals=function(e,t){return e===t||a(e)&&a(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(E[n],p[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(E[i],p[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=p[a],h=E[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,m=e[s.getElementIndex(h,h)],y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(h,f)],T=(m-y)/2/_;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6], -t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,p=n-u-f+d,E=2*(a-h),m=2*(i+l),y=2*(a+h),_=-n+u-f+d,T=2*(c-o),v=2*(i-l),R=2*(c+o),A=-n-u+f+d;return r(t)?(t[0]=p,t[1]=y,t[2]=v,t[3]=E,t[4]=_,t[5]=R,t[6]=m,t[7]=T,t[8]=A,t):new s(p,E,m,y,_,T,v,R,A)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,p=i*a+c*o*u,E=-o*i+i*o*u,m=-o,y=c*n,_=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=m,t[3]=f,t[4]=p,t[5]=y,t[6]=h,t[7]=E,t[8]=_,t):new s(l,f,h,d,p,E,m,y,_)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var p=[1,0,0],E=[2,2,1],m=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),p=n*c(d);o<a&&l(d)>p;)f(d,m),s.transpose(m,y),s.multiply(d,m,d),s.multiply(y,d,d),s.multiply(h,m,h),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,h,d,p,E,m){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(p,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(E,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(m,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,p=t.y*t.z,E=t.y*t.w,m=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-d-m+_,v=2*(c-y),R=2*(f+E),A=2*(c+y),S=-s+d-m+_,g=2*(p-h),N=2*(f-E),w=2*(p+h),O=-s-d+m+_;return r[0]=T*i,r[1]=A*i,r[2]=N*i,r[3]=0,r[4]=v*o,r[5]=S*o,r[6]=w*o,r[7]=0,r[8]=R*u,r[9]=g*u,r[10]=O*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,p=f.x,E=f.y,m=f.z,y=d.x,_=d.y,T=d.z,v=r.x,R=r.y,A=r.z,S=u*-v+s*-R+c*-A,g=y*-v+_*-R+T*-A,N=p*v+E*R+m*A;return a(n)?(n[0]=u,n[1]=y,n[2]=-p,n[3]=0,n[4]=s,n[5]=_,n[6]=-E,n[7]=0,n[8]=c,n[9]=T,n[10]=-m,n[11]=0,n[12]=S,n[13]=g,n[14]=N,n[15]=1,n):new l(u,s,c,S,y,_,T,g,-p,-E,-m,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,p=f,E=i+c,m=o+l,y=t+f,_=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=p,a[11]=0,a[12]=E,a[13]=m,a[14]=y,a[15]=_,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var p=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),n};var E=new e;l.getMaximumScale=function(t){return l.getScale(t,E),e.maximumComponent(E)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],E=e[12],m=e[13],y=e[14],_=e[15],T=t[0],v=t[1],R=t[2],A=t[3],S=t[4],g=t[5],N=t[6],w=t[7],O=t[8],x=t[9],I=t[10],M=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=r*T+u*v+f*R+E*A,b=a*T+s*v+h*R+m*A,F=i*T+c*v+d*R+y*A,B=o*T+l*v+p*R+_*A,z=r*S+u*g+f*N+E*w,G=a*S+s*g+h*N+m*w,q=i*S+c*g+d*N+y*w,W=o*S+l*g+p*N+_*w,V=r*O+u*x+f*I+E*M,X=a*O+s*x+h*I+m*M,H=i*O+c*x+d*I+y*M,Y=o*O+l*x+p*I+_*M,k=r*C+u*P+f*D+E*U,Z=a*C+s*P+h*D+m*U,j=i*C+c*P+d*D+y*U,K=o*C+l*P+p*D+_*U;return n[0]=L,n[1]=b,n[2]=F,n[3]=B,n[4]=z,n[5]=G,n[6]=q,n[7]=W,n[8]=V,n[9]=X,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],p=e[14],E=t[0],m=t[1],y=t[2],_=t[4],T=t[5],v=t[6],R=t[8],A=t[9],S=t[10],g=t[12],N=t[13],w=t[14],O=r*E+o*m+c*y,x=a*E+u*m+l*y,I=i*E+s*m+f*y,M=r*_+o*T+c*v,C=a*_+u*T+l*v,P=i*_+s*T+f*v,D=r*R+o*A+c*S,U=a*R+u*A+l*S,L=i*R+s*A+f*S,b=r*g+o*N+c*w+h,F=a*g+u*N+l*w+d,B=i*g+s*N+f*w+p;return n[0]=O,n[1]=x,n[2]=I,n[3]=0,n[4]=M,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=b,n[13]=F,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],p=t[2],E=t[3],m=t[4],y=t[5],_=t[6],T=t[7],v=t[8],R=r*h+o*d+c*p,A=a*h+u*d+l*p,S=i*h+s*d+f*p,g=r*E+o*m+c*y,N=a*E+u*m+l*y,w=i*E+s*m+f*y,O=r*_+o*T+c*v,x=a*_+u*T+l*v,I=i*_+s*T+f*v;return n[0]=R,n[1]=A,n[2]=S,n[3]=0,n[4]=g,n[5]=N,n[6]=w,n[7]=0,n[8]=O,n[9]=x,n[10]=I,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var m=new e;l.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var y=new s,_=new s,T=new t,v=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,y),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),v))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],p=e[13],E=e[2],m=e[6],R=e[10],A=e[14],S=e[3],g=e[7],N=e[11],w=e[15],O=R*w,x=A*N,I=m*w,M=A*g,C=m*N,P=R*g,D=E*w,U=A*S,L=E*N,b=R*S,F=E*g,B=m*S,z=O*h+M*d+C*p-(x*h+I*d+P*p),G=x*f+D*d+b*p-(O*f+U*d+L*p),q=I*f+U*h+F*p-(M*f+D*h+B*p),W=P*f+L*h+B*d-(C*f+b*h+F*d),V=x*a+I*i+P*o-(O*a+M*i+C*o),X=O*r+U*i+L*o-(x*r+D*i+b*o),H=M*r+D*a+B*o-(I*r+U*a+F*o),Y=C*r+b*a+F*i-(P*r+L*a+B*i);O=i*p,x=o*d,I=a*p,M=o*h,C=a*d,P=i*h,D=r*p,U=o*f,L=r*d,b=i*f,F=r*h,B=a*f;var k=O*g+M*N+C*w-(x*g+I*N+P*w),Z=x*S+D*N+b*w-(O*S+U*N+L*w),j=I*S+U*g+F*w-(M*S+D*g+B*w),K=P*S+L*g+B*N-(C*S+b*g+F*N),J=I*R+P*A+x*m-(C*A+O*m+M*R),Q=L*A+O*E+U*R-(D*R+b*A+x*E),$=D*m+B*A+M*E-(F*A+I*E+U*m),ee=F*R+C*E+b*m-(L*m+B*R+P*E),te=r*z+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=z*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=V*te,n[5]=X*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],p=-n*f-r*h-a*d,E=-i*f-o*h-u*d,m=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=p,t[13]=E,t[14]=m,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,p=new e,E=new e,m=new e,y=new e,_=new e,T=new e,v=new e,R=new e,A=new e,S=new e,g=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,p),u=e.clone(r,E),s=e.clone(r,m),c=e.clone(r,y),l=e.clone(r,_),f=t.length,N=1;N<f;N++){e.clone(t[N],r);var w=r.x,O=r.y,x=r.z;w<i.x&&e.clone(r,i),w>s.x&&e.clone(r,s),O<o.y&&e.clone(r,o),O>c.y&&e.clone(r,c),x<u.z&&e.clone(r,u),x>l.z&&e.clone(r,l)}var I=e.magnitudeSquared(e.subtract(s,i,v)),M=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),P=i,D=s,U=I;M>U&&(U=M,P=o,D=c),C>U&&(U=C,P=u,D=l);var L=R;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var b=e.magnitudeSquared(e.subtract(D,L,v)),F=Math.sqrt(b),B=A;B.x=i.x,B.y=o.y,B.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,v),.5,g),q=0;for(N=0;N<f;N++){e.clone(t[N],r);var W=e.magnitude(e.subtract(r,G,v));W>q&&(q=W);var V=e.magnitudeSquared(e.subtract(r,L,v));if(V>b){var X=Math.sqrt(V);F=.5*(F+X),b=F*F;var H=X-F;L.x=(F*L.x+H*r.x)/X,L.y=(F*L.y+H*r.y)/X,L.z=(F*L.z+H*r.z)/X}}return F<q?(e.clone(L,n.center),n.radius=F):(e.clone(G,n.center),n.radius=q),n};var N=new o,w=new e,O=new e,x=new t,I=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,N),f.southwest(t,x),x.height=i,f.northeast(t,I),I.height=o;var s=n.project(x,w),c=n.project(I,O),l=c.x-s.x,d=c.y-s.y,p=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+p*p);var E=u.center;return E.x=s.x+.5*l,E.y=s.y+.5*d,E.z=s.z+.5*p,u};var M=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,M)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,p),l=e.clone(u,E),f=e.clone(u,m),N=e.clone(u,y),w=e.clone(u,_),O=t.length,x=0;x<O;x+=i){var I=t[x]+n.x,M=t[x+1]+n.y,C=t[x+2]+n.z;u.x=I,u.y=M,u.z=C,I<s.x&&e.clone(u,s),I>f.x&&e.clone(u,f),M<c.y&&e.clone(u,c),M>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>w.z&&e.clone(u,w)}var P=e.magnitudeSquared(e.subtract(f,s,v)),D=e.magnitudeSquared(e.subtract(N,c,v)),U=e.magnitudeSquared(e.subtract(w,l,v)),L=s,b=f,F=P;D>F&&(F=D,L=c,b=N),U>F&&(F=U,L=l,b=w);var B=R;B.x=.5*(L.x+b.x),B.y=.5*(L.y+b.y),B.z=.5*(L.z+b.z);var z=e.magnitudeSquared(e.subtract(b,B,v)),G=Math.sqrt(z),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=N.y,W.z=w.z;var V=e.multiplyByScalar(e.add(q,W,v),.5,g),X=0;for(x=0;x<O;x+=i){u.x=t[x]+n.x,u.y=t[x+1]+n.y,u.z=t[x+2]+n.z;var H=e.magnitude(e.subtract(u,V,v));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,B,v));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<X?(e.clone(B,o.center),o.radius=G):(e.clone(V,o.center),o.radius=X),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,p),s=e.clone(i,E),c=e.clone(i,m),l=e.clone(i,y),f=e.clone(i,_),N=t.length,w=0;w<N;w+=3){var O=t[w]+n[w],x=t[w+1]+n[w+1],I=t[w+2]+n[w+2];i.x=O,i.y=x,i.z=I,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),x<u.y&&e.clone(i,u),x>l.y&&e.clone(i,l),I<s.z&&e.clone(i,s),I>f.z&&e.clone(i,f)}var M=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),P=e.magnitudeSquared(e.subtract(f,s,v)),D=o,U=c,L=M;C>L&&(L=C,D=u,U=l),P>L&&(L=P,D=s,U=f);var b=R;b.x=.5*(D.x+U.x),b.y=.5*(D.y+U.y),b.z=.5*(D.z+U.z);var F=e.magnitudeSquared(e.subtract(U,b,v)),B=Math.sqrt(F),z=A;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(z,G,v),.5,g),W=0;for(w=0;w<N;w+=3){i.x=t[w]+n[w],i.y=t[w+1]+n[w+1],i.z=t[w+2]+n[w+2];var V=e.magnitude(e.subtract(i,q,v));V>W&&(W=V);var X=e.magnitudeSquared(e.subtract(i,b,v));if(X>F){var H=Math.sqrt(X);B=.5*(B+H),F=B*B;var Y=H-B;b.x=(B*b.x+Y*i.x)/H,b.y=(B*b.y+Y*i.y)/H,b.z=(B*b.z+Y*i.z)/H}}return B<W?(e.clone(b,r.center),r.radius=B):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,U=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,D),u=c.getColumn(r,2,U),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,b=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var F=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,F));return a>r.radius&&(r.radius=a), -r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var z=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,z),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,V=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),d=e.negate(c,V),p=Y,E=p[0];e.add(s,l,E),e.add(E,c,E),E=p[1],e.add(s,l,E),e.add(E,d,E),E=p[2],e.add(s,f,E),e.add(E,d,E),E=p[3],e.add(s,f,E),e.add(E,c,E),e.negate(s,s),E=p[4],e.add(s,l,E),e.add(E,c,E),E=p[5],e.add(s,l,E),e.add(E,d,E),E=p[6],e.add(s,f,E),e.add(E,d,E),E=p[7],e.add(s,f,E),e.add(E,c,E);for(var m=p.length,y=0;y<m;++y){var _=p[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);n.project(T,_)}a=h.fromPoints(p,a),o=a.center;var v=o.x,R=o.y,A=o.z;return o.x=A,o.y=v,o.z=R,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(R)&&(R=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(R=!0,A=r(e[1]))}return R}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(v.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(S=!0,g=r(e[1]))}return S}function u(){return o()&&g}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(v.userAgent);null!==e&&(N=!0,w=r(e[1]),w.isNightly=!!e[2])}return N}function c(){return s()&&w}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===v.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(O=!0,x=r(e[1]))):"Netscape"===v.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(O=!0,x=r(e[1])))}return O}function f(){return l()&&x}function h(){if(!t(I)){I=!1;var e=/ Edge\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(I=!0,M=r(e[1]))}return I}function d(){return h()&&M}function p(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function E(){return t(D)||(D=/Windows/i.test(v.appVersion)),D}function m(){return p()&&P}function y(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(v.pointerEnabled)||v.pointerEnabled)),U}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;b=t(n)&&""!==n,b&&(L=n)}return b}function T(){return _()?L:void 0}var v;v="undefined"!=typeof navigator?navigator:{};var R,A,S,g,N,w,O,x,I,M,C,P,D,U,L,b,F={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:p,firefoxVersion:m,isWindows:E,hardwareConcurrency:e(v.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return F.supportsFullscreen=function(){return n.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,s,c,l){n(l)||(l=new t);var f,h,d,p,E,m,y,_;n(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(r,a,u),p=t.dot(f,f),E=t.dot(f,h),m=t.dot(f,d),y=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,a,i),h=e.subtract(c,a,o),d=e.subtract(r,a,u),p=e.dot(f,f),E=e.dot(f,h),m=e.dot(f,d),y=e.dot(h,h),_=e.dot(h,d));var T=1/(p*y-E*E);return l.y=(y*m-E*_)*T,l.z=(p*_-E*m)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,n){t(n)||(n={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),n.high=r,n.low=e-r):(r=65536*Math.floor(-e/65536),n.high=-r,n.low=e+r),n};var a={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var i=n.high,o=n.low;return r.encode(e.x,a),i.x=a.high,o.x=a.low,r.encode(e.y,a),i.y=a.high,o.y=a.low,r.encode(e.z,a),i.z=a.high,o.z=a.low,n};var i=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,i);var a=i.high,o=i.low;t[n]=a.x,t[n+1]=a.y,t[n+2]=a.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,p=o*s-h,E=o*c-u*s,m=u*c-d,y=4*p*m-E*E;if(y<0){var _,T,v;h*f>=l*d?(_=o,T=p,v=-2*u*p+o*E):(_=c,T=m,v=-c*E+2*s*m);var R=v<0?-1:1,A=-R*Math.abs(_)*Math.sqrt(-y);i=-v+A;var S=i/2,g=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),N=i===A?-g:-T/g;return a=T<=0?g+N:-v/(g*g+N*N+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var w=p,O=-2*u*p+o*E,x=m,I=-c*E+2*s*m,M=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*M,-O)/3);a=2*Math.sqrt(-w);var D=Math.cos(P);i=a*D;var U=a*(-D/2-C*Math.sin(P)),L=i+U>2*u?i-u:U-u,b=o,F=L/b;P=Math.abs(Math.atan2(c*M,-I)/3),a=2*Math.sqrt(-x),D=Math.cos(P),i=a*D,U=a*(-D/2-C*Math.sin(P));var B=-c,z=i+U<2*s?i+s:U+s,G=B/z,q=b*z,W=-L*z-b*B,V=L*B,X=(s*W-u*V)/(-u*W+s*q);return F<=X?F<=G?X<=G?[F,X,G]:[F,G,X]:[G,F,X]:F<=G?[X,F,G]:X<=G?[X,G,F]:[G,X,F]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var p=r.computeRealRoots(1,s,l);if(2===p.length){var E,m=p[0],y=p[1];if(m>=0&&y>=0){var _=Math.sqrt(m),T=Math.sqrt(y);return[h-T,h-_,h+_,h+T]}if(m>=0&&y<0)return E=Math.sqrt(m),[h-E,h+E];if(m<0&&y>=0)return E=Math.sqrt(y),[h-E,h+E]}return[]}if(d>0){var v=Math.sqrt(d),R=(s+d-c/v)/2,A=(s+d+c/v)/2,S=r.computeRealRoots(1,v,R),g=r.computeRealRoots(1,-v,A);return 0!==S.length?(S[0]+=h,S[1]+=h,0!==g.length?(g[0]+=h,g[1]+=h,S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>g[0]&&S[0]<g[1]?[g[0],S[0],g[1],S[1]]:[S[0],g[0],S[1],g[1]]):S):0!==g.length?(g[0]+=h,g[1]+=h,g):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var p,E,m=d[0],y=a-m,_=y*y,T=t/2,v=y/2,R=_-4*o,A=_+4*Math.abs(o),S=c-4*m,g=c+4*Math.abs(m);if(m<0||R*g<S*A){var N=Math.sqrt(S);p=N/2,E=0===N?0:(t*v-i)/N}else{var w=Math.sqrt(R);p=0===w?0:(t*v-i)/w,E=w/2}var O,x;0===T&&0===p?(O=0,x=0):n.sign(T)===n.sign(p)?(O=T+p,x=m/O):(x=T-p,O=m/x);var I,M;0===v&&0===E?(I=0,M=0):n.sign(v)===n.sign(E)?(I=v+E,M=o/I):(M=v-E,I=o/M);var C=r.computeRealRoots(1,O,I),P=r.computeRealRoots(1,x,M);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C; -if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,p=d*a,E=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*p+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return E},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,_),h=e.dot(u,u),d=2*e.dot(u,l),p=e.magnitudeSquared(l)-c,E=f(h,d,p,A);if(r(E))return a.start=E.root0,a.stop=E.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function p(t,n,r,a,i){var l,f=a*a,h=i*i,p=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,E=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),m=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,y=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===_&&0===y){if(l=s.computeRealRoots(p,E,m),0===l.length)return T;var v=l[0],R=Math.sqrt(Math.max(1-v*v,0));if(T.push(new e(a,i*v,i*-R)),T.push(new e(a,i*v,i*R)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,i*A,i*-S)),T.push(new e(a,i*A,i*S))}return T}var g=_*_,N=y*y,w=p*p,O=_*y,x=w+N,I=2*(E*p+O),M=2*m*p+E*E-N+g,C=2*(m*E-O),P=m*m-g;if(0===x&&0===I&&0===M&&0===C)return T;l=c.computeRealRoots(x,I,M,C,P);var D=l.length;if(0===D)return T;for(var U=0;U<D;++U){var L,b=l[U],F=b*b,B=Math.max(1-F,0),z=Math.sqrt(B);L=o.sign(p)===o.sign(m)?d(p*F+m,E*b,o.EPSILON12):o.sign(m)===o.sign(E*b)?d(p*F,E*b+m,o.EPSILON12):d(p*F+E*b,m,o.EPSILON12);var G=d(y*b,_,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*b,i*z)):q>0?T.push(new e(a,i*b,i*-z)):0!==z?(T.push(new e(a,i*b,i*-z)),T.push(new e(a,i*b,i*z)),++U):T.push(new e(a,i*b,i*z))}return T}var E={};E.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var m=new e,y=new e,_=new e,T=new e,v=new e;E.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,p=t.direction,E=e.subtract(a,r,m),R=e.subtract(i,r,y),A=e.cross(p,R,_),S=e.dot(E,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,E,v),f=e.dot(p,c),f<0||l+f>S)return;h=e.dot(R,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var g=1/S;if(s=e.subtract(d,r,T),l=e.dot(s,A)*g,l<0||l>1)return;if(c=e.cross(s,E,v),f=e.dot(p,c)*g,f<0||l+f>1)return;h=e.dot(R,c)*g}return h},E.rayTriangle=function(t,n,a,i,o,u){var s=E.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new l;E.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};E.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new l;E.lineSegmentSphere=function(t,n,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var g=new e,N=new e;E.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,g),f=e.multiplyComponents(c,t.direction,N),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var p=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,p<o)return;if(p>o){u=d*d-o,s=-d+Math.sqrt(u);var E=s/a,m=r/s;return E<m?new i(E,m):{start:m,stop:E}}var y=Math.sqrt(r/a);return new i(y,y)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var w=new e,O=new e,x=new e,I=new e,M=new e,C=new u,P=new u,D=new u,U=new u,L=new u,b=new u,F=new u,B=new e,z=new e,G=new t;E.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,w);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,w),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,I),d=e.normalize(e.cross(h,f,O),O),E=e.normalize(e.cross(f,d,x),x),m=C;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=E.x,m[7]=E.y,m[8]=E.z;var y=u.transpose(m,P),_=u.fromScale(n.radii,D),T=u.fromScale(n.oneOverRadii,U),v=L;v[0]=0,v[1]=-i.z,v[2]=i.y,v[3]=i.z,v[4]=0,v[5]=-i.x,v[6]=-i.y,v[7]=i.x,v[8]=0;var R,A,S=u.multiply(u.multiply(y,T,b),v,b),g=u.multiply(u.multiply(S,_,F),m,F),N=u.multiplyByVector(S,a,M),q=p(g,e.negate(N,w),0,0,1),W=q.length;if(W>0){for(var V=e.clone(e.ZERO,z),X=Number.NEGATIVE_INFINITY,H=0;H<W;++H){R=u.multiplyByVector(_,u.multiplyByVector(m,q[H],B),B);var Y=e.normalize(e.subtract(R,a,I),I),k=e.dot(Y,i);k>X&&(X=k,V=e.clone(R,V))}var Z=n.cartesianToCartographic(V,G);return X=o.clamp(X,0,1),A=e.magnitude(e.subtract(V,a,I))*Math.sqrt(1-X*X),A=c?-A:A,Z.height=A,n.cartographicToCartesian(Z,new e)}};var q=new e;return E.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},E.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return E.lineSegmentPlane(t,n,a,f),E.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(n,r,a,f),E.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(r,t,a,f),E.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(n,t,a,f),E.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(r,n,a,f),E.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,r,a,f),E.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.calculateACMR=function(n){n=e(n,e.EMPTY_OBJECT);var r=n.indices,a=n.maximumIndex,i=e(n.cacheSize,24),o=r.length;if(!t(a)){a=0;for(var u=0,s=r[u];u<o;)s>a&&(a=s),++u,s=r[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,h=0;h<o;++h)f-c[r[h]]>i&&(c[r[h]]=f,++f);return(f-i+1)/(o/3)},r.tipsify=function(n){function r(e,t,n,r){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<r;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,n,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<n.length;){var h=n[f];a[h].numLiveTriangles&&(s=0,i-a[h].timeStamp+2*a[h].numLiveTriangles<=t&&(s=i-a[h].timeStamp),(s>l||l===-1)&&(l=s,c=h)),++f}return c===-1?r(a,o,e,u):c}n=e(n,e.EMPTY_OBJECT);var i,o=n.indices,u=n.maximumIndex,s=e(n.cacheSize,24),c=o.length,l=0,f=0,h=o[f],d=c;if(t(u))l=u+1;else{for(;f<d;)h>l&&(l=h),++f,h=o[f];if(l===-1)return 0;++l}for(var p=[],E=0;E<l;E++)p[E]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var m=0;f<d;)p[o[f]].vertexTriangles.push(m),++p[o[f]].numLiveTriangles,p[o[f+1]].vertexTriangles.push(m),++p[o[f+1]].numLiveTriangles,p[o[f+2]].vertexTriangles.push(m),++p[o[f+2]].numLiveTriangles,++m,f+=3;var y=0,_=s+1;i=1;var T,v,R=[],A=[],S=0,g=[],N=c/3,w=[];for(E=0;E<N;E++)w[E]=!1;for(var O,x;y!==-1;){R=[],v=p[y],x=v.vertexTriangles.length;for(var I=0;I<x;++I)if(m=v.vertexTriangles[I],!w[m]){w[m]=!0,f=m+m+m;for(var M=0;M<3;++M)O=o[f],R.push(O),A.push(O),g[S]=O,++S,T=p[O],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}y=a(o,s,R,p,_,A,l)}return g},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,m,y,_,T,v,R,A,S,g){"use strict";function N(e,t,n,r,a){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=a,e[t++]=a,e[t]=n}function w(e){for(var t=e.length,n=t/3*6,r=m.createTypedArray(t,n),a=0,i=0;i<t;i+=3,a+=6)N(r,a,e[i],e[i+1],e[i+2]);return r}function O(e){var t=e.length;if(t>=3){var n=6*(t-2),r=m.createTypedArray(t,n);N(r,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)N(r,a,e[i-1],e[i],e[i-2]);return r}return new Uint16Array}function x(e){if(e.length>0){for(var t=e.length-1,n=6*(t-1),r=m.createTypedArray(t,n),a=e[0],i=0,o=1;o<t;++o,i+=6)N(r,i,a,e[o],e[o+1]);return r}return new Uint16Array}function I(e){var t={};for(var n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){var r=e[n];t[n]=new p({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function M(e,t,n){for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values))for(var a=t[r],i=0;i<a.componentsPerAttribute;++i)e[r].values.push(a.values[n*a.componentsPerAttribute+i])}function C(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),R.multiplyByPoint(e,ie,ie),a.pack(ie,n,i)}function P(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),v.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,n,i)}function D(e,t){var n,r=e.length,a={},i=e[0][t].attributes;for(n in i)if(i.hasOwnProperty(n)&&c(i[n])&&c(i[n].values)){for(var o=i[n],s=o.values.length,l=!0,f=1;f<r;++f){var h=e[f][t].attributes[n];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(a[n]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var r,i,o,u,s,l,f,h=e.length,p=(e[0].modelMatrix,c(e[0][t].indices)),E=e[0][t].primitiveType,y=D(e,t);for(r in y)if(y.hasOwnProperty(r))for(s=y[r].values,u=0,i=0;i<h;++i)for(l=e[i][t].attributes[r].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(p){var T=0;for(i=0;i<h;++i)T+=e[i][t].indices.length;var v=d.computeNumberOfVertices(new d({attributes:y,primitiveType:S.POINTS})),R=m.createTypedArray(v,T),A=0,g=0;for(i=0;i<h;++i){var N=e[i][t].indices,w=N.length;for(u=0;u<w;++u)R[A++]=g+N[u];g+=d.computeNumberOfVertices(e[i][t])}_=R}var O,x=new a,I=0;for(i=0;i<h;++i){if(O=e[i][t].boundingSphere,!c(O)){x=void 0;break}a.add(O.center,x,x)}if(c(x))for(a.divideByScalar(x,h,x),i=0;i<h;++i){O=e[i][t].boundingSphere;var M=a.magnitude(a.subtract(O.center,x,se))+O.radius;M>I&&(I=M)}return new d({attributes:y,indices:_,primitiveType:E,boundingSphere:c(x)?new n(x,I):void 0})}function L(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function b(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;for(var r=3,a=3;a<t;++a)n[r++]=a-1,n[r++]=0,n[r++]=a;return e.indices=n,e.primitiveType=S.TRIANGLES,e}function F(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);for(var r=6,a=3;a<t-1;a+=2)n[r++]=a,n[r++]=a-1,n[r++]=a+1,a+2<t&&(n[r++]=a,n[r++]=a+1,n[r++]=a+2);return e.indices=n,e.primitiveType=S.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function z(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return e.indices=n,e.primitiveType=S.LINES,e}function G(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return n[r++]=t-1,n[r]=0,e.indices=n,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return b(e);case S.TRIANGLE_STRIP:return F(e);case S.TRIANGLES:return L(e);case S.LINE_STRIP:return z(e);case S.LINE_LOOP:return G(e);case S.LINES:return B(e)}return e}function W(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function V(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return W(e,e.y<0),W(t,t.y<0),void W(n,n.y<0);var r,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(n.y);r=a>i?a>o?T.sign(e.y):T.sign(n.y):i>o?T.sign(t.y):T.sign(n.y);var u=r<0;W(e,u),W(t,u),W(n,u)}function X(e,t,n,r){a.add(e,a.multiplyByScalar(a.subtract(t,e,Re),e.y/(e.y-t.y),Re),n),a.clone(n,r),W(n,!0),W(r,!1)}function H(e,t,n){if(!(e.x>=0||t.x>=0||n.x>=0)){V(e,t,n);var r=e.y<0,a=t.y<0,i=n.y<0,o=0;o+=r?1:0,o+=a?1:0,o+=i?1:0;var u=we.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,r?(X(e,t,Ae,ge),X(e,n,Se,Ne),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(X(t,n,Ae,ge),X(t,e,Se,Ne),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(X(n,e,Ae,ge),X(n,t,Se,Ne),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,r?a?i||(X(n,e,Ae,ge),X(n,t,Se,Ne),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(X(t,n,Ae,ge),X(t,e,Se,Ne),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(X(e,t,Ae,ge),X(e,n,Se,Ne),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=we.positions;return s[0]=e,s[1]=t,s[2]=n,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=Se,s[5]=ge,s[6]=Ne,s.length=7),we}}function Y(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var a in r)if(r.hasOwnProperty(a)&&c(r[a])&&c(r[a].values)){var i=r[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=d.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function k(e){var t=e.attributes,n={};for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values)){var a=t[r];n[r]=new p({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new d({attributes:n,indices:[],primitiveType:e.primitiveType})}function Z(e,t,n){var r=c(e.geometry.boundingSphere);t=Y(t,r),n=Y(n,r),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function j(e,n,i,o,u,s,l,f,h,d,p,E){if(c(s)||c(l)||c(f)||c(h)||c(d)){var m=a.fromArray(u,3*e,Oe),y=a.fromArray(u,3*n,xe),_=a.fromArray(u,3*i,Ie),T=t(o,m,y,_,Me);if(c(s)){var v=a.fromArray(s,3*e,Oe),R=a.fromArray(s,3*n,xe),A=a.fromArray(s,3*i,Ie);a.multiplyByScalar(v,T.x,v),a.multiplyByScalar(R,T.y,R),a.multiplyByScalar(A,T.z,A);var S=a.add(v,R,v);a.add(S,A,S),a.normalize(S,S),a.pack(S,p.normal.values,3*E)}if(c(d)){var g=a.fromArray(d,3*e,Oe),N=a.fromArray(d,3*n,xe),w=a.fromArray(d,3*i,Ie);a.multiplyByScalar(g,T.x,g),a.multiplyByScalar(N,T.y,N),a.multiplyByScalar(w,T.z,w);var O;a.equals(g,a.ZERO)&&a.equals(N,a.ZERO)&&a.equals(w,a.ZERO)?(O=Oe,O.x=0,O.y=0,O.z=0):(O=a.add(g,N,g),a.add(O,w,O),a.normalize(O,O)),a.pack(O,p.extrudeDirection.values,3*E)}if(c(l)){var x=a.fromArray(l,3*e,Oe),I=a.fromArray(l,3*n,xe),M=a.fromArray(l,3*i,Ie);a.multiplyByScalar(x,T.x,x),a.multiplyByScalar(I,T.y,I),a.multiplyByScalar(M,T.z,M);var C=a.add(x,I,x);a.add(C,M,C),a.normalize(C,C),a.pack(C,p.tangent.values,3*E)}if(c(f)){var P=a.fromArray(f,3*e,Oe),D=a.fromArray(f,3*n,xe),U=a.fromArray(f,3*i,Ie);a.multiplyByScalar(P,T.x,P),a.multiplyByScalar(D,T.y,D),a.multiplyByScalar(U,T.z,U);var L=a.add(P,D,P);a.add(L,U,L),a.normalize(L,L),a.pack(L,p.bitangent.values,3*E)}if(c(h)){var b=r.fromArray(h,2*e,Ce),F=r.fromArray(h,2*n,Pe),B=r.fromArray(h,2*i,De);r.multiplyByScalar(b,T.x,b),r.multiplyByScalar(F,T.y,F),r.multiplyByScalar(B,T.z,B);var z=r.add(b,F,b);r.add(z,B,z),r.pack(z,p.st.values,2*E)}}}function K(e,t,n,r,a,i){var o=e.position.values.length/3;if(a!==-1){var u=r[a],s=n[u];return s===-1?(n[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,n,r,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,h=c(s.bitangent)?s.bitangent.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,p=c(s.st)?s.st.values:void 0,E=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,m=u.indices,y=k(u),_=k(u),T=[];T.length=l.length/3;var v=[];for(v.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,v[o]=-1;var R=m.length;for(o=0;o<R;o+=3){var A=m[o],S=m[o+1],g=m[o+2],N=a.fromArray(l,3*A),w=a.fromArray(l,3*S),O=a.fromArray(l,3*g),x=H(N,w,O);if(c(x)&&x.positions.length>3)for(var I=x.positions,M=x.indices,C=M.length,P=0;P<C;++P){var D=M[P],U=I[D];U.y<0?(t=_.attributes,n=_.indices,r=T):(t=y.attributes,n=y.indices,r=v),i=K(t,n,r,m,D<3?o+D:-1,U),j(A,S,g,U,l,f,d,h,p,E,t,i)}else c(x)&&(N=x.positions[0],w=x.positions[1],O=x.positions[2]),N.y<0?(t=_.attributes,n=_.indices,r=T):(t=y.attributes,n=y.indices,r=v),i=K(t,n,r,m,o,N),j(A,S,g,N,l,f,d,h,p,E,t,i),i=K(t,n,r,m,o+1,w),j(A,S,g,w,l,f,d,h,p,E,t,i),i=K(t,n,r,m,o+2,O),j(A,S,g,O,l,f,d,h,p,E,t,i)}Z(e,_,y)}function Q(e){var t,n=e.geometry,r=n.attributes,i=r.position.values,o=n.indices,u=k(n),s=k(n),l=o.length,f=[];f.length=i.length/3;var h=[];for(h.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,h[t]=-1;for(t=0;t<l;t+=2){var d=o[t],p=o[t+1],E=a.fromArray(i,3*d,Oe),m=a.fromArray(i,3*p,xe);Math.abs(E.y)<T.EPSILON6&&(E.y<0?E.y=-T.EPSILON6:E.y=T.EPSILON6),Math.abs(m.y)<T.EPSILON6&&(m.y<0?m.y=-T.EPSILON6:m.y=T.EPSILON6);var y=u.attributes,v=u.indices,R=h,A=s.attributes,S=s.indices,g=f,N=_.lineSegmentPlane(E,m,Ue,Ie);if(c(N)){var w=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Le);E.y<0&&(a.negate(w,w),y=s.attributes,v=s.indices,R=f,A=u.attributes,S=u.indices,g=h);var O=a.add(N,w,be);K(y,v,R,o,t,E),K(y,v,R,o,-1,O),a.negate(w,w),a.add(N,w,O),K(A,S,g,o,-1,O),K(A,S,g,o,t+1,m)}else{var x,I,M;E.y<0?(x=s.attributes,I=s.indices,M=f):(x=u.attributes,I=u.indices,M=h),K(x,I,M,o,t,E),K(x,I,M,o,t+1,m)}}Z(e,s,u)}function $(e){for(var t=e.attributes,n=t.position.values,r=t.prevPosition.values,i=t.nextPosition.values,o=n.length,u=0;u<o;u+=3){var s=a.unpack(n,u,ze);if(!(s.x>0)){var c=a.unpack(r,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(r[u]=n[u-3],r[u+1]=n[u-2],r[u+2]=n[u-1]):a.pack(s,r,u));var l=a.unpack(i,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=n[u+3],i[u+1]=n[u+4],i[u+2]=n[u+5]):a.pack(s,i,u))}}}function ee(e){var t,n,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,h=s.nextPosition.values,d=s.expandAndWidth.values,p=c(s.st)?s.st.values:void 0,E=c(s.color)?s.color.values:void 0,m=k(u),y=k(u),v=!1,R=l.length/3;for(t=0;t<R;t+=4){var A=t,S=t+2,g=a.fromArray(l,3*A,ze),N=a.fromArray(l,3*S,Ge);if(Math.abs(g.y)<ke)for(g.y=ke*(N.y<0?-1:1),l[3*t+1]=g.y,l[3*(t+1)+1]=g.y,n=3*A;n<3*A+12;n+=3)f[n]=l[3*t],f[n+1]=l[3*t+1],f[n+2]=l[3*t+2];if(Math.abs(N.y)<ke)for(N.y=ke*(g.y<0?-1:1),l[3*(t+2)+1]=N.y,l[3*(t+3)+1]=N.y,n=3*A;n<3*A+12;n+=3)h[n]=l[3*(t+2)],h[n+1]=l[3*(t+2)+1],h[n+2]=l[3*(t+2)+2];var w=m.attributes,O=m.indices,x=y.attributes,I=y.indices,M=_.lineSegmentPlane(g,N,Ue,We);if(c(M)){v=!0;var C=a.multiplyByScalar(a.UNIT_Y,Ye,Ve);g.y<0&&(a.negate(C,C),w=y.attributes,O=y.indices,x=m.attributes,I=m.indices);var P=a.add(M,C,Xe);w.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),w.position.values.push(P.x,P.y,P.z),w.position.values.push(P.x,P.y,P.z),w.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),w.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),w.prevPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),w.nextPosition.values.push(P.x,P.y,P.z),w.nextPosition.values.push(P.x,P.y,P.z),w.nextPosition.values.push(P.x,P.y,P.z),w.nextPosition.values.push(P.x,P.y,P.z),a.negate(C,C),a.add(M,C,P),x.position.values.push(P.x,P.y,P.z),x.position.values.push(P.x,P.y,P.z),x.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),x.nextPosition.values.push(h[3*S],h[3*S+1],h[3*S+2]),x.nextPosition.values.push(h[3*S+3],h[3*S+4],h[3*S+5]);var D=r.fromArray(d,2*A,Fe),U=Math.abs(D.y);w.expandAndWidth.values.push(-1,U,1,U),w.expandAndWidth.values.push(-1,-U,1,-U),x.expandAndWidth.values.push(-1,U,1,U),x.expandAndWidth.values.push(-1,-U,1,-U);var L=a.magnitudeSquared(a.subtract(M,g,qe));if(L/=a.magnitudeSquared(a.subtract(N,g,qe)),c(E)){var b=i.fromArray(E,4*A,He),F=i.fromArray(E,4*S,He),B=T.lerp(b.x,F.x,L),z=T.lerp(b.y,F.y,L),G=T.lerp(b.z,F.z,L),q=T.lerp(b.w,F.w,L);for(n=4*A;n<4*A+8;++n)w.color.values.push(E[n]);for(w.color.values.push(B,z,G,q),w.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),n=4*S;n<4*S+8;++n)x.color.values.push(E[n])}if(c(p)){var W=r.fromArray(p,2*A,Fe),V=r.fromArray(p,2*(t+3),Be),X=T.lerp(W.x,V.x,L);for(n=2*A;n<2*A+4;++n)w.st.values.push(p[n]);for(w.st.values.push(X,W.y),w.st.values.push(X,V.y),x.st.values.push(X,W.y),x.st.values.push(X,V.y),n=2*S;n<2*S+4;++n)x.st.values.push(p[n])}o=w.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=x.position.values.length/3-4,I.push(o,o+2,o+1),I.push(o+1,o+2,o+3)}else{var H,Y;for(g.y<0?(H=y.attributes,Y=y.indices):(H=m.attributes,Y=m.indices),H.position.values.push(g.x,g.y,g.z),H.position.values.push(g.x,g.y,g.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),n=3*t;n<3*t+12;++n)H.prevPosition.values.push(f[n]),H.nextPosition.values.push(h[n]);for(n=2*t;n<2*t+8;++n)H.expandAndWidth.values.push(d[n]),c(p)&&H.st.values.push(p[n]);if(c(E))for(n=4*t;n<4*t+16;++n)H.color.values.push(E[n]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}v&&($(y),$(m)),Z(e,y,m)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=w(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=x(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,r){t=s(t,"normal"),r=s(r,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,h=0;h<o;h+=3)l[f++]=a[h],l[f++]=a[h+1],l[f++]=a[h+2],l[f++]=a[h]+i[h]*r,l[f++]=a[h+1]+i[h+1]*r,l[f++]=a[h+2]+i[h+2]*r;var E,m=e.boundingSphere;return c(m)&&(E=new n(m.center,m.radius+r)),new d({attributes:{position:new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:E})},te.createAttributeLocations=function(e){var t,n=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,a={},i=0,o=n.length;for(t=0;t<o;++t){var u=n[t];c(r[u])&&(a[u]=i++)}for(var s in r)r.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),n=e.indices;if(c(n)){for(var r=new Int32Array(t),a=0;a<t;a++)r[a]=-1;for(var i,o=n,s=o.length,l=m.createTypedArray(t,s),f=0,h=0,p=0;f<s;)i=r[o[f]],i!==-1?l[h]=i:(i=o[f],r[i]=p,l[h]=p,++p),++f,++h;e.indices=l;var E=e.attributes;for(var y in E)if(E.hasOwnProperty(y)&&c(E[y])&&c(E[y].values)){for(var _=E[y],T=_.values,v=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,p*R);v<t;){var S=r[v];if(S!==-1)for(a=0;a<R;a++)A[R*S+a]=T[R*v+a];++v}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var n=e.indices;if(e.primitiveType===S.TRIANGLES&&c(n)){for(var r=n.length,a=0,i=0;i<r;i++)n[i]>a&&(a=n[i]);e.indices=g.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],n=d.computeNumberOfVertices(e);if(c(e.indices)&&n>=T.SIXTY_FOUR_KILOBYTES){var r,a=[],i=[],o=0,u=I(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?r=3:e.primitiveType===S.LINES?r=2:e.primitiveType===S.POINTS&&(r=1);for(var f=0;f<l;f+=r){for(var h=0;h<r;++h){var p=s[f+h],E=a[p];c(E)||(E=o++,a[p]=E,M(u,e.attributes,p)),i.push(E)}o+r>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=I(e.attributes))}0!==i.length&&t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ne=new a,re=new o;te.projectTo2D=function(e,t,n,r,i){var o=e.attributes[t];i=c(i)?i:new h;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),d=0,E=0;E<l.length;E+=3){var m=a.fromArray(l,E,ne),y=s.cartesianToCartographic(m,re),_=i.project(y,ne);f[d++]=_.x,f[d++]=_.y,f[d++]=_.z}return e.attributes[n]=o,e.attributes[r]=new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,n,r){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var h=a.componentsPerAttribute;return e.attributes[n]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[r]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};var ie=new a,oe=new R,ue=new v;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(R.equals(t,R.IDENTITY))return e;var r=e.geometry.attributes;C(t,r.position),C(t,r.prevPosition),C(t,r.nextPosition),(c(r.normal)||c(r.tangent)||c(r.bitangent))&&(R.inverse(t,oe),R.transpose(oe,oe),R.getRotation(oe,ue),P(ue,r.normal),P(ue,r.tangent),P(ue,r.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=n.transform(a,t,a)),e.modelMatrix=R.clone(R.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],n=[],r=e.length,a=0;a<r;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&n.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),n.length>0&&(o.push(U(n,"westHemisphereGeometry")),o.push(U(n,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,fe=new a,he=new a;te.computeNormal=function(e){for(var t=e.indices,n=e.attributes,r=n.position.values,i=n.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;f<o;f+=3){var d=t[f],E=t[f+1],m=t[f+2],y=3*d,_=3*E,v=3*m;le.x=r[y],le.y=r[y+1],le.z=r[y+2],fe.x=r[_],fe.y=r[_+1],fe.z=r[_+2],he.x=r[v],he.y=r[v+1],he.z=r[v+2],s[d].count++,s[E].count++,s[m].count++,a.subtract(fe,le,fe),a.subtract(he,le,he),c[h]=a.cross(fe,he,new a),h++}var R=0;for(f=0;f<i;f++)s[f].indexOffset+=R,R+=s[f].count;h=0;var A;for(f=0;f<o;f+=3){A=s[t[f]];var S=A.indexOffset+A.currentCount;l[S]=h,A.currentCount++,A=s[t[f+1]],S=A.indexOffset+A.currentCount,l[S]=h,A.currentCount++,A=s[t[f+2]],S=A.indexOffset+A.currentCount,l[S]=h,A.currentCount++,h++}var g=new Float32Array(3*i);for(f=0;f<i;f++){var N=3*f;if(A=s[f],a.clone(a.ZERO,ce),A.count>0){for(h=0;h<A.count;h++)a.add(ce,c[l[A.indexOffset+h]],ce);a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&a.clone(c[l[A.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),g[N]=ce.x,g[N+1]=ce.y,g[N+2]=ce.z}return e.attributes.normal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:g}),e};var de=new a,pe=new a,Ee=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),n=e.attributes.position.values,r=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,h,d;for(l=0;l<s;l+=3){var E=t[l],m=t[l+1],y=t[l+2];f=3*E,h=3*m,d=3*y;var _=2*E,T=2*m,v=2*y,R=n[f],A=n[f+1],S=n[f+2],g=i[_],N=i[_+1],w=i[T+1]-N,O=i[v+1]-N,x=1/((i[T]-g)*O-(i[v]-g)*w),I=(O*(n[h]-R)-w*(n[d]-R))*x,M=(O*(n[h+1]-A)-w*(n[d+1]-A))*x,C=(O*(n[h+2]-S)-w*(n[d+2]-S))*x;c[f]+=I,c[f+1]+=M,c[f+2]+=C,c[h]+=I,c[h+1]+=M,c[h+2]+=C,c[d]+=I,c[d+1]+=M,c[d+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,h=f+1,d=f+2;var U=a.fromArray(r,f,de),L=a.fromArray(c,f,Ee),b=a.dot(U,L);a.multiplyByScalar(U,b,pe),a.normalize(a.subtract(L,pe,L),L),P[f]=L.x,P[h]=L.y,P[d]=L.z,a.normalize(a.cross(U,L,L),L),D[f]=L.x,D[h]=L.y,D[d]=L.z}return e.attributes.tangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e};var me=new r,ye=new a,_e=new a,Te=new a,ve=new r;te.compressVertices=function(t){var n,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),f=0;for(n=0;n<i;++n)a.fromArray(s,3*n,ye),a.equals(ye,a.ZERO)?f+=2:(ve=e.octEncodeInRange(ye,65535,ve),l[f++]=ve.x,l[f++]=ve.y);return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,d=t.attributes.st,E=c(h),m=c(d);if(!E&&!m)return t;var y,_,T,v,R=t.attributes.tangent,A=t.attributes.bitangent,S=c(R),g=c(A);E&&(y=h.values),m&&(_=d.values),S&&(T=R.values),g&&(v=A.values);var N=E?y.length:_.length,w=E?3:2;i=N/w;var O=i,x=m&&E?2:1;x+=S||g?1:0,O*=x;var I=new Float32Array(O),M=0;for(n=0;n<i;++n){m&&(r.fromArray(_,2*n,me),I[M++]=e.compressTextureCoordinates(me));var C=3*n;E&&c(T)&&c(v)?(a.fromArray(y,C,ye),a.fromArray(T,C,_e),a.fromArray(v,C,Te),e.octPack(ye,_e,Te,me),I[M++]=me.x,I[M++]=me.y):(E&&(a.fromArray(y,C,ye),I[M++]=e.octEncodeFloat(ye)),S&&(a.fromArray(T,C,ye), -I[M++]=e.octEncodeFloat(ye)),g&&(a.fromArray(v,C,ye),I[M++]=e.octEncodeFloat(ye)))}return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:x,values:I}),E&&delete t.attributes.normal,m&&delete t.attributes.st,g&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Re=new a,Ae=new a,Se=new a,ge=new a,Ne=new a,we={positions:new Array(7),indices:new Array(9)},Oe=new a,xe=new a,Ie=new a,Me=new a,Ce=new r,Pe=new r,De=new r,Ue=A.fromPointNormal(a.ZERO,a.UNIT_Y),Le=new a,be=new a,Fe=new r,Be=new r,ze=new a,Ge=new a,qe=new a,We=new a,Ve=new a,Xe=new a,He=new i,Ye=5*T.EPSILON9,ke=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(c(r)){var a=r.center.x-r.radius;if(a>0||n.intersectPlane(r,A.ORIGIN_ZX_PLANE)!==y.INTERSECTING)return e}if(t.geometryType!==E.NONE)switch(t.geometryType){case E.POLYLINES:ee(e);break;case E.TRIANGLES:J(e);break;case E.LINES:Q(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&Q(e);return e},te}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,p,E,m;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var y=a;y<o;y+=a)p=e[y],E=e[y+1],p<l&&(l=p),E<f&&(f=E),p>h&&(h=p),E>d&&(d=E);m=Math.max(h-l,d-f)}return r(u,c,a,l,f,m),c}function t(e,t,n,r,a){var i,o;if(a===x(e,t,n,r)>0)for(i=t;i<n;i+=r)o=N(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=N(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(w(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(w(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var p,E,m=e;e.prev!==e.next;)if(p=e.prev,E=e.next,f?i(e,c,l,f):a(e))t.push(p.i/s),t.push(e.i/s),t.push(E.i/s),w(e),e=E.next,m=E.next;else if(e=E,e===m){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(m(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&_(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(_(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=p(u,s,t,n,r),h=p(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&v(a,r,r.next,i)&&A(a,i)&&A(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),w(r),w(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&y(s,c)){var l=g(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(E(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=g(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&m(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&A(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=p(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function p(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function E(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function m(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function y(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&A(e,t)&&A(t,e)&&S(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function v(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function R(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&v(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function A(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function g(e,t){var n=new O(e.i,e.x,e.y),r=new O(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function N(e,t,n,r){var a=new O(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function w(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,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function x(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(x(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(x(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,p=r[u+2]*n;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,p=new n,E={};E.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},E.computeWindingOrder2D=function(e){var t=E.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},E.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var m=new n,y=new n,_=new n,T=new n,v=new n,R=new n,A=new n;return E.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),p=t.length,E=new Array(3*p),S=0;for(h=0;h<p;h++){var g=t[h];E[S++]=g.x,E[S++]=g.y,E[S++]=g.z}for(var N=[],w={},O=e.maximumRadius,x=l.chordLength(u,O),I=x*x;d.length>0;){var M,C,P=d.pop(),D=d.pop(),U=d.pop(),L=n.fromArray(E,3*U,m),b=n.fromArray(E,3*D,y),F=n.fromArray(E,3*P,_),B=n.multiplyByScalar(n.normalize(L,T),O,T),z=n.multiplyByScalar(n.normalize(b,v),O,v),G=n.multiplyByScalar(n.normalize(F,R),O,R),q=n.magnitudeSquared(n.subtract(B,z,A)),W=n.magnitudeSquared(n.subtract(z,G,A)),V=n.magnitudeSquared(n.subtract(G,B,A)),X=Math.max(q,W,V);X>I?q===X?(M=Math.min(U,D)+" "+Math.max(U,D),h=w[M],i(h)||(C=n.add(L,b,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,w[M]=h),d.push(U,h,P),d.push(h,D,P)):W===X?(M=Math.min(D,P)+" "+Math.max(D,P),h=w[M],i(h)||(C=n.add(b,F,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,w[M]=h),d.push(D,h,U),d.push(h,P,U)):V===X&&(M=Math.min(P,U)+" "+Math.max(P,U),h=w[M],i(h)||(C=n.add(F,L,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,w[M]=h),d.push(P,h,D),d.push(h,U,D)):(N.push(U),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:E})},indices:N,primitiveType:f.TRIANGLES})},E.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=p;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},E}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],p=d.x,E=d.y,m=d.z;a=Math.min(p,a),s=Math.max(p,s),o=Math.min(E,o),c=Math.max(E,c),u=Math.min(m,u),l=Math.max(m,l)}var y=r.minimum;y.x=a,y.y=o,y.z=u;var _=r.maximum;_.x=s,_.y=c,_.z=l;var T=e.add(y,_,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return p(e)}function a(e){return p(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,p;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return E(f,e),e},p=function(e){return e=t(e),h=e.then,p=t,d=y,E(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return m(2,arguments),e(t,function(t){function u(e){E(e)}function s(e){p(e)}var c,l,f,h,d,p,E,m,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(n,_)),f=[],l=_-c+1,h=[],d=o(),c)for(m=d.progress,E=function(e){h.push(e),--l||(p=E=y,d.reject(h))},p=function(e){f.push(e),--c||(p=E=y,d.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,m);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return m(1,arguments),h(e,_).then(t,n,r)}function f(){return h(arguments,_)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=v.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function p(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function E(e,t){for(var n,r=0;n=e[r++];)n(t)}function m(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function y(){}function _(e){return e}var T,v,R;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=p,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},v=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,p,E,m,y;if("%%"==e)return"%";for(var _=!1,T="",v=!1,R=!1,A=" ",S=s.length,g=0;s&&g<S;g++)switch(s.charAt(g)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":A=s.charAt(g+1);break;case"0":v=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(y),_,c,f,v,A);case"c":return u(String.fromCharCode(+y),_,c,f,v);case"b":return o(y,2,R,_,c,f,v);case"o":return o(y,8,R,_,c,f,v);case"x":return o(y,16,R,_,c,f,v);case"X":return o(y,16,R,_,c,f,v).toUpperCase();case"u":return o(y,10,R,_,c,f,v);case"i":case"d":return d=+y||0,d=Math.round(d-d%1),p=d<0?"-":T,y=p+a(String(Math.abs(d)),f,"0",!1),i(y,p,_,c,v);case"e":case"E":case"f":case"F":case"g":case"G":return d=+y,p=d<0?"-":T,E=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],y=p+Math.abs(d)[E](f),i(y,p,_,c,v)[m]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return E.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=E.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=E.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}E.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=E.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return E.addSeconds(e,-r[0].offset,n);if(a>=r.length)return E.addSeconds(e,-r[a-1].offset,n);var i=E.secondsDifference(r[a].julianDate,e);return 0===i?E.addSeconds(e,-r[a].offset,n):i<=1?void 0:E.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function p(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function E(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var m=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,v=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,g=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,w=/^(\d{2})(\.\d+)?/.source+N.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,x=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;E.fromDate=function(e,t){var n=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new E(n[0],n[1],c.UTC)},E.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,m=0,T=0,N=0,I=u[0],M=u[1];if(u=I.match(g),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=I.match(R),null!==u)n=+u[1],s=+u[2];else if(u=I.match(v),null!==u)n=+u[1];else{var C;if(u=I.match(A),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=I.match(S),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,U=new Date(Date.UTC(n,0,4));C=7*P+D-U.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(M)){u=M.match(x),null!==u?(h=+u[1],m=+u[2],T=+u[3],N=1e3*+(u[4]||0),L=5):(u=M.match(O),null!==u?(h=+u[1],m=+u[2],T=60*+(u[3]||0),L=4):(u=M.match(w),null!==u&&(h=+u[1],m=60*+(u[2]||0),L=3)));var b=u[L],F=+u[L+1],B=+(u[L+2]||0);switch(b){case"+":h-=F,m-=B;break;case"-":h+=F,m+=B;break;case"Z":break;default:m+=new Date(Date.UTC(n,s-1,l,h,m)).getTimezoneOffset()}}else m+=new Date(n,s-1,l).getTimezoneOffset();var z=60===T;for(z&&T--;m>=60;)m-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?_:y[s-1];for(;m<0;)m+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?_:y[s-1],l+=a;var G=p(n,s,l,h,m,T,N);return r(t)?(d(G[0],G[1],t),f(t)):t=new E(G[0],G[1],c.UTC),z&&E.addSeconds(t,1,t),t},E.now=function(e){return E.fromDate(new Date,e)};var I=new E(0,0,c.TAI);return E.toGregorianDate=function(e,t){var n=!1,a=h(e,I);r(a)||(E.addSeconds(e,-1,I),a=h(I,I),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,p=c-(2447*d/80|0)|0;c=d/11|0;var m=d+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,v=T/s.SECONDS_PER_MINUTE|0;T-=v*s.SECONDS_PER_MINUTE;var R=0|T,A=(T-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(R+=1),r(t)?(t.year=y,t.month=m,t.day=p,t.hour=_,t.minute=v,t.second=R,t.millisecond=A,t.isLeapSecond=n,t):new i(y,m,p,_,v,R,A,n)},E.toDate=function(e){var t=E.toGregorianDate(e,m),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},E.toIso8601=function(t,n){var a,i=E.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},E.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new E(e.dayNumber,e.secondsOfDay,c.TAI)},E.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},E.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(E.secondsDifference(e,t))<=n},E.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},E.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},E.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},E.computeTaiMinusUtc=function(e){T.julianDate=e;var n=E.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},E.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},E.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},E.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},E.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},E.lessThan=function(e,t){return E.compare(e,t)<0},E.lessThanOrEquals=function(e,t){return E.compare(e,t)<=0},E.greaterThan=function(e,t){return E.compare(e,t)>0},E.greaterThanOrEquals=function(e,t){return E.compare(e,t)>=0},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return E.toIso8601(this)},E.leapSeconds=[new u(new E(2441317,43210,c.TAI),10),new u(new E(2441499,43211,c.TAI),11),new u(new E(2441683,43212,c.TAI),12),new u(new E(2442048,43213,c.TAI),13),new u(new E(2442413,43214,c.TAI),14),new u(new E(2442778,43215,c.TAI),15),new u(new E(2443144,43216,c.TAI),16),new u(new E(2443509,43217,c.TAI),17),new u(new E(2443874,43218,c.TAI),18),new u(new E(2444239,43219,c.TAI),19),new u(new E(2444786,43220,c.TAI),20),new u(new E(2445151,43221,c.TAI),21),new u(new E(2445516,43222,c.TAI),22),new u(new E(2446247,43223,c.TAI),23),new u(new E(2447161,43224,c.TAI),24),new u(new E(2447892,43225,c.TAI),25),new u(new E(2448257,43226,c.TAI),26),new u(new E(2448804,43227,c.TAI),27),new u(new E(2449169,43228,c.TAI),28),new u(new E(2449534,43229,c.TAI),29),new u(new E(2450083,43230,c.TAI),30),new u(new E(2450630,43231,c.TAI),31),new u(new E(2451179,43232,c.TAI),32),new u(new E(2453736,43233,c.TAI),33),new u(new E(2454832,43234,c.TAI),34),new u(new E(2456109,43235,c.TAI),35),new u(new E(2457204,43236,c.TAI),36),new u(new E(2457754,43237,c.TAI),37)],E}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var p=new XMLHttpRequest;if(o.contains(e)&&(p.withCredentials=!0),n(h)&&n(p.overrideMimeType)&&p.overrideMimeType(h),p.open(r,e,!0),n(s))for(var E in s)s.hasOwnProperty(E)&&p.setRequestHeader(E,s[E]);n(t)&&(p.responseType=t),p.onload=function(){if(p.status<200||p.status>=300)return void c.reject(new a(p.status,p.response,p.getAllResponseHeaders()));var e=p.response,r=p.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(p.responseXML)&&p.responseXML.hasChildNodes()?c.resolve(p.responseXML):""!==r&&"text"!==r||!n(p.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(p.responseText);else c.resolve(e)},p.onerror=function(e){c.reject(new a)},p.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){ -"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))p(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){p(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function p(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||p<0||E<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var m=e._samples=n.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=E,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,v=0,R=m.length;v<R;v+=e._columnCount){var A=m[v+a],S=m[v+E],g=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(y.push(N),T){if(S!==_&&r(_)){var w=o.leapSeconds,O=t(w,N,d);if(O<0){var x=new u(N,S);w.splice(~O,0,x)}}_=S}}}function E(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function m(e,t,n){return t+e*(n-t)}function y(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return E(e,n,a,s,u),u;if(r.equals(l))return E(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,p=n[h+e._ut1MinusUtcSecondsColumn],y=n[d+e._ut1MinusUtcSecondsColumn],_=y-p;if(_>.5||_<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],v=n[d+e._taiMinusUtcSecondsColumn];T!==v&&(l.equals(r)?p=y:y-=v-T)}return u.xPoleWander=m(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,p,y),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),p=!r(h),E=p||o.greaterThanOrEquals(h,e);if(d&&E)return s=u,!p&&h.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,n),n}var m=t(i,e,o.compare,this._dateColumn);return m>=0?(m<i.length-1&&i[m+1].equals(e)&&++m,s=m,l=m):(l=~m,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=p.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=p,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],p=f;p<=h;++p)d.push(l(this,p));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var p,E,m=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,v=this._xTable;for(p=0;p<=u;++p)y[p]=m-v[p];for(p=0;p<=u;++p){for(T[p]=1,E=0;E<=u;++E)E!==p&&(T[p]*=y[E]);T[p]*=_[p];var R=3*(s+p);n.x+=T[p]*d[R++],n.y+=T[p]*d[R++],n.s+=T[p]*d[R]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=h,a):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],p=e[c.COLUMN2ROW2],E=s+f+p;if(E>0)n=Math.sqrt(E+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var m=h,y=0;f>s&&(y=1),p>s&&p>f&&(y=2);var _=m[y],T=m[_];n=Math.sqrt(e[c.getElementIndex(y,y)]-e[c.getElementIndex(_,_)]-e[c.getElementIndex(T,T)]+1);var v=d;v[y]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,_)]-e[c.getElementIndex(_,T)])*n,v[_]=(e[c.getElementIndex(_,y)]+e[c.getElementIndex(y,_)])*n,v[T]=(e[c.getElementIndex(T,y)]+e[c.getElementIndex(y,T)])*n,a=-v[0],i=-v[1],o=-v[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var p=new l,E=new l,m=new l,y=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),y=l.fromAxisAngle(e.UNIT_X,o.roll,p),m=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(m,y,m),E=l.fromAxisAngle(e.UNIT_Z,-o.heading,p),l.multiply(E,i,i)};var _=new e,T=new e,v=new l,R=new l,A=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,A),l.conjugate(A,A);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),v),l.multiply(v,A,v),v.w<0&&l.negate(v,v),l.computeAxis(v,_);var u=l.computeAngle(v);r[o]=_.x*u,r[o+1]=_.y*u,r[o+2]=_.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,R),0===u?l.clone(l.IDENTITY,v):l.fromAxisAngle(T,u,v),l.multiply(v,R,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,p=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=p,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var S=new l;l.lerp=function(e,t,n,r){return S=l.multiplyByScalar(t,n,S),r=l.multiplyByScalar(e,1-n,r),l.add(S,r,r)};var g=new l,N=new l,w=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=g=l.negate(t,g)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return N=l.multiplyByScalar(e,Math.sin((1-n)*o),N),w=l.multiplyByScalar(i,Math.sin(n*o),w),r=l.add(N,w,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var O=new e,x=new e,I=new l,M=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,I);l.multiply(i,r,M);var o=l.log(M,O);l.multiply(i,t,M);var u=l.log(M,x);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,I),l.multiply(n,I,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,I),u=l.slerp(n,r,a,M);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],b=i.supportsTypedArrays()?new Float32Array(8):[],F=0;F<7;++F){var B=F+1,z=2*B+1;D[F]=1/(B*z),U[F]=B/z}return D[7]=P/136,U[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)L[f]=(D[f]*s-U[f])*o,b[f]=(D[f]*c-U[f])*o;var h=a*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),d=u*(1+b[0]*(1+b[1]*(1+b[2]*(1+b[3]*(1+b[4]*(1+b[5]*(1+b[6]*(1+b[7])))))))),p=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,h,r),l.add(p,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,I),u=l.fastSlerp(n,r,a,M);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,m,y,_,T,v){"use strict";var R={},A={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},S={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},g={},N={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},w=new n,O=new n,x=new n;R.localFrameToFixedFrameGenerator=function(e,t){if(!A.hasOwnProperty(e)||!A[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=A[e][t],i=e+t;return u(g[i])?r=g[i]:(r=function(r,i,s){if(u(s)||(s=new _),m.equalsEpsilon(r.x,0,m.EPSILON14)&&m.equalsEpsilon(r.y,0,m.EPSILON14)){var c=m.sign(r.z);n.unpack(S[e],0,w),"east"!==e&&"west"!==e&&n.multiplyByScalar(w,c,w),n.unpack(S[t],0,O),"east"!==t&&"west"!==t&&n.multiplyByScalar(O,c,O),n.unpack(S[a],0,x),"east"!==a&&"west"!==a&&n.multiplyByScalar(x,c,x)}else{i=o(i,h.WGS84),i.geodeticSurfaceNormal(r,N.up);var l=N.up,f=N.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,N.east),n.cross(l,f,N.north),n.multiplyByScalar(N.up,-1,N.down),n.multiplyByScalar(N.east,-1,N.west),n.multiplyByScalar(N.north,-1,N.south),w=N[e],O=N[t],x=N[a]}return s[0]=w.x,s[1]=w.y,s[2]=w.z,s[3]=0,s[4]=O.x,s[5]=O.y,s[6]=O.z,s[7]=0,s[8]=x.x,s[9]=x.y,s[10]=x.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},g[i]=r),r},R.eastNorthUpToFixedFrame=R.localFrameToFixedFrameGenerator("east","north"),R.northEastDownToFixedFrame=R.localFrameToFixedFrameGenerator("north","east"),R.northUpEastToFixedFrame=R.localFrameToFixedFrameGenerator("north","up"),R.northWestUpToFixedFrame=R.localFrameToFixedFrameGenerator("north","west");var I=new T,M=new n(1,1,1),C=new _;R.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof _&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,R.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,I),c=_.fromTranslationQuaternionRotationScale(n.ZERO,u,M,C);return i=a(e,r,i),_.multiply(i,c,i)};var P=new _,D=new y;R.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=R.headingPitchRollToFixedFrame(e,t,n,r,P),o=_.getRotation(i,D);return T.fromRotationMatrix(o,a)};var U=24110.54841,L=8640184.812866,b=.093104,F=-62e-7,B=1.1772758384668e-19,z=72921158553e-15,G=m.TWO_PI/86400,q=new E;R.computeTemeToPseudoFixedMatrix=function(e,t){q=E.addSeconds(e,-E.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/v.DAYS_PER_JULIAN_CENTURY:(i-.5)/v.DAYS_PER_JULIAN_CENTURY;var o=U+n*(L+n*(b+n*F)),s=o*G%m.TWO_PI,c=z+B*(r-2451545.5),l=(a+.5*v.SECONDS_PER_DAY)%v.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(h,d,0,-d,h,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=l.NONE;var W=32.184,V=2451545;R.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=R.iau2006XysData.preload(n,r,a,i),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var n=R.computeFixedToIcrfMatrix(e,t);if(u(n))return y.transpose(n,t)};var X=new p(0,0,0),H=new f(0,0,0,0,0,0),Y=new y,k=new y;R.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var n=R.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=R.iau2006XysData.computeXysRadians(r,a,X);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,k),h=y.multiply(l,f,Y),d=e.dayNumber,p=e.secondsOfDay-E.computeTaiMinusUtc(e)+n.ut1MinusUtc,_=d-2451545,T=p/v.SECONDS_PER_DAY,A=.779057273264+T+.00273781191135448*(_+T);A=A%1*m.TWO_PI;var S=y.fromRotationZ(A,k),g=y.multiply(h,S,Y),N=Math.cos(n.xPoleWander),w=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),x=Math.sin(n.yPoleWander),I=r-V+a/v.SECONDS_PER_DAY;I/=36525;var M=-47e-6*I*m.RADIANS_PER_DEGREE/3600,C=Math.cos(M),P=Math.sin(M),D=k;return D[0]=N*C,D[1]=N*P,D[2]=O,D[3]=-w*P+x*O*C,D[4]=w*C+x*O*P,D[5]=-x*N,D[6]=-x*P-w*O*C,D[7]=x*C-w*O*P,D[8]=w*N,y.multiply(g,D,t)}}};var Z=new r;R.pointToWindowCoordinates=function(e,t,n,r){return r=R.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},R.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return _.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,J=new n;R.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,h.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,m.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new _,ue=new _;R.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=_.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=R.eastNorthUpToFixedFrame(o,i,oe),c=_.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=_.getColumn(t,0,ee),d=n.magnitude(h),p=_.multiplyByVector(c,h,re);r.fromElements(p.z,p.x,p.y,0,p);var E=_.getColumn(t,1,ee),m=n.magnitude(E),y=_.multiplyByVector(c,E,ae);r.fromElements(y.z,y.x,y.y,0,y);var T=_.getColumn(t,2,ee),v=n.magnitude(T),A=ie;return n.cross(p,y,A),n.normalize(A,A),n.cross(y,A,p),n.normalize(p,p),n.cross(A,p,y),n.normalize(y,y),n.multiplyByScalar(p,d,p),n.multiplyByScalar(y,m,y),n.multiplyByScalar(A,v,A),_.setColumn(a,0,p,a),_.setColumn(a,1,y,a),_.setColumn(a,2,A,a),_.setColumn(a,3,f,a),a};var se=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return R.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=R.eastNorthUpToFixedFrame(t,r,oe),i=_.inverseTransformation(a,ue),o=r.cartesianToCartographic(t,Q),u=e.project(o,$),s=ne;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=_.fromTranslation(s,oe);return _.multiply(se,i,n),_.multiply(c,n,n),n},R}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function p(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,E)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,E));var i=n.fromCartesian4(l.getColumn(r,2,E));this._plane=f.fromPointNormal(e,i)}var E=new r;o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var m=new e;p.fromPoints=function(t,n){var r=e.fromPoints(t,m);return new p(r.center,n)};var y=new h,_=new n;p.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,_);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},p.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},p.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=y;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,_);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},p.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,p=Math.sqrt(d),E=t/4,m=E*E,y=m*E,_=m*m,T=1+E-3*m/4+5*y/4-175*_/64,v=1-E+15*m/8-35*y/8,R=1-3*E+35*m/4,A=1-5*E,S=T*l-v*Math.sin(2*l)*E/2-R*Math.sin(4*l)*m/16-A*Math.sin(6*l)*y/48-5*Math.sin(8*l)*_/512,g=e._constants;g.a=n,g.b=r,g.f=a,g.cosineHeading=i,g.sineHeading=o,g.tanU=u,g.cosineU=s,g.sineU=c,g.sigma=l,g.sineAlpha=f,g.sineSquaredAlpha=h,g.cosineSquaredAlpha=d,g.cosineAlpha=p,g.u2Over4=E,g.u4Over16=m,g.u6Over64=y,g.u8Over256=_,g.a0=T,g.a1=v,g.a2=R,g.a3=A,g.distanceRatio=S}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,p=(t-n)/t,E=i-r,m=Math.atan((1-p)*Math.tan(a)),y=Math.atan((1-p)*Math.tan(o)),_=Math.cos(m),T=Math.sin(m),v=Math.cos(y),R=Math.sin(y),A=_*v,S=_*R,g=T*R,N=T*v,w=E,O=u.TWO_PI,x=Math.cos(w),I=Math.sin(w);do{x=Math.cos(w),I=Math.sin(w);var M=S-N*x;f=Math.sqrt(v*v*I*I+M*M),c=g+A*x,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=A*I/f,h=1-C*C),O=w,d=c-2*g/h,isNaN(d)&&(d=0),w=E+l(p,C,h,s,f,c,d)}while(Math.abs(w-O)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,U=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,b=U*f*(d+U*(c*(2*L-1)-U*d*(4*f*f-3)*(4*L-3)/6)/4),F=n*D*(s-b),B=Math.atan2(v*I,S-N*x),z=Math.atan2(_*I,S*x-N);e._distance=F,e._startHeading=B,e._endHeading=z,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,E),p),e.normalize(i.cartographicToCartesian(a,E),E);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var p=new e,E=new e;return a(d.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}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),p=i*i,E=i*p,m=a.u8Over256,y=a.u2Over4,_=a.u6Over64,T=a.u4Over16,v=2*E*m*o/3+i*(1-y+7*T/4-15*_/4+579*m/64-(T-15*_/4+187*m/16)*o-(5*_/4-115*m/16)*u-29*m*s/16)+(y/2-T+71*_/32-85*m/16)*c+(5*T/16-5*_/4+383*m/96)*f-p*((_-11*m/2)*c+5*m*f/2)+(29*_/96-29*m/16)*h+539*m*d/1536,R=Math.asin(Math.sin(v)*a.cosineAlpha),A=Math.atan(a.a/a.b*Math.tan(R));v-=a.sigma;var S=Math.cos(2*a.sigma+v),g=Math.sin(v),N=Math.cos(v),w=a.cosineU*N,O=a.sineU*g,x=Math.atan2(g*a.sineHeading,w-O*a.cosineHeading),I=x-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,v,g,N,S);return r(n)?(n.longitude=this._start.longitude+I,n.latitude=A,n.height=0,n):new t(this._start.longitude+I,A,0)},d}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=g;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,x),l=a.scaleToGeodeticSurface(n,I),f=p.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,N),E=a.cartesianToCartographic(l,w),m=h(f,i,o);M.setEndPoints(d,E);var y=M.surfaceDistance/f,_=s;d.height=i;var T=a.cartographicToCartesian(d,O);e.pack(T,u,_),_+=3;for(var v=1;v<f;v++){var R=M.interpolateUsingSurfaceDistance(v*y,w);R.height=m[v],T=a.cartographicToCartesian(R,O),e.pack(T,u,_),_+=3}return _}var p={};p.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var E=new t;p.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,E).height}return r};var m=new l,y=new e,_=new e,T=new f(e.ZERO,0),v=new e,R=new f(e.ZERO,0),A=new e,S=new e,g=[],N=new t,w=new t,O=new e,x=new e,I=new e,M=new o;return p.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY); -var s=l.inverseTransformation(a,m),c=l.multiplyByPoint(s,e.ZERO,y),h=l.multiplyByPointAsVector(s,e.UNIT_Y,_),d=f.fromPointNormal(c,h,T),p=l.multiplyByPointAsVector(s,e.UNIT_X,v),E=f.fromPointNormal(c,p,R),g=1;i.push(e.clone(t[0]));for(var N=i[0],w=t.length,O=1;O<w;++O){var x=t[O];if(f.getPointDistance(E,N)<0||f.getPointDistance(E,x)<0){var I=u.lineSegmentPlane(N,x,d,A);if(r(I)){var M=e.multiplyByScalar(h,5e-9,S);f.getPointDistance(d,N)<0&&e.negate(M,M),i.push(e.add(I,M,new e)),o.push(g+1),e.negate(M,M),i.push(e.add(I,M,new e)),g=1}}i.push(e.clone(t[O])),g++,N=x}o.push(g)}return{positions:i,lengths:o}},p.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],x);if(l=f?l[0]:l,0!==l){var E=u.geodeticSurfaceNormal(h,O);e.multiplyByScalar(E,l,E),e.add(h,E,h)}return[h.x,h.y,h.z]}var m=t.minDistance;if(!r(m)){var y=n(t.granularity,c.RADIANS_PER_DEGREE);m=c.chordLength(y,u.maximumRadius)}var _,T=0;for(_=0;_<o-1;_++)T+=p.numberOfPoints(a[_],a[_+1],m);var v=3*(T+1),R=new Array(v),A=0;for(_=0;_<o-1;_++){var S=a[_],w=a[_+1],I=f?l[_]:l,M=f?l[_+1]:l;A=d(S,w,m,u,I,M,R,A)}g.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,N);P.height=f?l[o-1]:l;var D=u.cartographicToCartesian(P,O);return e.pack(D,R,v-3),R},p.generateCartesianArc=function(t){for(var n=p.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},p}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];D=t.cartesianToCartographic(a,D),n[r]=D.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function d(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;i<c;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function p(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function E(e,n,r,a,i,o,c,l){var h=z,d=G;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,U,h),h=t.normalize(h,h);var E=p(h,n,e,i);F=u.fromRotationZ(E,F),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(F,q,b),L);var m=B;m[0]=c;for(var y=0;y<l;y++)for(var _=0;_<r.length;_+=3)d=t.fromArray(r,_,d),d=u.multiplyByVector(m,d,d),d=s.multiplyByPoint(L,d,d),a.push(d.x,d.y,d.z);return a}function m(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=E(c,n,r,a,i,o[s/3],u,1)}return a}function y(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function _(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,h,d,p){var m,y=t.angleBetween(t.subtract(n,e,M),t.subtract(r,e,C)),_=i===a.BEVELED?0:Math.ceil(y/o.toRadians(5));m=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,M),y/(_+1),V),H):u.fromQuaternion(l.fromAxisAngle(e,y/(_+1),V),H);var T,v;if(n=t.clone(n,X),_>0)for(var R=p?2:1,A=0;A<_;A++)n=u.multiplyByVector(m,n,n),T=t.subtract(n,e,M),T=t.normalize(T,T),s||(T=t.negate(T,T)),v=c.scaleToGeodeticSurface(n,C),f=E(v,T,h,f,c,d,1,R);else T=t.subtract(n,e,M),T=t.normalize(T,T),s||(T=t.negate(T,T)),v=c.scaleToGeodeticSurface(n,C),f=E(v,T,h,f,c,d,1,1),r=t.clone(r,X),T=t.subtract(r,e,M),T=t.normalize(T,T),s||(T=t.negate(T,T)),v=c.scaleToGeodeticSurface(r,C),f=E(v,T,h,f,c,d,1,1);return f}var v=[new t,new t],R=new t,A=new t,S=new t,g=new t,N=new t,w=new t,O=new t,x=new t,I=new t,M=new t,C=new t,P={},D=new r,U=new t(-1,0,0),L=new s,b=new s,F=new u,B=u.IDENTITY.clone(),z=new t,G=new n,q=new t,W=new t,V=new l,X=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,p=i._cornerType,C=u?y(n,r):_(n,r),D=u?_(n,r):void 0,U=r.height/2,L=r.width/2,b=e.length,F=[],B=u?[]:void 0,z=R,G=A,q=S,W=g,V=N,X=w,H=O,Y=x,k=I,K=e[0],J=e[1];W=s.geodeticSurfaceNormal(K,W),z=t.subtract(J,K,z),z=t.normalize(z,z),Y=t.cross(W,z,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(B=E(K,Y,D,B,s,Q+U,1,1)),k=t.clone(K,k),K=J,G=t.negate(z,G);for(var ee,te,ne=1;ne<b-1;ne++){var re=u?2:1;J=e[ne+1],z=t.subtract(J,K,z),z=t.normalize(z,z),q=t.add(z,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(z,W),Z);t.subtract(z,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,M))),se=P.angleIsGreaterThanPi(z,G,K,s);se?(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,L,X),X),v[0]=t.clone(k,v[0]),v[1]=t.clone(X,v[1]),ee=d(v,Q+U,$+U,f),te=c.generateArc({positions:v,granularity:f,ellipsoid:s}),F=m(te,Y,C,F,s,ee,1),Y=t.cross(W,z,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,L,H),H),p===a.ROUNDED||p===a.BEVELED?T(V,X,H,p,se,s,F,C,$+U,u):(q=t.negate(q,q),F=E(K,q,C,F,s,$+U,ue,re)),k=t.clone(H,k)):(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,-L,X),X),v[0]=t.clone(k,v[0]),v[1]=t.clone(X,v[1]),ee=d(v,Q+U,$+U,f),te=c.generateArc({positions:v,granularity:f,ellipsoid:s}),F=m(te,Y,C,F,s,ee,1),Y=t.cross(W,z,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,-L,H),H),p===a.ROUNDED||p===a.BEVELED?T(V,X,H,p,se,s,F,C,$+U,u):F=E(K,q,C,F,s,$+U,ue,re),k=t.clone(H,k)),G=t.negate(z,G)}else F=E(k,Y,C,F,s,Q+U,1,1),k=K;Q=$,$=l[ne+1],K=J}v[0]=t.clone(k,v[0]),v[1]=t.clone(K,v[1]),ee=d(v,Q+U,$+U,f),te=c.generateArc({positions:v,granularity:f,ellipsoid:s}),F=m(te,Y,C,F,s,ee,1),u&&(B=E(K,Y,D,B,s,$+U,1,1)),b=F.length;var ce=u?b+B.length:b,le=new Float64Array(ce);return le.set(F),u&&le.set(B,b),le},P}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/PolylineVolumeGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./oneTimeWarning","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,m,y,_,T,v,R,A){"use strict";function S(e,t,r,a){var o=new d;a.position&&(o.position=new h({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:e}));var u,s,c,l,m,T,R=t.length,A=e.length/3,S=(A-2*R)/(2*R),g=_.triangulate(t),N=(S-1)*R*6+2*g.length,w=E.createTypedArray(A,N),O=2*R,x=0;for(u=0;u<S-1;u++){for(s=0;s<R-1;s++)c=2*s+u*R*2,T=c+O,l=c+1,m=l+O,w[x++]=l,w[x++]=c,w[x++]=m,w[x++]=m,w[x++]=c,w[x++]=T;c=2*R-2+u*R*2,l=c+1,m=l+O,T=c+O,w[x++]=l,w[x++]=c,w[x++]=m,w[x++]=m,w[x++]=c,w[x++]=T}if(a.st||a.tangent||a.bitangent){var I,M,C=new Float32Array(2*A),P=1/(S-1),D=1/r.height,U=r.height/2,L=0;for(u=0;u<S;u++){for(I=u*P,M=D*(t[0].y+U),C[L++]=I,C[L++]=M,s=1;s<R;s++)M=D*(t[s].y+U),C[L++]=I,C[L++]=M,C[L++]=I,C[L++]=M;M=D*(t[0].y+U),C[L++]=I,C[L++]=M}for(s=0;s<R;s++)I=0,M=D*(t[s].y+U),C[L++]=I,C[L++]=M;for(s=0;s<R;s++)I=(S-1)*P,M=D*(t[s].y+U),C[L++]=I,C[L++]=M;o.st=new h({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:new Float32Array(C)})}var b=A-2*R;for(u=0;u<g.length;u+=3){var F=g[u]+b,B=g[u+1]+b,z=g[u+2]+b;w[x++]=F,w[x++]=B,w[x++]=z,w[x++]=z+R,w[x++]=B+R,w[x++]=F+R}var G=new f({attributes:o,indices:w,boundingSphere:n.fromVertices(e),primitiveType:v.TRIANGLES});if(a.normal&&(G=p.computeNormal(G)),a.tangent||a.bitangent){try{G=p.computeTangentAndBitangent(G)}catch(e){y("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}a.tangent||(G.attributes.tangent=void 0),a.bitangent||(G.attributes.bitangent=void 0),a.st||(G.attributes.st=void 0)}return G}function g(e){e=u(e,u.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=l.clone(u(e.ellipsoid,l.WGS84)),this._cornerType=u(e.cornerType,o.ROUNDED),this._vertexFormat=R.clone(u(e.vertexFormat,R.DEFAULT)),this._granularity=u(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var i=1+t.length*a.packedLength;i+=1+n.length*r.packedLength,this.packedLength=i+l.packedLength+R.packedLength+2}g.pack=function(e,t,n){n=u(n,0);var i,o=e._positions,s=o.length;for(t[n++]=s,i=0;i<s;++i,n+=a.packedLength)a.pack(o[i],t,n);var c=e._shape;for(s=c.length,t[n++]=s,i=0;i<s;++i,n+=r.packedLength)r.pack(c[i],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,R.pack(e._vertexFormat,t,n),n+=R.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var N=l.clone(l.UNIT_SPHERE),w=new R,O={polylinePositions:void 0,shapePositions:void 0,ellipsoid:N,vertexFormat:w,cornerType:void 0,granularity:void 0};g.unpack=function(e,t,n){t=u(t,0);var i,o=e[t++],c=new Array(o);for(i=0;i<o;++i,t+=a.packedLength)c[i]=a.unpack(e,t);o=e[t++];var f=new Array(o);for(i=0;i<o;++i,t+=r.packedLength)f[i]=r.unpack(e,t);var h=l.unpack(e,t,N);t+=l.packedLength;var d=R.unpack(e,t,w);t+=R.packedLength;var p=e[t++],E=e[t];return s(n)?(n._positions=c,n._shape=f,n._ellipsoid=l.clone(h,n._ellipsoid),n._vertexFormat=R.clone(d,n._vertexFormat),n._cornerType=p,n._granularity=E,n):(O.polylinePositions=c,O.shapePositions=f,O.cornerType=p,O.granularity=E,new g(O))};var x=new t;return g.createGeometry=function(n){var r=n._positions,i=e(r,a.equalsEpsilon),o=n._shape;if(o=T.removeDuplicatesFromShape(o),!(i.length<2||o.length<3)){_.computeWindingOrder2D(o)===A.CLOCKWISE&&o.reverse();var u=t.fromPoints(o,x),s=T.computePositions(i,o,u,n,!0);return S(s,o,u,n._vertexFormat)}},g}),define("Workers/createPolylineVolumeGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolylineVolumeGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,p=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:p,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,p=a.y,E=a.z,m=l*l*d*d,y=f*f*p*p,_=h*h*E*E,T=m+y+_,v=Math.sqrt(1/T),R=e.multiplyByScalar(n,v,i);if(T<s)return isFinite(v)?e.clone(R,c):void 0;var A=u.x,S=u.y,g=u.z,N=o;N.x=R.x*A*2,N.y=R.y*S*2,N.z=R.z*g*2;var w,O,x,I,M,C,P,D,U,L,b,F=(1-v)*e.magnitude(n)/(.5*e.magnitude(N)),B=0;do{F-=B,x=1/(1+F*A),I=1/(1+F*S),M=1/(1+F*g),C=x*x,P=I*I,D=M*M,U=C*x,L=P*I,b=D*M,w=m*C+y*P+_*D-1,O=m*U*A+y*L*S+_*b*g;var z=-2*O;B=w/z}while(Math.abs(w)>r.EPSILON12);return t(c)?(c.x=l*x,c.y=f*I,c.z=h*M,c):new e(l*x,f*I,h*M)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,a,i){return a=n(a,0),r(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,n,a){var p=r(n)?n.oneOverRadii:f,E=r(n)?n.oneOverRadiiSquared:h,m=r(n)?n._centerToleranceSquared:d,y=o(t,p,E,m,c);if(r(y)){var _=e.multiplyComponents(y,E,s);_=e.normalize(_,_);var T=e.subtract(t,y,l),v=Math.atan2(_.y,_.x),R=Math.asin(_.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=v,a.latitude=R,a.height=A,a):new u(v,R,A)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,p=new e,E=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,p);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,E),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/arrayRemoveDuplicates",["./Check","./defaultValue","./defined","./Math"],function(e,t,n,r){"use strict";function a(e,r,a){if(n(e)){a=t(a,!1);var o=e.length;if(o<2)return e;var u,s,c;for(u=1;u<o&&(s=e[u-1],c=e[u],!r(s,c,i));++u);if(u===o)return a&&r(e[0],e[e.length-1],i)?e.slice(1):e;for(var l=e.slice(0,u);u<o;++u)c=e[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,p),o=Math.max(o,p)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var p=t.cartesianToCartographic(e[h]);a=Math.min(a,p.longitude),i=Math.max(i,p.longitude),l=Math.min(l,p.latitude),f=Math.max(f,p.latitude);var E=p.longitude>=0?p.longitude:p.longitude+u.TWO_PI;o=Math.min(o,E),c=Math.max(c,E)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,p=e.west,E=c;E.height=a,E.longitude=p,E.latitude=f,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.latitude=h,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=p,o[l]=t.cartographicToCartesian(E,o[l]),l++,f<0?E.latitude=f:h>0?E.latitude=h:E.latitude=0;for(var m=1;m<8;++m)E.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,E)&&(o[l]=t.cartographicToCartesian(E,o[l]),l++);return 0===E.latitude&&(E.longitude=p,o[l]=t.cartographicToCartesian(E,o[l]),l++,E.longitude=d,o[l]=t.cartographicToCartesian(E,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.width=r(n,0),this.height=r(a,0)}s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},s.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new s),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},s.fromPoints=function(e,t){if(a(t)||(t=new s),!a(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var n=e.length,r=e[0].x,i=e[0].y,o=e[0].x,u=e[0].y,c=1;c<n;c++){var l=e[c],f=l.x,h=l.y;r=Math.min(f,r),o=Math.max(f,o),i=Math.min(h,i),u=Math.max(h,u)}return t.x=r,t.y=i,t.width=o-r,t.height=u-i,t};var c=new i,l=new t,f=new t;return s.fromRectangle=function(t,n,i){if(a(i)||(i=new s),!a(t))return i.x=0,i.y=0,i.width=0,i.height=0,i;n=r(n,c);var o=n.project(u.southwest(t,l)),h=n.project(u.northeast(t,f));return e.subtract(h,o,h),i.x=o.x,i.y=o.y,i.width=h.x,i.height=h.y,i},s.clone=function(e,t){if(a(e))return a(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new s(e.x,e.y,e.width,e.height)},s.union=function(e,t,n){a(n)||(n=new s);var r=Math.min(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return n.x=r,n.y=i,n.width=o-r,n.height=u-i,n},s.expand=function(e,t,n){n=s.clone(e,n);var r=t.x-n.x,a=t.y-n.y;return r>n.width?n.width=r:r<0&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:a<0&&(n.height-=a,n.y=t.y),n},s.intersect=function(e,t){var n=e.x,r=e.y,a=t.x,i=t.y;return n>a+t.width||n+e.width<a||r+e.height<i||r>i+t.height?o.OUTSIDE:o.INTERSECTING},s.equals=function(e,t){return e===t||a(e)&&a(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(E[n],p[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(E[i],p[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=p[a],h=E[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,m=e[s.getElementIndex(h,h)],y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(h,f)],T=(m-y)/2/_;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7], +t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,p=n-u-f+d,E=2*(a-h),m=2*(i+l),y=2*(a+h),_=-n+u-f+d,T=2*(c-o),v=2*(i-l),R=2*(c+o),A=-n-u+f+d;return r(t)?(t[0]=p,t[1]=y,t[2]=v,t[3]=E,t[4]=_,t[5]=R,t[6]=m,t[7]=T,t[8]=A,t):new s(p,E,m,y,_,T,v,R,A)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,p=i*a+c*o*u,E=-c*a+i*o*u,m=-o,y=c*n,_=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=m,t[3]=f,t[4]=p,t[5]=y,t[6]=h,t[7]=E,t[8]=_,t):new s(l,f,h,d,p,E,m,y,_)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var p=[1,0,0],E=[2,2,1],m=new s,y=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),p=n*c(d);o<a&&l(d)>p;)f(d,m),s.transpose(m,y),s.multiply(d,m,d),s.multiply(y,d,d),s.multiply(h,m,h),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,h,d,p,E,m){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(p,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(E,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(m,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,p=t.y*t.z,E=t.y*t.w,m=t.z*t.z,y=t.z*t.w,_=t.w*t.w,T=s-d-m+_,v=2*(c-y),R=2*(f+E),A=2*(c+y),S=-s+d-m+_,g=2*(p-h),N=2*(f-E),w=2*(p+h),O=-s-d+m+_;return r[0]=T*i,r[1]=A*i,r[2]=N*i,r[3]=0,r[4]=v*o,r[5]=S*o,r[6]=w*o,r[7]=0,r[8]=R*u,r[9]=g*u,r[10]=O*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,p=f.x,E=f.y,m=f.z,y=d.x,_=d.y,T=d.z,v=r.x,R=r.y,A=r.z,S=u*-v+s*-R+c*-A,g=y*-v+_*-R+T*-A,N=p*v+E*R+m*A;return a(n)?(n[0]=u,n[1]=y,n[2]=-p,n[3]=0,n[4]=s,n[5]=_,n[6]=-E,n[7]=0,n[8]=c,n[9]=T,n[10]=-m,n[11]=0,n[12]=S,n[13]=g,n[14]=N,n[15]=1,n):new l(u,s,c,S,y,_,T,g,-p,-E,-m,N,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,p=f,E=i+c,m=o+l,y=t+f,_=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=p,a[11]=0,a[12]=E,a[13]=m,a[14]=y,a[15]=_,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var p=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],p)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],p)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],p)),n};var E=new e;l.getMaximumScale=function(t){return l.getScale(t,E),e.maximumComponent(E)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],p=e[11],E=e[12],m=e[13],y=e[14],_=e[15],T=t[0],v=t[1],R=t[2],A=t[3],S=t[4],g=t[5],N=t[6],w=t[7],O=t[8],x=t[9],I=t[10],M=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=r*T+u*v+f*R+E*A,b=a*T+s*v+h*R+m*A,F=i*T+c*v+d*R+y*A,B=o*T+l*v+p*R+_*A,z=r*S+u*g+f*N+E*w,G=a*S+s*g+h*N+m*w,q=i*S+c*g+d*N+y*w,W=o*S+l*g+p*N+_*w,V=r*O+u*x+f*I+E*M,X=a*O+s*x+h*I+m*M,H=i*O+c*x+d*I+y*M,Y=o*O+l*x+p*I+_*M,k=r*C+u*P+f*D+E*U,Z=a*C+s*P+h*D+m*U,j=i*C+c*P+d*D+y*U,K=o*C+l*P+p*D+_*U;return n[0]=L,n[1]=b,n[2]=F,n[3]=B,n[4]=z,n[5]=G,n[6]=q,n[7]=W,n[8]=V,n[9]=X,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],p=e[14],E=t[0],m=t[1],y=t[2],_=t[4],T=t[5],v=t[6],R=t[8],A=t[9],S=t[10],g=t[12],N=t[13],w=t[14],O=r*E+o*m+c*y,x=a*E+u*m+l*y,I=i*E+s*m+f*y,M=r*_+o*T+c*v,C=a*_+u*T+l*v,P=i*_+s*T+f*v,D=r*R+o*A+c*S,U=a*R+u*A+l*S,L=i*R+s*A+f*S,b=r*g+o*N+c*w+h,F=a*g+u*N+l*w+d,B=i*g+s*N+f*w+p;return n[0]=O,n[1]=x,n[2]=I,n[3]=0,n[4]=M,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=b,n[13]=F,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],p=t[2],E=t[3],m=t[4],y=t[5],_=t[6],T=t[7],v=t[8],R=r*h+o*d+c*p,A=a*h+u*d+l*p,S=i*h+s*d+f*p,g=r*E+o*m+c*y,N=a*E+u*m+l*y,w=i*E+s*m+f*y,O=r*_+o*T+c*v,x=a*_+u*T+l*v,I=i*_+s*T+f*v;return n[0]=R,n[1]=A,n[2]=S,n[3]=0,n[4]=g,n[5]=N,n[6]=w,n[7]=0,n[8]=O,n[9]=x,n[10]=I,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var m=new e;l.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var y=new s,_=new s,T=new t,v=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,y),_,u.EPSILON7)&&t.equals(l.getRow(e,3,T),v))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],p=e[13],E=e[2],m=e[6],R=e[10],A=e[14],S=e[3],g=e[7],N=e[11],w=e[15],O=R*w,x=A*N,I=m*w,M=A*g,C=m*N,P=R*g,D=E*w,U=A*S,L=E*N,b=R*S,F=E*g,B=m*S,z=O*h+M*d+C*p-(x*h+I*d+P*p),G=x*f+D*d+b*p-(O*f+U*d+L*p),q=I*f+U*h+F*p-(M*f+D*h+B*p),W=P*f+L*h+B*d-(C*f+b*h+F*d),V=x*a+I*i+P*o-(O*a+M*i+C*o),X=O*r+U*i+L*o-(x*r+D*i+b*o),H=M*r+D*a+B*o-(I*r+U*a+F*o),Y=C*r+b*a+F*i-(P*r+L*a+B*i);O=i*p,x=o*d,I=a*p,M=o*h,C=a*d,P=i*h,D=r*p,U=o*f,L=r*d,b=i*f,F=r*h,B=a*f;var k=O*g+M*N+C*w-(x*g+I*N+P*w),Z=x*S+D*N+b*w-(O*S+U*N+L*w),j=I*S+U*g+F*w-(M*S+D*g+B*w),K=P*S+L*g+B*N-(C*S+b*g+F*N),J=I*R+P*A+x*m-(C*A+O*m+M*R),Q=L*A+O*E+U*R-(D*R+b*A+x*E),$=D*m+B*A+M*E-(F*A+I*E+U*m),ee=F*R+C*E+b*m-(L*m+B*R+P*E),te=r*z+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=z*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=V*te,n[5]=X*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],p=-n*f-r*h-a*d,E=-i*f-o*h-u*d,m=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=p,t[13]=E,t[14]=m,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,p=new e,E=new e,m=new e,y=new e,_=new e,T=new e,v=new e,R=new e,A=new e,S=new e,g=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,p),u=e.clone(r,E),s=e.clone(r,m),c=e.clone(r,y),l=e.clone(r,_),f=t.length,N=1;N<f;N++){e.clone(t[N],r);var w=r.x,O=r.y,x=r.z;w<i.x&&e.clone(r,i),w>s.x&&e.clone(r,s),O<o.y&&e.clone(r,o),O>c.y&&e.clone(r,c),x<u.z&&e.clone(r,u),x>l.z&&e.clone(r,l)}var I=e.magnitudeSquared(e.subtract(s,i,v)),M=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),P=i,D=s,U=I;M>U&&(U=M,P=o,D=c),C>U&&(U=C,P=u,D=l);var L=R;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var b=e.magnitudeSquared(e.subtract(D,L,v)),F=Math.sqrt(b),B=A;B.x=i.x,B.y=o.y,B.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,v),.5,g),q=0;for(N=0;N<f;N++){e.clone(t[N],r);var W=e.magnitude(e.subtract(r,G,v));W>q&&(q=W);var V=e.magnitudeSquared(e.subtract(r,L,v));if(V>b){var X=Math.sqrt(V);F=.5*(F+X),b=F*F;var H=X-F;L.x=(F*L.x+H*r.x)/X,L.y=(F*L.y+H*r.y)/X,L.z=(F*L.z+H*r.z)/X}}return F<q?(e.clone(L,n.center),n.radius=F):(e.clone(G,n.center),n.radius=q),n};var N=new o,w=new e,O=new e,x=new t,I=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,N),f.southwest(t,x),x.height=i,f.northeast(t,I),I.height=o;var s=n.project(x,w),c=n.project(I,O),l=c.x-s.x,d=c.y-s.y,p=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+p*p);var E=u.center;return E.x=s.x+.5*l,E.y=s.y+.5*d,E.z=s.z+.5*p,u};var M=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,M)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,p),l=e.clone(u,E),f=e.clone(u,m),N=e.clone(u,y),w=e.clone(u,_),O=t.length,x=0;x<O;x+=i){var I=t[x]+n.x,M=t[x+1]+n.y,C=t[x+2]+n.z;u.x=I,u.y=M,u.z=C,I<s.x&&e.clone(u,s),I>f.x&&e.clone(u,f),M<c.y&&e.clone(u,c),M>N.y&&e.clone(u,N),C<l.z&&e.clone(u,l),C>w.z&&e.clone(u,w)}var P=e.magnitudeSquared(e.subtract(f,s,v)),D=e.magnitudeSquared(e.subtract(N,c,v)),U=e.magnitudeSquared(e.subtract(w,l,v)),L=s,b=f,F=P;D>F&&(F=D,L=c,b=N),U>F&&(F=U,L=l,b=w);var B=R;B.x=.5*(L.x+b.x),B.y=.5*(L.y+b.y),B.z=.5*(L.z+b.z);var z=e.magnitudeSquared(e.subtract(b,B,v)),G=Math.sqrt(z),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var W=S;W.x=f.x,W.y=N.y,W.z=w.z;var V=e.multiplyByScalar(e.add(q,W,v),.5,g),X=0;for(x=0;x<O;x+=i){u.x=t[x]+n.x,u.y=t[x+1]+n.y,u.z=t[x+2]+n.z;var H=e.magnitude(e.subtract(u,V,v));H>X&&(X=H);var Y=e.magnitudeSquared(e.subtract(u,B,v));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<X?(e.clone(B,o.center),o.radius=G):(e.clone(V,o.center),o.radius=X),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,p),s=e.clone(i,E),c=e.clone(i,m),l=e.clone(i,y),f=e.clone(i,_),N=t.length,w=0;w<N;w+=3){var O=t[w]+n[w],x=t[w+1]+n[w+1],I=t[w+2]+n[w+2];i.x=O,i.y=x,i.z=I,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),x<u.y&&e.clone(i,u),x>l.y&&e.clone(i,l),I<s.z&&e.clone(i,s),I>f.z&&e.clone(i,f)}var M=e.magnitudeSquared(e.subtract(c,o,v)),C=e.magnitudeSquared(e.subtract(l,u,v)),P=e.magnitudeSquared(e.subtract(f,s,v)),D=o,U=c,L=M;C>L&&(L=C,D=u,U=l),P>L&&(L=P,D=s,U=f);var b=R;b.x=.5*(D.x+U.x),b.y=.5*(D.y+U.y),b.z=.5*(D.z+U.z);var F=e.magnitudeSquared(e.subtract(U,b,v)),B=Math.sqrt(F),z=A;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(z,G,v),.5,g),W=0;for(w=0;w<N;w+=3){i.x=t[w]+n[w],i.y=t[w+1]+n[w+1],i.z=t[w+2]+n[w+2];var V=e.magnitude(e.subtract(i,q,v));V>W&&(W=V);var X=e.magnitudeSquared(e.subtract(i,b,v));if(X>F){var H=Math.sqrt(X);B=.5*(B+H),F=B*B;var Y=H-B;b.x=(B*b.x+Y*i.x)/H,b.y=(B*b.y+Y*i.y)/H,b.z=(B*b.z+Y*i.z)/H}}return B<W?(e.clone(b,r.center),r.radius=B):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,U=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,D),u=c.getColumn(r,2,U);return e.add(i,o,i),e.add(i,u,i),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(i),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,b=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,b);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var F=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,F));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){ +var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var z=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,z),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,V=new e,X=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,X),d=e.negate(c,V),p=Y,E=p[0];e.add(s,l,E),e.add(E,c,E),E=p[1],e.add(s,l,E),e.add(E,d,E),E=p[2],e.add(s,f,E),e.add(E,d,E),E=p[3],e.add(s,f,E),e.add(E,c,E),e.negate(s,s),E=p[4],e.add(s,l,E),e.add(E,c,E),E=p[5],e.add(s,l,E),e.add(E,d,E),E=p[6],e.add(s,f,E),e.add(E,d,E),E=p[7],e.add(s,f,E),e.add(E,c,E);for(var m=p.length,y=0;y<m;++y){var _=p[y];e.add(o,_,_);var T=i.cartesianToCartographic(_,H);n.project(T,_)}a=h.fromPoints(p,a),o=a.center;var v=o.x,R=o.y,A=o.z;return o.x=A,o.y=v,o.z=R,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(R)&&(R=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(R=!0,A=r(e[1]))}return R}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(v.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(S=!0,g=r(e[1]))}return S}function u(){return o()&&g}function s(){if(!t(N)){N=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(v.userAgent);null!==e&&(N=!0,w=r(e[1]),w.isNightly=!!e[2])}return N}function c(){return s()&&w}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===v.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(O=!0,x=r(e[1]))):"Netscape"===v.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(v.userAgent),null!==e&&(O=!0,x=r(e[1])))}return O}function f(){return l()&&x}function h(){if(!t(I)){I=!1;var e=/ Edge\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(I=!0,M=r(e[1]))}return I}function d(){return h()&&M}function p(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(v.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function E(){return t(D)||(D=/Windows/i.test(v.appVersion)),D}function m(){return p()&&P}function y(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(v.pointerEnabled)||v.pointerEnabled)),U}function _(){if(!t(b)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;b=t(n)&&""!==n,b&&(L=n)}return b}function T(){return _()?L:void 0}var v;v="undefined"!=typeof navigator?navigator:{};var R,A,S,g,N,w,O,x,I,M,C,P,D,U,L,b,F={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:p,firefoxVersion:m,isWindows:E,hardwareConcurrency:e(v.hardwareConcurrency,3),supportsPointerEvents:y,supportsImageRenderingPixelated:_,imageRenderingValue:T};return F.supportsFullscreen=function(){return n.supportsFullscreen()},F.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},F.supportsWebWorkers=function(){return"undefined"!=typeof Worker},F}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,n,r,a,i){"use strict";var o={};o.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,a=n.y;n.x=(1-Math.abs(a))*i.signNotZero(r),n.y=(1-Math.abs(r))*i.signNotZero(a)}return n.x=i.toSNorm(n.x,t),n.y=i.toSNorm(n.y,t),n},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,n,r,a){if(a.x=i.fromSNorm(e,r),a.y=i.fromSNorm(n,r),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},o.octDecode=function(e,t,n){return o.octDecodeInRange(e,t,255,n)},o.octPackFloat=function(e){return 256*e.x+e.y};var u=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,u),o.octPackFloat(u)},o.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return o.octDecode(r,a,t)},o.octPack=function(e,t,n,r){var a=o.octEncodeFloat(e),i=o.octEncodeFloat(t),s=o.octEncode(n,u);return r.x=65536*s.x+a,r.y=65536*s.y+i,r},o.octUnpack=function(e,t,n,r){var a=e.x/65536,i=Math.floor(a),u=65536*(a-i);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);o.octDecodeFloat(u,t),o.octDecodeFloat(c,n),o.octDecode(i,s,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},o.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined"],function(e,t,n,r){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var f,h,d,p,E,m,y,_;r(a.z)?(f=t.subtract(s,a,i),h=t.subtract(c,a,o),d=t.subtract(n,a,u),p=t.dot(f,f),E=t.dot(f,h),m=t.dot(f,d),y=t.dot(h,h),_=t.dot(h,d)):(f=e.subtract(s,a,i),h=e.subtract(c,a,o),d=e.subtract(n,a,u),p=e.dot(f,f),E=e.dot(f,h),m=e.dot(f,d),y=e.dot(h,h),_=e.dot(h,d));var T=1/(p*y-E*E);return l.y=(y*m-E*_)*T,l.z=(p*_-E*m)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,n){t(n)||(n={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),n.high=r,n.low=e-r):(r=65536*Math.floor(-e/65536),n.high=-r,n.low=e+r),n};var a={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var i=n.high,o=n.low;return r.encode(e.x,a),i.x=a.high,o.x=a.low,r.encode(e.y,a),i.y=a.high,o.y=a.low,r.encode(e.z,a),i.z=a.high,o.z=a.low,n};var i=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,i);var a=i.high,o=i.low;t[n]=a.x,t[n+1]=a.y,t[n+2]=a.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,p=o*s-h,E=o*c-u*s,m=u*c-d,y=4*p*m-E*E;if(y<0){var _,T,v;h*f>=l*d?(_=o,T=p,v=-2*u*p+o*E):(_=c,T=m,v=-c*E+2*s*m);var R=v<0?-1:1,A=-R*Math.abs(_)*Math.sqrt(-y);i=-v+A;var S=i/2,g=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),N=i===A?-g:-T/g;return a=T<=0?g+N:-v/(g*g+N*N+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var w=p,O=-2*u*p+o*E,x=m,I=-c*E+2*s*m,M=Math.sqrt(y),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*M,-O)/3);a=2*Math.sqrt(-w);var D=Math.cos(P);i=a*D;var U=a*(-D/2-C*Math.sin(P)),L=i+U>2*u?i-u:U-u,b=o,F=L/b;P=Math.abs(Math.atan2(c*M,-I)/3),a=2*Math.sqrt(-x),D=Math.cos(P),i=a*D,U=a*(-D/2-C*Math.sin(P));var B=-c,z=i+U<2*s?i+s:U+s,G=B/z,q=b*z,W=-L*z-b*B,V=L*B,X=(s*W-u*V)/(-u*W+s*q);return F<=X?F<=G?X<=G?[F,X,G]:[F,G,X]:[G,F,X]:F<=G?[X,F,G]:X<=G?[X,G,F]:[G,X,F]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var p=r.computeRealRoots(1,s,l);if(2===p.length){var E,m=p[0],y=p[1];if(m>=0&&y>=0){var _=Math.sqrt(m),T=Math.sqrt(y);return[h-T,h-_,h+_,h+T]}if(m>=0&&y<0)return E=Math.sqrt(m),[h-E,h+E];if(m<0&&y>=0)return E=Math.sqrt(y),[h-E,h+E]}return[]}if(d>0){var v=Math.sqrt(d),R=(s+d-c/v)/2,A=(s+d+c/v)/2,S=r.computeRealRoots(1,v,R),g=r.computeRealRoots(1,-v,A);return 0!==S.length?(S[0]+=h,S[1]+=h,0!==g.length?(g[0]+=h,g[1]+=h,S[1]<=g[0]?[S[0],S[1],g[0],g[1]]:g[1]<=S[0]?[g[0],g[1],S[0],S[1]]:S[0]>=g[0]&&S[1]<=g[1]?[g[0],S[0],S[1],g[1]]:g[0]>=S[0]&&g[1]<=S[1]?[S[0],g[0],g[1],S[1]]:S[0]>g[0]&&S[0]<g[1]?[g[0],S[0],g[1],S[1]]:[S[0],g[0],S[1],g[1]]):S):0!==g.length?(g[0]+=h,g[1]+=h,g):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var p,E,m=d[0],y=a-m,_=y*y,T=t/2,v=y/2,R=_-4*o,A=_+4*Math.abs(o),S=c-4*m,g=c+4*Math.abs(m);if(m<0||R*g<S*A){var N=Math.sqrt(S);p=N/2,E=0===N?0:(t*v-i)/N}else{var w=Math.sqrt(R);p=0===w?0:(t*v-i)/w,E=w/2}var O,x;0===T&&0===p?(O=0,x=0):n.sign(T)===n.sign(p)?(O=T+p,x=m/O):(x=T-p,O=m/x);var I,M;0===v&&0===E?(I=0,M=0):n.sign(v)===n.sign(E)?(I=v+E,M=o/I):(M=v-E,I=o/M);var C=r.computeRealRoots(1,O,I),P=r.computeRealRoots(1,x,M);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C; +if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,p=d*a,E=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*p+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return E},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,_),h=e.dot(u,u),d=2*e.dot(u,l),p=e.magnitudeSquared(l)-c,E=f(h,d,p,A);if(r(E))return a.start=E.root0,a.stop=E.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function p(t,n,r,a,i){var l,f=a*a,h=i*i,p=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,E=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),m=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,y=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),_=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===_&&0===y){if(l=s.computeRealRoots(p,E,m),0===l.length)return T;var v=l[0],R=Math.sqrt(Math.max(1-v*v,0));if(T.push(new e(a,i*v,i*-R)),T.push(new e(a,i*v,i*R)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,i*A,i*-S)),T.push(new e(a,i*A,i*S))}return T}var g=_*_,N=y*y,w=p*p,O=_*y,x=w+N,I=2*(E*p+O),M=2*m*p+E*E-N+g,C=2*(m*E-O),P=m*m-g;if(0===x&&0===I&&0===M&&0===C)return T;l=c.computeRealRoots(x,I,M,C,P);var D=l.length;if(0===D)return T;for(var U=0;U<D;++U){var L,b=l[U],F=b*b,B=Math.max(1-F,0),z=Math.sqrt(B);L=o.sign(p)===o.sign(m)?d(p*F+m,E*b,o.EPSILON12):o.sign(m)===o.sign(E*b)?d(p*F,E*b+m,o.EPSILON12):d(p*F+E*b,m,o.EPSILON12);var G=d(y*b,_,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*b,i*z)):q>0?T.push(new e(a,i*b,i*-z)):0!==z?(T.push(new e(a,i*b,i*-z)),T.push(new e(a,i*b,i*z)),++U):T.push(new e(a,i*b,i*z))}return T}var E={};E.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var m=new e,y=new e,_=new e,T=new e,v=new e;E.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,p=t.direction,E=e.subtract(a,r,m),R=e.subtract(i,r,y),A=e.cross(p,R,_),S=e.dot(E,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,E,v),f=e.dot(p,c),f<0||l+f>S)return;h=e.dot(R,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var g=1/S;if(s=e.subtract(d,r,T),l=e.dot(s,A)*g,l<0||l>1)return;if(c=e.cross(s,E,v),f=e.dot(p,c)*g,f<0||l+f>1)return;h=e.dot(R,c)*g}return h},E.rayTriangle=function(t,n,a,i,o,u){var s=E.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var R=new l;E.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=R;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=E.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};E.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new l;E.lineSegmentSphere=function(t,n,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var g=new e,N=new e;E.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,g),f=e.multiplyComponents(c,t.direction,N),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var p=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,p<o)return;if(p>o){u=d*d-o,s=-d+Math.sqrt(u);var E=s/a,m=r/s;return E<m?new i(E,m):{start:m,stop:E}}var y=Math.sqrt(r/a);return new i(y,y)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var w=new e,O=new e,x=new e,I=new e,M=new e,C=new u,P=new u,D=new u,U=new u,L=new u,b=new u,F=new u,B=new e,z=new e,G=new t;E.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,w);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,w),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,I),d=e.normalize(e.cross(h,f,O),O),E=e.normalize(e.cross(f,d,x),x),m=C;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=E.x,m[7]=E.y,m[8]=E.z;var y=u.transpose(m,P),_=u.fromScale(n.radii,D),T=u.fromScale(n.oneOverRadii,U),v=L;v[0]=0,v[1]=-i.z,v[2]=i.y,v[3]=i.z,v[4]=0,v[5]=-i.x,v[6]=-i.y,v[7]=i.x,v[8]=0;var R,A,S=u.multiply(u.multiply(y,T,b),v,b),g=u.multiply(u.multiply(S,_,F),m,F),N=u.multiplyByVector(S,a,M),q=p(g,e.negate(N,w),0,0,1),W=q.length;if(W>0){for(var V=e.clone(e.ZERO,z),X=Number.NEGATIVE_INFINITY,H=0;H<W;++H){R=u.multiplyByVector(_,u.multiplyByVector(m,q[H],B),B);var Y=e.normalize(e.subtract(R,a,I),I),k=e.dot(Y,i);k>X&&(X=k,V=e.clone(R,V))}var Z=n.cartesianToCartographic(V,G);return X=o.clamp(X,0,1),A=e.magnitude(e.subtract(V,a,I))*Math.sqrt(1-X*X),A=c?-A:A,Z.height=A,n.cartographicToCartesian(Z,new e)}};var q=new e;return E.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},E.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return E.lineSegmentPlane(t,n,a,f),E.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return E.lineSegmentPlane(n,r,a,f),E.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return E.lineSegmentPlane(r,t,a,f),E.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return E.lineSegmentPlane(n,t,a,f),E.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return E.lineSegmentPlane(r,n,a,f),E.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return E.lineSegmentPlane(t,r,a,f),E.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},E}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,n,r,a){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var o=new e;return i.fromCartesian4=function(n,r){var a=e.fromCartesian4(n,o),u=n.w;return t(r)?(e.clone(a,r.normal),r.distance=u,r):new i(a,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.calculateACMR=function(n){n=e(n,e.EMPTY_OBJECT);var r=n.indices,a=n.maximumIndex,i=e(n.cacheSize,24),o=r.length;if(!t(a)){a=0;for(var u=0,s=r[u];u<o;)s>a&&(a=s),++u,s=r[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var f=i+1,h=0;h<o;++h)f-c[r[h]]>i&&(c[r[h]]=f,++f);return(f-i+1)/(o/3)},r.tipsify=function(n){function r(e,t,n,r){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<r;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,n,a,i,o,u){for(var s,c=-1,l=-1,f=0;f<n.length;){var h=n[f];a[h].numLiveTriangles&&(s=0,i-a[h].timeStamp+2*a[h].numLiveTriangles<=t&&(s=i-a[h].timeStamp),(s>l||l===-1)&&(l=s,c=h)),++f}return c===-1?r(a,o,e,u):c}n=e(n,e.EMPTY_OBJECT);var i,o=n.indices,u=n.maximumIndex,s=e(n.cacheSize,24),c=o.length,l=0,f=0,h=o[f],d=c;if(t(u))l=u+1;else{for(;f<d;)h>l&&(l=h),++f,h=o[f];if(l===-1)return 0;++l}for(var p=[],E=0;E<l;E++)p[E]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};f=0;for(var m=0;f<d;)p[o[f]].vertexTriangles.push(m),++p[o[f]].numLiveTriangles,p[o[f+1]].vertexTriangles.push(m),++p[o[f+1]].numLiveTriangles,p[o[f+2]].vertexTriangles.push(m),++p[o[f+2]].numLiveTriangles,++m,f+=3;var y=0,_=s+1;i=1;var T,v,R=[],A=[],S=0,g=[],N=c/3,w=[];for(E=0;E<N;E++)w[E]=!1;for(var O,x;y!==-1;){R=[],v=p[y],x=v.vertexTriangles.length;for(var I=0;I<x;++I)if(m=v.vertexTriangles[I],!w[m]){w[m]=!0,f=m+m+m;for(var M=0;M<3;++M)O=o[f],R.push(O),A.push(O),g[S]=O,++S,T=p[O],--T.numLiveTriangles,_-T.timeStamp>s&&(T.timeStamp=_,++_),++f}y=a(o,s,R,p,_,A,l)}return g},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,m,y,_,T,v,R,A,S,g){"use strict";function N(e,t,n,r,a){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=a,e[t++]=a,e[t]=n}function w(e){for(var t=e.length,n=t/3*6,r=m.createTypedArray(t,n),a=0,i=0;i<t;i+=3,a+=6)N(r,a,e[i],e[i+1],e[i+2]);return r}function O(e){var t=e.length;if(t>=3){var n=6*(t-2),r=m.createTypedArray(t,n);N(r,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)N(r,a,e[i-1],e[i],e[i-2]);return r}return new Uint16Array}function x(e){if(e.length>0){for(var t=e.length-1,n=6*(t-1),r=m.createTypedArray(t,n),a=e[0],i=0,o=1;o<t;++o,i+=6)N(r,i,a,e[o],e[o+1]);return r}return new Uint16Array}function I(e){var t={};for(var n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){var r=e[n];t[n]=new p({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function M(e,t,n){for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values))for(var a=t[r],i=0;i<a.componentsPerAttribute;++i)e[r].values.push(a.values[n*a.componentsPerAttribute+i])}function C(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),R.multiplyByPoint(e,ie,ie),a.pack(ie,n,i)}function P(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),v.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,n,i)}function D(e,t){var n,r=e.length,a={},i=e[0][t].attributes;for(n in i)if(i.hasOwnProperty(n)&&c(i[n])&&c(i[n].values)){for(var o=i[n],s=o.values.length,l=!0,f=1;f<r;++f){var h=e[f][t].attributes[n];if(!c(h)||o.componentDatatype!==h.componentDatatype||o.componentsPerAttribute!==h.componentsPerAttribute||o.normalize!==h.normalize){l=!1;break}s+=h.values.length}l&&(a[n]=new p({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function U(e,t){var r,i,o,u,s,l,f,h=e.length,p=(e[0].modelMatrix,c(e[0][t].indices)),E=e[0][t].primitiveType,y=D(e,t);for(r in y)if(y.hasOwnProperty(r))for(s=y[r].values,u=0,i=0;i<h;++i)for(l=e[i][t].attributes[r].values,f=l.length,o=0;o<f;++o)s[u++]=l[o];var _;if(p){var T=0;for(i=0;i<h;++i)T+=e[i][t].indices.length;var v=d.computeNumberOfVertices(new d({attributes:y,primitiveType:S.POINTS})),R=m.createTypedArray(v,T),A=0,g=0;for(i=0;i<h;++i){var N=e[i][t].indices,w=N.length;for(u=0;u<w;++u)R[A++]=g+N[u];g+=d.computeNumberOfVertices(e[i][t])}_=R}var O,x=new a,I=0;for(i=0;i<h;++i){if(O=e[i][t].boundingSphere,!c(O)){x=void 0;break}a.add(O.center,x,x)}if(c(x))for(a.divideByScalar(x,h,x),i=0;i<h;++i){O=e[i][t].boundingSphere;var M=a.magnitude(a.subtract(O.center,x,se))+O.radius;M>I&&(I=M)}return new d({attributes:y,indices:_,primitiveType:E,boundingSphere:c(x)?new n(x,I):void 0})}function L(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function b(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;for(var r=3,a=3;a<t;++a)n[r++]=a-1,n[r++]=0,n[r++]=a;return e.indices=n,e.primitiveType=S.TRIANGLES,e}function F(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);for(var r=6,a=3;a<t-1;a+=2)n[r++]=a,n[r++]=a-1,n[r++]=a+1,a+2<t&&(n[r++]=a,n[r++]=a+1,n[r++]=a+2);return e.indices=n,e.primitiveType=S.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function z(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return e.indices=n,e.primitiveType=S.LINES,e}function G(e){var t=d.computeNumberOfVertices(e),n=m.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return n[r++]=t-1,n[r]=0,e.indices=n,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return b(e);case S.TRIANGLE_STRIP:return F(e);case S.TRIANGLES:return L(e);case S.LINE_STRIP:return z(e);case S.LINE_LOOP:return G(e);case S.LINES:return B(e)}return e}function W(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function V(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return W(e,e.y<0),W(t,t.y<0),void W(n,n.y<0);var r,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(n.y);r=a>i?a>o?T.sign(e.y):T.sign(n.y):i>o?T.sign(t.y):T.sign(n.y);var u=r<0;W(e,u),W(t,u),W(n,u)}function X(e,t,n,r){a.add(e,a.multiplyByScalar(a.subtract(t,e,Re),e.y/(e.y-t.y),Re),n),a.clone(n,r),W(n,!0),W(r,!1)}function H(e,t,n){if(!(e.x>=0||t.x>=0||n.x>=0)){V(e,t,n);var r=e.y<0,a=t.y<0,i=n.y<0,o=0;o+=r?1:0,o+=a?1:0,o+=i?1:0;var u=we.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,r?(X(e,t,Ae,ge),X(e,n,Se,Ne),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(X(t,n,Ae,ge),X(t,e,Se,Ne),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(X(n,e,Ae,ge),X(n,t,Se,Ne),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,r?a?i||(X(n,e,Ae,ge),X(n,t,Se,Ne),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(X(t,n,Ae,ge),X(t,e,Se,Ne),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(X(e,t,Ae,ge),X(e,n,Se,Ne),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=we.positions;return s[0]=e,s[1]=t,s[2]=n,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=Se,s[5]=ge,s[6]=Ne,s.length=7),we}}function Y(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var a in r)if(r.hasOwnProperty(a)&&c(r[a])&&c(r[a].values)){var i=r[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=d.computeNumberOfVertices(e);return e.indices=m.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function k(e){var t=e.attributes,n={};for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values)){var a=t[r];n[r]=new p({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new d({attributes:n,indices:[],primitiveType:e.primitiveType})}function Z(e,t,n){var r=c(e.geometry.boundingSphere);t=Y(t,r),n=Y(n,r),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function j(e,n,i,o,u,s,l,f,h,d,p,E){if(c(s)||c(l)||c(f)||c(h)||c(d)){var m=a.fromArray(u,3*e,Oe),y=a.fromArray(u,3*n,xe),_=a.fromArray(u,3*i,Ie),T=t(o,m,y,_,Me);if(c(s)){var v=a.fromArray(s,3*e,Oe),R=a.fromArray(s,3*n,xe),A=a.fromArray(s,3*i,Ie);a.multiplyByScalar(v,T.x,v),a.multiplyByScalar(R,T.y,R),a.multiplyByScalar(A,T.z,A);var S=a.add(v,R,v);a.add(S,A,S),a.normalize(S,S),a.pack(S,p.normal.values,3*E)}if(c(d)){var g=a.fromArray(d,3*e,Oe),N=a.fromArray(d,3*n,xe),w=a.fromArray(d,3*i,Ie);a.multiplyByScalar(g,T.x,g),a.multiplyByScalar(N,T.y,N),a.multiplyByScalar(w,T.z,w);var O;a.equals(g,a.ZERO)&&a.equals(N,a.ZERO)&&a.equals(w,a.ZERO)?(O=Oe,O.x=0,O.y=0,O.z=0):(O=a.add(g,N,g),a.add(O,w,O),a.normalize(O,O)),a.pack(O,p.extrudeDirection.values,3*E)}if(c(l)){var x=a.fromArray(l,3*e,Oe),I=a.fromArray(l,3*n,xe),M=a.fromArray(l,3*i,Ie);a.multiplyByScalar(x,T.x,x),a.multiplyByScalar(I,T.y,I),a.multiplyByScalar(M,T.z,M);var C=a.add(x,I,x);a.add(C,M,C),a.normalize(C,C),a.pack(C,p.tangent.values,3*E)}if(c(f)){var P=a.fromArray(f,3*e,Oe),D=a.fromArray(f,3*n,xe),U=a.fromArray(f,3*i,Ie);a.multiplyByScalar(P,T.x,P),a.multiplyByScalar(D,T.y,D),a.multiplyByScalar(U,T.z,U);var L=a.add(P,D,P);a.add(L,U,L),a.normalize(L,L),a.pack(L,p.bitangent.values,3*E)}if(c(h)){var b=r.fromArray(h,2*e,Ce),F=r.fromArray(h,2*n,Pe),B=r.fromArray(h,2*i,De);r.multiplyByScalar(b,T.x,b),r.multiplyByScalar(F,T.y,F),r.multiplyByScalar(B,T.z,B);var z=r.add(b,F,b);r.add(z,B,z),r.pack(z,p.st.values,2*E)}}}function K(e,t,n,r,a,i){var o=e.position.values.length/3;if(a!==-1){var u=r[a],s=n[u];return s===-1?(n[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function J(e){var t,n,r,i,o,u=e.geometry,s=u.attributes,l=s.position.values,f=c(s.normal)?s.normal.values:void 0,h=c(s.bitangent)?s.bitangent.values:void 0,d=c(s.tangent)?s.tangent.values:void 0,p=c(s.st)?s.st.values:void 0,E=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,m=u.indices,y=k(u),_=k(u),T=[];T.length=l.length/3;var v=[];for(v.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,v[o]=-1;var R=m.length;for(o=0;o<R;o+=3){var A=m[o],S=m[o+1],g=m[o+2],N=a.fromArray(l,3*A),w=a.fromArray(l,3*S),O=a.fromArray(l,3*g),x=H(N,w,O);if(c(x)&&x.positions.length>3)for(var I=x.positions,M=x.indices,C=M.length,P=0;P<C;++P){var D=M[P],U=I[D];U.y<0?(t=_.attributes,n=_.indices,r=T):(t=y.attributes,n=y.indices,r=v),i=K(t,n,r,m,D<3?o+D:-1,U),j(A,S,g,U,l,f,d,h,p,E,t,i)}else c(x)&&(N=x.positions[0],w=x.positions[1],O=x.positions[2]),N.y<0?(t=_.attributes,n=_.indices,r=T):(t=y.attributes,n=y.indices,r=v),i=K(t,n,r,m,o,N),j(A,S,g,N,l,f,d,h,p,E,t,i),i=K(t,n,r,m,o+1,w),j(A,S,g,w,l,f,d,h,p,E,t,i),i=K(t,n,r,m,o+2,O),j(A,S,g,O,l,f,d,h,p,E,t,i)}Z(e,_,y)}function Q(e){var t,n=e.geometry,r=n.attributes,i=r.position.values,o=n.indices,u=k(n),s=k(n),l=o.length,f=[];f.length=i.length/3;var h=[];for(h.length=i.length/3,t=0;t<f.length;++t)f[t]=-1,h[t]=-1;for(t=0;t<l;t+=2){var d=o[t],p=o[t+1],E=a.fromArray(i,3*d,Oe),m=a.fromArray(i,3*p,xe);Math.abs(E.y)<T.EPSILON6&&(E.y<0?E.y=-T.EPSILON6:E.y=T.EPSILON6),Math.abs(m.y)<T.EPSILON6&&(m.y<0?m.y=-T.EPSILON6:m.y=T.EPSILON6);var y=u.attributes,v=u.indices,R=h,A=s.attributes,S=s.indices,g=f,N=_.lineSegmentPlane(E,m,Ue,Ie);if(c(N)){var w=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Le);E.y<0&&(a.negate(w,w),y=s.attributes,v=s.indices,R=f,A=u.attributes,S=u.indices,g=h);var O=a.add(N,w,be);K(y,v,R,o,t,E),K(y,v,R,o,-1,O),a.negate(w,w),a.add(N,w,O),K(A,S,g,o,-1,O),K(A,S,g,o,t+1,m)}else{var x,I,M;E.y<0?(x=s.attributes,I=s.indices,M=f):(x=u.attributes,I=u.indices,M=h),K(x,I,M,o,t,E),K(x,I,M,o,t+1,m)}}Z(e,s,u)}function $(e){for(var t=e.attributes,n=t.position.values,r=t.prevPosition.values,i=t.nextPosition.values,o=n.length,u=0;u<o;u+=3){var s=a.unpack(n,u,ze);if(!(s.x>0)){var c=a.unpack(r,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(r[u]=n[u-3],r[u+1]=n[u-2],r[u+2]=n[u-1]):a.pack(s,r,u));var l=a.unpack(i,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=n[u+3],i[u+1]=n[u+4],i[u+2]=n[u+5]):a.pack(s,i,u))}}}function ee(e){var t,n,o,u=e.geometry,s=u.attributes,l=s.position.values,f=s.prevPosition.values,h=s.nextPosition.values,d=s.expandAndWidth.values,p=c(s.st)?s.st.values:void 0,E=c(s.color)?s.color.values:void 0,m=k(u),y=k(u),v=!1,R=l.length/3;for(t=0;t<R;t+=4){var A=t,S=t+2,g=a.fromArray(l,3*A,ze),N=a.fromArray(l,3*S,Ge);if(Math.abs(g.y)<ke)for(g.y=ke*(N.y<0?-1:1),l[3*t+1]=g.y,l[3*(t+1)+1]=g.y,n=3*A;n<3*A+12;n+=3)f[n]=l[3*t],f[n+1]=l[3*t+1],f[n+2]=l[3*t+2];if(Math.abs(N.y)<ke)for(N.y=ke*(g.y<0?-1:1),l[3*(t+2)+1]=N.y,l[3*(t+3)+1]=N.y,n=3*A;n<3*A+12;n+=3)h[n]=l[3*(t+2)],h[n+1]=l[3*(t+2)+1],h[n+2]=l[3*(t+2)+2];var w=m.attributes,O=m.indices,x=y.attributes,I=y.indices,M=_.lineSegmentPlane(g,N,Ue,We);if(c(M)){v=!0;var C=a.multiplyByScalar(a.UNIT_Y,Ye,Ve);g.y<0&&(a.negate(C,C),w=y.attributes,O=y.indices,x=m.attributes,I=m.indices);var P=a.add(M,C,Xe);w.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),w.position.values.push(P.x,P.y,P.z),w.position.values.push(P.x,P.y,P.z),w.prevPosition.values.push(f[3*A],f[3*A+1],f[3*A+2]),w.prevPosition.values.push(f[3*A+3],f[3*A+4],f[3*A+5]),w.prevPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),w.nextPosition.values.push(P.x,P.y,P.z),w.nextPosition.values.push(P.x,P.y,P.z),w.nextPosition.values.push(P.x,P.y,P.z),w.nextPosition.values.push(P.x,P.y,P.z),a.negate(C,C),a.add(M,C,P),x.position.values.push(P.x,P.y,P.z),x.position.values.push(P.x,P.y,P.z),x.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),x.nextPosition.values.push(h[3*S],h[3*S+1],h[3*S+2]),x.nextPosition.values.push(h[3*S+3],h[3*S+4],h[3*S+5]);var D=r.fromArray(d,2*A,Fe),U=Math.abs(D.y);w.expandAndWidth.values.push(-1,U,1,U),w.expandAndWidth.values.push(-1,-U,1,-U),x.expandAndWidth.values.push(-1,U,1,U),x.expandAndWidth.values.push(-1,-U,1,-U);var L=a.magnitudeSquared(a.subtract(M,g,qe));if(L/=a.magnitudeSquared(a.subtract(N,g,qe)),c(E)){var b=i.fromArray(E,4*A,He),F=i.fromArray(E,4*S,He),B=T.lerp(b.x,F.x,L),z=T.lerp(b.y,F.y,L),G=T.lerp(b.z,F.z,L),q=T.lerp(b.w,F.w,L);for(n=4*A;n<4*A+8;++n)w.color.values.push(E[n]);for(w.color.values.push(B,z,G,q),w.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),n=4*S;n<4*S+8;++n)x.color.values.push(E[n])}if(c(p)){var W=r.fromArray(p,2*A,Fe),V=r.fromArray(p,2*(t+3),Be),X=T.lerp(W.x,V.x,L);for(n=2*A;n<2*A+4;++n)w.st.values.push(p[n]);for(w.st.values.push(X,W.y),w.st.values.push(X,V.y),x.st.values.push(X,W.y),x.st.values.push(X,V.y),n=2*S;n<2*S+4;++n)x.st.values.push(p[n])}o=w.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3),o=x.position.values.length/3-4,I.push(o,o+2,o+1),I.push(o+1,o+2,o+3)}else{var H,Y;for(g.y<0?(H=y.attributes,Y=y.indices):(H=m.attributes,Y=m.indices),H.position.values.push(g.x,g.y,g.z),H.position.values.push(g.x,g.y,g.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),n=3*t;n<3*t+12;++n)H.prevPosition.values.push(f[n]),H.nextPosition.values.push(h[n]);for(n=2*t;n<2*t+8;++n)H.expandAndWidth.values.push(d[n]),c(p)&&H.st.values.push(p[n]);if(c(E))for(n=4*t;n<4*t+16;++n)H.color.values.push(E[n]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}v&&($(y),$(m)),Z(e,y,m)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=w(t);break;case S.TRIANGLE_STRIP:e.indices=O(t);break;case S.TRIANGLE_FAN:e.indices=x(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,r){t=s(t,"normal"),r=s(r,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),f=0,h=0;h<o;h+=3)l[f++]=a[h],l[f++]=a[h+1],l[f++]=a[h+2],l[f++]=a[h]+i[h]*r,l[f++]=a[h+1]+i[h+1]*r,l[f++]=a[h+2]+i[h+2]*r;var E,m=e.boundingSphere;return c(m)&&(E=new n(m.center,m.radius+r)),new d({attributes:{position:new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:E})},te.createAttributeLocations=function(e){var t,n=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,a={},i=0,o=n.length;for(t=0;t<o;++t){var u=n[t];c(r[u])&&(a[u]=i++)}for(var s in r)r.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=d.computeNumberOfVertices(e),n=e.indices;if(c(n)){for(var r=new Int32Array(t),a=0;a<t;a++)r[a]=-1;for(var i,o=n,s=o.length,l=m.createTypedArray(t,s),f=0,h=0,p=0;f<s;)i=r[o[f]],i!==-1?l[h]=i:(i=o[f],r[i]=p,l[h]=p,++p),++f,++h;e.indices=l;var E=e.attributes;for(var y in E)if(E.hasOwnProperty(y)&&c(E[y])&&c(E[y].values)){for(var _=E[y],T=_.values,v=0,R=_.componentsPerAttribute,A=u.createTypedArray(_.componentDatatype,p*R);v<t;){var S=r[v];if(S!==-1)for(a=0;a<R;a++)A[R*S+a]=T[R*v+a];++v}_.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var n=e.indices;if(e.primitiveType===S.TRIANGLES&&c(n)){for(var r=n.length,a=0,i=0;i<r;i++)n[i]>a&&(a=n[i]);e.indices=g.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],n=d.computeNumberOfVertices(e);if(c(e.indices)&&n>=T.SIXTY_FOUR_KILOBYTES){var r,a=[],i=[],o=0,u=I(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?r=3:e.primitiveType===S.LINES?r=2:e.primitiveType===S.POINTS&&(r=1);for(var f=0;f<l;f+=r){for(var h=0;h<r;++h){var p=s[f+h],E=a[p];c(E)||(E=o++,a[p]=E,M(u,e.attributes,p)),i.push(E)}o+r>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=I(e.attributes))}0!==i.length&&t.push(new d({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ne=new a,re=new o;te.projectTo2D=function(e,t,n,r,i){var o=e.attributes[t];i=c(i)?i:new h;for(var s=i.ellipsoid,l=o.values,f=new Float64Array(l.length),d=0,E=0;E<l.length;E+=3){var m=a.fromArray(l,E,ne),y=s.cartesianToCartographic(m,re),_=i.project(y,ne);f[d++]=_.x,f[d++]=_.y,f[d++]=_.z}return e.attributes[n]=o,e.attributes[r]=new p({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:f}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,n,r){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)f.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var h=a.componentsPerAttribute;return e.attributes[n]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:s}),e.attributes[r]=new p({componentDatatype:u.FLOAT,componentsPerAttribute:h,values:c}),delete e.attributes[t],e};var ie=new a,oe=new R,ue=new v;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(R.equals(t,R.IDENTITY))return e;var r=e.geometry.attributes;C(t,r.position),C(t,r.prevPosition),C(t,r.nextPosition),(c(r.normal)||c(r.tangent)||c(r.bitangent))&&(R.inverse(t,oe),R.transpose(oe,oe),R.getRotation(oe,ue),P(ue,r.normal),P(ue,r.tangent),P(ue,r.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=n.transform(a,t,a)),e.modelMatrix=R.clone(R.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],n=[],r=e.length,a=0;a<r;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&n.push(i)}var o=[];return t.length>0&&o.push(U(t,"geometry")),n.length>0&&(o.push(U(n,"westHemisphereGeometry")),o.push(U(n,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,fe=new a,he=new a;te.computeNormal=function(e){for(var t=e.indices,n=e.attributes,r=n.position.values,i=n.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),f=0;f<i;f++)s[f]={indexOffset:0,count:0,currentCount:0};var h=0;for(f=0;f<o;f+=3){var d=t[f],E=t[f+1],m=t[f+2],y=3*d,_=3*E,v=3*m;le.x=r[y],le.y=r[y+1],le.z=r[y+2],fe.x=r[_],fe.y=r[_+1],fe.z=r[_+2],he.x=r[v],he.y=r[v+1],he.z=r[v+2],s[d].count++,s[E].count++,s[m].count++,a.subtract(fe,le,fe),a.subtract(he,le,he),c[h]=a.cross(fe,he,new a),h++}var R=0;for(f=0;f<i;f++)s[f].indexOffset+=R,R+=s[f].count;h=0;var A;for(f=0;f<o;f+=3){A=s[t[f]];var S=A.indexOffset+A.currentCount;l[S]=h,A.currentCount++,A=s[t[f+1]],S=A.indexOffset+A.currentCount,l[S]=h,A.currentCount++,A=s[t[f+2]],S=A.indexOffset+A.currentCount,l[S]=h,A.currentCount++,h++}var g=new Float32Array(3*i);for(f=0;f<i;f++){var N=3*f;if(A=s[f],a.clone(a.ZERO,ce),A.count>0){for(h=0;h<A.count;h++)a.add(ce,c[l[A.indexOffset+h]],ce);a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&a.clone(c[l[A.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),g[N]=ce.x,g[N+1]=ce.y,g[N+2]=ce.z}return e.attributes.normal=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:g}),e};var de=new a,pe=new a,Ee=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),n=e.attributes.position.values,r=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var f,h,d;for(l=0;l<s;l+=3){var E=t[l],m=t[l+1],y=t[l+2];f=3*E,h=3*m,d=3*y;var _=2*E,T=2*m,v=2*y,R=n[f],A=n[f+1],S=n[f+2],g=i[_],N=i[_+1],w=i[T+1]-N,O=i[v+1]-N,x=1/((i[T]-g)*O-(i[v]-g)*w),I=(O*(n[h]-R)-w*(n[d]-R))*x,M=(O*(n[h+1]-A)-w*(n[d+1]-A))*x,C=(O*(n[h+2]-S)-w*(n[d+2]-S))*x;c[f]+=I,c[f+1]+=M,c[f+2]+=C,c[h]+=I,c[h+1]+=M,c[h+2]+=C,c[d]+=I,c[d+1]+=M,c[d+2]+=C}var P=new Float32Array(3*o),D=new Float32Array(3*o);for(l=0;l<o;l++){f=3*l,h=f+1,d=f+2;var U=a.fromArray(r,f,de),L=a.fromArray(c,f,Ee),b=a.dot(U,L);a.multiplyByScalar(U,b,pe),a.normalize(a.subtract(L,pe,L),L),P[f]=L.x,P[h]=L.y,P[d]=L.z,a.normalize(a.cross(U,L,L),L),D[f]=L.x,D[h]=L.y,D[d]=L.z}return e.attributes.tangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new p({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:D}),e};var me=new r,ye=new a,_e=new a,Te=new a,ve=new r;te.compressVertices=function(t){var n,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),f=0;for(n=0;n<i;++n)a.fromArray(s,3*n,ye),a.equals(ye,a.ZERO)?f+=2:(ve=e.octEncodeInRange(ye,65535,ve),l[f++]=ve.x,l[f++]=ve.y);return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var h=t.attributes.normal,d=t.attributes.st,E=c(h),m=c(d);if(!E&&!m)return t;var y,_,T,v,R=t.attributes.tangent,A=t.attributes.bitangent,S=c(R),g=c(A);E&&(y=h.values),m&&(_=d.values),S&&(T=R.values),g&&(v=A.values);var N=E?y.length:_.length,w=E?3:2;i=N/w;var O=i,x=m&&E?2:1;x+=S||g?1:0,O*=x;var I=new Float32Array(O),M=0;for(n=0;n<i;++n){m&&(r.fromArray(_,2*n,me),I[M++]=e.compressTextureCoordinates(me));var C=3*n;E&&c(T)&&c(v)?(a.fromArray(y,C,ye),a.fromArray(T,C,_e),a.fromArray(v,C,Te),e.octPack(ye,_e,Te,me),I[M++]=me.x,I[M++]=me.y):(E&&(a.fromArray(y,C,ye),I[M++]=e.octEncodeFloat(ye)),S&&(a.fromArray(T,C,ye), +I[M++]=e.octEncodeFloat(ye)),g&&(a.fromArray(v,C,ye),I[M++]=e.octEncodeFloat(ye)))}return t.attributes.compressedAttributes=new p({componentDatatype:u.FLOAT,componentsPerAttribute:x,values:I}),E&&delete t.attributes.normal,m&&delete t.attributes.st,g&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var Re=new a,Ae=new a,Se=new a,ge=new a,Ne=new a,we={positions:new Array(7),indices:new Array(9)},Oe=new a,xe=new a,Ie=new a,Me=new a,Ce=new r,Pe=new r,De=new r,Ue=A.fromPointNormal(a.ZERO,a.UNIT_Y),Le=new a,be=new a,Fe=new r,Be=new r,ze=new a,Ge=new a,qe=new a,We=new a,Ve=new a,Xe=new a,He=new i,Ye=5*T.EPSILON9,ke=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(c(r)){var a=r.center.x-r.radius;if(a>0||n.intersectPlane(r,A.ORIGIN_ZX_PLANE)!==y.INTERSECTING)return e}if(t.geometryType!==E.NONE)switch(t.geometryType){case E.POLYLINES:ee(e);break;case E.TRIANGLES:J(e);break;case E.LINES:Q(e)}else q(t),t.primitiveType===S.TRIANGLES?J(e):t.primitiveType===S.LINES&&Q(e);return e},te}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,p,E,m;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var y=a;y<o;y+=a)p=e[y],E=e[y+1],p<l&&(l=p),E<f&&(f=E),p>h&&(h=p),E>d&&(d=E);m=Math.max(h-l,d-f)}return r(u,c,a,l,f,m),c}function t(e,t,n,r,a){var i,o;if(a===x(e,t,n,r)>0)for(i=t;i<n;i+=r)o=N(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=N(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(w(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==_(r.prev,r,r.next))r=r.next;else{if(w(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var p,E,m=e;e.prev!==e.next;)if(p=e.prev,E=e.next,f?i(e,c,l,f):a(e))t.push(p.i/s),t.push(e.i/s),t.push(E.i/s),w(e),e=E.next,m=E.next;else if(e=E,e===m){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(_(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(m(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&_(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(_(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=p(u,s,t,n,r),h=p(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&v(a,r,r.next,i)&&A(a,i)&&A(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),w(r),w(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&y(s,c)){var l=g(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(E(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=g(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&m(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&A(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=p(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function p(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function E(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function m(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function y(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!R(e,t)&&A(e,t)&&A(t,e)&&S(e,t)}function _(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function v(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||_(e,t,n)>0!=_(e,t,r)>0&&_(n,r,e)>0!=_(n,r,t)>0}function R(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&v(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function A(e,t){return _(e.prev,e,e.next)<0?_(e,t,e.next)>=0&&_(e,e.prev,t)>=0:_(e,t,e.prev)<0||_(e,e.next,t)<0}function S(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function g(e,t){var n=new O(e.i,e.x,e.y),r=new O(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function N(e,t,n,r){var a=new O(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function w(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,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function x(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(x(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(x(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,p=r[u+2]*n;f+=Math.abs((e[h]-e[p])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[p+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,p=new n,E={};E.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},E.computeWindingOrder2D=function(e){var t=E.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},E.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var m=new n,y=new n,_=new n,T=new n,v=new n,R=new n,A=new n;return E.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),p=t.length,E=new Array(3*p),S=0;for(h=0;h<p;h++){var g=t[h];E[S++]=g.x,E[S++]=g.y,E[S++]=g.z}for(var N=[],w={},O=e.maximumRadius,x=l.chordLength(u,O),I=x*x;d.length>0;){var M,C,P=d.pop(),D=d.pop(),U=d.pop(),L=n.fromArray(E,3*U,m),b=n.fromArray(E,3*D,y),F=n.fromArray(E,3*P,_),B=n.multiplyByScalar(n.normalize(L,T),O,T),z=n.multiplyByScalar(n.normalize(b,v),O,v),G=n.multiplyByScalar(n.normalize(F,R),O,R),q=n.magnitudeSquared(n.subtract(B,z,A)),W=n.magnitudeSquared(n.subtract(z,G,A)),V=n.magnitudeSquared(n.subtract(G,B,A)),X=Math.max(q,W,V);X>I?q===X?(M=Math.min(U,D)+" "+Math.max(U,D),h=w[M],i(h)||(C=n.add(L,b,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,w[M]=h),d.push(U,h,P),d.push(h,D,P)):W===X?(M=Math.min(D,P)+" "+Math.max(D,P),h=w[M],i(h)||(C=n.add(b,F,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,w[M]=h),d.push(D,h,U),d.push(h,P,U)):V===X&&(M=Math.min(P,U)+" "+Math.max(P,U),h=w[M],i(h)||(C=n.add(F,L,A),n.multiplyByScalar(C,.5,C),E.push(C.x,C.y,C.z),h=E.length/3-1,w[M]=h),d.push(P,h,D),d.push(h,U,D)):(N.push(U),N.push(D),N.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:E})},indices:N,primitiveType:f.TRIANGLES})},E.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=p;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},E}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,n,r,a){"use strict";function i(t,a,i){this.minimum=e.clone(n(t,e.ZERO)),this.maximum=e.clone(n(a,e.ZERO)),r(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,n){if(r(n)||(n=new i),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],p=d.x,E=d.y,m=d.z;a=Math.min(p,a),s=Math.max(p,s),o=Math.min(E,o),c=Math.max(E,c),u=Math.min(m,u),l=Math.max(m,l)}var y=n.minimum;y.x=a,y.y=o,y.z=u;var _=n.maximum;_.x=s,_.y=c,_.z=l;var T=e.add(y,_,n.center);return e.multiplyByScalar(T,.5,T),n},i.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new i(t.minimum,t.maximum)},i.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return p(e)}function a(e){return p(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,p;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return E(f,e),e},p=function(e){return e=t(e),h=e.then,p=t,d=y,E(l,e),f=l=R,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return m(2,arguments),e(t,function(t){function u(e){E(e)}function s(e){p(e)}var c,l,f,h,d,p,E,m,_,T;if(_=t.length>>>0,c=Math.max(0,Math.min(n,_)),f=[],l=_-c+1,h=[],d=o(),c)for(m=d.progress,E=function(e){h.push(e),--l||(p=E=y,d.reject(h))},p=function(e){f.push(e),--c||(p=E=y,d.resolve(f))},T=0;T<_;++T)T in t&&e(t[T],s,u,m);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return m(1,arguments),h(e,_).then(t,n,r)}function f(){return h(arguments,_)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=v.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function p(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function E(e,t){for(var n,r=0;n=e[r++];)n(t)}function m(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function y(){}function _(e){return e}var T,v,R;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=p,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(R,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(R,t)})})}},v=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,p,E,m,y;if("%%"==e)return"%";for(var _=!1,T="",v=!1,R=!1,A=" ",S=s.length,g=0;s&&g<S;g++)switch(s.charAt(g)){case" ":T=" ";break;case"+":T="+";break;case"-":_=!0;break;case"'":A=s.charAt(g+1);break;case"0":v=!0;break;case"#":R=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,_=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,y=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(y),_,c,f,v,A);case"c":return u(String.fromCharCode(+y),_,c,f,v);case"b":return o(y,2,R,_,c,f,v);case"o":return o(y,8,R,_,c,f,v);case"x":return o(y,16,R,_,c,f,v);case"X":return o(y,16,R,_,c,f,v).toUpperCase();case"u":return o(y,10,R,_,c,f,v);case"i":case"d":return d=+y||0,d=Math.round(d-d%1),p=d<0?"-":T,y=p+a(String(Math.abs(d)),f,"0",!1),i(y,p,_,c,v);case"e":case"E":case"f":case"F":case"g":case"G":return d=+y,p=d<0?"-":T,E=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],y=p+Math.abs(d)[E](f),i(y,p,_,c,v)[m]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return E.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=E.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=E.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}E.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=E.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return E.addSeconds(e,-r[0].offset,n);if(a>=r.length)return E.addSeconds(e,-r[a-1].offset,n);var i=E.secondsDifference(r[a].julianDate,e);return 0===i?E.addSeconds(e,-r[a].offset,n):i<=1?void 0:E.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function p(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function E(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var m=new i,y=[31,28,31,30,31,30,31,31,30,31,30,31],_=29,T=new u,v=/^(\d{4})$/,R=/^(\d{4})-(\d{2})$/,A=/^(\d{4})-?(\d{3})$/,S=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,g=/^(\d{4})-?(\d{2})-?(\d{2})$/,N=/([Z+\-])?(\d{2})?:?(\d{2})?$/,w=/^(\d{2})(\.\d+)?/.source+N.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+N.source,x=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+N.source;E.fromDate=function(e,t){var n=p(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new E(n[0],n[1],c.UTC)},E.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,m=0,T=0,N=0,I=u[0],M=u[1];if(u=I.match(g),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=I.match(R),null!==u)n=+u[1],s=+u[2];else if(u=I.match(v),null!==u)n=+u[1];else{var C;if(u=I.match(A),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=I.match(S),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,U=new Date(Date.UTC(n,0,4));C=7*P+D-U.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(M)){u=M.match(x),null!==u?(h=+u[1],m=+u[2],T=+u[3],N=1e3*+(u[4]||0),L=5):(u=M.match(O),null!==u?(h=+u[1],m=+u[2],T=60*+(u[3]||0),L=4):(u=M.match(w),null!==u&&(h=+u[1],m=60*+(u[2]||0),L=3)));var b=u[L],F=+u[L+1],B=+(u[L+2]||0);switch(b){case"+":h-=F,m-=B;break;case"-":h+=F,m+=B;break;case"Z":break;default:m+=new Date(Date.UTC(n,s-1,l,h,m)).getTimezoneOffset()}}else m+=new Date(n,s-1,l).getTimezoneOffset();var z=60===T;for(z&&T--;m>=60;)m-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?_:y[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?_:y[s-1];for(;m<0;)m+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?_:y[s-1],l+=a;var G=p(n,s,l,h,m,T,N);return r(t)?(d(G[0],G[1],t),f(t)):t=new E(G[0],G[1],c.UTC),z&&E.addSeconds(t,1,t),t},E.now=function(e){return E.fromDate(new Date,e)};var I=new E(0,0,c.TAI);return E.toGregorianDate=function(e,t){var n=!1,a=h(e,I);r(a)||(E.addSeconds(e,-1,I),a=h(I,I),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,p=c-(2447*d/80|0)|0;c=d/11|0;var m=d+2-12*c|0,y=100*(l-49)+f+c|0,_=u/s.SECONDS_PER_HOUR|0,T=u-_*s.SECONDS_PER_HOUR,v=T/s.SECONDS_PER_MINUTE|0;T-=v*s.SECONDS_PER_MINUTE;var R=0|T,A=(T-R)/s.SECONDS_PER_MILLISECOND;return _+=12,_>23&&(_-=24),n&&(R+=1),r(t)?(t.year=y,t.month=m,t.day=p,t.hour=_,t.minute=v,t.second=R,t.millisecond=A,t.isLeapSecond=n,t):new i(y,m,p,_,v,R,A,n)},E.toDate=function(e){var t=E.toGregorianDate(e,m),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},E.toIso8601=function(t,n){var a,i=E.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},E.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new E(e.dayNumber,e.secondsOfDay,c.TAI)},E.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},E.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(E.secondsDifference(e,t))<=n},E.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},E.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},E.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},E.computeTaiMinusUtc=function(e){T.julianDate=e;var n=E.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},E.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},E.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},E.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},E.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},E.lessThan=function(e,t){return E.compare(e,t)<0},E.lessThanOrEquals=function(e,t){return E.compare(e,t)<=0},E.greaterThan=function(e,t){return E.compare(e,t)>0},E.greaterThanOrEquals=function(e,t){return E.compare(e,t)>=0},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return E.toIso8601(this)},E.leapSeconds=[new u(new E(2441317,43210,c.TAI),10),new u(new E(2441499,43211,c.TAI),11),new u(new E(2441683,43212,c.TAI),12),new u(new E(2442048,43213,c.TAI),13),new u(new E(2442413,43214,c.TAI),14),new u(new E(2442778,43215,c.TAI),15),new u(new E(2443144,43216,c.TAI),16),new u(new E(2443509,43217,c.TAI),17),new u(new E(2443874,43218,c.TAI),18),new u(new E(2444239,43219,c.TAI),19),new u(new E(2444786,43220,c.TAI),20),new u(new E(2445151,43221,c.TAI),21),new u(new E(2445516,43222,c.TAI),22),new u(new E(2446247,43223,c.TAI),23),new u(new E(2447161,43224,c.TAI),24),new u(new E(2447892,43225,c.TAI),25),new u(new E(2448257,43226,c.TAI),26),new u(new E(2448804,43227,c.TAI),27),new u(new E(2449169,43228,c.TAI),28),new u(new E(2449534,43229,c.TAI),29),new u(new E(2450083,43230,c.TAI),30),new u(new E(2450630,43231,c.TAI),31),new u(new E(2451179,43232,c.TAI),32),new u(new E(2453736,43233,c.TAI),33),new u(new E(2454832,43234,c.TAI),34),new u(new E(2456109,43235,c.TAI),35),new u(new E(2457204,43236,c.TAI),36),new u(new E(2457754,43237,c.TAI),37)],E}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var p=new XMLHttpRequest;if(o.contains(e)&&(p.withCredentials=!0),n(h)&&n(p.overrideMimeType)&&p.overrideMimeType(h),p.open(r,e,!0),n(s))for(var E in s)s.hasOwnProperty(E)&&p.setRequestHeader(E,s[E]);n(t)&&(p.responseType=t),p.onload=function(){if(p.status<200||p.status>=300)return void c.reject(new a(p.status,p.response,p.getAllResponseHeaders()));var e=p.response,r=p.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(p.responseXML)&&p.responseXML.hasChildNodes()?c.resolve(p.responseXML):""!==r&&"text"!==r||!n(p.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(p.responseText);else c.resolve(e)},p.onerror=function(e){c.reject(new a)},p.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){ +"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))p(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){p(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else p(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function p(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),p=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||p<0||E<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var m=e._samples=n.samples,y=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=p,e._taiMinusUtcSecondsColumn=E,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var _,T=e._addNewLeapSeconds,v=0,R=m.length;v<R;v+=e._columnCount){var A=m[v+a],S=m[v+E],g=A+l.MODIFIED_JULIAN_DATE_DIFFERENCE,N=new o(g,S,f.TAI);if(y.push(N),T){if(S!==_&&r(_)){var w=o.leapSeconds,O=t(w,N,d);if(O<0){var x=new u(N,S);w.splice(~O,0,x)}}_=S}}}function E(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function m(e,t,n){return t+e*(n-t)}function y(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return E(e,n,a,s,u),u;if(r.equals(l))return E(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,p=n[h+e._ut1MinusUtcSecondsColumn],y=n[d+e._ut1MinusUtcSecondsColumn],_=y-p;if(_>.5||_<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],v=n[d+e._taiMinusUtcSecondsColumn];T!==v&&(l.equals(r)?p=y:y-=v-T)}return u.xPoleWander=m(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,p,y),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),p=!r(h),E=p||o.greaterThanOrEquals(h,e);if(d&&E)return s=u,!p&&h.equals(e)&&++s,l=s+1,y(this,i,this._samples,e,s,l,n),n}var m=t(i,e,o.compare,this._dateColumn);return m>=0?(m<i.length-1&&i[m+1].equals(e)&&++m,s=m,l=m):(l=~m,s=l-1,s<0&&(s=0)),this._lastIndex=s,y(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){if(i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),"data"===r.scheme)return r.toString();if("data"===a.scheme)return a.toString();n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=p.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,p=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=p,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],p=f;p<=h;++p)d.push(l(this,p));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var p,E,m=i-s*this._stepSizeDays,y=this._work,_=this._denominators,T=this._coef,v=this._xTable;for(p=0;p<=u;++p)y[p]=m-v[p];for(p=0;p<=u;++p){for(T[p]=1,E=0;E<=u;++E)E!==p&&(T[p]*=y[E]);T[p]*=_[p];var R=3*(s+p);n.x+=T[p]*d[R++],n.y+=T[p]*d[R++],n.s+=T[p]*d[R]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=h,a):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],p=e[c.COLUMN2ROW2],E=s+f+p;if(E>0)n=Math.sqrt(E+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var m=h,y=0;f>s&&(y=1),p>s&&p>f&&(y=2);var _=m[y],T=m[_];n=Math.sqrt(e[c.getElementIndex(y,y)]-e[c.getElementIndex(_,_)]-e[c.getElementIndex(T,T)]+1);var v=d;v[y]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,_)]-e[c.getElementIndex(_,T)])*n,v[_]=(e[c.getElementIndex(_,y)]+e[c.getElementIndex(y,_)])*n,v[T]=(e[c.getElementIndex(T,y)]+e[c.getElementIndex(y,T)])*n,a=-v[0],i=-v[1],o=-v[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var p=new l,E=new l,m=new l,y=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),y=l.fromAxisAngle(e.UNIT_X,o.roll,p),m=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(m,y,m),E=l.fromAxisAngle(e.UNIT_Z,-o.heading,p),l.multiply(E,i,i)};var _=new e,T=new e,v=new l,R=new l,A=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,A),l.conjugate(A,A);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),v),l.multiply(v,A,v),v.w<0&&l.negate(v,v),l.computeAxis(v,_);var u=l.computeAngle(v);r[o]=_.x*u,r[o+1]=_.y*u,r[o+2]=_.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,R),0===u?l.clone(l.IDENTITY,v):l.fromAxisAngle(T,u,v),l.multiply(v,R,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,p=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=p,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var S=new l;l.lerp=function(e,t,n,r){return S=l.multiplyByScalar(t,n,S),r=l.multiplyByScalar(e,1-n,r),l.add(S,r,r)};var g=new l,N=new l,w=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=g=l.negate(t,g)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return N=l.multiplyByScalar(e,Math.sin((1-n)*o),N),w=l.multiplyByScalar(i,Math.sin(n*o),w),r=l.add(N,w,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var O=new e,x=new e,I=new l,M=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,I);l.multiply(i,r,M);var o=l.log(M,O);l.multiply(i,t,M);var u=l.log(M,x);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,I),l.multiply(n,I,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,I),u=l.slerp(n,r,a,M);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],b=i.supportsTypedArrays()?new Float32Array(8):[],F=0;F<7;++F){var B=F+1,z=2*B+1;D[F]=1/(B*z),U[F]=B/z}return D[7]=P/136,U[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)L[f]=(D[f]*s-U[f])*o,b[f]=(D[f]*c-U[f])*o;var h=a*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),d=u*(1+b[0]*(1+b[1]*(1+b[2]*(1+b[3]*(1+b[4]*(1+b[5]*(1+b[6]*(1+b[7])))))))),p=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,h,r),l.add(p,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,I),u=l.fastSlerp(n,r,a,M);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,m,y,_,T,v){"use strict";var R={},A={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},S={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},g={},N={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},w=new n,O=new n,x=new n;R.localFrameToFixedFrameGenerator=function(e,t){if(!A.hasOwnProperty(e)||!A[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=A[e][t],i=e+t;return u(g[i])?r=g[i]:(r=function(r,i,s){if(u(s)||(s=new _),m.equalsEpsilon(r.x,0,m.EPSILON14)&&m.equalsEpsilon(r.y,0,m.EPSILON14)){var c=m.sign(r.z);n.unpack(S[e],0,w),"east"!==e&&"west"!==e&&n.multiplyByScalar(w,c,w),n.unpack(S[t],0,O),"east"!==t&&"west"!==t&&n.multiplyByScalar(O,c,O),n.unpack(S[a],0,x),"east"!==a&&"west"!==a&&n.multiplyByScalar(x,c,x)}else{i=o(i,h.WGS84),i.geodeticSurfaceNormal(r,N.up);var l=N.up,f=N.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,N.east),n.cross(l,f,N.north),n.multiplyByScalar(N.up,-1,N.down),n.multiplyByScalar(N.east,-1,N.west),n.multiplyByScalar(N.north,-1,N.south),w=N[e],O=N[t],x=N[a]}return s[0]=w.x,s[1]=w.y,s[2]=w.z,s[3]=0,s[4]=O.x,s[5]=O.y,s[6]=O.z,s[7]=0,s[8]=x.x,s[9]=x.y,s[10]=x.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},g[i]=r),r},R.eastNorthUpToFixedFrame=R.localFrameToFixedFrameGenerator("east","north"),R.northEastDownToFixedFrame=R.localFrameToFixedFrameGenerator("north","east"),R.northUpEastToFixedFrame=R.localFrameToFixedFrameGenerator("north","up"),R.northWestUpToFixedFrame=R.localFrameToFixedFrameGenerator("north","west");var I=new T,M=new n(1,1,1),C=new _;R.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof _&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,R.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,I),c=_.fromTranslationQuaternionRotationScale(n.ZERO,u,M,C);return i=a(e,r,i),_.multiply(i,c,i)};var P=new _,D=new y;R.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=R.headingPitchRollToFixedFrame(e,t,n,r,P),o=_.getRotation(i,D);return T.fromRotationMatrix(o,a)};var U=24110.54841,L=8640184.812866,b=.093104,F=-62e-7,B=1.1772758384668e-19,z=72921158553e-15,G=m.TWO_PI/86400,q=new E;R.computeTemeToPseudoFixedMatrix=function(e,t){q=E.addSeconds(e,-E.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/v.DAYS_PER_JULIAN_CENTURY:(i-.5)/v.DAYS_PER_JULIAN_CENTURY;var o=U+n*(L+n*(b+n*F)),s=o*G%m.TWO_PI,c=z+B*(r-2451545.5),l=(a+.5*v.SECONDS_PER_DAY)%v.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new y(h,d,0,-d,h,0,0,0,1)},R.iau2006XysData=new d,R.earthOrientationParameters=l.NONE;var W=32.184,V=2451545;R.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=R.iau2006XysData.preload(n,r,a,i),u=R.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},R.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new y);var n=R.computeFixedToIcrfMatrix(e,t);if(u(n))return y.transpose(n,t)};var X=new p(0,0,0),H=new f(0,0,0,0,0,0),Y=new y,k=new y;R.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new y);var n=R.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=R.iau2006XysData.computeXysRadians(r,a,X);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=y.fromRotationZ(-i.s,k),h=y.multiply(l,f,Y),d=e.dayNumber,p=e.secondsOfDay-E.computeTaiMinusUtc(e)+n.ut1MinusUtc,_=d-2451545,T=p/v.SECONDS_PER_DAY,A=.779057273264+T+.00273781191135448*(_+T);A=A%1*m.TWO_PI;var S=y.fromRotationZ(A,k),g=y.multiply(h,S,Y),N=Math.cos(n.xPoleWander),w=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),x=Math.sin(n.yPoleWander),I=r-V+a/v.SECONDS_PER_DAY;I/=36525;var M=-47e-6*I*m.RADIANS_PER_DEGREE/3600,C=Math.cos(M),P=Math.sin(M),D=k;return D[0]=N*C,D[1]=N*P,D[2]=O,D[3]=-w*P+x*O*C,D[4]=w*C+x*O*P,D[5]=-x*N,D[6]=-x*P-w*O*C,D[7]=x*C-w*O*P,D[8]=w*N,y.multiply(g,D,t)}}};var Z=new r;R.pointToWindowCoordinates=function(e,t,n,r){return r=R.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},R.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return _.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),_.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,J=new n;R.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,h.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,m.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new y),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new _(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new n,te=new n,ne=new y,re=new _,ae=new _;return R.basisTo2D=function(e,t,r){var a=_.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);n.fromElements(u.z,u.x,u.y,u);var s=R.eastNorthUpToFixedFrame(a,i,re),c=_.inverseTransformation(s,ae),l=_.getRotation(t,ne),f=_.multiplyByMatrix3(c,l,r);return _.multiply(Q,f,r),_.setTranslation(r,u,r),r},R.wgs84To2DModelMatrix=function(e,t,r){var a=e.ellipsoid,i=R.eastNorthUpToFixedFrame(t,a,re),o=_.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);n.fromElements(s.z,s.x,s.y,s);var c=_.fromTranslation(s,re);return _.multiply(Q,o,r),_.multiply(c,r,r),r},R}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function p(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,E)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,E));var i=n.fromCartesian4(l.getColumn(r,2,E));this._plane=f.fromPointNormal(e,i)}var E=new r;o(p.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var m=new e;p.fromPoints=function(t,n){var r=e.fromPoints(t,m);return new p(r.center,n)};var y=new h,_=new n;p.prototype.projectPointOntoPlane=function(e,r){var a=y;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,_);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},p.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},p.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=y;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,_);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,_));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},p.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return p.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},p}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,p=Math.sqrt(d),E=t/4,m=E*E,y=m*E,_=m*m,T=1+E-3*m/4+5*y/4-175*_/64,v=1-E+15*m/8-35*y/8,R=1-3*E+35*m/4,A=1-5*E,S=T*l-v*Math.sin(2*l)*E/2-R*Math.sin(4*l)*m/16-A*Math.sin(6*l)*y/48-5*Math.sin(8*l)*_/512,g=e._constants;g.a=n,g.b=r,g.f=a,g.cosineHeading=i,g.sineHeading=o,g.tanU=u,g.cosineU=s,g.sineU=c,g.sigma=l,g.sineAlpha=f,g.sineSquaredAlpha=h,g.cosineSquaredAlpha=d,g.cosineAlpha=p,g.u2Over4=E,g.u4Over16=m,g.u6Over64=y,g.u8Over256=_,g.a0=T,g.a1=v,g.a2=R,g.a3=A,g.distanceRatio=S}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,p=(t-n)/t,E=i-r,m=Math.atan((1-p)*Math.tan(a)),y=Math.atan((1-p)*Math.tan(o)),_=Math.cos(m),T=Math.sin(m),v=Math.cos(y),R=Math.sin(y),A=_*v,S=_*R,g=T*R,N=T*v,w=E,O=u.TWO_PI,x=Math.cos(w),I=Math.sin(w);do{x=Math.cos(w),I=Math.sin(w);var M=S-N*x;f=Math.sqrt(v*v*I*I+M*M),c=g+A*x,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=A*I/f,h=1-C*C),O=w,d=c-2*g/h,isNaN(d)&&(d=0),w=E+l(p,C,h,s,f,c,d)}while(Math.abs(w-O)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,U=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,b=U*f*(d+U*(c*(2*L-1)-U*d*(4*f*f-3)*(4*L-3)/6)/4),F=n*D*(s-b),B=Math.atan2(v*I,S-N*x),z=Math.atan2(_*I,S*x-N);e._distance=F,e._startHeading=B,e._endHeading=z,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,E),p),e.normalize(i.cartographicToCartesian(a,E),E);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var p=new e,E=new e;return a(d.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}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),p=i*i,E=i*p,m=a.u8Over256,y=a.u2Over4,_=a.u6Over64,T=a.u4Over16,v=2*E*m*o/3+i*(1-y+7*T/4-15*_/4+579*m/64-(T-15*_/4+187*m/16)*o-(5*_/4-115*m/16)*u-29*m*s/16)+(y/2-T+71*_/32-85*m/16)*c+(5*T/16-5*_/4+383*m/96)*f-p*((_-11*m/2)*c+5*m*f/2)+(29*_/96-29*m/16)*h+539*m*d/1536,R=Math.asin(Math.sin(v)*a.cosineAlpha),A=Math.atan(a.a/a.b*Math.tan(R));v-=a.sigma;var S=Math.cos(2*a.sigma+v),g=Math.sin(v),N=Math.cos(v),w=a.cosineU*N,O=a.sineU*g,x=Math.atan2(g*a.sineHeading,w-O*a.cosineHeading),I=x-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,v,g,N,S);return r(n)?(n.longitude=this._start.longitude+I,n.latitude=A,n.height=0,n):new t(this._start.longitude+I,A,0)},d}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=g;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,x),l=a.scaleToGeodeticSurface(n,I),f=p.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,N),E=a.cartesianToCartographic(l,w),m=h(f,i,o);M.setEndPoints(d,E);var y=M.surfaceDistance/f,_=s;d.height=i;var T=a.cartographicToCartesian(d,O);e.pack(T,u,_),_+=3;for(var v=1;v<f;v++){var R=M.interpolateUsingSurfaceDistance(v*y,w);R.height=m[v],T=a.cartographicToCartesian(R,O),e.pack(T,u,_),_+=3}return _}var p={};p.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var E=new t;p.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,E).height}return r};var m=new l,y=new e,_=new e,T=new f(e.UNIT_X,0),v=new e,R=new f(e.UNIT_X,0),A=new e,S=new e,g=[],N=new t,w=new t,O=new e,x=new e,I=new e,M=new o;return p.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,m),c=l.multiplyByPoint(s,e.ZERO,y),h=e.normalize(l.multiplyByPointAsVector(s,e.UNIT_Y,_),_),d=f.fromPointNormal(c,h,T),p=e.normalize(l.multiplyByPointAsVector(s,e.UNIT_X,v),v),E=f.fromPointNormal(c,p,R),g=1;i.push(e.clone(t[0]));for(var N=i[0],w=t.length,O=1;O<w;++O){var x=t[O];if(f.getPointDistance(E,N)<0||f.getPointDistance(E,x)<0){ +var I=u.lineSegmentPlane(N,x,d,A);if(r(I)){var M=e.multiplyByScalar(h,5e-9,S);f.getPointDistance(d,N)<0&&e.negate(M,M),i.push(e.add(I,M,new e)),o.push(g+1),e.negate(M,M),i.push(e.add(I,M,new e)),g=1}}i.push(e.clone(t[O])),g++,N=x}o.push(g)}return{positions:i,lengths:o}},p.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],x);if(l=f?l[0]:l,0!==l){var E=u.geodeticSurfaceNormal(h,O);e.multiplyByScalar(E,l,E),e.add(h,E,h)}return[h.x,h.y,h.z]}var m=t.minDistance;if(!r(m)){var y=n(t.granularity,c.RADIANS_PER_DEGREE);m=c.chordLength(y,u.maximumRadius)}var _,T=0;for(_=0;_<o-1;_++)T+=p.numberOfPoints(a[_],a[_+1],m);var v=3*(T+1),R=new Array(v),A=0;for(_=0;_<o-1;_++){var S=a[_],w=a[_+1],I=f?l[_]:l,M=f?l[_+1]:l;A=d(S,w,m,u,I,M,R,A)}g.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,N);P.height=f?l[o-1]:l;var D=u.cartographicToCartesian(P,O);return e.pack(D,R,v-3),R},p.generateCartesianArc=function(t){for(var n=p.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},p}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];D=t.cartesianToCartographic(a,D),n[r]=D.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function d(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;i<c;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function p(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function E(e,n,r,a,i,o,c,l){var h=z,d=G;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,U,h),h=t.normalize(h,h);var E=p(h,n,e,i);F=u.fromRotationZ(E,F),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(F,q,b),L);var m=B;m[0]=c;for(var y=0;y<l;y++)for(var _=0;_<r.length;_+=3)d=t.fromArray(r,_,d),d=u.multiplyByVector(m,d,d),d=s.multiplyByPoint(L,d,d),a.push(d.x,d.y,d.z);return a}function m(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=E(c,n,r,a,i,o[s/3],u,1)}return a}function y(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function _(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,h,d,p){var m,y=t.angleBetween(t.subtract(n,e,M),t.subtract(r,e,C)),_=i===a.BEVELED?0:Math.ceil(y/o.toRadians(5));m=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,M),y/(_+1),V),H):u.fromQuaternion(l.fromAxisAngle(e,y/(_+1),V),H);var T,v;if(n=t.clone(n,X),_>0)for(var R=p?2:1,A=0;A<_;A++)n=u.multiplyByVector(m,n,n),T=t.subtract(n,e,M),T=t.normalize(T,T),s||(T=t.negate(T,T)),v=c.scaleToGeodeticSurface(n,C),f=E(v,T,h,f,c,d,1,R);else T=t.subtract(n,e,M),T=t.normalize(T,T),s||(T=t.negate(T,T)),v=c.scaleToGeodeticSurface(n,C),f=E(v,T,h,f,c,d,1,1),r=t.clone(r,X),T=t.subtract(r,e,M),T=t.normalize(T,T),s||(T=t.negate(T,T)),v=c.scaleToGeodeticSurface(r,C),f=E(v,T,h,f,c,d,1,1);return f}var v=[new t,new t],R=new t,A=new t,S=new t,g=new t,N=new t,w=new t,O=new t,x=new t,I=new t,M=new t,C=new t,P={},D=new r,U=new t(-1,0,0),L=new s,b=new s,F=new u,B=u.IDENTITY.clone(),z=new t,G=new n,q=new t,W=new t,V=new l,X=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,p=i._cornerType,C=u?y(n,r):_(n,r),D=u?_(n,r):void 0,U=r.height/2,L=r.width/2,b=e.length,F=[],B=u?[]:void 0,z=R,G=A,q=S,W=g,V=N,X=w,H=O,Y=x,k=I,K=e[0],J=e[1];W=s.geodeticSurfaceNormal(K,W),z=t.subtract(J,K,z),z=t.normalize(z,z),Y=t.cross(W,z,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(B=E(K,Y,D,B,s,Q+U,1,1)),k=t.clone(K,k),K=J,G=t.negate(z,G);for(var ee,te,ne=1;ne<b-1;ne++){var re=u?2:1;J=e[ne+1],z=t.subtract(J,K,z),z=t.normalize(z,z),q=t.add(z,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(z,W),Z);t.subtract(z,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,M))),se=P.angleIsGreaterThanPi(z,G,K,s);se?(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,L,X),X),v[0]=t.clone(k,v[0]),v[1]=t.clone(X,v[1]),ee=d(v,Q+U,$+U,f),te=c.generateArc({positions:v,granularity:f,ellipsoid:s}),F=m(te,Y,C,F,s,ee,1),Y=t.cross(W,z,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,L,H),H),p===a.ROUNDED||p===a.BEVELED?T(V,X,H,p,se,s,F,C,$+U,u):(q=t.negate(q,q),F=E(K,q,C,F,s,$+U,ue,re)),k=t.clone(H,k)):(V=t.add(K,t.multiplyByScalar(q,ue*L,q),V),X=t.add(V,t.multiplyByScalar(Y,-L,X),X),v[0]=t.clone(k,v[0]),v[1]=t.clone(X,v[1]),ee=d(v,Q+U,$+U,f),te=c.generateArc({positions:v,granularity:f,ellipsoid:s}),F=m(te,Y,C,F,s,ee,1),Y=t.cross(W,z,Y),Y=t.normalize(Y,Y),H=t.add(V,t.multiplyByScalar(Y,-L,H),H),p===a.ROUNDED||p===a.BEVELED?T(V,X,H,p,se,s,F,C,$+U,u):F=E(K,q,C,F,s,$+U,ue,re),k=t.clone(H,k)),G=t.negate(z,G)}else F=E(k,Y,C,F,s,Q+U,1,1),k=K;Q=$,$=l[ne+1],K=J}v[0]=t.clone(k,v[0]),v[1]=t.clone(K,v[1]),ee=d(v,Q+U,$+U,f),te=c.generateArc({positions:v,granularity:f,ellipsoid:s}),F=m(te,Y,C,F,s,ee,1),u&&(B=E(K,Y,D,B,s,$+U,1,1)),b=F.length;var ce=u?b+B.length:b,le=new Float64Array(ce);return le.set(F),u&&le.set(B,b),le},P}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/PolylineVolumeGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryPipeline","./IndexDatatype","./Math","./oneTimeWarning","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./VertexFormat","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,p,E,m,y,_,T,v,R,A){"use strict";function S(e,t,r,a){var o=new d;a.position&&(o.position=new h({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:e}));var u,s,c,l,m,T,R=t.length,A=e.length/3,S=(A-2*R)/(2*R),g=_.triangulate(t),N=(S-1)*R*6+2*g.length,w=E.createTypedArray(A,N),O=2*R,x=0;for(u=0;u<S-1;u++){for(s=0;s<R-1;s++)c=2*s+u*R*2,T=c+O,l=c+1,m=l+O,w[x++]=l,w[x++]=c,w[x++]=m,w[x++]=m,w[x++]=c,w[x++]=T;c=2*R-2+u*R*2,l=c+1,m=l+O,T=c+O,w[x++]=l,w[x++]=c,w[x++]=m,w[x++]=m,w[x++]=c,w[x++]=T}if(a.st||a.tangent||a.bitangent){var I,M,C=new Float32Array(2*A),P=1/(S-1),D=1/r.height,U=r.height/2,L=0;for(u=0;u<S;u++){for(I=u*P,M=D*(t[0].y+U),C[L++]=I,C[L++]=M,s=1;s<R;s++)M=D*(t[s].y+U),C[L++]=I,C[L++]=M,C[L++]=I,C[L++]=M;M=D*(t[0].y+U),C[L++]=I,C[L++]=M}for(s=0;s<R;s++)I=0,M=D*(t[s].y+U),C[L++]=I,C[L++]=M;for(s=0;s<R;s++)I=(S-1)*P,M=D*(t[s].y+U),C[L++]=I,C[L++]=M;o.st=new h({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:new Float32Array(C)})}var b=A-2*R;for(u=0;u<g.length;u+=3){var F=g[u]+b,B=g[u+1]+b,z=g[u+2]+b;w[x++]=F,w[x++]=B,w[x++]=z,w[x++]=z+R,w[x++]=B+R,w[x++]=F+R}var G=new f({attributes:o,indices:w,boundingSphere:n.fromVertices(e),primitiveType:v.TRIANGLES});if(a.normal&&(G=p.computeNormal(G)),a.tangent||a.bitangent){try{G=p.computeTangentAndBitangent(G)}catch(e){y("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}a.tangent||(G.attributes.tangent=void 0),a.bitangent||(G.attributes.bitangent=void 0),a.st||(G.attributes.st=void 0)}return G}function g(e){e=u(e,u.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=l.clone(u(e.ellipsoid,l.WGS84)),this._cornerType=u(e.cornerType,o.ROUNDED),this._vertexFormat=R.clone(u(e.vertexFormat,R.DEFAULT)),this._granularity=u(e.granularity,m.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeGeometry";var i=1+t.length*a.packedLength;i+=1+n.length*r.packedLength,this.packedLength=i+l.packedLength+R.packedLength+2}g.pack=function(e,t,n){n=u(n,0);var i,o=e._positions,s=o.length;for(t[n++]=s,i=0;i<s;++i,n+=a.packedLength)a.pack(o[i],t,n);var c=e._shape;for(s=c.length,t[n++]=s,i=0;i<s;++i,n+=r.packedLength)r.pack(c[i],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,R.pack(e._vertexFormat,t,n),n+=R.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var N=l.clone(l.UNIT_SPHERE),w=new R,O={polylinePositions:void 0,shapePositions:void 0,ellipsoid:N,vertexFormat:w,cornerType:void 0,granularity:void 0};g.unpack=function(e,t,n){t=u(t,0);var i,o=e[t++],c=new Array(o);for(i=0;i<o;++i,t+=a.packedLength)c[i]=a.unpack(e,t);o=e[t++];var f=new Array(o);for(i=0;i<o;++i,t+=r.packedLength)f[i]=r.unpack(e,t);var h=l.unpack(e,t,N);t+=l.packedLength;var d=R.unpack(e,t,w);t+=R.packedLength;var p=e[t++],E=e[t];return s(n)?(n._positions=c,n._shape=f,n._ellipsoid=l.clone(h,n._ellipsoid),n._vertexFormat=R.clone(d,n._vertexFormat),n._cornerType=p,n._granularity=E,n):(O.polylinePositions=c,O.shapePositions=f,O.cornerType=p,O.granularity=E,new g(O))};var x=new t;return g.createGeometry=function(n){var r=n._positions,i=e(r,a.equalsEpsilon),o=n._shape;if(o=T.removeDuplicatesFromShape(o),!(i.length<2||o.length<3)){_.computeWindingOrder2D(o)===A.CLOCKWISE&&o.reverse();var u=t.fromPoints(o,x),s=T.computePositions(i,o,u,n,!0);return S(s,o,u,n._vertexFormat)}},g}),define("Workers/createPolylineVolumeGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolylineVolumeGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createPolylineVolumeOutlineGeometry.js b/engines/Cesium/Workers/createPolylineVolumeOutlineGeometry.js index 75860af..4947252 100644 --- a/engines/Cesium/Workers/createPolylineVolumeOutlineGeometry.js +++ b/engines/Cesium/Workers/createPolylineVolumeOutlineGeometry.js @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,_=a.z,p=l*l*d*d,m=f*f*E*E,y=h*h*_*_,T=p+m+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,g=o;g.x=A.x*S*2,g.y=A.y*v*2,g.z=A.z*N*2;var M,O,I,w,x,C,P,D,U,L,F,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(g)),z=0;do{B-=z,I=1/(1+B*S),w=1/(1+B*v),x=1/(1+B*N),C=I*I,P=w*w,D=x*x,U=C*I,L=P*w,F=D*x,M=p*C+m*P+y*D-1,O=p*U*S+m*L*v+y*F*N;var b=-2*O;z=M/b}while(Math.abs(M)>r.EPSILON12);return t(c)?(c.x=l*I,c.y=f*w,c.z=h*x,c):new e(l*I,f*w,h*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,_=n(r)?r.oneOverRadiiSquared:h,p=n(r)?r._centerToleranceSquared:d,m=o(t,E,_,p,c);if(n(m)){var y=e.multiplyComponents(m,_,s);y=e.normalize(y,y);var T=e.subtract(t,m,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,_=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,_),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/arrayRemoveDuplicates",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,r,a){if(t(n)){a=e(a,!1);var o=n.length;if(o<2)return n;var u,s,c;for(u=1;u<o&&(s=n[u-1],c=n[u],!r(s,c,i));++u);if(u===o)return a&&r(n[0],n[n.length-1],i)?n.slice(1):n;for(var l=n.slice(0,u);u<o;++u)c=n[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var _=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,_),c=Math.max(c,_)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,E=e.west,_=c;_.height=a,_.longitude=E,_.latitude=f,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.latitude=h,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=E,o[l]=t.cartographicToCartesian(_,o[l]),l++,f<0?_.latitude=f:h>0?_.latitude=h:_.latitude=0;for(var p=1;p<8;++p)_.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=t.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=E,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.width=r(n,0),this.height=r(a,0)}s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},s.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new s),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},s.fromPoints=function(e,t){if(a(t)||(t=new s),!a(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var n=e.length,r=e[0].x,i=e[0].y,o=e[0].x,u=e[0].y,c=1;c<n;c++){var l=e[c],f=l.x,h=l.y;r=Math.min(f,r),o=Math.max(f,o),i=Math.min(h,i),u=Math.max(h,u)}return t.x=r,t.y=i,t.width=o-r,t.height=u-i,t};var c=new i,l=new t,f=new t;return s.fromRectangle=function(t,n,i){if(a(i)||(i=new s),!a(t))return i.x=0,i.y=0,i.width=0,i.height=0,i;n=r(n,c);var o=n.project(u.southwest(t,l)),h=n.project(u.northeast(t,f));return e.subtract(h,o,h),i.x=o.x,i.y=o.y,i.width=h.x,i.height=h.y,i},s.clone=function(e,t){if(a(e))return a(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new s(e.x,e.y,e.width,e.height)},s.union=function(e,t,n){a(n)||(n=new s);var r=Math.min(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return n.x=r,n.y=i,n.width=o-r,n.height=u-i,n},s.expand=function(e,t,n){n=s.clone(e,n);var r=t.x-n.x,a=t.y-n.y;return r>n.width?n.width=r:r<0&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:a<0&&(n.height-=a,n.y=t.y),n},s.intersect=function(e,t){var n=e.x,r=e.y,a=t.x,i=t.y;return n>a+t.width||n+e.width<a||r+e.height<i||r>i+t.height?o.OUTSIDE:o.INTERSECTING},s.equals=function(e,t){return e===t||a(e)&&a(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(_[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(_[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],h=_[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,p=e[s.getElementIndex(h,h)],m=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(h,f)],T=(p-m)/2/y;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6], -t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=n-u-f+d,_=2*(a-h),p=2*(i+l),m=2*(a+h),y=-n+u-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+d;return r(t)?(t[0]=E,t[1]=m,t[2]=R,t[3]=_,t[4]=y,t[5]=A,t[6]=p,t[7]=T,t[8]=S,t):new s(E,_,p,m,y,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,E=i*a+c*o*u,_=-o*i+i*o*u,p=-o,m=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=p,t[3]=f,t[4]=E,t[5]=m,t[6]=h,t[7]=_,t[8]=y,t):new s(l,f,h,d,E,_,p,m,y)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],_=[2,2,1],p=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)f(d,p),s.transpose(p,m),s.multiply(d,p,d),s.multiply(m,d,d),s.multiply(h,p,h),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,h,d,E,_,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(_,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(p,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,_=t.y*t.w,p=t.z*t.z,m=t.z*t.w,y=t.w*t.w,T=s-d-p+y,R=2*(c-m),A=2*(f+_),S=2*(c+m),v=-s+d-p+y,N=2*(E-h),g=2*(f-_),M=2*(E+h),O=-s-d+p+y;return r[0]=T*i,r[1]=S*i,r[2]=g*i,r[3]=0,r[4]=R*o,r[5]=v*o,r[6]=M*o,r[7]=0,r[8]=A*u,r[9]=N*u,r[10]=O*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,E=f.x,_=f.y,p=f.z,m=d.x,y=d.y,T=d.z,R=r.x,A=r.y,S=r.z,v=u*-R+s*-A+c*-S,N=m*-R+y*-A+T*-S,g=E*R+_*A+p*S;return a(n)?(n[0]=u,n[1]=m,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-_,n[7]=0,n[8]=c,n[9]=T,n[10]=-p,n[11]=0,n[12]=v,n[13]=N,n[14]=g,n[15]=1,n):new l(u,s,c,v,m,y,T,N,-E,-_,-p,g,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,E=f,_=i+c,p=o+l,m=t+f,y=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=_,a[13]=p,a[14]=m,a[15]=y,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var _=new e;l.getMaximumScale=function(t){return l.getScale(t,_),e.maximumComponent(_)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],_=e[12],p=e[13],m=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],g=t[6],M=t[7],O=t[8],I=t[9],w=t[10],x=t[11],C=t[12],P=t[13],D=t[14],U=t[15],L=r*T+u*R+f*A+_*S,F=a*T+s*R+h*A+p*S,B=i*T+c*R+d*A+m*S,z=o*T+l*R+E*A+y*S,b=r*v+u*N+f*g+_*M,G=a*v+s*N+h*g+p*M,q=i*v+c*N+d*g+m*M,W=o*v+l*N+E*g+y*M,X=r*O+u*I+f*w+_*x,V=a*O+s*I+h*w+p*x,H=i*O+c*I+d*w+m*x,Y=o*O+l*I+E*w+y*x,k=r*C+u*P+f*D+_*U,Z=a*C+s*P+h*D+p*U,j=i*C+c*P+d*D+m*U,K=o*C+l*P+E*D+y*U;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],_=t[0],p=t[1],m=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],g=t[13],M=t[14],O=r*_+o*p+c*m,I=a*_+u*p+l*m,w=i*_+s*p+f*m,x=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,D=r*A+o*S+c*v,U=a*A+u*S+l*v,L=i*A+s*S+f*v,F=r*N+o*g+c*M+h,B=a*N+u*g+l*M+d,z=i*N+s*g+f*M+E;return n[0]=O,n[1]=I,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=D,n[9]=U,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],_=t[3],p=t[4],m=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,S=a*h+u*d+l*E,v=i*h+s*d+f*E,N=r*_+o*p+c*m,g=a*_+u*p+l*m,M=i*_+s*p+f*m,O=r*y+o*T+c*R,I=a*y+u*T+l*R,w=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=g,n[6]=M,n[7]=0,n[8]=O,n[9]=I,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var p=new e;l.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var m=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,m),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],E=e[13],_=e[2],p=e[6],A=e[10],S=e[14],v=e[3],N=e[7],g=e[11],M=e[15],O=A*M,I=S*g,w=p*M,x=S*N,C=p*g,P=A*N,D=_*M,U=S*v,L=_*g,F=A*v,B=_*N,z=p*v,b=O*h+x*d+C*E-(I*h+w*d+P*E),G=I*f+D*d+F*E-(O*f+U*d+L*E),q=w*f+U*h+B*E-(x*f+D*h+z*E),W=P*f+L*h+z*d-(C*f+F*h+B*d),X=I*a+w*i+P*o-(O*a+x*i+C*o),V=O*r+U*i+L*o-(I*r+D*i+F*o),H=x*r+D*a+z*o-(w*r+U*a+B*o),Y=C*r+F*a+B*i-(P*r+L*a+z*i);O=i*E,I=o*d,w=a*E,x=o*h,C=a*d,P=i*h,D=r*E,U=o*f,L=r*d,F=i*f,B=r*h,z=a*f;var k=O*N+x*g+C*M-(I*N+w*g+P*M),Z=I*v+D*g+F*M-(O*v+U*g+L*M),j=w*v+U*N+B*M-(x*v+D*N+z*M),K=P*v+L*N+z*g-(C*v+F*N+B*g),J=w*A+P*S+I*p-(C*S+O*p+x*A),Q=L*S+O*_+U*A-(D*A+F*S+I*_),$=D*p+z*S+x*_-(B*S+w*_+U*p),ee=B*A+C*_+F*p-(L*p+z*A+P*_),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,_=-i*f-o*h-u*d,p=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=_,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,_=new e,p=new e,m=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,_),s=e.clone(r,p),c=e.clone(r,m),l=e.clone(r,y),f=t.length,g=1;g<f;g++){e.clone(t[g],r);var M=r.x,O=r.y,I=r.z;M<i.x&&e.clone(r,i),M>s.x&&e.clone(r,s),O<o.y&&e.clone(r,o),O>c.y&&e.clone(r,c),I<u.z&&e.clone(r,u),I>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,D=s,U=w;x>U&&(U=x,P=o,D=c),C>U&&(U=C,P=u,D=l);var L=A;L.x=.5*(P.x+D.x),L.y=.5*(P.y+D.y),L.z=.5*(P.z+D.z);var F=e.magnitudeSquared(e.subtract(D,L,R)),B=Math.sqrt(F),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,R),.5,N),q=0;for(g=0;g<f;g++){e.clone(t[g],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var V=Math.sqrt(X);B=.5*(B+V),F=B*B;var H=V-B;L.x=(B*L.x+H*r.x)/V,L.y=(B*L.y+H*r.y)/V,L.z=(B*L.z+H*r.z)/V}}return B<q?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var g=new o,M=new e,O=new e,I=new t,w=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,g),f.southwest(t,I),I.height=i,f.northeast(t,w),w.height=o;var s=n.project(I,M),c=n.project(w,O),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*d,_.z=s.z+.5*E,u};var x=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,_),f=e.clone(u,p),g=e.clone(u,m),M=e.clone(u,y),O=t.length,I=0;I<O;I+=i){var w=t[I]+n.x,x=t[I+1]+n.y,C=t[I+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>g.y&&e.clone(u,g),C<l.z&&e.clone(u,l),C>M.z&&e.clone(u,M)}var P=e.magnitudeSquared(e.subtract(f,s,R)),D=e.magnitudeSquared(e.subtract(g,c,R)),U=e.magnitudeSquared(e.subtract(M,l,R)),L=s,F=f,B=P;D>B&&(B=D,L=c,F=g),U>B&&(B=U,L=l,F=M);var z=A;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=g.y,W.z=M.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),V=0;for(I=0;I<O;I+=i){u.x=t[I]+n.x,u.y=t[I+1]+n.y,u.z=t[I+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);G=.5*(G+k),b=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<V?(e.clone(z,o.center),o.radius=G):(e.clone(X,o.center),o.radius=V),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,_),c=e.clone(i,p),l=e.clone(i,m),f=e.clone(i,y),g=t.length,M=0;M<g;M+=3){var O=t[M]+n[M],I=t[M+1]+n[M+1],w=t[M+2]+n[M+2];i.x=O,i.y=I,i.z=w,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),I<u.y&&e.clone(i,u),I>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),D=o,U=c,L=x;C>L&&(L=C,D=u,U=l),P>L&&(L=P,D=s,U=f);var F=A;F.x=.5*(D.x+U.x),F.y=.5*(D.y+U.y),F.z=.5*(D.z+U.z);var B=e.magnitudeSquared(e.subtract(U,F,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(M=0;M<g;M+=3){i.x=t[M]+n[M],i.y=t[M+1]+n[M+1],i.z=t[M+2]+n[M+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;F.x=(z*F.x+Y*i.x)/H,F.y=(z*F.y+Y*i.y)/H,F.z=(z*F.z+Y*i.z)/H}}return z<W?(e.clone(F,r.center),r.radius=z):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,D=new e,U=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,D),u=c.getColumn(r,2,U),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var B=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a), -r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),d=e.negate(c,X),E=Y,_=E[0];e.add(s,l,_),e.add(_,c,_),_=E[1],e.add(s,l,_),e.add(_,d,_),_=E[2],e.add(s,f,_),e.add(_,d,_),_=E[3],e.add(s,f,_),e.add(_,c,_),e.negate(s,s),_=E[4],e.add(s,l,_),e.add(_,c,_),_=E[5],e.add(s,l,_),e.add(_,d,_),_=E[6],e.add(s,f,_),e.add(_,d,_),_=E[7],e.add(s,f,_),e.add(_,c,_);for(var p=E.length,m=0;m<p;++m){var y=E[m];e.add(o,y,y);var T=i.cartesianToCartographic(y,H);n.project(T,y)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(v)&&(v=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(g=!0,M=r(e[1]),M.isNightly=!!e[2])}return g}function c(){return s()&&M}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,I=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,I=r(e[1])))}return O}function f(){return l()&&I}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function d(){return h()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function _(){return t(D)||(D=/Windows/i.test(R.appVersion)),D}function p(){return E()&&P}function m(){return t(U)||(U="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),U}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,g,M,O,I,w,x,C,P,D,U,L,F,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:p,isWindows:_,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:y,imageRenderingValue:T};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,E,_,p;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var m=a;m<o;m+=a)E=e[m],_=e[m+1],E<l&&(l=E),_<f&&(f=_),E>h&&(h=E),_>d&&(d=_);p=Math.max(h-l,d-f)}return r(u,c,a,l,f,p),c}function t(e,t,n,r,a){var i,o;if(a===I(e,t,n,r)>0)for(i=t;i<n;i+=r)o=g(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=g(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(M(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(M(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,_,p=e;e.prev!==e.next;)if(E=e.prev,_=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(_.i/s),M(e),e=_.next,p=_.next;else if(e=_,e===p){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(p(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),h=E(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&S(a,i)&&S(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),M(r),M(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(_(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&p(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function _(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function p(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new O(e.i,e.x,e.y),r=new O(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function g(e,t,n,r){var a=new O(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function M(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,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(I(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(I(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,E=new n,_={};_.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},_.computeWindingOrder2D=function(e){var t=_.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},_.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var p=new n,m=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return _.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,_=new Array(3*E),v=0;for(h=0;h<E;h++){var N=t[h];_[v++]=N.x,_[v++]=N.y, -_[v++]=N.z}for(var g=[],M={},O=e.maximumRadius,I=l.chordLength(u,O),w=I*I;d.length>0;){var x,C,P=d.pop(),D=d.pop(),U=d.pop(),L=n.fromArray(_,3*U,p),F=n.fromArray(_,3*D,m),B=n.fromArray(_,3*P,y),z=n.multiplyByScalar(n.normalize(L,T),O,T),b=n.multiplyByScalar(n.normalize(F,R),O,R),G=n.multiplyByScalar(n.normalize(B,A),O,A),q=n.magnitudeSquared(n.subtract(z,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),X=n.magnitudeSquared(n.subtract(G,z,S)),V=Math.max(q,W,X);V>w?q===V?(x=Math.min(U,D)+" "+Math.max(U,D),h=M[x],i(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,M[x]=h),d.push(U,h,P),d.push(h,D,P)):W===V?(x=Math.min(D,P)+" "+Math.max(D,P),h=M[x],i(h)||(C=n.add(F,B,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,M[x]=h),d.push(D,h,U),d.push(h,P,U)):X===V&&(x=Math.min(P,U)+" "+Math.max(P,U),h=M[x],i(h)||(C=n.add(B,L,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,M[x]=h),d.push(P,h,D),d.push(h,U,D)):(g.push(U),g.push(D),g.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:_})},indices:g,primitiveType:f.TRIANGLES})},_.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},_}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,_=d.y,p=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(_,o),c=Math.max(_,c),u=Math.min(p,u),l=Math.max(p,l)}var m=r.minimum;m.x=a,m.y=o,m.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(m,y,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,_=o*c-u*s,p=u*c-d,m=4*E*p-_*_;if(m<0){var y,T,R;h*f>=l*d?(y=o,T=E,R=-2*u*E+o*_):(y=c,T=p,R=-c*_+2*s*p);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-m);i=-R+S;var v=i/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),g=i===S?-N:-T/N;return a=T<=0?N+g:-R/(N*N+g*g+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var M=E,O=-2*u*E+o*_,I=p,w=-c*_+2*s*p,x=Math.sqrt(m),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-M);var D=Math.cos(P);i=a*D;var U=a*(-D/2-C*Math.sin(P)),L=i+U>2*u?i-u:U-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-I),D=Math.cos(P),i=a*D,U=a*(-D/2-C*Math.sin(P));var z=-c,b=i+U<2*s?i+s:U+s,G=z/b,q=F*b,W=-L*b-F*z,X=L*z,V=(s*W-u*X)/(-u*W+s*q);return B<=V?B<=G?V<=G?[B,V,G]:[B,G,V]:[G,B,V]:B<=G?[V,B,G]:V<=G?[V,G,B]:[G,V,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var _,p=E[0],m=E[1];if(p>=0&&m>=0){var y=Math.sqrt(p),T=Math.sqrt(m);return[h-T,h-y,h+y,h+T]}if(p>=0&&m<0)return _=Math.sqrt(p),[h-_,h+_];if(p<0&&m>=0)return _=Math.sqrt(m),[h-_,h+_]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,_,p=d[0],m=a-p,y=m*m,T=t/2,R=m/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*p,N=c+4*Math.abs(p);if(p<0||A*N<v*S){var g=Math.sqrt(v);E=g/2,_=0===g?0:(t*R-i)/g}else{var M=Math.sqrt(A);E=0===M?0:(t*R-i)/M,_=M/2}var O,I;0===T&&0===E?(O=0,I=0):n.sign(T)===n.sign(E)?(O=T+E,I=p/O):(I=T-E,O=p/I);var w,x;0===R&&0===_?(w=0,x=0):n.sign(R)===n.sign(_)?(w=R+_,x=o/w):(x=R-_,w=o/x);var C=r.computeRealRoots(1,O,w),P=r.computeRealRoots(1,I,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,_=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return _},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),h=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,_=f(h,d,E,S);if(r(_))return a.start=_.root0,a.stop=_.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,h=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,_=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),p=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,m=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===m){if(l=s.computeRealRoots(E,_,p),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-v)),T.push(new e(a,i*S,i*v))}return T}var N=y*y,g=m*m,M=E*E,O=y*m,I=M+g,w=2*(_*E+O),x=2*p*E+_*_-g+N,C=2*(p*_-O),P=p*p-N;if(0===I&&0===w&&0===x&&0===C)return T;l=c.computeRealRoots(I,w,x,C,P);var D=l.length;if(0===D)return T;for(var U=0;U<D;++U){var L,F=l[U],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=o.sign(E)===o.sign(p)?d(E*B+p,_*F,o.EPSILON12):o.sign(p)===o.sign(_*F)?d(E*B,_*F+p,o.EPSILON12):d(E*B+_*F,p,o.EPSILON12);var G=d(m*F,y,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++U):T.push(new e(a,i*F,i*b))}return T}var _={};_.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,m=new e,y=new e,T=new e,R=new e;_.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,_=e.subtract(a,r,p),A=e.subtract(i,r,m),S=e.cross(E,A,y),v=e.dot(_,S);if(u){if(v<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,_,R),f=e.dot(E,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<o.EPSILON6)return;var N=1/v;if(s=e.subtract(d,r,T),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,_,R),f=e.dot(E,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},_.rayTriangle=function(t,n,a,i,o,u){var s=_.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;_.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=_.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};_.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new l;_.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,g=new e;_.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,g),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var E=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var _=s/a,p=r/s;return _<p?new i(_,p):{start:p,stop:_}}var m=Math.sqrt(r/a);return new i(m,m)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var M=new e,O=new e,I=new e,w=new e,x=new e,C=new u,P=new u,D=new u,U=new u,L=new u,F=new u,B=new u,z=new e,b=new e,G=new t;_.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,M);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,M),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,O),O),_=e.normalize(e.cross(f,d,I),I),p=C;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=d.x,p[4]=d.y,p[5]=d.z,p[6]=_.x,p[7]=_.y,p[8]=_.z;var m=u.transpose(p,P),y=u.fromScale(n.radii,D),T=u.fromScale(n.oneOverRadii,U),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,v=u.multiply(u.multiply(m,T,F),R,F),N=u.multiply(u.multiply(v,y,B),p,B),g=u.multiplyByVector(v,a,x),q=E(N,e.negate(g,M),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(y,u.multiplyByVector(p,q[H],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,G);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-V*V),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var q=new e;return _.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},_.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return _.lineSegmentPlane(t,n,a,f),_.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return _.lineSegmentPlane(n,r,a,f),_.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return _.lineSegmentPlane(r,t,a,f),_.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return _.lineSegmentPlane(n,t,a,f),_.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return _.lineSegmentPlane(r,n,a,f),_.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return _.lineSegmentPlane(t,r,a,f),_.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},_}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return _(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=m,_(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return p(2,arguments),e(t,function(t){function u(e){_(e)}function s(e){E(e)}var c,l,f,h,d,E,_,p,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(p=d.progress,_=function(e){h.push(e),--l||(E=_=m,d.reject(h))},E=function(e){f.push(e),--c||(E=_=m,d.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,p);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return p(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function _(e,t){for(var n,r=0;n=e[r++];)n(t)}function p(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function m(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,_,p,m;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(m),y,c,f,R,S);case"c":return u(String.fromCharCode(+m),y,c,f,R);case"b":return o(m,2,A,y,c,f,R);case"o":return o(m,8,A,y,c,f,R);case"x":return o(m,16,A,y,c,f,R);case"X":return o(m,16,A,y,c,f,R).toUpperCase();case"u":return o(m,10,A,y,c,f,R);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),E=d<0?"-":T,m=E+a(String(Math.abs(d)),f,"0",!1),i(m,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,E=d<0?"-":T,_=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=E+Math.abs(d)[_](f),i(m,E,y,c,R)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return _.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=_.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=_.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}_.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=_.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return _.addSeconds(e,-r[0].offset,n);if(a>=r.length)return _.addSeconds(e,-r[a-1].offset,n);var i=_.secondsDifference(r[a].julianDate,e);return 0===i?_.addSeconds(e,-r[a].offset,n):i<=1?void 0:_.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function _(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var p=new i,m=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,g=/([Z+\-])?(\d{2})?:?(\d{2})?$/,M=/^(\d{2})(\.\d+)?/.source+g.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+g.source,I=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+g.source;_.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new _(n[0],n[1],c.UTC)},_.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,p=0,T=0,g=0,w=u[0],x=u[1];if(u=w.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(v),null!==u){n=+u[1];var P=+u[2],D=+u[3]||0,U=new Date(Date.UTC(n,0,4));C=7*P+D-U.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(x)){u=x.match(I),null!==u?(h=+u[1],p=+u[2],T=+u[3],g=1e3*+(u[4]||0),L=5):(u=x.match(O),null!==u?(h=+u[1],p=+u[2],T=60*+(u[3]||0),L=4):(u=x.match(M),null!==u&&(h=+u[1],p=60*+(u[2]||0),L=3)));var F=u[L],B=+u[L+1],z=+(u[L+2]||0);switch(F){case"+":h-=B,p-=z;break;case"-":h+=B,p+=z;break;case"Z":break;default:p+=new Date(Date.UTC(n,s-1,l,h,p)).getTimezoneOffset()}}else p+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;p>=60;)p-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?y:m[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:m[s-1];for(;p<0;)p+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:m[s-1],l+=a;var G=E(n,s,l,h,p,T,g);return r(t)?(d(G[0],G[1],t),f(t)):t=new _(G[0],G[1],c.UTC),b&&_.addSeconds(t,1,t),t},_.now=function(e){return _.fromDate(new Date,e)};var w=new _(0,0,c.TAI);return _.toGregorianDate=function(e,t){var n=!1,a=h(e,w);r(a)||(_.addSeconds(e,-1,w),a=h(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var p=d+2-12*c|0,m=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=m,t.month=p,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(m,p,E,y,R,A,S,n)},_.toDate=function(e){var t=_.toGregorianDate(e,p),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},_.toIso8601=function(t,n){var a,i=_.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},_.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new _(e.dayNumber,e.secondsOfDay,c.TAI)},_.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},_.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},_.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(_.secondsDifference(e,t))<=n},_.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},_.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},_.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},_.computeTaiMinusUtc=function(e){T.julianDate=e;var n=_.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},_.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},_.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},_.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},_.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},_.lessThan=function(e,t){return _.compare(e,t)<0},_.lessThanOrEquals=function(e,t){return _.compare(e,t)<=0},_.greaterThan=function(e,t){return _.compare(e,t)>0},_.greaterThanOrEquals=function(e,t){return _.compare(e,t)>=0},_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)},_.prototype.toString=function(){return _.toIso8601(this)},_.leapSeconds=[new u(new _(2441317,43210,c.TAI),10),new u(new _(2441499,43211,c.TAI),11),new u(new _(2441683,43212,c.TAI),12),new u(new _(2442048,43213,c.TAI),13),new u(new _(2442413,43214,c.TAI),14),new u(new _(2442778,43215,c.TAI),15),new u(new _(2443144,43216,c.TAI),16),new u(new _(2443509,43217,c.TAI),17),new u(new _(2443874,43218,c.TAI),18),new u(new _(2444239,43219,c.TAI),19),new u(new _(2444786,43220,c.TAI),20),new u(new _(2445151,43221,c.TAI),21),new u(new _(2445516,43222,c.TAI),22),new u(new _(2446247,43223,c.TAI),23),new u(new _(2447161,43224,c.TAI),24),new u(new _(2447892,43225,c.TAI),25),new u(new _(2448257,43226,c.TAI),26),new u(new _(2448804,43227,c.TAI),27),new u(new _(2449169,43228,c.TAI),28),new u(new _(2449534,43229,c.TAI),29),new u(new _(2450083,43230,c.TAI),30),new u(new _(2450630,43231,c.TAI),31),new u(new _(2451179,43232,c.TAI),32),new u(new _(2453736,43233,c.TAI),33),new u(new _(2454832,43234,c.TAI),34),new u(new _(2456109,43235,c.TAI),35),new u(new _(2457204,43236,c.TAI),36),new u(new _(2457754,43237,c.TAI),37)],_}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment; -},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var _ in s)s.hasOwnProperty(_)&&E.setRequestHeader(_,s[_]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),_=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||E<0||_<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=n.samples,m=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=_,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=p.length;R<A;R+=e._columnCount){var S=p[R+a],v=p[R+_],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,g=new o(N,v,f.TAI);if(m.push(g),T){if(v!==y&&r(y)){var M=o.leapSeconds,O=t(M,g,d);if(O<0){var I=new u(g,v);M.splice(~O,0,I)}}y=v}}}function _(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,n){return t+e*(n-t)}function m(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return _(e,n,a,s,u),u;if(r.equals(l))return _(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],m=n[d+e._ut1MinusUtcSecondsColumn],y=m-E;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=m:m-=R-T)}return u.xPoleWander=p(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,m),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),_=E||o.greaterThanOrEquals(h,e);if(d&&_)return s=u,!E&&h.equals(e)&&++s,l=s+1,m(this,i,this._samples,e,s,l,n),n}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,_,p=i-s*this._stepSizeDays,m=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)m[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,_=0;_<=u;++_)_!==E&&(T[E]*=m[_]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=h,a):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],_=s+f+E;if(_>0)n=Math.sqrt(_+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var p=h,m=0;f>s&&(m=1),E>s&&E>f&&(m=2);var y=p[m],T=p[y];n=Math.sqrt(e[c.getElementIndex(m,m)]-e[c.getElementIndex(y,y)]-e[c.getElementIndex(T,T)]+1);var R=d;R[m]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,y)]-e[c.getElementIndex(y,T)])*n,R[y]=(e[c.getElementIndex(y,m)]+e[c.getElementIndex(m,y)])*n,R[T]=(e[c.getElementIndex(T,m)]+e[c.getElementIndex(m,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,_=new l,p=new l,m=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),m=l.fromAxisAngle(e.UNIT_X,o.roll,E),p=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(p,m,p),_=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(_,i,i)};var y=new e,T=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,y);var u=l.computeAngle(R);r[o]=y.x*u,r[o+1]=y.y*u,r[o+2]=y.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var v=new l;l.lerp=function(e,t,n,r){return v=l.multiplyByScalar(t,n,v),r=l.multiplyByScalar(e,1-n,r),l.add(v,r,r)};var N=new l,g=new l,M=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return g=l.multiplyByScalar(e,Math.sin((1-n)*o),g),M=l.multiplyByScalar(i,Math.sin(n*o),M),r=l.add(g,M,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var O=new e,I=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,O);l.multiply(i,t,x);var u=l.log(x,I);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,D=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;D[B]=1/(z*b),U[B]=z/b}return D[7]=P/136,U[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)L[f]=(D[f]*s-U[f])*o,F[f]=(D[f]*c-U[f])*o;var h=a*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),d=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,h,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,_,p,m,y,T,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},v={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},N={},g={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},M=new n,O=new n,I=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(N[i])?r=N[i]:(r=function(r,i,s){if(u(s)||(s=new y),p.equalsEpsilon(r.x,0,p.EPSILON14)&&p.equalsEpsilon(r.y,0,p.EPSILON14)){var c=p.sign(r.z);n.unpack(v[e],0,M),"east"!==e&&"west"!==e&&n.multiplyByScalar(M,c,M),n.unpack(v[t],0,O),"east"!==t&&"west"!==t&&n.multiplyByScalar(O,c,O),n.unpack(v[a],0,I),"east"!==a&&"west"!==a&&n.multiplyByScalar(I,c,I)}else{i=o(i,h.WGS84),i.geodeticSurfaceNormal(r,g.up);var l=g.up,f=g.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,g.east),n.cross(l,f,g.north),n.multiplyByScalar(g.up,-1,g.down),n.multiplyByScalar(g.east,-1,g.west),n.multiplyByScalar(g.north,-1,g.south),M=g[e],O=g[t],I=g[a]}return s[0]=M.x,s[1]=M.y,s[2]=M.z,s[3]=0,s[4]=O.x,s[5]=O.y,s[6]=O.z,s[7]=0,s[8]=I.x,s[9]=I.y,s[10]=I.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},N[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new T,x=new n(1,1,1),C=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof y&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,w),c=y.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),y.multiply(i,c,i)};var P=new y,D=new m;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=y.getRotation(i,D);return T.fromRotationMatrix(o,a)};var U=24110.54841,L=8640184.812866,F=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,G=p.TWO_PI/86400,q=new _;A.computeTemeToPseudoFixedMatrix=function(e,t){q=_.addSeconds(e,-_.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=U+n*(L+n*(F+n*B)),s=o*G%p.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new m);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return m.transpose(n,t)};var V=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new m,k=new m;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new m);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=m.fromRotationZ(-i.s,k),h=m.multiply(l,f,Y),d=e.dayNumber,E=e.secondsOfDay-_.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=d-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*p.TWO_PI;var v=m.fromRotationZ(S,k),N=m.multiply(h,v,Y),g=Math.cos(n.xPoleWander),M=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*p.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),D=k;return D[0]=g*C,D[1]=g*P,D[2]=O,D[3]=-M*P+I*O*C,D[4]=M*C+I*O*P,D[5]=-I*g,D[6]=-I*P-M*O*C,D[7]=I*C-M*O*P,D[8]=M*g,m.multiply(N,D,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,h.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,p.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new m),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new y,ue=new y;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=y.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=A.eastNorthUpToFixedFrame(o,i,oe),c=y.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=y.getColumn(t,0,ee),d=n.magnitude(h),E=y.multiplyByVector(c,h,re);r.fromElements(E.z,E.x,E.y,0,E);var _=y.getColumn(t,1,ee),p=n.magnitude(_),m=y.multiplyByVector(c,_,ae);r.fromElements(m.z,m.x,m.y,0,m);var T=y.getColumn(t,2,ee),R=n.magnitude(T),S=ie;return n.cross(E,m,S),n.normalize(S,S),n.cross(m,S,E),n.normalize(E,E),n.cross(S,E,m),n.normalize(m,m),n.multiplyByScalar(E,d,E),n.multiplyByScalar(m,p,m),n.multiplyByScalar(S,R,S),y.setColumn(a,0,E,a),y.setColumn(a,1,m,a),y.setColumn(a,2,S,a),y.setColumn(a,3,f,a),a};var se=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,oe),i=y.inverseTransformation(a,ue),o=r.cartesianToCartographic(t,Q),u=e.project(o,$),s=ne;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=y.fromTranslation(s,oe);return y.multiply(se,i,n),y.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,_)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,_));var i=n.fromCartesian4(l.getColumn(r,2,_));this._plane=f.fromPointNormal(e,i)}var _=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var p=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new E(r.center,n)};var m=new h,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=m;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=m;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,E=Math.sqrt(d),_=t/4,p=_*_,m=p*_,y=p*p,T=1+_-3*p/4+5*m/4-175*y/64,R=1-_+15*p/8-35*m/8,A=1-3*_+35*p/4,S=1-5*_,v=T*l-R*Math.sin(2*l)*_/2-A*Math.sin(4*l)*p/16-S*Math.sin(6*l)*m/48-5*Math.sin(8*l)*y/512,N=e._constants; -N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=d,N.cosineAlpha=E,N.u2Over4=_,N.u4Over16=p,N.u6Over64=m,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,E=(t-n)/t,_=i-r,p=Math.atan((1-E)*Math.tan(a)),m=Math.atan((1-E)*Math.tan(o)),y=Math.cos(p),T=Math.sin(p),R=Math.cos(m),A=Math.sin(m),S=y*R,v=y*A,N=T*A,g=T*R,M=_,O=u.TWO_PI,I=Math.cos(M),w=Math.sin(M);do{I=Math.cos(M),w=Math.sin(M);var x=v-g*I;f=Math.sqrt(R*R*w*w+x*x),c=N+S*I,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*w/f,h=1-C*C),O=M,d=c-2*N/h,isNaN(d)&&(d=0),M=_+l(E,C,h,s,f,c,d)}while(Math.abs(M-O)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),D=1+P*(4096+P*(P*(320-175*P)-768))/16384,U=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,F=U*f*(d+U*(c*(2*L-1)-U*d*(4*f*f-3)*(4*L-3)/6)/4),B=n*D*(s-F),z=Math.atan2(R*w,v-g*I),b=Math.atan2(y*w,v*I-g);e._distance=B,e._startHeading=z,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,_),E),e.normalize(i.cartographicToCartesian(a,_),_);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var E=new e,_=new e;return a(d.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}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),E=i*i,_=i*E,p=a.u8Over256,m=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*_*p*o/3+i*(1-m+7*T/4-15*y/4+579*p/64-(T-15*y/4+187*p/16)*o-(5*y/4-115*p/16)*u-29*p*s/16)+(m/2-T+71*y/32-85*p/16)*c+(5*T/16-5*y/4+383*p/96)*f-E*((y-11*p/2)*c+5*p*f/2)+(29*y/96-29*p/16)*h+539*p*d/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var v=Math.cos(2*a.sigma+R),N=Math.sin(R),g=Math.cos(R),M=a.cosineU*g,O=a.sineU*N,I=Math.atan2(N*a.sineHeading,M-O*a.cosineHeading),w=I-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,g,v);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=S,n.height=0,n):new t(this._start.longitude+w,S,0)},d}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,I),l=a.scaleToGeodeticSurface(n,w),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,g),_=a.cartesianToCartographic(l,M),p=h(f,i,o);x.setEndPoints(d,_);var m=x.surfaceDistance/f,y=s;d.height=i;var T=a.cartographicToCartesian(d,O);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=x.interpolateUsingSurfaceDistance(R*m,M);A.height=p[R],T=a.cartographicToCartesian(A,O),e.pack(T,u,y),y+=3}return y}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var _=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,_).height}return r};var p=new l,m=new e,y=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],g=new t,M=new t,O=new e,I=new e,w=new e,x=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,p),c=l.multiplyByPoint(s,e.ZERO,m),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),d=f.fromPointNormal(c,h,T),E=l.multiplyByPointAsVector(s,e.UNIT_X,R),_=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var g=i[0],M=t.length,O=1;O<M;++O){var I=t[O];if(f.getPointDistance(_,g)<0||f.getPointDistance(_,I)<0){var w=u.lineSegmentPlane(g,I,d,S);if(r(w)){var x=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,g)<0&&e.negate(x,x),i.push(e.add(w,x,new e)),o.push(N+1),e.negate(x,x),i.push(e.add(w,x,new e)),N=1}}i.push(e.clone(t[O])),N++,g=I}o.push(N)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],I);if(l=f?l[0]:l,0!==l){var _=u.geodeticSurfaceNormal(h,O);e.multiplyByScalar(_,l,_),e.add(h,_,h)}return[h.x,h.y,h.z]}var p=t.minDistance;if(!r(p)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);p=c.chordLength(m,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=E.numberOfPoints(a[y],a[y+1],p);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=a[y],M=a[y+1],w=f?l[y]:l,x=f?l[y+1]:l;S=d(v,M,p,u,w,x,A,S)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,g);P.height=f?l[o-1]:l;var D=u.cartographicToCartesian(P,O);return e.pack(D,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];D=t.cartesianToCartographic(a,D),n[r]=D.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function d(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;i<c;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function E(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function _(e,n,r,a,i,o,c,l){var h=b,d=G;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,U,h),h=t.normalize(h,h);var _=E(h,n,e,i);B=u.fromRotationZ(_,B),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(B,q,F),L);var p=z;p[0]=c;for(var m=0;m<l;m++)for(var y=0;y<r.length;y+=3)d=t.fromArray(r,y,d),d=u.multiplyByVector(p,d,d),d=s.multiplyByPoint(L,d,d),a.push(d.x,d.y,d.z);return a}function p(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=_(c,n,r,a,i,o[s/3],u,1)}return a}function m(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function y(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,h,d,E){var p,m=t.angleBetween(t.subtract(n,e,x),t.subtract(r,e,C)),y=i===a.BEVELED?0:Math.ceil(m/o.toRadians(5));p=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,x),m/(y+1),X),H):u.fromQuaternion(l.fromAxisAngle(e,m/(y+1),X),H);var T,R;if(n=t.clone(n,V),y>0)for(var A=E?2:1,S=0;S<y;S++)n=u.multiplyByVector(p,n,n),T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=_(R,T,h,f,c,d,1,A);else T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=_(R,T,h,f,c,d,1,1),r=t.clone(r,V),T=t.subtract(r,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,C),f=_(R,T,h,f,c,d,1,1);return f}var R=[new t,new t],A=new t,S=new t,v=new t,N=new t,g=new t,M=new t,O=new t,I=new t,w=new t,x=new t,C=new t,P={},D=new r,U=new t(-1,0,0),L=new s,F=new s,B=new u,z=u.IDENTITY.clone(),b=new t,G=new n,q=new t,W=new t,X=new l,V=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,E=i._cornerType,C=u?m(n,r):y(n,r),D=u?y(n,r):void 0,U=r.height/2,L=r.width/2,F=e.length,B=[],z=u?[]:void 0,b=A,G=S,q=v,W=N,X=g,V=M,H=O,Y=I,k=w,K=e[0],J=e[1];W=s.geodeticSurfaceNormal(K,W),b=t.subtract(J,K,b),b=t.normalize(b,b),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(z=_(K,Y,D,z,s,Q+U,1,1)),k=t.clone(K,k),K=J,G=t.negate(b,G);for(var ee,te,ne=1;ne<F-1;ne++){var re=u?2:1;J=e[ne+1],b=t.subtract(J,K,b),b=t.normalize(b,b),q=t.add(b,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(b,W),Z);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,x))),se=P.angleIsGreaterThanPi(b,G,K,s);se?(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,L,V),V),R[0]=t.clone(k,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,Q+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=p(te,Y,C,B,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,B,C,$+U,u):(q=t.negate(q,q),B=_(K,q,C,B,s,$+U,ue,re)),k=t.clone(H,k)):(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,-L,V),V),R[0]=t.clone(k,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,Q+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=p(te,Y,C,B,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,-L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,B,C,$+U,u):B=_(K,q,C,B,s,$+U,ue,re),k=t.clone(H,k)),G=t.negate(b,G)}else B=_(k,Y,C,B,s,Q+U,1,1),k=K;Q=$,$=l[ne+1],K=J}R[0]=t.clone(k,R[0]),R[1]=t.clone(K,R[1]),ee=d(R,Q+U,$+U,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=p(te,Y,C,B,s,ee,1),u&&(z=_(K,Y,D,z,s,$+U,1,1)),F=B.length;var ce=u?F+z.length:F,le=new Float64Array(ce);return le.set(B),u&&le.set(z,F),le},P}),define("Core/PolylineVolumeOutlineGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,_,p,m,y,T){"use strict";function R(e,t){var r=new d;r.position=new h({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:e});var a,o,u=t.length,s=r.position.values.length/3,c=e.length/3,l=c/u,_=E.createTypedArray(s,2*u*(l+1)),p=0;a=0;var m=a*u;for(o=0;o<u-1;o++)_[p++]=o+m,_[p++]=o+m+1;for(_[p++]=u-1+m,_[p++]=m,a=l-1,m=a*u,o=0;o<u-1;o++)_[p++]=o+m,_[p++]=o+m+1;for(_[p++]=u-1+m,_[p++]=m,a=0;a<l-1;a++){var T=u*a,R=T+u;for(o=0;o<u;o++)_[p++]=o+T,_[p++]=o+R}var A=new f({attributes:r,indices:E.createTypedArray(s,_),boundingSphere:n.fromVertices(e),primitiveType:y.LINES});return A}function A(e){e=u(e,u.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=l.clone(u(e.ellipsoid,l.WGS84)),this._cornerType=u(e.cornerType,o.ROUNDED),this._granularity=u(e.granularity,_.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var i=1+t.length*a.packedLength;i+=1+n.length*r.packedLength,this.packedLength=i+l.packedLength+2}A.pack=function(e,t,n){n=u(n,0);var i,o=e._positions,s=o.length;for(t[n++]=s,i=0;i<s;++i,n+=a.packedLength)a.pack(o[i],t,n);var c=e._shape;for(s=c.length,t[n++]=s,i=0;i<s;++i,n+=r.packedLength)r.pack(c[i],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var S=l.clone(l.UNIT_SPHERE),v={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,height:void 0,cornerType:void 0,granularity:void 0};A.unpack=function(e,t,n){t=u(t,0);var i,o=e[t++],c=new Array(o);for(i=0;i<o;++i,t+=a.packedLength)c[i]=a.unpack(e,t);o=e[t++];var f=new Array(o);for(i=0;i<o;++i,t+=r.packedLength)f[i]=r.unpack(e,t);var h=l.unpack(e,t,S);t+=l.packedLength;var d=e[t++],E=e[t];return s(n)?(n._positions=c,n._shape=f,n._ellipsoid=l.clone(h,n._ellipsoid),n._cornerType=d,n._granularity=E,n):(v.polylinePositions=c,v.shapePositions=f,v.cornerType=d,v.granularity=E,new A(v))};var N=new t;return A.createGeometry=function(n){var r=n._positions,i=e(r,a.equalsEpsilon),o=n._shape;if(o=m.removeDuplicatesFromShape(o),!(i.length<2||o.length<3)){p.computeWindingOrder2D(o)===T.CLOCKWISE&&o.reverse();var u=t.fromPoints(o,N),s=m.computePositions(i,o,u,n,!1);return R(s,o)}},A}),define("Workers/createPolylineVolumeOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolylineVolumeOutlineGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,_=a.z,p=l*l*d*d,m=f*f*E*E,y=h*h*_*_,T=p+m+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,M=o;M.x=A.x*S*2,M.y=A.y*v*2,M.z=A.z*N*2;var g,O,I,w,x,C,P,U,D,L,F,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(M)),z=0;do{B-=z,I=1/(1+B*S),w=1/(1+B*v),x=1/(1+B*N),C=I*I,P=w*w,U=x*x,D=C*I,L=P*w,F=U*x,g=p*C+m*P+y*U-1,O=p*D*S+m*L*v+y*F*N;var b=-2*O;z=g/b}while(Math.abs(g)>r.EPSILON12);return t(c)?(c.x=l*I,c.y=f*w,c.z=h*x,c):new e(l*I,f*w,h*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,a,i){return a=n(a,0),r(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,_=r(n)?n.oneOverRadiiSquared:h,p=r(n)?n._centerToleranceSquared:d,m=o(t,E,_,p,c);if(r(m)){var y=e.multiplyComponents(m,_,s);y=e.normalize(y,y);var T=e.subtract(t,m,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,_=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,_),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/arrayRemoveDuplicates",["./Check","./defaultValue","./defined","./Math"],function(e,t,n,r){"use strict";function a(e,r,a){if(n(e)){a=t(a,!1);var o=e.length;if(o<2)return e;var u,s,c;for(u=1;u<o&&(s=e[u-1],c=e[u],!r(s,c,i));++u);if(u===o)return a&&r(e[0],e[e.length-1],i)?e.slice(1):e;for(var l=e.slice(0,u);u<o;++u)c=e[u],r(s,c,i)||(l.push(c),s=c);return a&&l.length>1&&r(l[0],l[l.length-1],i)&&l.shift(),l}}var i=r.EPSILON10;return a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var _=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,_),c=Math.max(c,_)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,E=e.west,_=c;_.height=a,_.longitude=E,_.latitude=f,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.latitude=h,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=E,o[l]=t.cartographicToCartesian(_,o[l]),l++,f<0?_.latitude=f:h>0?_.latitude=h:_.latitude=0;for(var p=1;p<8;++p)_.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=t.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=E,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingRectangle",["./Cartesian2","./Cartographic","./Check","./defaultValue","./defined","./GeographicProjection","./Intersect","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,n,a){this.x=r(e,0),this.y=r(t,0),this.width=r(n,0),this.height=r(a,0)}s.packedLength=4,s.pack=function(e,t,n){return n=r(n,0),t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t},s.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new s),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n},s.fromPoints=function(e,t){if(a(t)||(t=new s),!a(e)||0===e.length)return t.x=0,t.y=0,t.width=0,t.height=0,t;for(var n=e.length,r=e[0].x,i=e[0].y,o=e[0].x,u=e[0].y,c=1;c<n;c++){var l=e[c],f=l.x,h=l.y;r=Math.min(f,r),o=Math.max(f,o),i=Math.min(h,i),u=Math.max(h,u)}return t.x=r,t.y=i,t.width=o-r,t.height=u-i,t};var c=new i,l=new t,f=new t;return s.fromRectangle=function(t,n,i){if(a(i)||(i=new s),!a(t))return i.x=0,i.y=0,i.width=0,i.height=0,i;n=r(n,c);var o=n.project(u.southwest(t,l)),h=n.project(u.northeast(t,f));return e.subtract(h,o,h),i.x=o.x,i.y=o.y,i.width=h.x,i.height=h.y,i},s.clone=function(e,t){if(a(e))return a(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new s(e.x,e.y,e.width,e.height)},s.union=function(e,t,n){a(n)||(n=new s);var r=Math.min(e.x,t.x),i=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),u=Math.max(e.y+e.height,t.y+t.height);return n.x=r,n.y=i,n.width=o-r,n.height=u-i,n},s.expand=function(e,t,n){n=s.clone(e,n);var r=t.x-n.x,a=t.y-n.y;return r>n.width?n.width=r:r<0&&(n.width-=r,n.x=t.x),a>n.height?n.height=a:a<0&&(n.height-=a,n.y=t.y),n},s.intersect=function(e,t){var n=e.x,r=e.y,a=t.x,i=t.y;return n>a+t.width||n+e.width<a||r+e.height<i||r>i+t.height?o.OUTSIDE:o.INTERSECTING},s.equals=function(e,t){return e===t||a(e)&&a(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.intersect=function(e){return s.intersect(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(_[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(_[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],h=_[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,p=e[s.getElementIndex(h,h)],m=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(h,f)],T=(p-m)/2/y;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7], +t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=n-u-f+d,_=2*(a-h),p=2*(i+l),m=2*(a+h),y=-n+u-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+d;return r(t)?(t[0]=E,t[1]=m,t[2]=R,t[3]=_,t[4]=y,t[5]=A,t[6]=p,t[7]=T,t[8]=S,t):new s(E,_,p,m,y,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,E=i*a+c*o*u,_=-c*a+i*o*u,p=-o,m=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=p,t[3]=f,t[4]=E,t[5]=m,t[6]=h,t[7]=_,t[8]=y,t):new s(l,f,h,d,E,_,p,m,y)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],_=[2,2,1],p=new s,m=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)f(d,p),s.transpose(p,m),s.multiply(d,p,d),s.multiply(m,d,d),s.multiply(h,p,h),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,h,d,E,_,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(_,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(p,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,_=t.y*t.w,p=t.z*t.z,m=t.z*t.w,y=t.w*t.w,T=s-d-p+y,R=2*(c-m),A=2*(f+_),S=2*(c+m),v=-s+d-p+y,N=2*(E-h),M=2*(f-_),g=2*(E+h),O=-s-d+p+y;return r[0]=T*i,r[1]=S*i,r[2]=M*i,r[3]=0,r[4]=R*o,r[5]=v*o,r[6]=g*o,r[7]=0,r[8]=A*u,r[9]=N*u,r[10]=O*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,E=f.x,_=f.y,p=f.z,m=d.x,y=d.y,T=d.z,R=r.x,A=r.y,S=r.z,v=u*-R+s*-A+c*-S,N=m*-R+y*-A+T*-S,M=E*R+_*A+p*S;return a(n)?(n[0]=u,n[1]=m,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-_,n[7]=0,n[8]=c,n[9]=T,n[10]=-p,n[11]=0,n[12]=v,n[13]=N,n[14]=M,n[15]=1,n):new l(u,s,c,v,m,y,T,N,-E,-_,-p,M,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,E=f,_=i+c,p=o+l,m=t+f,y=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=_,a[13]=p,a[14]=m,a[15]=y,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var _=new e;l.getMaximumScale=function(t){return l.getScale(t,_),e.maximumComponent(_)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],_=e[12],p=e[13],m=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],M=t[6],g=t[7],O=t[8],I=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+_*S,F=a*T+s*R+h*A+p*S,B=i*T+c*R+d*A+m*S,z=o*T+l*R+E*A+y*S,b=r*v+u*N+f*M+_*g,G=a*v+s*N+h*M+p*g,q=i*v+c*N+d*M+m*g,W=o*v+l*N+E*M+y*g,X=r*O+u*I+f*w+_*x,V=a*O+s*I+h*w+p*x,H=i*O+c*I+d*w+m*x,Y=o*O+l*I+E*w+y*x,k=r*C+u*P+f*U+_*D,Z=a*C+s*P+h*U+p*D,j=i*C+c*P+d*U+m*D,K=o*C+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],_=t[0],p=t[1],m=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],M=t[13],g=t[14],O=r*_+o*p+c*m,I=a*_+u*p+l*m,w=i*_+s*p+f*m,x=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,U=r*A+o*S+c*v,D=a*A+u*S+l*v,L=i*A+s*S+f*v,F=r*N+o*M+c*g+h,B=a*N+u*M+l*g+d,z=i*N+s*M+f*g+E;return n[0]=O,n[1]=I,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],_=t[3],p=t[4],m=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,S=a*h+u*d+l*E,v=i*h+s*d+f*E,N=r*_+o*p+c*m,M=a*_+u*p+l*m,g=i*_+s*p+f*m,O=r*y+o*T+c*R,I=a*y+u*T+l*R,w=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=M,n[6]=g,n[7]=0,n[8]=O,n[9]=I,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var p=new e;l.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var m=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,m),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],E=e[13],_=e[2],p=e[6],A=e[10],S=e[14],v=e[3],N=e[7],M=e[11],g=e[15],O=A*g,I=S*M,w=p*g,x=S*N,C=p*M,P=A*N,U=_*g,D=S*v,L=_*M,F=A*v,B=_*N,z=p*v,b=O*h+x*d+C*E-(I*h+w*d+P*E),G=I*f+U*d+F*E-(O*f+D*d+L*E),q=w*f+D*h+B*E-(x*f+U*h+z*E),W=P*f+L*h+z*d-(C*f+F*h+B*d),X=I*a+w*i+P*o-(O*a+x*i+C*o),V=O*r+D*i+L*o-(I*r+U*i+F*o),H=x*r+U*a+z*o-(w*r+D*a+B*o),Y=C*r+F*a+B*i-(P*r+L*a+z*i);O=i*E,I=o*d,w=a*E,x=o*h,C=a*d,P=i*h,U=r*E,D=o*f,L=r*d,F=i*f,B=r*h,z=a*f;var k=O*N+x*M+C*g-(I*N+w*M+P*g),Z=I*v+U*M+F*g-(O*v+D*M+L*g),j=w*v+D*N+B*g-(x*v+U*N+z*g),K=P*v+L*N+z*M-(C*v+F*N+B*M),J=w*A+P*S+I*p-(C*S+O*p+x*A),Q=L*S+O*_+D*A-(U*A+F*S+I*_),$=U*p+z*S+x*_-(B*S+w*_+D*p),ee=B*A+C*_+F*p-(L*p+z*A+P*_),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,_=-i*f-o*h-u*d,p=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=_,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,_=new e,p=new e,m=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,_),s=e.clone(r,p),c=e.clone(r,m),l=e.clone(r,y),f=t.length,M=1;M<f;M++){e.clone(t[M],r);var g=r.x,O=r.y,I=r.z;g<i.x&&e.clone(r,i),g>s.x&&e.clone(r,s),O<o.y&&e.clone(r,o),O>c.y&&e.clone(r,c),I<u.z&&e.clone(r,u),I>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),B=Math.sqrt(F),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,R),.5,N),q=0;for(M=0;M<f;M++){e.clone(t[M],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var V=Math.sqrt(X);B=.5*(B+V),F=B*B;var H=V-B;L.x=(B*L.x+H*r.x)/V,L.y=(B*L.y+H*r.y)/V,L.z=(B*L.z+H*r.z)/V}}return B<q?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var M=new o,g=new e,O=new e,I=new t,w=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,M),f.southwest(t,I),I.height=i,f.northeast(t,w),w.height=o;var s=n.project(I,g),c=n.project(w,O),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*d,_.z=s.z+.5*E,u};var x=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,_),f=e.clone(u,p),M=e.clone(u,m),g=e.clone(u,y),O=t.length,I=0;I<O;I+=i){var w=t[I]+n.x,x=t[I+1]+n.y,C=t[I+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>M.y&&e.clone(u,M),C<l.z&&e.clone(u,l),C>g.z&&e.clone(u,g)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(M,c,R)),D=e.magnitudeSquared(e.subtract(g,l,R)),L=s,F=f,B=P;U>B&&(B=U,L=c,F=M),D>B&&(B=D,L=l,F=g);var z=A;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=M.y,W.z=g.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),V=0;for(I=0;I<O;I+=i){u.x=t[I]+n.x,u.y=t[I+1]+n.y,u.z=t[I+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);G=.5*(G+k),b=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<V?(e.clone(z,o.center),o.radius=G):(e.clone(X,o.center),o.radius=V),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,_),c=e.clone(i,p),l=e.clone(i,m),f=e.clone(i,y),M=t.length,g=0;g<M;g+=3){var O=t[g]+n[g],I=t[g+1]+n[g+1],w=t[g+2]+n[g+2];i.x=O,i.y=I,i.z=w,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),I<u.y&&e.clone(i,u),I>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=x;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,F,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(g=0;g<M;g+=3){i.x=t[g]+n[g],i.y=t[g+1]+n[g+1],i.z=t[g+2]+n[g+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,F,R));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;F.x=(z*F.x+Y*i.x)/H,F.y=(z*F.y+Y*i.y)/H,F.z=(z*F.z+Y*i.z)/H}}return z<W?(e.clone(F,r.center),r.radius=z):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D);return e.add(i,o,i),e.add(i,u,i),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(i),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var B=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){ +var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),d=e.negate(c,X),E=Y,_=E[0];e.add(s,l,_),e.add(_,c,_),_=E[1],e.add(s,l,_),e.add(_,d,_),_=E[2],e.add(s,f,_),e.add(_,d,_),_=E[3],e.add(s,f,_),e.add(_,c,_),e.negate(s,s),_=E[4],e.add(s,l,_),e.add(_,c,_),_=E[5],e.add(s,l,_),e.add(_,d,_),_=E[6],e.add(s,f,_),e.add(_,d,_),_=E[7],e.add(s,f,_),e.add(_,c,_);for(var p=E.length,m=0;m<p;++m){var y=E[m];e.add(o,y,y);var T=i.cartesianToCartographic(y,H);n.project(T,y)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(v)&&(v=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(M)){M=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(M=!0,g=r(e[1]),g.isNightly=!!e[2])}return M}function c(){return s()&&g}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,I=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,I=r(e[1])))}return O}function f(){return l()&&I}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function d(){return h()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function _(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function p(){return E()&&P}function m(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,M,g,O,I,w,x,C,P,U,D,L,F,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:p,isWindows:_,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:m,supportsImageRenderingPixelated:y,imageRenderingValue:T};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/CornerType",["./freezeObject"],function(e){"use strict";var t={ROUNDED:0,MITERED:1,BEVELED:2};return e(t)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,E,_,p;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var m=a;m<o;m+=a)E=e[m],_=e[m+1],E<l&&(l=E),_<f&&(f=_),E>h&&(h=E),_>d&&(d=_);p=Math.max(h-l,d-f)}return r(u,c,a,l,f,p),c}function t(e,t,n,r,a){var i,o;if(a===I(e,t,n,r)>0)for(i=t;i<n;i+=r)o=M(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=M(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(g(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(g(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,_,p=e;e.prev!==e.next;)if(E=e.prev,_=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(_.i/s),g(e),e=_.next,p=_.next;else if(e=_,e===p){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(p(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),h=E(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&p(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&S(a,i)&&S(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),g(r),g(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&m(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(_(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&p(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function _(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function p(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function m(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new O(e.i,e.x,e.y),r=new O(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function M(e,t,n,r){var a=new O(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function g(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,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(I(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(I(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,E=new n,_={};_.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},_.computeWindingOrder2D=function(e){var t=_.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},_.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var p=new n,m=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return _.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,_=new Array(3*E),v=0;for(h=0;h<E;h++){var N=t[h];_[v++]=N.x,_[v++]=N.y,_[v++]=N.z}for(var M=[],g={},O=e.maximumRadius,I=l.chordLength(u,O),w=I*I;d.length>0;){ +var x,C,P=d.pop(),U=d.pop(),D=d.pop(),L=n.fromArray(_,3*D,p),F=n.fromArray(_,3*U,m),B=n.fromArray(_,3*P,y),z=n.multiplyByScalar(n.normalize(L,T),O,T),b=n.multiplyByScalar(n.normalize(F,R),O,R),G=n.multiplyByScalar(n.normalize(B,A),O,A),q=n.magnitudeSquared(n.subtract(z,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),X=n.magnitudeSquared(n.subtract(G,z,S)),V=Math.max(q,W,X);V>w?q===V?(x=Math.min(D,U)+" "+Math.max(D,U),h=g[x],i(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,g[x]=h),d.push(D,h,P),d.push(h,U,P)):W===V?(x=Math.min(U,P)+" "+Math.max(U,P),h=g[x],i(h)||(C=n.add(F,B,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,g[x]=h),d.push(U,h,D),d.push(h,P,D)):X===V&&(x=Math.min(P,D)+" "+Math.max(P,D),h=g[x],i(h)||(C=n.add(B,L,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,g[x]=h),d.push(P,h,U),d.push(h,D,U)):(M.push(D),M.push(U),M.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:_})},indices:M,primitiveType:f.TRIANGLES})},_.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},_}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,n,r,a){"use strict";function i(t,a,i){this.minimum=e.clone(n(t,e.ZERO)),this.maximum=e.clone(n(a,e.ZERO)),r(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,n){if(r(n)||(n=new i),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,_=d.y,p=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(_,o),c=Math.max(_,c),u=Math.min(p,u),l=Math.max(p,l)}var m=n.minimum;m.x=a,m.y=o,m.z=u;var y=n.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(m,y,n.center);return e.multiplyByScalar(T,.5,T),n},i.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new i(t.minimum,t.maximum)},i.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,_=o*c-u*s,p=u*c-d,m=4*E*p-_*_;if(m<0){var y,T,R;h*f>=l*d?(y=o,T=E,R=-2*u*E+o*_):(y=c,T=p,R=-c*_+2*s*p);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-m);i=-R+S;var v=i/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),M=i===S?-N:-T/N;return a=T<=0?N+M:-R/(N*N+M*M+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var g=E,O=-2*u*E+o*_,I=p,w=-c*_+2*s*p,x=Math.sqrt(m),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-g);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-I),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=i+D<2*s?i+s:D+s,G=z/b,q=F*b,W=-L*b-F*z,X=L*z,V=(s*W-u*X)/(-u*W+s*q);return B<=V?B<=G?V<=G?[B,V,G]:[B,G,V]:[G,B,V]:B<=G?[V,B,G]:V<=G?[V,G,B]:[G,V,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var _,p=E[0],m=E[1];if(p>=0&&m>=0){var y=Math.sqrt(p),T=Math.sqrt(m);return[h-T,h-y,h+y,h+T]}if(p>=0&&m<0)return _=Math.sqrt(p),[h-_,h+_];if(p<0&&m>=0)return _=Math.sqrt(m),[h-_,h+_]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,_,p=d[0],m=a-p,y=m*m,T=t/2,R=m/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*p,N=c+4*Math.abs(p);if(p<0||A*N<v*S){var M=Math.sqrt(v);E=M/2,_=0===M?0:(t*R-i)/M}else{var g=Math.sqrt(A);E=0===g?0:(t*R-i)/g,_=g/2}var O,I;0===T&&0===E?(O=0,I=0):n.sign(T)===n.sign(E)?(O=T+E,I=p/O):(I=T-E,O=p/I);var w,x;0===R&&0===_?(w=0,x=0):n.sign(R)===n.sign(_)?(w=R+_,x=o/w):(x=R-_,w=o/x);var C=r.computeRealRoots(1,O,w),P=r.computeRealRoots(1,I,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,_=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return _},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),h=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,_=f(h,d,E,S);if(r(_))return a.start=_.root0,a.stop=_.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,h=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,_=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),p=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,m=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===m){if(l=s.computeRealRoots(E,_,p),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-v)),T.push(new e(a,i*S,i*v))}return T}var N=y*y,M=m*m,g=E*E,O=y*m,I=g+M,w=2*(_*E+O),x=2*p*E+_*_-M+N,C=2*(p*_-O),P=p*p-N;if(0===I&&0===w&&0===x&&0===C)return T;l=c.computeRealRoots(I,w,x,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=o.sign(E)===o.sign(p)?d(E*B+p,_*F,o.EPSILON12):o.sign(p)===o.sign(_*F)?d(E*B,_*F+p,o.EPSILON12):d(E*B+_*F,p,o.EPSILON12);var G=d(m*F,y,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++D):T.push(new e(a,i*F,i*b))}return T}var _={};_.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,m=new e,y=new e,T=new e,R=new e;_.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,_=e.subtract(a,r,p),A=e.subtract(i,r,m),S=e.cross(E,A,y),v=e.dot(_,S);if(u){if(v<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,_,R),f=e.dot(E,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<o.EPSILON6)return;var N=1/v;if(s=e.subtract(d,r,T),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,_,R),f=e.dot(E,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},_.rayTriangle=function(t,n,a,i,o,u){var s=_.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;_.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=_.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};_.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new l;_.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,M=new e;_.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,M),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var E=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var _=s/a,p=r/s;return _<p?new i(_,p):{start:p,stop:_}}var m=Math.sqrt(r/a);return new i(m,m)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var g=new e,O=new e,I=new e,w=new e,x=new e,C=new u,P=new u,U=new u,D=new u,L=new u,F=new u,B=new u,z=new e,b=new e,G=new t;_.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,g);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,g),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,O),O),_=e.normalize(e.cross(f,d,I),I),p=C;p[0]=f.x,p[1]=f.y,p[2]=f.z,p[3]=d.x,p[4]=d.y,p[5]=d.z,p[6]=_.x,p[7]=_.y,p[8]=_.z;var m=u.transpose(p,P),y=u.fromScale(n.radii,U),T=u.fromScale(n.oneOverRadii,D),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,v=u.multiply(u.multiply(m,T,F),R,F),N=u.multiply(u.multiply(v,y,B),p,B),M=u.multiplyByVector(v,a,x),q=E(N,e.negate(M,g),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(y,u.multiplyByVector(p,q[H],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,G);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-V*V),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var q=new e;return _.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},_.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return _.lineSegmentPlane(t,n,a,f),_.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return _.lineSegmentPlane(n,r,a,f),_.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return _.lineSegmentPlane(r,t,a,f),_.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return _.lineSegmentPlane(n,t,a,f),_.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return _.lineSegmentPlane(r,n,a,f),_.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return _.lineSegmentPlane(t,r,a,f),_.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},_}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,n,r,a){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var o=new e;return i.fromCartesian4=function(n,r){var a=e.fromCartesian4(n,o),u=n.w;return t(r)?(e.clone(a,r.normal),r.distance=u,r):new i(a,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return _(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=m,_(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return p(2,arguments),e(t,function(t){function u(e){_(e)}function s(e){E(e)}var c,l,f,h,d,E,_,p,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(p=d.progress,_=function(e){h.push(e),--l||(E=_=m,d.reject(h))},E=function(e){f.push(e),--c||(E=_=m,d.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,p);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return p(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function _(e,t){for(var n,r=0;n=e[r++];)n(t)}function p(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function m(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,_,p,m;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,m=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(m),y,c,f,R,S);case"c":return u(String.fromCharCode(+m),y,c,f,R);case"b":return o(m,2,A,y,c,f,R);case"o":return o(m,8,A,y,c,f,R);case"x":return o(m,16,A,y,c,f,R);case"X":return o(m,16,A,y,c,f,R).toUpperCase();case"u":return o(m,10,A,y,c,f,R);case"i":case"d":return d=+m||0,d=Math.round(d-d%1),E=d<0?"-":T,m=E+a(String(Math.abs(d)),f,"0",!1),i(m,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+m,E=d<0?"-":T,_=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],m=E+Math.abs(d)[_](f),i(m,E,y,c,R)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return _.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=_.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=_.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}_.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=_.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return _.addSeconds(e,-r[0].offset,n);if(a>=r.length)return _.addSeconds(e,-r[a-1].offset,n);var i=_.secondsDifference(r[a].julianDate,e);return 0===i?_.addSeconds(e,-r[a].offset,n):i<=1?void 0:_.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function _(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var p=new i,m=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,M=/([Z+\-])?(\d{2})?:?(\d{2})?$/,g=/^(\d{2})(\.\d+)?/.source+M.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+M.source,I=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+M.source;_.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new _(n[0],n[1],c.UTC)},_.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,p=0,T=0,M=0,w=u[0],x=u[1];if(u=w.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(v),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(x)){u=x.match(I),null!==u?(h=+u[1],p=+u[2],T=+u[3],M=1e3*+(u[4]||0),L=5):(u=x.match(O),null!==u?(h=+u[1],p=+u[2],T=60*+(u[3]||0),L=4):(u=x.match(g),null!==u&&(h=+u[1],p=60*+(u[2]||0),L=3)));var F=u[L],B=+u[L+1],z=+(u[L+2]||0);switch(F){case"+":h-=B,p-=z;break;case"-":h+=B,p+=z;break;case"Z":break;default:p+=new Date(Date.UTC(n,s-1,l,h,p)).getTimezoneOffset()}}else p+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;p>=60;)p-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?y:m[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:m[s-1];for(;p<0;)p+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:m[s-1],l+=a;var G=E(n,s,l,h,p,T,M);return r(t)?(d(G[0],G[1],t),f(t)):t=new _(G[0],G[1],c.UTC),b&&_.addSeconds(t,1,t),t},_.now=function(e){return _.fromDate(new Date,e)};var w=new _(0,0,c.TAI);return _.toGregorianDate=function(e,t){var n=!1,a=h(e,w);r(a)||(_.addSeconds(e,-1,w),a=h(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var p=d+2-12*c|0,m=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=m,t.month=p,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(m,p,E,y,R,A,S,n)},_.toDate=function(e){var t=_.toGregorianDate(e,p),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},_.toIso8601=function(t,n){var a,i=_.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},_.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new _(e.dayNumber,e.secondsOfDay,c.TAI)},_.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},_.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},_.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(_.secondsDifference(e,t))<=n},_.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},_.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},_.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},_.computeTaiMinusUtc=function(e){T.julianDate=e;var n=_.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},_.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},_.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},_.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},_.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},_.lessThan=function(e,t){return _.compare(e,t)<0},_.lessThanOrEquals=function(e,t){return _.compare(e,t)<=0},_.greaterThan=function(e,t){return _.compare(e,t)>0},_.greaterThanOrEquals=function(e,t){return _.compare(e,t)>=0},_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)},_.prototype.toString=function(){return _.toIso8601(this)},_.leapSeconds=[new u(new _(2441317,43210,c.TAI),10),new u(new _(2441499,43211,c.TAI),11),new u(new _(2441683,43212,c.TAI),12),new u(new _(2442048,43213,c.TAI),13),new u(new _(2442413,43214,c.TAI),14),new u(new _(2442778,43215,c.TAI),15),new u(new _(2443144,43216,c.TAI),16),new u(new _(2443509,43217,c.TAI),17),new u(new _(2443874,43218,c.TAI),18),new u(new _(2444239,43219,c.TAI),19),new u(new _(2444786,43220,c.TAI),20),new u(new _(2445151,43221,c.TAI),21),new u(new _(2445516,43222,c.TAI),22),new u(new _(2446247,43223,c.TAI),23),new u(new _(2447161,43224,c.TAI),24),new u(new _(2447892,43225,c.TAI),25),new u(new _(2448257,43226,c.TAI),26),new u(new _(2448804,43227,c.TAI),27),new u(new _(2449169,43228,c.TAI),28),new u(new _(2449534,43229,c.TAI),29),new u(new _(2450083,43230,c.TAI),30),new u(new _(2450630,43231,c.TAI),31),new u(new _(2451179,43232,c.TAI),32),new u(new _(2453736,43233,c.TAI),33),new u(new _(2454832,43234,c.TAI),34),new u(new _(2456109,43235,c.TAI),35),new u(new _(2457204,43236,c.TAI),36),new u(new _(2457754,43237,c.TAI),37)],_}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(), +this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var _ in s)s.hasOwnProperty(_)&&E.setRequestHeader(_,s[_]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),_=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||E<0||_<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=n.samples,m=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=_,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=p.length;R<A;R+=e._columnCount){var S=p[R+a],v=p[R+_],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,M=new o(N,v,f.TAI);if(m.push(M),T){if(v!==y&&r(y)){var g=o.leapSeconds,O=t(g,M,d);if(O<0){var I=new u(M,v);g.splice(~O,0,I)}}y=v}}}function _(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,n){return t+e*(n-t)}function m(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return _(e,n,a,s,u),u;if(r.equals(l))return _(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],m=n[d+e._ut1MinusUtcSecondsColumn],y=m-E;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=m:m-=R-T)}return u.xPoleWander=p(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(f,E,m),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),_=E||o.greaterThanOrEquals(h,e);if(d&&_)return s=u,!E&&h.equals(e)&&++s,l=s+1,m(this,i,this._samples,e,s,l,n),n}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,m(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){if(i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),"data"===r.scheme)return r.toString();if("data"===a.scheme)return a.toString();n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,_,p=i-s*this._stepSizeDays,m=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)m[E]=p-R[E];for(E=0;E<=u;++E){for(T[E]=1,_=0;_<=u;++_)_!==E&&(T[E]*=m[_]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=h,a):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],_=s+f+E;if(_>0)n=Math.sqrt(_+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var p=h,m=0;f>s&&(m=1),E>s&&E>f&&(m=2);var y=p[m],T=p[y];n=Math.sqrt(e[c.getElementIndex(m,m)]-e[c.getElementIndex(y,y)]-e[c.getElementIndex(T,T)]+1);var R=d;R[m]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,y)]-e[c.getElementIndex(y,T)])*n,R[y]=(e[c.getElementIndex(y,m)]+e[c.getElementIndex(m,y)])*n,R[T]=(e[c.getElementIndex(T,m)]+e[c.getElementIndex(m,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,_=new l,p=new l,m=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),m=l.fromAxisAngle(e.UNIT_X,o.roll,E),p=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(p,m,p),_=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(_,i,i)};var y=new e,T=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,y);var u=l.computeAngle(R);r[o]=y.x*u,r[o+1]=y.y*u,r[o+2]=y.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var v=new l;l.lerp=function(e,t,n,r){return v=l.multiplyByScalar(t,n,v),r=l.multiplyByScalar(e,1-n,r),l.add(v,r,r)};var N=new l,M=new l,g=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return M=l.multiplyByScalar(e,Math.sin((1-n)*o),M),g=l.multiplyByScalar(i,Math.sin(n*o),g),r=l.add(M,g,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var O=new e,I=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,O);l.multiply(i,t,x);var u=l.log(x,I);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],D=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;U[B]=1/(z*b),D[B]=z/b}return U[7]=P/136,D[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)L[f]=(U[f]*s-D[f])*o,F[f]=(U[f]*c-D[f])*o;var h=a*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),d=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,h,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,_,p,m,y,T,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},v={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},N={},M={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},g=new n,O=new n,I=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(N[i])?r=N[i]:(r=function(r,i,s){if(u(s)||(s=new y),p.equalsEpsilon(r.x,0,p.EPSILON14)&&p.equalsEpsilon(r.y,0,p.EPSILON14)){var c=p.sign(r.z);n.unpack(v[e],0,g),"east"!==e&&"west"!==e&&n.multiplyByScalar(g,c,g),n.unpack(v[t],0,O),"east"!==t&&"west"!==t&&n.multiplyByScalar(O,c,O),n.unpack(v[a],0,I),"east"!==a&&"west"!==a&&n.multiplyByScalar(I,c,I)}else{i=o(i,h.WGS84),i.geodeticSurfaceNormal(r,M.up);var l=M.up,f=M.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,M.east),n.cross(l,f,M.north),n.multiplyByScalar(M.up,-1,M.down),n.multiplyByScalar(M.east,-1,M.west),n.multiplyByScalar(M.north,-1,M.south),g=M[e],O=M[t],I=M[a]}return s[0]=g.x,s[1]=g.y,s[2]=g.z,s[3]=0,s[4]=O.x,s[5]=O.y,s[6]=O.z,s[7]=0,s[8]=I.x,s[9]=I.y,s[10]=I.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},N[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new T,x=new n(1,1,1),C=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof y&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,w),c=y.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),y.multiply(i,c,i)};var P=new y,U=new m;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=y.getRotation(i,U);return T.fromRotationMatrix(o,a)};var D=24110.54841,L=8640184.812866,F=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,G=p.TWO_PI/86400,q=new _;A.computeTemeToPseudoFixedMatrix=function(e,t){q=_.addSeconds(e,-_.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(L+n*(F+n*B)),s=o*G%p.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new m(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new m);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return m.transpose(n,t)};var V=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new m,k=new m;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new m);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=m.fromRotationZ(-i.s,k),h=m.multiply(l,f,Y),d=e.dayNumber,E=e.secondsOfDay-_.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=d-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*p.TWO_PI;var v=m.fromRotationZ(S,k),N=m.multiply(h,v,Y),M=Math.cos(n.xPoleWander),g=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*p.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=k;return U[0]=M*C,U[1]=M*P,U[2]=O,U[3]=-g*P+I*O*C,U[4]=g*C+I*O*P,U[5]=-I*M,U[6]=-I*P-g*O*C,U[7]=I*C-g*O*P,U[8]=g*M,m.multiply(N,U,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,h.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,p.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new m),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new n,te=new n,ne=new m,re=new y,ae=new y;return A.basisTo2D=function(e,t,r){var a=y.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);n.fromElements(u.z,u.x,u.y,u);var s=A.eastNorthUpToFixedFrame(a,i,re),c=y.inverseTransformation(s,ae),l=y.getRotation(t,ne),f=y.multiplyByMatrix3(c,l,r);return y.multiply(Q,f,r),y.setTranslation(r,u,r),r},A.wgs84To2DModelMatrix=function(e,t,r){var a=e.ellipsoid,i=A.eastNorthUpToFixedFrame(t,a,re),o=y.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);n.fromElements(s.z,s.x,s.y,s);var c=y.fromTranslation(s,re);return y.multiply(Q,o,r),y.multiply(c,r,r),r},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,_)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,_));var i=n.fromCartesian4(l.getColumn(r,2,_));this._plane=f.fromPointNormal(e,i)}var _=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var p=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new E(r.center,n)};var m=new h,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=m;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=m;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,E=Math.sqrt(d),_=t/4,p=_*_,m=p*_,y=p*p,T=1+_-3*p/4+5*m/4-175*y/64,R=1-_+15*p/8-35*m/8,A=1-3*_+35*p/4,S=1-5*_,v=T*l-R*Math.sin(2*l)*_/2-A*Math.sin(4*l)*p/16-S*Math.sin(6*l)*m/48-5*Math.sin(8*l)*y/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=d,N.cosineAlpha=E,N.u2Over4=_,N.u4Over16=p,N.u6Over64=m,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){ +var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,E=(t-n)/t,_=i-r,p=Math.atan((1-E)*Math.tan(a)),m=Math.atan((1-E)*Math.tan(o)),y=Math.cos(p),T=Math.sin(p),R=Math.cos(m),A=Math.sin(m),S=y*R,v=y*A,N=T*A,M=T*R,g=_,O=u.TWO_PI,I=Math.cos(g),w=Math.sin(g);do{I=Math.cos(g),w=Math.sin(g);var x=v-M*I;f=Math.sqrt(R*R*w*w+x*x),c=N+S*I,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*w/f,h=1-C*C),O=g,d=c-2*N/h,isNaN(d)&&(d=0),g=_+l(E,C,h,s,f,c,d)}while(Math.abs(g-O)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),U=1+P*(4096+P*(P*(320-175*P)-768))/16384,D=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,F=D*f*(d+D*(c*(2*L-1)-D*d*(4*f*f-3)*(4*L-3)/6)/4),B=n*U*(s-F),z=Math.atan2(R*w,v-M*I),b=Math.atan2(y*w,v*I-M);e._distance=B,e._startHeading=z,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,_),E),e.normalize(i.cartographicToCartesian(a,_),_);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var E=new e,_=new e;return a(d.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}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),E=i*i,_=i*E,p=a.u8Over256,m=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*_*p*o/3+i*(1-m+7*T/4-15*y/4+579*p/64-(T-15*y/4+187*p/16)*o-(5*y/4-115*p/16)*u-29*p*s/16)+(m/2-T+71*y/32-85*p/16)*c+(5*T/16-5*y/4+383*p/96)*f-E*((y-11*p/2)*c+5*p*f/2)+(29*y/96-29*p/16)*h+539*p*d/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var v=Math.cos(2*a.sigma+R),N=Math.sin(R),M=Math.cos(R),g=a.cosineU*M,O=a.sineU*N,I=Math.atan2(N*a.sineHeading,g-O*a.cosineHeading),w=I-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,M,v);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=S,n.height=0,n):new t(this._start.longitude+w,S,0)},d}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,I),l=a.scaleToGeodeticSurface(n,w),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,M),_=a.cartesianToCartographic(l,g),p=h(f,i,o);x.setEndPoints(d,_);var m=x.surfaceDistance/f,y=s;d.height=i;var T=a.cartographicToCartesian(d,O);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=x.interpolateUsingSurfaceDistance(R*m,g);A.height=p[R],T=a.cartographicToCartesian(A,O),e.pack(T,u,y),y+=3}return y}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var _=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,_).height}return r};var p=new l,m=new e,y=new e,T=new f(e.UNIT_X,0),R=new e,A=new f(e.UNIT_X,0),S=new e,v=new e,N=[],M=new t,g=new t,O=new e,I=new e,w=new e,x=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,p),c=l.multiplyByPoint(s,e.ZERO,m),h=e.normalize(l.multiplyByPointAsVector(s,e.UNIT_Y,y),y),d=f.fromPointNormal(c,h,T),E=e.normalize(l.multiplyByPointAsVector(s,e.UNIT_X,R),R),_=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var M=i[0],g=t.length,O=1;O<g;++O){var I=t[O];if(f.getPointDistance(_,M)<0||f.getPointDistance(_,I)<0){var w=u.lineSegmentPlane(M,I,d,S);if(r(w)){var x=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,M)<0&&e.negate(x,x),i.push(e.add(w,x,new e)),o.push(N+1),e.negate(x,x),i.push(e.add(w,x,new e)),N=1}}i.push(e.clone(t[O])),N++,M=I}o.push(N)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],I);if(l=f?l[0]:l,0!==l){var _=u.geodeticSurfaceNormal(h,O);e.multiplyByScalar(_,l,_),e.add(h,_,h)}return[h.x,h.y,h.z]}var p=t.minDistance;if(!r(p)){var m=n(t.granularity,c.RADIANS_PER_DEGREE);p=c.chordLength(m,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=E.numberOfPoints(a[y],a[y+1],p);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=a[y],g=a[y+1],w=f?l[y]:l,x=f?l[y+1]:l;S=d(v,g,p,u,w,x,A,S)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,M);P.height=f?l[o-1]:l;var U=u.cartographicToCartesian(P,O);return e.pack(U,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/PolylineVolumeGeometryLibrary",["./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./CornerType","./EllipsoidTangentPlane","./Math","./Matrix3","./Matrix4","./PolylinePipeline","./Quaternion","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t){for(var n=new Array(e.length),r=0;r<e.length;r++){var a=e[r];U=t.cartesianToCartographic(a,U),n[r]=U.height,e[r]=t.scaleToGeodeticSurface(a,a)}return n}function d(e,n,r,a){var i,o=e[0],u=e[1],s=t.angleBetween(o,u),c=Math.ceil(s/a),l=new Array(c);if(n===r){for(i=0;i<c;i++)l[i]=n;return l.push(r),l}var f=r-n,h=f/c;for(i=1;i<c;i++){var d=n+i*h;l[i]=d}return l[0]=n,l.push(r),l}function E(n,r,a,o){var u=new i(a,o),s=u.projectPointOntoPlane(t.add(a,n,Y),Y),c=u.projectPointOntoPlane(t.add(a,r,k),k),l=e.angleBetween(s,c);return c.x*s.y-c.y*s.x>=0?-l:l}function _(e,n,r,a,i,o,c,l){var h=b,d=G;L=f.eastNorthUpToFixedFrame(e,i,L),h=s.multiplyByPointAsVector(L,D,h),h=t.normalize(h,h);var _=E(h,n,e,i);B=u.fromRotationZ(_,B),q.z=o,L=s.multiplyTransformation(L,s.fromRotationTranslation(B,q,F),L);var p=z;p[0]=c;for(var m=0;m<l;m++)for(var y=0;y<r.length;y+=3)d=t.fromArray(r,y,d),d=u.multiplyByVector(p,d,d),d=s.multiplyByPoint(L,d,d),a.push(d.x,d.y,d.z);return a}function p(e,n,r,a,i,o,u){for(var s=0;s<e.length;s+=3){var c=t.fromArray(e,s,W);a=_(c,n,r,a,i,o[s/3],u,1)}return a}function m(e,t){var n=e.length,r=new Array(6*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=e[0];r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o;for(var s=1;s<n;s++){u=e[s];var c=u.x-i,l=u.y-o;r[a++]=c,r[a++]=0,r[a++]=l,r[a++]=c,r[a++]=0,r[a++]=l}return u=e[0],r[a++]=u.x-i,r[a++]=0,r[a++]=u.y-o,r}function y(e,t){for(var n=e.length,r=new Array(3*n),a=0,i=t.x+t.width/2,o=t.y+t.height/2,u=0;u<n;u++)r[a++]=e[u].x-i,r[a++]=0,r[a++]=e[u].y-o;return r}function T(e,n,r,i,s,c,f,h,d,E){var p,m=t.angleBetween(t.subtract(n,e,x),t.subtract(r,e,C)),y=i===a.BEVELED?0:Math.ceil(m/o.toRadians(5));p=s?u.fromQuaternion(l.fromAxisAngle(t.negate(e,x),m/(y+1),X),H):u.fromQuaternion(l.fromAxisAngle(e,m/(y+1),X),H);var T,R;if(n=t.clone(n,V),y>0)for(var A=E?2:1,S=0;S<y;S++)n=u.multiplyByVector(p,n,n),T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=_(R,T,h,f,c,d,1,A);else T=t.subtract(n,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(n,C),f=_(R,T,h,f,c,d,1,1),r=t.clone(r,V),T=t.subtract(r,e,x),T=t.normalize(T,T),s||(T=t.negate(T,T)),R=c.scaleToGeodeticSurface(r,C),f=_(R,T,h,f,c,d,1,1);return f}var R=[new t,new t],A=new t,S=new t,v=new t,N=new t,M=new t,g=new t,O=new t,I=new t,w=new t,x=new t,C=new t,P={},U=new r,D=new t(-1,0,0),L=new s,F=new s,B=new u,z=u.IDENTITY.clone(),b=new t,G=new n,q=new t,W=new t,X=new l,V=new t,H=new u;P.removeDuplicatesFromShape=function(t){for(var n=t.length,r=[],a=n-1,i=0;i<n;a=i++){var o=t[a],u=t[i];e.equals(o,u)||r.push(u)}return r};var Y=new t,k=new t;P.angleIsGreaterThanPi=function(e,n,r,a){var o=new i(r,a),u=o.projectPointOntoPlane(t.add(r,e,Y),Y),s=o.projectPointOntoPlane(t.add(r,n,k),k);return s.x*u.y-s.y*u.x>=0};var Z=new t,j=new t;return P.computePositions=function(e,n,r,i,u){var s=i._ellipsoid,l=h(e,s),f=i._granularity,E=i._cornerType,C=u?m(n,r):y(n,r),U=u?y(n,r):void 0,D=r.height/2,L=r.width/2,F=e.length,B=[],z=u?[]:void 0,b=A,G=S,q=v,W=N,X=M,V=g,H=O,Y=I,k=w,K=e[0],J=e[1];W=s.geodeticSurfaceNormal(K,W),b=t.subtract(J,K,b),b=t.normalize(b,b),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y);var Q=l[0],$=l[1];u&&(z=_(K,Y,U,z,s,Q+D,1,1)),k=t.clone(K,k),K=J,G=t.negate(b,G);for(var ee,te,ne=1;ne<F-1;ne++){var re=u?2:1;J=e[ne+1],b=t.subtract(J,K,b),b=t.normalize(b,b),q=t.add(b,G,q),q=t.normalize(q,q),W=s.geodeticSurfaceNormal(K,W);var ae=t.multiplyByScalar(W,t.dot(b,W),Z);t.subtract(b,ae,ae),t.normalize(ae,ae);var ie=t.multiplyByScalar(W,t.dot(G,W),j);t.subtract(G,ie,ie),t.normalize(ie,ie);var oe=!o.equalsEpsilon(Math.abs(t.dot(ae,ie)),1,o.EPSILON7);if(oe){q=t.cross(q,W,q),q=t.cross(W,q,q),q=t.normalize(q,q);var ue=1/Math.max(.25,t.magnitude(t.cross(q,G,x))),se=P.angleIsGreaterThanPi(b,G,K,s);se?(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,L,V),V),R[0]=t.clone(k,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,Q+D,$+D,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=p(te,Y,C,B,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,B,C,$+D,u):(q=t.negate(q,q),B=_(K,q,C,B,s,$+D,ue,re)),k=t.clone(H,k)):(X=t.add(K,t.multiplyByScalar(q,ue*L,q),X),V=t.add(X,t.multiplyByScalar(Y,-L,V),V),R[0]=t.clone(k,R[0]),R[1]=t.clone(V,R[1]),ee=d(R,Q+D,$+D,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=p(te,Y,C,B,s,ee,1),Y=t.cross(W,b,Y),Y=t.normalize(Y,Y),H=t.add(X,t.multiplyByScalar(Y,-L,H),H),E===a.ROUNDED||E===a.BEVELED?T(X,V,H,E,se,s,B,C,$+D,u):B=_(K,q,C,B,s,$+D,ue,re),k=t.clone(H,k)),G=t.negate(b,G)}else B=_(k,Y,C,B,s,Q+D,1,1),k=K;Q=$,$=l[ne+1],K=J}R[0]=t.clone(k,R[0]),R[1]=t.clone(K,R[1]),ee=d(R,Q+D,$+D,f),te=c.generateArc({positions:R,granularity:f,ellipsoid:s}),B=p(te,Y,C,B,s,ee,1),u&&(z=_(K,Y,U,z,s,$+D,1,1)),F=B.length;var ce=u?F+z.length:F,le=new Float64Array(ce);return le.set(B),u&&le.set(z,F),le},P}),define("Core/PolylineVolumeOutlineGeometry",["./arrayRemoveDuplicates","./BoundingRectangle","./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./CornerType","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PolylineVolumeGeometryLibrary","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,_,p,m,y,T){"use strict";function R(e,t){var r=new d;r.position=new h({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:e});var a,o,u=t.length,s=r.position.values.length/3,c=e.length/3,l=c/u,_=E.createTypedArray(s,2*u*(l+1)),p=0;a=0;var m=a*u;for(o=0;o<u-1;o++)_[p++]=o+m,_[p++]=o+m+1;for(_[p++]=u-1+m,_[p++]=m,a=l-1,m=a*u,o=0;o<u-1;o++)_[p++]=o+m,_[p++]=o+m+1;for(_[p++]=u-1+m,_[p++]=m,a=0;a<l-1;a++){var T=u*a,R=T+u;for(o=0;o<u;o++)_[p++]=o+T,_[p++]=o+R}var A=new f({attributes:r,indices:E.createTypedArray(s,_),boundingSphere:n.fromVertices(e),primitiveType:y.LINES});return A}function A(e){e=u(e,u.EMPTY_OBJECT);var t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=l.clone(u(e.ellipsoid,l.WGS84)),this._cornerType=u(e.cornerType,o.ROUNDED),this._granularity=u(e.granularity,_.RADIANS_PER_DEGREE),this._workerName="createPolylineVolumeOutlineGeometry";var i=1+t.length*a.packedLength;i+=1+n.length*r.packedLength,this.packedLength=i+l.packedLength+2}A.pack=function(e,t,n){n=u(n,0);var i,o=e._positions,s=o.length;for(t[n++]=s,i=0;i<s;++i,n+=a.packedLength)a.pack(o[i],t,n);var c=e._shape;for(s=c.length,t[n++]=s,i=0;i<s;++i,n+=r.packedLength)r.pack(c[i],t,n);return l.pack(e._ellipsoid,t,n),n+=l.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var S=l.clone(l.UNIT_SPHERE),v={polylinePositions:void 0,shapePositions:void 0,ellipsoid:S,height:void 0,cornerType:void 0,granularity:void 0};A.unpack=function(e,t,n){t=u(t,0);var i,o=e[t++],c=new Array(o);for(i=0;i<o;++i,t+=a.packedLength)c[i]=a.unpack(e,t);o=e[t++];var f=new Array(o);for(i=0;i<o;++i,t+=r.packedLength)f[i]=r.unpack(e,t);var h=l.unpack(e,t,S);t+=l.packedLength;var d=e[t++],E=e[t];return s(n)?(n._positions=c,n._shape=f,n._ellipsoid=l.clone(h,n._ellipsoid),n._cornerType=d,n._granularity=E,n):(v.polylinePositions=c,v.shapePositions=f,v.cornerType=d,v.granularity=E,new A(v))};var N=new t;return A.createGeometry=function(n){var r=n._positions,i=e(r,a.equalsEpsilon),o=n._shape;if(o=m.removeDuplicatesFromShape(o),!(i.length<2||o.length<3)){p.computeWindingOrder2D(o)===T.CLOCKWISE&&o.reverse();var u=t.fromPoints(o,N),s=m.computePositions(i,o,u,n,!1);return R(s,o)}},A}),define("Workers/createPolylineVolumeOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/PolylineVolumeOutlineGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createRectangleGeometry.js b/engines/Cesium/Workers/createRectangleGeometry.js index 6e6b457..ef546b7 100644 --- a/engines/Cesium/Workers/createRectangleGeometry.js +++ b/engines/Cesium/Workers/createRectangleGeometry.js @@ -55,9 +55,9 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var E=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,E=r*u-a*o;return n.x=c,n.y=l,n.z=E,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(r),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),n(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,E=n.y,f=n.z,h=a.x,d=a.y,p=a.z,y=l*l*h*h,_=E*E*d*d,m=f*f*p*p,T=y+_+m,R=Math.sqrt(1/T),v=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(v,c):void 0;var A=u.x,S=u.y,N=u.z,g=o;g.x=v.x*A*2,g.y=v.y*S*2,g.z=v.z*N*2;var I,M,x,O,w,C,P,L,b,U,F,D=(1-R)*e.magnitude(n)/(.5*e.magnitude(g)),B=0;do{D-=B,x=1/(1+D*A),O=1/(1+D*S),w=1/(1+D*N),C=x*x,P=O*O,L=w*w,b=C*x,U=P*O,F=L*w,I=y*C+_*P+m*L-1,M=y*b*A+_*U*S+m*F*N;var z=-2*M;B=I/z}while(Math.abs(I)>r.EPSILON12);return t(c)?(c.x=l*x,c.y=E*O,c.z=f*w,c):new e(l*x,E*O,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var d=n(r)?r.oneOverRadii:E,p=n(r)?r.oneOverRadiiSquared:f,y=n(r)?r._centerToleranceSquared:h,_=o(t,d,p,y,c);if(n(_)){var m=e.multiplyComponents(_,p,s);m=e.normalize(m,m);var T=e.subtract(t,_,l),R=Math.atan2(m.y,m.x),v=Math.asin(m.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=v,a.height=A,a):new u(R,v,A)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,n){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,p=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,d);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=E,n):new s(a,l,i,E)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),E=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return r(n)?(n.west=l,n.south=f,n.east=E,n.north=h,n):new s(l,f,E,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),E=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=E,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,E=e.north,f=e.south,h=e.east,d=e.west,p=c;p.height=a,p.longitude=d,p.latitude=E,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.latitude=f,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=t.cartographicToCartesian(p,o[l]),l++,E<0?p.latitude=E:f>0?p.latitude=f:p.latitude=0;for(var y=1;y<8;++y)p.longitude=-Math.PI+y*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=t.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=d,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=t.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(p[n],d[n])];t+=2*r*r}return Math.sqrt(t)}function E(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(p[i],d[i])]);o>r&&(a=i,r=o)}var c=1,l=0,E=d[a],f=p[a];if(Math.abs(e[s.getElementIndex(f,E)])>n){var h,y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(E,E)],m=e[s.getElementIndex(f,E)],T=(y-_)/2/m;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(E,E)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,E)]=l,t[s.getElementIndex(E,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=n-u-E+h,p=2*(a-f),y=2*(i+l),_=2*(a+f),m=-n+u-E+h,T=2*(c-o),R=2*(i-l),v=2*(c+o),A=-n-u+E+h;return r(t)?(t[0]=d,t[1]=_,t[2]=R,t[3]=p,t[4]=m,t[5]=v,t[6]=y,t[7]=T,t[8]=A,t):new s(d,p,y,_,m,T,R,v,A)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,E=-i*u+c*o*a,f=c*u+i*o*a,h=n*u,d=i*a+c*o*u,p=-o*i+i*o*u,y=-o,_=c*n,m=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=y,t[3]=E,t[4]=d,t[5]=_,t[6]=f,t[7]=p,t[8]=m,t):new s(l,E,f,h,d,p,y,_,m)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=E,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],p=[2,2,1],y=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),d=n*c(h);o<a&&l(h)>d;)E(h,y),s.transpose(y,_),s.multiply(h,y,h),s.multiply(_,h,h),s.multiply(f,y,f),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],E=e[8],f=s.determinant(e);t[0]=o*E-l*u,t[1]=l*a-r*E,t[2]=r*u-o*a,t[3]=c*u-i*E,t[4]=n*E-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/f;return s.multiplyByScalar(t,h,t); -},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,E,f,h,d,p,y){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(d,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(E,0),this[11]=r(p,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(y,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,E=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,p=t.y*t.w,y=t.z*t.z,_=t.z*t.w,m=t.w*t.w,T=s-h-y+m,R=2*(c-_),v=2*(E+p),A=2*(c+_),S=-s+h-y+m,N=2*(d-f),g=2*(E-p),I=2*(d+f),M=-s-h+y+m;return r[0]=T*i,r[1]=A*i,r[2]=g*i,r[3]=0,r[4]=R*o,r[5]=S*o,r[6]=I*o,r[7]=0,r[8]=v*u,r[9]=N*u,r[10]=M*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var E=new e,f=new e,h=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,E),e.normalize(e.cross(E,o,f),f),e.normalize(e.cross(f,E,h),h);var u=f.x,s=f.y,c=f.z,d=E.x,p=E.y,y=E.z,_=h.x,m=h.y,T=h.z,R=r.x,v=r.y,A=r.z,S=u*-R+s*-v+c*-A,N=_*-R+m*-v+T*-A,g=d*R+p*v+y*A;return a(n)?(n[0]=u,n[1]=_,n[2]=-d,n[3]=0,n[4]=s,n[5]=m,n[6]=-p,n[7]=0,n[8]=c,n[9]=T,n[10]=-y,n[11]=0,n[12]=S,n[13]=N,n[14]=g,n[15]=1,n):new l(u,s,c,S,_,m,T,N,-d,-p,-y,g,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,E=-(r+n)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,E=.5*(n-t),f=c,h=l,d=E,p=i+c,y=o+l,_=t+E,m=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=p,a[13]=y,a[14]=_,a[15]=m,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var d=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),n};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],p=e[12],y=e[13],_=e[14],m=e[15],T=t[0],R=t[1],v=t[2],A=t[3],S=t[4],N=t[5],g=t[6],I=t[7],M=t[8],x=t[9],O=t[10],w=t[11],C=t[12],P=t[13],L=t[14],b=t[15],U=r*T+u*R+E*v+p*A,F=a*T+s*R+f*v+y*A,D=i*T+c*R+h*v+_*A,B=o*T+l*R+d*v+m*A,z=r*S+u*N+E*g+p*I,G=a*S+s*N+f*g+y*I,q=i*S+c*N+h*g+_*I,V=o*S+l*N+d*g+m*I,X=r*M+u*x+E*O+p*w,W=a*M+s*x+f*O+y*w,H=i*M+c*x+h*O+_*w,Y=o*M+l*x+d*O+m*w,k=r*C+u*P+E*L+p*b,Z=a*C+s*P+f*L+y*b,K=i*C+c*P+h*L+_*b,j=o*C+l*P+d*L+m*b;return n[0]=U,n[1]=F,n[2]=D,n[3]=B,n[4]=z,n[5]=G,n[6]=q,n[7]=V,n[8]=X,n[9]=W,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=K,n[15]=j,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],p=t[0],y=t[1],_=t[2],m=t[4],T=t[5],R=t[6],v=t[8],A=t[9],S=t[10],N=t[12],g=t[13],I=t[14],M=r*p+o*y+c*_,x=a*p+u*y+l*_,O=i*p+s*y+E*_,w=r*m+o*T+c*R,C=a*m+u*T+l*R,P=i*m+s*T+E*R,L=r*v+o*A+c*S,b=a*v+u*A+l*S,U=i*v+s*A+E*S,F=r*N+o*g+c*I+f,D=a*N+u*g+l*I+h,B=i*N+s*g+E*I+d;return n[0]=M,n[1]=x,n[2]=O,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=L,n[9]=b,n[10]=U,n[11]=0,n[12]=F,n[13]=D,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],p=t[3],y=t[4],_=t[5],m=t[6],T=t[7],R=t[8],v=r*f+o*h+c*d,A=a*f+u*h+l*d,S=i*f+s*h+E*d,N=r*p+o*y+c*_,g=a*p+u*y+l*_,I=i*p+s*y+E*_,M=r*m+o*T+c*R,x=a*m+u*T+l*R,O=i*m+s*T+E*R;return n[0]=v,n[1]=A,n[2]=S,n[3]=0,n[4]=N,n[5]=g,n[6]=I,n[7]=0,n[8]=M,n[9]=x,n[10]=O,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var y=new e;l.multiplyByUniformScale=function(e,t,n){return y.x=t,y.y=t,y.z=t,l.multiplyByScale(e,y,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var _=new s,m=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,_),m,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],E=e[1],f=e[5],h=e[9],d=e[13],p=e[2],y=e[6],v=e[10],A=e[14],S=e[3],N=e[7],g=e[11],I=e[15],M=v*I,x=A*g,O=y*I,w=A*N,C=y*g,P=v*N,L=p*I,b=A*S,U=p*g,F=v*S,D=p*N,B=y*S,z=M*f+w*h+C*d-(x*f+O*h+P*d),G=x*E+L*h+F*d-(M*E+b*h+U*d),q=O*E+b*f+D*d-(w*E+L*f+B*d),V=P*E+U*f+B*h-(C*E+F*f+D*h),X=x*a+O*i+P*o-(M*a+w*i+C*o),W=M*r+b*i+U*o-(x*r+L*i+F*o),H=w*r+L*a+B*o-(O*r+b*a+D*o),Y=C*r+F*a+D*i-(P*r+U*a+B*i);M=i*d,x=o*h,O=a*d,w=o*f,C=a*h,P=i*f,L=r*d,b=o*E,U=r*h,F=i*E,D=r*f,B=a*E;var k=M*N+w*g+C*I-(x*N+O*g+P*I),Z=x*S+L*g+F*I-(M*S+b*g+U*I),K=O*S+b*N+D*I-(w*S+L*N+B*I),j=P*S+U*N+B*g-(C*S+F*N+D*g),Q=O*v+P*A+x*y-(C*A+M*y+w*v),J=U*A+M*p+b*v-(L*v+F*A+x*p),$=L*y+B*A+w*p-(D*A+O*p+b*y),ee=D*v+C*p+F*y-(U*y+B*v+P*p),te=r*z+a*G+i*q+o*V;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=z*te,n[1]=G*te,n[2]=q*te,n[3]=V*te,n[4]=X*te,n[5]=W*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=K*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-n*E-r*f-a*h,p=-i*E-o*f-u*h,y=-s*E-c*f-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=p,t[14]=y,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,E){"use strict";function f(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,d=new e,p=new e,y=new e,_=new e,m=new e,T=new e,R=new e,v=new e,A=new e,S=new e,N=new e;f.fromPoints=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,h),o=e.clone(r,d),u=e.clone(r,p),s=e.clone(r,y),c=e.clone(r,_),l=e.clone(r,m),E=t.length,g=1;g<E;g++){e.clone(t[g],r);var I=r.x,M=r.y,x=r.z;I<i.x&&e.clone(r,i),I>s.x&&e.clone(r,s),M<o.y&&e.clone(r,o),M>c.y&&e.clone(r,c),x<u.z&&e.clone(r,u),x>l.z&&e.clone(r,l)}var O=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,L=s,b=O;w>b&&(b=w,P=o,L=c),C>b&&(b=C,P=u,L=l);var U=v;U.x=.5*(P.x+L.x),U.y=.5*(P.y+L.y),U.z=.5*(P.z+L.z);var F=e.magnitudeSquared(e.subtract(L,U,R)),D=Math.sqrt(F),B=A;B.x=i.x,B.y=o.y,B.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,R),.5,N),q=0;for(g=0;g<E;g++){e.clone(t[g],r);var V=e.magnitude(e.subtract(r,G,R));V>q&&(q=V);var X=e.magnitudeSquared(e.subtract(r,U,R));if(X>F){var W=Math.sqrt(X);D=.5*(D+W),F=D*D;var H=W-D;U.x=(D*U.x+H*r.x)/W,U.y=(D*U.y+H*r.y)/W,U.z=(D*U.z+H*r.z)/W}}return D<q?(e.clone(U,n.center),n.radius=D):(e.clone(G,n.center),n.radius=q),n};var g=new o,I=new e,M=new e,x=new t,O=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,g),E.southwest(t,x),x.height=i,E.northeast(t,O),O.height=o;var s=n.project(x,I),c=n.project(O,M),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*h,p.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=E.subsample(e,t,n,w)),f.fromPoints(u,o)},f.fromVertices=function(t,n,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,p),E=e.clone(u,y),g=e.clone(u,_),I=e.clone(u,m),M=t.length,x=0;x<M;x+=i){var O=t[x]+n.x,w=t[x+1]+n.y,C=t[x+2]+n.z;u.x=O,u.y=w,u.z=C,O<s.x&&e.clone(u,s),O>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>g.y&&e.clone(u,g),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(E,s,R)),L=e.magnitudeSquared(e.subtract(g,c,R)),b=e.magnitudeSquared(e.subtract(I,l,R)),U=s,F=E,D=P;L>D&&(D=L,U=c,F=g),b>D&&(D=b,U=l,F=I);var B=v;B.x=.5*(U.x+F.x),B.y=.5*(U.y+F.y),B.z=.5*(U.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(z),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var V=S;V.x=E.x,V.y=g.y,V.z=I.z;var X=e.multiplyByScalar(e.add(q,V,R),.5,N),W=0;for(x=0;x<M;x+=i){u.x=t[x]+n.x,u.y=t[x+1]+n.y,u.z=t[x+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>W&&(W=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<W?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=W),o},f.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new f),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,p),c=e.clone(i,y),l=e.clone(i,_),E=e.clone(i,m),g=t.length,I=0;I<g;I+=3){var M=t[I]+n[I],x=t[I+1]+n[I+1],O=t[I+2]+n[I+2];i.x=M,i.y=x,i.z=O,M<o.x&&e.clone(i,o),M>c.x&&e.clone(i,c),x<u.y&&e.clone(i,u),x>l.y&&e.clone(i,l),O<s.z&&e.clone(i,s),O>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(E,s,R)),L=o,b=c,U=w;C>U&&(U=C,L=u,b=l),P>U&&(U=P,L=s,b=E);var F=v;F.x=.5*(L.x+b.x),F.y=.5*(L.y+b.y),F.z=.5*(L.z+b.z);var D=e.magnitudeSquared(e.subtract(b,F,R)),B=Math.sqrt(D),z=A;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=E.z;var q=e.multiplyByScalar(e.add(z,G,R),.5,N),V=0;for(I=0;I<g;I+=3){i.x=t[I]+n[I],i.y=t[I+1]+n[I+1],i.z=t[I+2]+n[I+2];var X=e.magnitude(e.subtract(i,q,R));X>V&&(V=X);var W=e.magnitudeSquared(e.subtract(i,F,R));if(W>D){var H=Math.sqrt(W);B=.5*(B+H),D=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<V?(e.clone(F,r.center),r.radius=B):(e.clone(q,r.center),r.radius=V),r},f.fromCornerPoints=function(t,n,r){a(r)||(r=new f);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},f.fromEllipsoid=function(t,n){return a(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;f.fromBoundingSpheres=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return f.clone(t[0],n);if(2===r)return f.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=f.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,L=new e,b=new e;f.fromOrientedBoundingBox=function(t,n){a(n)||(n=new f);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,L),u=c.getColumn(r,2,b),s=e.magnitude(i),l=e.magnitude(o),E=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,E),n},f.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},f.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new f);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var U=new e,F=new e;f.union=function(t,n,r){a(r)||(r=new f);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,r.center),r.radius=E,r};var D=new e;f.expand=function(t,n,r){r=f.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,D));return a>r.radius&&(r.radius=a),r},f.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;f.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},f.transformWithoutScale=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var z=new e;f.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,z),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,X=new e,W=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return f.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,W),h=e.negate(c,X),d=Y,p=d[0];e.add(s,l,p),e.add(p,c,p),p=d[1],e.add(s,l,p),e.add(p,h,p),p=d[2],e.add(s,E,p),e.add(p,h,p),p=d[3],e.add(s,E,p),e.add(p,c,p),e.negate(s,s),p=d[4],e.add(s,l,p),e.add(p,c,p),p=d[5],e.add(s,l,p),e.add(p,h,p),p=d[6],e.add(s,E,p),e.add(p,h,p),p=d[7],e.add(s,E,p),e.add(p,c,p);for(var y=d.length,_=0;_<y;++_){var m=d[_];e.add(o,m,m);var T=i.cartesianToCartographic(m,H);n.project(T,m)}a=f.fromPoints(d,a),o=a.center;var R=o.x,v=o.y,A=o.z;return o.x=A,o.y=R,o.z=v,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,n){return f.computePlaneDistances(this,e,t,n)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var E=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{ -get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(v)&&(v=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,A=r(e[1]))}return v}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=r(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(g=!0,I=r(e[1]),I.isNightly=!!e[2])}return g}function c(){return s()&&I}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,x=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,x=r(e[1])))}return M}function E(){return l()&&x}function f(){if(!t(O)){O=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(O=!0,w=r(e[1]))}return O}function h(){return f()&&w}function d(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function p(){return t(L)||(L=/Windows/i.test(R.appVersion)),L}function y(){return d()&&P}function _(){return t(b)||(b="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),b}function m(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(U=n)}return F}function T(){return m()?U:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var v,A,S,N,g,I,M,x,O,w,C,P,L,b,U,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:y,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:m,imageRenderingValue:T};return D.supportsFullscreen=function(){return n.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=r.clone(e(t.modelMatrix,r.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,s,c,l){n(l)||(l=new t);var E,f,h,d,p,y,_,m;n(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(r,a,u),d=t.dot(E,E),p=t.dot(E,f),y=t.dot(E,h),_=t.dot(f,f),m=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(r,a,u),d=e.dot(E,E),p=e.dot(E,f),y=e.dot(E,h),_=e.dot(f,f),m=e.dot(f,h));var T=1/(d*_-p*p);return l.y=(_*y-p*m)*T,l.z=(d*m-p*y)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,n){t(n)||(n={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),n.high=r,n.low=e-r):(r=65536*Math.floor(-e/65536),n.high=-r,n.low=e+r),n};var a={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var i=n.high,o=n.low;return r.encode(e.x,a),i.x=a.high,o.x=a.low,r.encode(e.y,a),i.y=a.high,o.y=a.low,r.encode(e.z,a),i.z=a.high,o.z=a.low,n};var i=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,i);var a=i.high,o=i.low;t[n]=a.x,t[n+1]=a.y,t[n+2]=a.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,E=n(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*n(r,t.sign(r)*Math.sqrt(E),t.EPSILON14);return r>0?[f/e,a/f]:[a/f,f/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,p=o*c-u*s,y=u*c-h,_=4*d*y-p*p;if(_<0){var m,T,R;f*E>=l*h?(m=o,T=d,R=-2*u*d+o*p):(m=c,T=y,R=-c*p+2*s*y);var v=R<0?-1:1,A=-v*Math.abs(m)*Math.sqrt(-_);i=-R+A;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),g=i===A?-N:-T/N;return a=T<=0?N+g:-R/(N*N+g*g+T),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var I=d,M=-2*u*d+o*p,x=y,O=-c*p+2*s*y,w=Math.sqrt(_),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-M)/3);a=2*Math.sqrt(-I);var L=Math.cos(P);i=a*L;var b=a*(-L/2-C*Math.sin(P)),U=i+b>2*u?i-u:b-u,F=o,D=U/F;P=Math.abs(Math.atan2(c*w,-O)/3),a=2*Math.sqrt(-x),L=Math.cos(P),i=a*L,b=a*(-L/2-C*Math.sin(P));var B=-c,z=i+b<2*s?i+s:b+s,G=B/z,q=F*z,V=-U*z-F*B,X=U*B,W=(s*V-u*X)/(-u*V+s*q);return D<=W?D<=G?W<=G?[D,W,G]:[D,G,W]:[G,D,W]:D<=G?[W,D,G]:W<=G?[W,G,D]:[G,W,D]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<n.EPSILON14){var d=r.computeRealRoots(1,s,l);if(2===d.length){var p,y=d[0],_=d[1];if(y>=0&&_>=0){var m=Math.sqrt(y),T=Math.sqrt(_);return[f-T,f-m,f+m,f+T]}if(y>=0&&_<0)return p=Math.sqrt(y),[f-p,f+p];if(y<0&&_>=0)return p=Math.sqrt(_),[f-p,f+p]}return[]}if(h>0){var R=Math.sqrt(h),v=(s+h-c/R)/2,A=(s+h+c/R)/2,S=r.computeRealRoots(1,R,v),N=r.computeRealRoots(1,-R,A);return 0!==S.length?(S[0]+=f,S[1]+=f,0!==N.length?(N[0]+=f,N[1]+=f,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=f,N[1]+=f,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,p,y=h[0],_=a-y,m=_*_,T=t/2,R=_/2,v=m-4*o,A=m+4*Math.abs(o),S=c-4*y,N=c+4*Math.abs(y);if(y<0||v*N<S*A){var g=Math.sqrt(S);d=g/2,p=0===g?0:(t*R-i)/g}else{var I=Math.sqrt(v);d=0===I?0:(t*R-i)/I,p=I/2}var M,x;0===T&&0===d?(M=0,x=0):n.sign(T)===n.sign(d)?(M=T+d,x=y/M):(x=T-d,M=y/x);var O,w;0===R&&0===p?(O=0,w=0):n.sign(R)===n.sign(p)?(O=R+p,w=o/O):(w=R-p,O=o/w);var C=r.computeRealRoots(1,M,O),P=r.computeRealRoots(1,x,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,E=r*r,f=E*r,h=a*a,d=h*a,p=u*c*E-4*s*f-4*e*l*E+18*e*t*n*f-27*i*E*E+256*o*d+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*E+144*i*n*E)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return p},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function E(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,m),f=e.dot(u,u),h=2*e.dot(u,l),d=e.magnitudeSquared(l)-c,p=E(f,h,d,A);if(r(p))return a.start=p.root0,a.stop=p.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r; -}function d(t,n,r,a,i){var l,E=a*a,f=i*i,d=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,p=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),y=t[u.COLUMN0ROW0]*E+t[u.COLUMN2ROW2]*f+a*n.x+r,_=f*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),m=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===m&&0===_){if(l=s.computeRealRoots(d,p,y),0===l.length)return T;var R=l[0],v=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-v)),T.push(new e(a,i*R,i*v)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,i*A,i*-S)),T.push(new e(a,i*A,i*S))}return T}var N=m*m,g=_*_,I=d*d,M=m*_,x=I+g,O=2*(p*d+M),w=2*y*d+p*p-g+N,C=2*(y*p-M),P=y*y-N;if(0===x&&0===O&&0===w&&0===C)return T;l=c.computeRealRoots(x,O,w,C,P);var L=l.length;if(0===L)return T;for(var b=0;b<L;++b){var U,F=l[b],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B);U=o.sign(d)===o.sign(y)?h(d*D+y,p*F,o.EPSILON12):o.sign(y)===o.sign(p*F)?h(d*D,p*F+y,o.EPSILON12):h(d*D+p*F,y,o.EPSILON12);var G=h(_*F,m,o.EPSILON15),q=U*G;q<0?T.push(new e(a,i*F,i*z)):q>0?T.push(new e(a,i*F,i*-z)):0!==z?(T.push(new e(a,i*F,i*-z)),T.push(new e(a,i*F,i*z)),++b):T.push(new e(a,i*F,i*z))}return T}var p={};p.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var y=new e,_=new e,m=new e,T=new e,R=new e;p.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,p=e.subtract(a,r,y),v=e.subtract(i,r,_),A=e.cross(d,v,m),S=e.dot(p,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,r,T),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,p,R),E=e.dot(d,c),E<0||l+E>S)return;f=e.dot(v,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(h,r,T),l=e.dot(s,A)*N,l<0||l>1)return;if(c=e.cross(s,p,R),E=e.dot(d,c)*N,E<0||l+E>1)return;f=e.dot(v,c)*N}return f},p.rayTriangle=function(t,n,a,i,o,u){var s=p.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var v=new l;p.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=v;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};p.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new l;p.lineSegmentSphere=function(t,n,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,g=new e;p.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),E=e.multiplyComponents(c,t.direction,g),f=e.magnitudeSquared(l),h=e.dot(l,E);if(f>1){if(h>=0)return;var d=h*h;if(r=f-1,a=e.magnitudeSquared(E),o=a*r,d<o)return;if(d>o){u=h*h-o,s=-h+Math.sqrt(u);var p=s/a,y=r/s;return p<y?new i(p,y):{start:y,stop:p}}var _=Math.sqrt(r/a);return new i(_,_)}return f<1?(r=f-1,a=e.magnitudeSquared(E),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(E),new i(0,-h/a)):void 0};var I=new e,M=new e,x=new e,O=new e,w=new e,C=new u,P=new u,L=new u,b=new u,U=new u,F=new u,D=new u,B=new e,z=new e,G=new t;p.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,I);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,I),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,O),h=e.normalize(e.cross(f,E,M),M),p=e.normalize(e.cross(E,h,x),x),y=C;y[0]=E.x,y[1]=E.y,y[2]=E.z,y[3]=h.x,y[4]=h.y,y[5]=h.z,y[6]=p.x,y[7]=p.y,y[8]=p.z;var _=u.transpose(y,P),m=u.fromScale(n.radii,L),T=u.fromScale(n.oneOverRadii,b),R=U;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var v,A,S=u.multiply(u.multiply(_,T,F),R,F),N=u.multiply(u.multiply(S,m,D),y,D),g=u.multiplyByVector(S,a,w),q=d(N,e.negate(g,I),0,0,1),V=q.length;if(V>0){for(var X=e.clone(e.ZERO,z),W=Number.NEGATIVE_INFINITY,H=0;H<V;++H){v=u.multiplyByVector(m,u.multiplyByVector(y,q[H],B),B);var Y=e.normalize(e.subtract(v,a,O),O),k=e.dot(Y,i);k>W&&(W=k,X=e.clone(v,X))}var Z=n.cartesianToCartographic(X,G);return W=o.clamp(W,0,1),A=e.magnitude(e.subtract(X,a,O))*Math.sqrt(1-W*W),A=c?-A:A,Z.height=A,n.cartographicToCartesian(Z,new e)}};var q=new e;return p.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,i),e.add(t,i,i),i}},p.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return p.lineSegmentPlane(t,n,a,E),p.lineSegmentPlane(t,r,a,f),{positions:[t,n,r,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(n,r,a,E),p.lineSegmentPlane(n,t,a,f),{positions:[t,n,r,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(r,t,a,E),p.lineSegmentPlane(r,n,a,f),{positions:[t,n,r,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(n,t,a,E),p.lineSegmentPlane(r,t,a,f),{positions:[t,n,r,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(r,n,a,E),p.lineSegmentPlane(t,n,a,f),{positions:[t,n,r,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,r,a,E),p.lineSegmentPlane(n,r,a,f),{positions:[t,n,r,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.calculateACMR=function(n){n=e(n,e.EMPTY_OBJECT);var r=n.indices,a=n.maximumIndex,i=e(n.cacheSize,24),o=r.length;if(!t(a)){a=0;for(var u=0,s=r[u];u<o;)s>a&&(a=s),++u,s=r[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[r[f]]>i&&(c[r[f]]=E,++E);return(E-i+1)/(o/3)},r.tipsify=function(n){function r(e,t,n,r){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<r;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,n,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<n.length;){var f=n[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?r(a,o,e,u):c}n=e(n,e.EMPTY_OBJECT);var i,o=n.indices,u=n.maximumIndex,s=e(n.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],p=0;p<l;p++)d[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var y=0;E<h;)d[o[E]].vertexTriangles.push(y),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(y),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(y),++d[o[E+2]].numLiveTriangles,++y,E+=3;var _=0,m=s+1;i=1;var T,R,v=[],A=[],S=0,N=[],g=c/3,I=[];for(p=0;p<g;p++)I[p]=!1;for(var M,x;_!==-1;){v=[],R=d[_],x=R.vertexTriangles.length;for(var O=0;O<x;++O)if(y=R.vertexTriangles[O],!I[y]){I[y]=!0,E=y+y+y;for(var w=0;w<3;++w)M=o[E],v.push(M),A.push(M),N[S]=M,++S,T=d[M],--T.numLiveTriangles,m-T.timeStamp>s&&(T.timeStamp=m,++m),++E}_=a(o,s,v,d,m,A,l)}return N},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,n,r,a,i,o,u,s,c,l,E,f,h,d,p,y,_,m,T,R,v,A,S,N){"use strict";function g(e,t,n,r,a){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=a,e[t++]=a,e[t]=n}function I(e){for(var t=e.length,n=t/3*6,r=y.createTypedArray(t,n),a=0,i=0;i<t;i+=3,a+=6)g(r,a,e[i],e[i+1],e[i+2]);return r}function M(e){var t=e.length;if(t>=3){var n=6*(t-2),r=y.createTypedArray(t,n);g(r,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)g(r,a,e[i-1],e[i],e[i-2]);return r}return new Uint16Array}function x(e){if(e.length>0){for(var t=e.length-1,n=6*(t-1),r=y.createTypedArray(t,n),a=e[0],i=0,o=1;o<t;++o,i+=6)g(r,i,a,e[o],e[o+1]);return r}return new Uint16Array}function O(e){var t={};for(var n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){var r=e[n];t[n]=new d({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function w(e,t,n){for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values))for(var a=t[r],i=0;i<a.componentsPerAttribute;++i)e[r].values.push(a.values[n*a.componentsPerAttribute+i])}function C(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),v.multiplyByPoint(e,ie,ie),a.pack(ie,n,i)}function P(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,n,i)}function L(e,t){var n,r=e.length,a={},i=e[0][t].attributes;for(n in i)if(i.hasOwnProperty(n)&&c(i[n])&&c(i[n].values)){for(var o=i[n],s=o.values.length,l=!0,E=1;E<r;++E){var f=e[E][t].attributes[n];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[n]=new d({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function b(e,t){var r,i,o,u,s,l,E,f=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,_=L(e,t);for(r in _)if(_.hasOwnProperty(r))for(s=_[r].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[r].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var m;if(d){var T=0;for(i=0;i<f;++i)T+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:_,primitiveType:S.POINTS})),v=y.createTypedArray(R,T),A=0,N=0;for(i=0;i<f;++i){var g=e[i][t].indices,I=g.length;for(u=0;u<I;++u)v[A++]=N+g[u];N+=h.computeNumberOfVertices(e[i][t])}m=v}var M,x=new a,O=0;for(i=0;i<f;++i){if(M=e[i][t].boundingSphere,!c(M)){x=void 0;break}a.add(M.center,x,x)}if(c(x))for(a.divideByScalar(x,f,x),i=0;i<f;++i){M=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(M.center,x,se))+M.radius;w>O&&(O=w)}return new h({attributes:_,indices:m,primitiveType:p,boundingSphere:c(x)?new n(x,O):void 0})}function U(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function F(e){var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;for(var r=3,a=3;a<t;++a)n[r++]=a-1,n[r++]=0,n[r++]=a;return e.indices=n,e.primitiveType=S.TRIANGLES,e}function D(e){var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);for(var r=6,a=3;a<t-1;a+=2)n[r++]=a,n[r++]=a-1,n[r++]=a+1,a+2<t&&(n[r++]=a,n[r++]=a+1,n[r++]=a+2);return e.indices=n,e.primitiveType=S.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function z(e){var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return e.indices=n,e.primitiveType=S.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return n[r++]=t-1,n[r]=0,e.indices=n,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return F(e);case S.TRIANGLE_STRIP:return D(e);case S.TRIANGLES:return U(e);case S.LINE_STRIP:return z(e);case S.LINE_LOOP:return G(e);case S.LINES:return B(e)}return e}function V(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function X(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return V(e,e.y<0),V(t,t.y<0),void V(n,n.y<0);var r,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(n.y);r=a>i?a>o?T.sign(e.y):T.sign(n.y):i>o?T.sign(t.y):T.sign(n.y);var u=r<0;V(e,u),V(t,u),V(n,u)}function W(e,t,n,r){a.add(e,a.multiplyByScalar(a.subtract(t,e,ve),e.y/(e.y-t.y),ve),n),a.clone(n,r),V(n,!0),V(r,!1)}function H(e,t,n){if(!(e.x>=0||t.x>=0||n.x>=0)){X(e,t,n);var r=e.y<0,a=t.y<0,i=n.y<0,o=0;o+=r?1:0,o+=a?1:0,o+=i?1:0;var u=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,r?(W(e,t,Ae,Ne),W(e,n,Se,ge),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(W(t,n,Ae,Ne),W(t,e,Se,ge),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(W(n,e,Ae,Ne),W(n,t,Se,ge),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,r?a?i||(W(n,e,Ae,Ne),W(n,t,Se,ge),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(W(t,n,Ae,Ne),W(t,e,Se,ge),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(W(e,t,Ae,Ne),W(e,n,Se,ge),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=n,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=Se,s[5]=Ne,s[6]=ge,s.length=7),Ie}}function Y(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var a in r)if(r.hasOwnProperty(a)&&c(r[a])&&c(r[a].values)){var i=r[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=y.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function k(e){var t=e.attributes,n={};for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values)){var a=t[r];n[r]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:n,indices:[],primitiveType:e.primitiveType})}function Z(e,t,n){var r=c(e.geometry.boundingSphere);t=Y(t,r),n=Y(n,r),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function K(e,n,i,o,u,s,l,E,f,h,d,p){if(c(s)||c(l)||c(E)||c(f)||c(h)){var y=a.fromArray(u,3*e,Me),_=a.fromArray(u,3*n,xe),m=a.fromArray(u,3*i,Oe),T=t(o,y,_,m,we);if(c(s)){var R=a.fromArray(s,3*e,Me),v=a.fromArray(s,3*n,xe),A=a.fromArray(s,3*i,Oe);a.multiplyByScalar(R,T.x,R),a.multiplyByScalar(v,T.y,v),a.multiplyByScalar(A,T.z,A);var S=a.add(R,v,R);a.add(S,A,S),a.normalize(S,S),a.pack(S,d.normal.values,3*p)}if(c(h)){var N=a.fromArray(h,3*e,Me),g=a.fromArray(h,3*n,xe),I=a.fromArray(h,3*i,Oe);a.multiplyByScalar(N,T.x,N),a.multiplyByScalar(g,T.y,g),a.multiplyByScalar(I,T.z,I);var M;a.equals(N,a.ZERO)&&a.equals(g,a.ZERO)&&a.equals(I,a.ZERO)?(M=Me,M.x=0,M.y=0,M.z=0):(M=a.add(N,g,N),a.add(M,I,M),a.normalize(M,M)),a.pack(M,d.extrudeDirection.values,3*p)}if(c(l)){var x=a.fromArray(l,3*e,Me),O=a.fromArray(l,3*n,xe),w=a.fromArray(l,3*i,Oe);a.multiplyByScalar(x,T.x,x),a.multiplyByScalar(O,T.y,O),a.multiplyByScalar(w,T.z,w);var C=a.add(x,O,x);a.add(C,w,C),a.normalize(C,C),a.pack(C,d.tangent.values,3*p)}if(c(E)){var P=a.fromArray(E,3*e,Me),L=a.fromArray(E,3*n,xe),b=a.fromArray(E,3*i,Oe);a.multiplyByScalar(P,T.x,P),a.multiplyByScalar(L,T.y,L),a.multiplyByScalar(b,T.z,b);var U=a.add(P,L,P);a.add(U,b,U),a.normalize(U,U),a.pack(U,d.bitangent.values,3*p)}if(c(f)){var F=r.fromArray(f,2*e,Ce),D=r.fromArray(f,2*n,Pe),B=r.fromArray(f,2*i,Le);r.multiplyByScalar(F,T.x,F),r.multiplyByScalar(D,T.y,D),r.multiplyByScalar(B,T.z,B);var z=r.add(F,D,F);r.add(z,B,z),r.pack(z,d.st.values,2*p)}}}function j(e,t,n,r,a,i){var o=e.position.values.length/3;if(a!==-1){var u=r[a],s=n[u];return s===-1?(n[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,n,r,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,p=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,y=u.indices,_=k(u),m=k(u),T=[];T.length=l.length/3;var R=[];for(R.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,R[o]=-1;var v=y.length;for(o=0;o<v;o+=3){var A=y[o],S=y[o+1],N=y[o+2],g=a.fromArray(l,3*A),I=a.fromArray(l,3*S),M=a.fromArray(l,3*N),x=H(g,I,M);if(c(x)&&x.positions.length>3)for(var O=x.positions,w=x.indices,C=w.length,P=0;P<C;++P){var L=w[P],b=O[L];b.y<0?(t=m.attributes,n=m.indices,r=T):(t=_.attributes,n=_.indices,r=R),i=j(t,n,r,y,L<3?o+L:-1,b),K(A,S,N,b,l,E,h,f,d,p,t,i)}else c(x)&&(g=x.positions[0],I=x.positions[1],M=x.positions[2]),g.y<0?(t=m.attributes,n=m.indices,r=T):(t=_.attributes,n=_.indices,r=R),i=j(t,n,r,y,o,g),K(A,S,N,g,l,E,h,f,d,p,t,i),i=j(t,n,r,y,o+1,I),K(A,S,N,I,l,E,h,f,d,p,t,i),i=j(t,n,r,y,o+2,M),K(A,S,N,M,l,E,h,f,d,p,t,i)}Z(e,m,_)}function J(e){var t,n=e.geometry,r=n.attributes,i=r.position.values,o=n.indices,u=k(n),s=k(n),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],p=a.fromArray(i,3*h,Me),y=a.fromArray(i,3*d,xe);Math.abs(p.y)<T.EPSILON6&&(p.y<0?p.y=-T.EPSILON6:p.y=T.EPSILON6),Math.abs(y.y)<T.EPSILON6&&(y.y<0?y.y=-T.EPSILON6:y.y=T.EPSILON6);var _=u.attributes,R=u.indices,v=f,A=s.attributes,S=s.indices,N=E,g=m.lineSegmentPlane(p,y,be,Oe);if(c(g)){var I=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Ue);p.y<0&&(a.negate(I,I),_=s.attributes,R=s.indices,v=E,A=u.attributes,S=u.indices,N=f);var M=a.add(g,I,Fe);j(_,R,v,o,t,p),j(_,R,v,o,-1,M),a.negate(I,I),a.add(g,I,M),j(A,S,N,o,-1,M),j(A,S,N,o,t+1,y)}else{var x,O,w;p.y<0?(x=s.attributes,O=s.indices,w=E):(x=u.attributes,O=u.indices,w=f),j(x,O,w,o,t,p),j(x,O,w,o,t+1,y)}}Z(e,s,u)}function $(e){for(var t=e.attributes,n=t.position.values,r=t.prevPosition.values,i=t.nextPosition.values,o=n.length,u=0;u<o;u+=3){var s=a.unpack(n,u,ze);if(!(s.x>0)){var c=a.unpack(r,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(r[u]=n[u-3],r[u+1]=n[u-2],r[u+2]=n[u-1]):a.pack(s,r,u));var l=a.unpack(i,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=n[u+3],i[u+1]=n[u+4],i[u+2]=n[u+5]):a.pack(s,i,u))}}}function ee(e){var t,n,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,y=k(u),_=k(u),R=!1,v=l.length/3;for(t=0;t<v;t+=4){var A=t,S=t+2,N=a.fromArray(l,3*A,ze),g=a.fromArray(l,3*S,Ge);if(Math.abs(N.y)<ke)for(N.y=ke*(g.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,n=3*A;n<3*A+12;n+=3)E[n]=l[3*t],E[n+1]=l[3*t+1],E[n+2]=l[3*t+2];if(Math.abs(g.y)<ke)for(g.y=ke*(N.y<0?-1:1),l[3*(t+2)+1]=g.y,l[3*(t+3)+1]=g.y,n=3*A;n<3*A+12;n+=3)f[n]=l[3*(t+2)],f[n+1]=l[3*(t+2)+1],f[n+2]=l[3*(t+2)+2];var I=y.attributes,M=y.indices,x=_.attributes,O=_.indices,w=m.lineSegmentPlane(N,g,be,Ve);if(c(w)){R=!0;var C=a.multiplyByScalar(a.UNIT_Y,Ye,Xe);N.y<0&&(a.negate(C,C),I=_.attributes,M=_.indices,x=y.attributes,O=y.indices);var P=a.add(w,C,We);I.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.position.values.push(P.x,P.y,P.z),I.position.values.push(P.x,P.y,P.z),I.prevPosition.values.push(E[3*A],E[3*A+1],E[3*A+2]),I.prevPosition.values.push(E[3*A+3],E[3*A+4],E[3*A+5]),I.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),a.negate(C,C),a.add(w,C,P),x.position.values.push(P.x,P.y,P.z),x.position.values.push(P.x,P.y,P.z),x.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.nextPosition.values.push(f[3*S],f[3*S+1],f[3*S+2]),x.nextPosition.values.push(f[3*S+3],f[3*S+4],f[3*S+5]);var L=r.fromArray(h,2*A,De),b=Math.abs(L.y);I.expandAndWidth.values.push(-1,b,1,b),I.expandAndWidth.values.push(-1,-b,1,-b),x.expandAndWidth.values.push(-1,b,1,b),x.expandAndWidth.values.push(-1,-b,1,-b);var U=a.magnitudeSquared(a.subtract(w,N,qe));if(U/=a.magnitudeSquared(a.subtract(g,N,qe)),c(p)){var F=i.fromArray(p,4*A,He),D=i.fromArray(p,4*S,He),B=T.lerp(F.x,D.x,U),z=T.lerp(F.y,D.y,U),G=T.lerp(F.z,D.z,U),q=T.lerp(F.w,D.w,U);for(n=4*A;n<4*A+8;++n)I.color.values.push(p[n]);for(I.color.values.push(B,z,G,q),I.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),n=4*S;n<4*S+8;++n)x.color.values.push(p[n])}if(c(d)){var V=r.fromArray(d,2*A,De),X=r.fromArray(d,2*(t+3),Be),W=T.lerp(V.x,X.x,U);for(n=2*A;n<2*A+4;++n)I.st.values.push(d[n]);for(I.st.values.push(W,V.y),I.st.values.push(W,X.y),x.st.values.push(W,V.y),x.st.values.push(W,X.y),n=2*S;n<2*S+4;++n)x.st.values.push(d[n])}o=I.position.values.length/3-4,M.push(o,o+2,o+1),M.push(o+1,o+2,o+3),o=x.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3)}else{var H,Y;for(N.y<0?(H=_.attributes,Y=_.indices):(H=y.attributes,Y=y.indices),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(g.x,g.y,g.z),H.position.values.push(g.x,g.y,g.z),n=3*t;n<3*t+12;++n)H.prevPosition.values.push(E[n]),H.nextPosition.values.push(f[n]);for(n=2*t;n<2*t+8;++n)H.expandAndWidth.values.push(h[n]),c(d)&&H.st.values.push(d[n]);if(c(p))for(n=4*t;n<4*t+16;++n)H.color.values.push(p[n]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}R&&($(_),$(y)),Z(e,_,y)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=I(t);break;case S.TRIANGLE_STRIP:e.indices=M(t);break;case S.TRIANGLE_FAN:e.indices=x(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,r){t=s(t,"normal"),r=s(r,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*r,l[E++]=a[f+1]+i[f+1]*r,l[E++]=a[f+2]+i[f+2]*r;var p,y=e.boundingSphere;return c(y)&&(p=new n(y.center,y.radius+r)),new h({attributes:{position:new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:p})},te.createAttributeLocations=function(e){var t,n=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,a={},i=0,o=n.length;for(t=0;t<o;++t){var u=n[t];c(r[u])&&(a[u]=i++)}for(var s in r)r.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),n=e.indices;if(c(n)){for(var r=new Int32Array(t),a=0;a<t;a++)r[a]=-1;for(var i,o=n,s=o.length,l=y.createTypedArray(t,s),E=0,f=0,d=0;E<s;)i=r[o[E]],i!==-1?l[f]=i:(i=o[E],r[i]=d,l[f]=d,++d),++E,++f;e.indices=l;var p=e.attributes;for(var _ in p)if(p.hasOwnProperty(_)&&c(p[_])&&c(p[_].values)){for(var m=p[_],T=m.values,R=0,v=m.componentsPerAttribute,A=u.createTypedArray(m.componentDatatype,d*v);R<t;){var S=r[R];if(S!==-1)for(a=0;a<v;a++)A[v*S+a]=T[v*R+a];++R}m.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var n=e.indices;if(e.primitiveType===S.TRIANGLES&&c(n)){for(var r=n.length,a=0,i=0;i<r;i++)n[i]>a&&(a=n[i]);e.indices=N.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],n=h.computeNumberOfVertices(e);if(c(e.indices)&&n>=T.SIXTY_FOUR_KILOBYTES){var r,a=[],i=[],o=0,u=O(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?r=3:e.primitiveType===S.LINES?r=2:e.primitiveType===S.POINTS&&(r=1);for(var E=0;E<l;E+=r){for(var f=0;f<r;++f){var d=s[E+f],p=a[d];c(p)||(p=o++,a[d]=p,w(u,e.attributes,d)),i.push(p)}o+r>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=O(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ne=new a,re=new o;te.projectTo2D=function(e,t,n,r,i){var o=e.attributes[t];i=c(i)?i:new f;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),h=0,p=0;p<l.length;p+=3){var y=a.fromArray(l,p,ne),_=s.cartesianToCartographic(y,re),m=i.project(_,ne);E[h++]=m.x,E[h++]=m.y,E[h++]=m.z}return e.attributes[n]=o,e.attributes[r]=new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,n,r){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)E.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var f=a.componentsPerAttribute;return e.attributes[n]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[r]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var ie=new a,oe=new v,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(v.equals(t,v.IDENTITY))return e;var r=e.geometry.attributes;C(t,r.position),C(t,r.prevPosition),C(t,r.nextPosition),(c(r.normal)||c(r.tangent)||c(r.bitangent))&&(v.inverse(t,oe),v.transpose(oe,oe),v.getRotation(oe,ue),P(ue,r.normal),P(ue,r.tangent),P(ue,r.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=n.transform(a,t,a)),e.modelMatrix=v.clone(v.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],n=[],r=e.length,a=0;a<r;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&n.push(i)}var o=[];return t.length>0&&o.push(b(t,"geometry")),n.length>0&&(o.push(b(n,"westHemisphereGeometry")),o.push(b(n,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,Ee=new a,fe=new a;te.computeNormal=function(e){for(var t=e.indices,n=e.attributes,r=n.position.values,i=n.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],p=t[E+1],y=t[E+2],_=3*h,m=3*p,R=3*y;le.x=r[_],le.y=r[_+1],le.z=r[_+2],Ee.x=r[m],Ee.y=r[m+1],Ee.z=r[m+2],fe.x=r[R],fe.y=r[R+1],fe.z=r[R+2],s[h].count++,s[p].count++,s[y].count++,a.subtract(Ee,le,Ee),a.subtract(fe,le,fe),c[f]=a.cross(Ee,fe,new a),f++}var v=0;for(E=0;E<i;E++)s[E].indexOffset+=v,v+=s[E].count;f=0;var A;for(E=0;E<o;E+=3){A=s[t[E]];var S=A.indexOffset+A.currentCount;l[S]=f,A.currentCount++,A=s[t[E+1]],S=A.indexOffset+A.currentCount,l[S]=f,A.currentCount++,A=s[t[E+2]],S=A.indexOffset+A.currentCount,l[S]=f,A.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var g=3*E;if(A=s[E],a.clone(a.ZERO,ce),A.count>0){for(f=0;f<A.count;f++)a.add(ce,c[l[A.indexOffset+f]],ce);a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&a.clone(c[l[A.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),N[g]=ce.x,N[g+1]=ce.y,N[g+2]=ce.z}return e.attributes.normal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,de=new a,pe=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),n=e.attributes.position.values,r=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var p=t[l],y=t[l+1],_=t[l+2];E=3*p,f=3*y,h=3*_;var m=2*p,T=2*y,R=2*_,v=n[E],A=n[E+1],S=n[E+2],N=i[m],g=i[m+1],I=i[T+1]-g,M=i[R+1]-g,x=1/((i[T]-N)*M-(i[R]-N)*I),O=(M*(n[f]-v)-I*(n[h]-v))*x,w=(M*(n[f+1]-A)-I*(n[h+1]-A))*x,C=(M*(n[f+2]-S)-I*(n[h+2]-S))*x;c[E]+=O,c[E+1]+=w,c[E+2]+=C,c[f]+=O,c[f+1]+=w,c[f+2]+=C,c[h]+=O,c[h+1]+=w,c[h+2]+=C}var P=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var b=a.fromArray(r,E,he),U=a.fromArray(c,E,pe),F=a.dot(b,U);a.multiplyByScalar(b,F,de),a.normalize(a.subtract(U,de,U),U),P[E]=U.x,P[f]=U.y,P[h]=U.z,a.normalize(a.cross(b,U,U),U),L[E]=U.x,L[f]=U.y,L[h]=U.z}return e.attributes.tangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e};var ye=new r,_e=new a,me=new a,Te=new a,Re=new r;te.compressVertices=function(t){var n,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),E=0;for(n=0;n<i;++n)a.fromArray(s,3*n,_e),a.equals(_e,a.ZERO)?E+=2:(Re=e.octEncodeInRange(_e,65535,Re),l[E++]=Re.x,l[E++]=Re.y);return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var f=t.attributes.normal,h=t.attributes.st,p=c(f),y=c(h);if(!p&&!y)return t;var _,m,T,R,v=t.attributes.tangent,A=t.attributes.bitangent,S=c(v),N=c(A);p&&(_=f.values),y&&(m=h.values),S&&(T=v.values),N&&(R=A.values);var g=p?_.length:m.length,I=p?3:2;i=g/I;var M=i,x=y&&p?2:1;x+=S||N?1:0,M*=x;var O=new Float32Array(M),w=0;for(n=0;n<i;++n){y&&(r.fromArray(m,2*n,ye),O[w++]=e.compressTextureCoordinates(ye));var C=3*n;p&&c(T)&&c(R)?(a.fromArray(_,C,_e),a.fromArray(T,C,me),a.fromArray(R,C,Te),e.octPack(_e,me,Te,ye),O[w++]=ye.x,O[w++]=ye.y):(p&&(a.fromArray(_,C,_e),O[w++]=e.octEncodeFloat(_e)),S&&(a.fromArray(T,C,_e),O[w++]=e.octEncodeFloat(_e)),N&&(a.fromArray(R,C,_e),O[w++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:x,values:O}),p&&delete t.attributes.normal,y&&delete t.attributes.st,N&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var ve=new a,Ae=new a,Se=new a,Ne=new a,ge=new a,Ie={positions:new Array(7),indices:new Array(9)},Me=new a,xe=new a,Oe=new a,we=new a,Ce=new r,Pe=new r,Le=new r,be=A.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,Fe=new a,De=new r,Be=new r,ze=new a,Ge=new a,qe=new a,Ve=new a,Xe=new a,We=new a,He=new i,Ye=5*T.EPSILON9,ke=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(c(r)){var a=r.center.x-r.radius;if(a>0||n.intersectPlane(r,A.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==p.NONE)switch(t.geometryType){case p.POLYLINES:ee(e);break;case p.TRIANGLES:Q(e);break;case p.LINES:J(e)}else q(t),t.primitiveType===S.TRIANGLES?Q(e):t.primitiveType===S.LINES&&J(e);return e},te}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,E,f,h,d,p,y;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=f=e[0],E=h=e[1];for(var _=a;_<o;_+=a)d=e[_],p=e[_+1],d<l&&(l=d),p<E&&(E=p),d>f&&(f=d),p>h&&(h=p);y=Math.max(f-l,h-E)}return r(u,c,a,l,E,y),c}function t(e,t,n,r,a){var i,o;if(a===x(e,t,n,r)>0)for(i=t;i<n;i+=r)o=g(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=g(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(I(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==m(r.prev,r,r.next))r=r.next;else{if(I(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,E,h){if(e){!h&&E&&f(e,c,l,E);for(var d,p,y=e;e.prev!==e.next;)if(d=e.prev,p=e.next,E?i(e,c,l,E):a(e))t.push(d.i/s),t.push(e.i/s),t.push(p.i/s),I(e),e=p.next,y=p.next;else if(e=p,e===y){h?1===h?(e=o(e,t,s),r(e,t,s,c,l,E,2)):2===h&&u(e,t,s,c,l,E):r(n(e),t,s,c,l,E,1);break}}}function a(e){var t=e.prev,n=e,r=e.next; -if(m(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(y(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&m(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(m(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,E=d(u,s,t,n,r),f=d(c,l,t,n,r),h=e.nextZ;h&&h.z<=f;){if(h!==e.prev&&h!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&m(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(h=e.prevZ;h&&h.z>=E;){if(h!==e.prev&&h!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&m(h.prev,h,h.next)>=0)return!1;h=h.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&A(a,i)&&A(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),I(r),I(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&_(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,E,f,h=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,E=o<u-1?r[o+1]*i:e.length,f=t(e,s,E,i,!1),f===f.next&&(f.steiner=!0),h.push(p(f));for(h.sort(c),o=0;o<h.length;o++)l(h[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=E(e,t)){var r=N(t,e);n(r,r.next)}}function E(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,E=n.y,f=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&y(i<E?a:o,i,l,E,i<E?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<f||s===f&&r.x>n.x)&&A(r,e)&&(n=r,f=s)),r=r.next;return n}function f(e,t,n,r){var a=e;do null===a.z&&(a.z=d(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,h(a)}function h(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function d(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function p(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function y(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!v(e,t)&&A(e,t)&&A(t,e)&&S(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||m(e,t,n)>0!=m(e,t,r)>0&&m(n,r,e)>0!=m(n,r,t)>0}function v(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function A(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function S(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function g(e,t,n,r){var a=new M(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function I(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 M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function x(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(x(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(x(e,c,l,n))}var E=0;for(u=0;u<r.length;u+=3){var f=r[u]*n,h=r[u+1]*n,d=r[u+2]*n;E+=Math.abs((e[f]-e[d])*(e[h+1]-e[f+1])-(e[f]-e[h])*(e[d+1]-e[f+1]))}return 0===o&&0===E?0:Math.abs((E-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,E,f){"use strict";var h=new n,d=new n,p={};p.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},p.computeWindingOrder2D=function(e){var t=p.computeArea2D(e);return t>0?f.COUNTER_CLOCKWISE:f.CLOCKWISE},p.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var y=new n,_=new n,m=new n,T=new n,R=new n,v=new n,A=new n;return p.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var f,h=o.slice(0),d=t.length,p=new Array(3*d),S=0;for(f=0;f<d;f++){var N=t[f];p[S++]=N.x,p[S++]=N.y,p[S++]=N.z}for(var g=[],I={},M=e.maximumRadius,x=l.chordLength(u,M),O=x*x;h.length>0;){var w,C,P=h.pop(),L=h.pop(),b=h.pop(),U=n.fromArray(p,3*b,y),F=n.fromArray(p,3*L,_),D=n.fromArray(p,3*P,m),B=n.multiplyByScalar(n.normalize(U,T),M,T),z=n.multiplyByScalar(n.normalize(F,R),M,R),G=n.multiplyByScalar(n.normalize(D,v),M,v),q=n.magnitudeSquared(n.subtract(B,z,A)),V=n.magnitudeSquared(n.subtract(z,G,A)),X=n.magnitudeSquared(n.subtract(G,B,A)),W=Math.max(q,V,X);W>O?q===W?(w=Math.min(b,L)+" "+Math.max(b,L),f=I[w],i(f)||(C=n.add(U,F,A),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),f=p.length/3-1,I[w]=f),h.push(b,f,P),h.push(f,L,P)):V===W?(w=Math.min(L,P)+" "+Math.max(L,P),f=I[w],i(f)||(C=n.add(F,D,A),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),f=p.length/3-1,I[w]=f),h.push(L,f,b),h.push(f,P,b)):X===W&&(w=Math.min(P,b)+" "+Math.max(P,b),f=I[w],i(f)||(C=n.add(D,U,A),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),f=p.length/3-1,I[w]=f),h.push(P,f,L),h.push(f,b,L)):(g.push(b),g.push(L),g.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})},indices:g,primitiveType:E.TRIANGLES})},p.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=h,c=d;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,E=0;E<l;E+=3)n.fromArray(e,E,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[E]=c.x,e[E+1]=c.y,e[E+2]=c.z;return e},p}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var E=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);E=e.normalize(t,E);var u=E.x*o,s=E.y*o,c=E.z*o,f=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=f,a):new l(u,s,c,f)};var f=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],E=e[c.COLUMN1ROW1],d=e[c.COLUMN2ROW2],p=s+E+d;if(p>0)n=Math.sqrt(p+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var y=f,_=0;E>s&&(_=1),d>s&&d>E&&(_=2);var m=y[_],T=y[m];n=Math.sqrt(e[c.getElementIndex(_,_)]-e[c.getElementIndex(m,m)]-e[c.getElementIndex(T,T)]+1);var R=h;R[_]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,m)]-e[c.getElementIndex(m,T)])*n,R[m]=(e[c.getElementIndex(m,_)]+e[c.getElementIndex(_,m)])*n,R[T]=(e[c.getElementIndex(T,_)]+e[c.getElementIndex(_,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var d=new l,p=new l,y=new l,_=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),_=l.fromAxisAngle(e.UNIT_X,o.roll,d),y=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(y,_,y),p=l.fromAxisAngle(e.UNIT_Z,-o.heading,d),l.multiply(p,i,i)};var m=new e,T=new e,R=new l,v=new l,A=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,A),l.conjugate(A,A);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,A,R),R.w<0&&l.negate(R,R),l.computeAxis(R,m);var u=l.computeAngle(R);r[o]=m.x*u,r[o+1]=m.y*u,r[o+2]=m.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,v),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,v,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,E=o*u+r*l+a*c-i*s,f=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,d=o*l-r*u-a*s-i*c;return n.x=E,n.y=f,n.z=h,n.w=d,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var S=new l;l.lerp=function(e,t,n,r){return S=l.multiplyByScalar(t,n,S),r=l.multiplyByScalar(e,1-n,r),l.add(S,r,r)};var N=new l,g=new l,I=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return g=l.multiplyByScalar(e,Math.sin((1-n)*o),g),I=l.multiplyByScalar(i,Math.sin(n*o),I),r=l.add(g,I,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var M=new e,x=new e,O=new l,w=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,O);l.multiply(i,r,w);var o=l.log(w,M);l.multiply(i,t,w);var u=l.log(w,x);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,O),l.multiply(n,O,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,O),u=l.slerp(n,r,a,w);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,L=i.supportsTypedArrays()?new Float32Array(8):[],b=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],D=0;D<7;++D){var B=D+1,z=2*B+1;L[D]=1/(B*z),b[D]=B/z}return L[7]=P/136,b[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,E=7;E>=0;--E)U[E]=(L[E]*s-b[E])*o,F[E]=(L[E]*c-b[E])*o;var f=a*n*(1+U[0]*(1+U[1]*(1+U[2]*(1+U[3]*(1+U[4]*(1+U[5]*(1+U[6]*(1+U[7])))))))),h=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),d=l.multiplyByScalar(e,h,C);return l.multiplyByScalar(t,f,r),l.add(d,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,O),u=l.fastSlerp(n,r,a,w);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./freezeObject"],function(e,t,n,r,a,i){"use strict";function o(e,t,r,a){this[0]=n(e,0),this[1]=n(r,0),this[2]=n(t,0),this[3]=n(a,0)}o.packedLength=4,o.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t},o.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new o),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a},o.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new o(e[0],e[2],e[1],e[3])},o.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new o),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a},o.fromColumnMajorArray=function(e,t){return o.clone(e,t)},o.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new o(e[0],e[1],e[2],e[3])},o.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new o(e.x,0,0,e.y)},o.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new o(e,0,0,e)},o.fromRotation=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=-a,t[3]=n,t):new o(n,-a,a,n)},o.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},o.getElementIndex=function(e,t){return 2*e+t},o.getColumn=function(e,t,n){var r=2*t,a=e[r],i=e[r+1];return n.x=a,n.y=i,n},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=2*t;return r[a]=n.x,r[a+1]=n.y,r},o.getRow=function(e,t,n){var r=e[t],a=e[t+2];return n.x=r,n.y=a,n},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+2]=n.y,r};var u=new e;o.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],u)),n.y=e.magnitude(e.fromElements(t[2],t[3],u)),n};var s=new e;return o.getMaximumScale=function(t){return o.getScale(t,s),e.maximumComponent(s)},o.multiply=function(e,t,n){var r=e[0]*t[0]+e[2]*t[1],a=e[0]*t[2]+e[2]*t[3],i=e[1]*t[0]+e[3]*t[1],o=e[1]*t[2]+e[3]*t[3];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n},o.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},o.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},o.multiplyByVector=function(e,t,n){var r=e[0]*t.x+e[2]*t.y,a=e[1]*t.x+e[3]*t.y;return n.x=r,n.y=a,n},o.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},o.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},o.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},o.transpose=function(e,t){var n=e[0],r=e[2],a=e[1],i=e[3];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t},o.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},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},o.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},o.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n},o.IDENTITY=i(new o(1,0,0,1)),o.ZERO=i(new o(0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,a(o.prototype,{length:{get:function(){return o.packedLength}}}),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},o}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(t,n,r,a,i,u,s){var c=Math.cos(n),l=a*c,E=r*c,f=Math.sin(n),p=a*f,m=r*f;d=_.project(t,d),d=e.subtract(d,y,d);var T=o.fromRotation(n,h);d=o.multiplyByVector(T,d,d),d=e.add(d,y,d),t=_.unproject(d,t),u-=1,s-=1;var R=t.latitude,v=R+u*m,A=R-l*s,S=R-l*s+u*m,N=Math.max(R,v,A,S),g=Math.min(R,v,A,S),I=t.longitude,M=I+u*E,x=I+s*p,O=I+s*p+u*E,w=Math.max(I,M,x,O),C=Math.min(I,M,x,O);return{north:N,south:g,east:w,west:C,granYCos:l,granYSin:p,granXCos:E,granXSin:m,nwCorner:t}}var c=Math.cos,l=Math.sin,E=Math.sqrt,f={};f.computePosition=function(e,t,r,a,i){var o=e.ellipsoid.radiiSquared,u=e.nwCorner,s=e.rectangle,f=u.latitude-e.granYCos*t+r*e.granXSin,h=c(f),d=l(f),p=o.z*d,y=u.longitude+t*e.granYSin+r*e.granXCos,_=h*c(y),m=h*l(y),T=o.x*_,R=o.y*m,v=E(T*_+R*m+p*d);if(a.x=T/v,a.y=R/v,a.z=p/v,n(e.vertexFormat)&&e.vertexFormat.st){var A=e.stNwCorner;n(A)?(f=A.latitude-e.stGranYCos*t+r*e.stGranXSin,y=A.longitude+t*e.stGranYSin+r*e.stGranXCos,i.x=(y-e.stWest)*e.lonScalar,i.y=(f-e.stSouth)*e.latScalar):(i.x=(y-s.west)*e.lonScalar,i.y=(f-s.south)*e.latScalar)}};var h=new o,d=new e,p=new t,y=new e,_=new a;return f.computeOptions=function(e,t,n,r){var a,o,c,l,E,f=e._granularity,h=e._ellipsoid,d=e._surfaceHeight,m=e._rotation,T=e._stRotation,R=e._extrudedHeight,v=t.east,A=t.west,S=t.north,N=t.south,g=S-N;A>v?(E=i.TWO_PI-A+v,a=Math.ceil(E/f)+1,o=Math.ceil(g/f)+1,c=E/(a-1),l=g/(o-1)):(E=v-A,a=Math.ceil(E/f)+1,o=Math.ceil(g/f)+1,c=E/(a-1),l=g/(o-1)),n=u.northwest(t,n);var I=u.center(t,p);0===m&&0===T||(I.longitude<n.longitude&&(I.longitude+=i.TWO_PI),y=_.project(I,y));var M=l,x=c,O=0,w=0,C={granYCos:M,granYSin:O,granXCos:x,granXSin:w,ellipsoid:h,surfaceHeight:d,extrudedHeight:R,nwCorner:n,rectangle:t,width:a,height:o};if(0!==m){var P=s(n,m,c,l,I,a,o);S=P.north,N=P.south,v=P.east,A=P.west,C.granYCos=P.granYCos,C.granYSin=P.granYSin,C.granXCos=P.granXCos,C.granXSin=P.granXSin,t.north=S,t.south=N,t.east=v,t.west=A}if(0!==T){m-=T,r=u.northwest(t,r);var L=s(r,m,c,l,I,a,o);C.stGranYCos=L.granYCos,C.stGranXCos=L.granXCos,C.stGranYSin=L.granYSin,C.stGranXSin=L.granXSin,C.stNwCorner=r,C.stWest=L.west,C.stSouth=L.south}return C},f}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,n,r,a,i,o,u,s,c,l,E,f,h,d,p,y,_,m,T,R,v,A,S,N){"use strict";function g(e,t){var n=new E({attributes:new h,primitiveType:R.TRIANGLES});return n.attributes.position=new f({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function I(e,t,r,a){var i=e.length,o=t.normal?new Float32Array(i):void 0,u=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,c=0,l=D,E=F,f=U;if(t.normal||t.tangent||t.bitangent)for(var h=0;h<i;h+=3){var d=n.fromArray(e,h,b),p=c+1,y=c+2;f=r.geodeticSurfaceNormal(d,f),(t.tangent||t.bitangent)&&(n.cross(n.UNIT_Z,f,E),m.multiplyByVector(a,E,E),n.normalize(E,E),t.bitangent&&n.normalize(n.cross(f,E,l),l)),t.normal&&(o[c]=f.x,o[p]=f.y,o[y]=f.z),t.tangent&&(u[c]=E.x,u[p]=E.y,u[y]=E.z),t.bitangent&&(s[c]=l.x,s[p]=l.y,s[y]=l.z),c+=3}return g(t,{positions:e,normals:o,tangents:u,bitangents:s})}function M(e,t,r){var a=e.length,i=t.normal?new Float32Array(a):void 0,o=t.tangent?new Float32Array(a):void 0,u=t.bitangent?new Float32Array(a):void 0,s=0,c=0,l=0,E=!0,f=D,h=F,d=U;if(t.normal||t.tangent||t.bitangent)for(var p=0;p<a;p+=6){var y=n.fromArray(e,p,b),m=n.fromArray(e,(p+6)%a,V);if(E){var T=n.fromArray(e,(p+3)%a,X);n.subtract(m,y,m),n.subtract(T,y,T),d=n.normalize(n.cross(T,m,d),d),E=!1}n.equalsEpsilon(m,y,_.EPSILON10)&&(E=!0),(t.tangent||t.bitangent)&&(f=r.geodeticSurfaceNormal(y,f),t.tangent&&(h=n.normalize(n.cross(f,d,h),h))),t.normal&&(i[s++]=d.x,i[s++]=d.y,i[s++]=d.z,i[s++]=d.x,i[s++]=d.y,i[s++]=d.z),t.tangent&&(o[c++]=h.x,o[c++]=h.y,o[c++]=h.z,o[c++]=h.x,o[c++]=h.y,o[c++]=h.z),t.bitangent&&(u[l++]=f.x,u[l++]=f.y,u[l++]=f.z,u[l++]=f.x,u[l++]=f.y,u[l++]=f.z)}return g(t,{positions:e,normals:i,tangents:o,bitangents:u})}function x(e){for(var t=e.vertexFormat,n=e.ellipsoid,r=e.size,a=e.height,o=e.width,u=t.position?new Float64Array(3*r):void 0,s=t.st?new Float32Array(2*r):void 0,c=0,l=0,E=b,h=z,d=Number.MAX_VALUE,p=Number.MAX_VALUE,_=-Number.MAX_VALUE,m=-Number.MAX_VALUE,T=0;T<a;++T)for(var R=0;R<o;++R)S.computePosition(e,T,R,E,h),u[c++]=E.x,u[c++]=E.y,u[c++]=E.z,t.st&&(s[l++]=h.x,s[l++]=h.y,d=Math.min(d,h.x),p=Math.min(p,h.y),_=Math.max(_,h.x),m=Math.max(m,h.y));if(t.st&&(d<0||p<0||_>1||m>1))for(var v=0;v<s.length;v+=2)s[v]=(s[v]-d)/(_-d),s[v+1]=(s[v+1]-p)/(m-p);for(var A=I(u,t,n,e.tangentRotationMatrix),N=6*(o-1)*(a-1),g=y.createTypedArray(r,N),M=0,x=0,O=0;O<a-1;++O){for(var w=0;w<o-1;++w){var C=M,P=C+o,L=P+1,U=C+1;g[x++]=C,g[x++]=P,g[x++]=U,g[x++]=U,g[x++]=P,g[x++]=L,++M}++M}return A.indices=g,t.st&&(A.attributes.st=new f({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:s})),A}function O(e,t,n,r,a){return e[t++]=r[n],e[t++]=r[n+1],e[t++]=r[n+2],e[t++]=a[n],e[t++]=a[n+1],e[t++]=a[n+2],e}function w(e,t,n,r){return e[t++]=r[n],e[t++]=r[n+1],e[t++]=r[n],e[t++]=r[n+1],e}function C(e){var t,r=e.shadowVolume,a=e.vertexFormat,o=e.surfaceHeight,u=e.extrudedHeight,s=Math.min(u,o),c=Math.max(u,o),l=e.height,E=e.width,h=e.ellipsoid;r&&(e.vertexFormat=N.clone(a,W),e.vertexFormat.normal=!0);var m=x(e);if(_.equalsEpsilon(s,c,_.EPSILON10))return m;var R=T.scaleToGeodeticHeight(m.attributes.position.values,c,h,!1);R=new Float64Array(R);var v=R.length,A=2*v,S=new Float64Array(A);S.set(R);var g=T.scaleToGeodeticHeight(m.attributes.position.values,s,h);S.set(g,v),m.attributes.position.values=S;var I,C,P=a.normal?new Float32Array(A):void 0,L=a.tangent?new Float32Array(A):void 0,b=a.bitangent?new Float32Array(A):void 0,U=a.st?new Float32Array(A/3*2):void 0;if(a.normal){for(C=m.attributes.normal.values,P.set(C),t=0;t<v;t++)C[t]=-C[t];P.set(C,v),m.attributes.normal.values=P}if(r){C=m.attributes.normal.values,a.normal||(m.attributes.normal=void 0);var F=new Float32Array(A);for(t=0;t<v;t++)C[t]=-C[t];F.set(C,v),m.attributes.extrudeDirection=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:F})}if(a.tangent){var D=m.attributes.tangent.values;for(L.set(D),t=0;t<v;t++)D[t]=-D[t];L.set(D,v),m.attributes.tangent.values=L}if(a.bitangent){var B=m.attributes.bitangent.values;b.set(B),b.set(B,v),m.attributes.bitangent.values=b}a.st&&(I=m.attributes.st.values,U.set(I),U.set(I,v/3*2),m.attributes.st.values=U);var z=m.indices,G=z.length,q=v/3,H=y.createTypedArray(A/3,2*G);for(H.set(z),t=0;t<G;t+=3)H[t+G]=z[t+2]+q,H[t+1+G]=z[t+1]+q,H[t+2+G]=z[t]+q;m.indices=H;var Y,k=2*E+2*l-4,Z=2*(k+4),K=new Float64Array(3*Z),j=r?new Float32Array(3*Z):void 0,Q=a.st?new Float32Array(2*Z):void 0,J=0,$=0,ee=0,te=E*l;for(t=0;t<te;t+=E)Y=3*t,K=O(K,J,Y,R,g),J+=6,a.st&&(Q=w(Q,$,2*t,I),$+=4),r&&(ee+=3,j[ee++]=C[Y],j[ee++]=C[Y+1],j[ee++]=C[Y+2]);for(t=te-E;t<te;t++)Y=3*t,K=O(K,J,Y,R,g),J+=6,a.st&&(Q=w(Q,$,2*t,I),$+=4),r&&(ee+=3,j[ee++]=C[Y],j[ee++]=C[Y+1],j[ee++]=C[Y+2]);for(t=te-1;t>0;t-=E)Y=3*t,K=O(K,J,Y,R,g),J+=6,a.st&&(Q=w(Q,$,2*t,I),$+=4),r&&(ee+=3,j[ee++]=C[Y],j[ee++]=C[Y+1],j[ee++]=C[Y+2]);for(t=E-1;t>=0;t--)Y=3*t,K=O(K,J,Y,R,g),J+=6,a.st&&(Q=w(Q,$,2*t,I),$+=4),r&&(ee+=3,j[ee++]=C[Y],j[ee++]=C[Y+1],j[ee++]=C[Y+2]);var ne=M(K,a,h);a.st&&(ne.attributes.st=new f({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:Q})),r&&(ne.attributes.extrudeDirection=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:j}));var re,ae,ie,oe,ue=y.createTypedArray(Z,6*k);v=K.length/3;var se=0;for(t=0;t<v-1;t+=2){re=t,oe=(re+2)%v;var ce=n.fromArray(K,3*re,V),le=n.fromArray(K,3*oe,X);n.equalsEpsilon(ce,le,_.EPSILON10)||(ae=(re+1)%v,ie=(ae+2)%v,ue[se++]=re,ue[se++]=ae,ue[se++]=oe,ue[se++]=oe,ue[se++]=ae,ue[se++]=ie)}return ne.indices=ue,ne=p.combineInstances([new d({geometry:m}),new d({geometry:ne})]),ne[0]}function P(e,t,n){if(0===n)return A.clone(e);A.northeast(e,K[0]),A.northwest(e,K[1]),A.southeast(e,K[2]),A.southwest(e,K[3]),t.cartographicArrayToCartesianArray(K,Z);var r=t.geodeticSurfaceNormalCartographic(A.center(e,Y));v.fromAxisAngle(r,n,k),m.fromQuaternion(k,H);for(var a=0;a<4;++a)m.multiplyByVector(H,Z[a],Z[a]);return t.cartesianArrayToCartographicArray(Z,K),A.fromCartographicArray(K)}function L(e){e=o(e,o.EMPTY_OBJECT);var t=e.rectangle,n=o(e.rotation,0);this._rectangle=t,this._granularity=o(e.granularity,_.RADIANS_PER_DEGREE),this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._surfaceHeight=o(e.height,0),this._rotation=n,this._stRotation=o(e.stRotation,0),this._vertexFormat=N.clone(o(e.vertexFormat,N.DEFAULT)),this._extrudedHeight=o(e.extrudedHeight,0),this._extrude=u(e.extrudedHeight),this._closeTop=o(e.closeTop,!0),this._closeBottom=o(e.closeBottom,!0),this._shadowVolume=o(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._rotatedRectangle=P(this._rectangle,this._ellipsoid,n)}var b=new n,U=new n,F=new n,D=new n,B=new A,z=new t,G=new e,q=new e,V=new n,X=new n,W=new N,H=new m,Y=new n,k=new v,Z=[new n,new n,new n,new n],K=[new r,new r,new r,new r];L.packedLength=A.packedLength+l.packedLength+N.packedLength+A.packedLength+9,L.pack=function(e,t,n){return n=o(n,0),A.pack(e._rectangle,t,n),n+=A.packedLength,l.pack(e._ellipsoid,t,n),n+=l.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,A.pack(e._rotatedRectangle,t,n),n+=A.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._extrude?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n]=e._shadowVolume?1:0,t};var j=new A,Q=new A,J=l.clone(l.UNIT_SPHERE),$={rectangle:j,ellipsoid:J,vertexFormat:W,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0,shadowVolume:void 0};L.unpack=function(e,t,n){t=o(t,0);var r=A.unpack(e,t,j);t+=A.packedLength;var a=l.unpack(e,t,J);t+=l.packedLength;var i=N.unpack(e,t,W);t+=N.packedLength;var s=A.unpack(e,t,Q);t+=A.packedLength;var c=e[t++],E=e[t++],f=e[t++],h=e[t++],d=e[t++],p=1===e[t++],y=1===e[t++],_=1===e[t++],m=1===e[t];return u(n)?(n._rectangle=A.clone(r,n._rectangle),n._ellipsoid=l.clone(a,n._ellipsoid),n._vertexFormat=N.clone(i,n._vertexFormat),n._granularity=c,n._surfaceHeight=E,n._rotation=f,n._stRotation=h,n._extrudedHeight=p?d:void 0,n._extrude=p,n._closeTop=y,n._closeBottom=_,n._rotatedRectangle=s,n._shadowVolume=m,n):($.granularity=c,$.height=E,$.rotation=f,$.stRotation=h,$.extrudedHeight=p?d:void 0,$.closeTop=y,$.closeBottom=_,$.shadowVolume=m,new L($))};var ee=new m,te=new r,ne=new r,re=new v,ae=new r;return L.createGeometry=function(t){if(!_.equalsEpsilon(t._rectangle.north,t._rectangle.south,_.EPSILON10)&&!_.equalsEpsilon(t._rectangle.east,t._rectangle.west,_.EPSILON10)){var n=A.clone(t._rectangle,B),r=t._ellipsoid,a=t._surfaceHeight,i=t._extrude,o=t._extrudedHeight,u=t._rotation,s=t._stRotation,c=t._vertexFormat,l=S.computeOptions(t,n,te,ne),f=ee; -if(0!==s||0!==u){var h=A.center(n,ae),d=r.geodeticSurfaceNormalCartographic(h,V);v.fromAxisAngle(d,-s,re),m.fromQuaternion(re,f)}else m.clone(m.IDENTITY,f);l.lonScalar=1/t._rectangle.width,l.latScalar=1/t._rectangle.height,l.vertexFormat=c,l.rotation=u,l.stRotation=s,l.tangentRotationMatrix=f,l.size=l.width*l.height;var p,y;if(n=t._rectangle,i){l.shadowVolume=t._shadowVolume,p=C(l);var R=e.fromRectangle3D(n,r,a,q),N=e.fromRectangle3D(n,r,o,G);y=e.union(R,N)}else p=x(l),p.attributes.position.values=T.scaleToGeodeticHeight(p.attributes.position.values,a,r,!1),y=e.fromRectangle3D(n,r,a);return c.position||delete p.attributes.position,new E({attributes:p.attributes,indices:p.indices,primitiveType:p.primitiveType,boundingSphere:y})}},L.createShadowVolume=function(e,t,n){var r=e._granularity,a=e._ellipsoid,i=t(r,a),o=n(r,a);return new L({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:a,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:i,closeTop:!0,closeBottom:!0,vertexFormat:N.POSITION_ONLY,shadowVolume:!0})},s(L.prototype,{rectangle:{get:function(){return this._rotatedRectangle}}}),L}),define("Workers/createRectangleGeometry",["../Core/defined","../Core/Ellipsoid","../Core/Rectangle","../Core/RectangleGeometry"],function(e,t,n,r){"use strict";function a(a,i){return e(i)&&(a=r.unpack(a,i)),a._ellipsoid=t.clone(a._ellipsoid),a._rectangle=n.clone(a._rectangle),r.createGeometry(a)}return a})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var E=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,E=r*u-a*o;return n.x=c,n.y=l,n.z=E,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var f=new o,h=new o,d=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:d,c=Math.cos(r);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(r),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),n(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,E=n.y,f=n.z,h=a.x,d=a.y,p=a.z,y=l*l*h*h,_=E*E*d*d,m=f*f*p*p,T=y+_+m,R=Math.sqrt(1/T),v=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(v,c):void 0;var A=u.x,S=u.y,N=u.z,g=o;g.x=v.x*A*2,g.y=v.y*S*2,g.z=v.z*N*2;var I,M,x,O,w,C,P,L,b,U,F,D=(1-R)*e.magnitude(n)/(.5*e.magnitude(g)),B=0;do{D-=B,x=1/(1+D*A),O=1/(1+D*S),w=1/(1+D*N),C=x*x,P=O*O,L=w*w,b=C*x,U=P*O,F=L*w,I=y*C+_*P+m*L-1,M=y*b*A+_*U*S+m*F*N;var z=-2*M;B=I/z}while(Math.abs(I)>r.EPSILON12);return t(c)?(c.x=l*x,c.y=E*O,c.z=f*w,c):new e(l*x,E*O,f*w)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,a,i){return a=n(a,0),r(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,E=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var d=r(n)?n.oneOverRadii:E,p=r(n)?n.oneOverRadiiSquared:f,y=r(n)?n._centerToleranceSquared:h,_=o(t,d,p,y,c);if(r(_)){var m=e.multiplyComponents(_,p,s);m=e.normalize(m,m);var T=e.subtract(t,_,l),R=Math.atan2(m.y,m.x),v=Math.asin(m.z),A=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=R,a.latitude=v,a.height=A,a):new u(R,v,A)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var E=new e,f=new e;l.prototype.cartographicToCartesian=function(t,n){var a=E,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,d=new e,p=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,d);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,p),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),E=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=E,a):new t(c,l,E)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,E=0,f=e.length;E<f;E++){var h=e[E];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var d=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,d),o=Math.max(o,d)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,E=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=t.cartesianToCartographic(e[f]);a=Math.min(a,d.longitude),i=Math.max(i,d.longitude),l=Math.min(l,d.latitude),E=Math.max(E,d.latitude);var p=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;o=Math.min(o,p),c=Math.max(c,p)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=E,n):new s(a,l,i,E)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),E=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&E<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return r(n)?(n.west=l,n.south=f,n.east=E,n.north=h,n):new s(l,f,E,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),E=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=E,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,E=e.north,f=e.south,h=e.east,d=e.west,p=c;p.height=a,p.longitude=d,p.latitude=E,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.latitude=f,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=d,o[l]=t.cartographicToCartesian(p,o[l]),l++,E<0?p.latitude=E:f>0?p.latitude=f:p.latitude=0;for(var y=1;y<8;++y)p.longitude=-Math.PI+y*u.PI_OVER_TWO,s.contains(e,p)&&(o[l]=t.cartographicToCartesian(p,o[l]),l++);return 0===p.latitude&&(p.longitude=d,o[l]=t.cartographicToCartesian(p,o[l]),l++,p.longitude=h,o[l]=t.cartographicToCartesian(p,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(p[n],d[n])];t+=2*r*r}return Math.sqrt(t)}function E(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(p[i],d[i])]);o>r&&(a=i,r=o)}var c=1,l=0,E=d[a],f=p[a];if(Math.abs(e[s.getElementIndex(f,E)])>n){var h,y=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(E,E)],m=e[s.getElementIndex(f,E)],T=(y-_)/2/m;h=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(E,E)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,E)]=l,t[s.getElementIndex(E,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,E=e.z*e.z,f=e.z*e.w,h=e.w*e.w,d=n-u-E+h,p=2*(a-f),y=2*(i+l),_=2*(a+f),m=-n+u-E+h,T=2*(c-o),R=2*(i-l),v=2*(c+o),A=-n-u+E+h;return r(t)?(t[0]=d,t[1]=_,t[2]=R,t[3]=p,t[4]=m,t[5]=v,t[6]=y,t[7]=T,t[8]=A,t):new s(d,p,y,_,m,T,R,v,A)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,E=-i*u+c*o*a,f=c*u+i*o*a,h=n*u,d=i*a+c*o*u,p=-c*a+i*o*u,y=-o,_=c*n,m=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=y,t[3]=E,t[4]=d,t[5]=_,t[6]=f,t[7]=p,t[8]=m,t):new s(l,E,f,h,d,p,y,_,m)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],E=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=E,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var d=[1,0,0],p=[2,2,1],y=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),d=n*c(h);o<a&&l(h)>d;)E(h,y),s.transpose(y,_),s.multiply(h,y,h),s.multiply(_,h,h),s.multiply(f,y,f),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],E=e[8],f=s.determinant(e);t[0]=o*E-l*u,t[1]=l*a-r*E,t[2]=r*u-o*a,t[3]=c*u-i*E,t[4]=n*E-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/f;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){ +return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,E,f,h,d,p,y){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(d,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(E,0),this[11]=r(p,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(y,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,E=t.x*t.z,f=t.x*t.w,h=t.y*t.y,d=t.y*t.z,p=t.y*t.w,y=t.z*t.z,_=t.z*t.w,m=t.w*t.w,T=s-h-y+m,R=2*(c-_),v=2*(E+p),A=2*(c+_),S=-s+h-y+m,N=2*(d-f),g=2*(E-p),I=2*(d+f),M=-s-h+y+m;return r[0]=T*i,r[1]=A*i,r[2]=g*i,r[3]=0,r[4]=R*o,r[5]=S*o,r[6]=I*o,r[7]=0,r[8]=v*u,r[9]=N*u,r[10]=M*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var E=new e,f=new e,h=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,E),e.normalize(e.cross(E,o,f),f),e.normalize(e.cross(f,E,h),h);var u=f.x,s=f.y,c=f.z,d=E.x,p=E.y,y=E.z,_=h.x,m=h.y,T=h.z,R=r.x,v=r.y,A=r.z,S=u*-R+s*-v+c*-A,N=_*-R+m*-v+T*-A,g=d*R+p*v+y*A;return a(n)?(n[0]=u,n[1]=_,n[2]=-d,n[3]=0,n[4]=s,n[5]=m,n[6]=-p,n[7]=0,n[8]=c,n[9]=T,n[10]=-y,n[11]=0,n[12]=S,n[13]=N,n[14]=g,n[15]=1,n):new l(u,s,c,S,_,m,T,N,-d,-p,-y,g,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,E=-(r+n)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=E,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),E=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=E,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,E=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=E,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,E=.5*(n-t),f=c,h=l,d=E,p=i+c,y=o+l,_=t+E,m=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=d,a[11]=0,a[12]=p,a[13]=y,a[14]=_,a[15]=m,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var d=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],d)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],d)),n};var p=new e;l.getMaximumScale=function(t){return l.getScale(t,p),e.maximumComponent(p)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],E=e[8],f=e[9],h=e[10],d=e[11],p=e[12],y=e[13],_=e[14],m=e[15],T=t[0],R=t[1],v=t[2],A=t[3],S=t[4],N=t[5],g=t[6],I=t[7],M=t[8],x=t[9],O=t[10],w=t[11],C=t[12],P=t[13],L=t[14],b=t[15],U=r*T+u*R+E*v+p*A,F=a*T+s*R+f*v+y*A,D=i*T+c*R+h*v+_*A,B=o*T+l*R+d*v+m*A,z=r*S+u*N+E*g+p*I,G=a*S+s*N+f*g+y*I,q=i*S+c*N+h*g+_*I,V=o*S+l*N+d*g+m*I,X=r*M+u*x+E*O+p*w,W=a*M+s*x+f*O+y*w,H=i*M+c*x+h*O+_*w,Y=o*M+l*x+d*O+m*w,k=r*C+u*P+E*L+p*b,Z=a*C+s*P+f*L+y*b,K=i*C+c*P+h*L+_*b,j=o*C+l*P+d*L+m*b;return n[0]=U,n[1]=F,n[2]=D,n[3]=B,n[4]=z,n[5]=G,n[6]=q,n[7]=V,n[8]=X,n[9]=W,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=K,n[15]=j,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=e[12],h=e[13],d=e[14],p=t[0],y=t[1],_=t[2],m=t[4],T=t[5],R=t[6],v=t[8],A=t[9],S=t[10],N=t[12],g=t[13],I=t[14],M=r*p+o*y+c*_,x=a*p+u*y+l*_,O=i*p+s*y+E*_,w=r*m+o*T+c*R,C=a*m+u*T+l*R,P=i*m+s*T+E*R,L=r*v+o*A+c*S,b=a*v+u*A+l*S,U=i*v+s*A+E*S,F=r*N+o*g+c*I+f,D=a*N+u*g+l*I+h,B=i*N+s*g+E*I+d;return n[0]=M,n[1]=x,n[2]=O,n[3]=0,n[4]=w,n[5]=C,n[6]=P,n[7]=0,n[8]=L,n[9]=b,n[10]=U,n[11]=0,n[12]=F,n[13]=D,n[14]=B,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],E=e[10],f=t[0],h=t[1],d=t[2],p=t[3],y=t[4],_=t[5],m=t[6],T=t[7],R=t[8],v=r*f+o*h+c*d,A=a*f+u*h+l*d,S=i*f+s*h+E*d,N=r*p+o*y+c*_,g=a*p+u*y+l*_,I=i*p+s*y+E*_,M=r*m+o*T+c*R,x=a*m+u*T+l*R,O=i*m+s*T+E*R;return n[0]=v,n[1]=A,n[2]=S,n[3]=0,n[4]=N,n[5]=g,n[6]=I,n[7]=0,n[8]=M,n[9]=x,n[10]=O,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var y=new e;l.multiplyByUniformScale=function(e,t,n){return y.x=t,y.y=t,y.z=t,l.multiplyByScale(e,y,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var _=new s,m=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,_),m,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],E=e[1],f=e[5],h=e[9],d=e[13],p=e[2],y=e[6],v=e[10],A=e[14],S=e[3],N=e[7],g=e[11],I=e[15],M=v*I,x=A*g,O=y*I,w=A*N,C=y*g,P=v*N,L=p*I,b=A*S,U=p*g,F=v*S,D=p*N,B=y*S,z=M*f+w*h+C*d-(x*f+O*h+P*d),G=x*E+L*h+F*d-(M*E+b*h+U*d),q=O*E+b*f+D*d-(w*E+L*f+B*d),V=P*E+U*f+B*h-(C*E+F*f+D*h),X=x*a+O*i+P*o-(M*a+w*i+C*o),W=M*r+b*i+U*o-(x*r+L*i+F*o),H=w*r+L*a+B*o-(O*r+b*a+D*o),Y=C*r+F*a+D*i-(P*r+U*a+B*i);M=i*d,x=o*h,O=a*d,w=o*f,C=a*h,P=i*f,L=r*d,b=o*E,U=r*h,F=i*E,D=r*f,B=a*E;var k=M*N+w*g+C*I-(x*N+O*g+P*I),Z=x*S+L*g+F*I-(M*S+b*g+U*I),K=O*S+b*N+D*I-(w*S+L*N+B*I),j=P*S+U*N+B*g-(C*S+F*N+D*g),Q=O*v+P*A+x*y-(C*A+M*y+w*v),J=U*A+M*p+b*v-(L*v+F*A+x*p),$=L*y+B*A+w*p-(D*A+O*p+b*y),ee=D*v+C*p+F*y-(U*y+B*v+P*p),te=r*z+a*G+i*q+o*V;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=z*te,n[1]=G*te,n[2]=q*te,n[3]=V*te,n[4]=X*te,n[5]=W*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=K*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],E=e[12],f=e[13],h=e[14],d=-n*E-r*f-a*h,p=-i*E-o*f-u*h,y=-s*E-c*f-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=d,t[13]=p,t[14]=y,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,E){"use strict";function f(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,d=new e,p=new e,y=new e,_=new e,m=new e,T=new e,R=new e,v=new e,A=new e,S=new e,N=new e;f.fromPoints=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,h),o=e.clone(r,d),u=e.clone(r,p),s=e.clone(r,y),c=e.clone(r,_),l=e.clone(r,m),E=t.length,g=1;g<E;g++){e.clone(t[g],r);var I=r.x,M=r.y,x=r.z;I<i.x&&e.clone(r,i),I>s.x&&e.clone(r,s),M<o.y&&e.clone(r,o),M>c.y&&e.clone(r,c),x<u.z&&e.clone(r,u),x>l.z&&e.clone(r,l)}var O=e.magnitudeSquared(e.subtract(s,i,R)),w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,L=s,b=O;w>b&&(b=w,P=o,L=c),C>b&&(b=C,P=u,L=l);var U=v;U.x=.5*(P.x+L.x),U.y=.5*(P.y+L.y),U.z=.5*(P.z+L.z);var F=e.magnitudeSquared(e.subtract(L,U,R)),D=Math.sqrt(F),B=A;B.x=i.x,B.y=o.y,B.z=u.z;var z=S;z.x=s.x,z.y=c.y,z.z=l.z;var G=e.multiplyByScalar(e.add(B,z,R),.5,N),q=0;for(g=0;g<E;g++){e.clone(t[g],r);var V=e.magnitude(e.subtract(r,G,R));V>q&&(q=V);var X=e.magnitudeSquared(e.subtract(r,U,R));if(X>F){var W=Math.sqrt(X);D=.5*(D+W),F=D*D;var H=W-D;U.x=(D*U.x+H*r.x)/W,U.y=(D*U.y+H*r.y)/W,U.z=(D*U.z+H*r.z)/W}}return D<q?(e.clone(U,n.center),n.radius=D):(e.clone(G,n.center),n.radius=q),n};var g=new o,I=new e,M=new e,x=new t,O=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,g),E.southwest(t,x),x.height=i,E.northeast(t,O),O.height=o;var s=n.project(x,I),c=n.project(O,M),l=c.x-s.x,h=c.y-s.y,d=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+d*d);var p=u.center;return p.x=s.x+.5*l,p.y=s.y+.5*h,p.z=s.z+.5*d,u};var w=[];f.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=E.subsample(e,t,n,w)),f.fromPoints(u,o)},f.fromVertices=function(t,n,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,d),l=e.clone(u,p),E=e.clone(u,y),g=e.clone(u,_),I=e.clone(u,m),M=t.length,x=0;x<M;x+=i){var O=t[x]+n.x,w=t[x+1]+n.y,C=t[x+2]+n.z;u.x=O,u.y=w,u.z=C,O<s.x&&e.clone(u,s),O>E.x&&e.clone(u,E),w<c.y&&e.clone(u,c),w>g.y&&e.clone(u,g),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(E,s,R)),L=e.magnitudeSquared(e.subtract(g,c,R)),b=e.magnitudeSquared(e.subtract(I,l,R)),U=s,F=E,D=P;L>D&&(D=L,U=c,F=g),b>D&&(D=b,U=l,F=I);var B=v;B.x=.5*(U.x+F.x),B.y=.5*(U.y+F.y),B.z=.5*(U.z+F.z);var z=e.magnitudeSquared(e.subtract(F,B,R)),G=Math.sqrt(z),q=A;q.x=s.x,q.y=c.y,q.z=l.z;var V=S;V.x=E.x,V.y=g.y,V.z=I.z;var X=e.multiplyByScalar(e.add(q,V,R),.5,N),W=0;for(x=0;x<M;x+=i){u.x=t[x]+n.x,u.y=t[x+1]+n.y,u.z=t[x+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>W&&(W=H);var Y=e.magnitudeSquared(e.subtract(u,B,R));if(Y>z){var k=Math.sqrt(Y);G=.5*(G+k),z=G*G;var Z=k-G;B.x=(G*B.x+Z*u.x)/k,B.y=(G*B.y+Z*u.y)/k,B.z=(G*B.z+Z*u.z)/k}}return G<W?(e.clone(B,o.center),o.radius=G):(e.clone(X,o.center),o.radius=W),o},f.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new f),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,d),s=e.clone(i,p),c=e.clone(i,y),l=e.clone(i,_),E=e.clone(i,m),g=t.length,I=0;I<g;I+=3){var M=t[I]+n[I],x=t[I+1]+n[I+1],O=t[I+2]+n[I+2];i.x=M,i.y=x,i.z=O,M<o.x&&e.clone(i,o),M>c.x&&e.clone(i,c),x<u.y&&e.clone(i,u),x>l.y&&e.clone(i,l),O<s.z&&e.clone(i,s),O>E.z&&e.clone(i,E)}var w=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(E,s,R)),L=o,b=c,U=w;C>U&&(U=C,L=u,b=l),P>U&&(U=P,L=s,b=E);var F=v;F.x=.5*(L.x+b.x),F.y=.5*(L.y+b.y),F.z=.5*(L.z+b.z);var D=e.magnitudeSquared(e.subtract(b,F,R)),B=Math.sqrt(D),z=A;z.x=o.x,z.y=u.y,z.z=s.z;var G=S;G.x=c.x,G.y=l.y,G.z=E.z;var q=e.multiplyByScalar(e.add(z,G,R),.5,N),V=0;for(I=0;I<g;I+=3){i.x=t[I]+n[I],i.y=t[I+1]+n[I+1],i.z=t[I+2]+n[I+2];var X=e.magnitude(e.subtract(i,q,R));X>V&&(V=X);var W=e.magnitudeSquared(e.subtract(i,F,R));if(W>D){var H=Math.sqrt(W);B=.5*(B+H),D=B*B;var Y=H-B;F.x=(B*F.x+Y*i.x)/H,F.y=(B*F.y+Y*i.y)/H,F.z=(B*F.z+Y*i.z)/H}}return B<V?(e.clone(F,r.center),r.radius=B):(e.clone(q,r.center),r.radius=V),r},f.fromCornerPoints=function(t,n,r){a(r)||(r=new f);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},f.fromEllipsoid=function(t,n){return a(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;f.fromBoundingSpheres=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return f.clone(t[0],n);if(2===r)return f.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=f.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,L=new e,b=new e;f.fromOrientedBoundingBox=function(t,n){a(n)||(n=new f);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,L),u=c.getColumn(r,2,b);return e.add(i,o,i),e.add(i,u,i),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(i),n},f.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},f.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new f);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var U=new e,F=new e;f.union=function(t,n,r){a(r)||(r=new f);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,U),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var E=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+E)/l,F);return e.add(h,i,h),e.clone(h,r.center),r.radius=E,r};var D=new e;f.expand=function(t,n,r){r=f.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,D));return a>r.radius&&(r.radius=a),r},f.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var B=new e;f.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,B);return e.magnitudeSquared(r)-t.radius*t.radius},f.transformWithoutScale=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var z=new e;f.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,z),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,V=new e,X=new e,W=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return f.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,V);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var E=e.negate(l,W),h=e.negate(c,X),d=Y,p=d[0];e.add(s,l,p),e.add(p,c,p),p=d[1],e.add(s,l,p),e.add(p,h,p),p=d[2],e.add(s,E,p),e.add(p,h,p),p=d[3],e.add(s,E,p),e.add(p,c,p),e.negate(s,s),p=d[4],e.add(s,l,p),e.add(p,c,p),p=d[5],e.add(s,l,p),e.add(p,h,p),p=d[6],e.add(s,E,p),e.add(p,h,p),p=d[7],e.add(s,E,p),e.add(p,c,p);for(var y=d.length,_=0;_<y;++_){var m=d[_];e.add(o,m,m);var T=i.cartesianToCartographic(m,H);n.project(T,m)}a=f.fromPoints(d,a),o=a.center;var R=o.x,v=o.y,A=o.z;return o.x=A,o.y=R,o.z=v,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,n){return f.computePlaneDistances(this,e,t,n)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var E=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]; +}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(v)&&(v=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,A=r(e[1]))}return v}function i(){return a()&&A}function o(){if(!t(S)&&(S=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(S=!0,N=r(e[1]))}return S}function u(){return o()&&N}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(g=!0,I=r(e[1]),I.isNightly=!!e[2])}return g}function c(){return s()&&I}function l(){if(!t(M)){M=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,x=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(M=!0,x=r(e[1])))}return M}function E(){return l()&&x}function f(){if(!t(O)){O=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(O=!0,w=r(e[1]))}return O}function h(){return f()&&w}function d(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function p(){return t(L)||(L=/Windows/i.test(R.appVersion)),L}function y(){return d()&&P}function _(){return t(b)||(b="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),b}function m(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(U=n)}return F}function T(){return m()?U:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var v,A,S,N,g,I,M,x,O,w,C,P,L,b,U,F,D={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:E,isEdge:f,edgeVersion:h,isFirefox:d,firefoxVersion:y,isWindows:p,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:m,imageRenderingValue:T};return D.supportsFullscreen=function(){return n.supportsFullscreen()},D.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},D.supportsWebWorkers=function(){return"undefined"!=typeof Worker},D}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/GeometryInstance",["./defaultValue","./defined","./DeveloperError","./Matrix4"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.geometry=t.geometry,this.modelMatrix=r.clone(e(t.modelMatrix,r.IDENTITY)),this.id=t.id,this.pickPrimitive=t.pickPrimitive,this.attributes=e(t.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}return a}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,n,r,a,i){"use strict";var o={};o.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,a=n.y;n.x=(1-Math.abs(a))*i.signNotZero(r),n.y=(1-Math.abs(r))*i.signNotZero(a)}return n.x=i.toSNorm(n.x,t),n.y=i.toSNorm(n.y,t),n},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,n,r,a){if(a.x=i.fromSNorm(e,r),a.y=i.fromSNorm(n,r),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},o.octDecode=function(e,t,n){return o.octDecodeInRange(e,t,255,n)},o.octPackFloat=function(e){return 256*e.x+e.y};var u=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,u),o.octPackFloat(u)},o.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return o.octDecode(r,a,t)},o.octPack=function(e,t,n,r){var a=o.octEncodeFloat(e),i=o.octEncodeFloat(t),s=o.octEncode(n,u);return r.x=65536*s.x+a,r.y=65536*s.y+i,r},o.octUnpack=function(e,t,n,r){var a=e.x/65536,i=Math.floor(a),u=65536*(a-i);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);o.octDecodeFloat(u,t),o.octDecodeFloat(c,n),o.octDecode(i,s,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},o.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),define("Core/barycentricCoordinates",["./Cartesian2","./Cartesian3","./Check","./defined"],function(e,t,n,r){"use strict";function a(n,a,s,c,l){r(l)||(l=new t);var E,f,h,d,p,y,_,m;r(a.z)?(E=t.subtract(s,a,i),f=t.subtract(c,a,o),h=t.subtract(n,a,u),d=t.dot(E,E),p=t.dot(E,f),y=t.dot(E,h),_=t.dot(f,f),m=t.dot(f,h)):(E=e.subtract(s,a,i),f=e.subtract(c,a,o),h=e.subtract(n,a,u),d=e.dot(E,E),p=e.dot(E,f),y=e.dot(E,h),_=e.dot(f,f),m=e.dot(f,h));var T=1/(d*_-p*p);return l.y=(_*y-p*m)*T,l.z=(d*m-p*y)*T,l.x=1-l.y-l.z,l}var i=new t,o=new t,u=new t;return a}),define("Core/EncodedCartesian3",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(){this.high=e.clone(e.ZERO),this.low=e.clone(e.ZERO)}r.encode=function(e,n){t(n)||(n={high:0,low:0});var r;return e>=0?(r=65536*Math.floor(e/65536),n.high=r,n.low=e-r):(r=65536*Math.floor(-e/65536),n.high=-r,n.low=e+r),n};var a={high:0,low:0};r.fromCartesian=function(e,n){t(n)||(n=new r);var i=n.high,o=n.low;return r.encode(e.x,a),i.x=a.high,o.x=a.low,r.encode(e.y,a),i.y=a.high,o.y=a.low,r.encode(e.z,a),i.z=a.high,o.z=a.low,n};var i=new r;return r.writeElements=function(e,t,n){r.fromCartesian(e,i);var a=i.high,o=i.low;t[n]=a.x,t[n+1]=a.y,t[n+2]=a.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z},r}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,E=n(c,-l,t.EPSILON14);if(E<0)return[];var f=-.5*n(r,t.sign(r)*Math.sqrt(E),t.EPSILON14);return r>0?[f/e,a/f]:[a/f,f/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,E=u*c,f=u*u,h=s*s,d=o*s-f,p=o*c-u*s,y=u*c-h,_=4*d*y-p*p;if(_<0){var m,T,R;f*E>=l*h?(m=o,T=d,R=-2*u*d+o*p):(m=c,T=y,R=-c*p+2*s*y);var v=R<0?-1:1,A=-v*Math.abs(m)*Math.sqrt(-_);i=-R+A;var S=i/2,N=S<0?-Math.pow(-S,1/3):Math.pow(S,1/3),g=i===A?-N:-T/N;return a=T<=0?N+g:-R/(N*N+g*g+T),f*E>=l*h?[(a-u)/o]:[-c/(a+s)]}var I=d,M=-2*u*d+o*p,x=y,O=-c*p+2*s*y,w=Math.sqrt(_),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*w,-M)/3);a=2*Math.sqrt(-I);var L=Math.cos(P);i=a*L;var b=a*(-L/2-C*Math.sin(P)),U=i+b>2*u?i-u:b-u,F=o,D=U/F;P=Math.abs(Math.atan2(c*w,-O)/3),a=2*Math.sqrt(-x),L=Math.cos(P),i=a*L,b=a*(-L/2-C*Math.sin(P));var B=-c,z=i+b<2*s?i+s:b+s,G=B/z,q=F*z,V=-U*z-F*B,X=U*B,W=(s*V-u*X)/(-u*V+s*q);return D<=W?D<=G?W<=G?[D,W,G]:[D,G,W]:[G,D,W]:D<=G?[W,D,G]:W<=G?[W,G,D]:[G,W,D]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,E=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(E.length>0){var f=-t/4,h=E[E.length-1];if(Math.abs(h)<n.EPSILON14){var d=r.computeRealRoots(1,s,l);if(2===d.length){var p,y=d[0],_=d[1];if(y>=0&&_>=0){var m=Math.sqrt(y),T=Math.sqrt(_);return[f-T,f-m,f+m,f+T]}if(y>=0&&_<0)return p=Math.sqrt(y),[f-p,f+p];if(y<0&&_>=0)return p=Math.sqrt(_),[f-p,f+p]}return[]}if(h>0){var R=Math.sqrt(h),v=(s+h-c/R)/2,A=(s+h+c/R)/2,S=r.computeRealRoots(1,R,v),N=r.computeRealRoots(1,-R,A);return 0!==S.length?(S[0]+=f,S[1]+=f,0!==N.length?(N[0]+=f,N[1]+=f,S[1]<=N[0]?[S[0],S[1],N[0],N[1]]:N[1]<=S[0]?[N[0],N[1],S[0],S[1]]:S[0]>=N[0]&&S[1]<=N[1]?[N[0],S[0],S[1],N[1]]:N[0]>=S[0]&&N[1]<=S[1]?[S[0],N[0],N[1],S[1]]:S[0]>N[0]&&S[0]<N[1]?[N[0],S[0],N[1],S[1]]:[S[0],N[0],S[1],N[1]]):S):0!==N.length?(N[0]+=f,N[1]+=f,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,E=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,E,f);if(h.length>0){var d,p,y=h[0],_=a-y,m=_*_,T=t/2,R=_/2,v=m-4*o,A=m+4*Math.abs(o),S=c-4*y,N=c+4*Math.abs(y);if(y<0||v*N<S*A){var g=Math.sqrt(S);d=g/2,p=0===g?0:(t*R-i)/g}else{var I=Math.sqrt(v);d=0===I?0:(t*R-i)/I,p=I/2}var M,x;0===T&&0===d?(M=0,x=0):n.sign(T)===n.sign(d)?(M=T+d,x=y/M):(x=T-d,M=y/x);var O,w;0===R&&0===p?(O=0,w=0):n.sign(R)===n.sign(p)?(O=R+p,w=o/O):(w=R-p,O=o/w);var C=r.computeRealRoots(1,M,O),P=r.computeRealRoots(1,x,w);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,E=r*r,f=E*r,h=a*a,d=h*a,p=u*c*E-4*s*f-4*e*l*E+18*e*t*n*f-27*i*E*E+256*o*d+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*E+144*i*n*E)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return p},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,E=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=E<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,E,f);case 1:return i(c,l,E,f);case 2:return i(c,l,E,f);case 3:return a(c,l,E,f);case 4:return a(c,l,E,f);case 5:return i(c,l,E,f);case 6:return a(c,l,E,f);case 7:return a(c,l,E,f);case 8:return i(c,l,E,f);case 9:return a(c,l,E,f);case 10:return a(c,l,E,f);case 11:return i(c,l,E,f);case 12:return a(c,l,E,f);case 13:return a(c,l,E,f);case 14:return a(c,l,E,f);case 15:return a(c,l,E,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function E(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,m),f=e.dot(u,u),h=2*e.dot(u,l),d=e.magnitudeSquared(l)-c,p=E(f,h,d,A);if(r(p))return a.start=p.root0,a.stop=p.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function d(t,n,r,a,i){var l,E=a*a,f=i*i,d=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,p=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),y=t[u.COLUMN0ROW0]*E+t[u.COLUMN2ROW2]*f+a*n.x+r,_=f*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),m=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[]; +if(0===m&&0===_){if(l=s.computeRealRoots(d,p,y),0===l.length)return T;var R=l[0],v=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-v)),T.push(new e(a,i*R,i*v)),2===l.length){var A=l[1],S=Math.sqrt(Math.max(1-A*A,0));T.push(new e(a,i*A,i*-S)),T.push(new e(a,i*A,i*S))}return T}var N=m*m,g=_*_,I=d*d,M=m*_,x=I+g,O=2*(p*d+M),w=2*y*d+p*p-g+N,C=2*(y*p-M),P=y*y-N;if(0===x&&0===O&&0===w&&0===C)return T;l=c.computeRealRoots(x,O,w,C,P);var L=l.length;if(0===L)return T;for(var b=0;b<L;++b){var U,F=l[b],D=F*F,B=Math.max(1-D,0),z=Math.sqrt(B);U=o.sign(d)===o.sign(y)?h(d*D+y,p*F,o.EPSILON12):o.sign(y)===o.sign(p*F)?h(d*D,p*F+y,o.EPSILON12):h(d*D+p*F,y,o.EPSILON12);var G=h(_*F,m,o.EPSILON15),q=U*G;q<0?T.push(new e(a,i*F,i*z)):q>0?T.push(new e(a,i*F,i*-z)):0!==z?(T.push(new e(a,i*F,i*-z)),T.push(new e(a,i*F,i*z)),++b):T.push(new e(a,i*F,i*z))}return T}var p={};p.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var y=new e,_=new e,m=new e,T=new e,R=new e;p.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,E,f,h=t.origin,d=t.direction,p=e.subtract(a,r,y),v=e.subtract(i,r,_),A=e.cross(d,v,m),S=e.dot(p,A);if(u){if(S<o.EPSILON6)return;if(s=e.subtract(h,r,T),l=e.dot(s,A),l<0||l>S)return;if(c=e.cross(s,p,R),E=e.dot(d,c),E<0||l+E>S)return;f=e.dot(v,c)/S}else{if(Math.abs(S)<o.EPSILON6)return;var N=1/S;if(s=e.subtract(h,r,T),l=e.dot(s,A)*N,l<0||l>1)return;if(c=e.cross(s,p,R),E=e.dot(d,c)*N,E<0||l+E>1)return;f=e.dot(v,c)*N}return f},p.rayTriangle=function(t,n,a,i,o,u){var s=p.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var v=new l;p.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=v;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=p.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var A={root0:0,root1:0};p.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var S=new l;p.lineSegmentSphere=function(t,n,a,i){var o=S;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,g=new e;p.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),E=e.multiplyComponents(c,t.direction,g),f=e.magnitudeSquared(l),h=e.dot(l,E);if(f>1){if(h>=0)return;var d=h*h;if(r=f-1,a=e.magnitudeSquared(E),o=a*r,d<o)return;if(d>o){u=h*h-o,s=-h+Math.sqrt(u);var p=s/a,y=r/s;return p<y?new i(p,y):{start:y,stop:p}}var _=Math.sqrt(r/a);return new i(_,_)}return f<1?(r=f-1,a=e.magnitudeSquared(E),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(E),new i(0,-h/a)):void 0};var I=new e,M=new e,x=new e,O=new e,w=new e,C=new u,P=new u,L=new u,b=new u,U=new u,F=new u,D=new u,B=new e,z=new e,G=new t;p.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,I);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,I),E=e.normalize(l,l),f=e.mostOrthogonalAxis(l,O),h=e.normalize(e.cross(f,E,M),M),p=e.normalize(e.cross(E,h,x),x),y=C;y[0]=E.x,y[1]=E.y,y[2]=E.z,y[3]=h.x,y[4]=h.y,y[5]=h.z,y[6]=p.x,y[7]=p.y,y[8]=p.z;var _=u.transpose(y,P),m=u.fromScale(n.radii,L),T=u.fromScale(n.oneOverRadii,b),R=U;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var v,A,S=u.multiply(u.multiply(_,T,F),R,F),N=u.multiply(u.multiply(S,m,D),y,D),g=u.multiplyByVector(S,a,w),q=d(N,e.negate(g,I),0,0,1),V=q.length;if(V>0){for(var X=e.clone(e.ZERO,z),W=Number.NEGATIVE_INFINITY,H=0;H<V;++H){v=u.multiplyByVector(m,u.multiplyByVector(y,q[H],B),B);var Y=e.normalize(e.subtract(v,a,O),O),k=e.dot(Y,i);k>W&&(W=k,X=e.clone(v,X))}var Z=n.cartesianToCartographic(X,G);return W=o.clamp(W,0,1),A=e.magnitude(e.subtract(X,a,O))*Math.sqrt(1-W*W),A=c?-A:A,Z.height=A,n.cartographicToCartesian(Z,new e)}};var q=new e;return p.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),E=-(a.distance+l)/c;if(!(E<0||E>1))return e.multiplyByScalar(u,E,i),e.add(t,i,i),i}},p.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var E,f;if(1!==l&&2!==l||(E=new e,f=new e),1===l){if(u)return p.lineSegmentPlane(t,n,a,E),p.lineSegmentPlane(t,r,a,f),{positions:[t,n,r,E,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return p.lineSegmentPlane(n,r,a,E),p.lineSegmentPlane(n,t,a,f),{positions:[t,n,r,E,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return p.lineSegmentPlane(r,t,a,E),p.lineSegmentPlane(r,n,a,f),{positions:[t,n,r,E,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return p.lineSegmentPlane(n,t,a,E),p.lineSegmentPlane(r,t,a,f),{positions:[t,n,r,E,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return p.lineSegmentPlane(r,n,a,E),p.lineSegmentPlane(t,n,a,f),{positions:[t,n,r,E,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return p.lineSegmentPlane(t,r,a,E),p.lineSegmentPlane(n,r,a,f),{positions:[t,n,r,E,f],indices:[0,1,4,0,4,3,2,3,4]}}},p}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,n,r,a){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var o=new e;return i.fromCartesian4=function(n,r){var a=e.fromCartesian4(n,o),u=n.w;return t(r)?(e.clone(a,r.normal),r.distance=u,r):new i(a,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),define("Core/Tipsify",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.calculateACMR=function(n){n=e(n,e.EMPTY_OBJECT);var r=n.indices,a=n.maximumIndex,i=e(n.cacheSize,24),o=r.length;if(!t(a)){a=0;for(var u=0,s=r[u];u<o;)s>a&&(a=s),++u,s=r[u]}for(var c=[],l=0;l<a+1;l++)c[l]=0;for(var E=i+1,f=0;f<o;++f)E-c[r[f]]>i&&(c[r[f]]=E,++E);return(E-i+1)/(o/3)},r.tipsify=function(n){function r(e,t,n,r){for(;t.length>=1;){var a=t[t.length-1];if(t.splice(t.length-1,1),e[a].numLiveTriangles>0)return a}for(;i<r;){if(e[i].numLiveTriangles>0)return++i,i-1;++i}return-1}function a(e,t,n,a,i,o,u){for(var s,c=-1,l=-1,E=0;E<n.length;){var f=n[E];a[f].numLiveTriangles&&(s=0,i-a[f].timeStamp+2*a[f].numLiveTriangles<=t&&(s=i-a[f].timeStamp),(s>l||l===-1)&&(l=s,c=f)),++E}return c===-1?r(a,o,e,u):c}n=e(n,e.EMPTY_OBJECT);var i,o=n.indices,u=n.maximumIndex,s=e(n.cacheSize,24),c=o.length,l=0,E=0,f=o[E],h=c;if(t(u))l=u+1;else{for(;E<h;)f>l&&(l=f),++E,f=o[E];if(l===-1)return 0;++l}for(var d=[],p=0;p<l;p++)d[p]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};E=0;for(var y=0;E<h;)d[o[E]].vertexTriangles.push(y),++d[o[E]].numLiveTriangles,d[o[E+1]].vertexTriangles.push(y),++d[o[E+1]].numLiveTriangles,d[o[E+2]].vertexTriangles.push(y),++d[o[E+2]].numLiveTriangles,++y,E+=3;var _=0,m=s+1;i=1;var T,R,v=[],A=[],S=0,N=[],g=c/3,I=[];for(p=0;p<g;p++)I[p]=!1;for(var M,x;_!==-1;){v=[],R=d[_],x=R.vertexTriangles.length;for(var O=0;O<x;++O)if(y=R.vertexTriangles[O],!I[y]){I[y]=!0,E=y+y+y;for(var w=0;w<3;++w)M=o[E],v.push(M),A.push(M),N[S]=M,++S,T=d[M],--T.numLiveTriangles,m-T.timeStamp>s&&(T.timeStamp=m,++m),++E}_=a(o,s,v,d,m,A,l)}return N},r}),define("Core/GeometryPipeline",["./AttributeCompression","./barycentricCoordinates","./BoundingSphere","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./EncodedCartesian3","./GeographicProjection","./Geometry","./GeometryAttribute","./GeometryType","./IndexDatatype","./Intersect","./IntersectionTests","./Math","./Matrix3","./Matrix4","./Plane","./PrimitiveType","./Tipsify"],function(e,t,n,r,a,i,o,u,s,c,l,E,f,h,d,p,y,_,m,T,R,v,A,S,N){"use strict";function g(e,t,n,r,a){e[t++]=n,e[t++]=r,e[t++]=r,e[t++]=a,e[t++]=a,e[t]=n}function I(e){for(var t=e.length,n=t/3*6,r=y.createTypedArray(t,n),a=0,i=0;i<t;i+=3,a+=6)g(r,a,e[i],e[i+1],e[i+2]);return r}function M(e){var t=e.length;if(t>=3){var n=6*(t-2),r=y.createTypedArray(t,n);g(r,0,e[0],e[1],e[2]);for(var a=6,i=3;i<t;++i,a+=6)g(r,a,e[i-1],e[i],e[i-2]);return r}return new Uint16Array}function x(e){if(e.length>0){for(var t=e.length-1,n=6*(t-1),r=y.createTypedArray(t,n),a=e[0],i=0,o=1;o<t;++o,i+=6)g(r,i,a,e[o],e[o+1]);return r}return new Uint16Array}function O(e){var t={};for(var n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){var r=e[n];t[n]=new d({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return t}function w(e,t,n){for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values))for(var a=t[r],i=0;i<a.componentsPerAttribute;++i)e[r].values.push(a.values[n*a.componentsPerAttribute+i])}function C(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),v.multiplyByPoint(e,ie,ie),a.pack(ie,n,i)}function P(e,t){if(c(t))for(var n=t.values,r=n.length,i=0;i<r;i+=3)a.unpack(n,i,ie),R.multiplyByVector(e,ie,ie),ie=a.normalize(ie,ie),a.pack(ie,n,i)}function L(e,t){var n,r=e.length,a={},i=e[0][t].attributes;for(n in i)if(i.hasOwnProperty(n)&&c(i[n])&&c(i[n].values)){for(var o=i[n],s=o.values.length,l=!0,E=1;E<r;++E){var f=e[E][t].attributes[n];if(!c(f)||o.componentDatatype!==f.componentDatatype||o.componentsPerAttribute!==f.componentsPerAttribute||o.normalize!==f.normalize){l=!1;break}s+=f.values.length}l&&(a[n]=new d({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:u.createTypedArray(o.componentDatatype,s)}))}return a}function b(e,t){var r,i,o,u,s,l,E,f=e.length,d=(e[0].modelMatrix,c(e[0][t].indices)),p=e[0][t].primitiveType,_=L(e,t);for(r in _)if(_.hasOwnProperty(r))for(s=_[r].values,u=0,i=0;i<f;++i)for(l=e[i][t].attributes[r].values,E=l.length,o=0;o<E;++o)s[u++]=l[o];var m;if(d){var T=0;for(i=0;i<f;++i)T+=e[i][t].indices.length;var R=h.computeNumberOfVertices(new h({attributes:_,primitiveType:S.POINTS})),v=y.createTypedArray(R,T),A=0,N=0;for(i=0;i<f;++i){var g=e[i][t].indices,I=g.length;for(u=0;u<I;++u)v[A++]=N+g[u];N+=h.computeNumberOfVertices(e[i][t])}m=v}var M,x=new a,O=0;for(i=0;i<f;++i){if(M=e[i][t].boundingSphere,!c(M)){x=void 0;break}a.add(M.center,x,x)}if(c(x))for(a.divideByScalar(x,f,x),i=0;i<f;++i){M=e[i][t].boundingSphere;var w=a.magnitude(a.subtract(M.center,x,se))+M.radius;w>O&&(O=w)}return new h({attributes:_,indices:m,primitiveType:p,boundingSphere:c(x)?new n(x,O):void 0})}function U(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function F(e){var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,3*(t-2));n[0]=1,n[1]=0,n[2]=2;for(var r=3,a=3;a<t;++a)n[r++]=a-1,n[r++]=0,n[r++]=a;return e.indices=n,e.primitiveType=S.TRIANGLES,e}function D(e){var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,3*(t-2));n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);for(var r=6,a=3;a<t-1;a+=2)n[r++]=a,n[r++]=a-1,n[r++]=a+1,a+2<t&&(n[r++]=a,n[r++]=a+1,n[r++]=a+2);return e.indices=n,e.primitiveType=S.TRIANGLES,e}function B(e){if(c(e.indices))return e;for(var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,t),r=0;r<t;++r)n[r]=r;return e.indices=n,e}function z(e){var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,2*(t-1));n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return e.indices=n,e.primitiveType=S.LINES,e}function G(e){var t=h.computeNumberOfVertices(e),n=y.createTypedArray(t,2*t);n[0]=0,n[1]=1;for(var r=2,a=2;a<t;++a)n[r++]=a-1,n[r++]=a;return n[r++]=t-1,n[r]=0,e.indices=n,e.primitiveType=S.LINES,e}function q(e){switch(e.primitiveType){case S.TRIANGLE_FAN:return F(e);case S.TRIANGLE_STRIP:return D(e);case S.TRIANGLES:return U(e);case S.LINE_STRIP:return z(e);case S.LINE_LOOP:return G(e);case S.LINES:return B(e)}return e}function V(e,t){Math.abs(e.y)<T.EPSILON6&&(t?e.y=-T.EPSILON6:e.y=T.EPSILON6)}function X(e,t,n){if(0!==e.y&&0!==t.y&&0!==n.y)return V(e,e.y<0),V(t,t.y<0),void V(n,n.y<0);var r,a=Math.abs(e.y),i=Math.abs(t.y),o=Math.abs(n.y);r=a>i?a>o?T.sign(e.y):T.sign(n.y):i>o?T.sign(t.y):T.sign(n.y);var u=r<0;V(e,u),V(t,u),V(n,u)}function W(e,t,n,r){a.add(e,a.multiplyByScalar(a.subtract(t,e,ve),e.y/(e.y-t.y),ve),n),a.clone(n,r),V(n,!0),V(r,!1)}function H(e,t,n){if(!(e.x>=0||t.x>=0||n.x>=0)){X(e,t,n);var r=e.y<0,a=t.y<0,i=n.y<0,o=0;o+=r?1:0,o+=a?1:0,o+=i?1:0;var u=Ie.indices;1===o?(u[1]=3,u[2]=4,u[5]=6,u[7]=6,u[8]=5,r?(W(e,t,Ae,Ne),W(e,n,Se,ge),u[0]=0,u[3]=1,u[4]=2,u[6]=1):a?(W(t,n,Ae,Ne),W(t,e,Se,ge),u[0]=1,u[3]=2,u[4]=0,u[6]=2):i&&(W(n,e,Ae,Ne),W(n,t,Se,ge),u[0]=2,u[3]=0,u[4]=1,u[6]=0)):2===o&&(u[2]=4,u[4]=4,u[5]=3,u[7]=5,u[8]=6,r?a?i||(W(n,e,Ae,Ne),W(n,t,Se,ge),u[0]=0,u[1]=1,u[3]=0,u[6]=2):(W(t,n,Ae,Ne),W(t,e,Se,ge),u[0]=2,u[1]=0,u[3]=2,u[6]=1):(W(e,t,Ae,Ne),W(e,n,Se,ge),u[0]=1,u[1]=2,u[3]=1,u[6]=0));var s=Ie.positions;return s[0]=e,s[1]=t,s[2]=n,s.length=3,1!==o&&2!==o||(s[3]=Ae,s[4]=Se,s[5]=Ne,s[6]=ge,s.length=7),Ie}}function Y(e,t){var r=e.attributes;if(0!==r.position.values.length){for(var a in r)if(r.hasOwnProperty(a)&&c(r[a])&&c(r[a].values)){var i=r[a];i.values=u.createTypedArray(i.componentDatatype,i.values)}var o=h.computeNumberOfVertices(e);return e.indices=y.createTypedArray(o,e.indices),t&&(e.boundingSphere=n.fromVertices(r.position.values)),e}}function k(e){var t=e.attributes,n={};for(var r in t)if(t.hasOwnProperty(r)&&c(t[r])&&c(t[r].values)){var a=t[r];n[r]=new d({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:[]})}return new h({attributes:n,indices:[],primitiveType:e.primitiveType})}function Z(e,t,n){var r=c(e.geometry.boundingSphere);t=Y(t,r),n=Y(n,r),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function K(e,n,i,o,u,s,l,E,f,h,d,p){if(c(s)||c(l)||c(E)||c(f)||c(h)){var y=a.fromArray(u,3*e,Me),_=a.fromArray(u,3*n,xe),m=a.fromArray(u,3*i,Oe),T=t(o,y,_,m,we);if(c(s)){var R=a.fromArray(s,3*e,Me),v=a.fromArray(s,3*n,xe),A=a.fromArray(s,3*i,Oe);a.multiplyByScalar(R,T.x,R),a.multiplyByScalar(v,T.y,v),a.multiplyByScalar(A,T.z,A);var S=a.add(R,v,R);a.add(S,A,S),a.normalize(S,S),a.pack(S,d.normal.values,3*p)}if(c(h)){var N=a.fromArray(h,3*e,Me),g=a.fromArray(h,3*n,xe),I=a.fromArray(h,3*i,Oe);a.multiplyByScalar(N,T.x,N),a.multiplyByScalar(g,T.y,g),a.multiplyByScalar(I,T.z,I);var M;a.equals(N,a.ZERO)&&a.equals(g,a.ZERO)&&a.equals(I,a.ZERO)?(M=Me,M.x=0,M.y=0,M.z=0):(M=a.add(N,g,N),a.add(M,I,M),a.normalize(M,M)),a.pack(M,d.extrudeDirection.values,3*p)}if(c(l)){var x=a.fromArray(l,3*e,Me),O=a.fromArray(l,3*n,xe),w=a.fromArray(l,3*i,Oe);a.multiplyByScalar(x,T.x,x),a.multiplyByScalar(O,T.y,O),a.multiplyByScalar(w,T.z,w);var C=a.add(x,O,x);a.add(C,w,C),a.normalize(C,C),a.pack(C,d.tangent.values,3*p)}if(c(E)){var P=a.fromArray(E,3*e,Me),L=a.fromArray(E,3*n,xe),b=a.fromArray(E,3*i,Oe);a.multiplyByScalar(P,T.x,P),a.multiplyByScalar(L,T.y,L),a.multiplyByScalar(b,T.z,b);var U=a.add(P,L,P);a.add(U,b,U),a.normalize(U,U),a.pack(U,d.bitangent.values,3*p)}if(c(f)){var F=r.fromArray(f,2*e,Ce),D=r.fromArray(f,2*n,Pe),B=r.fromArray(f,2*i,Le);r.multiplyByScalar(F,T.x,F),r.multiplyByScalar(D,T.y,D),r.multiplyByScalar(B,T.z,B);var z=r.add(F,D,F);r.add(z,B,z),r.pack(z,d.st.values,2*p)}}}function j(e,t,n,r,a,i){var o=e.position.values.length/3;if(a!==-1){var u=r[a],s=n[u];return s===-1?(n[u]=o,e.position.values.push(i.x,i.y,i.z),t.push(o),o):(t.push(s),s)}return e.position.values.push(i.x,i.y,i.z),t.push(o),o}function Q(e){var t,n,r,i,o,u=e.geometry,s=u.attributes,l=s.position.values,E=c(s.normal)?s.normal.values:void 0,f=c(s.bitangent)?s.bitangent.values:void 0,h=c(s.tangent)?s.tangent.values:void 0,d=c(s.st)?s.st.values:void 0,p=c(s.extrudeDirection)?s.extrudeDirection.values:void 0,y=u.indices,_=k(u),m=k(u),T=[];T.length=l.length/3;var R=[];for(R.length=l.length/3,o=0;o<T.length;++o)T[o]=-1,R[o]=-1;var v=y.length;for(o=0;o<v;o+=3){var A=y[o],S=y[o+1],N=y[o+2],g=a.fromArray(l,3*A),I=a.fromArray(l,3*S),M=a.fromArray(l,3*N),x=H(g,I,M);if(c(x)&&x.positions.length>3)for(var O=x.positions,w=x.indices,C=w.length,P=0;P<C;++P){var L=w[P],b=O[L];b.y<0?(t=m.attributes,n=m.indices,r=T):(t=_.attributes,n=_.indices,r=R),i=j(t,n,r,y,L<3?o+L:-1,b),K(A,S,N,b,l,E,h,f,d,p,t,i)}else c(x)&&(g=x.positions[0],I=x.positions[1],M=x.positions[2]),g.y<0?(t=m.attributes,n=m.indices,r=T):(t=_.attributes,n=_.indices,r=R),i=j(t,n,r,y,o,g),K(A,S,N,g,l,E,h,f,d,p,t,i),i=j(t,n,r,y,o+1,I),K(A,S,N,I,l,E,h,f,d,p,t,i),i=j(t,n,r,y,o+2,M),K(A,S,N,M,l,E,h,f,d,p,t,i)}Z(e,m,_)}function J(e){var t,n=e.geometry,r=n.attributes,i=r.position.values,o=n.indices,u=k(n),s=k(n),l=o.length,E=[];E.length=i.length/3;var f=[];for(f.length=i.length/3,t=0;t<E.length;++t)E[t]=-1,f[t]=-1;for(t=0;t<l;t+=2){var h=o[t],d=o[t+1],p=a.fromArray(i,3*h,Me),y=a.fromArray(i,3*d,xe);Math.abs(p.y)<T.EPSILON6&&(p.y<0?p.y=-T.EPSILON6:p.y=T.EPSILON6),Math.abs(y.y)<T.EPSILON6&&(y.y<0?y.y=-T.EPSILON6:y.y=T.EPSILON6);var _=u.attributes,R=u.indices,v=f,A=s.attributes,S=s.indices,N=E,g=m.lineSegmentPlane(p,y,be,Oe);if(c(g)){var I=a.multiplyByScalar(a.UNIT_Y,5*T.EPSILON9,Ue);p.y<0&&(a.negate(I,I),_=s.attributes,R=s.indices,v=E,A=u.attributes,S=u.indices,N=f);var M=a.add(g,I,Fe);j(_,R,v,o,t,p),j(_,R,v,o,-1,M),a.negate(I,I),a.add(g,I,M),j(A,S,N,o,-1,M),j(A,S,N,o,t+1,y)}else{var x,O,w;p.y<0?(x=s.attributes,O=s.indices,w=E):(x=u.attributes,O=u.indices,w=f),j(x,O,w,o,t,p),j(x,O,w,o,t+1,y)}}Z(e,s,u)}function $(e){for(var t=e.attributes,n=t.position.values,r=t.prevPosition.values,i=t.nextPosition.values,o=n.length,u=0;u<o;u+=3){var s=a.unpack(n,u,ze);if(!(s.x>0)){var c=a.unpack(r,u,Ge);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(u-3>0?(r[u]=n[u-3],r[u+1]=n[u-2],r[u+2]=n[u-1]):a.pack(s,r,u));var l=a.unpack(i,u,qe);(s.y<0&&l.y>0||s.y>0&&l.y<0)&&(u+3<o?(i[u]=n[u+3],i[u+1]=n[u+4],i[u+2]=n[u+5]):a.pack(s,i,u))}}}function ee(e){var t,n,o,u=e.geometry,s=u.attributes,l=s.position.values,E=s.prevPosition.values,f=s.nextPosition.values,h=s.expandAndWidth.values,d=c(s.st)?s.st.values:void 0,p=c(s.color)?s.color.values:void 0,y=k(u),_=k(u),R=!1,v=l.length/3;for(t=0;t<v;t+=4){var A=t,S=t+2,N=a.fromArray(l,3*A,ze),g=a.fromArray(l,3*S,Ge);if(Math.abs(N.y)<ke)for(N.y=ke*(g.y<0?-1:1),l[3*t+1]=N.y,l[3*(t+1)+1]=N.y,n=3*A;n<3*A+12;n+=3)E[n]=l[3*t],E[n+1]=l[3*t+1],E[n+2]=l[3*t+2];if(Math.abs(g.y)<ke)for(g.y=ke*(N.y<0?-1:1),l[3*(t+2)+1]=g.y,l[3*(t+3)+1]=g.y,n=3*A;n<3*A+12;n+=3)f[n]=l[3*(t+2)],f[n+1]=l[3*(t+2)+1],f[n+2]=l[3*(t+2)+2];var I=y.attributes,M=y.indices,x=_.attributes,O=_.indices,w=m.lineSegmentPlane(N,g,be,Ve);if(c(w)){R=!0;var C=a.multiplyByScalar(a.UNIT_Y,Ye,Xe);N.y<0&&(a.negate(C,C),I=_.attributes,M=_.indices,x=y.attributes,O=y.indices);var P=a.add(w,C,We);I.position.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.position.values.push(P.x,P.y,P.z),I.position.values.push(P.x,P.y,P.z),I.prevPosition.values.push(E[3*A],E[3*A+1],E[3*A+2]),I.prevPosition.values.push(E[3*A+3],E[3*A+4],E[3*A+5]),I.prevPosition.values.push(N.x,N.y,N.z,N.x,N.y,N.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),I.nextPosition.values.push(P.x,P.y,P.z),a.negate(C,C),a.add(w,C,P),x.position.values.push(P.x,P.y,P.z),x.position.values.push(P.x,P.y,P.z),x.position.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.prevPosition.values.push(P.x,P.y,P.z),x.nextPosition.values.push(g.x,g.y,g.z,g.x,g.y,g.z),x.nextPosition.values.push(f[3*S],f[3*S+1],f[3*S+2]),x.nextPosition.values.push(f[3*S+3],f[3*S+4],f[3*S+5]);var L=r.fromArray(h,2*A,De),b=Math.abs(L.y);I.expandAndWidth.values.push(-1,b,1,b),I.expandAndWidth.values.push(-1,-b,1,-b),x.expandAndWidth.values.push(-1,b,1,b),x.expandAndWidth.values.push(-1,-b,1,-b);var U=a.magnitudeSquared(a.subtract(w,N,qe));if(U/=a.magnitudeSquared(a.subtract(g,N,qe)),c(p)){var F=i.fromArray(p,4*A,He),D=i.fromArray(p,4*S,He),B=T.lerp(F.x,D.x,U),z=T.lerp(F.y,D.y,U),G=T.lerp(F.z,D.z,U),q=T.lerp(F.w,D.w,U);for(n=4*A;n<4*A+8;++n)I.color.values.push(p[n]);for(I.color.values.push(B,z,G,q),I.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),x.color.values.push(B,z,G,q),n=4*S;n<4*S+8;++n)x.color.values.push(p[n])}if(c(d)){var V=r.fromArray(d,2*A,De),X=r.fromArray(d,2*(t+3),Be),W=T.lerp(V.x,X.x,U);for(n=2*A;n<2*A+4;++n)I.st.values.push(d[n]);for(I.st.values.push(W,V.y),I.st.values.push(W,X.y),x.st.values.push(W,V.y),x.st.values.push(W,X.y),n=2*S;n<2*S+4;++n)x.st.values.push(d[n])}o=I.position.values.length/3-4,M.push(o,o+2,o+1),M.push(o+1,o+2,o+3),o=x.position.values.length/3-4,O.push(o,o+2,o+1),O.push(o+1,o+2,o+3)}else{var H,Y;for(N.y<0?(H=_.attributes,Y=_.indices):(H=y.attributes,Y=y.indices),H.position.values.push(N.x,N.y,N.z),H.position.values.push(N.x,N.y,N.z),H.position.values.push(g.x,g.y,g.z),H.position.values.push(g.x,g.y,g.z),n=3*t;n<3*t+12;++n)H.prevPosition.values.push(E[n]),H.nextPosition.values.push(f[n]);for(n=2*t;n<2*t+8;++n)H.expandAndWidth.values.push(h[n]),c(d)&&H.st.values.push(d[n]);if(c(p))for(n=4*t;n<4*t+16;++n)H.color.values.push(p[n]);o=H.position.values.length/3-4,Y.push(o,o+2,o+1),Y.push(o+1,o+2,o+3)}}R&&($(_),$(y)),Z(e,_,y)}var te={};te.toWireframe=function(e){var t=e.indices;if(c(t)){switch(e.primitiveType){case S.TRIANGLES:e.indices=I(t);break;case S.TRIANGLE_STRIP:e.indices=M(t);break;case S.TRIANGLE_FAN:e.indices=x(t)}e.primitiveType=S.LINES}return e},te.createLineSegmentsForVectors=function(e,t,r){t=s(t,"normal"),r=s(r,1e4);for(var a=e.attributes.position.values,i=e.attributes[t].values,o=a.length,l=new Float64Array(2*o),E=0,f=0;f<o;f+=3)l[E++]=a[f],l[E++]=a[f+1],l[E++]=a[f+2],l[E++]=a[f]+i[f]*r,l[E++]=a[f+1]+i[f+1]*r,l[E++]=a[f+2]+i[f+2]*r;var p,y=e.boundingSphere;return c(y)&&(p=new n(y.center,y.radius+r)),new h({attributes:{position:new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:l})},primitiveType:S.LINES,boundingSphere:p})},te.createAttributeLocations=function(e){var t,n=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],r=e.attributes,a={},i=0,o=n.length;for(t=0;t<o;++t){var u=n[t];c(r[u])&&(a[u]=i++)}for(var s in r)r.hasOwnProperty(s)&&!c(a[s])&&(a[s]=i++);return a},te.reorderForPreVertexCache=function(e){var t=h.computeNumberOfVertices(e),n=e.indices;if(c(n)){for(var r=new Int32Array(t),a=0;a<t;a++)r[a]=-1;for(var i,o=n,s=o.length,l=y.createTypedArray(t,s),E=0,f=0,d=0;E<s;)i=r[o[E]],i!==-1?l[f]=i:(i=o[E],r[i]=d,l[f]=d,++d),++E,++f;e.indices=l;var p=e.attributes;for(var _ in p)if(p.hasOwnProperty(_)&&c(p[_])&&c(p[_].values)){for(var m=p[_],T=m.values,R=0,v=m.componentsPerAttribute,A=u.createTypedArray(m.componentDatatype,d*v);R<t;){var S=r[R];if(S!==-1)for(a=0;a<v;a++)A[v*S+a]=T[v*R+a];++R}m.values=A}}return e},te.reorderForPostVertexCache=function(e,t){var n=e.indices;if(e.primitiveType===S.TRIANGLES&&c(n)){for(var r=n.length,a=0,i=0;i<r;i++)n[i]>a&&(a=n[i]);e.indices=N.tipsify({indices:n,maximumIndex:a,cacheSize:t})}return e},te.fitToUnsignedShortIndices=function(e){var t=[],n=h.computeNumberOfVertices(e);if(c(e.indices)&&n>=T.SIXTY_FOUR_KILOBYTES){var r,a=[],i=[],o=0,u=O(e.attributes),s=e.indices,l=s.length;e.primitiveType===S.TRIANGLES?r=3:e.primitiveType===S.LINES?r=2:e.primitiveType===S.POINTS&&(r=1);for(var E=0;E<l;E+=r){for(var f=0;f<r;++f){var d=s[E+f],p=a[d];c(p)||(p=o++,a[d]=p,w(u,e.attributes,d)),i.push(p)}o+r>=T.SIXTY_FOUR_KILOBYTES&&(t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),a=[],i=[],o=0,u=O(e.attributes))}0!==i.length&&t.push(new h({attributes:u,indices:i,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var ne=new a,re=new o;te.projectTo2D=function(e,t,n,r,i){var o=e.attributes[t];i=c(i)?i:new f;for(var s=i.ellipsoid,l=o.values,E=new Float64Array(l.length),h=0,p=0;p<l.length;p+=3){var y=a.fromArray(l,p,ne),_=s.cartesianToCartographic(y,re),m=i.project(_,ne);E[h++]=m.x,E[h++]=m.y,E[h++]=m.z}return e.attributes[n]=o,e.attributes[r]=new d({componentDatatype:u.DOUBLE,componentsPerAttribute:3,values:E}),delete e.attributes[t],e};var ae={high:0,low:0};te.encodeAttribute=function(e,t,n,r){for(var a=e.attributes[t],i=a.values,o=i.length,s=new Float32Array(o),c=new Float32Array(o),l=0;l<o;++l)E.encode(i[l],ae),s[l]=ae.high,c[l]=ae.low;var f=a.componentsPerAttribute;return e.attributes[n]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:s}),e.attributes[r]=new d({componentDatatype:u.FLOAT,componentsPerAttribute:f,values:c}),delete e.attributes[t],e};var ie=new a,oe=new v,ue=new R;te.transformToWorldCoordinates=function(e){var t=e.modelMatrix;if(v.equals(t,v.IDENTITY))return e;var r=e.geometry.attributes;C(t,r.position),C(t,r.prevPosition),C(t,r.nextPosition),(c(r.normal)||c(r.tangent)||c(r.bitangent))&&(v.inverse(t,oe),v.transpose(oe,oe),v.getRotation(oe,ue),P(ue,r.normal),P(ue,r.tangent),P(ue,r.bitangent));var a=e.geometry.boundingSphere;return c(a)&&(e.geometry.boundingSphere=n.transform(a,t,a)),e.modelMatrix=v.clone(v.IDENTITY),e};var se=new a;te.combineInstances=function(e){for(var t=[],n=[],r=e.length,a=0;a<r;++a){var i=e[a];c(i.geometry)?t.push(i):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&n.push(i)}var o=[];return t.length>0&&o.push(b(t,"geometry")),n.length>0&&(o.push(b(n,"westHemisphereGeometry")),o.push(b(n,"eastHemisphereGeometry"))),o};var ce=new a,le=new a,Ee=new a,fe=new a;te.computeNormal=function(e){for(var t=e.indices,n=e.attributes,r=n.position.values,i=n.position.values.length/3,o=t.length,s=new Array(i),c=new Array(o/3),l=new Array(o),E=0;E<i;E++)s[E]={indexOffset:0,count:0,currentCount:0};var f=0;for(E=0;E<o;E+=3){var h=t[E],p=t[E+1],y=t[E+2],_=3*h,m=3*p,R=3*y;le.x=r[_],le.y=r[_+1],le.z=r[_+2],Ee.x=r[m],Ee.y=r[m+1],Ee.z=r[m+2],fe.x=r[R],fe.y=r[R+1],fe.z=r[R+2],s[h].count++,s[p].count++,s[y].count++,a.subtract(Ee,le,Ee),a.subtract(fe,le,fe),c[f]=a.cross(Ee,fe,new a),f++}var v=0;for(E=0;E<i;E++)s[E].indexOffset+=v,v+=s[E].count;f=0;var A;for(E=0;E<o;E+=3){A=s[t[E]];var S=A.indexOffset+A.currentCount;l[S]=f,A.currentCount++,A=s[t[E+1]],S=A.indexOffset+A.currentCount,l[S]=f,A.currentCount++,A=s[t[E+2]],S=A.indexOffset+A.currentCount,l[S]=f,A.currentCount++,f++}var N=new Float32Array(3*i);for(E=0;E<i;E++){var g=3*E;if(A=s[E],a.clone(a.ZERO,ce),A.count>0){for(f=0;f<A.count;f++)a.add(ce,c[l[A.indexOffset+f]],ce);a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&a.clone(c[l[A.indexOffset]],ce)}a.equalsEpsilon(a.ZERO,ce,T.EPSILON10)&&(ce.z=1),a.normalize(ce,ce),N[g]=ce.x,N[g+1]=ce.y,N[g+2]=ce.z}return e.attributes.normal=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:N}),e};var he=new a,de=new a,pe=new a;te.computeTangentAndBitangent=function(e){for(var t=(e.attributes,e.indices),n=e.attributes.position.values,r=e.attributes.normal.values,i=e.attributes.st.values,o=e.attributes.position.values.length/3,s=t.length,c=new Array(3*o),l=0;l<c.length;l++)c[l]=0;var E,f,h;for(l=0;l<s;l+=3){var p=t[l],y=t[l+1],_=t[l+2];E=3*p,f=3*y,h=3*_;var m=2*p,T=2*y,R=2*_,v=n[E],A=n[E+1],S=n[E+2],N=i[m],g=i[m+1],I=i[T+1]-g,M=i[R+1]-g,x=1/((i[T]-N)*M-(i[R]-N)*I),O=(M*(n[f]-v)-I*(n[h]-v))*x,w=(M*(n[f+1]-A)-I*(n[h+1]-A))*x,C=(M*(n[f+2]-S)-I*(n[h+2]-S))*x;c[E]+=O,c[E+1]+=w,c[E+2]+=C,c[f]+=O,c[f+1]+=w,c[f+2]+=C,c[h]+=O,c[h+1]+=w,c[h+2]+=C}var P=new Float32Array(3*o),L=new Float32Array(3*o);for(l=0;l<o;l++){E=3*l,f=E+1,h=E+2;var b=a.fromArray(r,E,he),U=a.fromArray(c,E,pe),F=a.dot(b,U);a.multiplyByScalar(b,F,de),a.normalize(a.subtract(U,de,U),U),P[E]=U.x,P[f]=U.y,P[h]=U.z,a.normalize(a.cross(b,U,U),U),L[E]=U.x,L[f]=U.y,L[h]=U.z}return e.attributes.tangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:P}),e.attributes.bitangent=new d({componentDatatype:u.FLOAT,componentsPerAttribute:3,values:L}),e};var ye=new r,_e=new a,me=new a,Te=new a,Re=new r;te.compressVertices=function(t){var n,i,o=t.attributes.extrudeDirection;if(c(o)){var s=o.values;i=s.length/3;var l=new Float32Array(2*i),E=0;for(n=0;n<i;++n)a.fromArray(s,3*n,_e),a.equals(_e,a.ZERO)?E+=2:(Re=e.octEncodeInRange(_e,65535,Re),l[E++]=Re.x,l[E++]=Re.y);return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:2,values:l}),delete t.attributes.extrudeDirection,t}var f=t.attributes.normal,h=t.attributes.st,p=c(f),y=c(h);if(!p&&!y)return t;var _,m,T,R,v=t.attributes.tangent,A=t.attributes.bitangent,S=c(v),N=c(A);p&&(_=f.values),y&&(m=h.values),S&&(T=v.values),N&&(R=A.values);var g=p?_.length:m.length,I=p?3:2;i=g/I;var M=i,x=y&&p?2:1;x+=S||N?1:0,M*=x;var O=new Float32Array(M),w=0;for(n=0;n<i;++n){y&&(r.fromArray(m,2*n,ye),O[w++]=e.compressTextureCoordinates(ye));var C=3*n;p&&c(T)&&c(R)?(a.fromArray(_,C,_e),a.fromArray(T,C,me),a.fromArray(R,C,Te),e.octPack(_e,me,Te,ye),O[w++]=ye.x,O[w++]=ye.y):(p&&(a.fromArray(_,C,_e),O[w++]=e.octEncodeFloat(_e)),S&&(a.fromArray(T,C,_e),O[w++]=e.octEncodeFloat(_e)),N&&(a.fromArray(R,C,_e),O[w++]=e.octEncodeFloat(_e)))}return t.attributes.compressedAttributes=new d({componentDatatype:u.FLOAT,componentsPerAttribute:x,values:O}),p&&delete t.attributes.normal,y&&delete t.attributes.st,N&&delete t.attributes.bitangent,S&&delete t.attributes.tangent,t};var ve=new a,Ae=new a,Se=new a,Ne=new a,ge=new a,Ie={positions:new Array(7),indices:new Array(9)},Me=new a,xe=new a,Oe=new a,we=new a,Ce=new r,Pe=new r,Le=new r,be=A.fromPointNormal(a.ZERO,a.UNIT_Y),Ue=new a,Fe=new a,De=new r,Be=new r,ze=new a,Ge=new a,qe=new a,Ve=new a,Xe=new a,We=new a,He=new i,Ye=5*T.EPSILON9,ke=T.EPSILON6;return te.splitLongitude=function(e){var t=e.geometry,r=t.boundingSphere;if(c(r)){var a=r.center.x-r.radius;if(a>0||n.intersectPlane(r,A.ORIGIN_ZX_PLANE)!==_.INTERSECTING)return e}if(t.geometryType!==p.NONE)switch(t.geometryType){case p.POLYLINES:ee(e);break;case p.TRIANGLES:Q(e);break;case p.LINES:J(e)}else q(t),t.primitiveType===S.TRIANGLES?Q(e):t.primitiveType===S.LINES&&J(e);return e},te}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,E,f,h,d,p,y;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=f=e[0],E=h=e[1];for(var _=a;_<o;_+=a)d=e[_],p=e[_+1],d<l&&(l=d),p<E&&(E=p),d>f&&(f=d),p>h&&(h=p);y=Math.max(f-l,h-E)}return r(u,c,a,l,E,y),c}function t(e,t,n,r,a){var i,o;if(a===x(e,t,n,r)>0)for(i=t;i<n;i+=r)o=g(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=g(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(I(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==m(r.prev,r,r.next))r=r.next;else{if(I(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,E,h){if(e){!h&&E&&f(e,c,l,E);for(var d,p,y=e;e.prev!==e.next;)if(d=e.prev,p=e.next,E?i(e,c,l,E):a(e))t.push(d.i/s),t.push(e.i/s),t.push(p.i/s),I(e),e=p.next,y=p.next;else if(e=p,e===y){h?1===h?(e=o(e,t,s),r(e,t,s,c,l,E,2)):2===h&&u(e,t,s,c,l,E):r(n(e),t,s,c,l,E,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(m(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(y(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&m(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(m(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,E=d(u,s,t,n,r),f=d(c,l,t,n,r),h=e.nextZ;h&&h.z<=f;){ +if(h!==e.prev&&h!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&m(h.prev,h,h.next)>=0)return!1;h=h.nextZ}for(h=e.prevZ;h&&h.z>=E;){if(h!==e.prev&&h!==e.next&&y(a.x,a.y,i.x,i.y,o.x,o.y,h.x,h.y)&&m(h.prev,h,h.next)>=0)return!1;h=h.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&A(a,i)&&A(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),I(r),I(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&_(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,E,f,h=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,E=o<u-1?r[o+1]*i:e.length,f=t(e,s,E,i,!1),f===f.next&&(f.steiner=!0),h.push(p(f));for(h.sort(c),o=0;o<h.length;o++)l(h[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=E(e,t)){var r=N(t,e);n(r,r.next)}}function E(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,E=n.y,f=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&y(i<E?a:o,i,l,E,i<E?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<f||s===f&&r.x>n.x)&&A(r,e)&&(n=r,f=s)),r=r.next;return n}function f(e,t,n,r){var a=e;do null===a.z&&(a.z=d(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,h(a)}function h(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function d(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function p(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function y(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!v(e,t)&&A(e,t)&&A(t,e)&&S(e,t)}function m(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||m(e,t,n)>0!=m(e,t,r)>0&&m(n,r,e)>0!=m(n,r,t)>0}function v(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function A(e,t){return m(e.prev,e,e.next)<0?m(e,t,e.next)>=0&&m(e,e.prev,t)>=0:m(e,t,e.prev)<0||m(e,e.next,t)<0}function S(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new M(e.i,e.x,e.y),r=new M(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function g(e,t,n,r){var a=new M(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function I(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 M(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function x(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(x(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(x(e,c,l,n))}var E=0;for(u=0;u<r.length;u+=3){var f=r[u]*n,h=r[u+1]*n,d=r[u+2]*n;E+=Math.abs((e[f]-e[d])*(e[h+1]-e[f+1])-(e[f]-e[h])*(e[d+1]-e[f+1]))}return 0===o&&0===E?0:Math.abs((E-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,E,f){"use strict";var h=new n,d=new n,p={};p.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},p.computeWindingOrder2D=function(e){var t=p.computeArea2D(e);return t>0?f.COUNTER_CLOCKWISE:f.CLOCKWISE},p.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var y=new n,_=new n,m=new n,T=new n,R=new n,v=new n,A=new n;return p.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var f,h=o.slice(0),d=t.length,p=new Array(3*d),S=0;for(f=0;f<d;f++){var N=t[f];p[S++]=N.x,p[S++]=N.y,p[S++]=N.z}for(var g=[],I={},M=e.maximumRadius,x=l.chordLength(u,M),O=x*x;h.length>0;){var w,C,P=h.pop(),L=h.pop(),b=h.pop(),U=n.fromArray(p,3*b,y),F=n.fromArray(p,3*L,_),D=n.fromArray(p,3*P,m),B=n.multiplyByScalar(n.normalize(U,T),M,T),z=n.multiplyByScalar(n.normalize(F,R),M,R),G=n.multiplyByScalar(n.normalize(D,v),M,v),q=n.magnitudeSquared(n.subtract(B,z,A)),V=n.magnitudeSquared(n.subtract(z,G,A)),X=n.magnitudeSquared(n.subtract(G,B,A)),W=Math.max(q,V,X);W>O?q===W?(w=Math.min(b,L)+" "+Math.max(b,L),f=I[w],i(f)||(C=n.add(U,F,A),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),f=p.length/3-1,I[w]=f),h.push(b,f,P),h.push(f,L,P)):V===W?(w=Math.min(L,P)+" "+Math.max(L,P),f=I[w],i(f)||(C=n.add(F,D,A),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),f=p.length/3-1,I[w]=f),h.push(L,f,b),h.push(f,P,b)):X===W&&(w=Math.min(P,b)+" "+Math.max(P,b),f=I[w],i(f)||(C=n.add(D,U,A),n.multiplyByScalar(C,.5,C),p.push(C.x,C.y,C.z),f=p.length/3-1,I[w]=f),h.push(P,f,L),h.push(f,b,L)):(g.push(b),g.push(L),g.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:p})},indices:g,primitiveType:E.TRIANGLES})},p.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=h,c=d;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,E=0;E<l;E+=3)n.fromArray(e,E,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[E]=c.x,e[E+1]=c.y,e[E+2]=c.z;return e},p}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var E=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);E=e.normalize(t,E);var u=E.x*o,s=E.y*o,c=E.z*o,f=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=f,a):new l(u,s,c,f)};var f=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],E=e[c.COLUMN1ROW1],d=e[c.COLUMN2ROW2],p=s+E+d;if(p>0)n=Math.sqrt(p+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var y=f,_=0;E>s&&(_=1),d>s&&d>E&&(_=2);var m=y[_],T=y[m];n=Math.sqrt(e[c.getElementIndex(_,_)]-e[c.getElementIndex(m,m)]-e[c.getElementIndex(T,T)]+1);var R=h;R[_]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,m)]-e[c.getElementIndex(m,T)])*n,R[m]=(e[c.getElementIndex(m,_)]+e[c.getElementIndex(_,m)])*n,R[T]=(e[c.getElementIndex(T,_)]+e[c.getElementIndex(_,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var d=new l,p=new l,y=new l,_=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),_=l.fromAxisAngle(e.UNIT_X,o.roll,d),y=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(y,_,y),p=l.fromAxisAngle(e.UNIT_Z,-o.heading,d),l.multiply(p,i,i)};var m=new e,T=new e,R=new l,v=new l,A=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,A),l.conjugate(A,A);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,A,R),R.w<0&&l.negate(R,R),l.computeAxis(R,m);var u=l.computeAngle(R);r[o]=m.x*u,r[o+1]=m.y*u,r[o+2]=m.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,v),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,v,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,E=o*u+r*l+a*c-i*s,f=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,d=o*l-r*u-a*s-i*c;return n.x=E,n.y=f,n.z=h,n.w=d,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var S=new l;l.lerp=function(e,t,n,r){return S=l.multiplyByScalar(t,n,S),r=l.multiplyByScalar(e,1-n,r),l.add(S,r,r)};var N=new l,g=new l,I=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return g=l.multiplyByScalar(e,Math.sin((1-n)*o),g),I=l.multiplyByScalar(i,Math.sin(n*o),I),r=l.add(g,I,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var M=new e,x=new e,O=new l,w=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,O);l.multiply(i,r,w);var o=l.log(w,M);l.multiply(i,t,w);var u=l.log(w,x);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,O),l.multiply(n,O,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,O),u=l.slerp(n,r,a,w);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,L=i.supportsTypedArrays()?new Float32Array(8):[],b=i.supportsTypedArrays()?new Float32Array(8):[],U=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],D=0;D<7;++D){var B=D+1,z=2*B+1;L[D]=1/(B*z),b[D]=B/z}return L[7]=P/136,b[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,E=7;E>=0;--E)U[E]=(L[E]*s-b[E])*o,F[E]=(L[E]*c-b[E])*o;var f=a*n*(1+U[0]*(1+U[1]*(1+U[2]*(1+U[3]*(1+U[4]*(1+U[5]*(1+U[6]*(1+U[7])))))))),h=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),d=l.multiplyByScalar(e,h,C);return l.multiplyByScalar(t,f,r),l.add(d,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,O),u=l.fastSlerp(n,r,a,w);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./freezeObject"],function(e,t,n,r,a,i){"use strict";function o(e,t,r,a){this[0]=n(e,0),this[1]=n(r,0),this[2]=n(t,0),this[3]=n(a,0)}o.packedLength=4,o.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t},o.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new o),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a},o.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new o(e[0],e[2],e[1],e[3])},o.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new o),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a},o.fromColumnMajorArray=function(e,t){return o.clone(e,t)},o.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new o(e[0],e[1],e[2],e[3])},o.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new o(e.x,0,0,e.y)},o.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new o(e,0,0,e)},o.fromRotation=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=-a,t[3]=n,t):new o(n,-a,a,n)},o.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},o.getElementIndex=function(e,t){return 2*e+t},o.getColumn=function(e,t,n){var r=2*t,a=e[r],i=e[r+1];return n.x=a,n.y=i,n},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var a=2*t;return r[a]=n.x,r[a+1]=n.y,r},o.getRow=function(e,t,n){var r=e[t],a=e[t+2];return n.x=r,n.y=a,n},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+2]=n.y,r};var u=new e;o.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],u)),n.y=e.magnitude(e.fromElements(t[2],t[3],u)),n};var s=new e;return o.getMaximumScale=function(t){return o.getScale(t,s),e.maximumComponent(s)},o.multiply=function(e,t,n){var r=e[0]*t[0]+e[2]*t[1],a=e[0]*t[2]+e[2]*t[3],i=e[1]*t[0]+e[3]*t[1],o=e[1]*t[2]+e[3]*t[3];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n},o.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},o.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},o.multiplyByVector=function(e,t,n){var r=e[0]*t.x+e[2]*t.y,a=e[1]*t.x+e[3]*t.y;return n.x=r,n.y=a,n},o.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},o.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},o.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},o.transpose=function(e,t){var n=e[0],r=e[2],a=e[1],i=e[3];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t},o.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},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},o.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},o.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n},o.IDENTITY=i(new o(1,0,0,1)),o.ZERO=i(new o(0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,a(o.prototype,{length:{get:function(){return o.packedLength}}}),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},o}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,n,r,a,i,o,u){"use strict";function s(t,n,r,a,i,u,s){var c=Math.cos(n),l=a*c,E=r*c,f=Math.sin(n),p=a*f,m=r*f;d=_.project(t,d),d=e.subtract(d,y,d);var T=o.fromRotation(n,h);d=o.multiplyByVector(T,d,d),d=e.add(d,y,d),t=_.unproject(d,t),u-=1,s-=1;var R=t.latitude,v=R+u*m,A=R-l*s,S=R-l*s+u*m,N=Math.max(R,v,A,S),g=Math.min(R,v,A,S),I=t.longitude,M=I+u*E,x=I+s*p,O=I+s*p+u*E,w=Math.max(I,M,x,O),C=Math.min(I,M,x,O);return{north:N,south:g,east:w,west:C,granYCos:l,granYSin:p,granXCos:E,granXSin:m,nwCorner:t}}var c=Math.cos,l=Math.sin,E=Math.sqrt,f={};f.computePosition=function(e,t,r,a,i){var o=e.ellipsoid.radiiSquared,u=e.nwCorner,s=e.rectangle,f=u.latitude-e.granYCos*t+r*e.granXSin,h=c(f),d=l(f),p=o.z*d,y=u.longitude+t*e.granYSin+r*e.granXCos,_=h*c(y),m=h*l(y),T=o.x*_,R=o.y*m,v=E(T*_+R*m+p*d);if(a.x=T/v,a.y=R/v,a.z=p/v,n(e.vertexFormat)&&e.vertexFormat.st){var A=e.stNwCorner;n(A)?(f=A.latitude-e.stGranYCos*t+r*e.stGranXSin,y=A.longitude+t*e.stGranYSin+r*e.stGranXCos,i.x=(y-e.stWest)*e.lonScalar,i.y=(f-e.stSouth)*e.latScalar):(i.x=(y-s.west)*e.lonScalar,i.y=(f-s.south)*e.latScalar)}};var h=new o,d=new e,p=new t,y=new e,_=new a;return f.computeOptions=function(e,t,n,r){var a,o,c,l,E,f=e._granularity,h=e._ellipsoid,d=e._surfaceHeight,m=e._rotation,T=e._stRotation,R=e._extrudedHeight,v=t.east,A=t.west,S=t.north,N=t.south,g=S-N;A>v?(E=i.TWO_PI-A+v,a=Math.ceil(E/f)+1,o=Math.ceil(g/f)+1,c=E/(a-1),l=g/(o-1)):(E=v-A,a=Math.ceil(E/f)+1,o=Math.ceil(g/f)+1,c=E/(a-1),l=g/(o-1)),n=u.northwest(t,n);var I=u.center(t,p);0===m&&0===T||(I.longitude<n.longitude&&(I.longitude+=i.TWO_PI),y=_.project(I,y));var M=l,x=c,O=0,w=0,C={granYCos:M,granYSin:O,granXCos:x,granXSin:w,ellipsoid:h,surfaceHeight:d,extrudedHeight:R,nwCorner:n,rectangle:t,width:a,height:o};if(0!==m){var P=s(n,m,c,l,I,a,o);S=P.north,N=P.south,v=P.east,A=P.west,C.granYCos=P.granYCos,C.granYSin=P.granYSin,C.granXCos=P.granXCos,C.granXSin=P.granXSin,t.north=S,t.south=N,t.east=v,t.west=A}if(0!==T){m-=T,r=u.northwest(t,r);var L=s(r,m,c,l,I,a,o);C.stGranYCos=L.granYCos,C.stGranXCos=L.granXCos,C.stGranYSin=L.granYSin,C.stGranXSin=L.granXSin,C.stNwCorner=r,C.stWest=L.west,C.stSouth=L.south}return C},f}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/RectangleGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./Check","./ComponentDatatype","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./GeometryInstance","./GeometryPipeline","./IndexDatatype","./Math","./Matrix3","./PolygonPipeline","./PrimitiveType","./Quaternion","./Rectangle","./RectangleGeometryLibrary","./VertexFormat"],function(e,t,n,r,a,i,o,u,s,c,l,E,f,h,d,p,y,_,m,T,R,v,A,S,N){"use strict";function g(e,t){var n=new E({attributes:new h,primitiveType:R.TRIANGLES});return n.attributes.position=new f({componentDatatype:i.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function I(e,t,r,a){var i=e.length,o=t.normal?new Float32Array(i):void 0,u=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,c=0,l=D,E=F,f=U;if(t.normal||t.tangent||t.bitangent)for(var h=0;h<i;h+=3){var d=n.fromArray(e,h,b),p=c+1,y=c+2;f=r.geodeticSurfaceNormal(d,f),(t.tangent||t.bitangent)&&(n.cross(n.UNIT_Z,f,E),m.multiplyByVector(a,E,E),n.normalize(E,E),t.bitangent&&n.normalize(n.cross(f,E,l),l)),t.normal&&(o[c]=f.x,o[p]=f.y,o[y]=f.z),t.tangent&&(u[c]=E.x,u[p]=E.y,u[y]=E.z),t.bitangent&&(s[c]=l.x,s[p]=l.y,s[y]=l.z),c+=3}return g(t,{positions:e,normals:o,tangents:u,bitangents:s})}function M(e,t,r){var a=e.length,i=t.normal?new Float32Array(a):void 0,o=t.tangent?new Float32Array(a):void 0,u=t.bitangent?new Float32Array(a):void 0,s=0,c=0,l=0,E=!0,f=D,h=F,d=U;if(t.normal||t.tangent||t.bitangent)for(var p=0;p<a;p+=6){var y=n.fromArray(e,p,b),m=n.fromArray(e,(p+6)%a,V);if(E){var T=n.fromArray(e,(p+3)%a,X);n.subtract(m,y,m),n.subtract(T,y,T),d=n.normalize(n.cross(T,m,d),d),E=!1}n.equalsEpsilon(m,y,_.EPSILON10)&&(E=!0),(t.tangent||t.bitangent)&&(f=r.geodeticSurfaceNormal(y,f),t.tangent&&(h=n.normalize(n.cross(f,d,h),h))),t.normal&&(i[s++]=d.x,i[s++]=d.y,i[s++]=d.z,i[s++]=d.x,i[s++]=d.y,i[s++]=d.z),t.tangent&&(o[c++]=h.x,o[c++]=h.y,o[c++]=h.z,o[c++]=h.x,o[c++]=h.y,o[c++]=h.z),t.bitangent&&(u[l++]=f.x,u[l++]=f.y,u[l++]=f.z,u[l++]=f.x,u[l++]=f.y,u[l++]=f.z)}return g(t,{positions:e,normals:i,tangents:o,bitangents:u})}function x(e){for(var t=e.vertexFormat,n=e.ellipsoid,r=e.size,a=e.height,o=e.width,u=t.position?new Float64Array(3*r):void 0,s=t.st?new Float32Array(2*r):void 0,c=0,l=0,E=b,h=z,d=Number.MAX_VALUE,p=Number.MAX_VALUE,_=-Number.MAX_VALUE,m=-Number.MAX_VALUE,T=0;T<a;++T)for(var R=0;R<o;++R)S.computePosition(e,T,R,E,h),u[c++]=E.x,u[c++]=E.y,u[c++]=E.z,t.st&&(s[l++]=h.x,s[l++]=h.y,d=Math.min(d,h.x),p=Math.min(p,h.y),_=Math.max(_,h.x),m=Math.max(m,h.y));if(t.st&&(d<0||p<0||_>1||m>1))for(var v=0;v<s.length;v+=2)s[v]=(s[v]-d)/(_-d),s[v+1]=(s[v+1]-p)/(m-p);for(var A=I(u,t,n,e.tangentRotationMatrix),N=6*(o-1)*(a-1),g=y.createTypedArray(r,N),M=0,x=0,O=0;O<a-1;++O){for(var w=0;w<o-1;++w){var C=M,P=C+o,L=P+1,U=C+1;g[x++]=C,g[x++]=P,g[x++]=U,g[x++]=U,g[x++]=P,g[x++]=L,++M}++M}return A.indices=g,t.st&&(A.attributes.st=new f({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:s})),A}function O(e,t,n,r,a){return e[t++]=r[n],e[t++]=r[n+1],e[t++]=r[n+2],e[t++]=a[n],e[t++]=a[n+1],e[t++]=a[n+2],e}function w(e,t,n,r){return e[t++]=r[n],e[t++]=r[n+1],e[t++]=r[n],e[t++]=r[n+1],e}function C(e){var t,r=e.shadowVolume,a=e.vertexFormat,o=e.surfaceHeight,u=e.extrudedHeight,s=Math.min(u,o),c=Math.max(u,o),l=e.height,E=e.width,h=e.ellipsoid;r&&(e.vertexFormat=N.clone(a,W),e.vertexFormat.normal=!0);var m=x(e);if(_.equalsEpsilon(s,c,_.EPSILON10))return m;var R=T.scaleToGeodeticHeight(m.attributes.position.values,c,h,!1);R=new Float64Array(R);var v=R.length,A=2*v,S=new Float64Array(A);S.set(R);var g=T.scaleToGeodeticHeight(m.attributes.position.values,s,h);S.set(g,v),m.attributes.position.values=S;var I,C,P=a.normal?new Float32Array(A):void 0,L=a.tangent?new Float32Array(A):void 0,b=a.bitangent?new Float32Array(A):void 0,U=a.st?new Float32Array(A/3*2):void 0;if(a.normal){for(C=m.attributes.normal.values,P.set(C),t=0;t<v;t++)C[t]=-C[t];P.set(C,v),m.attributes.normal.values=P}if(r){C=m.attributes.normal.values,a.normal||(m.attributes.normal=void 0);var F=new Float32Array(A);for(t=0;t<v;t++)C[t]=-C[t];F.set(C,v),m.attributes.extrudeDirection=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:F})}if(a.tangent){var D=m.attributes.tangent.values;for(L.set(D),t=0;t<v;t++)D[t]=-D[t];L.set(D,v),m.attributes.tangent.values=L}if(a.bitangent){var B=m.attributes.bitangent.values;b.set(B),b.set(B,v),m.attributes.bitangent.values=b}a.st&&(I=m.attributes.st.values,U.set(I),U.set(I,v/3*2),m.attributes.st.values=U);var z=m.indices,G=z.length,q=v/3,H=y.createTypedArray(A/3,2*G);for(H.set(z),t=0;t<G;t+=3)H[t+G]=z[t+2]+q,H[t+1+G]=z[t+1]+q,H[t+2+G]=z[t]+q;m.indices=H;var Y,k=2*E+2*l-4,Z=2*(k+4),K=new Float64Array(3*Z),j=r?new Float32Array(3*Z):void 0,Q=a.st?new Float32Array(2*Z):void 0,J=0,$=0,ee=0,te=E*l;for(t=0;t<te;t+=E)Y=3*t,K=O(K,J,Y,R,g),J+=6,a.st&&(Q=w(Q,$,2*t,I),$+=4),r&&(ee+=3,j[ee++]=C[Y],j[ee++]=C[Y+1],j[ee++]=C[Y+2]);for(t=te-E;t<te;t++)Y=3*t,K=O(K,J,Y,R,g),J+=6,a.st&&(Q=w(Q,$,2*t,I),$+=4),r&&(ee+=3,j[ee++]=C[Y],j[ee++]=C[Y+1],j[ee++]=C[Y+2]);for(t=te-1;t>0;t-=E)Y=3*t,K=O(K,J,Y,R,g),J+=6,a.st&&(Q=w(Q,$,2*t,I),$+=4),r&&(ee+=3,j[ee++]=C[Y],j[ee++]=C[Y+1],j[ee++]=C[Y+2]);for(t=E-1;t>=0;t--)Y=3*t,K=O(K,J,Y,R,g),J+=6,a.st&&(Q=w(Q,$,2*t,I),$+=4),r&&(ee+=3,j[ee++]=C[Y],j[ee++]=C[Y+1],j[ee++]=C[Y+2]);var ne=M(K,a,h);a.st&&(ne.attributes.st=new f({componentDatatype:i.FLOAT,componentsPerAttribute:2,values:Q})),r&&(ne.attributes.extrudeDirection=new f({componentDatatype:i.FLOAT,componentsPerAttribute:3,values:j}));var re,ae,ie,oe,ue=y.createTypedArray(Z,6*k);v=K.length/3;var se=0;for(t=0;t<v-1;t+=2){re=t,oe=(re+2)%v;var ce=n.fromArray(K,3*re,V),le=n.fromArray(K,3*oe,X);n.equalsEpsilon(ce,le,_.EPSILON10)||(ae=(re+1)%v,ie=(ae+2)%v,ue[se++]=re,ue[se++]=ae,ue[se++]=oe,ue[se++]=oe,ue[se++]=ae,ue[se++]=ie)}return ne.indices=ue,ne=p.combineInstances([new d({geometry:m}),new d({geometry:ne})]),ne[0]}function P(e,t,n){if(0===n)return A.clone(e);A.northeast(e,K[0]),A.northwest(e,K[1]),A.southeast(e,K[2]),A.southwest(e,K[3]),t.cartographicArrayToCartesianArray(K,Z);var r=t.geodeticSurfaceNormalCartographic(A.center(e,Y));v.fromAxisAngle(r,n,k),m.fromQuaternion(k,H);for(var a=0;a<4;++a)m.multiplyByVector(H,Z[a],Z[a]);return t.cartesianArrayToCartographicArray(Z,K),A.fromCartographicArray(K)}function L(e){e=o(e,o.EMPTY_OBJECT);var t=e.rectangle,n=o(e.rotation,0);this._rectangle=t,this._granularity=o(e.granularity,_.RADIANS_PER_DEGREE),this._ellipsoid=l.clone(o(e.ellipsoid,l.WGS84)),this._surfaceHeight=o(e.height,0),this._rotation=n,this._stRotation=o(e.stRotation,0),this._vertexFormat=N.clone(o(e.vertexFormat,N.DEFAULT)),this._extrudedHeight=o(e.extrudedHeight,0),this._extrude=u(e.extrudedHeight),this._closeTop=o(e.closeTop,!0),this._closeBottom=o(e.closeBottom,!0),this._shadowVolume=o(e.shadowVolume,!1),this._workerName="createRectangleGeometry",this._rotatedRectangle=P(this._rectangle,this._ellipsoid,n)}var b=new n,U=new n,F=new n,D=new n,B=new A,z=new t,G=new e,q=new e,V=new n,X=new n,W=new N,H=new m,Y=new n,k=new v,Z=[new n,new n,new n,new n],K=[new r,new r,new r,new r];L.packedLength=A.packedLength+l.packedLength+N.packedLength+A.packedLength+9,L.pack=function(e,t,n){return n=o(n,0),A.pack(e._rectangle,t,n),n+=A.packedLength,l.pack(e._ellipsoid,t,n),n+=l.packedLength,N.pack(e._vertexFormat,t,n),n+=N.packedLength,A.pack(e._rotatedRectangle,t,n),n+=A.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._extrude?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n]=e._shadowVolume?1:0,t};var j=new A,Q=new A,J=l.clone(l.UNIT_SPHERE),$={rectangle:j,ellipsoid:J,vertexFormat:W,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,closeTop:void 0,closeBottom:void 0,shadowVolume:void 0};L.unpack=function(e,t,n){t=o(t,0);var r=A.unpack(e,t,j);t+=A.packedLength;var a=l.unpack(e,t,J);t+=l.packedLength;var i=N.unpack(e,t,W);t+=N.packedLength;var s=A.unpack(e,t,Q);t+=A.packedLength;var c=e[t++],E=e[t++],f=e[t++],h=e[t++],d=e[t++],p=1===e[t++],y=1===e[t++],_=1===e[t++],m=1===e[t];return u(n)?(n._rectangle=A.clone(r,n._rectangle),n._ellipsoid=l.clone(a,n._ellipsoid),n._vertexFormat=N.clone(i,n._vertexFormat),n._granularity=c,n._surfaceHeight=E,n._rotation=f,n._stRotation=h,n._extrudedHeight=p?d:void 0,n._extrude=p,n._closeTop=y,n._closeBottom=_,n._rotatedRectangle=s,n._shadowVolume=m,n):($.granularity=c,$.height=E,$.rotation=f,$.stRotation=h,$.extrudedHeight=p?d:void 0,$.closeTop=y,$.closeBottom=_,$.shadowVolume=m,new L($))};var ee=new m,te=new r,ne=new r,re=new v,ae=new r;return L.createGeometry=function(t){if(!_.equalsEpsilon(t._rectangle.north,t._rectangle.south,_.EPSILON10)&&!_.equalsEpsilon(t._rectangle.east,t._rectangle.west,_.EPSILON10)){var n=A.clone(t._rectangle,B),r=t._ellipsoid,a=t._surfaceHeight,i=t._extrude,o=t._extrudedHeight,u=t._rotation,s=t._stRotation,c=t._vertexFormat,l=S.computeOptions(t,n,te,ne),f=ee;if(0!==s||0!==u){var h=A.center(n,ae),d=r.geodeticSurfaceNormalCartographic(h,V);v.fromAxisAngle(d,-s,re),m.fromQuaternion(re,f)}else m.clone(m.IDENTITY,f);l.lonScalar=1/t._rectangle.width,l.latScalar=1/t._rectangle.height,l.vertexFormat=c,l.rotation=u,l.stRotation=s,l.tangentRotationMatrix=f,l.size=l.width*l.height;var p,y;if(n=t._rectangle,i){l.shadowVolume=t._shadowVolume,p=C(l);var R=e.fromRectangle3D(n,r,a,q),N=e.fromRectangle3D(n,r,o,G); +y=e.union(R,N)}else p=x(l),p.attributes.position.values=T.scaleToGeodeticHeight(p.attributes.position.values,a,r,!1),y=e.fromRectangle3D(n,r,a);return c.position||delete p.attributes.position,new E({attributes:p.attributes,indices:p.indices,primitiveType:p.primitiveType,boundingSphere:y})}},L.createShadowVolume=function(e,t,n){var r=e._granularity,a=e._ellipsoid,i=t(r,a),o=n(r,a);return new L({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:a,stRotation:e._stRotation,granularity:r,extrudedHeight:o,height:i,closeTop:!0,closeBottom:!0,vertexFormat:N.POSITION_ONLY,shadowVolume:!0})},s(L.prototype,{rectangle:{get:function(){return this._rotatedRectangle}}}),L}),define("Workers/createRectangleGeometry",["../Core/defined","../Core/Ellipsoid","../Core/Rectangle","../Core/RectangleGeometry"],function(e,t,n,r){"use strict";function a(a,i){return e(i)&&(a=r.unpack(a,i)),a._ellipsoid=t.clone(a._ellipsoid),a._rectangle=n.clone(a._rectangle),r.createGeometry(a)}return a})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createRectangleOutlineGeometry.js b/engines/Cesium/Workers/createRectangleOutlineGeometry.js index 4fa9a0c..44454a5 100644 --- a/engines/Cesium/Workers/createRectangleOutlineGeometry.js +++ b/engines/Cesium/Workers/createRectangleOutlineGeometry.js @@ -55,7 +55,7 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,E),o.normalize(t,c);var n=o.dot(E,c),r=o.magnitude(o.cross(E,c,E));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,E=i*s-a*u,c=a*o-r*s,_=r*u-i*o;return n.x=E,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var l=new o,f=new o,T=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:T,E=Math.cos(r);l.x=E*Math.cos(e),l.y=E*Math.sin(e),l.z=Math.sin(r),l=o.normalize(l,l),o.multiplyComponents(s,l,f);var c=Math.sqrt(o.dot(l,f));return f=o.divideByScalar(f,c,f),l=o.multiplyByScalar(l,i,l),n(u)||(u=new o),o.add(f,l,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromDegrees(u,s,0,t,r[E])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromRadians(u,s,0,t,r[E])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromDegrees(u,s,E,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromRadians(u,s,E,t,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,E){var c=n.x,_=n.y,l=n.z,f=i.x,T=i.y,R=i.z,h=c*c*f*f,A=_*_*T*T,d=l*l*R*R,N=h+A+d,S=Math.sqrt(1/N),y=e.multiplyByScalar(n,S,a);if(N<s)return isFinite(S)?e.clone(y,E):void 0;var I=u.x,p=u.y,m=u.z,M=o;M.x=y.x*I*2,M.y=y.y*p*2,M.z=y.z*m*2;var O,x,C,g,v,U,L,w,P,F,D,B=(1-S)*e.magnitude(n)/(.5*e.magnitude(M)),z=0;do{B-=z,C=1/(1+B*I),g=1/(1+B*p),v=1/(1+B*m),U=C*C,L=g*g,w=v*v,P=U*C,F=L*g,D=w*v,O=h*U+A*L+d*w-1,x=h*P*I+A*F*p+d*D*m;var G=-2*x;z=O/G}while(Math.abs(O)>r.EPSILON12);return t(E)?(E.x=c*C,E.y=_*g,E.z=l*v,E):new e(c*C,_*g,l*v)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,E=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),l=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),f=a.EPSILON1;return u.fromCartesian=function(t,r,i){var T=n(r)?r.oneOverRadii:_,R=n(r)?r.oneOverRadiiSquared:l,h=n(r)?r._centerToleranceSquared:f,A=o(t,T,R,h,E);if(n(A)){var d=e.multiplyComponents(A,R,s);d=e.normalize(d,d);var N=e.subtract(t,A,c),S=Math.atan2(d.y,d.x),y=Math.asin(d.z),I=a.sign(e.dot(N,t))*e.magnitude(N);return n(i)?(i.longitude=S,i.latitude=y,i.height=I,i):new u(S,y,I)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,E(this,e,t,n)}i(c.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}}}),c.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(E(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),E=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=E,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,l=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=l;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var f=new e,T=new e,R=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,T);if(r(a)){var o=this.geodeticSurfaceNormal(a,f),s=e.subtract(n,a,R),E=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=E,i.latitude=c,i.height=_,i):new t(E,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,i,a,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new s(e,t,i,a)},s.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new s(e,t,i,a)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,E=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,l=e.length;_<l;_++){var f=e[_];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),E=Math.min(E,f.latitude),c=Math.max(c,f.latitude);var T=f.longitude>=0?f.longitude:f.longitude+u.TWO_PI;a=Math.min(a,T),o=Math.max(o,T)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=E,t.east=i,t.north=c,t):new s(n,E,i,c)},s.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,E=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,l=0,f=e.length;l<f;l++){var T=t.cartesianToCartographic(e[l]);i=Math.min(i,T.longitude),a=Math.max(a,T.longitude),c=Math.min(c,T.latitude),_=Math.max(_,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+u.TWO_PI;o=Math.min(o,R),E=Math.max(E,R)}return a-i>E-o&&(i=o,a=E,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new s(i,c,a,_)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,E)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var l=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(l>=f))return r(n)?(n.west=c,n.south=l,n.east=_,n.north=f,n):new s(c,l,_,f)}},s.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,E)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var E=new e;return s.subsample=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=e.north,l=e.south,f=e.east,T=e.west,R=E;R.height=i,R.longitude=T,R.latitude=_,o[c]=t.cartographicToCartesian(R,o[c]),c++,R.longitude=f,o[c]=t.cartographicToCartesian(R,o[c]),c++,R.latitude=l,o[c]=t.cartographicToCartesian(R,o[c]),c++,R.longitude=T,o[c]=t.cartographicToCartesian(R,o[c]),c++,_<0?R.latitude=_:l>0?R.latitude=l:R.latitude=0;for(var h=1;h<8;++h)R.longitude=-Math.PI+h*u.PI_OVER_TWO,s.contains(e,R)&&(o[c]=t.cartographicToCartesian(R,o[c]),c++);return 0===R.latitude&&(R.longitude=T,o[c]=t.cartographicToCartesian(R,o[c]),c++,R.longitude=f,o[c]=t.cartographicToCartesian(R,o[c]),c++),o.length=c,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i,a,o,u,s,E){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(E,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(R[n],T[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(R[a],T[a])]);o>r&&(i=a,r=o)}var E=1,c=0,_=T[i],l=R[i];if(Math.abs(e[s.getElementIndex(l,_)])>n){var f,h=e[s.getElementIndex(l,l)],A=e[s.getElementIndex(_,_)],d=e[s.getElementIndex(l,_)],N=(h-A)/2/d;f=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),E=1/Math.sqrt(1+f*f),c=f*E}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(_,_)]=t[s.getElementIndex(l,l)]=E,t[s.getElementIndex(l,_)]=c,t[s.getElementIndex(_,l)]=-c,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,E=e.y*e.z,c=e.y*e.w,_=e.z*e.z,l=e.z*e.w,f=e.w*e.w,T=n-u-_+f,R=2*(i-l),h=2*(a+c),A=2*(i+l),d=-n+u-_+f,N=2*(E-o),S=2*(a-c),y=2*(E+o),I=-n-u+_+f;return r(t)?(t[0]=T,t[1]=A,t[2]=S,t[3]=R,t[4]=d,t[5]=y,t[6]=h,t[7]=N,t[8]=I,t):new s(T,R,h,A,d,N,S,y,I)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),E=Math.sin(e.roll),c=n*i,_=-a*u+E*o*i,l=E*u+a*o*i,f=n*u,T=a*i+E*o*u,R=-o*a+a*o*u,h=-o,A=E*n,d=a*n;return r(t)?(t[0]=c,t[1]=f,t[2]=h,t[3]=_,t[4]=T,t[5]=A,t[6]=l,t[7]=R,t[8]=d,t):new s(c,_,l,f,T,R,h,A,d)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new s(1,0,0,0,n,-i,0,i,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new s(n,0,i,0,1,0,-i,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-i,0,i,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),n};var f=new e;s.getMaximumScale=function(t){return s.getScale(t,f),e.maximumComponent(f)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],E=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=E,n[7]=c,n[8]=_,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],E=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=E,t[8]=c,t};var T=[1,0,0],R=[2,2,1],h=new s,A=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var l=t.unitary=s.clone(s.IDENTITY,t.unitary),f=t.diagonal=s.clone(e,t.diagonal),T=n*E(f);o<i&&c(f)>T;)_(f,h),s.transpose(h,A),s.multiply(f,h,f),s.multiply(A,f,f),s.multiply(l,h,l),++a>2&&(++o,a=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],E=e[8];return t*(a*E-s*o)+i*(s*r-n*E)+u*(n*o-a*r)},s.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],E=e[6],c=e[7],_=e[8],l=s.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=E*u-a*_,t[4]=n*_-E*i,t[5]=a*i-n*u,t[6]=a*c-E*o,t[7]=E*r-n*c,t[8]=n*o-a*r;var f=1/l;return s.multiplyByScalar(t,f,t); -},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,E){"use strict";function c(e,t,n,i,a,o,u,s,E,c,_,l,f,T,R,h){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(E,0),this[3]=r(f,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(T,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(R,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(l,0),this[15]=r(h,0)}c.packedLength=16,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},c.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new c),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},c.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,E=t.x*t.y,_=t.x*t.z,l=t.x*t.w,f=t.y*t.y,T=t.y*t.z,R=t.y*t.w,h=t.z*t.z,A=t.z*t.w,d=t.w*t.w,N=s-f-h+d,S=2*(E-A),y=2*(_+R),I=2*(E+A),p=-s+f-h+d,m=2*(T-l),M=2*(_-R),O=2*(T+l),x=-s-f+h+d;return r[0]=N*a,r[1]=I*a,r[2]=M*a,r[3]=0,r[4]=S*o,r[5]=p*o,r[6]=O*o,r[7]=0,r[8]=y*u,r[9]=m*u,r[10]=x*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(s.IDENTITY,e,t)},c.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,l=new e,f=new e;c.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,l),l),e.normalize(e.cross(l,_,f),f);var u=l.x,s=l.y,E=l.z,T=_.x,R=_.y,h=_.z,A=f.x,d=f.y,N=f.z,S=r.x,y=r.y,I=r.z,p=u*-S+s*-y+E*-I,m=A*-S+d*-y+N*-I,M=T*S+R*y+h*I;return i(n)?(n[0]=u,n[1]=A,n[2]=-T,n[3]=0,n[4]=s,n[5]=d,n[6]=-R,n[7]=0,n[8]=E,n[9]=N,n[10]=-h,n[11]=0,n[12]=p,n[13]=m,n[14]=M,n[15]=1,n):new c(u,s,E,p,A,d,N,m,-T,-R,-h,M,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),E=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=E,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),E=1/(a-i),c=-(t+e)*u,_=-(r+n)*s,l=-(a+i)*E;return u*=2,s*=2,E*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=E,o[11]=0,o[12]=c,o[13]=_,o[14]=l,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),E=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),l=-1,f=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=E,o[9]=c,o[10]=_,o[11]=l,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),E=(r+n)/(r-n),c=-1,_=-1,l=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=s,a[9]=E,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=l,a[15]=0,a},c.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var E=.5*u,c=.5*s,_=.5*(n-t),l=E,f=c,T=_,R=a+E,h=o+c,A=t+_,d=1;return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=f,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=T,i[11]=0,i[12]=R,i[13]=h,i[14]=A,i[15]=d,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},c.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var T=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],T)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],T)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],T)),n};var R=new e;c.getMaximumScale=function(t){return c.getScale(t,R),e.maximumComponent(R)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],E=e[6],c=e[7],_=e[8],l=e[9],f=e[10],T=e[11],R=e[12],h=e[13],A=e[14],d=e[15],N=t[0],S=t[1],y=t[2],I=t[3],p=t[4],m=t[5],M=t[6],O=t[7],x=t[8],C=t[9],g=t[10],v=t[11],U=t[12],L=t[13],w=t[14],P=t[15],F=r*N+u*S+_*y+R*I,D=i*N+s*S+l*y+h*I,B=a*N+E*S+f*y+A*I,z=o*N+c*S+T*y+d*I,G=r*p+u*m+_*M+R*O,b=i*p+s*m+l*M+h*O,X=a*p+E*m+f*M+A*O,q=o*p+c*m+T*M+d*O,V=r*x+u*C+_*g+R*v,H=i*x+s*C+l*g+h*v,W=a*x+E*C+f*g+A*v,Y=o*x+c*C+T*g+d*v,k=r*U+u*L+_*w+R*P,Z=i*U+s*L+l*w+h*P,K=a*U+E*L+f*w+A*P,j=o*U+c*L+T*w+d*P;return n[0]=F,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=q,n[8]=V,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=Z,n[14]=K,n[15]=j,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=e[12],f=e[13],T=e[14],R=t[0],h=t[1],A=t[2],d=t[4],N=t[5],S=t[6],y=t[8],I=t[9],p=t[10],m=t[12],M=t[13],O=t[14],x=r*R+o*h+E*A,C=i*R+u*h+c*A,g=a*R+s*h+_*A,v=r*d+o*N+E*S,U=i*d+u*N+c*S,L=a*d+s*N+_*S,w=r*y+o*I+E*p,P=i*y+u*I+c*p,F=a*y+s*I+_*p,D=r*m+o*M+E*O+l,B=i*m+u*M+c*O+f,z=a*m+s*M+_*O+T;return n[0]=x,n[1]=C,n[2]=g,n[3]=0,n[4]=v,n[5]=U,n[6]=L,n[7]=0,n[8]=w,n[9]=P,n[10]=F,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=t[0],f=t[1],T=t[2],R=t[3],h=t[4],A=t[5],d=t[6],N=t[7],S=t[8],y=r*l+o*f+E*T,I=i*l+u*f+c*T,p=a*l+s*f+_*T,m=r*R+o*h+E*A,M=i*R+u*h+c*A,O=a*R+s*h+_*A,x=r*d+o*N+E*S,C=i*d+u*N+c*S,g=a*d+s*N+_*S;return n[0]=y,n[1]=I,n[2]=p,n[3]=0,n[4]=m,n[5]=M,n[6]=O,n[7]=0,n[8]=x,n[9]=C,n[10]=g,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var h=new e;c.multiplyByUniformScale=function(e,t,n){return h.x=t,h.y=t,h.z=t,c.multiplyByScale(e,h,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,E=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=E,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var A=new s,d=new s,N=new t,S=new t(0,0,0,1);return c.inverse=function(e,n){if(s.equalsEpsilon(c.getRotation(e,A),d,u.EPSILON7)&&t.equals(c.getRow(e,3,N),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],l=e[5],f=e[9],T=e[13],R=e[2],h=e[6],y=e[10],I=e[14],p=e[3],m=e[7],M=e[11],O=e[15],x=y*O,C=I*M,g=h*O,v=I*m,U=h*M,L=y*m,w=R*O,P=I*p,F=R*M,D=y*p,B=R*m,z=h*p,G=x*l+v*f+U*T-(C*l+g*f+L*T),b=C*_+w*f+D*T-(x*_+P*f+F*T),X=g*_+P*l+B*T-(v*_+w*l+z*T),q=L*_+F*l+z*f-(U*_+D*l+B*f),V=C*i+g*a+L*o-(x*i+v*a+U*o),H=x*r+P*a+F*o-(C*r+w*a+D*o),W=v*r+w*i+z*o-(g*r+P*i+B*o),Y=U*r+D*i+B*a-(L*r+F*i+z*a);x=a*T,C=o*f,g=i*T,v=o*l,U=i*f,L=a*l,w=r*T,P=o*_,F=r*f,D=a*_,B=r*l,z=i*_;var k=x*m+v*M+U*O-(C*m+g*M+L*O),Z=C*p+w*M+D*O-(x*p+P*M+F*O),K=g*p+P*m+B*O-(v*p+w*m+z*O),j=L*p+F*m+z*M-(U*p+D*m+B*M),Q=g*y+L*I+C*h-(U*I+x*h+v*y),J=F*I+x*R+P*y-(w*y+D*I+C*R),$=w*h+z*I+v*R-(B*I+g*R+P*h),ee=B*y+U*R+D*h-(F*h+z*y+L*R),te=r*G+i*b+a*X+o*q;if(Math.abs(te)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=q*te,n[4]=V*te,n[5]=H*te,n[6]=W*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=K*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],E=e[9],c=e[10],_=e[12],l=e[13],f=e[14],T=-n*_-r*l-i*f,R=-a*_-o*l-u*f,h=-s*_-E*l-c*f;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=E,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=T,t[13]=R,t[14]=h,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,E,c,_){"use strict";function l(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var f=new e,T=new e,R=new e,h=new e,A=new e,d=new e,N=new e,S=new e,y=new e,I=new e,p=new e,m=new e;l.fromPoints=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],N),a=e.clone(r,f),o=e.clone(r,T),u=e.clone(r,R),s=e.clone(r,h),E=e.clone(r,A),c=e.clone(r,d),_=t.length,M=1;M<_;M++){e.clone(t[M],r);var O=r.x,x=r.y,C=r.z;O<a.x&&e.clone(r,a),O>s.x&&e.clone(r,s),x<o.y&&e.clone(r,o),x>E.y&&e.clone(r,E),C<u.z&&e.clone(r,u),C>c.z&&e.clone(r,c)}var g=e.magnitudeSquared(e.subtract(s,a,S)),v=e.magnitudeSquared(e.subtract(E,o,S)),U=e.magnitudeSquared(e.subtract(c,u,S)),L=a,w=s,P=g;v>P&&(P=v,L=o,w=E),U>P&&(P=U,L=u,w=c);var F=y;F.x=.5*(L.x+w.x),F.y=.5*(L.y+w.y),F.z=.5*(L.z+w.z);var D=e.magnitudeSquared(e.subtract(w,F,S)),B=Math.sqrt(D),z=I;z.x=a.x,z.y=o.y,z.z=u.z;var G=p;G.x=s.x,G.y=E.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,S),.5,m),X=0;for(M=0;M<_;M++){e.clone(t[M],r);var q=e.magnitude(e.subtract(r,b,S));q>X&&(X=q);var V=e.magnitudeSquared(e.subtract(r,F,S));if(V>D){var H=Math.sqrt(V);B=.5*(B+H),D=B*B;var W=H-B;F.x=(B*F.x+W*r.x)/H,F.y=(B*F.y+W*r.y)/H,F.z=(B*F.z+W*r.z)/H}}return B<X?(e.clone(F,n.center),n.radius=B):(e.clone(b,n.center),n.radius=X),n};var M=new o,O=new e,x=new e,C=new t,g=new t;l.fromRectangle2D=function(e,t,n){return l.fromRectangleWithHeights2D(e,t,0,0,n)},l.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new l),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,M),_.southwest(t,C),C.height=a,_.northeast(t,g),g.height=o;var s=n.project(C,O),E=n.project(g,x),c=E.x-s.x,f=E.y-s.y,T=E.z-s.z;u.radius=.5*Math.sqrt(c*c+f*f+T*T);var R=u.center;return R.x=s.x+.5*c,R.y=s.y+.5*f,R.z=s.z+.5*T,u};var v=[];l.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,v)),l.fromPoints(u,o)},l.fromVertices=function(t,n,a,o){if(i(o)||(o=new l),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=N;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,f),E=e.clone(u,T),c=e.clone(u,R),_=e.clone(u,h),M=e.clone(u,A),O=e.clone(u,d),x=t.length,C=0;C<x;C+=a){var g=t[C]+n.x,v=t[C+1]+n.y,U=t[C+2]+n.z;u.x=g,u.y=v,u.z=U,g<s.x&&e.clone(u,s),g>_.x&&e.clone(u,_),v<E.y&&e.clone(u,E),v>M.y&&e.clone(u,M),U<c.z&&e.clone(u,c),U>O.z&&e.clone(u,O)}var L=e.magnitudeSquared(e.subtract(_,s,S)),w=e.magnitudeSquared(e.subtract(M,E,S)),P=e.magnitudeSquared(e.subtract(O,c,S)),F=s,D=_,B=L;w>B&&(B=w,F=E,D=M),P>B&&(B=P,F=c,D=O);var z=y;z.x=.5*(F.x+D.x),z.y=.5*(F.y+D.y),z.z=.5*(F.z+D.z);var G=e.magnitudeSquared(e.subtract(D,z,S)),b=Math.sqrt(G),X=I;X.x=s.x,X.y=E.y,X.z=c.z;var q=p;q.x=_.x,q.y=M.y,q.z=O.z;var V=e.multiplyByScalar(e.add(X,q,S),.5,m),H=0;for(C=0;C<x;C+=a){u.x=t[C]+n.x,u.y=t[C+1]+n.y,u.z=t[C+2]+n.z;var W=e.magnitude(e.subtract(u,V,S));W>H&&(H=W);var Y=e.magnitudeSquared(e.subtract(u,z,S));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var Z=k-b;z.x=(b*z.x+Z*u.x)/k,z.y=(b*z.y+Z*u.y)/k,z.z=(b*z.z+Z*u.z)/k}}return b<H?(e.clone(z,o.center),o.radius=b):(e.clone(V,o.center),o.radius=H),o},l.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new l),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=N;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,f),u=e.clone(a,T),s=e.clone(a,R),E=e.clone(a,h),c=e.clone(a,A),_=e.clone(a,d),M=t.length,O=0;O<M;O+=3){var x=t[O]+n[O],C=t[O+1]+n[O+1],g=t[O+2]+n[O+2];a.x=x,a.y=C,a.z=g,x<o.x&&e.clone(a,o),x>E.x&&e.clone(a,E),C<u.y&&e.clone(a,u),C>c.y&&e.clone(a,c),g<s.z&&e.clone(a,s),g>_.z&&e.clone(a,_)}var v=e.magnitudeSquared(e.subtract(E,o,S)),U=e.magnitudeSquared(e.subtract(c,u,S)),L=e.magnitudeSquared(e.subtract(_,s,S)),w=o,P=E,F=v;U>F&&(F=U,w=u,P=c),L>F&&(F=L,w=s,P=_);var D=y;D.x=.5*(w.x+P.x),D.y=.5*(w.y+P.y),D.z=.5*(w.z+P.z);var B=e.magnitudeSquared(e.subtract(P,D,S)),z=Math.sqrt(B),G=I;G.x=o.x,G.y=u.y,G.z=s.z;var b=p;b.x=E.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,S),.5,m),q=0;for(O=0;O<M;O+=3){a.x=t[O]+n[O],a.y=t[O+1]+n[O+1],a.z=t[O+2]+n[O+2];var V=e.magnitude(e.subtract(a,X,S));V>q&&(q=V);var H=e.magnitudeSquared(e.subtract(a,D,S));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<q?(e.clone(D,r.center),r.radius=z):(e.clone(X,r.center),r.radius=q),r},l.fromCornerPoints=function(t,n,r){i(r)||(r=new l);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},l.fromEllipsoid=function(t,n){return i(n)||(n=new l),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var U=new e;l.fromBoundingSpheres=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return l.clone(t[0],n);if(2===r)return l.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=l.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var E=t[o];s=Math.max(s,e.distance(u,E.center,U)+E.radius)}return n.radius=s,n};var L=new e,w=new e,P=new e;l.fromOrientedBoundingBox=function(t,n){i(n)||(n=new l);var r=t.halfAxes,a=E.getColumn(r,0,L),o=E.getColumn(r,1,w),u=E.getColumn(r,2,P),s=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,c,_),n},l.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new l(t.center,t.radius)},l.packedLength=4,l.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},l.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new l);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var F=new e,D=new e;l.union=function(t,n,r){i(r)||(r=new l);var a=t.center,o=t.radius,u=n.center,s=n.radius,E=e.subtract(u,a,F),c=e.magnitude(E);if(o>=c+s)return t.clone(r),r;if(s>=c+o)return n.clone(r),r;var _=.5*(o+c+s),f=e.multiplyByScalar(E,(-o+_)/c,D);return e.add(f,a,f),e.clone(f,r.center),r.radius=_,r};var B=new e;l.expand=function(t,n,r){r=l.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},l.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},l.transform=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;l.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},l.transformWithoutScale=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;l.computePlaneDistances=function(t,n,r,a){i(a)||(a=new s);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,q=new e,V=new e,H=new e,W=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return l.projectTo2D=function(t,n,i){n=r(n,Z);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,b),E=e.cross(e.UNIT_Z,s,X);e.normalize(E,E);var c=e.cross(s,E,q);e.normalize(c,c),e.multiplyByScalar(s,u,s),e.multiplyByScalar(c,u,c),e.multiplyByScalar(E,u,E);var _=e.negate(c,H),f=e.negate(E,V),T=Y,R=T[0];e.add(s,c,R),e.add(R,E,R),R=T[1],e.add(s,c,R),e.add(R,f,R),R=T[2],e.add(s,_,R),e.add(R,f,R),R=T[3],e.add(s,_,R),e.add(R,E,R),e.negate(s,s),R=T[4],e.add(s,c,R),e.add(R,E,R),R=T[5],e.add(s,c,R),e.add(R,f,R),R=T[6],e.add(s,_,R),e.add(R,f,R),R=T[7],e.add(s,_,R),e.add(R,E,R);for(var h=T.length,A=0;A<h;++A){var d=T[A];e.add(o,d,d);var N=a.cartesianToCartographic(d,W);n.project(N,d)}i=l.fromPoints(T,i),o=i.center;var S=o.x,y=o.y,I=o.z;return o.x=I,o.y=S,o.z=y,i},l.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},l.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.distanceSquaredTo=function(e){return l.distanceSquaredTo(this,e)},l.prototype.computePlaneDistances=function(e,t,n){return l.computePlaneDistances(this,e,t,n)},l.prototype.isOccluded=function(e){return l.isOccluded(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.clone=function(e){return l.clone(this,e)},l}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(y)&&(y=!1,!l())){var e=/ Chrome\/([\.0-9]+)/.exec(S.userAgent);null!==e&&(y=!0,I=r(e[1]))}return y}function a(){return i()&&I}function o(){if(!t(p)&&(p=!1,!i()&&!l()&&/ Safari\/[\.0-9]+/.test(S.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(S.userAgent);null!==e&&(p=!0,m=r(e[1]))}return p}function u(){return o()&&m}function s(){if(!t(M)){M=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(S.userAgent);null!==e&&(M=!0,O=r(e[1]),O.isNightly=!!e[2])}return M}function E(){return s()&&O}function c(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===S.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(S.userAgent),null!==e&&(x=!0,C=r(e[1]))):"Netscape"===S.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(S.userAgent),null!==e&&(x=!0,C=r(e[1])))}return x}function _(){return c()&&C}function l(){if(!t(g)){g=!1;var e=/ Edge\/([\.0-9]+)/.exec(S.userAgent);null!==e&&(g=!0,v=r(e[1]))}return g}function f(){return l()&&v}function T(){ -if(!t(U)){U=!1;var e=/Firefox\/([\.0-9]+)/.exec(S.userAgent);null!==e&&(U=!0,L=r(e[1]))}return U}function R(){return t(w)||(w=/Windows/i.test(S.appVersion)),w}function h(){return T()&&L}function A(){return t(P)||(P="undefined"!=typeof PointerEvent&&(!t(S.pointerEnabled)||S.pointerEnabled)),P}function d(){if(!t(D)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;D=t(n)&&""!==n,D&&(F=n)}return D}function N(){return d()?F:void 0}var S;S="undefined"!=typeof navigator?navigator:{};var y,I,p,m,M,O,x,C,g,v,U,L,w,P,F,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:_,isEdge:l,edgeVersion:f,isFirefox:T,firefoxVersion:h,isWindows:R,hardwareConcurrency:e(S.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:N};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,i){i=i||2;var a=n&&n.length,o=a?n[0]*i:e.length,u=t(e,0,o,i,!0),E=[];if(!u)return E;var c,_,l,f,T,R,h;if(a&&(u=s(e,n,u,i)),e.length>80*i){c=l=e[0],_=f=e[1];for(var A=i;A<o;A+=i)T=e[A],R=e[A+1],T<c&&(c=T),R<_&&(_=R),T>l&&(l=T),R>f&&(f=R);h=Math.max(l-c,f-_)}return r(u,E,i,c,_,h),E}function t(e,t,n,r,i){var a,o;if(i===C(e,t,n,r)>0)for(a=t;a<n;a+=r)o=M(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=M(a,e[a],e[a+1],o);return o&&N(o,o.next)&&(O(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!N(r,r.next)&&0!==d(r.prev,r,r.next))r=r.next;else{if(O(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,E,c,_,f){if(e){!f&&_&&l(e,E,c,_);for(var T,R,h=e;e.prev!==e.next;)if(T=e.prev,R=e.next,_?a(e,E,c,_):i(e))t.push(T.i/s),t.push(e.i/s),t.push(R.i/s),O(e),e=R.next,h=R.next;else if(e=R,e===h){f?1===f?(e=o(e,t,s),r(e,t,s,E,c,_,2)):2===f&&u(e,t,s,E,c,_):r(n(e),t,s,E,c,_,1);break}}}function i(e){var t=e.prev,n=e,r=e.next;if(d(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(h(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&d(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(e,t,n,r){var i=e.prev,a=e,o=e.next;if(d(i,a,o)>=0)return!1;for(var u=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,s=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,E=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,_=T(u,s,t,n,r),l=T(E,c,t,n,r),f=e.nextZ;f&&f.z<=l;){if(f!==e.prev&&f!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&d(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=e.prevZ;f&&f.z>=_;){if(f!==e.prev&&f!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&d(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function o(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!N(i,a)&&S(i,r,r.next,a)&&I(i,a)&&I(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),O(r),O(r.next),r=e=a),r=r.next}while(r!==e);return r}function u(e,t,i,a,o,u){var s=e;do{for(var E=s.next.next;E!==s.prev;){if(s.i!==E.i&&A(s,E)){var c=m(s,E);return s=n(s,s.next),c=n(c,c.next),r(s,t,i,a,o,u),void r(c,t,i,a,o,u)}E=E.next}s=s.next}while(s!==e)}function s(e,r,i,a){var o,u,s,_,l,f=[];for(o=0,u=r.length;o<u;o++)s=r[o]*a,_=o<u-1?r[o+1]*a:e.length,l=t(e,s,_,a,!1),l===l.next&&(l.steiner=!0),f.push(R(l));for(f.sort(E),o=0;o<f.length;o++)c(f[o],i),i=n(i,i.next);return i}function E(e,t){return e.x-t.x}function c(e,t){if(t=_(e,t)){var r=m(t,e);n(r,r.next)}}function _(e,t){var n,r=t,i=e.x,a=e.y,o=-(1/0);do{if(a<=r.y&&a>=r.next.y){var u=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=i&&u>o){if(o=u,u===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var s,E=n,c=n.x,_=n.y,l=1/0;for(r=n.next;r!==E;)i>=r.x&&r.x>=c&&h(a<_?i:o,a,c,_,a<_?o:i,a,r.x,r.y)&&(s=Math.abs(a-r.y)/(i-r.x),(s<l||s===l&&r.x>n.x)&&I(r,e)&&(n=r,l=s)),r=r.next;return n}function l(e,t,n,r){var i=e;do null===i.z&&(i.z=T(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,f(i)}function f(e){var t,n,r,i,a,o,u,s,E=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,u=0,t=0;t<E&&(u++,r=r.nextZ,r);t++);for(s=E;u>0||s>0&&r;)0===u?(i=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,E*=2}while(o>1);return e}function T(e,t,n,r,i){return e=32767*(e-n)/i,t=32767*(t-r)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function R(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function h(e,t,n,r,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(a-u)-(i-o)*(r-u)>=0}function A(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!y(e,t)&&I(e,t)&&I(t,e)&&p(e,t)}function d(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function N(e,t){return e.x===t.x&&e.y===t.y}function S(e,t,n,r){return!!(N(e,t)&&N(n,r)||N(e,r)&&N(n,t))||d(e,t,n)>0!=d(e,t,r)>0&&d(n,r,e)>0!=d(n,r,t)>0}function y(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&S(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function I(e,t){return d(e.prev,e,e.next)<0?d(e,t,e.next)>=0&&d(e,e.prev,t)>=0:d(e,t,e.prev)<0||d(e,e.next,t)<0}function p(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function m(e,t){var n=new x(e.i,e.x,e.y),r=new x(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function M(e,t,n,r){var i=new x(e,t,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 O(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 x(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function C(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(C(e,0,a,n));if(i)for(var u=0,s=t.length;u<s;u++){var E=t[u]*n,c=u<s-1?t[u+1]*n:e.length;o-=Math.abs(C(e,E,c,n))}var _=0;for(u=0;u<r.length;u+=3){var l=r[u]*n,f=r[u+1]*n,T=r[u+2]*n;_+=Math.abs((e[l]-e[T])*(e[f+1]-e[l+1])-(e[l]-e[f])*(e[T+1]-e[l+1]))}return 0===o&&0===_?0:Math.abs((_-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[i][a][o]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},e}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var i=0;i<r;++i)o.pack(e[i],t,2*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var i=0;i<r;i+=2){var a=i/2;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o,c=new o;o.angleBetween=function(e,t){return o.normalize(e,E),o.normalize(t,c),a.acosClamped(o.dot(E,c))};var _=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)},o.ZERO=i(new o(0,0)),o.UNIT_X=i(new o(1,0)),o.UNIT_Y=i(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,E,c,_,l){"use strict";var f=new n,T=new n,R={};R.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++){var a=e[r],o=e[i];n+=a.x*o.y-o.x*a.y}return.5*n},R.computeWindingOrder2D=function(e){var t=R.computeArea2D(e);return t>0?l.COUNTER_CLOCKWISE:l.CLOCKWISE},R.triangulate=function(n,r){var i=t.packArray(n);return e(i,r,2)};var h=new n,A=new n,d=new n,N=new n,S=new n,y=new n,I=new n;return R.computeSubdivision=function(e,t,o,u){u=i(u,c.RADIANS_PER_DEGREE);var l,f=o.slice(0),T=t.length,R=new Array(3*T),p=0;for(l=0;l<T;l++){var m=t[l];R[p++]=m.x,R[p++]=m.y,R[p++]=m.z}for(var M=[],O={},x=e.maximumRadius,C=c.chordLength(u,x),g=C*C;f.length>0;){var v,U,L=f.pop(),w=f.pop(),P=f.pop(),F=n.fromArray(R,3*P,h),D=n.fromArray(R,3*w,A),B=n.fromArray(R,3*L,d),z=n.multiplyByScalar(n.normalize(F,N),x,N),G=n.multiplyByScalar(n.normalize(D,S),x,S),b=n.multiplyByScalar(n.normalize(B,y),x,y),X=n.magnitudeSquared(n.subtract(z,G,I)),q=n.magnitudeSquared(n.subtract(G,b,I)),V=n.magnitudeSquared(n.subtract(b,z,I)),H=Math.max(X,q,V);H>g?X===H?(v=Math.min(P,w)+" "+Math.max(P,w),l=O[v],a(l)||(U=n.add(F,D,I),n.multiplyByScalar(U,.5,U),R.push(U.x,U.y,U.z),l=R.length/3-1,O[v]=l),f.push(P,l,L),f.push(l,w,L)):q===H?(v=Math.min(w,L)+" "+Math.max(w,L),l=O[v],a(l)||(U=n.add(D,B,I),n.multiplyByScalar(U,.5,U),R.push(U.x,U.y,U.z),l=R.length/3-1,O[v]=l),f.push(w,l,P),f.push(l,L,P)):V===H&&(v=Math.min(L,P)+" "+Math.max(L,P),l=O[v],a(l)||(U=n.add(B,F,I),n.multiplyByScalar(U,.5,U),R.push(U.x,U.y,U.z),l=R.length/3-1,O[v]=l),f.push(L,l,w),f.push(l,P,w)):(M.push(P),M.push(w),M.push(L))}return new s({attributes:{position:new E({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:R})},indices:M,primitiveType:_.TRIANGLES})},R.scaleToGeodeticHeight=function(e,t,r,o){r=i(r,u.WGS84);var s=f,E=T;if(t=i(t,0),o=i(o,!0),a(e))for(var c=e.length,_=0;_<c;_+=3)n.fromArray(e,_,E),o&&(E=r.scaleToGeodeticSurface(E,E)),0!==t&&(s=r.geodeticSurfaceNormal(E,s),n.multiplyByScalar(s,t,s),n.add(E,s,E)),e[_]=E.x,e[_+1]=E.y,e[_+2]=E.z;return e},R}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./freezeObject"],function(e,t,n,r,i,a){"use strict";function o(e,t,r,i){this[0]=n(e,0),this[1]=n(r,0),this[2]=n(t,0),this[3]=n(i,0)}o.packedLength=4,o.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t},o.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new o),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i},o.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new o(e[0],e[2],e[1],e[3])},o.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new o),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i},o.fromColumnMajorArray=function(e,t){return o.clone(e,t)},o.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new o(e[0],e[1],e[2],e[3])},o.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new o(e.x,0,0,e.y)},o.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new o(e,0,0,e)},o.fromRotation=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n, -t[1]=i,t[2]=-i,t[3]=n,t):new o(n,-i,i,n)},o.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},o.getElementIndex=function(e,t){return 2*e+t},o.getColumn=function(e,t,n){var r=2*t,i=e[r],a=e[r+1];return n.x=i,n.y=a,n},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var i=2*t;return r[i]=n.x,r[i+1]=n.y,r},o.getRow=function(e,t,n){var r=e[t],i=e[t+2];return n.x=r,n.y=i,n},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+2]=n.y,r};var u=new e;o.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],u)),n.y=e.magnitude(e.fromElements(t[2],t[3],u)),n};var s=new e;return o.getMaximumScale=function(t){return o.getScale(t,s),e.maximumComponent(s)},o.multiply=function(e,t,n){var r=e[0]*t[0]+e[2]*t[1],i=e[0]*t[2]+e[2]*t[3],a=e[1]*t[0]+e[3]*t[1],o=e[1]*t[2]+e[3]*t[3];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n},o.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},o.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},o.multiplyByVector=function(e,t,n){var r=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=r,n.y=i,n},o.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},o.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},o.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},o.transpose=function(e,t){var n=e[0],r=e[2],i=e[1],a=e[3];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t},o.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},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},o.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},o.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n},o.IDENTITY=a(new o(1,0,0,1)),o.ZERO=a(new o(0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,i(o.prototype,{length:{get:function(){return o.packedLength}}}),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},o}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,n,r,i,a,o,u){"use strict";function s(t,n,r,i,a,u,s){var E=Math.cos(n),c=i*E,_=r*E,l=Math.sin(n),R=i*l,d=r*l;T=A.project(t,T),T=e.subtract(T,h,T);var N=o.fromRotation(n,f);T=o.multiplyByVector(N,T,T),T=e.add(T,h,T),t=A.unproject(T,t),u-=1,s-=1;var S=t.latitude,y=S+u*d,I=S-c*s,p=S-c*s+u*d,m=Math.max(S,y,I,p),M=Math.min(S,y,I,p),O=t.longitude,x=O+u*_,C=O+s*R,g=O+s*R+u*_,v=Math.max(O,x,C,g),U=Math.min(O,x,C,g);return{north:m,south:M,east:v,west:U,granYCos:c,granYSin:R,granXCos:_,granXSin:d,nwCorner:t}}var E=Math.cos,c=Math.sin,_=Math.sqrt,l={};l.computePosition=function(e,t,r,i,a){var o=e.ellipsoid.radiiSquared,u=e.nwCorner,s=e.rectangle,l=u.latitude-e.granYCos*t+r*e.granXSin,f=E(l),T=c(l),R=o.z*T,h=u.longitude+t*e.granYSin+r*e.granXCos,A=f*E(h),d=f*c(h),N=o.x*A,S=o.y*d,y=_(N*A+S*d+R*T);if(i.x=N/y,i.y=S/y,i.z=R/y,n(e.vertexFormat)&&e.vertexFormat.st){var I=e.stNwCorner;n(I)?(l=I.latitude-e.stGranYCos*t+r*e.stGranXSin,h=I.longitude+t*e.stGranYSin+r*e.stGranXCos,a.x=(h-e.stWest)*e.lonScalar,a.y=(l-e.stSouth)*e.latScalar):(a.x=(h-s.west)*e.lonScalar,a.y=(l-s.south)*e.latScalar)}};var f=new o,T=new e,R=new t,h=new e,A=new i;return l.computeOptions=function(e,t,n,r){var i,o,E,c,_,l=e._granularity,f=e._ellipsoid,T=e._surfaceHeight,d=e._rotation,N=e._stRotation,S=e._extrudedHeight,y=t.east,I=t.west,p=t.north,m=t.south,M=p-m;I>y?(_=a.TWO_PI-I+y,i=Math.ceil(_/l)+1,o=Math.ceil(M/l)+1,E=_/(i-1),c=M/(o-1)):(_=y-I,i=Math.ceil(_/l)+1,o=Math.ceil(M/l)+1,E=_/(i-1),c=M/(o-1)),n=u.northwest(t,n);var O=u.center(t,R);0===d&&0===N||(O.longitude<n.longitude&&(O.longitude+=a.TWO_PI),h=A.project(O,h));var x=c,C=E,g=0,v=0,U={granYCos:x,granYSin:g,granXCos:C,granXSin:v,ellipsoid:f,surfaceHeight:T,extrudedHeight:S,nwCorner:n,rectangle:t,width:i,height:o};if(0!==d){var L=s(n,d,E,c,O,i,o);p=L.north,m=L.south,y=L.east,I=L.west,U.granYCos=L.granYCos,U.granYSin=L.granYSin,U.granXCos=L.granXCos,U.granXSin=L.granXSin,t.north=p,t.south=m,t.east=y,t.west=I}if(0!==N){d-=N,r=u.northwest(t,r);var w=s(r,d,E,c,O,i,o);U.stGranYCos=w.granYCos,U.stGranXCos=w.granXCos,U.stGranYSin=w.granYSin,U.stGranXSin=w.granXSin,U.stNwCorner=r,U.stWest=w.west,U.stSouth=w.south}return U},l}),define("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,n,r,i,a,o,u,s,E,c,_,l,f,T,R,h){"use strict";function A(e){var t,n=e.size,i=e.height,a=e.width,o=new Float64Array(3*n),u=0,l=0,f=I;for(t=0;t<a;t++)h.computePosition(e,l,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(t=a-1,l=1;l<i;l++)h.computePosition(e,l,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(l=i-1,t=a-2;t>=0;t--)h.computePosition(e,l,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(t=0,l=i-2;l>0;l--)h.computePosition(e,l,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(var R=o.length/3*2,A=_.createTypedArray(o.length/3,R),d=0,N=0;N<o.length/3-1;N++)A[d++]=N,A[d++]=N+1;A[d++]=o.length/3-1,A[d++]=0;var S=new s({attributes:new c,primitiveType:T.LINES});return S.attributes.position=new E({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:o}),S.indices=A,S}function d(e){var t=e.surfaceHeight,n=e.extrudedHeight,r=e.ellipsoid,i=Math.min(n,t),a=Math.max(n,t),o=A(e);if(l.equalsEpsilon(i,a,l.EPSILON10))return o;var u=e.height,s=e.width,E=f.scaleToGeodeticHeight(o.attributes.position.values,a,r,!1),c=E.length,T=new Float64Array(2*c);T.set(E);var R=f.scaleToGeodeticHeight(o.attributes.position.values,i,r);T.set(R,c),o.attributes.position.values=T;var h=T.length/3*2+8,d=_.createTypedArray(T.length/3,h);c=T.length/6;for(var N=0,S=0;S<c-1;S++)d[N++]=S,d[N++]=S+1,d[N++]=S+c,d[N++]=S+c+1;return d[N++]=c-1,d[N++]=0,d[N++]=c+c-1,d[N++]=c,d[N++]=0,d[N++]=c,d[N++]=s-1,d[N++]=c+s-1,d[N++]=s+u-2,d[N++]=s+u-2+c,d[N++]=2*s+u-3,d[N++]=2*s+u-3+c,o.indices=d,o}function N(e){e=i(e,i.EMPTY_OBJECT);var t=e.rectangle,n=i(e.granularity,l.RADIANS_PER_DEGREE),r=i(e.ellipsoid,u.WGS84),a=i(e.height,0),o=i(e.rotation,0),s=e.extrudedHeight;this._rectangle=t,this._granularity=n,this._ellipsoid=r,this._surfaceHeight=a,this._rotation=o,this._extrudedHeight=s,this._workerName="createRectangleOutlineGeometry"}var S=new e,y=new e,I=new t,p=new R;N.packedLength=R.packedLength+u.packedLength+5,N.pack=function(e,t,n){return n=i(n,0),R.pack(e._rectangle,t,n),n+=R.packedLength,u.pack(e._ellipsoid,t,n),n+=u.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=a(e._extrudedHeight)?1:0,t[n]=i(e._extrudedHeight,0),t};var m=new R,M=u.clone(u.UNIT_SPHERE),O={rectangle:m,ellipsoid:M,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};N.unpack=function(e,t,n){t=i(t,0);var r=R.unpack(e,t,m);t+=R.packedLength;var o=u.unpack(e,t,M);t+=u.packedLength;var s=e[t++],E=e[t++],c=e[t++],_=e[t++],l=e[t];return a(n)?(n._rectangle=R.clone(r,n._rectangle),n._ellipsoid=u.clone(o,n._ellipsoid),n._surfaceHeight=E,n._rotation=c,n._extrudedHeight=_?l:void 0,n):(O.granularity=s,O.height=E,O.rotation=c,O.extrudedHeight=_?l:void 0,new N(O))};var x=new n;return N.createGeometry=function(t){var n=R.clone(t._rectangle,p),r=t._ellipsoid,i=t._surfaceHeight,o=t._extrudedHeight,u=h.computeOptions(t,n,x);u.size=2*u.width+2*u.height-4;var E,c;if(n=t._rectangle,!l.equalsEpsilon(n.north,n.south,l.EPSILON10)&&!l.equalsEpsilon(n.east,n.west,l.EPSILON10)){if(a(o)){E=d(u);var _=e.fromRectangle3D(n,r,i,y),N=e.fromRectangle3D(n,r,o,S);c=e.union(_,N)}else E=A(u),E.attributes.position.values=f.scaleToGeodeticHeight(E.attributes.position.values,i,r,!1),c=e.fromRectangle3D(n,r,i);return new s({attributes:E.attributes,indices:E.indices,primitiveType:T.LINES,boundingSphere:c})}},N}),define("Workers/createRectangleOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/Rectangle","../Core/RectangleOutlineGeometry"],function(e,t,n,r){"use strict";function i(i,a){return e(a)&&(i=r.unpack(i,a)),i._ellipsoid=t.clone(i._ellipsoid),i._rectangle=n.clone(i._rectangle),r.createGeometry(i)}return i})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),s=u*Math.sin(a);return r.x=s*Math.cos(i),r.y=s*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,E),o.normalize(t,c);var n=o.dot(E,c),r=o.magnitude(o.cross(E,c,E));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,s=t.z,E=i*s-a*u,c=a*o-r*s,_=r*u-i*o;return n.x=E,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var l=new o,f=new o,T=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var s=n(a)?a.radiiSquared:T,E=Math.cos(r);l.x=E*Math.cos(e),l.y=E*Math.sin(e),l.z=Math.sin(r),l=o.normalize(l,l),o.multiplyComponents(s,l,f);var c=Math.sqrt(o.dot(l,f));return f=o.divideByScalar(f,c,f),l=o.multiplyByScalar(l,i,l),n(u)||(u=new o),o.add(f,l,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromDegrees(u,s,0,t,r[E])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],s=e[a+1],E=a/2;r[E]=o.fromRadians(u,s,0,t,r[E])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromDegrees(u,s,E,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],s=e[a+1],E=e[a+2],c=a/3;r[c]=o.fromRadians(u,s,E,t,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,s,E){var c=n.x,_=n.y,l=n.z,f=i.x,T=i.y,R=i.z,h=c*c*f*f,A=_*_*T*T,d=l*l*R*R,N=h+A+d,S=Math.sqrt(1/N),y=e.multiplyByScalar(n,S,a);if(N<s)return isFinite(S)?e.clone(y,E):void 0;var I=u.x,p=u.y,m=u.z,M=o;M.x=y.x*I*2,M.y=y.y*p*2,M.z=y.z*m*2;var O,x,C,g,v,U,L,w,P,F,D,B=(1-S)*e.magnitude(n)/(.5*e.magnitude(M)),z=0;do{B-=z,C=1/(1+B*I),g=1/(1+B*p),v=1/(1+B*m),U=C*C,L=g*g,w=v*v,P=U*C,F=L*g,D=w*v,O=h*U+A*L+d*w-1,x=h*P*I+A*F*p+d*D*m;var G=-2*x;z=O/G}while(Math.abs(O)>r.EPSILON12);return t(E)?(E.x=c*C,E.y=_*g,E.z=l*v,E):new e(c*C,_*g,l*v)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,i,a){return i=n(i,0),r(a)?(a.longitude=e,a.latitude=t,a.height=i,a):new u(e,t,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,E=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),l=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),f=a.EPSILON1;return u.fromCartesian=function(t,n,i){var T=r(n)?n.oneOverRadii:_,R=r(n)?n.oneOverRadiiSquared:l,h=r(n)?n._centerToleranceSquared:f,A=o(t,T,R,h,E);if(r(A)){var d=e.multiplyComponents(A,R,s);d=e.normalize(d,d);var N=e.subtract(t,A,c),S=Math.atan2(d.y,d.x),y=Math.asin(d.z),I=a.sign(e.dot(N,t))*e.magnitude(N);return r(i)?(i.longitude=S,i.latitude=y,i.height=I,i):new u(S,y,I)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,s){"use strict";function E(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,E(this,e,t,n)}i(c.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}}}),c.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(E(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),s=o*Math.sin(i),E=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=s,n.z=E,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,l=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=l;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var f=new e,T=new e,R=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,T);if(r(a)){var o=this.geodeticSurfaceNormal(a,f),s=e.subtract(n,a,R),E=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(s,n))*e.magnitude(s);return r(i)?(i.longitude=E,i.latitude=c,i.height=_,i):new t(E,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,i,a,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new s(e,t,i,a)},s.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new s(e,t,i,a)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,E=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,l=e.length;_<l;_++){var f=e[_];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),E=Math.min(E,f.latitude),c=Math.max(c,f.latitude);var T=f.longitude>=0?f.longitude:f.longitude+u.TWO_PI;a=Math.min(a,T),o=Math.max(o,T)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=E,t.east=i,t.north=c,t):new s(n,E,i,c)},s.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,E=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,l=0,f=e.length;l<f;l++){var T=t.cartesianToCartographic(e[l]);i=Math.min(i,T.longitude),a=Math.max(a,T.longitude),c=Math.min(c,T.latitude),_=Math.max(_,T.latitude);var R=T.longitude>=0?T.longitude:T.longitude+u.TWO_PI;o=Math.min(o,R),E=Math.max(E,R)}return a-i>E-o&&(i=o,a=E,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new s(i,c,a,_)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,E)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var l=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(l>=f))return r(n)?(n.west=c,n.south=l,n.east=_,n.north=f,n):new s(c,l,_,f)}},s.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new s(i,a,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var i=e.east,a=e.west,o=t.east,E=t.west;i<a&&o>0?i+=u.TWO_PI:o<E&&i>0&&(o+=u.TWO_PI),i<a&&E<0?E+=u.TWO_PI:o<E&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,E)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var E=new e;return s.subsample=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=e.north,l=e.south,f=e.east,T=e.west,R=E;R.height=i,R.longitude=T,R.latitude=_,o[c]=t.cartographicToCartesian(R,o[c]),c++,R.longitude=f,o[c]=t.cartographicToCartesian(R,o[c]),c++,R.latitude=l,o[c]=t.cartographicToCartesian(R,o[c]),c++,R.longitude=T,o[c]=t.cartographicToCartesian(R,o[c]),c++,_<0?R.latitude=_:l>0?R.latitude=l:R.latitude=0;for(var h=1;h<8;++h)R.longitude=-Math.PI+h*u.PI_OVER_TWO,s.contains(e,R)&&(o[c]=t.cartographicToCartesian(R,o[c]),c++);return 0===R.latitude&&(R.longitude=T,o[c]=t.cartographicToCartesian(R,o[c]),c++,R.longitude=f,o[c]=t.cartographicToCartesian(R,o[c]),c++),o.length=c,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function s(e,t,r,i,a,o,u,s,E){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(E,0)}function E(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(R[n],T[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[s.getElementIndex(R[a],T[a])]);o>r&&(i=a,r=o)}var E=1,c=0,_=T[i],l=R[i];if(Math.abs(e[s.getElementIndex(l,_)])>n){var f,h=e[s.getElementIndex(l,l)],A=e[s.getElementIndex(_,_)],d=e[s.getElementIndex(l,_)],N=(h-A)/2/d;f=N<0?-1/(-N+Math.sqrt(1+N*N)):1/(N+Math.sqrt(1+N*N)),E=1/Math.sqrt(1+f*f),c=f*E}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(_,_)]=t[s.getElementIndex(l,l)]=E,t[s.getElementIndex(l,_)]=c,t[s.getElementIndex(_,l)]=-c,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new s),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,E=e.y*e.z,c=e.y*e.w,_=e.z*e.z,l=e.z*e.w,f=e.w*e.w,T=n-u-_+f,R=2*(i-l),h=2*(a+c),A=2*(i+l),d=-n+u-_+f,N=2*(E-o),S=2*(a-c),y=2*(E+o),I=-n-u+_+f;return r(t)?(t[0]=T,t[1]=A,t[2]=S,t[3]=R,t[4]=d,t[5]=y,t[6]=h,t[7]=N,t[8]=I,t):new s(T,R,h,A,d,N,S,y,I)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),E=Math.sin(e.roll),c=n*i,_=-a*u+E*o*i,l=E*u+a*o*i,f=n*u,T=a*i+E*o*u,R=-E*i+a*o*u,h=-o,A=E*n,d=a*n;return r(t)?(t[0]=c,t[1]=f,t[2]=h,t[3]=_,t[4]=T,t[5]=A,t[6]=l,t[7]=R,t[8]=d,t):new s(c,_,l,f,T,R,h,A,d)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new s(1,0,0,0,n,-i,0,i,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new s(n,0,i,0,1,0,-i,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-i,0,i,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var l=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],l)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],l)),n};var f=new e;s.getMaximumScale=function(t){return s.getScale(t,f),e.maximumComponent(f)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],E=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=s,n[6]=E,n[7]=c,n[8]=_,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,s=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],s=e[2],E=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=s,t[7]=E,t[8]=c,t};var T=[1,0,0],R=[2,2,1],h=new s,A=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var l=t.unitary=s.clone(s.IDENTITY,t.unitary),f=t.diagonal=s.clone(e,t.diagonal),T=n*E(f);o<i&&c(f)>T;)_(f,h),s.transpose(h,A),s.multiply(f,h,f),s.multiply(A,f,f),s.multiply(l,h,l),++a>2&&(++o,a=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],s=e[5],E=e[8];return t*(a*E-s*o)+i*(s*r-n*E)+u*(n*o-a*r)},s.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],E=e[6],c=e[7],_=e[8],l=s.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=E*u-a*_,t[4]=n*_-E*i,t[5]=a*i-n*u,t[6]=a*c-E*o,t[7]=E*r-n*c,t[8]=n*o-a*r;var f=1/l;return s.multiplyByScalar(t,f,t)},s.equals=function(e,t){ +return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,i(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,E);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,s,E){"use strict";function c(e,t,n,i,a,o,u,s,E,c,_,l,f,T,R,h){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(E,0),this[3]=r(f,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(T,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(R,0),this[12]=r(i,0),this[13]=r(s,0),this[14]=r(l,0),this[15]=r(h,0)}c.packedLength=16,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},c.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new c),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},c.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,s=t.x*t.x,E=t.x*t.y,_=t.x*t.z,l=t.x*t.w,f=t.y*t.y,T=t.y*t.z,R=t.y*t.w,h=t.z*t.z,A=t.z*t.w,d=t.w*t.w,N=s-f-h+d,S=2*(E-A),y=2*(_+R),I=2*(E+A),p=-s+f-h+d,m=2*(T-l),M=2*(_-R),O=2*(T+l),x=-s-f+h+d;return r[0]=N*a,r[1]=I*a,r[2]=M*a,r[3]=0,r[4]=S*o,r[5]=p*o,r[6]=O*o,r[7]=0,r[8]=y*u,r[9]=m*u,r[10]=x*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(s.IDENTITY,e,t)},c.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,l=new e,f=new e;c.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,l),l),e.normalize(e.cross(l,_,f),f);var u=l.x,s=l.y,E=l.z,T=_.x,R=_.y,h=_.z,A=f.x,d=f.y,N=f.z,S=r.x,y=r.y,I=r.z,p=u*-S+s*-y+E*-I,m=A*-S+d*-y+N*-I,M=T*S+R*y+h*I;return i(n)?(n[0]=u,n[1]=A,n[2]=-T,n[3]=0,n[4]=s,n[5]=d,n[6]=-R,n[7]=0,n[8]=E,n[9]=N,n[10]=-h,n[11]=0,n[12]=p,n[13]=m,n[14]=M,n[15]=1,n):new c(u,s,E,p,A,d,N,m,-T,-R,-h,M,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,s=(r+n)/(n-r),E=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=-1,i[12]=0,i[13]=0,i[14]=E,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),s=1/(r-n),E=1/(a-i),c=-(t+e)*u,_=-(r+n)*s,l=-(a+i)*E;return u*=2,s*=2,E*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=E,o[11]=0,o[12]=c,o[13]=_,o[14]=l,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),s=2*i/(r-n),E=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),l=-1,f=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=E,o[9]=c,o[10]=_,o[11]=l,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),s=(t+e)/(t-e),E=(r+n)/(r-n),c=-1,_=-1,l=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=s,a[9]=E,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=l,a[15]=0,a},c.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var E=.5*u,c=.5*s,_=.5*(n-t),l=E,f=c,T=_,R=a+E,h=o+c,A=t+_,d=1;return i[0]=l,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=f,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=T,i[11]=0,i[12]=R,i[13]=h,i[14]=A,i[15]=d,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},c.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var T=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],T)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],T)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],T)),n};var R=new e;c.getMaximumScale=function(t){return c.getScale(t,R),e.maximumComponent(R)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],s=e[5],E=e[6],c=e[7],_=e[8],l=e[9],f=e[10],T=e[11],R=e[12],h=e[13],A=e[14],d=e[15],N=t[0],S=t[1],y=t[2],I=t[3],p=t[4],m=t[5],M=t[6],O=t[7],x=t[8],C=t[9],g=t[10],v=t[11],U=t[12],L=t[13],w=t[14],P=t[15],F=r*N+u*S+_*y+R*I,D=i*N+s*S+l*y+h*I,B=a*N+E*S+f*y+A*I,z=o*N+c*S+T*y+d*I,G=r*p+u*m+_*M+R*O,b=i*p+s*m+l*M+h*O,X=a*p+E*m+f*M+A*O,q=o*p+c*m+T*M+d*O,V=r*x+u*C+_*g+R*v,H=i*x+s*C+l*g+h*v,W=a*x+E*C+f*g+A*v,Y=o*x+c*C+T*g+d*v,k=r*U+u*L+_*w+R*P,Z=i*U+s*L+l*w+h*P,K=a*U+E*L+f*w+A*P,j=o*U+c*L+T*w+d*P;return n[0]=F,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=q,n[8]=V,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=Z,n[14]=K,n[15]=j,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=e[12],f=e[13],T=e[14],R=t[0],h=t[1],A=t[2],d=t[4],N=t[5],S=t[6],y=t[8],I=t[9],p=t[10],m=t[12],M=t[13],O=t[14],x=r*R+o*h+E*A,C=i*R+u*h+c*A,g=a*R+s*h+_*A,v=r*d+o*N+E*S,U=i*d+u*N+c*S,L=a*d+s*N+_*S,w=r*y+o*I+E*p,P=i*y+u*I+c*p,F=a*y+s*I+_*p,D=r*m+o*M+E*O+l,B=i*m+u*M+c*O+f,z=a*m+s*M+_*O+T;return n[0]=x,n[1]=C,n[2]=g,n[3]=0,n[4]=v,n[5]=U,n[6]=L,n[7]=0,n[8]=w,n[9]=P,n[10]=F,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],s=e[6],E=e[8],c=e[9],_=e[10],l=t[0],f=t[1],T=t[2],R=t[3],h=t[4],A=t[5],d=t[6],N=t[7],S=t[8],y=r*l+o*f+E*T,I=i*l+u*f+c*T,p=a*l+s*f+_*T,m=r*R+o*h+E*A,M=i*R+u*h+c*A,O=a*R+s*h+_*A,x=r*d+o*N+E*S,C=i*d+u*N+c*S,g=a*d+s*N+_*S;return n[0]=y,n[1]=I,n[2]=p,n[3]=0,n[4]=m,n[5]=M,n[6]=O,n[7]=0,n[8]=x,n[9]=C,n[10]=g,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],s=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var h=new e;c.multiplyByUniformScale=function(e,t,n){return h.x=t,h.y=t,h.z=t,c.multiplyByScale(e,h,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,s=e[1]*r+e[5]*i+e[9]*a+e[13]*o,E=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=s,n.z=E,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,s=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=s,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],s=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=s,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var A=new s,d=new s,N=new t,S=new t(0,0,0,1);return c.inverse=function(e,n){if(s.equalsEpsilon(c.getRotation(e,A),d,u.EPSILON7)&&t.equals(c.getRow(e,3,N),S))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],l=e[5],f=e[9],T=e[13],R=e[2],h=e[6],y=e[10],I=e[14],p=e[3],m=e[7],M=e[11],O=e[15],x=y*O,C=I*M,g=h*O,v=I*m,U=h*M,L=y*m,w=R*O,P=I*p,F=R*M,D=y*p,B=R*m,z=h*p,G=x*l+v*f+U*T-(C*l+g*f+L*T),b=C*_+w*f+D*T-(x*_+P*f+F*T),X=g*_+P*l+B*T-(v*_+w*l+z*T),q=L*_+F*l+z*f-(U*_+D*l+B*f),V=C*i+g*a+L*o-(x*i+v*a+U*o),H=x*r+P*a+F*o-(C*r+w*a+D*o),W=v*r+w*i+z*o-(g*r+P*i+B*o),Y=U*r+D*i+B*a-(L*r+F*i+z*a);x=a*T,C=o*f,g=i*T,v=o*l,U=i*f,L=a*l,w=r*T,P=o*_,F=r*f,D=a*_,B=r*l,z=i*_;var k=x*m+v*M+U*O-(C*m+g*M+L*O),Z=C*p+w*M+D*O-(x*p+P*M+F*O),K=g*p+P*m+B*O-(v*p+w*m+z*O),j=L*p+F*m+z*M-(U*p+D*m+B*M),Q=g*y+L*I+C*h-(U*I+x*h+v*y),J=F*I+x*R+P*y-(w*y+D*I+C*R),$=w*h+z*I+v*R-(B*I+g*R+P*h),ee=B*y+U*R+D*h-(F*h+z*y+L*R),te=r*G+i*b+a*X+o*q;if(Math.abs(te)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=G*te,n[1]=b*te,n[2]=X*te,n[3]=q*te,n[4]=V*te,n[5]=H*te,n[6]=W*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=K*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],s=e[8],E=e[9],c=e[10],_=e[12],l=e[13],f=e[14],T=-n*_-r*l-i*f,R=-a*_-o*l-u*f,h=-s*_-E*l-c*f;return t[0]=n,t[1]=a,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=E,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=T,t[13]=R,t[14]=h,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,s,E,c,_){"use strict";function l(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var f=new e,T=new e,R=new e,h=new e,A=new e,d=new e,N=new e,S=new e,y=new e,I=new e,p=new e,m=new e;l.fromPoints=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],N),a=e.clone(r,f),o=e.clone(r,T),u=e.clone(r,R),s=e.clone(r,h),E=e.clone(r,A),c=e.clone(r,d),_=t.length,M=1;M<_;M++){e.clone(t[M],r);var O=r.x,x=r.y,C=r.z;O<a.x&&e.clone(r,a),O>s.x&&e.clone(r,s),x<o.y&&e.clone(r,o),x>E.y&&e.clone(r,E),C<u.z&&e.clone(r,u),C>c.z&&e.clone(r,c)}var g=e.magnitudeSquared(e.subtract(s,a,S)),v=e.magnitudeSquared(e.subtract(E,o,S)),U=e.magnitudeSquared(e.subtract(c,u,S)),L=a,w=s,P=g;v>P&&(P=v,L=o,w=E),U>P&&(P=U,L=u,w=c);var F=y;F.x=.5*(L.x+w.x),F.y=.5*(L.y+w.y),F.z=.5*(L.z+w.z);var D=e.magnitudeSquared(e.subtract(w,F,S)),B=Math.sqrt(D),z=I;z.x=a.x,z.y=o.y,z.z=u.z;var G=p;G.x=s.x,G.y=E.y,G.z=c.z;var b=e.multiplyByScalar(e.add(z,G,S),.5,m),X=0;for(M=0;M<_;M++){e.clone(t[M],r);var q=e.magnitude(e.subtract(r,b,S));q>X&&(X=q);var V=e.magnitudeSquared(e.subtract(r,F,S));if(V>D){var H=Math.sqrt(V);B=.5*(B+H),D=B*B;var W=H-B;F.x=(B*F.x+W*r.x)/H,F.y=(B*F.y+W*r.y)/H,F.z=(B*F.z+W*r.z)/H}}return B<X?(e.clone(F,n.center),n.radius=B):(e.clone(b,n.center),n.radius=X),n};var M=new o,O=new e,x=new e,C=new t,g=new t;l.fromRectangle2D=function(e,t,n){return l.fromRectangleWithHeights2D(e,t,0,0,n)},l.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new l),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,M),_.southwest(t,C),C.height=a,_.northeast(t,g),g.height=o;var s=n.project(C,O),E=n.project(g,x),c=E.x-s.x,f=E.y-s.y,T=E.z-s.z;u.radius=.5*Math.sqrt(c*c+f*f+T*T);var R=u.center;return R.x=s.x+.5*c,R.y=s.y+.5*f,R.z=s.z+.5*T,u};var v=[];l.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,v)),l.fromPoints(u,o)},l.fromVertices=function(t,n,a,o){if(i(o)||(o=new l),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=N;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,f),E=e.clone(u,T),c=e.clone(u,R),_=e.clone(u,h),M=e.clone(u,A),O=e.clone(u,d),x=t.length,C=0;C<x;C+=a){var g=t[C]+n.x,v=t[C+1]+n.y,U=t[C+2]+n.z;u.x=g,u.y=v,u.z=U,g<s.x&&e.clone(u,s),g>_.x&&e.clone(u,_),v<E.y&&e.clone(u,E),v>M.y&&e.clone(u,M),U<c.z&&e.clone(u,c),U>O.z&&e.clone(u,O)}var L=e.magnitudeSquared(e.subtract(_,s,S)),w=e.magnitudeSquared(e.subtract(M,E,S)),P=e.magnitudeSquared(e.subtract(O,c,S)),F=s,D=_,B=L;w>B&&(B=w,F=E,D=M),P>B&&(B=P,F=c,D=O);var z=y;z.x=.5*(F.x+D.x),z.y=.5*(F.y+D.y),z.z=.5*(F.z+D.z);var G=e.magnitudeSquared(e.subtract(D,z,S)),b=Math.sqrt(G),X=I;X.x=s.x,X.y=E.y,X.z=c.z;var q=p;q.x=_.x,q.y=M.y,q.z=O.z;var V=e.multiplyByScalar(e.add(X,q,S),.5,m),H=0;for(C=0;C<x;C+=a){u.x=t[C]+n.x,u.y=t[C+1]+n.y,u.z=t[C+2]+n.z;var W=e.magnitude(e.subtract(u,V,S));W>H&&(H=W);var Y=e.magnitudeSquared(e.subtract(u,z,S));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var Z=k-b;z.x=(b*z.x+Z*u.x)/k,z.y=(b*z.y+Z*u.y)/k,z.z=(b*z.z+Z*u.z)/k}}return b<H?(e.clone(z,o.center),o.radius=b):(e.clone(V,o.center),o.radius=H),o},l.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new l),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=N;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,f),u=e.clone(a,T),s=e.clone(a,R),E=e.clone(a,h),c=e.clone(a,A),_=e.clone(a,d),M=t.length,O=0;O<M;O+=3){var x=t[O]+n[O],C=t[O+1]+n[O+1],g=t[O+2]+n[O+2];a.x=x,a.y=C,a.z=g,x<o.x&&e.clone(a,o),x>E.x&&e.clone(a,E),C<u.y&&e.clone(a,u),C>c.y&&e.clone(a,c),g<s.z&&e.clone(a,s),g>_.z&&e.clone(a,_)}var v=e.magnitudeSquared(e.subtract(E,o,S)),U=e.magnitudeSquared(e.subtract(c,u,S)),L=e.magnitudeSquared(e.subtract(_,s,S)),w=o,P=E,F=v;U>F&&(F=U,w=u,P=c),L>F&&(F=L,w=s,P=_);var D=y;D.x=.5*(w.x+P.x),D.y=.5*(w.y+P.y),D.z=.5*(w.z+P.z);var B=e.magnitudeSquared(e.subtract(P,D,S)),z=Math.sqrt(B),G=I;G.x=o.x,G.y=u.y,G.z=s.z;var b=p;b.x=E.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(G,b,S),.5,m),q=0;for(O=0;O<M;O+=3){a.x=t[O]+n[O],a.y=t[O+1]+n[O+1],a.z=t[O+2]+n[O+2];var V=e.magnitude(e.subtract(a,X,S));V>q&&(q=V);var H=e.magnitudeSquared(e.subtract(a,D,S));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*a.x)/W,D.y=(z*D.y+Y*a.y)/W,D.z=(z*D.z+Y*a.z)/W}}return z<q?(e.clone(D,r.center),r.radius=z):(e.clone(X,r.center),r.radius=q),r},l.fromCornerPoints=function(t,n,r){i(r)||(r=new l);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},l.fromEllipsoid=function(t,n){return i(n)||(n=new l),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var U=new e;l.fromBoundingSpheres=function(t,n){if(i(n)||(n=new l),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return l.clone(t[0],n);if(2===r)return l.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=l.fromPoints(a,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var E=t[o];s=Math.max(s,e.distance(u,E.center,U)+E.radius)}return n.radius=s,n};var L=new e,w=new e,P=new e;l.fromOrientedBoundingBox=function(t,n){i(n)||(n=new l);var r=t.halfAxes,a=E.getColumn(r,0,L),o=E.getColumn(r,1,w),u=E.getColumn(r,2,P);return e.add(a,o,a),e.add(a,u,a),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(a),n},l.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new l(t.center,t.radius)},l.packedLength=4,l.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},l.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new l);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var F=new e,D=new e;l.union=function(t,n,r){i(r)||(r=new l);var a=t.center,o=t.radius,u=n.center,s=n.radius,E=e.subtract(u,a,F),c=e.magnitude(E);if(o>=c+s)return t.clone(r),r;if(s>=c+o)return n.clone(r),r;var _=.5*(o+c+s),f=e.multiplyByScalar(E,(-o+_)/c,D);return e.add(f,a,f),e.clone(f,r.center),r.radius=_,r};var B=new e;l.expand=function(t,n,r){r=l.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,B));return i>r.radius&&(r.radius=i),r},l.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},l.transform=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var z=new e;l.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},l.transformWithoutScale=function(e,t,n){return i(n)||(n=new l),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var G=new e;l.computePlaneDistances=function(t,n,r,a){i(a)||(a=new s);var o=e.subtract(t.center,n,G),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,q=new e,V=new e,H=new e,W=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return l.projectTo2D=function(t,n,i){n=r(n,Z);var a=n.ellipsoid,o=t.center,u=t.radius,s=a.geodeticSurfaceNormal(o,b),E=e.cross(e.UNIT_Z,s,X);e.normalize(E,E);var c=e.cross(s,E,q);e.normalize(c,c),e.multiplyByScalar(s,u,s),e.multiplyByScalar(c,u,c),e.multiplyByScalar(E,u,E);var _=e.negate(c,H),f=e.negate(E,V),T=Y,R=T[0];e.add(s,c,R),e.add(R,E,R),R=T[1],e.add(s,c,R),e.add(R,f,R),R=T[2],e.add(s,_,R),e.add(R,f,R),R=T[3],e.add(s,_,R),e.add(R,E,R),e.negate(s,s),R=T[4],e.add(s,c,R),e.add(R,E,R),R=T[5],e.add(s,c,R),e.add(R,f,R),R=T[6],e.add(s,_,R),e.add(R,f,R),R=T[7],e.add(s,_,R),e.add(R,E,R);for(var h=T.length,A=0;A<h;++A){var d=T[A];e.add(o,d,d);var N=a.cartesianToCartographic(d,W);n.project(N,d)}i=l.fromPoints(T,i),o=i.center;var S=o.x,y=o.y,I=o.z;return o.x=I,o.y=S,o.z=y,i},l.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},l.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},l.prototype.intersectPlane=function(e){return l.intersectPlane(this,e)},l.prototype.distanceSquaredTo=function(e){return l.distanceSquaredTo(this,e)},l.prototype.computePlaneDistances=function(e,t,n){return l.computePlaneDistances(this,e,t,n)},l.prototype.isOccluded=function(e){return l.isOccluded(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.clone=function(e){return l.clone(this,e)},l}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var s=a[o];i=s+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=s+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=s+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=s+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=s+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=s+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=s+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=s+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=s+"fullscreenchange",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=s+"fullscreenerror",void 0!==document["on"+i]&&("ms"===s&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(y)&&(y=!1,!l())){var e=/ Chrome\/([\.0-9]+)/.exec(S.userAgent);null!==e&&(y=!0,I=r(e[1]))}return y}function a(){return i()&&I}function o(){if(!t(p)&&(p=!1,!i()&&!l()&&/ Safari\/[\.0-9]+/.test(S.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(S.userAgent);null!==e&&(p=!0,m=r(e[1]))}return p}function u(){return o()&&m}function s(){if(!t(M)){M=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(S.userAgent);null!==e&&(M=!0,O=r(e[1]),O.isNightly=!!e[2])}return M}function E(){return s()&&O}function c(){if(!t(x)){x=!1;var e;"Microsoft Internet Explorer"===S.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(S.userAgent),null!==e&&(x=!0,C=r(e[1]))):"Netscape"===S.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(S.userAgent),null!==e&&(x=!0,C=r(e[1])))}return x}function _(){return c()&&C}function l(){if(!t(g)){g=!1;var e=/ Edge\/([\.0-9]+)/.exec(S.userAgent);null!==e&&(g=!0,v=r(e[1]))}return g}function f(){return l()&&v}function T(){if(!t(U)){U=!1;var e=/Firefox\/([\.0-9]+)/.exec(S.userAgent); +null!==e&&(U=!0,L=r(e[1]))}return U}function R(){return t(w)||(w=/Windows/i.test(S.appVersion)),w}function h(){return T()&&L}function A(){return t(P)||(P="undefined"!=typeof PointerEvent&&(!t(S.pointerEnabled)||S.pointerEnabled)),P}function d(){if(!t(D)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;D=t(n)&&""!==n,D&&(F=n)}return D}function N(){return d()?F:void 0}var S;S="undefined"!=typeof navigator?navigator:{};var y,I,p,m,M,O,x,C,g,v,U,L,w,P,F,D,B={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:c,internetExplorerVersion:_,isEdge:l,edgeVersion:f,isFirefox:T,firefoxVersion:h,isWindows:R,hardwareConcurrency:e(S.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:N};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,i){i=i||2;var a=n&&n.length,o=a?n[0]*i:e.length,u=t(e,0,o,i,!0),E=[];if(!u)return E;var c,_,l,f,T,R,h;if(a&&(u=s(e,n,u,i)),e.length>80*i){c=l=e[0],_=f=e[1];for(var A=i;A<o;A+=i)T=e[A],R=e[A+1],T<c&&(c=T),R<_&&(_=R),T>l&&(l=T),R>f&&(f=R);h=Math.max(l-c,f-_)}return r(u,E,i,c,_,h),E}function t(e,t,n,r,i){var a,o;if(i===C(e,t,n,r)>0)for(a=t;a<n;a+=r)o=M(a,e[a],e[a+1],o);else for(a=n-r;a>=t;a-=r)o=M(a,e[a],e[a+1],o);return o&&N(o,o.next)&&(O(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!N(r,r.next)&&0!==d(r.prev,r,r.next))r=r.next;else{if(O(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,E,c,_,f){if(e){!f&&_&&l(e,E,c,_);for(var T,R,h=e;e.prev!==e.next;)if(T=e.prev,R=e.next,_?a(e,E,c,_):i(e))t.push(T.i/s),t.push(e.i/s),t.push(R.i/s),O(e),e=R.next,h=R.next;else if(e=R,e===h){f?1===f?(e=o(e,t,s),r(e,t,s,E,c,_,2)):2===f&&u(e,t,s,E,c,_):r(n(e),t,s,E,c,_,1);break}}}function i(e){var t=e.prev,n=e,r=e.next;if(d(t,n,r)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(h(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&d(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function a(e,t,n,r){var i=e.prev,a=e,o=e.next;if(d(i,a,o)>=0)return!1;for(var u=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,s=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,E=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,c=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,_=T(u,s,t,n,r),l=T(E,c,t,n,r),f=e.nextZ;f&&f.z<=l;){if(f!==e.prev&&f!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&d(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(f=e.prevZ;f&&f.z>=_;){if(f!==e.prev&&f!==e.next&&h(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&d(f.prev,f,f.next)>=0)return!1;f=f.prevZ}return!0}function o(e,t,n){var r=e;do{var i=r.prev,a=r.next.next;!N(i,a)&&S(i,r,r.next,a)&&I(i,a)&&I(a,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(a.i/n),O(r),O(r.next),r=e=a),r=r.next}while(r!==e);return r}function u(e,t,i,a,o,u){var s=e;do{for(var E=s.next.next;E!==s.prev;){if(s.i!==E.i&&A(s,E)){var c=m(s,E);return s=n(s,s.next),c=n(c,c.next),r(s,t,i,a,o,u),void r(c,t,i,a,o,u)}E=E.next}s=s.next}while(s!==e)}function s(e,r,i,a){var o,u,s,_,l,f=[];for(o=0,u=r.length;o<u;o++)s=r[o]*a,_=o<u-1?r[o+1]*a:e.length,l=t(e,s,_,a,!1),l===l.next&&(l.steiner=!0),f.push(R(l));for(f.sort(E),o=0;o<f.length;o++)c(f[o],i),i=n(i,i.next);return i}function E(e,t){return e.x-t.x}function c(e,t){if(t=_(e,t)){var r=m(t,e);n(r,r.next)}}function _(e,t){var n,r=t,i=e.x,a=e.y,o=-(1/0);do{if(a<=r.y&&a>=r.next.y){var u=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=i&&u>o){if(o=u,u===i){if(a===r.y)return r;if(a===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(i===o)return n.prev;var s,E=n,c=n.x,_=n.y,l=1/0;for(r=n.next;r!==E;)i>=r.x&&r.x>=c&&h(a<_?i:o,a,c,_,a<_?o:i,a,r.x,r.y)&&(s=Math.abs(a-r.y)/(i-r.x),(s<l||s===l&&r.x>n.x)&&I(r,e)&&(n=r,l=s)),r=r.next;return n}function l(e,t,n,r){var i=e;do null===i.z&&(i.z=T(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,f(i)}function f(e){var t,n,r,i,a,o,u,s,E=1;do{for(n=e,e=null,a=null,o=0;n;){for(o++,r=n,u=0,t=0;t<E&&(u++,r=r.nextZ,r);t++);for(s=E;u>0||s>0&&r;)0===u?(i=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(i=n,n=n.nextZ,u--):(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,u--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=r}a.nextZ=null,E*=2}while(o>1);return e}function T(e,t,n,r,i){return e=32767*(e-n)/i,t=32767*(t-r)/i,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function R(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function h(e,t,n,r,i,a,o,u){return(i-o)*(t-u)-(e-o)*(a-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(a-u)-(i-o)*(r-u)>=0}function A(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!y(e,t)&&I(e,t)&&I(t,e)&&p(e,t)}function d(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function N(e,t){return e.x===t.x&&e.y===t.y}function S(e,t,n,r){return!!(N(e,t)&&N(n,r)||N(e,r)&&N(n,t))||d(e,t,n)>0!=d(e,t,r)>0&&d(n,r,e)>0!=d(n,r,t)>0}function y(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&S(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function I(e,t){return d(e.prev,e,e.next)<0?d(e,t,e.next)>=0&&d(e,e.prev,t)>=0:d(e,t,e.prev)<0||d(e,e.next,t)<0}function p(e,t){var n=e,r=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do n.y>a!=n.next.y>a&&i<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function m(e,t){var n=new x(e.i,e.x,e.y),r=new x(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,n.next=i,i.prev=n,r.next=n,n.prev=r,a.next=r,r.prev=a,r}function M(e,t,n,r){var i=new x(e,t,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 O(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 x(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function C(e,t,n,r){for(var i=0,a=t,o=n-r;a<n;a+=r)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}return e.deviation=function(e,t,n,r){var i=t&&t.length,a=i?t[0]*n:e.length,o=Math.abs(C(e,0,a,n));if(i)for(var u=0,s=t.length;u<s;u++){var E=t[u]*n,c=u<s-1?t[u+1]*n:e.length;o-=Math.abs(C(e,E,c,n))}var _=0;for(u=0;u<r.length;u+=3){var l=r[u]*n,f=r[u+1]*n,T=r[u+2]*n;_+=Math.abs((e[l]-e[T])*(e[f+1]-e[l+1])-(e[l]-e[f])*(e[T+1]-e[l+1]))}return 0===o&&0===_?0:Math.abs((_-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)n.vertices.push(e[i][a][o]);i>0&&(r+=e[i-1].length,n.holes.push(r))}return n},e}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var i=0;i<r;++i)o.pack(e[i],t,2*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var i=0;i<r;i+=2){var a=i/2;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var E=new o,c=new o;o.angleBetween=function(e,t){return o.normalize(e,E),o.normalize(t,c),a.acosClamped(o.dot(E,c))};var _=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)},o.ZERO=i(new o(0,0)),o.UNIT_X=i(new o(1,0)),o.UNIT_Y=i(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,i,a,o,u,s,E,c,_,l){"use strict";var f=new n,T=new n,R={};R.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,i=0;i<t;r=i++){var a=e[r],o=e[i];n+=a.x*o.y-o.x*a.y}return.5*n},R.computeWindingOrder2D=function(e){var t=R.computeArea2D(e);return t>0?l.COUNTER_CLOCKWISE:l.CLOCKWISE},R.triangulate=function(n,r){var i=t.packArray(n);return e(i,r,2)};var h=new n,A=new n,d=new n,N=new n,S=new n,y=new n,I=new n;return R.computeSubdivision=function(e,t,o,u){u=i(u,c.RADIANS_PER_DEGREE);var l,f=o.slice(0),T=t.length,R=new Array(3*T),p=0;for(l=0;l<T;l++){var m=t[l];R[p++]=m.x,R[p++]=m.y,R[p++]=m.z}for(var M=[],O={},x=e.maximumRadius,C=c.chordLength(u,x),g=C*C;f.length>0;){var v,U,L=f.pop(),w=f.pop(),P=f.pop(),F=n.fromArray(R,3*P,h),D=n.fromArray(R,3*w,A),B=n.fromArray(R,3*L,d),z=n.multiplyByScalar(n.normalize(F,N),x,N),G=n.multiplyByScalar(n.normalize(D,S),x,S),b=n.multiplyByScalar(n.normalize(B,y),x,y),X=n.magnitudeSquared(n.subtract(z,G,I)),q=n.magnitudeSquared(n.subtract(G,b,I)),V=n.magnitudeSquared(n.subtract(b,z,I)),H=Math.max(X,q,V);H>g?X===H?(v=Math.min(P,w)+" "+Math.max(P,w),l=O[v],a(l)||(U=n.add(F,D,I),n.multiplyByScalar(U,.5,U),R.push(U.x,U.y,U.z),l=R.length/3-1,O[v]=l),f.push(P,l,L),f.push(l,w,L)):q===H?(v=Math.min(w,L)+" "+Math.max(w,L),l=O[v],a(l)||(U=n.add(D,B,I),n.multiplyByScalar(U,.5,U),R.push(U.x,U.y,U.z),l=R.length/3-1,O[v]=l),f.push(w,l,P),f.push(l,L,P)):V===H&&(v=Math.min(L,P)+" "+Math.max(L,P),l=O[v],a(l)||(U=n.add(B,F,I),n.multiplyByScalar(U,.5,U),R.push(U.x,U.y,U.z),l=R.length/3-1,O[v]=l),f.push(L,l,w),f.push(l,P,w)):(M.push(P),M.push(w),M.push(L))}return new s({attributes:{position:new E({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:R})},indices:M,primitiveType:_.TRIANGLES})},R.scaleToGeodeticHeight=function(e,t,r,o){r=i(r,u.WGS84);var s=f,E=T;if(t=i(t,0),o=i(o,!0),a(e))for(var c=e.length,_=0;_<c;_+=3)n.fromArray(e,_,E),o&&(E=r.scaleToGeodeticSurface(E,E)),0!==t&&(s=r.geodeticSurfaceNormal(E,s),n.multiplyByScalar(s,t,s),n.add(E,s,E)),e[_]=E.x,e[_+1]=E.y,e[_+2]=E.z;return e},R}),define("Core/Matrix2",["./Cartesian2","./Check","./defaultValue","./defined","./defineProperties","./freezeObject"],function(e,t,n,r,i,a){"use strict";function o(e,t,r,i){this[0]=n(e,0),this[1]=n(r,0),this[2]=n(t,0),this[3]=n(i,0)}o.packedLength=4,o.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t},o.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new o),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i},o.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new o(e[0],e[2],e[1],e[3])},o.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new o),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i},o.fromColumnMajorArray=function(e,t){return o.clone(e,t)},o.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new o(e[0],e[1],e[2],e[3])},o.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new o(e.x,0,0,e.y)},o.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new o(e,0,0,e)},o.fromRotation=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new o(n,-i,i,n)},o.toArray=function(e,t){ +return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]},o.getElementIndex=function(e,t){return 2*e+t},o.getColumn=function(e,t,n){var r=2*t,i=e[r],a=e[r+1];return n.x=i,n.y=a,n},o.setColumn=function(e,t,n,r){r=o.clone(e,r);var i=2*t;return r[i]=n.x,r[i+1]=n.y,r},o.getRow=function(e,t,n){var r=e[t],i=e[t+2];return n.x=r,n.y=i,n},o.setRow=function(e,t,n,r){return r=o.clone(e,r),r[t]=n.x,r[t+2]=n.y,r};var u=new e;o.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],u)),n.y=e.magnitude(e.fromElements(t[2],t[3],u)),n};var s=new e;return o.getMaximumScale=function(t){return o.getScale(t,s),e.maximumComponent(s)},o.multiply=function(e,t,n){var r=e[0]*t[0]+e[2]*t[1],i=e[0]*t[2]+e[2]*t[3],a=e[1]*t[0]+e[3]*t[1],o=e[1]*t[2]+e[3]*t[3];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n},o.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n},o.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n},o.multiplyByVector=function(e,t,n){var r=e[0]*t.x+e[2]*t.y,i=e[1]*t.x+e[3]*t.y;return n.x=r,n.y=i,n},o.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n},o.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n},o.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},o.transpose=function(e,t){var n=e[0],r=e[2],i=e[1],a=e[3];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t},o.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},o.equals=function(e,t){return e===t||r(e)&&r(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},o.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]},o.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n},o.IDENTITY=a(new o(1,0,0,1)),o.ZERO=a(new o(0,0,0,0)),o.COLUMN0ROW0=0,o.COLUMN0ROW1=1,o.COLUMN1ROW0=2,o.COLUMN1ROW1=3,i(o.prototype,{length:{get:function(){return o.packedLength}}}),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t){return o.equalsEpsilon(this,e,t)},o.prototype.toString=function(){return"("+this[0]+", "+this[2]+")\n("+this[1]+", "+this[3]+")"},o}),define("Core/RectangleGeometryLibrary",["./Cartesian3","./Cartographic","./defined","./DeveloperError","./GeographicProjection","./Math","./Matrix2","./Rectangle"],function(e,t,n,r,i,a,o,u){"use strict";function s(t,n,r,i,a,u,s){var E=Math.cos(n),c=i*E,_=r*E,l=Math.sin(n),R=i*l,d=r*l;T=A.project(t,T),T=e.subtract(T,h,T);var N=o.fromRotation(n,f);T=o.multiplyByVector(N,T,T),T=e.add(T,h,T),t=A.unproject(T,t),u-=1,s-=1;var S=t.latitude,y=S+u*d,I=S-c*s,p=S-c*s+u*d,m=Math.max(S,y,I,p),M=Math.min(S,y,I,p),O=t.longitude,x=O+u*_,C=O+s*R,g=O+s*R+u*_,v=Math.max(O,x,C,g),U=Math.min(O,x,C,g);return{north:m,south:M,east:v,west:U,granYCos:c,granYSin:R,granXCos:_,granXSin:d,nwCorner:t}}var E=Math.cos,c=Math.sin,_=Math.sqrt,l={};l.computePosition=function(e,t,r,i,a){var o=e.ellipsoid.radiiSquared,u=e.nwCorner,s=e.rectangle,l=u.latitude-e.granYCos*t+r*e.granXSin,f=E(l),T=c(l),R=o.z*T,h=u.longitude+t*e.granYSin+r*e.granXCos,A=f*E(h),d=f*c(h),N=o.x*A,S=o.y*d,y=_(N*A+S*d+R*T);if(i.x=N/y,i.y=S/y,i.z=R/y,n(e.vertexFormat)&&e.vertexFormat.st){var I=e.stNwCorner;n(I)?(l=I.latitude-e.stGranYCos*t+r*e.stGranXSin,h=I.longitude+t*e.stGranYSin+r*e.stGranXCos,a.x=(h-e.stWest)*e.lonScalar,a.y=(l-e.stSouth)*e.latScalar):(a.x=(h-s.west)*e.lonScalar,a.y=(l-s.south)*e.latScalar)}};var f=new o,T=new e,R=new t,h=new e,A=new i;return l.computeOptions=function(e,t,n,r){var i,o,E,c,_,l=e._granularity,f=e._ellipsoid,T=e._surfaceHeight,d=e._rotation,N=e._stRotation,S=e._extrudedHeight,y=t.east,I=t.west,p=t.north,m=t.south,M=p-m;I>y?(_=a.TWO_PI-I+y,i=Math.ceil(_/l)+1,o=Math.ceil(M/l)+1,E=_/(i-1),c=M/(o-1)):(_=y-I,i=Math.ceil(_/l)+1,o=Math.ceil(M/l)+1,E=_/(i-1),c=M/(o-1)),n=u.northwest(t,n);var O=u.center(t,R);0===d&&0===N||(O.longitude<n.longitude&&(O.longitude+=a.TWO_PI),h=A.project(O,h));var x=c,C=E,g=0,v=0,U={granYCos:x,granYSin:g,granXCos:C,granXSin:v,ellipsoid:f,surfaceHeight:T,extrudedHeight:S,nwCorner:n,rectangle:t,width:i,height:o};if(0!==d){var L=s(n,d,E,c,O,i,o);p=L.north,m=L.south,y=L.east,I=L.west,U.granYCos=L.granYCos,U.granYSin=L.granYSin,U.granXCos=L.granXCos,U.granXSin=L.granXSin,t.north=p,t.south=m,t.east=y,t.west=I}if(0!==N){d-=N,r=u.northwest(t,r);var w=s(r,d,E,c,O,i,o);U.stGranYCos=w.granYCos,U.stGranXCos=w.granXCos,U.stGranYSin=w.granYSin,U.stGranXSin=w.granXSin,U.stNwCorner=r,U.stWest=w.west,U.stSouth=w.south}return U},l}),define("Core/RectangleOutlineGeometry",["./BoundingSphere","./Cartesian3","./Cartographic","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolygonPipeline","./PrimitiveType","./Rectangle","./RectangleGeometryLibrary"],function(e,t,n,r,i,a,o,u,s,E,c,_,l,f,T,R,h){"use strict";function A(e){var t,n=e.size,i=e.height,a=e.width,o=new Float64Array(3*n),u=0,l=0,f=I;for(t=0;t<a;t++)h.computePosition(e,l,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(t=a-1,l=1;l<i;l++)h.computePosition(e,l,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(l=i-1,t=a-2;t>=0;t--)h.computePosition(e,l,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(t=0,l=i-2;l>0;l--)h.computePosition(e,l,t,f),o[u++]=f.x,o[u++]=f.y,o[u++]=f.z;for(var R=o.length/3*2,A=_.createTypedArray(o.length/3,R),d=0,N=0;N<o.length/3-1;N++)A[d++]=N,A[d++]=N+1;A[d++]=o.length/3-1,A[d++]=0;var S=new s({attributes:new c,primitiveType:T.LINES});return S.attributes.position=new E({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:o}),S.indices=A,S}function d(e){var t=e.surfaceHeight,n=e.extrudedHeight,r=e.ellipsoid,i=Math.min(n,t),a=Math.max(n,t),o=A(e);if(l.equalsEpsilon(i,a,l.EPSILON10))return o;var u=e.height,s=e.width,E=f.scaleToGeodeticHeight(o.attributes.position.values,a,r,!1),c=E.length,T=new Float64Array(2*c);T.set(E);var R=f.scaleToGeodeticHeight(o.attributes.position.values,i,r);T.set(R,c),o.attributes.position.values=T;var h=T.length/3*2+8,d=_.createTypedArray(T.length/3,h);c=T.length/6;for(var N=0,S=0;S<c-1;S++)d[N++]=S,d[N++]=S+1,d[N++]=S+c,d[N++]=S+c+1;return d[N++]=c-1,d[N++]=0,d[N++]=c+c-1,d[N++]=c,d[N++]=0,d[N++]=c,d[N++]=s-1,d[N++]=c+s-1,d[N++]=s+u-2,d[N++]=s+u-2+c,d[N++]=2*s+u-3,d[N++]=2*s+u-3+c,o.indices=d,o}function N(e){e=i(e,i.EMPTY_OBJECT);var t=e.rectangle,n=i(e.granularity,l.RADIANS_PER_DEGREE),r=i(e.ellipsoid,u.WGS84),a=i(e.height,0),o=i(e.rotation,0),s=e.extrudedHeight;this._rectangle=t,this._granularity=n,this._ellipsoid=r,this._surfaceHeight=a,this._rotation=o,this._extrudedHeight=s,this._workerName="createRectangleOutlineGeometry"}var S=new e,y=new e,I=new t,p=new R;N.packedLength=R.packedLength+u.packedLength+5,N.pack=function(e,t,n){return n=i(n,0),R.pack(e._rectangle,t,n),n+=R.packedLength,u.pack(e._ellipsoid,t,n),n+=u.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=a(e._extrudedHeight)?1:0,t[n]=i(e._extrudedHeight,0),t};var m=new R,M=u.clone(u.UNIT_SPHERE),O={rectangle:m,ellipsoid:M,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0};N.unpack=function(e,t,n){t=i(t,0);var r=R.unpack(e,t,m);t+=R.packedLength;var o=u.unpack(e,t,M);t+=u.packedLength;var s=e[t++],E=e[t++],c=e[t++],_=e[t++],l=e[t];return a(n)?(n._rectangle=R.clone(r,n._rectangle),n._ellipsoid=u.clone(o,n._ellipsoid),n._surfaceHeight=E,n._rotation=c,n._extrudedHeight=_?l:void 0,n):(O.granularity=s,O.height=E,O.rotation=c,O.extrudedHeight=_?l:void 0,new N(O))};var x=new n;return N.createGeometry=function(t){var n=R.clone(t._rectangle,p),r=t._ellipsoid,i=t._surfaceHeight,o=t._extrudedHeight,u=h.computeOptions(t,n,x);u.size=2*u.width+2*u.height-4;var E,c;if(n=t._rectangle,!l.equalsEpsilon(n.north,n.south,l.EPSILON10)&&!l.equalsEpsilon(n.east,n.west,l.EPSILON10)){if(a(o)){E=d(u);var _=e.fromRectangle3D(n,r,i,y),N=e.fromRectangle3D(n,r,o,S);c=e.union(_,N)}else E=A(u),E.attributes.position.values=f.scaleToGeodeticHeight(E.attributes.position.values,i,r,!1),c=e.fromRectangle3D(n,r,i);return new s({attributes:E.attributes,indices:E.indices,primitiveType:T.LINES,boundingSphere:c})}},N}),define("Workers/createRectangleOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/Rectangle","../Core/RectangleOutlineGeometry"],function(e,t,n,r){"use strict";function i(i,a){return e(a)&&(i=r.unpack(i,a)),i._ellipsoid=t.clone(i._ellipsoid),i._rectangle=n.clone(i._rectangle),r.createGeometry(i)}return i})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createSimplePolylineGeometry.js b/engines/Cesium/Workers/createSimplePolylineGeometry.js index 2051d75..a27ce78 100644 --- a/engines/Cesium/Workers/createSimplePolylineGeometry.js +++ b/engines/Cesium/Workers/createSimplePolylineGeometry.js @@ -55,7 +55,7 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function r(t){return t+" is required, actual value was undefined"}function n(t,e,r){return"Expected "+r+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(n,a){if(!t(a))throw new e(r(n))},a.typeOf.func=function(t,r){if("function"!=typeof r)throw new e(n(typeof r,"function",t))},a.typeOf.string=function(t,r){if("string"!=typeof r)throw new e(n(typeof r,"string",t))},a.typeOf.number=function(t,r){if("number"!=typeof r)throw new e(n(typeof r,"number",t))},a.typeOf.number.lessThan=function(t,r,n){if(a.typeOf.number(t,r),r>=n)throw new e("Expected "+t+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(t,r,n){if(a.typeOf.number(t,r),r>n)throw new e("Expected "+t+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(t,r,n){if(a.typeOf.number(t,r),r<=n)throw new e("Expected "+t+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(t,r,n){if(a.typeOf.number(t,r),r<n)throw new e("Expected "+t+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(t,r){if("object"!=typeof r)throw new e(n(typeof r,"object",t))},a.typeOf.bool=function(t,r){if("boolean"!=typeof r)throw new e(n(typeof r,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^t>>>1^e[1&t];for(;r<this.N-1;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,r){return r=e(r,255),Math.round((.5*a.clamp(t,-1,1)+.5)*r)},a.fromSNorm=function(t,r){return r=e(r,255),a.clamp(t,0,r)/r*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e-r)},a.cosh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e+r)},a.lerp=function(t,e,r){return(1-r)*t+r*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,r,n,a){a=e(a,n);var o=Math.abs(t-r);return o<=a||o<=n*Math.max(Math.abs(t),Math.abs(r))};var o=[1];a.factorial=function(t){var e=o.length;if(t>=e)for(var r=o[e-1],n=e;n<=t;n++)o.push(r*n);return o[t]},a.incrementWrap=function(t,r,n){return n=e(n,0),++t,t>r&&(t=n),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,r){return t<e?e:t>r?r:t};var i=new t;return a.setRandomNumberSeed=function(e){i=new t(e)},a.nextRandomNumber=function(){return i.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var r=t*e;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)}i.fromSpherical=function(t,n){r(n)||(n=new i);var a=t.clock,o=t.cone,u=e(t.magnitude,1),s=u*Math.sin(o);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(o),n},i.fromElements=function(t,e,n,a){return r(a)?(a.x=t,a.y=e,a.z=n,a):new i(t,e,n)},i.clone=function(t,e){if(r(t))return r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new i(t.x,t.y,t.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z,r},i.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new i),a.x=t[n++],a.y=t[n++],a.z=t[n],a},i.packArray=function(t,e){var n=t.length;r(e)?e.length=3*n:e=new Array(3*n);for(var a=0;a<n;++a)i.pack(t[a],e,3*a);return e},i.unpackArray=function(t,e){var n=t.length;r(e)?e.length=n/3:e=new Array(n/3);for(var a=0;a<n;a+=3){var o=a/3;e[o]=i.unpack(t,a,e[o])}return e},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},i.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r},i.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};var u=new i;i.distance=function(t,e){return i.subtract(t,e,u),i.magnitude(u)},i.distanceSquared=function(t,e){return i.subtract(t,e,u),i.magnitudeSquared(u)},i.normalize=function(t,e){var r=i.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},i.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r},i.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r},i.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r},i.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r},i.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r},i.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var s=new i;i.lerp=function(t,e,r,n){return i.multiplyByScalar(e,r,s),n=i.multiplyByScalar(t,1-r,n),i.add(s,n,n)};var E=new i,l=new i;i.angleBetween=function(t,e){i.normalize(t,E),i.normalize(e,l);var r=i.dot(E,l),n=i.magnitude(i.cross(E,l,E));return Math.atan2(n,r)};var c=new i;i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,c);return i.abs(r,r),e=r.x<=r.y?r.x<=r.z?i.clone(i.UNIT_X,e):i.clone(i.UNIT_Z,e):r.y<=r.z?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_Z,e)},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},i.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]},i.equalsEpsilon=function(t,e,n,a){return t===e||r(t)&&r(e)&&o.equalsEpsilon(t.x,e.x,n,a)&&o.equalsEpsilon(t.y,e.y,n,a)&&o.equalsEpsilon(t.z,e.z,n,a)},i.cross=function(t,e,r){var n=t.x,a=t.y,o=t.z,i=e.x,u=e.y,s=e.z,E=a*s-o*u,l=o*i-n*s,c=n*u-a*i;return r.x=E,r.y=l,r.z=c,r},i.fromDegrees=function(t,e,r,n,a){return t=o.toRadians(t),e=o.toRadians(e),i.fromRadians(t,e,r,n,a)};var f=new i,_=new i,R=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(t,n,a,o,u){a=e(a,0);var s=r(o)?o.radiiSquared:R,E=Math.cos(n);f.x=E*Math.cos(t),f.y=E*Math.sin(t),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,_);var l=Math.sqrt(i.dot(f,_));return _=i.divideByScalar(_,l,_),f=i.multiplyByScalar(f,a,f),r(u)||(u=new i),i.add(_,f,u)},i.fromDegreesArray=function(t,e,n){var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=t[o],s=t[o+1],E=o/2;n[E]=i.fromDegrees(u,s,0,e,n[E])}return n},i.fromRadiansArray=function(t,e,n){var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=t[o],s=t[o+1],E=o/2;n[E]=i.fromRadians(u,s,0,e,n[E])}return n},i.fromDegreesArrayHeights=function(t,e,n){var a=t.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=t[o],s=t[o+1],E=t[o+2],l=o/3;n[l]=i.fromDegrees(u,s,E,e,n[l])}return n},i.fromRadiansArrayHeights=function(t,e,n){var a=t.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=t[o],s=t[o+1],E=t[o+2],l=o/3;n[l]=i.fromRadians(u,s,E,e,n[l])}return n},i.ZERO=a(new i(0,0,0)),i.UNIT_X=a(new i(1,0,0)),i.UNIT_Y=a(new i(0,1,0)),i.UNIT_Z=a(new i(0,0,1)),i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e,r){return i.equalsEpsilon(this,t,e,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,r,n){"use strict";function a(r,a,u,s,E){var l=r.x,c=r.y,f=r.z,_=a.x,R=a.y,T=a.z,h=l*l*_*_,A=c*c*R*R,d=f*f*T*T,S=h+A+d,m=Math.sqrt(1/S),N=t.multiplyByScalar(r,m,o);if(S<s)return isFinite(m)?t.clone(N,E):void 0;var C=u.x,I=u.y,M=u.z,p=i;p.x=N.x*C*2,p.y=N.y*I*2,p.z=N.z*M*2;var O,g,y,F,L,v,U,D,P,B,w,x=(1-m)*t.magnitude(r)/(.5*t.magnitude(p)),G=0;do{x-=G,y=1/(1+x*C),F=1/(1+x*I),L=1/(1+x*M),v=y*y,U=F*F,D=L*L,P=v*y,B=U*F,w=D*L,O=h*v+A*U+d*D-1,g=h*P*C+A*B*I+d*w*M;var b=-2*g;G=O/b}while(Math.abs(O)>n.EPSILON12);return e(E)?(E.x=l*y,E.y=c*F,E.z=f*L,E):new t(l*y,c*F,f*L)}var o=new t,i=new t;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,a,o,i){"use strict";function u(t,r,n){this.longitude=e(t,0),this.latitude=e(r,0),this.height=e(n,0)}u.fromRadians=function(t,n,a,o){return a=e(a,0),r(o)?(o.longitude=t,o.latitude=n,o.height=a,o):new u(t,n,a)},u.fromDegrees=function(t,e,r,n){return t=o.toRadians(t),e=o.toRadians(e),u.fromRadians(t,e,r,n)};var s=new t,E=new t,l=new t,c=new t(1/6378137,1/6378137,1/6356752.314245179),f=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),_=o.EPSILON1;return u.fromCartesian=function(e,n,a){var R=r(n)?n.oneOverRadii:c,T=r(n)?n.oneOverRadiiSquared:f,h=r(n)?n._centerToleranceSquared:_,A=i(e,R,T,h,E);if(r(A)){var d=t.multiplyComponents(A,T,s);d=t.normalize(d,d);var S=t.subtract(e,A,l),m=Math.atan2(d.y,d.x),N=Math.asin(d.z),C=o.sign(t.dot(S,e))*t.magnitude(S);return r(a)?(a.longitude=m,a.latitude=N,a.height=C,a):new u(m,N,C)}},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),r=Object.defineProperties;return e&&t(r)||(r=function(t){return t}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,a,o,i,u,s){"use strict";function E(e,n,a,o){n=r(n,0),a=r(a,0),o=r(o,0),e._radii=new t(n,a,o),e._radiiSquared=new t(n*n,a*a,o*o),e._radiiToTheFourth=new t(n*n*n*n,a*a*a*a,o*o*o*o),e._oneOverRadii=new t(0===n?0:1/n,0===a?0:1/a,0===o?0:1/o),e._oneOverRadiiSquared=new t(0===n?0:1/(n*n),0===a?0:1/(a*a),0===o?0:1/(o*o)),e._minimumRadius=Math.min(n,a,o),e._maximumRadius=Math.max(n,a,o),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function l(t,e,r){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._sqauredXOverSquaredZ=void 0,E(this,t,e,r)}a(l.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}}}),l.clone=function(e,r){if(n(e)){var a=e._radii;return n(r)?(t.clone(a,r._radii),t.clone(e._radiiSquared,r._radiiSquared),t.clone(e._radiiToTheFourth,r._radiiToTheFourth),t.clone(e._oneOverRadii,r._oneOverRadii),t.clone(e._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=e._minimumRadius,r._maximumRadius=e._maximumRadius,r._centerToleranceSquared=e._centerToleranceSquared,r):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(t,e){return n(e)||(e=new l),n(t)?(E(e,t.x,t.y,t.z),e):e},l.WGS84=i(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=i(new l(1,1,1)),l.MOON=i(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(t){return l.clone(this,t)},l.packedLength=t.packedLength,l.pack=function(e,n,a){return a=r(a,0),t.pack(e._radii,n,a),n},l.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n);return l.fromCartesian3(o,a)},l.prototype.geocentricSurfaceNormal=t.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(e,r){var a=e.longitude,o=e.latitude,i=Math.cos(o),u=i*Math.cos(a),s=i*Math.sin(a),E=Math.sin(o);return n(r)||(r=new t),r.x=u,r.y=s,r.z=E,t.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(e,r){return n(r)||(r=new t),r=t.multiplyComponents(e,this._oneOverRadiiSquared,r),t.normalize(r,r)};var c=new t,f=new t;l.prototype.cartographicToCartesian=function(e,r){var a=c,o=f;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,o);var i=Math.sqrt(t.dot(a,o));return t.divideByScalar(o,i,o),t.multiplyByScalar(a,e.height,a),n(r)||(r=new t),t.add(o,a,r)},l.prototype.cartographicArrayToCartesianArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var a=0;a<r;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var _=new t,R=new t,T=new t;return l.prototype.cartesianToCartographic=function(r,a){var o=this.scaleToGeodeticSurface(r,R);if(n(o)){var i=this.geodeticSurfaceNormal(o,_),s=t.subtract(r,o,T),E=Math.atan2(i.y,i.x),l=Math.asin(i.z),c=u.sign(t.dot(s,r))*t.magnitude(s);return n(a)?(a.longitude=E,a.latitude=l,a.height=c,a):new e(E,l,c)}},l.prototype.cartesianArrayToCartographicArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var a=0;a<r;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},l.prototype.scaleToGeodeticSurface=function(t,e){return s(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},l.prototype.scaleToGeocentricSurface=function(e,r){n(r)||(r=new t);var a=e.x,o=e.y,i=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+o*o*u.y+i*i*u.z);return t.multiplyByScalar(e,s,r)},l.prototype.transformPositionToScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._radii,r)},l.prototype.equals=function(e){return this===e||n(e)&&t.equals(this._radii,e._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,o){a=r(a,0);var i=this._sqauredXOverSquaredZ;if(n(o)||(o=new t),o.x=0,o.y=0,o.z=e.z*(1-i),!(Math.abs(o.z)>=this._radii.z-a))return o},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,r,n,a,o,i){"use strict";function u(t){this._ellipsoid=r(t,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,r){var a=this._semimajorAxis,o=e.longitude*a,i=e.latitude*a,u=e.height;return n(r)?(r.x=o,r.y=i,r.z=u,r):new t(o,i,u)},u.prototype.unproject=function(t,r){var a=this._oneOverSemimajorAxis,o=t.x*a,i=t.y*a,u=t.z;return n(r)?(r.longitude=o,r.latitude=i,r.height=u,r):new e(o,i,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,r){this.start=t(e,0),this.stop=t(r,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t,e,n,a,o,i,u,s,E){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(e,0),this[4]=r(o,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(i,0),this[8]=r(E,0)}function E(t){for(var e=0,r=0;r<9;++r){var n=t[r];e+=n*n}return Math.sqrt(e)}function l(t){for(var e=0,r=0;r<3;++r){var n=t[s.getElementIndex(T[r],R[r])];e+=2*n*n}return Math.sqrt(e)}function c(t,e){for(var r=u.EPSILON15,n=0,a=1,o=0;o<3;++o){var i=Math.abs(t[s.getElementIndex(T[o],R[o])]);i>n&&(a=o,n=i)}var E=1,l=0,c=R[a],f=T[a];if(Math.abs(t[s.getElementIndex(f,c)])>r){var _,h=t[s.getElementIndex(f,f)],A=t[s.getElementIndex(c,c)],d=t[s.getElementIndex(f,c)],S=(h-A)/2/d;_=S<0?-1/(-S+Math.sqrt(1+S*S)):1/(S+Math.sqrt(1+S*S)),E=1/Math.sqrt(1+_*_),l=_*E}return e=s.clone(s.IDENTITY,e),e[s.getElementIndex(c,c)]=e[s.getElementIndex(f,f)]=E,e[s.getElementIndex(f,c)]=l,e[s.getElementIndex(c,f)]=-l,e}s.packedLength=9,s.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e},s.unpack=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},s.clone=function(t,e){if(n(t))return n(e)?(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],e):new s(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},s.fromArray=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},s.fromColumnMajorArray=function(t,e){return s.clone(t,e)},s.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new s(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},s.fromQuaternion=function(t,e){var r=t.x*t.x,a=t.x*t.y,o=t.x*t.z,i=t.x*t.w,u=t.y*t.y,E=t.y*t.z,l=t.y*t.w,c=t.z*t.z,f=t.z*t.w,_=t.w*t.w,R=r-u-c+_,T=2*(a-f),h=2*(o+l),A=2*(a+f),d=-r+u-c+_,S=2*(E-i),m=2*(o-l),N=2*(E+i),C=-r-u+c+_;return n(e)?(e[0]=R,e[1]=A,e[2]=m,e[3]=T,e[4]=d,e[5]=N,e[6]=h,e[7]=S,e[8]=C,e):new s(R,T,h,A,d,S,m,N,C)},s.fromHeadingPitchRoll=function(t,e){var r=Math.cos(-t.pitch),a=Math.cos(-t.heading),o=Math.cos(t.roll),i=Math.sin(-t.pitch),u=Math.sin(-t.heading),E=Math.sin(t.roll),l=r*a,c=-o*u+E*i*a,f=E*u+o*i*a,_=r*u,R=o*a+E*i*u,T=-i*o+o*i*u,h=-i,A=E*r,d=o*r;return n(e)?(e[0]=l,e[1]=_,e[2]=h,e[3]=c,e[4]=R,e[5]=A,e[6]=f,e[7]=T,e[8]=d,e):new s(l,c,f,_,R,T,h,A,d)},s.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new s(t.x,0,0,0,t.y,0,0,0,t.z)},s.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new s(t,0,0,0,t,0,0,0,t)},s.fromCrossProduct=function(t,e){return n(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new s(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},s.fromRotationX=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=r,e[5]=a,e[6]=0,e[7]=-a,e[8]=r,e):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=r,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=r,e):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=r,e[1]=a,e[2]=0,e[3]=-a,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(t,e){return n(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},s.getElementIndex=function(t,e){return 3*t+e},s.getColumn=function(t,e,r){var n=3*e,a=t[n],o=t[n+1],i=t[n+2];return r.x=a,r.y=o,r.z=i,r},s.setColumn=function(t,e,r,n){n=s.clone(t,n);var a=3*e;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(t,e,r){var n=t[e],a=t[e+3],o=t[e+6];return r.x=n,r.y=a,r.z=o,r},s.setRow=function(t,e,r,n){return n=s.clone(t,n),n[e]=r.x,n[e+3]=r.y,n[e+6]=r.z,n};var f=new t;s.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],f)),r.y=t.magnitude(t.fromElements(e[3],e[4],e[5],f)),r.z=t.magnitude(t.fromElements(e[6],e[7],e[8],f)),r};var _=new t;s.getMaximumScale=function(e){return s.getScale(e,_),t.maximumComponent(_)},s.multiply=function(t,e,r){var n=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],o=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],i=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],E=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],l=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],c=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return r[0]=n,r[1]=a,r[2]=o,r[3]=i,r[4]=u,r[5]=s,r[6]=E,r[7]=l,r[8]=c,r},s.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r},s.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r},s.multiplyByVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[3]*a+t[6]*o,u=t[1]*n+t[4]*a+t[7]*o,s=t[2]*n+t[5]*a+t[8]*o;return r.x=i,r.y=u,r.z=s,r},s.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r},s.multiplyByScale=function(t,e,r){return r[0]=t[0]*e.x,r[1]=t[1]*e.x,r[2]=t[2]*e.x,r[3]=t[3]*e.y,r[4]=t[4]*e.y,r[5]=t[5]*e.y,r[6]=t[6]*e.z,r[7]=t[7]*e.z,r[8]=t[8]*e.z,r},s.negate=function(t,e){return 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],e},s.transpose=function(t,e){var r=t[0],n=t[3],a=t[6],o=t[1],i=t[4],u=t[7],s=t[2],E=t[5],l=t[8];return e[0]=r,e[1]=n,e[2]=a,e[3]=o,e[4]=i,e[5]=u,e[6]=s,e[7]=E,e[8]=l,e};var R=[1,0,0],T=[2,2,1],h=new s,A=new s;return s.computeEigenDecomposition=function(t,e){var r=u.EPSILON20,a=10,o=0,i=0;n(e)||(e={});for(var f=e.unitary=s.clone(s.IDENTITY,e.unitary),_=e.diagonal=s.clone(t,e.diagonal),R=r*E(_);i<a&&l(_)>R;)c(_,h),s.transpose(h,A),s.multiply(_,h,_),s.multiply(A,_,_),s.multiply(f,h,f),++o>2&&(++i,o=0);return e},s.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},s.determinant=function(t){var e=t[0],r=t[3],n=t[6],a=t[1],o=t[4],i=t[7],u=t[2],s=t[5],E=t[8];return e*(o*E-s*i)+a*(s*n-r*E)+u*(r*i-o*n)},s.inverse=function(t,e){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],u=t[5],E=t[6],l=t[7],c=t[8],f=s.determinant(t);e[0]=i*c-l*u,e[1]=l*a-n*c,e[2]=n*u-i*a,e[3]=E*u-o*c,e[4]=r*c-E*a,e[5]=o*a-r*u,e[6]=o*l-E*i,e[7]=E*n-r*l,e[8]=r*i-o*n;var _=1/f;return s.multiplyByScalar(e,_,e)},s.equals=function(t,e){return t===e||n(t)&&n(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},s.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},s.IDENTITY=i(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=i(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,0)}i.fromElements=function(t,e,n,a,o){return r(o)?(o.x=t,o.y=e,o.z=n,o.w=a,o):new i(t,e,n,a)},i.fromColor=function(t,e){return r(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,e){if(r(t))return r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new i(t.x,t.y,t.z,t.w)},i.packedLength=4,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},i.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new i),a.x=t[n++],a.y=t[n++],a.z=t[n++],a.w=t[n],a},i.packArray=function(t,e){var n=t.length;r(e)?e.length=4*n:e=new Array(4*n);for(var a=0;a<n;++a)i.pack(t[a],e,4*a);return e},i.unpackArray=function(t,e){var n=t.length;r(e)?e.length=n/4:e=new Array(n/4);for(var a=0;a<n;a+=4){var o=a/4;e[o]=i.unpack(t,a,e[o])}return e},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},i.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r.w=Math.min(t.w,e.w),r},i.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r.w=Math.max(t.w,e.w),r},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};var u=new i;i.distance=function(t,e){return i.subtract(t,e,u),i.magnitude(u)},i.distanceSquared=function(t,e){return i.subtract(t,e,u),i.magnitudeSquared(u)},i.normalize=function(t,e){var r=i.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e.w=t.w/r,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},i.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r.w=t.w*e.w,r},i.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r.w=t.w/e.w,r},i.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r.w=t.w+e.w,r},i.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r.w=t.w-e.w,r},i.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r.w=t.w*e,r},i.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r.w=t.w/e,r},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var s=new i;i.lerp=function(t,e,r,n){return i.multiplyByScalar(e,r,s),n=i.multiplyByScalar(t,1-r,n),i.add(s,n,n)};var E=new i;return i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,E);return i.abs(r,r),e=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):r.z<=r.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):r.z<=r.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},i.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]&&t.w===e[r+3]},i.equalsEpsilon=function(t,e,n,a){return t===e||r(t)&&r(e)&&o.equalsEpsilon(t.x,e.x,n,a)&&o.equalsEpsilon(t.y,e.y,n,a)&&o.equalsEpsilon(t.z,e.z,n,a)&&o.equalsEpsilon(t.w,e.w,n,a)},i.ZERO=a(new i(0,0,0,0)),i.UNIT_X=a(new i(1,0,0,0)),i.UNIT_Y=a(new i(0,1,0,0)),i.UNIT_Z=a(new i(0,0,1,0)),i.UNIT_W=a(new i(0,0,0,1)),i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e,r){return i.equalsEpsilon(this,t,e,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,r,n,a,o,i,u,s,E){ -"use strict";function l(t,e,r,a,o,i,u,s,E,l,c,f,_,R,T,h){this[0]=n(t,0),this[1]=n(o,0),this[2]=n(E,0),this[3]=n(_,0),this[4]=n(e,0),this[5]=n(i,0),this[6]=n(l,0),this[7]=n(R,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(c,0),this[11]=n(T,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(h,0)}l.packedLength=16,l.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e[r++]=t[9],e[r++]=t[10],e[r++]=t[11],e[r++]=t[12],e[r++]=t[13],e[r++]=t[14],e[r]=t[15],e},l.unpack=function(t,e,r){return e=n(e,0),a(r)||(r=new l),r[0]=t[e++],r[1]=t[e++],r[2]=t[e++],r[3]=t[e++],r[4]=t[e++],r[5]=t[e++],r[6]=t[e++],r[7]=t[e++],r[8]=t[e++],r[9]=t[e++],r[10]=t[e++],r[11]=t[e++],r[12]=t[e++],r[13]=t[e++],r[14]=t[e++],r[15]=t[e],r},l.clone=function(t,e){if(a(t))return a(e)?(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],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):new l(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(t,e){return l.clone(t,e)},l.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new l(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},l.fromRotationTranslation=function(e,r,o){return r=n(r,t.ZERO),a(o)?(o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=0,o[4]=e[3],o[5]=e[4],o[6]=e[5],o[7]=0,o[8]=e[6],o[9]=e[7],o[10]=e[8],o[11]=0,o[12]=r.x,o[13]=r.y,o[14]=r.z,o[15]=1,o):new l(e[0],e[3],e[6],r.x,e[1],e[4],e[7],r.y,e[2],e[5],e[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(t,e,r,n){a(n)||(n=new l);var o=r.x,i=r.y,u=r.z,s=e.x*e.x,E=e.x*e.y,c=e.x*e.z,f=e.x*e.w,_=e.y*e.y,R=e.y*e.z,T=e.y*e.w,h=e.z*e.z,A=e.z*e.w,d=e.w*e.w,S=s-_-h+d,m=2*(E-A),N=2*(c+T),C=2*(E+A),I=-s+_-h+d,M=2*(R-f),p=2*(c-T),O=2*(R+f),g=-s-_+h+d;return n[0]=S*o,n[1]=C*o,n[2]=p*o,n[3]=0,n[4]=m*i,n[5]=I*i,n[6]=O*i,n[7]=0,n[8]=N*u,n[9]=M*u,n[10]=g*u,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n},l.fromTranslationRotationScale=function(t,e){return l.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},l.fromTranslation=function(t,e){return l.fromRotationTranslation(s.IDENTITY,t,e)},l.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new l(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},l.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new l(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var c=new t,f=new t,_=new t;l.fromCamera=function(e,r){var n=e.position,o=e.direction,i=e.up;t.normalize(o,c),t.normalize(t.cross(c,i,f),f),t.normalize(t.cross(f,c,_),_);var u=f.x,s=f.y,E=f.z,R=c.x,T=c.y,h=c.z,A=_.x,d=_.y,S=_.z,m=n.x,N=n.y,C=n.z,I=u*-m+s*-N+E*-C,M=A*-m+d*-N+S*-C,p=R*m+T*N+h*C;return a(r)?(r[0]=u,r[1]=A,r[2]=-R,r[3]=0,r[4]=s,r[5]=d,r[6]=-T,r[7]=0,r[8]=E,r[9]=S,r[10]=-h,r[11]=0,r[12]=I,r[13]=M,r[14]=p,r[15]=1,r):new l(u,s,E,I,A,d,S,M,-R,-T,-h,p,0,0,0,1)},l.computePerspectiveFieldOfView=function(t,e,r,n,a){var o=Math.tan(.5*t),i=1/o,u=i/e,s=(n+r)/(r-n),E=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=E,a[15]=0,a},l.computeOrthographicOffCenter=function(t,e,r,n,a,o,i){var u=1/(e-t),s=1/(n-r),E=1/(o-a),l=-(e+t)*u,c=-(n+r)*s,f=-(o+a)*E;return u*=2,s*=2,E*=-2,i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=0,i[12]=l,i[13]=c,i[14]=f,i[15]=1,i},l.computePerspectiveOffCenter=function(t,e,r,n,a,o,i){var u=2*a/(e-t),s=2*a/(n-r),E=(e+t)/(e-t),l=(n+r)/(n-r),c=-(o+a)/(o-a),f=-1,_=-2*o*a/(o-a);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=E,i[9]=l,i[10]=c,i[11]=f,i[12]=0,i[13]=0,i[14]=_,i[15]=0,i},l.computeInfinitePerspectiveOffCenter=function(t,e,r,n,a,o){var i=2*a/(e-t),u=2*a/(n-r),s=(e+t)/(e-t),E=(n+r)/(n-r),l=-1,c=-1,f=-2*a;return o[0]=i,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=s,o[9]=E,o[10]=l,o[11]=c,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o},l.computeViewportTransformation=function(t,e,r,a){t=n(t,n.EMPTY_OBJECT);var o=n(t.x,0),i=n(t.y,0),u=n(t.width,0),s=n(t.height,0);e=n(e,0),r=n(r,1);var E=.5*u,l=.5*s,c=.5*(r-e),f=E,_=l,R=c,T=o+E,h=i+l,A=e+c,d=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=_,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=R,a[11]=0,a[12]=T,a[13]=h,a[14]=A,a[15]=d,a},l.computeView=function(e,r,n,a,o){return o[0]=a.x,o[1]=n.x,o[2]=-r.x,o[3]=0,o[4]=a.y,o[5]=n.y,o[6]=-r.y,o[7]=0,o[8]=a.z,o[9]=n.z,o[10]=-r.z,o[11]=0,o[12]=-t.dot(a,e),o[13]=-t.dot(n,e),o[14]=t.dot(r,e),o[15]=1,o},l.toArray=function(t,e){return a(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},l.getElementIndex=function(t,e){return 4*t+e},l.getColumn=function(t,e,r){var n=4*e,a=t[n],o=t[n+1],i=t[n+2],u=t[n+3];return r.x=a,r.y=o,r.z=i,r.w=u,r},l.setColumn=function(t,e,r,n){n=l.clone(t,n);var a=4*e;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(t,e,r){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=t[15],r},l.getRow=function(t,e,r){var n=t[e],a=t[e+4],o=t[e+8],i=t[e+12];return r.x=n,r.y=a,r.z=o,r.w=i,r},l.setRow=function(t,e,r,n){return n=l.clone(t,n),n[e]=r.x,n[e+4]=r.y,n[e+8]=r.z,n[e+12]=r.w,n};var R=new t;l.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],R)),r.y=t.magnitude(t.fromElements(e[4],e[5],e[6],R)),r.z=t.magnitude(t.fromElements(e[8],e[9],e[10],R)),r};var T=new t;l.getMaximumScale=function(e){return l.getScale(e,T),t.maximumComponent(T)},l.multiply=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[3],u=t[4],s=t[5],E=t[6],l=t[7],c=t[8],f=t[9],_=t[10],R=t[11],T=t[12],h=t[13],A=t[14],d=t[15],S=e[0],m=e[1],N=e[2],C=e[3],I=e[4],M=e[5],p=e[6],O=e[7],g=e[8],y=e[9],F=e[10],L=e[11],v=e[12],U=e[13],D=e[14],P=e[15],B=n*S+u*m+c*N+T*C,w=a*S+s*m+f*N+h*C,x=o*S+E*m+_*N+A*C,G=i*S+l*m+R*N+d*C,b=n*I+u*M+c*p+T*O,z=a*I+s*M+f*p+h*O,H=o*I+E*M+_*p+A*O,V=i*I+l*M+R*p+d*O,X=n*g+u*y+c*F+T*L,q=a*g+s*y+f*F+h*L,W=o*g+E*y+_*F+A*L,Y=i*g+l*y+R*F+d*L,K=n*v+u*U+c*D+T*P,k=a*v+s*U+f*D+h*P,Z=o*v+E*U+_*D+A*P,j=i*v+l*U+R*D+d*P;return r[0]=B,r[1]=w,r[2]=x,r[3]=G,r[4]=b,r[5]=z,r[6]=H,r[7]=V,r[8]=X,r[9]=q,r[10]=W,r[11]=Y,r[12]=K,r[13]=k,r[14]=Z,r[15]=j,r},l.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r},l.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r},l.multiplyTransformation=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[4],u=t[5],s=t[6],E=t[8],l=t[9],c=t[10],f=t[12],_=t[13],R=t[14],T=e[0],h=e[1],A=e[2],d=e[4],S=e[5],m=e[6],N=e[8],C=e[9],I=e[10],M=e[12],p=e[13],O=e[14],g=n*T+i*h+E*A,y=a*T+u*h+l*A,F=o*T+s*h+c*A,L=n*d+i*S+E*m,v=a*d+u*S+l*m,U=o*d+s*S+c*m,D=n*N+i*C+E*I,P=a*N+u*C+l*I,B=o*N+s*C+c*I,w=n*M+i*p+E*O+f,x=a*M+u*p+l*O+_,G=o*M+s*p+c*O+R;return r[0]=g,r[1]=y,r[2]=F,r[3]=0,r[4]=L,r[5]=v,r[6]=U,r[7]=0,r[8]=D,r[9]=P,r[10]=B,r[11]=0,r[12]=w,r[13]=x,r[14]=G,r[15]=1,r},l.multiplyByMatrix3=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[4],u=t[5],s=t[6],E=t[8],l=t[9],c=t[10],f=e[0],_=e[1],R=e[2],T=e[3],h=e[4],A=e[5],d=e[6],S=e[7],m=e[8],N=n*f+i*_+E*R,C=a*f+u*_+l*R,I=o*f+s*_+c*R,M=n*T+i*h+E*A,p=a*T+u*h+l*A,O=o*T+s*h+c*A,g=n*d+i*S+E*m,y=a*d+u*S+l*m,F=o*d+s*S+c*m;return r[0]=N,r[1]=C,r[2]=I,r[3]=0,r[4]=M,r[5]=p,r[6]=O,r[7]=0,r[8]=g,r[9]=y,r[10]=F,r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},l.multiplyByTranslation=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=n*t[0]+a*t[4]+o*t[8]+t[12],u=n*t[1]+a*t[5]+o*t[9]+t[13],s=n*t[2]+a*t[6]+o*t[10]+t[14];return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=i,r[13]=u,r[14]=s,r[15]=t[15],r};var h=new t;l.multiplyByUniformScale=function(t,e,r){return h.x=e,h.y=e,h.z=e,l.multiplyByScale(t,h,r)},l.multiplyByScale=function(t,e,r){var n=e.x,a=e.y,o=e.z;return 1===n&&1===a&&1===o?l.clone(t,r):(r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=0,r[4]=a*t[4],r[5]=a*t[5],r[6]=a*t[6],r[7]=0,r[8]=o*t[8],r[9]=o*t[9],r[10]=o*t[10],r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=1,r)},l.multiplyByVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=e.w,u=t[0]*n+t[4]*a+t[8]*o+t[12]*i,s=t[1]*n+t[5]*a+t[9]*o+t[13]*i,E=t[2]*n+t[6]*a+t[10]*o+t[14]*i,l=t[3]*n+t[7]*a+t[11]*o+t[15]*i;return r.x=u,r.y=s,r.z=E,r.w=l,r},l.multiplyByPointAsVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[4]*a+t[8]*o,u=t[1]*n+t[5]*a+t[9]*o,s=t[2]*n+t[6]*a+t[10]*o;return r.x=i,r.y=u,r.z=s,r},l.multiplyByPoint=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[4]*a+t[8]*o+t[12],u=t[1]*n+t[5]*a+t[9]*o+t[13],s=t[2]*n+t[6]*a+t[10]*o+t[14];return r.x=i,r.y=u,r.z=s,r},l.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r},l.negate=function(t,e){return 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],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},l.transpose=function(t,e){var r=t[1],n=t[2],a=t[3],o=t[6],i=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=i,e[14]=u,e[15]=t[15],e},l.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},l.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},l.equalsEpsilon=function(t,e,r){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r&&Math.abs(t[9]-e[9])<=r&&Math.abs(t[10]-e[10])<=r&&Math.abs(t[11]-e[11])<=r&&Math.abs(t[12]-e[12])<=r&&Math.abs(t[13]-e[13])<=r&&Math.abs(t[14]-e[14])<=r&&Math.abs(t[15]-e[15])<=r},l.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},l.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var A=new s,d=new s,S=new e,m=new e(0,0,0,1);return l.inverse=function(t,r){if(s.equalsEpsilon(l.getRotation(t,A),d,u.EPSILON7)&&e.equals(l.getRow(t,3,S),m))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-t[12],r[13]=-t[13],r[14]=-t[14],r[15]=1,r;var n=t[0],a=t[4],o=t[8],i=t[12],c=t[1],f=t[5],_=t[9],R=t[13],T=t[2],h=t[6],N=t[10],C=t[14],I=t[3],M=t[7],p=t[11],O=t[15],g=N*O,y=C*p,F=h*O,L=C*M,v=h*p,U=N*M,D=T*O,P=C*I,B=T*p,w=N*I,x=T*M,G=h*I,b=g*f+L*_+v*R-(y*f+F*_+U*R),z=y*c+D*_+w*R-(g*c+P*_+B*R),H=F*c+P*f+x*R-(L*c+D*f+G*R),V=U*c+B*f+G*_-(v*c+w*f+x*_),X=y*a+F*o+U*i-(g*a+L*o+v*i),q=g*n+P*o+B*i-(y*n+D*o+w*i),W=L*n+D*a+G*i-(F*n+P*a+x*i),Y=v*n+w*a+x*o-(U*n+B*a+G*o);g=o*R,y=i*_,F=a*R,L=i*f,v=a*_,U=o*f,D=n*R,P=i*c,B=n*_,w=o*c,x=n*f,G=a*c;var K=g*M+L*p+v*O-(y*M+F*p+U*O),k=y*I+D*p+w*O-(g*I+P*p+B*O),Z=F*I+P*M+x*O-(L*I+D*M+G*O),j=U*I+B*M+G*p-(v*I+w*M+x*p),Q=F*N+U*C+y*h-(v*C+g*h+L*N),J=B*C+g*T+P*N-(D*N+w*C+y*T),$=D*h+G*C+L*T-(x*C+F*T+P*h),tt=x*N+v*T+w*h-(B*h+G*N+U*T),et=n*b+a*z+o*H+i*V;if(Math.abs(et)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return et=1/et,r[0]=b*et,r[1]=z*et,r[2]=H*et,r[3]=V*et,r[4]=X*et,r[5]=q*et,r[6]=W*et,r[7]=Y*et,r[8]=K*et,r[9]=k*et,r[10]=Z*et,r[11]=j*et,r[12]=Q*et,r[13]=J*et,r[14]=$*et,r[15]=tt*et,r},l.inverseTransformation=function(t,e){var r=t[0],n=t[1],a=t[2],o=t[4],i=t[5],u=t[6],s=t[8],E=t[9],l=t[10],c=t[12],f=t[13],_=t[14],R=-r*c-n*f-a*_,T=-o*c-i*f-u*_,h=-s*c-E*f-l*_;return e[0]=r,e[1]=o,e[2]=s,e[3]=0,e[4]=n,e[5]=i,e[6]=E,e[7]=0,e[8]=a,e[9]=u,e[10]=l,e[11]=0,e[12]=R,e[13]=T,e[14]=h,e[15]=1,e},l.IDENTITY=i(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=i(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,o(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(t){return l.clone(this,t)},l.prototype.equals=function(t){return l.equals(this,t)},l.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]&&t[9]===e[r+9]&&t[10]===e[r+10]&&t[11]===e[r+11]&&t[12]===e[r+12]&&t[13]===e[r+13]&&t[14]===e[r+14]&&t[15]===e[r+15]},l.prototype.equalsEpsilon=function(t,e){return l.equalsEpsilon(this,t,e)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t,e,n,a){this.west=r(t,0),this.south=r(e,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(t,e,n){return n=r(n,0),e[n++]=t.west,e[n++]=t.south,e[n++]=t.east,e[n]=t.north,e},s.unpack=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},s.computeWidth=function(t){var e=t.east,r=t.west;return e<r&&(e+=u.TWO_PI),e-r},s.computeHeight=function(t){return t.north-t.south},s.fromDegrees=function(t,e,a,o,i){return t=u.toRadians(r(t,0)),e=u.toRadians(r(e,0)),a=u.toRadians(r(a,0)),o=u.toRadians(r(o,0)),n(i)?(i.west=t,i.south=e,i.east=a,i.north=o,i):new s(t,e,a,o)},s.fromRadians=function(t,e,a,o,i){return n(i)?(i.west=r(t,0),i.south=r(e,0),i.east=r(a,0),i.north=r(o,0),i):new s(t,e,a,o)},s.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,i=-Number.MAX_VALUE,E=Number.MAX_VALUE,l=-Number.MAX_VALUE,c=0,f=t.length;c<f;c++){var _=t[c];r=Math.min(r,_.longitude),a=Math.max(a,_.longitude),E=Math.min(E,_.latitude),l=Math.max(l,_.latitude);var R=_.longitude>=0?_.longitude:_.longitude+u.TWO_PI;o=Math.min(o,R),i=Math.max(i,R)}return a-r>i-o&&(r=o,a=i,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(e)?(e.west=r,e.south=E,e.east=a,e.north=l,e):new s(r,E,a,l)},s.fromCartesianArray=function(t,e,r){for(var a=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,E=-Number.MAX_VALUE,l=Number.MAX_VALUE,c=-Number.MAX_VALUE,f=0,_=t.length;f<_;f++){var R=e.cartesianToCartographic(t[f]);a=Math.min(a,R.longitude),o=Math.max(o,R.longitude),l=Math.min(l,R.latitude),c=Math.max(c,R.latitude);var T=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;i=Math.min(i,T),E=Math.max(E,T)}return o-a>E-i&&(a=i,o=E,o>u.PI&&(o-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=o,r.north=c,r):new s(a,l,o,c)},s.clone=function(t,e){if(n(t))return n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new s(t.west,t.south,t.east,t.north)},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,e){return t===e||n(t)&&n(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},s.prototype.equalsEpsilon=function(t,e){return n(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},s.validate=function(t){},s.southwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t(e.west,e.south)},s.northwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t(e.west,e.north)},s.northeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t(e.east,e.north)},s.southeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t(e.east,e.south)},s.center=function(e,r){var a=e.east,o=e.west;a<o&&(a+=u.TWO_PI);var i=u.negativePiToPi(.5*(o+a)),s=.5*(e.south+e.north);return n(r)?(r.longitude=i,r.latitude=s,r.height=0,r):new t(i,s)},s.intersection=function(t,e,r){var a=t.east,o=t.west,i=e.east,E=e.west;a<o&&i>0?a+=u.TWO_PI:i<E&&a>0&&(i+=u.TWO_PI),a<o&&E<0?E+=u.TWO_PI:i<E&&o<0&&(o+=u.TWO_PI);var l=u.negativePiToPi(Math.max(o,E)),c=u.negativePiToPi(Math.min(a,i));if(!((t.west<t.east||e.west<e.east)&&c<=l)){var f=Math.max(t.south,e.south),_=Math.min(t.north,e.north);if(!(f>=_))return n(r)?(r.west=l,r.south=f,r.east=c,r.north=_,r):new s(l,f,c,_)}},s.simpleIntersection=function(t,e,r){var a=Math.max(t.west,e.west),o=Math.max(t.south,e.south),i=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(o>=u||a>=i))return n(r)?(r.west=a,r.south=o,r.east=i,r.north=u,r):new s(a,o,i,u)},s.union=function(t,e,r){n(r)||(r=new s);var a=t.east,o=t.west,i=e.east,E=e.west;a<o&&i>0?a+=u.TWO_PI:i<E&&a>0&&(i+=u.TWO_PI),a<o&&E<0?E+=u.TWO_PI:i<E&&o<0&&(o+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(o,E)),c=u.convertLongitudeRange(Math.max(a,i));return r.west=l,r.south=Math.min(t.south,e.south),r.east=c,r.north=Math.max(t.north,e.north),r},s.expand=function(t,e,r){return n(r)||(r=new s),r.west=Math.min(t.west,e.longitude),r.south=Math.min(t.south,e.latitude),r.east=Math.max(t.east,e.longitude),r.north=Math.max(t.north,e.latitude),r},s.contains=function(t,e){var r=e.longitude,n=e.latitude,a=t.west,o=t.east;return o<a&&(o+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<o||u.equalsEpsilon(r,o,u.EPSILON14))&&n>=t.south&&n<=t.north};var E=new t;return s.subsample=function(t,e,a,i){e=r(e,o.WGS84),a=r(a,0),n(i)||(i=[]);var l=0,c=t.north,f=t.south,_=t.east,R=t.west,T=E;T.height=a,T.longitude=R,T.latitude=c,i[l]=e.cartographicToCartesian(T,i[l]),l++,T.longitude=_,i[l]=e.cartographicToCartesian(T,i[l]),l++,T.latitude=f,i[l]=e.cartographicToCartesian(T,i[l]),l++,T.longitude=R,i[l]=e.cartographicToCartesian(T,i[l]),l++,c<0?T.latitude=c:f>0?T.latitude=f:T.latitude=0;for(var h=1;h<8;++h)T.longitude=-Math.PI+h*u.PI_OVER_TWO,s.contains(t,T)&&(i[l]=e.cartographicToCartesian(T,i[l]),l++);return 0===T.latitude&&(T.longitude=R,i[l]=e.cartographicToCartesian(T,i[l]),l++,T.longitude=_,i[l]=e.cartographicToCartesian(T,i[l]),l++),i.length=l,i},s.MAX_VALUE=i(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,r,n,a,o,i,u,s,E,l,c){"use strict";function f(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var _=new t,R=new t,T=new t,h=new t,A=new t,d=new t,S=new t,m=new t,N=new t,C=new t,I=new t,M=new t;f.fromPoints=function(e,r){if(a(r)||(r=new f),!a(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;for(var n=t.clone(e[0],S),o=t.clone(n,_),i=t.clone(n,R),u=t.clone(n,T),s=t.clone(n,h),E=t.clone(n,A),l=t.clone(n,d),c=e.length,p=1;p<c;p++){t.clone(e[p],n);var O=n.x,g=n.y,y=n.z;O<o.x&&t.clone(n,o),O>s.x&&t.clone(n,s),g<i.y&&t.clone(n,i),g>E.y&&t.clone(n,E),y<u.z&&t.clone(n,u),y>l.z&&t.clone(n,l)}var F=t.magnitudeSquared(t.subtract(s,o,m)),L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(l,u,m)),U=o,D=s,P=F;L>P&&(P=L,U=i,D=E),v>P&&(P=v,U=u,D=l);var B=N;B.x=.5*(U.x+D.x),B.y=.5*(U.y+D.y),B.z=.5*(U.z+D.z);var w=t.magnitudeSquared(t.subtract(D,B,m)),x=Math.sqrt(w),G=C;G.x=o.x,G.y=i.y,G.z=u.z;var b=I;b.x=s.x,b.y=E.y,b.z=l.z;var z=t.multiplyByScalar(t.add(G,b,m),.5,M),H=0;for(p=0;p<c;p++){t.clone(e[p],n);var V=t.magnitude(t.subtract(n,z,m));V>H&&(H=V);var X=t.magnitudeSquared(t.subtract(n,B,m));if(X>w){var q=Math.sqrt(X);x=.5*(x+q),w=x*x;var W=q-x;B.x=(x*B.x+W*n.x)/q,B.y=(x*B.y+W*n.y)/q,B.z=(x*B.z+W*n.z)/q}}return x<H?(t.clone(B,r.center),r.radius=x):(t.clone(z,r.center),r.radius=H),r};var p=new i,O=new t,g=new t,y=new e,F=new e;f.fromRectangle2D=function(t,e,r){return f.fromRectangleWithHeights2D(t,e,0,0,r)},f.fromRectangleWithHeights2D=function(e,r,o,i,u){if(a(u)||(u=new f),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;r=n(r,p),c.southwest(e,y),y.height=o,c.northeast(e,F),F.height=i;var s=r.project(y,O),E=r.project(F,g),l=E.x-s.x,_=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(l*l+_*_+R*R);var T=u.center;return T.x=s.x+.5*l,T.y=s.y+.5*_,T.z=s.z+.5*R,u};var L=[];f.fromRectangle3D=function(t,e,r,i){e=n(e,o.WGS84),r=n(r,0);var u;return a(t)&&(u=c.subsample(t,e,r,L)),f.fromPoints(u,i)},f.fromVertices=function(e,r,o,i){if(a(i)||(i=new f),!a(e)||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;r=n(r,t.ZERO),o=n(o,3);var u=S;u.x=e[0]+r.x,u.y=e[1]+r.y,u.z=e[2]+r.z;for(var s=t.clone(u,_),E=t.clone(u,R),l=t.clone(u,T),c=t.clone(u,h),p=t.clone(u,A),O=t.clone(u,d),g=e.length,y=0;y<g;y+=o){var F=e[y]+r.x,L=e[y+1]+r.y,v=e[y+2]+r.z;u.x=F,u.y=L,u.z=v,F<s.x&&t.clone(u,s),F>c.x&&t.clone(u,c),L<E.y&&t.clone(u,E),L>p.y&&t.clone(u,p),v<l.z&&t.clone(u,l),v>O.z&&t.clone(u,O)}var U=t.magnitudeSquared(t.subtract(c,s,m)),D=t.magnitudeSquared(t.subtract(p,E,m)),P=t.magnitudeSquared(t.subtract(O,l,m)),B=s,w=c,x=U;D>x&&(x=D,B=E,w=p),P>x&&(x=P,B=l,w=O);var G=N;G.x=.5*(B.x+w.x),G.y=.5*(B.y+w.y),G.z=.5*(B.z+w.z);var b=t.magnitudeSquared(t.subtract(w,G,m)),z=Math.sqrt(b),H=C;H.x=s.x,H.y=E.y,H.z=l.z;var V=I;V.x=c.x,V.y=p.y,V.z=O.z;var X=t.multiplyByScalar(t.add(H,V,m),.5,M),q=0;for(y=0;y<g;y+=o){u.x=e[y]+r.x,u.y=e[y+1]+r.y,u.z=e[y+2]+r.z;var W=t.magnitude(t.subtract(u,X,m));W>q&&(q=W);var Y=t.magnitudeSquared(t.subtract(u,G,m));if(Y>b){var K=Math.sqrt(Y);z=.5*(z+K),b=z*z;var k=K-z;G.x=(z*G.x+k*u.x)/K,G.y=(z*G.y+k*u.y)/K,G.z=(z*G.z+k*u.z)/K}}return z<q?(t.clone(G,i.center),i.radius=z):(t.clone(X,i.center),i.radius=q),i},f.fromEncodedCartesianVertices=function(e,r,n){if(a(n)||(n=new f),!a(e)||!a(r)||e.length!==r.length||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var o=S;o.x=e[0]+r[0],o.y=e[1]+r[1],o.z=e[2]+r[2];for(var i=t.clone(o,_),u=t.clone(o,R),s=t.clone(o,T),E=t.clone(o,h),l=t.clone(o,A),c=t.clone(o,d),p=e.length,O=0;O<p;O+=3){var g=e[O]+r[O],y=e[O+1]+r[O+1],F=e[O+2]+r[O+2];o.x=g,o.y=y,o.z=F,g<i.x&&t.clone(o,i),g>E.x&&t.clone(o,E),y<u.y&&t.clone(o,u),y>l.y&&t.clone(o,l),F<s.z&&t.clone(o,s),F>c.z&&t.clone(o,c)}var L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(l,u,m)),U=t.magnitudeSquared(t.subtract(c,s,m)),D=i,P=E,B=L;v>B&&(B=v,D=u,P=l),U>B&&(B=U,D=s,P=c);var w=N;w.x=.5*(D.x+P.x),w.y=.5*(D.y+P.y),w.z=.5*(D.z+P.z);var x=t.magnitudeSquared(t.subtract(P,w,m)),G=Math.sqrt(x),b=C;b.x=i.x,b.y=u.y,b.z=s.z;var z=I;z.x=E.x,z.y=l.y,z.z=c.z;var H=t.multiplyByScalar(t.add(b,z,m),.5,M),V=0;for(O=0;O<p;O+=3){o.x=e[O]+r[O],o.y=e[O+1]+r[O+1],o.z=e[O+2]+r[O+2];var X=t.magnitude(t.subtract(o,H,m));X>V&&(V=X);var q=t.magnitudeSquared(t.subtract(o,w,m));if(q>x){var W=Math.sqrt(q);G=.5*(G+W),x=G*G;var Y=W-G;w.x=(G*w.x+Y*o.x)/W,w.y=(G*w.y+Y*o.y)/W,w.z=(G*w.z+Y*o.z)/W}}return G<V?(t.clone(w,n.center),n.radius=G):(t.clone(H,n.center),n.radius=V),n},f.fromCornerPoints=function(e,r,n){a(n)||(n=new f);var o=n.center;return t.add(e,r,o),t.multiplyByScalar(o,.5,o),n.radius=t.distance(o,r),n},f.fromEllipsoid=function(e,r){return a(r)||(r=new f),t.clone(t.ZERO,r.center),r.radius=e.maximumRadius,r};var v=new t;f.fromBoundingSpheres=function(e,r){if(a(r)||(r=new f),!a(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var n=e.length;if(1===n)return f.clone(e[0],r);if(2===n)return f.union(e[0],e[1],r);for(var o=[],i=0;i<n;i++)o.push(e[i].center);r=f.fromPoints(o,r);var u=r.center,s=r.radius;for(i=0;i<n;i++){var E=e[i];s=Math.max(s,t.distance(u,E.center,v)+E.radius)}return r.radius=s,r};var U=new t,D=new t,P=new t;f.fromOrientedBoundingBox=function(e,r){a(r)||(r=new f);var n=e.halfAxes,o=E.getColumn(n,0,U),i=E.getColumn(n,1,D),u=E.getColumn(n,2,P),s=t.magnitude(o),l=t.magnitude(i),c=t.magnitude(u);return r.center=t.clone(e.center,r.center),r.radius=Math.max(s,l,c),r},f.clone=function(e,r){if(a(e))return a(r)?(r.center=t.clone(e.center,r.center),r.radius=e.radius,r):new f(e.center,e.radius)},f.packedLength=4,f.pack=function(t,e,r){r=n(r,0);var a=t.center;return e[r++]=a.x,e[r++]=a.y,e[r++]=a.z,e[r]=t.radius,e},f.unpack=function(t,e,r){e=n(e,0),a(r)||(r=new f);var o=r.center;return o.x=t[e++],o.y=t[e++],o.z=t[e++],r.radius=t[e],r};var B=new t,w=new t;f.union=function(e,r,n){a(n)||(n=new f);var o=e.center,i=e.radius,u=r.center,s=r.radius,E=t.subtract(u,o,B),l=t.magnitude(E);if(i>=l+s)return e.clone(n),n;if(s>=l+i)return r.clone(n),n;var c=.5*(i+l+s),_=t.multiplyByScalar(E,(-i+c)/l,w);return t.add(_,o,_),t.clone(_,n.center),n.radius=c,n};var x=new t;f.expand=function(e,r,n){n=f.clone(e,n);var a=t.magnitude(t.subtract(r,n.center,x));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(e,r){var n=e.center,a=e.radius,o=r.normal,i=t.dot(o,n)+r.distance;return i<-a?u.OUTSIDE:i<a?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(e,t.center,r.center),r.radius=l.getMaximumScale(e)*t.radius,r};var G=new t;f.distanceSquaredTo=function(e,r){var n=t.subtract(e.center,r,G);return t.magnitudeSquared(n)-e.radius*e.radius},f.transformWithoutScale=function(t,e,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(e,t.center,r.center),r.radius=t.radius,r};var b=new t;f.computePlaneDistances=function(e,r,n,o){a(o)||(o=new s);var i=t.subtract(e.center,r,b),u=t.dot(n,i);return o.start=u-e.radius,o.stop=u+e.radius,o};for(var z=new t,H=new t,V=new t,X=new t,q=new t,W=new e,Y=new Array(8),K=0;K<8;++K)Y[K]=new t;var k=new i;return f.projectTo2D=function(e,r,a){r=n(r,k);var o=r.ellipsoid,i=e.center,u=e.radius,s=o.geodeticSurfaceNormal(i,z),E=t.cross(t.UNIT_Z,s,H);t.normalize(E,E);var l=t.cross(s,E,V);t.normalize(l,l),t.multiplyByScalar(s,u,s),t.multiplyByScalar(l,u,l),t.multiplyByScalar(E,u,E);var c=t.negate(l,q),_=t.negate(E,X),R=Y,T=R[0];t.add(s,l,T),t.add(T,E,T),T=R[1],t.add(s,l,T),t.add(T,_,T),T=R[2],t.add(s,c,T),t.add(T,_,T),T=R[3],t.add(s,c,T),t.add(T,E,T),t.negate(s,s),T=R[4],t.add(s,l,T),t.add(T,E,T),T=R[5],t.add(s,l,T),t.add(T,_,T),T=R[6],t.add(s,c,T),t.add(T,_,T),T=R[7],t.add(s,c,T),t.add(T,E,T);for(var h=R.length,A=0;A<h;++A){var d=R[A];t.add(i,d,d);var S=o.cartesianToCartographic(d,W);r.project(S,d)}a=f.fromPoints(R,a),i=a.center;var m=i.x,N=i.y,C=i.z;return i.x=C,i.y=m,i.z=N,a},f.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},f.equals=function(e,r){return e===r||a(e)&&a(r)&&t.equals(e.center,r.center)&&e.radius===r.radius},f.prototype.intersectPlane=function(t){return f.intersectPlane(this,t)},f.prototype.distanceSquaredTo=function(t){return f.distanceSquaredTo(this,t)},f.prototype.computePlaneDistances=function(t,e,r){return f.computePlaneDistances(this,t,e,r)},f.prototype.isOccluded=function(t){return f.isOccluded(this,t)},f.prototype.equals=function(t){return f.equals(this,t)},f.prototype.clone=function(t){return f.clone(this,t)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(r))return r;r=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,o=["webkit","moz","o","ms","khtml"],i=0,u=o.length;i<u;++i){var s=o[i];a=s+"RequestFullscreen","function"==typeof e[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof e[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[n.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,r){"use strict";function n(t){for(var e=t.split("."),r=0,n=e.length;r<n;++r)e[r]=parseInt(e[r],10);return e}function a(){if(!e(N)&&(N=!1,!f())){var t=/ Chrome\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(N=!0,C=n(t[1]))}return N}function o(){return a()&&C}function i(){if(!e(I)&&(I=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(m.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(I=!0,M=n(t[1]))}return I}function u(){return i()&&M}function s(){if(!e(p)){p=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(m.userAgent);null!==t&&(p=!0,O=n(t[1]),O.isNightly=!!t[2])}return p}function E(){return s()&&O}function l(){if(!e(g)){g=!1;var t;"Microsoft Internet Explorer"===m.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1]))):"Netscape"===m.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1])))}return g}function c(){return l()&&y}function f(){if(!e(F)){F=!1;var t=/ Edge\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(F=!0,L=n(t[1]))}return F}function _(){return f()&&L}function R(){if(!e(v)){v=!1;var t=/Firefox\/([\.0-9]+)/.exec(m.userAgent); -null!==t&&(v=!0,U=n(t[1]))}return v}function T(){return e(D)||(D=/Windows/i.test(m.appVersion)),D}function h(){return R()&&U}function A(){return e(P)||(P="undefined"!=typeof PointerEvent&&(!e(m.pointerEnabled)||m.pointerEnabled)),P}function d(){if(!e(w)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=t.style.imageRendering;w=e(r)&&""!==r,w&&(B=r)}return w}function S(){return d()?B:void 0}var m;m="undefined"!=typeof navigator?navigator:{};var N,C,I,M,p,O,g,y,F,L,v,U,D,P,B,w,x={isChrome:a,chromeVersion:o,isSafari:i,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:l,internetExplorerVersion:c,isEdge:f,edgeVersion:_,isFirefox:R,firefoxVersion:h,isWindows:T,hardwareConcurrency:t(m.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:S};return x.supportsFullscreen=function(){return r.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(e,r,n,a){this.red=t(e,1),this.green=t(r,1),this.blue=t(n,1),this.alpha=t(a,1)}u.fromCartesian4=function(t,r){return e(r)?(r.red=t.x,r.green=t.y,r.blue=t.z,r.alpha=t.w,r):new u(t.x,t.y,t.z,t.w)},u.fromBytes=function(r,n,a,o,i){return r=u.byteToFloat(t(r,255)),n=u.byteToFloat(t(n,255)),a=u.byteToFloat(t(a,255)),o=u.byteToFloat(t(o,255)),e(i)?(i.red=r,i.green=n,i.blue=a,i.alpha=o,i):new u(r,n,a,o)},u.fromAlpha=function(t,r,n){return e(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=r,n):new u(t.red,t.green,t.blue,r)};var s,E,l;n.supportsTypedArrays()&&(s=new ArrayBuffer(4),E=new Uint32Array(s),l=new Uint8Array(s)),u.fromRgba=function(t,e){return E[0]=t,u.fromBytes(l[0],l[1],l[2],l[3],e)},u.fromHsl=function(r,n,a,o,s){r=t(r,0)%1,n=t(n,0),a=t(a,0),o=t(o,1);var E=a,l=a,c=a;if(0!==n){var f;f=a<.5?a*(1+n):a+n-a*n;var _=2*a-f;E=i(_,f,r+1/3),l=i(_,f,r),c=i(_,f,r-1/3)}return e(s)?(s.red=E,s.green=l,s.blue=c,s.alpha=o,s):new u(E,l,c,o)},u.fromRandom=function(r,n){r=t(r,t.EMPTY_OBJECT);var a=r.red;if(!e(a)){var i=t(r.minimumRed,0),s=t(r.maximumRed,1);a=i+o.nextRandomNumber()*(s-i)}var E=r.green;if(!e(E)){var l=t(r.minimumGreen,0),c=t(r.maximumGreen,1);E=l+o.nextRandomNumber()*(c-l)}var f=r.blue;if(!e(f)){var _=t(r.minimumBlue,0),R=t(r.maximumBlue,1);f=_+o.nextRandomNumber()*(R-_)}var T=r.alpha;if(!e(T)){var h=t(r.minimumAlpha,0),A=t(r.maximumAlpha,1);T=h+o.nextRandomNumber()*(A-h)}return e(n)?(n.red=a,n.green=E,n.blue=f,n.alpha=T,n):new u(a,E,f,T)};var c=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,f=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,_=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return u.fromCssColorString=function(r,n){e(n)||(n=new u);var a=u[r.toUpperCase()];if(e(a))return u.clone(a,n),n;var o=c.exec(r);return null!==o?(n.red=parseInt(o[1],16)/15,n.green=parseInt(o[2],16)/15,n.blue=parseInt(o[3],16)/15,n.alpha=1,n):(o=f.exec(r),null!==o?(n.red=parseInt(o[1],16)/255,n.green=parseInt(o[2],16)/255,n.blue=parseInt(o[3],16)/255,n.alpha=1,n):(o=_.exec(r),null!==o?(n.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),n.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),n.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),n.alpha=parseFloat(t(o[4],"1.0")),n):(o=R.exec(r),null!==o?u.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0")),n):n=void 0)))},u.packedLength=4,u.pack=function(e,r,n){return n=t(n,0),r[n++]=e.red,r[n++]=e.green,r[n++]=e.blue,r[n]=e.alpha,r},u.unpack=function(r,n,a){return n=t(n,0),e(a)||(a=new u),a.red=r[n++],a.green=r[n++],a.blue=r[n++],a.alpha=r[n],a},u.byteToFloat=function(t){return t/255},u.floatToByte=function(t){return 1===t?255:256*t|0},u.clone=function(t,r){if(e(t))return e(r)?(r.red=t.red,r.green=t.green,r.blue=t.blue,r.alpha=t.alpha,r):new u(t.red,t.green,t.blue,t.alpha)},u.equals=function(t,r){return t===r||e(t)&&e(r)&&t.red===r.red&&t.green===r.green&&t.blue===r.blue&&t.alpha===r.alpha},u.equalsArray=function(t,e,r){return t.red===e[r]&&t.green===e[r+1]&&t.blue===e[r+2]&&t.alpha===e[r+3]},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,r){return this===t||e(t)&&Math.abs(this.red-t.red)<=r&&Math.abs(this.green-t.green)<=r&&Math.abs(this.blue-t.blue)<=r&&Math.abs(this.alpha-t.alpha)<=r},u.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},u.prototype.toCssColorString=function(){var t=u.floatToByte(this.red),e=u.floatToByte(this.green),r=u.floatToByte(this.blue);return 1===this.alpha?"rgb("+t+","+e+","+r+")":"rgba("+t+","+e+","+r+","+this.alpha+")"},u.prototype.toBytes=function(t){var r=u.floatToByte(this.red),n=u.floatToByte(this.green),a=u.floatToByte(this.blue),o=u.floatToByte(this.alpha);return e(t)?(t[0]=r,t[1]=n,t[2]=a,t[3]=o,t):[r,n,a,o]},u.prototype.toRgba=function(){return l[0]=u.floatToByte(this.red),l[1]=u.floatToByte(this.green),l[2]=u.floatToByte(this.blue),l[3]=u.floatToByte(this.alpha),E[0]},u.prototype.brighten=function(t,e){return t=1-t,e.red=1-(1-this.red)*t,e.green=1-(1-this.green)*t,e.blue=1-(1-this.blue)*t,e.alpha=this.alpha,e},u.prototype.darken=function(t,e){return t=1-t,e.red=this.red*t,e.green=this.green*t,e.blue=this.blue*t,e.alpha=this.alpha,e},u.prototype.withAlpha=function(t,e){return u.fromAlpha(this,t,e)},u.add=function(t,e,r){return r.red=t.red+e.red,r.green=t.green+e.green,r.blue=t.blue+e.blue,r.alpha=t.alpha+e.alpha,r},u.subtract=function(t,e,r){return r.red=t.red-e.red,r.green=t.green-e.green,r.blue=t.blue-e.blue,r.alpha=t.alpha-e.alpha,r},u.multiply=function(t,e,r){return r.red=t.red*e.red,r.green=t.green*e.green,r.blue=t.blue*e.blue,r.alpha=t.alpha*e.alpha,r},u.divide=function(t,e,r){return r.red=t.red/e.red,r.green=t.green/e.green,r.blue=t.blue/e.blue,r.alpha=t.alpha/e.alpha,r},u.mod=function(t,e,r){return r.red=t.red%e.red,r.green=t.green%e.green,r.blue=t.blue%e.blue,r.alpha=t.alpha%e.alpha,r},u.multiplyByScalar=function(t,e,r){return r.red=t.red*e,r.green=t.green*e,r.blue=t.blue*e,r.alpha=t.alpha*e,r},u.divideByScalar=function(t,e,r){return r.red=t.red/e,r.green=t.green/e,r.blue=t.blue/e,r.alpha=t.alpha/e,r},u.ALICEBLUE=a(u.fromCssColorString("#F0F8FF")),u.ANTIQUEWHITE=a(u.fromCssColorString("#FAEBD7")),u.AQUA=a(u.fromCssColorString("#00FFFF")),u.AQUAMARINE=a(u.fromCssColorString("#7FFFD4")),u.AZURE=a(u.fromCssColorString("#F0FFFF")),u.BEIGE=a(u.fromCssColorString("#F5F5DC")),u.BISQUE=a(u.fromCssColorString("#FFE4C4")),u.BLACK=a(u.fromCssColorString("#000000")),u.BLANCHEDALMOND=a(u.fromCssColorString("#FFEBCD")),u.BLUE=a(u.fromCssColorString("#0000FF")),u.BLUEVIOLET=a(u.fromCssColorString("#8A2BE2")),u.BROWN=a(u.fromCssColorString("#A52A2A")),u.BURLYWOOD=a(u.fromCssColorString("#DEB887")),u.CADETBLUE=a(u.fromCssColorString("#5F9EA0")),u.CHARTREUSE=a(u.fromCssColorString("#7FFF00")),u.CHOCOLATE=a(u.fromCssColorString("#D2691E")),u.CORAL=a(u.fromCssColorString("#FF7F50")),u.CORNFLOWERBLUE=a(u.fromCssColorString("#6495ED")),u.CORNSILK=a(u.fromCssColorString("#FFF8DC")),u.CRIMSON=a(u.fromCssColorString("#DC143C")),u.CYAN=a(u.fromCssColorString("#00FFFF")),u.DARKBLUE=a(u.fromCssColorString("#00008B")),u.DARKCYAN=a(u.fromCssColorString("#008B8B")),u.DARKGOLDENROD=a(u.fromCssColorString("#B8860B")),u.DARKGRAY=a(u.fromCssColorString("#A9A9A9")),u.DARKGREEN=a(u.fromCssColorString("#006400")),u.DARKGREY=u.DARKGRAY,u.DARKKHAKI=a(u.fromCssColorString("#BDB76B")),u.DARKMAGENTA=a(u.fromCssColorString("#8B008B")),u.DARKOLIVEGREEN=a(u.fromCssColorString("#556B2F")),u.DARKORANGE=a(u.fromCssColorString("#FF8C00")),u.DARKORCHID=a(u.fromCssColorString("#9932CC")),u.DARKRED=a(u.fromCssColorString("#8B0000")),u.DARKSALMON=a(u.fromCssColorString("#E9967A")),u.DARKSEAGREEN=a(u.fromCssColorString("#8FBC8F")),u.DARKSLATEBLUE=a(u.fromCssColorString("#483D8B")),u.DARKSLATEGRAY=a(u.fromCssColorString("#2F4F4F")),u.DARKSLATEGREY=u.DARKSLATEGRAY,u.DARKTURQUOISE=a(u.fromCssColorString("#00CED1")),u.DARKVIOLET=a(u.fromCssColorString("#9400D3")),u.DEEPPINK=a(u.fromCssColorString("#FF1493")),u.DEEPSKYBLUE=a(u.fromCssColorString("#00BFFF")),u.DIMGRAY=a(u.fromCssColorString("#696969")),u.DIMGREY=u.DIMGRAY,u.DODGERBLUE=a(u.fromCssColorString("#1E90FF")),u.FIREBRICK=a(u.fromCssColorString("#B22222")),u.FLORALWHITE=a(u.fromCssColorString("#FFFAF0")),u.FORESTGREEN=a(u.fromCssColorString("#228B22")),u.FUCHSIA=a(u.fromCssColorString("#FF00FF")),u.GAINSBORO=a(u.fromCssColorString("#DCDCDC")),u.GHOSTWHITE=a(u.fromCssColorString("#F8F8FF")),u.GOLD=a(u.fromCssColorString("#FFD700")),u.GOLDENROD=a(u.fromCssColorString("#DAA520")),u.GRAY=a(u.fromCssColorString("#808080")),u.GREEN=a(u.fromCssColorString("#008000")),u.GREENYELLOW=a(u.fromCssColorString("#ADFF2F")),u.GREY=u.GRAY,u.HONEYDEW=a(u.fromCssColorString("#F0FFF0")),u.HOTPINK=a(u.fromCssColorString("#FF69B4")),u.INDIANRED=a(u.fromCssColorString("#CD5C5C")),u.INDIGO=a(u.fromCssColorString("#4B0082")),u.IVORY=a(u.fromCssColorString("#FFFFF0")),u.KHAKI=a(u.fromCssColorString("#F0E68C")),u.LAVENDER=a(u.fromCssColorString("#E6E6FA")),u.LAVENDAR_BLUSH=a(u.fromCssColorString("#FFF0F5")),u.LAWNGREEN=a(u.fromCssColorString("#7CFC00")),u.LEMONCHIFFON=a(u.fromCssColorString("#FFFACD")),u.LIGHTBLUE=a(u.fromCssColorString("#ADD8E6")),u.LIGHTCORAL=a(u.fromCssColorString("#F08080")),u.LIGHTCYAN=a(u.fromCssColorString("#E0FFFF")),u.LIGHTGOLDENRODYELLOW=a(u.fromCssColorString("#FAFAD2")),u.LIGHTGRAY=a(u.fromCssColorString("#D3D3D3")),u.LIGHTGREEN=a(u.fromCssColorString("#90EE90")),u.LIGHTGREY=u.LIGHTGRAY,u.LIGHTPINK=a(u.fromCssColorString("#FFB6C1")),u.LIGHTSEAGREEN=a(u.fromCssColorString("#20B2AA")),u.LIGHTSKYBLUE=a(u.fromCssColorString("#87CEFA")),u.LIGHTSLATEGRAY=a(u.fromCssColorString("#778899")),u.LIGHTSLATEGREY=u.LIGHTSLATEGRAY,u.LIGHTSTEELBLUE=a(u.fromCssColorString("#B0C4DE")),u.LIGHTYELLOW=a(u.fromCssColorString("#FFFFE0")),u.LIME=a(u.fromCssColorString("#00FF00")),u.LIMEGREEN=a(u.fromCssColorString("#32CD32")),u.LINEN=a(u.fromCssColorString("#FAF0E6")),u.MAGENTA=a(u.fromCssColorString("#FF00FF")),u.MAROON=a(u.fromCssColorString("#800000")),u.MEDIUMAQUAMARINE=a(u.fromCssColorString("#66CDAA")),u.MEDIUMBLUE=a(u.fromCssColorString("#0000CD")),u.MEDIUMORCHID=a(u.fromCssColorString("#BA55D3")),u.MEDIUMPURPLE=a(u.fromCssColorString("#9370DB")),u.MEDIUMSEAGREEN=a(u.fromCssColorString("#3CB371")),u.MEDIUMSLATEBLUE=a(u.fromCssColorString("#7B68EE")),u.MEDIUMSPRINGGREEN=a(u.fromCssColorString("#00FA9A")),u.MEDIUMTURQUOISE=a(u.fromCssColorString("#48D1CC")),u.MEDIUMVIOLETRED=a(u.fromCssColorString("#C71585")),u.MIDNIGHTBLUE=a(u.fromCssColorString("#191970")),u.MINTCREAM=a(u.fromCssColorString("#F5FFFA")),u.MISTYROSE=a(u.fromCssColorString("#FFE4E1")),u.MOCCASIN=a(u.fromCssColorString("#FFE4B5")),u.NAVAJOWHITE=a(u.fromCssColorString("#FFDEAD")),u.NAVY=a(u.fromCssColorString("#000080")),u.OLDLACE=a(u.fromCssColorString("#FDF5E6")),u.OLIVE=a(u.fromCssColorString("#808000")),u.OLIVEDRAB=a(u.fromCssColorString("#6B8E23")),u.ORANGE=a(u.fromCssColorString("#FFA500")),u.ORANGERED=a(u.fromCssColorString("#FF4500")),u.ORCHID=a(u.fromCssColorString("#DA70D6")),u.PALEGOLDENROD=a(u.fromCssColorString("#EEE8AA")),u.PALEGREEN=a(u.fromCssColorString("#98FB98")),u.PALETURQUOISE=a(u.fromCssColorString("#AFEEEE")),u.PALEVIOLETRED=a(u.fromCssColorString("#DB7093")),u.PAPAYAWHIP=a(u.fromCssColorString("#FFEFD5")),u.PEACHPUFF=a(u.fromCssColorString("#FFDAB9")),u.PERU=a(u.fromCssColorString("#CD853F")),u.PINK=a(u.fromCssColorString("#FFC0CB")),u.PLUM=a(u.fromCssColorString("#DDA0DD")),u.POWDERBLUE=a(u.fromCssColorString("#B0E0E6")),u.PURPLE=a(u.fromCssColorString("#800080")),u.RED=a(u.fromCssColorString("#FF0000")),u.ROSYBROWN=a(u.fromCssColorString("#BC8F8F")),u.ROYALBLUE=a(u.fromCssColorString("#4169E1")),u.SADDLEBROWN=a(u.fromCssColorString("#8B4513")),u.SALMON=a(u.fromCssColorString("#FA8072")),u.SANDYBROWN=a(u.fromCssColorString("#F4A460")),u.SEAGREEN=a(u.fromCssColorString("#2E8B57")),u.SEASHELL=a(u.fromCssColorString("#FFF5EE")),u.SIENNA=a(u.fromCssColorString("#A0522D")),u.SILVER=a(u.fromCssColorString("#C0C0C0")),u.SKYBLUE=a(u.fromCssColorString("#87CEEB")),u.SLATEBLUE=a(u.fromCssColorString("#6A5ACD")),u.SLATEGRAY=a(u.fromCssColorString("#708090")),u.SLATEGREY=u.SLATEGRAY,u.SNOW=a(u.fromCssColorString("#FFFAFA")),u.SPRINGGREEN=a(u.fromCssColorString("#00FF7F")),u.STEELBLUE=a(u.fromCssColorString("#4682B4")),u.TAN=a(u.fromCssColorString("#D2B48C")),u.TEAL=a(u.fromCssColorString("#008080")),u.THISTLE=a(u.fromCssColorString("#D8BFD8")),u.TOMATO=a(u.fromCssColorString("#FF6347")),u.TURQUOISE=a(u.fromCssColorString("#40E0D0")),u.VIOLET=a(u.fromCssColorString("#EE82EE")),u.WHEAT=a(u.fromCssColorString("#F5DEB3")),u.WHITE=a(u.fromCssColorString("#FFFFFF")),u.WHITESMOKE=a(u.fromCssColorString("#F5F5F5")),u.YELLOW=a(u.fromCssColorString("#FFFF00")),u.YELLOWGREEN=a(u.fromCssColorString("#9ACD32")),u.TRANSPARENT=a(new u(0,0,0,0)),u}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,r,n,a,o){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return i.getSizeInBytes=function(t){switch(t){case i.BYTE:return Int8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.SHORT:return Int16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.INT:return Int32Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case i.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},i.fromTypedArray=function(t){return t instanceof Int8Array?i.BYTE:t instanceof Uint8Array?i.UNSIGNED_BYTE:t instanceof Int16Array?i.SHORT:t instanceof Uint16Array?i.UNSIGNED_SHORT:t instanceof Int32Array?i.INT:t instanceof Uint32Array?i.UNSIGNED_INT:t instanceof Float32Array?i.FLOAT:t instanceof Float64Array?i.DOUBLE:void 0},i.validate=function(t){return e(t)&&(t===i.BYTE||t===i.UNSIGNED_BYTE||t===i.SHORT||t===i.UNSIGNED_SHORT||t===i.INT||t===i.UNSIGNED_INT||t===i.FLOAT||t===i.DOUBLE)},i.createTypedArray=function(t,e){switch(t){case i.BYTE:return new Int8Array(e);case i.UNSIGNED_BYTE:return new Uint8Array(e);case i.SHORT:return new Int16Array(e);case i.UNSIGNED_SHORT:return new Uint16Array(e);case i.INT:return new Int32Array(e);case i.UNSIGNED_INT:return new Uint32Array(e);case i.FLOAT:return new Float32Array(e);case i.DOUBLE:return new Float64Array(e)}},i.createArrayBufferView=function(e,r,n,a){switch(n=t(n,0),a=t(a,(r.byteLength-n)/i.getSizeInBytes(e)),e){case i.BYTE:return new Int8Array(r,n,a);case i.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case i.SHORT:return new Int16Array(r,n,a);case i.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case i.INT:return new Int32Array(r,n,a);case i.UNSIGNED_INT:return new Uint32Array(r,n,a);case i.FLOAT:return new Float32Array(r,n,a);case i.DOUBLE:return new Float64Array(r,n,a)}},i.fromName=function(t){switch(t){case"BYTE":return i.BYTE;case"UNSIGNED_BYTE":return i.UNSIGNED_BYTE;case"SHORT":return i.SHORT;case"UNSIGNED_SHORT":return i.UNSIGNED_SHORT;case"INT":return i.INT;case"UNSIGNED_INT":return i.UNSIGNED_INT;case"FLOAT":return i.FLOAT;case"DOUBLE":return i.DOUBLE}},a(i)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var r={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN}};return t(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,r,n,a){"use strict";function o(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,n.NONE),this.boundingSphereCV=e.boundingSphereCV}return o.computeNumberOfVertices=function(t){var r=-1;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&e(t.attributes[n])&&e(t.attributes[n].values)){var a=t.attributes[n],o=a.values.length/a.componentsPerAttribute;r=o}return r},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,r){"use strict";function n(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,r,n,a){"use strict";var o={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return o.getSizeInBytes=function(t){switch(t){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(e){return t(e)&&(e===o.UNSIGNED_BYTE||e===o.UNSIGNED_SHORT||e===o.UNSIGNED_INT)},o.createTypedArray=function(t,e){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},o.createTypedArrayFromArrayBuffer=function(t,e,r,a){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,r,a):new Uint16Array(e,r,a)},r(o)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t){ -var e=t._uSquared,r=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,a=(r-n)/r,o=Math.cos(t._startHeading),i=Math.sin(t._startHeading),u=(1-a)*Math.tan(t._start.latitude),s=1/Math.sqrt(1+u*u),E=s*u,l=Math.atan2(u,o),c=s*i,f=c*c,_=1-f,R=Math.sqrt(_),T=e/4,h=T*T,A=h*T,d=h*h,S=1+T-3*h/4+5*A/4-175*d/64,m=1-T+15*h/8-35*A/8,N=1-3*T+35*h/4,C=1-5*T,I=S*l-m*Math.sin(2*l)*T/2-N*Math.sin(4*l)*h/16-C*Math.sin(6*l)*A/48-5*Math.sin(8*l)*d/512,M=t._constants;M.a=r,M.b=n,M.f=a,M.cosineHeading=o,M.sineHeading=i,M.tanU=u,M.cosineU=s,M.sineU=E,M.sigma=l,M.sineAlpha=c,M.sineSquaredAlpha=f,M.cosineSquaredAlpha=_,M.cosineAlpha=R,M.u2Over4=T,M.u4Over16=h,M.u6Over64=A,M.u8Over256=d,M.a0=S,M.a1=m,M.a2=N,M.a3=C,M.distanceRatio=I}function E(t,e){return t*e*(4+t*(4-3*e))/16}function l(t,e,r,n,a,o,i){var u=E(t,r);return(1-u)*t*e*(n+u*a*(i+u*o*(2*i*i-1)))}function c(t,e,r,n,a,o,i){var s,E,c,f,_,R=(e-r)/e,T=o-n,h=Math.atan((1-R)*Math.tan(a)),A=Math.atan((1-R)*Math.tan(i)),d=Math.cos(h),S=Math.sin(h),m=Math.cos(A),N=Math.sin(A),C=d*m,I=d*N,M=S*N,p=S*m,O=T,g=u.TWO_PI,y=Math.cos(O),F=Math.sin(O);do{y=Math.cos(O),F=Math.sin(O);var L=I-p*y;c=Math.sqrt(m*m*F*F+L*L),E=M+C*y,s=Math.atan2(c,E);var v;0===c?(v=0,f=1):(v=C*F/c,f=1-v*v),g=O,_=E-2*M/f,isNaN(_)&&(_=0),O=T+l(R,v,f,s,c,E,_)}while(Math.abs(O-g)>u.EPSILON12);var U=f*(e*e-r*r)/(r*r),D=1+U*(4096+U*(U*(320-175*U)-768))/16384,P=U*(256+U*(U*(74-47*U)-128))/1024,B=_*_,w=P*c*(_+P*(E*(2*B-1)-P*_*(4*c*c-3)*(4*B-3)/6)/4),x=r*D*(s-w),G=Math.atan2(m*F,I-p*y),b=Math.atan2(d*F,I*y-p);t._distance=x,t._startHeading=G,t._endHeading=b,t._uSquared=U}function f(r,n,a,o){t.normalize(o.cartographicToCartesian(n,T),R),t.normalize(o.cartographicToCartesian(a,T),T);c(r,o.maximumRadius,o.minimumRadius,n.longitude,n.latitude,a.longitude,a.latitude),r._start=e.clone(n,r._start),r._end=e.clone(a,r._end),r._start.height=0,r._end.height=0,s(r)}function _(t,a,o){var u=r(o,i.WGS84);this._ellipsoid=u,this._start=new e,this._end=new e,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n(t)&&n(a)&&f(this,t,a,u)}var R=new t,T=new t;return a(_.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}}}),_.prototype.setEndPoints=function(t,e){f(this,t,e,this._ellipsoid)},_.prototype.interpolateUsingFraction=function(t,e){return this.interpolateUsingSurfaceDistance(this._distance*t,e)},_.prototype.interpolateUsingSurfaceDistance=function(t,r){var a=this._constants,o=a.distanceRatio+t/a.b,i=Math.cos(2*o),u=Math.cos(4*o),s=Math.cos(6*o),E=Math.sin(2*o),c=Math.sin(4*o),f=Math.sin(6*o),_=Math.sin(8*o),R=o*o,T=o*R,h=a.u8Over256,A=a.u2Over4,d=a.u6Over64,S=a.u4Over16,m=2*T*h*i/3+o*(1-A+7*S/4-15*d/4+579*h/64-(S-15*d/4+187*h/16)*i-(5*d/4-115*h/16)*u-29*h*s/16)+(A/2-S+71*d/32-85*h/16)*E+(5*S/16-5*d/4+383*h/96)*c-R*((d-11*h/2)*E+5*h*c/2)+(29*d/96-29*h/16)*f+539*h*_/1536,N=Math.asin(Math.sin(m)*a.cosineAlpha),C=Math.atan(a.a/a.b*Math.tan(N));m-=a.sigma;var I=Math.cos(2*a.sigma+m),M=Math.sin(m),p=Math.cos(m),O=a.cosineU*p,g=a.sineU*M,y=Math.atan2(M*a.sineHeading,O-g*a.cosineHeading),F=y-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,m,M,p,I);return n(r)?(r.longitude=this._start.longitude+F,r.latitude=C,r.height=0,r):new e(this._start.longitude+F,C,0)},_}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(t,e){"use strict";function r(t,r,n){var a=t+r;return e.sign(t)!==e.sign(r)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(t,e,r){var n=e*e-4*t*r;return n},n.computeRealRoots=function(t,n,a){var o;if(0===t)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var i=Math.abs(a),u=Math.abs(t);if(i<u&&i/u<e.EPSILON14)return[0,0];if(i>u&&u/i<e.EPSILON14)return[];if(o=-a/t,o<0)return[];var s=Math.sqrt(o);return[-s,s]}if(0===a)return o=-n/t,o<0?[o,0]:[0,o];var E=n*n,l=4*t*a,c=r(E,-l,e.EPSILON14);if(c<0)return[];var f=-.5*r(n,e.sign(n)*Math.sqrt(c),e.EPSILON14);return n>0?[f/t,a/f]:[a/f,f/t]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(t,e){"use strict";function r(t,e,r,n){var a,o,i=t,u=e/3,s=r/3,E=n,l=i*s,c=u*E,f=u*u,_=s*s,R=i*s-f,T=i*E-u*s,h=u*E-_,A=4*R*h-T*T;if(A<0){var d,S,m;f*c>=l*_?(d=i,S=R,m=-2*u*R+i*T):(d=E,S=h,m=-E*T+2*s*h);var N=m<0?-1:1,C=-N*Math.abs(d)*Math.sqrt(-A);o=-m+C;var I=o/2,M=I<0?-Math.pow(-I,1/3):Math.pow(I,1/3),p=o===C?-M:-S/M;return a=S<=0?M+p:-m/(M*M+p*p+S),f*c>=l*_?[(a-u)/i]:[-E/(a+s)]}var O=R,g=-2*u*R+i*T,y=h,F=-E*T+2*s*h,L=Math.sqrt(A),v=Math.sqrt(3)/2,U=Math.abs(Math.atan2(i*L,-g)/3);a=2*Math.sqrt(-O);var D=Math.cos(U);o=a*D;var P=a*(-D/2-v*Math.sin(U)),B=o+P>2*u?o-u:P-u,w=i,x=B/w;U=Math.abs(Math.atan2(E*L,-F)/3),a=2*Math.sqrt(-y),D=Math.cos(U),o=a*D,P=a*(-D/2-v*Math.sin(U));var G=-E,b=o+P<2*s?o+s:P+s,z=G/b,H=w*b,V=-B*b-w*G,X=B*G,q=(s*V-u*X)/(-u*V+s*H);return x<=q?x<=z?q<=z?[x,q,z]:[x,z,q]:[z,x,q]:x<=z?[q,x,z]:q<=z?[q,z,x]:[z,q,x]}var n={};return n.computeDiscriminant=function(t,e,r,n){var a=t*t,o=e*e,i=r*r,u=n*n,s=18*t*e*r*n+o*i-27*a*u-4*(t*i*r+o*e*n);return s},n.computeRealRoots=function(t,n,a,o){var i,u;if(0===t)return e.computeRealRoots(n,a,o);if(0===n){if(0===a){if(0===o)return[0,0,0];u=-o/t;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===o?(i=e.computeRealRoots(t,0,a),0===i.Length?[0]:[i[0],0,i[1]]):r(t,0,a,o)}return 0===a?0===o?(u=-n/t,u<0?[u,0,0]:[0,0,u]):r(t,n,0,o):0===o?(i=e.computeRealRoots(t,n,a),0===i.length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]):r(t,n,a,o)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(t,e,r,n){"use strict";function a(e,a,o,i){var u=e*e,s=a-3*u/8,E=o-a*e/2+u*e/8,l=i-o*e/4+a*u/16-3*u*u/256,c=t.computeRealRoots(1,2*s,s*s-4*l,-E*E);if(c.length>0){var f=-e/4,_=c[c.length-1];if(Math.abs(_)<r.EPSILON14){var R=n.computeRealRoots(1,s,l);if(2===R.length){var T,h=R[0],A=R[1];if(h>=0&&A>=0){var d=Math.sqrt(h),S=Math.sqrt(A);return[f-S,f-d,f+d,f+S]}if(h>=0&&A<0)return T=Math.sqrt(h),[f-T,f+T];if(h<0&&A>=0)return T=Math.sqrt(A),[f-T,f+T]}return[]}if(_>0){var m=Math.sqrt(_),N=(s+_-E/m)/2,C=(s+_+E/m)/2,I=n.computeRealRoots(1,m,N),M=n.computeRealRoots(1,-m,C);return 0!==I.length?(I[0]+=f,I[1]+=f,0!==M.length?(M[0]+=f,M[1]+=f,I[1]<=M[0]?[I[0],I[1],M[0],M[1]]:M[1]<=I[0]?[M[0],M[1],I[0],I[1]]:I[0]>=M[0]&&I[1]<=M[1]?[M[0],I[0],I[1],M[1]]:M[0]>=I[0]&&M[1]<=I[1]?[I[0],M[0],M[1],I[1]]:I[0]>M[0]&&I[0]<M[1]?[M[0],I[0],M[1],I[1]]:[I[0],M[0],I[1],M[1]]):I):0!==M.length?(M[0]+=f,M[1]+=f,M):[]}}return[]}function o(e,a,o,i){var u=o*o,s=a*a,E=e*e,l=-2*a,c=o*e+s-4*i,f=E*i-o*a*e+u,_=t.computeRealRoots(1,l,c,f);if(_.length>0){var R,T,h=_[0],A=a-h,d=A*A,S=e/2,m=A/2,N=d-4*i,C=d+4*Math.abs(i),I=E-4*h,M=E+4*Math.abs(h);if(h<0||N*M<I*C){var p=Math.sqrt(I);R=p/2,T=0===p?0:(e*m-o)/p}else{var O=Math.sqrt(N);R=0===O?0:(e*m-o)/O,T=O/2}var g,y;0===S&&0===R?(g=0,y=0):r.sign(S)===r.sign(R)?(g=S+R,y=h/g):(y=S-R,g=h/y);var F,L;0===m&&0===T?(F=0,L=0):r.sign(m)===r.sign(T)?(F=m+T,L=i/F):(L=m-T,F=i/L);var v=n.computeRealRoots(1,g,F),U=n.computeRealRoots(1,y,L);if(0!==v.length)return 0!==U.length?v[1]<=U[0]?[v[0],v[1],U[0],U[1]]:U[1]<=v[0]?[U[0],U[1],v[0],v[1]]:v[0]>=U[0]&&v[1]<=U[1]?[U[0],v[0],v[1],U[1]]:U[0]>=v[0]&&U[1]<=v[1]?[v[0],U[0],U[1],v[1]]:v[0]>U[0]&&v[0]<U[1]?[U[0],v[0],U[1],v[1]]:[v[0],U[0],v[1],U[1]]:v;if(0!==U.length)return U}return[]}var i={};return i.computeDiscriminant=function(t,e,r,n,a){var o=t*t,i=o*t,u=e*e,s=u*e,E=r*r,l=E*r,c=n*n,f=c*n,_=a*a,R=_*a,T=u*E*c-4*s*f-4*t*l*c+18*t*e*r*f-27*o*c*c+256*i*R+a*(18*s*r*n-4*u*l+16*t*E*E-80*t*e*E*n-6*t*u*c+144*o*r*c)+_*(144*t*u*r-27*u*u-128*o*E-192*o*e*n);return T},i.computeRealRoots=function(e,n,i,u,s){if(Math.abs(e)<r.EPSILON15)return t.computeRealRoots(n,i,u,s);var E=n/e,l=i/e,c=u/e,f=s/e,_=E<0?1:0;switch(_+=l<0?_+1:_,_+=c<0?_+1:_,_+=f<0?_+1:_){case 0:return a(E,l,c,f);case 1:return o(E,l,c,f);case 2:return o(E,l,c,f);case 3:return a(E,l,c,f);case 4:return a(E,l,c,f);case 5:return o(E,l,c,f);case 6:return a(E,l,c,f);case 7:return a(E,l,c,f);case 8:return o(E,l,c,f);case 9:return a(E,l,c,f);case 10:return a(E,l,c,f);case 11:return o(E,l,c,f);case 12:return a(E,l,c,f);case 13:return a(E,l,c,f);case 14:return a(E,l,c,f);case 15:return a(E,l,c,f);default:return}},i}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";function a(r,n){n=t.clone(e(n,t.ZERO)),t.equals(n,t.ZERO)||t.normalize(n,n),this.origin=t.clone(e(r,t.ZERO)),this.direction=n}return a.getPoint=function(e,n,a){return r(a)||(a=new t),a=t.multiplyByScalar(e.direction,n,a),t.add(e.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(t,e,r,n,a,o,i,u,s,E,l){"use strict";function c(t,e,r,n){var a=e*e-4*t*r;if(!(a<0)){if(a>0){var o=1/(2*t),i=Math.sqrt(a),u=(-e+i)*o,s=(-e-i)*o;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var E=-e/(2*t);if(0!==E)return n.root0=n.root1=E,n}}function f(e,r,a){n(a)||(a=new o);var i=e.origin,u=e.direction,s=r.center,E=r.radius*r.radius,l=t.subtract(i,s,d),f=t.dot(u,u),_=2*t.dot(u,l),R=t.magnitudeSquared(l)-E,T=c(f,_,R,C);if(n(T))return a.start=T.root0,a.stop=T.root1,a}function _(t,e,r){var n=t+e;return i.sign(t)!==i.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}function R(e,r,n,a,o){var l,c=a*a,f=o*o,R=(e[u.COLUMN1ROW1]-e[u.COLUMN2ROW2])*f,T=o*(a*_(e[u.COLUMN1ROW0],e[u.COLUMN0ROW1],i.EPSILON15)+r.y),h=e[u.COLUMN0ROW0]*c+e[u.COLUMN2ROW2]*f+a*r.x+n,A=f*_(e[u.COLUMN2ROW1],e[u.COLUMN1ROW2],i.EPSILON15),d=o*(a*_(e[u.COLUMN2ROW0],e[u.COLUMN0ROW2])+r.z),S=[];if(0===d&&0===A){if(l=s.computeRealRoots(R,T,h),0===l.length)return S;var m=l[0],N=Math.sqrt(Math.max(1-m*m,0));if(S.push(new t(a,o*m,o*-N)),S.push(new t(a,o*m,o*N)),2===l.length){var C=l[1],I=Math.sqrt(Math.max(1-C*C,0));S.push(new t(a,o*C,o*-I)),S.push(new t(a,o*C,o*I))}return S}var M=d*d,p=A*A,O=R*R,g=d*A,y=O+p,F=2*(T*R+g),L=2*h*R+T*T-p+M,v=2*(h*T-g),U=h*h-M;if(0===y&&0===F&&0===L&&0===v)return S;l=E.computeRealRoots(y,F,L,v,U);var D=l.length;if(0===D)return S;for(var P=0;P<D;++P){var B,w=l[P],x=w*w,G=Math.max(1-x,0),b=Math.sqrt(G);B=i.sign(R)===i.sign(h)?_(R*x+h,T*w,i.EPSILON12):i.sign(h)===i.sign(T*w)?_(R*x,T*w+h,i.EPSILON12):_(R*x+T*w,h,i.EPSILON12);var z=_(A*w,d,i.EPSILON15),H=B*z;H<0?S.push(new t(a,o*w,o*b)):H>0?S.push(new t(a,o*w,o*-b)):0!==b?(S.push(new t(a,o*w,o*-b)),S.push(new t(a,o*w,o*b)),++P):S.push(new t(a,o*w,o*b))}return S}var T={};T.rayPlane=function(e,r,a){n(a)||(a=new t);var o=e.origin,u=e.direction,s=r.normal,E=t.dot(s,u);if(!(Math.abs(E)<i.EPSILON15)){var l=(-r.distance-t.dot(s,o))/E;if(!(l<0))return a=t.multiplyByScalar(u,l,a),t.add(o,a,a)}};var h=new t,A=new t,d=new t,S=new t,m=new t;T.rayTriangleParametric=function(e,n,a,o,u){u=r(u,!1);var s,E,l,c,f,_=e.origin,R=e.direction,T=t.subtract(a,n,h),N=t.subtract(o,n,A),C=t.cross(R,N,d),I=t.dot(T,C);if(u){if(I<i.EPSILON6)return;if(s=t.subtract(_,n,S),l=t.dot(s,C),l<0||l>I)return;if(E=t.cross(s,T,m),c=t.dot(R,E),c<0||l+c>I)return;f=t.dot(N,E)/I}else{if(Math.abs(I)<i.EPSILON6)return;var M=1/I;if(s=t.subtract(_,n,S),l=t.dot(s,C)*M,l<0||l>1)return;if(E=t.cross(s,T,m),c=t.dot(R,E)*M,c<0||l+c>1)return;f=t.dot(N,E)*M}return f},T.rayTriangle=function(e,r,a,o,i,u){var s=T.rayTriangleParametric(e,r,a,o,i);if(n(s)&&!(s<0))return n(u)||(u=new t),t.multiplyByScalar(e.direction,s,u),t.add(e.origin,u,u)};var N=new l;T.lineSegmentTriangle=function(e,r,a,o,i,u,s){var E=N;t.clone(e,E.origin),t.subtract(r,e,E.direction),t.normalize(E.direction,E.direction);var l=T.rayTriangleParametric(E,a,o,i,u);if(!(!n(l)||l<0||l>t.distance(e,r)))return n(s)||(s=new t),t.multiplyByScalar(E.direction,l,s),t.add(E.origin,s,s)};var C={root0:0,root1:0};T.raySphere=function(t,e,r){if(r=f(t,e,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var I=new l;T.lineSegmentSphere=function(e,r,a,o){var i=I;t.clone(e,i.origin);var u=t.subtract(r,e,i.direction),s=t.magnitude(u);if(t.normalize(u,u),o=f(i,a,o),!(!n(o)||o.stop<0||o.start>s))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,s),o};var M=new t,p=new t;T.rayEllipsoid=function(e,r){var n,a,i,u,s,E=r.oneOverRadii,l=t.multiplyComponents(E,e.origin,M),c=t.multiplyComponents(E,e.direction,p),f=t.magnitudeSquared(l),_=t.dot(l,c);if(f>1){if(_>=0)return;var R=_*_;if(n=f-1,a=t.magnitudeSquared(c),i=a*n,R<i)return;if(R>i){u=_*_-i,s=-_+Math.sqrt(u);var T=s/a,h=n/s;return T<h?new o(T,h):{start:h,stop:T}}var A=Math.sqrt(n/a);return new o(A,A)}return f<1?(n=f-1,a=t.magnitudeSquared(c),i=a*n,u=_*_-i,s=-_+Math.sqrt(u),new o(0,s/a)):_<0?(a=t.magnitudeSquared(c),new o(0,-_/a)):void 0};var O=new t,g=new t,y=new t,F=new t,L=new t,v=new u,U=new u,D=new u,P=new u,B=new u,w=new u,x=new u,G=new t,b=new t,z=new e;T.grazingAltitudeLocation=function(e,r){var a=e.origin,o=e.direction;if(!t.equals(a,t.ZERO)){var s=r.geodeticSurfaceNormal(a,O);if(t.dot(o,s)>=0)return a}var E=n(this.rayEllipsoid(e,r)),l=r.transformPositionToScaledSpace(o,O),c=t.normalize(l,l),f=t.mostOrthogonalAxis(l,F),_=t.normalize(t.cross(f,c,g),g),T=t.normalize(t.cross(c,_,y),y),h=v;h[0]=c.x,h[1]=c.y,h[2]=c.z,h[3]=_.x,h[4]=_.y,h[5]=_.z,h[6]=T.x,h[7]=T.y,h[8]=T.z;var A=u.transpose(h,U),d=u.fromScale(r.radii,D),S=u.fromScale(r.oneOverRadii,P),m=B;m[0]=0,m[1]=-o.z,m[2]=o.y,m[3]=o.z,m[4]=0,m[5]=-o.x,m[6]=-o.y,m[7]=o.x,m[8]=0;var N,C,I=u.multiply(u.multiply(A,S,w),m,w),M=u.multiply(u.multiply(I,d,x),h,x),p=u.multiplyByVector(I,a,L),H=R(M,t.negate(p,O),0,0,1),V=H.length;if(V>0){for(var X=t.clone(t.ZERO,b),q=Number.NEGATIVE_INFINITY,W=0;W<V;++W){N=u.multiplyByVector(d,u.multiplyByVector(h,H[W],G),G);var Y=t.normalize(t.subtract(N,a,F),F),K=t.dot(Y,o);K>q&&(q=K,X=t.clone(N,X))}var k=r.cartesianToCartographic(X,z);return q=i.clamp(q,0,1),C=t.magnitude(t.subtract(X,a,F))*Math.sqrt(1-q*q),C=E?-C:C,k.height=C,r.cartographicToCartesian(k,new t)}};var H=new t;return T.lineSegmentPlane=function(e,r,a,o){n(o)||(o=new t);var u=t.subtract(r,e,H),s=a.normal,E=t.dot(s,u);if(!(Math.abs(E)<i.EPSILON6)){var l=t.dot(s,e),c=-(a.distance+l)/E;if(!(c<0||c>1))return t.multiplyByScalar(u,c,o),t.add(e,o,o),o}},T.trianglePlaneIntersection=function(e,r,n,a){var o=a.normal,i=a.distance,u=t.dot(o,e)+i<0,s=t.dot(o,r)+i<0,E=t.dot(o,n)+i<0,l=0;l+=u?1:0,l+=s?1:0,l+=E?1:0;var c,f;if(1!==l&&2!==l||(c=new t,f=new t),1===l){if(u)return T.lineSegmentPlane(e,r,a,c),T.lineSegmentPlane(e,n,a,f),{positions:[e,r,n,c,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return T.lineSegmentPlane(r,n,a,c),T.lineSegmentPlane(r,e,a,f),{positions:[e,r,n,c,f],indices:[1,3,4,2,0,4,2,4,3]};if(E)return T.lineSegmentPlane(n,e,a,c),T.lineSegmentPlane(n,r,a,f),{positions:[e,r,n,c,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return T.lineSegmentPlane(r,e,a,c),T.lineSegmentPlane(n,e,a,f),{positions:[e,r,n,c,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return T.lineSegmentPlane(n,r,a,c),T.lineSegmentPlane(e,r,a,f),{positions:[e,r,n,c,f],indices:[2,0,4,2,4,3,1,3,4]};if(!E)return T.lineSegmentPlane(e,n,a,c),T.lineSegmentPlane(r,n,a,f),{positions:[e,r,n,c,f],indices:[0,1,4,0,4,3,2,3,4]}}},T}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(t,e,r,n){"use strict";function a(e,r){this.normal=t.clone(e),this.distance=r}a.fromPointNormal=function(r,n,o){var i=-t.dot(n,r);return e(o)?(t.clone(n,o.normal),o.distance=i,o):new a(n,i)};var o=new t;return a.fromCartesian4=function(r,n){var i=t.fromCartesian4(r,o),u=r.w;return e(n)?(t.clone(i,n.normal),n.distance=u,n):new a(i,u)},a.getPointDistance=function(e,r){return t.dot(e.normal,r)+e.distance},a.ORIGIN_XY_PLANE=n(new a(t.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=n(new a(t.UNIT_X,0)),a.ORIGIN_ZX_PLANE=n(new a(t.UNIT_Y,0)),a}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(t,e,r,n,a,o,i,u,s,E,l,c){"use strict";function f(t,e,r){var n=M;n.length=t;var a;if(e===r){for(a=0;a<t;a++)n[a]=e;return n}var o=r-e,i=o/t;for(a=0;a<t;a++){var u=e+a*i;n[a]=u}return n}function _(e,r,n,a,o,i,u,s){var E=a.scaleToGeodeticSurface(e,y),l=a.scaleToGeodeticSurface(r,F),c=R.numberOfPoints(e,r,n),_=a.cartesianToCartographic(E,p),T=a.cartesianToCartographic(l,O),h=f(c,o,i);L.setEndPoints(_,T);var A=L.surfaceDistance/c,d=s;_.height=o;var S=a.cartographicToCartesian(_,g);t.pack(S,u,d),d+=3;for(var m=1;m<c;m++){var N=L.interpolateUsingSurfaceDistance(m*A,O);N.height=h[m],S=a.cartographicToCartesian(N,g),t.pack(S,u,d),d+=3}return d}var R={};R.numberOfPoints=function(e,r,n){var a=t.distance(e,r);return Math.ceil(a/n)};var T=new e;R.extractHeights=function(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;a++){var o=t[a];n[a]=e.cartesianToCartographic(o,T).height}return n};var h=new l,A=new t,d=new t,S=new c(t.ZERO,0),m=new t,N=new c(t.ZERO,0),C=new t,I=new t,M=[],p=new e,O=new e,g=new t,y=new t,F=new t,L=new i;return R.wrapLongitude=function(e,a){var o=[],i=[];if(n(e)&&e.length>0){a=r(a,l.IDENTITY);var s=l.inverseTransformation(a,h),E=l.multiplyByPoint(s,t.ZERO,A),f=l.multiplyByPointAsVector(s,t.UNIT_Y,d),_=c.fromPointNormal(E,f,S),R=l.multiplyByPointAsVector(s,t.UNIT_X,m),T=c.fromPointNormal(E,R,N),M=1;o.push(t.clone(e[0]));for(var p=o[0],O=e.length,g=1;g<O;++g){var y=e[g];if(c.getPointDistance(T,p)<0||c.getPointDistance(T,y)<0){var F=u.lineSegmentPlane(p,y,_,C);if(n(F)){var L=t.multiplyByScalar(f,5e-9,I);c.getPointDistance(_,p)<0&&t.negate(L,L),o.push(t.add(F,L,new t)),i.push(M+1),t.negate(L,L),o.push(t.add(F,L,new t)),M=1}}o.push(t.clone(e[g])),M++,p=y}i.push(M)}return{positions:o,lengths:i}},R.generateArc=function(e){n(e)||(e={});var a=e.positions,i=a.length,u=r(e.ellipsoid,o.WGS84),l=r(e.height,0),c=s(l);if(i<1)return[];if(1===i){var f=u.scaleToGeodeticSurface(a[0],y);if(l=c?l[0]:l,0!==l){var T=u.geodeticSurfaceNormal(f,g);t.multiplyByScalar(T,l,T),t.add(f,T,f)}return[f.x,f.y,f.z]}var h=e.minDistance;if(!n(h)){var A=r(e.granularity,E.RADIANS_PER_DEGREE);h=E.chordLength(A,u.maximumRadius)}var d,S=0;for(d=0;d<i-1;d++)S+=R.numberOfPoints(a[d],a[d+1],h);var m=3*(S+1),N=new Array(m),C=0;for(d=0;d<i-1;d++){var I=a[d],O=a[d+1],F=c?l[d]:l,L=c?l[d+1]:l;C=_(I,O,h,u,F,L,N,C)}M.length=0;var v=a[i-1],U=u.cartesianToCartographic(v,p);U.height=c?l[i-1]:l;var D=u.cartographicToCartesian(U,g);return t.pack(D,N,m-3),N},R.generateCartesianArc=function(e){for(var r=R.generateArc(e),n=r.length/3,a=new Array(n),o=0;o<n;o++)a[o]=t.unpack(r,3*o);return a},R}),define("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(t,e,r,n,a,o,i,u,s,E,l,c,f,_,R){"use strict";function T(t,e,n,a,o,i,u){var s,E=_.numberOfPoints(t,e,o),l=n.red,c=n.green,f=n.blue,R=n.alpha,T=a.red,h=a.green,A=a.blue,d=a.alpha;if(r.equals(n,a)){for(s=0;s<E;s++)i[u++]=r.floatToByte(l),i[u++]=r.floatToByte(c),i[u++]=r.floatToByte(f),i[u++]=r.floatToByte(R);return u}var S=(T-l)/E,m=(h-c)/E,N=(A-f)/E,C=(d-R)/E,I=u;for(s=0;s<E;s++)i[I++]=r.floatToByte(l+s*S),i[I++]=r.floatToByte(c+s*m),i[I++]=r.floatToByte(f+s*N),i[I++]=r.floatToByte(R+s*C);return I}function h(t){t=a(t,a.EMPTY_OBJECT);var n=t.positions,i=t.colors,s=a(t.colorsPerVertex,!1);this._positions=n,this._colors=i,this._colorsPerVertex=s,this._followSurface=a(t.followSurface,!0),this._granularity=a(t.granularity,f.RADIANS_PER_DEGREE),this._ellipsoid=a(t.ellipsoid,u.WGS84),this._workerName="createSimplePolylineGeometry";var E=1+n.length*e.packedLength;E+=o(i)?1+i.length*r.packedLength:1,this.packedLength=E+u.packedLength+3}h.pack=function(t,n,i){i=a(i,0);var s,E=t._positions,l=E.length;for(n[i++]=l,s=0;s<l;++s,i+=e.packedLength)e.pack(E[s],n,i);var c=t._colors;for(l=o(c)?c.length:0,n[i++]=l,s=0;s<l;++s,i+=r.packedLength)r.pack(c[s],n,i);return u.pack(t._ellipsoid,n,i),i+=u.packedLength,n[i++]=t._colorsPerVertex?1:0,n[i++]=t._followSurface?1:0,n[i]=t._granularity,n},h.unpack=function(t,n,i){n=a(n,0);var s,E=t[n++],l=new Array(E);for(s=0;s<E;++s,n+=e.packedLength)l[s]=e.unpack(t,n);E=t[n++];var c=E>0?new Array(E):void 0;for(s=0;s<E;++s,n+=r.packedLength)c[s]=r.unpack(t,n);var f=u.unpack(t,n);n+=u.packedLength;var _=1===t[n++],R=1===t[n++],T=t[n];return o(i)?(i._positions=l,i._colors=c,i._ellipsoid=f,i._colorsPerVertex=_,i._followSurface=R,i._granularity=T,i):new h({positions:l,colors:c,ellipsoid:f,colorsPerVertex:_,followSurface:R,granularity:T})};var A=new Array(2),d=new Array(2),S={positions:A,height:d,ellipsoid:void 0,minDistance:void 0};return h.createGeometry=function(a){var i,u,h,m,N,C=a._positions,I=a._colors,M=a._colorsPerVertex,p=a._followSurface,O=a._granularity,g=a._ellipsoid,y=f.chordLength(O,g.maximumRadius),F=o(I)&&!M,L=C.length,v=0;if(p){var U=_.extractHeights(C,g),D=S;if(D.minDistance=y,D.ellipsoid=g,F){var P=0;for(i=0;i<L-1;i++)P+=_.numberOfPoints(C[i],C[i+1],y)+1;u=new Float64Array(3*P),m=new Uint8Array(4*P),D.positions=A,D.height=d;var B=0;for(i=0;i<L-1;++i){A[0]=C[i],A[1]=C[i+1],d[0]=U[i],d[1]=U[i+1];var w=_.generateArc(D);if(o(I)){var x=w.length/3;N=I[i];for(var G=0;G<x;++G)m[B++]=r.floatToByte(N.red),m[B++]=r.floatToByte(N.green),m[B++]=r.floatToByte(N.blue),m[B++]=r.floatToByte(N.alpha)}u.set(w,v),v+=w.length}}else if(D.positions=C,D.height=U,u=new Float64Array(_.generateArc(D)),o(I)){for(m=new Uint8Array(u.length/3*4),i=0;i<L-1;++i){var b=C[i],z=C[i+1],H=I[i],V=I[i+1];v=T(b,z,H,V,y,m,v)}var X=I[L-1];m[v++]=r.floatToByte(X.red),m[v++]=r.floatToByte(X.green),m[v++]=r.floatToByte(X.blue),m[v++]=r.floatToByte(X.alpha)}}else{h=F?2*L-2:L,u=new Float64Array(3*h),m=o(I)?new Uint8Array(4*h):void 0;var q=0,W=0;for(i=0;i<L;++i){var Y=C[i];if(F&&i>0&&(e.pack(Y,u,q),q+=3,N=I[i-1],m[W++]=r.floatToByte(N.red),m[W++]=r.floatToByte(N.green),m[W++]=r.floatToByte(N.blue),m[W++]=r.floatToByte(N.alpha)),F&&i===L-1)break;e.pack(Y,u,q),q+=3,o(I)&&(N=I[i],m[W++]=r.floatToByte(N.red),m[W++]=r.floatToByte(N.green),m[W++]=r.floatToByte(N.blue),m[W++]=r.floatToByte(N.alpha))}}var K=new l;K.position=new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:u}),o(I)&&(K.color=new E({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:m,normalize:!0})),h=u.length/3;var k=2*(h-1),Z=c.createTypedArray(h,k),j=0;for(i=0;i<h-1;++i)Z[j++]=i,Z[j++]=i+1;return new s({attributes:K,indices:Z,primitiveType:R.LINES,boundingSphere:t.fromPoints(C)})},h}),define("Workers/createSimplePolylineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/SimplePolylineGeometry"],function(t,e,r){"use strict";function n(n,a){return t(a)&&(n=r.unpack(n,a)),n._ellipsoid=e.clone(n._ellipsoid),r.createGeometry(n)}return n})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function r(t){return t+" is required, actual value was undefined"}function n(t,e,r){return"Expected "+r+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(n,a){if(!t(a))throw new e(r(n))},a.typeOf.func=function(t,r){if("function"!=typeof r)throw new e(n(typeof r,"function",t))},a.typeOf.string=function(t,r){if("string"!=typeof r)throw new e(n(typeof r,"string",t))},a.typeOf.number=function(t,r){if("number"!=typeof r)throw new e(n(typeof r,"number",t))},a.typeOf.number.lessThan=function(t,r,n){if(a.typeOf.number(t,r),r>=n)throw new e("Expected "+t+" to be less than "+n+", actual value was "+r)},a.typeOf.number.lessThanOrEquals=function(t,r,n){if(a.typeOf.number(t,r),r>n)throw new e("Expected "+t+" to be less than or equal to "+n+", actual value was "+r)},a.typeOf.number.greaterThan=function(t,r,n){if(a.typeOf.number(t,r),r<=n)throw new e("Expected "+t+" to be greater than "+n+", actual value was "+r)},a.typeOf.number.greaterThanOrEquals=function(t,r,n){if(a.typeOf.number(t,r),r<n)throw new e("Expected "+t+" to be greater than or equal to"+n+", actual value was "+r)},a.typeOf.object=function(t,r){if("object"!=typeof r)throw new e(n(typeof r,"object",t))},a.typeOf.bool=function(t,r){if("boolean"!=typeof r)throw new e(n(typeof r,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var r;for(this.mti==this.N+1&&this.init_genrand(5489),r=0;r<this.N-this.M;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+this.M]^t>>>1^e[1&t];for(;r<this.N-1;r++)t=this.mt[r]&this.UPPER_MASK|this.mt[r+1]&this.LOWER_MASK,this.mt[r]=this.mt[r+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,r){return r=e(r,255),Math.round((.5*a.clamp(t,-1,1)+.5)*r)},a.fromSNorm=function(t,r){return r=e(r,255),a.clamp(t,0,r)/r*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e-r)},a.cosh=function(t){var e=Math.pow(Math.E,t),r=Math.pow(Math.E,-1*t);return.5*(e+r)},a.lerp=function(t,e,r){return(1-r)*t+r*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,r=t-Math.floor(t/e)*e;return r<-Math.PI?r+e:r>=Math.PI?r-e:r},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,r,n,a){a=e(a,n);var o=Math.abs(t-r);return o<=a||o<=n*Math.max(Math.abs(t),Math.abs(r))};var o=[1];a.factorial=function(t){var e=o.length;if(t>=e)for(var r=o[e-1],n=e;n<=t;n++)o.push(r*n);return o[t]},a.incrementWrap=function(t,r,n){return n=e(n,0),++t,t>r&&(t=n),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,r){return t<e?e:t>r?r:t};var i=new t;return a.setRandomNumberSeed=function(e){i=new t(e)},a.nextRandomNumber=function(){return i.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var r=t*e;return 1-Math.exp(-(r*r))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,r,n){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0)}i.fromSpherical=function(t,n){r(n)||(n=new i);var a=t.clock,o=t.cone,u=e(t.magnitude,1),s=u*Math.sin(o);return n.x=s*Math.cos(a),n.y=s*Math.sin(a),n.z=u*Math.cos(o),n},i.fromElements=function(t,e,n,a){return r(a)?(a.x=t,a.y=e,a.z=n,a):new i(t,e,n)},i.clone=function(t,e){if(r(t))return r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new i(t.x,t.y,t.z)},i.fromCartesian4=i.clone,i.packedLength=3,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n]=t.z,r},i.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new i),a.x=t[n++],a.y=t[n++],a.z=t[n],a},i.packArray=function(t,e){var n=t.length;r(e)?e.length=3*n:e=new Array(3*n);for(var a=0;a<n;++a)i.pack(t[a],e,3*a);return e},i.unpackArray=function(t,e){var n=t.length;r(e)?e.length=n/3:e=new Array(n/3);for(var a=0;a<n;a+=3){var o=a/3;e[o]=i.unpack(t,a,e[o])}return e},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},i.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r},i.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};var u=new i;i.distance=function(t,e){return i.subtract(t,e,u),i.magnitude(u)},i.distanceSquared=function(t,e){return i.subtract(t,e,u),i.magnitudeSquared(u)},i.normalize=function(t,e){var r=i.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},i.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r},i.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r},i.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r},i.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r},i.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r},i.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var s=new i;i.lerp=function(t,e,r,n){return i.multiplyByScalar(e,r,s),n=i.multiplyByScalar(t,1-r,n),i.add(s,n,n)};var E=new i,l=new i;i.angleBetween=function(t,e){i.normalize(t,E),i.normalize(e,l);var r=i.dot(E,l),n=i.magnitude(i.cross(E,l,E));return Math.atan2(n,r)};var c=new i;i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,c);return i.abs(r,r),e=r.x<=r.y?r.x<=r.z?i.clone(i.UNIT_X,e):i.clone(i.UNIT_Z,e):r.y<=r.z?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_Z,e)},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},i.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]},i.equalsEpsilon=function(t,e,n,a){return t===e||r(t)&&r(e)&&o.equalsEpsilon(t.x,e.x,n,a)&&o.equalsEpsilon(t.y,e.y,n,a)&&o.equalsEpsilon(t.z,e.z,n,a)},i.cross=function(t,e,r){var n=t.x,a=t.y,o=t.z,i=e.x,u=e.y,s=e.z,E=a*s-o*u,l=o*i-n*s,c=n*u-a*i;return r.x=E,r.y=l,r.z=c,r},i.fromDegrees=function(t,e,r,n,a){return t=o.toRadians(t),e=o.toRadians(e),i.fromRadians(t,e,r,n,a)};var f=new i,_=new i,R=new i(40680631590769,40680631590769,40408299984661.445);return i.fromRadians=function(t,n,a,o,u){a=e(a,0);var s=r(o)?o.radiiSquared:R,E=Math.cos(n);f.x=E*Math.cos(t),f.y=E*Math.sin(t),f.z=Math.sin(n),f=i.normalize(f,f),i.multiplyComponents(s,f,_);var l=Math.sqrt(i.dot(f,_));return _=i.divideByScalar(_,l,_),f=i.multiplyByScalar(f,a,f),r(u)||(u=new i),i.add(_,f,u)},i.fromDegreesArray=function(t,e,n){var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=t[o],s=t[o+1],E=o/2;n[E]=i.fromDegrees(u,s,0,e,n[E])}return n},i.fromRadiansArray=function(t,e,n){var a=t.length;r(n)?n.length=a/2:n=new Array(a/2);for(var o=0;o<a;o+=2){var u=t[o],s=t[o+1],E=o/2;n[E]=i.fromRadians(u,s,0,e,n[E])}return n},i.fromDegreesArrayHeights=function(t,e,n){var a=t.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=t[o],s=t[o+1],E=t[o+2],l=o/3;n[l]=i.fromDegrees(u,s,E,e,n[l])}return n},i.fromRadiansArrayHeights=function(t,e,n){var a=t.length;r(n)?n.length=a/3:n=new Array(a/3);for(var o=0;o<a;o+=3){var u=t[o],s=t[o+1],E=t[o+2],l=o/3;n[l]=i.fromRadians(u,s,E,e,n[l])}return n},i.ZERO=a(new i(0,0,0)),i.UNIT_X=a(new i(1,0,0)),i.UNIT_Y=a(new i(0,1,0)),i.UNIT_Z=a(new i(0,0,1)),i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e,r){return i.equalsEpsilon(this,t,e,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,r,n){"use strict";function a(r,a,u,s,E){var l=r.x,c=r.y,f=r.z,_=a.x,R=a.y,T=a.z,h=l*l*_*_,A=c*c*R*R,d=f*f*T*T,S=h+A+d,m=Math.sqrt(1/S),N=t.multiplyByScalar(r,m,o);if(S<s)return isFinite(m)?t.clone(N,E):void 0;var C=u.x,I=u.y,M=u.z,p=i;p.x=N.x*C*2,p.y=N.y*I*2,p.z=N.z*M*2;var O,g,y,F,L,v,U,D,P,B,w,x=(1-m)*t.magnitude(r)/(.5*t.magnitude(p)),G=0;do{x-=G,y=1/(1+x*C),F=1/(1+x*I),L=1/(1+x*M),v=y*y,U=F*F,D=L*L,P=v*y,B=U*F,w=D*L,O=h*v+A*U+d*D-1,g=h*P*C+A*B*I+d*w*M;var b=-2*g;G=O/b}while(Math.abs(O)>n.EPSILON12);return e(E)?(E.x=l*y,E.y=c*F,E.z=f*L,E):new t(l*y,c*F,f*L)}var o=new t,i=new t;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,a,o,i){"use strict";function u(t,e,n){this.longitude=r(t,0),this.latitude=r(e,0),this.height=r(n,0)}u.fromRadians=function(t,e,a,o){return a=r(a,0),n(o)?(o.longitude=t,o.latitude=e,o.height=a,o):new u(t,e,a)},u.fromDegrees=function(t,e,r,n){return t=o.toRadians(t),e=o.toRadians(e),u.fromRadians(t,e,r,n)};var s=new t,E=new t,l=new t,c=new t(1/6378137,1/6378137,1/6356752.314245179),f=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),_=o.EPSILON1;return u.fromCartesian=function(e,r,a){var R=n(r)?r.oneOverRadii:c,T=n(r)?r.oneOverRadiiSquared:f,h=n(r)?r._centerToleranceSquared:_,A=i(e,R,T,h,E);if(n(A)){var d=t.multiplyComponents(A,T,s);d=t.normalize(d,d);var S=t.subtract(e,A,l),m=Math.atan2(d.y,d.x),N=Math.asin(d.z),C=o.sign(t.dot(S,e))*t.magnitude(S);return n(a)?(a.longitude=m,a.latitude=N,a.height=C,a):new u(m,N,C)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),r=Object.defineProperties;return e&&t(r)||(r=function(t){return t}),r}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,r,n,a,o,i,u,s){"use strict";function E(e,n,a,o){n=r(n,0),a=r(a,0),o=r(o,0),e._radii=new t(n,a,o),e._radiiSquared=new t(n*n,a*a,o*o),e._radiiToTheFourth=new t(n*n*n*n,a*a*a*a,o*o*o*o),e._oneOverRadii=new t(0===n?0:1/n,0===a?0:1/a,0===o?0:1/o),e._oneOverRadiiSquared=new t(0===n?0:1/(n*n),0===a?0:1/(a*a),0===o?0:1/(o*o)),e._minimumRadius=Math.min(n,a,o),e._maximumRadius=Math.max(n,a,o),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function l(t,e,r){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._sqauredXOverSquaredZ=void 0,E(this,t,e,r)}a(l.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}}}),l.clone=function(e,r){if(n(e)){var a=e._radii;return n(r)?(t.clone(a,r._radii),t.clone(e._radiiSquared,r._radiiSquared),t.clone(e._radiiToTheFourth,r._radiiToTheFourth),t.clone(e._oneOverRadii,r._oneOverRadii),t.clone(e._oneOverRadiiSquared,r._oneOverRadiiSquared),r._minimumRadius=e._minimumRadius,r._maximumRadius=e._maximumRadius,r._centerToleranceSquared=e._centerToleranceSquared,r):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(t,e){return n(e)||(e=new l),n(t)?(E(e,t.x,t.y,t.z),e):e},l.WGS84=i(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=i(new l(1,1,1)),l.MOON=i(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(t){return l.clone(this,t)},l.packedLength=t.packedLength,l.pack=function(e,n,a){return a=r(a,0),t.pack(e._radii,n,a),n},l.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n);return l.fromCartesian3(o,a)},l.prototype.geocentricSurfaceNormal=t.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(e,r){var a=e.longitude,o=e.latitude,i=Math.cos(o),u=i*Math.cos(a),s=i*Math.sin(a),E=Math.sin(o);return n(r)||(r=new t),r.x=u,r.y=s,r.z=E,t.normalize(r,r)},l.prototype.geodeticSurfaceNormal=function(e,r){return n(r)||(r=new t),r=t.multiplyComponents(e,this._oneOverRadiiSquared,r),t.normalize(r,r)};var c=new t,f=new t;l.prototype.cartographicToCartesian=function(e,r){var a=c,o=f;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,o);var i=Math.sqrt(t.dot(a,o));return t.divideByScalar(o,i,o),t.multiplyByScalar(a,e.height,a),n(r)||(r=new t),t.add(o,a,r)},l.prototype.cartographicArrayToCartesianArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var a=0;a<r;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var _=new t,R=new t,T=new t;return l.prototype.cartesianToCartographic=function(r,a){var o=this.scaleToGeodeticSurface(r,R);if(n(o)){var i=this.geodeticSurfaceNormal(o,_),s=t.subtract(r,o,T),E=Math.atan2(i.y,i.x),l=Math.asin(i.z),c=u.sign(t.dot(s,r))*t.magnitude(s);return n(a)?(a.longitude=E,a.latitude=l,a.height=c,a):new e(E,l,c)}},l.prototype.cartesianArrayToCartographicArray=function(t,e){var r=t.length;n(e)?e.length=r:e=new Array(r);for(var a=0;a<r;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},l.prototype.scaleToGeodeticSurface=function(t,e){return s(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},l.prototype.scaleToGeocentricSurface=function(e,r){n(r)||(r=new t);var a=e.x,o=e.y,i=e.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+o*o*u.y+i*i*u.z);return t.multiplyByScalar(e,s,r)},l.prototype.transformPositionToScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._oneOverRadii,r)},l.prototype.transformPositionFromScaledSpace=function(e,r){return n(r)||(r=new t),t.multiplyComponents(e,this._radii,r)},l.prototype.equals=function(e){return this===e||n(e)&&t.equals(this._radii,e._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,o){a=r(a,0);var i=this._sqauredXOverSquaredZ;if(n(o)||(o=new t),o.x=0,o.y=0,o.z=e.z*(1-i),!(Math.abs(o.z)>=this._radii.z-a))return o},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,r,n,a,o,i){"use strict";function u(t){this._ellipsoid=r(t,i.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,r){var a=this._semimajorAxis,o=e.longitude*a,i=e.latitude*a,u=e.height;return n(r)?(r.x=o,r.y=i,r.z=u,r):new t(o,i,u)},u.prototype.unproject=function(t,r){var a=this._oneOverSemimajorAxis,o=t.x*a,i=t.y*a,u=t.z;return n(r)?(r.longitude=o,r.latitude=i,r.height=u,r):new e(o,i,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,r){this.start=t(e,0),this.stop=t(r,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t,e,n,a,o,i,u,s,E){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(u,0),this[3]=r(e,0),this[4]=r(o,0),this[5]=r(s,0),this[6]=r(n,0),this[7]=r(i,0),this[8]=r(E,0)}function E(t){for(var e=0,r=0;r<9;++r){var n=t[r];e+=n*n}return Math.sqrt(e)}function l(t){for(var e=0,r=0;r<3;++r){var n=t[s.getElementIndex(T[r],R[r])];e+=2*n*n}return Math.sqrt(e)}function c(t,e){for(var r=u.EPSILON15,n=0,a=1,o=0;o<3;++o){var i=Math.abs(t[s.getElementIndex(T[o],R[o])]);i>n&&(a=o,n=i)}var E=1,l=0,c=R[a],f=T[a];if(Math.abs(t[s.getElementIndex(f,c)])>r){var _,h=t[s.getElementIndex(f,f)],A=t[s.getElementIndex(c,c)],d=t[s.getElementIndex(f,c)],S=(h-A)/2/d;_=S<0?-1/(-S+Math.sqrt(1+S*S)):1/(S+Math.sqrt(1+S*S)),E=1/Math.sqrt(1+_*_),l=_*E}return e=s.clone(s.IDENTITY,e),e[s.getElementIndex(c,c)]=e[s.getElementIndex(f,f)]=E,e[s.getElementIndex(f,c)]=l,e[s.getElementIndex(c,f)]=-l,e}s.packedLength=9,s.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e},s.unpack=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},s.clone=function(t,e){if(n(t))return n(e)?(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],e):new s(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},s.fromArray=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},s.fromColumnMajorArray=function(t,e){return s.clone(t,e)},s.fromRowMajorArray=function(t,e){return n(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new s(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},s.fromQuaternion=function(t,e){var r=t.x*t.x,a=t.x*t.y,o=t.x*t.z,i=t.x*t.w,u=t.y*t.y,E=t.y*t.z,l=t.y*t.w,c=t.z*t.z,f=t.z*t.w,_=t.w*t.w,R=r-u-c+_,T=2*(a-f),h=2*(o+l),A=2*(a+f),d=-r+u-c+_,S=2*(E-i),m=2*(o-l),N=2*(E+i),C=-r-u+c+_;return n(e)?(e[0]=R,e[1]=A,e[2]=m,e[3]=T,e[4]=d,e[5]=N,e[6]=h,e[7]=S,e[8]=C,e):new s(R,T,h,A,d,S,m,N,C)},s.fromHeadingPitchRoll=function(t,e){var r=Math.cos(-t.pitch),a=Math.cos(-t.heading),o=Math.cos(t.roll),i=Math.sin(-t.pitch),u=Math.sin(-t.heading),E=Math.sin(t.roll),l=r*a,c=-o*u+E*i*a,f=E*u+o*i*a,_=r*u,R=o*a+E*i*u,T=-E*a+o*i*u,h=-i,A=E*r,d=o*r;return n(e)?(e[0]=l,e[1]=_,e[2]=h,e[3]=c,e[4]=R,e[5]=A,e[6]=f,e[7]=T,e[8]=d,e):new s(l,c,f,_,R,T,h,A,d)},s.fromScale=function(t,e){return n(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new s(t.x,0,0,0,t.y,0,0,0,t.z)},s.fromUniformScale=function(t,e){return n(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new s(t,0,0,0,t,0,0,0,t)},s.fromCrossProduct=function(t,e){return n(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new s(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},s.fromRotationX=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=r,e[5]=a,e[6]=0,e[7]=-a,e[8]=r,e):new s(1,0,0,0,r,-a,0,a,r)},s.fromRotationY=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=r,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=r,e):new s(r,0,a,0,1,0,-a,0,r)},s.fromRotationZ=function(t,e){var r=Math.cos(t),a=Math.sin(t);return n(e)?(e[0]=r,e[1]=a,e[2]=0,e[3]=-a,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new s(r,-a,0,a,r,0,0,0,1)},s.toArray=function(t,e){return n(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},s.getElementIndex=function(t,e){return 3*t+e},s.getColumn=function(t,e,r){var n=3*e,a=t[n],o=t[n+1],i=t[n+2];return r.x=a,r.y=o,r.z=i,r},s.setColumn=function(t,e,r,n){n=s.clone(t,n);var a=3*e;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n},s.getRow=function(t,e,r){var n=t[e],a=t[e+3],o=t[e+6];return r.x=n,r.y=a,r.z=o,r},s.setRow=function(t,e,r,n){return n=s.clone(t,n),n[e]=r.x,n[e+3]=r.y,n[e+6]=r.z,n};var f=new t;s.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],f)),r.y=t.magnitude(t.fromElements(e[3],e[4],e[5],f)),r.z=t.magnitude(t.fromElements(e[6],e[7],e[8],f)),r};var _=new t;s.getMaximumScale=function(e){return s.getScale(e,_),t.maximumComponent(_)},s.multiply=function(t,e,r){var n=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],o=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],i=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],s=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],E=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],l=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],c=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return r[0]=n,r[1]=a,r[2]=o,r[3]=i,r[4]=u,r[5]=s,r[6]=E,r[7]=l,r[8]=c,r},s.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r},s.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r},s.multiplyByVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[3]*a+t[6]*o,u=t[1]*n+t[4]*a+t[7]*o,s=t[2]*n+t[5]*a+t[8]*o;return r.x=i,r.y=u,r.z=s,r},s.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r},s.multiplyByScale=function(t,e,r){return r[0]=t[0]*e.x,r[1]=t[1]*e.x,r[2]=t[2]*e.x,r[3]=t[3]*e.y,r[4]=t[4]*e.y,r[5]=t[5]*e.y,r[6]=t[6]*e.z,r[7]=t[7]*e.z,r[8]=t[8]*e.z,r},s.negate=function(t,e){return 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],e},s.transpose=function(t,e){var r=t[0],n=t[3],a=t[6],o=t[1],i=t[4],u=t[7],s=t[2],E=t[5],l=t[8];return e[0]=r,e[1]=n,e[2]=a,e[3]=o,e[4]=i,e[5]=u,e[6]=s,e[7]=E,e[8]=l,e};var R=[1,0,0],T=[2,2,1],h=new s,A=new s;return s.computeEigenDecomposition=function(t,e){var r=u.EPSILON20,a=10,o=0,i=0;n(e)||(e={});for(var f=e.unitary=s.clone(s.IDENTITY,e.unitary),_=e.diagonal=s.clone(t,e.diagonal),R=r*E(_);i<a&&l(_)>R;)c(_,h),s.transpose(h,A),s.multiply(_,h,_),s.multiply(A,_,_),s.multiply(f,h,f),++o>2&&(++i,o=0);return e},s.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},s.determinant=function(t){var e=t[0],r=t[3],n=t[6],a=t[1],o=t[4],i=t[7],u=t[2],s=t[5],E=t[8];return e*(o*E-s*i)+a*(s*n-r*E)+u*(r*i-o*n)},s.inverse=function(t,e){var r=t[0],n=t[1],a=t[2],o=t[3],i=t[4],u=t[5],E=t[6],l=t[7],c=t[8],f=s.determinant(t);e[0]=i*c-l*u,e[1]=l*a-n*c,e[2]=n*u-i*a,e[3]=E*u-o*c,e[4]=r*c-E*a,e[5]=o*a-r*u,e[6]=o*l-E*i,e[7]=E*n-r*l,e[8]=r*i-o*n;var _=1/f;return s.multiplyByScalar(e,_,e)},s.equals=function(t,e){return t===e||n(t)&&n(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},s.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r},s.IDENTITY=i(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=i(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]},s.prototype.equalsEpsilon=function(t,e){return s.equalsEpsilon(this,t,e)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,r,n,a){this.x=e(t,0),this.y=e(r,0),this.z=e(n,0),this.w=e(a,0)}i.fromElements=function(t,e,n,a,o){return r(o)?(o.x=t,o.y=e,o.z=n,o.w=a,o):new i(t,e,n,a)},i.fromColor=function(t,e){return r(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new i(t.red,t.green,t.blue,t.alpha)},i.clone=function(t,e){if(r(t))return r(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new i(t.x,t.y,t.z,t.w)},i.packedLength=4,i.pack=function(t,r,n){return n=e(n,0),r[n++]=t.x,r[n++]=t.y,r[n++]=t.z,r[n]=t.w,r},i.unpack=function(t,n,a){return n=e(n,0),r(a)||(a=new i),a.x=t[n++],a.y=t[n++],a.z=t[n++],a.w=t[n],a},i.packArray=function(t,e){var n=t.length;r(e)?e.length=4*n:e=new Array(4*n);for(var a=0;a<n;++a)i.pack(t[a],e,4*a);return e},i.unpackArray=function(t,e){var n=t.length;r(e)?e.length=n/4:e=new Array(n/4);for(var a=0;a<n;a+=4){var o=a/4;e[o]=i.unpack(t,a,e[o])}return e},i.fromArray=i.unpack,i.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},i.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},i.minimumByComponent=function(t,e,r){return r.x=Math.min(t.x,e.x),r.y=Math.min(t.y,e.y),r.z=Math.min(t.z,e.z),r.w=Math.min(t.w,e.w),r},i.maximumByComponent=function(t,e,r){return r.x=Math.max(t.x,e.x),r.y=Math.max(t.y,e.y),r.z=Math.max(t.z,e.z),r.w=Math.max(t.w,e.w),r},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},i.magnitude=function(t){return Math.sqrt(i.magnitudeSquared(t))};var u=new i;i.distance=function(t,e){return i.subtract(t,e,u),i.magnitude(u)},i.distanceSquared=function(t,e){return i.subtract(t,e,u),i.magnitudeSquared(u)},i.normalize=function(t,e){var r=i.magnitude(t);return e.x=t.x/r,e.y=t.y/r,e.z=t.z/r,e.w=t.w/r,e},i.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},i.multiplyComponents=function(t,e,r){return r.x=t.x*e.x,r.y=t.y*e.y,r.z=t.z*e.z,r.w=t.w*e.w,r},i.divideComponents=function(t,e,r){return r.x=t.x/e.x,r.y=t.y/e.y,r.z=t.z/e.z,r.w=t.w/e.w,r},i.add=function(t,e,r){return r.x=t.x+e.x,r.y=t.y+e.y,r.z=t.z+e.z,r.w=t.w+e.w,r},i.subtract=function(t,e,r){return r.x=t.x-e.x,r.y=t.y-e.y,r.z=t.z-e.z,r.w=t.w-e.w,r},i.multiplyByScalar=function(t,e,r){return r.x=t.x*e,r.y=t.y*e,r.z=t.z*e,r.w=t.w*e,r},i.divideByScalar=function(t,e,r){return r.x=t.x/e,r.y=t.y/e,r.z=t.z/e,r.w=t.w/e,r},i.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},i.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var s=new i;i.lerp=function(t,e,r,n){return i.multiplyByScalar(e,r,s),n=i.multiplyByScalar(t,1-r,n),i.add(s,n,n)};var E=new i;return i.mostOrthogonalAxis=function(t,e){var r=i.normalize(t,E);return i.abs(r,r),e=r.x<=r.y?r.x<=r.z?r.x<=r.w?i.clone(i.UNIT_X,e):i.clone(i.UNIT_W,e):r.z<=r.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e):r.y<=r.z?r.y<=r.w?i.clone(i.UNIT_Y,e):i.clone(i.UNIT_W,e):r.z<=r.w?i.clone(i.UNIT_Z,e):i.clone(i.UNIT_W,e)},i.equals=function(t,e){return t===e||r(t)&&r(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},i.equalsArray=function(t,e,r){return t.x===e[r]&&t.y===e[r+1]&&t.z===e[r+2]&&t.w===e[r+3]},i.equalsEpsilon=function(t,e,n,a){return t===e||r(t)&&r(e)&&o.equalsEpsilon(t.x,e.x,n,a)&&o.equalsEpsilon(t.y,e.y,n,a)&&o.equalsEpsilon(t.z,e.z,n,a)&&o.equalsEpsilon(t.w,e.w,n,a)},i.ZERO=a(new i(0,0,0,0)),i.UNIT_X=a(new i(1,0,0,0)),i.UNIT_Y=a(new i(0,1,0,0)),i.UNIT_Z=a(new i(0,0,1,0)),i.UNIT_W=a(new i(0,0,0,1)),i.prototype.clone=function(t){return i.clone(this,t)},i.prototype.equals=function(t){return i.equals(this,t)},i.prototype.equalsEpsilon=function(t,e,r){return i.equalsEpsilon(this,t,e,r)},i.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},i}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,r,n,a,o,i,u,s,E){ +"use strict";function l(t,e,r,a,o,i,u,s,E,l,c,f,_,R,T,h){this[0]=n(t,0),this[1]=n(o,0),this[2]=n(E,0),this[3]=n(_,0),this[4]=n(e,0),this[5]=n(i,0),this[6]=n(l,0),this[7]=n(R,0),this[8]=n(r,0),this[9]=n(u,0),this[10]=n(c,0),this[11]=n(T,0),this[12]=n(a,0),this[13]=n(s,0),this[14]=n(f,0),this[15]=n(h,0)}l.packedLength=16,l.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e[r++]=t[9],e[r++]=t[10],e[r++]=t[11],e[r++]=t[12],e[r++]=t[13],e[r++]=t[14],e[r]=t[15],e},l.unpack=function(t,e,r){return e=n(e,0),a(r)||(r=new l),r[0]=t[e++],r[1]=t[e++],r[2]=t[e++],r[3]=t[e++],r[4]=t[e++],r[5]=t[e++],r[6]=t[e++],r[7]=t[e++],r[8]=t[e++],r[9]=t[e++],r[10]=t[e++],r[11]=t[e++],r[12]=t[e++],r[13]=t[e++],r[14]=t[e++],r[15]=t[e],r},l.clone=function(t,e){if(a(t))return a(e)?(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],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):new l(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(t,e){return l.clone(t,e)},l.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new l(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},l.fromRotationTranslation=function(e,r,o){return r=n(r,t.ZERO),a(o)?(o[0]=e[0],o[1]=e[1],o[2]=e[2],o[3]=0,o[4]=e[3],o[5]=e[4],o[6]=e[5],o[7]=0,o[8]=e[6],o[9]=e[7],o[10]=e[8],o[11]=0,o[12]=r.x,o[13]=r.y,o[14]=r.z,o[15]=1,o):new l(e[0],e[3],e[6],r.x,e[1],e[4],e[7],r.y,e[2],e[5],e[8],r.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(t,e,r,n){a(n)||(n=new l);var o=r.x,i=r.y,u=r.z,s=e.x*e.x,E=e.x*e.y,c=e.x*e.z,f=e.x*e.w,_=e.y*e.y,R=e.y*e.z,T=e.y*e.w,h=e.z*e.z,A=e.z*e.w,d=e.w*e.w,S=s-_-h+d,m=2*(E-A),N=2*(c+T),C=2*(E+A),I=-s+_-h+d,M=2*(R-f),p=2*(c-T),O=2*(R+f),g=-s-_+h+d;return n[0]=S*o,n[1]=C*o,n[2]=p*o,n[3]=0,n[4]=m*i,n[5]=I*i,n[6]=O*i,n[7]=0,n[8]=N*u,n[9]=M*u,n[10]=g*u,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n},l.fromTranslationRotationScale=function(t,e){return l.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},l.fromTranslation=function(t,e){return l.fromRotationTranslation(s.IDENTITY,t,e)},l.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new l(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},l.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new l(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var c=new t,f=new t,_=new t;l.fromCamera=function(e,r){var n=e.position,o=e.direction,i=e.up;t.normalize(o,c),t.normalize(t.cross(c,i,f),f),t.normalize(t.cross(f,c,_),_);var u=f.x,s=f.y,E=f.z,R=c.x,T=c.y,h=c.z,A=_.x,d=_.y,S=_.z,m=n.x,N=n.y,C=n.z,I=u*-m+s*-N+E*-C,M=A*-m+d*-N+S*-C,p=R*m+T*N+h*C;return a(r)?(r[0]=u,r[1]=A,r[2]=-R,r[3]=0,r[4]=s,r[5]=d,r[6]=-T,r[7]=0,r[8]=E,r[9]=S,r[10]=-h,r[11]=0,r[12]=I,r[13]=M,r[14]=p,r[15]=1,r):new l(u,s,E,I,A,d,S,M,-R,-T,-h,p,0,0,0,1)},l.computePerspectiveFieldOfView=function(t,e,r,n,a){var o=Math.tan(.5*t),i=1/o,u=i/e,s=(n+r)/(r-n),E=2*n*r/(r-n);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=i,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=E,a[15]=0,a},l.computeOrthographicOffCenter=function(t,e,r,n,a,o,i){var u=1/(e-t),s=1/(n-r),E=1/(o-a),l=-(e+t)*u,c=-(n+r)*s,f=-(o+a)*E;return u*=2,s*=2,E*=-2,i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=0,i[12]=l,i[13]=c,i[14]=f,i[15]=1,i},l.computePerspectiveOffCenter=function(t,e,r,n,a,o,i){var u=2*a/(e-t),s=2*a/(n-r),E=(e+t)/(e-t),l=(n+r)/(n-r),c=-(o+a)/(o-a),f=-1,_=-2*o*a/(o-a);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=s,i[6]=0,i[7]=0,i[8]=E,i[9]=l,i[10]=c,i[11]=f,i[12]=0,i[13]=0,i[14]=_,i[15]=0,i},l.computeInfinitePerspectiveOffCenter=function(t,e,r,n,a,o){var i=2*a/(e-t),u=2*a/(n-r),s=(e+t)/(e-t),E=(n+r)/(n-r),l=-1,c=-1,f=-2*a;return o[0]=i,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=u,o[6]=0,o[7]=0,o[8]=s,o[9]=E,o[10]=l,o[11]=c,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o},l.computeViewportTransformation=function(t,e,r,a){t=n(t,n.EMPTY_OBJECT);var o=n(t.x,0),i=n(t.y,0),u=n(t.width,0),s=n(t.height,0);e=n(e,0),r=n(r,1);var E=.5*u,l=.5*s,c=.5*(r-e),f=E,_=l,R=c,T=o+E,h=i+l,A=e+c,d=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=_,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=R,a[11]=0,a[12]=T,a[13]=h,a[14]=A,a[15]=d,a},l.computeView=function(e,r,n,a,o){return o[0]=a.x,o[1]=n.x,o[2]=-r.x,o[3]=0,o[4]=a.y,o[5]=n.y,o[6]=-r.y,o[7]=0,o[8]=a.z,o[9]=n.z,o[10]=-r.z,o[11]=0,o[12]=-t.dot(a,e),o[13]=-t.dot(n,e),o[14]=t.dot(r,e),o[15]=1,o},l.toArray=function(t,e){return a(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},l.getElementIndex=function(t,e){return 4*t+e},l.getColumn=function(t,e,r){var n=4*e,a=t[n],o=t[n+1],i=t[n+2],u=t[n+3];return r.x=a,r.y=o,r.z=i,r.w=u,r},l.setColumn=function(t,e,r,n){n=l.clone(t,n);var a=4*e;return n[a]=r.x,n[a+1]=r.y,n[a+2]=r.z,n[a+3]=r.w,n},l.setTranslation=function(t,e,r){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=t[15],r},l.getRow=function(t,e,r){var n=t[e],a=t[e+4],o=t[e+8],i=t[e+12];return r.x=n,r.y=a,r.z=o,r.w=i,r},l.setRow=function(t,e,r,n){return n=l.clone(t,n),n[e]=r.x,n[e+4]=r.y,n[e+8]=r.z,n[e+12]=r.w,n};var R=new t;l.getScale=function(e,r){return r.x=t.magnitude(t.fromElements(e[0],e[1],e[2],R)),r.y=t.magnitude(t.fromElements(e[4],e[5],e[6],R)),r.z=t.magnitude(t.fromElements(e[8],e[9],e[10],R)),r};var T=new t;l.getMaximumScale=function(e){return l.getScale(e,T),t.maximumComponent(T)},l.multiply=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[3],u=t[4],s=t[5],E=t[6],l=t[7],c=t[8],f=t[9],_=t[10],R=t[11],T=t[12],h=t[13],A=t[14],d=t[15],S=e[0],m=e[1],N=e[2],C=e[3],I=e[4],M=e[5],p=e[6],O=e[7],g=e[8],y=e[9],F=e[10],L=e[11],v=e[12],U=e[13],D=e[14],P=e[15],B=n*S+u*m+c*N+T*C,w=a*S+s*m+f*N+h*C,x=o*S+E*m+_*N+A*C,G=i*S+l*m+R*N+d*C,b=n*I+u*M+c*p+T*O,z=a*I+s*M+f*p+h*O,H=o*I+E*M+_*p+A*O,V=i*I+l*M+R*p+d*O,X=n*g+u*y+c*F+T*L,q=a*g+s*y+f*F+h*L,W=o*g+E*y+_*F+A*L,Y=i*g+l*y+R*F+d*L,K=n*v+u*U+c*D+T*P,k=a*v+s*U+f*D+h*P,Z=o*v+E*U+_*D+A*P,j=i*v+l*U+R*D+d*P;return r[0]=B,r[1]=w,r[2]=x,r[3]=G,r[4]=b,r[5]=z,r[6]=H,r[7]=V,r[8]=X,r[9]=q,r[10]=W,r[11]=Y,r[12]=K,r[13]=k,r[14]=Z,r[15]=j,r},l.add=function(t,e,r){return r[0]=t[0]+e[0],r[1]=t[1]+e[1],r[2]=t[2]+e[2],r[3]=t[3]+e[3],r[4]=t[4]+e[4],r[5]=t[5]+e[5],r[6]=t[6]+e[6],r[7]=t[7]+e[7],r[8]=t[8]+e[8],r[9]=t[9]+e[9],r[10]=t[10]+e[10],r[11]=t[11]+e[11],r[12]=t[12]+e[12],r[13]=t[13]+e[13],r[14]=t[14]+e[14],r[15]=t[15]+e[15],r},l.subtract=function(t,e,r){return r[0]=t[0]-e[0],r[1]=t[1]-e[1],r[2]=t[2]-e[2],r[3]=t[3]-e[3],r[4]=t[4]-e[4],r[5]=t[5]-e[5],r[6]=t[6]-e[6],r[7]=t[7]-e[7],r[8]=t[8]-e[8],r[9]=t[9]-e[9],r[10]=t[10]-e[10],r[11]=t[11]-e[11],r[12]=t[12]-e[12],r[13]=t[13]-e[13],r[14]=t[14]-e[14],r[15]=t[15]-e[15],r},l.multiplyTransformation=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[4],u=t[5],s=t[6],E=t[8],l=t[9],c=t[10],f=t[12],_=t[13],R=t[14],T=e[0],h=e[1],A=e[2],d=e[4],S=e[5],m=e[6],N=e[8],C=e[9],I=e[10],M=e[12],p=e[13],O=e[14],g=n*T+i*h+E*A,y=a*T+u*h+l*A,F=o*T+s*h+c*A,L=n*d+i*S+E*m,v=a*d+u*S+l*m,U=o*d+s*S+c*m,D=n*N+i*C+E*I,P=a*N+u*C+l*I,B=o*N+s*C+c*I,w=n*M+i*p+E*O+f,x=a*M+u*p+l*O+_,G=o*M+s*p+c*O+R;return r[0]=g,r[1]=y,r[2]=F,r[3]=0,r[4]=L,r[5]=v,r[6]=U,r[7]=0,r[8]=D,r[9]=P,r[10]=B,r[11]=0,r[12]=w,r[13]=x,r[14]=G,r[15]=1,r},l.multiplyByMatrix3=function(t,e,r){var n=t[0],a=t[1],o=t[2],i=t[4],u=t[5],s=t[6],E=t[8],l=t[9],c=t[10],f=e[0],_=e[1],R=e[2],T=e[3],h=e[4],A=e[5],d=e[6],S=e[7],m=e[8],N=n*f+i*_+E*R,C=a*f+u*_+l*R,I=o*f+s*_+c*R,M=n*T+i*h+E*A,p=a*T+u*h+l*A,O=o*T+s*h+c*A,g=n*d+i*S+E*m,y=a*d+u*S+l*m,F=o*d+s*S+c*m;return r[0]=N,r[1]=C,r[2]=I,r[3]=0,r[4]=M,r[5]=p,r[6]=O,r[7]=0,r[8]=g,r[9]=y,r[10]=F,r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},l.multiplyByTranslation=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=n*t[0]+a*t[4]+o*t[8]+t[12],u=n*t[1]+a*t[5]+o*t[9]+t[13],s=n*t[2]+a*t[6]+o*t[10]+t[14];return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=i,r[13]=u,r[14]=s,r[15]=t[15],r};var h=new t;l.multiplyByUniformScale=function(t,e,r){return h.x=e,h.y=e,h.z=e,l.multiplyByScale(t,h,r)},l.multiplyByScale=function(t,e,r){var n=e.x,a=e.y,o=e.z;return 1===n&&1===a&&1===o?l.clone(t,r):(r[0]=n*t[0],r[1]=n*t[1],r[2]=n*t[2],r[3]=0,r[4]=a*t[4],r[5]=a*t[5],r[6]=a*t[6],r[7]=0,r[8]=o*t[8],r[9]=o*t[9],r[10]=o*t[10],r[11]=0,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=1,r)},l.multiplyByVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=e.w,u=t[0]*n+t[4]*a+t[8]*o+t[12]*i,s=t[1]*n+t[5]*a+t[9]*o+t[13]*i,E=t[2]*n+t[6]*a+t[10]*o+t[14]*i,l=t[3]*n+t[7]*a+t[11]*o+t[15]*i;return r.x=u,r.y=s,r.z=E,r.w=l,r},l.multiplyByPointAsVector=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[4]*a+t[8]*o,u=t[1]*n+t[5]*a+t[9]*o,s=t[2]*n+t[6]*a+t[10]*o;return r.x=i,r.y=u,r.z=s,r},l.multiplyByPoint=function(t,e,r){var n=e.x,a=e.y,o=e.z,i=t[0]*n+t[4]*a+t[8]*o+t[12],u=t[1]*n+t[5]*a+t[9]*o+t[13],s=t[2]*n+t[6]*a+t[10]*o+t[14];return r.x=i,r.y=u,r.z=s,r},l.multiplyByScalar=function(t,e,r){return r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e,r[3]=t[3]*e,r[4]=t[4]*e,r[5]=t[5]*e,r[6]=t[6]*e,r[7]=t[7]*e,r[8]=t[8]*e,r[9]=t[9]*e,r[10]=t[10]*e,r[11]=t[11]*e,r[12]=t[12]*e,r[13]=t[13]*e,r[14]=t[14]*e,r[15]=t[15]*e,r},l.negate=function(t,e){return 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],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},l.transpose=function(t,e){var r=t[1],n=t[2],a=t[3],o=t[6],i=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=i,e[14]=u,e[15]=t[15],e},l.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},l.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},l.equalsEpsilon=function(t,e,r){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=r&&Math.abs(t[1]-e[1])<=r&&Math.abs(t[2]-e[2])<=r&&Math.abs(t[3]-e[3])<=r&&Math.abs(t[4]-e[4])<=r&&Math.abs(t[5]-e[5])<=r&&Math.abs(t[6]-e[6])<=r&&Math.abs(t[7]-e[7])<=r&&Math.abs(t[8]-e[8])<=r&&Math.abs(t[9]-e[9])<=r&&Math.abs(t[10]-e[10])<=r&&Math.abs(t[11]-e[11])<=r&&Math.abs(t[12]-e[12])<=r&&Math.abs(t[13]-e[13])<=r&&Math.abs(t[14]-e[14])<=r&&Math.abs(t[15]-e[15])<=r},l.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},l.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var A=new s,d=new s,S=new e,m=new e(0,0,0,1);return l.inverse=function(t,r){if(s.equalsEpsilon(l.getRotation(t,A),d,u.EPSILON7)&&e.equals(l.getRow(t,3,S),m))return r[0]=0,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=0,r[11]=0,r[12]=-t[12],r[13]=-t[13],r[14]=-t[14],r[15]=1,r;var n=t[0],a=t[4],o=t[8],i=t[12],c=t[1],f=t[5],_=t[9],R=t[13],T=t[2],h=t[6],N=t[10],C=t[14],I=t[3],M=t[7],p=t[11],O=t[15],g=N*O,y=C*p,F=h*O,L=C*M,v=h*p,U=N*M,D=T*O,P=C*I,B=T*p,w=N*I,x=T*M,G=h*I,b=g*f+L*_+v*R-(y*f+F*_+U*R),z=y*c+D*_+w*R-(g*c+P*_+B*R),H=F*c+P*f+x*R-(L*c+D*f+G*R),V=U*c+B*f+G*_-(v*c+w*f+x*_),X=y*a+F*o+U*i-(g*a+L*o+v*i),q=g*n+P*o+B*i-(y*n+D*o+w*i),W=L*n+D*a+G*i-(F*n+P*a+x*i),Y=v*n+w*a+x*o-(U*n+B*a+G*o);g=o*R,y=i*_,F=a*R,L=i*f,v=a*_,U=o*f,D=n*R,P=i*c,B=n*_,w=o*c,x=n*f,G=a*c;var K=g*M+L*p+v*O-(y*M+F*p+U*O),k=y*I+D*p+w*O-(g*I+P*p+B*O),Z=F*I+P*M+x*O-(L*I+D*M+G*O),j=U*I+B*M+G*p-(v*I+w*M+x*p),Q=F*N+U*C+y*h-(v*C+g*h+L*N),J=B*C+g*T+P*N-(D*N+w*C+y*T),$=D*h+G*C+L*T-(x*C+F*T+P*h),tt=x*N+v*T+w*h-(B*h+G*N+U*T),et=n*b+a*z+o*H+i*V;if(Math.abs(et)<u.EPSILON20)throw new E("matrix is not invertible because its determinate is zero.");return et=1/et,r[0]=b*et,r[1]=z*et,r[2]=H*et,r[3]=V*et,r[4]=X*et,r[5]=q*et,r[6]=W*et,r[7]=Y*et,r[8]=K*et,r[9]=k*et,r[10]=Z*et,r[11]=j*et,r[12]=Q*et,r[13]=J*et,r[14]=$*et,r[15]=tt*et,r},l.inverseTransformation=function(t,e){var r=t[0],n=t[1],a=t[2],o=t[4],i=t[5],u=t[6],s=t[8],E=t[9],l=t[10],c=t[12],f=t[13],_=t[14],R=-r*c-n*f-a*_,T=-o*c-i*f-u*_,h=-s*c-E*f-l*_;return e[0]=r,e[1]=o,e[2]=s,e[3]=0,e[4]=n,e[5]=i,e[6]=E,e[7]=0,e[8]=a,e[9]=u,e[10]=l,e[11]=0,e[12]=R,e[13]=T,e[14]=h,e[15]=1,e},l.IDENTITY=i(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=i(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,o(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(t){return l.clone(this,t)},l.prototype.equals=function(t){return l.equals(this,t)},l.equalsArray=function(t,e,r){return t[0]===e[r]&&t[1]===e[r+1]&&t[2]===e[r+2]&&t[3]===e[r+3]&&t[4]===e[r+4]&&t[5]===e[r+5]&&t[6]===e[r+6]&&t[7]===e[r+7]&&t[8]===e[r+8]&&t[9]===e[r+9]&&t[10]===e[r+10]&&t[11]===e[r+11]&&t[12]===e[r+12]&&t[13]===e[r+13]&&t[14]===e[r+14]&&t[15]===e[r+15]},l.prototype.equalsEpsilon=function(t,e){return l.equalsEpsilon(this,t,e)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t,e,n,a){this.west=r(t,0),this.south=r(e,0),this.east=r(n,0),this.north=r(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(t,e,n){return n=r(n,0),e[n++]=t.west,e[n++]=t.south,e[n++]=t.east,e[n]=t.north,e},s.unpack=function(t,e,a){return e=r(e,0),n(a)||(a=new s),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},s.computeWidth=function(t){var e=t.east,r=t.west;return e<r&&(e+=u.TWO_PI),e-r},s.computeHeight=function(t){return t.north-t.south},s.fromDegrees=function(t,e,a,o,i){return t=u.toRadians(r(t,0)),e=u.toRadians(r(e,0)),a=u.toRadians(r(a,0)),o=u.toRadians(r(o,0)),n(i)?(i.west=t,i.south=e,i.east=a,i.north=o,i):new s(t,e,a,o)},s.fromRadians=function(t,e,a,o,i){return n(i)?(i.west=r(t,0),i.south=r(e,0),i.east=r(a,0),i.north=r(o,0),i):new s(t,e,a,o)},s.fromCartographicArray=function(t,e){for(var r=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,i=-Number.MAX_VALUE,E=Number.MAX_VALUE,l=-Number.MAX_VALUE,c=0,f=t.length;c<f;c++){var _=t[c];r=Math.min(r,_.longitude),a=Math.max(a,_.longitude),E=Math.min(E,_.latitude),l=Math.max(l,_.latitude);var R=_.longitude>=0?_.longitude:_.longitude+u.TWO_PI;o=Math.min(o,R),i=Math.max(i,R)}return a-r>i-o&&(r=o,a=i,a>u.PI&&(a-=u.TWO_PI),r>u.PI&&(r-=u.TWO_PI)),n(e)?(e.west=r,e.south=E,e.east=a,e.north=l,e):new s(r,E,a,l)},s.fromCartesianArray=function(t,e,r){for(var a=Number.MAX_VALUE,o=-Number.MAX_VALUE,i=Number.MAX_VALUE,E=-Number.MAX_VALUE,l=Number.MAX_VALUE,c=-Number.MAX_VALUE,f=0,_=t.length;f<_;f++){var R=e.cartesianToCartographic(t[f]);a=Math.min(a,R.longitude),o=Math.max(o,R.longitude),l=Math.min(l,R.latitude),c=Math.max(c,R.latitude);var T=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;i=Math.min(i,T),E=Math.max(E,T)}return o-a>E-i&&(a=i,o=E,o>u.PI&&(o-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),n(r)?(r.west=a,r.south=l,r.east=o,r.north=c,r):new s(a,l,o,c)},s.clone=function(t,e){if(n(t))return n(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new s(t.west,t.south,t.east,t.north)},s.prototype.clone=function(t){return s.clone(this,t)},s.prototype.equals=function(t){return s.equals(this,t)},s.equals=function(t,e){return t===e||n(t)&&n(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},s.prototype.equalsEpsilon=function(t,e){return n(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},s.validate=function(t){},s.southwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.south,r.height=0,r):new t(e.west,e.south)},s.northwest=function(e,r){return n(r)?(r.longitude=e.west,r.latitude=e.north,r.height=0,r):new t(e.west,e.north)},s.northeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.north,r.height=0,r):new t(e.east,e.north)},s.southeast=function(e,r){return n(r)?(r.longitude=e.east,r.latitude=e.south,r.height=0,r):new t(e.east,e.south)},s.center=function(e,r){var a=e.east,o=e.west;a<o&&(a+=u.TWO_PI);var i=u.negativePiToPi(.5*(o+a)),s=.5*(e.south+e.north);return n(r)?(r.longitude=i,r.latitude=s,r.height=0,r):new t(i,s)},s.intersection=function(t,e,r){var a=t.east,o=t.west,i=e.east,E=e.west;a<o&&i>0?a+=u.TWO_PI:i<E&&a>0&&(i+=u.TWO_PI),a<o&&E<0?E+=u.TWO_PI:i<E&&o<0&&(o+=u.TWO_PI);var l=u.negativePiToPi(Math.max(o,E)),c=u.negativePiToPi(Math.min(a,i));if(!((t.west<t.east||e.west<e.east)&&c<=l)){var f=Math.max(t.south,e.south),_=Math.min(t.north,e.north);if(!(f>=_))return n(r)?(r.west=l,r.south=f,r.east=c,r.north=_,r):new s(l,f,c,_)}},s.simpleIntersection=function(t,e,r){var a=Math.max(t.west,e.west),o=Math.max(t.south,e.south),i=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(o>=u||a>=i))return n(r)?(r.west=a,r.south=o,r.east=i,r.north=u,r):new s(a,o,i,u)},s.union=function(t,e,r){n(r)||(r=new s);var a=t.east,o=t.west,i=e.east,E=e.west;a<o&&i>0?a+=u.TWO_PI:i<E&&a>0&&(i+=u.TWO_PI),a<o&&E<0?E+=u.TWO_PI:i<E&&o<0&&(o+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(o,E)),c=u.convertLongitudeRange(Math.max(a,i));return r.west=l,r.south=Math.min(t.south,e.south),r.east=c,r.north=Math.max(t.north,e.north),r},s.expand=function(t,e,r){return n(r)||(r=new s),r.west=Math.min(t.west,e.longitude),r.south=Math.min(t.south,e.latitude),r.east=Math.max(t.east,e.longitude),r.north=Math.max(t.north,e.latitude),r},s.contains=function(t,e){var r=e.longitude,n=e.latitude,a=t.west,o=t.east;return o<a&&(o+=u.TWO_PI,r<0&&(r+=u.TWO_PI)),(r>a||u.equalsEpsilon(r,a,u.EPSILON14))&&(r<o||u.equalsEpsilon(r,o,u.EPSILON14))&&n>=t.south&&n<=t.north};var E=new t;return s.subsample=function(t,e,a,i){e=r(e,o.WGS84),a=r(a,0),n(i)||(i=[]);var l=0,c=t.north,f=t.south,_=t.east,R=t.west,T=E;T.height=a,T.longitude=R,T.latitude=c,i[l]=e.cartographicToCartesian(T,i[l]),l++,T.longitude=_,i[l]=e.cartographicToCartesian(T,i[l]),l++,T.latitude=f,i[l]=e.cartographicToCartesian(T,i[l]),l++,T.longitude=R,i[l]=e.cartographicToCartesian(T,i[l]),l++,c<0?T.latitude=c:f>0?T.latitude=f:T.latitude=0;for(var h=1;h<8;++h)T.longitude=-Math.PI+h*u.PI_OVER_TWO,s.contains(t,T)&&(i[l]=e.cartographicToCartesian(T,i[l]),l++);return 0===T.latitude&&(T.longitude=R,i[l]=e.cartographicToCartesian(T,i[l]),l++,T.longitude=_,i[l]=e.cartographicToCartesian(T,i[l]),l++),i.length=l,i},s.MAX_VALUE=i(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,r,n,a,o,i,u,s,E,l,c){"use strict";function f(e,r){this.center=t.clone(n(e,t.ZERO)),this.radius=n(r,0)}var _=new t,R=new t,T=new t,h=new t,A=new t,d=new t,S=new t,m=new t,N=new t,C=new t,I=new t,M=new t;f.fromPoints=function(e,r){if(a(r)||(r=new f),!a(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;for(var n=t.clone(e[0],S),o=t.clone(n,_),i=t.clone(n,R),u=t.clone(n,T),s=t.clone(n,h),E=t.clone(n,A),l=t.clone(n,d),c=e.length,p=1;p<c;p++){t.clone(e[p],n);var O=n.x,g=n.y,y=n.z;O<o.x&&t.clone(n,o),O>s.x&&t.clone(n,s),g<i.y&&t.clone(n,i),g>E.y&&t.clone(n,E),y<u.z&&t.clone(n,u),y>l.z&&t.clone(n,l)}var F=t.magnitudeSquared(t.subtract(s,o,m)),L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(l,u,m)),U=o,D=s,P=F;L>P&&(P=L,U=i,D=E),v>P&&(P=v,U=u,D=l);var B=N;B.x=.5*(U.x+D.x),B.y=.5*(U.y+D.y),B.z=.5*(U.z+D.z);var w=t.magnitudeSquared(t.subtract(D,B,m)),x=Math.sqrt(w),G=C;G.x=o.x,G.y=i.y,G.z=u.z;var b=I;b.x=s.x,b.y=E.y,b.z=l.z;var z=t.multiplyByScalar(t.add(G,b,m),.5,M),H=0;for(p=0;p<c;p++){t.clone(e[p],n);var V=t.magnitude(t.subtract(n,z,m));V>H&&(H=V);var X=t.magnitudeSquared(t.subtract(n,B,m));if(X>w){var q=Math.sqrt(X);x=.5*(x+q),w=x*x;var W=q-x;B.x=(x*B.x+W*n.x)/q,B.y=(x*B.y+W*n.y)/q,B.z=(x*B.z+W*n.z)/q}}return x<H?(t.clone(B,r.center),r.radius=x):(t.clone(z,r.center),r.radius=H),r};var p=new i,O=new t,g=new t,y=new e,F=new e;f.fromRectangle2D=function(t,e,r){return f.fromRectangleWithHeights2D(t,e,0,0,r)},f.fromRectangleWithHeights2D=function(e,r,o,i,u){if(a(u)||(u=new f),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;r=n(r,p),c.southwest(e,y),y.height=o,c.northeast(e,F),F.height=i;var s=r.project(y,O),E=r.project(F,g),l=E.x-s.x,_=E.y-s.y,R=E.z-s.z;u.radius=.5*Math.sqrt(l*l+_*_+R*R);var T=u.center;return T.x=s.x+.5*l,T.y=s.y+.5*_,T.z=s.z+.5*R,u};var L=[];f.fromRectangle3D=function(t,e,r,i){e=n(e,o.WGS84),r=n(r,0);var u;return a(t)&&(u=c.subsample(t,e,r,L)),f.fromPoints(u,i)},f.fromVertices=function(e,r,o,i){if(a(i)||(i=new f),!a(e)||0===e.length)return i.center=t.clone(t.ZERO,i.center),i.radius=0,i;r=n(r,t.ZERO),o=n(o,3);var u=S;u.x=e[0]+r.x,u.y=e[1]+r.y,u.z=e[2]+r.z;for(var s=t.clone(u,_),E=t.clone(u,R),l=t.clone(u,T),c=t.clone(u,h),p=t.clone(u,A),O=t.clone(u,d),g=e.length,y=0;y<g;y+=o){var F=e[y]+r.x,L=e[y+1]+r.y,v=e[y+2]+r.z;u.x=F,u.y=L,u.z=v,F<s.x&&t.clone(u,s),F>c.x&&t.clone(u,c),L<E.y&&t.clone(u,E),L>p.y&&t.clone(u,p),v<l.z&&t.clone(u,l),v>O.z&&t.clone(u,O)}var U=t.magnitudeSquared(t.subtract(c,s,m)),D=t.magnitudeSquared(t.subtract(p,E,m)),P=t.magnitudeSquared(t.subtract(O,l,m)),B=s,w=c,x=U;D>x&&(x=D,B=E,w=p),P>x&&(x=P,B=l,w=O);var G=N;G.x=.5*(B.x+w.x),G.y=.5*(B.y+w.y),G.z=.5*(B.z+w.z);var b=t.magnitudeSquared(t.subtract(w,G,m)),z=Math.sqrt(b),H=C;H.x=s.x,H.y=E.y,H.z=l.z;var V=I;V.x=c.x,V.y=p.y,V.z=O.z;var X=t.multiplyByScalar(t.add(H,V,m),.5,M),q=0;for(y=0;y<g;y+=o){u.x=e[y]+r.x,u.y=e[y+1]+r.y,u.z=e[y+2]+r.z;var W=t.magnitude(t.subtract(u,X,m));W>q&&(q=W);var Y=t.magnitudeSquared(t.subtract(u,G,m));if(Y>b){var K=Math.sqrt(Y);z=.5*(z+K),b=z*z;var k=K-z;G.x=(z*G.x+k*u.x)/K,G.y=(z*G.y+k*u.y)/K,G.z=(z*G.z+k*u.z)/K}}return z<q?(t.clone(G,i.center),i.radius=z):(t.clone(X,i.center),i.radius=q),i},f.fromEncodedCartesianVertices=function(e,r,n){if(a(n)||(n=new f),!a(e)||!a(r)||e.length!==r.length||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var o=S;o.x=e[0]+r[0],o.y=e[1]+r[1],o.z=e[2]+r[2];for(var i=t.clone(o,_),u=t.clone(o,R),s=t.clone(o,T),E=t.clone(o,h),l=t.clone(o,A),c=t.clone(o,d),p=e.length,O=0;O<p;O+=3){var g=e[O]+r[O],y=e[O+1]+r[O+1],F=e[O+2]+r[O+2];o.x=g,o.y=y,o.z=F,g<i.x&&t.clone(o,i),g>E.x&&t.clone(o,E),y<u.y&&t.clone(o,u),y>l.y&&t.clone(o,l),F<s.z&&t.clone(o,s),F>c.z&&t.clone(o,c)}var L=t.magnitudeSquared(t.subtract(E,i,m)),v=t.magnitudeSquared(t.subtract(l,u,m)),U=t.magnitudeSquared(t.subtract(c,s,m)),D=i,P=E,B=L;v>B&&(B=v,D=u,P=l),U>B&&(B=U,D=s,P=c);var w=N;w.x=.5*(D.x+P.x),w.y=.5*(D.y+P.y),w.z=.5*(D.z+P.z);var x=t.magnitudeSquared(t.subtract(P,w,m)),G=Math.sqrt(x),b=C;b.x=i.x,b.y=u.y,b.z=s.z;var z=I;z.x=E.x,z.y=l.y,z.z=c.z;var H=t.multiplyByScalar(t.add(b,z,m),.5,M),V=0;for(O=0;O<p;O+=3){o.x=e[O]+r[O],o.y=e[O+1]+r[O+1],o.z=e[O+2]+r[O+2];var X=t.magnitude(t.subtract(o,H,m));X>V&&(V=X);var q=t.magnitudeSquared(t.subtract(o,w,m));if(q>x){var W=Math.sqrt(q);G=.5*(G+W),x=G*G;var Y=W-G;w.x=(G*w.x+Y*o.x)/W,w.y=(G*w.y+Y*o.y)/W,w.z=(G*w.z+Y*o.z)/W}}return G<V?(t.clone(w,n.center),n.radius=G):(t.clone(H,n.center),n.radius=V),n},f.fromCornerPoints=function(e,r,n){a(n)||(n=new f);var o=n.center;return t.add(e,r,o),t.multiplyByScalar(o,.5,o),n.radius=t.distance(o,r),n},f.fromEllipsoid=function(e,r){return a(r)||(r=new f),t.clone(t.ZERO,r.center),r.radius=e.maximumRadius,r};var v=new t;f.fromBoundingSpheres=function(e,r){if(a(r)||(r=new f),!a(e)||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var n=e.length;if(1===n)return f.clone(e[0],r);if(2===n)return f.union(e[0],e[1],r);for(var o=[],i=0;i<n;i++)o.push(e[i].center);r=f.fromPoints(o,r);var u=r.center,s=r.radius;for(i=0;i<n;i++){var E=e[i];s=Math.max(s,t.distance(u,E.center,v)+E.radius)}return r.radius=s,r};var U=new t,D=new t,P=new t;f.fromOrientedBoundingBox=function(e,r){a(r)||(r=new f);var n=e.halfAxes,o=E.getColumn(n,0,U),i=E.getColumn(n,1,D),u=E.getColumn(n,2,P);return t.add(o,i,o),t.add(o,u,o),r.center=t.clone(e.center,r.center),r.radius=t.magnitude(o),r},f.clone=function(e,r){if(a(e))return a(r)?(r.center=t.clone(e.center,r.center),r.radius=e.radius,r):new f(e.center,e.radius)},f.packedLength=4,f.pack=function(t,e,r){r=n(r,0);var a=t.center;return e[r++]=a.x,e[r++]=a.y,e[r++]=a.z,e[r]=t.radius,e},f.unpack=function(t,e,r){e=n(e,0),a(r)||(r=new f);var o=r.center;return o.x=t[e++],o.y=t[e++],o.z=t[e++],r.radius=t[e],r};var B=new t,w=new t;f.union=function(e,r,n){a(n)||(n=new f);var o=e.center,i=e.radius,u=r.center,s=r.radius,E=t.subtract(u,o,B),l=t.magnitude(E);if(i>=l+s)return e.clone(n),n;if(s>=l+i)return r.clone(n),n;var c=.5*(i+l+s),_=t.multiplyByScalar(E,(-i+c)/l,w);return t.add(_,o,_),t.clone(_,n.center),n.radius=c,n};var x=new t;f.expand=function(e,r,n){n=f.clone(e,n);var a=t.magnitude(t.subtract(r,n.center,x));return a>n.radius&&(n.radius=a),n},f.intersectPlane=function(e,r){var n=e.center,a=e.radius,o=r.normal,i=t.dot(o,n)+r.distance;return i<-a?u.OUTSIDE:i<a?u.INTERSECTING:u.INSIDE},f.transform=function(t,e,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(e,t.center,r.center),r.radius=l.getMaximumScale(e)*t.radius,r};var G=new t;f.distanceSquaredTo=function(e,r){var n=t.subtract(e.center,r,G);return t.magnitudeSquared(n)-e.radius*e.radius},f.transformWithoutScale=function(t,e,r){return a(r)||(r=new f),r.center=l.multiplyByPoint(e,t.center,r.center),r.radius=t.radius,r};var b=new t;f.computePlaneDistances=function(e,r,n,o){a(o)||(o=new s);var i=t.subtract(e.center,r,b),u=t.dot(n,i);return o.start=u-e.radius,o.stop=u+e.radius,o};for(var z=new t,H=new t,V=new t,X=new t,q=new t,W=new e,Y=new Array(8),K=0;K<8;++K)Y[K]=new t;var k=new i;return f.projectTo2D=function(e,r,a){r=n(r,k);var o=r.ellipsoid,i=e.center,u=e.radius,s=o.geodeticSurfaceNormal(i,z),E=t.cross(t.UNIT_Z,s,H);t.normalize(E,E);var l=t.cross(s,E,V);t.normalize(l,l),t.multiplyByScalar(s,u,s),t.multiplyByScalar(l,u,l),t.multiplyByScalar(E,u,E);var c=t.negate(l,q),_=t.negate(E,X),R=Y,T=R[0];t.add(s,l,T),t.add(T,E,T),T=R[1],t.add(s,l,T),t.add(T,_,T),T=R[2],t.add(s,c,T),t.add(T,_,T),T=R[3],t.add(s,c,T),t.add(T,E,T),t.negate(s,s),T=R[4],t.add(s,l,T),t.add(T,E,T),T=R[5],t.add(s,l,T),t.add(T,_,T),T=R[6],t.add(s,c,T),t.add(T,_,T),T=R[7],t.add(s,c,T),t.add(T,E,T);for(var h=R.length,A=0;A<h;++A){var d=R[A];t.add(i,d,d);var S=o.cartesianToCartographic(d,W);r.project(S,d)}a=f.fromPoints(R,a),i=a.center;var m=i.x,N=i.y,C=i.z;return i.x=C,i.y=m,i.z=N,a},f.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},f.equals=function(e,r){return e===r||a(e)&&a(r)&&t.equals(e.center,r.center)&&e.radius===r.radius},f.prototype.intersectPlane=function(t){return f.intersectPlane(this,t)},f.prototype.distanceSquaredTo=function(t){return f.distanceSquaredTo(this,t)},f.prototype.computePlaneDistances=function(t,e,r){return f.computePlaneDistances(this,t,e,r)},f.prototype.isOccluded=function(t){return f.isOccluded(this,t)},f.prototype.equals=function(t){return f.equals(this,t)},f.prototype.clone=function(t){return f.clone(this,t)},f}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var r,n={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return n.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[n.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(r))return r;r=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return n.requestFullscreen="requestFullscreen",n.exitFullscreen="exitFullscreen",n.fullscreenEnabled="fullscreenEnabled",n.fullscreenElement="fullscreenElement",n.fullscreenchange="fullscreenchange",n.fullscreenerror="fullscreenerror",r=!0;for(var a,o=["webkit","moz","o","ms","khtml"],i=0,u=o.length;i<u;++i){var s=o[i];a=s+"RequestFullscreen","function"==typeof e[a]?(n.requestFullscreen=a,r=!0):(a=s+"RequestFullScreen","function"==typeof e[a]&&(n.requestFullscreen=a,r=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?n.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(n.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?n.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(n.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?n.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(n.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),n.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),n.fullscreenerror=a)}return r},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[n.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[n.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,r){"use strict";function n(t){for(var e=t.split("."),r=0,n=e.length;r<n;++r)e[r]=parseInt(e[r],10);return e}function a(){if(!e(N)&&(N=!1,!f())){var t=/ Chrome\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(N=!0,C=n(t[1]))}return N}function o(){return a()&&C}function i(){if(!e(I)&&(I=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(m.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(I=!0,M=n(t[1]))}return I}function u(){return i()&&M}function s(){if(!e(p)){p=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(m.userAgent);null!==t&&(p=!0,O=n(t[1]),O.isNightly=!!t[2])}return p}function E(){return s()&&O}function l(){if(!e(g)){g=!1;var t;"Microsoft Internet Explorer"===m.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1]))):"Netscape"===m.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(m.userAgent),null!==t&&(g=!0,y=n(t[1])))}return g}function c(){return l()&&y}function f(){if(!e(F)){F=!1;var t=/ Edge\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(F=!0,L=n(t[1]))}return F}function _(){return f()&&L}function R(){if(!e(v)){v=!1;var t=/Firefox\/([\.0-9]+)/.exec(m.userAgent);null!==t&&(v=!0,U=n(t[1])); +}return v}function T(){return e(D)||(D=/Windows/i.test(m.appVersion)),D}function h(){return R()&&U}function A(){return e(P)||(P="undefined"!=typeof PointerEvent&&(!e(m.pointerEnabled)||m.pointerEnabled)),P}function d(){if(!e(w)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var r=t.style.imageRendering;w=e(r)&&""!==r,w&&(B=r)}return w}function S(){return d()?B:void 0}var m;m="undefined"!=typeof navigator?navigator:{};var N,C,I,M,p,O,g,y,F,L,v,U,D,P,B,w,x={isChrome:a,chromeVersion:o,isSafari:i,safariVersion:u,isWebkit:s,webkitVersion:E,isInternetExplorer:l,internetExplorerVersion:c,isEdge:f,edgeVersion:_,isFirefox:R,firefoxVersion:h,isWindows:T,hardwareConcurrency:t(m.hardwareConcurrency,3),supportsPointerEvents:A,supportsImageRenderingPixelated:d,imageRenderingValue:S};return x.supportsFullscreen=function(){return r.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/Color",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./Math"],function(t,e,r,n,a,o){"use strict";function i(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),6*r<1?t+6*(e-t)*r:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function u(e,r,n,a){this.red=t(e,1),this.green=t(r,1),this.blue=t(n,1),this.alpha=t(a,1)}u.fromCartesian4=function(t,r){return e(r)?(r.red=t.x,r.green=t.y,r.blue=t.z,r.alpha=t.w,r):new u(t.x,t.y,t.z,t.w)},u.fromBytes=function(r,n,a,o,i){return r=u.byteToFloat(t(r,255)),n=u.byteToFloat(t(n,255)),a=u.byteToFloat(t(a,255)),o=u.byteToFloat(t(o,255)),e(i)?(i.red=r,i.green=n,i.blue=a,i.alpha=o,i):new u(r,n,a,o)},u.fromAlpha=function(t,r,n){return e(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=r,n):new u(t.red,t.green,t.blue,r)};var s,E,l;n.supportsTypedArrays()&&(s=new ArrayBuffer(4),E=new Uint32Array(s),l=new Uint8Array(s)),u.fromRgba=function(t,e){return E[0]=t,u.fromBytes(l[0],l[1],l[2],l[3],e)},u.fromHsl=function(r,n,a,o,s){r=t(r,0)%1,n=t(n,0),a=t(a,0),o=t(o,1);var E=a,l=a,c=a;if(0!==n){var f;f=a<.5?a*(1+n):a+n-a*n;var _=2*a-f;E=i(_,f,r+1/3),l=i(_,f,r),c=i(_,f,r-1/3)}return e(s)?(s.red=E,s.green=l,s.blue=c,s.alpha=o,s):new u(E,l,c,o)},u.fromRandom=function(r,n){r=t(r,t.EMPTY_OBJECT);var a=r.red;if(!e(a)){var i=t(r.minimumRed,0),s=t(r.maximumRed,1);a=i+o.nextRandomNumber()*(s-i)}var E=r.green;if(!e(E)){var l=t(r.minimumGreen,0),c=t(r.maximumGreen,1);E=l+o.nextRandomNumber()*(c-l)}var f=r.blue;if(!e(f)){var _=t(r.minimumBlue,0),R=t(r.maximumBlue,1);f=_+o.nextRandomNumber()*(R-_)}var T=r.alpha;if(!e(T)){var h=t(r.minimumAlpha,0),A=t(r.maximumAlpha,1);T=h+o.nextRandomNumber()*(A-h)}return e(n)?(n.red=a,n.green=E,n.blue=f,n.alpha=T,n):new u(a,E,f,T)};var c=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,f=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,_=/^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,R=/^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;return u.fromCssColorString=function(r,n){e(n)||(n=new u);var a=u[r.toUpperCase()];if(e(a))return u.clone(a,n),n;var o=c.exec(r);return null!==o?(n.red=parseInt(o[1],16)/15,n.green=parseInt(o[2],16)/15,n.blue=parseInt(o[3],16)/15,n.alpha=1,n):(o=f.exec(r),null!==o?(n.red=parseInt(o[1],16)/255,n.green=parseInt(o[2],16)/255,n.blue=parseInt(o[3],16)/255,n.alpha=1,n):(o=_.exec(r),null!==o?(n.red=parseFloat(o[1])/("%"===o[1].substr(-1)?100:255),n.green=parseFloat(o[2])/("%"===o[2].substr(-1)?100:255),n.blue=parseFloat(o[3])/("%"===o[3].substr(-1)?100:255),n.alpha=parseFloat(t(o[4],"1.0")),n):(o=R.exec(r),null!==o?u.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(t(o[4],"1.0")),n):n=void 0)))},u.packedLength=4,u.pack=function(e,r,n){return n=t(n,0),r[n++]=e.red,r[n++]=e.green,r[n++]=e.blue,r[n]=e.alpha,r},u.unpack=function(r,n,a){return n=t(n,0),e(a)||(a=new u),a.red=r[n++],a.green=r[n++],a.blue=r[n++],a.alpha=r[n],a},u.byteToFloat=function(t){return t/255},u.floatToByte=function(t){return 1===t?255:256*t|0},u.clone=function(t,r){if(e(t))return e(r)?(r.red=t.red,r.green=t.green,r.blue=t.blue,r.alpha=t.alpha,r):new u(t.red,t.green,t.blue,t.alpha)},u.equals=function(t,r){return t===r||e(t)&&e(r)&&t.red===r.red&&t.green===r.green&&t.blue===r.blue&&t.alpha===r.alpha},u.equalsArray=function(t,e,r){return t.red===e[r]&&t.green===e[r+1]&&t.blue===e[r+2]&&t.alpha===e[r+3]},u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,r){return this===t||e(t)&&Math.abs(this.red-t.red)<=r&&Math.abs(this.green-t.green)<=r&&Math.abs(this.blue-t.blue)<=r&&Math.abs(this.alpha-t.alpha)<=r},u.prototype.toString=function(){return"("+this.red+", "+this.green+", "+this.blue+", "+this.alpha+")"},u.prototype.toCssColorString=function(){var t=u.floatToByte(this.red),e=u.floatToByte(this.green),r=u.floatToByte(this.blue);return 1===this.alpha?"rgb("+t+","+e+","+r+")":"rgba("+t+","+e+","+r+","+this.alpha+")"},u.prototype.toBytes=function(t){var r=u.floatToByte(this.red),n=u.floatToByte(this.green),a=u.floatToByte(this.blue),o=u.floatToByte(this.alpha);return e(t)?(t[0]=r,t[1]=n,t[2]=a,t[3]=o,t):[r,n,a,o]},u.prototype.toRgba=function(){return l[0]=u.floatToByte(this.red),l[1]=u.floatToByte(this.green),l[2]=u.floatToByte(this.blue),l[3]=u.floatToByte(this.alpha),E[0]},u.prototype.brighten=function(t,e){return t=1-t,e.red=1-(1-this.red)*t,e.green=1-(1-this.green)*t,e.blue=1-(1-this.blue)*t,e.alpha=this.alpha,e},u.prototype.darken=function(t,e){return t=1-t,e.red=this.red*t,e.green=this.green*t,e.blue=this.blue*t,e.alpha=this.alpha,e},u.prototype.withAlpha=function(t,e){return u.fromAlpha(this,t,e)},u.add=function(t,e,r){return r.red=t.red+e.red,r.green=t.green+e.green,r.blue=t.blue+e.blue,r.alpha=t.alpha+e.alpha,r},u.subtract=function(t,e,r){return r.red=t.red-e.red,r.green=t.green-e.green,r.blue=t.blue-e.blue,r.alpha=t.alpha-e.alpha,r},u.multiply=function(t,e,r){return r.red=t.red*e.red,r.green=t.green*e.green,r.blue=t.blue*e.blue,r.alpha=t.alpha*e.alpha,r},u.divide=function(t,e,r){return r.red=t.red/e.red,r.green=t.green/e.green,r.blue=t.blue/e.blue,r.alpha=t.alpha/e.alpha,r},u.mod=function(t,e,r){return r.red=t.red%e.red,r.green=t.green%e.green,r.blue=t.blue%e.blue,r.alpha=t.alpha%e.alpha,r},u.multiplyByScalar=function(t,e,r){return r.red=t.red*e,r.green=t.green*e,r.blue=t.blue*e,r.alpha=t.alpha*e,r},u.divideByScalar=function(t,e,r){return r.red=t.red/e,r.green=t.green/e,r.blue=t.blue/e,r.alpha=t.alpha/e,r},u.ALICEBLUE=a(u.fromCssColorString("#F0F8FF")),u.ANTIQUEWHITE=a(u.fromCssColorString("#FAEBD7")),u.AQUA=a(u.fromCssColorString("#00FFFF")),u.AQUAMARINE=a(u.fromCssColorString("#7FFFD4")),u.AZURE=a(u.fromCssColorString("#F0FFFF")),u.BEIGE=a(u.fromCssColorString("#F5F5DC")),u.BISQUE=a(u.fromCssColorString("#FFE4C4")),u.BLACK=a(u.fromCssColorString("#000000")),u.BLANCHEDALMOND=a(u.fromCssColorString("#FFEBCD")),u.BLUE=a(u.fromCssColorString("#0000FF")),u.BLUEVIOLET=a(u.fromCssColorString("#8A2BE2")),u.BROWN=a(u.fromCssColorString("#A52A2A")),u.BURLYWOOD=a(u.fromCssColorString("#DEB887")),u.CADETBLUE=a(u.fromCssColorString("#5F9EA0")),u.CHARTREUSE=a(u.fromCssColorString("#7FFF00")),u.CHOCOLATE=a(u.fromCssColorString("#D2691E")),u.CORAL=a(u.fromCssColorString("#FF7F50")),u.CORNFLOWERBLUE=a(u.fromCssColorString("#6495ED")),u.CORNSILK=a(u.fromCssColorString("#FFF8DC")),u.CRIMSON=a(u.fromCssColorString("#DC143C")),u.CYAN=a(u.fromCssColorString("#00FFFF")),u.DARKBLUE=a(u.fromCssColorString("#00008B")),u.DARKCYAN=a(u.fromCssColorString("#008B8B")),u.DARKGOLDENROD=a(u.fromCssColorString("#B8860B")),u.DARKGRAY=a(u.fromCssColorString("#A9A9A9")),u.DARKGREEN=a(u.fromCssColorString("#006400")),u.DARKGREY=u.DARKGRAY,u.DARKKHAKI=a(u.fromCssColorString("#BDB76B")),u.DARKMAGENTA=a(u.fromCssColorString("#8B008B")),u.DARKOLIVEGREEN=a(u.fromCssColorString("#556B2F")),u.DARKORANGE=a(u.fromCssColorString("#FF8C00")),u.DARKORCHID=a(u.fromCssColorString("#9932CC")),u.DARKRED=a(u.fromCssColorString("#8B0000")),u.DARKSALMON=a(u.fromCssColorString("#E9967A")),u.DARKSEAGREEN=a(u.fromCssColorString("#8FBC8F")),u.DARKSLATEBLUE=a(u.fromCssColorString("#483D8B")),u.DARKSLATEGRAY=a(u.fromCssColorString("#2F4F4F")),u.DARKSLATEGREY=u.DARKSLATEGRAY,u.DARKTURQUOISE=a(u.fromCssColorString("#00CED1")),u.DARKVIOLET=a(u.fromCssColorString("#9400D3")),u.DEEPPINK=a(u.fromCssColorString("#FF1493")),u.DEEPSKYBLUE=a(u.fromCssColorString("#00BFFF")),u.DIMGRAY=a(u.fromCssColorString("#696969")),u.DIMGREY=u.DIMGRAY,u.DODGERBLUE=a(u.fromCssColorString("#1E90FF")),u.FIREBRICK=a(u.fromCssColorString("#B22222")),u.FLORALWHITE=a(u.fromCssColorString("#FFFAF0")),u.FORESTGREEN=a(u.fromCssColorString("#228B22")),u.FUCHSIA=a(u.fromCssColorString("#FF00FF")),u.GAINSBORO=a(u.fromCssColorString("#DCDCDC")),u.GHOSTWHITE=a(u.fromCssColorString("#F8F8FF")),u.GOLD=a(u.fromCssColorString("#FFD700")),u.GOLDENROD=a(u.fromCssColorString("#DAA520")),u.GRAY=a(u.fromCssColorString("#808080")),u.GREEN=a(u.fromCssColorString("#008000")),u.GREENYELLOW=a(u.fromCssColorString("#ADFF2F")),u.GREY=u.GRAY,u.HONEYDEW=a(u.fromCssColorString("#F0FFF0")),u.HOTPINK=a(u.fromCssColorString("#FF69B4")),u.INDIANRED=a(u.fromCssColorString("#CD5C5C")),u.INDIGO=a(u.fromCssColorString("#4B0082")),u.IVORY=a(u.fromCssColorString("#FFFFF0")),u.KHAKI=a(u.fromCssColorString("#F0E68C")),u.LAVENDER=a(u.fromCssColorString("#E6E6FA")),u.LAVENDAR_BLUSH=a(u.fromCssColorString("#FFF0F5")),u.LAWNGREEN=a(u.fromCssColorString("#7CFC00")),u.LEMONCHIFFON=a(u.fromCssColorString("#FFFACD")),u.LIGHTBLUE=a(u.fromCssColorString("#ADD8E6")),u.LIGHTCORAL=a(u.fromCssColorString("#F08080")),u.LIGHTCYAN=a(u.fromCssColorString("#E0FFFF")),u.LIGHTGOLDENRODYELLOW=a(u.fromCssColorString("#FAFAD2")),u.LIGHTGRAY=a(u.fromCssColorString("#D3D3D3")),u.LIGHTGREEN=a(u.fromCssColorString("#90EE90")),u.LIGHTGREY=u.LIGHTGRAY,u.LIGHTPINK=a(u.fromCssColorString("#FFB6C1")),u.LIGHTSEAGREEN=a(u.fromCssColorString("#20B2AA")),u.LIGHTSKYBLUE=a(u.fromCssColorString("#87CEFA")),u.LIGHTSLATEGRAY=a(u.fromCssColorString("#778899")),u.LIGHTSLATEGREY=u.LIGHTSLATEGRAY,u.LIGHTSTEELBLUE=a(u.fromCssColorString("#B0C4DE")),u.LIGHTYELLOW=a(u.fromCssColorString("#FFFFE0")),u.LIME=a(u.fromCssColorString("#00FF00")),u.LIMEGREEN=a(u.fromCssColorString("#32CD32")),u.LINEN=a(u.fromCssColorString("#FAF0E6")),u.MAGENTA=a(u.fromCssColorString("#FF00FF")),u.MAROON=a(u.fromCssColorString("#800000")),u.MEDIUMAQUAMARINE=a(u.fromCssColorString("#66CDAA")),u.MEDIUMBLUE=a(u.fromCssColorString("#0000CD")),u.MEDIUMORCHID=a(u.fromCssColorString("#BA55D3")),u.MEDIUMPURPLE=a(u.fromCssColorString("#9370DB")),u.MEDIUMSEAGREEN=a(u.fromCssColorString("#3CB371")),u.MEDIUMSLATEBLUE=a(u.fromCssColorString("#7B68EE")),u.MEDIUMSPRINGGREEN=a(u.fromCssColorString("#00FA9A")),u.MEDIUMTURQUOISE=a(u.fromCssColorString("#48D1CC")),u.MEDIUMVIOLETRED=a(u.fromCssColorString("#C71585")),u.MIDNIGHTBLUE=a(u.fromCssColorString("#191970")),u.MINTCREAM=a(u.fromCssColorString("#F5FFFA")),u.MISTYROSE=a(u.fromCssColorString("#FFE4E1")),u.MOCCASIN=a(u.fromCssColorString("#FFE4B5")),u.NAVAJOWHITE=a(u.fromCssColorString("#FFDEAD")),u.NAVY=a(u.fromCssColorString("#000080")),u.OLDLACE=a(u.fromCssColorString("#FDF5E6")),u.OLIVE=a(u.fromCssColorString("#808000")),u.OLIVEDRAB=a(u.fromCssColorString("#6B8E23")),u.ORANGE=a(u.fromCssColorString("#FFA500")),u.ORANGERED=a(u.fromCssColorString("#FF4500")),u.ORCHID=a(u.fromCssColorString("#DA70D6")),u.PALEGOLDENROD=a(u.fromCssColorString("#EEE8AA")),u.PALEGREEN=a(u.fromCssColorString("#98FB98")),u.PALETURQUOISE=a(u.fromCssColorString("#AFEEEE")),u.PALEVIOLETRED=a(u.fromCssColorString("#DB7093")),u.PAPAYAWHIP=a(u.fromCssColorString("#FFEFD5")),u.PEACHPUFF=a(u.fromCssColorString("#FFDAB9")),u.PERU=a(u.fromCssColorString("#CD853F")),u.PINK=a(u.fromCssColorString("#FFC0CB")),u.PLUM=a(u.fromCssColorString("#DDA0DD")),u.POWDERBLUE=a(u.fromCssColorString("#B0E0E6")),u.PURPLE=a(u.fromCssColorString("#800080")),u.RED=a(u.fromCssColorString("#FF0000")),u.ROSYBROWN=a(u.fromCssColorString("#BC8F8F")),u.ROYALBLUE=a(u.fromCssColorString("#4169E1")),u.SADDLEBROWN=a(u.fromCssColorString("#8B4513")),u.SALMON=a(u.fromCssColorString("#FA8072")),u.SANDYBROWN=a(u.fromCssColorString("#F4A460")),u.SEAGREEN=a(u.fromCssColorString("#2E8B57")),u.SEASHELL=a(u.fromCssColorString("#FFF5EE")),u.SIENNA=a(u.fromCssColorString("#A0522D")),u.SILVER=a(u.fromCssColorString("#C0C0C0")),u.SKYBLUE=a(u.fromCssColorString("#87CEEB")),u.SLATEBLUE=a(u.fromCssColorString("#6A5ACD")),u.SLATEGRAY=a(u.fromCssColorString("#708090")),u.SLATEGREY=u.SLATEGRAY,u.SNOW=a(u.fromCssColorString("#FFFAFA")),u.SPRINGGREEN=a(u.fromCssColorString("#00FF7F")),u.STEELBLUE=a(u.fromCssColorString("#4682B4")),u.TAN=a(u.fromCssColorString("#D2B48C")),u.TEAL=a(u.fromCssColorString("#008080")),u.THISTLE=a(u.fromCssColorString("#D8BFD8")),u.TOMATO=a(u.fromCssColorString("#FF6347")),u.TURQUOISE=a(u.fromCssColorString("#40E0D0")),u.VIOLET=a(u.fromCssColorString("#EE82EE")),u.WHEAT=a(u.fromCssColorString("#F5DEB3")),u.WHITE=a(u.fromCssColorString("#FFFFFF")),u.WHITESMOKE=a(u.fromCssColorString("#F5F5F5")),u.YELLOW=a(u.fromCssColorString("#FFFF00")),u.YELLOWGREEN=a(u.fromCssColorString("#9ACD32")),u.TRANSPARENT=a(new u(0,0,0,0)),u}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,r,n,a,o){"use strict";if(!n.supportsTypedArrays())return{};var i={BYTE:o.BYTE,UNSIGNED_BYTE:o.UNSIGNED_BYTE,SHORT:o.SHORT,UNSIGNED_SHORT:o.UNSIGNED_SHORT,INT:o.INT,UNSIGNED_INT:o.UNSIGNED_INT,FLOAT:o.FLOAT,DOUBLE:o.DOUBLE};return i.getSizeInBytes=function(t){switch(t){case i.BYTE:return Int8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.SHORT:return Int16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.INT:return Int32Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case i.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case i.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},i.fromTypedArray=function(t){return t instanceof Int8Array?i.BYTE:t instanceof Uint8Array?i.UNSIGNED_BYTE:t instanceof Int16Array?i.SHORT:t instanceof Uint16Array?i.UNSIGNED_SHORT:t instanceof Int32Array?i.INT:t instanceof Uint32Array?i.UNSIGNED_INT:t instanceof Float32Array?i.FLOAT:t instanceof Float64Array?i.DOUBLE:void 0},i.validate=function(t){return e(t)&&(t===i.BYTE||t===i.UNSIGNED_BYTE||t===i.SHORT||t===i.UNSIGNED_SHORT||t===i.INT||t===i.UNSIGNED_INT||t===i.FLOAT||t===i.DOUBLE)},i.createTypedArray=function(t,e){switch(t){case i.BYTE:return new Int8Array(e);case i.UNSIGNED_BYTE:return new Uint8Array(e);case i.SHORT:return new Int16Array(e);case i.UNSIGNED_SHORT:return new Uint16Array(e);case i.INT:return new Int32Array(e);case i.UNSIGNED_INT:return new Uint32Array(e);case i.FLOAT:return new Float32Array(e);case i.DOUBLE:return new Float64Array(e)}},i.createArrayBufferView=function(e,r,n,a){switch(n=t(n,0),a=t(a,(r.byteLength-n)/i.getSizeInBytes(e)),e){case i.BYTE:return new Int8Array(r,n,a);case i.UNSIGNED_BYTE:return new Uint8Array(r,n,a);case i.SHORT:return new Int16Array(r,n,a);case i.UNSIGNED_SHORT:return new Uint16Array(r,n,a);case i.INT:return new Int32Array(r,n,a);case i.UNSIGNED_INT:return new Uint32Array(r,n,a);case i.FLOAT:return new Float32Array(r,n,a);case i.DOUBLE:return new Float64Array(r,n,a)}},i.fromName=function(t){switch(t){case"BYTE":return i.BYTE;case"UNSIGNED_BYTE":return i.UNSIGNED_BYTE;case"SHORT":return i.SHORT;case"UNSIGNED_SHORT":return i.UNSIGNED_SHORT;case"INT":return i.INT;case"UNSIGNED_INT":return i.UNSIGNED_INT;case"FLOAT":return i.FLOAT;case"DOUBLE":return i.DOUBLE}},a(i)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var r={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===r.POINTS||t===r.LINES||t===r.LINE_LOOP||t===r.LINE_STRIP||t===r.TRIANGLES||t===r.TRIANGLE_STRIP||t===r.TRIANGLE_FAN}};return t(r)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,r,n,a){"use strict";function o(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,n.NONE),this.boundingSphereCV=e.boundingSphereCV}return o.computeNumberOfVertices=function(t){var r=-1;for(var n in t.attributes)if(t.attributes.hasOwnProperty(n)&&e(t.attributes[n])&&e(t.attributes[n].values)){var a=t.attributes[n],o=a.values.length/a.componentsPerAttribute;r=o}return r},o}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,r){"use strict";function n(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return n}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,r,n,a){"use strict";var o={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return o.getSizeInBytes=function(t){switch(t){case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},o.validate=function(e){return t(e)&&(e===o.UNSIGNED_BYTE||e===o.UNSIGNED_SHORT||e===o.UNSIGNED_INT)},o.createTypedArray=function(t,e){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},o.createTypedArrayFromArrayBuffer=function(t,e,r,a){return t>=n.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,r,a):new Uint16Array(e,r,a)},r(o)}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(t,e,r,n,a,o,i,u){"use strict";function s(t){var e=t._uSquared,r=t._ellipsoid.maximumRadius,n=t._ellipsoid.minimumRadius,a=(r-n)/r,o=Math.cos(t._startHeading),i=Math.sin(t._startHeading),u=(1-a)*Math.tan(t._start.latitude),s=1/Math.sqrt(1+u*u),E=s*u,l=Math.atan2(u,o),c=s*i,f=c*c,_=1-f,R=Math.sqrt(_),T=e/4,h=T*T,A=h*T,d=h*h,S=1+T-3*h/4+5*A/4-175*d/64,m=1-T+15*h/8-35*A/8,N=1-3*T+35*h/4,C=1-5*T,I=S*l-m*Math.sin(2*l)*T/2-N*Math.sin(4*l)*h/16-C*Math.sin(6*l)*A/48-5*Math.sin(8*l)*d/512,M=t._constants; +M.a=r,M.b=n,M.f=a,M.cosineHeading=o,M.sineHeading=i,M.tanU=u,M.cosineU=s,M.sineU=E,M.sigma=l,M.sineAlpha=c,M.sineSquaredAlpha=f,M.cosineSquaredAlpha=_,M.cosineAlpha=R,M.u2Over4=T,M.u4Over16=h,M.u6Over64=A,M.u8Over256=d,M.a0=S,M.a1=m,M.a2=N,M.a3=C,M.distanceRatio=I}function E(t,e){return t*e*(4+t*(4-3*e))/16}function l(t,e,r,n,a,o,i){var u=E(t,r);return(1-u)*t*e*(n+u*a*(i+u*o*(2*i*i-1)))}function c(t,e,r,n,a,o,i){var s,E,c,f,_,R=(e-r)/e,T=o-n,h=Math.atan((1-R)*Math.tan(a)),A=Math.atan((1-R)*Math.tan(i)),d=Math.cos(h),S=Math.sin(h),m=Math.cos(A),N=Math.sin(A),C=d*m,I=d*N,M=S*N,p=S*m,O=T,g=u.TWO_PI,y=Math.cos(O),F=Math.sin(O);do{y=Math.cos(O),F=Math.sin(O);var L=I-p*y;c=Math.sqrt(m*m*F*F+L*L),E=M+C*y,s=Math.atan2(c,E);var v;0===c?(v=0,f=1):(v=C*F/c,f=1-v*v),g=O,_=E-2*M/f,isNaN(_)&&(_=0),O=T+l(R,v,f,s,c,E,_)}while(Math.abs(O-g)>u.EPSILON12);var U=f*(e*e-r*r)/(r*r),D=1+U*(4096+U*(U*(320-175*U)-768))/16384,P=U*(256+U*(U*(74-47*U)-128))/1024,B=_*_,w=P*c*(_+P*(E*(2*B-1)-P*_*(4*c*c-3)*(4*B-3)/6)/4),x=r*D*(s-w),G=Math.atan2(m*F,I-p*y),b=Math.atan2(d*F,I*y-p);t._distance=x,t._startHeading=G,t._endHeading=b,t._uSquared=U}function f(r,n,a,o){t.normalize(o.cartographicToCartesian(n,T),R),t.normalize(o.cartographicToCartesian(a,T),T);c(r,o.maximumRadius,o.minimumRadius,n.longitude,n.latitude,a.longitude,a.latitude),r._start=e.clone(n,r._start),r._end=e.clone(a,r._end),r._start.height=0,r._end.height=0,s(r)}function _(t,a,o){var u=r(o,i.WGS84);this._ellipsoid=u,this._start=new e,this._end=new e,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,n(t)&&n(a)&&f(this,t,a,u)}var R=new t,T=new t;return a(_.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}}}),_.prototype.setEndPoints=function(t,e){f(this,t,e,this._ellipsoid)},_.prototype.interpolateUsingFraction=function(t,e){return this.interpolateUsingSurfaceDistance(this._distance*t,e)},_.prototype.interpolateUsingSurfaceDistance=function(t,r){var a=this._constants,o=a.distanceRatio+t/a.b,i=Math.cos(2*o),u=Math.cos(4*o),s=Math.cos(6*o),E=Math.sin(2*o),c=Math.sin(4*o),f=Math.sin(6*o),_=Math.sin(8*o),R=o*o,T=o*R,h=a.u8Over256,A=a.u2Over4,d=a.u6Over64,S=a.u4Over16,m=2*T*h*i/3+o*(1-A+7*S/4-15*d/4+579*h/64-(S-15*d/4+187*h/16)*i-(5*d/4-115*h/16)*u-29*h*s/16)+(A/2-S+71*d/32-85*h/16)*E+(5*S/16-5*d/4+383*h/96)*c-R*((d-11*h/2)*E+5*h*c/2)+(29*d/96-29*h/16)*f+539*h*_/1536,N=Math.asin(Math.sin(m)*a.cosineAlpha),C=Math.atan(a.a/a.b*Math.tan(N));m-=a.sigma;var I=Math.cos(2*a.sigma+m),M=Math.sin(m),p=Math.cos(m),O=a.cosineU*p,g=a.sineU*M,y=Math.atan2(M*a.sineHeading,O-g*a.cosineHeading),F=y-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,m,M,p,I);return n(r)?(r.longitude=this._start.longitude+F,r.latitude=C,r.height=0,r):new e(this._start.longitude+F,C,0)},_}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(t,e){"use strict";function r(t,r,n){var a=t+r;return e.sign(t)!==e.sign(r)&&Math.abs(a/Math.max(Math.abs(t),Math.abs(r)))<n?0:a}var n={};return n.computeDiscriminant=function(t,e,r){var n=e*e-4*t*r;return n},n.computeRealRoots=function(t,n,a){var o;if(0===t)return 0===n?[]:[-a/n];if(0===n){if(0===a)return[0,0];var i=Math.abs(a),u=Math.abs(t);if(i<u&&i/u<e.EPSILON14)return[0,0];if(i>u&&u/i<e.EPSILON14)return[];if(o=-a/t,o<0)return[];var s=Math.sqrt(o);return[-s,s]}if(0===a)return o=-n/t,o<0?[o,0]:[0,o];var E=n*n,l=4*t*a,c=r(E,-l,e.EPSILON14);if(c<0)return[];var f=-.5*r(n,e.sign(n)*Math.sqrt(c),e.EPSILON14);return n>0?[f/t,a/f]:[a/f,f/t]},n}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(t,e){"use strict";function r(t,e,r,n){var a,o,i=t,u=e/3,s=r/3,E=n,l=i*s,c=u*E,f=u*u,_=s*s,R=i*s-f,T=i*E-u*s,h=u*E-_,A=4*R*h-T*T;if(A<0){var d,S,m;f*c>=l*_?(d=i,S=R,m=-2*u*R+i*T):(d=E,S=h,m=-E*T+2*s*h);var N=m<0?-1:1,C=-N*Math.abs(d)*Math.sqrt(-A);o=-m+C;var I=o/2,M=I<0?-Math.pow(-I,1/3):Math.pow(I,1/3),p=o===C?-M:-S/M;return a=S<=0?M+p:-m/(M*M+p*p+S),f*c>=l*_?[(a-u)/i]:[-E/(a+s)]}var O=R,g=-2*u*R+i*T,y=h,F=-E*T+2*s*h,L=Math.sqrt(A),v=Math.sqrt(3)/2,U=Math.abs(Math.atan2(i*L,-g)/3);a=2*Math.sqrt(-O);var D=Math.cos(U);o=a*D;var P=a*(-D/2-v*Math.sin(U)),B=o+P>2*u?o-u:P-u,w=i,x=B/w;U=Math.abs(Math.atan2(E*L,-F)/3),a=2*Math.sqrt(-y),D=Math.cos(U),o=a*D,P=a*(-D/2-v*Math.sin(U));var G=-E,b=o+P<2*s?o+s:P+s,z=G/b,H=w*b,V=-B*b-w*G,X=B*G,q=(s*V-u*X)/(-u*V+s*H);return x<=q?x<=z?q<=z?[x,q,z]:[x,z,q]:[z,x,q]:x<=z?[q,x,z]:q<=z?[q,z,x]:[z,q,x]}var n={};return n.computeDiscriminant=function(t,e,r,n){var a=t*t,o=e*e,i=r*r,u=n*n,s=18*t*e*r*n+o*i-27*a*u-4*(t*i*r+o*e*n);return s},n.computeRealRoots=function(t,n,a,o){var i,u;if(0===t)return e.computeRealRoots(n,a,o);if(0===n){if(0===a){if(0===o)return[0,0,0];u=-o/t;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===o?(i=e.computeRealRoots(t,0,a),0===i.Length?[0]:[i[0],0,i[1]]):r(t,0,a,o)}return 0===a?0===o?(u=-n/t,u<0?[u,0,0]:[0,0,u]):r(t,n,0,o):0===o?(i=e.computeRealRoots(t,n,a),0===i.length?[0]:i[1]<=0?[i[0],i[1],0]:i[0]>=0?[0,i[0],i[1]]:[i[0],0,i[1]]):r(t,n,a,o)},n}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(t,e,r,n){"use strict";function a(e,a,o,i){var u=e*e,s=a-3*u/8,E=o-a*e/2+u*e/8,l=i-o*e/4+a*u/16-3*u*u/256,c=t.computeRealRoots(1,2*s,s*s-4*l,-E*E);if(c.length>0){var f=-e/4,_=c[c.length-1];if(Math.abs(_)<r.EPSILON14){var R=n.computeRealRoots(1,s,l);if(2===R.length){var T,h=R[0],A=R[1];if(h>=0&&A>=0){var d=Math.sqrt(h),S=Math.sqrt(A);return[f-S,f-d,f+d,f+S]}if(h>=0&&A<0)return T=Math.sqrt(h),[f-T,f+T];if(h<0&&A>=0)return T=Math.sqrt(A),[f-T,f+T]}return[]}if(_>0){var m=Math.sqrt(_),N=(s+_-E/m)/2,C=(s+_+E/m)/2,I=n.computeRealRoots(1,m,N),M=n.computeRealRoots(1,-m,C);return 0!==I.length?(I[0]+=f,I[1]+=f,0!==M.length?(M[0]+=f,M[1]+=f,I[1]<=M[0]?[I[0],I[1],M[0],M[1]]:M[1]<=I[0]?[M[0],M[1],I[0],I[1]]:I[0]>=M[0]&&I[1]<=M[1]?[M[0],I[0],I[1],M[1]]:M[0]>=I[0]&&M[1]<=I[1]?[I[0],M[0],M[1],I[1]]:I[0]>M[0]&&I[0]<M[1]?[M[0],I[0],M[1],I[1]]:[I[0],M[0],I[1],M[1]]):I):0!==M.length?(M[0]+=f,M[1]+=f,M):[]}}return[]}function o(e,a,o,i){var u=o*o,s=a*a,E=e*e,l=-2*a,c=o*e+s-4*i,f=E*i-o*a*e+u,_=t.computeRealRoots(1,l,c,f);if(_.length>0){var R,T,h=_[0],A=a-h,d=A*A,S=e/2,m=A/2,N=d-4*i,C=d+4*Math.abs(i),I=E-4*h,M=E+4*Math.abs(h);if(h<0||N*M<I*C){var p=Math.sqrt(I);R=p/2,T=0===p?0:(e*m-o)/p}else{var O=Math.sqrt(N);R=0===O?0:(e*m-o)/O,T=O/2}var g,y;0===S&&0===R?(g=0,y=0):r.sign(S)===r.sign(R)?(g=S+R,y=h/g):(y=S-R,g=h/y);var F,L;0===m&&0===T?(F=0,L=0):r.sign(m)===r.sign(T)?(F=m+T,L=i/F):(L=m-T,F=i/L);var v=n.computeRealRoots(1,g,F),U=n.computeRealRoots(1,y,L);if(0!==v.length)return 0!==U.length?v[1]<=U[0]?[v[0],v[1],U[0],U[1]]:U[1]<=v[0]?[U[0],U[1],v[0],v[1]]:v[0]>=U[0]&&v[1]<=U[1]?[U[0],v[0],v[1],U[1]]:U[0]>=v[0]&&U[1]<=v[1]?[v[0],U[0],U[1],v[1]]:v[0]>U[0]&&v[0]<U[1]?[U[0],v[0],U[1],v[1]]:[v[0],U[0],v[1],U[1]]:v;if(0!==U.length)return U}return[]}var i={};return i.computeDiscriminant=function(t,e,r,n,a){var o=t*t,i=o*t,u=e*e,s=u*e,E=r*r,l=E*r,c=n*n,f=c*n,_=a*a,R=_*a,T=u*E*c-4*s*f-4*t*l*c+18*t*e*r*f-27*o*c*c+256*i*R+a*(18*s*r*n-4*u*l+16*t*E*E-80*t*e*E*n-6*t*u*c+144*o*r*c)+_*(144*t*u*r-27*u*u-128*o*E-192*o*e*n);return T},i.computeRealRoots=function(e,n,i,u,s){if(Math.abs(e)<r.EPSILON15)return t.computeRealRoots(n,i,u,s);var E=n/e,l=i/e,c=u/e,f=s/e,_=E<0?1:0;switch(_+=l<0?_+1:_,_+=c<0?_+1:_,_+=f<0?_+1:_){case 0:return a(E,l,c,f);case 1:return o(E,l,c,f);case 2:return o(E,l,c,f);case 3:return a(E,l,c,f);case 4:return a(E,l,c,f);case 5:return o(E,l,c,f);case 6:return a(E,l,c,f);case 7:return a(E,l,c,f);case 8:return o(E,l,c,f);case 9:return a(E,l,c,f);case 10:return a(E,l,c,f);case 11:return o(E,l,c,f);case 12:return a(E,l,c,f);case 13:return a(E,l,c,f);case 14:return a(E,l,c,f);case 15:return a(E,l,c,f);default:return}},i}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(t,e,r,n){"use strict";function a(r,n){n=t.clone(e(n,t.ZERO)),t.equals(n,t.ZERO)||t.normalize(n,n),this.origin=t.clone(e(r,t.ZERO)),this.direction=n}return a.getPoint=function(e,n,a){return r(a)||(a=new t),a=t.multiplyByScalar(e.direction,n,a),t.add(e.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(t,e,r,n,a,o,i,u,s,E,l){"use strict";function c(t,e,r,n){var a=e*e-4*t*r;if(!(a<0)){if(a>0){var o=1/(2*t),i=Math.sqrt(a),u=(-e+i)*o,s=(-e-i)*o;return u<s?(n.root0=u,n.root1=s):(n.root0=s,n.root1=u),n}var E=-e/(2*t);if(0!==E)return n.root0=n.root1=E,n}}function f(e,r,a){n(a)||(a=new o);var i=e.origin,u=e.direction,s=r.center,E=r.radius*r.radius,l=t.subtract(i,s,d),f=t.dot(u,u),_=2*t.dot(u,l),R=t.magnitudeSquared(l)-E,T=c(f,_,R,C);if(n(T))return a.start=T.root0,a.stop=T.root1,a}function _(t,e,r){var n=t+e;return i.sign(t)!==i.sign(e)&&Math.abs(n/Math.max(Math.abs(t),Math.abs(e)))<r?0:n}function R(e,r,n,a,o){var l,c=a*a,f=o*o,R=(e[u.COLUMN1ROW1]-e[u.COLUMN2ROW2])*f,T=o*(a*_(e[u.COLUMN1ROW0],e[u.COLUMN0ROW1],i.EPSILON15)+r.y),h=e[u.COLUMN0ROW0]*c+e[u.COLUMN2ROW2]*f+a*r.x+n,A=f*_(e[u.COLUMN2ROW1],e[u.COLUMN1ROW2],i.EPSILON15),d=o*(a*_(e[u.COLUMN2ROW0],e[u.COLUMN0ROW2])+r.z),S=[];if(0===d&&0===A){if(l=s.computeRealRoots(R,T,h),0===l.length)return S;var m=l[0],N=Math.sqrt(Math.max(1-m*m,0));if(S.push(new t(a,o*m,o*-N)),S.push(new t(a,o*m,o*N)),2===l.length){var C=l[1],I=Math.sqrt(Math.max(1-C*C,0));S.push(new t(a,o*C,o*-I)),S.push(new t(a,o*C,o*I))}return S}var M=d*d,p=A*A,O=R*R,g=d*A,y=O+p,F=2*(T*R+g),L=2*h*R+T*T-p+M,v=2*(h*T-g),U=h*h-M;if(0===y&&0===F&&0===L&&0===v)return S;l=E.computeRealRoots(y,F,L,v,U);var D=l.length;if(0===D)return S;for(var P=0;P<D;++P){var B,w=l[P],x=w*w,G=Math.max(1-x,0),b=Math.sqrt(G);B=i.sign(R)===i.sign(h)?_(R*x+h,T*w,i.EPSILON12):i.sign(h)===i.sign(T*w)?_(R*x,T*w+h,i.EPSILON12):_(R*x+T*w,h,i.EPSILON12);var z=_(A*w,d,i.EPSILON15),H=B*z;H<0?S.push(new t(a,o*w,o*b)):H>0?S.push(new t(a,o*w,o*-b)):0!==b?(S.push(new t(a,o*w,o*-b)),S.push(new t(a,o*w,o*b)),++P):S.push(new t(a,o*w,o*b))}return S}var T={};T.rayPlane=function(e,r,a){n(a)||(a=new t);var o=e.origin,u=e.direction,s=r.normal,E=t.dot(s,u);if(!(Math.abs(E)<i.EPSILON15)){var l=(-r.distance-t.dot(s,o))/E;if(!(l<0))return a=t.multiplyByScalar(u,l,a),t.add(o,a,a)}};var h=new t,A=new t,d=new t,S=new t,m=new t;T.rayTriangleParametric=function(e,n,a,o,u){u=r(u,!1);var s,E,l,c,f,_=e.origin,R=e.direction,T=t.subtract(a,n,h),N=t.subtract(o,n,A),C=t.cross(R,N,d),I=t.dot(T,C);if(u){if(I<i.EPSILON6)return;if(s=t.subtract(_,n,S),l=t.dot(s,C),l<0||l>I)return;if(E=t.cross(s,T,m),c=t.dot(R,E),c<0||l+c>I)return;f=t.dot(N,E)/I}else{if(Math.abs(I)<i.EPSILON6)return;var M=1/I;if(s=t.subtract(_,n,S),l=t.dot(s,C)*M,l<0||l>1)return;if(E=t.cross(s,T,m),c=t.dot(R,E)*M,c<0||l+c>1)return;f=t.dot(N,E)*M}return f},T.rayTriangle=function(e,r,a,o,i,u){var s=T.rayTriangleParametric(e,r,a,o,i);if(n(s)&&!(s<0))return n(u)||(u=new t),t.multiplyByScalar(e.direction,s,u),t.add(e.origin,u,u)};var N=new l;T.lineSegmentTriangle=function(e,r,a,o,i,u,s){var E=N;t.clone(e,E.origin),t.subtract(r,e,E.direction),t.normalize(E.direction,E.direction);var l=T.rayTriangleParametric(E,a,o,i,u);if(!(!n(l)||l<0||l>t.distance(e,r)))return n(s)||(s=new t),t.multiplyByScalar(E.direction,l,s),t.add(E.origin,s,s)};var C={root0:0,root1:0};T.raySphere=function(t,e,r){if(r=f(t,e,r),n(r)&&!(r.stop<0))return r.start=Math.max(r.start,0),r};var I=new l;T.lineSegmentSphere=function(e,r,a,o){var i=I;t.clone(e,i.origin);var u=t.subtract(r,e,i.direction),s=t.magnitude(u);if(t.normalize(u,u),o=f(i,a,o),!(!n(o)||o.stop<0||o.start>s))return o.start=Math.max(o.start,0),o.stop=Math.min(o.stop,s),o};var M=new t,p=new t;T.rayEllipsoid=function(e,r){var n,a,i,u,s,E=r.oneOverRadii,l=t.multiplyComponents(E,e.origin,M),c=t.multiplyComponents(E,e.direction,p),f=t.magnitudeSquared(l),_=t.dot(l,c);if(f>1){if(_>=0)return;var R=_*_;if(n=f-1,a=t.magnitudeSquared(c),i=a*n,R<i)return;if(R>i){u=_*_-i,s=-_+Math.sqrt(u);var T=s/a,h=n/s;return T<h?new o(T,h):{start:h,stop:T}}var A=Math.sqrt(n/a);return new o(A,A)}return f<1?(n=f-1,a=t.magnitudeSquared(c),i=a*n,u=_*_-i,s=-_+Math.sqrt(u),new o(0,s/a)):_<0?(a=t.magnitudeSquared(c),new o(0,-_/a)):void 0};var O=new t,g=new t,y=new t,F=new t,L=new t,v=new u,U=new u,D=new u,P=new u,B=new u,w=new u,x=new u,G=new t,b=new t,z=new e;T.grazingAltitudeLocation=function(e,r){var a=e.origin,o=e.direction;if(!t.equals(a,t.ZERO)){var s=r.geodeticSurfaceNormal(a,O);if(t.dot(o,s)>=0)return a}var E=n(this.rayEllipsoid(e,r)),l=r.transformPositionToScaledSpace(o,O),c=t.normalize(l,l),f=t.mostOrthogonalAxis(l,F),_=t.normalize(t.cross(f,c,g),g),T=t.normalize(t.cross(c,_,y),y),h=v;h[0]=c.x,h[1]=c.y,h[2]=c.z,h[3]=_.x,h[4]=_.y,h[5]=_.z,h[6]=T.x,h[7]=T.y,h[8]=T.z;var A=u.transpose(h,U),d=u.fromScale(r.radii,D),S=u.fromScale(r.oneOverRadii,P),m=B;m[0]=0,m[1]=-o.z,m[2]=o.y,m[3]=o.z,m[4]=0,m[5]=-o.x,m[6]=-o.y,m[7]=o.x,m[8]=0;var N,C,I=u.multiply(u.multiply(A,S,w),m,w),M=u.multiply(u.multiply(I,d,x),h,x),p=u.multiplyByVector(I,a,L),H=R(M,t.negate(p,O),0,0,1),V=H.length;if(V>0){for(var X=t.clone(t.ZERO,b),q=Number.NEGATIVE_INFINITY,W=0;W<V;++W){N=u.multiplyByVector(d,u.multiplyByVector(h,H[W],G),G);var Y=t.normalize(t.subtract(N,a,F),F),K=t.dot(Y,o);K>q&&(q=K,X=t.clone(N,X))}var k=r.cartesianToCartographic(X,z);return q=i.clamp(q,0,1),C=t.magnitude(t.subtract(X,a,F))*Math.sqrt(1-q*q),C=E?-C:C,k.height=C,r.cartographicToCartesian(k,new t)}};var H=new t;return T.lineSegmentPlane=function(e,r,a,o){n(o)||(o=new t);var u=t.subtract(r,e,H),s=a.normal,E=t.dot(s,u);if(!(Math.abs(E)<i.EPSILON6)){var l=t.dot(s,e),c=-(a.distance+l)/E;if(!(c<0||c>1))return t.multiplyByScalar(u,c,o),t.add(e,o,o),o}},T.trianglePlaneIntersection=function(e,r,n,a){var o=a.normal,i=a.distance,u=t.dot(o,e)+i<0,s=t.dot(o,r)+i<0,E=t.dot(o,n)+i<0,l=0;l+=u?1:0,l+=s?1:0,l+=E?1:0;var c,f;if(1!==l&&2!==l||(c=new t,f=new t),1===l){if(u)return T.lineSegmentPlane(e,r,a,c),T.lineSegmentPlane(e,n,a,f),{positions:[e,r,n,c,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return T.lineSegmentPlane(r,n,a,c),T.lineSegmentPlane(r,e,a,f),{positions:[e,r,n,c,f],indices:[1,3,4,2,0,4,2,4,3]};if(E)return T.lineSegmentPlane(n,e,a,c),T.lineSegmentPlane(n,r,a,f),{positions:[e,r,n,c,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return T.lineSegmentPlane(r,e,a,c),T.lineSegmentPlane(n,e,a,f),{positions:[e,r,n,c,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return T.lineSegmentPlane(n,r,a,c),T.lineSegmentPlane(e,r,a,f),{positions:[e,r,n,c,f],indices:[2,0,4,2,4,3,1,3,4]};if(!E)return T.lineSegmentPlane(e,n,a,c),T.lineSegmentPlane(r,n,a,f),{positions:[e,r,n,c,f],indices:[0,1,4,0,4,3,2,3,4]}}},T}),define("Core/isArray",["./defined"],function(t){"use strict";var e=Array.isArray;return t(e)||(e=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),e}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(t,e,r,n,a){"use strict";function o(e,r){this.normal=t.clone(e),this.distance=r}o.fromPointNormal=function(r,n,a){var i=-t.dot(n,r);return e(a)?(t.clone(n,a.normal),a.distance=i,a):new o(n,i)};var i=new t;return o.fromCartesian4=function(r,n){var a=t.fromCartesian4(r,i),u=r.w;return e(n)?(t.clone(a,n.normal),n.distance=u,n):new o(a,u)},o.getPointDistance=function(e,r){return t.dot(e.normal,r)+e.distance},o.ORIGIN_XY_PLANE=a(new o(t.UNIT_Z,0)),o.ORIGIN_YZ_PLANE=a(new o(t.UNIT_X,0)),o.ORIGIN_ZX_PLANE=a(new o(t.UNIT_Y,0)),o}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(t,e,r,n,a,o,i,u,s,E,l,c){"use strict";function f(t,e,r){var n=M;n.length=t;var a;if(e===r){for(a=0;a<t;a++)n[a]=e;return n}var o=r-e,i=o/t;for(a=0;a<t;a++){var u=e+a*i;n[a]=u}return n}function _(e,r,n,a,o,i,u,s){var E=a.scaleToGeodeticSurface(e,y),l=a.scaleToGeodeticSurface(r,F),c=R.numberOfPoints(e,r,n),_=a.cartesianToCartographic(E,p),T=a.cartesianToCartographic(l,O),h=f(c,o,i);L.setEndPoints(_,T);var A=L.surfaceDistance/c,d=s;_.height=o;var S=a.cartographicToCartesian(_,g);t.pack(S,u,d),d+=3;for(var m=1;m<c;m++){var N=L.interpolateUsingSurfaceDistance(m*A,O);N.height=h[m],S=a.cartographicToCartesian(N,g),t.pack(S,u,d),d+=3}return d}var R={};R.numberOfPoints=function(e,r,n){var a=t.distance(e,r);return Math.ceil(a/n)};var T=new e;R.extractHeights=function(t,e){for(var r=t.length,n=new Array(r),a=0;a<r;a++){var o=t[a];n[a]=e.cartesianToCartographic(o,T).height}return n};var h=new l,A=new t,d=new t,S=new c(t.UNIT_X,0),m=new t,N=new c(t.UNIT_X,0),C=new t,I=new t,M=[],p=new e,O=new e,g=new t,y=new t,F=new t,L=new i;return R.wrapLongitude=function(e,a){var o=[],i=[];if(n(e)&&e.length>0){a=r(a,l.IDENTITY);var s=l.inverseTransformation(a,h),E=l.multiplyByPoint(s,t.ZERO,A),f=t.normalize(l.multiplyByPointAsVector(s,t.UNIT_Y,d),d),_=c.fromPointNormal(E,f,S),R=t.normalize(l.multiplyByPointAsVector(s,t.UNIT_X,m),m),T=c.fromPointNormal(E,R,N),M=1;o.push(t.clone(e[0]));for(var p=o[0],O=e.length,g=1;g<O;++g){var y=e[g];if(c.getPointDistance(T,p)<0||c.getPointDistance(T,y)<0){var F=u.lineSegmentPlane(p,y,_,C);if(n(F)){var L=t.multiplyByScalar(f,5e-9,I);c.getPointDistance(_,p)<0&&t.negate(L,L),o.push(t.add(F,L,new t)),i.push(M+1),t.negate(L,L),o.push(t.add(F,L,new t)),M=1}}o.push(t.clone(e[g])),M++,p=y}i.push(M)}return{positions:o,lengths:i}},R.generateArc=function(e){n(e)||(e={});var a=e.positions,i=a.length,u=r(e.ellipsoid,o.WGS84),l=r(e.height,0),c=s(l);if(i<1)return[];if(1===i){var f=u.scaleToGeodeticSurface(a[0],y);if(l=c?l[0]:l,0!==l){var T=u.geodeticSurfaceNormal(f,g);t.multiplyByScalar(T,l,T),t.add(f,T,f)}return[f.x,f.y,f.z]}var h=e.minDistance;if(!n(h)){var A=r(e.granularity,E.RADIANS_PER_DEGREE);h=E.chordLength(A,u.maximumRadius)}var d,S=0;for(d=0;d<i-1;d++)S+=R.numberOfPoints(a[d],a[d+1],h);var m=3*(S+1),N=new Array(m),C=0;for(d=0;d<i-1;d++){var I=a[d],O=a[d+1],F=c?l[d]:l,L=c?l[d+1]:l;C=_(I,O,h,u,F,L,N,C)}M.length=0;var v=a[i-1],U=u.cartesianToCartographic(v,p);U.height=c?l[i-1]:l;var D=u.cartographicToCartesian(U,g);return t.pack(D,N,m-3),N},R.generateCartesianArc=function(e){for(var r=R.generateArc(e),n=r.length/3,a=new Array(n),o=0;o<n;o++)a[o]=t.unpack(r,3*o);return a},R}),define("Core/SimplePolylineGeometry",["./BoundingSphere","./Cartesian3","./Color","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PolylinePipeline","./PrimitiveType"],function(t,e,r,n,a,o,i,u,s,E,l,c,f,_,R){"use strict";function T(t,e,n,a,o,i,u){var s,E=_.numberOfPoints(t,e,o),l=n.red,c=n.green,f=n.blue,R=n.alpha,T=a.red,h=a.green,A=a.blue,d=a.alpha;if(r.equals(n,a)){for(s=0;s<E;s++)i[u++]=r.floatToByte(l),i[u++]=r.floatToByte(c),i[u++]=r.floatToByte(f),i[u++]=r.floatToByte(R);return u}var S=(T-l)/E,m=(h-c)/E,N=(A-f)/E,C=(d-R)/E,I=u;for(s=0;s<E;s++)i[I++]=r.floatToByte(l+s*S),i[I++]=r.floatToByte(c+s*m),i[I++]=r.floatToByte(f+s*N),i[I++]=r.floatToByte(R+s*C);return I}function h(t){t=a(t,a.EMPTY_OBJECT);var n=t.positions,i=t.colors,s=a(t.colorsPerVertex,!1);this._positions=n,this._colors=i,this._colorsPerVertex=s,this._followSurface=a(t.followSurface,!0),this._granularity=a(t.granularity,f.RADIANS_PER_DEGREE),this._ellipsoid=a(t.ellipsoid,u.WGS84),this._workerName="createSimplePolylineGeometry";var E=1+n.length*e.packedLength;E+=o(i)?1+i.length*r.packedLength:1,this.packedLength=E+u.packedLength+3}h.pack=function(t,n,i){i=a(i,0);var s,E=t._positions,l=E.length;for(n[i++]=l,s=0;s<l;++s,i+=e.packedLength)e.pack(E[s],n,i);var c=t._colors;for(l=o(c)?c.length:0,n[i++]=l,s=0;s<l;++s,i+=r.packedLength)r.pack(c[s],n,i);return u.pack(t._ellipsoid,n,i),i+=u.packedLength,n[i++]=t._colorsPerVertex?1:0,n[i++]=t._followSurface?1:0,n[i]=t._granularity,n},h.unpack=function(t,n,i){n=a(n,0);var s,E=t[n++],l=new Array(E);for(s=0;s<E;++s,n+=e.packedLength)l[s]=e.unpack(t,n);E=t[n++];var c=E>0?new Array(E):void 0;for(s=0;s<E;++s,n+=r.packedLength)c[s]=r.unpack(t,n);var f=u.unpack(t,n);n+=u.packedLength;var _=1===t[n++],R=1===t[n++],T=t[n];return o(i)?(i._positions=l,i._colors=c,i._ellipsoid=f,i._colorsPerVertex=_,i._followSurface=R,i._granularity=T,i):new h({positions:l,colors:c,ellipsoid:f,colorsPerVertex:_,followSurface:R,granularity:T})};var A=new Array(2),d=new Array(2),S={positions:A,height:d,ellipsoid:void 0,minDistance:void 0};return h.createGeometry=function(a){var i,u,h,m,N,C=a._positions,I=a._colors,M=a._colorsPerVertex,p=a._followSurface,O=a._granularity,g=a._ellipsoid,y=f.chordLength(O,g.maximumRadius),F=o(I)&&!M,L=C.length,v=0;if(p){var U=_.extractHeights(C,g),D=S;if(D.minDistance=y,D.ellipsoid=g,F){var P=0;for(i=0;i<L-1;i++)P+=_.numberOfPoints(C[i],C[i+1],y)+1;u=new Float64Array(3*P),m=new Uint8Array(4*P),D.positions=A,D.height=d;var B=0;for(i=0;i<L-1;++i){A[0]=C[i],A[1]=C[i+1],d[0]=U[i],d[1]=U[i+1];var w=_.generateArc(D);if(o(I)){var x=w.length/3;N=I[i];for(var G=0;G<x;++G)m[B++]=r.floatToByte(N.red),m[B++]=r.floatToByte(N.green),m[B++]=r.floatToByte(N.blue),m[B++]=r.floatToByte(N.alpha)}u.set(w,v),v+=w.length}}else if(D.positions=C,D.height=U,u=new Float64Array(_.generateArc(D)),o(I)){for(m=new Uint8Array(u.length/3*4),i=0;i<L-1;++i){var b=C[i],z=C[i+1],H=I[i],V=I[i+1];v=T(b,z,H,V,y,m,v)}var X=I[L-1];m[v++]=r.floatToByte(X.red),m[v++]=r.floatToByte(X.green),m[v++]=r.floatToByte(X.blue),m[v++]=r.floatToByte(X.alpha)}}else{h=F?2*L-2:L,u=new Float64Array(3*h),m=o(I)?new Uint8Array(4*h):void 0;var q=0,W=0;for(i=0;i<L;++i){var Y=C[i];if(F&&i>0&&(e.pack(Y,u,q),q+=3,N=I[i-1],m[W++]=r.floatToByte(N.red),m[W++]=r.floatToByte(N.green),m[W++]=r.floatToByte(N.blue),m[W++]=r.floatToByte(N.alpha)),F&&i===L-1)break;e.pack(Y,u,q),q+=3,o(I)&&(N=I[i],m[W++]=r.floatToByte(N.red),m[W++]=r.floatToByte(N.green),m[W++]=r.floatToByte(N.blue),m[W++]=r.floatToByte(N.alpha))}}var K=new l;K.position=new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:u}),o(I)&&(K.color=new E({componentDatatype:n.UNSIGNED_BYTE,componentsPerAttribute:4,values:m,normalize:!0})),h=u.length/3;var k=2*(h-1),Z=c.createTypedArray(h,k),j=0;for(i=0;i<h-1;++i)Z[j++]=i,Z[j++]=i+1;return new s({attributes:K,indices:Z,primitiveType:R.LINES,boundingSphere:t.fromPoints(C)})},h}),define("Workers/createSimplePolylineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/SimplePolylineGeometry"],function(t,e,r){"use strict";function n(n,a){return t(a)&&(n=r.unpack(n,a)),n._ellipsoid=e.clone(n._ellipsoid),r.createGeometry(n)}return n})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createSphereGeometry.js b/engines/Cesium/Workers/createSphereGeometry.js index 2d72587..670e3de 100644 --- a/engines/Cesium/Workers/createSphereGeometry.js +++ b/engines/Cesium/Workers/createSphereGeometry.js @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(r,a){if(!t(a))throw new e(n(r))},a.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},a.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},a.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},a.typeOf.number.lessThan=function(t,n,r){if(a.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(t,n,r){if(a.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},a.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*a.clamp(t,-1,1)+.5)*n)},a.fromSNorm=function(t,n){return n=e(n,255),a.clamp(t,0,n)/n*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},a.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},a.lerp=function(t,e,n){return(1-n)*t+n*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,n,r,a){a=e(a,r);var i=Math.abs(t-n);return i<=a||i<=r*Math.max(Math.abs(t),Math.abs(n))};var i=[1];a.factorial=function(t){var e=i.length;if(t>=e)for(var n=i[e-1],r=e;r<=t;r++)i.push(n*r);return i[t]},a.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return a.setRandomNumberSeed=function(e){o=new t(e)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var a=t.clock,i=t.cone,u=e(t.magnitude,1),E=u*Math.sin(i);return r.x=E*Math.cos(a),r.y=E*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(t,e,r,a){return n(a)?(a.x=t,a.y=e,a.z=r,a):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var a=0;a<r;++a)o.pack(t[a],e,3*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)},o.cross=function(t,e,n){var r=t.x,a=t.y,i=t.z,o=e.x,u=e.y,E=e.z,s=a*E-i*u,c=i*o-r*E,_=r*u-a*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,a){return t=i.toRadians(t),e=i.toRadians(e),o.fromRadians(t,e,n,r,a)};var T=new o,l=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,a,i,u){a=e(a,0);var E=n(i)?i.radiiSquared:R,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,l);var c=Math.sqrt(o.dot(T,l));return l=o.divideByScalar(l,c,l),T=o.multiplyByScalar(T,a,T),n(u)||(u=new o),o.add(l,T,u)},o.fromDegreesArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function a(n,a,u,E,s){var c=n.x,_=n.y,T=n.z,l=a.x,R=a.y,f=a.z,A=c*c*l*l,h=_*_*R*R,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,i);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var m=u.x,M=u.y,O=u.z,y=o;y.x=S.x*m*2,y.y=S.y*M*2,y.z=S.z*O*2;var p,C,U,P,L,F,w,g,v,x,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*m),P=1/(1+B*M),L=1/(1+B*O),F=U*U,w=P*P,g=L*L,v=F*U,x=w*P,D=g*L,p=A*F+h*w+N*g-1,C=A*v*m+h*x*M+N*D*O;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*P,s.z=T*L,s):new t(c*U,_*P,T*L)}var i=new t,o=new t;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o){"use strict";function u(t,n,r){this.longitude=e(t,0),this.latitude=e(n,0),this.height=e(r,0)}u.fromRadians=function(t,r,a,i){return a=e(a,0),n(i)?(i.longitude=t,i.latitude=r,i.height=a,i):new u(t,r,a)},u.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),l=i.EPSILON1;return u.fromCartesian=function(e,r,a){var R=n(r)?r.oneOverRadii:_,f=n(r)?r.oneOverRadiiSquared:T,A=n(r)?r._centerToleranceSquared:l,h=o(e,R,f,A,s);if(n(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=i.sign(t.dot(d,e))*t.magnitude(d);return n(a)?(a.longitude=I,a.latitude=S,a.height=m,a):new u(I,S,m)}},u.clone=function(t,e){if(n(t))return n(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||n(t)&&n(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,r){return t===e||n(t)&&n(e)&&Math.abs(t.longitude-e.longitude)<=r&&Math.abs(t.latitude-e.latitude)<=r&&Math.abs(t.height-e.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o,u,E){"use strict";function s(e,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),e._radii=new t(r,a,i),e._radiiSquared=new t(r*r,a*a,i*i),e._radiiToTheFourth=new t(r*r*r*r,a*a*a*a,i*i*i*i),e._oneOverRadii=new t(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),e._minimumRadius=Math.min(r,a,i),e._maximumRadius=Math.max(r,a,i),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}a(c.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}}}),c.clone=function(e,n){if(r(e)){var a=e._radii;return r(n)?(t.clone(a,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(a.x,a.y,a.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,a){return a=n(a,0),t.pack(e._radii,r,a),r},c.unpack=function(e,r,a){r=n(r,0);var i=t.unpack(e,r);return c.fromCartesian3(i,a)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var a=e.longitude,i=e.latitude,o=Math.cos(i),u=o*Math.cos(a),E=o*Math.sin(a),s=Math.sin(i);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var a=_,i=T;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(t.dot(a,i));return t.divideByScalar(i,o,i),t.multiplyByScalar(a,e.height,a),r(n)||(n=new t),t.add(i,a,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var l=new t,R=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,R);if(r(i)){var o=this.geodeticSurfaceNormal(i,l),E=t.subtract(n,i,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(a)?(a.longitude=s,a.latitude=c,a.height=_,a):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var a=e.x,i=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new t),i.x=0,i.y=0,i.z=e.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,a,i,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var a=this._semimajorAxis,i=e.longitude*a,o=e.latitude*a,u=e.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new t(i,o,u)},u.prototype.unproject=function(t,n){var a=this._oneOverSemimajorAxis,i=t.x*a,o=t.y*a,u=t.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new e(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a,i,o,u,E,s){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(i,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(f[n],R[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(t[E.getElementIndex(f[i],R[i])]);o>r&&(a=i,r=o)}var s=1,c=0,_=R[a],T=f[a];if(Math.abs(t[E.getElementIndex(T,_)])>n){var l,A=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(A-h)/2/N;l=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+l*l),c=l*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,a=t.x*t.y,i=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,l=t.w*t.w,R=n-u-_+l,f=2*(a-T),A=2*(i+c),h=2*(a+T),N=-n+u-_+l,d=2*(s-o),I=2*(i-c),S=2*(s+o),m=-n-u+_+l;return r(e)?(e[0]=R,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=m,e):new E(R,f,A,h,N,d,I,S,m)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),a=Math.cos(-t.heading),i=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*a,_=-i*u+s*o*a,T=s*u+i*o*a,l=n*u,R=i*a+s*o*u,f=-o*i+i*o*u,A=-o,h=s*n,N=i*n;return r(e)?(e[0]=c,e[1]=l,e[2]=A,e[3]=_,e[4]=R,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new E(c,_,T,l,R,f,A,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=a,e[6]=0,e[7]=-a,e[8]=n,e):new E(1,0,0,0,n,-a,0,a,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=n,e):new E(n,0,a,0,1,0,-a,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=a,e[2]=0,e[3]=-a,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-a,0,a,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,a=t[r],i=t[r+1],o=t[r+2];return n.x=a,n.y=i,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var a=3*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],a=t[e+3],i=t[e+6];return n.x=r,n.y=a,n.z=i,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var l=new t;E.getMaximumScale=function(e){return E.getScale(e,l),t.maximumComponent(l)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],i=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[3]*a+t[6]*i,u=t[1]*r+t[4]*a+t[7]*i,E=t[2]*r+t[5]*a+t[8]*i;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],a=t[6],i=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var R=[1,0,0],f=[2,2,1],A=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,a=10,i=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),l=e.diagonal=E.clone(t,e.diagonal),R=n*s(l);o<a&&c(l)>R;)_(l,A),E.transpose(A,h),E.multiply(l,A,l),E.multiply(h,l,l),E.multiply(T,A,T),++i>2&&(++o,i=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],a=t[1],i=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(i*s-E*o)+a*(E*r-n*s)+u*(n*o-i*r)},E.inverse=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*a-r*_,e[2]=r*u-o*a,e[3]=s*u-i*_,e[4]=n*_-s*a,e[5]=i*a-n*u,e[6]=i*c-s*o,e[7]=s*r-n*c,e[8]=n*o-i*r;var l=1/T;return E.multiplyByScalar(e,l,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,a(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}o.fromElements=function(t,e,r,a,i){return n(i)?(i.x=t,i.y=e,i.z=r,i.w=a,i):new o(t,e,r,a)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r++],a.w=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var a=0;a<r;++a)o.pack(t[a],e,4*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)&&i.equalsEpsilon(t.w,e.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,a,i,o,u,E,s){ -"use strict";function c(t,e,n,a,i,o,u,E,s,c,_,T,l,R,f,A){this[0]=r(t,0),this[1]=r(i,0),this[2]=r(s,0),this[3]=r(l,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(R,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(a,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(A,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),a(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(a(t))return a(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,i){return n=r(n,t.ZERO),a(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){a(r)||(r=new c);var i=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,l=e.y*e.y,R=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-l-A+N,I=2*(s-h),S=2*(_+f),m=2*(s+h),M=-E+l-A+N,O=2*(R-T),y=2*(_-f),p=2*(R+T),C=-E-l+A+N;return r[0]=d*i,r[1]=m*i,r[2]=y*i,r[3]=0,r[4]=I*o,r[5]=M*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=O*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,l=new t;c.fromCamera=function(e,n){var r=e.position,i=e.direction,o=e.up;t.normalize(i,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,l),l);var u=T.x,E=T.y,s=T.z,R=_.x,f=_.y,A=_.z,h=l.x,N=l.y,d=l.z,I=r.x,S=r.y,m=r.z,M=u*-I+E*-S+s*-m,O=h*-I+N*-S+d*-m,y=R*I+f*S+A*m;return a(n)?(n[0]=u,n[1]=h,n[2]=-R,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=M,n[13]=O,n[14]=y,n[15]=1,n):new c(u,E,s,M,h,N,d,O,-R,-f,-A,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,a){var i=Math.tan(.5*t),o=1/i,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=-1,a[12]=0,a[13]=0,a[14]=s,a[15]=0,a},c.computeOrthographicOffCenter=function(t,e,n,r,a,i,o){var u=1/(e-t),E=1/(r-n),s=1/(i-a),c=-(e+t)*u,_=-(r+n)*E,T=-(i+a)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,a,i,o){var u=2*a/(e-t),E=2*a/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(i+a)/(i-a),T=-1,l=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,a,i){var o=2*a/(e-t),u=2*a/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=E,i[9]=s,i[10]=c,i[11]=_,i[12]=0,i[13]=0,i[14]=T,i[15]=0,i},c.computeViewportTransformation=function(t,e,n,a){t=r(t,r.EMPTY_OBJECT);var i=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,l=c,R=_,f=i+s,A=o+c,h=e+_,N=1;return a[0]=T,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=R,a[11]=0,a[12]=f,a[13]=A,a[14]=h,a[15]=N,a},c.computeView=function(e,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-t.dot(a,e),i[13]=-t.dot(r,e),i[14]=t.dot(n,e),i[15]=1,i},c.toArray=function(t,e){return a(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,a=t[r],i=t[r+1],o=t[r+2],u=t[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var a=4*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],a=t[e+4],i=t[e+8],o=t[e+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var R=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],R)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],R)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],R)),n};var f=new t;c.getMaximumScale=function(e){return c.getScale(e,f),t.maximumComponent(f)},c.multiply=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],l=t[10],R=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],m=e[3],M=e[4],O=e[5],y=e[6],p=e[7],C=e[8],U=e[9],P=e[10],L=e[11],F=e[12],w=e[13],g=e[14],v=e[15],x=r*d+u*I+_*S+f*m,D=a*d+E*I+T*S+A*m,B=i*d+s*I+l*S+h*m,z=o*d+c*I+R*S+N*m,G=r*M+u*O+_*y+f*p,b=a*M+E*O+T*y+A*p,X=i*M+s*O+l*y+h*p,V=o*M+c*O+R*y+N*p,q=r*C+u*U+_*P+f*L,H=a*C+E*U+T*P+A*L,W=i*C+s*U+l*P+h*L,Y=o*C+c*U+R*P+N*L,k=r*F+u*w+_*g+f*v,K=a*F+E*w+T*g+A*v,Z=i*F+s*w+l*g+h*v,j=o*F+c*w+R*g+N*v;return n[0]=x,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],l=t[13],R=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],m=e[9],M=e[10],O=e[12],y=e[13],p=e[14],C=r*f+o*A+s*h,U=a*f+u*A+c*h,P=i*f+E*A+_*h,L=r*N+o*d+s*I,F=a*N+u*d+c*I,w=i*N+E*d+_*I,g=r*S+o*m+s*M,v=a*S+u*m+c*M,x=i*S+E*m+_*M,D=r*O+o*y+s*p+T,B=a*O+u*y+c*p+l,z=i*O+E*y+_*p+R;return n[0]=C,n[1]=U,n[2]=P,n[3]=0,n[4]=L,n[5]=F,n[6]=w,n[7]=0,n[8]=g,n[9]=v,n[10]=x,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],l=e[1],R=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*l+s*R,m=a*T+u*l+c*R,M=i*T+E*l+_*R,O=r*f+o*A+s*h,y=a*f+u*A+c*h,p=i*f+E*A+_*h,C=r*N+o*d+s*I,U=a*N+u*d+c*I,P=i*N+E*d+_*I;return n[0]=S,n[1]=m,n[2]=M,n[3]=0,n[4]=O,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=P,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=r*t[0]+a*t[4]+i*t[8]+t[12],u=r*t[1]+a*t[5]+i*t[9]+t[13],E=r*t[2]+a*t[6]+i*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var A=new t;c.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,c.multiplyByScale(t,A,n)},c.multiplyByScale=function(t,e,n){var r=e.x,a=e.y,i=e.z;return 1===r&&1===a&&1===i?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=a*t[4],n[5]=a*t[5],n[6]=a*t[6],n[7]=0,n[8]=i*t[8],n[9]=i*t[9],n[10]=i*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t[0]*r+t[4]*a+t[8]*i+t[12]*o,E=t[1]*r+t[5]*a+t[9]*i+t[13]*o,s=t[2]*r+t[6]*a+t[10]*i+t[14]*o,c=t[3]*r+t[7]*a+t[11]*i+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i,u=t[1]*r+t[5]*a+t[9]*i,E=t[2]*r+t[6]*a+t[10]*i;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i+t[12],u=t[1]*r+t[5]*a+t[9]*i+t[13],E=t[2]*r+t[6]*a+t[10]*i+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],a=t[3],i=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=i,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],a=t[4],i=t[8],o=t[12],_=t[1],T=t[5],l=t[9],R=t[13],f=t[2],A=t[6],S=t[10],m=t[14],M=t[3],O=t[7],y=t[11],p=t[15],C=S*p,U=m*y,P=A*p,L=m*O,F=A*y,w=S*O,g=f*p,v=m*M,x=f*y,D=S*M,B=f*O,z=A*M,G=C*T+L*l+F*R-(U*T+P*l+w*R),b=U*_+g*l+D*R-(C*_+v*l+x*R),X=P*_+v*T+B*R-(L*_+g*T+z*R),V=w*_+x*T+z*l-(F*_+D*T+B*l),q=U*a+P*i+w*o-(C*a+L*i+F*o),H=C*r+v*i+x*o-(U*r+g*i+D*o),W=L*r+g*a+z*o-(P*r+v*a+B*o),Y=F*r+D*a+B*i-(w*r+x*a+z*i);C=i*R,U=o*l,P=a*R,L=o*T,F=a*l,w=i*T,g=r*R,v=o*_,x=r*l,D=i*_,B=r*T,z=a*_;var k=C*O+L*y+F*p-(U*O+P*y+w*p),K=U*M+g*y+D*p-(C*M+v*y+x*p),Z=P*M+v*O+B*p-(L*M+g*O+z*p),j=w*M+x*O+z*y-(F*M+D*O+B*y),Q=P*S+w*m+U*A-(F*m+C*A+L*S),J=x*m+C*f+v*S-(g*S+D*m+U*f),$=g*A+z*m+L*f-(B*m+P*f+v*A),tt=B*S+F*f+D*A-(x*A+z*S+w*f),et=r*G+a*b+i*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],l=t[14],R=-n*_-r*T-a*l,f=-i*_-o*T-u*l,A=-E*_-s*T-c*l;return e[0]=n,e[1]=i,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=a,e[9]=u,e[10]=c,e[11]=0,e[12]=R,e[13]=f,e[14]=A,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(a,0)}a(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,a,i,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=t,o.south=e,o.east=a,o.north=i,o):new E(t,e,a,i)},E.fromRadians=function(t,e,a,i,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(a,0),o.north=n(i,0),o):new E(t,e,a,i)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var l=t[_];n=Math.min(n,l.longitude),a=Math.max(a,l.longitude),s=Math.min(s,l.latitude),c=Math.max(c,l.latitude);var R=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;i=Math.min(i,R),o=Math.max(o,R)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=a,e.north=c,e):new E(n,s,a,c)},E.fromCartesianArray=function(t,e,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,l=t.length;T<l;T++){var R=e.cartesianToCartographic(t[T]);a=Math.min(a,R.longitude),i=Math.max(i,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return i-a>s-o&&(a=o,i=s,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=c,n.east=i,n.north=_,n):new E(a,c,i,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var a=e.east,i=e.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var a=t.east,i=t.west,o=e.east,s=e.west;a<i&&o>0?a+=u.TWO_PI:o<s&&a>0&&(o+=u.TWO_PI),a<i&&s<0?s+=u.TWO_PI:o<s&&i<0&&(i+=u.TWO_PI);var c=u.negativePiToPi(Math.max(i,s)),_=u.negativePiToPi(Math.min(a,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),l=Math.min(t.north,e.north);if(!(T>=l))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=l,n):new E(c,T,_,l)}},E.simpleIntersection=function(t,e,n){var a=Math.max(t.west,e.west),i=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new E(a,i,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var a=t.east,i=t.west,o=e.east,s=e.west;a<i&&o>0?a+=u.TWO_PI:o<s&&a>0&&(o+=u.TWO_PI),a<i&&s<0?s+=u.TWO_PI:o<s&&i<0&&(i+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(i,s)),_=u.convertLongitudeRange(Math.max(a,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,a=t.west,i=t.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,a,o){e=n(e,i.WGS84),a=n(a,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,l=t.east,R=t.west,f=s;f.height=a,f.longitude=R,f.latitude=_,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.latitude=T,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=e.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,a,i,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var l=new t,R=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,m=new t,M=new t,O=new t;T.fromPoints=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),i=t.clone(r,l),o=t.clone(r,R),u=t.clone(r,f),E=t.clone(r,A),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<i.x&&t.clone(r,i),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var P=t.magnitudeSquared(t.subtract(E,i,I)),L=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),w=i,g=E,v=P;L>v&&(v=L,w=o,g=s),F>v&&(v=F,w=u,g=c);var x=S;x.x=.5*(w.x+g.x),x.y=.5*(w.y+g.y),x.z=.5*(w.z+g.z);var D=t.magnitudeSquared(t.subtract(g,x,I)),B=Math.sqrt(D),z=m;z.x=i.x,z.y=o.y,z.z=u.z;var G=M;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,O),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*r.x)/H,x.y=(B*x.y+W*r.y)/H,x.z=(B*x.z+W*r.z)/H}}return B<X?(t.clone(x,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,P=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,i,o,u){if(a(u)||(u=new T),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=i,_.northeast(e,P),P.height=o;var E=n.project(U,p),s=n.project(P,C),c=s.x-E.x,l=s.y-E.y,R=s.z-E.z;u.radius=.5*Math.sqrt(c*c+l*l+R*R);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*l,f.z=E.z+.5*R,u};var L=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,i.WGS84),n=r(n,0);var u;return a(t)&&(u=_.subsample(t,e,n,L)),T.fromPoints(u,o)},T.fromVertices=function(e,n,i,o){if(a(o)||(o=new T),!a(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),i=r(i,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,l),s=t.clone(u,R),c=t.clone(u,f),_=t.clone(u,A),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=i){var P=e[U]+n.x,L=e[U+1]+n.y,F=e[U+2]+n.z;u.x=P,u.y=L,u.z=F,P<E.x&&t.clone(u,E),P>_.x&&t.clone(u,_),L<s.y&&t.clone(u,s),L>y.y&&t.clone(u,y),F<c.z&&t.clone(u,c),F>p.z&&t.clone(u,p)}var w=t.magnitudeSquared(t.subtract(_,E,I)),g=t.magnitudeSquared(t.subtract(y,s,I)),v=t.magnitudeSquared(t.subtract(p,c,I)),x=E,D=_,B=w;g>B&&(B=g,x=s,D=y),v>B&&(B=v,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=M;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,O),H=0;for(U=0;U<C;U+=i){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(a(r)||(r=new T),!a(e)||!a(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var i=d;i.x=e[0]+n[0],i.y=e[1]+n[1],i.z=e[2]+n[2];for(var o=t.clone(i,l),u=t.clone(i,R),E=t.clone(i,f),s=t.clone(i,A),c=t.clone(i,h),_=t.clone(i,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],P=e[p+2]+n[p+2];i.x=C,i.y=U,i.z=P,C<o.x&&t.clone(i,o),C>s.x&&t.clone(i,s),U<u.y&&t.clone(i,u),U>c.y&&t.clone(i,c),P<E.z&&t.clone(i,E),P>_.z&&t.clone(i,_)}var L=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),w=t.magnitudeSquared(t.subtract(_,E,I)),g=o,v=s,x=L;F>x&&(x=F,g=u,v=c),w>x&&(x=w,g=E,v=_);var D=S;D.x=.5*(g.x+v.x),D.y=.5*(g.y+v.y),D.z=.5*(g.z+v.z);var B=t.magnitudeSquared(t.subtract(v,D,I)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=M;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,O),V=0;for(p=0;p<y;p+=3){i.x=e[p]+n[p],i.y=e[p+1]+n[p+1],i.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(i,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(i,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*i.x)/W,D.y=(z*D.y+Y*i.y)/W,D.z=(z*D.z+Y*i.z)/W}}return z<V?(t.clone(D,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){a(r)||(r=new T);var i=r.center;return t.add(e,n,i),t.multiplyByScalar(i,.5,i),r.radius=t.distance(i,n),r},T.fromEllipsoid=function(e,n){return a(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var F=new t;T.fromBoundingSpheres=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var i=[],o=0;o<r;o++)i.push(e[o].center);n=T.fromPoints(i,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var w=new t,g=new t,v=new t;T.fromOrientedBoundingBox=function(e,n){a(n)||(n=new T);var r=e.halfAxes,i=s.getColumn(r,0,w),o=s.getColumn(r,1,g),u=s.getColumn(r,2,v),E=t.magnitude(i),c=t.magnitude(o),_=t.magnitude(u);return n.center=t.clone(e.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(e,n){if(a(e))return a(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var a=t.center;return e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),a(n)||(n=new T);var i=n.center;return i.x=t[e++],i.y=t[e++],i.z=t[e++],n.radius=t[e],n};var x=new t,D=new t;T.union=function(e,n,r){a(r)||(r=new T);var i=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,i,x),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),l=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(l,i,l),t.clone(l,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var a=t.magnitude(t.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},T.intersectPlane=function(e,n){var r=e.center,a=e.radius,i=n.normal,o=t.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,i){a(i)||(i=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return i.start=u-e.radius,i.stop=u+e.radius,i};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,a){n=r(n,K);var i=n.ellipsoid,o=e.center,u=e.radius,E=i.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),l=t.negate(s,q),R=Y,f=R[0];t.add(E,c,f),t.add(f,s,f),f=R[1],t.add(E,c,f),t.add(f,l,f),f=R[2],t.add(E,_,f),t.add(f,l,f),f=R[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=R[4],t.add(E,c,f),t.add(f,s,f),f=R[5],t.add(E,c,f),t.add(f,l,f),f=R[6],t.add(E,_,f),t.add(f,l,f),f=R[7],t.add(E,_,f),t.add(f,s,f);for(var A=R.length,h=0;h<A;++h){var N=R[h];t.add(o,N,N);var d=i.cartesianToCartographic(N,W);n.project(d,N)}a=T.fromPoints(R,a),o=a.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,a},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||a(e)&&a(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n){this.x=e(t,0),this.y=e(n,0)}o.fromElements=function(t,e,r){return n(r)?(r.x=t,r.y=e,r):new o(t,e)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e):new o(t.x,t.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=2*r:e=new Array(2*r);for(var a=0;a<r;++a)o.pack(t[a],e,2*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/2:e=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y)},o.minimumComponent=function(t){return Math.min(t.x,t.y)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){return o.normalize(t,s),o.normalize(e,c),i.acosClamped(o.dot(s,c))};var _=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Y,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]; -}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var E=i[o];a=E+"RequestFullscreen","function"==typeof e[a]?(r.requestFullscreen=a,n=!0):(a=E+"RequestFullScreen","function"==typeof e[a]&&(r.requestFullscreen=a,n=!0)),a=E+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=E+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=E+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=E+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=E+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=E+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=E+"fullscreenchange",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=E+"fullscreenerror",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function a(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function i(){return a()&&m}function o(){if(!e(M)&&(M=!1,!a()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(M=!0,O=r(t[1]))}return M}function u(){return o()&&O}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(P)){P=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,L=r(t[1]))}return P}function l(){return T()&&L}function R(){if(!e(F)){F=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(F=!0,w=r(t[1]))}return F}function f(){return e(g)||(g=/Windows/i.test(I.appVersion)),g}function A(){return R()&&w}function h(){return e(v)||(v="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),v}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(x=n)}return D}function d(){return N()?x:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,M,O,y,p,C,U,P,L,F,w,g,v,x,D,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:l,isFirefox:R,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,a){switch(r=t(r,0),a=t(a,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,a){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return i.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var a=t.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(t){switch(t){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},i.createTypedArrayFromArrayBuffer=function(t,e,n,a){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,a):new Uint16Array(e,n,a)},n(i)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.tangent?1:0,n[r++]=e.bitangent?1:0,n[r++]=e.color?1:0,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(t,n){if(e(t))return e(n)||(n=new a),n.position=t.position,n.normal=t.normal,n.st=t.st,n.tangent=t.tangent,n.bitangent=t.bitangent,n.color=t.color,n},a}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,a,i,o,u,E,s,c,_,T,l,R){"use strict";function f(t){t=a(t,a.EMPTY_OBJECT);var e=a(t.radii,S),r=a(t.stackPartitions,64),i=a(t.slicePartitions,64),o=a(t.vertexFormat,R.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=i,this._vertexFormat=R.clone(o),this._workerName="createEllipsoidGeometry"}var A=new n,h=new n,N=new n,d=new n,I=new n,S=new n(1,1,1),m=Math.cos,M=Math.sin;f.packedLength=n.packedLength+R.packedLength+2,f.pack=function(t,e,r){return r=a(r,0),n.pack(t._radii,e,r),r+=n.packedLength,R.pack(t._vertexFormat,e,r),r+=R.packedLength,e[r++]=t._stackPartitions,e[r]=t._slicePartitions,e};var O=new n,y=new R,p={radii:O,vertexFormat:y,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(t,e,r){e=a(e,0);var o=n.unpack(t,e,O);e+=n.packedLength;var u=R.unpack(t,e,y);e+=R.packedLength;var E=t[e++],s=t[e];return i(r)?(r._radii=n.clone(o,r._radii),r._vertexFormat=R.clone(u,r._vertexFormat),r._stackPartitions=E,r._slicePartitions=s,r):(p.stackPartitions=E,p.slicePartitions=s,new f(p))},f.createGeometry=function(a){var i=a._radii;if(!(i.x<=0||i.y<=0||i.z<=0)){var o,R,f=u.fromCartesian3(i),S=a._vertexFormat,O=a._slicePartitions+1,y=a._stackPartitions+1,p=y*O,C=new Float64Array(3*p),U=6*(O-1)*(y-2),P=_.createTypedArray(p,U),L=S.normal?new Float32Array(3*p):void 0,F=S.tangent?new Float32Array(3*p):void 0,w=S.bitangent?new Float32Array(3*p):void 0,g=S.st?new Float32Array(2*p):void 0,v=new Array(O),x=new Array(O),D=0;for(o=0;o<O;o++){var B=T.TWO_PI*o/(O-1);v[o]=m(B),x[o]=M(B),C[D++]=0,C[D++]=0,C[D++]=i.z}for(o=1;o<y-1;o++){var z=Math.PI*o/(y-1),G=M(z),b=i.x*G,X=i.y*G,V=i.z*m(z);for(R=0;R<O;R++)C[D++]=v[R]*b,C[D++]=x[R]*X,C[D++]=V}for(o=0;o<O;o++)C[D++]=0,C[D++]=0,C[D++]=-i.z;var q=new c;S.position&&(q.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:C}));var H=0,W=0,Y=0,k=0;if(S.st||S.normal||S.tangent||S.bitangent){for(o=0;o<p;o++){var K=n.fromArray(C,3*o,A),Z=f.geodeticSurfaceNormal(K,h);if(S.st){var j=e.negate(Z,I);e.magnitude(j)<T.EPSILON6&&(D=3*(o+O*Math.floor(.5*y)),D>C.length&&(D=3*(o-O*Math.floor(.5*y))),n.fromArray(C,D,j),f.geodeticSurfaceNormal(j,j),e.negate(j,j)),g[H++]=Math.atan2(j.y,j.x)/T.TWO_PI+.5,g[H++]=Math.asin(Z.z)/Math.PI+.5}if(S.normal&&(L[W++]=Z.x,L[W++]=Z.y,L[W++]=Z.z),S.tangent||S.bitangent){var Q=N;if(o<O||o>p-O-1?(n.cross(n.UNIT_X,Z,Q),n.normalize(Q,Q)):(n.cross(n.UNIT_Z,Z,Q),n.normalize(Q,Q)),S.tangent&&(F[Y++]=Q.x,F[Y++]=Q.y,F[Y++]=Q.z),S.bitangent){var J=n.cross(Z,Q,d);n.normalize(J,J),w[k++]=J.x,w[k++]=J.y,w[k++]=J.z}}}S.st&&(q.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:g})),S.normal&&(q.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:L})),S.tangent&&(q.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),S.bitangent&&(q.bitangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:w}))}for(D=0,R=0;R<O-1;R++)P[D++]=O+R,P[D++]=O+R+1,P[D++]=R+1;var $,tt;for(o=1;o<y-2;o++)for($=o*O,tt=(o+1)*O,R=0;R<O-1;R++)P[D++]=tt+R,P[D++]=tt+R+1,P[D++]=$+R+1,P[D++]=tt+R,P[D++]=$+R+1,P[D++]=$+R;for(o=y-2,$=o*O,tt=(o+1)*O,R=0;R<O-1;R++)P[D++]=tt+R,P[D++]=$+R+1,P[D++]=$+R;return new E({attributes:q,indices:P,primitiveType:l.TRIANGLES,boundingSphere:t.fromEllipsoid(f)})}},f}),define("Core/SphereGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidGeometry","./VertexFormat"],function(t,e,n,r,a,i){"use strict";function o(e){var r=n(e.radius,1),i=new t(r,r,r),o={radii:i,stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new a(o),this._workerName="createSphereGeometry"}o.packedLength=a.packedLength,o.pack=function(t,e,n){return a.pack(t._ellipsoidGeometry,e,n)};var u=new a,E={radius:void 0,radii:new t,vertexFormat:new i,stackPartitions:void 0,slicePartitions:void 0};return o.unpack=function(e,n,s){var c=a.unpack(e,n,u);return E.vertexFormat=i.clone(c._vertexFormat,E.vertexFormat),E.stackPartitions=c._stackPartitions,E.slicePartitions=c._slicePartitions,r(s)?(t.clone(c._radii,E.radii),s._ellipsoidGeometry=new a(E),s):(E.radius=c._radii.x,new o(E))},o.createGeometry=function(t){return a.createGeometry(t._ellipsoidGeometry)},o}),define("Workers/createSphereGeometry",["../Core/defined","../Core/SphereGeometry"],function(t,e){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var a={};return a.typeOf={},a.defined=function(r,a){if(!t(a))throw new e(n(r))},a.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},a.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},a.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},a.typeOf.number.lessThan=function(t,n,r){if(a.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(t,n,r){if(a.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(t,n,r){if(a.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},a.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},a}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(t){return t>0?1:t<0?-1:0},a.signNotZero=function(t){return t<0?-1:1},a.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*a.clamp(t,-1,1)+.5)*n)},a.fromSNorm=function(t,n){return n=e(n,255),a.clamp(t,0,n)/n*2-1},a.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},a.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},a.lerp=function(t,e,n){return(1-n)*t+n*e},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(t){return t*a.RADIANS_PER_DEGREE},a.toDegrees=function(t){return t*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(t){var e=a.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},a.clampToLatitudeRange=function(t){return a.clamp(t,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(t){return a.zeroToTwoPi(t+a.PI)-a.PI},a.zeroToTwoPi=function(t){var e=a.mod(t,a.TWO_PI);return Math.abs(e)<a.EPSILON14&&Math.abs(t)>a.EPSILON14?a.TWO_PI:e},a.mod=function(t,e){return(t%e+e)%e},a.equalsEpsilon=function(t,n,r,a){a=e(a,r);var i=Math.abs(t-n);return i<=a||i<=r*Math.max(Math.abs(t),Math.abs(n))};var i=[1];a.factorial=function(t){var e=i.length;if(t>=e)for(var n=i[e-1],r=e;r<=t;r++)i.push(n*r);return i[t]},a.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},a.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},a.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},a.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return a.setRandomNumberSeed=function(e){o=new t(e)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(t){return Math.acos(a.clamp(t,-1,1))},a.asinClamped=function(t){return Math.asin(a.clamp(t,-1,1))},a.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},a.logBase=function(t,e){return Math.log(t)/Math.log(e)},a.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var a=t.clock,i=t.cone,u=e(t.magnitude,1),E=u*Math.sin(i);return r.x=E*Math.cos(a),r.y=E*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(t,e,r,a){return n(a)?(a.x=t,a.y=e,a.z=r,a):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var a=0;a<r;++a)o.pack(t[a],e,3*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)},o.cross=function(t,e,n){var r=t.x,a=t.y,i=t.z,o=e.x,u=e.y,E=e.z,s=a*E-i*u,c=i*o-r*E,_=r*u-a*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,a){return t=i.toRadians(t),e=i.toRadians(e),o.fromRadians(t,e,n,r,a)};var T=new o,l=new o,R=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,a,i,u){a=e(a,0);var E=n(i)?i.radiiSquared:R,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,l);var c=Math.sqrt(o.dot(T,l));return l=o.divideByScalar(l,c,l),T=o.multiplyByScalar(T,a,T),n(u)||(u=new o),o.add(l,T,u)},o.fromDegreesArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var a=t.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=t[i],E=t[i+1],s=i/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var a=t.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=t[i],E=t[i+1],s=t[i+2],c=i/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function a(n,a,u,E,s){var c=n.x,_=n.y,T=n.z,l=a.x,R=a.y,f=a.z,A=c*c*l*l,h=_*_*R*R,N=T*T*f*f,d=A+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,i);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var m=u.x,M=u.y,O=u.z,y=o;y.x=S.x*m*2,y.y=S.y*M*2,y.z=S.z*O*2;var p,C,U,P,L,F,w,g,v,x,D,B=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),z=0;do{B-=z,U=1/(1+B*m),P=1/(1+B*M),L=1/(1+B*O),F=U*U,w=P*P,g=L*L,v=F*U,x=w*P,D=g*L,p=A*F+h*w+N*g-1,C=A*v*m+h*x*M+N*D*O;var G=-2*C;z=p/G}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*P,s.z=T*L,s):new t(c*U,_*P,T*L)}var i=new t,o=new t;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o){"use strict";function u(t,e,r){this.longitude=n(t,0),this.latitude=n(e,0),this.height=n(r,0)}u.fromRadians=function(t,e,a,i){return a=n(a,0),r(i)?(i.longitude=t,i.latitude=e,i.height=a,i):new u(t,e,a)},u.fromDegrees=function(t,e,n,r){return t=i.toRadians(t),e=i.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),l=i.EPSILON1;return u.fromCartesian=function(e,n,a){var R=r(n)?n.oneOverRadii:_,f=r(n)?n.oneOverRadiiSquared:T,A=r(n)?n._centerToleranceSquared:l,h=o(e,R,f,A,s);if(r(h)){var N=t.multiplyComponents(h,f,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),m=i.sign(t.dot(d,e))*t.magnitude(d);return r(a)?(a.longitude=I,a.latitude=S,a.height=m,a):new u(I,S,m)}},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,a,i,o,u,E){"use strict";function s(e,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),e._radii=new t(r,a,i),e._radiiSquared=new t(r*r,a*a,i*i),e._radiiToTheFourth=new t(r*r*r*r,a*a*a*a,i*i*i*i),e._oneOverRadii=new t(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),e._minimumRadius=Math.min(r,a,i),e._maximumRadius=Math.max(r,a,i),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}a(c.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}}}),c.clone=function(e,n){if(r(e)){var a=e._radii;return r(n)?(t.clone(a,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(a.x,a.y,a.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,a){return a=n(a,0),t.pack(e._radii,r,a),r},c.unpack=function(e,r,a){r=n(r,0);var i=t.unpack(e,r);return c.fromCartesian3(i,a)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var a=e.longitude,i=e.latitude,o=Math.cos(i),u=o*Math.cos(a),E=o*Math.sin(a),s=Math.sin(i);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var a=_,i=T;this.geodeticSurfaceNormalCartographic(e,a),t.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(t.dot(a,i));return t.divideByScalar(i,o,i),t.multiplyByScalar(a,e.height,a),r(n)||(n=new t),t.add(i,a,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;a++)e[a]=this.cartographicToCartesian(t[a],e[a]);return e};var l=new t,R=new t,f=new t;return c.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,R);if(r(i)){var o=this.geodeticSurfaceNormal(i,l),E=t.subtract(n,i,f),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(a)?(a.longitude=s,a.latitude=c,a.height=_,a):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var a=0;a<n;++a)e[a]=this.cartesianToCartographic(t[a],e[a]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var a=e.x,i=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new t),i.x=0,i.y=0,i.z=e.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,a,i,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var a=this._semimajorAxis,i=e.longitude*a,o=e.latitude*a,u=e.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new t(i,o,u)},u.prototype.unproject=function(t,n){var a=this._oneOverSemimajorAxis,i=t.x*a,o=t.y*a,u=t.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new e(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a,i,o,u,E,s){this[0]=n(t,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(i,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(f[n],R[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(t[E.getElementIndex(f[i],R[i])]);o>r&&(a=i,r=o)}var s=1,c=0,_=R[a],T=f[a];if(Math.abs(t[E.getElementIndex(T,_)])>n){var l,A=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(A-h)/2/N;l=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+l*l),c=l*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e++],a[1]=t[e++],a[2]=t[e++],a[3]=t[e++],a[4]=t[e++],a[5]=t[e++],a[6]=t[e++],a[7]=t[e++],a[8]=t[e++],a},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a[0]=t[e],a[1]=t[e+1],a[2]=t[e+2],a[3]=t[e+3],a[4]=t[e+4],a[5]=t[e+5],a[6]=t[e+6],a[7]=t[e+7],a[8]=t[e+8],a},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,a=t.x*t.y,i=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,l=t.w*t.w,R=n-u-_+l,f=2*(a-T),A=2*(i+c),h=2*(a+T),N=-n+u-_+l,d=2*(s-o),I=2*(i-c),S=2*(s+o),m=-n-u+_+l;return r(e)?(e[0]=R,e[1]=h,e[2]=I,e[3]=f,e[4]=N,e[5]=S,e[6]=A,e[7]=d,e[8]=m,e):new E(R,f,A,h,N,d,I,S,m)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),a=Math.cos(-t.heading),i=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*a,_=-i*u+s*o*a,T=s*u+i*o*a,l=n*u,R=i*a+s*o*u,f=-s*a+i*o*u,A=-o,h=s*n,N=i*n;return r(e)?(e[0]=c,e[1]=l,e[2]=A,e[3]=_,e[4]=R,e[5]=h,e[6]=T,e[7]=f,e[8]=N,e):new E(c,_,T,l,R,f,A,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=a,e[6]=0,e[7]=-a,e[8]=n,e):new E(1,0,0,0,n,-a,0,a,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-a,e[3]=0,e[4]=1,e[5]=0,e[6]=a,e[7]=0,e[8]=n,e):new E(n,0,a,0,1,0,-a,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),a=Math.sin(t);return r(e)?(e[0]=n,e[1]=a,e[2]=0,e[3]=-a,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-a,0,a,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,a=t[r],i=t[r+1],o=t[r+2];return n.x=a,n.y=i,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var a=3*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],a=t[e+3],i=t[e+6];return n.x=r,n.y=a,n.z=i,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var l=new t;E.getMaximumScale=function(e){return E.getScale(e,l),t.maximumComponent(l)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],a=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],i=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[3]*a+t[6]*i,u=t[1]*r+t[4]*a+t[7]*i,E=t[2]*r+t[5]*a+t[8]*i;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],a=t[6],i=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=a,e[3]=i,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var R=[1,0,0],f=[2,2,1],A=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,a=10,i=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),l=e.diagonal=E.clone(t,e.diagonal),R=n*s(l);o<a&&c(l)>R;)_(l,A),E.transpose(A,h),E.multiply(l,A,l),E.multiply(h,l,l),E.multiply(T,A,T),++i>2&&(++o,i=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],a=t[1],i=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(i*s-E*o)+a*(E*r-n*s)+u*(n*o-i*r)},E.inverse=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*a-r*_,e[2]=r*u-o*a,e[3]=s*u-i*_,e[4]=n*_-s*a,e[5]=i*a-n*u,e[6]=i*c-s*o,e[7]=s*r-n*c,e[8]=n*o-i*r;var l=1/T;return E.multiplyByScalar(e,l,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,a(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n,r,a){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(a,0)}o.fromElements=function(t,e,r,a,i){return n(i)?(i.x=t,i.y=e,i.z=r,i.w=a,i):new o(t,e,r,a)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r++],a.z=t[r++],a.w=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var a=0;a<r;++a)o.pack(t[a],e,4*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)&&i.equalsEpsilon(t.z,e.z,r,a)&&i.equalsEpsilon(t.w,e.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,a,i,o,u,E,s){ +"use strict";function c(t,e,n,a,i,o,u,E,s,c,_,T,l,R,f,A){this[0]=r(t,0),this[1]=r(i,0),this[2]=r(s,0),this[3]=r(l,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(R,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(f,0),this[12]=r(a,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(A,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),a(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(a(t))return a(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return a(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,i){return n=r(n,t.ZERO),a(i)?(i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=0,i[4]=e[3],i[5]=e[4],i[6]=e[5],i[7]=0,i[8]=e[6],i[9]=e[7],i[10]=e[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){a(r)||(r=new c);var i=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,l=e.y*e.y,R=e.y*e.z,f=e.y*e.w,A=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-l-A+N,I=2*(s-h),S=2*(_+f),m=2*(s+h),M=-E+l-A+N,O=2*(R-T),y=2*(_-f),p=2*(R+T),C=-E-l+A+N;return r[0]=d*i,r[1]=m*i,r[2]=y*i,r[3]=0,r[4]=I*o,r[5]=M*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=O*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return a(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return a(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,l=new t;c.fromCamera=function(e,n){var r=e.position,i=e.direction,o=e.up;t.normalize(i,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,l),l);var u=T.x,E=T.y,s=T.z,R=_.x,f=_.y,A=_.z,h=l.x,N=l.y,d=l.z,I=r.x,S=r.y,m=r.z,M=u*-I+E*-S+s*-m,O=h*-I+N*-S+d*-m,y=R*I+f*S+A*m;return a(n)?(n[0]=u,n[1]=h,n[2]=-R,n[3]=0,n[4]=E,n[5]=N,n[6]=-f,n[7]=0,n[8]=s,n[9]=d,n[10]=-A,n[11]=0,n[12]=M,n[13]=O,n[14]=y,n[15]=1,n):new c(u,E,s,M,h,N,d,O,-R,-f,-A,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,a){var i=Math.tan(.5*t),o=1/i,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=-1,a[12]=0,a[13]=0,a[14]=s,a[15]=0,a},c.computeOrthographicOffCenter=function(t,e,n,r,a,i,o){var u=1/(e-t),E=1/(r-n),s=1/(i-a),c=-(e+t)*u,_=-(r+n)*E,T=-(i+a)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,a,i,o){var u=2*a/(e-t),E=2*a/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(i+a)/(i-a),T=-1,l=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=l,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,a,i){var o=2*a/(e-t),u=2*a/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=E,i[9]=s,i[10]=c,i[11]=_,i[12]=0,i[13]=0,i[14]=T,i[15]=0,i},c.computeViewportTransformation=function(t,e,n,a){t=r(t,r.EMPTY_OBJECT);var i=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,l=c,R=_,f=i+s,A=o+c,h=e+_,N=1;return a[0]=T,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=l,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=R,a[11]=0,a[12]=f,a[13]=A,a[14]=h,a[15]=N,a},c.computeView=function(e,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-t.dot(a,e),i[13]=-t.dot(r,e),i[14]=t.dot(n,e),i[15]=1,i},c.toArray=function(t,e){return a(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,a=t[r],i=t[r+1],o=t[r+2],u=t[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var a=4*e;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],a=t[e+4],i=t[e+8],o=t[e+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var R=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],R)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],R)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],R)),n};var f=new t;c.getMaximumScale=function(e){return c.getScale(e,f),t.maximumComponent(f)},c.multiply=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],l=t[10],R=t[11],f=t[12],A=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],m=e[3],M=e[4],O=e[5],y=e[6],p=e[7],C=e[8],U=e[9],P=e[10],L=e[11],F=e[12],w=e[13],g=e[14],v=e[15],x=r*d+u*I+_*S+f*m,D=a*d+E*I+T*S+A*m,B=i*d+s*I+l*S+h*m,z=o*d+c*I+R*S+N*m,G=r*M+u*O+_*y+f*p,b=a*M+E*O+T*y+A*p,X=i*M+s*O+l*y+h*p,V=o*M+c*O+R*y+N*p,q=r*C+u*U+_*P+f*L,H=a*C+E*U+T*P+A*L,W=i*C+s*U+l*P+h*L,Y=o*C+c*U+R*P+N*L,k=r*F+u*w+_*g+f*v,K=a*F+E*w+T*g+A*v,Z=i*F+s*w+l*g+h*v,j=o*F+c*w+R*g+N*v;return n[0]=x,n[1]=D,n[2]=B,n[3]=z,n[4]=G,n[5]=b,n[6]=X,n[7]=V,n[8]=q,n[9]=H,n[10]=W,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],l=t[13],R=t[14],f=e[0],A=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],m=e[9],M=e[10],O=e[12],y=e[13],p=e[14],C=r*f+o*A+s*h,U=a*f+u*A+c*h,P=i*f+E*A+_*h,L=r*N+o*d+s*I,F=a*N+u*d+c*I,w=i*N+E*d+_*I,g=r*S+o*m+s*M,v=a*S+u*m+c*M,x=i*S+E*m+_*M,D=r*O+o*y+s*p+T,B=a*O+u*y+c*p+l,z=i*O+E*y+_*p+R;return n[0]=C,n[1]=U,n[2]=P,n[3]=0,n[4]=L,n[5]=F,n[6]=w,n[7]=0,n[8]=g,n[9]=v,n[10]=x,n[11]=0,n[12]=D,n[13]=B,n[14]=z,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],a=t[1],i=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],l=e[1],R=e[2],f=e[3],A=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*l+s*R,m=a*T+u*l+c*R,M=i*T+E*l+_*R,O=r*f+o*A+s*h,y=a*f+u*A+c*h,p=i*f+E*A+_*h,C=r*N+o*d+s*I,U=a*N+u*d+c*I,P=i*N+E*d+_*I;return n[0]=S,n[1]=m,n[2]=M,n[3]=0,n[4]=O,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=P,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=r*t[0]+a*t[4]+i*t[8]+t[12],u=r*t[1]+a*t[5]+i*t[9]+t[13],E=r*t[2]+a*t[6]+i*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var A=new t;c.multiplyByUniformScale=function(t,e,n){return A.x=e,A.y=e,A.z=e,c.multiplyByScale(t,A,n)},c.multiplyByScale=function(t,e,n){var r=e.x,a=e.y,i=e.z;return 1===r&&1===a&&1===i?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=a*t[4],n[5]=a*t[5],n[6]=a*t[6],n[7]=0,n[8]=i*t[8],n[9]=i*t[9],n[10]=i*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t[0]*r+t[4]*a+t[8]*i+t[12]*o,E=t[1]*r+t[5]*a+t[9]*i+t[13]*o,s=t[2]*r+t[6]*a+t[10]*i+t[14]*o,c=t[3]*r+t[7]*a+t[11]*i+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i,u=t[1]*r+t[5]*a+t[9]*i,E=t[2]*r+t[6]*a+t[10]*i;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,a=e.y,i=e.z,o=t[0]*r+t[4]*a+t[8]*i+t[12],u=t[1]*r+t[5]*a+t[9]*i+t[13],E=t[2]*r+t[6]*a+t[10]*i+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],a=t[3],i=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=i,e[10]=t[10],e[11]=t[14],e[12]=a,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||a(t)&&a(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||a(t)&&a(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],a=t[4],i=t[8],o=t[12],_=t[1],T=t[5],l=t[9],R=t[13],f=t[2],A=t[6],S=t[10],m=t[14],M=t[3],O=t[7],y=t[11],p=t[15],C=S*p,U=m*y,P=A*p,L=m*O,F=A*y,w=S*O,g=f*p,v=m*M,x=f*y,D=S*M,B=f*O,z=A*M,G=C*T+L*l+F*R-(U*T+P*l+w*R),b=U*_+g*l+D*R-(C*_+v*l+x*R),X=P*_+v*T+B*R-(L*_+g*T+z*R),V=w*_+x*T+z*l-(F*_+D*T+B*l),q=U*a+P*i+w*o-(C*a+L*i+F*o),H=C*r+v*i+x*o-(U*r+g*i+D*o),W=L*r+g*a+z*o-(P*r+v*a+B*o),Y=F*r+D*a+B*i-(w*r+x*a+z*i);C=i*R,U=o*l,P=a*R,L=o*T,F=a*l,w=i*T,g=r*R,v=o*_,x=r*l,D=i*_,B=r*T,z=a*_;var k=C*O+L*y+F*p-(U*O+P*y+w*p),K=U*M+g*y+D*p-(C*M+v*y+x*p),Z=P*M+v*O+B*p-(L*M+g*O+z*p),j=w*M+x*O+z*y-(F*M+D*O+B*y),Q=P*S+w*m+U*A-(F*m+C*A+L*S),J=x*m+C*f+v*S-(g*S+D*m+U*f),$=g*A+z*m+L*f-(B*m+P*f+v*A),tt=B*S+F*f+D*A-(x*A+z*S+w*f),et=r*G+a*b+i*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=G*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=q*et,n[5]=H*et,n[6]=W*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],a=t[2],i=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],l=t[14],R=-n*_-r*T-a*l,f=-i*_-o*T-u*l,A=-E*_-s*T-c*l;return e[0]=n,e[1]=i,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=a,e[9]=u,e[10]=c,e[11]=0,e[12]=R,e[13]=f,e[14]=A,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,i(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,a,i,o,u){"use strict";function E(t,e,r,a){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(a,0)}a(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,a){return e=n(e,0),r(a)||(a=new E),a.west=t[e++],a.south=t[e++],a.east=t[e++],a.north=t[e],a},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,a,i,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=t,o.south=e,o.east=a,o.north=i,o):new E(t,e,a,i)},E.fromRadians=function(t,e,a,i,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(a,0),o.north=n(i,0),o):new E(t,e,a,i)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var l=t[_];n=Math.min(n,l.longitude),a=Math.max(a,l.longitude),s=Math.min(s,l.latitude),c=Math.max(c,l.latitude);var R=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;i=Math.min(i,R),o=Math.max(o,R)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=a,e.north=c,e):new E(n,s,a,c)},E.fromCartesianArray=function(t,e,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,l=t.length;T<l;T++){var R=e.cartesianToCartographic(t[T]);a=Math.min(a,R.longitude),i=Math.max(i,R.longitude),c=Math.min(c,R.latitude),_=Math.max(_,R.latitude);var f=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;o=Math.min(o,f),s=Math.max(s,f)}return i-a>s-o&&(a=o,i=s,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=c,n.east=i,n.north=_,n):new E(a,c,i,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var a=e.east,i=e.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var a=t.east,i=t.west,o=e.east,s=e.west;a<i&&o>0?a+=u.TWO_PI:o<s&&a>0&&(o+=u.TWO_PI),a<i&&s<0?s+=u.TWO_PI:o<s&&i<0&&(i+=u.TWO_PI);var c=u.negativePiToPi(Math.max(i,s)),_=u.negativePiToPi(Math.min(a,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),l=Math.min(t.north,e.north);if(!(T>=l))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=l,n):new E(c,T,_,l)}},E.simpleIntersection=function(t,e,n){var a=Math.max(t.west,e.west),i=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new E(a,i,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var a=t.east,i=t.west,o=e.east,s=e.west;a<i&&o>0?a+=u.TWO_PI:o<s&&a>0&&(o+=u.TWO_PI),a<i&&s<0?s+=u.TWO_PI:o<s&&i<0&&(i+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(i,s)),_=u.convertLongitudeRange(Math.max(a,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,a=t.west,i=t.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,a,o){e=n(e,i.WGS84),a=n(a,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,l=t.east,R=t.west,f=s;f.height=a,f.longitude=R,f.latitude=_,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.latitude=T,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++,_<0?f.latitude=_:T>0?f.latitude=T:f.latitude=0;for(var A=1;A<8;++A)f.longitude=-Math.PI+A*u.PI_OVER_TWO,E.contains(t,f)&&(o[c]=e.cartographicToCartesian(f,o[c]),c++);return 0===f.latitude&&(f.longitude=R,o[c]=e.cartographicToCartesian(f,o[c]),c++,f.longitude=l,o[c]=e.cartographicToCartesian(f,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,a,i,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var l=new t,R=new t,f=new t,A=new t,h=new t,N=new t,d=new t,I=new t,S=new t,m=new t,M=new t,O=new t;T.fromPoints=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),i=t.clone(r,l),o=t.clone(r,R),u=t.clone(r,f),E=t.clone(r,A),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<i.x&&t.clone(r,i),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var P=t.magnitudeSquared(t.subtract(E,i,I)),L=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),w=i,g=E,v=P;L>v&&(v=L,w=o,g=s),F>v&&(v=F,w=u,g=c);var x=S;x.x=.5*(w.x+g.x),x.y=.5*(w.y+g.y),x.z=.5*(w.z+g.z);var D=t.magnitudeSquared(t.subtract(g,x,I)),B=Math.sqrt(D),z=m;z.x=i.x,z.y=o.y,z.z=u.z;var G=M;G.x=E.x,G.y=s.y,G.z=c.z;var b=t.multiplyByScalar(t.add(z,G,I),.5,O),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var q=t.magnitudeSquared(t.subtract(r,x,I));if(q>D){var H=Math.sqrt(q);B=.5*(B+H),D=B*B;var W=H-B;x.x=(B*x.x+W*r.x)/H,x.y=(B*x.y+W*r.y)/H,x.z=(B*x.z+W*r.z)/H}}return B<X?(t.clone(x,n.center),n.radius=B):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,P=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,i,o,u){if(a(u)||(u=new T),!a(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=i,_.northeast(e,P),P.height=o;var E=n.project(U,p),s=n.project(P,C),c=s.x-E.x,l=s.y-E.y,R=s.z-E.z;u.radius=.5*Math.sqrt(c*c+l*l+R*R);var f=u.center;return f.x=E.x+.5*c,f.y=E.y+.5*l,f.z=E.z+.5*R,u};var L=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,i.WGS84),n=r(n,0);var u;return a(t)&&(u=_.subsample(t,e,n,L)),T.fromPoints(u,o)},T.fromVertices=function(e,n,i,o){if(a(o)||(o=new T),!a(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),i=r(i,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,l),s=t.clone(u,R),c=t.clone(u,f),_=t.clone(u,A),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=i){var P=e[U]+n.x,L=e[U+1]+n.y,F=e[U+2]+n.z;u.x=P,u.y=L,u.z=F,P<E.x&&t.clone(u,E),P>_.x&&t.clone(u,_),L<s.y&&t.clone(u,s),L>y.y&&t.clone(u,y),F<c.z&&t.clone(u,c),F>p.z&&t.clone(u,p)}var w=t.magnitudeSquared(t.subtract(_,E,I)),g=t.magnitudeSquared(t.subtract(y,s,I)),v=t.magnitudeSquared(t.subtract(p,c,I)),x=E,D=_,B=w;g>B&&(B=g,x=s,D=y),v>B&&(B=v,x=c,D=p);var z=S;z.x=.5*(x.x+D.x),z.y=.5*(x.y+D.y),z.z=.5*(x.z+D.z);var G=t.magnitudeSquared(t.subtract(D,z,I)),b=Math.sqrt(G),X=m;X.x=E.x,X.y=s.y,X.z=c.z;var V=M;V.x=_.x,V.y=y.y,V.z=p.z;var q=t.multiplyByScalar(t.add(X,V,I),.5,O),H=0;for(U=0;U<C;U+=i){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var W=t.magnitude(t.subtract(u,q,I));W>H&&(H=W);var Y=t.magnitudeSquared(t.subtract(u,z,I));if(Y>G){var k=Math.sqrt(Y);b=.5*(b+k),G=b*b;var K=k-b;z.x=(b*z.x+K*u.x)/k,z.y=(b*z.y+K*u.y)/k,z.z=(b*z.z+K*u.z)/k}}return b<H?(t.clone(z,o.center),o.radius=b):(t.clone(q,o.center),o.radius=H),o},T.fromEncodedCartesianVertices=function(e,n,r){if(a(r)||(r=new T),!a(e)||!a(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var i=d;i.x=e[0]+n[0],i.y=e[1]+n[1],i.z=e[2]+n[2];for(var o=t.clone(i,l),u=t.clone(i,R),E=t.clone(i,f),s=t.clone(i,A),c=t.clone(i,h),_=t.clone(i,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],P=e[p+2]+n[p+2];i.x=C,i.y=U,i.z=P,C<o.x&&t.clone(i,o),C>s.x&&t.clone(i,s),U<u.y&&t.clone(i,u),U>c.y&&t.clone(i,c),P<E.z&&t.clone(i,E),P>_.z&&t.clone(i,_)}var L=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),w=t.magnitudeSquared(t.subtract(_,E,I)),g=o,v=s,x=L;F>x&&(x=F,g=u,v=c),w>x&&(x=w,g=E,v=_);var D=S;D.x=.5*(g.x+v.x),D.y=.5*(g.y+v.y),D.z=.5*(g.z+v.z);var B=t.magnitudeSquared(t.subtract(v,D,I)),z=Math.sqrt(B),G=m;G.x=o.x,G.y=u.y,G.z=E.z;var b=M;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(G,b,I),.5,O),V=0;for(p=0;p<y;p+=3){i.x=e[p]+n[p],i.y=e[p+1]+n[p+1],i.z=e[p+2]+n[p+2];var q=t.magnitude(t.subtract(i,X,I));q>V&&(V=q);var H=t.magnitudeSquared(t.subtract(i,D,I));if(H>B){var W=Math.sqrt(H);z=.5*(z+W),B=z*z;var Y=W-z;D.x=(z*D.x+Y*i.x)/W,D.y=(z*D.y+Y*i.y)/W,D.z=(z*D.z+Y*i.z)/W}}return z<V?(t.clone(D,r.center),r.radius=z):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){a(r)||(r=new T);var i=r.center;return t.add(e,n,i),t.multiplyByScalar(i,.5,i),r.radius=t.distance(i,n),r},T.fromEllipsoid=function(e,n){return a(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var F=new t;T.fromBoundingSpheres=function(e,n){if(a(n)||(n=new T),!a(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var i=[],o=0;o<r;o++)i.push(e[o].center);n=T.fromPoints(i,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var w=new t,g=new t,v=new t;T.fromOrientedBoundingBox=function(e,n){a(n)||(n=new T);var r=e.halfAxes,i=s.getColumn(r,0,w),o=s.getColumn(r,1,g),u=s.getColumn(r,2,v);return t.add(i,o,i),t.add(i,u,i),n.center=t.clone(e.center,n.center),n.radius=t.magnitude(i),n},T.clone=function(e,n){if(a(e))return a(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var a=t.center;return e[n++]=a.x,e[n++]=a.y,e[n++]=a.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),a(n)||(n=new T);var i=n.center;return i.x=t[e++],i.y=t[e++],i.z=t[e++],n.radius=t[e],n};var x=new t,D=new t;T.union=function(e,n,r){a(r)||(r=new T);var i=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,i,x),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),l=t.multiplyByScalar(s,(-o+_)/c,D);return t.add(l,i,l),t.clone(l,r.center),r.radius=_,r};var B=new t;T.expand=function(e,n,r){r=T.clone(e,r);var a=t.magnitude(t.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},T.intersectPlane=function(e,n){var r=e.center,a=e.radius,i=n.normal,o=t.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var z=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,z);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return a(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var G=new t;T.computePlaneDistances=function(e,n,r,i){a(i)||(i=new E);var o=t.subtract(e.center,n,G),u=t.dot(r,o);return i.start=u-e.radius,i.stop=u+e.radius,i};for(var b=new t,X=new t,V=new t,q=new t,H=new t,W=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,a){n=r(n,K);var i=n.ellipsoid,o=e.center,u=e.radius,E=i.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,H),l=t.negate(s,q),R=Y,f=R[0];t.add(E,c,f),t.add(f,s,f),f=R[1],t.add(E,c,f),t.add(f,l,f),f=R[2],t.add(E,_,f),t.add(f,l,f),f=R[3],t.add(E,_,f),t.add(f,s,f),t.negate(E,E),f=R[4],t.add(E,c,f),t.add(f,s,f),f=R[5],t.add(E,c,f),t.add(f,l,f),f=R[6],t.add(E,_,f),t.add(f,l,f),f=R[7],t.add(E,_,f),t.add(f,s,f);for(var A=R.length,h=0;h<A;++h){var N=R[h];t.add(o,N,N);var d=i.cartesianToCartographic(N,W);n.project(d,N)}a=T.fromPoints(R,a),o=a.center;var I=o.x,S=o.y,m=o.z;return o.x=m,o.y=I,o.z=S,a},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||a(e)&&a(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,a,i){"use strict";function o(t,n){this.x=e(t,0),this.y=e(n,0)}o.fromElements=function(t,e,r){return n(r)?(r.x=t,r.y=e,r):new o(t,e)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e):new o(t.x,t.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r]=t.y,n},o.unpack=function(t,r,a){return r=e(r,0),n(a)||(a=new o),a.x=t[r++],a.y=t[r],a},o.packArray=function(t,e){var r=t.length;n(e)?e.length=2*r:e=new Array(2*r);for(var a=0;a<r;++a)o.pack(t[a],e,2*a);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/2:e=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;e[i]=o.unpack(t,a,e[i])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y)},o.minimumComponent=function(t){return Math.min(t.x,t.y)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){return o.normalize(t,s),o.normalize(e,c),i.acosClamped(o.dot(s,c))};var _=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Y,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]},o.equalsEpsilon=function(t,e,r,a){return t===e||n(t)&&n(e)&&i.equalsEpsilon(t.x,e.x,r,a)&&i.equalsEpsilon(t.y,e.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return e(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{ +get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var E=i[o];a=E+"RequestFullscreen","function"==typeof e[a]?(r.requestFullscreen=a,n=!0):(a=E+"RequestFullScreen","function"==typeof e[a]&&(r.requestFullscreen=a,n=!0)),a=E+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=E+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=E+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=E+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=E+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=E+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=E+"fullscreenchange",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=E+"fullscreenerror",void 0!==document["on"+a]&&("ms"===E&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(t,e){a.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function a(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,m=r(t[1]))}return S}function i(){return a()&&m}function o(){if(!e(M)&&(M=!1,!a()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(M=!0,O=r(t[1]))}return M}function u(){return o()&&O}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(P)){P=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,L=r(t[1]))}return P}function l(){return T()&&L}function R(){if(!e(F)){F=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(F=!0,w=r(t[1]))}return F}function f(){return e(g)||(g=/Windows/i.test(I.appVersion)),g}function A(){return R()&&w}function h(){return e(v)||(v="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),v}function N(){if(!e(D)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;D=e(n)&&""!==n,D&&(x=n)}return D}function d(){return N()?x:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,m,M,O,y,p,C,U,P,L,F,w,g,v,x,D,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:l,isFirefox:R,firefoxVersion:A,isWindows:f,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,a){switch(r=t(r,0),a=t(a,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,a){"use strict";function i(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,a.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return i.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var a=t.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(t){switch(t){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(e){return t(e)&&(e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT)},i.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},i.createTypedArrayFromArrayBuffer=function(t,e,n,a){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,a):new Uint16Array(e,n,a)},n(i)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(t,e,n,r){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.position=t(e.position,!1),this.normal=t(e.normal,!1),this.st=t(e.st,!1),this.bitangent=t(e.bitangent,!1),this.tangent=t(e.tangent,!1),this.color=t(e.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(e,n,r){return r=t(r,0),n[r++]=e.position?1:0,n[r++]=e.normal?1:0,n[r++]=e.st?1:0,n[r++]=e.tangent?1:0,n[r++]=e.bitangent?1:0,n[r++]=e.color?1:0,n},a.unpack=function(n,r,i){return r=t(r,0),e(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(t,n){if(e(t))return e(n)||(n=new a),n.position=t.position,n.normal=t.normal,n.st=t.st,n.tangent=t.tangent,n.bitangent=t.bitangent,n.color=t.color,n},a}),define("Core/EllipsoidGeometry",["./BoundingSphere","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat"],function(t,e,n,r,a,i,o,u,E,s,c,_,T,l,R){"use strict";function f(t){t=a(t,a.EMPTY_OBJECT);var e=a(t.radii,S),r=Math.round(a(t.stackPartitions,64)),i=Math.round(a(t.slicePartitions,64)),o=a(t.vertexFormat,R.DEFAULT);this._radii=n.clone(e),this._stackPartitions=r,this._slicePartitions=i,this._vertexFormat=R.clone(o),this._workerName="createEllipsoidGeometry"}var A=new n,h=new n,N=new n,d=new n,I=new n,S=new n(1,1,1),m=Math.cos,M=Math.sin;f.packedLength=n.packedLength+R.packedLength+2,f.pack=function(t,e,r){return r=a(r,0),n.pack(t._radii,e,r),r+=n.packedLength,R.pack(t._vertexFormat,e,r),r+=R.packedLength,e[r++]=t._stackPartitions,e[r]=t._slicePartitions,e};var O=new n,y=new R,p={radii:O,vertexFormat:y,stackPartitions:void 0,slicePartitions:void 0};return f.unpack=function(t,e,r){e=a(e,0);var o=n.unpack(t,e,O);e+=n.packedLength;var u=R.unpack(t,e,y);e+=R.packedLength;var E=t[e++],s=t[e];return i(r)?(r._radii=n.clone(o,r._radii),r._vertexFormat=R.clone(u,r._vertexFormat),r._stackPartitions=E,r._slicePartitions=s,r):(p.stackPartitions=E,p.slicePartitions=s,new f(p))},f.createGeometry=function(a){var i=a._radii;if(!(i.x<=0||i.y<=0||i.z<=0)){var o,R,f=u.fromCartesian3(i),S=a._vertexFormat,O=a._slicePartitions+1,y=a._stackPartitions+1,p=y*O,C=new Float64Array(3*p),U=6*(O-1)*(y-2),P=_.createTypedArray(p,U),L=S.normal?new Float32Array(3*p):void 0,F=S.tangent?new Float32Array(3*p):void 0,w=S.bitangent?new Float32Array(3*p):void 0,g=S.st?new Float32Array(2*p):void 0,v=new Array(O),x=new Array(O),D=0;for(o=0;o<O;o++){var B=T.TWO_PI*o/(O-1);v[o]=m(B),x[o]=M(B),C[D++]=0,C[D++]=0,C[D++]=i.z}for(o=1;o<y-1;o++){var z=Math.PI*o/(y-1),G=M(z),b=i.x*G,X=i.y*G,V=i.z*m(z);for(R=0;R<O;R++)C[D++]=v[R]*b,C[D++]=x[R]*X,C[D++]=V}for(o=0;o<O;o++)C[D++]=0,C[D++]=0,C[D++]=-i.z;var q=new c;S.position&&(q.position=new s({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:C}));var H=0,W=0,Y=0,k=0;if(S.st||S.normal||S.tangent||S.bitangent){for(o=0;o<p;o++){var K=n.fromArray(C,3*o,A),Z=f.geodeticSurfaceNormal(K,h);if(S.st){var j=e.negate(Z,I);e.magnitude(j)<T.EPSILON6&&(D=3*(o+O*Math.floor(.5*y)),D>C.length&&(D=3*(o-O*Math.floor(.5*y))),n.fromArray(C,D,j),f.geodeticSurfaceNormal(j,j),e.negate(j,j)),g[H++]=Math.atan2(j.y,j.x)/T.TWO_PI+.5,g[H++]=Math.asin(Z.z)/Math.PI+.5}if(S.normal&&(L[W++]=Z.x,L[W++]=Z.y,L[W++]=Z.z),S.tangent||S.bitangent){var Q=N;if(o<O||o>p-O-1?(n.cross(n.UNIT_X,Z,Q),n.normalize(Q,Q)):(n.cross(n.UNIT_Z,Z,Q),n.normalize(Q,Q)),S.tangent&&(F[Y++]=Q.x,F[Y++]=Q.y,F[Y++]=Q.z),S.bitangent){var J=n.cross(Z,Q,d);n.normalize(J,J),w[k++]=J.x,w[k++]=J.y,w[k++]=J.z}}}S.st&&(q.st=new s({componentDatatype:r.FLOAT,componentsPerAttribute:2,values:g})),S.normal&&(q.normal=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:L})),S.tangent&&(q.tangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:F})),S.bitangent&&(q.bitangent=new s({componentDatatype:r.FLOAT,componentsPerAttribute:3,values:w}))}for(D=0,R=0;R<O-1;R++)P[D++]=O+R,P[D++]=O+R+1,P[D++]=R+1;var $,tt;for(o=1;o<y-2;o++)for($=o*O,tt=(o+1)*O,R=0;R<O-1;R++)P[D++]=tt+R,P[D++]=tt+R+1,P[D++]=$+R+1,P[D++]=tt+R,P[D++]=$+R+1,P[D++]=$+R;for(o=y-2,$=o*O,tt=(o+1)*O,R=0;R<O-1;R++)P[D++]=tt+R,P[D++]=$+R+1,P[D++]=$+R;return new E({attributes:q,indices:P,primitiveType:l.TRIANGLES,boundingSphere:t.fromEllipsoid(f)})}},f}),define("Core/SphereGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidGeometry","./VertexFormat"],function(t,e,n,r,a,i){"use strict";function o(e){var r=n(e.radius,1),i=new t(r,r,r),o={radii:i,stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new a(o),this._workerName="createSphereGeometry"}o.packedLength=a.packedLength,o.pack=function(t,e,n){return a.pack(t._ellipsoidGeometry,e,n)};var u=new a,E={radius:void 0,radii:new t,vertexFormat:new i,stackPartitions:void 0,slicePartitions:void 0};return o.unpack=function(e,n,s){var c=a.unpack(e,n,u);return E.vertexFormat=i.clone(c._vertexFormat,E.vertexFormat),E.stackPartitions=c._stackPartitions,E.slicePartitions=c._slicePartitions,r(s)?(t.clone(c._radii,E.radii),s._ellipsoidGeometry=new a(E),s):(E.radius=c._radii.x,new o(E))},o.createGeometry=function(t){return a.createGeometry(t._ellipsoidGeometry)},o}),define("Workers/createSphereGeometry",["../Core/defined","../Core/SphereGeometry"],function(t,e){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createSphereOutlineGeometry.js b/engines/Cesium/Workers/createSphereOutlineGeometry.js index d94552d..70e9028 100644 --- a/engines/Cesium/Workers/createSphereOutlineGeometry.js +++ b/engines/Cesium/Workers/createSphereOutlineGeometry.js @@ -55,6 +55,6 @@ mersenne-twister.js - https://gist.github.com/banksean/300494 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(r,i){if(!e(i))throw new t(n(r))},i.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},i.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},i.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},i.typeOf.number.lessThan=function(e,n,r){if(i.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(e,n,r){if(i.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(e,n,r){if(i.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},i.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(e){return e>0?1:e<0?-1:0},i.signNotZero=function(e){return e<0?-1:1},i.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*i.clamp(e,-1,1)+.5)*n)},i.fromSNorm=function(e,n){return n=t(n,255),i.clamp(e,0,n)/n*2-1},i.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},i.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},i.lerp=function(e,t,n){return(1-n)*e+n*t},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(e){return e*i.RADIANS_PER_DEGREE},i.toDegrees=function(e){return e*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(e){var t=i.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},i.clampToLatitudeRange=function(e){return i.clamp(e,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(e){return i.zeroToTwoPi(e+i.PI)-i.PI},i.zeroToTwoPi=function(e){var t=i.mod(e,i.TWO_PI);return Math.abs(t)<i.EPSILON14&&Math.abs(e)>i.EPSILON14?i.TWO_PI:t},i.mod=function(e,t){return(e%t+t)%t},i.equalsEpsilon=function(e,n,r,i){i=t(i,r);var a=Math.abs(e-n);return a<=i||a<=r*Math.max(Math.abs(e),Math.abs(n))};var a=[1];i.factorial=function(e){var t=a.length;if(e>=t)for(var n=a[t-1],r=t;r<=e;r++)a.push(n*r);return a[e]},i.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},i.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},i.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},i.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return i.setRandomNumberSeed=function(t){o=new e(t)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(e){return Math.acos(i.clamp(e,-1,1))},i.asinClamped=function(e){return Math.asin(i.clamp(e,-1,1))},i.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},i.logBase=function(e,t){return Math.log(e)/Math.log(t)},i.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var i=e.clock,a=e.cone,u=t(e.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(e,t,r,i){return n(i)?(i.x=e,i.y=t,i.z=r,i):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var i=0;i<r;++i)o.pack(e[i],t,3*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(e,t){o.normalize(e,s),o.normalize(t,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,_);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)},o.cross=function(e,t,n){var r=e.x,i=e.y,a=e.z,o=t.x,u=t.y,E=t.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(e,t,n,r,i){return e=a.toRadians(e),t=a.toRadians(t),o.fromRadians(e,t,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,i,a,u){i=t(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(e),T.y=s*Math.sin(e),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,t,r[s])}return r},o.fromRadiansArray=function(e,t,r){var i=e.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=e[a],E=e[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,t,r[s])}return r},o.fromDegreesArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,t,r[c])}return r},o.fromRadiansArrayHeights=function(e,t,r){var i=e.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=e[a],E=e[a+1],s=e[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,t,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),S=e.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?e.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,P,L,F,v,w,D,B,g,x=(1-I)*e.magnitude(n)/(.5*e.magnitude(y)),G=0;do{x-=G,U=1/(1+x*M),P=1/(1+x*O),L=1/(1+x*m),F=U*U,v=P*P,w=L*L,D=F*U,B=v*P,g=w*L,p=f*F+h*v+N*w-1,C=f*D*M+h*B*O+N*g*m;var z=-2*C;G=p/z}while(Math.abs(p)>r.EPSILON12);return t(s)?(s.x=c*U,s.y=_*P,s.z=T*L,s):new e(c*U,_*P,T*L)}var a=new e,o=new e;return i}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,i,a){return i=t(i,0),n(a)?(a.longitude=e,a.latitude=r,a.height=i,a):new u(e,r,i)},u.fromDegrees=function(e,t,n,r){return e=a.toRadians(e),t=a.toRadians(t),u.fromRadians(e,t,n,r)};var E=new e,s=new e,c=new e,_=new e(1/6378137,1/6378137,1/6356752.314245179),T=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(t,r,i){var l=n(r)?r.oneOverRadii:_,A=n(r)?r.oneOverRadiiSquared:T,f=n(r)?r._centerToleranceSquared:R,h=o(t,l,A,f,s);if(n(h)){var N=e.multiplyComponents(h,A,E);N=e.normalize(N,N);var d=e.subtract(t,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(e.dot(d,t))*e.magnitude(d);return n(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,i,a,o,u,E){"use strict";function s(t,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),t._radii=new e(r,i,a),t._radiiSquared=new e(r*r,i*i,a*a),t._radiiToTheFourth=new e(r*r*r*r,i*i*i*i,a*a*a*a),t._oneOverRadii=new e(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),t._minimumRadius=Math.min(r,i,a),t._maximumRadius=Math.max(r,i,a),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function c(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,e,t,n)}i(c.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}}}),c.clone=function(t,n){if(r(t)){var i=t._radii;return r(n)?(e.clone(i,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(e,t){return r(t)||(t=new c),r(e)?(s(t,e.x,e.y,e.z),t):t},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(e){return c.clone(this,e)},c.packedLength=e.packedLength,c.pack=function(t,r,i){return i=n(i,0),e.pack(t._radii,r,i),r},c.unpack=function(t,r,i){r=n(r,0);var a=e.unpack(t,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=e.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(t,n){var i=t.longitude,a=t.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new e),n.x=u,n.y=E,n.z=s,e.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var _=new e,T=new e;c.prototype.cartographicToCartesian=function(t,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(t,i),e.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(e.dot(i,a));return e.divideByScalar(a,o,a),e.multiplyByScalar(i,t.height,i),r(n)||(n=new e),e.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var R=new e,l=new e,A=new e;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=e.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(e.dot(E,n))*e.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new t(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t},c.prototype.scaleToGeodeticSurface=function(e,t){return E(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},c.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var i=t.x,a=t.y,o=t.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return e.multiplyByScalar(t,E,n)},c.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},c.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new e),a.x=0,a.y=0,a.z=t.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,i,a,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var i=this._semimajorAxis,a=t.longitude*i,o=t.latitude*i,u=t.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new e(a,o,u)},u.prototype.unproject=function(e,n){var i=this._oneOverSemimajorAxis,a=e.x*i,o=e.y*i,u=e.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new t(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,t,r,i,a,o,u,E,s){this[0]=n(e,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function c(e){for(var t=0,n=0;n<3;++n){var r=e[E.getElementIndex(A[n],l[n])];t+=2*r*r}return Math.sqrt(t)}function _(e,t){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(e[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(e[E.getElementIndex(T,_)])>n){var R,f=e[E.getElementIndex(T,T)],h=e[E.getElementIndex(_,_)],N=e[E.getElementIndex(T,_)],d=(f-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return t=E.clone(E.IDENTITY,t),t[E.getElementIndex(_,_)]=t[E.getElementIndex(T,T)]=s,t[E.getElementIndex(T,_)]=c,t[E.getElementIndex(_,T)]=-c,t}E.packedLength=9,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t++],i[1]=e[t++],i[2]=e[t++],i[3]=e[t++],i[4]=e[t++],i[5]=e[t++],i[6]=e[t++],i[7]=e[t++],i[8]=e[t++],i},E.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new E(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},E.fromArray=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i[0]=e[t],i[1]=e[t+1],i[2]=e[t+2],i[3]=e[t+3],i[4]=e[t+4],i[5]=e[t+5],i[6]=e[t+6],i[7]=e[t+7],i[8]=e[t+8],i},E.fromColumnMajorArray=function(e,t){return E.clone(e,t)},E.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new E(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},E.fromQuaternion=function(e,t){var n=e.x*e.x,i=e.x*e.y,a=e.x*e.z,o=e.x*e.w,u=e.y*e.y,s=e.y*e.z,c=e.y*e.w,_=e.z*e.z,T=e.z*e.w,R=e.w*e.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(t)?(t[0]=l,t[1]=h,t[2]=I,t[3]=A,t[4]=N,t[5]=S,t[6]=f,t[7]=d,t[8]=M,t):new E(l,A,f,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),i=Math.cos(-e.heading),a=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),s=Math.sin(e.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-o*a+a*o*u,f=-o,h=s*n,N=a*n;return r(t)?(t[0]=c,t[1]=R,t[2]=f,t[3]=_,t[4]=l,t[5]=h,t[6]=T,t[7]=A,t[8]=N,t):new E(c,_,T,R,l,A,f,h,N)},E.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new E(e.x,0,0,0,e.y,0,0,0,e.z)},E.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new E(e,0,0,0,e,0,0,0,e)},E.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new E(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},E.fromRotationX=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(e,t){var n=Math.cos(e),i=Math.sin(e);return r(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},E.getElementIndex=function(e,t){return 3*e+t},E.getColumn=function(e,t,n){var r=3*t,i=e[r],a=e[r+1],o=e[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(e,t,n,r){r=E.clone(e,r);var i=3*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(e,t,n){var r=e[t],i=e[t+3],a=e[t+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(e,t,n,r){return r=E.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var T=new e;E.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],T)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],T)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],T)),n};var R=new e;E.getMaximumScale=function(t){return E.getScale(t,R),e.maximumComponent(R)},E.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],i=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],a=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],E=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],s=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],c=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],_=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},E.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},E.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[3]*i+e[6]*a,u=e[1]*r+e[4]*i+e[7]*a,E=e[2]*r+e[5]*i+e[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},E.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},E.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},E.transpose=function(e,t){var n=e[0],r=e[3],i=e[6],a=e[1],o=e[4],u=e[7],E=e[2],s=e[5],c=e[8];return t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=u,t[6]=E,t[7]=s,t[8]=c,t};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,i=10,a=0,o=0;r(t)||(t={});for(var T=t.unitary=E.clone(E.IDENTITY,t.unitary),R=t.diagonal=E.clone(e,t.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return t},E.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},E.determinant=function(e){var t=e[0],n=e[3],r=e[6],i=e[1],a=e[4],o=e[7],u=e[2],E=e[5],s=e[8];return t*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],u=e[5],s=e[6],c=e[7],_=e[8],T=E.determinant(e);t[0]=o*_-c*u,t[1]=c*i-r*_,t[2]=r*u-o*i,t[3]=s*u-a*_,t[4]=n*_-s*i,t[5]=a*i-n*u,t[6]=a*c-s*o,t[7]=s*r-n*c,t[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(t,R,t)},E.equals=function(e,t){return e===t||r(e)&&r(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]},E.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},E.prototype.equalsEpsilon=function(e,t){return E.equalsEpsilon(this,e,t)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,i,a){"use strict";function o(e,n,r,i){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(i,0)}o.fromElements=function(e,t,r,i,a){return n(a)?(a.x=e,a.y=t,a.z=r,a.w=i,a):new o(e,t,r,i)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,i){return r=t(r,0),n(i)||(i=new o),i.x=e[r++],i.y=e[r++],i.z=e[r++],i.w=e[r],i},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var i=0;i<r;++i)o.pack(e[i],t,4*i);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;t[a]=o.unpack(e,i,t[a])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var E=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,E),r=o.multiplyByScalar(e,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,s);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,i){return e===t||n(e)&&n(t)&&a.equalsEpsilon(e.x,t.x,r,i)&&a.equalsEpsilon(e.y,t.y,r,i)&&a.equalsEpsilon(e.z,t.z,r,i)&&a.equalsEpsilon(e.w,t.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,i,a,o,u,E,s){ -"use strict";function c(e,t,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(e,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}c.packedLength=16,c.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},c.unpack=function(e,t,n){return t=r(t,0),i(n)||(n=new c),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},c.clone=function(e,t){if(i(e))return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new c(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(e,t){return c.clone(e,t)},c.fromRowMajorArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new c(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},c.fromRotationTranslation=function(t,n,a){return n=r(n,e.ZERO),i(a)?(a[0]=t[0],a[1]=t[1],a[2]=t[2],a[3]=0,a[4]=t[3],a[5]=t[4],a[6]=t[5],a[7]=0,a[8]=t[6],a[9]=t[7],a[10]=t[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(e,t,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,E=t.x*t.x,s=t.x*t.y,_=t.x*t.z,T=t.x*t.w,R=t.y*t.y,l=t.y*t.z,A=t.y*t.w,f=t.z*t.z,h=t.z*t.w,N=t.w*t.w,d=E-R-f+N,I=2*(s-h),S=2*(_+A),M=2*(s+h),O=-E+R-f+N,m=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},c.fromTranslationRotationScale=function(e,t){return c.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},c.fromTranslation=function(e,t){return c.fromRotationTranslation(E.IDENTITY,e,t)},c.fromScale=function(e,t){return i(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},c.fromUniformScale=function(e,t){return i(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new c(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var _=new e,T=new e,R=new e;c.fromCamera=function(t,n){var r=t.position,a=t.direction,o=t.up;e.normalize(a,_),e.normalize(e.cross(_,o,T),T),e.normalize(e.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=l*I+A*S+f*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,d,m,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(e,t,n,r,i){var a=Math.tan(.5*e),o=1/a,u=o/t,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(e,t,n,r,i,a,o){var u=1/(t-e),E=1/(r-n),s=1/(a-i),c=-(t+e)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(e,t,n,r,i,a,o){var u=2*i/(t-e),E=2*i/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(e,t,n,r,i,a){var o=2*i/(t-e),u=2*i/(r-n),E=(t+e)/(t-e),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(e,t,n,i){e=r(e,r.EMPTY_OBJECT);var a=r(e.x,0),o=r(e.y,0),u=r(e.width,0),E=r(e.height,0);t=r(t,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-t),T=s,R=c,l=_,A=a+s,f=o+c,h=t+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},c.computeView=function(t,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-e.dot(i,t),a[13]=-e.dot(r,t),a[14]=e.dot(n,t),a[15]=1,a},c.toArray=function(e,t){return i(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},c.getElementIndex=function(e,t){return 4*e+t},c.getColumn=function(e,t,n){var r=4*t,i=e[r],a=e[r+1],o=e[r+2],u=e[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(e,t,n,r){r=c.clone(e,r);var i=4*t;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},c.getRow=function(e,t,n){var r=e[t],i=e[t+4],a=e[t+8],o=e[t+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(e,t,n,r){return r=c.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var l=new e;c.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],l)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],l)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],l)),n};var A=new e;c.getMaximumScale=function(t){return c.getScale(t,A),e.maximumComponent(A)},c.multiply=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[3],u=e[4],E=e[5],s=e[6],c=e[7],_=e[8],T=e[9],R=e[10],l=e[11],A=e[12],f=e[13],h=e[14],N=e[15],d=t[0],I=t[1],S=t[2],M=t[3],O=t[4],m=t[5],y=t[6],p=t[7],C=t[8],U=t[9],P=t[10],L=t[11],F=t[12],v=t[13],w=t[14],D=t[15],B=r*d+u*I+_*S+A*M,g=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+h*M,G=o*d+c*I+l*S+N*M,z=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,H=r*C+u*U+_*P+A*L,W=i*C+E*U+T*P+f*L,q=a*C+s*U+R*P+h*L,Y=o*C+c*U+l*P+N*L,k=r*F+u*v+_*w+A*D,K=i*F+E*v+T*w+f*D,Z=a*F+s*v+R*w+h*D,j=o*F+c*v+l*w+N*D;return n[0]=B,n[1]=g,n[2]=x,n[3]=G,n[4]=z,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=W,n[10]=q,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},c.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},c.multiplyTransformation=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=e[12],R=e[13],l=e[14],A=t[0],f=t[1],h=t[2],N=t[4],d=t[5],I=t[6],S=t[8],M=t[9],O=t[10],m=t[12],y=t[13],p=t[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,P=a*A+E*f+_*h,L=r*N+o*d+s*I,F=i*N+u*d+c*I,v=a*N+E*d+_*I,w=r*S+o*M+s*O,D=i*S+u*M+c*O,B=a*S+E*M+_*O,g=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,G=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=P,n[3]=0,n[4]=L,n[5]=F,n[6]=v,n[7]=0,n[8]=w,n[9]=D,n[10]=B,n[11]=0,n[12]=g,n[13]=x,n[14]=G,n[15]=1,n},c.multiplyByMatrix3=function(e,t,n){var r=e[0],i=e[1],a=e[2],o=e[4],u=e[5],E=e[6],s=e[8],c=e[9],_=e[10],T=t[0],R=t[1],l=t[2],A=t[3],f=t[4],h=t[5],N=t[6],d=t[7],I=t[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,P=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=P,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},c.multiplyByTranslation=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=r*e[0]+i*e[4]+a*e[8]+e[12],u=r*e[1]+i*e[5]+a*e[9]+e[13],E=r*e[2]+i*e[6]+a*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=E,n[15]=e[15],n};var f=new e;c.multiplyByUniformScale=function(e,t,n){return f.x=t,f.y=t,f.z=t,c.multiplyByScale(e,f,n)},c.multiplyByScale=function(e,t,n){var r=t.x,i=t.y,a=t.z;return 1===r&&1===i&&1===a?c.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=i*e[4],n[5]=i*e[5],n[6]=i*e[6],n[7]=0,n[8]=a*e[8],n[9]=a*e[9],n[10]=a*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},c.multiplyByVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=t.w,u=e[0]*r+e[4]*i+e[8]*a+e[12]*o,E=e[1]*r+e[5]*i+e[9]*a+e[13]*o,s=e[2]*r+e[6]*i+e[10]*a+e[14]*o,c=e[3]*r+e[7]*i+e[11]*a+e[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a,u=e[1]*r+e[5]*i+e[9]*a,E=e[2]*r+e[6]*i+e[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(e,t,n){var r=t.x,i=t.y,a=t.z,o=e[0]*r+e[4]*i+e[8]*a+e[12],u=e[1]*r+e[5]*i+e[9]*a+e[13],E=e[2]*r+e[6]*i+e[10]*a+e[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},c.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},c.transpose=function(e,t){var n=e[1],r=e[2],i=e[3],a=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=a,t[10]=e[10],t[11]=e[14],t[12]=i,t[13]=o,t[14]=u,t[15]=e[15],t},c.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},c.equals=function(e,t){return e===t||i(e)&&i(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},c.equalsEpsilon=function(e,t,n){return e===t||i(e)&&i(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},c.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},c.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var h=new E,N=new E,d=new t,I=new t(0,0,0,1);return c.inverse=function(e,n){if(E.equalsEpsilon(c.getRotation(e,h),N,u.EPSILON7)&&t.equals(c.getRow(e,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],i=e[4],a=e[8],o=e[12],_=e[1],T=e[5],R=e[9],l=e[13],A=e[2],f=e[6],S=e[10],M=e[14],O=e[3],m=e[7],y=e[11],p=e[15],C=S*p,U=M*y,P=f*p,L=M*m,F=f*y,v=S*m,w=A*p,D=M*O,B=A*y,g=S*O,x=A*m,G=f*O,z=C*T+L*R+F*l-(U*T+P*R+v*l),b=U*_+w*R+g*l-(C*_+D*R+B*l),X=P*_+D*T+x*l-(L*_+w*T+G*l),V=v*_+B*T+G*R-(F*_+g*T+x*R),H=U*i+P*a+v*o-(C*i+L*a+F*o),W=C*r+D*a+B*o-(U*r+w*a+g*o),q=L*r+w*i+G*o-(P*r+D*i+x*o),Y=F*r+g*i+x*a-(v*r+B*i+G*a);C=a*l,U=o*R,P=i*l,L=o*T,F=i*R,v=a*T,w=r*l,D=o*_,B=r*R,g=a*_,x=r*T,G=i*_;var k=C*m+L*y+F*p-(U*m+P*y+v*p),K=U*O+w*y+g*p-(C*O+D*y+B*p),Z=P*O+D*m+x*p-(L*O+w*m+G*p),j=v*O+B*m+G*y-(F*O+g*m+x*y),Q=P*S+v*M+U*f-(F*M+C*f+L*S),J=B*M+C*A+D*S-(w*S+g*M+U*A),$=w*f+G*M+L*A-(x*M+P*A+D*f),ee=x*S+F*A+g*f-(B*f+G*S+v*A),te=r*z+i*b+a*X+o*V;if(Math.abs(te)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=z*te,n[1]=b*te,n[2]=X*te,n[3]=V*te,n[4]=H*te,n[5]=W*te,n[6]=q*te,n[7]=Y*te,n[8]=k*te,n[9]=K*te,n[10]=Z*te,n[11]=j*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},c.inverseTransformation=function(e,t){var n=e[0],r=e[1],i=e[2],a=e[4],o=e[5],u=e[6],E=e[8],s=e[9],c=e[10],_=e[12],T=e[13],R=e[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return t[0]=n,t[1]=a,t[2]=E,t[3]=0,t[4]=r,t[5]=o,t[6]=s,t[7]=0,t[8]=i,t[9]=u,t[10]=c,t[11]=0,t[12]=l,t[13]=A,t[14]=f,t[15]=1,t},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(e){return c.clone(this,e)},c.prototype.equals=function(e){return c.equals(this,e)},c.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},c.prototype.equalsEpsilon=function(e,t){return c.equalsEpsilon(this,e,t)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,i,a,o,u){"use strict";function E(e,t,r,i){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},E.unpack=function(e,t,i){return t=n(t,0),r(i)||(i=new E),i.west=e[t++],i.south=e[t++],i.east=e[t++],i.north=e[t],i},E.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},E.computeHeight=function(e){return e.north-e.south},E.fromDegrees=function(e,t,i,a,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=e,o.south=t,o.east=i,o.north=a,o):new E(e,t,i,a)},E.fromRadians=function(e,t,i,a,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(i,0),o.north=n(a,0),o):new E(e,t,i,a)},E.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=e.length;_<T;_++){var R=e[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=s,t.east=i,t.north=c,t):new E(n,s,i,c)},E.fromCartesianArray=function(e,t,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=e.length;T<R;T++){var l=t.cartesianToCartographic(e[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new E(e.west,e.south,e.east,e.north)},E.prototype.clone=function(e){return E.clone(this,e)},E.prototype.equals=function(e){return E.equals(this,e)},E.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},E.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},E.validate=function(e){},E.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},E.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},E.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},E.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},E.center=function(t,n){var i=t.east,a=t.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new e(o,E)},E.intersection=function(e,t,n){var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((e.west<e.east||t.west<t.east)&&_<=c)){var T=Math.max(e.south,t.south),R=Math.min(e.north,t.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(e,t,n){var i=Math.max(e.west,t.west),a=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(e,t,n){r(n)||(n=new E);var i=e.east,a=e.west,o=t.east,s=t.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(e.south,t.south),n.east=_,n.north=Math.max(e.north,t.north),n},E.expand=function(e,t,n){return r(n)||(n=new E),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},E.contains=function(e,t){var n=t.longitude,r=t.latitude,i=e.west,a=e.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=e.south&&r<=e.north};var s=new e;return E.subsample=function(e,t,i,o){t=n(t,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=e.north,T=e.south,R=e.east,l=e.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=t.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(e,A)&&(o[c]=t.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=t.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=t.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,i,a,o,u,E,s,c,_){"use strict";function T(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var R=new e,l=new e,A=new e,f=new e,h=new e,N=new e,d=new e,I=new e,S=new e,M=new e,O=new e,m=new e;T.fromPoints=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],d),a=e.clone(r,R),o=e.clone(r,l),u=e.clone(r,A),E=e.clone(r,f),s=e.clone(r,h),c=e.clone(r,N),_=t.length,y=1;y<_;y++){e.clone(t[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&e.clone(r,a),p>E.x&&e.clone(r,E),C<o.y&&e.clone(r,o),C>s.y&&e.clone(r,s),U<u.z&&e.clone(r,u),U>c.z&&e.clone(r,c)}var P=e.magnitudeSquared(e.subtract(E,a,I)),L=e.magnitudeSquared(e.subtract(s,o,I)),F=e.magnitudeSquared(e.subtract(c,u,I)),v=a,w=E,D=P;L>D&&(D=L,v=o,w=s),F>D&&(D=F,v=u,w=c);var B=S;B.x=.5*(v.x+w.x),B.y=.5*(v.y+w.y),B.z=.5*(v.z+w.z);var g=e.magnitudeSquared(e.subtract(w,B,I)),x=Math.sqrt(g),G=M;G.x=a.x,G.y=o.y,G.z=u.z;var z=O;z.x=E.x,z.y=s.y,z.z=c.z;var b=e.multiplyByScalar(e.add(G,z,I),.5,m),X=0;for(y=0;y<_;y++){e.clone(t[y],r);var V=e.magnitude(e.subtract(r,b,I));V>X&&(X=V);var H=e.magnitudeSquared(e.subtract(r,B,I));if(H>g){var W=Math.sqrt(H);x=.5*(x+W),g=x*x;var q=W-x;B.x=(x*B.x+q*r.x)/W,B.y=(x*B.y+q*r.y)/W,B.z=(x*B.z+q*r.z)/W}}return x<X?(e.clone(B,n.center),n.radius=x):(e.clone(b,n.center),n.radius=X),n};var y=new o,p=new e,C=new e,U=new t,P=new t;T.fromRectangle2D=function(e,t,n){return T.fromRectangleWithHeights2D(e,t,0,0,n)},T.fromRectangleWithHeights2D=function(t,n,a,o,u){if(i(u)||(u=new T),!i(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(t,U),U.height=a,_.northeast(t,P),P.height=o;var E=n.project(U,p),s=n.project(P,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var L=[];T.fromRectangle3D=function(e,t,n,o){t=r(t,a.WGS84),n=r(n,0);var u;return i(e)&&(u=_.subsample(e,t,n,L)),T.fromPoints(u,o)},T.fromVertices=function(t,n,a,o){if(i(o)||(o=new T),!i(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),a=r(a,3);var u=d;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var E=e.clone(u,R),s=e.clone(u,l),c=e.clone(u,A),_=e.clone(u,f),y=e.clone(u,h),p=e.clone(u,N),C=t.length,U=0;U<C;U+=a){var P=t[U]+n.x,L=t[U+1]+n.y,F=t[U+2]+n.z;u.x=P,u.y=L,u.z=F,P<E.x&&e.clone(u,E),P>_.x&&e.clone(u,_),L<s.y&&e.clone(u,s),L>y.y&&e.clone(u,y),F<c.z&&e.clone(u,c),F>p.z&&e.clone(u,p)}var v=e.magnitudeSquared(e.subtract(_,E,I)),w=e.magnitudeSquared(e.subtract(y,s,I)),D=e.magnitudeSquared(e.subtract(p,c,I)),B=E,g=_,x=v;w>x&&(x=w,B=s,g=y),D>x&&(x=D,B=c,g=p);var G=S;G.x=.5*(B.x+g.x),G.y=.5*(B.y+g.y),G.z=.5*(B.z+g.z);var z=e.magnitudeSquared(e.subtract(g,G,I)),b=Math.sqrt(z),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var H=e.multiplyByScalar(e.add(X,V,I),.5,m),W=0;for(U=0;U<C;U+=a){u.x=t[U]+n.x,u.y=t[U+1]+n.y,u.z=t[U+2]+n.z;var q=e.magnitude(e.subtract(u,H,I));q>W&&(W=q);var Y=e.magnitudeSquared(e.subtract(u,G,I));if(Y>z){var k=Math.sqrt(Y);b=.5*(b+k),z=b*b;var K=k-b;G.x=(b*G.x+K*u.x)/k,G.y=(b*G.y+K*u.y)/k,G.z=(b*G.z+K*u.z)/k}}return b<W?(e.clone(G,o.center),o.radius=b):(e.clone(H,o.center),o.radius=W),o},T.fromEncodedCartesianVertices=function(t,n,r){if(i(r)||(r=new T),!i(t)||!i(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var a=d;a.x=t[0]+n[0],a.y=t[1]+n[1],a.z=t[2]+n[2];for(var o=e.clone(a,R),u=e.clone(a,l),E=e.clone(a,A),s=e.clone(a,f),c=e.clone(a,h),_=e.clone(a,N),y=t.length,p=0;p<y;p+=3){var C=t[p]+n[p],U=t[p+1]+n[p+1],P=t[p+2]+n[p+2];a.x=C,a.y=U,a.z=P,C<o.x&&e.clone(a,o),C>s.x&&e.clone(a,s),U<u.y&&e.clone(a,u),U>c.y&&e.clone(a,c),P<E.z&&e.clone(a,E),P>_.z&&e.clone(a,_)}var L=e.magnitudeSquared(e.subtract(s,o,I)),F=e.magnitudeSquared(e.subtract(c,u,I)),v=e.magnitudeSquared(e.subtract(_,E,I)),w=o,D=s,B=L;F>B&&(B=F,w=u,D=c),v>B&&(B=v,w=E,D=_);var g=S;g.x=.5*(w.x+D.x),g.y=.5*(w.y+D.y),g.z=.5*(w.z+D.z);var x=e.magnitudeSquared(e.subtract(D,g,I)),G=Math.sqrt(x),z=M;z.x=o.x,z.y=u.y,z.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=e.multiplyByScalar(e.add(z,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=t[p]+n[p],a.y=t[p+1]+n[p+1],a.z=t[p+2]+n[p+2];var H=e.magnitude(e.subtract(a,X,I));H>V&&(V=H);var W=e.magnitudeSquared(e.subtract(a,g,I));if(W>x){var q=Math.sqrt(W);G=.5*(G+q),x=G*G;var Y=q-G;g.x=(G*g.x+Y*a.x)/q,g.y=(G*g.y+Y*a.y)/q,g.z=(G*g.z+Y*a.z)/q}}return G<V?(e.clone(g,r.center),r.radius=G):(e.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(t,n,r){i(r)||(r=new T);var a=r.center;return e.add(t,n,a),e.multiplyByScalar(a,.5,a),r.radius=e.distance(a,n),r},T.fromEllipsoid=function(t,n){return i(n)||(n=new T),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var F=new e;T.fromBoundingSpheres=function(t,n){if(i(n)||(n=new T),!i(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return T.clone(t[0],n);if(2===r)return T.union(t[0],t[1],n);for(var a=[],o=0;o<r;o++)a.push(t[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=t[o];E=Math.max(E,e.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var v=new e,w=new e,D=new e;T.fromOrientedBoundingBox=function(t,n){i(n)||(n=new T);var r=t.halfAxes,a=s.getColumn(r,0,v),o=s.getColumn(r,1,w),u=s.getColumn(r,2,D),E=e.magnitude(a),c=e.magnitude(o),_=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(E,c,_),n},T.clone=function(t,n){if(i(t))return i(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new T(t.center,t.radius)},T.packedLength=4,T.pack=function(e,t,n){n=r(n,0);var i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t},T.unpack=function(e,t,n){t=r(t,0),i(n)||(n=new T);var a=n.center;return a.x=e[t++],a.y=e[t++],a.z=e[t++],n.radius=e[t],n};var B=new e,g=new e;T.union=function(t,n,r){i(r)||(r=new T);var a=t.center,o=t.radius,u=n.center,E=n.radius,s=e.subtract(u,a,B),c=e.magnitude(s);if(o>=c+E)return t.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=e.multiplyByScalar(s,(-o+_)/c,g);return e.add(R,a,R),e.clone(R,r.center),r.radius=_,r};var x=new e;T.expand=function(t,n,r){r=T.clone(t,r);var i=e.magnitude(e.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(t,n){var r=t.center,i=t.radius,a=n.normal,o=e.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=c.getMaximumScale(t)*e.radius,n};var G=new e;T.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,G);return e.magnitudeSquared(r)-t.radius*t.radius},T.transformWithoutScale=function(e,t,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var z=new e;T.computePlaneDistances=function(t,n,r,a){i(a)||(a=new E);var o=e.subtract(t.center,n,z),u=e.dot(r,o);return a.start=u-t.radius,a.stop=u+t.radius,a};for(var b=new e,X=new e,V=new e,H=new e,W=new e,q=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var K=new o;return T.projectTo2D=function(t,n,i){n=r(n,K);var a=n.ellipsoid,o=t.center,u=t.radius,E=a.geodeticSurfaceNormal(o,b),s=e.cross(e.UNIT_Z,E,X);e.normalize(s,s);var c=e.cross(E,s,V);e.normalize(c,c),e.multiplyByScalar(E,u,E),e.multiplyByScalar(c,u,c),e.multiplyByScalar(s,u,s);var _=e.negate(c,W),R=e.negate(s,H),l=Y,A=l[0];e.add(E,c,A),e.add(A,s,A),A=l[1],e.add(E,c,A),e.add(A,R,A),A=l[2],e.add(E,_,A),e.add(A,R,A),A=l[3],e.add(E,_,A),e.add(A,s,A),e.negate(E,E),A=l[4],e.add(E,c,A),e.add(A,s,A),A=l[5],e.add(E,c,A),e.add(A,R,A),A=l[6],e.add(E,_,A),e.add(A,R,A),A=l[7],e.add(E,_,A),e.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];e.add(o,N,N);var d=a.cartesianToCartographic(N,q);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},T.equals=function(t,n){return t===n||i(t)&&i(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},T.prototype.intersectPlane=function(e){return T.intersectPlane(this,e)},T.prototype.distanceSquaredTo=function(e){return T.distanceSquaredTo(this,e)},T.prototype.computePlaneDistances=function(e,t,n){return T.computePlaneDistances(this,e,t,n)},T.prototype.isOccluded=function(e){return T.isOccluded(this,e)},T.prototype.equals=function(e){return T.equals(this,e)},T.prototype.clone=function(e){return T.clone(this,e)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return t(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof t[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof t[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(e,t){i.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function i(){if(!t(S)&&(S=!1,!T())){var e=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(S=!0,M=r(e[1]))}return S}function a(){return i()&&M}function o(){if(!t(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(O=!0,m=r(e[1]))}return O}function u(){return o()&&m}function E(){if(!t(y)){y=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==e&&(y=!0,p=r(e[1]),p.isNightly=!!e[2])}return y}function s(){return E()&&p}function c(){if(!t(C)){C=!1;var e;"Microsoft Internet Explorer"===I.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1]))):"Netscape"===I.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==e&&(C=!0,U=r(e[1])))}return C}function _(){return c()&&U}function T(){if(!t(P)){P=!1;var e=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==e&&(P=!0,L=r(e[1]))}return P}function R(){return T()&&L}function l(){if(!t(F)){F=!1;var e=/Firefox\/([\.0-9]+)/.exec(I.userAgent); -null!==e&&(F=!0,v=r(e[1]))}return F}function A(){return t(w)||(w=/Windows/i.test(I.appVersion)),w}function f(){return l()&&v}function h(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(I.pointerEnabled)||I.pointerEnabled)),D}function N(){if(!t(g)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;g=t(n)&&""!==n,g&&(B=n)}return g}function d(){return N()?B:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,P,L,F,v,w,D,B,g,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:e(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,i){switch(r=e(r,0),i=e(i,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,i){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,i.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return a.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var i=e.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(e){switch(e){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(t){return e(t)&&(t===a.UNSIGNED_BYTE||t===a.UNSIGNED_SHORT||t===a.UNSIGNED_INT)},a.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},a.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)},n(a)}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(e,t,n,r,i,a,o,u,E,s,c,_,T){"use strict";function R(e){e=r(e,r.EMPTY_OBJECT);var n=r(e.radii,l),i=r(e.stackPartitions,10),a=r(e.slicePartitions,8),o=r(e.subdivisions,128);this._radii=t.clone(n),this._stackPartitions=i,this._slicePartitions=a,this._subdivisions=o,this._workerName="createEllipsoidOutlineGeometry"}var l=new t(1,1,1),A=Math.cos,f=Math.sin;R.packedLength=t.packedLength+3,R.pack=function(e,n,i){return i=r(i,0),t.pack(e._radii,n,i),i+=t.packedLength,n[i++]=e._stackPartitions,n[i++]=e._slicePartitions,n[i]=e._subdivisions,n};var h=new t,N={radii:h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return R.unpack=function(e,n,a){n=r(n,0);var o=t.unpack(e,n,h);n+=t.packedLength;var u=e[n++],E=e[n++],s=e[n++];return i(a)?(a._radii=t.clone(o,a._radii),a._stackPartitions=u,a._slicePartitions=E,a._subdivisions=s,a):(N.stackPartitions=u,N.slicePartitions=E,N.subdivisions=s,new R(N))},R.createGeometry=function(t){var r=t._radii;if(!(r.x<=0||r.y<=0||r.z<=0)){var i,a,R,l,h,N,d=o.fromCartesian3(r),I=t._stackPartitions,S=t._slicePartitions,M=t._subdivisions,O=M*(I+S-1),m=O-S+2,y=new Float64Array(3*m),p=c.createTypedArray(m,2*O),C=0,U=new Array(M),P=new Array(M);for(i=0;i<M;i++)R=_.TWO_PI*i/M,U[i]=A(R),P[i]=f(R);for(i=1;i<I;i++)for(l=Math.PI*i/I,h=A(l),N=f(l),a=0;a<M;a++)y[C++]=r.x*U[a]*N,y[C++]=r.y*P[a]*N,y[C++]=r.z*h;for(U.length=S,P.length=S,i=0;i<S;i++)R=_.TWO_PI*i/S,U[i]=A(R),P[i]=f(R);for(y[C++]=0,y[C++]=0,y[C++]=r.z,i=1;i<M;i++)for(l=Math.PI*i/M,h=A(l),N=f(l),a=0;a<S;a++)y[C++]=r.x*U[a]*N,y[C++]=r.y*P[a]*N,y[C++]=r.z*h;for(y[C++]=0,y[C++]=0,y[C++]=-r.z,C=0,i=0;i<I-1;++i){var L=i*M;for(a=0;a<M-1;++a)p[C++]=L+a,p[C++]=L+a+1;p[C++]=L+M-1,p[C++]=L}var F=M*(I-1);for(a=1;a<S+1;++a)p[C++]=F,p[C++]=F+a;for(i=0;i<M-2;++i){var v=i*S+1+F,w=(i+1)*S+1+F;for(a=0;a<S-1;++a)p[C++]=w+a,p[C++]=v+a;p[C++]=w+S-1,p[C++]=v+S-1}var D=y.length/3-1;for(a=D-1;a>D-S-1;--a)p[C++]=D,p[C++]=a;var B=new s({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y})});return new u({attributes:B,indices:p,primitiveType:T.LINES,boundingSphere:e.fromEllipsoid(d)})}},R}),define("Core/SphereOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidOutlineGeometry"],function(e,t,n,r,i){"use strict";function a(t){var r=n(t.radius,1),a=new e(r,r,r),o={radii:a,stackPartitions:t.stackPartitions,slicePartitions:t.slicePartitions,subdivisions:t.subdivisions};this._ellipsoidGeometry=new i(o),this._workerName="createSphereOutlineGeometry"}a.packedLength=i.packedLength,a.pack=function(e,t,n){return i.pack(e._ellipsoidGeometry,t,n)};var o=new i,u={radius:void 0,radii:new e,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return a.unpack=function(t,n,E){var s=i.unpack(t,n,o);return u.stackPartitions=s._stackPartitions,u.slicePartitions=s._slicePartitions,u.subdivisions=s._subdivisions,r(E)?(e.clone(s._radii,u.radii),E._ellipsoidGeometry=new i(u),E):(u.radius=s._radii.x,new a(u))},a.createGeometry=function(e){return i.createGeometry(e._ellipsoidGeometry)},a}),define("Workers/createSphereOutlineGeometry",["../Core/defined","../Core/SphereOutlineGeometry"],function(e,t){"use strict";return function(n,r){return e(r)&&(n=t.unpack(n,r)),t.createGeometry(n)}})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function t(t){return void 0!==t&&null!==t}return t}),define("Core/DeveloperError",["./defined"],function(t){"use strict";function e(t){this.name="DeveloperError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e.throwInstantiationError=function(){throw new e("This function defines an interface and should not be called directly.")},e}),define("Core/Check",["./defined","./DeveloperError"],function(t,e){"use strict";function n(t){return t+" is required, actual value was undefined"}function r(t,e,n){return"Expected "+n+" to be typeof "+e+", actual typeof was "+t}var i={};return i.typeOf={},i.defined=function(r,i){if(!t(i))throw new e(n(r))},i.typeOf.func=function(t,n){if("function"!=typeof n)throw new e(r(typeof n,"function",t))},i.typeOf.string=function(t,n){if("string"!=typeof n)throw new e(r(typeof n,"string",t))},i.typeOf.number=function(t,n){if("number"!=typeof n)throw new e(r(typeof n,"number",t))},i.typeOf.number.lessThan=function(t,n,r){if(i.typeOf.number(t,n),n>=r)throw new e("Expected "+t+" to be less than "+r+", actual value was "+n)},i.typeOf.number.lessThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n>r)throw new e("Expected "+t+" to be less than or equal to "+r+", actual value was "+n)},i.typeOf.number.greaterThan=function(t,n,r){if(i.typeOf.number(t,n),n<=r)throw new e("Expected "+t+" to be greater than "+r+", actual value was "+n)},i.typeOf.number.greaterThanOrEquals=function(t,n,r){if(i.typeOf.number(t,n),n<r)throw new e("Expected "+t+" to be greater than or equal to"+r+", actual value was "+n)},i.typeOf.object=function(t,n){if("object"!=typeof n)throw new e(r(typeof n,"object",t))},i.typeOf.bool=function(t,n){if("boolean"!=typeof n)throw new e(r(typeof n,"boolean",t))},i}),define("Core/freezeObject",["./defined"],function(t){"use strict";var e=Object.freeze;return t(e)||(e=function(t){return t}),e}),define("Core/defaultValue",["./freezeObject"],function(t){"use strict";function e(t,e){return void 0!==t?t:e}return e.EMPTY_OBJECT=t({}),e}),define("ThirdParty/mersenne-twister",[],function(){var t=function(t){void 0==t&&(t=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(t)};return t.prototype.init_genrand=function(t){for(this.mt[0]=t>>>0,this.mti=1;this.mti<this.N;this.mti++){var t=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&t)>>>16)<<16)+1812433253*(65535&t)+this.mti,this.mt[this.mti]>>>=0}},t.prototype.genrand_int32=function(){var t,e=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^t>>>1^e[1&t];for(;n<this.N-1;n++)t=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^t>>>1^e[1&t];t=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^t>>>1^e[1&t],this.mti=0}return t=this.mt[this.mti++],t^=t>>>11,t^=t<<7&2636928640,t^=t<<15&4022730752,t^=t>>>18,t>>>0},t.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},t}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(t,e,n,r){"use strict";var i={};i.EPSILON1=.1,i.EPSILON2=.01,i.EPSILON3=.001,i.EPSILON4=1e-4,i.EPSILON5=1e-5,i.EPSILON6=1e-6,i.EPSILON7=1e-7,i.EPSILON8=1e-8,i.EPSILON9=1e-9,i.EPSILON10=1e-10,i.EPSILON11=1e-11,i.EPSILON12=1e-12,i.EPSILON13=1e-13,i.EPSILON14=1e-14,i.EPSILON15=1e-15,i.EPSILON16=1e-16,i.EPSILON17=1e-17,i.EPSILON18=1e-18,i.EPSILON19=1e-19,i.EPSILON20=1e-20,i.GRAVITATIONALPARAMETER=3986004418e5,i.SOLAR_RADIUS=6955e5,i.LUNAR_RADIUS=1737400,i.SIXTY_FOUR_KILOBYTES=65536,i.sign=function(t){return t>0?1:t<0?-1:0},i.signNotZero=function(t){return t<0?-1:1},i.toSNorm=function(t,n){return n=e(n,255),Math.round((.5*i.clamp(t,-1,1)+.5)*n)},i.fromSNorm=function(t,n){return n=e(n,255),i.clamp(t,0,n)/n*2-1},i.sinh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e-n)},i.cosh=function(t){var e=Math.pow(Math.E,t),n=Math.pow(Math.E,-1*t);return.5*(e+n)},i.lerp=function(t,e,n){return(1-n)*t+n*e},i.PI=Math.PI,i.ONE_OVER_PI=1/Math.PI,i.PI_OVER_TWO=.5*Math.PI,i.PI_OVER_THREE=Math.PI/3,i.PI_OVER_FOUR=Math.PI/4,i.PI_OVER_SIX=Math.PI/6,i.THREE_PI_OVER_TWO=3*Math.PI*.5,i.TWO_PI=2*Math.PI,i.ONE_OVER_TWO_PI=1/(2*Math.PI),i.RADIANS_PER_DEGREE=Math.PI/180,i.DEGREES_PER_RADIAN=180/Math.PI,i.RADIANS_PER_ARCSECOND=i.RADIANS_PER_DEGREE/3600,i.toRadians=function(t){return t*i.RADIANS_PER_DEGREE},i.toDegrees=function(t){return t*i.DEGREES_PER_RADIAN},i.convertLongitudeRange=function(t){var e=i.TWO_PI,n=t-Math.floor(t/e)*e;return n<-Math.PI?n+e:n>=Math.PI?n-e:n},i.clampToLatitudeRange=function(t){return i.clamp(t,-1*i.PI_OVER_TWO,i.PI_OVER_TWO)},i.negativePiToPi=function(t){return i.zeroToTwoPi(t+i.PI)-i.PI},i.zeroToTwoPi=function(t){var e=i.mod(t,i.TWO_PI);return Math.abs(e)<i.EPSILON14&&Math.abs(t)>i.EPSILON14?i.TWO_PI:e},i.mod=function(t,e){return(t%e+e)%e},i.equalsEpsilon=function(t,n,r,i){i=e(i,r);var a=Math.abs(t-n);return a<=i||a<=r*Math.max(Math.abs(t),Math.abs(n))};var a=[1];i.factorial=function(t){var e=a.length;if(t>=e)for(var n=a[e-1],r=e;r<=t;r++)a.push(n*r);return a[t]},i.incrementWrap=function(t,n,r){return r=e(r,0),++t,t>n&&(t=r),t},i.isPowerOfTwo=function(t){return 0!==t&&0===(t&t-1)},i.nextPowerOfTwo=function(t){return--t,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t,t},i.clamp=function(t,e,n){return t<e?e:t>n?n:t};var o=new t;return i.setRandomNumberSeed=function(e){o=new t(e)},i.nextRandomNumber=function(){return o.random()},i.acosClamped=function(t){return Math.acos(i.clamp(t,-1,1))},i.asinClamped=function(t){return Math.asin(i.clamp(t,-1,1))},i.chordLength=function(t,e){return 2*e*Math.sin(.5*t)},i.logBase=function(t,e){return Math.log(t)/Math.log(e)},i.fog=function(t,e){var n=t*e;return 1-Math.exp(-(n*n))},i}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0)}o.fromSpherical=function(t,r){n(r)||(r=new o);var i=t.clock,a=t.cone,u=e(t.magnitude,1),E=u*Math.sin(a);return r.x=E*Math.cos(i),r.y=E*Math.sin(i),r.z=u*Math.cos(a),r},o.fromElements=function(t,e,r,i){return n(i)?(i.x=t,i.y=e,i.z=r,i):new o(t,e,r)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e):new o(t.x,t.y,t.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r]=t.z,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=3*r:e=new Array(3*r);for(var i=0;i<r;++i)o.pack(t[i],e,3*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/3:e=new Array(r/3);for(var i=0;i<r;i+=3){var a=i/3;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o,c=new o;o.angleBetween=function(t,e){o.normalize(t,s),o.normalize(e,c);var n=o.dot(s,c),r=o.magnitude(o.cross(s,c,s));return Math.atan2(r,n)};var _=new o;o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,_);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,e):o.clone(o.UNIT_Z,e):n.y<=n.z?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_Z,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)},o.cross=function(t,e,n){var r=t.x,i=t.y,a=t.z,o=e.x,u=e.y,E=e.z,s=i*E-a*u,c=a*o-r*E,_=r*u-i*o;return n.x=s,n.y=c,n.z=_,n},o.fromDegrees=function(t,e,n,r,i){return t=a.toRadians(t),e=a.toRadians(e),o.fromRadians(t,e,n,r,i)};var T=new o,R=new o,l=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(t,r,i,a,u){i=e(i,0);var E=n(a)?a.radiiSquared:l,s=Math.cos(r);T.x=s*Math.cos(t),T.y=s*Math.sin(t),T.z=Math.sin(r),T=o.normalize(T,T),o.multiplyComponents(E,T,R);var c=Math.sqrt(o.dot(T,R));return R=o.divideByScalar(R,c,R),T=o.multiplyByScalar(T,i,T),n(u)||(u=new o),o.add(R,T,u)},o.fromDegreesArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromDegrees(u,E,0,e,r[s])}return r},o.fromRadiansArray=function(t,e,r){var i=t.length;n(r)?r.length=i/2:r=new Array(i/2);for(var a=0;a<i;a+=2){var u=t[a],E=t[a+1],s=a/2;r[s]=o.fromRadians(u,E,0,e,r[s])}return r},o.fromDegreesArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromDegrees(u,E,s,e,r[c])}return r},o.fromRadiansArrayHeights=function(t,e,r){var i=t.length;n(r)?r.length=i/3:r=new Array(i/3);for(var a=0;a<i;a+=3){var u=t[a],E=t[a+1],s=t[a+2],c=a/3;r[c]=o.fromRadians(u,E,s,e,r[c])}return r},o.ZERO=i(new o(0,0,0)),o.UNIT_X=i(new o(1,0,0)),o.UNIT_Y=i(new o(0,1,0)),o.UNIT_Z=i(new o(0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(t,e,n,r){"use strict";function i(n,i,u,E,s){var c=n.x,_=n.y,T=n.z,R=i.x,l=i.y,A=i.z,f=c*c*R*R,h=_*_*l*l,N=T*T*A*A,d=f+h+N,I=Math.sqrt(1/d),S=t.multiplyByScalar(n,I,a);if(d<E)return isFinite(I)?t.clone(S,s):void 0;var M=u.x,O=u.y,m=u.z,y=o;y.x=S.x*M*2,y.y=S.y*O*2,y.z=S.z*m*2;var p,C,U,P,L,F,v,w,D,B,g,x=(1-I)*t.magnitude(n)/(.5*t.magnitude(y)),G=0;do{x-=G,U=1/(1+x*M),P=1/(1+x*O),L=1/(1+x*m),F=U*U,v=P*P,w=L*L,D=F*U,B=v*P,g=w*L,p=f*F+h*v+N*w-1,C=f*D*M+h*B*O+N*g*m;var z=-2*C;G=p/z}while(Math.abs(p)>r.EPSILON12);return e(s)?(s.x=c*U,s.y=_*P,s.z=T*L,s):new t(c*U,_*P,T*L)}var a=new t,o=new t;return i}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o){"use strict";function u(t,e,r){this.longitude=n(t,0),this.latitude=n(e,0),this.height=n(r,0)}u.fromRadians=function(t,e,i,a){return i=n(i,0),r(a)?(a.longitude=t,a.latitude=e,a.height=i,a):new u(t,e,i)},u.fromDegrees=function(t,e,n,r){return t=a.toRadians(t),e=a.toRadians(e),u.fromRadians(t,e,n,r)};var E=new t,s=new t,c=new t,_=new t(1/6378137,1/6378137,1/6356752.314245179),T=new t(1/40680631590769,1/40680631590769,1/40408299984661.445),R=a.EPSILON1;return u.fromCartesian=function(e,n,i){var l=r(n)?n.oneOverRadii:_,A=r(n)?n.oneOverRadiiSquared:T,f=r(n)?n._centerToleranceSquared:R,h=o(e,l,A,f,s);if(r(h)){var N=t.multiplyComponents(h,A,E);N=t.normalize(N,N);var d=t.subtract(e,h,c),I=Math.atan2(N.y,N.x),S=Math.asin(N.z),M=a.sign(t.dot(d,e))*t.magnitude(d);return r(i)?(i.longitude=I,i.latitude=S,i.height=M,i):new u(I,S,M)}},u.clone=function(t,e){if(r(t))return r(e)?(e.longitude=t.longitude,e.latitude=t.latitude,e.height=t.height,e):new u(t.longitude,t.latitude,t.height)},u.equals=function(t,e){return t===e||r(t)&&r(e)&&t.longitude===e.longitude&&t.latitude===e.latitude&&t.height===e.height},u.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t.longitude-e.longitude)<=n&&Math.abs(t.latitude-e.latitude)<=n&&Math.abs(t.height-e.height)<=n},u.ZERO=i(new u(0,0,0)),u.prototype.clone=function(t){return u.clone(this,t)},u.prototype.equals=function(t){return u.equals(this,t)},u.prototype.equalsEpsilon=function(t,e){return u.equalsEpsilon(this,t,e)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(t){"use strict";var e=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(t){return!1}}(),n=Object.defineProperties;return e&&t(n)||(n=function(t){return t}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(t,e,n,r,i,a,o,u,E){"use strict";function s(e,r,i,a){r=n(r,0),i=n(i,0),a=n(a,0),e._radii=new t(r,i,a),e._radiiSquared=new t(r*r,i*i,a*a),e._radiiToTheFourth=new t(r*r*r*r,i*i*i*i,a*a*a*a),e._oneOverRadii=new t(0===r?0:1/r,0===i?0:1/i,0===a?0:1/a),e._oneOverRadiiSquared=new t(0===r?0:1/(r*r),0===i?0:1/(i*i),0===a?0:1/(a*a)),e._minimumRadius=Math.min(r,i,a),e._maximumRadius=Math.max(r,i,a),e._centerToleranceSquared=u.EPSILON1,0!==e._radiiSquared.z&&(e._sqauredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function c(t,e,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,s(this,t,e,n)}i(c.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}}}),c.clone=function(e,n){if(r(e)){var i=e._radii;return r(n)?(t.clone(i,n._radii),t.clone(e._radiiSquared,n._radiiSquared),t.clone(e._radiiToTheFourth,n._radiiToTheFourth),t.clone(e._oneOverRadii,n._oneOverRadii),t.clone(e._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=e._minimumRadius,n._maximumRadius=e._maximumRadius,n._centerToleranceSquared=e._centerToleranceSquared,n):new c(i.x,i.y,i.z)}},c.fromCartesian3=function(t,e){return r(e)||(e=new c),r(t)?(s(e,t.x,t.y,t.z),e):e},c.WGS84=o(new c(6378137,6378137,6356752.314245179)),c.UNIT_SPHERE=o(new c(1,1,1)),c.MOON=o(new c(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),c.prototype.clone=function(t){return c.clone(this,t)},c.packedLength=t.packedLength,c.pack=function(e,r,i){return i=n(i,0),t.pack(e._radii,r,i),r},c.unpack=function(e,r,i){r=n(r,0);var a=t.unpack(e,r);return c.fromCartesian3(a,i)},c.prototype.geocentricSurfaceNormal=t.normalize,c.prototype.geodeticSurfaceNormalCartographic=function(e,n){var i=e.longitude,a=e.latitude,o=Math.cos(a),u=o*Math.cos(i),E=o*Math.sin(i),s=Math.sin(a);return r(n)||(n=new t),n.x=u,n.y=E,n.z=s,t.normalize(n,n)},c.prototype.geodeticSurfaceNormal=function(e,n){return r(n)||(n=new t),n=t.multiplyComponents(e,this._oneOverRadiiSquared,n),t.normalize(n,n)};var _=new t,T=new t;c.prototype.cartographicToCartesian=function(e,n){var i=_,a=T;this.geodeticSurfaceNormalCartographic(e,i),t.multiplyComponents(this._radiiSquared,i,a);var o=Math.sqrt(t.dot(i,a));return t.divideByScalar(a,o,a),t.multiplyByScalar(i,e.height,i),r(n)||(n=new t),t.add(a,i,n)},c.prototype.cartographicArrayToCartesianArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;i++)e[i]=this.cartographicToCartesian(t[i],e[i]);return e};var R=new t,l=new t,A=new t;return c.prototype.cartesianToCartographic=function(n,i){var a=this.scaleToGeodeticSurface(n,l);if(r(a)){var o=this.geodeticSurfaceNormal(a,R),E=t.subtract(n,a,A),s=Math.atan2(o.y,o.x),c=Math.asin(o.z),_=u.sign(t.dot(E,n))*t.magnitude(E);return r(i)?(i.longitude=s,i.latitude=c,i.height=_,i):new e(s,c,_)}},c.prototype.cartesianArrayToCartographicArray=function(t,e){var n=t.length;r(e)?e.length=n:e=new Array(n);for(var i=0;i<n;++i)e[i]=this.cartesianToCartographic(t[i],e[i]);return e},c.prototype.scaleToGeodeticSurface=function(t,e){return E(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,e)},c.prototype.scaleToGeocentricSurface=function(e,n){r(n)||(n=new t);var i=e.x,a=e.y,o=e.z,u=this._oneOverRadiiSquared,E=1/Math.sqrt(i*i*u.x+a*a*u.y+o*o*u.z);return t.multiplyByScalar(e,E,n)},c.prototype.transformPositionToScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._oneOverRadii,n)},c.prototype.transformPositionFromScaledSpace=function(e,n){return r(n)||(n=new t),t.multiplyComponents(e,this._radii,n)},c.prototype.equals=function(e){return this===e||r(e)&&t.equals(this._radii,e._radii)},c.prototype.toString=function(){return this._radii.toString()},c.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,i,a){i=n(i,0);var o=this._sqauredXOverSquaredZ;if(r(a)||(a=new t),a.x=0,a.y=0,a.z=e.z*(1-o),!(Math.abs(a.z)>=this._radii.z-i))return a},c}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(t,e,n,r,i,a,o){"use strict";function u(t){this._ellipsoid=n(t,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return i(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(e,n){var i=this._semimajorAxis,a=e.longitude*i,o=e.latitude*i,u=e.height;return r(n)?(n.x=a,n.y=o,n.z=u,n):new t(a,o,u)},u.prototype.unproject=function(t,n){var i=this._oneOverSemimajorAxis,a=t.x*i,o=t.y*i,u=t.z;return r(n)?(n.longitude=a,n.latitude=o,n.height=u,n):new e(a,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(t){"use strict";var e={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return t(e)}),define("Core/Interval",["./defaultValue"],function(t){"use strict";function e(e,n){this.start=t(e,0),this.stop=t(n,0)}return e}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i,a,o,u,E,s){this[0]=n(t,0),this[1]=n(i,0),this[2]=n(u,0),this[3]=n(e,0),this[4]=n(a,0),this[5]=n(E,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(s,0)}function s(t){for(var e=0,n=0;n<9;++n){var r=t[n];e+=r*r}return Math.sqrt(e)}function c(t){for(var e=0,n=0;n<3;++n){var r=t[E.getElementIndex(A[n],l[n])];e+=2*r*r}return Math.sqrt(e)}function _(t,e){for(var n=u.EPSILON15,r=0,i=1,a=0;a<3;++a){var o=Math.abs(t[E.getElementIndex(A[a],l[a])]);o>r&&(i=a,r=o)}var s=1,c=0,_=l[i],T=A[i];if(Math.abs(t[E.getElementIndex(T,_)])>n){var R,f=t[E.getElementIndex(T,T)],h=t[E.getElementIndex(_,_)],N=t[E.getElementIndex(T,_)],d=(f-h)/2/N;R=d<0?-1/(-d+Math.sqrt(1+d*d)):1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+R*R),c=R*s}return e=E.clone(E.IDENTITY,e),e[E.getElementIndex(_,_)]=e[E.getElementIndex(T,T)]=s,e[E.getElementIndex(T,_)]=c,e[E.getElementIndex(_,T)]=-c,e}E.packedLength=9,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t[0],e[r++]=t[1],e[r++]=t[2],e[r++]=t[3],e[r++]=t[4],e[r++]=t[5],e[r++]=t[6],e[r++]=t[7],e[r++]=t[8],e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e++],i[1]=t[e++],i[2]=t[e++],i[3]=t[e++],i[4]=t[e++],i[5]=t[e++],i[6]=t[e++],i[7]=t[e++],i[8]=t[e++],i},E.clone=function(t,e){if(r(t))return r(e)?(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],e):new E(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])},E.fromArray=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i[0]=t[e],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5],i[6]=t[e+6],i[7]=t[e+7],i[8]=t[e+8],i},E.fromColumnMajorArray=function(t,e){return E.clone(t,e)},E.fromRowMajorArray=function(t,e){return r(e)?(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],e):new E(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},E.fromQuaternion=function(t,e){var n=t.x*t.x,i=t.x*t.y,a=t.x*t.z,o=t.x*t.w,u=t.y*t.y,s=t.y*t.z,c=t.y*t.w,_=t.z*t.z,T=t.z*t.w,R=t.w*t.w,l=n-u-_+R,A=2*(i-T),f=2*(a+c),h=2*(i+T),N=-n+u-_+R,d=2*(s-o),I=2*(a-c),S=2*(s+o),M=-n-u+_+R;return r(e)?(e[0]=l,e[1]=h,e[2]=I,e[3]=A,e[4]=N,e[5]=S,e[6]=f,e[7]=d,e[8]=M,e):new E(l,A,f,h,N,d,I,S,M)},E.fromHeadingPitchRoll=function(t,e){var n=Math.cos(-t.pitch),i=Math.cos(-t.heading),a=Math.cos(t.roll),o=Math.sin(-t.pitch),u=Math.sin(-t.heading),s=Math.sin(t.roll),c=n*i,_=-a*u+s*o*i,T=s*u+a*o*i,R=n*u,l=a*i+s*o*u,A=-s*i+a*o*u,f=-o,h=s*n,N=a*n;return r(e)?(e[0]=c,e[1]=R,e[2]=f,e[3]=_,e[4]=l,e[5]=h,e[6]=T,e[7]=A,e[8]=N,e):new E(c,_,T,R,l,A,f,h,N)},E.fromScale=function(t,e){return r(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=t.y,e[5]=0,e[6]=0,e[7]=0,e[8]=t.z,e):new E(t.x,0,0,0,t.y,0,0,0,t.z)},E.fromUniformScale=function(t,e){return r(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=t,e[5]=0,e[6]=0,e[7]=0,e[8]=t,e):new E(t,0,0,0,t,0,0,0,t)},E.fromCrossProduct=function(t,e){return r(e)?(e[0]=0,e[1]=t.z,e[2]=-t.y,e[3]=-t.z,e[4]=0,e[5]=t.x,e[6]=t.y,e[7]=-t.x,e[8]=0,e):new E(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)},E.fromRotationX=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=n,e[5]=i,e[6]=0,e[7]=-i,e[8]=n,e):new E(1,0,0,0,n,-i,0,i,n)},E.fromRotationY=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=0,e[2]=-i,e[3]=0,e[4]=1,e[5]=0,e[6]=i,e[7]=0,e[8]=n,e):new E(n,0,i,0,1,0,-i,0,n)},E.fromRotationZ=function(t,e){var n=Math.cos(t),i=Math.sin(t);return r(e)?(e[0]=n,e[1]=i,e[2]=0,e[3]=-i,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e):new E(n,-i,0,i,n,0,0,0,1)},E.toArray=function(t,e){return r(e)?(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],e):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},E.getElementIndex=function(t,e){return 3*t+e},E.getColumn=function(t,e,n){var r=3*e,i=t[r],a=t[r+1],o=t[r+2];return n.x=i,n.y=a,n.z=o,n},E.setColumn=function(t,e,n,r){r=E.clone(t,r);var i=3*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r},E.getRow=function(t,e,n){var r=t[e],i=t[e+3],a=t[e+6];return n.x=r,n.y=i,n.z=a,n},E.setRow=function(t,e,n,r){return r=E.clone(t,r),r[e]=n.x,r[e+3]=n.y,r[e+6]=n.z,r};var T=new t;E.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],T)),n.y=t.magnitude(t.fromElements(e[3],e[4],e[5],T)),n.z=t.magnitude(t.fromElements(e[6],e[7],e[8],T)),n};var R=new t;E.getMaximumScale=function(e){return E.getScale(e,R),t.maximumComponent(R)},E.multiply=function(t,e,n){var r=t[0]*e[0]+t[3]*e[1]+t[6]*e[2],i=t[1]*e[0]+t[4]*e[1]+t[7]*e[2],a=t[2]*e[0]+t[5]*e[1]+t[8]*e[2],o=t[0]*e[3]+t[3]*e[4]+t[6]*e[5],u=t[1]*e[3]+t[4]*e[4]+t[7]*e[5],E=t[2]*e[3]+t[5]*e[4]+t[8]*e[5],s=t[0]*e[6]+t[3]*e[7]+t[6]*e[8],c=t[1]*e[6]+t[4]*e[7]+t[7]*e[8],_=t[2]*e[6]+t[5]*e[7]+t[8]*e[8];return n[0]=r,n[1]=i,n[2]=a,n[3]=o,n[4]=u,n[5]=E,n[6]=s,n[7]=c,n[8]=_,n},E.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n},E.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n},E.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[3]*i+t[6]*a,u=t[1]*r+t[4]*i+t[7]*a,E=t[2]*r+t[5]*i+t[8]*a;return n.x=o,n.y=u,n.z=E,n},E.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n},E.multiplyByScale=function(t,e,n){return n[0]=t[0]*e.x,n[1]=t[1]*e.x,n[2]=t[2]*e.x,n[3]=t[3]*e.y,n[4]=t[4]*e.y,n[5]=t[5]*e.y,n[6]=t[6]*e.z,n[7]=t[7]*e.z,n[8]=t[8]*e.z,n},E.negate=function(t,e){return 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],e},E.transpose=function(t,e){var n=t[0],r=t[3],i=t[6],a=t[1],o=t[4],u=t[7],E=t[2],s=t[5],c=t[8];return e[0]=n,e[1]=r,e[2]=i,e[3]=a,e[4]=o,e[5]=u,e[6]=E,e[7]=s,e[8]=c,e};var l=[1,0,0],A=[2,2,1],f=new E,h=new E;return E.computeEigenDecomposition=function(t,e){var n=u.EPSILON20,i=10,a=0,o=0;r(e)||(e={});for(var T=e.unitary=E.clone(E.IDENTITY,e.unitary),R=e.diagonal=E.clone(t,e.diagonal),l=n*s(R);o<i&&c(R)>l;)_(R,f),E.transpose(f,h),E.multiply(R,f,R),E.multiply(h,R,R),E.multiply(T,f,T),++a>2&&(++o,a=0);return e},E.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e},E.determinant=function(t){var e=t[0],n=t[3],r=t[6],i=t[1],a=t[4],o=t[7],u=t[2],E=t[5],s=t[8];return e*(a*s-E*o)+i*(E*r-n*s)+u*(n*o-a*r)},E.inverse=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[3],o=t[4],u=t[5],s=t[6],c=t[7],_=t[8],T=E.determinant(t);e[0]=o*_-c*u,e[1]=c*i-r*_,e[2]=r*u-o*i,e[3]=s*u-a*_,e[4]=n*_-s*i,e[5]=a*i-n*u,e[6]=a*c-s*o,e[7]=s*r-n*c,e[8]=n*o-a*r;var R=1/T;return E.multiplyByScalar(e,R,e)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]},E.equalsEpsilon=function(t,e,n){return t===e||r(t)&&r(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n},E.IDENTITY=o(new E(1,0,0,0,1,0,0,0,1)),E.ZERO=o(new E(0,0,0,0,0,0,0,0,0)),E.COLUMN0ROW0=0,E.COLUMN0ROW1=1,E.COLUMN0ROW2=2,E.COLUMN1ROW0=3,E.COLUMN1ROW1=4,E.COLUMN1ROW2=5,E.COLUMN2ROW0=6,E.COLUMN2ROW1=7,E.COLUMN2ROW2=8,i(E.prototype,{length:{get:function(){return E.packedLength}}}),E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]},E.prototype.equalsEpsilon=function(t,e){return E.equalsEpsilon(this,t,e)},E.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},E}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(t,e,n,r,i,a){"use strict";function o(t,n,r,i){this.x=e(t,0),this.y=e(n,0),this.z=e(r,0),this.w=e(i,0)}o.fromElements=function(t,e,r,i,a){return n(a)?(a.x=t,a.y=e,a.z=r,a.w=i,a):new o(t,e,r,i)},o.fromColor=function(t,e){return n(e)?(e.x=t.red,e.y=t.green,e.z=t.blue,e.w=t.alpha,e):new o(t.red,t.green,t.blue,t.alpha)},o.clone=function(t,e){if(n(t))return n(e)?(e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e):new o(t.x,t.y,t.z,t.w)},o.packedLength=4,o.pack=function(t,n,r){return r=e(r,0),n[r++]=t.x,n[r++]=t.y,n[r++]=t.z,n[r]=t.w,n},o.unpack=function(t,r,i){return r=e(r,0),n(i)||(i=new o),i.x=t[r++],i.y=t[r++],i.z=t[r++],i.w=t[r],i},o.packArray=function(t,e){var r=t.length;n(e)?e.length=4*r:e=new Array(4*r);for(var i=0;i<r;++i)o.pack(t[i],e,4*i);return e},o.unpackArray=function(t,e){var r=t.length;n(e)?e.length=r/4:e=new Array(r/4);for(var i=0;i<r;i+=4){var a=i/4;e[a]=o.unpack(t,i,e[a])}return e},o.fromArray=o.unpack,o.maximumComponent=function(t){return Math.max(t.x,t.y,t.z,t.w)},o.minimumComponent=function(t){return Math.min(t.x,t.y,t.z,t.w)},o.minimumByComponent=function(t,e,n){return n.x=Math.min(t.x,e.x),n.y=Math.min(t.y,e.y),n.z=Math.min(t.z,e.z),n.w=Math.min(t.w,e.w),n},o.maximumByComponent=function(t,e,n){return n.x=Math.max(t.x,e.x),n.y=Math.max(t.y,e.y),n.z=Math.max(t.z,e.z),n.w=Math.max(t.w,e.w),n},o.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},o.magnitude=function(t){return Math.sqrt(o.magnitudeSquared(t))};var u=new o;o.distance=function(t,e){return o.subtract(t,e,u),o.magnitude(u)},o.distanceSquared=function(t,e){return o.subtract(t,e,u),o.magnitudeSquared(u)},o.normalize=function(t,e){var n=o.magnitude(t);return e.x=t.x/n,e.y=t.y/n,e.z=t.z/n,e.w=t.w/n,e},o.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z+t.w*e.w},o.multiplyComponents=function(t,e,n){return n.x=t.x*e.x,n.y=t.y*e.y,n.z=t.z*e.z,n.w=t.w*e.w,n},o.divideComponents=function(t,e,n){return n.x=t.x/e.x,n.y=t.y/e.y,n.z=t.z/e.z,n.w=t.w/e.w,n},o.add=function(t,e,n){return n.x=t.x+e.x,n.y=t.y+e.y,n.z=t.z+e.z,n.w=t.w+e.w,n},o.subtract=function(t,e,n){return n.x=t.x-e.x,n.y=t.y-e.y,n.z=t.z-e.z,n.w=t.w-e.w,n},o.multiplyByScalar=function(t,e,n){return n.x=t.x*e,n.y=t.y*e,n.z=t.z*e,n.w=t.w*e,n},o.divideByScalar=function(t,e,n){return n.x=t.x/e,n.y=t.y/e,n.z=t.z/e,n.w=t.w/e,n},o.negate=function(t,e){return e.x=-t.x,e.y=-t.y,e.z=-t.z,e.w=-t.w,e},o.abs=function(t,e){return e.x=Math.abs(t.x),e.y=Math.abs(t.y),e.z=Math.abs(t.z),e.w=Math.abs(t.w),e};var E=new o;o.lerp=function(t,e,n,r){return o.multiplyByScalar(e,n,E),r=o.multiplyByScalar(t,1-n,r),o.add(E,r,r)};var s=new o;return o.mostOrthogonalAxis=function(t,e){var n=o.normalize(t,s);return o.abs(n,n),e=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,e):o.clone(o.UNIT_W,e):n.z<=n.w?o.clone(o.UNIT_Z,e):o.clone(o.UNIT_W,e)},o.equals=function(t,e){return t===e||n(t)&&n(e)&&t.x===e.x&&t.y===e.y&&t.z===e.z&&t.w===e.w},o.equalsArray=function(t,e,n){return t.x===e[n]&&t.y===e[n+1]&&t.z===e[n+2]&&t.w===e[n+3]},o.equalsEpsilon=function(t,e,r,i){return t===e||n(t)&&n(e)&&a.equalsEpsilon(t.x,e.x,r,i)&&a.equalsEpsilon(t.y,e.y,r,i)&&a.equalsEpsilon(t.z,e.z,r,i)&&a.equalsEpsilon(t.w,e.w,r,i)},o.ZERO=i(new o(0,0,0,0)),o.UNIT_X=i(new o(1,0,0,0)),o.UNIT_Y=i(new o(0,1,0,0)),o.UNIT_Z=i(new o(0,0,1,0)),o.UNIT_W=i(new o(0,0,0,1)),o.prototype.clone=function(t){return o.clone(this,t)},o.prototype.equals=function(t){return o.equals(this,t)},o.prototype.equalsEpsilon=function(t,e,n){return o.equalsEpsilon(this,t,e,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(t){"use strict";function e(t){this.name="RuntimeError",this.message=t;var e;try{throw new Error}catch(t){e=t.stack}this.stack=e}return t(Object.create)&&(e.prototype=Object.create(Error.prototype),e.prototype.constructor=e),e.prototype.toString=function(){var e=this.name+": "+this.message;return t(this.stack)&&(e+="\n"+this.stack.toString()),e},e}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(t,e,n,r,i,a,o,u,E,s){ +"use strict";function c(t,e,n,i,a,o,u,E,s,c,_,T,R,l,A,f){this[0]=r(t,0),this[1]=r(a,0),this[2]=r(s,0),this[3]=r(R,0),this[4]=r(e,0),this[5]=r(o,0),this[6]=r(c,0),this[7]=r(l,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(_,0),this[11]=r(A,0),this[12]=r(i,0),this[13]=r(E,0),this[14]=r(T,0),this[15]=r(f,0)}c.packedLength=16,c.pack=function(t,e,n){return n=r(n,0),e[n++]=t[0],e[n++]=t[1],e[n++]=t[2],e[n++]=t[3],e[n++]=t[4],e[n++]=t[5],e[n++]=t[6],e[n++]=t[7],e[n++]=t[8],e[n++]=t[9],e[n++]=t[10],e[n++]=t[11],e[n++]=t[12],e[n++]=t[13],e[n++]=t[14],e[n]=t[15],e},c.unpack=function(t,e,n){return e=r(e,0),i(n)||(n=new c),n[0]=t[e++],n[1]=t[e++],n[2]=t[e++],n[3]=t[e++],n[4]=t[e++],n[5]=t[e++],n[6]=t[e++],n[7]=t[e++],n[8]=t[e++],n[9]=t[e++],n[10]=t[e++],n[11]=t[e++],n[12]=t[e++],n[13]=t[e++],n[14]=t[e++],n[15]=t[e],n},c.clone=function(t,e){if(i(t))return i(e)?(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],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):new c(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])},c.fromArray=c.unpack,c.fromColumnMajorArray=function(t,e){return c.clone(t,e)},c.fromRowMajorArray=function(t,e){return i(e)?(e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15],e):new c(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},c.fromRotationTranslation=function(e,n,a){return n=r(n,t.ZERO),i(a)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=0,a[4]=e[3],a[5]=e[4],a[6]=e[5],a[7]=0,a[8]=e[6],a[9]=e[7],a[10]=e[8],a[11]=0,a[12]=n.x,a[13]=n.y,a[14]=n.z,a[15]=1,a):new c(e[0],e[3],e[6],n.x,e[1],e[4],e[7],n.y,e[2],e[5],e[8],n.z,0,0,0,1)},c.fromTranslationQuaternionRotationScale=function(t,e,n,r){i(r)||(r=new c);var a=n.x,o=n.y,u=n.z,E=e.x*e.x,s=e.x*e.y,_=e.x*e.z,T=e.x*e.w,R=e.y*e.y,l=e.y*e.z,A=e.y*e.w,f=e.z*e.z,h=e.z*e.w,N=e.w*e.w,d=E-R-f+N,I=2*(s-h),S=2*(_+A),M=2*(s+h),O=-E+R-f+N,m=2*(l-T),y=2*(_-A),p=2*(l+T),C=-E-R+f+N;return r[0]=d*a,r[1]=M*a,r[2]=y*a,r[3]=0,r[4]=I*o,r[5]=O*o,r[6]=p*o,r[7]=0,r[8]=S*u,r[9]=m*u,r[10]=C*u,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r},c.fromTranslationRotationScale=function(t,e){return c.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,e)},c.fromTranslation=function(t,e){return c.fromRotationTranslation(E.IDENTITY,t,e)},c.fromScale=function(t,e){return i(e)?(e[0]=t.x,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t.y,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t.z,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)},c.fromUniformScale=function(t,e){return i(e)?(e[0]=t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e):new c(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)};var _=new t,T=new t,R=new t;c.fromCamera=function(e,n){var r=e.position,a=e.direction,o=e.up;t.normalize(a,_),t.normalize(t.cross(_,o,T),T),t.normalize(t.cross(T,_,R),R);var u=T.x,E=T.y,s=T.z,l=_.x,A=_.y,f=_.z,h=R.x,N=R.y,d=R.z,I=r.x,S=r.y,M=r.z,O=u*-I+E*-S+s*-M,m=h*-I+N*-S+d*-M,y=l*I+A*S+f*M;return i(n)?(n[0]=u,n[1]=h,n[2]=-l,n[3]=0,n[4]=E,n[5]=N,n[6]=-A,n[7]=0,n[8]=s,n[9]=d,n[10]=-f,n[11]=0,n[12]=O,n[13]=m,n[14]=y,n[15]=1,n):new c(u,E,s,O,h,N,d,m,-l,-A,-f,y,0,0,0,1)},c.computePerspectiveFieldOfView=function(t,e,n,r,i){var a=Math.tan(.5*t),o=1/a,u=o/e,E=(r+n)/(n-r),s=2*r*n/(n-r);return i[0]=u,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=o,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=E,i[11]=-1,i[12]=0,i[13]=0,i[14]=s,i[15]=0,i},c.computeOrthographicOffCenter=function(t,e,n,r,i,a,o){var u=1/(e-t),E=1/(r-n),s=1/(a-i),c=-(e+t)*u,_=-(r+n)*E,T=-(a+i)*s;return u*=2,E*=2,s*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=s,o[11]=0,o[12]=c,o[13]=_,o[14]=T,o[15]=1,o},c.computePerspectiveOffCenter=function(t,e,n,r,i,a,o){var u=2*i/(e-t),E=2*i/(r-n),s=(e+t)/(e-t),c=(r+n)/(r-n),_=-(a+i)/(a-i),T=-1,R=-2*a*i/(a-i);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=E,o[6]=0,o[7]=0,o[8]=s,o[9]=c,o[10]=_,o[11]=T,o[12]=0,o[13]=0,o[14]=R,o[15]=0,o},c.computeInfinitePerspectiveOffCenter=function(t,e,n,r,i,a){var o=2*i/(e-t),u=2*i/(r-n),E=(e+t)/(e-t),s=(r+n)/(r-n),c=-1,_=-1,T=-2*i;return a[0]=o,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=E,a[9]=s,a[10]=c,a[11]=_,a[12]=0,a[13]=0,a[14]=T,a[15]=0,a},c.computeViewportTransformation=function(t,e,n,i){t=r(t,r.EMPTY_OBJECT);var a=r(t.x,0),o=r(t.y,0),u=r(t.width,0),E=r(t.height,0);e=r(e,0),n=r(n,1);var s=.5*u,c=.5*E,_=.5*(n-e),T=s,R=c,l=_,A=a+s,f=o+c,h=e+_,N=1;return i[0]=T,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=R,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=l,i[11]=0,i[12]=A,i[13]=f,i[14]=h,i[15]=N,i},c.computeView=function(e,n,r,i,a){return a[0]=i.x,a[1]=r.x,a[2]=-n.x,a[3]=0,a[4]=i.y,a[5]=r.y,a[6]=-n.y,a[7]=0,a[8]=i.z,a[9]=r.z,a[10]=-n.z,a[11]=0,a[12]=-t.dot(i,e),a[13]=-t.dot(r,e),a[14]=t.dot(n,e),a[15]=1,a},c.toArray=function(t,e){return i(e)?(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],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):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},c.getElementIndex=function(t,e){return 4*t+e},c.getColumn=function(t,e,n){var r=4*e,i=t[r],a=t[r+1],o=t[r+2],u=t[r+3];return n.x=i,n.y=a,n.z=o,n.w=u,n},c.setColumn=function(t,e,n,r){r=c.clone(t,r);var i=4*e;return r[i]=n.x,r[i+1]=n.y,r[i+2]=n.z,r[i+3]=n.w,r},c.setTranslation=function(t,e,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=t[15],n},c.getRow=function(t,e,n){var r=t[e],i=t[e+4],a=t[e+8],o=t[e+12];return n.x=r,n.y=i,n.z=a,n.w=o,n},c.setRow=function(t,e,n,r){return r=c.clone(t,r),r[e]=n.x,r[e+4]=n.y,r[e+8]=n.z,r[e+12]=n.w,r};var l=new t;c.getScale=function(e,n){return n.x=t.magnitude(t.fromElements(e[0],e[1],e[2],l)),n.y=t.magnitude(t.fromElements(e[4],e[5],e[6],l)),n.z=t.magnitude(t.fromElements(e[8],e[9],e[10],l)),n};var A=new t;c.getMaximumScale=function(e){return c.getScale(e,A),t.maximumComponent(A)},c.multiply=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[3],u=t[4],E=t[5],s=t[6],c=t[7],_=t[8],T=t[9],R=t[10],l=t[11],A=t[12],f=t[13],h=t[14],N=t[15],d=e[0],I=e[1],S=e[2],M=e[3],O=e[4],m=e[5],y=e[6],p=e[7],C=e[8],U=e[9],P=e[10],L=e[11],F=e[12],v=e[13],w=e[14],D=e[15],B=r*d+u*I+_*S+A*M,g=i*d+E*I+T*S+f*M,x=a*d+s*I+R*S+h*M,G=o*d+c*I+l*S+N*M,z=r*O+u*m+_*y+A*p,b=i*O+E*m+T*y+f*p,X=a*O+s*m+R*y+h*p,V=o*O+c*m+l*y+N*p,H=r*C+u*U+_*P+A*L,W=i*C+E*U+T*P+f*L,q=a*C+s*U+R*P+h*L,Y=o*C+c*U+l*P+N*L,k=r*F+u*v+_*w+A*D,K=i*F+E*v+T*w+f*D,Z=a*F+s*v+R*w+h*D,j=o*F+c*v+l*w+N*D;return n[0]=B,n[1]=g,n[2]=x,n[3]=G,n[4]=z,n[5]=b,n[6]=X,n[7]=V,n[8]=H,n[9]=W,n[10]=q,n[11]=Y,n[12]=k,n[13]=K,n[14]=Z,n[15]=j,n},c.add=function(t,e,n){return n[0]=t[0]+e[0],n[1]=t[1]+e[1],n[2]=t[2]+e[2],n[3]=t[3]+e[3],n[4]=t[4]+e[4],n[5]=t[5]+e[5],n[6]=t[6]+e[6],n[7]=t[7]+e[7],n[8]=t[8]+e[8],n[9]=t[9]+e[9],n[10]=t[10]+e[10],n[11]=t[11]+e[11],n[12]=t[12]+e[12],n[13]=t[13]+e[13],n[14]=t[14]+e[14],n[15]=t[15]+e[15],n},c.subtract=function(t,e,n){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n[2]=t[2]-e[2],n[3]=t[3]-e[3],n[4]=t[4]-e[4],n[5]=t[5]-e[5],n[6]=t[6]-e[6],n[7]=t[7]-e[7],n[8]=t[8]-e[8],n[9]=t[9]-e[9],n[10]=t[10]-e[10],n[11]=t[11]-e[11],n[12]=t[12]-e[12],n[13]=t[13]-e[13],n[14]=t[14]-e[14],n[15]=t[15]-e[15],n},c.multiplyTransformation=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=t[12],R=t[13],l=t[14],A=e[0],f=e[1],h=e[2],N=e[4],d=e[5],I=e[6],S=e[8],M=e[9],O=e[10],m=e[12],y=e[13],p=e[14],C=r*A+o*f+s*h,U=i*A+u*f+c*h,P=a*A+E*f+_*h,L=r*N+o*d+s*I,F=i*N+u*d+c*I,v=a*N+E*d+_*I,w=r*S+o*M+s*O,D=i*S+u*M+c*O,B=a*S+E*M+_*O,g=r*m+o*y+s*p+T,x=i*m+u*y+c*p+R,G=a*m+E*y+_*p+l;return n[0]=C,n[1]=U,n[2]=P,n[3]=0,n[4]=L,n[5]=F,n[6]=v,n[7]=0,n[8]=w,n[9]=D,n[10]=B,n[11]=0,n[12]=g,n[13]=x,n[14]=G,n[15]=1,n},c.multiplyByMatrix3=function(t,e,n){var r=t[0],i=t[1],a=t[2],o=t[4],u=t[5],E=t[6],s=t[8],c=t[9],_=t[10],T=e[0],R=e[1],l=e[2],A=e[3],f=e[4],h=e[5],N=e[6],d=e[7],I=e[8],S=r*T+o*R+s*l,M=i*T+u*R+c*l,O=a*T+E*R+_*l,m=r*A+o*f+s*h,y=i*A+u*f+c*h,p=a*A+E*f+_*h,C=r*N+o*d+s*I,U=i*N+u*d+c*I,P=a*N+E*d+_*I;return n[0]=S,n[1]=M,n[2]=O,n[3]=0,n[4]=m,n[5]=y,n[6]=p,n[7]=0,n[8]=C,n[9]=U,n[10]=P,n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},c.multiplyByTranslation=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=r*t[0]+i*t[4]+a*t[8]+t[12],u=r*t[1]+i*t[5]+a*t[9]+t[13],E=r*t[2]+i*t[6]+a*t[10]+t[14];return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=o,n[13]=u,n[14]=E,n[15]=t[15],n};var f=new t;c.multiplyByUniformScale=function(t,e,n){return f.x=e,f.y=e,f.z=e,c.multiplyByScale(t,f,n)},c.multiplyByScale=function(t,e,n){var r=e.x,i=e.y,a=e.z;return 1===r&&1===i&&1===a?c.clone(t,n):(n[0]=r*t[0],n[1]=r*t[1],n[2]=r*t[2],n[3]=0,n[4]=i*t[4],n[5]=i*t[5],n[6]=i*t[6],n[7]=0,n[8]=a*t[8],n[9]=a*t[9],n[10]=a*t[10],n[11]=0,n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=1,n)},c.multiplyByVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=e.w,u=t[0]*r+t[4]*i+t[8]*a+t[12]*o,E=t[1]*r+t[5]*i+t[9]*a+t[13]*o,s=t[2]*r+t[6]*i+t[10]*a+t[14]*o,c=t[3]*r+t[7]*i+t[11]*a+t[15]*o;return n.x=u,n.y=E,n.z=s,n.w=c,n},c.multiplyByPointAsVector=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a,u=t[1]*r+t[5]*i+t[9]*a,E=t[2]*r+t[6]*i+t[10]*a;return n.x=o,n.y=u,n.z=E,n},c.multiplyByPoint=function(t,e,n){var r=e.x,i=e.y,a=e.z,o=t[0]*r+t[4]*i+t[8]*a+t[12],u=t[1]*r+t[5]*i+t[9]*a+t[13],E=t[2]*r+t[6]*i+t[10]*a+t[14];return n.x=o,n.y=u,n.z=E,n},c.multiplyByScalar=function(t,e,n){return n[0]=t[0]*e,n[1]=t[1]*e,n[2]=t[2]*e,n[3]=t[3]*e,n[4]=t[4]*e,n[5]=t[5]*e,n[6]=t[6]*e,n[7]=t[7]*e,n[8]=t[8]*e,n[9]=t[9]*e,n[10]=t[10]*e,n[11]=t[11]*e,n[12]=t[12]*e,n[13]=t[13]*e,n[14]=t[14]*e,n[15]=t[15]*e,n},c.negate=function(t,e){return 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],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},c.transpose=function(t,e){var n=t[1],r=t[2],i=t[3],a=t[6],o=t[7],u=t[11];return e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=a,e[10]=t[10],e[11]=t[14],e[12]=i,e[13]=o,e[14]=u,e[15]=t[15],e},c.abs=function(t,e){return e[0]=Math.abs(t[0]),e[1]=Math.abs(t[1]),e[2]=Math.abs(t[2]),e[3]=Math.abs(t[3]),e[4]=Math.abs(t[4]),e[5]=Math.abs(t[5]),e[6]=Math.abs(t[6]),e[7]=Math.abs(t[7]),e[8]=Math.abs(t[8]),e[9]=Math.abs(t[9]),e[10]=Math.abs(t[10]),e[11]=Math.abs(t[11]),e[12]=Math.abs(t[12]),e[13]=Math.abs(t[13]),e[14]=Math.abs(t[14]),e[15]=Math.abs(t[15]),e},c.equals=function(t,e){return t===e||i(t)&&i(e)&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[3]===e[3]&&t[7]===e[7]&&t[11]===e[11]&&t[15]===e[15]},c.equalsEpsilon=function(t,e,n){return t===e||i(t)&&i(e)&&Math.abs(t[0]-e[0])<=n&&Math.abs(t[1]-e[1])<=n&&Math.abs(t[2]-e[2])<=n&&Math.abs(t[3]-e[3])<=n&&Math.abs(t[4]-e[4])<=n&&Math.abs(t[5]-e[5])<=n&&Math.abs(t[6]-e[6])<=n&&Math.abs(t[7]-e[7])<=n&&Math.abs(t[8]-e[8])<=n&&Math.abs(t[9]-e[9])<=n&&Math.abs(t[10]-e[10])<=n&&Math.abs(t[11]-e[11])<=n&&Math.abs(t[12]-e[12])<=n&&Math.abs(t[13]-e[13])<=n&&Math.abs(t[14]-e[14])<=n&&Math.abs(t[15]-e[15])<=n},c.getTranslation=function(t,e){return e.x=t[12],e.y=t[13],e.z=t[14],e},c.getRotation=function(t,e){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e};var h=new E,N=new E,d=new e,I=new e(0,0,0,1);return c.inverse=function(t,n){if(E.equalsEpsilon(c.getRotation(t,h),N,u.EPSILON7)&&e.equals(c.getRow(t,3,d),I))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;var r=t[0],i=t[4],a=t[8],o=t[12],_=t[1],T=t[5],R=t[9],l=t[13],A=t[2],f=t[6],S=t[10],M=t[14],O=t[3],m=t[7],y=t[11],p=t[15],C=S*p,U=M*y,P=f*p,L=M*m,F=f*y,v=S*m,w=A*p,D=M*O,B=A*y,g=S*O,x=A*m,G=f*O,z=C*T+L*R+F*l-(U*T+P*R+v*l),b=U*_+w*R+g*l-(C*_+D*R+B*l),X=P*_+D*T+x*l-(L*_+w*T+G*l),V=v*_+B*T+G*R-(F*_+g*T+x*R),H=U*i+P*a+v*o-(C*i+L*a+F*o),W=C*r+D*a+B*o-(U*r+w*a+g*o),q=L*r+w*i+G*o-(P*r+D*i+x*o),Y=F*r+g*i+x*a-(v*r+B*i+G*a);C=a*l,U=o*R,P=i*l,L=o*T,F=i*R,v=a*T,w=r*l,D=o*_,B=r*R,g=a*_,x=r*T,G=i*_;var k=C*m+L*y+F*p-(U*m+P*y+v*p),K=U*O+w*y+g*p-(C*O+D*y+B*p),Z=P*O+D*m+x*p-(L*O+w*m+G*p),j=v*O+B*m+G*y-(F*O+g*m+x*y),Q=P*S+v*M+U*f-(F*M+C*f+L*S),J=B*M+C*A+D*S-(w*S+g*M+U*A),$=w*f+G*M+L*A-(x*M+P*A+D*f),tt=x*S+F*A+g*f-(B*f+G*S+v*A),et=r*z+i*b+a*X+o*V;if(Math.abs(et)<u.EPSILON20)throw new s("matrix is not invertible because its determinate is zero.");return et=1/et,n[0]=z*et,n[1]=b*et,n[2]=X*et,n[3]=V*et,n[4]=H*et,n[5]=W*et,n[6]=q*et,n[7]=Y*et,n[8]=k*et,n[9]=K*et,n[10]=Z*et,n[11]=j*et,n[12]=Q*et,n[13]=J*et,n[14]=$*et,n[15]=tt*et,n},c.inverseTransformation=function(t,e){var n=t[0],r=t[1],i=t[2],a=t[4],o=t[5],u=t[6],E=t[8],s=t[9],c=t[10],_=t[12],T=t[13],R=t[14],l=-n*_-r*T-i*R,A=-a*_-o*T-u*R,f=-E*_-s*T-c*R;return e[0]=n,e[1]=a,e[2]=E,e[3]=0,e[4]=r,e[5]=o,e[6]=s,e[7]=0,e[8]=i,e[9]=u,e[10]=c,e[11]=0,e[12]=l,e[13]=A,e[14]=f,e[15]=1,e},c.IDENTITY=o(new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),c.ZERO=o(new c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),c.COLUMN0ROW0=0,c.COLUMN0ROW1=1,c.COLUMN0ROW2=2,c.COLUMN0ROW3=3,c.COLUMN1ROW0=4,c.COLUMN1ROW1=5,c.COLUMN1ROW2=6,c.COLUMN1ROW3=7,c.COLUMN2ROW0=8,c.COLUMN2ROW1=9,c.COLUMN2ROW2=10,c.COLUMN2ROW3=11,c.COLUMN3ROW0=12,c.COLUMN3ROW1=13,c.COLUMN3ROW2=14,c.COLUMN3ROW3=15,a(c.prototype,{length:{get:function(){return c.packedLength}}}),c.prototype.clone=function(t){return c.clone(this,t)},c.prototype.equals=function(t){return c.equals(this,t)},c.equalsArray=function(t,e,n){return t[0]===e[n]&&t[1]===e[n+1]&&t[2]===e[n+2]&&t[3]===e[n+3]&&t[4]===e[n+4]&&t[5]===e[n+5]&&t[6]===e[n+6]&&t[7]===e[n+7]&&t[8]===e[n+8]&&t[9]===e[n+9]&&t[10]===e[n+10]&&t[11]===e[n+11]&&t[12]===e[n+12]&&t[13]===e[n+13]&&t[14]===e[n+14]&&t[15]===e[n+15]},c.prototype.equalsEpsilon=function(t,e){return c.equalsEpsilon(this,t,e)},c.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},c}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(t,e,n,r,i,a,o,u){"use strict";function E(t,e,r,i){this.west=n(t,0),this.south=n(e,0),this.east=n(r,0),this.north=n(i,0)}i(E.prototype,{width:{get:function(){return E.computeWidth(this)}},height:{get:function(){return E.computeHeight(this)}}}),E.packedLength=4,E.pack=function(t,e,r){return r=n(r,0),e[r++]=t.west,e[r++]=t.south,e[r++]=t.east,e[r]=t.north,e},E.unpack=function(t,e,i){return e=n(e,0),r(i)||(i=new E),i.west=t[e++],i.south=t[e++],i.east=t[e++],i.north=t[e],i},E.computeWidth=function(t){var e=t.east,n=t.west;return e<n&&(e+=u.TWO_PI),e-n},E.computeHeight=function(t){return t.north-t.south},E.fromDegrees=function(t,e,i,a,o){return t=u.toRadians(n(t,0)),e=u.toRadians(n(e,0)),i=u.toRadians(n(i,0)),a=u.toRadians(n(a,0)),r(o)?(o.west=t,o.south=e,o.east=i,o.north=a,o):new E(t,e,i,a)},E.fromRadians=function(t,e,i,a,o){return r(o)?(o.west=n(t,0),o.south=n(e,0),o.east=n(i,0),o.north=n(a,0),o):new E(t,e,i,a)},E.fromCartographicArray=function(t,e){for(var n=Number.MAX_VALUE,i=-Number.MAX_VALUE,a=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE,_=0,T=t.length;_<T;_++){var R=t[_];n=Math.min(n,R.longitude),i=Math.max(i,R.longitude),s=Math.min(s,R.latitude),c=Math.max(c,R.latitude);var l=R.longitude>=0?R.longitude:R.longitude+u.TWO_PI;a=Math.min(a,l),o=Math.max(o,l)}return i-n>o-a&&(n=a,i=o,i>u.PI&&(i-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(e)?(e.west=n,e.south=s,e.east=i,e.north=c,e):new E(n,s,i,c)},E.fromCartesianArray=function(t,e,n){for(var i=Number.MAX_VALUE,a=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=Number.MAX_VALUE,_=-Number.MAX_VALUE,T=0,R=t.length;T<R;T++){var l=e.cartesianToCartographic(t[T]);i=Math.min(i,l.longitude),a=Math.max(a,l.longitude),c=Math.min(c,l.latitude),_=Math.max(_,l.latitude);var A=l.longitude>=0?l.longitude:l.longitude+u.TWO_PI;o=Math.min(o,A),s=Math.max(s,A)}return a-i>s-o&&(i=o,a=s,a>u.PI&&(a-=u.TWO_PI),i>u.PI&&(i-=u.TWO_PI)),r(n)?(n.west=i,n.south=c,n.east=a,n.north=_,n):new E(i,c,a,_)},E.clone=function(t,e){if(r(t))return r(e)?(e.west=t.west,e.south=t.south,e.east=t.east,e.north=t.north,e):new E(t.west,t.south,t.east,t.north)},E.prototype.clone=function(t){return E.clone(this,t)},E.prototype.equals=function(t){return E.equals(this,t)},E.equals=function(t,e){return t===e||r(t)&&r(e)&&t.west===e.west&&t.south===e.south&&t.east===e.east&&t.north===e.north},E.prototype.equalsEpsilon=function(t,e){return r(t)&&Math.abs(this.west-t.west)<=e&&Math.abs(this.south-t.south)<=e&&Math.abs(this.east-t.east)<=e&&Math.abs(this.north-t.north)<=e},E.validate=function(t){},E.southwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.south,n.height=0,n):new t(e.west,e.south)},E.northwest=function(e,n){return r(n)?(n.longitude=e.west,n.latitude=e.north,n.height=0,n):new t(e.west,e.north)},E.northeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.north,n.height=0,n):new t(e.east,e.north)},E.southeast=function(e,n){return r(n)?(n.longitude=e.east,n.latitude=e.south,n.height=0,n):new t(e.east,e.south)},E.center=function(e,n){var i=e.east,a=e.west;i<a&&(i+=u.TWO_PI);var o=u.negativePiToPi(.5*(a+i)),E=.5*(e.south+e.north);return r(n)?(n.longitude=o,n.latitude=E,n.height=0,n):new t(o,E)},E.intersection=function(t,e,n){var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.negativePiToPi(Math.max(a,s)),_=u.negativePiToPi(Math.min(i,o));if(!((t.west<t.east||e.west<e.east)&&_<=c)){var T=Math.max(t.south,e.south),R=Math.min(t.north,e.north);if(!(T>=R))return r(n)?(n.west=c,n.south=T,n.east=_,n.north=R,n):new E(c,T,_,R)}},E.simpleIntersection=function(t,e,n){var i=Math.max(t.west,e.west),a=Math.max(t.south,e.south),o=Math.min(t.east,e.east),u=Math.min(t.north,e.north);if(!(a>=u||i>=o))return r(n)?(n.west=i,n.south=a,n.east=o,n.north=u,n):new E(i,a,o,u)},E.union=function(t,e,n){r(n)||(n=new E);var i=t.east,a=t.west,o=e.east,s=e.west;i<a&&o>0?i+=u.TWO_PI:o<s&&i>0&&(o+=u.TWO_PI),i<a&&s<0?s+=u.TWO_PI:o<s&&a<0&&(a+=u.TWO_PI);var c=u.convertLongitudeRange(Math.min(a,s)),_=u.convertLongitudeRange(Math.max(i,o));return n.west=c,n.south=Math.min(t.south,e.south),n.east=_,n.north=Math.max(t.north,e.north),n},E.expand=function(t,e,n){return r(n)||(n=new E),n.west=Math.min(t.west,e.longitude),n.south=Math.min(t.south,e.latitude),n.east=Math.max(t.east,e.longitude),n.north=Math.max(t.north,e.latitude),n},E.contains=function(t,e){var n=e.longitude,r=e.latitude,i=t.west,a=t.east;return a<i&&(a+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>i||u.equalsEpsilon(n,i,u.EPSILON14))&&(n<a||u.equalsEpsilon(n,a,u.EPSILON14))&&r>=t.south&&r<=t.north};var s=new t;return E.subsample=function(t,e,i,o){e=n(e,a.WGS84),i=n(i,0),r(o)||(o=[]);var c=0,_=t.north,T=t.south,R=t.east,l=t.west,A=s;A.height=i,A.longitude=l,A.latitude=_,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.latitude=T,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=l,o[c]=e.cartographicToCartesian(A,o[c]),c++,_<0?A.latitude=_:T>0?A.latitude=T:A.latitude=0;for(var f=1;f<8;++f)A.longitude=-Math.PI+f*u.PI_OVER_TWO,E.contains(t,A)&&(o[c]=e.cartographicToCartesian(A,o[c]),c++);return 0===A.latitude&&(A.longitude=l,o[c]=e.cartographicToCartesian(A,o[c]),c++,A.longitude=R,o[c]=e.cartographicToCartesian(A,o[c]),c++),o.length=c,o},E.MAX_VALUE=o(new E(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),E}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(t,e,n,r,i,a,o,u,E,s,c,_){"use strict";function T(e,n){this.center=t.clone(r(e,t.ZERO)),this.radius=r(n,0)}var R=new t,l=new t,A=new t,f=new t,h=new t,N=new t,d=new t,I=new t,S=new t,M=new t,O=new t,m=new t;T.fromPoints=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;for(var r=t.clone(e[0],d),a=t.clone(r,R),o=t.clone(r,l),u=t.clone(r,A),E=t.clone(r,f),s=t.clone(r,h),c=t.clone(r,N),_=e.length,y=1;y<_;y++){t.clone(e[y],r);var p=r.x,C=r.y,U=r.z;p<a.x&&t.clone(r,a),p>E.x&&t.clone(r,E),C<o.y&&t.clone(r,o),C>s.y&&t.clone(r,s),U<u.z&&t.clone(r,u),U>c.z&&t.clone(r,c)}var P=t.magnitudeSquared(t.subtract(E,a,I)),L=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),v=a,w=E,D=P;L>D&&(D=L,v=o,w=s),F>D&&(D=F,v=u,w=c);var B=S;B.x=.5*(v.x+w.x),B.y=.5*(v.y+w.y),B.z=.5*(v.z+w.z);var g=t.magnitudeSquared(t.subtract(w,B,I)),x=Math.sqrt(g),G=M;G.x=a.x,G.y=o.y,G.z=u.z;var z=O;z.x=E.x,z.y=s.y,z.z=c.z;var b=t.multiplyByScalar(t.add(G,z,I),.5,m),X=0;for(y=0;y<_;y++){t.clone(e[y],r);var V=t.magnitude(t.subtract(r,b,I));V>X&&(X=V);var H=t.magnitudeSquared(t.subtract(r,B,I));if(H>g){var W=Math.sqrt(H);x=.5*(x+W),g=x*x;var q=W-x;B.x=(x*B.x+q*r.x)/W,B.y=(x*B.y+q*r.y)/W,B.z=(x*B.z+q*r.z)/W}}return x<X?(t.clone(B,n.center),n.radius=x):(t.clone(b,n.center),n.radius=X),n};var y=new o,p=new t,C=new t,U=new e,P=new e;T.fromRectangle2D=function(t,e,n){return T.fromRectangleWithHeights2D(t,e,0,0,n)},T.fromRectangleWithHeights2D=function(e,n,a,o,u){if(i(u)||(u=new T),!i(e))return u.center=t.clone(t.ZERO,u.center),u.radius=0,u;n=r(n,y),_.southwest(e,U),U.height=a,_.northeast(e,P),P.height=o;var E=n.project(U,p),s=n.project(P,C),c=s.x-E.x,R=s.y-E.y,l=s.z-E.z;u.radius=.5*Math.sqrt(c*c+R*R+l*l);var A=u.center;return A.x=E.x+.5*c,A.y=E.y+.5*R,A.z=E.z+.5*l,u};var L=[];T.fromRectangle3D=function(t,e,n,o){e=r(e,a.WGS84),n=r(n,0);var u;return i(t)&&(u=_.subsample(t,e,n,L)),T.fromPoints(u,o)},T.fromVertices=function(e,n,a,o){if(i(o)||(o=new T),!i(e)||0===e.length)return o.center=t.clone(t.ZERO,o.center),o.radius=0,o;n=r(n,t.ZERO),a=r(a,3);var u=d;u.x=e[0]+n.x,u.y=e[1]+n.y,u.z=e[2]+n.z;for(var E=t.clone(u,R),s=t.clone(u,l),c=t.clone(u,A),_=t.clone(u,f),y=t.clone(u,h),p=t.clone(u,N),C=e.length,U=0;U<C;U+=a){var P=e[U]+n.x,L=e[U+1]+n.y,F=e[U+2]+n.z;u.x=P,u.y=L,u.z=F,P<E.x&&t.clone(u,E),P>_.x&&t.clone(u,_),L<s.y&&t.clone(u,s),L>y.y&&t.clone(u,y),F<c.z&&t.clone(u,c),F>p.z&&t.clone(u,p)}var v=t.magnitudeSquared(t.subtract(_,E,I)),w=t.magnitudeSquared(t.subtract(y,s,I)),D=t.magnitudeSquared(t.subtract(p,c,I)),B=E,g=_,x=v;w>x&&(x=w,B=s,g=y),D>x&&(x=D,B=c,g=p);var G=S;G.x=.5*(B.x+g.x),G.y=.5*(B.y+g.y),G.z=.5*(B.z+g.z);var z=t.magnitudeSquared(t.subtract(g,G,I)),b=Math.sqrt(z),X=M;X.x=E.x,X.y=s.y,X.z=c.z;var V=O;V.x=_.x,V.y=y.y,V.z=p.z;var H=t.multiplyByScalar(t.add(X,V,I),.5,m),W=0;for(U=0;U<C;U+=a){u.x=e[U]+n.x,u.y=e[U+1]+n.y,u.z=e[U+2]+n.z;var q=t.magnitude(t.subtract(u,H,I));q>W&&(W=q);var Y=t.magnitudeSquared(t.subtract(u,G,I));if(Y>z){var k=Math.sqrt(Y);b=.5*(b+k),z=b*b;var K=k-b;G.x=(b*G.x+K*u.x)/k,G.y=(b*G.y+K*u.y)/k,G.z=(b*G.z+K*u.z)/k}}return b<W?(t.clone(G,o.center),o.radius=b):(t.clone(H,o.center),o.radius=W),o},T.fromEncodedCartesianVertices=function(e,n,r){if(i(r)||(r=new T),!i(e)||!i(n)||e.length!==n.length||0===e.length)return r.center=t.clone(t.ZERO,r.center),r.radius=0,r;var a=d;a.x=e[0]+n[0],a.y=e[1]+n[1],a.z=e[2]+n[2];for(var o=t.clone(a,R),u=t.clone(a,l),E=t.clone(a,A),s=t.clone(a,f),c=t.clone(a,h),_=t.clone(a,N),y=e.length,p=0;p<y;p+=3){var C=e[p]+n[p],U=e[p+1]+n[p+1],P=e[p+2]+n[p+2];a.x=C,a.y=U,a.z=P,C<o.x&&t.clone(a,o),C>s.x&&t.clone(a,s),U<u.y&&t.clone(a,u),U>c.y&&t.clone(a,c),P<E.z&&t.clone(a,E),P>_.z&&t.clone(a,_)}var L=t.magnitudeSquared(t.subtract(s,o,I)),F=t.magnitudeSquared(t.subtract(c,u,I)),v=t.magnitudeSquared(t.subtract(_,E,I)),w=o,D=s,B=L;F>B&&(B=F,w=u,D=c),v>B&&(B=v,w=E,D=_);var g=S;g.x=.5*(w.x+D.x),g.y=.5*(w.y+D.y),g.z=.5*(w.z+D.z);var x=t.magnitudeSquared(t.subtract(D,g,I)),G=Math.sqrt(x),z=M;z.x=o.x,z.y=u.y,z.z=E.z;var b=O;b.x=s.x,b.y=c.y,b.z=_.z;var X=t.multiplyByScalar(t.add(z,b,I),.5,m),V=0;for(p=0;p<y;p+=3){a.x=e[p]+n[p],a.y=e[p+1]+n[p+1],a.z=e[p+2]+n[p+2];var H=t.magnitude(t.subtract(a,X,I));H>V&&(V=H);var W=t.magnitudeSquared(t.subtract(a,g,I));if(W>x){var q=Math.sqrt(W);G=.5*(G+q),x=G*G;var Y=q-G;g.x=(G*g.x+Y*a.x)/q,g.y=(G*g.y+Y*a.y)/q,g.z=(G*g.z+Y*a.z)/q}}return G<V?(t.clone(g,r.center),r.radius=G):(t.clone(X,r.center),r.radius=V),r},T.fromCornerPoints=function(e,n,r){i(r)||(r=new T);var a=r.center;return t.add(e,n,a),t.multiplyByScalar(a,.5,a),r.radius=t.distance(a,n),r},T.fromEllipsoid=function(e,n){return i(n)||(n=new T),t.clone(t.ZERO,n.center),n.radius=e.maximumRadius,n};var F=new t;T.fromBoundingSpheres=function(e,n){if(i(n)||(n=new T),!i(e)||0===e.length)return n.center=t.clone(t.ZERO,n.center),n.radius=0,n;var r=e.length;if(1===r)return T.clone(e[0],n);if(2===r)return T.union(e[0],e[1],n);for(var a=[],o=0;o<r;o++)a.push(e[o].center);n=T.fromPoints(a,n);var u=n.center,E=n.radius;for(o=0;o<r;o++){var s=e[o];E=Math.max(E,t.distance(u,s.center,F)+s.radius)}return n.radius=E,n};var v=new t,w=new t,D=new t;T.fromOrientedBoundingBox=function(e,n){i(n)||(n=new T);var r=e.halfAxes,a=s.getColumn(r,0,v),o=s.getColumn(r,1,w),u=s.getColumn(r,2,D);return t.add(a,o,a),t.add(a,u,a),n.center=t.clone(e.center,n.center),n.radius=t.magnitude(a),n},T.clone=function(e,n){if(i(e))return i(n)?(n.center=t.clone(e.center,n.center),n.radius=e.radius,n):new T(e.center,e.radius)},T.packedLength=4,T.pack=function(t,e,n){n=r(n,0);var i=t.center;return e[n++]=i.x,e[n++]=i.y,e[n++]=i.z,e[n]=t.radius,e},T.unpack=function(t,e,n){e=r(e,0),i(n)||(n=new T);var a=n.center;return a.x=t[e++],a.y=t[e++],a.z=t[e++],n.radius=t[e],n};var B=new t,g=new t;T.union=function(e,n,r){i(r)||(r=new T);var a=e.center,o=e.radius,u=n.center,E=n.radius,s=t.subtract(u,a,B),c=t.magnitude(s);if(o>=c+E)return e.clone(r),r;if(E>=c+o)return n.clone(r),r;var _=.5*(o+c+E),R=t.multiplyByScalar(s,(-o+_)/c,g);return t.add(R,a,R),t.clone(R,r.center),r.radius=_,r};var x=new t;T.expand=function(e,n,r){r=T.clone(e,r);var i=t.magnitude(t.subtract(n,r.center,x));return i>r.radius&&(r.radius=i),r},T.intersectPlane=function(e,n){var r=e.center,i=e.radius,a=n.normal,o=t.dot(a,r)+n.distance;return o<-i?u.OUTSIDE:o<i?u.INTERSECTING:u.INSIDE},T.transform=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=c.getMaximumScale(e)*t.radius,n};var G=new t;T.distanceSquaredTo=function(e,n){var r=t.subtract(e.center,n,G);return t.magnitudeSquared(r)-e.radius*e.radius},T.transformWithoutScale=function(t,e,n){return i(n)||(n=new T),n.center=c.multiplyByPoint(e,t.center,n.center),n.radius=t.radius,n};var z=new t;T.computePlaneDistances=function(e,n,r,a){i(a)||(a=new E);var o=t.subtract(e.center,n,z),u=t.dot(r,o);return a.start=u-e.radius,a.stop=u+e.radius,a};for(var b=new t,X=new t,V=new t,H=new t,W=new t,q=new e,Y=new Array(8),k=0;k<8;++k)Y[k]=new t;var K=new o;return T.projectTo2D=function(e,n,i){n=r(n,K);var a=n.ellipsoid,o=e.center,u=e.radius,E=a.geodeticSurfaceNormal(o,b),s=t.cross(t.UNIT_Z,E,X);t.normalize(s,s);var c=t.cross(E,s,V);t.normalize(c,c),t.multiplyByScalar(E,u,E),t.multiplyByScalar(c,u,c),t.multiplyByScalar(s,u,s);var _=t.negate(c,W),R=t.negate(s,H),l=Y,A=l[0];t.add(E,c,A),t.add(A,s,A),A=l[1],t.add(E,c,A),t.add(A,R,A),A=l[2],t.add(E,_,A),t.add(A,R,A),A=l[3],t.add(E,_,A),t.add(A,s,A),t.negate(E,E),A=l[4],t.add(E,c,A),t.add(A,s,A),A=l[5],t.add(E,c,A),t.add(A,R,A),A=l[6],t.add(E,_,A),t.add(A,R,A),A=l[7],t.add(E,_,A),t.add(A,s,A);for(var f=l.length,h=0;h<f;++h){var N=l[h];t.add(o,N,N);var d=a.cartesianToCartographic(N,q);n.project(d,N)}i=T.fromPoints(l,i),o=i.center;var I=o.x,S=o.y,M=o.z;return o.x=M,o.y=I,o.z=S,i},T.isOccluded=function(t,e){return!e.isBoundingSphereVisible(t)},T.equals=function(e,n){return e===n||i(e)&&i(n)&&t.equals(e.center,n.center)&&e.radius===n.radius},T.prototype.intersectPlane=function(t){return T.intersectPlane(this,t)},T.prototype.distanceSquaredTo=function(t){return T.distanceSquaredTo(this,t)},T.prototype.computePlaneDistances=function(t,e,n){return T.computePlaneDistances(this,t,e,n)},T.prototype.isOccluded=function(t){return T.isOccluded(this,t)},T.prototype.equals=function(t){return T.equals(this,t)},T.prototype.clone=function(t){return T.clone(this,t)},T}),define("Core/Fullscreen",["./defined","./defineProperties"],function(t,e){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},i={};return e(i,{element:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(i.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(i.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(i.supportsFullscreen())return null!==i.element}}}),i.supportsFullscreen=function(){if(t(n))return n;n=!1;var e=document.body;if("function"==typeof e.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var i,a=["webkit","moz","o","ms","khtml"],o=0,u=a.length;o<u;++o){var E=a[o];i=E+"RequestFullscreen","function"==typeof e[i]?(r.requestFullscreen=i,n=!0):(i=E+"RequestFullScreen","function"==typeof e[i]&&(r.requestFullscreen=i,n=!0)),i=E+"ExitFullscreen","function"==typeof document[i]?r.exitFullscreen=i:(i=E+"CancelFullScreen","function"==typeof document[i]&&(r.exitFullscreen=i)),i=E+"FullscreenEnabled",void 0!==document[i]?r.fullscreenEnabled=i:(i=E+"FullScreenEnabled",void 0!==document[i]&&(r.fullscreenEnabled=i)),i=E+"FullscreenElement",void 0!==document[i]?r.fullscreenElement=i:(i=E+"FullScreenElement",void 0!==document[i]&&(r.fullscreenElement=i)),i=E+"fullscreenchange",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenChange"),r.fullscreenchange=i),i=E+"fullscreenerror",void 0!==document["on"+i]&&("ms"===E&&(i="MSFullscreenError"),r.fullscreenerror=i)}return n},i.requestFullscreen=function(t,e){i.supportsFullscreen()&&t[r.requestFullscreen]({vrDisplay:e})},i.exitFullscreen=function(){i.supportsFullscreen()&&document[r.exitFullscreen]()},i}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(t,e,n){"use strict";function r(t){for(var e=t.split("."),n=0,r=e.length;n<r;++n)e[n]=parseInt(e[n],10);return e}function i(){if(!e(S)&&(S=!1,!T())){var t=/ Chrome\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(S=!0,M=r(t[1]))}return S}function a(){return i()&&M}function o(){if(!e(O)&&(O=!1,!i()&&!T()&&/ Safari\/[\.0-9]+/.test(I.userAgent))){var t=/ Version\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(O=!0,m=r(t[1]))}return O}function u(){return o()&&m}function E(){if(!e(y)){y=!1;var t=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(I.userAgent);null!==t&&(y=!0,p=r(t[1]),p.isNightly=!!t[2])}return y}function s(){return E()&&p}function c(){if(!e(C)){C=!1;var t;"Microsoft Internet Explorer"===I.appName?(t=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1]))):"Netscape"===I.appName&&(t=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(I.userAgent),null!==t&&(C=!0,U=r(t[1])))}return C}function _(){return c()&&U}function T(){if(!e(P)){P=!1;var t=/ Edge\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(P=!0,L=r(t[1]))}return P}function R(){return T()&&L}function l(){if(!e(F)){F=!1;var t=/Firefox\/([\.0-9]+)/.exec(I.userAgent);null!==t&&(F=!0,v=r(t[1])); +}return F}function A(){return e(w)||(w=/Windows/i.test(I.appVersion)),w}function f(){return l()&&v}function h(){return e(D)||(D="undefined"!=typeof PointerEvent&&(!e(I.pointerEnabled)||I.pointerEnabled)),D}function N(){if(!e(g)){var t=document.createElement("canvas");t.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=t.style.imageRendering;g=e(n)&&""!==n,g&&(B=n)}return g}function d(){return N()?B:void 0}var I;I="undefined"!=typeof navigator?navigator:{};var S,M,O,m,y,p,C,U,P,L,F,v,w,D,B,g,x={isChrome:i,chromeVersion:a,isSafari:o,safariVersion:u,isWebkit:E,webkitVersion:s,isInternetExplorer:c,internetExplorerVersion:_,isEdge:T,edgeVersion:R,isFirefox:l,firefoxVersion:f,isWindows:A,hardwareConcurrency:t(I.hardwareConcurrency,3),supportsPointerEvents:h,supportsImageRenderingPixelated:N,imageRenderingValue:d};return x.supportsFullscreen=function(){return n.supportsFullscreen()},x.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},x.supportsWebWorkers=function(){return"undefined"!=typeof Worker},x}),define("Core/WebGLConstants",["./freezeObject"],function(t){"use strict";var e={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,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};return t(e)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(t,e,n,r,i,a){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:a.BYTE,UNSIGNED_BYTE:a.UNSIGNED_BYTE,SHORT:a.SHORT,UNSIGNED_SHORT:a.UNSIGNED_SHORT,INT:a.INT,UNSIGNED_INT:a.UNSIGNED_INT,FLOAT:a.FLOAT,DOUBLE:a.DOUBLE};return o.getSizeInBytes=function(t){switch(t){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(t){return t instanceof Int8Array?o.BYTE:t instanceof Uint8Array?o.UNSIGNED_BYTE:t instanceof Int16Array?o.SHORT:t instanceof Uint16Array?o.UNSIGNED_SHORT:t instanceof Int32Array?o.INT:t instanceof Uint32Array?o.UNSIGNED_INT:t instanceof Float32Array?o.FLOAT:t instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(t){return e(t)&&(t===o.BYTE||t===o.UNSIGNED_BYTE||t===o.SHORT||t===o.UNSIGNED_SHORT||t===o.INT||t===o.UNSIGNED_INT||t===o.FLOAT||t===o.DOUBLE)},o.createTypedArray=function(t,e){switch(t){case o.BYTE:return new Int8Array(e);case o.UNSIGNED_BYTE:return new Uint8Array(e);case o.SHORT:return new Int16Array(e);case o.UNSIGNED_SHORT:return new Uint16Array(e);case o.INT:return new Int32Array(e);case o.UNSIGNED_INT:return new Uint32Array(e);case o.FLOAT:return new Float32Array(e);case o.DOUBLE:return new Float64Array(e)}},o.createArrayBufferView=function(e,n,r,i){switch(r=t(r,0),i=t(i,(n.byteLength-r)/o.getSizeInBytes(e)),e){case o.BYTE:return new Int8Array(n,r,i);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,i);case o.SHORT:return new Int16Array(n,r,i);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,i);case o.INT:return new Int32Array(n,r,i);case o.UNSIGNED_INT:return new Uint32Array(n,r,i);case o.FLOAT:return new Float32Array(n,r,i);case o.DOUBLE:return new Float64Array(n,r,i)}},o.fromName=function(t){switch(t){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},i(o)}),define("Core/GeometryType",["./freezeObject"],function(t){"use strict";var e={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return t(e)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(t,e){"use strict";var n={POINTS:e.POINTS,LINES:e.LINES,LINE_LOOP:e.LINE_LOOP,LINE_STRIP:e.LINE_STRIP,TRIANGLES:e.TRIANGLES,TRIANGLE_STRIP:e.TRIANGLE_STRIP,TRIANGLE_FAN:e.TRIANGLE_FAN,validate:function(t){return t===n.POINTS||t===n.LINES||t===n.LINE_LOOP||t===n.LINE_STRIP||t===n.TRIANGLES||t===n.TRIANGLE_STRIP||t===n.TRIANGLE_FAN}};return t(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(t,e,n,r,i){"use strict";function a(e){e=t(e,t.EMPTY_OBJECT),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=t(e.primitiveType,i.TRIANGLES),this.boundingSphere=e.boundingSphere,this.geometryType=t(e.geometryType,r.NONE),this.boundingSphereCV=e.boundingSphereCV}return a.computeNumberOfVertices=function(t){var n=-1;for(var r in t.attributes)if(t.attributes.hasOwnProperty(r)&&e(t.attributes[r])&&e(t.attributes[r].values)){var i=t.attributes[r],a=i.values.length/i.componentsPerAttribute;n=a}return n},a}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(t,e,n){"use strict";function r(e){e=t(e,t.EMPTY_OBJECT),this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=t(e.normalize,!1),this.values=e.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(t){"use strict";function e(e){e=t(e,t.EMPTY_OBJECT),this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}return e}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(t,e,n,r,i){"use strict";var a={UNSIGNED_BYTE:i.UNSIGNED_BYTE,UNSIGNED_SHORT:i.UNSIGNED_SHORT,UNSIGNED_INT:i.UNSIGNED_INT};return a.getSizeInBytes=function(t){switch(t){case a.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case a.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case a.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},a.validate=function(e){return t(e)&&(e===a.UNSIGNED_BYTE||e===a.UNSIGNED_SHORT||e===a.UNSIGNED_INT)},a.createTypedArray=function(t,e){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e):new Uint16Array(e)},a.createTypedArrayFromArrayBuffer=function(t,e,n,i){return t>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(e,n,i):new Uint16Array(e,n,i)},n(a)}),define("Core/EllipsoidOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType"],function(t,e,n,r,i,a,o,u,E,s,c,_,T){"use strict";function R(t){t=r(t,r.EMPTY_OBJECT);var n=r(t.radii,l),i=Math.round(r(t.stackPartitions,10)),a=Math.round(r(t.slicePartitions,8)),o=Math.round(r(t.subdivisions,128));this._radii=e.clone(n),this._stackPartitions=i,this._slicePartitions=a,this._subdivisions=o,this._workerName="createEllipsoidOutlineGeometry"}var l=new e(1,1,1),A=Math.cos,f=Math.sin;R.packedLength=e.packedLength+3,R.pack=function(t,n,i){return i=r(i,0),e.pack(t._radii,n,i),i+=e.packedLength,n[i++]=t._stackPartitions,n[i++]=t._slicePartitions,n[i]=t._subdivisions,n};var h=new e,N={radii:h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return R.unpack=function(t,n,a){n=r(n,0);var o=e.unpack(t,n,h);n+=e.packedLength;var u=t[n++],E=t[n++],s=t[n++];return i(a)?(a._radii=e.clone(o,a._radii),a._stackPartitions=u,a._slicePartitions=E,a._subdivisions=s,a):(N.stackPartitions=u,N.slicePartitions=E,N.subdivisions=s,new R(N))},R.createGeometry=function(e){var r=e._radii;if(!(r.x<=0||r.y<=0||r.z<=0)){var i,a,R,l,h,N,d=o.fromCartesian3(r),I=e._stackPartitions,S=e._slicePartitions,M=e._subdivisions,O=M*(I+S-1),m=O-S+2,y=new Float64Array(3*m),p=c.createTypedArray(m,2*O),C=0,U=new Array(M),P=new Array(M);for(i=0;i<M;i++)R=_.TWO_PI*i/M,U[i]=A(R),P[i]=f(R);for(i=1;i<I;i++)for(l=Math.PI*i/I,h=A(l),N=f(l),a=0;a<M;a++)y[C++]=r.x*U[a]*N,y[C++]=r.y*P[a]*N,y[C++]=r.z*h;for(U.length=S,P.length=S,i=0;i<S;i++)R=_.TWO_PI*i/S,U[i]=A(R),P[i]=f(R);for(y[C++]=0,y[C++]=0,y[C++]=r.z,i=1;i<M;i++)for(l=Math.PI*i/M,h=A(l),N=f(l),a=0;a<S;a++)y[C++]=r.x*U[a]*N,y[C++]=r.y*P[a]*N,y[C++]=r.z*h;for(y[C++]=0,y[C++]=0,y[C++]=-r.z,C=0,i=0;i<I-1;++i){var L=i*M;for(a=0;a<M-1;++a)p[C++]=L+a,p[C++]=L+a+1;p[C++]=L+M-1,p[C++]=L}var F=M*(I-1);for(a=1;a<S+1;++a)p[C++]=F,p[C++]=F+a;for(i=0;i<M-2;++i){var v=i*S+1+F,w=(i+1)*S+1+F;for(a=0;a<S-1;++a)p[C++]=w+a,p[C++]=v+a;p[C++]=w+S-1,p[C++]=v+S-1}var D=y.length/3-1;for(a=D-1;a>D-S-1;--a)p[C++]=D,p[C++]=a;var B=new s({position:new E({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:y})});return new u({attributes:B,indices:p,primitiveType:T.LINES,boundingSphere:t.fromEllipsoid(d)})}},R}),define("Core/SphereOutlineGeometry",["./Cartesian3","./Check","./defaultValue","./defined","./EllipsoidOutlineGeometry"],function(t,e,n,r,i){"use strict";function a(e){var r=n(e.radius,1),a=new t(r,r,r),o={radii:a,stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new i(o),this._workerName="createSphereOutlineGeometry"}a.packedLength=i.packedLength,a.pack=function(t,e,n){return i.pack(t._ellipsoidGeometry,e,n)};var o=new i,u={radius:void 0,radii:new t,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};return a.unpack=function(e,n,E){var s=i.unpack(e,n,o);return u.stackPartitions=s._stackPartitions,u.slicePartitions=s._slicePartitions,u.subdivisions=s._subdivisions,r(E)?(t.clone(s._radii,u.radii),E._ellipsoidGeometry=new i(u),E):(u.radius=s._radii.x,new a(u))},a.createGeometry=function(t){return i.createGeometry(t._ellipsoidGeometry)},a}),define("Workers/createSphereOutlineGeometry",["../Core/defined","../Core/SphereOutlineGeometry"],function(t,e){"use strict";return function(n,r){return t(r)&&(n=e.unpack(n,r)),e.createGeometry(n)}})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js b/engines/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js new file mode 100644 index 0000000..1e2c2b5 --- /dev/null +++ b/engines/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js @@ -0,0 +1,230 @@ +/** + * Cesium - https://github.com/AnalyticalGraphicsInc/cesium + * + * Copyright 2011-2017 Cesium Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Columbus View (Pat. Pend.) + * + * Portions licensed separately. + * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details. + */ +/** +@license +mersenne-twister.js - https://gist.github.com/banksean/300494 + + Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +/** + @license + when.js - https://github.com/cujojs/when + + MIT License (c) copyright B Cavalier & J Hann + + * A lightweight CommonJS Promises/A and when() implementation + * when is part of the cujo.js family of libraries (http://cujojs.com/) + * + * Licensed under the MIT License at: + * http://www.opensource.org/licenses/mit-license.php + * + * @version 1.7.1 + */ + +/** +@license +sprintf.js from the php.js project - https://github.com/kvz/phpjs +Directly from https://github.com/kvz/phpjs/blob/master/functions/strings/sprintf.js + +php.js is copyright 2012 Kevin van Zonneveld. + +Portions copyright Brett Zamir (http://brett-zamir.me), Kevin van Zonneveld +(http://kevin.vanzonneveld.net), Onno Marsman, Theriault, Michael White +(http://getsprink.com), Waldo Malqui Silva, Paulo Freitas, Jack, Jonas +Raoni Soares Silva (http://www.jsfromhell.com), Philip Peterson, Legaev +Andrey, Ates Goral (http://magnetiq.com), Alex, Ratheous, Martijn Wieringa, +Rafa? Kukawski (http://blog.kukawski.pl), lmeyrick +(https://sourceforge.net/projects/bcmath-js/), Nate, Philippe Baumann, +Enrique Gonzalez, Webtoolkit.info (http://www.webtoolkit.info/), Carlos R. +L. Rodrigues (http://www.jsfromhell.com), Ash Searle +(http://hexmen.com/blog/), Jani Hartikainen, travc, Ole Vrijenhoek, +Erkekjetter, Michael Grier, Rafa? Kukawski (http://kukawski.pl), Johnny +Mast (http://www.phpvrouwen.nl), T.Wild, d3x, +http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript, +Rafa? Kukawski (http://blog.kukawski.pl/), stag019, pilus, WebDevHobo +(http://webdevhobo.blogspot.com/), marrtins, GeekFG +(http://geekfg.blogspot.com), Andrea Giammarchi +(http://webreflection.blogspot.com), Arpad Ray (mailto:arpad@php.net), +gorthaur, Paul Smith, Tim de Koning (http://www.kingsquare.nl), Joris, Oleg +Eremeev, Steve Hilder, majak, gettimeofday, KELAN, Josh Fraser +(http://onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/), +Marc Palau, Martin +(http://www.erlenwiese.de/), Breaking Par Consulting Inc +(http://www.breakingpar.com/bkp/home.nsf/0/87256B280015193F87256CFB006C45F7), +Chris, Mirek Slugen, saulius, Alfonso Jimenez +(http://www.alfonsojimenez.com), Diplom@t (http://difane.com/), felix, +Mailfaker (http://www.weedem.fr/), Tyler Akins (http://rumkin.com), Caio +Ariede (http://caioariede.com), Robin, Kankrelune +(http://www.webfaktory.info/), Karol Kowalski, Imgen Tata +(http://www.myipdf.com/), mdsjack (http://www.mdsjack.bo.it), Dreamer, +Felix Geisendoerfer (http://www.debuggable.com/felix), Lars Fischer, AJ, +David, Aman Gupta, Michael White, Public Domain +(http://www.json.org/json2.js), Steven Levithan +(http://blog.stevenlevithan.com), Sakimori, Pellentesque Malesuada, +Thunder.m, Dj (http://phpjs.org/functions/htmlentities:425#comment_134018), +Steve Clay, David James, Francois, class_exists, nobbler, T. Wild, Itsacon +(http://www.itsacon.net/), date, Ole Vrijenhoek (http://www.nervous.nl/), +Fox, Raphael (Ao RUDLER), Marco, noname, Mateusz "loonquawl" Zalega, Frank +Forte, Arno, ger, mktime, john (http://www.jd-tech.net), Nick Kolosov +(http://sammy.ru), marc andreu, Scott Cariss, Douglas Crockford +(http://javascript.crockford.com), madipta, Slawomir Kaniecki, +ReverseSyntax, Nathan, Alex Wilson, kenneth, Bayron Guevara, Adam Wallner +(http://web2.bitbaro.hu/), paulo kuong, jmweb, Lincoln Ramsay, djmix, +Pyerre, Jon Hohle, Thiago Mata (http://thiagomata.blog.com), lmeyrick +(https://sourceforge.net/projects/bcmath-js/this.), Linuxworld, duncan, +Gilbert, Sanjoy Roy, Shingo, sankai, Oskar Larsson H?gfeldt +(http://oskar-lh.name/), Denny Wardhana, 0m3r, Everlasto, Subhasis Deb, +josh, jd, Pier Paolo Ramon (http://www.mastersoup.com/), P, merabi, Soren +Hansen, Eugene Bulkin (http://doubleaw.com/), Der Simon +(http://innerdom.sourceforge.net/), echo is bad, Ozh, XoraX +(http://www.xorax.info), EdorFaus, JB, J A R, Marc Jansen, Francesco, LH, +Stoyan Kyosev (http://www.svest.org/), nord_ua, omid +(http://phpjs.org/functions/380:380#comment_137122), Brad Touesnard, MeEtc +(http://yass.meetcweb.com), Peter-Paul Koch +(http://www.quirksmode.org/js/beat.html), Olivier Louvignes +(http://mg-crea.com/), T0bsn, Tim Wiel, Bryan Elliott, Jalal Berrami, +Martin, JT, David Randall, Thomas Beaucourt (http://www.webapp.fr), taith, +vlado houba, Pierre-Luc Paour, Kristof Coomans (SCK-CEN Belgian Nucleair +Research Centre), Martin Pool, Kirk Strobeck, Rick Waldron, Brant Messenger +(http://www.brantmessenger.com/), Devan Penner-Woelk, Saulo Vallory, Wagner +B. Soares, Artur Tchernychev, Valentina De Rosa, Jason Wong +(http://carrot.org/), Christoph, Daniel Esteban, strftime, Mick@el, rezna, +Simon Willison (http://simonwillison.net), Anton Ongson, Gabriel Paderni, +Marco van Oort, penutbutterjelly, Philipp Lenssen, Bjorn Roesbeke +(http://www.bjornroesbeke.be/), Bug?, Eric Nagel, Tomasz Wesolowski, +Evertjan Garretsen, Bobby Drake, Blues (http://tech.bluesmoon.info/), Luke +Godfrey, Pul, uestla, Alan C, Ulrich, Rafal Kukawski, Yves Sucaet, +sowberry, Norman "zEh" Fuchs, hitwork, Zahlii, johnrembo, Nick Callen, +Steven Levithan (stevenlevithan.com), ejsanders, Scott Baker, Brian Tafoya +(http://www.premasolutions.com/), Philippe Jausions +(http://pear.php.net/user/jausions), Aidan Lister +(http://aidanlister.com/), Rob, e-mike, HKM, ChaosNo1, metjay, strcasecmp, +strcmp, Taras Bogach, jpfle, Alexander Ermolaev +(http://snippets.dzone.com/user/AlexanderErmolaev), DxGx, kilops, Orlando, +dptr1988, Le Torbi, James (http://www.james-bell.co.uk/), Pedro Tainha +(http://www.pedrotainha.com), James, Arnout Kazemier +(http://www.3rd-Eden.com), Chris McMacken, gabriel paderni, Yannoo, +FGFEmperor, baris ozdil, Tod Gentille, Greg Frazier, jakes, 3D-GRAF, Allan +Jensen (http://www.winternet.no), Howard Yeend, Benjamin Lupton, davook, +daniel airton wermann (http://wermann.com.br), Atli T¨®r, Maximusya, Ryan +W Tenney (http://ryan.10e.us), Alexander M Beedie, fearphage +(http://http/my.opera.com/fearphage/), Nathan Sepulveda, Victor, Matteo, +Billy, stensi, Cord, Manish, T.J. Leahy, Riddler +(http://www.frontierwebdev.com/), Rafa? Kukawski, FremyCompany, Matt +Bradley, Tim de Koning, Luis Salazar (http://www.freaky-media.com/), Diogo +Resende, Rival, Andrej Pavlovic, Garagoth, Le Torbi +(http://www.letorbi.de/), Dino, Josep Sanz (http://www.ws3.es/), rem, +Russell Walker (http://www.nbill.co.uk/), Jamie Beck +(http://www.terabit.ca/), setcookie, Michael, YUI Library: +http://developer.yahoo.com/yui/docs/YAHOO.util.DateLocale.html, Blues at +http://hacks.bluesmoon.info/strftime/strftime.js, Ben +(http://benblume.co.uk/), DtTvB +(http://dt.in.th/2008-09-16.string-length-in-bytes.html), Andreas, William, +meo, incidence, Cagri Ekin, Amirouche, Amir Habibi +(http://www.residence-mixte.com/), Luke Smith (http://lucassmith.name), +Kheang Hok Chin (http://www.distantia.ca/), Jay Klehr, Lorenzo Pisani, +Tony, Yen-Wei Liu, Greenseed, mk.keck, Leslie Hoare, dude, booeyOH, Ben +Bryan + +Licensed under the MIT (MIT-LICENSE.txt) license. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL KEVIN VAN ZONNEVELD BE LIABLE FOR ANY CLAIM, DAMAGES +OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. +*/ + +/** + * @license + * + * Grauw URI utilities + * + * See: http://hg.grauw.nl/grauw-lib/file/tip/src/uri.js + * + * @author Laurens Holst (http://www.grauw.nl/) + * + * Copyright 2012 Laurens Holst + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var d=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,d);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,d=r*u-a*o;return n.x=c,n.y=l,n.z=d,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var f=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(r),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),n(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,n,r,a){"use strict";function i(t,a,i){this.minimum=e.clone(n(t,e.ZERO)),this.maximum=e.clone(n(a,e.ZERO)),r(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,n){if(r(n)||(n=new i),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,d=t.length,f=1;f<d;f++){var h=t[f],E=h.x,m=h.y,_=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var p=n.minimum;p.x=a,p.y=o,p.z=u;var T=n.maximum;T.x=s,T.y=c,T.z=l;var y=e.add(p,T,n.center);return e.multiplyByScalar(y,.5,y),n},i.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new i(t.minimum,t.maximum)},i.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,d=n.y,f=n.z,h=a.x,E=a.y,m=a.z,_=l*l*h*h,p=d*d*E*E,T=f*f*m*m,y=_+p+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(n,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,N=u.y,M=u.z,g=o;g.x=A.x*S*2,g.y=A.y*N*2,g.z=A.z*M*2;var I,O,v,w,x,C,P,U,D,F,L,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(g)),z=0;do{B-=z,v=1/(1+B*S),w=1/(1+B*N),x=1/(1+B*M),C=v*v,P=w*w,U=x*x,D=C*v,F=P*w,L=U*x,I=_*C+p*P+T*U-1,O=_*D*S+p*F*N+T*L*M;var b=-2*O;z=I/b}while(Math.abs(I)>r.EPSILON12);return t(c)?(c.x=l*v,c.y=d*w,c.z=f*x,c):new e(l*v,d*w,f*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,a,i){return a=n(a,0),r(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,d=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:d,m=r(n)?n.oneOverRadiiSquared:f,_=r(n)?n._centerToleranceSquared:h,p=o(t,E,m,_,c);if(r(p)){var T=e.multiplyComponents(p,m,s);T=e.normalize(T,T);var y=e.subtract(t,p,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),S=i.sign(e.dot(y,t))*e.magnitude(y);return r(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var d=new e,f=new e;l.prototype.cartographicToCartesian=function(t,n){var a=d,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),d=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=d,a):new t(c,l,d)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function d(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,d=E[a],f=m[a];if(Math.abs(e[s.getElementIndex(f,d)])>n){var h,_=e[s.getElementIndex(f,f)],p=e[s.getElementIndex(d,d)],T=e[s.getElementIndex(f,d)],y=(_-p)/2/T;h=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(d,d)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,d)]=l,t[s.getElementIndex(d,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,d=e.z*e.z,f=e.z*e.w,h=e.w*e.w,E=n-u-d+h,m=2*(a-f),_=2*(i+l),p=2*(a+f),T=-n+u-d+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+d+h;return r(t)?(t[0]=E,t[1]=p,t[2]=R,t[3]=m,t[4]=T,t[5]=A,t[6]=_,t[7]=y,t[8]=S,t):new s(E,m,_,p,T,y,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,d=-i*u+c*o*a,f=c*u+i*o*a,h=n*u,E=i*a+c*o*u,m=-c*a+i*o*u,_=-o,p=c*n,T=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=_,t[3]=d,t[4]=E,t[5]=p,t[6]=f,t[7]=m,t[8]=T,t):new s(l,d,f,h,E,m,_,p,T)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=d,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],_=new s,p=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=n*c(h);o<a&&l(h)>E;)d(h,_),s.transpose(_,p),s.multiply(h,_,h),s.multiply(p,h,h),s.multiply(f,_,f),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=s.determinant(e);t[0]=o*d-l*u,t[1]=l*a-r*d,t[2]=r*u-o*a,t[3]=c*u-i*d,t[4]=n*d-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/f;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o; +return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,d,f,h,E,m,_){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(d,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(_,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,d=t.x*t.z,f=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,_=t.z*t.z,p=t.z*t.w,T=t.w*t.w,y=s-h-_+T,R=2*(c-p),A=2*(d+m),S=2*(c+p),N=-s+h-_+T,M=2*(E-f),g=2*(d-m),I=2*(E+f),O=-s-h+_+T;return r[0]=y*i,r[1]=S*i,r[2]=g*i,r[3]=0,r[4]=R*o,r[5]=N*o,r[6]=I*o,r[7]=0,r[8]=A*u,r[9]=M*u,r[10]=O*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var d=new e,f=new e,h=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,d),e.normalize(e.cross(d,o,f),f),e.normalize(e.cross(f,d,h),h);var u=f.x,s=f.y,c=f.z,E=d.x,m=d.y,_=d.z,p=h.x,T=h.y,y=h.z,R=r.x,A=r.y,S=r.z,N=u*-R+s*-A+c*-S,M=p*-R+T*-A+y*-S,g=E*R+m*A+_*S;return a(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=T,n[6]=-m,n[7]=0,n[8]=c,n[9]=y,n[10]=-_,n[11]=0,n[12]=N,n[13]=M,n[14]=g,n[15]=1,n):new l(u,s,c,N,p,T,y,M,-E,-m,-_,g,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,d=-(r+n)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=d,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),d=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=d,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,d=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=d,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,d=.5*(n-t),f=c,h=l,E=d,m=i+c,_=o+l,p=t+d,T=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=p,a[15]=T,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],d=e[8],f=e[9],h=e[10],E=e[11],m=e[12],_=e[13],p=e[14],T=e[15],y=t[0],R=t[1],A=t[2],S=t[3],N=t[4],M=t[5],g=t[6],I=t[7],O=t[8],v=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],F=r*y+u*R+d*A+m*S,L=a*y+s*R+f*A+_*S,B=i*y+c*R+h*A+p*S,z=o*y+l*R+E*A+T*S,b=r*N+u*M+d*g+m*I,q=a*N+s*M+f*g+_*I,G=i*N+c*M+h*g+p*I,W=o*N+l*M+E*g+T*I,X=r*O+u*v+d*w+m*x,V=a*O+s*v+f*w+_*x,H=i*O+c*v+h*w+p*x,Y=o*O+l*v+E*w+T*x,k=r*C+u*P+d*U+m*D,j=a*C+s*P+f*U+_*D,Z=i*C+c*P+h*U+p*D,K=o*C+l*P+E*U+T*D;return n[0]=F,n[1]=L,n[2]=B,n[3]=z,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],d=e[10],f=e[12],h=e[13],E=e[14],m=t[0],_=t[1],p=t[2],T=t[4],y=t[5],R=t[6],A=t[8],S=t[9],N=t[10],M=t[12],g=t[13],I=t[14],O=r*m+o*_+c*p,v=a*m+u*_+l*p,w=i*m+s*_+d*p,x=r*T+o*y+c*R,C=a*T+u*y+l*R,P=i*T+s*y+d*R,U=r*A+o*S+c*N,D=a*A+u*S+l*N,F=i*A+s*S+d*N,L=r*M+o*g+c*I+f,B=a*M+u*g+l*I+h,z=i*M+s*g+d*I+E;return n[0]=O,n[1]=v,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=F,n[11]=0,n[12]=L,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],d=e[10],f=t[0],h=t[1],E=t[2],m=t[3],_=t[4],p=t[5],T=t[6],y=t[7],R=t[8],A=r*f+o*h+c*E,S=a*f+u*h+l*E,N=i*f+s*h+d*E,M=r*m+o*_+c*p,g=a*m+u*_+l*p,I=i*m+s*_+d*p,O=r*T+o*y+c*R,v=a*T+u*y+l*R,w=i*T+s*y+d*R;return n[0]=A,n[1]=S,n[2]=N,n[3]=0,n[4]=M,n[5]=g,n[6]=I,n[7]=0,n[8]=O,n[9]=v,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var p=new s,T=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,p),T,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],d=e[1],f=e[5],h=e[9],E=e[13],m=e[2],_=e[6],A=e[10],S=e[14],N=e[3],M=e[7],g=e[11],I=e[15],O=A*I,v=S*g,w=_*I,x=S*M,C=_*g,P=A*M,U=m*I,D=S*N,F=m*g,L=A*N,B=m*M,z=_*N,b=O*f+x*h+C*E-(v*f+w*h+P*E),q=v*d+U*h+L*E-(O*d+D*h+F*E),G=w*d+D*f+B*E-(x*d+U*f+z*E),W=P*d+F*f+z*h-(C*d+L*f+B*h),X=v*a+w*i+P*o-(O*a+x*i+C*o),V=O*r+D*i+F*o-(v*r+U*i+L*o),H=x*r+U*a+z*o-(w*r+D*a+B*o),Y=C*r+L*a+B*i-(P*r+F*a+z*i);O=i*E,v=o*h,w=a*E,x=o*f,C=a*h,P=i*f,U=r*E,D=o*d,F=r*h,L=i*d,B=r*f,z=a*d;var k=O*M+x*g+C*I-(v*M+w*g+P*I),j=v*N+U*g+L*I-(O*N+D*g+F*I),Z=w*N+D*M+B*I-(x*N+U*M+z*I),K=P*N+F*M+z*g-(C*N+L*M+B*g),Q=w*A+P*S+v*_-(C*S+O*_+x*A),J=F*S+O*m+D*A-(U*A+L*S+v*m),$=U*_+z*S+x*m-(B*S+w*m+D*_),ee=B*A+C*m+L*_-(F*_+z*A+P*m),te=r*b+a*q+i*G+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=j*te,n[10]=Z*te,n[11]=K*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],d=e[12],f=e[13],h=e[14],E=-n*d-r*f-a*h,m=-i*d-o*f-u*h,_=-s*d-c*f-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,d=0,f=e.length;d<f;d++){var h=e[d];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,d=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var E=t.cartesianToCartographic(e[f]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),d=Math.max(d,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=d,n):new s(a,l,i,d)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),d=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&d<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return r(n)?(n.west=l,n.south=f,n.east=d,n.north=h,n):new s(l,f,d,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),d=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,d=e.north,f=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,d<0?m.latitude=d:f>0?m.latitude=f:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,d){"use strict";function f(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,E=new e,m=new e,_=new e,p=new e,T=new e,y=new e,R=new e,A=new e,S=new e,N=new e,M=new e;f.fromPoints=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],y),i=e.clone(r,h),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,_),c=e.clone(r,p),l=e.clone(r,T),d=t.length,g=1;g<d;g++){e.clone(t[g],r);var I=r.x,O=r.y,v=r.z;I<i.x&&e.clone(r,i),I>s.x&&e.clone(r,s),O<o.y&&e.clone(r,o),O>c.y&&e.clone(r,c),v<u.z&&e.clone(r,u),v>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var F=A;F.x=.5*(P.x+U.x),F.y=.5*(P.y+U.y),F.z=.5*(P.z+U.z);var L=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(L),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(z,b,R),.5,M),G=0;for(g=0;g<d;g++){e.clone(t[g],r);var W=e.magnitude(e.subtract(r,q,R));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(r,F,R));if(X>L){var V=Math.sqrt(X);B=.5*(B+V),L=B*B;var H=V-B;F.x=(B*F.x+H*r.x)/V,F.y=(B*F.y+H*r.y)/V,F.z=(B*F.z+H*r.z)/V}}return B<G?(e.clone(F,n.center),n.radius=B):(e.clone(q,n.center),n.radius=G),n};var g=new o,I=new e,O=new e,v=new t,w=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,g),d.southwest(t,v),v.height=i,d.northeast(t,w),w.height=o;var s=n.project(v,I),c=n.project(w,O),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];f.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=d.subsample(e,t,n,x)),f.fromPoints(u,o)},f.fromVertices=function(t,n,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=y;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),d=e.clone(u,_),g=e.clone(u,p),I=e.clone(u,T),O=t.length,v=0;v<O;v+=i){var w=t[v]+n.x,x=t[v+1]+n.y,C=t[v+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>d.x&&e.clone(u,d),x<c.y&&e.clone(u,c),x>g.y&&e.clone(u,g),C<l.z&&e.clone(u,l),C>I.z&&e.clone(u,I)}var P=e.magnitudeSquared(e.subtract(d,s,R)),U=e.magnitudeSquared(e.subtract(g,c,R)),D=e.magnitudeSquared(e.subtract(I,l,R)),F=s,L=d,B=P;U>B&&(B=U,F=c,L=g),D>B&&(B=D,F=l,L=I);var z=A;z.x=.5*(F.x+L.x),z.y=.5*(F.y+L.y),z.z=.5*(F.z+L.z);var b=e.magnitudeSquared(e.subtract(L,z,R)),q=Math.sqrt(b),G=S;G.x=s.x,G.y=c.y,G.z=l.z;var W=N;W.x=d.x,W.y=g.y,W.z=I.z;var X=e.multiplyByScalar(e.add(G,W,R),.5,M),V=0;for(v=0;v<O;v+=i){u.x=t[v]+n.x,u.y=t[v+1]+n.y,u.z=t[v+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var j=k-q;z.x=(q*z.x+j*u.x)/k,z.y=(q*z.y+j*u.y)/k,z.z=(q*z.z+j*u.z)/k}}return q<V?(e.clone(z,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},f.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new f),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=y;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,p),d=e.clone(i,T),g=t.length,I=0;I<g;I+=3){var O=t[I]+n[I],v=t[I+1]+n[I+1],w=t[I+2]+n[I+2];i.x=O,i.y=v,i.z=w,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),v<u.y&&e.clone(i,u),v>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>d.z&&e.clone(i,d)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(d,s,R)),U=o,D=c,F=x;C>F&&(F=C,U=u,D=l),P>F&&(F=P,U=s,D=d);var L=A;L.x=.5*(U.x+D.x),L.y=.5*(U.y+D.y),L.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,L,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var q=N;q.x=c.x,q.y=l.y,q.z=d.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,M),W=0;for(I=0;I<g;I+=3){i.x=t[I]+n[I],i.y=t[I+1]+n[I+1],i.z=t[I+2]+n[I+2];var X=e.magnitude(e.subtract(i,G,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,L,R));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;L.x=(z*L.x+Y*i.x)/H,L.y=(z*L.y+Y*i.y)/H,L.z=(z*L.z+Y*i.z)/H}}return z<W?(e.clone(L,r.center),r.radius=z):(e.clone(G,r.center),r.radius=W),r},f.fromCornerPoints=function(t,n,r){a(r)||(r=new f);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},f.fromEllipsoid=function(t,n){return a(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;f.fromBoundingSpheres=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return f.clone(t[0],n);if(2===r)return f.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=f.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;f.fromOrientedBoundingBox=function(t,n){a(n)||(n=new f);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D);return e.add(i,o,i),e.add(i,u,i),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(i),n},f.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},f.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new f);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var F=new e,L=new e;f.union=function(t,n,r){a(r)||(r=new f);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,F),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var d=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+d)/l,L);return e.add(h,i,h),e.clone(h,r.center),r.radius=d,r};var B=new e;f.expand=function(t,n,r){r=f.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},f.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;f.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},f.transformWithoutScale=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;f.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,G=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return f.projectTo2D=function(t,n,a){n=r(n,j);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var d=e.negate(l,V),h=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,d,m),e.add(m,h,m),m=E[3],e.add(s,d,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,d,m),e.add(m,h,m),m=E[7],e.add(s,d,m),e.add(m,c,m);for(var _=E.length,p=0;p<_;++p){var T=E[p];e.add(o,T,T);var y=i.cartesianToCartographic(T,H);n.project(y,T)}a=f.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,n){return f.computePlaneDistances(this,e,t,n)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y, +n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var d=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,d);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,n,r,a,i,o){"use strict";function u(e,n){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(n)&&(this.cameraPosition=n)}function s(e,n,r){var a=e.transformPositionToScaledSpace(n,E),i=t.magnitudeSquared(a),o=Math.sqrt(i),u=t.divideByScalar(a,o,m);i=Math.max(1,i),o=Math.max(1,o);var s=t.dot(u,r),c=t.magnitude(t.cross(u,r,u)),l=1/o,d=Math.sqrt(i-1)*l;return 1/(s*l-c*d)}function c(e,n,r){if(!(n<=0||n===1/0||n!==n))return t.multiplyByScalar(e,n,r)}function l(e,n){return t.equals(n,t.ZERO)?n:(e.transformPositionToScaledSpace(n,_),t.normalize(_,_))}a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var n=this._ellipsoid,r=n.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),a=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=a}}});var d=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,n=t.transformPositionToScaledSpace(e,d);return this.isScaledSpacePointVisible(n)},u.prototype.isScaledSpacePointVisible=function(e){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,a=t.subtract(e,n,d),i=-t.dot(a,n),o=r<0?i>0:i>r&&i*i/t.magnitudeSquared(a)>r;return!o},u.prototype.computeHorizonCullingPoint=function(e,n,a){r(a)||(a=new t);for(var i=this._ellipsoid,o=l(i,e),u=0,d=0,f=n.length;d<f;++d){var h=n[d],E=s(i,h,o);u=Math.max(u,E)}return c(o,u,a)};var f=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,a,i,o,u){r(u)||(u=new t),o=n(o,t.ZERO);for(var d=this._ellipsoid,h=l(d,e),E=0,m=0,_=a.length;m<_;m+=i){f.x=a[m]+o.x,f.y=a[m+1]+o.y,f.z=a[m+2]+o.z;var p=s(d,f,h);E=Math.max(E,p)}return c(h,E,u)};var h=[];u.prototype.computeHorizonCullingPointFromRectangle=function(n,r,a){var i=o.subsample(n,r,0,h),u=e.fromPoints(i);if(!(t.magnitude(u.center)<.1*r.minimumRadius))return this.computeHorizonCullingPoint(u.center,i,a)};var E=new t,m=new t,_=new t;return u}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,d=n(c,-l,t.EPSILON14);if(d<0)return[];var f=-.5*n(r,t.sign(r)*Math.sqrt(d),t.EPSILON14);return r>0?[f/e,a/f]:[a/f,f/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,d=u*c,f=u*u,h=s*s,E=o*s-f,m=o*c-u*s,_=u*c-h,p=4*E*_-m*m;if(p<0){var T,y,R;f*d>=l*h?(T=o,y=E,R=-2*u*E+o*m):(T=c,y=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(T)*Math.sqrt(-p);i=-R+S;var N=i/2,M=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),g=i===S?-M:-y/M;return a=y<=0?M+g:-R/(M*M+g*g+y),f*d>=l*h?[(a-u)/o]:[-c/(a+s)]}var I=E,O=-2*u*E+o*m,v=_,w=-c*m+2*s*_,x=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-I);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),F=i+D>2*u?i-u:D-u,L=o,B=F/L;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-v),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=i+D<2*s?i+s:D+s,q=z/b,G=L*b,W=-F*b-L*z,X=F*z,V=(s*W-u*X)/(-u*W+s*G);return B<=V?B<=q?V<=q?[B,V,q]:[B,q,V]:[q,B,V]:B<=q?[V,B,q]:V<=q?[V,q,B]:[q,V,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,d=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(d.length>0){var f=-t/4,h=d[d.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,_=E[0],p=E[1];if(_>=0&&p>=0){var T=Math.sqrt(_),y=Math.sqrt(p);return[f-y,f-T,f+T,f+y]}if(_>=0&&p<0)return m=Math.sqrt(_),[f-m,f+m];if(_<0&&p>=0)return m=Math.sqrt(p),[f-m,f+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,S=(s+h+c/R)/2,N=r.computeRealRoots(1,R,A),M=r.computeRealRoots(1,-R,S);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==M.length?(M[0]+=f,M[1]+=f,N[1]<=M[0]?[N[0],N[1],M[0],M[1]]:M[1]<=N[0]?[M[0],M[1],N[0],N[1]]:N[0]>=M[0]&&N[1]<=M[1]?[M[0],N[0],N[1],M[1]]:M[0]>=N[0]&&M[1]<=N[1]?[N[0],M[0],M[1],N[1]]:N[0]>M[0]&&N[0]<M[1]?[M[0],N[0],M[1],N[1]]:[N[0],M[0],N[1],M[1]]):N):0!==M.length?(M[0]+=f,M[1]+=f,M):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,d=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,d,f);if(h.length>0){var E,m,_=h[0],p=a-_,T=p*p,y=t/2,R=p/2,A=T-4*o,S=T+4*Math.abs(o),N=c-4*_,M=c+4*Math.abs(_);if(_<0||A*M<N*S){var g=Math.sqrt(N);E=g/2,m=0===g?0:(t*R-i)/g}else{var I=Math.sqrt(A);E=0===I?0:(t*R-i)/I,m=I/2}var O,v;0===y&&0===E?(O=0,v=0):n.sign(y)===n.sign(E)?(O=y+E,v=_/O):(v=y-E,O=_/v);var w,x;0===R&&0===m?(w=0,x=0):n.sign(R)===n.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var C=r.computeRealRoots(1,O,w),P=r.computeRealRoots(1,v,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,d=r*r,f=d*r,h=a*a,E=h*a,m=u*c*d-4*s*f-4*e*l*d+18*e*t*n*f-27*i*d*d+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*d+144*i*n*d)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,d=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=d<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,d,f);case 1:return i(c,l,d,f);case 2:return i(c,l,d,f);case 3:return a(c,l,d,f);case 4:return a(c,l,d,f);case 5:return i(c,l,d,f);case 6:return a(c,l,d,f);case 7:return a(c,l,d,f);case 8:return i(c,l,d,f);case 9:return a(c,l,d,f);case 10:return a(c,l,d,f);case 11:return i(c,l,d,f);case 12:return a(c,l,d,f);case 13:return a(c,l,d,f);case 14:return a(c,l,d,f);case 15:return a(c,l,d,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function d(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,T),f=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=d(f,h,E,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,d=a*a,f=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),_=t[u.COLUMN0ROW0]*d+t[u.COLUMN2ROW2]*f+a*n.x+r,p=f*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),T=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),y=[];if(0===T&&0===p){if(l=s.computeRealRoots(E,m,_),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],N=Math.sqrt(Math.max(1-S*S,0));y.push(new e(a,i*S,i*-N)),y.push(new e(a,i*S,i*N))}return y}var M=T*T,g=p*p,I=E*E,O=T*p,v=I+g,w=2*(m*E+O),x=2*_*E+m*m-g+M,C=2*(_*m-O),P=_*_-M;if(0===v&&0===w&&0===x&&0===C)return y;l=c.computeRealRoots(v,w,x,C,P);var U=l.length;if(0===U)return y;for(var D=0;D<U;++D){var F,L=l[D],B=L*L,z=Math.max(1-B,0),b=Math.sqrt(z);F=o.sign(E)===o.sign(_)?h(E*B+_,m*L,o.EPSILON12):o.sign(_)===o.sign(m*L)?h(E*B,m*L+_,o.EPSILON12):h(E*B+m*L,_,o.EPSILON12);var q=h(p*L,T,o.EPSILON15),G=F*q;G<0?y.push(new e(a,i*L,i*b)):G>0?y.push(new e(a,i*L,i*-b)):0!==b?(y.push(new e(a,i*L,i*-b)),y.push(new e(a,i*L,i*b)),++D):y.push(new e(a,i*L,i*b))}return y}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var _=new e,p=new e,T=new e,y=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,d,f,h=t.origin,E=t.direction,m=e.subtract(a,r,_),A=e.subtract(i,r,p),S=e.cross(E,A,T),N=e.dot(m,S);if(u){if(N<o.EPSILON6)return;if(s=e.subtract(h,r,y),l=e.dot(s,S),l<0||l>N)return;if(c=e.cross(s,m,R),d=e.dot(E,c),d<0||l+d>N)return;f=e.dot(A,c)/N}else{if(Math.abs(N)<o.EPSILON6)return;var M=1/N;if(s=e.subtract(h,r,y),l=e.dot(s,S)*M,l<0||l>1)return;if(c=e.cross(s,m,R),d=e.dot(E,c)*M,d<0||l+d>1)return;f=e.dot(A,c)*M}return f},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var N=new l;m.lineSegmentSphere=function(t,n,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var M=new e,g=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,M),d=e.multiplyComponents(c,t.direction,g),f=e.magnitudeSquared(l),h=e.dot(l,d);if(f>1){if(h>=0)return;var E=h*h;if(r=f-1,a=e.magnitudeSquared(d),o=a*r,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,_=r/s;return m<_?new i(m,_):{start:_,stop:m}}var p=Math.sqrt(r/a);return new i(p,p)}return f<1?(r=f-1,a=e.magnitudeSquared(d),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(d),new i(0,-h/a)):void 0};var I=new e,O=new e,v=new e,w=new e,x=new e,C=new u,P=new u,U=new u,D=new u,F=new u,L=new u,B=new u,z=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,I);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,I),d=e.normalize(l,l),f=e.mostOrthogonalAxis(l,w),h=e.normalize(e.cross(f,d,O),O),m=e.normalize(e.cross(d,h,v),v),_=C;_[0]=d.x,_[1]=d.y,_[2]=d.z,_[3]=h.x,_[4]=h.y,_[5]=h.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=u.transpose(_,P),T=u.fromScale(n.radii,U),y=u.fromScale(n.oneOverRadii,D),R=F;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,N=u.multiply(u.multiply(p,y,L),R,L),M=u.multiply(u.multiply(N,T,B),_,B),g=u.multiplyByVector(N,a,x),G=E(M,e.negate(g,I),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(T,u.multiplyByVector(_,G[H],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var j=n.cartesianToCartographic(X,q);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-V*V),S=c?-S:S,j.height=S,n.cartographicToCartesian(j,new e)}};var G=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),d=-(a.distance+l)/c;if(!(d<0||d>1))return e.multiplyByScalar(u,d,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var d,f;if(1!==l&&2!==l||(d=new e,f=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,d),m.lineSegmentPlane(t,r,a,f),{positions:[t,n,r,d,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,d),m.lineSegmentPlane(n,t,a,f),{positions:[t,n,r,d,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,d),m.lineSegmentPlane(r,n,a,f),{positions:[t,n,r,d,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,d),m.lineSegmentPlane(r,t,a,f),{positions:[t,n,r,d,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,d),m.lineSegmentPlane(t,n,a,f),{positions:[t,n,r,d,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,d),m.lineSegmentPlane(n,r,a,f),{positions:[t,n,r,d,f],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,n,r,a){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var o=new e;return i.fromCartesian4=function(n,r){var a=e.fromCartesian4(n,o),u=n.w;return t(r)?(e.clone(a,r.normal),r.distance=u,r):new i(a,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return f(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,d,f,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],d=[],f=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),d.push(a),r.promise},h=function(e){return m(d,e),e},E=function(e){return e=t(e),f=e.then,E=t,h=p,m(l,e),d=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,d,f,h,E,m,_,T,y;if(T=t.length>>>0,c=Math.max(0,Math.min(n,T)),d=[],l=T-c+1,f=[],h=o(),c)for(_=h.progress,m=function(e){f.push(e),--l||(E=m=p,h.reject(f))},E=function(e){d.push(e),--c||(E=m=p,h.resolve(d))},y=0;y<T;++y)y in t&&e(t[y],s,u,_);else h.resolve(d);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),f(e,T).then(t,n,r)}function d(){return f(arguments,T)}function f(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},y.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function T(e){return e}var y,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=d,e.all=l,e.map=f,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,y=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,d,f){var h,E,m,_,p;if("%%"==e)return"%";for(var T=!1,y="",R=!1,A=!1,S=" ",N=s.length,M=0;s&&M<N;M++)switch(s.charAt(M)){case" ":y=" ";break;case"+":y="+";break;case"-":T=!0;break;case"'":S=s.charAt(M+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,T=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(d=d?"*"==d?+t[n++]:"*"==d.charAt(0)?+t[d.slice(1,-1)]:+d:"fFeE".indexOf(f)>-1?6:"d"==f?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],f){case"s":return u(String(p),T,c,d,R,S);case"c":return u(String.fromCharCode(+p),T,c,d,R);case"b":return o(p,2,A,T,c,d,R);case"o":return o(p,8,A,T,c,d,R);case"x":return o(p,16,A,T,c,d,R);case"X":return o(p,16,A,T,c,d,R).toUpperCase();case"u":return o(p,10,A,T,c,d,R);case"i":case"d":return h=+p||0,h=Math.round(h-h%1),E=h<0?"-":y,p=E+a(String(Math.abs(h)),d,"0",!1),i(p,E,T,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+p,E=h<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(f.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(f)%2],p=E+Math.abs(h)[m](d),i(p,E,T,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function d(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function f(e,n){y.julianDate=e;var r=m.leapSeconds,a=t(r,y,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var d=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return d>=43200&&(l-=1),[l,d]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&d(this)}var _=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],T=29,y=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,N=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,g=/([Z+\-])?(\d{2})?:?(\d{2})?$/,I=/^(\d{2})(\.\d+)?/.source+g.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+g.source,v=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+g.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),d(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,f=0,_=0,y=0,g=0,w=u[0],x=u[1];if(u=w.match(M),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(N),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var F;if(r(x)){u=x.match(v),null!==u?(f=+u[1],_=+u[2],y=+u[3],g=1e3*+(u[4]||0),F=5):(u=x.match(O),null!==u?(f=+u[1],_=+u[2],y=60*+(u[3]||0),F=4):(u=x.match(I),null!==u&&(f=+u[1],_=60*+(u[2]||0),F=3)));var L=u[F],B=+u[F+1],z=+(u[F+2]||0);switch(L){case"+":f-=B,_-=z;break;case"-":f+=B,_+=z;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,f,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===y;for(b&&y--;_>=60;)_-=60,f++;for(;f>=24;)f-=24,l++;for(a=i&&2===s?T:p[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?T:p[s-1];for(;_<0;)_+=60,f--;for(;f<0;)f+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?T:p[s-1],l+=a;var q=E(n,s,l,f,_,y,g);return r(t)?(h(q[0],q[1],t),d(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=f(e,w);r(a)||(m.addSeconds(e,-1,w),a=f(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var d=4e3*(c+1)/1461001|0;c=c-(1461*d/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var _=h+2-12*c|0,p=100*(l-49)+d+c|0,T=u/s.SECONDS_PER_HOUR|0,y=u-T*s.SECONDS_PER_HOUR,R=y/s.SECONDS_PER_MINUTE|0;y-=R*s.SECONDS_PER_MINUTE;var A=0|y,S=(y-A)/s.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(A+=1),r(t)?(t.year=p,t.month=_,t.day=E,t.hour=T,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,_,E,T,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme; +},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var d=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,f){var h=d.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(f)&&n(E.overrideMimeType)&&E.overrideMimeType(f),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,d){"use strict";function f(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),f=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||f<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,p=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=f,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var T,y=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],N=_[R+m],M=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,g=new o(M,N,d.TAI);if(p.push(g),y){if(N!==T&&r(T)){var I=o.leapSeconds,O=t(I,g,h);if(O<0){var v=new u(g,N);I.splice(~O,0,v)}}T=N}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function p(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var d=o.secondsDifference(r,c)/o.secondsDifference(l,c),f=a*s,h=i*s,E=n[f+e._ut1MinusUtcSecondsColumn],p=n[h+e._ut1MinusUtcSecondsColumn],T=p-E;if(T>.5||T<-.5){var y=n[f+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];y!==R&&(l.equals(r)?E=p:p-=R-y)}return u.xPoleWander=_(d,n[f+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(d,n[f+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(d,n[f+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(d,n[f+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(d,E,p),u}return f.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),f.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},f.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var d=i[u],f=i[u+1],h=o.lessThanOrEquals(d,e),E=!r(f),m=E||o.greaterThanOrEquals(f,e);if(h&&m)return s=u,!E&&f.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},f}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){if(i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),"data"===r.scheme)return r.toString();if("data"===a.scheme)return a.toString();n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(d))return d;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),d=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(f)||(f=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=f(e);return h.href=n,h.href=h.href,h.href}var d,f,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){d=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=d;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var d=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var d=u/this._samplesPerXysFile|0,f=s/this._samplesPerXysFile|0,h=[],E=d;E<=f;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var d=s+u;d>=this._totalSamples&&(d=this._totalSamples-1,s=d-u,s<0&&(s=0));var f=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),f=!0),r(h[3*d])||(l(this,d/this._samplesPerXysFile|0),f=!0),!f){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,_=i-s*this._stepSizeDays,p=this._work,T=this._denominators,y=this._coef,R=this._xTable;for(E=0;E<=u;++E)p[E]=_-R[E];for(E=0;E<=u;++E){for(y[E]=1,m=0;m<=u;++m)m!==E&&(y[E]*=p[m]);y[E]*=T[E];var A=3*(s+E);n.x+=y[E]*h[A++],n.y+=y[E]*h[A++],n.s+=y[E]*h[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(N)&&(N=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,M=r(e[1]))}return N}function u(){return o()&&M}function s(){if(!t(g)){g=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(g=!0,I=r(e[1]),I.isNightly=!!e[2])}return g}function c(){return s()&&I}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,v=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,v=r(e[1])))}return O}function d(){return l()&&v}function f(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function h(){return f()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return E()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function T(){if(!t(L)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;L=t(n)&&""!==n,L&&(F=n)}return L}function y(){return T()?F:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,N,M,g,I,O,v,w,x,C,P,U,D,F,L,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:d,isEdge:f,edgeVersion:h,isFirefox:E,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:T,imageRenderingValue:y};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var d=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);d=e.normalize(t,d);var u=d.x*o,s=d.y*o,c=d.z*o,f=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=f,a):new l(u,s,c,f)};var f=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],d=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+d+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var _=f,p=0;d>s&&(p=1),E>s&&E>d&&(p=2);var T=_[p],y=_[T];n=Math.sqrt(e[c.getElementIndex(p,p)]-e[c.getElementIndex(T,T)]-e[c.getElementIndex(y,y)]+1);var R=h;R[p]=.5*n,n=.5/n,u=(e[c.getElementIndex(y,T)]-e[c.getElementIndex(T,y)])*n,R[T]=(e[c.getElementIndex(T,p)]+e[c.getElementIndex(p,T)])*n,R[y]=(e[c.getElementIndex(y,p)]+e[c.getElementIndex(p,y)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,_=new l,p=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),p=l.fromAxisAngle(e.UNIT_X,o.roll,E),_=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(_,p,_),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var T=new e,y=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,T);var u=l.computeAngle(R);r[o]=T.x*u,r[o+1]=T.y*u,r[o+2]=T.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,y);var u=e.magnitude(y);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(y,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,d=o*u+r*l+a*c-i*s,f=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=d,n.y=f,n.z=h,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var N=new l;l.lerp=function(e,t,n,r){return N=l.multiplyByScalar(t,n,N),r=l.multiplyByScalar(e,1-n,r),l.add(N,r,r)};var M=new l,g=new l,I=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=M=l.negate(t,M)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return g=l.multiplyByScalar(e,Math.sin((1-n)*o),g),I=l.multiplyByScalar(i,Math.sin(n*o),I),r=l.add(g,I,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var O=new e,v=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,O);l.multiply(i,t,x);var u=l.log(x,v);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],D=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;U[B]=1/(z*b),D[B]=z/b}return U[7]=P/136,D[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,d=7;d>=0;--d)F[d]=(U[d]*s-D[d])*o,L[d]=(U[d]*c-D[d])*o;var f=a*n*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),h=u*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),E=l.multiplyByScalar(e,h,C);return l.multiplyByScalar(t,f,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,h,E,m,_,p,T,y,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},N={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},M={},g={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},I=new n,O=new n,v=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(M[i])?r=M[i]:(r=function(r,i,s){if(u(s)||(s=new T),_.equalsEpsilon(r.x,0,_.EPSILON14)&&_.equalsEpsilon(r.y,0,_.EPSILON14)){var c=_.sign(r.z);n.unpack(N[e],0,I),"east"!==e&&"west"!==e&&n.multiplyByScalar(I,c,I),n.unpack(N[t],0,O),"east"!==t&&"west"!==t&&n.multiplyByScalar(O,c,O),n.unpack(N[a],0,v),"east"!==a&&"west"!==a&&n.multiplyByScalar(v,c,v)}else{i=o(i,f.WGS84),i.geodeticSurfaceNormal(r,g.up);var l=g.up,d=g.east;d.x=-r.y,d.y=r.x,d.z=0,n.normalize(d,g.east),n.cross(l,d,g.north),n.multiplyByScalar(g.up,-1,g.down),n.multiplyByScalar(g.east,-1,g.west),n.multiplyByScalar(g.north,-1,g.south),I=g[e],O=g[t],v=g[a]}return s[0]=I.x,s[1]=I.y,s[2]=I.z,s[3]=0,s[4]=O.x,s[5]=O.y,s[6]=O.z,s[7]=0,s[8]=v.x,s[9]=v.y,s[10]=v.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},M[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new y,x=new n(1,1,1),C=new T;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof T&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=y.fromHeadingPitchRoll(t,w),c=T.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),T.multiply(i,c,i)};var P=new T,U=new p;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof y&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=T.getRotation(i,U);return y.fromRotationMatrix(o,a)};var D=24110.54841,F=8640184.812866,L=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,q=_.TWO_PI/86400,G=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(F+n*(L+n*B)),s=o*q%_.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,d=s+c*l,f=Math.cos(d),h=Math.sin(d);return u(t)?(t[0]=f,t[1]=-h,t[2]=0,t[3]=h,t[4]=f,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(f,h,0,-h,f,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return p.transpose(n,t)};var V=new E(0,0,0),H=new d(0,0,0,0,0,0),Y=new p,k=new p;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var d=p.fromRotationZ(-i.s,k),f=p.multiply(l,d,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=h-2451545,y=E/R.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(T+y);S=S%1*_.TWO_PI;var N=p.fromRotationZ(S,k),M=p.multiply(f,N,Y),g=Math.cos(n.xPoleWander),I=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),v=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*_.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=k; +return U[0]=g*C,U[1]=g*P,U[2]=O,U[3]=-I*P+v*O*C,U[4]=I*C+v*O*P,U[5]=-v*g,U[6]=-v*P-I*O*C,U[7]=v*C-I*O*P,U[8]=I*g,p.multiply(M,U,t)}}};var j=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=j;return T.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),T.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var Z=new n,K=new n,Q=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,Q);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new n,te=new n,ne=new p,re=new T,ae=new T;return A.basisTo2D=function(e,t,r){var a=T.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);n.fromElements(u.z,u.x,u.y,u);var s=A.eastNorthUpToFixedFrame(a,i,re),c=T.inverseTransformation(s,ae),l=T.getRotation(t,ne),d=T.multiplyByMatrix3(c,l,r);return T.multiply(J,d,r),T.setTranslation(r,u,r),r},A.wgs84To2DModelMatrix=function(e,t,r){var a=e.ellipsoid,i=A.eastNorthUpToFixedFrame(t,a,re),o=T.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);n.fromElements(s.z,s.x,s.y,s);var c=T.fromTranslation(s,re);return T.multiply(J,o,r),T.multiply(c,r,r),r},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=d.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var p=new f,T=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,T);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=p;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,T);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var y=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=y,l=0;l<r;++l){var d=e[l];n.multiplyByScalar(u,d.x,c),i(t[l])||(t[l]=new n);var f=n.add(o,c,t[l]);n.multiplyByScalar(s,d.y,c),n.add(f,c,f),a.scaleToGeocentricSurface(f,f)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,h,E){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=f.clone(a(t,f.ZERO))}function _(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;f.setColumn(l,0,e.xAxis,l),f.setColumn(l,1,e.yAxis,l),f.setColumn(l,2,e.zAxis,l);var d=g;d.x=(t+r)/2,d.y=(a+o)/2,d.z=(u+s)/2;var h=I;h.x=(r-t)/2,h.y=(o-a)/2,h.z=(s-u)/2;var E=c.center;return d=f.multiplyByVector(l,d,d),n.add(e.origin,d,E),f.multiplyByScale(l,h,l),c}var p=new n,T=new n,y=new n,R=new n,A=new n,S=new n,N=new f,M={unitary:new f,diagonal:new f};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=f.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],p);for(r=1;r<a;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,d=0,h=0,E=0,_=0;for(r=0;r<a;r++)s=n.subtract(e[r],o,T),c+=s.x*s.x,l+=s.x*s.y,d+=s.x*s.z,h+=s.y*s.y,E+=s.y*s.z,_+=s.z*s.z;c*=u,l*=u,d*=u,h*=u,E*=u,_*=u;var g=N;g[0]=c,g[1]=l,g[2]=d,g[3]=l,g[4]=h,g[5]=E,g[6]=d,g[7]=E,g[8]=_;var I=f.computeEigenDecomposition(g,M),O=f.clone(I.unitary,t.halfAxes),v=f.getColumn(O,0,R),w=f.getColumn(O,1,A),x=f.getColumn(O,2,S),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,F=Number.MAX_VALUE,L=Number.MAX_VALUE;for(r=0;r<a;r++)s=e[r],C=Math.max(n.dot(v,s),C),P=Math.max(n.dot(w,s),P),U=Math.max(n.dot(x,s),U),D=Math.min(n.dot(v,s),D),F=Math.min(n.dot(w,s),F),L=Math.min(n.dot(x,s),L);v=n.multiplyByScalar(v,.5*(D+C),v),w=n.multiplyByScalar(w,.5*(F+P),w),x=n.multiplyByScalar(x,.5*(L+U),x);var B=n.add(v,w,t.center);n.add(B,x,B);var z=y;return z.x=C-D,z.y=P-F,z.z=U-L,n.multiplyByScalar(z,.5,z),f.multiplyByScale(t.halfAxes,z,t.halfAxes),t};var g=new n,I=new n,O=new r,v=new n,w=[new r,new r,new r,new r,new r,new r,new r,new r],x=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,i){t=a(t,0),n=a(n,0),r=a(r,u.WGS84);var o=E.center(e,O),c=r.cartographicToCartesian(o,v),l=new s(c,r),d=l.plane,f=w[0],m=w[1],p=w[2],T=w[3],y=w[4],R=w[5],A=w[6],S=w[7],N=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=y.latitude=e.south,S.latitude=T.latitude=M,f.latitude=m.latitude=p.latitude=e.north,A.longitude=S.longitude=f.longitude=e.west,R.longitude=m.longitude=N,y.longitude=T.longitude=p.longitude=e.east,p.height=m.height=f.height=S.height=A.height=R.height=y.height=T.height=n,r.cartographicArrayToCartesianArray(w,x),l.projectPointsToNearestOnPlane(x,C);var g=Math.min(C[6].x,C[7].x,C[0].x),I=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);p.height=f.height=y.height=A.height=t,r.cartographicArrayToCartesianArray(w,x);var D=Math.min(h.getPointDistance(d,x[0]),h.getPointDistance(d,x[2]),h.getPointDistance(d,x[4]),h.getPointDistance(d,x[6])),F=n;return _(l,g,I,P,U,D,F,i)},m.clone=function(e,t){if(i(e))return i(t)?(n.clone(e.center,t.center),f.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,a=t.normal,i=e.halfAxes,o=a.x,u=a.y,s=a.z,l=Math.abs(o*i[f.COLUMN0ROW0]+u*i[f.COLUMN0ROW1]+s*i[f.COLUMN0ROW2])+Math.abs(o*i[f.COLUMN1ROW0]+u*i[f.COLUMN1ROW1]+s*i[f.COLUMN1ROW2])+Math.abs(o*i[f.COLUMN2ROW0]+u*i[f.COLUMN2ROW1]+s*i[f.COLUMN2ROW2]),d=n.dot(a,r)+t.distance;return d<=-l?c.OUTSIDE:d>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,F=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,g),a=e.halfAxes,i=f.getColumn(a,0,P),o=f.getColumn(a,1,U),u=f.getColumn(a,2,D),s=n.magnitude(i),c=n.magnitude(o),l=n.magnitude(u);n.normalize(i,i),n.normalize(o,o),n.normalize(u,u);var d=F;d.x=n.dot(r,i),d.y=n.dot(r,o),d.z=n.dot(r,u);var h,E=0;return d.x<-s?(h=d.x+s,E+=h*h):d.x>s&&(h=d.x-s,E+=h*h),d.y<-c?(h=d.y+c,E+=h*h):d.y>c&&(h=d.y-c,E+=h*h),d.z<-l?(h=d.z+l,E+=h*h):d.z>l&&(h=d.z-l,E+=h*h),E};var L=new n,B=new n;m.computePlaneDistances=function(e,t,r,a){i(a)||(a=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,d=f.getColumn(c,0,P),h=f.getColumn(c,1,U),E=f.getColumn(c,2,D),m=n.add(d,h,L);n.add(m,E,m),n.add(m,s,m);var _=n.subtract(m,t,B),p=n.dot(r,_);return o=Math.min(p,o),u=Math.max(p,u),n.add(s,d,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.add(s,d,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.add(s,d,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,d,m),n.add(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,d,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,d,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,d,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),a.start=o,a.stop=u,a};var z=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,z);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||i(e)&&i(t)&&n.equals(e.center,t.center)&&f.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,n,r,a,i){"use strict";var o={};o.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,a=n.y;n.x=(1-Math.abs(a))*i.signNotZero(r),n.y=(1-Math.abs(r))*i.signNotZero(a)}return n.x=i.toSNorm(n.x,t),n.y=i.toSNorm(n.y,t),n},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,n,r,a){if(a.x=i.fromSNorm(e,r),a.y=i.fromSNorm(n,r),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},o.octDecode=function(e,t,n){return o.octDecodeInRange(e,t,255,n)},o.octPackFloat=function(e){return 256*e.x+e.y};var u=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,u),o.octPackFloat(u)},o.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return o.octDecode(r,a,t)},o.octPack=function(e,t,n,r){var a=o.octEncodeFloat(e),i=o.octEncodeFloat(t),s=o.octEncode(n,u);return r.x=65536*s.x+a,r.y=65536*s.y+i,r},o.octUnpack=function(e,t,n,r){var a=e.x/65536,i=Math.floor(a),u=65536*(a-i);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);o.octDecodeFloat(u,t),o.octDecodeFloat(c,n),o.octDecode(i,s,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},o.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,o,c,f){var _,p,T,y;if(i(e)&&i(t)&&i(r)&&i(o)){var R=e.minimum,A=e.maximum,S=n.subtract(A,R,d),N=r-t,M=Math.max(n.maximumComponent(S),N);_=M<m-1?s.BITS12:s.NONE,p=e.center,T=u.inverseTransformation(o,new u);var g=n.negate(R,l);u.multiply(u.fromTranslation(g,h),T,T);var I=l;I.x=1/S.x,I.y=1/S.y,I.z=1/S.z,u.multiply(u.fromScale(I,h),T,T),y=u.clone(o),u.setTranslation(y,n.ZERO,y),o=u.clone(o,new u);var O=u.fromTranslation(R,h),v=u.fromScale(S,E),w=u.multiply(O,v,h);u.multiply(o,w,o),u.multiply(y,w,y)}this.quantization=_,this.minimumHeight=t,this.maximumHeight=r,this.center=p,this.toScaledENU=T,this.fromScaledENU=o,this.matrix=y,this.hasVertexNormals=c,this.hasWebMercatorT=a(f,!1)}var l=new n,d=new n,f=new t,h=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,i,c,d,h,E){var m=c.x,_=c.y;if(this.quantization===s.BITS12){i=u.multiplyByPoint(this.toScaledENU,i,l),i.x=o.clamp(i.x,0,1),i.y=o.clamp(i.y,0,1),i.z=o.clamp(i.z,0,1);var p=this.maximumHeight-this.minimumHeight,T=o.clamp((d-this.minimumHeight)/p,0,1);t.fromElements(i.x,i.y,f);var y=e.compressTextureCoordinates(f);t.fromElements(i.z,T,f);var R=e.compressTextureCoordinates(f);t.fromElements(m,_,f);var A=e.compressTextureCoordinates(f);if(r[a++]=y,r[a++]=R,r[a++]=A,this.hasWebMercatorT){t.fromElements(E,0,f);var S=e.compressTextureCoordinates(f);r[a++]=S}}else n.subtract(i,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=d,r[a++]=m,r[a++]=_,this.hasWebMercatorT&&(r[a++]=E);return this.hasVertexNormals&&(r[a++]=e.octPackFloat(h)),a},c.prototype.decodePosition=function(t,r,a){if(i(a)||(a=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],f);a.x=o.x,a.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],f);return a.z=c.x,u.multiplyByPoint(this.fromScaledENU,a,a)}return a.x=t[r],a.y=t[r+1],a.z=t[r+2],n.add(a,this.center,a)},c.prototype.decodeTextureCoordinates=function(n,r,a){return i(a)||(a=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],a):t.fromElements(n[r+4],n[r+5],a)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){var r=e.decompressTextureCoordinates(t[n+1],f);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var a=this.getStride();n=(n+1)*a-1;var i=e[n]/256,o=Math.floor(i),u=256*(i-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},p={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,n=r.FLOAT,a=r.getSizeInBytes(n);if(this.quantization===s.NONE){var i=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(i+o)*a,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:i*a,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*a,[{index:p.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:p.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*a,strideInBytes:t}]):[{index:p.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?_:p},c.clone=function(e,t){return i(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius, +this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},s.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},s}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,a=t.message;n=e(r)&&e(a)?r+": "+a:t.toString();var i=t.stack;return e(i)&&(n+="\n"+i),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){"use strict";function r(r){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return r}),define("Workers/createVerticesFromGoogleEarthEnterpriseBuffer",["../Core/AxisAlignedBoundingBox","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defaultValue","../Core/defined","../Core/Ellipsoid","../Core/EllipsoidalOccluder","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/Rectangle","../Core/RuntimeError","../Core/TerrainEncoding","../Core/Transforms","../Core/WebMercatorProjection","./createTaskProcessorWorker"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,h,E,m,_,p){"use strict";function T(e,t,n){n=i(n,c);for(var r=e.length,a=0;a<r;++a)if(n.equalsEpsilon(e[a],t,c.EPSILON12))return a;return-1}function y(e,t){e.ellipsoid=u.clone(e.ellipsoid),e.rectangle=f.clone(e.rectangle);var n=R(e.buffer,e.relativeToCenter,e.ellipsoid,e.rectangle,e.nativeRectangle,e.exaggeration,e.skirtHeight,e.includeWebMercatorT,e.negativeAltitudeExponentBias,e.negativeElevationThreshold),r=n.vertices;t.push(r.buffer);var a=n.indices;return t.push(a.buffer),{vertices:r.buffer,indices:a.buffer,numberOfAttributes:n.encoding.getStride(),minimumHeight:n.minimumHeight,maximumHeight:n.maximumHeight,boundingSphere3D:n.boundingSphere3D,orientedBoundingBox:n.orientedBoundingBox,occludeePointInScaledSpace:n.occludeePointInScaledSpace,encoding:n.encoding,vertexCountWithoutSkirts:n.vertexCountWithoutSkirts,skirtIndex:n.skirtIndex}}function R(i,u,f,p,y,R,P,U,D,F){var L,B,z,b,q,G;o(p)?(L=p.west,B=p.south,z=p.east,b=p.north,q=p.width,G=p.height):(L=c.toRadians(y.west),B=c.toRadians(y.south),z=c.toRadians(y.east),b=c.toRadians(y.north),q=c.toRadians(p.width),G=c.toRadians(p.height));var W,X,V=[B,b],H=[L,z],Y=m.eastNorthUpToFixedFrame(u,f),k=l.inverseTransformation(Y,C);U&&(W=_.geodeticLatitudeToMercatorAngle(B),X=1/(_.geodeticLatitudeToMercatorAngle(b)-W));var j=new DataView(i),Z=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,Q=w;Q.x=Number.POSITIVE_INFINITY,Q.y=Number.POSITIVE_INFINITY,Q.z=Number.POSITIVE_INFINITY;var J=x;J.x=Number.NEGATIVE_INFINITY,J.y=Number.NEGATIVE_INFINITY,J.z=Number.NEGATIVE_INFINITY;for(var $,ee=0,te=0,ne=0,re=0;re<4;++re){var ae=ee;$=j.getUint32(ae,!0),ae+=M;var ie=c.toRadians(180*j.getFloat64(ae,!0));ae+=I,T(H,ie)===-1&&H.push(ie);var oe=c.toRadians(180*j.getFloat64(ae,!0));ae+=I,T(V,oe)===-1&&V.push(oe),ae+=2*I;var ue=j.getInt32(ae,!0);ae+=N,te+=ue,ue=j.getInt32(ae,!0),ne+=3*ue,ee+=$+M}var se=[],ce=[],le=new Array(te),de=new Array(te),fe=new Array(te),he=U?new Array(te):[],Ee=new Array(ne),me=[],_e=[],pe=[],Te=[],ye=0,Re=0;for(ee=0,re=0;re<4;++re){$=j.getUint32(ee,!0),ee+=M;var Ae=ee,Se=c.toRadians(180*j.getFloat64(ee,!0));ee+=I;var Ne=c.toRadians(180*j.getFloat64(ee,!0));ee+=I;var Me=c.toRadians(180*j.getFloat64(ee,!0)),ge=.5*Me;ee+=I;var Ie=c.toRadians(180*j.getFloat64(ee,!0)),Oe=.5*Ie;ee+=I;var ve=j.getInt32(ee,!0);ee+=N;var we=j.getInt32(ee,!0);ee+=N,ee+=N;for(var xe=new Array(ve),Ce=0;Ce<ve;++Ce){var Pe=Se+j.getUint8(ee++)*Me;O.longitude=Pe;var Ue=Ne+j.getUint8(ee++)*Ie;O.latitude=Ue;var De=6371010*j.getFloat32(ee,!0);if(ee+=g,De<F&&(De*=D),De*=R,O.height=De,T(H,Pe)!==-1||T(V,Ue)!==-1){var Fe=T(se,O,a);if(Fe!==-1){xe[Ce]=ce[Fe];continue}se.push(a.clone(O)),ce.push(ye)}xe[Ce]=ye,Math.abs(Pe-L)<ge?me.push({index:ye,cartographic:a.clone(O)}):Math.abs(Pe-z)<ge?pe.push({index:ye,cartographic:a.clone(O)}):Math.abs(Ue-B)<Oe?_e.push({index:ye,cartographic:a.clone(O)}):Math.abs(Ue-b)<Oe&&Te.push({index:ye,cartographic:a.clone(O)}),Z=Math.min(De,Z),K=Math.max(De,K),fe[ye]=De;var Le=f.cartographicToCartesian(O);le[ye]=Le,U&&(he[ye]=(_.geodeticLatitudeToMercatorAngle(Ue)-W)*X),l.multiplyByPoint(k,Le,v),r.minimumByComponent(v,Q,Q),r.maximumByComponent(v,J,J);var Be=(Pe-L)/(z-L);Be=c.clamp(Be,0,1);var ze=(Ue-B)/(b-B);ze=c.clamp(ze,0,1),de[ye]=new n(Be,ze),++ye}var be=3*we;for(Ce=0;Ce<be;++Ce,++Re)Ee[Re]=xe[j.getUint16(ee,!0)],ee+=S;if($!==ee-Ae)throw new h("Invalid terrain tile.")}le.length=ye,de.length=ye,fe.length=ye,U&&(he.length=ye);var qe=ye,Ge=Re,We={hMin:Z,lastBorderPoint:void 0,skirtHeight:P,toENU:k,ellipsoid:f,minimum:Q,maximum:J};me.sort(function(e,t){return t.cartographic.latitude-e.cartographic.latitude}),_e.sort(function(e,t){return e.cartographic.longitude-t.cartographic.longitude}),pe.sort(function(e,t){return e.cartographic.latitude-t.cartographic.latitude}),Te.sort(function(e,t){return t.cartographic.longitude-e.cartographic.longitude});var Xe=1e-5;if(A(le,fe,de,he,Ee,We,me,-Xe*q,!0,-Xe*G),A(le,fe,de,he,Ee,We,_e,-Xe*G,!1),A(le,fe,de,he,Ee,We,pe,Xe*q,!0,Xe*G),A(le,fe,de,he,Ee,We,Te,Xe*G,!1),me.length>0&&Te.length>0){var Ve=me[0].index,He=qe,Ye=Te[Te.length-1].index,ke=le.length-1;Ee.push(Ye,ke,He,He,Ve,Ye)}te=le.length;var je,Ze=t.fromPoints(le);o(p)&&p.width<c.PI_OVER_TWO+c.EPSILON5&&(je=d.fromRectangle(p,Z,K,f));for(var Ke=new s(f),Qe=Ke.computeHorizonCullingPoint(u,le),Je=new e(Q,J,u),$e=new E(Je,We.hMin,K,Y,!1,U),et=new Float32Array(te*$e.getStride()),tt=0,nt=0;nt<te;++nt)tt=$e.encode(et,tt,le[nt],de[nt],fe[nt],void 0,he[nt]);return{vertices:et,indices:new Uint16Array(Ee),maximumHeight:K,minimumHeight:Z,encoding:$e,boundingSphere3D:Ze,orientedBoundingBox:je,occludeePointInScaledSpace:Qe,vertexCountWithoutSkirts:qe,skirtIndex:Ge}}function A(e,t,i,u,s,d,f,h,E,m){for(var _=f.length,p=0;p<_;++p){var T=f[p],y=T.cartographic,R=T.index,A=e.length,S=y.longitude,N=y.latitude;N=c.clamp(N,-c.PI_OVER_TWO,c.PI_OVER_TWO);var M=y.height-d.skirtHeight;d.hMin=Math.min(d.hMin,M),a.fromRadians(S,N,M,O),E&&(O.longitude+=h),E?p===_-1?O.latitude+=m:0===p&&(O.latitude-=m):O.latitude+=h;var g=d.ellipsoid.cartographicToCartesian(O);e.push(g),t.push(M),i.push(n.clone(i[R])),u.length>0&&u.push(u[R]),l.multiplyByPoint(d.toENU,g,v);var I=d.minimum,w=d.maximum;r.minimumByComponent(v,I,I),r.maximumByComponent(v,w,w);var x=d.lastBorderPoint;if(o(x)){var C=x.index;s.push(C,A-1,A,A,R,C)}d.lastBorderPoint=T}}var S=Uint16Array.BYTES_PER_ELEMENT,N=Int32Array.BYTES_PER_ELEMENT,M=Uint32Array.BYTES_PER_ELEMENT,g=Float32Array.BYTES_PER_ELEMENT,I=Float64Array.BYTES_PER_ELEMENT,O=new a,v=new r,w=new r,x=new r,C=new l;return p(y)})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createVerticesFromHeightmap.js b/engines/Cesium/Workers/createVerticesFromHeightmap.js index e98ae36..f5023fb 100644 --- a/engines/Cesium/Workers/createVerticesFromHeightmap.js +++ b/engines/Cesium/Workers/createVerticesFromHeightmap.js @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var d=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,d);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,d=r*u-a*o;return n.x=c,n.y=l,n.z=d,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var f=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(r),f=o.normalize(f,f),o.multiplyComponents(s,f,h);var l=Math.sqrt(o.dot(f,h));return h=o.divideByScalar(h,l,h),f=o.multiplyByScalar(f,a,f),n(u)||(u=new o),o.add(h,f,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,d=n.y,f=n.z,h=a.x,E=a.y,m=a.z,_=l*l*h*h,p=d*d*E*E,T=f*f*m*m,y=_+p+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(n,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,N=u.y,M=u.z,I=o;I.x=A.x*S*2,I.y=A.y*N*2,I.z=A.z*M*2;var O,g,v,w,x,C,P,U,D,F,L,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(I)),z=0;do{B-=z,v=1/(1+B*S),w=1/(1+B*N),x=1/(1+B*M),C=v*v,P=w*w,U=x*x,D=C*v,F=P*w,L=U*x,O=_*C+p*P+T*U-1,g=_*D*S+p*F*N+T*L*M;var b=-2*g;z=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*v,c.y=d*w,c.z=f*x,c):new e(l*v,d*w,f*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,d=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:d,m=n(r)?r.oneOverRadiiSquared:f,_=n(r)?r._centerToleranceSquared:h,p=o(t,E,m,_,c);if(n(p)){var T=e.multiplyComponents(p,m,s);T=e.normalize(T,T);var y=e.subtract(t,p,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),S=i.sign(e.dot(y,t))*e.magnitude(y);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var d=new e,f=new e;l.prototype.cartographicToCartesian=function(t,n){var a=d,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),d=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=d,a):new t(c,l,d)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,d=t.length,f=1;f<d;f++){var h=t[f],E=h.x,m=h.y,_=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var p=r.minimum;p.x=a,p.y=o,p.z=u;var T=r.maximum;T.x=s,T.y=c,T.z=l;var y=e.add(p,T,r.center);return e.multiplyByScalar(y,.5,y),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function d(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,d=E[a],f=m[a];if(Math.abs(e[s.getElementIndex(f,d)])>n){var h,_=e[s.getElementIndex(f,f)],p=e[s.getElementIndex(d,d)],T=e[s.getElementIndex(f,d)],y=(_-p)/2/T;h=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(d,d)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,d)]=l,t[s.getElementIndex(d,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,d=e.z*e.z,f=e.z*e.w,h=e.w*e.w,E=n-u-d+h,m=2*(a-f),_=2*(i+l),p=2*(a+f),T=-n+u-d+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+d+h;return r(t)?(t[0]=E,t[1]=p,t[2]=R,t[3]=m,t[4]=T,t[5]=A,t[6]=_,t[7]=y,t[8]=S,t):new s(E,m,_,p,T,y,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,d=-i*u+c*o*a,f=c*u+i*o*a,h=n*u,E=i*a+c*o*u,m=-o*i+i*o*u,_=-o,p=c*n,T=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=_,t[3]=d,t[4]=E,t[5]=p,t[6]=f,t[7]=m,t[8]=T,t):new s(l,d,f,h,E,m,_,p,T)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],d=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=d,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],_=new s,p=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=n*c(h);o<a&&l(h)>E;)d(h,_),s.transpose(_,p),s.multiply(h,_,h),s.multiply(p,h,h),s.multiply(f,_,f),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],d=e[8],f=s.determinant(e);t[0]=o*d-l*u,t[1]=l*a-r*d,t[2]=r*u-o*a,t[3]=c*u-i*d,t[4]=n*d-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/f;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r); -};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,d,f,h,E,m,_){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(d,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(_,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,d=t.x*t.z,f=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,_=t.z*t.z,p=t.z*t.w,T=t.w*t.w,y=s-h-_+T,R=2*(c-p),A=2*(d+m),S=2*(c+p),N=-s+h-_+T,M=2*(E-f),I=2*(d-m),O=2*(E+f),g=-s-h+_+T;return r[0]=y*i,r[1]=S*i,r[2]=I*i,r[3]=0,r[4]=R*o,r[5]=N*o,r[6]=O*o,r[7]=0,r[8]=A*u,r[9]=M*u,r[10]=g*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var d=new e,f=new e,h=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,d),e.normalize(e.cross(d,o,f),f),e.normalize(e.cross(f,d,h),h);var u=f.x,s=f.y,c=f.z,E=d.x,m=d.y,_=d.z,p=h.x,T=h.y,y=h.z,R=r.x,A=r.y,S=r.z,N=u*-R+s*-A+c*-S,M=p*-R+T*-A+y*-S,I=E*R+m*A+_*S;return a(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=T,n[6]=-m,n[7]=0,n[8]=c,n[9]=y,n[10]=-_,n[11]=0,n[12]=N,n[13]=M,n[14]=I,n[15]=1,n):new l(u,s,c,N,p,T,y,M,-E,-m,-_,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,d=-(r+n)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=d,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),d=-(i+a)/(i-a),f=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=d,o[11]=f,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,d=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=d,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,d=.5*(n-t),f=c,h=l,E=d,m=i+c,_=o+l,p=t+d,T=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=p,a[15]=T,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],d=e[8],f=e[9],h=e[10],E=e[11],m=e[12],_=e[13],p=e[14],T=e[15],y=t[0],R=t[1],A=t[2],S=t[3],N=t[4],M=t[5],I=t[6],O=t[7],g=t[8],v=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],F=r*y+u*R+d*A+m*S,L=a*y+s*R+f*A+_*S,B=i*y+c*R+h*A+p*S,z=o*y+l*R+E*A+T*S,b=r*N+u*M+d*I+m*O,q=a*N+s*M+f*I+_*O,G=i*N+c*M+h*I+p*O,W=o*N+l*M+E*I+T*O,X=r*g+u*v+d*w+m*x,V=a*g+s*v+f*w+_*x,H=i*g+c*v+h*w+p*x,Y=o*g+l*v+E*w+T*x,k=r*C+u*P+d*U+m*D,j=a*C+s*P+f*U+_*D,Z=i*C+c*P+h*U+p*D,K=o*C+l*P+E*U+T*D;return n[0]=F,n[1]=L,n[2]=B,n[3]=z,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],d=e[10],f=e[12],h=e[13],E=e[14],m=t[0],_=t[1],p=t[2],T=t[4],y=t[5],R=t[6],A=t[8],S=t[9],N=t[10],M=t[12],I=t[13],O=t[14],g=r*m+o*_+c*p,v=a*m+u*_+l*p,w=i*m+s*_+d*p,x=r*T+o*y+c*R,C=a*T+u*y+l*R,P=i*T+s*y+d*R,U=r*A+o*S+c*N,D=a*A+u*S+l*N,F=i*A+s*S+d*N,L=r*M+o*I+c*O+f,B=a*M+u*I+l*O+h,z=i*M+s*I+d*O+E;return n[0]=g,n[1]=v,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=F,n[11]=0,n[12]=L,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],d=e[10],f=t[0],h=t[1],E=t[2],m=t[3],_=t[4],p=t[5],T=t[6],y=t[7],R=t[8],A=r*f+o*h+c*E,S=a*f+u*h+l*E,N=i*f+s*h+d*E,M=r*m+o*_+c*p,I=a*m+u*_+l*p,O=i*m+s*_+d*p,g=r*T+o*y+c*R,v=a*T+u*y+l*R,w=i*T+s*y+d*R;return n[0]=A,n[1]=S,n[2]=N,n[3]=0,n[4]=M,n[5]=I,n[6]=O,n[7]=0,n[8]=g,n[9]=v,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var p=new s,T=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,p),T,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],d=e[1],f=e[5],h=e[9],E=e[13],m=e[2],_=e[6],A=e[10],S=e[14],N=e[3],M=e[7],I=e[11],O=e[15],g=A*O,v=S*I,w=_*O,x=S*M,C=_*I,P=A*M,U=m*O,D=S*N,F=m*I,L=A*N,B=m*M,z=_*N,b=g*f+x*h+C*E-(v*f+w*h+P*E),q=v*d+U*h+L*E-(g*d+D*h+F*E),G=w*d+D*f+B*E-(x*d+U*f+z*E),W=P*d+F*f+z*h-(C*d+L*f+B*h),X=v*a+w*i+P*o-(g*a+x*i+C*o),V=g*r+D*i+F*o-(v*r+U*i+L*o),H=x*r+U*a+z*o-(w*r+D*a+B*o),Y=C*r+L*a+B*i-(P*r+F*a+z*i);g=i*E,v=o*h,w=a*E,x=o*f,C=a*h,P=i*f,U=r*E,D=o*d,F=r*h,L=i*d,B=r*f,z=a*d;var k=g*M+x*I+C*O-(v*M+w*I+P*O),j=v*N+U*I+L*O-(g*N+D*I+F*O),Z=w*N+D*M+B*O-(x*N+U*M+z*O),K=P*N+F*M+z*I-(C*N+L*M+B*I),Q=w*A+P*S+v*_-(C*S+g*_+x*A),J=F*S+g*m+D*A-(U*A+L*S+v*m),$=U*_+z*S+x*m-(B*S+w*m+D*_),ee=B*A+C*m+L*_-(F*_+z*A+P*m),te=r*b+a*q+i*G+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=j*te,n[10]=Z*te,n[11]=K*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],d=e[12],f=e[13],h=e[14],E=-n*d-r*f-a*h,m=-i*d-o*f-u*h,_=-s*d-c*f-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,d=0,f=e.length;d<f;d++){var h=e[d];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,d=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var E=t.cartesianToCartographic(e[f]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),d=Math.max(d,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=d,n):new s(a,l,i,d)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),d=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&d<=l)){var f=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(f>=h))return r(n)?(n.west=l,n.south=f,n.east=d,n.north=h,n):new s(l,f,d,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),d=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=d,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,d=e.north,f=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,d<0?m.latitude=d:f>0?m.latitude=f:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,d){"use strict";function f(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,E=new e,m=new e,_=new e,p=new e,T=new e,y=new e,R=new e,A=new e,S=new e,N=new e,M=new e;f.fromPoints=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],y),i=e.clone(r,h),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,_),c=e.clone(r,p),l=e.clone(r,T),d=t.length,I=1;I<d;I++){e.clone(t[I],r);var O=r.x,g=r.y,v=r.z;O<i.x&&e.clone(r,i),O>s.x&&e.clone(r,s),g<o.y&&e.clone(r,o),g>c.y&&e.clone(r,c),v<u.z&&e.clone(r,u),v>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var F=A;F.x=.5*(P.x+U.x),F.y=.5*(P.y+U.y),F.z=.5*(P.z+U.z);var L=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(L),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(z,b,R),.5,M),G=0;for(I=0;I<d;I++){e.clone(t[I],r);var W=e.magnitude(e.subtract(r,q,R));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(r,F,R));if(X>L){var V=Math.sqrt(X);B=.5*(B+V),L=B*B;var H=V-B;F.x=(B*F.x+H*r.x)/V,F.y=(B*F.y+H*r.y)/V,F.z=(B*F.z+H*r.z)/V}}return B<G?(e.clone(F,n.center),n.radius=B):(e.clone(q,n.center),n.radius=G),n};var I=new o,O=new e,g=new e,v=new t,w=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,I),d.southwest(t,v),v.height=i,d.northeast(t,w),w.height=o;var s=n.project(v,O),c=n.project(w,g),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];f.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=d.subsample(e,t,n,x)),f.fromPoints(u,o)},f.fromVertices=function(t,n,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=y;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),d=e.clone(u,_),I=e.clone(u,p),O=e.clone(u,T),g=t.length,v=0;v<g;v+=i){var w=t[v]+n.x,x=t[v+1]+n.y,C=t[v+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>d.x&&e.clone(u,d),x<c.y&&e.clone(u,c),x>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(d,s,R)),U=e.magnitudeSquared(e.subtract(I,c,R)),D=e.magnitudeSquared(e.subtract(O,l,R)),F=s,L=d,B=P;U>B&&(B=U,F=c,L=I),D>B&&(B=D,F=l,L=O);var z=A;z.x=.5*(F.x+L.x),z.y=.5*(F.y+L.y),z.z=.5*(F.z+L.z);var b=e.magnitudeSquared(e.subtract(L,z,R)),q=Math.sqrt(b),G=S;G.x=s.x,G.y=c.y,G.z=l.z;var W=N;W.x=d.x,W.y=I.y,W.z=O.z;var X=e.multiplyByScalar(e.add(G,W,R),.5,M),V=0;for(v=0;v<g;v+=i){u.x=t[v]+n.x,u.y=t[v+1]+n.y,u.z=t[v+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var j=k-q;z.x=(q*z.x+j*u.x)/k,z.y=(q*z.y+j*u.y)/k,z.z=(q*z.z+j*u.z)/k}}return q<V?(e.clone(z,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},f.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new f),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=y;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,p),d=e.clone(i,T),I=t.length,O=0;O<I;O+=3){var g=t[O]+n[O],v=t[O+1]+n[O+1],w=t[O+2]+n[O+2];i.x=g,i.y=v,i.z=w,g<o.x&&e.clone(i,o),g>c.x&&e.clone(i,c),v<u.y&&e.clone(i,u),v>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>d.z&&e.clone(i,d)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(d,s,R)),U=o,D=c,F=x;C>F&&(F=C,U=u,D=l),P>F&&(F=P,U=s,D=d);var L=A;L.x=.5*(U.x+D.x),L.y=.5*(U.y+D.y),L.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,L,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var q=N;q.x=c.x,q.y=l.y,q.z=d.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,M),W=0;for(O=0;O<I;O+=3){i.x=t[O]+n[O],i.y=t[O+1]+n[O+1],i.z=t[O+2]+n[O+2];var X=e.magnitude(e.subtract(i,G,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,L,R));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;L.x=(z*L.x+Y*i.x)/H,L.y=(z*L.y+Y*i.y)/H,L.z=(z*L.z+Y*i.z)/H}}return z<W?(e.clone(L,r.center),r.radius=z):(e.clone(G,r.center),r.radius=W),r},f.fromCornerPoints=function(t,n,r){a(r)||(r=new f);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},f.fromEllipsoid=function(t,n){return a(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;f.fromBoundingSpheres=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return f.clone(t[0],n);if(2===r)return f.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=f.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;f.fromOrientedBoundingBox=function(t,n){a(n)||(n=new f);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D),s=e.magnitude(i),l=e.magnitude(o),d=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,d),n},f.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},f.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new f);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var F=new e,L=new e;f.union=function(t,n,r){a(r)||(r=new f);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,F),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var d=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+d)/l,L);return e.add(h,i,h),e.clone(h,r.center),r.radius=d,r};var B=new e;f.expand=function(t,n,r){r=f.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},f.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;f.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},f.transformWithoutScale=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;f.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,G=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return f.projectTo2D=function(t,n,a){n=r(n,j);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var d=e.negate(l,V),h=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,d,m),e.add(m,h,m),m=E[3],e.add(s,d,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,d,m),e.add(m,h,m),m=E[7],e.add(s,d,m),e.add(m,c,m);for(var _=E.length,p=0;p<_;++p){var T=E[p];e.add(o,T,T);var y=i.cartesianToCartographic(T,H);n.project(y,T)}a=f.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,n){return f.computePlaneDistances(this,e,t,n)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){ -return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var d=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,d);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,n,r,a,i,o){"use strict";function u(e,n){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(n)&&(this.cameraPosition=n)}function s(e,n,r){var a=e.transformPositionToScaledSpace(n,E),i=t.magnitudeSquared(a),o=Math.sqrt(i),u=t.divideByScalar(a,o,m);i=Math.max(1,i),o=Math.max(1,o);var s=t.dot(u,r),c=t.magnitude(t.cross(u,r,u)),l=1/o,d=Math.sqrt(i-1)*l;return 1/(s*l-c*d)}function c(e,n,r){if(!(n<=0||n===1/0||n!==n))return t.multiplyByScalar(e,n,r)}function l(e,n){return t.equals(n,t.ZERO)?n:(e.transformPositionToScaledSpace(n,_),t.normalize(_,_))}a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var n=this._ellipsoid,r=n.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),a=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=a}}});var d=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,n=t.transformPositionToScaledSpace(e,d);return this.isScaledSpacePointVisible(n)},u.prototype.isScaledSpacePointVisible=function(e){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,a=t.subtract(e,n,d),i=-t.dot(a,n),o=r<0?i>0:i>r&&i*i/t.magnitudeSquared(a)>r;return!o},u.prototype.computeHorizonCullingPoint=function(e,n,a){r(a)||(a=new t);for(var i=this._ellipsoid,o=l(i,e),u=0,d=0,f=n.length;d<f;++d){var h=n[d],E=s(i,h,o);u=Math.max(u,E)}return c(o,u,a)};var f=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,a,i,o,u){r(u)||(u=new t),o=n(o,t.ZERO);for(var d=this._ellipsoid,h=l(d,e),E=0,m=0,_=a.length;m<_;m+=i){f.x=a[m]+o.x,f.y=a[m+1]+o.y,f.z=a[m+2]+o.z;var p=s(d,f,h);E=Math.max(E,p)}return c(h,E,u)};var h=[];u.prototype.computeHorizonCullingPointFromRectangle=function(n,r,a){var i=o.subsample(n,r,0,h),u=e.fromPoints(i);if(!(t.magnitude(u.center)<.1*r.minimumRadius))return this.computeHorizonCullingPoint(u.center,i,a)};var E=new t,m=new t,_=new t;return u}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,d=n(c,-l,t.EPSILON14);if(d<0)return[];var f=-.5*n(r,t.sign(r)*Math.sqrt(d),t.EPSILON14);return r>0?[f/e,a/f]:[a/f,f/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,d=u*c,f=u*u,h=s*s,E=o*s-f,m=o*c-u*s,_=u*c-h,p=4*E*_-m*m;if(p<0){var T,y,R;f*d>=l*h?(T=o,y=E,R=-2*u*E+o*m):(T=c,y=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(T)*Math.sqrt(-p);i=-R+S;var N=i/2,M=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===S?-M:-y/M;return a=y<=0?M+I:-R/(M*M+I*I+y),f*d>=l*h?[(a-u)/o]:[-c/(a+s)]}var O=E,g=-2*u*E+o*m,v=_,w=-c*m+2*s*_,x=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-g)/3);a=2*Math.sqrt(-O);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),F=i+D>2*u?i-u:D-u,L=o,B=F/L;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-v),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=i+D<2*s?i+s:D+s,q=z/b,G=L*b,W=-F*b-L*z,X=F*z,V=(s*W-u*X)/(-u*W+s*G);return B<=V?B<=q?V<=q?[B,V,q]:[B,q,V]:[q,B,V]:B<=q?[V,B,q]:V<=q?[V,q,B]:[q,V,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,d=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(d.length>0){var f=-t/4,h=d[d.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,_=E[0],p=E[1];if(_>=0&&p>=0){var T=Math.sqrt(_),y=Math.sqrt(p);return[f-y,f-T,f+T,f+y]}if(_>=0&&p<0)return m=Math.sqrt(_),[f-m,f+m];if(_<0&&p>=0)return m=Math.sqrt(p),[f-m,f+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,S=(s+h+c/R)/2,N=r.computeRealRoots(1,R,A),M=r.computeRealRoots(1,-R,S);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==M.length?(M[0]+=f,M[1]+=f,N[1]<=M[0]?[N[0],N[1],M[0],M[1]]:M[1]<=N[0]?[M[0],M[1],N[0],N[1]]:N[0]>=M[0]&&N[1]<=M[1]?[M[0],N[0],N[1],M[1]]:M[0]>=N[0]&&M[1]<=N[1]?[N[0],M[0],M[1],N[1]]:N[0]>M[0]&&N[0]<M[1]?[M[0],N[0],M[1],N[1]]:[N[0],M[0],N[1],M[1]]):N):0!==M.length?(M[0]+=f,M[1]+=f,M):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,d=i*t+s-4*o,f=c*o-i*a*t+u,h=e.computeRealRoots(1,l,d,f);if(h.length>0){var E,m,_=h[0],p=a-_,T=p*p,y=t/2,R=p/2,A=T-4*o,S=T+4*Math.abs(o),N=c-4*_,M=c+4*Math.abs(_);if(_<0||A*M<N*S){var I=Math.sqrt(N);E=I/2,m=0===I?0:(t*R-i)/I}else{var O=Math.sqrt(A);E=0===O?0:(t*R-i)/O,m=O/2}var g,v;0===y&&0===E?(g=0,v=0):n.sign(y)===n.sign(E)?(g=y+E,v=_/g):(v=y-E,g=_/v);var w,x;0===R&&0===m?(w=0,x=0):n.sign(R)===n.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var C=r.computeRealRoots(1,g,w),P=r.computeRealRoots(1,v,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,d=r*r,f=d*r,h=a*a,E=h*a,m=u*c*d-4*s*f-4*e*l*d+18*e*t*n*f-27*i*d*d+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*d+144*i*n*d)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,d=u/t,f=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=d<0?h+1:h,h+=f<0?h+1:h){case 0:return a(c,l,d,f);case 1:return i(c,l,d,f);case 2:return i(c,l,d,f);case 3:return a(c,l,d,f);case 4:return a(c,l,d,f);case 5:return i(c,l,d,f);case 6:return a(c,l,d,f);case 7:return a(c,l,d,f);case 8:return i(c,l,d,f);case 9:return a(c,l,d,f);case 10:return a(c,l,d,f);case 11:return i(c,l,d,f);case 12:return a(c,l,d,f);case 13:return a(c,l,d,f);case 14:return a(c,l,d,f);case 15:return a(c,l,d,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function d(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,T),f=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=d(f,h,E,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,d=a*a,f=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),_=t[u.COLUMN0ROW0]*d+t[u.COLUMN2ROW2]*f+a*n.x+r,p=f*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),T=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),y=[];if(0===T&&0===p){if(l=s.computeRealRoots(E,m,_),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],N=Math.sqrt(Math.max(1-S*S,0));y.push(new e(a,i*S,i*-N)),y.push(new e(a,i*S,i*N))}return y}var M=T*T,I=p*p,O=E*E,g=T*p,v=O+I,w=2*(m*E+g),x=2*_*E+m*m-I+M,C=2*(_*m-g),P=_*_-M;if(0===v&&0===w&&0===x&&0===C)return y;l=c.computeRealRoots(v,w,x,C,P);var U=l.length;if(0===U)return y;for(var D=0;D<U;++D){var F,L=l[D],B=L*L,z=Math.max(1-B,0),b=Math.sqrt(z);F=o.sign(E)===o.sign(_)?h(E*B+_,m*L,o.EPSILON12):o.sign(_)===o.sign(m*L)?h(E*B,m*L+_,o.EPSILON12):h(E*B+m*L,_,o.EPSILON12);var q=h(p*L,T,o.EPSILON15),G=F*q;G<0?y.push(new e(a,i*L,i*b)):G>0?y.push(new e(a,i*L,i*-b)):0!==b?(y.push(new e(a,i*L,i*-b)),y.push(new e(a,i*L,i*b)),++D):y.push(new e(a,i*L,i*b))}return y}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var _=new e,p=new e,T=new e,y=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,d,f,h=t.origin,E=t.direction,m=e.subtract(a,r,_),A=e.subtract(i,r,p),S=e.cross(E,A,T),N=e.dot(m,S);if(u){if(N<o.EPSILON6)return;if(s=e.subtract(h,r,y),l=e.dot(s,S),l<0||l>N)return;if(c=e.cross(s,m,R),d=e.dot(E,c),d<0||l+d>N)return;f=e.dot(A,c)/N}else{if(Math.abs(N)<o.EPSILON6)return;var M=1/N;if(s=e.subtract(h,r,y),l=e.dot(s,S)*M,l<0||l>1)return;if(c=e.cross(s,m,R),d=e.dot(E,c)*M,d<0||l+d>1)return;f=e.dot(A,c)*M}return f},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var N=new l;m.lineSegmentSphere=function(t,n,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var M=new e,I=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,M),d=e.multiplyComponents(c,t.direction,I),f=e.magnitudeSquared(l),h=e.dot(l,d);if(f>1){if(h>=0)return;var E=h*h;if(r=f-1,a=e.magnitudeSquared(d),o=a*r,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,_=r/s;return m<_?new i(m,_):{start:_,stop:m}}var p=Math.sqrt(r/a);return new i(p,p)}return f<1?(r=f-1,a=e.magnitudeSquared(d),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(d),new i(0,-h/a)):void 0};var O=new e,g=new e,v=new e,w=new e,x=new e,C=new u,P=new u,U=new u,D=new u,F=new u,L=new u,B=new u,z=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,O);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,O),d=e.normalize(l,l),f=e.mostOrthogonalAxis(l,w),h=e.normalize(e.cross(f,d,g),g),m=e.normalize(e.cross(d,h,v),v),_=C;_[0]=d.x,_[1]=d.y,_[2]=d.z,_[3]=h.x,_[4]=h.y,_[5]=h.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=u.transpose(_,P),T=u.fromScale(n.radii,U),y=u.fromScale(n.oneOverRadii,D),R=F;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,N=u.multiply(u.multiply(p,y,L),R,L),M=u.multiply(u.multiply(N,T,B),_,B),I=u.multiplyByVector(N,a,x),G=E(M,e.negate(I,O),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(T,u.multiplyByVector(_,G[H],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var j=n.cartesianToCartographic(X,q);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-V*V),S=c?-S:S,j.height=S,n.cartographicToCartesian(j,new e)}};var G=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),d=-(a.distance+l)/c;if(!(d<0||d>1))return e.multiplyByScalar(u,d,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var d,f;if(1!==l&&2!==l||(d=new e,f=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,d),m.lineSegmentPlane(t,r,a,f),{positions:[t,n,r,d,f],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,d),m.lineSegmentPlane(n,t,a,f),{positions:[t,n,r,d,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,d),m.lineSegmentPlane(r,n,a,f),{positions:[t,n,r,d,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,d),m.lineSegmentPlane(r,t,a,f),{positions:[t,n,r,d,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,d),m.lineSegmentPlane(t,n,a,f),{positions:[t,n,r,d,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,d),m.lineSegmentPlane(n,r,a,f),{positions:[t,n,r,d,f],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return f(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,d,f,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],d=[],f=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),d.push(a),r.promise},h=function(e){return m(d,e),e},E=function(e){return e=t(e),f=e.then,E=t,h=p,m(l,e),d=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,d,f,h,E,m,_,T,y;if(T=t.length>>>0,c=Math.max(0,Math.min(n,T)),d=[],l=T-c+1,f=[],h=o(),c)for(_=h.progress,m=function(e){f.push(e),--l||(E=m=p,h.reject(f))},E=function(e){d.push(e),--c||(E=m=p,h.resolve(d))},y=0;y<T;++y)y in t&&e(t[y],s,u,_);else h.resolve(d);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),f(e,T).then(t,n,r)}function d(){return f(arguments,T)}function f(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},y.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function T(e){return e}var y,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=d,e.all=l,e.map=f,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,y=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,d,f){var h,E,m,_,p;if("%%"==e)return"%";for(var T=!1,y="",R=!1,A=!1,S=" ",N=s.length,M=0;s&&M<N;M++)switch(s.charAt(M)){case" ":y=" ";break;case"+":y="+";break;case"-":T=!0;break;case"'":S=s.charAt(M+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,T=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(d=d?"*"==d?+t[n++]:"*"==d.charAt(0)?+t[d.slice(1,-1)]:+d:"fFeE".indexOf(f)>-1?6:"d"==f?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],f){case"s":return u(String(p),T,c,d,R,S);case"c":return u(String.fromCharCode(+p),T,c,d,R);case"b":return o(p,2,A,T,c,d,R);case"o":return o(p,8,A,T,c,d,R);case"x":return o(p,16,A,T,c,d,R);case"X":return o(p,16,A,T,c,d,R).toUpperCase();case"u":return o(p,10,A,T,c,d,R);case"i":case"d":return h=+p||0,h=Math.round(h-h%1),E=h<0?"-":y,p=E+a(String(Math.abs(h)),d,"0",!1),i(p,E,T,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+p,E=h<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(f.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(f)%2],p=E+Math.abs(h)[m](d),i(p,E,T,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function d(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function f(e,n){y.julianDate=e;var r=m.leapSeconds,a=t(r,y,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var d=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return d>=43200&&(l-=1),[l,d]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&d(this)}var _=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],T=29,y=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,N=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+I.source,g=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,v=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),d(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,f=0,_=0,y=0,I=0,w=u[0],x=u[1];if(u=w.match(M),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(N),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var F;if(r(x)){u=x.match(v),null!==u?(f=+u[1],_=+u[2],y=+u[3],I=1e3*+(u[4]||0),F=5):(u=x.match(g),null!==u?(f=+u[1],_=+u[2],y=60*+(u[3]||0),F=4):(u=x.match(O),null!==u&&(f=+u[1],_=60*+(u[2]||0),F=3)));var L=u[F],B=+u[F+1],z=+(u[F+2]||0);switch(L){case"+":f-=B,_-=z;break;case"-":f+=B,_+=z;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,f,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===y;for(b&&y--;_>=60;)_-=60,f++;for(;f>=24;)f-=24,l++;for(a=i&&2===s?T:p[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?T:p[s-1];for(;_<0;)_+=60,f--;for(;f<0;)f+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?T:p[s-1],l+=a;var q=E(n,s,l,f,_,y,I);return r(t)?(h(q[0],q[1],t),d(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=f(e,w);r(a)||(m.addSeconds(e,-1,w),a=f(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var d=4e3*(c+1)/1461001|0;c=c-(1461*d/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var _=h+2-12*c|0,p=100*(l-49)+d+c|0,T=u/s.SECONDS_PER_HOUR|0,y=u-T*s.SECONDS_PER_HOUR,R=y/s.SECONDS_PER_MINUTE|0;y-=R*s.SECONDS_PER_MINUTE;var A=0|y,S=(y-A)/s.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(A+=1),r(t)?(t.year=p,t.month=_,t.day=E,t.hour=T,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,_,E,T,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){ -return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var d=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,f){var h=d.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(f)&&n(E.overrideMimeType)&&E.overrideMimeType(f),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,d){"use strict";function f(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),f=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||f<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,p=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=f,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var T,y=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],N=_[R+m],M=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(M,N,d.TAI);if(p.push(I),y){if(N!==T&&r(T)){var O=o.leapSeconds,g=t(O,I,h);if(g<0){var v=new u(I,N);O.splice(~g,0,v)}}T=N}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function p(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var d=o.secondsDifference(r,c)/o.secondsDifference(l,c),f=a*s,h=i*s,E=n[f+e._ut1MinusUtcSecondsColumn],p=n[h+e._ut1MinusUtcSecondsColumn],T=p-E;if(T>.5||T<-.5){var y=n[f+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];y!==R&&(l.equals(r)?E=p:p-=R-y)}return u.xPoleWander=_(d,n[f+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(d,n[f+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(d,n[f+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(d,n[f+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(d,E,p),u}return f.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),f.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},f.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var d=i[u],f=i[u+1],h=o.lessThanOrEquals(d,e),E=!r(f),m=E||o.greaterThanOrEquals(f,e);if(h&&m)return s=u,!E&&f.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},f}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(d))return d;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),d=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(f)||(f=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=f(e);return h.href=n,h.href=h.href,h.href}var d,f,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){d=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=d;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var d=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var d=u/this._samplesPerXysFile|0,f=s/this._samplesPerXysFile|0,h=[],E=d;E<=f;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var d=s+u;d>=this._totalSamples&&(d=this._totalSamples-1,s=d-u,s<0&&(s=0));var f=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),f=!0),r(h[3*d])||(l(this,d/this._samplesPerXysFile|0),f=!0),!f){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,_=i-s*this._stepSizeDays,p=this._work,T=this._denominators,y=this._coef,R=this._xTable;for(E=0;E<=u;++E)p[E]=_-R[E];for(E=0;E<=u;++E){for(y[E]=1,m=0;m<=u;++m)m!==E&&(y[E]*=p[m]);y[E]*=T[E];var A=3*(s+E);n.x+=y[E]*h[A++],n.y+=y[E]*h[A++],n.s+=y[E]*h[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(N)&&(N=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,M=r(e[1]))}return N}function u(){return o()&&M}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,O=r(e[1]),O.isNightly=!!e[2])}return I}function c(){return s()&&O}function l(){if(!t(g)){g=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,v=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,v=r(e[1])))}return g}function d(){return l()&&v}function f(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function h(){return f()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return E()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function T(){if(!t(L)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;L=t(n)&&""!==n,L&&(F=n)}return L}function y(){return T()?F:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,N,M,I,O,g,v,w,x,C,P,U,D,F,L,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:d,isEdge:f,edgeVersion:h,isFirefox:E,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:T,imageRenderingValue:y};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var d=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);d=e.normalize(t,d);var u=d.x*o,s=d.y*o,c=d.z*o,f=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=f,a):new l(u,s,c,f)};var f=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],d=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+d+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var _=f,p=0;d>s&&(p=1),E>s&&E>d&&(p=2);var T=_[p],y=_[T];n=Math.sqrt(e[c.getElementIndex(p,p)]-e[c.getElementIndex(T,T)]-e[c.getElementIndex(y,y)]+1);var R=h;R[p]=.5*n,n=.5/n,u=(e[c.getElementIndex(y,T)]-e[c.getElementIndex(T,y)])*n,R[T]=(e[c.getElementIndex(T,p)]+e[c.getElementIndex(p,T)])*n,R[y]=(e[c.getElementIndex(y,p)]+e[c.getElementIndex(p,y)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,_=new l,p=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),p=l.fromAxisAngle(e.UNIT_X,o.roll,E),_=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(_,p,_),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var T=new e,y=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,T);var u=l.computeAngle(R);r[o]=T.x*u,r[o+1]=T.y*u,r[o+2]=T.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,y);var u=e.magnitude(y);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(y,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,d=o*u+r*l+a*c-i*s,f=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=d,n.y=f,n.z=h,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var N=new l;l.lerp=function(e,t,n,r){return N=l.multiplyByScalar(t,n,N),r=l.multiplyByScalar(e,1-n,r),l.add(N,r,r)};var M=new l,I=new l,O=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=M=l.negate(t,M)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return I=l.multiplyByScalar(e,Math.sin((1-n)*o),I),O=l.multiplyByScalar(i,Math.sin(n*o),O),r=l.add(I,O,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var g=new e,v=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,g);l.multiply(i,t,x);var u=l.log(x,v);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],D=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;U[B]=1/(z*b),D[B]=z/b}return U[7]=P/136,D[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,d=7;d>=0;--d)F[d]=(U[d]*s-D[d])*o,L[d]=(U[d]*c-D[d])*o;var f=a*n*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),h=u*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),E=l.multiplyByScalar(e,h,C);return l.multiplyByScalar(t,f,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,h,E,m,_,p,T,y,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},N={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},M={},I={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},O=new n,g=new n,v=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(M[i])?r=M[i]:(r=function(r,i,s){if(u(s)||(s=new T),_.equalsEpsilon(r.x,0,_.EPSILON14)&&_.equalsEpsilon(r.y,0,_.EPSILON14)){var c=_.sign(r.z);n.unpack(N[e],0,O),"east"!==e&&"west"!==e&&n.multiplyByScalar(O,c,O),n.unpack(N[t],0,g),"east"!==t&&"west"!==t&&n.multiplyByScalar(g,c,g),n.unpack(N[a],0,v),"east"!==a&&"west"!==a&&n.multiplyByScalar(v,c,v)}else{i=o(i,f.WGS84),i.geodeticSurfaceNormal(r,I.up);var l=I.up,d=I.east;d.x=-r.y,d.y=r.x,d.z=0,n.normalize(d,I.east),n.cross(l,d,I.north),n.multiplyByScalar(I.up,-1,I.down),n.multiplyByScalar(I.east,-1,I.west),n.multiplyByScalar(I.north,-1,I.south),O=I[e],g=I[t],v=I[a]}return s[0]=O.x,s[1]=O.y,s[2]=O.z,s[3]=0,s[4]=g.x,s[5]=g.y,s[6]=g.z,s[7]=0,s[8]=v.x,s[9]=v.y,s[10]=v.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},M[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new y,x=new n(1,1,1),C=new T;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof T&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=y.fromHeadingPitchRoll(t,w),c=T.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),T.multiply(i,c,i)};var P=new T,U=new p;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof y&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=T.getRotation(i,U);return y.fromRotationMatrix(o,a)};var D=24110.54841,F=8640184.812866,L=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,q=_.TWO_PI/86400,G=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(F+n*(L+n*B)),s=o*q%_.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,d=s+c*l,f=Math.cos(d),h=Math.sin(d);return u(t)?(t[0]=f,t[1]=-h,t[2]=0,t[3]=h,t[4]=f,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(f,h,0,-h,f,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return p.transpose(n,t)};var V=new E(0,0,0),H=new d(0,0,0,0,0,0),Y=new p,k=new p;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var d=p.fromRotationZ(-i.s,k),f=p.multiply(l,d,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=h-2451545,y=E/R.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(T+y);S=S%1*_.TWO_PI;var N=p.fromRotationZ(S,k),M=p.multiply(f,N,Y),I=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),v=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*_.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=k;return U[0]=I*C,U[1]=I*P,U[2]=g,U[3]=-O*P+v*g*C, -U[4]=O*C+v*g*P,U[5]=-v*I,U[6]=-v*P-O*g*C,U[7]=v*C-O*g*P,U[8]=O*I,p.multiply(M,U,t)}}};var j=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=j;return T.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),T.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var Z=new n,K=new n,Q=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,Q);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new T,ue=new T;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=T.getColumn(t,3,te),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,oe),c=T.inverseTransformation(s,ue),l=e.project(u,$),d=ne;d.x=l.z,d.y=l.x,d.z=l.y,d.w=1;var f=T.getColumn(t,0,ee),h=n.magnitude(f),E=T.multiplyByVector(c,f,re);r.fromElements(E.z,E.x,E.y,0,E);var m=T.getColumn(t,1,ee),_=n.magnitude(m),p=T.multiplyByVector(c,m,ae);r.fromElements(p.z,p.x,p.y,0,p);var y=T.getColumn(t,2,ee),R=n.magnitude(y),S=ie;return n.cross(E,p,S),n.normalize(S,S),n.cross(p,S,E),n.normalize(E,E),n.cross(S,E,p),n.normalize(p,p),n.multiplyByScalar(E,h,E),n.multiplyByScalar(p,_,p),n.multiplyByScalar(S,R,S),T.setColumn(a,0,E,a),T.setColumn(a,1,p,a),T.setColumn(a,2,S,a),T.setColumn(a,3,d,a),a};var se=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,oe),i=T.inverseTransformation(a,ue),o=r.cartesianToCartographic(t,J),u=e.project(o,$),s=ne;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=T.fromTranslation(s,oe);return T.multiply(se,i,n),T.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=d.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var p=new f,T=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,T);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=p;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,T);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var y=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=y,l=0;l<r;++l){var d=e[l];n.multiplyByScalar(u,d.x,c),i(t[l])||(t[l]=new n);var f=n.add(o,c,t[l]);n.multiplyByScalar(s,d.y,c),n.add(f,c,f),a.scaleToGeocentricSurface(f,f)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,h,E){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=f.clone(a(t,f.ZERO))}function _(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;f.setColumn(l,0,e.xAxis,l),f.setColumn(l,1,e.yAxis,l),f.setColumn(l,2,e.zAxis,l);var d=I;d.x=(t+r)/2,d.y=(a+o)/2,d.z=(u+s)/2;var h=O;h.x=(r-t)/2,h.y=(o-a)/2,h.z=(s-u)/2;var E=c.center;return d=f.multiplyByVector(l,d,d),n.add(e.origin,d,E),f.multiplyByScale(l,h,l),c}var p=new n,T=new n,y=new n,R=new n,A=new n,S=new n,N=new f,M={unitary:new f,diagonal:new f};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=f.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],p);for(r=1;r<a;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,d=0,h=0,E=0,_=0;for(r=0;r<a;r++)s=n.subtract(e[r],o,T),c+=s.x*s.x,l+=s.x*s.y,d+=s.x*s.z,h+=s.y*s.y,E+=s.y*s.z,_+=s.z*s.z;c*=u,l*=u,d*=u,h*=u,E*=u,_*=u;var I=N;I[0]=c,I[1]=l,I[2]=d,I[3]=l,I[4]=h,I[5]=E,I[6]=d,I[7]=E,I[8]=_;var O=f.computeEigenDecomposition(I,M),g=f.clone(O.unitary,t.halfAxes),v=f.getColumn(g,0,R),w=f.getColumn(g,1,A),x=f.getColumn(g,2,S),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,F=Number.MAX_VALUE,L=Number.MAX_VALUE;for(r=0;r<a;r++)s=e[r],C=Math.max(n.dot(v,s),C),P=Math.max(n.dot(w,s),P),U=Math.max(n.dot(x,s),U),D=Math.min(n.dot(v,s),D),F=Math.min(n.dot(w,s),F),L=Math.min(n.dot(x,s),L);v=n.multiplyByScalar(v,.5*(D+C),v),w=n.multiplyByScalar(w,.5*(F+P),w),x=n.multiplyByScalar(x,.5*(L+U),x);var B=n.add(v,w,t.center);B=n.add(B,x,B);var z=y;return z.x=C-D,z.y=P-F,z.z=U-L,n.multiplyByScalar(z,.5,z),f.multiplyByScale(t.halfAxes,z,t.halfAxes),t};var I=new n,O=new n,g=new r,v=new n,w=[new r,new r,new r,new r,new r,new r,new r,new r],x=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,i){t=a(t,0),n=a(n,0),r=a(r,u.WGS84);var o=E.center(e,g),c=r.cartographicToCartesian(o,v),l=new s(c,r),d=l.plane,f=w[0],m=w[1],p=w[2],T=w[3],y=w[4],R=w[5],A=w[6],S=w[7],N=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=y.latitude=e.south,S.latitude=T.latitude=M,f.latitude=m.latitude=p.latitude=e.north,A.longitude=S.longitude=f.longitude=e.west,R.longitude=m.longitude=N,y.longitude=T.longitude=p.longitude=e.east,p.height=m.height=f.height=S.height=A.height=R.height=y.height=T.height=n,r.cartographicArrayToCartesianArray(w,x),l.projectPointsToNearestOnPlane(x,C);var I=Math.min(C[6].x,C[7].x,C[0].x),O=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);p.height=f.height=y.height=A.height=t,r.cartographicArrayToCartesianArray(w,x);var D=Math.min(h.getPointDistance(d,x[0]),h.getPointDistance(d,x[2]),h.getPointDistance(d,x[4]),h.getPointDistance(d,x[6])),F=n;return _(l,I,O,P,U,D,F,i)},m.clone=function(e,t){if(i(e))return i(t)?(n.clone(e.center,t.center),f.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,a=t.normal,i=e.halfAxes,o=a.x,u=a.y,s=a.z,l=Math.abs(o*i[f.COLUMN0ROW0]+u*i[f.COLUMN0ROW1]+s*i[f.COLUMN0ROW2])+Math.abs(o*i[f.COLUMN1ROW0]+u*i[f.COLUMN1ROW1]+s*i[f.COLUMN1ROW2])+Math.abs(o*i[f.COLUMN2ROW0]+u*i[f.COLUMN2ROW1]+s*i[f.COLUMN2ROW2]),d=n.dot(a,r)+t.distance;return d<=-l?c.OUTSIDE:d>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,F=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,I),a=e.halfAxes,i=f.getColumn(a,0,P),o=f.getColumn(a,1,U),u=f.getColumn(a,2,D),s=n.magnitude(i),c=n.magnitude(o),l=n.magnitude(u);n.normalize(i,i),n.normalize(o,o),n.normalize(u,u);var d=F;d.x=n.dot(r,i),d.y=n.dot(r,o),d.z=n.dot(r,u);var h,E=0;return d.x<-s?(h=d.x+s,E+=h*h):d.x>s&&(h=d.x-s,E+=h*h),d.y<-c?(h=d.y+c,E+=h*h):d.y>c&&(h=d.y-c,E+=h*h),d.z<-l?(h=d.z+l,E+=h*h):d.z>l&&(h=d.z-l,E+=h*h),E};var L=new n,B=new n;m.computePlaneDistances=function(e,t,r,a){i(a)||(a=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,d=f.getColumn(c,0,P),h=f.getColumn(c,1,U),E=f.getColumn(c,2,D),m=n.add(d,h,L);n.add(m,E,m),n.add(m,s,m);var _=n.subtract(m,t,B),p=n.dot(r,_);return o=Math.min(p,o),u=Math.max(p,u),n.add(s,d,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.add(s,d,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.add(s,d,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,d,m),n.add(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,d,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,d,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,d,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),a.start=o,a.stop=u,a};var z=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,z);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||i(e)&&i(t)&&n.equals(e.center,t.center)&&f.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,o,c,f){var _,p,T,y;if(i(e)&&i(t)&&i(r)&&i(o)){var R=e.minimum,A=e.maximum,S=n.subtract(A,R,d),N=r-t,M=Math.max(n.maximumComponent(S),N);_=M<m-1?s.BITS12:s.NONE,p=e.center,T=u.inverseTransformation(o,new u);var I=n.negate(R,l);u.multiply(u.fromTranslation(I,h),T,T);var O=l;O.x=1/S.x,O.y=1/S.y,O.z=1/S.z,u.multiply(u.fromScale(O,h),T,T),y=u.clone(o),u.setTranslation(y,n.ZERO,y),o=u.clone(o,new u);var g=u.fromTranslation(R,h),v=u.fromScale(S,E),w=u.multiply(g,v,h);u.multiply(o,w,o),u.multiply(y,w,y)}this.quantization=_,this.minimumHeight=t,this.maximumHeight=r,this.center=p,this.toScaledENU=T,this.fromScaledENU=o,this.matrix=y,this.hasVertexNormals=c,this.hasWebMercatorT=a(f,!1)}var l=new n,d=new n,f=new t,h=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,i,c,d,h,E){var m=c.x,_=c.y;if(this.quantization===s.BITS12){i=u.multiplyByPoint(this.toScaledENU,i,l),i.x=o.clamp(i.x,0,1),i.y=o.clamp(i.y,0,1),i.z=o.clamp(i.z,0,1);var p=this.maximumHeight-this.minimumHeight,T=o.clamp((d-this.minimumHeight)/p,0,1);t.fromElements(i.x,i.y,f);var y=e.compressTextureCoordinates(f);t.fromElements(i.z,T,f);var R=e.compressTextureCoordinates(f);t.fromElements(m,_,f);var A=e.compressTextureCoordinates(f);if(r[a++]=y,r[a++]=R,r[a++]=A,this.hasWebMercatorT){t.fromElements(E,0,f);var S=e.compressTextureCoordinates(f);r[a++]=S}}else n.subtract(i,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=d,r[a++]=m,r[a++]=_,this.hasWebMercatorT&&(r[a++]=E);return this.hasVertexNormals&&(r[a++]=e.octPackFloat(h)),a},c.prototype.decodePosition=function(t,r,a){if(i(a)||(a=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],f);a.x=o.x,a.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],f);return a.z=c.x,u.multiplyByPoint(this.fromScaledENU,a,a)}return a.x=t[r],a.y=t[r+1],a.z=t[r+2],n.add(a,this.center,a)},c.prototype.decodeTextureCoordinates=function(n,r,a){return i(a)||(a=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],a):t.fromElements(n[r+4],n[r+5],a)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){var r=e.decompressTextureCoordinates(t[n+1],f);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var a=this.getStride();n=(n+1)*a-1;var i=e[n]/256,o=Math.floor(i),u=256*(i-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},p={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,n=r.FLOAT,a=r.getSizeInBytes(n);if(this.quantization===s.NONE){var i=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(i+o)*a,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:i*a,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*a,[{index:p.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:p.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*a,strideInBytes:t}]):[{index:p.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?_:p},c.clone=function(e,t){return i(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU), -t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},s.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},s}),define("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,n,r,a,i,o,u,s,c,l,d,f,h,E,m,_){"use strict";var p={};p.DEFAULT_STRUCTURE=c({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var T=new r,y=new d,R=new r,A=new r;return p.computeVertices=function(o){var c,S,N,M,I=Math.cos,O=Math.sin,g=Math.sqrt,v=Math.atan,w=Math.exp,x=l.PI_OVER_TWO,C=l.toRadians,P=o.heightmap,U=o.width,D=o.height,F=o.skirtHeight,L=a(o.isGeographic,!0),B=a(o.ellipsoid,u.WGS84),z=1/B.maximumRadius,b=o.nativeRectangle,q=o.rectangle;i(q)?(c=q.west,S=q.south,N=q.east,M=q.north):L?(c=C(b.west),S=C(b.south),N=C(b.east),M=C(b.north)):(c=b.west*z,S=x-2*v(w(-b.south*z)),N=b.east*z,M=x-2*v(w(-b.north*z)));var G=o.relativeToCenter,W=i(G);G=W?G:r.ZERO;var X,V,H=a(o.exaggeration,1),Y=a(o.includeWebMercatorT,!1),k=a(o.structure,p.DEFAULT_STRUCTURE),j=a(k.heightScale,p.DEFAULT_STRUCTURE.heightScale),Z=a(k.heightOffset,p.DEFAULT_STRUCTURE.heightOffset),K=a(k.elementsPerHeight,p.DEFAULT_STRUCTURE.elementsPerHeight),Q=a(k.stride,p.DEFAULT_STRUCTURE.stride),J=a(k.elementMultiplier,p.DEFAULT_STRUCTURE.elementMultiplier),$=a(k.isBigEndian,p.DEFAULT_STRUCTURE.isBigEndian),ee=h.computeWidth(b)/(U-1),te=h.computeHeight(b)/(D-1),ne=B.radiiSquared,re=ne.x,ae=ne.y,ie=ne.z,oe=65536,ue=-65536,se=m.eastNorthUpToFixedFrame(G,B),ce=d.inverseTransformation(se,y);Y&&(X=_.geodeticLatitudeToMercatorAngle(S),V=1/(_.geodeticLatitudeToMercatorAngle(M)-X));var le=R;le.x=Number.POSITIVE_INFINITY,le.y=Number.POSITIVE_INFINITY,le.z=Number.POSITIVE_INFINITY;var de=A;de.x=Number.NEGATIVE_INFINITY,de.y=Number.NEGATIVE_INFINITY,de.z=Number.NEGATIVE_INFINITY;var fe=Number.POSITIVE_INFINITY,he=U+(F>0?2:0),Ee=D+(F>0?2:0),me=he*Ee,_e=new Array(me),pe=new Array(me),Te=new Array(me),ye=Y?new Array(me):[],Re=0,Ae=D,Se=0,Ne=U;F>0&&(--Re,++Ae,--Se,++Ne);for(var Me=0,Ie=Re;Ie<Ae;++Ie){var Oe=Ie;Oe<0&&(Oe=0),Oe>=D&&(Oe=D-1);var ge=b.north-te*Oe;ge=L?C(ge):x-2*v(w(-ge*z));var ve=I(ge),we=O(ge),xe=ie*we,Ce=(ge-S)/(M-S);Ce=l.clamp(Ce,0,1);var Pe;Y&&(Pe=(_.geodeticLatitudeToMercatorAngle(ge)-X)*V);for(var Ue=Se;Ue<Ne;++Ue){var De=Ue;De<0&&(De=0),De>=U&&(De=U-1);var Fe=b.west+ee*De;L?Fe=C(Fe):Fe*=z;var Le,Be=Oe*(U*Q)+De*Q;if(1===K)Le=P[Be];else{Le=0;var ze;if($)for(ze=0;ze<K;++ze)Le=Le*J+P[Be+ze];else for(ze=K-1;ze>=0;--ze)Le=Le*J+P[Be+ze]}Le=(Le*j+Z)*H,ue=Math.max(ue,Le),oe=Math.min(oe,Le),Ue===De&&Ie===Oe||(Le-=F);var be=ve*I(Fe),qe=ve*O(Fe),Ge=re*be,We=ae*qe,Xe=g(Ge*be+We*qe+xe*we),Ve=1/Xe,He=Ge*Ve,Ye=We*Ve,ke=xe*Ve,je=new r;je.x=He+be*Le,je.y=Ye+qe*Le,je.z=ke+we*Le,_e[Me]=je,pe[Me]=Le;var Ze=(Fe-c)/(N-c);Ze=l.clamp(Ze,0,1),Te[Me]=new n(Ze,Ce),Y&&(ye[Me]=Pe),Me++,d.multiplyByPoint(ce,je,T),r.minimumByComponent(T,le,le),r.maximumByComponent(T,de,de),fe=Math.min(fe,Le)}}var Ke,Qe=t.fromPoints(_e);i(q)&&q.width<l.PI_OVER_TWO+l.EPSILON5&&(Ke=f.fromRectangle(q,oe,ue,B));var Je;if(W){var $e=new s(B);Je=$e.computeHorizonCullingPoint(G,_e)}for(var et=new e(le,de,G),tt=new E(et,fe,ue,se,!1,Y),nt=new Float32Array(me*tt.getStride()),rt=0,at=0;at<me;++at)rt=tt.encode(nt,rt,_e[at],Te[at],pe[at],void 0,ye[at]);return{vertices:nt,maximumHeight:ue,minimumHeight:oe,encoding:tt,boundingSphere3D:Qe,orientedBoundingBox:Ke,occludeePointInScaledSpace:Je}},p}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,a=t.message;n=e(r)&&e(a)?r+": "+a:t.toString();var i=t.stack;return e(i)&&(n+="\n"+i),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){"use strict";function r(r){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return r}),define("Workers/createVerticesFromHeightmap",["../Core/Ellipsoid","../Core/HeightmapTessellator","../Core/Rectangle","./createTaskProcessorWorker"],function(e,t,n,r){"use strict";function a(r,a){var i=r.width,o=r.height;r.skirtHeight>0&&(i+=2,o+=2),r.ellipsoid=e.clone(r.ellipsoid),r.rectangle=n.clone(r.rectangle);var u=t.computeVertices(r),s=u.vertices;return a.push(s.buffer),{vertices:s.buffer,numberOfAttributes:u.encoding.getStride(),minimumHeight:u.minimumHeight,maximumHeight:u.maximumHeight,gridWidth:i,gridHeight:o,boundingSphere3D:u.boundingSphere3D,orientedBoundingBox:u.orientedBoundingBox,occludeePointInScaledSpace:u.occludeePointInScaledSpace,encoding:u.encoding}}return r(a)})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(r),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),n(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,d=n.z,h=a.x,E=a.y,m=a.z,_=l*l*h*h,p=f*f*E*E,T=d*d*m*m,y=_+p+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(n,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,N=u.y,M=u.z,I=o;I.x=A.x*S*2,I.y=A.y*N*2,I.z=A.z*M*2;var O,g,v,w,x,C,P,U,D,F,L,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(I)),z=0;do{B-=z,v=1/(1+B*S),w=1/(1+B*N),x=1/(1+B*M),C=v*v,P=w*w,U=x*x,D=C*v,F=P*w,L=U*x,O=_*C+p*P+T*U-1,g=_*D*S+p*F*N+T*L*M;var b=-2*g;z=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*v,c.y=f*w,c.z=d*x,c):new e(l*v,f*w,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,a,i){return a=n(a,0),r(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,m=r(n)?n.oneOverRadiiSquared:d,_=r(n)?n._centerToleranceSquared:h,p=o(t,E,m,_,c);if(r(p)){var T=e.multiplyComponents(p,m,s);T=e.normalize(T,T);var y=e.subtract(t,p,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),S=i.sign(e.dot(y,t))*e.magnitude(y);return r(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,n,r,a){"use strict";function i(t,a,i){this.minimum=e.clone(n(t,e.ZERO)),this.maximum=e.clone(n(a,e.ZERO)),r(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,n){if(r(n)||(n=new i),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,d=1;d<f;d++){var h=t[d],E=h.x,m=h.y,_=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var p=n.minimum;p.x=a,p.y=o,p.z=u;var T=n.maximum;T.x=s,T.y=c,T.z=l;var y=e.add(p,T,n.center);return e.multiplyByScalar(y,.5,y),n},i.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new i(t.minimum,t.maximum)},i.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],d=m[a];if(Math.abs(e[s.getElementIndex(d,f)])>n){var h,_=e[s.getElementIndex(d,d)],p=e[s.getElementIndex(f,f)],T=e[s.getElementIndex(d,f)],y=(_-p)/2/T;h=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=n-u-f+h,m=2*(a-d),_=2*(i+l),p=2*(a+d),T=-n+u-f+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+h;return r(t)?(t[0]=E,t[1]=p,t[2]=R,t[3]=m,t[4]=T,t[5]=A,t[6]=_,t[7]=y,t[8]=S,t):new s(E,m,_,p,T,y,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=n*u,E=i*a+c*o*u,m=-c*a+i*o*u,_=-o,p=c*n,T=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=_,t[3]=f,t[4]=E,t[5]=p,t[6]=d,t[7]=m,t[8]=T,t):new s(l,f,d,h,E,m,_,p,T)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var d=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],_=new s,p=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=n*c(h);o<a&&l(h)>E;)f(h,_),s.transpose(_,p),s.multiply(h,_,h),s.multiply(p,h,h),s.multiply(d,_,d),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/d;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o; +return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,d,h,E,m,_){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(d,0),this[15]=r(_,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,_=t.z*t.z,p=t.z*t.w,T=t.w*t.w,y=s-h-_+T,R=2*(c-p),A=2*(f+m),S=2*(c+p),N=-s+h-_+T,M=2*(E-d),I=2*(f-m),O=2*(E+d),g=-s-h+_+T;return r[0]=y*i,r[1]=S*i,r[2]=I*i,r[3]=0,r[4]=R*o,r[5]=N*o,r[6]=O*o,r[7]=0,r[8]=A*u,r[9]=M*u,r[10]=g*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,m=f.y,_=f.z,p=h.x,T=h.y,y=h.z,R=r.x,A=r.y,S=r.z,N=u*-R+s*-A+c*-S,M=p*-R+T*-A+y*-S,I=E*R+m*A+_*S;return a(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=T,n[6]=-m,n[7]=0,n[8]=c,n[9]=y,n[10]=-_,n[11]=0,n[12]=N,n[13]=M,n[14]=I,n[15]=1,n):new l(u,s,c,N,p,T,y,M,-E,-m,-_,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),d=c,h=l,E=f,m=i+c,_=o+l,p=t+f,T=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=p,a[15]=T,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],_=e[13],p=e[14],T=e[15],y=t[0],R=t[1],A=t[2],S=t[3],N=t[4],M=t[5],I=t[6],O=t[7],g=t[8],v=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],F=r*y+u*R+f*A+m*S,L=a*y+s*R+d*A+_*S,B=i*y+c*R+h*A+p*S,z=o*y+l*R+E*A+T*S,b=r*N+u*M+f*I+m*O,q=a*N+s*M+d*I+_*O,G=i*N+c*M+h*I+p*O,W=o*N+l*M+E*I+T*O,X=r*g+u*v+f*w+m*x,V=a*g+s*v+d*w+_*x,H=i*g+c*v+h*w+p*x,Y=o*g+l*v+E*w+T*x,k=r*C+u*P+f*U+m*D,j=a*C+s*P+d*U+_*D,Z=i*C+c*P+h*U+p*D,K=o*C+l*P+E*U+T*D;return n[0]=F,n[1]=L,n[2]=B,n[3]=z,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],_=t[1],p=t[2],T=t[4],y=t[5],R=t[6],A=t[8],S=t[9],N=t[10],M=t[12],I=t[13],O=t[14],g=r*m+o*_+c*p,v=a*m+u*_+l*p,w=i*m+s*_+f*p,x=r*T+o*y+c*R,C=a*T+u*y+l*R,P=i*T+s*y+f*R,U=r*A+o*S+c*N,D=a*A+u*S+l*N,F=i*A+s*S+f*N,L=r*M+o*I+c*O+d,B=a*M+u*I+l*O+h,z=i*M+s*I+f*O+E;return n[0]=g,n[1]=v,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=F,n[11]=0,n[12]=L,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],_=t[4],p=t[5],T=t[6],y=t[7],R=t[8],A=r*d+o*h+c*E,S=a*d+u*h+l*E,N=i*d+s*h+f*E,M=r*m+o*_+c*p,I=a*m+u*_+l*p,O=i*m+s*_+f*p,g=r*T+o*y+c*R,v=a*T+u*y+l*R,w=i*T+s*y+f*R;return n[0]=A,n[1]=S,n[2]=N,n[3]=0,n[4]=M,n[5]=I,n[6]=O,n[7]=0,n[8]=g,n[9]=v,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var p=new s,T=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,p),T,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],_=e[6],A=e[10],S=e[14],N=e[3],M=e[7],I=e[11],O=e[15],g=A*O,v=S*I,w=_*O,x=S*M,C=_*I,P=A*M,U=m*O,D=S*N,F=m*I,L=A*N,B=m*M,z=_*N,b=g*d+x*h+C*E-(v*d+w*h+P*E),q=v*f+U*h+L*E-(g*f+D*h+F*E),G=w*f+D*d+B*E-(x*f+U*d+z*E),W=P*f+F*d+z*h-(C*f+L*d+B*h),X=v*a+w*i+P*o-(g*a+x*i+C*o),V=g*r+D*i+F*o-(v*r+U*i+L*o),H=x*r+U*a+z*o-(w*r+D*a+B*o),Y=C*r+L*a+B*i-(P*r+F*a+z*i);g=i*E,v=o*h,w=a*E,x=o*d,C=a*h,P=i*d,U=r*E,D=o*f,F=r*h,L=i*f,B=r*d,z=a*f;var k=g*M+x*I+C*O-(v*M+w*I+P*O),j=v*N+U*I+L*O-(g*N+D*I+F*O),Z=w*N+D*M+B*O-(x*N+U*M+z*O),K=P*N+F*M+z*I-(C*N+L*M+B*I),Q=w*A+P*S+v*_-(C*S+g*_+x*A),J=F*S+g*m+D*A-(U*A+L*S+v*m),$=U*_+z*S+x*m-(B*S+w*m+D*_),ee=B*A+C*m+L*_-(F*_+z*A+P*m),te=r*b+a*q+i*G+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=j*te,n[10]=Z*te,n[11]=K*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-n*f-r*d-a*h,m=-i*f-o*d-u*h,_=-s*f-c*d-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return r(n)?(n.west=l,n.south=d,n.east=f,n.north=h,n):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,E=new e,m=new e,_=new e,p=new e,T=new e,y=new e,R=new e,A=new e,S=new e,N=new e,M=new e;d.fromPoints=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],y),i=e.clone(r,h),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,_),c=e.clone(r,p),l=e.clone(r,T),f=t.length,I=1;I<f;I++){e.clone(t[I],r);var O=r.x,g=r.y,v=r.z;O<i.x&&e.clone(r,i),O>s.x&&e.clone(r,s),g<o.y&&e.clone(r,o),g>c.y&&e.clone(r,c),v<u.z&&e.clone(r,u),v>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var F=A;F.x=.5*(P.x+U.x),F.y=.5*(P.y+U.y),F.z=.5*(P.z+U.z);var L=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(L),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(z,b,R),.5,M),G=0;for(I=0;I<f;I++){e.clone(t[I],r);var W=e.magnitude(e.subtract(r,q,R));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(r,F,R));if(X>L){var V=Math.sqrt(X);B=.5*(B+V),L=B*B;var H=V-B;F.x=(B*F.x+H*r.x)/V,F.y=(B*F.y+H*r.y)/V,F.z=(B*F.z+H*r.z)/V}}return B<G?(e.clone(F,n.center),n.radius=B):(e.clone(q,n.center),n.radius=G),n};var I=new o,O=new e,g=new e,v=new t,w=new t;d.fromRectangle2D=function(e,t,n){return d.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,I),f.southwest(t,v),v.height=i,f.northeast(t,w),w.height=o;var s=n.project(v,O),c=n.project(w,g),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),d.fromPoints(u,o)},d.fromVertices=function(t,n,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=y;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,_),I=e.clone(u,p),O=e.clone(u,T),g=t.length,v=0;v<g;v+=i){var w=t[v]+n.x,x=t[v+1]+n.y,C=t[v+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(I,c,R)),D=e.magnitudeSquared(e.subtract(O,l,R)),F=s,L=f,B=P;U>B&&(B=U,F=c,L=I),D>B&&(B=D,F=l,L=O);var z=A;z.x=.5*(F.x+L.x),z.y=.5*(F.y+L.y),z.z=.5*(F.z+L.z);var b=e.magnitudeSquared(e.subtract(L,z,R)),q=Math.sqrt(b),G=S;G.x=s.x,G.y=c.y,G.z=l.z;var W=N;W.x=f.x,W.y=I.y,W.z=O.z;var X=e.multiplyByScalar(e.add(G,W,R),.5,M),V=0;for(v=0;v<g;v+=i){u.x=t[v]+n.x,u.y=t[v+1]+n.y,u.z=t[v+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var j=k-q;z.x=(q*z.x+j*u.x)/k,z.y=(q*z.y+j*u.y)/k,z.z=(q*z.z+j*u.z)/k}}return q<V?(e.clone(z,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},d.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new d),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=y;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,p),f=e.clone(i,T),I=t.length,O=0;O<I;O+=3){var g=t[O]+n[O],v=t[O+1]+n[O+1],w=t[O+2]+n[O+2];i.x=g,i.y=v,i.z=w,g<o.x&&e.clone(i,o),g>c.x&&e.clone(i,c),v<u.y&&e.clone(i,u),v>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,F=x;C>F&&(F=C,U=u,D=l),P>F&&(F=P,U=s,D=f);var L=A;L.x=.5*(U.x+D.x),L.y=.5*(U.y+D.y),L.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,L,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var q=N;q.x=c.x,q.y=l.y,q.z=f.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,M),W=0;for(O=0;O<I;O+=3){i.x=t[O]+n[O],i.y=t[O+1]+n[O+1],i.z=t[O+2]+n[O+2];var X=e.magnitude(e.subtract(i,G,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,L,R));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;L.x=(z*L.x+Y*i.x)/H,L.y=(z*L.y+Y*i.y)/H,L.z=(z*L.z+Y*i.z)/H}}return z<W?(e.clone(L,r.center),r.radius=z):(e.clone(G,r.center),r.radius=W),r},d.fromCornerPoints=function(t,n,r){a(r)||(r=new d);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},d.fromEllipsoid=function(t,n){return a(n)||(n=new d),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;d.fromBoundingSpheres=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return d.clone(t[0],n);if(2===r)return d.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;d.fromOrientedBoundingBox=function(t,n){a(n)||(n=new d);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D);return e.add(i,o,i),e.add(i,u,i),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(i),n},d.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},d.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new d);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var F=new e,L=new e;d.union=function(t,n,r){a(r)||(r=new d);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,F),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,L);return e.add(h,i,h),e.clone(h,r.center),r.radius=f,r};var B=new e;d.expand=function(t,n,r){r=d.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},d.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;d.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;d.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,G=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,n,a){n=r(n,j);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),h=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var _=E.length,p=0;p<_;++p){var T=E[p];e.add(o,T,T);var y=i.cartesianToCartographic(T,H);n.project(y,T)}a=d.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){return d.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y, +n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,n,r,a,i,o){"use strict";function u(e,n){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(n)&&(this.cameraPosition=n)}function s(e,n,r){var a=e.transformPositionToScaledSpace(n,E),i=t.magnitudeSquared(a),o=Math.sqrt(i),u=t.divideByScalar(a,o,m);i=Math.max(1,i),o=Math.max(1,o);var s=t.dot(u,r),c=t.magnitude(t.cross(u,r,u)),l=1/o,f=Math.sqrt(i-1)*l;return 1/(s*l-c*f)}function c(e,n,r){if(!(n<=0||n===1/0||n!==n))return t.multiplyByScalar(e,n,r)}function l(e,n){return t.equals(n,t.ZERO)?n:(e.transformPositionToScaledSpace(n,_),t.normalize(_,_))}a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var n=this._ellipsoid,r=n.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),a=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=a}}});var f=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,n=t.transformPositionToScaledSpace(e,f);return this.isScaledSpacePointVisible(n)},u.prototype.isScaledSpacePointVisible=function(e){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,a=t.subtract(e,n,f),i=-t.dot(a,n),o=r<0?i>0:i>r&&i*i/t.magnitudeSquared(a)>r;return!o},u.prototype.computeHorizonCullingPoint=function(e,n,a){r(a)||(a=new t);for(var i=this._ellipsoid,o=l(i,e),u=0,f=0,d=n.length;f<d;++f){var h=n[f],E=s(i,h,o);u=Math.max(u,E)}return c(o,u,a)};var d=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,a,i,o,u){r(u)||(u=new t),o=n(o,t.ZERO);for(var f=this._ellipsoid,h=l(f,e),E=0,m=0,_=a.length;m<_;m+=i){d.x=a[m]+o.x,d.y=a[m+1]+o.y,d.z=a[m+2]+o.z;var p=s(f,d,h);E=Math.max(E,p)}return c(h,E,u)};var h=[];u.prototype.computeHorizonCullingPointFromRectangle=function(n,r,a){var i=o.subsample(n,r,0,h),u=e.fromPoints(i);if(!(t.magnitude(u.center)<.1*r.minimumRadius))return this.computeHorizonCullingPoint(u.center,i,a)};var E=new t,m=new t,_=new t;return u}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[d/e,a/d]:[a/d,d/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,_=u*c-h,p=4*E*_-m*m;if(p<0){var T,y,R;d*f>=l*h?(T=o,y=E,R=-2*u*E+o*m):(T=c,y=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(T)*Math.sqrt(-p);i=-R+S;var N=i/2,M=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===S?-M:-y/M;return a=y<=0?M+I:-R/(M*M+I*I+y),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var O=E,g=-2*u*E+o*m,v=_,w=-c*m+2*s*_,x=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-g)/3);a=2*Math.sqrt(-O);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),F=i+D>2*u?i-u:D-u,L=o,B=F/L;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-v),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=i+D<2*s?i+s:D+s,q=z/b,G=L*b,W=-F*b-L*z,X=F*z,V=(s*W-u*X)/(-u*W+s*G);return B<=V?B<=q?V<=q?[B,V,q]:[B,q,V]:[q,B,V]:B<=q?[V,B,q]:V<=q?[V,q,B]:[q,V,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,_=E[0],p=E[1];if(_>=0&&p>=0){var T=Math.sqrt(_),y=Math.sqrt(p);return[d-y,d-T,d+T,d+y]}if(_>=0&&p<0)return m=Math.sqrt(_),[d-m,d+m];if(_<0&&p>=0)return m=Math.sqrt(p),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,S=(s+h+c/R)/2,N=r.computeRealRoots(1,R,A),M=r.computeRealRoots(1,-R,S);return 0!==N.length?(N[0]+=d,N[1]+=d,0!==M.length?(M[0]+=d,M[1]+=d,N[1]<=M[0]?[N[0],N[1],M[0],M[1]]:M[1]<=N[0]?[M[0],M[1],N[0],N[1]]:N[0]>=M[0]&&N[1]<=M[1]?[M[0],N[0],N[1],M[1]]:M[0]>=N[0]&&M[1]<=N[1]?[N[0],M[0],M[1],N[1]]:N[0]>M[0]&&N[0]<M[1]?[M[0],N[0],M[1],N[1]]:[N[0],M[0],N[1],M[1]]):N):0!==M.length?(M[0]+=d,M[1]+=d,M):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,_=h[0],p=a-_,T=p*p,y=t/2,R=p/2,A=T-4*o,S=T+4*Math.abs(o),N=c-4*_,M=c+4*Math.abs(_);if(_<0||A*M<N*S){var I=Math.sqrt(N);E=I/2,m=0===I?0:(t*R-i)/I}else{var O=Math.sqrt(A);E=0===O?0:(t*R-i)/O,m=O/2}var g,v;0===y&&0===E?(g=0,v=0):n.sign(y)===n.sign(E)?(g=y+E,v=_/g):(v=y-E,g=_/v);var w,x;0===R&&0===m?(w=0,x=0):n.sign(R)===n.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var C=r.computeRealRoots(1,g,w),P=r.computeRealRoots(1,v,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,d=f*r,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*n*d-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function d(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,T),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(d,h,E,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),_=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*n.x+r,p=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),T=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),y=[];if(0===T&&0===p){if(l=s.computeRealRoots(E,m,_),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],N=Math.sqrt(Math.max(1-S*S,0));y.push(new e(a,i*S,i*-N)),y.push(new e(a,i*S,i*N))}return y}var M=T*T,I=p*p,O=E*E,g=T*p,v=O+I,w=2*(m*E+g),x=2*_*E+m*m-I+M,C=2*(_*m-g),P=_*_-M;if(0===v&&0===w&&0===x&&0===C)return y;l=c.computeRealRoots(v,w,x,C,P);var U=l.length;if(0===U)return y;for(var D=0;D<U;++D){var F,L=l[D],B=L*L,z=Math.max(1-B,0),b=Math.sqrt(z);F=o.sign(E)===o.sign(_)?h(E*B+_,m*L,o.EPSILON12):o.sign(_)===o.sign(m*L)?h(E*B,m*L+_,o.EPSILON12):h(E*B+m*L,_,o.EPSILON12);var q=h(p*L,T,o.EPSILON15),G=F*q;G<0?y.push(new e(a,i*L,i*b)):G>0?y.push(new e(a,i*L,i*-b)):0!==b?(y.push(new e(a,i*L,i*-b)),y.push(new e(a,i*L,i*b)),++D):y.push(new e(a,i*L,i*b))}return y}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var _=new e,p=new e,T=new e,y=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,m=e.subtract(a,r,_),A=e.subtract(i,r,p),S=e.cross(E,A,T),N=e.dot(m,S);if(u){if(N<o.EPSILON6)return;if(s=e.subtract(h,r,y),l=e.dot(s,S),l<0||l>N)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>N)return;d=e.dot(A,c)/N}else{if(Math.abs(N)<o.EPSILON6)return;var M=1/N;if(s=e.subtract(h,r,y),l=e.dot(s,S)*M,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*M,f<0||l+f>1)return;d=e.dot(A,c)*M}return d},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=d(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var N=new l;m.lineSegmentSphere=function(t,n,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var M=new e,I=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,M),f=e.multiplyComponents(c,t.direction,I),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(r=d-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,_=r/s;return m<_?new i(m,_):{start:_,stop:m}}var p=Math.sqrt(r/a);return new i(p,p)}return d<1?(r=d-1,a=e.magnitudeSquared(f),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var O=new e,g=new e,v=new e,w=new e,x=new e,C=new u,P=new u,U=new u,D=new u,F=new u,L=new u,B=new u,z=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,O);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,O),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,w),h=e.normalize(e.cross(d,f,g),g),m=e.normalize(e.cross(f,h,v),v),_=C;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=h.x,_[4]=h.y,_[5]=h.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=u.transpose(_,P),T=u.fromScale(n.radii,U),y=u.fromScale(n.oneOverRadii,D),R=F;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,N=u.multiply(u.multiply(p,y,L),R,L),M=u.multiply(u.multiply(N,T,B),_,B),I=u.multiplyByVector(N,a,x),G=E(M,e.negate(I,O),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(T,u.multiplyByVector(_,G[H],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var j=n.cartesianToCartographic(X,q);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-V*V),S=c?-S:S,j.height=S,n.cartographicToCartesian(j,new e)}};var G=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,d),{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,d),{positions:[t,n,r,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,n,r,a){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var o=new e;return i.fromCartesian4=function(n,r){var a=e.fromCartesian4(n,o),u=n.w;return t(r)?(e.clone(a,r.normal),r.distance=u,r):new i(a,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],d=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=p,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,_,T,y;if(T=t.length>>>0,c=Math.max(0,Math.min(n,T)),f=[],l=T-c+1,d=[],h=o(),c)for(_=h.progress,m=function(e){d.push(e),--l||(E=m=p,h.reject(d))},E=function(e){f.push(e),--c||(E=m=p,h.resolve(f))},y=0;y<T;++y)y in t&&e(t[y],s,u,_);else h.resolve(f);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),d(e,T).then(t,n,r)}function f(){return d(arguments,T)}function d(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},y.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function T(e){return e}var y,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,y=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,d){var h,E,m,_,p;if("%%"==e)return"%";for(var T=!1,y="",R=!1,A=!1,S=" ",N=s.length,M=0;s&&M<N;M++)switch(s.charAt(M)){case" ":y=" ";break;case"+":y="+";break;case"-":T=!0;break;case"'":S=s.charAt(M+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,T=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],d){case"s":return u(String(p),T,c,f,R,S);case"c":return u(String.fromCharCode(+p),T,c,f,R);case"b":return o(p,2,A,T,c,f,R);case"o":return o(p,8,A,T,c,f,R);case"x":return o(p,16,A,T,c,f,R);case"X":return o(p,16,A,T,c,f,R).toUpperCase();case"u":return o(p,10,A,T,c,f,R);case"i":case"d":return h=+p||0,h=Math.round(h-h%1),E=h<0?"-":y,p=E+a(String(Math.abs(h)),f,"0",!1),i(p,E,T,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+p,E=h<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],p=E+Math.abs(h)[m](f),i(p,E,T,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function d(e,n){y.julianDate=e;var r=m.leapSeconds,a=t(r,y,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&f(this)}var _=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],T=29,y=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,N=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+I.source,g=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,v=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,d=0,_=0,y=0,I=0,w=u[0],x=u[1];if(u=w.match(M),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(N),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var F;if(r(x)){u=x.match(v),null!==u?(d=+u[1],_=+u[2],y=+u[3],I=1e3*+(u[4]||0),F=5):(u=x.match(g),null!==u?(d=+u[1],_=+u[2],y=60*+(u[3]||0),F=4):(u=x.match(O),null!==u&&(d=+u[1],_=60*+(u[2]||0),F=3)));var L=u[F],B=+u[F+1],z=+(u[F+2]||0);switch(L){case"+":d-=B,_-=z;break;case"-":d+=B,_+=z;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,d,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===y;for(b&&y--;_>=60;)_-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?T:p[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?T:p[s-1];for(;_<0;)_+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?T:p[s-1],l+=a;var q=E(n,s,l,d,_,y,I);return r(t)?(h(q[0],q[1],t),f(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=d(e,w);r(a)||(m.addSeconds(e,-1,w),a=d(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var _=h+2-12*c|0,p=100*(l-49)+f+c|0,T=u/s.SECONDS_PER_HOUR|0,y=u-T*s.SECONDS_PER_HOUR,R=y/s.SECONDS_PER_MINUTE|0;y-=R*s.SECONDS_PER_MINUTE;var A=0|y,S=(y-A)/s.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(A+=1),r(t)?(t.year=p,t.month=_,t.day=E,t.hour=T,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,_,E,T,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme; +},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(d)&&n(E.overrideMimeType)&&E.overrideMimeType(d),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,p=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var T,y=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],N=_[R+m],M=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(M,N,f.TAI);if(p.push(I),y){if(N!==T&&r(T)){var O=o.leapSeconds,g=t(O,I,h);if(g<0){var v=new u(I,N);O.splice(~g,0,v)}}T=N}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function p(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=n[d+e._ut1MinusUtcSecondsColumn],p=n[h+e._ut1MinusUtcSecondsColumn],T=p-E;if(T>.5||T<-.5){var y=n[d+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];y!==R&&(l.equals(r)?E=p:p-=R-y)}return u.xPoleWander=_(f,n[d+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[d+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,E,p),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!r(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},d}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){if(i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),"data"===r.scheme)return r.toString();if("data"===a.scheme)return a.toString();n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=d(e);return h.href=n,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),r(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,_=i-s*this._stepSizeDays,p=this._work,T=this._denominators,y=this._coef,R=this._xTable;for(E=0;E<=u;++E)p[E]=_-R[E];for(E=0;E<=u;++E){for(y[E]=1,m=0;m<=u;++m)m!==E&&(y[E]*=p[m]);y[E]*=T[E];var A=3*(s+E);n.x+=y[E]*h[A++],n.y+=y[E]*h[A++],n.s+=y[E]*h[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(N)&&(N=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,M=r(e[1]))}return N}function u(){return o()&&M}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,O=r(e[1]),O.isNightly=!!e[2])}return I}function c(){return s()&&O}function l(){if(!t(g)){g=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,v=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,v=r(e[1])))}return g}function f(){return l()&&v}function d(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function h(){return d()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return E()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function T(){if(!t(L)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;L=t(n)&&""!==n,L&&(F=n)}return L}function y(){return T()?F:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,N,M,I,O,g,v,w,x,C,P,U,D,F,L,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:T,imageRenderingValue:y};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,d=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=d,a):new l(u,s,c,d)};var d=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+f+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var _=d,p=0;f>s&&(p=1),E>s&&E>f&&(p=2);var T=_[p],y=_[T];n=Math.sqrt(e[c.getElementIndex(p,p)]-e[c.getElementIndex(T,T)]-e[c.getElementIndex(y,y)]+1);var R=h;R[p]=.5*n,n=.5/n,u=(e[c.getElementIndex(y,T)]-e[c.getElementIndex(T,y)])*n,R[T]=(e[c.getElementIndex(T,p)]+e[c.getElementIndex(p,T)])*n,R[y]=(e[c.getElementIndex(y,p)]+e[c.getElementIndex(p,y)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,_=new l,p=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),p=l.fromAxisAngle(e.UNIT_X,o.roll,E),_=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(_,p,_),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var T=new e,y=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,T);var u=l.computeAngle(R);r[o]=T.x*u,r[o+1]=T.y*u,r[o+2]=T.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,y);var u=e.magnitude(y);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(y,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,d=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=d,n.z=h,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var N=new l;l.lerp=function(e,t,n,r){return N=l.multiplyByScalar(t,n,N),r=l.multiplyByScalar(e,1-n,r),l.add(N,r,r)};var M=new l,I=new l,O=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=M=l.negate(t,M)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return I=l.multiplyByScalar(e,Math.sin((1-n)*o),I),O=l.multiplyByScalar(i,Math.sin(n*o),O),r=l.add(I,O,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var g=new e,v=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,g);l.multiply(i,t,x);var u=l.log(x,v);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],D=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;U[B]=1/(z*b),D[B]=z/b}return U[7]=P/136,D[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)F[f]=(U[f]*s-D[f])*o,L[f]=(U[f]*c-D[f])*o;var d=a*n*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),h=u*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),E=l.multiplyByScalar(e,h,C);return l.multiplyByScalar(t,d,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,_,p,T,y,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},N={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},M={},I={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},O=new n,g=new n,v=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(M[i])?r=M[i]:(r=function(r,i,s){if(u(s)||(s=new T),_.equalsEpsilon(r.x,0,_.EPSILON14)&&_.equalsEpsilon(r.y,0,_.EPSILON14)){var c=_.sign(r.z);n.unpack(N[e],0,O),"east"!==e&&"west"!==e&&n.multiplyByScalar(O,c,O),n.unpack(N[t],0,g),"east"!==t&&"west"!==t&&n.multiplyByScalar(g,c,g),n.unpack(N[a],0,v),"east"!==a&&"west"!==a&&n.multiplyByScalar(v,c,v)}else{i=o(i,d.WGS84),i.geodeticSurfaceNormal(r,I.up);var l=I.up,f=I.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,I.east),n.cross(l,f,I.north),n.multiplyByScalar(I.up,-1,I.down),n.multiplyByScalar(I.east,-1,I.west),n.multiplyByScalar(I.north,-1,I.south),O=I[e],g=I[t],v=I[a]}return s[0]=O.x,s[1]=O.y,s[2]=O.z,s[3]=0,s[4]=g.x,s[5]=g.y,s[6]=g.z,s[7]=0,s[8]=v.x,s[9]=v.y,s[10]=v.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},M[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new y,x=new n(1,1,1),C=new T;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof T&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=y.fromHeadingPitchRoll(t,w),c=T.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),T.multiply(i,c,i)};var P=new T,U=new p;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof y&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=T.getRotation(i,U);return y.fromRotationMatrix(o,a)};var D=24110.54841,F=8640184.812866,L=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,q=_.TWO_PI/86400,G=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(F+n*(L+n*B)),s=o*q%_.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(d,h,0,-h,d,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return p.transpose(n,t)};var V=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new p,k=new p;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=p.fromRotationZ(-i.s,k),d=p.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=h-2451545,y=E/R.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(T+y);S=S%1*_.TWO_PI;var N=p.fromRotationZ(S,k),M=p.multiply(d,N,Y),I=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),v=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*_.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=k; +return U[0]=I*C,U[1]=I*P,U[2]=g,U[3]=-O*P+v*g*C,U[4]=O*C+v*g*P,U[5]=-v*I,U[6]=-v*P-O*g*C,U[7]=v*C-O*g*P,U[8]=O*I,p.multiply(M,U,t)}}};var j=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=j;return T.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),T.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var Z=new n,K=new n,Q=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,d.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,Q);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new n,te=new n,ne=new p,re=new T,ae=new T;return A.basisTo2D=function(e,t,r){var a=T.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);n.fromElements(u.z,u.x,u.y,u);var s=A.eastNorthUpToFixedFrame(a,i,re),c=T.inverseTransformation(s,ae),l=T.getRotation(t,ne),f=T.multiplyByMatrix3(c,l,r);return T.multiply(J,f,r),T.setTranslation(r,u,r),r},A.wgs84To2DModelMatrix=function(e,t,r){var a=e.ellipsoid,i=A.eastNorthUpToFixedFrame(t,a,re),o=T.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);n.fromElements(s.z,s.x,s.y,s);var c=T.fromTranslation(s,re);return T.multiply(J,o,r),T.multiply(c,r,r),r},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var p=new d,T=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,T);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=p;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,T);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var y=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=y,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var d=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=d.clone(a(t,d.ZERO))}function _(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;d.setColumn(l,0,e.xAxis,l),d.setColumn(l,1,e.yAxis,l),d.setColumn(l,2,e.zAxis,l);var f=I;f.x=(t+r)/2,f.y=(a+o)/2,f.z=(u+s)/2;var h=O;h.x=(r-t)/2,h.y=(o-a)/2,h.z=(s-u)/2;var E=c.center;return f=d.multiplyByVector(l,f,f),n.add(e.origin,f,E),d.multiplyByScale(l,h,l),c}var p=new n,T=new n,y=new n,R=new n,A=new n,S=new n,N=new d,M={unitary:new d,diagonal:new d};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],p);for(r=1;r<a;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,f=0,h=0,E=0,_=0;for(r=0;r<a;r++)s=n.subtract(e[r],o,T),c+=s.x*s.x,l+=s.x*s.y,f+=s.x*s.z,h+=s.y*s.y,E+=s.y*s.z,_+=s.z*s.z;c*=u,l*=u,f*=u,h*=u,E*=u,_*=u;var I=N;I[0]=c,I[1]=l,I[2]=f,I[3]=l,I[4]=h,I[5]=E,I[6]=f,I[7]=E,I[8]=_;var O=d.computeEigenDecomposition(I,M),g=d.clone(O.unitary,t.halfAxes),v=d.getColumn(g,0,R),w=d.getColumn(g,1,A),x=d.getColumn(g,2,S),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,F=Number.MAX_VALUE,L=Number.MAX_VALUE;for(r=0;r<a;r++)s=e[r],C=Math.max(n.dot(v,s),C),P=Math.max(n.dot(w,s),P),U=Math.max(n.dot(x,s),U),D=Math.min(n.dot(v,s),D),F=Math.min(n.dot(w,s),F),L=Math.min(n.dot(x,s),L);v=n.multiplyByScalar(v,.5*(D+C),v),w=n.multiplyByScalar(w,.5*(F+P),w),x=n.multiplyByScalar(x,.5*(L+U),x);var B=n.add(v,w,t.center);n.add(B,x,B);var z=y;return z.x=C-D,z.y=P-F,z.z=U-L,n.multiplyByScalar(z,.5,z),d.multiplyByScale(t.halfAxes,z,t.halfAxes),t};var I=new n,O=new n,g=new r,v=new n,w=[new r,new r,new r,new r,new r,new r,new r,new r],x=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,i){t=a(t,0),n=a(n,0),r=a(r,u.WGS84);var o=E.center(e,g),c=r.cartographicToCartesian(o,v),l=new s(c,r),f=l.plane,d=w[0],m=w[1],p=w[2],T=w[3],y=w[4],R=w[5],A=w[6],S=w[7],N=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=y.latitude=e.south,S.latitude=T.latitude=M,d.latitude=m.latitude=p.latitude=e.north,A.longitude=S.longitude=d.longitude=e.west,R.longitude=m.longitude=N,y.longitude=T.longitude=p.longitude=e.east,p.height=m.height=d.height=S.height=A.height=R.height=y.height=T.height=n,r.cartographicArrayToCartesianArray(w,x),l.projectPointsToNearestOnPlane(x,C);var I=Math.min(C[6].x,C[7].x,C[0].x),O=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);p.height=d.height=y.height=A.height=t,r.cartographicArrayToCartesianArray(w,x);var D=Math.min(h.getPointDistance(f,x[0]),h.getPointDistance(f,x[2]),h.getPointDistance(f,x[4]),h.getPointDistance(f,x[6])),F=n;return _(l,I,O,P,U,D,F,i)},m.clone=function(e,t){if(i(e))return i(t)?(n.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,a=t.normal,i=e.halfAxes,o=a.x,u=a.y,s=a.z,l=Math.abs(o*i[d.COLUMN0ROW0]+u*i[d.COLUMN0ROW1]+s*i[d.COLUMN0ROW2])+Math.abs(o*i[d.COLUMN1ROW0]+u*i[d.COLUMN1ROW1]+s*i[d.COLUMN1ROW2])+Math.abs(o*i[d.COLUMN2ROW0]+u*i[d.COLUMN2ROW1]+s*i[d.COLUMN2ROW2]),f=n.dot(a,r)+t.distance;return f<=-l?c.OUTSIDE:f>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,F=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,I),a=e.halfAxes,i=d.getColumn(a,0,P),o=d.getColumn(a,1,U),u=d.getColumn(a,2,D),s=n.magnitude(i),c=n.magnitude(o),l=n.magnitude(u);n.normalize(i,i),n.normalize(o,o),n.normalize(u,u);var f=F;f.x=n.dot(r,i),f.y=n.dot(r,o),f.z=n.dot(r,u);var h,E=0;return f.x<-s?(h=f.x+s,E+=h*h):f.x>s&&(h=f.x-s,E+=h*h),f.y<-c?(h=f.y+c,E+=h*h):f.y>c&&(h=f.y-c,E+=h*h),f.z<-l?(h=f.z+l,E+=h*h):f.z>l&&(h=f.z-l,E+=h*h),E};var L=new n,B=new n;m.computePlaneDistances=function(e,t,r,a){i(a)||(a=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,f=d.getColumn(c,0,P),h=d.getColumn(c,1,U),E=d.getColumn(c,2,D),m=n.add(f,h,L);n.add(m,E,m),n.add(m,s,m);var _=n.subtract(m,t,B),p=n.dot(r,_);return o=Math.min(p,o),u=Math.max(p,u),n.add(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.add(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.add(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.add(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),a.start=o,a.stop=u,a};var z=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,z);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||i(e)&&i(t)&&n.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,n,r,a,i){"use strict";var o={};o.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,a=n.y;n.x=(1-Math.abs(a))*i.signNotZero(r),n.y=(1-Math.abs(r))*i.signNotZero(a)}return n.x=i.toSNorm(n.x,t),n.y=i.toSNorm(n.y,t),n},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,n,r,a){if(a.x=i.fromSNorm(e,r),a.y=i.fromSNorm(n,r),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},o.octDecode=function(e,t,n){return o.octDecodeInRange(e,t,255,n)},o.octPackFloat=function(e){return 256*e.x+e.y};var u=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,u),o.octPackFloat(u)},o.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return o.octDecode(r,a,t)},o.octPack=function(e,t,n,r){var a=o.octEncodeFloat(e),i=o.octEncodeFloat(t),s=o.octEncode(n,u);return r.x=65536*s.x+a,r.y=65536*s.y+i,r},o.octUnpack=function(e,t,n,r){var a=e.x/65536,i=Math.floor(a),u=65536*(a-i);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);o.octDecodeFloat(u,t),o.octDecodeFloat(c,n),o.octDecode(i,s,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},o.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,o,c,d){var _,p,T,y;if(i(e)&&i(t)&&i(r)&&i(o)){var R=e.minimum,A=e.maximum,S=n.subtract(A,R,f),N=r-t,M=Math.max(n.maximumComponent(S),N);_=M<m-1?s.BITS12:s.NONE,p=e.center,T=u.inverseTransformation(o,new u);var I=n.negate(R,l);u.multiply(u.fromTranslation(I,h),T,T);var O=l;O.x=1/S.x,O.y=1/S.y,O.z=1/S.z,u.multiply(u.fromScale(O,h),T,T),y=u.clone(o),u.setTranslation(y,n.ZERO,y),o=u.clone(o,new u);var g=u.fromTranslation(R,h),v=u.fromScale(S,E),w=u.multiply(g,v,h);u.multiply(o,w,o),u.multiply(y,w,y)}this.quantization=_,this.minimumHeight=t,this.maximumHeight=r,this.center=p,this.toScaledENU=T,this.fromScaledENU=o,this.matrix=y,this.hasVertexNormals=c,this.hasWebMercatorT=a(d,!1)}var l=new n,f=new n,d=new t,h=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,i,c,f,h,E){var m=c.x,_=c.y;if(this.quantization===s.BITS12){i=u.multiplyByPoint(this.toScaledENU,i,l),i.x=o.clamp(i.x,0,1),i.y=o.clamp(i.y,0,1),i.z=o.clamp(i.z,0,1);var p=this.maximumHeight-this.minimumHeight,T=o.clamp((f-this.minimumHeight)/p,0,1);t.fromElements(i.x,i.y,d);var y=e.compressTextureCoordinates(d);t.fromElements(i.z,T,d);var R=e.compressTextureCoordinates(d);t.fromElements(m,_,d);var A=e.compressTextureCoordinates(d);if(r[a++]=y,r[a++]=R,r[a++]=A,this.hasWebMercatorT){t.fromElements(E,0,d);var S=e.compressTextureCoordinates(d);r[a++]=S}}else n.subtract(i,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=f,r[a++]=m,r[a++]=_,this.hasWebMercatorT&&(r[a++]=E);return this.hasVertexNormals&&(r[a++]=e.octPackFloat(h)),a},c.prototype.decodePosition=function(t,r,a){if(i(a)||(a=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],d);a.x=o.x,a.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],d);return a.z=c.x,u.multiplyByPoint(this.fromScaledENU,a,a)}return a.x=t[r],a.y=t[r+1],a.z=t[r+2],n.add(a,this.center,a)},c.prototype.decodeTextureCoordinates=function(n,r,a){return i(a)||(a=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],a):t.fromElements(n[r+4],n[r+5],a)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){var r=e.decompressTextureCoordinates(t[n+1],d);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var a=this.getStride();n=(n+1)*a-1;var i=e[n]/256,o=Math.floor(i),u=256*(i-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},p={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,n=r.FLOAT,a=r.getSizeInBytes(n);if(this.quantization===s.NONE){var i=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(i+o)*a,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:i*a,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*a,[{index:p.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:p.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*a,strideInBytes:t}]):[{index:p.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?_:p},c.clone=function(e,t){return i(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius, +this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},s.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},s}),define("Core/HeightmapTessellator",["./AxisAlignedBoundingBox","./BoundingSphere","./Cartesian2","./Cartesian3","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidalOccluder","./freezeObject","./Math","./Matrix4","./OrientedBoundingBox","./Rectangle","./TerrainEncoding","./Transforms","./WebMercatorProjection"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,_){"use strict";var p={};p.DEFAULT_STRUCTURE=c({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var T=new r,y=new f,R=new r,A=new r;return p.computeVertices=function(o){var c,S,N,M,I=Math.cos,O=Math.sin,g=Math.sqrt,v=Math.atan,w=Math.exp,x=l.PI_OVER_TWO,C=l.toRadians,P=o.heightmap,U=o.width,D=o.height,F=o.skirtHeight,L=a(o.isGeographic,!0),B=a(o.ellipsoid,u.WGS84),z=1/B.maximumRadius,b=o.nativeRectangle,q=o.rectangle;i(q)?(c=q.west,S=q.south,N=q.east,M=q.north):L?(c=C(b.west),S=C(b.south),N=C(b.east),M=C(b.north)):(c=b.west*z,S=x-2*v(w(-b.south*z)),N=b.east*z,M=x-2*v(w(-b.north*z)));var G=o.relativeToCenter,W=i(G);G=W?G:r.ZERO;var X,V,H=a(o.exaggeration,1),Y=a(o.includeWebMercatorT,!1),k=a(o.structure,p.DEFAULT_STRUCTURE),j=a(k.heightScale,p.DEFAULT_STRUCTURE.heightScale),Z=a(k.heightOffset,p.DEFAULT_STRUCTURE.heightOffset),K=a(k.elementsPerHeight,p.DEFAULT_STRUCTURE.elementsPerHeight),Q=a(k.stride,p.DEFAULT_STRUCTURE.stride),J=a(k.elementMultiplier,p.DEFAULT_STRUCTURE.elementMultiplier),$=a(k.isBigEndian,p.DEFAULT_STRUCTURE.isBigEndian),ee=h.computeWidth(b),te=h.computeHeight(b),ne=ee/(U-1),re=te/(D-1),ae=B.radiiSquared,ie=ae.x,oe=ae.y,ue=ae.z,se=65536,ce=-65536,le=m.eastNorthUpToFixedFrame(G,B),fe=f.inverseTransformation(le,y);Y&&(X=_.geodeticLatitudeToMercatorAngle(S),V=1/(_.geodeticLatitudeToMercatorAngle(M)-X));var de=R;de.x=Number.POSITIVE_INFINITY,de.y=Number.POSITIVE_INFINITY,de.z=Number.POSITIVE_INFINITY;var he=A;he.x=Number.NEGATIVE_INFINITY,he.y=Number.NEGATIVE_INFINITY,he.z=Number.NEGATIVE_INFINITY;var Ee=Number.POSITIVE_INFINITY,me=U+(F>0?2:0),_e=D+(F>0?2:0),pe=me*_e,Te=new Array(pe),ye=new Array(pe),Re=new Array(pe),Ae=Y?new Array(pe):[],Se=0,Ne=D,Me=0,Ie=U;F>0&&(--Se,++Ne,--Me,++Ie);for(var Oe=0,ge=Se;ge<Ne;++ge){var ve=ge;ve<0&&(ve=0),ve>=D&&(ve=D-1);var we=b.north-re*ve;we=L?C(we):x-2*v(w(-we*z));var xe=I(we),Ce=O(we),Pe=ue*Ce,Ue=(we-S)/(M-S);Ue=l.clamp(Ue,0,1);var De;Y&&(De=(_.geodeticLatitudeToMercatorAngle(we)-X)*V);for(var Fe=Me;Fe<Ie;++Fe){var Le=Fe;Le<0&&(Le=0),Le>=U&&(Le=U-1);var Be=b.west+ne*Le;L?Be=C(Be):Be*=z;var ze,be=ve*(U*Q)+Le*Q;if(1===K)ze=P[be];else{ze=0;var qe;if($)for(qe=0;qe<K;++qe)ze=ze*J+P[be+qe];else for(qe=K-1;qe>=0;--qe)ze=ze*J+P[be+qe]}ze=(ze*j+Z)*H;var Ge=(Be-c)/(N-c);if(Ge=l.clamp(Ge,0,1),Re[Oe]=new n(Ge,Ue),ce=Math.max(ce,ze),se=Math.min(se,ze),Fe!==Le||ge!==ve){var We=1e-5;Fe<0?Be-=We*ee:Be+=We*ee,ge<0?we+=We*te:we-=We*te,xe=I(we),Ce=O(we),Pe=ue*Ce,ze-=F}var Xe=xe*I(Be),Ve=xe*O(Be),He=ie*Xe,Ye=oe*Ve,ke=g(He*Xe+Ye*Ve+Pe*Ce),je=1/ke,Ze=He*je,Ke=Ye*je,Qe=Pe*je,Je=new r;Je.x=Ze+Xe*ze,Je.y=Ke+Ve*ze,Je.z=Qe+Ce*ze,Te[Oe]=Je,ye[Oe]=ze,Y&&(Ae[Oe]=De),Oe++,f.multiplyByPoint(fe,Je,T),r.minimumByComponent(T,de,de),r.maximumByComponent(T,he,he),Ee=Math.min(Ee,ze)}}var $e,et=t.fromPoints(Te);i(q)&&q.width<l.PI_OVER_TWO+l.EPSILON5&&($e=d.fromRectangle(q,se,ce,B));var tt;if(W){var nt=new s(B);tt=nt.computeHorizonCullingPoint(G,Te)}for(var rt=new e(de,he,G),at=new E(rt,Ee,ce,le,!1,Y),it=new Float32Array(pe*at.getStride()),ot=0,ut=0;ut<pe;++ut)ot=at.encode(it,ot,Te[ut],Re[ut],ye[ut],void 0,Ae[ut]);return{vertices:it,maximumHeight:ce,minimumHeight:se,encoding:at,boundingSphere3D:et,orientedBoundingBox:$e,occludeePointInScaledSpace:tt}},p}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,a=t.message;n=e(r)&&e(a)?r+": "+a:t.toString();var i=t.stack;return e(i)&&(n+="\n"+i),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){"use strict";function r(r){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return r}),define("Workers/createVerticesFromHeightmap",["../Core/Ellipsoid","../Core/HeightmapTessellator","../Core/Rectangle","./createTaskProcessorWorker"],function(e,t,n,r){"use strict";function a(r,a){var i=r.width,o=r.height;r.skirtHeight>0&&(i+=2,o+=2),r.ellipsoid=e.clone(r.ellipsoid),r.rectangle=n.clone(r.rectangle);var u=t.computeVertices(r),s=u.vertices;return a.push(s.buffer),{vertices:s.buffer,numberOfAttributes:u.encoding.getStride(),minimumHeight:u.minimumHeight,maximumHeight:u.maximumHeight,gridWidth:i,gridHeight:o,boundingSphere3D:u.boundingSphere3D,orientedBoundingBox:u.orientedBoundingBox,occludeePointInScaledSpace:u.occludeePointInScaledSpace,encoding:u.encoding}}return r(a)})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js b/engines/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js index b6a4650..dfc9098 100644 --- a/engines/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +++ b/engines/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(r),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),n(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,d=1;d<f;d++){var h=t[d],E=h.x,m=h.y,_=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var p=r.minimum;p.x=a,p.y=o,p.z=u;var T=r.maximum;T.x=s,T.y=c,T.z=l;var y=e.add(p,T,r.center);return e.multiplyByScalar(y,.5,y),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,d=n.z,h=a.x,E=a.y,m=a.z,_=l*l*h*h,p=f*f*E*E,T=d*d*m*m,y=_+p+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(n,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,N=u.y,M=u.z,I=o;I.x=A.x*S*2,I.y=A.y*N*2,I.z=A.z*M*2;var O,g,v,w,x,C,P,U,D,F,L,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(I)),z=0;do{B-=z,v=1/(1+B*S),w=1/(1+B*N),x=1/(1+B*M),C=v*v,P=w*w,U=x*x,D=C*v,F=P*w,L=U*x,O=_*C+p*P+T*U-1,g=_*D*S+p*F*N+T*L*M;var b=-2*g;z=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*v,c.y=f*w,c.z=d*x,c):new e(l*v,f*w,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:d,_=n(r)?r._centerToleranceSquared:h,p=o(t,E,m,_,c);if(n(p)){var T=e.multiplyComponents(p,m,s);T=e.normalize(T,T);var y=e.subtract(t,p,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),S=i.sign(e.dot(y,t))*e.magnitude(y);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],d=m[a];if(Math.abs(e[s.getElementIndex(d,f)])>n){var h,_=e[s.getElementIndex(d,d)],p=e[s.getElementIndex(f,f)],T=e[s.getElementIndex(d,f)],y=(_-p)/2/T;h=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=n-u-f+h,m=2*(a-d),_=2*(i+l),p=2*(a+d),T=-n+u-f+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+h;return r(t)?(t[0]=E,t[1]=p,t[2]=R,t[3]=m,t[4]=T,t[5]=A,t[6]=_,t[7]=y,t[8]=S,t):new s(E,m,_,p,T,y,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=n*u,E=i*a+c*o*u,m=-o*i+i*o*u,_=-o,p=c*n,T=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=_,t[3]=f,t[4]=E,t[5]=p,t[6]=d,t[7]=m,t[8]=T,t):new s(l,f,d,h,E,m,_,p,T)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var d=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],_=new s,p=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=n*c(h);o<a&&l(h)>E;)f(h,_),s.transpose(_,p),s.multiply(h,_,h),s.multiply(p,h,h),s.multiply(d,_,d),++i>2&&(++o, -i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/d;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,d,h,E,m,_){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(d,0),this[15]=r(_,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,_=t.z*t.z,p=t.z*t.w,T=t.w*t.w,y=s-h-_+T,R=2*(c-p),A=2*(f+m),S=2*(c+p),N=-s+h-_+T,M=2*(E-d),I=2*(f-m),O=2*(E+d),g=-s-h+_+T;return r[0]=y*i,r[1]=S*i,r[2]=I*i,r[3]=0,r[4]=R*o,r[5]=N*o,r[6]=O*o,r[7]=0,r[8]=A*u,r[9]=M*u,r[10]=g*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,m=f.y,_=f.z,p=h.x,T=h.y,y=h.z,R=r.x,A=r.y,S=r.z,N=u*-R+s*-A+c*-S,M=p*-R+T*-A+y*-S,I=E*R+m*A+_*S;return a(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=T,n[6]=-m,n[7]=0,n[8]=c,n[9]=y,n[10]=-_,n[11]=0,n[12]=N,n[13]=M,n[14]=I,n[15]=1,n):new l(u,s,c,N,p,T,y,M,-E,-m,-_,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),d=c,h=l,E=f,m=i+c,_=o+l,p=t+f,T=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=p,a[15]=T,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],_=e[13],p=e[14],T=e[15],y=t[0],R=t[1],A=t[2],S=t[3],N=t[4],M=t[5],I=t[6],O=t[7],g=t[8],v=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],F=r*y+u*R+f*A+m*S,L=a*y+s*R+d*A+_*S,B=i*y+c*R+h*A+p*S,z=o*y+l*R+E*A+T*S,b=r*N+u*M+f*I+m*O,q=a*N+s*M+d*I+_*O,G=i*N+c*M+h*I+p*O,W=o*N+l*M+E*I+T*O,X=r*g+u*v+f*w+m*x,V=a*g+s*v+d*w+_*x,H=i*g+c*v+h*w+p*x,Y=o*g+l*v+E*w+T*x,k=r*C+u*P+f*U+m*D,j=a*C+s*P+d*U+_*D,Z=i*C+c*P+h*U+p*D,K=o*C+l*P+E*U+T*D;return n[0]=F,n[1]=L,n[2]=B,n[3]=z,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],_=t[1],p=t[2],T=t[4],y=t[5],R=t[6],A=t[8],S=t[9],N=t[10],M=t[12],I=t[13],O=t[14],g=r*m+o*_+c*p,v=a*m+u*_+l*p,w=i*m+s*_+f*p,x=r*T+o*y+c*R,C=a*T+u*y+l*R,P=i*T+s*y+f*R,U=r*A+o*S+c*N,D=a*A+u*S+l*N,F=i*A+s*S+f*N,L=r*M+o*I+c*O+d,B=a*M+u*I+l*O+h,z=i*M+s*I+f*O+E;return n[0]=g,n[1]=v,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=F,n[11]=0,n[12]=L,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],_=t[4],p=t[5],T=t[6],y=t[7],R=t[8],A=r*d+o*h+c*E,S=a*d+u*h+l*E,N=i*d+s*h+f*E,M=r*m+o*_+c*p,I=a*m+u*_+l*p,O=i*m+s*_+f*p,g=r*T+o*y+c*R,v=a*T+u*y+l*R,w=i*T+s*y+f*R;return n[0]=A,n[1]=S,n[2]=N,n[3]=0,n[4]=M,n[5]=I,n[6]=O,n[7]=0,n[8]=g,n[9]=v,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var p=new s,T=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,p),T,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],_=e[6],A=e[10],S=e[14],N=e[3],M=e[7],I=e[11],O=e[15],g=A*O,v=S*I,w=_*O,x=S*M,C=_*I,P=A*M,U=m*O,D=S*N,F=m*I,L=A*N,B=m*M,z=_*N,b=g*d+x*h+C*E-(v*d+w*h+P*E),q=v*f+U*h+L*E-(g*f+D*h+F*E),G=w*f+D*d+B*E-(x*f+U*d+z*E),W=P*f+F*d+z*h-(C*f+L*d+B*h),X=v*a+w*i+P*o-(g*a+x*i+C*o),V=g*r+D*i+F*o-(v*r+U*i+L*o),H=x*r+U*a+z*o-(w*r+D*a+B*o),Y=C*r+L*a+B*i-(P*r+F*a+z*i);g=i*E,v=o*h,w=a*E,x=o*d,C=a*h,P=i*d,U=r*E,D=o*f,F=r*h,L=i*f,B=r*d,z=a*f;var k=g*M+x*I+C*O-(v*M+w*I+P*O),j=v*N+U*I+L*O-(g*N+D*I+F*O),Z=w*N+D*M+B*O-(x*N+U*M+z*O),K=P*N+F*M+z*I-(C*N+L*M+B*I),Q=w*A+P*S+v*_-(C*S+g*_+x*A),J=F*S+g*m+D*A-(U*A+L*S+v*m),$=U*_+z*S+x*m-(B*S+w*m+D*_),ee=B*A+C*m+L*_-(F*_+z*A+P*m),te=r*b+a*q+i*G+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=j*te,n[10]=Z*te,n[11]=K*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-n*f-r*d-a*h,m=-i*f-o*d-u*h,_=-s*f-c*d-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return r(n)?(n.west=l,n.south=d,n.east=f,n.north=h,n):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,E=new e,m=new e,_=new e,p=new e,T=new e,y=new e,R=new e,A=new e,S=new e,N=new e,M=new e;d.fromPoints=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],y),i=e.clone(r,h),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,_),c=e.clone(r,p),l=e.clone(r,T),f=t.length,I=1;I<f;I++){e.clone(t[I],r);var O=r.x,g=r.y,v=r.z;O<i.x&&e.clone(r,i),O>s.x&&e.clone(r,s),g<o.y&&e.clone(r,o),g>c.y&&e.clone(r,c),v<u.z&&e.clone(r,u),v>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var F=A;F.x=.5*(P.x+U.x),F.y=.5*(P.y+U.y),F.z=.5*(P.z+U.z);var L=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(L),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(z,b,R),.5,M),G=0;for(I=0;I<f;I++){e.clone(t[I],r);var W=e.magnitude(e.subtract(r,q,R));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(r,F,R));if(X>L){var V=Math.sqrt(X);B=.5*(B+V),L=B*B;var H=V-B;F.x=(B*F.x+H*r.x)/V,F.y=(B*F.y+H*r.y)/V,F.z=(B*F.z+H*r.z)/V}}return B<G?(e.clone(F,n.center),n.radius=B):(e.clone(q,n.center),n.radius=G),n};var I=new o,O=new e,g=new e,v=new t,w=new t;d.fromRectangle2D=function(e,t,n){return d.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,I),f.southwest(t,v),v.height=i,f.northeast(t,w),w.height=o;var s=n.project(v,O),c=n.project(w,g),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),d.fromPoints(u,o)},d.fromVertices=function(t,n,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=y;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,_),I=e.clone(u,p),O=e.clone(u,T),g=t.length,v=0;v<g;v+=i){var w=t[v]+n.x,x=t[v+1]+n.y,C=t[v+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(I,c,R)),D=e.magnitudeSquared(e.subtract(O,l,R)),F=s,L=f,B=P;U>B&&(B=U,F=c,L=I),D>B&&(B=D,F=l,L=O);var z=A;z.x=.5*(F.x+L.x),z.y=.5*(F.y+L.y),z.z=.5*(F.z+L.z);var b=e.magnitudeSquared(e.subtract(L,z,R)),q=Math.sqrt(b),G=S;G.x=s.x,G.y=c.y,G.z=l.z;var W=N;W.x=f.x,W.y=I.y,W.z=O.z;var X=e.multiplyByScalar(e.add(G,W,R),.5,M),V=0;for(v=0;v<g;v+=i){u.x=t[v]+n.x,u.y=t[v+1]+n.y,u.z=t[v+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var j=k-q;z.x=(q*z.x+j*u.x)/k,z.y=(q*z.y+j*u.y)/k,z.z=(q*z.z+j*u.z)/k}}return q<V?(e.clone(z,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},d.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new d),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=y;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,p),f=e.clone(i,T),I=t.length,O=0;O<I;O+=3){var g=t[O]+n[O],v=t[O+1]+n[O+1],w=t[O+2]+n[O+2];i.x=g,i.y=v,i.z=w,g<o.x&&e.clone(i,o),g>c.x&&e.clone(i,c),v<u.y&&e.clone(i,u),v>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,F=x;C>F&&(F=C,U=u,D=l),P>F&&(F=P,U=s,D=f);var L=A;L.x=.5*(U.x+D.x),L.y=.5*(U.y+D.y),L.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,L,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var q=N;q.x=c.x,q.y=l.y,q.z=f.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,M),W=0;for(O=0;O<I;O+=3){i.x=t[O]+n[O],i.y=t[O+1]+n[O+1],i.z=t[O+2]+n[O+2];var X=e.magnitude(e.subtract(i,G,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,L,R));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;L.x=(z*L.x+Y*i.x)/H,L.y=(z*L.y+Y*i.y)/H,L.z=(z*L.z+Y*i.z)/H}}return z<W?(e.clone(L,r.center),r.radius=z):(e.clone(G,r.center),r.radius=W),r},d.fromCornerPoints=function(t,n,r){a(r)||(r=new d);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},d.fromEllipsoid=function(t,n){return a(n)||(n=new d),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;d.fromBoundingSpheres=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return d.clone(t[0],n);if(2===r)return d.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;d.fromOrientedBoundingBox=function(t,n){a(n)||(n=new d);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},d.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center), -n.radius=t.radius,n):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},d.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new d);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var F=new e,L=new e;d.union=function(t,n,r){a(r)||(r=new d);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,F),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,L);return e.add(h,i,h),e.clone(h,r.center),r.radius=f,r};var B=new e;d.expand=function(t,n,r){r=d.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},d.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;d.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;d.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,G=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,n,a){n=r(n,j);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),h=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var _=E.length,p=0;p<_;++p){var T=E[p];e.add(o,T,T);var y=i.cartesianToCartographic(T,H);n.project(y,T)}a=d.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){return d.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[d/e,a/d]:[a/d,d/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,_=u*c-h,p=4*E*_-m*m;if(p<0){var T,y,R;d*f>=l*h?(T=o,y=E,R=-2*u*E+o*m):(T=c,y=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(T)*Math.sqrt(-p);i=-R+S;var N=i/2,M=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===S?-M:-y/M;return a=y<=0?M+I:-R/(M*M+I*I+y),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var O=E,g=-2*u*E+o*m,v=_,w=-c*m+2*s*_,x=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-g)/3);a=2*Math.sqrt(-O);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),F=i+D>2*u?i-u:D-u,L=o,B=F/L;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-v),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=i+D<2*s?i+s:D+s,q=z/b,G=L*b,W=-F*b-L*z,X=F*z,V=(s*W-u*X)/(-u*W+s*G);return B<=V?B<=q?V<=q?[B,V,q]:[B,q,V]:[q,B,V]:B<=q?[V,B,q]:V<=q?[V,q,B]:[q,V,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,_=E[0],p=E[1];if(_>=0&&p>=0){var T=Math.sqrt(_),y=Math.sqrt(p);return[d-y,d-T,d+T,d+y]}if(_>=0&&p<0)return m=Math.sqrt(_),[d-m,d+m];if(_<0&&p>=0)return m=Math.sqrt(p),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,S=(s+h+c/R)/2,N=r.computeRealRoots(1,R,A),M=r.computeRealRoots(1,-R,S);return 0!==N.length?(N[0]+=d,N[1]+=d,0!==M.length?(M[0]+=d,M[1]+=d,N[1]<=M[0]?[N[0],N[1],M[0],M[1]]:M[1]<=N[0]?[M[0],M[1],N[0],N[1]]:N[0]>=M[0]&&N[1]<=M[1]?[M[0],N[0],N[1],M[1]]:M[0]>=N[0]&&M[1]<=N[1]?[N[0],M[0],M[1],N[1]]:N[0]>M[0]&&N[0]<M[1]?[M[0],N[0],M[1],N[1]]:[N[0],M[0],N[1],M[1]]):N):0!==M.length?(M[0]+=d,M[1]+=d,M):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,_=h[0],p=a-_,T=p*p,y=t/2,R=p/2,A=T-4*o,S=T+4*Math.abs(o),N=c-4*_,M=c+4*Math.abs(_);if(_<0||A*M<N*S){var I=Math.sqrt(N);E=I/2,m=0===I?0:(t*R-i)/I}else{var O=Math.sqrt(A);E=0===O?0:(t*R-i)/O,m=O/2}var g,v;0===y&&0===E?(g=0,v=0):n.sign(y)===n.sign(E)?(g=y+E,v=_/g):(v=y-E,g=_/v);var w,x;0===R&&0===m?(w=0,x=0):n.sign(R)===n.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var C=r.computeRealRoots(1,g,w),P=r.computeRealRoots(1,v,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,d=f*r,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*n*d-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function d(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,T),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(d,h,E,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),_=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*n.x+r,p=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),T=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),y=[];if(0===T&&0===p){if(l=s.computeRealRoots(E,m,_),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],N=Math.sqrt(Math.max(1-S*S,0));y.push(new e(a,i*S,i*-N)),y.push(new e(a,i*S,i*N))}return y}var M=T*T,I=p*p,O=E*E,g=T*p,v=O+I,w=2*(m*E+g),x=2*_*E+m*m-I+M,C=2*(_*m-g),P=_*_-M;if(0===v&&0===w&&0===x&&0===C)return y;l=c.computeRealRoots(v,w,x,C,P);var U=l.length;if(0===U)return y;for(var D=0;D<U;++D){var F,L=l[D],B=L*L,z=Math.max(1-B,0),b=Math.sqrt(z);F=o.sign(E)===o.sign(_)?h(E*B+_,m*L,o.EPSILON12):o.sign(_)===o.sign(m*L)?h(E*B,m*L+_,o.EPSILON12):h(E*B+m*L,_,o.EPSILON12);var q=h(p*L,T,o.EPSILON15),G=F*q;G<0?y.push(new e(a,i*L,i*b)):G>0?y.push(new e(a,i*L,i*-b)):0!==b?(y.push(new e(a,i*L,i*-b)),y.push(new e(a,i*L,i*b)),++D):y.push(new e(a,i*L,i*b))}return y}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var _=new e,p=new e,T=new e,y=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,m=e.subtract(a,r,_),A=e.subtract(i,r,p),S=e.cross(E,A,T),N=e.dot(m,S);if(u){if(N<o.EPSILON6)return;if(s=e.subtract(h,r,y),l=e.dot(s,S),l<0||l>N)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>N)return;d=e.dot(A,c)/N}else{if(Math.abs(N)<o.EPSILON6)return;var M=1/N;if(s=e.subtract(h,r,y),l=e.dot(s,S)*M,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*M,f<0||l+f>1)return;d=e.dot(A,c)*M}return d},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=d(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var N=new l;m.lineSegmentSphere=function(t,n,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var M=new e,I=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,M),f=e.multiplyComponents(c,t.direction,I),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(r=d-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,_=r/s;return m<_?new i(m,_):{start:_,stop:m}}var p=Math.sqrt(r/a);return new i(p,p)}return d<1?(r=d-1,a=e.magnitudeSquared(f),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var O=new e,g=new e,v=new e,w=new e,x=new e,C=new u,P=new u,U=new u,D=new u,F=new u,L=new u,B=new u,z=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,O);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,O),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,w),h=e.normalize(e.cross(d,f,g),g),m=e.normalize(e.cross(f,h,v),v),_=C;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=h.x,_[4]=h.y,_[5]=h.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=u.transpose(_,P),T=u.fromScale(n.radii,U),y=u.fromScale(n.oneOverRadii,D),R=F;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,N=u.multiply(u.multiply(p,y,L),R,L),M=u.multiply(u.multiply(N,T,B),_,B),I=u.multiplyByVector(N,a,x),G=E(M,e.negate(I,O),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(T,u.multiplyByVector(_,G[H],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var j=n.cartesianToCartographic(X,q);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-V*V),S=c?-S:S,j.height=S,n.cartographicToCartesian(j,new e)}};var G=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,d),{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,d),{positions:[t,n,r,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],d=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=p,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,_,T,y;if(T=t.length>>>0,c=Math.max(0,Math.min(n,T)),f=[],l=T-c+1,d=[],h=o(),c)for(_=h.progress,m=function(e){d.push(e),--l||(E=m=p,h.reject(d))},E=function(e){f.push(e),--c||(E=m=p,h.resolve(f))},y=0;y<T;++y)y in t&&e(t[y],s,u,_);else h.resolve(f);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),d(e,T).then(t,n,r)}function f(){return d(arguments,T)}function d(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},y.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r], -null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function T(e){return e}var y,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,y=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,d){var h,E,m,_,p;if("%%"==e)return"%";for(var T=!1,y="",R=!1,A=!1,S=" ",N=s.length,M=0;s&&M<N;M++)switch(s.charAt(M)){case" ":y=" ";break;case"+":y="+";break;case"-":T=!0;break;case"'":S=s.charAt(M+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,T=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],d){case"s":return u(String(p),T,c,f,R,S);case"c":return u(String.fromCharCode(+p),T,c,f,R);case"b":return o(p,2,A,T,c,f,R);case"o":return o(p,8,A,T,c,f,R);case"x":return o(p,16,A,T,c,f,R);case"X":return o(p,16,A,T,c,f,R).toUpperCase();case"u":return o(p,10,A,T,c,f,R);case"i":case"d":return h=+p||0,h=Math.round(h-h%1),E=h<0?"-":y,p=E+a(String(Math.abs(h)),f,"0",!1),i(p,E,T,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+p,E=h<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],p=E+Math.abs(h)[m](f),i(p,E,T,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function d(e,n){y.julianDate=e;var r=m.leapSeconds,a=t(r,y,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&f(this)}var _=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],T=29,y=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,N=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+I.source,g=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,v=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,d=0,_=0,y=0,I=0,w=u[0],x=u[1];if(u=w.match(M),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(N),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var F;if(r(x)){u=x.match(v),null!==u?(d=+u[1],_=+u[2],y=+u[3],I=1e3*+(u[4]||0),F=5):(u=x.match(g),null!==u?(d=+u[1],_=+u[2],y=60*+(u[3]||0),F=4):(u=x.match(O),null!==u&&(d=+u[1],_=60*+(u[2]||0),F=3)));var L=u[F],B=+u[F+1],z=+(u[F+2]||0);switch(L){case"+":d-=B,_-=z;break;case"-":d+=B,_+=z;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,d,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===y;for(b&&y--;_>=60;)_-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?T:p[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?T:p[s-1];for(;_<0;)_+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?T:p[s-1],l+=a;var q=E(n,s,l,d,_,y,I);return r(t)?(h(q[0],q[1],t),f(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=d(e,w);r(a)||(m.addSeconds(e,-1,w),a=d(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var _=h+2-12*c|0,p=100*(l-49)+f+c|0,T=u/s.SECONDS_PER_HOUR|0,y=u-T*s.SECONDS_PER_HOUR,R=y/s.SECONDS_PER_MINUTE|0;y-=R*s.SECONDS_PER_MINUTE;var A=0|y,S=(y-A)/s.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(A+=1),r(t)?(t.year=p,t.month=_,t.day=E,t.hour=T,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,_,E,T,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(d)&&n(E.overrideMimeType)&&E.overrideMimeType(d),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,p=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var T,y=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],N=_[R+m],M=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(M,N,f.TAI);if(p.push(I),y){if(N!==T&&r(T)){var O=o.leapSeconds,g=t(O,I,h);if(g<0){var v=new u(I,N);O.splice(~g,0,v)}}T=N}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function p(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=n[d+e._ut1MinusUtcSecondsColumn],p=n[h+e._ut1MinusUtcSecondsColumn],T=p-E;if(T>.5||T<-.5){var y=n[d+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];y!==R&&(l.equals(r)?E=p:p-=R-y)}return u.xPoleWander=_(f,n[d+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[d+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,E,p),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!r(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},d}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=d(e);return h.href=n,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),r(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,_=i-s*this._stepSizeDays,p=this._work,T=this._denominators,y=this._coef,R=this._xTable;for(E=0;E<=u;++E)p[E]=_-R[E];for(E=0;E<=u;++E){for(y[E]=1,m=0;m<=u;++m)m!==E&&(y[E]*=p[m]);y[E]*=T[E];var A=3*(s+E);n.x+=y[E]*h[A++],n.y+=y[E]*h[A++],n.s+=y[E]*h[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(N)&&(N=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,M=r(e[1]))}return N}function u(){return o()&&M}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,O=r(e[1]),O.isNightly=!!e[2])}return I}function c(){return s()&&O}function l(){if(!t(g)){g=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,v=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,v=r(e[1])))}return g}function f(){return l()&&v}function d(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function h(){return d()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return E()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function T(){if(!t(L)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;L=t(n)&&""!==n,L&&(F=n)}return L}function y(){return T()?F:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,N,M,I,O,g,v,w,x,C,P,U,D,F,L,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d,edgeVersion:h,isFirefox:E,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3), -supportsPointerEvents:p,supportsImageRenderingPixelated:T,imageRenderingValue:y};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,d=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=d,a):new l(u,s,c,d)};var d=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+f+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var _=d,p=0;f>s&&(p=1),E>s&&E>f&&(p=2);var T=_[p],y=_[T];n=Math.sqrt(e[c.getElementIndex(p,p)]-e[c.getElementIndex(T,T)]-e[c.getElementIndex(y,y)]+1);var R=h;R[p]=.5*n,n=.5/n,u=(e[c.getElementIndex(y,T)]-e[c.getElementIndex(T,y)])*n,R[T]=(e[c.getElementIndex(T,p)]+e[c.getElementIndex(p,T)])*n,R[y]=(e[c.getElementIndex(y,p)]+e[c.getElementIndex(p,y)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,_=new l,p=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),p=l.fromAxisAngle(e.UNIT_X,o.roll,E),_=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(_,p,_),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var T=new e,y=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,T);var u=l.computeAngle(R);r[o]=T.x*u,r[o+1]=T.y*u,r[o+2]=T.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,y);var u=e.magnitude(y);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(y,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,d=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=d,n.z=h,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var N=new l;l.lerp=function(e,t,n,r){return N=l.multiplyByScalar(t,n,N),r=l.multiplyByScalar(e,1-n,r),l.add(N,r,r)};var M=new l,I=new l,O=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=M=l.negate(t,M)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return I=l.multiplyByScalar(e,Math.sin((1-n)*o),I),O=l.multiplyByScalar(i,Math.sin(n*o),O),r=l.add(I,O,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var g=new e,v=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,g);l.multiply(i,t,x);var u=l.log(x,v);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],D=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;U[B]=1/(z*b),D[B]=z/b}return U[7]=P/136,D[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)F[f]=(U[f]*s-D[f])*o,L[f]=(U[f]*c-D[f])*o;var d=a*n*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),h=u*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),E=l.multiplyByScalar(e,h,C);return l.multiplyByScalar(t,d,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,_,p,T,y,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},N={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},M={},I={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},O=new n,g=new n,v=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(M[i])?r=M[i]:(r=function(r,i,s){if(u(s)||(s=new T),_.equalsEpsilon(r.x,0,_.EPSILON14)&&_.equalsEpsilon(r.y,0,_.EPSILON14)){var c=_.sign(r.z);n.unpack(N[e],0,O),"east"!==e&&"west"!==e&&n.multiplyByScalar(O,c,O),n.unpack(N[t],0,g),"east"!==t&&"west"!==t&&n.multiplyByScalar(g,c,g),n.unpack(N[a],0,v),"east"!==a&&"west"!==a&&n.multiplyByScalar(v,c,v)}else{i=o(i,d.WGS84),i.geodeticSurfaceNormal(r,I.up);var l=I.up,f=I.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,I.east),n.cross(l,f,I.north),n.multiplyByScalar(I.up,-1,I.down),n.multiplyByScalar(I.east,-1,I.west),n.multiplyByScalar(I.north,-1,I.south),O=I[e],g=I[t],v=I[a]}return s[0]=O.x,s[1]=O.y,s[2]=O.z,s[3]=0,s[4]=g.x,s[5]=g.y,s[6]=g.z,s[7]=0,s[8]=v.x,s[9]=v.y,s[10]=v.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},M[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new y,x=new n(1,1,1),C=new T;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof T&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=y.fromHeadingPitchRoll(t,w),c=T.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),T.multiply(i,c,i)};var P=new T,U=new p;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof y&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=T.getRotation(i,U);return y.fromRotationMatrix(o,a)};var D=24110.54841,F=8640184.812866,L=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,q=_.TWO_PI/86400,G=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(F+n*(L+n*B)),s=o*q%_.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(d,h,0,-h,d,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return p.transpose(n,t)};var V=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new p,k=new p;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=p.fromRotationZ(-i.s,k),d=p.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=h-2451545,y=E/R.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(T+y);S=S%1*_.TWO_PI;var N=p.fromRotationZ(S,k),M=p.multiply(d,N,Y),I=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),v=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*_.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=k;return U[0]=I*C,U[1]=I*P,U[2]=g,U[3]=-O*P+v*g*C,U[4]=O*C+v*g*P,U[5]=-v*I,U[6]=-v*P-O*g*C,U[7]=v*C-O*g*P,U[8]=O*I,p.multiply(M,U,t)}}};var j=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=j;return T.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),T.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var Z=new n,K=new n,Q=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,d.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,Q);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new T,ue=new T;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=T.getColumn(t,3,te),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,oe),c=T.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var d=T.getColumn(t,0,ee),h=n.magnitude(d),E=T.multiplyByVector(c,d,re);r.fromElements(E.z,E.x,E.y,0,E);var m=T.getColumn(t,1,ee),_=n.magnitude(m),p=T.multiplyByVector(c,m,ae);r.fromElements(p.z,p.x,p.y,0,p);var y=T.getColumn(t,2,ee),R=n.magnitude(y),S=ie;return n.cross(E,p,S),n.normalize(S,S),n.cross(p,S,E),n.normalize(E,E),n.cross(S,E,p),n.normalize(p,p),n.multiplyByScalar(E,h,E),n.multiplyByScalar(p,_,p),n.multiplyByScalar(S,R,S),T.setColumn(a,0,E,a),T.setColumn(a,1,p,a),T.setColumn(a,2,S,a),T.setColumn(a,3,f,a),a};var se=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,oe),i=T.inverseTransformation(a,ue),o=r.cartesianToCartographic(t,J),u=e.project(o,$),s=ne;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=T.fromTranslation(s,oe);return T.multiply(se,i,n),T.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var p=new d,T=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,T);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=p;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,T);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var y=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=y,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var d=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=d.clone(a(t,d.ZERO))}function _(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;d.setColumn(l,0,e.xAxis,l),d.setColumn(l,1,e.yAxis,l),d.setColumn(l,2,e.zAxis,l);var f=I;f.x=(t+r)/2,f.y=(a+o)/2,f.z=(u+s)/2;var h=O;h.x=(r-t)/2,h.y=(o-a)/2,h.z=(s-u)/2;var E=c.center;return f=d.multiplyByVector(l,f,f),n.add(e.origin,f,E),d.multiplyByScale(l,h,l),c}var p=new n,T=new n,y=new n,R=new n,A=new n,S=new n,N=new d,M={unitary:new d,diagonal:new d};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],p);for(r=1;r<a;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,f=0,h=0,E=0,_=0;for(r=0;r<a;r++)s=n.subtract(e[r],o,T),c+=s.x*s.x,l+=s.x*s.y,f+=s.x*s.z,h+=s.y*s.y,E+=s.y*s.z,_+=s.z*s.z;c*=u,l*=u,f*=u,h*=u,E*=u,_*=u;var I=N;I[0]=c,I[1]=l,I[2]=f,I[3]=l,I[4]=h,I[5]=E,I[6]=f,I[7]=E,I[8]=_;var O=d.computeEigenDecomposition(I,M),g=d.clone(O.unitary,t.halfAxes),v=d.getColumn(g,0,R),w=d.getColumn(g,1,A),x=d.getColumn(g,2,S),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,F=Number.MAX_VALUE,L=Number.MAX_VALUE;for(r=0;r<a;r++)s=e[r],C=Math.max(n.dot(v,s),C),P=Math.max(n.dot(w,s),P),U=Math.max(n.dot(x,s),U),D=Math.min(n.dot(v,s),D),F=Math.min(n.dot(w,s),F),L=Math.min(n.dot(x,s),L);v=n.multiplyByScalar(v,.5*(D+C),v),w=n.multiplyByScalar(w,.5*(F+P),w),x=n.multiplyByScalar(x,.5*(L+U),x);var B=n.add(v,w,t.center);B=n.add(B,x,B);var z=y;return z.x=C-D,z.y=P-F,z.z=U-L,n.multiplyByScalar(z,.5,z),d.multiplyByScale(t.halfAxes,z,t.halfAxes),t};var I=new n,O=new n,g=new r,v=new n,w=[new r,new r,new r,new r,new r,new r,new r,new r],x=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,i){t=a(t,0),n=a(n,0),r=a(r,u.WGS84);var o=E.center(e,g),c=r.cartographicToCartesian(o,v),l=new s(c,r),f=l.plane,d=w[0],m=w[1],p=w[2],T=w[3],y=w[4],R=w[5],A=w[6],S=w[7],N=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=y.latitude=e.south,S.latitude=T.latitude=M,d.latitude=m.latitude=p.latitude=e.north,A.longitude=S.longitude=d.longitude=e.west,R.longitude=m.longitude=N,y.longitude=T.longitude=p.longitude=e.east,p.height=m.height=d.height=S.height=A.height=R.height=y.height=T.height=n,r.cartographicArrayToCartesianArray(w,x),l.projectPointsToNearestOnPlane(x,C);var I=Math.min(C[6].x,C[7].x,C[0].x),O=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);p.height=d.height=y.height=A.height=t,r.cartographicArrayToCartesianArray(w,x);var D=Math.min(h.getPointDistance(f,x[0]),h.getPointDistance(f,x[2]),h.getPointDistance(f,x[4]),h.getPointDistance(f,x[6])),F=n;return _(l,I,O,P,U,D,F,i)},m.clone=function(e,t){if(i(e))return i(t)?(n.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,a=t.normal,i=e.halfAxes,o=a.x,u=a.y,s=a.z,l=Math.abs(o*i[d.COLUMN0ROW0]+u*i[d.COLUMN0ROW1]+s*i[d.COLUMN0ROW2])+Math.abs(o*i[d.COLUMN1ROW0]+u*i[d.COLUMN1ROW1]+s*i[d.COLUMN1ROW2])+Math.abs(o*i[d.COLUMN2ROW0]+u*i[d.COLUMN2ROW1]+s*i[d.COLUMN2ROW2]),f=n.dot(a,r)+t.distance;return f<=-l?c.OUTSIDE:f>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,F=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,I),a=e.halfAxes,i=d.getColumn(a,0,P),o=d.getColumn(a,1,U),u=d.getColumn(a,2,D),s=n.magnitude(i),c=n.magnitude(o),l=n.magnitude(u);n.normalize(i,i),n.normalize(o,o),n.normalize(u,u);var f=F;f.x=n.dot(r,i),f.y=n.dot(r,o),f.z=n.dot(r,u);var h,E=0;return f.x<-s?(h=f.x+s,E+=h*h):f.x>s&&(h=f.x-s,E+=h*h),f.y<-c?(h=f.y+c,E+=h*h):f.y>c&&(h=f.y-c,E+=h*h),f.z<-l?(h=f.z+l,E+=h*h):f.z>l&&(h=f.z-l,E+=h*h),E};var L=new n,B=new n;m.computePlaneDistances=function(e,t,r,a){i(a)||(a=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,f=d.getColumn(c,0,P),h=d.getColumn(c,1,U),E=d.getColumn(c,2,D),m=n.add(f,h,L);n.add(m,E,m),n.add(m,s,m);var _=n.subtract(m,t,B),p=n.dot(r,_);return o=Math.min(p,o),u=Math.max(p,u),n.add(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.add(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.add(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.add(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),n.subtract(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),p=n.dot(r,_),o=Math.min(p,o),u=Math.max(p,u),a.start=o,a.stop=u,a};var z=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,z);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||i(e)&&i(t)&&n.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,o,c,d){var _,p,T,y;if(i(e)&&i(t)&&i(r)&&i(o)){var R=e.minimum,A=e.maximum,S=n.subtract(A,R,f),N=r-t,M=Math.max(n.maximumComponent(S),N);_=M<m-1?s.BITS12:s.NONE,p=e.center,T=u.inverseTransformation(o,new u);var I=n.negate(R,l);u.multiply(u.fromTranslation(I,h),T,T);var O=l;O.x=1/S.x,O.y=1/S.y,O.z=1/S.z,u.multiply(u.fromScale(O,h),T,T),y=u.clone(o),u.setTranslation(y,n.ZERO,y),o=u.clone(o,new u);var g=u.fromTranslation(R,h),v=u.fromScale(S,E),w=u.multiply(g,v,h);u.multiply(o,w,o),u.multiply(y,w,y)}this.quantization=_,this.minimumHeight=t,this.maximumHeight=r,this.center=p,this.toScaledENU=T,this.fromScaledENU=o,this.matrix=y,this.hasVertexNormals=c,this.hasWebMercatorT=a(d,!1)}var l=new n,f=new n,d=new t,h=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,i,c,f,h,E){var m=c.x,_=c.y;if(this.quantization===s.BITS12){i=u.multiplyByPoint(this.toScaledENU,i,l),i.x=o.clamp(i.x,0,1),i.y=o.clamp(i.y,0,1),i.z=o.clamp(i.z,0,1);var p=this.maximumHeight-this.minimumHeight,T=o.clamp((f-this.minimumHeight)/p,0,1);t.fromElements(i.x,i.y,d);var y=e.compressTextureCoordinates(d);t.fromElements(i.z,T,d);var R=e.compressTextureCoordinates(d);t.fromElements(m,_,d);var A=e.compressTextureCoordinates(d);if(r[a++]=y,r[a++]=R,r[a++]=A,this.hasWebMercatorT){t.fromElements(E,0,d);var S=e.compressTextureCoordinates(d);r[a++]=S}}else n.subtract(i,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=f,r[a++]=m,r[a++]=_,this.hasWebMercatorT&&(r[a++]=E);return this.hasVertexNormals&&(r[a++]=e.octPackFloat(h)),a},c.prototype.decodePosition=function(t,r,a){if(i(a)||(a=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],d);a.x=o.x,a.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],d);return a.z=c.x,u.multiplyByPoint(this.fromScaledENU,a,a)}return a.x=t[r],a.y=t[r+1],a.z=t[r+2],n.add(a,this.center,a)},c.prototype.decodeTextureCoordinates=function(n,r,a){return i(a)||(a=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],a):t.fromElements(n[r+4],n[r+5],a)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){var r=e.decompressTextureCoordinates(t[n+1],d);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var a=this.getStride();n=(n+1)*a-1;var i=e[n]/256,o=Math.floor(i),u=256*(i-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},p={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,n=r.FLOAT,a=r.getSizeInBytes(n);if(this.quantization===s.NONE){var i=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(i+o)*a,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:i*a,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*a,[{index:p.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:p.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*a,strideInBytes:t}]):[{index:p.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?_:p},c.clone=function(e,t){return i(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},s.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},s}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,a=t.message;n=e(r)&&e(a)?r+": "+a:t.toString();var i=t.stack;return e(i)&&(n+="\n"+i),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){ -"use strict";function r(r){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return r}),define("Workers/createVerticesFromQuantizedTerrainMesh",["../Core/AttributeCompression","../Core/AxisAlignedBoundingBox","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/Ellipsoid","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/TerrainEncoding","../Core/Transforms","../Core/WebMercatorProjection","./createTaskProcessorWorker"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m){"use strict";function _(i,m){var _,v,w=i.quantizedVertices,x=w.length/3,C=i.octEncodedNormals,P=i.westIndices.length+i.eastIndices.length+i.southIndices.length+i.northIndices.length,U=i.includeWebMercatorT,D=i.rectangle,F=D.west,L=D.south,B=D.east,z=D.north,b=u.clone(i.ellipsoid),q=i.exaggeration,G=i.minimumHeight*q,W=i.maximumHeight*q,X=i.relativeToCenter,V=h.eastNorthUpToFixedFrame(X,b),H=l.inverseTransformation(V,new l);U&&(_=E.geodeticLatitudeToMercatorAngle(L),v=1/(E.geodeticLatitudeToMercatorAngle(z)-_));var Y=w.subarray(0,x),k=w.subarray(x,2*x),j=w.subarray(2*x,3*x),Z=o(C),K=new Array(x),Q=new Array(x),J=new Array(x),$=U?new Array(x):[],ee=A;ee.x=Number.POSITIVE_INFINITY,ee.y=Number.POSITIVE_INFINITY,ee.z=Number.POSITIVE_INFINITY;var te=S;te.x=Number.NEGATIVE_INFINITY,te.y=Number.NEGATIVE_INFINITY,te.z=Number.NEGATIVE_INFINITY;for(var ne=0;ne<x;++ne){var re=Y[ne]/y,ae=k[ne]/y,ie=c.lerp(G,W,j[ne]/y);N.longitude=c.lerp(F,B,re),N.latitude=c.lerp(L,z,ae),N.height=ie;var oe=b.cartographicToCartesian(N);K[ne]=new r(re,ae),Q[ne]=ie,J[ne]=oe,U&&($[ne]=(E.geodeticLatitudeToMercatorAngle(N.latitude)-_)*v),l.multiplyByPoint(H,oe,R),a.minimumByComponent(R,ee,ee),a.maximumByComponent(R,te,te)}var ue,se;1!==q&&(se=n.fromPoints(J),ue=f.fromRectangle(D,G,W,b));var ce=G;ce=Math.min(ce,p(i.westIndices,i.westSkirtHeight,Q,K,D,b,H,ee,te)),ce=Math.min(ce,p(i.southIndices,i.southSkirtHeight,Q,K,D,b,H,ee,te)),ce=Math.min(ce,p(i.eastIndices,i.eastSkirtHeight,Q,K,D,b,H,ee,te)),ce=Math.min(ce,p(i.northIndices,i.northSkirtHeight,Q,K,D,b,H,ee,te));for(var le=new t(ee,te,X),fe=new d(le,ce,W,V,Z,U),de=fe.getStride(),he=x*de+P*de,Ee=new Float32Array(he),me=0,_e=0;_e<x;++_e){if(Z){var pe=2*_e;if(M.x=C[pe],M.y=C[pe+1],1!==q){var Te=e.octDecode(M.x,M.y,I),ye=h.eastNorthUpToFixedFrame(J[_e],b,g),Re=l.inverseTransformation(ye,O);l.multiplyByPointAsVector(Re,Te,Te),Te.z*=q,a.normalize(Te,Te),l.multiplyByPointAsVector(ye,Te,Te),a.normalize(Te,Te),e.octEncode(Te,M)}}me=fe.encode(Ee,me,J[_e],K[_e],Q[_e],M,$[_e])}var Ae=Math.max(0,2*(P-4)),Se=i.indices.length+3*Ae,Ne=s.createTypedArray(x+P,Se);Ne.set(i.indices,0);var Me=x*de,Ie=i.indices.length;return Ie=T(Ee,Me,Ne,Ie,i.westIndices,fe,Q,K,C,b,D,i.westSkirtHeight,!0,q,_,v),Me+=i.westIndices.length*de,Ie=T(Ee,Me,Ne,Ie,i.southIndices,fe,Q,K,C,b,D,i.southSkirtHeight,!1,q,_,v),Me+=i.southIndices.length*de,Ie=T(Ee,Me,Ne,Ie,i.eastIndices,fe,Q,K,C,b,D,i.eastSkirtHeight,!1,q,_,v),Me+=i.eastIndices.length*de,T(Ee,Me,Ne,Ie,i.northIndices,fe,Q,K,C,b,D,i.northSkirtHeight,!0,q,_,v),m.push(Ee.buffer,Ne.buffer),{vertices:Ee.buffer,indices:Ne.buffer,vertexStride:de,center:X,minimumHeight:G,maximumHeight:W,boundingSphere:se,orientedBoundingBox:ue,encoding:fe,skirtIndex:i.indices.length}}function p(e,t,n,r,i,o,u,s,f){var d=Number.POSITIVE_INFINITY,h=i.north,E=i.south,m=i.east,_=i.west;m<_&&(m+=c.TWO_PI);for(var p=e.length,T=0;T<p;++T){var y=e[T],A=n[y],S=r[y];N.longitude=c.lerp(_,m,S.x),N.latitude=c.lerp(E,h,S.y),N.height=A-t;var M=o.cartographicToCartesian(N,R);l.multiplyByPoint(u,M,M),a.minimumByComponent(M,s,s),a.maximumByComponent(M,f,f),d=Math.min(d,N.height)}return d}function T(t,n,r,i,u,s,f,d,m,_,p,T,y,A,S,v){var w,x,C;y?(w=u.length-1,x=-1,C=-1):(w=0,x=u.length,C=1);var P=-1,U=o(m),D=s.getStride(),F=n/D,L=p.north,B=p.south,z=p.east,b=p.west;z<b&&(z+=c.TWO_PI);for(var q=w;q!==x;q+=C){var G=u[q],W=f[G],X=d[G];N.longitude=c.lerp(b,z,X.x),N.latitude=c.lerp(B,L,X.y),N.height=W-T;var V=_.cartographicToCartesian(N,R);if(U){var H=2*G;if(M.x=m[H],M.y=m[H+1],1!==A){var Y=e.octDecode(M.x,M.y,I),k=h.eastNorthUpToFixedFrame(R,_,g),j=l.inverseTransformation(k,O);l.multiplyByPointAsVector(j,Y,Y),Y.z*=A,a.normalize(Y,Y),l.multiplyByPointAsVector(k,Y,Y),a.normalize(Y,Y),e.octEncode(Y,M)}}var Z;s.hasWebMercatorT&&(Z=(E.geodeticLatitudeToMercatorAngle(N.latitude)-S)*v),n=s.encode(t,n,V,X,N.height,M,Z),P!==-1&&(r[i++]=P,r[i++]=F-1,r[i++]=G,r[i++]=F-1,r[i++]=F,r[i++]=G),P=G,++F}return i}var y=32767,R=new a,A=new a,S=new a,N=new i,M=new r,I=new a,O=new l,g=new l;return m(_)})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var d=new o,h=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);d.x=c*Math.cos(e),d.y=c*Math.sin(e),d.z=Math.sin(r),d=o.normalize(d,d),o.multiplyComponents(s,d,h);var l=Math.sqrt(o.dot(d,h));return h=o.divideByScalar(h,l,h),d=o.multiplyByScalar(d,a,d),n(u)||(u=new o),o.add(h,d,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,n,r,a,i){"use strict";var o={};o.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,a=n.y;n.x=(1-Math.abs(a))*i.signNotZero(r),n.y=(1-Math.abs(r))*i.signNotZero(a)}return n.x=i.toSNorm(n.x,t),n.y=i.toSNorm(n.y,t),n},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,n,r,a){if(a.x=i.fromSNorm(e,r),a.y=i.fromSNorm(n,r),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},o.octDecode=function(e,t,n){return o.octDecodeInRange(e,t,255,n)},o.octPackFloat=function(e){return 256*e.x+e.y};var u=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,u),o.octPackFloat(u)},o.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return o.octDecode(r,a,t)},o.octPack=function(e,t,n,r){var a=o.octEncodeFloat(e),i=o.octEncodeFloat(t),s=o.octEncode(n,u);return r.x=65536*s.x+a,r.y=65536*s.y+i,r},o.octUnpack=function(e,t,n,r){var a=e.x/65536,i=Math.floor(a),u=65536*(a-i);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);o.octDecodeFloat(u,t),o.octDecodeFloat(c,n),o.octDecode(i,s,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},o.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,n,r,a){"use strict";function i(t,a,i){this.minimum=e.clone(n(t,e.ZERO)),this.maximum=e.clone(n(a,e.ZERO)),r(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,n){if(r(n)||(n=new i),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,d=1;d<f;d++){var h=t[d],E=h.x,m=h.y,_=h.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var T=n.minimum;T.x=a,T.y=o,T.z=u;var p=n.maximum;p.x=s,p.y=c,p.z=l;var y=e.add(T,p,n.center);return e.multiplyByScalar(y,.5,y),n},i.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new i(t.minimum,t.maximum)},i.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,d=n.z,h=a.x,E=a.y,m=a.z,_=l*l*h*h,T=f*f*E*E,p=d*d*m*m,y=_+T+p,R=Math.sqrt(1/y),A=e.multiplyByScalar(n,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,N=u.y,M=u.z,I=o;I.x=A.x*S*2,I.y=A.y*N*2,I.z=A.z*M*2;var O,g,v,w,x,C,P,U,D,F,L,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(I)),z=0;do{B-=z,v=1/(1+B*S),w=1/(1+B*N),x=1/(1+B*M),C=v*v,P=w*w,U=x*x,D=C*v,F=P*w,L=U*x,O=_*C+T*P+p*U-1,g=_*D*S+T*F*N+p*L*M;var b=-2*g;z=O/b}while(Math.abs(O)>r.EPSILON12);return t(c)?(c.x=l*v,c.y=f*w,c.z=d*x,c):new e(l*v,f*w,d*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,a,i){return a=n(a,0),r(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),d=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),h=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,m=r(n)?n.oneOverRadiiSquared:d,_=r(n)?n._centerToleranceSquared:h,T=o(t,E,m,_,c);if(r(T)){var p=e.multiplyComponents(T,m,s);p=e.normalize(p,p);var y=e.subtract(t,T,l),R=Math.atan2(p.y,p.x),A=Math.asin(p.z),S=i.sign(e.dot(y,t))*e.magnitude(y);return r(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,d=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=d;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var h=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,h),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],d=m[a];if(Math.abs(e[s.getElementIndex(d,f)])>n){var h,_=e[s.getElementIndex(d,d)],T=e[s.getElementIndex(f,f)],p=e[s.getElementIndex(d,f)],y=(_-T)/2/p;h=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+h*h),l=h*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(d,d)]=c,t[s.getElementIndex(d,f)]=l,t[s.getElementIndex(f,d)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,d=e.z*e.w,h=e.w*e.w,E=n-u-f+h,m=2*(a-d),_=2*(i+l),T=2*(a+d),p=-n+u-f+h,y=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+h;return r(t)?(t[0]=E,t[1]=T,t[2]=R,t[3]=m,t[4]=p,t[5]=A,t[6]=_,t[7]=y,t[8]=S,t):new s(E,m,_,T,p,y,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,d=c*u+i*o*a,h=n*u,E=i*a+c*o*u,m=-c*a+i*o*u,_=-o,T=c*n,p=i*n;return r(t)?(t[0]=l,t[1]=h,t[2]=_,t[3]=f,t[4]=E,t[5]=T,t[6]=d,t[7]=m,t[8]=p,t):new s(l,f,d,h,E,m,_,T,p)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var d=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],d)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],d)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],d)),n};var h=new e;s.getMaximumScale=function(t){return s.getScale(t,h),e.maximumComponent(h)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],_=new s,T=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var d=t.unitary=s.clone(s.IDENTITY,t.unitary),h=t.diagonal=s.clone(e,t.diagonal),E=n*c(h);o<a&&l(h)>E;)f(h,_),s.transpose(_,T),s.multiply(h,_,h),s.multiply(T,h,h),s.multiply(d,_,d),++i>2&&(++o, +i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],d=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var h=1/d;return s.multiplyByScalar(t,h,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,d,h,E,m,_){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(h,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(d,0),this[15]=r(_,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,d=t.x*t.w,h=t.y*t.y,E=t.y*t.z,m=t.y*t.w,_=t.z*t.z,T=t.z*t.w,p=t.w*t.w,y=s-h-_+p,R=2*(c-T),A=2*(f+m),S=2*(c+T),N=-s+h-_+p,M=2*(E-d),I=2*(f-m),O=2*(E+d),g=-s-h+_+p;return r[0]=y*i,r[1]=S*i,r[2]=I*i,r[3]=0,r[4]=R*o,r[5]=N*o,r[6]=O*o,r[7]=0,r[8]=A*u,r[9]=M*u,r[10]=g*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,d=new e,h=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,d),d),e.normalize(e.cross(d,f,h),h);var u=d.x,s=d.y,c=d.z,E=f.x,m=f.y,_=f.z,T=h.x,p=h.y,y=h.z,R=r.x,A=r.y,S=r.z,N=u*-R+s*-A+c*-S,M=T*-R+p*-A+y*-S,I=E*R+m*A+_*S;return a(n)?(n[0]=u,n[1]=T,n[2]=-E,n[3]=0,n[4]=s,n[5]=p,n[6]=-m,n[7]=0,n[8]=c,n[9]=y,n[10]=-_,n[11]=0,n[12]=N,n[13]=M,n[14]=I,n[15]=1,n):new l(u,s,c,N,T,p,y,M,-E,-m,-_,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,d=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=d,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),d=-1,h=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=d,o[12]=0,o[13]=0,o[14]=h,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,d=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=d,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),d=c,h=l,E=f,m=i+c,_=o+l,T=t+f,p=1;return a[0]=d,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=h,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=T,a[15]=p,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],d=e[9],h=e[10],E=e[11],m=e[12],_=e[13],T=e[14],p=e[15],y=t[0],R=t[1],A=t[2],S=t[3],N=t[4],M=t[5],I=t[6],O=t[7],g=t[8],v=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],F=r*y+u*R+f*A+m*S,L=a*y+s*R+d*A+_*S,B=i*y+c*R+h*A+T*S,z=o*y+l*R+E*A+p*S,b=r*N+u*M+f*I+m*O,q=a*N+s*M+d*I+_*O,G=i*N+c*M+h*I+T*O,W=o*N+l*M+E*I+p*O,X=r*g+u*v+f*w+m*x,V=a*g+s*v+d*w+_*x,H=i*g+c*v+h*w+T*x,Y=o*g+l*v+E*w+p*x,k=r*C+u*P+f*U+m*D,j=a*C+s*P+d*U+_*D,Z=i*C+c*P+h*U+T*D,K=o*C+l*P+E*U+p*D;return n[0]=F,n[1]=L,n[2]=B,n[3]=z,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=j,n[14]=Z,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=e[12],h=e[13],E=e[14],m=t[0],_=t[1],T=t[2],p=t[4],y=t[5],R=t[6],A=t[8],S=t[9],N=t[10],M=t[12],I=t[13],O=t[14],g=r*m+o*_+c*T,v=a*m+u*_+l*T,w=i*m+s*_+f*T,x=r*p+o*y+c*R,C=a*p+u*y+l*R,P=i*p+s*y+f*R,U=r*A+o*S+c*N,D=a*A+u*S+l*N,F=i*A+s*S+f*N,L=r*M+o*I+c*O+d,B=a*M+u*I+l*O+h,z=i*M+s*I+f*O+E;return n[0]=g,n[1]=v,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=F,n[11]=0,n[12]=L,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],d=t[0],h=t[1],E=t[2],m=t[3],_=t[4],T=t[5],p=t[6],y=t[7],R=t[8],A=r*d+o*h+c*E,S=a*d+u*h+l*E,N=i*d+s*h+f*E,M=r*m+o*_+c*T,I=a*m+u*_+l*T,O=i*m+s*_+f*T,g=r*p+o*y+c*R,v=a*p+u*y+l*R,w=i*p+s*y+f*R;return n[0]=A,n[1]=S,n[2]=N,n[3]=0,n[4]=M,n[5]=I,n[6]=O,n[7]=0,n[8]=g,n[9]=v,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var T=new s,p=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,T),p,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],d=e[5],h=e[9],E=e[13],m=e[2],_=e[6],A=e[10],S=e[14],N=e[3],M=e[7],I=e[11],O=e[15],g=A*O,v=S*I,w=_*O,x=S*M,C=_*I,P=A*M,U=m*O,D=S*N,F=m*I,L=A*N,B=m*M,z=_*N,b=g*d+x*h+C*E-(v*d+w*h+P*E),q=v*f+U*h+L*E-(g*f+D*h+F*E),G=w*f+D*d+B*E-(x*f+U*d+z*E),W=P*f+F*d+z*h-(C*f+L*d+B*h),X=v*a+w*i+P*o-(g*a+x*i+C*o),V=g*r+D*i+F*o-(v*r+U*i+L*o),H=x*r+U*a+z*o-(w*r+D*a+B*o),Y=C*r+L*a+B*i-(P*r+F*a+z*i);g=i*E,v=o*h,w=a*E,x=o*d,C=a*h,P=i*d,U=r*E,D=o*f,F=r*h,L=i*f,B=r*d,z=a*f;var k=g*M+x*I+C*O-(v*M+w*I+P*O),j=v*N+U*I+L*O-(g*N+D*I+F*O),Z=w*N+D*M+B*O-(x*N+U*M+z*O),K=P*N+F*M+z*I-(C*N+L*M+B*I),Q=w*A+P*S+v*_-(C*S+g*_+x*A),J=F*S+g*m+D*A-(U*A+L*S+v*m),$=U*_+z*S+x*m-(B*S+w*m+D*_),ee=B*A+C*m+L*_-(F*_+z*A+P*m),te=r*b+a*q+i*G+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=j*te,n[10]=Z*te,n[11]=K*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],d=e[13],h=e[14],E=-n*f-r*d-a*h,m=-i*f-o*d-u*h,_=-s*f-c*d-l*h;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var h=e[f];n=Math.min(n,h.longitude),a=Math.max(a,h.longitude),c=Math.min(c,h.latitude),l=Math.max(l,h.latitude);var E=h.longitude>=0?h.longitude:h.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,d=0,h=e.length;d<h;d++){var E=t.cartesianToCartographic(e[d]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var d=Math.max(e.south,t.south),h=Math.min(e.north,t.north);if(!(d>=h))return r(n)?(n.west=l,n.south=d,n.east=f,n.north=h,n):new s(l,d,f,h)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,d=e.south,h=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:d>0?m.latitude=d:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var h=new e,E=new e,m=new e,_=new e,T=new e,p=new e,y=new e,R=new e,A=new e,S=new e,N=new e,M=new e;d.fromPoints=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],y),i=e.clone(r,h),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,_),c=e.clone(r,T),l=e.clone(r,p),f=t.length,I=1;I<f;I++){e.clone(t[I],r);var O=r.x,g=r.y,v=r.z;O<i.x&&e.clone(r,i),O>s.x&&e.clone(r,s),g<o.y&&e.clone(r,o),g>c.y&&e.clone(r,c),v<u.z&&e.clone(r,u),v>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var F=A;F.x=.5*(P.x+U.x),F.y=.5*(P.y+U.y),F.z=.5*(P.z+U.z);var L=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(L),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(z,b,R),.5,M),G=0;for(I=0;I<f;I++){e.clone(t[I],r);var W=e.magnitude(e.subtract(r,q,R));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(r,F,R));if(X>L){var V=Math.sqrt(X);B=.5*(B+V),L=B*B;var H=V-B;F.x=(B*F.x+H*r.x)/V,F.y=(B*F.y+H*r.y)/V,F.z=(B*F.z+H*r.z)/V}}return B<G?(e.clone(F,n.center),n.radius=B):(e.clone(q,n.center),n.radius=G),n};var I=new o,O=new e,g=new e,v=new t,w=new t;d.fromRectangle2D=function(e,t,n){return d.fromRectangleWithHeights2D(e,t,0,0,n)},d.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new d),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,I),f.southwest(t,v),v.height=i,f.northeast(t,w),w.height=o;var s=n.project(v,O),c=n.project(w,g),l=c.x-s.x,h=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+h*h+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*h,m.z=s.z+.5*E,u};var x=[];d.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),d.fromPoints(u,o)},d.fromVertices=function(t,n,i,o){if(a(o)||(o=new d),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=y;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,h),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,_),I=e.clone(u,T),O=e.clone(u,p),g=t.length,v=0;v<g;v+=i){var w=t[v]+n.x,x=t[v+1]+n.y,C=t[v+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>O.z&&e.clone(u,O)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(I,c,R)),D=e.magnitudeSquared(e.subtract(O,l,R)),F=s,L=f,B=P;U>B&&(B=U,F=c,L=I),D>B&&(B=D,F=l,L=O);var z=A;z.x=.5*(F.x+L.x),z.y=.5*(F.y+L.y),z.z=.5*(F.z+L.z);var b=e.magnitudeSquared(e.subtract(L,z,R)),q=Math.sqrt(b),G=S;G.x=s.x,G.y=c.y,G.z=l.z;var W=N;W.x=f.x,W.y=I.y,W.z=O.z;var X=e.multiplyByScalar(e.add(G,W,R),.5,M),V=0;for(v=0;v<g;v+=i){u.x=t[v]+n.x,u.y=t[v+1]+n.y,u.z=t[v+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var j=k-q;z.x=(q*z.x+j*u.x)/k,z.y=(q*z.y+j*u.y)/k,z.z=(q*z.z+j*u.z)/k}}return q<V?(e.clone(z,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},d.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new d),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=y;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,h),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,T),f=e.clone(i,p),I=t.length,O=0;O<I;O+=3){var g=t[O]+n[O],v=t[O+1]+n[O+1],w=t[O+2]+n[O+2];i.x=g,i.y=v,i.z=w,g<o.x&&e.clone(i,o),g>c.x&&e.clone(i,c),v<u.y&&e.clone(i,u),v>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,F=x;C>F&&(F=C,U=u,D=l),P>F&&(F=P,U=s,D=f);var L=A;L.x=.5*(U.x+D.x),L.y=.5*(U.y+D.y),L.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,L,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var q=N;q.x=c.x,q.y=l.y,q.z=f.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,M),W=0;for(O=0;O<I;O+=3){i.x=t[O]+n[O],i.y=t[O+1]+n[O+1],i.z=t[O+2]+n[O+2];var X=e.magnitude(e.subtract(i,G,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,L,R));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;L.x=(z*L.x+Y*i.x)/H,L.y=(z*L.y+Y*i.y)/H,L.z=(z*L.z+Y*i.z)/H}}return z<W?(e.clone(L,r.center),r.radius=z):(e.clone(G,r.center),r.radius=W),r},d.fromCornerPoints=function(t,n,r){a(r)||(r=new d);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},d.fromEllipsoid=function(t,n){return a(n)||(n=new d),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;d.fromBoundingSpheres=function(t,n){if(a(n)||(n=new d),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return d.clone(t[0],n);if(2===r)return d.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=d.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;d.fromOrientedBoundingBox=function(t,n){a(n)||(n=new d);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D);return e.add(i,o,i),e.add(i,u,i),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(i),n},d.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center), +n.radius=t.radius,n):new d(t.center,t.radius)},d.packedLength=4,d.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},d.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new d);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var F=new e,L=new e;d.union=function(t,n,r){a(r)||(r=new d);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,F),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),h=e.multiplyByScalar(c,(-o+f)/l,L);return e.add(h,i,h),e.clone(h,r.center),r.radius=f,r};var B=new e;d.expand=function(t,n,r){r=d.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},d.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},d.transform=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;d.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},d.transformWithoutScale=function(e,t,n){return a(n)||(n=new d),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;d.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,G=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var j=new o;return d.projectTo2D=function(t,n,a){n=r(n,j);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,V),h=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,h,m),m=E[2],e.add(s,f,m),e.add(m,h,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,h,m),m=E[6],e.add(s,f,m),e.add(m,h,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var _=E.length,T=0;T<_;++T){var p=E[T];e.add(o,p,p);var y=i.cartesianToCartographic(p,H);n.project(y,p)}a=d.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},d.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},d.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},d.prototype.intersectPlane=function(e){return d.intersectPlane(this,e)},d.prototype.distanceSquaredTo=function(e){return d.distanceSquaredTo(this,e)},d.prototype.computePlaneDistances=function(e,t,n){return d.computePlaneDistances(this,e,t,n)},d.prototype.isOccluded=function(e){return d.isOccluded(this,e)},d.prototype.equals=function(e){return d.equals(this,e)},d.prototype.clone=function(e){return d.clone(this,e)},d}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var d=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[d/e,a/d]:[a/d,d/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,d=u*u,h=s*s,E=o*s-d,m=o*c-u*s,_=u*c-h,T=4*E*_-m*m;if(T<0){var p,y,R;d*f>=l*h?(p=o,y=E,R=-2*u*E+o*m):(p=c,y=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(p)*Math.sqrt(-T);i=-R+S;var N=i/2,M=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===S?-M:-y/M;return a=y<=0?M+I:-R/(M*M+I*I+y),d*f>=l*h?[(a-u)/o]:[-c/(a+s)]}var O=E,g=-2*u*E+o*m,v=_,w=-c*m+2*s*_,x=Math.sqrt(T),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-g)/3);a=2*Math.sqrt(-O);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),F=i+D>2*u?i-u:D-u,L=o,B=F/L;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-v),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=i+D<2*s?i+s:D+s,q=z/b,G=L*b,W=-F*b-L*z,X=F*z,V=(s*W-u*X)/(-u*W+s*G);return B<=V?B<=q?V<=q?[B,V,q]:[B,q,V]:[q,B,V]:B<=q?[V,B,q]:V<=q?[V,q,B]:[q,V,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var d=-t/4,h=f[f.length-1];if(Math.abs(h)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,_=E[0],T=E[1];if(_>=0&&T>=0){var p=Math.sqrt(_),y=Math.sqrt(T);return[d-y,d-p,d+p,d+y]}if(_>=0&&T<0)return m=Math.sqrt(_),[d-m,d+m];if(_<0&&T>=0)return m=Math.sqrt(T),[d-m,d+m]}return[]}if(h>0){var R=Math.sqrt(h),A=(s+h-c/R)/2,S=(s+h+c/R)/2,N=r.computeRealRoots(1,R,A),M=r.computeRealRoots(1,-R,S);return 0!==N.length?(N[0]+=d,N[1]+=d,0!==M.length?(M[0]+=d,M[1]+=d,N[1]<=M[0]?[N[0],N[1],M[0],M[1]]:M[1]<=N[0]?[M[0],M[1],N[0],N[1]]:N[0]>=M[0]&&N[1]<=M[1]?[M[0],N[0],N[1],M[1]]:M[0]>=N[0]&&M[1]<=N[1]?[N[0],M[0],M[1],N[1]]:N[0]>M[0]&&N[0]<M[1]?[M[0],N[0],M[1],N[1]]:[N[0],M[0],N[1],M[1]]):N):0!==M.length?(M[0]+=d,M[1]+=d,M):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,d=c*o-i*a*t+u,h=e.computeRealRoots(1,l,f,d);if(h.length>0){var E,m,_=h[0],T=a-_,p=T*T,y=t/2,R=T/2,A=p-4*o,S=p+4*Math.abs(o),N=c-4*_,M=c+4*Math.abs(_);if(_<0||A*M<N*S){var I=Math.sqrt(N);E=I/2,m=0===I?0:(t*R-i)/I}else{var O=Math.sqrt(A);E=0===O?0:(t*R-i)/O,m=O/2}var g,v;0===y&&0===E?(g=0,v=0):n.sign(y)===n.sign(E)?(g=y+E,v=_/g):(v=y-E,g=_/v);var w,x;0===R&&0===m?(w=0,x=0):n.sign(R)===n.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var C=r.computeRealRoots(1,g,w),P=r.computeRealRoots(1,v,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,d=f*r,h=a*a,E=h*a,m=u*c*f-4*s*d-4*e*l*f+18*e*t*n*d-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+h*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,d=s/t,h=c<0?1:0;switch(h+=l<0?h+1:h,h+=f<0?h+1:h,h+=d<0?h+1:h){case 0:return a(c,l,f,d);case 1:return i(c,l,f,d);case 2:return i(c,l,f,d);case 3:return a(c,l,f,d);case 4:return a(c,l,f,d);case 5:return i(c,l,f,d);case 6:return a(c,l,f,d);case 7:return a(c,l,f,d);case 8:return i(c,l,f,d);case 9:return a(c,l,f,d);case 10:return a(c,l,f,d);case 11:return i(c,l,f,d);case 12:return a(c,l,f,d);case 13:return a(c,l,f,d);case 14:return a(c,l,f,d);case 15:return a(c,l,f,d);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function d(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,p),d=e.dot(u,u),h=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(d,h,E,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function h(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,d=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*d,m=i*(a*h(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),_=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*d+a*n.x+r,T=d*h(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),p=i*(a*h(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),y=[];if(0===p&&0===T){if(l=s.computeRealRoots(E,m,_),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],N=Math.sqrt(Math.max(1-S*S,0));y.push(new e(a,i*S,i*-N)),y.push(new e(a,i*S,i*N))}return y}var M=p*p,I=T*T,O=E*E,g=p*T,v=O+I,w=2*(m*E+g),x=2*_*E+m*m-I+M,C=2*(_*m-g),P=_*_-M;if(0===v&&0===w&&0===x&&0===C)return y;l=c.computeRealRoots(v,w,x,C,P);var U=l.length;if(0===U)return y;for(var D=0;D<U;++D){var F,L=l[D],B=L*L,z=Math.max(1-B,0),b=Math.sqrt(z);F=o.sign(E)===o.sign(_)?h(E*B+_,m*L,o.EPSILON12):o.sign(_)===o.sign(m*L)?h(E*B,m*L+_,o.EPSILON12):h(E*B+m*L,_,o.EPSILON12);var q=h(T*L,p,o.EPSILON15),G=F*q;G<0?y.push(new e(a,i*L,i*b)):G>0?y.push(new e(a,i*L,i*-b)):0!==b?(y.push(new e(a,i*L,i*-b)),y.push(new e(a,i*L,i*b)),++D):y.push(new e(a,i*L,i*b))}return y}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var _=new e,T=new e,p=new e,y=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,d,h=t.origin,E=t.direction,m=e.subtract(a,r,_),A=e.subtract(i,r,T),S=e.cross(E,A,p),N=e.dot(m,S);if(u){if(N<o.EPSILON6)return;if(s=e.subtract(h,r,y),l=e.dot(s,S),l<0||l>N)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>N)return;d=e.dot(A,c)/N}else{if(Math.abs(N)<o.EPSILON6)return;var M=1/N;if(s=e.subtract(h,r,y),l=e.dot(s,S)*M,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*M,f<0||l+f>1)return;d=e.dot(A,c)*M}return d},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=d(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var N=new l;m.lineSegmentSphere=function(t,n,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=d(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var M=new e,I=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,M),f=e.multiplyComponents(c,t.direction,I),d=e.magnitudeSquared(l),h=e.dot(l,f);if(d>1){if(h>=0)return;var E=h*h;if(r=d-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=h*h-o,s=-h+Math.sqrt(u);var m=s/a,_=r/s;return m<_?new i(m,_):{start:_,stop:m}}var T=Math.sqrt(r/a);return new i(T,T)}return d<1?(r=d-1,a=e.magnitudeSquared(f),o=a*r,u=h*h-o,s=-h+Math.sqrt(u),new i(0,s/a)):h<0?(a=e.magnitudeSquared(f),new i(0,-h/a)):void 0};var O=new e,g=new e,v=new e,w=new e,x=new e,C=new u,P=new u,U=new u,D=new u,F=new u,L=new u,B=new u,z=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,O);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,O),f=e.normalize(l,l),d=e.mostOrthogonalAxis(l,w),h=e.normalize(e.cross(d,f,g),g),m=e.normalize(e.cross(f,h,v),v),_=C;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=h.x,_[4]=h.y,_[5]=h.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var T=u.transpose(_,P),p=u.fromScale(n.radii,U),y=u.fromScale(n.oneOverRadii,D),R=F;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,N=u.multiply(u.multiply(T,y,L),R,L),M=u.multiply(u.multiply(N,p,B),_,B),I=u.multiplyByVector(N,a,x),G=E(M,e.negate(I,O),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(p,u.multiplyByVector(_,G[H],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var j=n.cartesianToCartographic(X,q);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-V*V),S=c?-S:S,j.height=S,n.cartographicToCartesian(j,new e)}};var G=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,d;if(1!==l&&2!==l||(f=new e,d=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,d),{positions:[t,n,r,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,d),{positions:[t,n,r,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,d),{positions:[t,n,r,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,d),{positions:[t,n,r,f,d],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,d),{positions:[t,n,r,f,d],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,d),{positions:[t,n,r,f,d],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,n,r,a){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var o=new e;return i.fromCartesian4=function(n,r){var a=e.fromCartesian4(n,o),u=n.w;return t(r)?(e.clone(a,r.normal),r.distance=u,r):new i(a,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return d(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return h(e)}var s,c,l,f,d,h,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],d=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},h=function(e){return m(f,e),e},E=function(e){return e=t(e),d=e.then,E=t,h=T,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,d,h,E,m,_,p,y;if(p=t.length>>>0,c=Math.max(0,Math.min(n,p)),f=[],l=p-c+1,d=[],h=o(),c)for(_=h.progress,m=function(e){d.push(e),--l||(E=m=T,h.reject(d))},E=function(e){f.push(e),--c||(E=m=T,h.resolve(f))},y=0;y<p;++y)y in t&&e(t[y],s,u,_);else h.resolve(f);return h.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),d(e,p).then(t,n,r)}function f(){return d(arguments,p)}function d(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function h(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},y.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r], +null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function T(){}function p(e){return e}var y,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=d,e.reduce=h,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,y=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,d){var h,E,m,_,T;if("%%"==e)return"%";for(var p=!1,y="",R=!1,A=!1,S=" ",N=s.length,M=0;s&&M<N;M++)switch(s.charAt(M)){case" ":y=" ";break;case"+":y="+";break;case"-":p=!0;break;case"'":S=s.charAt(M+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,p=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(d)>-1?6:"d"==d?0:void 0,T=r?t[r.slice(0,-1)]:t[n++],d){case"s":return u(String(T),p,c,f,R,S);case"c":return u(String.fromCharCode(+T),p,c,f,R);case"b":return o(T,2,A,p,c,f,R);case"o":return o(T,8,A,p,c,f,R);case"x":return o(T,16,A,p,c,f,R);case"X":return o(T,16,A,p,c,f,R).toUpperCase();case"u":return o(T,10,A,p,c,f,R);case"i":case"d":return h=+T||0,h=Math.round(h-h%1),E=h<0?"-":y,T=E+a(String(Math.abs(h)),f,"0",!1),i(T,E,p,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return h=+T,E=h<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(d.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(d)%2],T=E+Math.abs(h)[m](f),i(T,E,p,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function d(e,n){y.julianDate=e;var r=m.leapSeconds,a=t(r,y,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function h(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,h(a,t,this),r===c.UTC&&f(this)}var _=new i,T=[31,28,31,30,31,30,31,31,30,31,30,31],p=29,y=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,N=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,O=/^(\d{2})(\.\d+)?/.source+I.source,g=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,v=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(h(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,d=0,_=0,y=0,I=0,w=u[0],x=u[1];if(u=w.match(M),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(N),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var F;if(r(x)){u=x.match(v),null!==u?(d=+u[1],_=+u[2],y=+u[3],I=1e3*+(u[4]||0),F=5):(u=x.match(g),null!==u?(d=+u[1],_=+u[2],y=60*+(u[3]||0),F=4):(u=x.match(O),null!==u&&(d=+u[1],_=60*+(u[2]||0),F=3)));var L=u[F],B=+u[F+1],z=+(u[F+2]||0);switch(L){case"+":d-=B,_-=z;break;case"-":d+=B,_+=z;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,d,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===y;for(b&&y--;_>=60;)_-=60,d++;for(;d>=24;)d-=24,l++;for(a=i&&2===s?p:T[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?p:T[s-1];for(;_<0;)_+=60,d--;for(;d<0;)d+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?p:T[s-1],l+=a;var q=E(n,s,l,d,_,y,I);return r(t)?(h(q[0],q[1],t),f(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=d(e,w);r(a)||(m.addSeconds(e,-1,w),a=d(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var h=80*c/2447|0,E=c-(2447*h/80|0)|0;c=h/11|0;var _=h+2-12*c|0,T=100*(l-49)+f+c|0,p=u/s.SECONDS_PER_HOUR|0,y=u-p*s.SECONDS_PER_HOUR,R=y/s.SECONDS_PER_MINUTE|0;y-=R*s.SECONDS_PER_MINUTE;var A=0|y,S=(y-A)/s.SECONDS_PER_MILLISECOND;return p+=12,p>23&&(p-=24),n&&(A+=1),r(t)?(t.year=T,t.month=_,t.day=E,t.hour=p,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(T,_,E,p,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return h(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return h(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return h(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return h(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,d){var h=f.exec(e);if(null!==h)return void c.resolve(l(h,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(d)&&n(E.overrideMimeType)&&E.overrideMimeType(d),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function d(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function h(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),d=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||d<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,T=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=d,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var p,y=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],N=_[R+m],M=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(M,N,f.TAI);if(T.push(I),y){if(N!==p&&r(p)){var O=o.leapSeconds,g=t(O,I,h);if(g<0){var v=new u(I,N);O.splice(~g,0,v)}}p=N}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function T(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),d=a*s,h=i*s,E=n[d+e._ut1MinusUtcSecondsColumn],T=n[h+e._ut1MinusUtcSecondsColumn],p=T-E;if(p>.5||p<-.5){var y=n[d+e._taiMinusUtcSecondsColumn],R=n[h+e._taiMinusUtcSecondsColumn];y!==R&&(l.equals(r)?E=T:T-=R-y)}return u.xPoleWander=_(f,n[d+e._xPoleWanderRadiansColumn],n[h+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[d+e._yPoleWanderRadiansColumn],n[h+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[h+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[h+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,E,T),u}return d.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),d.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},d.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],d=i[u+1],h=o.lessThanOrEquals(f,e),E=!r(d),m=E||o.greaterThanOrEquals(d,e);if(h&&m)return s=u,!E&&d.equals(e)&&++s,l=s+1,T(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,T(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},d}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){if(i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),"data"===r.scheme)return r.toString();if("data"===a.scheme)return a.toString();n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(d)||(d=t(i.toUrl)?s:c),t(h)||(h=document.createElement("a"));var n=d(e);return h.href=n,h.href=h.href,h.href}var f,d,h,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,d=s/this._samplesPerXysFile|0,h=[],E=f;E<=d;++E)h.push(l(this,E));return e.all(h)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var d=!1,h=this._samples;if(r(h[3*s])||(l(this,s/this._samplesPerXysFile|0),d=!0),r(h[3*f])||(l(this,f/this._samplesPerXysFile|0),d=!0),!d){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,_=i-s*this._stepSizeDays,T=this._work,p=this._denominators,y=this._coef,R=this._xTable;for(E=0;E<=u;++E)T[E]=_-R[E];for(E=0;E<=u;++E){for(y[E]=1,m=0;m<=u;++m)m!==E&&(y[E]*=T[m]);y[E]*=p[E];var A=3*(s+E);n.x+=y[E]*h[A++],n.y+=y[E]*h[A++],n.s+=y[E]*h[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!d())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(N)&&(N=!1,!a()&&!d()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,M=r(e[1]))}return N}function u(){return o()&&M}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,O=r(e[1]),O.isNightly=!!e[2])}return I}function c(){return s()&&O}function l(){if(!t(g)){g=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,v=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,v=r(e[1])))}return g}function f(){return l()&&v}function d(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function h(){return d()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return E()&&P}function T(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function p(){if(!t(L)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;L=t(n)&&""!==n,L&&(F=n)}return L}function y(){return p()?F:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,N,M,I,O,g,v,w,x,C,P,U,D,F,L,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:d, +edgeVersion:h,isFirefox:E,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:T,supportsImageRenderingPixelated:p,imageRenderingValue:y};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,d=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=d,a):new l(u,s,c,d)};var d=[1,2,0],h=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+f+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var _=d,T=0;f>s&&(T=1),E>s&&E>f&&(T=2);var p=_[T],y=_[p];n=Math.sqrt(e[c.getElementIndex(T,T)]-e[c.getElementIndex(p,p)]-e[c.getElementIndex(y,y)]+1);var R=h;R[T]=.5*n,n=.5/n,u=(e[c.getElementIndex(y,p)]-e[c.getElementIndex(p,y)])*n,R[p]=(e[c.getElementIndex(p,T)]+e[c.getElementIndex(T,p)])*n,R[y]=(e[c.getElementIndex(y,T)]+e[c.getElementIndex(T,y)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,_=new l,T=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),T=l.fromAxisAngle(e.UNIT_X,o.roll,E),_=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(_,T,_),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var p=new e,y=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,p);var u=l.computeAngle(R);r[o]=p.x*u,r[o+1]=p.y*u,r[o+2]=p.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,y);var u=e.magnitude(y);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(y,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,d=o*s-r*c+a*l+i*u,h=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=d,n.z=h,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var N=new l;l.lerp=function(e,t,n,r){return N=l.multiplyByScalar(t,n,N),r=l.multiplyByScalar(e,1-n,r),l.add(N,r,r)};var M=new l,I=new l,O=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=M=l.negate(t,M)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return I=l.multiplyByScalar(e,Math.sin((1-n)*o),I),O=l.multiplyByScalar(i,Math.sin(n*o),O),r=l.add(I,O,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var g=new e,v=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,g);l.multiply(i,t,x);var u=l.log(x,v);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],D=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;U[B]=1/(z*b),D[B]=z/b}return U[7]=P/136,D[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)F[f]=(U[f]*s-D[f])*o,L[f]=(U[f]*c-D[f])*o;var d=a*n*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),h=u*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),E=l.multiplyByScalar(e,h,C);return l.multiplyByScalar(t,d,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m,_,T,p,y,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},N={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},M={},I={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},O=new n,g=new n,v=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(M[i])?r=M[i]:(r=function(r,i,s){if(u(s)||(s=new p),_.equalsEpsilon(r.x,0,_.EPSILON14)&&_.equalsEpsilon(r.y,0,_.EPSILON14)){var c=_.sign(r.z);n.unpack(N[e],0,O),"east"!==e&&"west"!==e&&n.multiplyByScalar(O,c,O),n.unpack(N[t],0,g),"east"!==t&&"west"!==t&&n.multiplyByScalar(g,c,g),n.unpack(N[a],0,v),"east"!==a&&"west"!==a&&n.multiplyByScalar(v,c,v)}else{i=o(i,d.WGS84),i.geodeticSurfaceNormal(r,I.up);var l=I.up,f=I.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,I.east),n.cross(l,f,I.north),n.multiplyByScalar(I.up,-1,I.down),n.multiplyByScalar(I.east,-1,I.west),n.multiplyByScalar(I.north,-1,I.south),O=I[e],g=I[t],v=I[a]}return s[0]=O.x,s[1]=O.y,s[2]=O.z,s[3]=0,s[4]=g.x,s[5]=g.y,s[6]=g.z,s[7]=0,s[8]=v.x,s[9]=v.y,s[10]=v.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},M[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new y,x=new n(1,1,1),C=new p;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof p&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=y.fromHeadingPitchRoll(t,w),c=p.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),p.multiply(i,c,i)};var P=new p,U=new T;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof y&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=p.getRotation(i,U);return y.fromRotationMatrix(o,a)};var D=24110.54841,F=8640184.812866,L=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,q=_.TWO_PI/86400,G=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(F+n*(L+n*B)),s=o*q%_.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,d=Math.cos(f),h=Math.sin(f);return u(t)?(t[0]=d,t[1]=-h,t[2]=0,t[3]=h,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new T(d,h,0,-h,d,0,0,0,1)},A.iau2006XysData=new h,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new T);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return T.transpose(n,t)};var V=new E(0,0,0),H=new f(0,0,0,0,0,0),Y=new T,k=new T;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new T);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=T.fromRotationZ(-i.s,k),d=T.multiply(l,f,Y),h=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,p=h-2451545,y=E/R.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(p+y);S=S%1*_.TWO_PI;var N=T.fromRotationZ(S,k),M=T.multiply(d,N,Y),I=Math.cos(n.xPoleWander),O=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),v=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*_.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=k;return U[0]=I*C,U[1]=I*P,U[2]=g,U[3]=-O*P+v*g*C,U[4]=O*C+v*g*P,U[5]=-v*I,U[6]=-v*P-O*g*C,U[7]=v*C-O*g*P,U[8]=O*I,T.multiply(M,U,t)}}};var j=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=j;return p.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),p.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var Z=new n,K=new n,Q=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,d.WGS84).geodeticSurfaceNormal(e,Z),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,Q);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new T),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new p(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new n,te=new n,ne=new T,re=new p,ae=new p;return A.basisTo2D=function(e,t,r){var a=p.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);n.fromElements(u.z,u.x,u.y,u);var s=A.eastNorthUpToFixedFrame(a,i,re),c=p.inverseTransformation(s,ae),l=p.getRotation(t,ne),f=p.multiplyByMatrix3(c,l,r);return p.multiply(J,f,r),p.setTranslation(r,u,r),r},A.wgs84To2DModelMatrix=function(e,t,r){var a=e.ellipsoid,i=A.eastNorthUpToFixedFrame(t,a,re),o=p.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);n.fromElements(s.z,s.x,s.y,s);var c=p.fromTranslation(s,re);return p.multiply(J,o,r),p.multiply(c,r,r),r},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=h.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var T=new d,p=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=T;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,p);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,p)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=T;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,p);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,p));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var y=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=y,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var d=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(d,c,d),a.scaleToGeocentricSurface(d,d)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=d.clone(a(t,d.ZERO))}function _(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;d.setColumn(l,0,e.xAxis,l),d.setColumn(l,1,e.yAxis,l),d.setColumn(l,2,e.zAxis,l);var f=I;f.x=(t+r)/2,f.y=(a+o)/2,f.z=(u+s)/2;var h=O;h.x=(r-t)/2,h.y=(o-a)/2,h.z=(s-u)/2;var E=c.center;return f=d.multiplyByVector(l,f,f),n.add(e.origin,f,E),d.multiplyByScale(l,h,l),c}var T=new n,p=new n,y=new n,R=new n,A=new n,S=new n,N=new d,M={unitary:new d,diagonal:new d};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=d.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],T);for(r=1;r<a;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,f=0,h=0,E=0,_=0;for(r=0;r<a;r++)s=n.subtract(e[r],o,p),c+=s.x*s.x,l+=s.x*s.y,f+=s.x*s.z,h+=s.y*s.y,E+=s.y*s.z,_+=s.z*s.z;c*=u,l*=u,f*=u,h*=u,E*=u,_*=u;var I=N;I[0]=c,I[1]=l,I[2]=f,I[3]=l,I[4]=h,I[5]=E,I[6]=f,I[7]=E,I[8]=_;var O=d.computeEigenDecomposition(I,M),g=d.clone(O.unitary,t.halfAxes),v=d.getColumn(g,0,R),w=d.getColumn(g,1,A),x=d.getColumn(g,2,S),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,F=Number.MAX_VALUE,L=Number.MAX_VALUE;for(r=0;r<a;r++)s=e[r],C=Math.max(n.dot(v,s),C),P=Math.max(n.dot(w,s),P),U=Math.max(n.dot(x,s),U),D=Math.min(n.dot(v,s),D),F=Math.min(n.dot(w,s),F),L=Math.min(n.dot(x,s),L);v=n.multiplyByScalar(v,.5*(D+C),v),w=n.multiplyByScalar(w,.5*(F+P),w),x=n.multiplyByScalar(x,.5*(L+U),x);var B=n.add(v,w,t.center);n.add(B,x,B);var z=y;return z.x=C-D,z.y=P-F,z.z=U-L,n.multiplyByScalar(z,.5,z),d.multiplyByScale(t.halfAxes,z,t.halfAxes),t};var I=new n,O=new n,g=new r,v=new n,w=[new r,new r,new r,new r,new r,new r,new r,new r],x=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,i){t=a(t,0),n=a(n,0),r=a(r,u.WGS84);var o=E.center(e,g),c=r.cartographicToCartesian(o,v),l=new s(c,r),f=l.plane,d=w[0],m=w[1],T=w[2],p=w[3],y=w[4],R=w[5],A=w[6],S=w[7],N=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=y.latitude=e.south,S.latitude=p.latitude=M,d.latitude=m.latitude=T.latitude=e.north,A.longitude=S.longitude=d.longitude=e.west,R.longitude=m.longitude=N,y.longitude=p.longitude=T.longitude=e.east,T.height=m.height=d.height=S.height=A.height=R.height=y.height=p.height=n,r.cartographicArrayToCartesianArray(w,x),l.projectPointsToNearestOnPlane(x,C);var I=Math.min(C[6].x,C[7].x,C[0].x),O=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);T.height=d.height=y.height=A.height=t,r.cartographicArrayToCartesianArray(w,x);var D=Math.min(h.getPointDistance(f,x[0]),h.getPointDistance(f,x[2]),h.getPointDistance(f,x[4]),h.getPointDistance(f,x[6])),F=n;return _(l,I,O,P,U,D,F,i)},m.clone=function(e,t){if(i(e))return i(t)?(n.clone(e.center,t.center),d.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,a=t.normal,i=e.halfAxes,o=a.x,u=a.y,s=a.z,l=Math.abs(o*i[d.COLUMN0ROW0]+u*i[d.COLUMN0ROW1]+s*i[d.COLUMN0ROW2])+Math.abs(o*i[d.COLUMN1ROW0]+u*i[d.COLUMN1ROW1]+s*i[d.COLUMN1ROW2])+Math.abs(o*i[d.COLUMN2ROW0]+u*i[d.COLUMN2ROW1]+s*i[d.COLUMN2ROW2]),f=n.dot(a,r)+t.distance;return f<=-l?c.OUTSIDE:f>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,F=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,I),a=e.halfAxes,i=d.getColumn(a,0,P),o=d.getColumn(a,1,U),u=d.getColumn(a,2,D),s=n.magnitude(i),c=n.magnitude(o),l=n.magnitude(u);n.normalize(i,i),n.normalize(o,o),n.normalize(u,u);var f=F;f.x=n.dot(r,i),f.y=n.dot(r,o),f.z=n.dot(r,u);var h,E=0;return f.x<-s?(h=f.x+s,E+=h*h):f.x>s&&(h=f.x-s,E+=h*h),f.y<-c?(h=f.y+c,E+=h*h):f.y>c&&(h=f.y-c,E+=h*h),f.z<-l?(h=f.z+l,E+=h*h):f.z>l&&(h=f.z-l,E+=h*h),E};var L=new n,B=new n;m.computePlaneDistances=function(e,t,r,a){i(a)||(a=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,f=d.getColumn(c,0,P),h=d.getColumn(c,1,U),E=d.getColumn(c,2,D),m=n.add(f,h,L);n.add(m,E,m),n.add(m,s,m);var _=n.subtract(m,t,B),T=n.dot(r,_);return o=Math.min(T,o),u=Math.max(T,u),n.add(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),T=n.dot(r,_),o=Math.min(T,o),u=Math.max(T,u),n.add(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),T=n.dot(r,_),o=Math.min(T,o),u=Math.max(T,u),n.add(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),T=n.dot(r,_),o=Math.min(T,o),u=Math.max(T,u),n.subtract(s,f,m),n.add(m,h,m),n.add(m,E,m),n.subtract(m,t,_),T=n.dot(r,_),o=Math.min(T,o),u=Math.max(T,u),n.subtract(s,f,m),n.add(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),T=n.dot(r,_),o=Math.min(T,o),u=Math.max(T,u),n.subtract(s,f,m),n.subtract(m,h,m),n.add(m,E,m),n.subtract(m,t,_),T=n.dot(r,_),o=Math.min(T,o),u=Math.max(T,u),n.subtract(s,f,m),n.subtract(m,h,m),n.subtract(m,E,m),n.subtract(m,t,_),T=n.dot(r,_),o=Math.min(T,o),u=Math.max(T,u),a.start=o,a.stop=u,a};var z=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,z);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||i(e)&&i(t)&&n.equals(e.center,t.center)&&d.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,o,c,d){var _,T,p,y;if(i(e)&&i(t)&&i(r)&&i(o)){var R=e.minimum,A=e.maximum,S=n.subtract(A,R,f),N=r-t,M=Math.max(n.maximumComponent(S),N);_=M<m-1?s.BITS12:s.NONE,T=e.center,p=u.inverseTransformation(o,new u);var I=n.negate(R,l);u.multiply(u.fromTranslation(I,h),p,p);var O=l;O.x=1/S.x,O.y=1/S.y,O.z=1/S.z,u.multiply(u.fromScale(O,h),p,p),y=u.clone(o),u.setTranslation(y,n.ZERO,y),o=u.clone(o,new u);var g=u.fromTranslation(R,h),v=u.fromScale(S,E),w=u.multiply(g,v,h);u.multiply(o,w,o),u.multiply(y,w,y)}this.quantization=_,this.minimumHeight=t,this.maximumHeight=r,this.center=T,this.toScaledENU=p,this.fromScaledENU=o,this.matrix=y,this.hasVertexNormals=c,this.hasWebMercatorT=a(d,!1)}var l=new n,f=new n,d=new t,h=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,i,c,f,h,E){var m=c.x,_=c.y;if(this.quantization===s.BITS12){i=u.multiplyByPoint(this.toScaledENU,i,l),i.x=o.clamp(i.x,0,1),i.y=o.clamp(i.y,0,1),i.z=o.clamp(i.z,0,1);var T=this.maximumHeight-this.minimumHeight,p=o.clamp((f-this.minimumHeight)/T,0,1);t.fromElements(i.x,i.y,d);var y=e.compressTextureCoordinates(d);t.fromElements(i.z,p,d);var R=e.compressTextureCoordinates(d);t.fromElements(m,_,d);var A=e.compressTextureCoordinates(d);if(r[a++]=y,r[a++]=R,r[a++]=A,this.hasWebMercatorT){t.fromElements(E,0,d);var S=e.compressTextureCoordinates(d);r[a++]=S}}else n.subtract(i,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=f,r[a++]=m,r[a++]=_,this.hasWebMercatorT&&(r[a++]=E);return this.hasVertexNormals&&(r[a++]=e.octPackFloat(h)),a},c.prototype.decodePosition=function(t,r,a){if(i(a)||(a=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],d);a.x=o.x,a.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],d);return a.z=c.x,u.multiplyByPoint(this.fromScaledENU,a,a)}return a.x=t[r],a.y=t[r+1],a.z=t[r+2],n.add(a,this.center,a)},c.prototype.decodeTextureCoordinates=function(n,r,a){return i(a)||(a=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],a):t.fromElements(n[r+4],n[r+5],a)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){var r=e.decompressTextureCoordinates(t[n+1],d);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var a=this.getStride();n=(n+1)*a-1;var i=e[n]/256,o=Math.floor(i),u=256*(i-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var _={position3DAndHeight:0,textureCoordAndEncodedNormals:1},T={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,n=r.FLOAT,a=r.getSizeInBytes(n);if(this.quantization===s.NONE){var i=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(i+o)*a,[{index:_.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:t},{index:_.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:i*a,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*a,[{index:T.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:T.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*a,strideInBytes:t}]):[{index:T.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?_:T},c.clone=function(e,t){return i(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/WebMercatorProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(s.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),s.mercatorAngleToGeodeticLatitude=function(e){return u.PI_OVER_TWO-2*Math.atan(Math.exp(-e))},s.geodeticLatitudeToMercatorAngle=function(e){e>s.MaximumLatitude?e=s.MaximumLatitude:e<-s.MaximumLatitude&&(e=-s.MaximumLatitude);var t=Math.sin(e);return.5*Math.log((1+t)/(1-t))},s.MaximumLatitude=s.mercatorAngleToGeodeticLatitude(Math.PI),s.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=s.geodeticLatitudeToMercatorAngle(t.latitude)*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},s.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=s.mercatorAngleToGeodeticLatitude(e.y*a),u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},s}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,a=t.message;n=e(r)&&e(a)?r+": "+a:t.toString();var i=t.stack;return e(i)&&(n+="\n"+i),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){"use strict";function r(r){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)), +s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return r}),define("Workers/createVerticesFromQuantizedTerrainMesh",["../Core/AttributeCompression","../Core/AxisAlignedBoundingBox","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/Ellipsoid","../Core/IndexDatatype","../Core/Math","../Core/Matrix4","../Core/OrientedBoundingBox","../Core/TerrainEncoding","../Core/Transforms","../Core/WebMercatorProjection","./createTaskProcessorWorker"],function(e,t,n,r,a,i,o,u,s,c,l,f,d,h,E,m){"use strict";function _(i,m){var _,v,w=i.quantizedVertices,x=w.length/3,C=i.octEncodedNormals,P=i.westIndices.length+i.eastIndices.length+i.southIndices.length+i.northIndices.length,U=i.includeWebMercatorT,D=i.rectangle,F=D.west,L=D.south,B=D.east,z=D.north,b=u.clone(i.ellipsoid),q=i.exaggeration,G=i.minimumHeight*q,W=i.maximumHeight*q,X=i.relativeToCenter,V=h.eastNorthUpToFixedFrame(X,b),H=l.inverseTransformation(V,new l);U&&(_=E.geodeticLatitudeToMercatorAngle(L),v=1/(E.geodeticLatitudeToMercatorAngle(z)-_));var Y=w.subarray(0,x),k=w.subarray(x,2*x),j=w.subarray(2*x,3*x),Z=o(C),K=new Array(x),Q=new Array(x),J=new Array(x),$=U?new Array(x):[],ee=A;ee.x=Number.POSITIVE_INFINITY,ee.y=Number.POSITIVE_INFINITY,ee.z=Number.POSITIVE_INFINITY;var te=S;te.x=Number.NEGATIVE_INFINITY,te.y=Number.NEGATIVE_INFINITY,te.z=Number.NEGATIVE_INFINITY;for(var ne=Number.POSITIVE_INFINITY,re=Number.NEGATIVE_INFINITY,ae=Number.POSITIVE_INFINITY,ie=Number.NEGATIVE_INFINITY,oe=0;oe<x;++oe){var ue=Y[oe]/y,se=k[oe]/y,ce=c.lerp(G,W,j[oe]/y);N.longitude=c.lerp(F,B,ue),N.latitude=c.lerp(L,z,se),N.height=ce,ne=Math.min(N.longitude,ne),re=Math.max(N.longitude,re),ae=Math.min(N.latitude,ae),ie=Math.max(N.latitude,ie);var le=b.cartographicToCartesian(N);K[oe]=new r(ue,se),Q[oe]=ce,J[oe]=le,U&&($[oe]=(E.geodeticLatitudeToMercatorAngle(N.latitude)-_)*v),l.multiplyByPoint(H,le,R),a.minimumByComponent(R,ee,ee),a.maximumByComponent(R,te,te)}var fe,de;1!==q&&(de=n.fromPoints(J),fe=f.fromRectangle(D,G,W,b));var he=G;he=Math.min(he,T(i.westIndices,i.westSkirtHeight,Q,K,D,b,H,ee,te)),he=Math.min(he,T(i.southIndices,i.southSkirtHeight,Q,K,D,b,H,ee,te)),he=Math.min(he,T(i.eastIndices,i.eastSkirtHeight,Q,K,D,b,H,ee,te)),he=Math.min(he,T(i.northIndices,i.northSkirtHeight,Q,K,D,b,H,ee,te));for(var Ee=new t(ee,te,X),me=new d(Ee,he,W,V,Z,U),_e=me.getStride(),Te=x*_e+P*_e,pe=new Float32Array(Te),ye=0,Re=0;Re<x;++Re){if(Z){var Ae=2*Re;if(M.x=C[Ae],M.y=C[Ae+1],1!==q){var Se=e.octDecode(M.x,M.y,I),Ne=h.eastNorthUpToFixedFrame(J[Re],b,g),Me=l.inverseTransformation(Ne,O);l.multiplyByPointAsVector(Me,Se,Se),Se.z*=q,a.normalize(Se,Se),l.multiplyByPointAsVector(Ne,Se,Se),a.normalize(Se,Se),e.octEncode(Se,M)}}ye=me.encode(pe,ye,J[Re],K[Re],Q[Re],M,$[Re])}var Ie=Math.max(0,2*(P-4)),Oe=i.indices.length+3*Ie,ge=s.createTypedArray(x+P,Oe);ge.set(i.indices,0);var ve=1e-4,we=(re-ne)*ve,xe=(ie-ae)*ve,Ce=-we,Pe=0,Ue=we,De=0,Fe=0,Le=xe,Be=0,ze=-xe,be=x*_e,qe=i.indices.length;return qe=p(pe,be,ge,qe,i.westIndices,me,Q,K,C,b,D,i.westSkirtHeight,!0,q,_,v,Ce,Pe),be+=i.westIndices.length*_e,qe=p(pe,be,ge,qe,i.southIndices,me,Q,K,C,b,D,i.southSkirtHeight,!1,q,_,v,Be,ze),be+=i.southIndices.length*_e,qe=p(pe,be,ge,qe,i.eastIndices,me,Q,K,C,b,D,i.eastSkirtHeight,!1,q,_,v,Ue,De),be+=i.eastIndices.length*_e,p(pe,be,ge,qe,i.northIndices,me,Q,K,C,b,D,i.northSkirtHeight,!0,q,_,v,Fe,Le),m.push(pe.buffer,ge.buffer),{vertices:pe.buffer,indices:ge.buffer,vertexStride:_e,center:X,minimumHeight:G,maximumHeight:W,boundingSphere:de,orientedBoundingBox:fe,encoding:me,skirtIndex:i.indices.length}}function T(e,t,n,r,i,o,u,s,f){var d=Number.POSITIVE_INFINITY,h=i.north,E=i.south,m=i.east,_=i.west;m<_&&(m+=c.TWO_PI);for(var T=e.length,p=0;p<T;++p){var y=e[p],A=n[y],S=r[y];N.longitude=c.lerp(_,m,S.x),N.latitude=c.lerp(E,h,S.y),N.height=A-t;var M=o.cartographicToCartesian(N,R);l.multiplyByPoint(u,M,M),a.minimumByComponent(M,s,s),a.maximumByComponent(M,f,f),d=Math.min(d,N.height)}return d}function p(t,n,r,i,u,s,f,d,m,_,T,p,y,A,S,v,w,x){var C,P,U;y?(C=u.length-1,P=-1,U=-1):(C=0,P=u.length,U=1);var D=-1,F=o(m),L=s.getStride(),B=n/L,z=T.north,b=T.south,q=T.east,G=T.west;q<G&&(q+=c.TWO_PI);for(var W=C;W!==P;W+=U){var X=u[W],V=f[X],H=d[X];N.longitude=c.lerp(G,q,H.x)+w,N.latitude=c.lerp(b,z,H.y)+x,N.height=V-p;var Y=_.cartographicToCartesian(N,R);if(F){var k=2*X;if(M.x=m[k],M.y=m[k+1],1!==A){var j=e.octDecode(M.x,M.y,I),Z=h.eastNorthUpToFixedFrame(R,_,g),K=l.inverseTransformation(Z,O);l.multiplyByPointAsVector(K,j,j),j.z*=A,a.normalize(j,j),l.multiplyByPointAsVector(Z,j,j),a.normalize(j,j),e.octEncode(j,M)}}var Q;s.hasWebMercatorT&&(Q=(E.geodeticLatitudeToMercatorAngle(N.latitude)-S)*v),n=s.encode(t,n,Y,H,N.height,M,Q),D!==-1&&(r[i++]=D,r[i++]=B-1,r[i++]=X,r[i++]=B-1,r[i++]=B,r[i++]=X),D=X,++B}return i}var y=32767,R=new a,A=new a,S=new a,N=new i,M=new r,I=new a,O=new l,g=new l;return m(_)})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createWallGeometry.js b/engines/Cesium/Workers/createWallGeometry.js index 39a37f6..2fbf8b5 100644 --- a/engines/Cesium/Workers/createWallGeometry.js +++ b/engines/Cesium/Workers/createWallGeometry.js @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,m=a.z,_=l*l*d*d,p=f*f*E*E,y=h*h*m*m,T=_+p+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,O=o;O.x=A.x*S*2,O.y=A.y*v*2,O.z=A.z*N*2;var g,I,M,w,x,C,P,U,D,L,F,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{B-=z,M=1/(1+B*S),w=1/(1+B*v),x=1/(1+B*N),C=M*M,P=w*w,U=x*x,D=C*M,L=P*w,F=U*x,g=_*C+p*P+y*U-1,I=_*D*S+p*L*v+y*F*N;var b=-2*I;z=g/b}while(Math.abs(g)>r.EPSILON12);return t(c)?(c.x=l*M,c.y=f*w,c.z=h*x,c):new e(l*M,f*w,h*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:h,_=n(r)?r._centerToleranceSquared:d,p=o(t,E,m,_,c);if(n(p)){var y=e.multiplyComponents(p,m,s);y=e.normalize(y,y);var T=e.subtract(t,p,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],h=m[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,_=e[s.getElementIndex(h,h)],p=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(h,f)],T=(_-p)/2/y;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=n-u-f+d,m=2*(a-h),_=2*(i+l),p=2*(a+h),y=-n+u-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+d;return r(t)?(t[0]=E,t[1]=p,t[2]=R,t[3]=m,t[4]=y,t[5]=A,t[6]=_,t[7]=T,t[8]=S,t):new s(E,m,_,p,y,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,E=i*a+c*o*u,m=-o*i+i*o*u,_=-o,p=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=_,t[3]=f,t[4]=E,t[5]=p,t[6]=h,t[7]=m,t[8]=y,t):new s(l,f,h,d,E,m,_,p,y)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],_=new s,p=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)f(d,_),s.transpose(_,p),s.multiply(d,_,d),s.multiply(p,d,d),s.multiply(h,_,h),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){ -"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,h,d,E,m,_){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(_,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,m=t.y*t.w,_=t.z*t.z,p=t.z*t.w,y=t.w*t.w,T=s-d-_+y,R=2*(c-p),A=2*(f+m),S=2*(c+p),v=-s+d-_+y,N=2*(E-h),O=2*(f-m),g=2*(E+h),I=-s-d+_+y;return r[0]=T*i,r[1]=S*i,r[2]=O*i,r[3]=0,r[4]=R*o,r[5]=v*o,r[6]=g*o,r[7]=0,r[8]=A*u,r[9]=N*u,r[10]=I*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,E=f.x,m=f.y,_=f.z,p=d.x,y=d.y,T=d.z,R=r.x,A=r.y,S=r.z,v=u*-R+s*-A+c*-S,N=p*-R+y*-A+T*-S,O=E*R+m*A+_*S;return a(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-_,n[11]=0,n[12]=v,n[13]=N,n[14]=O,n[15]=1,n):new l(u,s,c,v,p,y,T,N,-E,-m,-_,O,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,E=f,m=i+c,_=o+l,p=t+f,y=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=p,a[15]=y,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],m=e[12],_=e[13],p=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],O=t[6],g=t[7],I=t[8],M=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+m*S,F=a*T+s*R+h*A+_*S,B=i*T+c*R+d*A+p*S,z=o*T+l*R+E*A+y*S,b=r*v+u*N+f*O+m*g,G=a*v+s*N+h*O+_*g,q=i*v+c*N+d*O+p*g,W=o*v+l*N+E*O+y*g,X=r*I+u*M+f*w+m*x,H=a*I+s*M+h*w+_*x,V=i*I+c*M+d*w+p*x,Y=o*I+l*M+E*w+y*x,k=r*C+u*P+f*U+m*D,Z=a*C+s*P+h*U+_*D,j=i*C+c*P+d*U+p*D,K=o*C+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=H,n[10]=V,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],m=t[0],_=t[1],p=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],O=t[13],g=t[14],I=r*m+o*_+c*p,M=a*m+u*_+l*p,w=i*m+s*_+f*p,x=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,U=r*A+o*S+c*v,D=a*A+u*S+l*v,L=i*A+s*S+f*v,F=r*N+o*O+c*g+h,B=a*N+u*O+l*g+d,z=i*N+s*O+f*g+E;return n[0]=I,n[1]=M,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],m=t[3],_=t[4],p=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,S=a*h+u*d+l*E,v=i*h+s*d+f*E,N=r*m+o*_+c*p,O=a*m+u*_+l*p,g=i*m+s*_+f*p,I=r*y+o*T+c*R,M=a*y+u*T+l*R,w=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=O,n[6]=g,n[7]=0,n[8]=I,n[9]=M,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var p=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,p),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],E=e[13],m=e[2],_=e[6],A=e[10],S=e[14],v=e[3],N=e[7],O=e[11],g=e[15],I=A*g,M=S*O,w=_*g,x=S*N,C=_*O,P=A*N,U=m*g,D=S*v,L=m*O,F=A*v,B=m*N,z=_*v,b=I*h+x*d+C*E-(M*h+w*d+P*E),G=M*f+U*d+F*E-(I*f+D*d+L*E),q=w*f+D*h+B*E-(x*f+U*h+z*E),W=P*f+L*h+z*d-(C*f+F*h+B*d),X=M*a+w*i+P*o-(I*a+x*i+C*o),H=I*r+D*i+L*o-(M*r+U*i+F*o),V=x*r+U*a+z*o-(w*r+D*a+B*o),Y=C*r+F*a+B*i-(P*r+L*a+z*i);I=i*E,M=o*d,w=a*E,x=o*h,C=a*d,P=i*h,U=r*E,D=o*f,L=r*d,F=i*f,B=r*h,z=a*f;var k=I*N+x*O+C*g-(M*N+w*O+P*g),Z=M*v+U*O+F*g-(I*v+D*O+L*g),j=w*v+D*N+B*g-(x*v+U*N+z*g),K=P*v+L*N+z*O-(C*v+F*N+B*O),J=w*A+P*S+M*_-(C*S+I*_+x*A),Q=L*S+I*m+D*A-(U*A+F*S+M*m),$=U*_+z*S+x*m-(B*S+w*m+D*_),ee=B*A+C*m+F*_-(L*_+z*A+P*m),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=H*te,n[6]=V*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,m=-i*f-o*h-u*d,_=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:h>0?m.latitude=h:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,m=new e,_=new e,p=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,_),c=e.clone(r,p),l=e.clone(r,y),f=t.length,O=1;O<f;O++){e.clone(t[O],r);var g=r.x,I=r.y,M=r.z;g<i.x&&e.clone(r,i),g>s.x&&e.clone(r,s),I<o.y&&e.clone(r,o),I>c.y&&e.clone(r,c),M<u.z&&e.clone(r,u),M>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),B=Math.sqrt(F),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,R),.5,N),q=0;for(O=0;O<f;O++){e.clone(t[O],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var H=Math.sqrt(X);B=.5*(B+H),F=B*B;var V=H-B;L.x=(B*L.x+V*r.x)/H,L.y=(B*L.y+V*r.y)/H,L.z=(B*L.z+V*r.z)/H}}return B<q?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var O=new o,g=new e,I=new e,M=new t,w=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,O),f.southwest(t,M),M.height=i,f.northeast(t,w),w.height=o;var s=n.project(M,g),c=n.project(w,I),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*d,m.z=s.z+.5*E,u};var x=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,_),O=e.clone(u,p),g=e.clone(u,y),I=t.length,M=0;M<I;M+=i){var w=t[M]+n.x,x=t[M+1]+n.y,C=t[M+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>O.y&&e.clone(u,O),C<l.z&&e.clone(u,l),C>g.z&&e.clone(u,g)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(O,c,R)),D=e.magnitudeSquared(e.subtract(g,l,R)),L=s,F=f,B=P;U>B&&(B=U,L=c,F=O),D>B&&(B=D,L=l,F=g);var z=A;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=O.y,W.z=g.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),H=0;for(M=0;M<I;M+=i){u.x=t[M]+n.x,u.y=t[M+1]+n.y,u.z=t[M+2]+n.z;var V=e.magnitude(e.subtract(u,X,R));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);G=.5*(G+k),b=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<H?(e.clone(z,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,p),f=e.clone(i,y),O=t.length,g=0;g<O;g+=3){var I=t[g]+n[g],M=t[g+1]+n[g+1],w=t[g+2]+n[g+2];i.x=I,i.y=M,i.z=w,I<o.x&&e.clone(i,o),I>c.x&&e.clone(i,c),M<u.y&&e.clone(i,u),M>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=x;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,F,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(g=0;g<O;g+=3){i.x=t[g]+n[g],i.y=t[g+1]+n[g+1],i.z=t[g+2]+n[g+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>B){var V=Math.sqrt(H);z=.5*(z+V),B=z*z;var Y=V-z;F.x=(z*F.x+Y*i.x)/V,F.y=(z*F.y+Y*i.y)/V,F.z=(z*F.z+Y*i.z)/V}}return z<W?(e.clone(F,r.center),r.radius=z):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var B=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,H=new e,V=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,H),d=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,d,m),m=E[2],e.add(s,f,m),e.add(m,d,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,d,m),m=E[6],e.add(s,f,m),e.add(m,d,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var _=E.length,p=0;p<_;++p){var y=E[p];e.add(o,y,y);var T=i.cartesianToCartographic(y,V);n.project(T,y)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(v)&&(v=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(O=!0,g=r(e[1]),g.isNightly=!!e[2])}return O}function c(){return s()&&g}function l(){if(!t(I)){I=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(I=!0,M=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(I=!0,M=r(e[1])))}return I}function f(){return l()&&M}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function d(){return h()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent); -null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return E()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,O,g,I,M,w,x,C,P,U,D,L,F,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:y,imageRenderingValue:T};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,m=d.y,_=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var p=r.minimum;p.x=a,p.y=o,p.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(p,y,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,m=o*c-u*s,_=u*c-d,p=4*E*_-m*m;if(p<0){var y,T,R;h*f>=l*d?(y=o,T=E,R=-2*u*E+o*m):(y=c,T=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);i=-R+S;var v=i/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),O=i===S?-N:-T/N;return a=T<=0?N+O:-R/(N*N+O*O+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var g=E,I=-2*u*E+o*m,M=_,w=-c*m+2*s*_,x=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-I)/3);a=2*Math.sqrt(-g);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-M),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=i+D<2*s?i+s:D+s,G=z/b,q=F*b,W=-L*b-F*z,X=L*z,H=(s*W-u*X)/(-u*W+s*q);return B<=H?B<=G?H<=G?[B,H,G]:[B,G,H]:[G,B,H]:B<=G?[H,B,G]:H<=G?[H,G,B]:[G,H,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,_=E[0],p=E[1];if(_>=0&&p>=0){var y=Math.sqrt(_),T=Math.sqrt(p);return[h-T,h-y,h+y,h+T]}if(_>=0&&p<0)return m=Math.sqrt(_),[h-m,h+m];if(_<0&&p>=0)return m=Math.sqrt(p),[h-m,h+m]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,m,_=d[0],p=a-_,y=p*p,T=t/2,R=p/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*_,N=c+4*Math.abs(_);if(_<0||A*N<v*S){var O=Math.sqrt(v);E=O/2,m=0===O?0:(t*R-i)/O}else{var g=Math.sqrt(A);E=0===g?0:(t*R-i)/g,m=g/2}var I,M;0===T&&0===E?(I=0,M=0):n.sign(T)===n.sign(E)?(I=T+E,M=_/I):(M=T-E,I=_/M);var w,x;0===R&&0===m?(w=0,x=0):n.sign(R)===n.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var C=r.computeRealRoots(1,I,w),P=r.computeRealRoots(1,M,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,m=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),h=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(h,d,E,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,h=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,m=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),_=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,p=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===p){if(l=s.computeRealRoots(E,m,_),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)), -T.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-v)),T.push(new e(a,i*S,i*v))}return T}var N=y*y,O=p*p,g=E*E,I=y*p,M=g+O,w=2*(m*E+I),x=2*_*E+m*m-O+N,C=2*(_*m-I),P=_*_-N;if(0===M&&0===w&&0===x&&0===C)return T;l=c.computeRealRoots(M,w,x,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=o.sign(E)===o.sign(_)?d(E*B+_,m*F,o.EPSILON12):o.sign(_)===o.sign(m*F)?d(E*B,m*F+_,o.EPSILON12):d(E*B+m*F,_,o.EPSILON12);var G=d(p*F,y,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++D):T.push(new e(a,i*F,i*b))}return T}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var _=new e,p=new e,y=new e,T=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,m=e.subtract(a,r,_),A=e.subtract(i,r,p),S=e.cross(E,A,y),v=e.dot(m,S);if(u){if(v<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<o.EPSILON6)return;var N=1/v;if(s=e.subtract(d,r,T),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new l;m.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,O=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,O),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var E=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var m=s/a,_=r/s;return m<_?new i(m,_):{start:_,stop:m}}var p=Math.sqrt(r/a);return new i(p,p)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var g=new e,I=new e,M=new e,w=new e,x=new e,C=new u,P=new u,U=new u,D=new u,L=new u,F=new u,B=new u,z=new e,b=new e,G=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,g);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,g),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,I),I),m=e.normalize(e.cross(f,d,M),M),_=C;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=d.x,_[4]=d.y,_[5]=d.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=u.transpose(_,P),y=u.fromScale(n.radii,U),T=u.fromScale(n.oneOverRadii,D),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,v=u.multiply(u.multiply(p,T,F),R,F),N=u.multiply(u.multiply(v,y,B),_,B),O=u.multiplyByVector(v,a,x),q=E(N,e.negate(O,g),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),H=Number.NEGATIVE_INFINITY,V=0;V<W;++V){A=u.multiplyByVector(y,u.multiplyByVector(_,q[V],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>H&&(H=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-H*H),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var q=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return m(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=p,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,h,d,E,m,_,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(_=d.progress,m=function(e){h.push(e),--l||(E=m=p,d.reject(h))},E=function(e){f.push(e),--c||(E=m=p,d.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,_);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,m,_,p;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(p),y,c,f,R,S);case"c":return u(String.fromCharCode(+p),y,c,f,R);case"b":return o(p,2,A,y,c,f,R);case"o":return o(p,8,A,y,c,f,R);case"x":return o(p,16,A,y,c,f,R);case"X":return o(p,16,A,y,c,f,R).toUpperCase();case"u":return o(p,10,A,y,c,f,R);case"i":case"d":return d=+p||0,d=Math.round(d-d%1),E=d<0?"-":T,p=E+a(String(Math.abs(d)),f,"0",!1),i(p,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+p,E=d<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],p=E+Math.abs(d)[m](f),i(p,E,y,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var _=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,g=/^(\d{2})(\.\d+)?/.source+O.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,_=0,T=0,O=0,w=u[0],x=u[1];if(u=w.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(v),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(x)){u=x.match(M),null!==u?(h=+u[1],_=+u[2],T=+u[3],O=1e3*+(u[4]||0),L=5):(u=x.match(I),null!==u?(h=+u[1],_=+u[2],T=60*+(u[3]||0),L=4):(u=x.match(g),null!==u&&(h=+u[1],_=60*+(u[2]||0),L=3)));var F=u[L],B=+u[L+1],z=+(u[L+2]||0);switch(F){case"+":h-=B,_-=z;break;case"-":h+=B,_+=z;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,h,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;_>=60;)_-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?y:p[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:p[s-1];for(;_<0;)_+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:p[s-1],l+=a;var G=E(n,s,l,h,_,T,O);return r(t)?(d(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=h(e,w);r(a)||(m.addSeconds(e,-1,w),a=h(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var _=d+2-12*c|0,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=p,t.month=_,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,_,E,y,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,p=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],v=_[R+m],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(N,v,f.TAI);if(p.push(O),T){if(v!==y&&r(y)){var g=o.leapSeconds,I=t(g,O,d);if(I<0){var M=new u(O,v);g.splice(~I,0,M)}}y=v}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function p(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],p=n[d+e._ut1MinusUtcSecondsColumn],y=p-E;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=p:p-=R-T)}return u.xPoleWander=_(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,E,p),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),m=E||o.greaterThanOrEquals(h,e);if(d&&m)return s=u,!E&&h.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)), -n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,_=i-s*this._stepSizeDays,p=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)p[E]=_-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=p[m]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=h,a):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+f+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var _=h,p=0;f>s&&(p=1),E>s&&E>f&&(p=2);var y=_[p],T=_[y];n=Math.sqrt(e[c.getElementIndex(p,p)]-e[c.getElementIndex(y,y)]-e[c.getElementIndex(T,T)]+1);var R=d;R[p]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,y)]-e[c.getElementIndex(y,T)])*n,R[y]=(e[c.getElementIndex(y,p)]+e[c.getElementIndex(p,y)])*n,R[T]=(e[c.getElementIndex(T,p)]+e[c.getElementIndex(p,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,_=new l,p=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),p=l.fromAxisAngle(e.UNIT_X,o.roll,E),_=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(_,p,_),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var y=new e,T=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,y);var u=l.computeAngle(R);r[o]=y.x*u,r[o+1]=y.y*u,r[o+2]=y.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var v=new l;l.lerp=function(e,t,n,r){return v=l.multiplyByScalar(t,n,v),r=l.multiplyByScalar(e,1-n,r),l.add(v,r,r)};var N=new l,O=new l,g=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return O=l.multiplyByScalar(e,Math.sin((1-n)*o),O),g=l.multiplyByScalar(i,Math.sin(n*o),g),r=l.add(O,g,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var I=new e,M=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,I);l.multiply(i,t,x);var u=l.log(x,M);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],D=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;U[B]=1/(z*b),D[B]=z/b}return U[7]=P/136,D[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)L[f]=(U[f]*s-D[f])*o,F[f]=(U[f]*c-D[f])*o;var h=a*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),d=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,h,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,m,_,p,y,T,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},v={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},N={},O={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},g=new n,I=new n,M=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(N[i])?r=N[i]:(r=function(r,i,s){if(u(s)||(s=new y),_.equalsEpsilon(r.x,0,_.EPSILON14)&&_.equalsEpsilon(r.y,0,_.EPSILON14)){var c=_.sign(r.z);n.unpack(v[e],0,g),"east"!==e&&"west"!==e&&n.multiplyByScalar(g,c,g),n.unpack(v[t],0,I),"east"!==t&&"west"!==t&&n.multiplyByScalar(I,c,I),n.unpack(v[a],0,M),"east"!==a&&"west"!==a&&n.multiplyByScalar(M,c,M)}else{i=o(i,h.WGS84),i.geodeticSurfaceNormal(r,O.up);var l=O.up,f=O.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,O.east),n.cross(l,f,O.north),n.multiplyByScalar(O.up,-1,O.down),n.multiplyByScalar(O.east,-1,O.west),n.multiplyByScalar(O.north,-1,O.south),g=O[e],I=O[t],M=O[a]}return s[0]=g.x,s[1]=g.y,s[2]=g.z,s[3]=0,s[4]=I.x,s[5]=I.y,s[6]=I.z,s[7]=0,s[8]=M.x,s[9]=M.y,s[10]=M.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},N[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new T,x=new n(1,1,1),C=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof y&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,w),c=y.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),y.multiply(i,c,i)};var P=new y,U=new p;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=y.getRotation(i,U);return T.fromRotationMatrix(o,a)};var D=24110.54841,L=8640184.812866,F=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,G=_.TWO_PI/86400,q=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(L+n*(F+n*B)),s=o*G%_.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return p.transpose(n,t)};var H=new E(0,0,0),V=new f(0,0,0,0,0,0),Y=new p,k=new p;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,V);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,H);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=p.fromRotationZ(-i.s,k),h=p.multiply(l,f,Y),d=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=d-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*_.TWO_PI;var v=p.fromRotationZ(S,k),N=p.multiply(h,v,Y),O=Math.cos(n.xPoleWander),g=Math.cos(n.yPoleWander),I=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*_.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=k;return U[0]=O*C,U[1]=O*P,U[2]=I,U[3]=-g*P+M*I*C,U[4]=g*C+M*I*P,U[5]=-M*O,U[6]=-M*P-g*I*C,U[7]=M*C-g*I*P,U[8]=g*O,p.multiply(N,U,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,h.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new y,ue=new y;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=y.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=A.eastNorthUpToFixedFrame(o,i,oe),c=y.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=y.getColumn(t,0,ee),d=n.magnitude(h),E=y.multiplyByVector(c,h,re);r.fromElements(E.z,E.x,E.y,0,E);var m=y.getColumn(t,1,ee),_=n.magnitude(m),p=y.multiplyByVector(c,m,ae);r.fromElements(p.z,p.x,p.y,0,p);var T=y.getColumn(t,2,ee),R=n.magnitude(T),S=ie;return n.cross(E,p,S),n.normalize(S,S),n.cross(p,S,E),n.normalize(E,E),n.cross(S,E,p),n.normalize(p,p),n.multiplyByScalar(E,d,E),n.multiplyByScalar(p,_,p),n.multiplyByScalar(S,R,S),y.setColumn(a,0,E,a),y.setColumn(a,1,p,a),y.setColumn(a,2,S,a),y.setColumn(a,3,f,a),a};var se=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,oe),i=y.inverseTransformation(a,ue),o=r.cartesianToCartographic(t,Q),u=e.project(o,$),s=ne;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=y.fromTranslation(s,oe);return y.multiply(se,i,n),y.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var p=new h,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=p;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,E,m,_;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var p=a;p<o;p+=a)E=e[p],m=e[p+1],E<l&&(l=E),m<f&&(f=m),E>h&&(h=E),m>d&&(d=m);_=Math.max(h-l,d-f)}return r(u,c,a,l,f,_),c}function t(e,t,n,r,a){var i,o;if(a===M(e,t,n,r)>0)for(i=t;i<n;i+=r)o=O(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=O(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(g(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(g(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,m,_=e;e.prev!==e.next;)if(E=e.prev,m=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(m.i/s),g(e),e=m.next,_=m.next;else if(e=m,e===_){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(_(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),h=E(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&_(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&_(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&S(a,i)&&S(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),g(r),g(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&p(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(m(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&_(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function _(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new I(e.i,e.x,e.y),r=new I(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function O(e,t,n,r){var a=new I(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function g(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 I(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(M(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(M(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,E=new n,m={};m.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},m.computeWindingOrder2D=function(e){var t=m.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},m.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var _=new n,p=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return m.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,m=new Array(3*E),v=0;for(h=0;h<E;h++){var N=t[h];m[v++]=N.x,m[v++]=N.y,m[v++]=N.z}for(var O=[],g={},I=e.maximumRadius,M=l.chordLength(u,I),w=M*M;d.length>0;){var x,C,P=d.pop(),U=d.pop(),D=d.pop(),L=n.fromArray(m,3*D,_),F=n.fromArray(m,3*U,p),B=n.fromArray(m,3*P,y),z=n.multiplyByScalar(n.normalize(L,T),I,T),b=n.multiplyByScalar(n.normalize(F,R),I,R),G=n.multiplyByScalar(n.normalize(B,A),I,A),q=n.magnitudeSquared(n.subtract(z,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),X=n.magnitudeSquared(n.subtract(G,z,S)),H=Math.max(q,W,X);H>w?q===H?(x=Math.min(D,U)+" "+Math.max(D,U),h=g[x],i(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,g[x]=h),d.push(D,h,P),d.push(h,U,P)):W===H?(x=Math.min(U,P)+" "+Math.max(U,P),h=g[x],i(h)||(C=n.add(F,B,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,g[x]=h),d.push(U,h,D),d.push(h,P,D)):X===H&&(x=Math.min(P,D)+" "+Math.max(P,D),h=g[x],i(h)||(C=n.add(B,L,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,g[x]=h),d.push(P,h,U),d.push(h,D,U)):(O.push(D),O.push(U),O.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m})},indices:O,primitiveType:f.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},m}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,E=Math.sqrt(d),m=t/4,_=m*m,p=_*m,y=_*_,T=1+m-3*_/4+5*p/4-175*y/64,R=1-m+15*_/8-35*p/8,A=1-3*m+35*_/4,S=1-5*m,v=T*l-R*Math.sin(2*l)*m/2-A*Math.sin(4*l)*_/16-S*Math.sin(6*l)*p/48-5*Math.sin(8*l)*y/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=d,N.cosineAlpha=E,N.u2Over4=m,N.u4Over16=_,N.u6Over64=p,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,E=(t-n)/t,m=i-r,_=Math.atan((1-E)*Math.tan(a)),p=Math.atan((1-E)*Math.tan(o)),y=Math.cos(_),T=Math.sin(_),R=Math.cos(p),A=Math.sin(p),S=y*R,v=y*A,N=T*A,O=T*R,g=m,I=u.TWO_PI,M=Math.cos(g),w=Math.sin(g);do{M=Math.cos(g),w=Math.sin(g);var x=v-O*M;f=Math.sqrt(R*R*w*w+x*x),c=N+S*M,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*w/f,h=1-C*C),I=g,d=c-2*N/h,isNaN(d)&&(d=0),g=m+l(E,C,h,s,f,c,d)}while(Math.abs(g-I)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),U=1+P*(4096+P*(P*(320-175*P)-768))/16384,D=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,F=D*f*(d+D*(c*(2*L-1)-D*d*(4*f*f-3)*(4*L-3)/6)/4),B=n*U*(s-F),z=Math.atan2(R*w,v-O*M),b=Math.atan2(y*w,v*M-O);e._distance=B,e._startHeading=z,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,m),E),e.normalize(i.cartographicToCartesian(a,m),m);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude), -n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var E=new e,m=new e;return a(d.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}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),E=i*i,m=i*E,_=a.u8Over256,p=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*m*_*o/3+i*(1-p+7*T/4-15*y/4+579*_/64-(T-15*y/4+187*_/16)*o-(5*y/4-115*_/16)*u-29*_*s/16)+(p/2-T+71*y/32-85*_/16)*c+(5*T/16-5*y/4+383*_/96)*f-E*((y-11*_/2)*c+5*_*f/2)+(29*y/96-29*_/16)*h+539*_*d/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var v=Math.cos(2*a.sigma+R),N=Math.sin(R),O=Math.cos(R),g=a.cosineU*O,I=a.sineU*N,M=Math.atan2(N*a.sineHeading,g-I*a.cosineHeading),w=M-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,O,v);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=S,n.height=0,n):new t(this._start.longitude+w,S,0)},d}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,M),l=a.scaleToGeodeticSurface(n,w),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,O),m=a.cartesianToCartographic(l,g),_=h(f,i,o);x.setEndPoints(d,m);var p=x.surfaceDistance/f,y=s;d.height=i;var T=a.cartographicToCartesian(d,I);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=x.interpolateUsingSurfaceDistance(R*p,g);A.height=_[R],T=a.cartographicToCartesian(A,I),e.pack(T,u,y),y+=3}return y}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var m=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,m).height}return r};var _=new l,p=new e,y=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],O=new t,g=new t,I=new e,M=new e,w=new e,x=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,_),c=l.multiplyByPoint(s,e.ZERO,p),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),d=f.fromPointNormal(c,h,T),E=l.multiplyByPointAsVector(s,e.UNIT_X,R),m=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var O=i[0],g=t.length,I=1;I<g;++I){var M=t[I];if(f.getPointDistance(m,O)<0||f.getPointDistance(m,M)<0){var w=u.lineSegmentPlane(O,M,d,S);if(r(w)){var x=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,O)<0&&e.negate(x,x),i.push(e.add(w,x,new e)),o.push(N+1),e.negate(x,x),i.push(e.add(w,x,new e)),N=1}}i.push(e.clone(t[I])),N++,O=M}o.push(N)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],M);if(l=f?l[0]:l,0!==l){var m=u.geodeticSurfaceNormal(h,I);e.multiplyByScalar(m,l,m),e.add(h,m,h)}return[h.x,h.y,h.z]}var _=t.minDistance;if(!r(_)){var p=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(p,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=E.numberOfPoints(a[y],a[y+1],_);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=a[y],g=a[y+1],w=f?l[y]:l,x=f?l[y+1]:l;S=d(v,g,_,u,w,x,A,S)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,O);P.height=f?l[o-1]:l;var U=u.cartographicToCartesian(P,I);return e.pack(U,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,a,i,o){"use strict";function u(e,t){return r.equalsEpsilon(e.latitude,t.latitude,r.EPSILON14)&&r.equalsEpsilon(e.longitude,t.longitude,r.EPSILON14)}function s(n,r,a,i){var o=r.length;if(!(o<2)){var s=t(i),c=t(a),h=!0,d=new Array(o),E=new Array(o),m=new Array(o),_=r[0];d[0]=_;var p=n.cartesianToCartographic(_,l);c&&(p.height=a[0]),h=h&&p.height<=0,E[0]=p.height,s?m[0]=i[0]:m[0]=0;for(var y=1,T=1;T<o;++T){var R=r[T],A=n.cartesianToCartographic(R,f);c&&(A.height=a[T]),h=h&&A.height<=0,u(p,A)?p.height<A.height&&(E[y-1]=A.height):(d[y]=R,E[y]=A.height,s?m[y]=i[T]:m[y]=0,e.clone(A,p),++y)}if(!(h||y<2))return d.length=y,E.length=y,m.length=y,{positions:d,topHeights:E,bottomHeights:m}}}var c={},l=new e,f=new e,h=new Array(2),d=new Array(2),E={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return c.computePositions=function(e,u,c,l,f,m){var _=s(e,u,c,l);if(t(_)){if(u=_.positions,c=_.topHeights,l=_.bottomHeights,u.length>=3){var p=n.fromPoints(u,e),y=p.projectPointsOntoPlane(u);a.computeWindingOrder2D(y)===o.CLOCKWISE&&(u.reverse(),c.reverse(),l.reverse())}var T,R,A=u.length,S=A-2,v=r.chordLength(f,e.maximumRadius),N=E;if(N.minDistance=v,N.ellipsoid=e,m){var O,g=0;for(O=0;O<A-1;O++)g+=i.numberOfPoints(u[O],u[O+1],v)+1;T=new Float64Array(3*g),R=new Float64Array(3*g);var I=h,M=d;N.positions=I,N.height=M;var w=0;for(O=0;O<A-1;O++){I[0]=u[O],I[1]=u[O+1],M[0]=c[O],M[1]=c[O+1];var x=i.generateArc(N);T.set(x,w),M[0]=l[O],M[1]=l[O+1],R.set(i.generateArc(N),w),w+=x.length}}else N.positions=u,N.height=c,T=new Float64Array(i.generateArc(N)),N.height=l,R=new Float64Array(i.generateArc(N));return{bottomPositions:R,topPositions:T,numCorners:S}}},c}),define("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E){"use strict";function m(e){e=r(e,r.EMPTY_OBJECT);var n=e.positions,i=e.maximumHeights,u=e.minimumHeights,s=r(e.vertexFormat,d.DEFAULT),c=r(e.granularity,f.RADIANS_PER_DEGREE),l=r(e.ellipsoid,o.WGS84);this._positions=n,this._minimumHeights=u,this._maximumHeights=i,this._vertexFormat=d.clone(s),this._granularity=c,this._ellipsoid=o.clone(l),this._workerName="createWallGeometry";var h=1+n.length*t.packedLength+2;a(u)&&(h+=u.length),a(i)&&(h+=i.length),this.packedLength=h+o.packedLength+d.packedLength+1}var _=new t,p=new t,y=new t,T=new t,R=new t,A=new t,S=new t,v=new t;m.pack=function(e,n,i){i=r(i,0);var u,s=e._positions,c=s.length;for(n[i++]=c,u=0;u<c;++u,i+=t.packedLength)t.pack(s[u],n,i);var l=e._minimumHeights;if(c=a(l)?l.length:0,n[i++]=c,a(l))for(u=0;u<c;++u)n[i++]=l[u];var f=e._maximumHeights;if(c=a(f)?f.length:0,n[i++]=c,a(f))for(u=0;u<c;++u)n[i++]=f[u];return o.pack(e._ellipsoid,n,i),i+=o.packedLength,d.pack(e._vertexFormat,n,i),i+=d.packedLength,n[i]=e._granularity,n};var N=o.clone(o.UNIT_SPHERE),O=new d,g={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:N,vertexFormat:O,granularity:void 0};return m.unpack=function(e,n,i){n=r(n,0);var u,s=e[n++],c=new Array(s);for(u=0;u<s;++u,n+=t.packedLength)c[u]=t.unpack(e,n);s=e[n++];var l;if(s>0)for(l=new Array(s),u=0;u<s;++u)l[u]=e[n++];s=e[n++];var f;if(s>0)for(f=new Array(s),u=0;u<s;++u)f[u]=e[n++];var h=o.unpack(e,n,N);n+=o.packedLength;var E=d.unpack(e,n,O);n+=d.packedLength;var _=e[n];return a(i)?(i._positions=c,i._minimumHeights=l,i._maximumHeights=f,i._ellipsoid=o.clone(h,i._ellipsoid),i._vertexFormat=d.clone(E,i._vertexFormat),i._granularity=_,i):(g.positions=c,g.minimumHeights=l,g.maximumHeights=f,g.granularity=_,new m(g))},m.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,n,i=e.positions,o=e.minimumHeight,u=e.maximumHeight,s=a(o),c=a(u);if(s||c){var l=i.length;t=s?new Array(l):void 0,n=c?new Array(l):void 0;for(var f=0;f<l;++f)s&&(t[f]=o),c&&(n[f]=u)}var h={positions:i,maximumHeights:n,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new m(h)},m.createGeometry=function(r){var i=r._positions,o=r._minimumHeights,d=r._maximumHeights,m=r._vertexFormat,N=r._granularity,O=r._ellipsoid,g=E.computePositions(O,i,d,o,N,!0);if(a(g)){var I=g.bottomPositions,M=g.topPositions,w=g.numCorners,x=M.length,C=2*x,P=m.position?new Float64Array(C):void 0,U=m.normal?new Float32Array(C):void 0,D=m.tangent?new Float32Array(C):void 0,L=m.bitangent?new Float32Array(C):void 0,F=m.st?new Float32Array(C/3*2):void 0,B=0,z=0,b=0,G=0,q=0,W=v,X=S,H=A,V=!0;x/=3;var Y,k=0,Z=1/(x-i.length+1);for(Y=0;Y<x;++Y){var j=3*Y,K=t.fromArray(M,j,_),J=t.fromArray(I,j,p);if(m.position&&(P[B++]=J.x,P[B++]=J.y,P[B++]=J.z,P[B++]=K.x,P[B++]=K.y,P[B++]=K.z),m.st&&(F[q++]=k,F[q++]=0,F[q++]=k,F[q++]=1),m.normal||m.tangent||m.bitangent){var Q,$=t.clone(t.ZERO,R),ee=O.scaleToGeodeticSurface(t.fromArray(M,j,p),p);if(Y+1<x&&(Q=O.scaleToGeodeticSurface(t.fromArray(M,j+3,y),y),$=t.fromArray(M,j+3,R)),V){var te=t.subtract($,K,T),ne=t.subtract(ee,K,_);W=t.normalize(t.cross(ne,te,W),W),V=!1}t.equalsEpsilon(Q,ee,f.EPSILON10)?V=!0:(k+=Z,m.tangent&&(X=t.normalize(t.subtract(Q,ee,X),X)),m.bitangent&&(H=t.normalize(t.cross(W,X,H),H))),m.normal&&(U[z++]=W.x,U[z++]=W.y,U[z++]=W.z,U[z++]=W.x,U[z++]=W.y,U[z++]=W.z),m.tangent&&(D[G++]=X.x,D[G++]=X.y,D[G++]=X.z,D[G++]=X.x,D[G++]=X.y,D[G++]=X.z),m.bitangent&&(L[b++]=H.x,L[b++]=H.y,L[b++]=H.z,L[b++]=H.x,L[b++]=H.y,L[b++]=H.z)}}var re=new c;m.position&&(re.position=new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:P})),m.normal&&(re.normal=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:U})),m.tangent&&(re.tangent=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:D})),m.bitangent&&(re.bitangent=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:L})),m.st&&(re.st=new s({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:F}));var ae=C/3;C-=6*(w+1);var ie=l.createTypedArray(ae,C),oe=0;for(Y=0;Y<ae-2;Y+=2){var ue=Y,se=Y+2,ce=t.fromArray(P,3*ue,_),le=t.fromArray(P,3*se,p);if(!t.equalsEpsilon(ce,le,f.EPSILON10)){var fe=Y+1,he=Y+3;ie[oe++]=fe,ie[oe++]=ue,ie[oe++]=he,ie[oe++]=he,ie[oe++]=ue,ie[oe++]=se}}return new u({attributes:re,indices:ie,primitiveType:h.TRIANGLES,boundingSphere:new e.fromVertices(P)})}},m}),define("Workers/createWallGeometry",["../Core/defined","../Core/Ellipsoid","../Core/WallGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,m=a.z,_=l*l*d*d,p=f*f*E*E,y=h*h*m*m,T=_+p+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,O=o;O.x=A.x*S*2,O.y=A.y*v*2,O.z=A.z*N*2;var g,I,M,w,x,C,P,U,D,L,F,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{B-=z,M=1/(1+B*S),w=1/(1+B*v),x=1/(1+B*N),C=M*M,P=w*w,U=x*x,D=C*M,L=P*w,F=U*x,g=_*C+p*P+y*U-1,I=_*D*S+p*L*v+y*F*N;var b=-2*I;z=g/b}while(Math.abs(g)>r.EPSILON12);return t(c)?(c.x=l*M,c.y=f*w,c.z=h*x,c):new e(l*M,f*w,h*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,a,i){return a=n(a,0),r(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,m=r(n)?n.oneOverRadiiSquared:h,_=r(n)?n._centerToleranceSquared:d,p=o(t,E,m,_,c);if(r(p)){var y=e.multiplyComponents(p,m,s);y=e.normalize(y,y);var T=e.subtract(t,p,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],h=m[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,_=e[s.getElementIndex(h,h)],p=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(h,f)],T=(_-p)/2/y;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=n-u-f+d,m=2*(a-h),_=2*(i+l),p=2*(a+h),y=-n+u-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+d;return r(t)?(t[0]=E,t[1]=p,t[2]=R,t[3]=m,t[4]=y,t[5]=A,t[6]=_,t[7]=T,t[8]=S,t):new s(E,m,_,p,y,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,E=i*a+c*o*u,m=-c*a+i*o*u,_=-o,p=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=_,t[3]=f,t[4]=E,t[5]=p,t[6]=h,t[7]=m,t[8]=y,t):new s(l,f,h,d,E,m,_,p,y)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],_=new s,p=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)f(d,_),s.transpose(_,p),s.multiply(d,_,d),s.multiply(p,d,d),s.multiply(h,_,h),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){ +"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,h,d,E,m,_){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(_,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,m=t.y*t.w,_=t.z*t.z,p=t.z*t.w,y=t.w*t.w,T=s-d-_+y,R=2*(c-p),A=2*(f+m),S=2*(c+p),v=-s+d-_+y,N=2*(E-h),O=2*(f-m),g=2*(E+h),I=-s-d+_+y;return r[0]=T*i,r[1]=S*i,r[2]=O*i,r[3]=0,r[4]=R*o,r[5]=v*o,r[6]=g*o,r[7]=0,r[8]=A*u,r[9]=N*u,r[10]=I*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,E=f.x,m=f.y,_=f.z,p=d.x,y=d.y,T=d.z,R=r.x,A=r.y,S=r.z,v=u*-R+s*-A+c*-S,N=p*-R+y*-A+T*-S,O=E*R+m*A+_*S;return a(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-_,n[11]=0,n[12]=v,n[13]=N,n[14]=O,n[15]=1,n):new l(u,s,c,v,p,y,T,N,-E,-m,-_,O,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,E=f,m=i+c,_=o+l,p=t+f,y=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=p,a[15]=y,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],m=e[12],_=e[13],p=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],O=t[6],g=t[7],I=t[8],M=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+m*S,F=a*T+s*R+h*A+_*S,B=i*T+c*R+d*A+p*S,z=o*T+l*R+E*A+y*S,b=r*v+u*N+f*O+m*g,G=a*v+s*N+h*O+_*g,q=i*v+c*N+d*O+p*g,W=o*v+l*N+E*O+y*g,X=r*I+u*M+f*w+m*x,H=a*I+s*M+h*w+_*x,V=i*I+c*M+d*w+p*x,Y=o*I+l*M+E*w+y*x,k=r*C+u*P+f*U+m*D,Z=a*C+s*P+h*U+_*D,j=i*C+c*P+d*U+p*D,K=o*C+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=H,n[10]=V,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],m=t[0],_=t[1],p=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],O=t[13],g=t[14],I=r*m+o*_+c*p,M=a*m+u*_+l*p,w=i*m+s*_+f*p,x=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,U=r*A+o*S+c*v,D=a*A+u*S+l*v,L=i*A+s*S+f*v,F=r*N+o*O+c*g+h,B=a*N+u*O+l*g+d,z=i*N+s*O+f*g+E;return n[0]=I,n[1]=M,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],m=t[3],_=t[4],p=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,S=a*h+u*d+l*E,v=i*h+s*d+f*E,N=r*m+o*_+c*p,O=a*m+u*_+l*p,g=i*m+s*_+f*p,I=r*y+o*T+c*R,M=a*y+u*T+l*R,w=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=O,n[6]=g,n[7]=0,n[8]=I,n[9]=M,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var p=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,p),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],E=e[13],m=e[2],_=e[6],A=e[10],S=e[14],v=e[3],N=e[7],O=e[11],g=e[15],I=A*g,M=S*O,w=_*g,x=S*N,C=_*O,P=A*N,U=m*g,D=S*v,L=m*O,F=A*v,B=m*N,z=_*v,b=I*h+x*d+C*E-(M*h+w*d+P*E),G=M*f+U*d+F*E-(I*f+D*d+L*E),q=w*f+D*h+B*E-(x*f+U*h+z*E),W=P*f+L*h+z*d-(C*f+F*h+B*d),X=M*a+w*i+P*o-(I*a+x*i+C*o),H=I*r+D*i+L*o-(M*r+U*i+F*o),V=x*r+U*a+z*o-(w*r+D*a+B*o),Y=C*r+F*a+B*i-(P*r+L*a+z*i);I=i*E,M=o*d,w=a*E,x=o*h,C=a*d,P=i*h,U=r*E,D=o*f,L=r*d,F=i*f,B=r*h,z=a*f;var k=I*N+x*O+C*g-(M*N+w*O+P*g),Z=M*v+U*O+F*g-(I*v+D*O+L*g),j=w*v+D*N+B*g-(x*v+U*N+z*g),K=P*v+L*N+z*O-(C*v+F*N+B*O),J=w*A+P*S+M*_-(C*S+I*_+x*A),Q=L*S+I*m+D*A-(U*A+F*S+M*m),$=U*_+z*S+x*m-(B*S+w*m+D*_),ee=B*A+C*m+F*_-(L*_+z*A+P*m),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=H*te,n[6]=V*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,m=-i*f-o*h-u*d,_=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:h>0?m.latitude=h:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,m=new e,_=new e,p=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,_),c=e.clone(r,p),l=e.clone(r,y),f=t.length,O=1;O<f;O++){e.clone(t[O],r);var g=r.x,I=r.y,M=r.z;g<i.x&&e.clone(r,i),g>s.x&&e.clone(r,s),I<o.y&&e.clone(r,o),I>c.y&&e.clone(r,c),M<u.z&&e.clone(r,u),M>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),B=Math.sqrt(F),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,R),.5,N),q=0;for(O=0;O<f;O++){e.clone(t[O],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var H=Math.sqrt(X);B=.5*(B+H),F=B*B;var V=H-B;L.x=(B*L.x+V*r.x)/H,L.y=(B*L.y+V*r.y)/H,L.z=(B*L.z+V*r.z)/H}}return B<q?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var O=new o,g=new e,I=new e,M=new t,w=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,O),f.southwest(t,M),M.height=i,f.northeast(t,w),w.height=o;var s=n.project(M,g),c=n.project(w,I),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*d,m.z=s.z+.5*E,u};var x=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,_),O=e.clone(u,p),g=e.clone(u,y),I=t.length,M=0;M<I;M+=i){var w=t[M]+n.x,x=t[M+1]+n.y,C=t[M+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>O.y&&e.clone(u,O),C<l.z&&e.clone(u,l),C>g.z&&e.clone(u,g)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(O,c,R)),D=e.magnitudeSquared(e.subtract(g,l,R)),L=s,F=f,B=P;U>B&&(B=U,L=c,F=O),D>B&&(B=D,L=l,F=g);var z=A;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=O.y,W.z=g.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),H=0;for(M=0;M<I;M+=i){u.x=t[M]+n.x,u.y=t[M+1]+n.y,u.z=t[M+2]+n.z;var V=e.magnitude(e.subtract(u,X,R));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);G=.5*(G+k),b=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<H?(e.clone(z,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,p),f=e.clone(i,y),O=t.length,g=0;g<O;g+=3){var I=t[g]+n[g],M=t[g+1]+n[g+1],w=t[g+2]+n[g+2];i.x=I,i.y=M,i.z=w,I<o.x&&e.clone(i,o),I>c.x&&e.clone(i,c),M<u.y&&e.clone(i,u),M>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=x;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,F,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(g=0;g<O;g+=3){i.x=t[g]+n[g],i.y=t[g+1]+n[g+1],i.z=t[g+2]+n[g+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>B){var V=Math.sqrt(H);z=.5*(z+V),B=z*z;var Y=V-z;F.x=(z*F.x+Y*i.x)/V,F.y=(z*F.y+Y*i.y)/V,F.z=(z*F.z+Y*i.z)/V}}return z<W?(e.clone(F,r.center),r.radius=z):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D);return e.add(i,o,i),e.add(i,u,i),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(i),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var B=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,H=new e,V=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,H),d=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,d,m),m=E[2],e.add(s,f,m),e.add(m,d,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,d,m),m=E[6],e.add(s,f,m),e.add(m,d,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var _=E.length,p=0;p<_;++p){var y=E[p];e.add(o,y,y);var T=i.cartesianToCartographic(y,V);n.project(T,y)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(v)&&(v=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(O=!0,g=r(e[1]),g.isNightly=!!e[2])}return O}function c(){return s()&&g}function l(){if(!t(I)){I=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(I=!0,M=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(I=!0,M=r(e[1])))}return I}function f(){return l()&&M}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function d(){return h()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1])); +}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return E()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,O,g,I,M,w,x,C,P,U,D,L,F,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:y,imageRenderingValue:T};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/VertexFormat",["./defaultValue","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t){t=e(t,e.EMPTY_OBJECT),this.position=e(t.position,!1),this.normal=e(t.normal,!1),this.st=e(t.st,!1),this.bitangent=e(t.bitangent,!1),this.tangent=e(t.tangent,!1),this.color=e(t.color,!1)}return a.POSITION_ONLY=r(new a({position:!0})),a.POSITION_AND_NORMAL=r(new a({position:!0,normal:!0})),a.POSITION_NORMAL_AND_ST=r(new a({position:!0,normal:!0,st:!0})),a.POSITION_AND_ST=r(new a({position:!0,st:!0})),a.POSITION_AND_COLOR=r(new a({position:!0,color:!0})),a.ALL=r(new a({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0})),a.DEFAULT=a.POSITION_NORMAL_AND_ST,a.packedLength=6,a.pack=function(t,n,r){return r=e(r,0),n[r++]=t.position?1:0,n[r++]=t.normal?1:0,n[r++]=t.st?1:0,n[r++]=t.tangent?1:0,n[r++]=t.bitangent?1:0,n[r++]=t.color?1:0,n},a.unpack=function(n,r,i){return r=e(r,0),t(i)||(i=new a),i.position=1===n[r++],i.normal=1===n[r++],i.st=1===n[r++],i.tangent=1===n[r++],i.bitangent=1===n[r++],i.color=1===n[r++],i},a.clone=function(e,n){if(t(e))return t(n)||(n=new a),n.position=e.position,n.normal=e.normal,n.st=e.st,n.tangent=e.tangent,n.bitangent=e.bitangent,n.color=e.color,n},a}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,n,r,a){"use strict";function i(t,a,i){this.minimum=e.clone(n(t,e.ZERO)),this.maximum=e.clone(n(a,e.ZERO)),r(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,n){if(r(n)||(n=new i),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,m=d.y,_=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var p=n.minimum;p.x=a,p.y=o,p.z=u;var y=n.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(p,y,n.center);return e.multiplyByScalar(T,.5,T),n},i.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new i(t.minimum,t.maximum)},i.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,m=o*c-u*s,_=u*c-d,p=4*E*_-m*m;if(p<0){var y,T,R;h*f>=l*d?(y=o,T=E,R=-2*u*E+o*m):(y=c,T=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);i=-R+S;var v=i/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),O=i===S?-N:-T/N;return a=T<=0?N+O:-R/(N*N+O*O+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var g=E,I=-2*u*E+o*m,M=_,w=-c*m+2*s*_,x=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-I)/3);a=2*Math.sqrt(-g);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-M),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=i+D<2*s?i+s:D+s,G=z/b,q=F*b,W=-L*b-F*z,X=L*z,H=(s*W-u*X)/(-u*W+s*q);return B<=H?B<=G?H<=G?[B,H,G]:[B,G,H]:[G,B,H]:B<=G?[H,B,G]:H<=G?[H,G,B]:[G,H,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,_=E[0],p=E[1];if(_>=0&&p>=0){var y=Math.sqrt(_),T=Math.sqrt(p);return[h-T,h-y,h+y,h+T]}if(_>=0&&p<0)return m=Math.sqrt(_),[h-m,h+m];if(_<0&&p>=0)return m=Math.sqrt(p),[h-m,h+m]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,m,_=d[0],p=a-_,y=p*p,T=t/2,R=p/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*_,N=c+4*Math.abs(_);if(_<0||A*N<v*S){var O=Math.sqrt(v);E=O/2,m=0===O?0:(t*R-i)/O}else{var g=Math.sqrt(A);E=0===g?0:(t*R-i)/g,m=g/2}var I,M;0===T&&0===E?(I=0,M=0):n.sign(T)===n.sign(E)?(I=T+E,M=_/I):(M=T-E,I=_/M);var w,x;0===R&&0===m?(w=0,x=0):n.sign(R)===n.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var C=r.computeRealRoots(1,I,w),P=r.computeRealRoots(1,M,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,m=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),h=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(h,d,E,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,h=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,m=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),_=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,p=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===p){if(l=s.computeRealRoots(E,m,_),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){ +var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-v)),T.push(new e(a,i*S,i*v))}return T}var N=y*y,O=p*p,g=E*E,I=y*p,M=g+O,w=2*(m*E+I),x=2*_*E+m*m-O+N,C=2*(_*m-I),P=_*_-N;if(0===M&&0===w&&0===x&&0===C)return T;l=c.computeRealRoots(M,w,x,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=o.sign(E)===o.sign(_)?d(E*B+_,m*F,o.EPSILON12):o.sign(_)===o.sign(m*F)?d(E*B,m*F+_,o.EPSILON12):d(E*B+m*F,_,o.EPSILON12);var G=d(p*F,y,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++D):T.push(new e(a,i*F,i*b))}return T}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var _=new e,p=new e,y=new e,T=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,m=e.subtract(a,r,_),A=e.subtract(i,r,p),S=e.cross(E,A,y),v=e.dot(m,S);if(u){if(v<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<o.EPSILON6)return;var N=1/v;if(s=e.subtract(d,r,T),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new l;m.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,O=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,O),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var E=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var m=s/a,_=r/s;return m<_?new i(m,_):{start:_,stop:m}}var p=Math.sqrt(r/a);return new i(p,p)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var g=new e,I=new e,M=new e,w=new e,x=new e,C=new u,P=new u,U=new u,D=new u,L=new u,F=new u,B=new u,z=new e,b=new e,G=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,g);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,g),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,I),I),m=e.normalize(e.cross(f,d,M),M),_=C;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=d.x,_[4]=d.y,_[5]=d.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=u.transpose(_,P),y=u.fromScale(n.radii,U),T=u.fromScale(n.oneOverRadii,D),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,v=u.multiply(u.multiply(p,T,F),R,F),N=u.multiply(u.multiply(v,y,B),_,B),O=u.multiplyByVector(v,a,x),q=E(N,e.negate(O,g),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),H=Number.NEGATIVE_INFINITY,V=0;V<W;++V){A=u.multiplyByVector(y,u.multiplyByVector(_,q[V],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>H&&(H=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-H*H),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var q=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,n,r,a){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var o=new e;return i.fromCartesian4=function(n,r){var a=e.fromCartesian4(n,o),u=n.w;return t(r)?(e.clone(a,r.normal),r.distance=u,r):new i(a,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return m(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=p,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,h,d,E,m,_,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(_=d.progress,m=function(e){h.push(e),--l||(E=m=p,d.reject(h))},E=function(e){f.push(e),--c||(E=m=p,d.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,_);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,m,_,p;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(p),y,c,f,R,S);case"c":return u(String.fromCharCode(+p),y,c,f,R);case"b":return o(p,2,A,y,c,f,R);case"o":return o(p,8,A,y,c,f,R);case"x":return o(p,16,A,y,c,f,R);case"X":return o(p,16,A,y,c,f,R).toUpperCase();case"u":return o(p,10,A,y,c,f,R);case"i":case"d":return d=+p||0,d=Math.round(d-d%1),E=d<0?"-":T,p=E+a(String(Math.abs(d)),f,"0",!1),i(p,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+p,E=d<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],p=E+Math.abs(d)[m](f),i(p,E,y,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var _=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,g=/^(\d{2})(\.\d+)?/.source+O.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,M=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,_=0,T=0,O=0,w=u[0],x=u[1];if(u=w.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(v),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(x)){u=x.match(M),null!==u?(h=+u[1],_=+u[2],T=+u[3],O=1e3*+(u[4]||0),L=5):(u=x.match(I),null!==u?(h=+u[1],_=+u[2],T=60*+(u[3]||0),L=4):(u=x.match(g),null!==u&&(h=+u[1],_=60*+(u[2]||0),L=3)));var F=u[L],B=+u[L+1],z=+(u[L+2]||0);switch(F){case"+":h-=B,_-=z;break;case"-":h+=B,_+=z;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,h,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;_>=60;)_-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?y:p[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:p[s-1];for(;_<0;)_+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:p[s-1],l+=a;var G=E(n,s,l,h,_,T,O);return r(t)?(d(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=h(e,w);r(a)||(m.addSeconds(e,-1,w),a=h(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var _=d+2-12*c|0,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=p,t.month=_,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,_,E,y,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,p=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],v=_[R+m],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(N,v,f.TAI);if(p.push(O),T){if(v!==y&&r(y)){var g=o.leapSeconds,I=t(g,O,d);if(I<0){var M=new u(O,v);g.splice(~I,0,M)}}y=v}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function p(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],p=n[d+e._ut1MinusUtcSecondsColumn],y=p-E;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=p:p-=R-T)}return u.xPoleWander=_(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,E,p),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),m=E||o.greaterThanOrEquals(h,e);if(d&&m)return s=u,!E&&h.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){if(i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),"data"===r.scheme)return r.toString(); +if("data"===a.scheme)return a.toString();n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,_=i-s*this._stepSizeDays,p=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)p[E]=_-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=p[m]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=h,a):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+f+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var _=h,p=0;f>s&&(p=1),E>s&&E>f&&(p=2);var y=_[p],T=_[y];n=Math.sqrt(e[c.getElementIndex(p,p)]-e[c.getElementIndex(y,y)]-e[c.getElementIndex(T,T)]+1);var R=d;R[p]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,y)]-e[c.getElementIndex(y,T)])*n,R[y]=(e[c.getElementIndex(y,p)]+e[c.getElementIndex(p,y)])*n,R[T]=(e[c.getElementIndex(T,p)]+e[c.getElementIndex(p,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,_=new l,p=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),p=l.fromAxisAngle(e.UNIT_X,o.roll,E),_=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(_,p,_),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var y=new e,T=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,y);var u=l.computeAngle(R);r[o]=y.x*u,r[o+1]=y.y*u,r[o+2]=y.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var v=new l;l.lerp=function(e,t,n,r){return v=l.multiplyByScalar(t,n,v),r=l.multiplyByScalar(e,1-n,r),l.add(v,r,r)};var N=new l,O=new l,g=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return O=l.multiplyByScalar(e,Math.sin((1-n)*o),O),g=l.multiplyByScalar(i,Math.sin(n*o),g),r=l.add(O,g,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var I=new e,M=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,I);l.multiply(i,t,x);var u=l.log(x,M);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],D=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;U[B]=1/(z*b),D[B]=z/b}return U[7]=P/136,D[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)L[f]=(U[f]*s-D[f])*o,F[f]=(U[f]*c-D[f])*o;var h=a*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),d=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,h,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,m,_,p,y,T,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},v={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},N={},O={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},g=new n,I=new n,M=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(N[i])?r=N[i]:(r=function(r,i,s){if(u(s)||(s=new y),_.equalsEpsilon(r.x,0,_.EPSILON14)&&_.equalsEpsilon(r.y,0,_.EPSILON14)){var c=_.sign(r.z);n.unpack(v[e],0,g),"east"!==e&&"west"!==e&&n.multiplyByScalar(g,c,g),n.unpack(v[t],0,I),"east"!==t&&"west"!==t&&n.multiplyByScalar(I,c,I),n.unpack(v[a],0,M),"east"!==a&&"west"!==a&&n.multiplyByScalar(M,c,M)}else{i=o(i,h.WGS84),i.geodeticSurfaceNormal(r,O.up);var l=O.up,f=O.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,O.east),n.cross(l,f,O.north),n.multiplyByScalar(O.up,-1,O.down),n.multiplyByScalar(O.east,-1,O.west),n.multiplyByScalar(O.north,-1,O.south),g=O[e],I=O[t],M=O[a]}return s[0]=g.x,s[1]=g.y,s[2]=g.z,s[3]=0,s[4]=I.x,s[5]=I.y,s[6]=I.z,s[7]=0,s[8]=M.x,s[9]=M.y,s[10]=M.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},N[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new T,x=new n(1,1,1),C=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof y&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,w),c=y.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),y.multiply(i,c,i)};var P=new y,U=new p;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=y.getRotation(i,U);return T.fromRotationMatrix(o,a)};var D=24110.54841,L=8640184.812866,F=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,G=_.TWO_PI/86400,q=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(L+n*(F+n*B)),s=o*G%_.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return p.transpose(n,t)};var H=new E(0,0,0),V=new f(0,0,0,0,0,0),Y=new p,k=new p;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,V);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,H);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=p.fromRotationZ(-i.s,k),h=p.multiply(l,f,Y),d=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=d-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*_.TWO_PI;var v=p.fromRotationZ(S,k),N=p.multiply(h,v,Y),O=Math.cos(n.xPoleWander),g=Math.cos(n.yPoleWander),I=Math.sin(n.xPoleWander),M=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*_.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=k;return U[0]=O*C,U[1]=O*P,U[2]=I,U[3]=-g*P+M*I*C,U[4]=g*C+M*I*P,U[5]=-M*O,U[6]=-M*P-g*I*C,U[7]=M*C-g*I*P,U[8]=g*O,p.multiply(N,U,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,h.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new n,te=new n,ne=new p,re=new y,ae=new y;return A.basisTo2D=function(e,t,r){var a=y.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);n.fromElements(u.z,u.x,u.y,u);var s=A.eastNorthUpToFixedFrame(a,i,re),c=y.inverseTransformation(s,ae),l=y.getRotation(t,ne),f=y.multiplyByMatrix3(c,l,r);return y.multiply(Q,f,r),y.setTranslation(r,u,r),r},A.wgs84To2DModelMatrix=function(e,t,r){var a=e.ellipsoid,i=A.eastNorthUpToFixedFrame(t,a,re),o=y.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);n.fromElements(s.z,s.x,s.y,s);var c=y.fromTranslation(s,re);return y.multiply(Q,o,r),y.multiply(c,r,r),r},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var p=new h,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=p;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,E,m,_;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var p=a;p<o;p+=a)E=e[p],m=e[p+1],E<l&&(l=E),m<f&&(f=m),E>h&&(h=E),m>d&&(d=m);_=Math.max(h-l,d-f)}return r(u,c,a,l,f,_),c}function t(e,t,n,r,a){var i,o;if(a===M(e,t,n,r)>0)for(i=t;i<n;i+=r)o=O(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=O(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(g(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(g(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,m,_=e;e.prev!==e.next;)if(E=e.prev,m=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(m.i/s),g(e),e=m.next,_=m.next;else if(e=m,e===_){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(_(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),h=E(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&_(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&_(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&S(a,i)&&S(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),g(r),g(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&p(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(m(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&_(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function _(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new I(e.i,e.x,e.y),r=new I(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function O(e,t,n,r){var a=new I(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function g(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 I(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(M(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(M(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,E=new n,m={};m.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},m.computeWindingOrder2D=function(e){var t=m.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},m.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var _=new n,p=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return m.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,m=new Array(3*E),v=0;for(h=0;h<E;h++){var N=t[h];m[v++]=N.x,m[v++]=N.y,m[v++]=N.z}for(var O=[],g={},I=e.maximumRadius,M=l.chordLength(u,I),w=M*M;d.length>0;){var x,C,P=d.pop(),U=d.pop(),D=d.pop(),L=n.fromArray(m,3*D,_),F=n.fromArray(m,3*U,p),B=n.fromArray(m,3*P,y),z=n.multiplyByScalar(n.normalize(L,T),I,T),b=n.multiplyByScalar(n.normalize(F,R),I,R),G=n.multiplyByScalar(n.normalize(B,A),I,A),q=n.magnitudeSquared(n.subtract(z,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),X=n.magnitudeSquared(n.subtract(G,z,S)),H=Math.max(q,W,X);H>w?q===H?(x=Math.min(D,U)+" "+Math.max(D,U),h=g[x],i(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,g[x]=h),d.push(D,h,P),d.push(h,U,P)):W===H?(x=Math.min(U,P)+" "+Math.max(U,P),h=g[x],i(h)||(C=n.add(F,B,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,g[x]=h),d.push(U,h,D),d.push(h,P,D)):X===H&&(x=Math.min(P,D)+" "+Math.max(P,D),h=g[x],i(h)||(C=n.add(B,L,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,g[x]=h),d.push(P,h,U),d.push(h,D,U)):(O.push(D),O.push(U),O.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m})},indices:O,primitiveType:f.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},m}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,E=Math.sqrt(d),m=t/4,_=m*m,p=_*m,y=_*_,T=1+m-3*_/4+5*p/4-175*y/64,R=1-m+15*_/8-35*p/8,A=1-3*m+35*_/4,S=1-5*m,v=T*l-R*Math.sin(2*l)*m/2-A*Math.sin(4*l)*_/16-S*Math.sin(6*l)*p/48-5*Math.sin(8*l)*y/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=d,N.cosineAlpha=E,N.u2Over4=m,N.u4Over16=_,N.u6Over64=p,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,E=(t-n)/t,m=i-r,_=Math.atan((1-E)*Math.tan(a)),p=Math.atan((1-E)*Math.tan(o)),y=Math.cos(_),T=Math.sin(_),R=Math.cos(p),A=Math.sin(p),S=y*R,v=y*A,N=T*A,O=T*R,g=m,I=u.TWO_PI,M=Math.cos(g),w=Math.sin(g);do{M=Math.cos(g),w=Math.sin(g);var x=v-O*M;f=Math.sqrt(R*R*w*w+x*x),c=N+S*M,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*w/f,h=1-C*C),I=g,d=c-2*N/h,isNaN(d)&&(d=0),g=m+l(E,C,h,s,f,c,d)}while(Math.abs(g-I)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),U=1+P*(4096+P*(P*(320-175*P)-768))/16384,D=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,F=D*f*(d+D*(c*(2*L-1)-D*d*(4*f*f-3)*(4*L-3)/6)/4),B=n*U*(s-F),z=Math.atan2(R*w,v-O*M),b=Math.atan2(y*w,v*M-O);e._distance=B,e._startHeading=z,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,m),E),e.normalize(i.cartographicToCartesian(a,m),m);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var E=new e,m=new e;return a(d.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}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),E=i*i,m=i*E,_=a.u8Over256,p=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*m*_*o/3+i*(1-p+7*T/4-15*y/4+579*_/64-(T-15*y/4+187*_/16)*o-(5*y/4-115*_/16)*u-29*_*s/16)+(p/2-T+71*y/32-85*_/16)*c+(5*T/16-5*y/4+383*_/96)*f-E*((y-11*_/2)*c+5*_*f/2)+(29*y/96-29*_/16)*h+539*_*d/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var v=Math.cos(2*a.sigma+R),N=Math.sin(R),O=Math.cos(R),g=a.cosineU*O,I=a.sineU*N,M=Math.atan2(N*a.sineHeading,g-I*a.cosineHeading),w=M-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,O,v);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=S,n.height=0,n):new t(this._start.longitude+w,S,0)},d}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,M),l=a.scaleToGeodeticSurface(n,w),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,O),m=a.cartesianToCartographic(l,g),_=h(f,i,o);x.setEndPoints(d,m);var p=x.surfaceDistance/f,y=s;d.height=i;var T=a.cartographicToCartesian(d,I);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=x.interpolateUsingSurfaceDistance(R*p,g);A.height=_[R],T=a.cartographicToCartesian(A,I),e.pack(T,u,y),y+=3}return y}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var m=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,m).height}return r};var _=new l,p=new e,y=new e,T=new f(e.UNIT_X,0),R=new e,A=new f(e.UNIT_X,0),S=new e,v=new e,N=[],O=new t,g=new t,I=new e,M=new e,w=new e,x=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,_),c=l.multiplyByPoint(s,e.ZERO,p),h=e.normalize(l.multiplyByPointAsVector(s,e.UNIT_Y,y),y),d=f.fromPointNormal(c,h,T),E=e.normalize(l.multiplyByPointAsVector(s,e.UNIT_X,R),R),m=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var O=i[0],g=t.length,I=1;I<g;++I){var M=t[I];if(f.getPointDistance(m,O)<0||f.getPointDistance(m,M)<0){var w=u.lineSegmentPlane(O,M,d,S);if(r(w)){var x=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,O)<0&&e.negate(x,x),i.push(e.add(w,x,new e)),o.push(N+1),e.negate(x,x),i.push(e.add(w,x,new e)),N=1}}i.push(e.clone(t[I])),N++,O=M}o.push(N)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],M);if(l=f?l[0]:l,0!==l){var m=u.geodeticSurfaceNormal(h,I);e.multiplyByScalar(m,l,m),e.add(h,m,h)}return[h.x,h.y,h.z]}var _=t.minDistance;if(!r(_)){var p=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(p,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=E.numberOfPoints(a[y],a[y+1],_);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=a[y],g=a[y+1],w=f?l[y]:l,x=f?l[y+1]:l;S=d(v,g,_,u,w,x,A,S)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,O);P.height=f?l[o-1]:l;var U=u.cartographicToCartesian(P,I);return e.pack(U,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,a,i,o){"use strict";function u(e,t){return r.equalsEpsilon(e.latitude,t.latitude,r.EPSILON14)&&r.equalsEpsilon(e.longitude,t.longitude,r.EPSILON14)}function s(n,r,a,i){var o=r.length;if(!(o<2)){var s=t(i),c=t(a),h=!0,d=new Array(o),E=new Array(o),m=new Array(o),_=r[0];d[0]=_;var p=n.cartesianToCartographic(_,l);c&&(p.height=a[0]),h=h&&p.height<=0,E[0]=p.height,s?m[0]=i[0]:m[0]=0;for(var y=1,T=1;T<o;++T){var R=r[T],A=n.cartesianToCartographic(R,f);c&&(A.height=a[T]),h=h&&A.height<=0,u(p,A)?p.height<A.height&&(E[y-1]=A.height):(d[y]=R,E[y]=A.height,s?m[y]=i[T]:m[y]=0,e.clone(A,p),++y)}if(!(h||y<2))return d.length=y,E.length=y,m.length=y,{positions:d,topHeights:E,bottomHeights:m}}}var c={},l=new e,f=new e,h=new Array(2),d=new Array(2),E={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return c.computePositions=function(e,u,c,l,f,m){var _=s(e,u,c,l);if(t(_)){if(u=_.positions,c=_.topHeights,l=_.bottomHeights,u.length>=3){var p=n.fromPoints(u,e),y=p.projectPointsOntoPlane(u);a.computeWindingOrder2D(y)===o.CLOCKWISE&&(u.reverse(),c.reverse(),l.reverse())}var T,R,A=u.length,S=A-2,v=r.chordLength(f,e.maximumRadius),N=E;if(N.minDistance=v,N.ellipsoid=e,m){var O,g=0;for(O=0;O<A-1;O++)g+=i.numberOfPoints(u[O],u[O+1],v)+1;T=new Float64Array(3*g),R=new Float64Array(3*g);var I=h,M=d;N.positions=I,N.height=M;var w=0;for(O=0;O<A-1;O++){I[0]=u[O],I[1]=u[O+1],M[0]=c[O],M[1]=c[O+1];var x=i.generateArc(N);T.set(x,w),M[0]=l[O],M[1]=l[O+1],R.set(i.generateArc(N),w),w+=x.length}}else N.positions=u,N.height=c,T=new Float64Array(i.generateArc(N)),N.height=l,R=new Float64Array(i.generateArc(N));return{bottomPositions:R,topPositions:T,numCorners:S}}},c}),define("Core/WallGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./VertexFormat","./WallGeometryLibrary"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E){"use strict";function m(e){e=r(e,r.EMPTY_OBJECT);var n=e.positions,i=e.maximumHeights,u=e.minimumHeights,s=r(e.vertexFormat,d.DEFAULT),c=r(e.granularity,f.RADIANS_PER_DEGREE),l=r(e.ellipsoid,o.WGS84);this._positions=n,this._minimumHeights=u,this._maximumHeights=i,this._vertexFormat=d.clone(s),this._granularity=c,this._ellipsoid=o.clone(l),this._workerName="createWallGeometry";var h=1+n.length*t.packedLength+2;a(u)&&(h+=u.length),a(i)&&(h+=i.length),this.packedLength=h+o.packedLength+d.packedLength+1}var _=new t,p=new t,y=new t,T=new t,R=new t,A=new t,S=new t,v=new t;m.pack=function(e,n,i){i=r(i,0);var u,s=e._positions,c=s.length;for(n[i++]=c,u=0;u<c;++u,i+=t.packedLength)t.pack(s[u],n,i);var l=e._minimumHeights;if(c=a(l)?l.length:0,n[i++]=c,a(l))for(u=0;u<c;++u)n[i++]=l[u];var f=e._maximumHeights;if(c=a(f)?f.length:0,n[i++]=c,a(f))for(u=0;u<c;++u)n[i++]=f[u];return o.pack(e._ellipsoid,n,i),i+=o.packedLength,d.pack(e._vertexFormat,n,i),i+=d.packedLength,n[i]=e._granularity,n};var N=o.clone(o.UNIT_SPHERE),O=new d,g={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:N,vertexFormat:O,granularity:void 0};return m.unpack=function(e,n,i){n=r(n,0);var u,s=e[n++],c=new Array(s);for(u=0;u<s;++u,n+=t.packedLength)c[u]=t.unpack(e,n);s=e[n++];var l;if(s>0)for(l=new Array(s),u=0;u<s;++u)l[u]=e[n++];s=e[n++];var f;if(s>0)for(f=new Array(s),u=0;u<s;++u)f[u]=e[n++];var h=o.unpack(e,n,N);n+=o.packedLength;var E=d.unpack(e,n,O);n+=d.packedLength;var _=e[n];return a(i)?(i._positions=c,i._minimumHeights=l,i._maximumHeights=f,i._ellipsoid=o.clone(h,i._ellipsoid),i._vertexFormat=d.clone(E,i._vertexFormat),i._granularity=_,i):(g.positions=c,g.minimumHeights=l,g.maximumHeights=f,g.granularity=_,new m(g))},m.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,n,i=e.positions,o=e.minimumHeight,u=e.maximumHeight,s=a(o),c=a(u);if(s||c){var l=i.length;t=s?new Array(l):void 0,n=c?new Array(l):void 0;for(var f=0;f<l;++f)s&&(t[f]=o),c&&(n[f]=u)}var h={positions:i,maximumHeights:n,minimumHeights:t,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new m(h)},m.createGeometry=function(r){var i=r._positions,o=r._minimumHeights,d=r._maximumHeights,m=r._vertexFormat,N=r._granularity,O=r._ellipsoid,g=E.computePositions(O,i,d,o,N,!0);if(a(g)){var I=g.bottomPositions,M=g.topPositions,w=g.numCorners,x=M.length,C=2*x,P=m.position?new Float64Array(C):void 0,U=m.normal?new Float32Array(C):void 0,D=m.tangent?new Float32Array(C):void 0,L=m.bitangent?new Float32Array(C):void 0,F=m.st?new Float32Array(C/3*2):void 0,B=0,z=0,b=0,G=0,q=0,W=v,X=S,H=A,V=!0;x/=3;var Y,k=0,Z=1/(x-i.length+1);for(Y=0;Y<x;++Y){var j=3*Y,K=t.fromArray(M,j,_),J=t.fromArray(I,j,p);if(m.position&&(P[B++]=J.x,P[B++]=J.y,P[B++]=J.z,P[B++]=K.x,P[B++]=K.y,P[B++]=K.z),m.st&&(F[q++]=k,F[q++]=0,F[q++]=k,F[q++]=1),m.normal||m.tangent||m.bitangent){var Q,$=t.clone(t.ZERO,R),ee=O.scaleToGeodeticSurface(t.fromArray(M,j,p),p);if(Y+1<x&&(Q=O.scaleToGeodeticSurface(t.fromArray(M,j+3,y),y),$=t.fromArray(M,j+3,R)),V){var te=t.subtract($,K,T),ne=t.subtract(ee,K,_);W=t.normalize(t.cross(ne,te,W),W),V=!1}t.equalsEpsilon(Q,ee,f.EPSILON10)?V=!0:(k+=Z,m.tangent&&(X=t.normalize(t.subtract(Q,ee,X),X)),m.bitangent&&(H=t.normalize(t.cross(W,X,H),H))),m.normal&&(U[z++]=W.x,U[z++]=W.y,U[z++]=W.z,U[z++]=W.x,U[z++]=W.y,U[z++]=W.z),m.tangent&&(D[G++]=X.x,D[G++]=X.y,D[G++]=X.z,D[G++]=X.x,D[G++]=X.y,D[G++]=X.z),m.bitangent&&(L[b++]=H.x,L[b++]=H.y,L[b++]=H.z,L[b++]=H.x,L[b++]=H.y,L[b++]=H.z)}}var re=new c;m.position&&(re.position=new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:P})),m.normal&&(re.normal=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:U})),m.tangent&&(re.tangent=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:D})),m.bitangent&&(re.bitangent=new s({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:L})),m.st&&(re.st=new s({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:F}));var ae=C/3;C-=6*(w+1);var ie=l.createTypedArray(ae,C),oe=0;for(Y=0;Y<ae-2;Y+=2){var ue=Y,se=Y+2,ce=t.fromArray(P,3*ue,_),le=t.fromArray(P,3*se,p);if(!t.equalsEpsilon(ce,le,f.EPSILON10)){var fe=Y+1,he=Y+3;ie[oe++]=fe,ie[oe++]=ue,ie[oe++]=he,ie[oe++]=he,ie[oe++]=ue,ie[oe++]=se}}return new u({attributes:re,indices:ie,primitiveType:h.TRIANGLES,boundingSphere:new e.fromVertices(P)})}},m}),define("Workers/createWallGeometry",["../Core/defined","../Core/Ellipsoid","../Core/WallGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/createWallOutlineGeometry.js b/engines/Cesium/Workers/createWallOutlineGeometry.js index 52ff769..6a08aae 100644 --- a/engines/Cesium/Workers/createWallOutlineGeometry.js +++ b/engines/Cesium/Workers/createWallOutlineGeometry.js @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,m=a.z,_=l*l*d*d,p=f*f*E*E,y=h*h*m*m,T=_+p+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,O=o;O.x=A.x*S*2,O.y=A.y*v*2,O.z=A.z*N*2;var M,g,I,w,x,C,P,U,D,L,F,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{B-=z,I=1/(1+B*S),w=1/(1+B*v),x=1/(1+B*N),C=I*I,P=w*w,U=x*x,D=C*I,L=P*w,F=U*x,M=_*C+p*P+y*U-1,g=_*D*S+p*L*v+y*F*N;var b=-2*g;z=M/b}while(Math.abs(M)>r.EPSILON12);return t(c)?(c.x=l*I,c.y=f*w,c.z=h*x,c):new e(l*I,f*w,h*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:f,m=n(r)?r.oneOverRadiiSquared:h,_=n(r)?r._centerToleranceSquared:d,p=o(t,E,m,_,c);if(n(p)){var y=e.multiplyComponents(p,m,s);y=e.normalize(y,y);var T=e.subtract(t,p,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],h=m[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,_=e[s.getElementIndex(h,h)],p=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(h,f)],T=(_-p)/2/y;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=n-u-f+d,m=2*(a-h),_=2*(i+l),p=2*(a+h),y=-n+u-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+d;return r(t)?(t[0]=E,t[1]=p,t[2]=R,t[3]=m,t[4]=y,t[5]=A,t[6]=_,t[7]=T,t[8]=S,t):new s(E,m,_,p,y,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,E=i*a+c*o*u,m=-o*i+i*o*u,_=-o,p=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=_,t[3]=f,t[4]=E,t[5]=p,t[6]=h,t[7]=m,t[8]=y,t):new s(l,f,h,d,E,m,_,p,y)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],_=new s,p=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)f(d,_),s.transpose(_,p),s.multiply(d,_,d),s.multiply(p,d,d),s.multiply(h,_,h),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){ -"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,h,d,E,m,_){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(_,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,m=t.y*t.w,_=t.z*t.z,p=t.z*t.w,y=t.w*t.w,T=s-d-_+y,R=2*(c-p),A=2*(f+m),S=2*(c+p),v=-s+d-_+y,N=2*(E-h),O=2*(f-m),M=2*(E+h),g=-s-d+_+y;return r[0]=T*i,r[1]=S*i,r[2]=O*i,r[3]=0,r[4]=R*o,r[5]=v*o,r[6]=M*o,r[7]=0,r[8]=A*u,r[9]=N*u,r[10]=g*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,E=f.x,m=f.y,_=f.z,p=d.x,y=d.y,T=d.z,R=r.x,A=r.y,S=r.z,v=u*-R+s*-A+c*-S,N=p*-R+y*-A+T*-S,O=E*R+m*A+_*S;return a(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-m,n[7]=0,n[8]=c,n[9]=T,n[10]=-_,n[11]=0,n[12]=v,n[13]=N,n[14]=O,n[15]=1,n):new l(u,s,c,v,p,y,T,N,-E,-m,-_,O,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,E=f,m=i+c,_=o+l,p=t+f,y=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=_,a[14]=p,a[15]=y,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],m=e[12],_=e[13],p=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],O=t[6],M=t[7],g=t[8],I=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+m*S,F=a*T+s*R+h*A+_*S,B=i*T+c*R+d*A+p*S,z=o*T+l*R+E*A+y*S,b=r*v+u*N+f*O+m*M,G=a*v+s*N+h*O+_*M,q=i*v+c*N+d*O+p*M,W=o*v+l*N+E*O+y*M,X=r*g+u*I+f*w+m*x,H=a*g+s*I+h*w+_*x,V=i*g+c*I+d*w+p*x,Y=o*g+l*I+E*w+y*x,k=r*C+u*P+f*U+m*D,Z=a*C+s*P+h*U+_*D,j=i*C+c*P+d*U+p*D,K=o*C+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=H,n[10]=V,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],m=t[0],_=t[1],p=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],O=t[13],M=t[14],g=r*m+o*_+c*p,I=a*m+u*_+l*p,w=i*m+s*_+f*p,x=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,U=r*A+o*S+c*v,D=a*A+u*S+l*v,L=i*A+s*S+f*v,F=r*N+o*O+c*M+h,B=a*N+u*O+l*M+d,z=i*N+s*O+f*M+E;return n[0]=g,n[1]=I,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],m=t[3],_=t[4],p=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,S=a*h+u*d+l*E,v=i*h+s*d+f*E,N=r*m+o*_+c*p,O=a*m+u*_+l*p,M=i*m+s*_+f*p,g=r*y+o*T+c*R,I=a*y+u*T+l*R,w=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=O,n[6]=M,n[7]=0,n[8]=g,n[9]=I,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var _=new e;l.multiplyByUniformScale=function(e,t,n){return _.x=t,_.y=t,_.z=t,l.multiplyByScale(e,_,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var p=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,p),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],E=e[13],m=e[2],_=e[6],A=e[10],S=e[14],v=e[3],N=e[7],O=e[11],M=e[15],g=A*M,I=S*O,w=_*M,x=S*N,C=_*O,P=A*N,U=m*M,D=S*v,L=m*O,F=A*v,B=m*N,z=_*v,b=g*h+x*d+C*E-(I*h+w*d+P*E),G=I*f+U*d+F*E-(g*f+D*d+L*E),q=w*f+D*h+B*E-(x*f+U*h+z*E),W=P*f+L*h+z*d-(C*f+F*h+B*d),X=I*a+w*i+P*o-(g*a+x*i+C*o),H=g*r+D*i+L*o-(I*r+U*i+F*o),V=x*r+U*a+z*o-(w*r+D*a+B*o),Y=C*r+F*a+B*i-(P*r+L*a+z*i);g=i*E,I=o*d,w=a*E,x=o*h,C=a*d,P=i*h,U=r*E,D=o*f,L=r*d,F=i*f,B=r*h,z=a*f;var k=g*N+x*O+C*M-(I*N+w*O+P*M),Z=I*v+U*O+F*M-(g*v+D*O+L*M),j=w*v+D*N+B*M-(x*v+U*N+z*M),K=P*v+L*N+z*O-(C*v+F*N+B*O),J=w*A+P*S+I*_-(C*S+g*_+x*A),Q=L*S+g*m+D*A-(U*A+F*S+I*m),$=U*_+z*S+x*m-(B*S+w*m+D*_),ee=B*A+C*m+F*_-(L*_+z*A+P*m),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=H*te,n[6]=V*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,m=-i*f-o*h-u*d,_=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=_,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,f<0?m.latitude=f:h>0?m.latitude=h:m.latitude=0;for(var _=1;_<8;++_)m.longitude=-Math.PI+_*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,m=new e,_=new e,p=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,_),c=e.clone(r,p),l=e.clone(r,y),f=t.length,O=1;O<f;O++){e.clone(t[O],r);var M=r.x,g=r.y,I=r.z;M<i.x&&e.clone(r,i),M>s.x&&e.clone(r,s),g<o.y&&e.clone(r,o),g>c.y&&e.clone(r,c),I<u.z&&e.clone(r,u),I>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),B=Math.sqrt(F),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,R),.5,N),q=0;for(O=0;O<f;O++){e.clone(t[O],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var H=Math.sqrt(X);B=.5*(B+H),F=B*B;var V=H-B;L.x=(B*L.x+V*r.x)/H,L.y=(B*L.y+V*r.y)/H,L.z=(B*L.z+V*r.z)/H}}return B<q?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var O=new o,M=new e,g=new e,I=new t,w=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,O),f.southwest(t,I),I.height=i,f.northeast(t,w),w.height=o;var s=n.project(I,M),c=n.project(w,g),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*d,m.z=s.z+.5*E,u};var x=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,m),f=e.clone(u,_),O=e.clone(u,p),M=e.clone(u,y),g=t.length,I=0;I<g;I+=i){var w=t[I]+n.x,x=t[I+1]+n.y,C=t[I+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>O.y&&e.clone(u,O),C<l.z&&e.clone(u,l),C>M.z&&e.clone(u,M)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(O,c,R)),D=e.magnitudeSquared(e.subtract(M,l,R)),L=s,F=f,B=P;U>B&&(B=U,L=c,F=O),D>B&&(B=D,L=l,F=M);var z=A;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=O.y,W.z=M.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),H=0;for(I=0;I<g;I+=i){u.x=t[I]+n.x,u.y=t[I+1]+n.y,u.z=t[I+2]+n.z;var V=e.magnitude(e.subtract(u,X,R));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);G=.5*(G+k),b=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<H?(e.clone(z,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,_),l=e.clone(i,p),f=e.clone(i,y),O=t.length,M=0;M<O;M+=3){var g=t[M]+n[M],I=t[M+1]+n[M+1],w=t[M+2]+n[M+2];i.x=g,i.y=I,i.z=w,g<o.x&&e.clone(i,o),g>c.x&&e.clone(i,c),I<u.y&&e.clone(i,u),I>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=x;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,F,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(M=0;M<O;M+=3){i.x=t[M]+n[M],i.y=t[M+1]+n[M+1],i.z=t[M+2]+n[M+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>B){var V=Math.sqrt(H);z=.5*(z+V),B=z*z;var Y=V-z;F.x=(z*F.x+Y*i.x)/V,F.y=(z*F.y+Y*i.y)/V,F.z=(z*F.z+Y*i.z)/V}}return z<W?(e.clone(F,r.center),r.radius=z):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D),s=e.magnitude(i),l=e.magnitude(o),f=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,f),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var B=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,H=new e,V=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,H),d=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,d,m),m=E[2],e.add(s,f,m),e.add(m,d,m),m=E[3],e.add(s,f,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,d,m),m=E[6],e.add(s,f,m),e.add(m,d,m),m=E[7],e.add(s,f,m),e.add(m,c,m);for(var _=E.length,p=0;p<_;++p){var y=E[p];e.add(o,y,y);var T=i.cartesianToCartographic(y,V);n.project(T,y)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(v)&&(v=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(O=!0,M=r(e[1]),M.isNightly=!!e[2])}return O}function c(){return s()&&M}function l(){if(!t(g)){g=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,I=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(g=!0,I=r(e[1])))}return g}function f(){return l()&&I}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function d(){return h()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent); -null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function _(){return E()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,O,M,g,I,w,x,C,P,U,D,L,F,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:_,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:y,imageRenderingValue:T};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,m=d.y,_=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(_,u),l=Math.max(_,l)}var p=r.minimum;p.x=a,p.y=o,p.z=u;var y=r.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(p,y,r.center);return e.multiplyByScalar(T,.5,T),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,m=o*c-u*s,_=u*c-d,p=4*E*_-m*m;if(p<0){var y,T,R;h*f>=l*d?(y=o,T=E,R=-2*u*E+o*m):(y=c,T=_,R=-c*m+2*s*_);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);i=-R+S;var v=i/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),O=i===S?-N:-T/N;return a=T<=0?N+O:-R/(N*N+O*O+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var M=E,g=-2*u*E+o*m,I=_,w=-c*m+2*s*_,x=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-g)/3);a=2*Math.sqrt(-M);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-I),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=i+D<2*s?i+s:D+s,G=z/b,q=F*b,W=-L*b-F*z,X=L*z,H=(s*W-u*X)/(-u*W+s*q);return B<=H?B<=G?H<=G?[B,H,G]:[B,G,H]:[G,B,H]:B<=G?[H,B,G]:H<=G?[H,G,B]:[G,H,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,_=E[0],p=E[1];if(_>=0&&p>=0){var y=Math.sqrt(_),T=Math.sqrt(p);return[h-T,h-y,h+y,h+T]}if(_>=0&&p<0)return m=Math.sqrt(_),[h-m,h+m];if(_<0&&p>=0)return m=Math.sqrt(p),[h-m,h+m]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,m,_=d[0],p=a-_,y=p*p,T=t/2,R=p/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*_,N=c+4*Math.abs(_);if(_<0||A*N<v*S){var O=Math.sqrt(v);E=O/2,m=0===O?0:(t*R-i)/O}else{var M=Math.sqrt(A);E=0===M?0:(t*R-i)/M,m=M/2}var g,I;0===T&&0===E?(g=0,I=0):n.sign(T)===n.sign(E)?(g=T+E,I=_/g):(I=T-E,g=_/I);var w,x;0===R&&0===m?(w=0,x=0):n.sign(R)===n.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var C=r.computeRealRoots(1,g,w),P=r.computeRealRoots(1,I,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,m=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),h=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=f(h,d,E,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,h=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,m=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),_=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,p=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===p){if(l=s.computeRealRoots(E,m,_),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-v)),T.push(new e(a,i*S,i*v))}return T}var N=y*y,O=p*p,M=E*E,g=y*p,I=M+O,w=2*(m*E+g),x=2*_*E+m*m-O+N,C=2*(_*m-g),P=_*_-N;if(0===I&&0===w&&0===x&&0===C)return T;l=c.computeRealRoots(I,w,x,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=o.sign(E)===o.sign(_)?d(E*B+_,m*F,o.EPSILON12):o.sign(_)===o.sign(m*F)?d(E*B,m*F+_,o.EPSILON12):d(E*B+m*F,_,o.EPSILON12);var G=d(p*F,y,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++D):T.push(new e(a,i*F,i*b))}return T}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var _=new e,p=new e,y=new e,T=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,m=e.subtract(a,r,_),A=e.subtract(i,r,p),S=e.cross(E,A,y),v=e.dot(m,S);if(u){if(v<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,S),l<0||l>v)return; -if(c=e.cross(s,m,R),f=e.dot(E,c),f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<o.EPSILON6)return;var N=1/v;if(s=e.subtract(d,r,T),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,m,R),f=e.dot(E,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new l;m.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,O=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,O),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var E=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var m=s/a,_=r/s;return m<_?new i(m,_):{start:_,stop:m}}var p=Math.sqrt(r/a);return new i(p,p)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var M=new e,g=new e,I=new e,w=new e,x=new e,C=new u,P=new u,U=new u,D=new u,L=new u,F=new u,B=new u,z=new e,b=new e,G=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,M);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,M),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,g),g),m=e.normalize(e.cross(f,d,I),I),_=C;_[0]=f.x,_[1]=f.y,_[2]=f.z,_[3]=d.x,_[4]=d.y,_[5]=d.z,_[6]=m.x,_[7]=m.y,_[8]=m.z;var p=u.transpose(_,P),y=u.fromScale(n.radii,U),T=u.fromScale(n.oneOverRadii,D),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,v=u.multiply(u.multiply(p,T,F),R,F),N=u.multiply(u.multiply(v,y,B),_,B),O=u.multiplyByVector(v,a,x),q=E(N,e.negate(O,M),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),H=Number.NEGATIVE_INFINITY,V=0;V<W;++V){A=u.multiplyByVector(y,u.multiplyByVector(_,q[V],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>H&&(H=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-H*H),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var q=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,f),m.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return m.lineSegmentPlane(n,r,a,f),m.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,f),m.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,f),m.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,f),m.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,f),m.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return m(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=p,m(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return _(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,f,h,d,E,m,_,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(_=d.progress,m=function(e){h.push(e),--l||(E=m=p,d.reject(h))},E=function(e){f.push(e),--c||(E=m=p,d.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,_);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return _(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function _(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,m,_,p;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(p),y,c,f,R,S);case"c":return u(String.fromCharCode(+p),y,c,f,R);case"b":return o(p,2,A,y,c,f,R);case"o":return o(p,8,A,y,c,f,R);case"x":return o(p,16,A,y,c,f,R);case"X":return o(p,16,A,y,c,f,R).toUpperCase();case"u":return o(p,10,A,y,c,f,R);case"i":case"d":return d=+p||0,d=Math.round(d-d%1),E=d<0?"-":T,p=E+a(String(Math.abs(d)),f,"0",!1),i(p,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+p,E=d<0?"-":T,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],_=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],p=E+Math.abs(d)[m](f),i(p,E,y,c,R)[_]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=m.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var _=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,M=/^(\d{2})(\.\d+)?/.source+O.source,g=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,I=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,_=0,T=0,O=0,w=u[0],x=u[1];if(u=w.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(v),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(x)){u=x.match(I),null!==u?(h=+u[1],_=+u[2],T=+u[3],O=1e3*+(u[4]||0),L=5):(u=x.match(g),null!==u?(h=+u[1],_=+u[2],T=60*+(u[3]||0),L=4):(u=x.match(M),null!==u&&(h=+u[1],_=60*+(u[2]||0),L=3)));var F=u[L],B=+u[L+1],z=+(u[L+2]||0);switch(F){case"+":h-=B,_-=z;break;case"-":h+=B,_+=z;break;case"Z":break;default:_+=new Date(Date.UTC(n,s-1,l,h,_)).getTimezoneOffset()}}else _+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;_>=60;)_-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?y:p[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:p[s-1];for(;_<0;)_+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:p[s-1],l+=a;var G=E(n,s,l,h,_,T,O);return r(t)?(d(G[0],G[1],t),f(t)):t=new m(G[0],G[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=h(e,w);r(a)||(m.addSeconds(e,-1,w),a=h(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var _=d+2-12*c|0,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=p,t.month=_,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,_,E,y,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,_),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){T.julianDate=e;var n=m.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var _=e._samples=n.samples,p=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=_.length;R<A;R+=e._columnCount){var S=_[R+a],v=_[R+m],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(N,v,f.TAI);if(p.push(O),T){if(v!==y&&r(y)){var M=o.leapSeconds,g=t(M,O,d);if(g<0){var I=new u(O,v);M.splice(~g,0,I)}}y=v}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function _(e,t,n){return t+e*(n-t)}function p(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],p=n[d+e._ut1MinusUtcSecondsColumn],y=p-E;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=p:p-=R-T)}return u.xPoleWander=_(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=_(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=_(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=_(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=_(f,E,p),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),m=E||o.greaterThanOrEquals(h,e);if(d&&m)return s=u,!E&&h.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var _=t(i,e,o.compare,this._dateColumn);return _>=0?(_<i.length-1&&i[_+1].equals(e)&&++_,s=_,l=_):(l=~_,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a")); -var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,_=i-s*this._stepSizeDays,p=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)p[E]=_-R[E];for(E=0;E<=u;++E){for(T[E]=1,m=0;m<=u;++m)m!==E&&(T[E]*=p[m]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=h,a):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+f+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var _=h,p=0;f>s&&(p=1),E>s&&E>f&&(p=2);var y=_[p],T=_[y];n=Math.sqrt(e[c.getElementIndex(p,p)]-e[c.getElementIndex(y,y)]-e[c.getElementIndex(T,T)]+1);var R=d;R[p]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,y)]-e[c.getElementIndex(y,T)])*n,R[y]=(e[c.getElementIndex(y,p)]+e[c.getElementIndex(p,y)])*n,R[T]=(e[c.getElementIndex(T,p)]+e[c.getElementIndex(p,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,_=new l,p=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),p=l.fromAxisAngle(e.UNIT_X,o.roll,E),_=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(_,p,_),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var y=new e,T=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,y);var u=l.computeAngle(R);r[o]=y.x*u,r[o+1]=y.y*u,r[o+2]=y.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var v=new l;l.lerp=function(e,t,n,r){return v=l.multiplyByScalar(t,n,v),r=l.multiplyByScalar(e,1-n,r),l.add(v,r,r)};var N=new l,O=new l,M=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return O=l.multiplyByScalar(e,Math.sin((1-n)*o),O),M=l.multiplyByScalar(i,Math.sin(n*o),M),r=l.add(O,M,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var g=new e,I=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,g);l.multiply(i,t,x);var u=l.log(x,I);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],D=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;U[B]=1/(z*b),D[B]=z/b}return U[7]=P/136,D[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)L[f]=(U[f]*s-D[f])*o,F[f]=(U[f]*c-D[f])*o;var h=a*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),d=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,h,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,m,_,p,y,T,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},v={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},N={},O={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},M=new n,g=new n,I=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(N[i])?r=N[i]:(r=function(r,i,s){if(u(s)||(s=new y),_.equalsEpsilon(r.x,0,_.EPSILON14)&&_.equalsEpsilon(r.y,0,_.EPSILON14)){var c=_.sign(r.z);n.unpack(v[e],0,M),"east"!==e&&"west"!==e&&n.multiplyByScalar(M,c,M),n.unpack(v[t],0,g),"east"!==t&&"west"!==t&&n.multiplyByScalar(g,c,g),n.unpack(v[a],0,I),"east"!==a&&"west"!==a&&n.multiplyByScalar(I,c,I)}else{i=o(i,h.WGS84),i.geodeticSurfaceNormal(r,O.up);var l=O.up,f=O.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,O.east),n.cross(l,f,O.north),n.multiplyByScalar(O.up,-1,O.down),n.multiplyByScalar(O.east,-1,O.west),n.multiplyByScalar(O.north,-1,O.south),M=O[e],g=O[t],I=O[a]}return s[0]=M.x,s[1]=M.y,s[2]=M.z,s[3]=0,s[4]=g.x,s[5]=g.y,s[6]=g.z,s[7]=0,s[8]=I.x,s[9]=I.y,s[10]=I.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},N[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new T,x=new n(1,1,1),C=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof y&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,w),c=y.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),y.multiply(i,c,i)};var P=new y,U=new p;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=y.getRotation(i,U);return T.fromRotationMatrix(o,a)};var D=24110.54841,L=8640184.812866,F=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,G=_.TWO_PI/86400,q=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){q=m.addSeconds(e,-m.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(L+n*(F+n*B)),s=o*G%_.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return p.transpose(n,t)};var H=new E(0,0,0),V=new f(0,0,0,0,0,0),Y=new p,k=new p;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,V);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,H);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=p.fromRotationZ(-i.s,k),h=p.multiply(l,f,Y),d=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=d-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*_.TWO_PI;var v=p.fromRotationZ(S,k),N=p.multiply(h,v,Y),O=Math.cos(n.xPoleWander),M=Math.cos(n.yPoleWander),g=Math.sin(n.xPoleWander),I=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*_.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=k;return U[0]=O*C,U[1]=O*P,U[2]=g,U[3]=-M*P+I*g*C,U[4]=M*C+I*g*P,U[5]=-I*O,U[6]=-I*P-M*g*C,U[7]=I*C-M*g*P,U[8]=M*O,p.multiply(N,U,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,h.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,_.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new y,ue=new y;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=y.getColumn(t,3,te),u=i.cartesianToCartographic(o,Q),s=A.eastNorthUpToFixedFrame(o,i,oe),c=y.inverseTransformation(s,ue),l=e.project(u,$),f=ne;f.x=l.z,f.y=l.x,f.z=l.y,f.w=1;var h=y.getColumn(t,0,ee),d=n.magnitude(h),E=y.multiplyByVector(c,h,re);r.fromElements(E.z,E.x,E.y,0,E);var m=y.getColumn(t,1,ee),_=n.magnitude(m),p=y.multiplyByVector(c,m,ae);r.fromElements(p.z,p.x,p.y,0,p);var T=y.getColumn(t,2,ee),R=n.magnitude(T),S=ie;return n.cross(E,p,S),n.normalize(S,S),n.cross(p,S,E),n.normalize(E,E),n.cross(S,E,p),n.normalize(p,p),n.multiplyByScalar(E,d,E),n.multiplyByScalar(p,_,p),n.multiplyByScalar(S,R,S),y.setColumn(a,0,E,a),y.setColumn(a,1,p,a),y.setColumn(a,2,S,a),y.setColumn(a,3,f,a),a};var se=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,oe),i=y.inverseTransformation(a,ue),o=r.cartesianToCartographic(t,Q),u=e.project(o,$),s=ne;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=y.fromTranslation(s,oe);return y.multiply(se,i,n),y.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=f.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var _=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,_);return new E(r.center,n)};var p=new h,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=p;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,E,m,_;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var p=a;p<o;p+=a)E=e[p],m=e[p+1],E<l&&(l=E),m<f&&(f=m),E>h&&(h=E),m>d&&(d=m);_=Math.max(h-l,d-f)}return r(u,c,a,l,f,_),c}function t(e,t,n,r,a){var i,o;if(a===I(e,t,n,r)>0)for(i=t;i<n;i+=r)o=O(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=O(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(M(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(M(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,m,_=e;e.prev!==e.next;)if(E=e.prev,m=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(m.i/s),M(e),e=m.next,_=m.next;else if(e=m,e===_){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(_(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),h=E(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&_(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&_(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&S(a,i)&&S(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),M(r),M(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&p(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(m(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&_(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function m(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function _(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new g(e.i,e.x,e.y),r=new g(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function O(e,t,n,r){var a=new g(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function M(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 g(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(I(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(I(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,E=new n,m={};m.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},m.computeWindingOrder2D=function(e){var t=m.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},m.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var _=new n,p=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return m.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,m=new Array(3*E),v=0;for(h=0;h<E;h++){var N=t[h];m[v++]=N.x,m[v++]=N.y,m[v++]=N.z}for(var O=[],M={},g=e.maximumRadius,I=l.chordLength(u,g),w=I*I;d.length>0;){var x,C,P=d.pop(),U=d.pop(),D=d.pop(),L=n.fromArray(m,3*D,_),F=n.fromArray(m,3*U,p),B=n.fromArray(m,3*P,y),z=n.multiplyByScalar(n.normalize(L,T),g,T),b=n.multiplyByScalar(n.normalize(F,R),g,R),G=n.multiplyByScalar(n.normalize(B,A),g,A),q=n.magnitudeSquared(n.subtract(z,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),X=n.magnitudeSquared(n.subtract(G,z,S)),H=Math.max(q,W,X);H>w?q===H?(x=Math.min(D,U)+" "+Math.max(D,U),h=M[x],i(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,M[x]=h),d.push(D,h,P),d.push(h,U,P)):W===H?(x=Math.min(U,P)+" "+Math.max(U,P),h=M[x],i(h)||(C=n.add(F,B,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,M[x]=h),d.push(U,h,D),d.push(h,P,D)):X===H&&(x=Math.min(P,D)+" "+Math.max(P,D),h=M[x],i(h)||(C=n.add(B,L,S),n.multiplyByScalar(C,.5,C),m.push(C.x,C.y,C.z),h=m.length/3-1,M[x]=h),d.push(P,h,U),d.push(h,D,U)):(O.push(D),O.push(U),O.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:m})},indices:O,primitiveType:f.TRIANGLES})},m.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},m}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,E=Math.sqrt(d),m=t/4,_=m*m,p=_*m,y=_*_,T=1+m-3*_/4+5*p/4-175*y/64,R=1-m+15*_/8-35*p/8,A=1-3*m+35*_/4,S=1-5*m,v=T*l-R*Math.sin(2*l)*m/2-A*Math.sin(4*l)*_/16-S*Math.sin(6*l)*p/48-5*Math.sin(8*l)*y/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=d,N.cosineAlpha=E,N.u2Over4=m,N.u4Over16=_,N.u6Over64=p,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,E=(t-n)/t,m=i-r,_=Math.atan((1-E)*Math.tan(a)),p=Math.atan((1-E)*Math.tan(o)),y=Math.cos(_),T=Math.sin(_),R=Math.cos(p),A=Math.sin(p),S=y*R,v=y*A,N=T*A,O=T*R,M=m,g=u.TWO_PI,I=Math.cos(M),w=Math.sin(M);do{I=Math.cos(M),w=Math.sin(M);var x=v-O*I;f=Math.sqrt(R*R*w*w+x*x),c=N+S*I,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*w/f,h=1-C*C),g=M,d=c-2*N/h,isNaN(d)&&(d=0),M=m+l(E,C,h,s,f,c,d)}while(Math.abs(M-g)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),U=1+P*(4096+P*(P*(320-175*P)-768))/16384,D=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,F=D*f*(d+D*(c*(2*L-1)-D*d*(4*f*f-3)*(4*L-3)/6)/4),B=n*U*(s-F),z=Math.atan2(R*w,v-O*I),b=Math.atan2(y*w,v*I-O);e._distance=B,e._startHeading=z,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,m),E),e.normalize(i.cartographicToCartesian(a,m),m);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var E=new e,m=new e;return a(d.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}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),E=i*i,m=i*E,_=a.u8Over256,p=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*m*_*o/3+i*(1-p+7*T/4-15*y/4+579*_/64-(T-15*y/4+187*_/16)*o-(5*y/4-115*_/16)*u-29*_*s/16)+(p/2-T+71*y/32-85*_/16)*c+(5*T/16-5*y/4+383*_/96)*f-E*((y-11*_/2)*c+5*_*f/2)+(29*y/96-29*_/16)*h+539*_*d/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A)); -R-=a.sigma;var v=Math.cos(2*a.sigma+R),N=Math.sin(R),O=Math.cos(R),M=a.cosineU*O,g=a.sineU*N,I=Math.atan2(N*a.sineHeading,M-g*a.cosineHeading),w=I-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,O,v);return r(n)?(n.longitude=this._start.longitude+w,n.latitude=S,n.height=0,n):new t(this._start.longitude+w,S,0)},d}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,I),l=a.scaleToGeodeticSurface(n,w),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,O),m=a.cartesianToCartographic(l,M),_=h(f,i,o);x.setEndPoints(d,m);var p=x.surfaceDistance/f,y=s;d.height=i;var T=a.cartographicToCartesian(d,g);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=x.interpolateUsingSurfaceDistance(R*p,M);A.height=_[R],T=a.cartographicToCartesian(A,g),e.pack(T,u,y),y+=3}return y}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var m=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,m).height}return r};var _=new l,p=new e,y=new e,T=new f(e.ZERO,0),R=new e,A=new f(e.ZERO,0),S=new e,v=new e,N=[],O=new t,M=new t,g=new e,I=new e,w=new e,x=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,_),c=l.multiplyByPoint(s,e.ZERO,p),h=l.multiplyByPointAsVector(s,e.UNIT_Y,y),d=f.fromPointNormal(c,h,T),E=l.multiplyByPointAsVector(s,e.UNIT_X,R),m=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var O=i[0],M=t.length,g=1;g<M;++g){var I=t[g];if(f.getPointDistance(m,O)<0||f.getPointDistance(m,I)<0){var w=u.lineSegmentPlane(O,I,d,S);if(r(w)){var x=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,O)<0&&e.negate(x,x),i.push(e.add(w,x,new e)),o.push(N+1),e.negate(x,x),i.push(e.add(w,x,new e)),N=1}}i.push(e.clone(t[g])),N++,O=I}o.push(N)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],I);if(l=f?l[0]:l,0!==l){var m=u.geodeticSurfaceNormal(h,g);e.multiplyByScalar(m,l,m),e.add(h,m,h)}return[h.x,h.y,h.z]}var _=t.minDistance;if(!r(_)){var p=n(t.granularity,c.RADIANS_PER_DEGREE);_=c.chordLength(p,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=E.numberOfPoints(a[y],a[y+1],_);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=a[y],M=a[y+1],w=f?l[y]:l,x=f?l[y+1]:l;S=d(v,M,_,u,w,x,A,S)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,O);P.height=f?l[o-1]:l;var U=u.cartographicToCartesian(P,g);return e.pack(U,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,a,i,o){"use strict";function u(e,t){return r.equalsEpsilon(e.latitude,t.latitude,r.EPSILON14)&&r.equalsEpsilon(e.longitude,t.longitude,r.EPSILON14)}function s(n,r,a,i){var o=r.length;if(!(o<2)){var s=t(i),c=t(a),h=!0,d=new Array(o),E=new Array(o),m=new Array(o),_=r[0];d[0]=_;var p=n.cartesianToCartographic(_,l);c&&(p.height=a[0]),h=h&&p.height<=0,E[0]=p.height,s?m[0]=i[0]:m[0]=0;for(var y=1,T=1;T<o;++T){var R=r[T],A=n.cartesianToCartographic(R,f);c&&(A.height=a[T]),h=h&&A.height<=0,u(p,A)?p.height<A.height&&(E[y-1]=A.height):(d[y]=R,E[y]=A.height,s?m[y]=i[T]:m[y]=0,e.clone(A,p),++y)}if(!(h||y<2))return d.length=y,E.length=y,m.length=y,{positions:d,topHeights:E,bottomHeights:m}}}var c={},l=new e,f=new e,h=new Array(2),d=new Array(2),E={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return c.computePositions=function(e,u,c,l,f,m){var _=s(e,u,c,l);if(t(_)){if(u=_.positions,c=_.topHeights,l=_.bottomHeights,u.length>=3){var p=n.fromPoints(u,e),y=p.projectPointsOntoPlane(u);a.computeWindingOrder2D(y)===o.CLOCKWISE&&(u.reverse(),c.reverse(),l.reverse())}var T,R,A=u.length,S=A-2,v=r.chordLength(f,e.maximumRadius),N=E;if(N.minDistance=v,N.ellipsoid=e,m){var O,M=0;for(O=0;O<A-1;O++)M+=i.numberOfPoints(u[O],u[O+1],v)+1;T=new Float64Array(3*M),R=new Float64Array(3*M);var g=h,I=d;N.positions=g,N.height=I;var w=0;for(O=0;O<A-1;O++){g[0]=u[O],g[1]=u[O+1],I[0]=c[O],I[1]=c[O+1];var x=i.generateArc(N);T.set(x,w),I[0]=l[O],I[1]=l[O+1],R.set(i.generateArc(N),w),w+=x.length}}else N.positions=u,N.height=c,T=new Float64Array(i.generateArc(N)),N.height=l,R=new Float64Array(i.generateArc(N));return{bottomPositions:R,topPositions:T,numCorners:S}}},c}),define("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e){e=r(e,r.EMPTY_OBJECT);var n=e.positions,i=e.maximumHeights,u=e.minimumHeights,s=r(e.granularity,f.RADIANS_PER_DEGREE),c=r(e.ellipsoid,o.WGS84);this._positions=n,this._minimumHeights=u,this._maximumHeights=i,this._granularity=s,this._ellipsoid=o.clone(c),this._workerName="createWallOutlineGeometry";var l=1+n.length*t.packedLength+2;a(u)&&(l+=u.length),a(i)&&(l+=i.length),this.packedLength=l+o.packedLength+1}var m=new t,_=new t;E.pack=function(e,n,i){i=r(i,0);var u,s=e._positions,c=s.length;for(n[i++]=c,u=0;u<c;++u,i+=t.packedLength)t.pack(s[u],n,i);var l=e._minimumHeights;if(c=a(l)?l.length:0,n[i++]=c,a(l))for(u=0;u<c;++u)n[i++]=l[u];var f=e._maximumHeights;if(c=a(f)?f.length:0,n[i++]=c,a(f))for(u=0;u<c;++u)n[i++]=f[u];return o.pack(e._ellipsoid,n,i),i+=o.packedLength,n[i]=e._granularity,n};var p=o.clone(o.UNIT_SPHERE),y={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:p,granularity:void 0};return E.unpack=function(e,n,i){n=r(n,0);var u,s=e[n++],c=new Array(s);for(u=0;u<s;++u,n+=t.packedLength)c[u]=t.unpack(e,n);s=e[n++];var l;if(s>0)for(l=new Array(s),u=0;u<s;++u)l[u]=e[n++];s=e[n++];var f;if(s>0)for(f=new Array(s),u=0;u<s;++u)f[u]=e[n++];var h=o.unpack(e,n,p);n+=o.packedLength;var d=e[n];return a(i)?(i._positions=c,i._minimumHeights=l,i._maximumHeights=f,i._ellipsoid=o.clone(h,i._ellipsoid),i._granularity=d,i):(y.positions=c,y.minimumHeights=l,y.maximumHeights=f,y.granularity=d,new E(y))},E.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,n,i=e.positions,o=e.minimumHeight,u=e.maximumHeight,s=a(o),c=a(u);if(s||c){var l=i.length;t=s?new Array(l):void 0,n=c?new Array(l):void 0;for(var f=0;f<l;++f)s&&(t[f]=o),c&&(n[f]=u)}var h={positions:i,maximumHeights:n,minimumHeights:t,ellipsoid:e.ellipsoid};return new E(h)},E.createGeometry=function(r){var i=r._positions,o=r._minimumHeights,E=r._maximumHeights,p=r._granularity,y=r._ellipsoid,T=d.computePositions(y,i,E,o,p,!1);if(a(T)){var R=T.bottomPositions,A=T.topPositions,S=A.length,v=2*S,N=new Float64Array(v),O=0;S/=3;var M;for(M=0;M<S;++M){var g=3*M,I=t.fromArray(A,g,m),w=t.fromArray(R,g,_);N[O++]=w.x,N[O++]=w.y,N[O++]=w.z,N[O++]=I.x,N[O++]=I.y,N[O++]=I.z}var x=new c({position:new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:N})}),C=v/3;v=2*C-4+C;var P=l.createTypedArray(C,v),U=0;for(M=0;M<C-2;M+=2){var D=M,L=M+2,F=t.fromArray(N,3*D,m),B=t.fromArray(N,3*L,_);if(!t.equalsEpsilon(F,B,f.EPSILON10)){var z=M+1,b=M+3;P[U++]=z,P[U++]=D,P[U++]=z,P[U++]=b,P[U++]=D,P[U++]=L}}return P[U++]=C-2,P[U++]=C-1,new u({attributes:x,indices:P,primitiveType:h.LINES,boundingSphere:new e.fromVertices(N)})}},E}),define("Workers/createWallOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/WallOutlineGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var f=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,f=r*u-a*o;return n.x=c,n.y=l,n.z=f,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var h=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);h.x=c*Math.cos(e),h.y=c*Math.sin(e),h.z=Math.sin(r),h=o.normalize(h,h),o.multiplyComponents(s,h,d);var l=Math.sqrt(o.dot(h,d));return d=o.divideByScalar(d,l,d),h=o.multiplyByScalar(h,a,h),n(u)||(u=new o),o.add(d,h,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,f=n.y,h=n.z,d=a.x,E=a.y,_=a.z,m=l*l*d*d,p=f*f*E*E,y=h*h*_*_,T=m+p+y,R=Math.sqrt(1/T),A=e.multiplyByScalar(n,R,i);if(T<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,v=u.y,N=u.z,O=o;O.x=A.x*S*2,O.y=A.y*v*2,O.z=A.z*N*2;var M,I,g,w,x,C,P,U,D,L,F,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(O)),z=0;do{B-=z,g=1/(1+B*S),w=1/(1+B*v),x=1/(1+B*N),C=g*g,P=w*w,U=x*x,D=C*g,L=P*w,F=U*x,M=m*C+p*P+y*U-1,I=m*D*S+p*L*v+y*F*N;var b=-2*I;z=M/b}while(Math.abs(M)>r.EPSILON12);return t(c)?(c.x=l*g,c.y=f*w,c.z=h*x,c):new e(l*g,f*w,h*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,a,i){return a=n(a,0),r(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,f=new e(1/6378137,1/6378137,1/6356752.314245179),h=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:f,_=r(n)?n.oneOverRadiiSquared:h,m=r(n)?n._centerToleranceSquared:d,p=o(t,E,_,m,c);if(r(p)){var y=e.multiplyComponents(p,_,s);y=e.normalize(y,y);var T=e.subtract(t,p,l),R=Math.atan2(y.y,y.x),A=Math.asin(y.z),S=i.sign(e.dot(T,t))*e.magnitude(T);return r(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var f=new e,h=new e;l.prototype.cartographicToCartesian=function(t,n){var a=f,i=h;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,_=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,_),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),f=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=f,a):new t(c,l,f)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(_[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function f(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(_[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,f=E[a],h=_[a];if(Math.abs(e[s.getElementIndex(h,f)])>n){var d,m=e[s.getElementIndex(h,h)],p=e[s.getElementIndex(f,f)],y=e[s.getElementIndex(h,f)],T=(m-p)/2/y;d=T<0?-1/(-T+Math.sqrt(1+T*T)):1/(T+Math.sqrt(1+T*T)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(f,f)]=t[s.getElementIndex(h,h)]=c,t[s.getElementIndex(h,f)]=l,t[s.getElementIndex(f,h)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,f=e.z*e.z,h=e.z*e.w,d=e.w*e.w,E=n-u-f+d,_=2*(a-h),m=2*(i+l),p=2*(a+h),y=-n+u-f+d,T=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+f+d;return r(t)?(t[0]=E,t[1]=p,t[2]=R,t[3]=_,t[4]=y,t[5]=A,t[6]=m,t[7]=T,t[8]=S,t):new s(E,_,m,p,y,T,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,f=-i*u+c*o*a,h=c*u+i*o*a,d=n*u,E=i*a+c*o*u,_=-c*a+i*o*u,m=-o,p=c*n,y=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=m,t[3]=f,t[4]=E,t[5]=p,t[6]=h,t[7]=_,t[8]=y,t):new s(l,f,h,d,E,_,m,p,y)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var h=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],h)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],h)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],h)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],f=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=f,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],_=[2,2,1],m=new s,p=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var h=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)f(d,m),s.transpose(m,p),s.multiply(d,m,d),s.multiply(p,d,d),s.multiply(h,m,h),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],f=e[8],h=s.determinant(e);t[0]=o*f-l*u,t[1]=l*a-r*f,t[2]=r*u-o*a,t[3]=c*u-i*f,t[4]=n*f-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/h;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){ +"use strict";function l(e,t,n,a,i,o,u,s,c,l,f,h,d,E,_,m){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(f,0),this[11]=r(_,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(h,0),this[15]=r(m,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,f=t.x*t.z,h=t.x*t.w,d=t.y*t.y,E=t.y*t.z,_=t.y*t.w,m=t.z*t.z,p=t.z*t.w,y=t.w*t.w,T=s-d-m+y,R=2*(c-p),A=2*(f+_),S=2*(c+p),v=-s+d-m+y,N=2*(E-h),O=2*(f-_),M=2*(E+h),I=-s-d+m+y;return r[0]=T*i,r[1]=S*i,r[2]=O*i,r[3]=0,r[4]=R*o,r[5]=v*o,r[6]=M*o,r[7]=0,r[8]=A*u,r[9]=N*u,r[10]=I*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var f=new e,h=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,f),e.normalize(e.cross(f,o,h),h),e.normalize(e.cross(h,f,d),d);var u=h.x,s=h.y,c=h.z,E=f.x,_=f.y,m=f.z,p=d.x,y=d.y,T=d.z,R=r.x,A=r.y,S=r.z,v=u*-R+s*-A+c*-S,N=p*-R+y*-A+T*-S,O=E*R+_*A+m*S;return a(n)?(n[0]=u,n[1]=p,n[2]=-E,n[3]=0,n[4]=s,n[5]=y,n[6]=-_,n[7]=0,n[8]=c,n[9]=T,n[10]=-m,n[11]=0,n[12]=v,n[13]=N,n[14]=O,n[15]=1,n):new l(u,s,c,v,p,y,T,N,-E,-_,-m,O,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,f=-(r+n)*s,h=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=f,o[14]=h,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),f=-(i+a)/(i-a),h=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=f,o[11]=h,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,f=-1,h=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=f,i[12]=0,i[13]=0,i[14]=h,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,f=.5*(n-t),h=c,d=l,E=f,_=i+c,m=o+l,p=t+f,y=1;return a[0]=h,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=_,a[13]=m,a[14]=p,a[15]=y,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var _=new e;l.getMaximumScale=function(t){return l.getScale(t,_),e.maximumComponent(_)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],f=e[8],h=e[9],d=e[10],E=e[11],_=e[12],m=e[13],p=e[14],y=e[15],T=t[0],R=t[1],A=t[2],S=t[3],v=t[4],N=t[5],O=t[6],M=t[7],I=t[8],g=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],L=r*T+u*R+f*A+_*S,F=a*T+s*R+h*A+m*S,B=i*T+c*R+d*A+p*S,z=o*T+l*R+E*A+y*S,b=r*v+u*N+f*O+_*M,G=a*v+s*N+h*O+m*M,q=i*v+c*N+d*O+p*M,W=o*v+l*N+E*O+y*M,X=r*I+u*g+f*w+_*x,H=a*I+s*g+h*w+m*x,V=i*I+c*g+d*w+p*x,Y=o*I+l*g+E*w+y*x,k=r*C+u*P+f*U+_*D,Z=a*C+s*P+h*U+m*D,j=i*C+c*P+d*U+p*D,K=o*C+l*P+E*U+y*D;return n[0]=L,n[1]=F,n[2]=B,n[3]=z,n[4]=b,n[5]=G,n[6]=q,n[7]=W,n[8]=X,n[9]=H,n[10]=V,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=e[12],d=e[13],E=e[14],_=t[0],m=t[1],p=t[2],y=t[4],T=t[5],R=t[6],A=t[8],S=t[9],v=t[10],N=t[12],O=t[13],M=t[14],I=r*_+o*m+c*p,g=a*_+u*m+l*p,w=i*_+s*m+f*p,x=r*y+o*T+c*R,C=a*y+u*T+l*R,P=i*y+s*T+f*R,U=r*A+o*S+c*v,D=a*A+u*S+l*v,L=i*A+s*S+f*v,F=r*N+o*O+c*M+h,B=a*N+u*O+l*M+d,z=i*N+s*O+f*M+E;return n[0]=I,n[1]=g,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=L,n[11]=0,n[12]=F,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],f=e[10],h=t[0],d=t[1],E=t[2],_=t[3],m=t[4],p=t[5],y=t[6],T=t[7],R=t[8],A=r*h+o*d+c*E,S=a*h+u*d+l*E,v=i*h+s*d+f*E,N=r*_+o*m+c*p,O=a*_+u*m+l*p,M=i*_+s*m+f*p,I=r*y+o*T+c*R,g=a*y+u*T+l*R,w=i*y+s*T+f*R;return n[0]=A,n[1]=S,n[2]=v,n[3]=0,n[4]=N,n[5]=O,n[6]=M,n[7]=0,n[8]=I,n[9]=g,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var m=new e;l.multiplyByUniformScale=function(e,t,n){return m.x=t,m.y=t,m.z=t,l.multiplyByScale(e,m,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var p=new s,y=new s,T=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,p),y,u.EPSILON7)&&t.equals(l.getRow(e,3,T),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],f=e[1],h=e[5],d=e[9],E=e[13],_=e[2],m=e[6],A=e[10],S=e[14],v=e[3],N=e[7],O=e[11],M=e[15],I=A*M,g=S*O,w=m*M,x=S*N,C=m*O,P=A*N,U=_*M,D=S*v,L=_*O,F=A*v,B=_*N,z=m*v,b=I*h+x*d+C*E-(g*h+w*d+P*E),G=g*f+U*d+F*E-(I*f+D*d+L*E),q=w*f+D*h+B*E-(x*f+U*h+z*E),W=P*f+L*h+z*d-(C*f+F*h+B*d),X=g*a+w*i+P*o-(I*a+x*i+C*o),H=I*r+D*i+L*o-(g*r+U*i+F*o),V=x*r+U*a+z*o-(w*r+D*a+B*o),Y=C*r+F*a+B*i-(P*r+L*a+z*i);I=i*E,g=o*d,w=a*E,x=o*h,C=a*d,P=i*h,U=r*E,D=o*f,L=r*d,F=i*f,B=r*h,z=a*f;var k=I*N+x*O+C*M-(g*N+w*O+P*M),Z=g*v+U*O+F*M-(I*v+D*O+L*M),j=w*v+D*N+B*M-(x*v+U*N+z*M),K=P*v+L*N+z*O-(C*v+F*N+B*O),J=w*A+P*S+g*m-(C*S+I*m+x*A),Q=L*S+I*_+D*A-(U*A+F*S+g*_),$=U*m+z*S+x*_-(B*S+w*_+D*m),ee=B*A+C*_+F*m-(L*m+z*A+P*_),te=r*b+a*G+i*q+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=G*te,n[2]=q*te,n[3]=W*te,n[4]=X*te,n[5]=H*te,n[6]=V*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=J*te,n[13]=Q*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],f=e[12],h=e[13],d=e[14],E=-n*f-r*h-a*d,_=-i*f-o*h-u*d,m=-s*f-c*h-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=_,t[14]=m,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,f=0,h=e.length;f<h;f++){var d=e[f];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,f=-Number.MAX_VALUE,h=0,d=e.length;h<d;h++){var E=t.cartesianToCartographic(e[h]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),f=Math.max(f,E.latitude);var _=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,_),c=Math.max(c,_)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=f,n):new s(a,l,i,f)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),f=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&f<=l)){var h=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(h>=d))return r(n)?(n.west=l,n.south=h,n.east=f,n.north=d,n):new s(l,h,f,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),f=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=f,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,f=e.north,h=e.south,d=e.east,E=e.west,_=c;_.height=a,_.longitude=E,_.latitude=f,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.latitude=h,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=E,o[l]=t.cartographicToCartesian(_,o[l]),l++,f<0?_.latitude=f:h>0?_.latitude=h:_.latitude=0;for(var m=1;m<8;++m)_.longitude=-Math.PI+m*u.PI_OVER_TWO,s.contains(e,_)&&(o[l]=t.cartographicToCartesian(_,o[l]),l++);return 0===_.latitude&&(_.longitude=E,o[l]=t.cartographicToCartesian(_,o[l]),l++,_.longitude=d,o[l]=t.cartographicToCartesian(_,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,_=new e,m=new e,p=new e,y=new e,T=new e,R=new e,A=new e,S=new e,v=new e,N=new e;h.fromPoints=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],T),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,_),s=e.clone(r,m),c=e.clone(r,p),l=e.clone(r,y),f=t.length,O=1;O<f;O++){e.clone(t[O],r);var M=r.x,I=r.y,g=r.z;M<i.x&&e.clone(r,i),M>s.x&&e.clone(r,s),I<o.y&&e.clone(r,o),I>c.y&&e.clone(r,c),g<u.z&&e.clone(r,u),g>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var L=A;L.x=.5*(P.x+U.x),L.y=.5*(P.y+U.y),L.z=.5*(P.z+U.z);var F=e.magnitudeSquared(e.subtract(U,L,R)),B=Math.sqrt(F),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=v;b.x=s.x,b.y=c.y,b.z=l.z;var G=e.multiplyByScalar(e.add(z,b,R),.5,N),q=0;for(O=0;O<f;O++){e.clone(t[O],r);var W=e.magnitude(e.subtract(r,G,R));W>q&&(q=W);var X=e.magnitudeSquared(e.subtract(r,L,R));if(X>F){var H=Math.sqrt(X);B=.5*(B+H),F=B*B;var V=H-B;L.x=(B*L.x+V*r.x)/H,L.y=(B*L.y+V*r.y)/H,L.z=(B*L.z+V*r.z)/H}}return B<q?(e.clone(L,n.center),n.radius=B):(e.clone(G,n.center),n.radius=q),n};var O=new o,M=new e,I=new e,g=new t,w=new t;h.fromRectangle2D=function(e,t,n){return h.fromRectangleWithHeights2D(e,t,0,0,n)},h.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new h),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,O),f.southwest(t,g),g.height=i,f.northeast(t,w),w.height=o;var s=n.project(g,M),c=n.project(w,I),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var _=u.center;return _.x=s.x+.5*l,_.y=s.y+.5*d,_.z=s.z+.5*E,u};var x=[];h.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=f.subsample(e,t,n,x)),h.fromPoints(u,o)},h.fromVertices=function(t,n,i,o){if(a(o)||(o=new h),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=T;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,_),f=e.clone(u,m),O=e.clone(u,p),M=e.clone(u,y),I=t.length,g=0;g<I;g+=i){var w=t[g]+n.x,x=t[g+1]+n.y,C=t[g+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>f.x&&e.clone(u,f),x<c.y&&e.clone(u,c),x>O.y&&e.clone(u,O),C<l.z&&e.clone(u,l),C>M.z&&e.clone(u,M)}var P=e.magnitudeSquared(e.subtract(f,s,R)),U=e.magnitudeSquared(e.subtract(O,c,R)),D=e.magnitudeSquared(e.subtract(M,l,R)),L=s,F=f,B=P;U>B&&(B=U,L=c,F=O),D>B&&(B=D,L=l,F=M);var z=A;z.x=.5*(L.x+F.x),z.y=.5*(L.y+F.y),z.z=.5*(L.z+F.z);var b=e.magnitudeSquared(e.subtract(F,z,R)),G=Math.sqrt(b),q=S;q.x=s.x,q.y=c.y,q.z=l.z;var W=v;W.x=f.x,W.y=O.y,W.z=M.z;var X=e.multiplyByScalar(e.add(q,W,R),.5,N),H=0;for(g=0;g<I;g+=i){u.x=t[g]+n.x,u.y=t[g+1]+n.y,u.z=t[g+2]+n.z;var V=e.magnitude(e.subtract(u,X,R));V>H&&(H=V);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);G=.5*(G+k),b=G*G;var Z=k-G;z.x=(G*z.x+Z*u.x)/k,z.y=(G*z.y+Z*u.y)/k,z.z=(G*z.z+Z*u.z)/k}}return G<H?(e.clone(z,o.center),o.radius=G):(e.clone(X,o.center),o.radius=H),o},h.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new h),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=T;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,_),c=e.clone(i,m),l=e.clone(i,p),f=e.clone(i,y),O=t.length,M=0;M<O;M+=3){var I=t[M]+n[M],g=t[M+1]+n[M+1],w=t[M+2]+n[M+2];i.x=I,i.y=g,i.z=w,I<o.x&&e.clone(i,o),I>c.x&&e.clone(i,c),g<u.y&&e.clone(i,u),g>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>f.z&&e.clone(i,f)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(f,s,R)),U=o,D=c,L=x;C>L&&(L=C,U=u,D=l),P>L&&(L=P,U=s,D=f);var F=A;F.x=.5*(U.x+D.x),F.y=.5*(U.y+D.y),F.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,F,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var G=v;G.x=c.x,G.y=l.y,G.z=f.z;var q=e.multiplyByScalar(e.add(b,G,R),.5,N),W=0;for(M=0;M<O;M+=3){i.x=t[M]+n[M],i.y=t[M+1]+n[M+1],i.z=t[M+2]+n[M+2];var X=e.magnitude(e.subtract(i,q,R));X>W&&(W=X);var H=e.magnitudeSquared(e.subtract(i,F,R));if(H>B){var V=Math.sqrt(H);z=.5*(z+V),B=z*z;var Y=V-z;F.x=(z*F.x+Y*i.x)/V,F.y=(z*F.y+Y*i.y)/V,F.z=(z*F.z+Y*i.z)/V}}return z<W?(e.clone(F,r.center),r.radius=z):(e.clone(q,r.center),r.radius=W),r},h.fromCornerPoints=function(t,n,r){a(r)||(r=new h);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},h.fromEllipsoid=function(t,n){return a(n)||(n=new h),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;h.fromBoundingSpheres=function(t,n){if(a(n)||(n=new h),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return h.clone(t[0],n);if(2===r)return h.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=h.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;h.fromOrientedBoundingBox=function(t,n){a(n)||(n=new h);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D);return e.add(i,o,i),e.add(i,u,i),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(i),n},h.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new h(t.center,t.radius)},h.packedLength=4,h.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},h.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new h);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var L=new e,F=new e;h.union=function(t,n,r){a(r)||(r=new h);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,L),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var f=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+f)/l,F);return e.add(d,i,d),e.clone(d,r.center),r.radius=f,r};var B=new e;h.expand=function(t,n,r){r=h.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},h.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},h.transform=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;h.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},h.transformWithoutScale=function(e,t,n){return a(n)||(n=new h),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;h.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var G=new e,q=new e,W=new e,X=new e,H=new e,V=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return h.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,G),c=e.cross(e.UNIT_Z,s,q);e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var f=e.negate(l,H),d=e.negate(c,X),E=Y,_=E[0];e.add(s,l,_),e.add(_,c,_),_=E[1],e.add(s,l,_),e.add(_,d,_),_=E[2],e.add(s,f,_),e.add(_,d,_),_=E[3],e.add(s,f,_),e.add(_,c,_),e.negate(s,s),_=E[4],e.add(s,l,_),e.add(_,c,_),_=E[5],e.add(s,l,_),e.add(_,d,_),_=E[6],e.add(s,f,_),e.add(_,d,_),_=E[7],e.add(s,f,_),e.add(_,c,_);for(var m=E.length,p=0;p<m;++p){var y=E[p];e.add(o,y,y);var T=i.cartesianToCartographic(y,V);n.project(T,y)}a=h.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},h.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},h.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},h.prototype.intersectPlane=function(e){return h.intersectPlane(this,e)},h.prototype.distanceSquaredTo=function(e){return h.distanceSquaredTo(this,e)},h.prototype.computePlaneDistances=function(e,t,n){return h.computePlaneDistances(this,e,t,n)},h.prototype.isOccluded=function(e){return h.isOccluded(this,e)},h.prototype.equals=function(e){return h.equals(this,e)},h.prototype.clone=function(e){return h.clone(this,e)},h}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!h())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(v)&&(v=!1,!a()&&!h()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(v=!0,N=r(e[1]))}return v}function u(){return o()&&N}function s(){if(!t(O)){O=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(O=!0,M=r(e[1]),M.isNightly=!!e[2])}return O}function c(){return s()&&M}function l(){if(!t(I)){I=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(I=!0,g=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(I=!0,g=r(e[1])))}return I}function f(){return l()&&g}function h(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function d(){return h()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1])); +}return C}function _(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function m(){return E()&&P}function p(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function y(){if(!t(F)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;F=t(n)&&""!==n,F&&(L=n)}return F}function T(){return y()?L:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,v,N,O,M,I,g,w,x,C,P,U,D,L,F,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:f,isEdge:h,edgeVersion:d,isFirefox:E,firefoxVersion:m,isWindows:_,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:p,supportsImageRenderingPixelated:y,imageRenderingValue:T};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/GeometryType",["./freezeObject"],function(e){"use strict";var t={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};return e(t)}),define("Core/PrimitiveType",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={POINTS:t.POINTS,LINES:t.LINES,LINE_LOOP:t.LINE_LOOP,LINE_STRIP:t.LINE_STRIP,TRIANGLES:t.TRIANGLES,TRIANGLE_STRIP:t.TRIANGLE_STRIP,TRIANGLE_FAN:t.TRIANGLE_FAN,validate:function(e){return e===n.POINTS||e===n.LINES||e===n.LINE_LOOP||e===n.LINE_STRIP||e===n.TRIANGLES||e===n.TRIANGLE_STRIP||e===n.TRIANGLE_FAN}};return e(n)}),define("Core/Geometry",["./defaultValue","./defined","./DeveloperError","./GeometryType","./PrimitiveType"],function(e,t,n,r,a){"use strict";function i(t){t=e(t,e.EMPTY_OBJECT),this.attributes=t.attributes,this.indices=t.indices,this.primitiveType=e(t.primitiveType,a.TRIANGLES),this.boundingSphere=t.boundingSphere,this.geometryType=e(t.geometryType,r.NONE),this.boundingSphereCV=t.boundingSphereCV}return i.computeNumberOfVertices=function(e){var n=-1;for(var r in e.attributes)if(e.attributes.hasOwnProperty(r)&&t(e.attributes[r])&&t(e.attributes[r].values)){var a=e.attributes[r],i=a.values.length/a.componentsPerAttribute;n=i}return n},i}),define("Core/GeometryAttribute",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(t){t=e(t,e.EMPTY_OBJECT),this.componentDatatype=t.componentDatatype,this.componentsPerAttribute=t.componentsPerAttribute,this.normalize=e(t.normalize,!1),this.values=t.values}return r}),define("Core/GeometryAttributes",["./defaultValue"],function(e){"use strict";function t(t){t=e(t,e.EMPTY_OBJECT),this.position=t.position,this.normal=t.normal,this.st=t.st,this.bitangent=t.bitangent,this.tangent=t.tangent,this.color=t.color}return t}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,n,r,a){"use strict";function i(t,a,i){this.minimum=e.clone(n(t,e.ZERO)),this.maximum=e.clone(n(a,e.ZERO)),r(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,n){if(r(n)||(n=new i),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,f=t.length,h=1;h<f;h++){var d=t[h],E=d.x,_=d.y,m=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(_,o),c=Math.max(_,c),u=Math.min(m,u),l=Math.max(m,l)}var p=n.minimum;p.x=a,p.y=o,p.z=u;var y=n.maximum;y.x=s,y.y=c,y.z=l;var T=e.add(p,y,n.center);return e.multiplyByScalar(T,.5,T),n},i.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new i(t.minimum,t.maximum)},i.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var f=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,f);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,f=n(c,-l,t.EPSILON14);if(f<0)return[];var h=-.5*n(r,t.sign(r)*Math.sqrt(f),t.EPSILON14);return r>0?[h/e,a/h]:[a/h,h/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,f=u*c,h=u*u,d=s*s,E=o*s-h,_=o*c-u*s,m=u*c-d,p=4*E*m-_*_;if(p<0){var y,T,R;h*f>=l*d?(y=o,T=E,R=-2*u*E+o*_):(y=c,T=m,R=-c*_+2*s*m);var A=R<0?-1:1,S=-A*Math.abs(y)*Math.sqrt(-p);i=-R+S;var v=i/2,N=v<0?-Math.pow(-v,1/3):Math.pow(v,1/3),O=i===S?-N:-T/N;return a=T<=0?N+O:-R/(N*N+O*O+T),h*f>=l*d?[(a-u)/o]:[-c/(a+s)]}var M=E,I=-2*u*E+o*_,g=m,w=-c*_+2*s*m,x=Math.sqrt(p),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-I)/3);a=2*Math.sqrt(-M);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),L=i+D>2*u?i-u:D-u,F=o,B=L/F;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-g),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=i+D<2*s?i+s:D+s,G=z/b,q=F*b,W=-L*b-F*z,X=L*z,H=(s*W-u*X)/(-u*W+s*q);return B<=H?B<=G?H<=G?[B,H,G]:[B,G,H]:[G,B,H]:B<=G?[H,B,G]:H<=G?[H,G,B]:[G,H,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,f=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(f.length>0){var h=-t/4,d=f[f.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var _,m=E[0],p=E[1];if(m>=0&&p>=0){var y=Math.sqrt(m),T=Math.sqrt(p);return[h-T,h-y,h+y,h+T]}if(m>=0&&p<0)return _=Math.sqrt(m),[h-_,h+_];if(m<0&&p>=0)return _=Math.sqrt(p),[h-_,h+_]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,v=r.computeRealRoots(1,R,A),N=r.computeRealRoots(1,-R,S);return 0!==v.length?(v[0]+=h,v[1]+=h,0!==N.length?(N[0]+=h,N[1]+=h,v[1]<=N[0]?[v[0],v[1],N[0],N[1]]:N[1]<=v[0]?[N[0],N[1],v[0],v[1]]:v[0]>=N[0]&&v[1]<=N[1]?[N[0],v[0],v[1],N[1]]:N[0]>=v[0]&&N[1]<=v[1]?[v[0],N[0],N[1],v[1]]:v[0]>N[0]&&v[0]<N[1]?[N[0],v[0],N[1],v[1]]:[v[0],N[0],v[1],N[1]]):v):0!==N.length?(N[0]+=h,N[1]+=h,N):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,f=i*t+s-4*o,h=c*o-i*a*t+u,d=e.computeRealRoots(1,l,f,h);if(d.length>0){var E,_,m=d[0],p=a-m,y=p*p,T=t/2,R=p/2,A=y-4*o,S=y+4*Math.abs(o),v=c-4*m,N=c+4*Math.abs(m);if(m<0||A*N<v*S){var O=Math.sqrt(v);E=O/2,_=0===O?0:(t*R-i)/O}else{var M=Math.sqrt(A);E=0===M?0:(t*R-i)/M,_=M/2}var I,g;0===T&&0===E?(I=0,g=0):n.sign(T)===n.sign(E)?(I=T+E,g=m/I):(g=T-E,I=m/g);var w,x;0===R&&0===_?(w=0,x=0):n.sign(R)===n.sign(_)?(w=R+_,x=o/w):(x=R-_,w=o/x);var C=r.computeRealRoots(1,I,w),P=r.computeRealRoots(1,g,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,f=r*r,h=f*r,d=a*a,E=d*a,_=u*c*f-4*s*h-4*e*l*f+18*e*t*n*h-27*i*f*f+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*f+144*i*n*f)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return _},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,f=u/t,h=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=f<0?d+1:d,d+=h<0?d+1:d){case 0:return a(c,l,f,h);case 1:return i(c,l,f,h);case 2:return i(c,l,f,h);case 3:return a(c,l,f,h);case 4:return a(c,l,f,h);case 5:return i(c,l,f,h);case 6:return a(c,l,f,h);case 7:return a(c,l,f,h);case 8:return i(c,l,f,h);case 9:return a(c,l,f,h);case 10:return a(c,l,f,h);case 11:return i(c,l,f,h);case 12:return a(c,l,f,h);case 13:return a(c,l,f,h);case 14:return a(c,l,f,h);case 15:return a(c,l,f,h);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function f(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function h(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,y),h=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,_=f(h,d,E,S);if(r(_))return a.start=_.root0,a.stop=_.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,f=a*a,h=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*h,_=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),m=t[u.COLUMN0ROW0]*f+t[u.COLUMN2ROW2]*h+a*n.x+r,p=h*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),y=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),T=[];if(0===y&&0===p){if(l=s.computeRealRoots(E,_,m),0===l.length)return T;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(T.push(new e(a,i*R,i*-A)),T.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],v=Math.sqrt(Math.max(1-S*S,0));T.push(new e(a,i*S,i*-v)),T.push(new e(a,i*S,i*v))}return T}var N=y*y,O=p*p,M=E*E,I=y*p,g=M+O,w=2*(_*E+I),x=2*m*E+_*_-O+N,C=2*(m*_-I),P=m*m-N;if(0===g&&0===w&&0===x&&0===C)return T;l=c.computeRealRoots(g,w,x,C,P);var U=l.length;if(0===U)return T;for(var D=0;D<U;++D){var L,F=l[D],B=F*F,z=Math.max(1-B,0),b=Math.sqrt(z);L=o.sign(E)===o.sign(m)?d(E*B+m,_*F,o.EPSILON12):o.sign(m)===o.sign(_*F)?d(E*B,_*F+m,o.EPSILON12):d(E*B+_*F,m,o.EPSILON12);var G=d(p*F,y,o.EPSILON15),q=L*G;q<0?T.push(new e(a,i*F,i*b)):q>0?T.push(new e(a,i*F,i*-b)):0!==b?(T.push(new e(a,i*F,i*-b)),T.push(new e(a,i*F,i*b)),++D):T.push(new e(a,i*F,i*b))}return T}var _={};_.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var m=new e,p=new e,y=new e,T=new e,R=new e;_.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,f,h,d=t.origin,E=t.direction,_=e.subtract(a,r,m),A=e.subtract(i,r,p),S=e.cross(E,A,y),v=e.dot(_,S);if(u){if(v<o.EPSILON6)return;if(s=e.subtract(d,r,T),l=e.dot(s,S),l<0||l>v)return;if(c=e.cross(s,_,R),f=e.dot(E,c), +f<0||l+f>v)return;h=e.dot(A,c)/v}else{if(Math.abs(v)<o.EPSILON6)return;var N=1/v;if(s=e.subtract(d,r,T),l=e.dot(s,S)*N,l<0||l>1)return;if(c=e.cross(s,_,R),f=e.dot(E,c)*N,f<0||l+f>1)return;h=e.dot(A,c)*N}return h},_.rayTriangle=function(t,n,a,i,o,u){var s=_.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;_.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=_.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};_.raySphere=function(e,t,n){if(n=h(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var v=new l;_.lineSegmentSphere=function(t,n,a,i){var o=v;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=h(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var N=new e,O=new e;_.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,N),f=e.multiplyComponents(c,t.direction,O),h=e.magnitudeSquared(l),d=e.dot(l,f);if(h>1){if(d>=0)return;var E=d*d;if(r=h-1,a=e.magnitudeSquared(f),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var _=s/a,m=r/s;return _<m?new i(_,m):{start:m,stop:_}}var p=Math.sqrt(r/a);return new i(p,p)}return h<1?(r=h-1,a=e.magnitudeSquared(f),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(f),new i(0,-d/a)):void 0};var M=new e,I=new e,g=new e,w=new e,x=new e,C=new u,P=new u,U=new u,D=new u,L=new u,F=new u,B=new u,z=new e,b=new e,G=new t;_.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,M);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,M),f=e.normalize(l,l),h=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(h,f,I),I),_=e.normalize(e.cross(f,d,g),g),m=C;m[0]=f.x,m[1]=f.y,m[2]=f.z,m[3]=d.x,m[4]=d.y,m[5]=d.z,m[6]=_.x,m[7]=_.y,m[8]=_.z;var p=u.transpose(m,P),y=u.fromScale(n.radii,U),T=u.fromScale(n.oneOverRadii,D),R=L;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,v=u.multiply(u.multiply(p,T,F),R,F),N=u.multiply(u.multiply(v,y,B),m,B),O=u.multiplyByVector(v,a,x),q=E(N,e.negate(O,M),0,0,1),W=q.length;if(W>0){for(var X=e.clone(e.ZERO,b),H=Number.NEGATIVE_INFINITY,V=0;V<W;++V){A=u.multiplyByVector(y,u.multiplyByVector(m,q[V],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>H&&(H=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,G);return H=o.clamp(H,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-H*H),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var q=new e;return _.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,q),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),f=-(a.distance+l)/c;if(!(f<0||f>1))return e.multiplyByScalar(u,f,i),e.add(t,i,i),i}},_.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var f,h;if(1!==l&&2!==l||(f=new e,h=new e),1===l){if(u)return _.lineSegmentPlane(t,n,a,f),_.lineSegmentPlane(t,r,a,h),{positions:[t,n,r,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return _.lineSegmentPlane(n,r,a,f),_.lineSegmentPlane(n,t,a,h),{positions:[t,n,r,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return _.lineSegmentPlane(r,t,a,f),_.lineSegmentPlane(r,n,a,h),{positions:[t,n,r,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return _.lineSegmentPlane(n,t,a,f),_.lineSegmentPlane(r,t,a,h),{positions:[t,n,r,f,h],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return _.lineSegmentPlane(r,n,a,f),_.lineSegmentPlane(t,n,a,h),{positions:[t,n,r,f,h],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return _.lineSegmentPlane(t,r,a,f),_.lineSegmentPlane(n,r,a,h),{positions:[t,n,r,f,h],indices:[0,1,4,0,4,3,2,3,4]}}},_}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,n,r,a){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var o=new e;return i.fromCartesian4=function(n,r){var a=e.fromCartesian4(n,o),u=n.w;return t(r)?(e.clone(a,r.normal),r.distance=u,r):new i(a,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return h(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,f,h,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],f=[],h=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),f.push(a),r.promise},d=function(e){return _(f,e),e},E=function(e){return e=t(e),h=e.then,E=t,d=p,_(l,e),f=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return m(2,arguments),e(t,function(t){function u(e){_(e)}function s(e){E(e)}var c,l,f,h,d,E,_,m,y,T;if(y=t.length>>>0,c=Math.max(0,Math.min(n,y)),f=[],l=y-c+1,h=[],d=o(),c)for(m=d.progress,_=function(e){h.push(e),--l||(E=_=p,d.reject(h))},E=function(e){f.push(e),--c||(E=_=p,d.resolve(f))},T=0;T<y;++T)T in t&&e(t[T],s,u,m);else d.resolve(f);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return m(1,arguments),h(e,y).then(t,n,r)}function f(){return h(arguments,y)}function h(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},T.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function _(e,t){for(var n,r=0;n=e[r++];)n(t)}function m(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function p(){}function y(e){return e}var T,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=f,e.all=l,e.map=h,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,T=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,f,h){var d,E,_,m,p;if("%%"==e)return"%";for(var y=!1,T="",R=!1,A=!1,S=" ",v=s.length,N=0;s&&N<v;N++)switch(s.charAt(N)){case" ":T=" ";break;case"+":T="+";break;case"-":y=!0;break;case"'":S=s.charAt(N+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,y=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(f=f?"*"==f?+t[n++]:"*"==f.charAt(0)?+t[f.slice(1,-1)]:+f:"fFeE".indexOf(h)>-1?6:"d"==h?0:void 0,p=r?t[r.slice(0,-1)]:t[n++],h){case"s":return u(String(p),y,c,f,R,S);case"c":return u(String.fromCharCode(+p),y,c,f,R);case"b":return o(p,2,A,y,c,f,R);case"o":return o(p,8,A,y,c,f,R);case"x":return o(p,16,A,y,c,f,R);case"X":return o(p,16,A,y,c,f,R).toUpperCase();case"u":return o(p,10,A,y,c,f,R);case"i":case"d":return d=+p||0,d=Math.round(d-d%1),E=d<0?"-":T,p=E+a(String(Math.abs(d)),f,"0",!1),i(p,E,y,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+p,E=d<0?"-":T,_=["toExponential","toFixed","toPrecision"]["efg".indexOf(h.toLowerCase())],m=["toString","toUpperCase"]["eEfFgG".indexOf(h)%2],p=E+Math.abs(d)[_](f),i(p,E,y,c,R)[m]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return _.compare(e.julianDate,t.julianDate)}function f(e){T.julianDate=e;var n=_.leapSeconds,r=t(n,T,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=_.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}_.addSeconds(e,a,e)}function h(e,n){T.julianDate=e;var r=_.leapSeconds,a=t(r,T,l);if(a<0&&(a=~a),0===a)return _.addSeconds(e,-r[0].offset,n);if(a>=r.length)return _.addSeconds(e,-r[a-1].offset,n);var i=_.secondsDifference(r[a].julianDate,e);return 0===i?_.addSeconds(e,-r[a].offset,n):i<=1?void 0:_.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var f=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return f>=43200&&(l-=1),[l,f]}function _(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&f(this)}var m=new i,p=[31,28,31,30,31,30,31,31,30,31,30,31],y=29,T=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,v=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,N=/^(\d{4})-?(\d{2})-?(\d{2})$/,O=/([Z+\-])?(\d{2})?:?(\d{2})?$/,M=/^(\d{2})(\.\d+)?/.source+O.source,I=/^(\d{2}):?(\d{2})(\.\d+)?/.source+O.source,g=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+O.source;_.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),f(t),t):new _(n[0],n[1],c.UTC)},_.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,h=0,m=0,T=0,O=0,w=u[0],x=u[1];if(u=w.match(N),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(v),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var L;if(r(x)){u=x.match(g),null!==u?(h=+u[1],m=+u[2],T=+u[3],O=1e3*+(u[4]||0),L=5):(u=x.match(I),null!==u?(h=+u[1],m=+u[2],T=60*+(u[3]||0),L=4):(u=x.match(M),null!==u&&(h=+u[1],m=60*+(u[2]||0),L=3)));var F=u[L],B=+u[L+1],z=+(u[L+2]||0);switch(F){case"+":h-=B,m-=z;break;case"-":h+=B,m+=z;break;case"Z":break;default:m+=new Date(Date.UTC(n,s-1,l,h,m)).getTimezoneOffset()}}else m+=new Date(n,s-1,l).getTimezoneOffset();var b=60===T;for(b&&T--;m>=60;)m-=60,h++;for(;h>=24;)h-=24,l++;for(a=i&&2===s?y:p[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?y:p[s-1];for(;m<0;)m+=60,h--;for(;h<0;)h+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?y:p[s-1],l+=a;var G=E(n,s,l,h,m,T,O);return r(t)?(d(G[0],G[1],t),f(t)):t=new _(G[0],G[1],c.UTC),b&&_.addSeconds(t,1,t),t},_.now=function(e){return _.fromDate(new Date,e)};var w=new _(0,0,c.TAI);return _.toGregorianDate=function(e,t){var n=!1,a=h(e,w);r(a)||(_.addSeconds(e,-1,w),a=h(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var f=4e3*(c+1)/1461001|0;c=c-(1461*f/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var m=d+2-12*c|0,p=100*(l-49)+f+c|0,y=u/s.SECONDS_PER_HOUR|0,T=u-y*s.SECONDS_PER_HOUR,R=T/s.SECONDS_PER_MINUTE|0;T-=R*s.SECONDS_PER_MINUTE;var A=0|T,S=(T-A)/s.SECONDS_PER_MILLISECOND;return y+=12,y>23&&(y-=24),n&&(A+=1),r(t)?(t.year=p,t.month=m,t.day=E,t.hour=y,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(p,m,E,y,R,A,S,n)},_.toDate=function(e){var t=_.toGregorianDate(e,m),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},_.toIso8601=function(t,n){var a,i=_.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},_.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new _(e.dayNumber,e.secondsOfDay,c.TAI)},_.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},_.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},_.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(_.secondsDifference(e,t))<=n},_.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},_.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},_.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},_.computeTaiMinusUtc=function(e){T.julianDate=e;var n=_.leapSeconds,r=t(n,T,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},_.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},_.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},_.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},_.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},_.lessThan=function(e,t){return _.compare(e,t)<0},_.lessThanOrEquals=function(e,t){return _.compare(e,t)<=0},_.greaterThan=function(e,t){return _.compare(e,t)>0},_.greaterThanOrEquals=function(e,t){return _.compare(e,t)>=0},_.prototype.clone=function(e){return _.clone(this,e)},_.prototype.equals=function(e){return _.equals(this,e)},_.prototype.equalsEpsilon=function(e,t){return _.equalsEpsilon(this,e,t)},_.prototype.toString=function(){return _.toIso8601(this)},_.leapSeconds=[new u(new _(2441317,43210,c.TAI),10),new u(new _(2441499,43211,c.TAI),11),new u(new _(2441683,43212,c.TAI),12),new u(new _(2442048,43213,c.TAI),13),new u(new _(2442413,43214,c.TAI),14),new u(new _(2442778,43215,c.TAI),15),new u(new _(2443144,43216,c.TAI),16),new u(new _(2443509,43217,c.TAI),17),new u(new _(2443874,43218,c.TAI),18),new u(new _(2444239,43219,c.TAI),19),new u(new _(2444786,43220,c.TAI),20),new u(new _(2445151,43221,c.TAI),21),new u(new _(2445516,43222,c.TAI),22),new u(new _(2446247,43223,c.TAI),23),new u(new _(2447161,43224,c.TAI),24),new u(new _(2447892,43225,c.TAI),25),new u(new _(2448257,43226,c.TAI),26),new u(new _(2448804,43227,c.TAI),27),new u(new _(2449169,43228,c.TAI),28),new u(new _(2449534,43229,c.TAI),29),new u(new _(2450083,43230,c.TAI),30),new u(new _(2450630,43231,c.TAI),31),new u(new _(2451179,43232,c.TAI),32),new u(new _(2453736,43233,c.TAI),33),new u(new _(2454832,43234,c.TAI),34),new u(new _(2456109,43235,c.TAI),35),new u(new _(2457204,43236,c.TAI),36),new u(new _(2457754,43237,c.TAI),37)],_}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var f=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,h){var d=f.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(h)&&n(E.overrideMimeType)&&E.overrideMimeType(h),E.open(r,e,!0),n(s))for(var _ in s)s.hasOwnProperty(_)&&E.setRequestHeader(_,s[_]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),h=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),_=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||h<0||E<0||_<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var m=e._samples=n.samples,p=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=h,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=_,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var y,T=e._addNewLeapSeconds,R=0,A=m.length;R<A;R+=e._columnCount){var S=m[R+a],v=m[R+_],N=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,O=new o(N,v,f.TAI);if(p.push(O),T){if(v!==y&&r(y)){var M=o.leapSeconds,I=t(M,O,d);if(I<0){var g=new u(O,v);M.splice(~I,0,g)}}y=v}}}function _(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function m(e,t,n){return t+e*(n-t)}function p(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return _(e,n,a,s,u),u;if(r.equals(l))return _(e,n,i,s,u),u;var f=o.secondsDifference(r,c)/o.secondsDifference(l,c),h=a*s,d=i*s,E=n[h+e._ut1MinusUtcSecondsColumn],p=n[d+e._ut1MinusUtcSecondsColumn],y=p-E;if(y>.5||y<-.5){var T=n[h+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];T!==R&&(l.equals(r)?E=p:p-=R-T)}return u.xPoleWander=m(f,n[h+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=m(f,n[h+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=m(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=m(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=m(f,E,p),u}return h.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),h.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},h.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var f=i[u],h=i[u+1],d=o.lessThanOrEquals(f,e),E=!r(h),_=E||o.greaterThanOrEquals(h,e);if(d&&_)return s=u,!E&&h.equals(e)&&++s,l=s+1,p(this,i,this._samples,e,s,l,n),n}var m=t(i,e,o.compare,this._dateColumn);return m>=0?(m<i.length-1&&i[m+1].equals(e)&&++m,s=m,l=m):(l=~m,s=l-1,s<0&&(s=0)),this._lastIndex=s,p(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},h}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){if(i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),"data"===r.scheme)return r.toString();if("data"===a.scheme)return a.toString();n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(f))return f;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),f=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){ +t(h)||(h=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=h(e);return d.href=n,d.href=d.href,d.href}var f,h,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){f=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=f;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var f=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var f=u/this._samplesPerXysFile|0,h=s/this._samplesPerXysFile|0,d=[],E=f;E<=h;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var f=s+u;f>=this._totalSamples&&(f=this._totalSamples-1,s=f-u,s<0&&(s=0));var h=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),h=!0),r(d[3*f])||(l(this,f/this._samplesPerXysFile|0),h=!0),!h){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,_,m=i-s*this._stepSizeDays,p=this._work,y=this._denominators,T=this._coef,R=this._xTable;for(E=0;E<=u;++E)p[E]=m-R[E];for(E=0;E<=u;++E){for(T[E]=1,_=0;_<=u;++_)_!==E&&(T[E]*=p[_]);T[E]*=y[E];var A=3*(s+E);n.x+=T[E]*d[A++],n.y+=T[E]*d[A++],n.s+=T[E]*d[A]}return n}}}},s}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var f=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);f=e.normalize(t,f);var u=f.x*o,s=f.y*o,c=f.z*o,h=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=h,a):new l(u,s,c,h)};var h=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],f=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],_=s+f+E;if(_>0)n=Math.sqrt(_+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var m=h,p=0;f>s&&(p=1),E>s&&E>f&&(p=2);var y=m[p],T=m[y];n=Math.sqrt(e[c.getElementIndex(p,p)]-e[c.getElementIndex(y,y)]-e[c.getElementIndex(T,T)]+1);var R=d;R[p]=.5*n,n=.5/n,u=(e[c.getElementIndex(T,y)]-e[c.getElementIndex(y,T)])*n,R[y]=(e[c.getElementIndex(y,p)]+e[c.getElementIndex(p,y)])*n,R[T]=(e[c.getElementIndex(T,p)]+e[c.getElementIndex(p,T)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,_=new l,m=new l,p=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),p=l.fromAxisAngle(e.UNIT_X,o.roll,E),m=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(m,p,m),_=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(_,i,i)};var y=new e,T=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,y);var u=l.computeAngle(R);r[o]=y.x*u,r[o+1]=y.y*u,r[o+2]=y.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,T);var u=e.magnitude(T);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(T,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,f=o*u+r*l+a*c-i*s,h=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=f,n.y=h,n.z=d,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var v=new l;l.lerp=function(e,t,n,r){return v=l.multiplyByScalar(t,n,v),r=l.multiplyByScalar(e,1-n,r),l.add(v,r,r)};var N=new l,O=new l,M=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=N=l.negate(t,N)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return O=l.multiplyByScalar(e,Math.sin((1-n)*o),O),M=l.multiplyByScalar(i,Math.sin(n*o),M),r=l.add(O,M,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var I=new e,g=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,I);l.multiply(i,t,x);var u=l.log(x,g);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],D=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;U[B]=1/(z*b),D[B]=z/b}return U[7]=P/136,D[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,f=7;f>=0;--f)L[f]=(U[f]*s-D[f])*o,F[f]=(U[f]*c-D[f])*o;var h=a*n*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),d=u*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),E=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,h,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d,E,_,m,p,y,T,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},v={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},N={},O={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},M=new n,I=new n,g=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(N[i])?r=N[i]:(r=function(r,i,s){if(u(s)||(s=new y),m.equalsEpsilon(r.x,0,m.EPSILON14)&&m.equalsEpsilon(r.y,0,m.EPSILON14)){var c=m.sign(r.z);n.unpack(v[e],0,M),"east"!==e&&"west"!==e&&n.multiplyByScalar(M,c,M),n.unpack(v[t],0,I),"east"!==t&&"west"!==t&&n.multiplyByScalar(I,c,I),n.unpack(v[a],0,g),"east"!==a&&"west"!==a&&n.multiplyByScalar(g,c,g)}else{i=o(i,h.WGS84),i.geodeticSurfaceNormal(r,O.up);var l=O.up,f=O.east;f.x=-r.y,f.y=r.x,f.z=0,n.normalize(f,O.east),n.cross(l,f,O.north),n.multiplyByScalar(O.up,-1,O.down),n.multiplyByScalar(O.east,-1,O.west),n.multiplyByScalar(O.north,-1,O.south),M=O[e],I=O[t],g=O[a]}return s[0]=M.x,s[1]=M.y,s[2]=M.z,s[3]=0,s[4]=I.x,s[5]=I.y,s[6]=I.z,s[7]=0,s[8]=g.x,s[9]=g.y,s[10]=g.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},N[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new T,x=new n(1,1,1),C=new y;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof y&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=T.fromHeadingPitchRoll(t,w),c=y.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),y.multiply(i,c,i)};var P=new y,U=new p;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof T&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=y.getRotation(i,U);return T.fromRotationMatrix(o,a)};var D=24110.54841,L=8640184.812866,F=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,G=m.TWO_PI/86400,q=new _;A.computeTemeToPseudoFixedMatrix=function(e,t){q=_.addSeconds(e,-_.computeTaiMinusUtc(e),q);var n,r=q.dayNumber,a=q.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(L+n*(F+n*B)),s=o*G%m.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,f=s+c*l,h=Math.cos(f),d=Math.sin(f);return u(t)?(t[0]=h,t[1]=-d,t[2]=0,t[3]=d,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new p(h,d,0,-d,h,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new p);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return p.transpose(n,t)};var H=new E(0,0,0),V=new f(0,0,0,0,0,0),Y=new p,k=new p;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new p);var n=A.earthOrientationParameters.compute(e,V);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,H);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var f=p.fromRotationZ(-i.s,k),h=p.multiply(l,f,Y),d=e.dayNumber,E=e.secondsOfDay-_.computeTaiMinusUtc(e)+n.ut1MinusUtc,y=d-2451545,T=E/R.SECONDS_PER_DAY,S=.779057273264+T+.00273781191135448*(y+T);S=S%1*m.TWO_PI;var v=p.fromRotationZ(S,k),N=p.multiply(h,v,Y),O=Math.cos(n.xPoleWander),M=Math.cos(n.yPoleWander),I=Math.sin(n.xPoleWander),g=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*m.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=k;return U[0]=O*C,U[1]=O*P,U[2]=I,U[3]=-M*P+g*I*C,U[4]=M*C+g*I*P,U[5]=-g*O,U[6]=-g*P-M*I*C,U[7]=g*C-M*I*P,U[8]=M*O,p.multiply(N,U,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return y.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),y.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,J=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,h.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,m.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,J);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new p),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var Q=new y(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new n,te=new n,ne=new p,re=new y,ae=new y;return A.basisTo2D=function(e,t,r){var a=y.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);n.fromElements(u.z,u.x,u.y,u);var s=A.eastNorthUpToFixedFrame(a,i,re),c=y.inverseTransformation(s,ae),l=y.getRotation(t,ne),f=y.multiplyByMatrix3(c,l,r);return y.multiply(Q,f,r),y.setTranslation(r,u,r),r},A.wgs84To2DModelMatrix=function(e,t,r){var a=e.ellipsoid,i=A.eastNorthUpToFixedFrame(t,a,re),o=y.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);n.fromElements(s.z,s.x,s.y,s);var c=y.fromTranslation(s,re);return y.multiply(Q,o,r),y.multiply(c,r,r),r},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,_)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,_));var i=n.fromCartesian4(l.getColumn(r,2,_));this._plane=f.fromPointNormal(e,i)}var _=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var m=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,m);return new E(r.center,n)};var p=new h,y=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=p;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,y);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=p;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,y);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,y));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var T=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=T,l=0;l<r;++l){var f=e[l];n.multiplyByScalar(u,f.x,c),i(t[l])||(t[l]=new n);var h=n.add(o,c,t[l]);n.multiplyByScalar(s,f.y,c),n.add(h,c,h),a.scaleToGeocentricSurface(h,h)}return t},E}),define("ThirdParty/earcut-2.1.1",[],function(){"use strict";function e(e,n,a){a=a||2;var i=n&&n.length,o=i?n[0]*a:e.length,u=t(e,0,o,a,!0),c=[];if(!u)return c;var l,f,h,d,E,_,m;if(i&&(u=s(e,n,u,a)),e.length>80*a){l=h=e[0],f=d=e[1];for(var p=a;p<o;p+=a)E=e[p],_=e[p+1],E<l&&(l=E),_<f&&(f=_),E>h&&(h=E),_>d&&(d=_);m=Math.max(h-l,d-f)}return r(u,c,a,l,f,m),c}function t(e,t,n,r,a){var i,o;if(a===g(e,t,n,r)>0)for(i=t;i<n;i+=r)o=O(i,e[i],e[i+1],o);else for(i=n-r;i>=t;i-=r)o=O(i,e[i],e[i+1],o);return o&&T(o,o.next)&&(M(o),o=o.next),o}function n(e,t){if(!e)return e;t||(t=e);var n,r=e;do if(n=!1,r.steiner||!T(r,r.next)&&0!==y(r.prev,r,r.next))r=r.next;else{if(M(r),r=t=r.prev,r===r.next)return null;n=!0}while(n||r!==t);return t}function r(e,t,s,c,l,f,d){if(e){!d&&f&&h(e,c,l,f);for(var E,_,m=e;e.prev!==e.next;)if(E=e.prev,_=e.next,f?i(e,c,l,f):a(e))t.push(E.i/s),t.push(e.i/s),t.push(_.i/s),M(e),e=_.next,m=_.next;else if(e=_,e===m){d?1===d?(e=o(e,t,s),r(e,t,s,c,l,f,2)):2===d&&u(e,t,s,c,l,f):r(n(e),t,s,c,l,f,1);break}}}function a(e){var t=e.prev,n=e,r=e.next;if(y(t,n,r)>=0)return!1;for(var a=e.next.next;a!==e.prev;){if(m(t.x,t.y,n.x,n.y,r.x,r.y,a.x,a.y)&&y(a.prev,a,a.next)>=0)return!1;a=a.next}return!0}function i(e,t,n,r){var a=e.prev,i=e,o=e.next;if(y(a,i,o)>=0)return!1;for(var u=a.x<i.x?a.x<o.x?a.x:o.x:i.x<o.x?i.x:o.x,s=a.y<i.y?a.y<o.y?a.y:o.y:i.y<o.y?i.y:o.y,c=a.x>i.x?a.x>o.x?a.x:o.x:i.x>o.x?i.x:o.x,l=a.y>i.y?a.y>o.y?a.y:o.y:i.y>o.y?i.y:o.y,f=E(u,s,t,n,r),h=E(c,l,t,n,r),d=e.nextZ;d&&d.z<=h;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&m(a.x,a.y,i.x,i.y,o.x,o.y,d.x,d.y)&&y(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function o(e,t,n){var r=e;do{var a=r.prev,i=r.next.next;!T(a,i)&&R(a,r,r.next,i)&&S(a,i)&&S(i,a)&&(t.push(a.i/n),t.push(r.i/n),t.push(i.i/n),M(r),M(r.next),r=e=i),r=r.next}while(r!==e);return r}function u(e,t,a,i,o,u){var s=e;do{for(var c=s.next.next;c!==s.prev;){if(s.i!==c.i&&p(s,c)){var l=N(s,c);return s=n(s,s.next),l=n(l,l.next),r(s,t,a,i,o,u),void r(l,t,a,i,o,u)}c=c.next}s=s.next}while(s!==e)}function s(e,r,a,i){var o,u,s,f,h,d=[];for(o=0,u=r.length;o<u;o++)s=r[o]*i,f=o<u-1?r[o+1]*i:e.length,h=t(e,s,f,i,!1),h===h.next&&(h.steiner=!0),d.push(_(h));for(d.sort(c),o=0;o<d.length;o++)l(d[o],a),a=n(a,a.next);return a}function c(e,t){return e.x-t.x}function l(e,t){if(t=f(e,t)){var r=N(t,e);n(r,r.next)}}function f(e,t){var n,r=t,a=e.x,i=e.y,o=-(1/0);do{if(i<=r.y&&i>=r.next.y){var u=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(u<=a&&u>o){if(o=u,u===a){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(a===o)return n.prev;var s,c=n,l=n.x,f=n.y,h=1/0;for(r=n.next;r!==c;)a>=r.x&&r.x>=l&&m(i<f?a:o,i,l,f,i<f?o:a,i,r.x,r.y)&&(s=Math.abs(i-r.y)/(a-r.x),(s<h||s===h&&r.x>n.x)&&S(r,e)&&(n=r,h=s)),r=r.next;return n}function h(e,t,n,r){var a=e;do null===a.z&&(a.z=E(a.x,a.y,t,n,r)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==e);a.prevZ.nextZ=null,a.prevZ=null,d(a)}function d(e){var t,n,r,a,i,o,u,s,c=1;do{for(n=e,e=null,i=null,o=0;n;){for(o++,r=n,u=0,t=0;t<c&&(u++,r=r.nextZ,r);t++);for(s=c;u>0||s>0&&r;)0===u?(a=r,r=r.nextZ,s--):0!==s&&r?n.z<=r.z?(a=n,n=n.nextZ,u--):(a=r,r=r.nextZ,s--):(a=n,n=n.nextZ,u--),i?i.nextZ=a:e=a,a.prevZ=i,i=a;n=r}i.nextZ=null,c*=2}while(o>1);return e}function E(e,t,n,r,a){return e=32767*(e-n)/a,t=32767*(t-r)/a,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e|t<<1}function _(e){var t=e,n=e;do t.x<n.x&&(n=t),t=t.next;while(t!==e);return n}function m(e,t,n,r,a,i,o,u){return(a-o)*(t-u)-(e-o)*(i-u)>=0&&(e-o)*(r-u)-(n-o)*(t-u)>=0&&(n-o)*(i-u)-(a-o)*(r-u)>=0}function p(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!A(e,t)&&S(e,t)&&S(t,e)&&v(e,t)}function y(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function T(e,t){return e.x===t.x&&e.y===t.y}function R(e,t,n,r){return!!(T(e,t)&&T(n,r)||T(e,r)&&T(n,t))||y(e,t,n)>0!=y(e,t,r)>0&&y(n,r,e)>0!=y(n,r,t)>0}function A(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&R(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function S(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function v(e,t){var n=e,r=!1,a=(e.x+t.x)/2,i=(e.y+t.y)/2;do n.y>i!=n.next.y>i&&a<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next;while(n!==e);return r}function N(e,t){var n=new I(e.i,e.x,e.y),r=new I(t.i,t.x,t.y),a=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=a,a.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function O(e,t,n,r){var a=new I(e,t,n);return r?(a.next=r.next,a.prev=r,r.next.prev=a,r.next=a):(a.prev=a,a.next=a),a}function M(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 I(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function g(e,t,n,r){for(var a=0,i=t,o=n-r;i<n;i+=r)a+=(e[o]-e[i])*(e[i+1]+e[o+1]),o=i;return a}return e.deviation=function(e,t,n,r){var a=t&&t.length,i=a?t[0]*n:e.length,o=Math.abs(g(e,0,i,n));if(a)for(var u=0,s=t.length;u<s;u++){var c=t[u]*n,l=u<s-1?t[u+1]*n:e.length;o-=Math.abs(g(e,c,l,n))}var f=0;for(u=0;u<r.length;u+=3){var h=r[u]*n,d=r[u+1]*n,E=r[u+2]*n;f+=Math.abs((e[h]-e[E])*(e[d+1]-e[h+1])-(e[h]-e[d])*(e[E+1]-e[h+1]))}return 0===o&&0===f?0:Math.abs((f-o)/o)},e.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,a=0;a<e.length;a++){for(var i=0;i<e[a].length;i++)for(var o=0;o<t;o++)n.vertices.push(e[a][i][o]);a>0&&(r+=e[a-1].length,n.holes.push(r))}return n},e}),define("Core/WindingOrder",["./freezeObject","./WebGLConstants"],function(e,t){"use strict";var n={CLOCKWISE:t.CW,COUNTER_CLOCKWISE:t.CCW,validate:function(e){return e===n.CLOCKWISE||e===n.COUNTER_CLOCKWISE}};return e(n)}),define("Core/PolygonPipeline",["../ThirdParty/earcut-2.1.1","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./Math","./PrimitiveType","./WindingOrder"],function(e,t,n,r,a,i,o,u,s,c,l,f,h){"use strict";var d=new n,E=new n,_={};_.computeArea2D=function(e){for(var t=e.length,n=0,r=t-1,a=0;a<t;r=a++){var i=e[r],o=e[a];n+=i.x*o.y-o.x*i.y}return.5*n},_.computeWindingOrder2D=function(e){var t=_.computeArea2D(e);return t>0?h.COUNTER_CLOCKWISE:h.CLOCKWISE},_.triangulate=function(n,r){var a=t.packArray(n);return e(a,r,2)};var m=new n,p=new n,y=new n,T=new n,R=new n,A=new n,S=new n;return _.computeSubdivision=function(e,t,o,u){u=a(u,l.RADIANS_PER_DEGREE);var h,d=o.slice(0),E=t.length,_=new Array(3*E),v=0;for(h=0;h<E;h++){var N=t[h];_[v++]=N.x,_[v++]=N.y,_[v++]=N.z}for(var O=[],M={},I=e.maximumRadius,g=l.chordLength(u,I),w=g*g;d.length>0;){var x,C,P=d.pop(),U=d.pop(),D=d.pop(),L=n.fromArray(_,3*D,m),F=n.fromArray(_,3*U,p),B=n.fromArray(_,3*P,y),z=n.multiplyByScalar(n.normalize(L,T),I,T),b=n.multiplyByScalar(n.normalize(F,R),I,R),G=n.multiplyByScalar(n.normalize(B,A),I,A),q=n.magnitudeSquared(n.subtract(z,b,S)),W=n.magnitudeSquared(n.subtract(b,G,S)),X=n.magnitudeSquared(n.subtract(G,z,S)),H=Math.max(q,W,X);H>w?q===H?(x=Math.min(D,U)+" "+Math.max(D,U),h=M[x],i(h)||(C=n.add(L,F,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,M[x]=h),d.push(D,h,P),d.push(h,U,P)):W===H?(x=Math.min(U,P)+" "+Math.max(U,P),h=M[x],i(h)||(C=n.add(F,B,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,M[x]=h),d.push(U,h,D),d.push(h,P,D)):X===H&&(x=Math.min(P,D)+" "+Math.max(P,D),h=M[x],i(h)||(C=n.add(B,L,S),n.multiplyByScalar(C,.5,C),_.push(C.x,C.y,C.z),h=_.length/3-1,M[x]=h),d.push(P,h,U),d.push(h,D,U)):(O.push(D),O.push(U),O.push(P))}return new s({attributes:{position:new c({componentDatatype:r.DOUBLE,componentsPerAttribute:3,values:_})},indices:O,primitiveType:f.TRIANGLES})},_.scaleToGeodeticHeight=function(e,t,r,o){r=a(r,u.WGS84);var s=d,c=E;if(t=a(t,0),o=a(o,!0),i(e))for(var l=e.length,f=0;f<l;f+=3)n.fromArray(e,f,c),o&&(c=r.scaleToGeodeticSurface(c,c)),0!==t&&(s=r.geodeticSurfaceNormal(c,s),n.multiplyByScalar(s,t,s),n.add(c,s,c)),e[f]=c.x,e[f+1]=c.y,e[f+2]=c.z;return e},_}),define("Core/EllipsoidGeodesic",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){var t=e._uSquared,n=e._ellipsoid.maximumRadius,r=e._ellipsoid.minimumRadius,a=(n-r)/n,i=Math.cos(e._startHeading),o=Math.sin(e._startHeading),u=(1-a)*Math.tan(e._start.latitude),s=1/Math.sqrt(1+u*u),c=s*u,l=Math.atan2(u,i),f=s*o,h=f*f,d=1-h,E=Math.sqrt(d),_=t/4,m=_*_,p=m*_,y=m*m,T=1+_-3*m/4+5*p/4-175*y/64,R=1-_+15*m/8-35*p/8,A=1-3*_+35*m/4,S=1-5*_,v=T*l-R*Math.sin(2*l)*_/2-A*Math.sin(4*l)*m/16-S*Math.sin(6*l)*p/48-5*Math.sin(8*l)*y/512,N=e._constants;N.a=n,N.b=r,N.f=a,N.cosineHeading=i,N.sineHeading=o,N.tanU=u,N.cosineU=s,N.sineU=c,N.sigma=l,N.sineAlpha=f,N.sineSquaredAlpha=h,N.cosineSquaredAlpha=d,N.cosineAlpha=E,N.u2Over4=_,N.u4Over16=m,N.u6Over64=p,N.u8Over256=y,N.a0=T,N.a1=R,N.a2=A,N.a3=S,N.distanceRatio=v}function c(e,t){return e*t*(4+e*(4-3*t))/16}function l(e,t,n,r,a,i,o){var u=c(e,n);return(1-u)*e*t*(r+u*a*(o+u*i*(2*o*o-1)))}function f(e,t,n,r,a,i,o){var s,c,f,h,d,E=(t-n)/t,_=i-r,m=Math.atan((1-E)*Math.tan(a)),p=Math.atan((1-E)*Math.tan(o)),y=Math.cos(m),T=Math.sin(m),R=Math.cos(p),A=Math.sin(p),S=y*R,v=y*A,N=T*A,O=T*R,M=_,I=u.TWO_PI,g=Math.cos(M),w=Math.sin(M);do{g=Math.cos(M),w=Math.sin(M);var x=v-O*g;f=Math.sqrt(R*R*w*w+x*x),c=N+S*g,s=Math.atan2(f,c);var C;0===f?(C=0,h=1):(C=S*w/f,h=1-C*C),I=M,d=c-2*N/h,isNaN(d)&&(d=0),M=_+l(E,C,h,s,f,c,d)}while(Math.abs(M-I)>u.EPSILON12);var P=h*(t*t-n*n)/(n*n),U=1+P*(4096+P*(P*(320-175*P)-768))/16384,D=P*(256+P*(P*(74-47*P)-128))/1024,L=d*d,F=D*f*(d+D*(c*(2*L-1)-D*d*(4*f*f-3)*(4*L-3)/6)/4),B=n*U*(s-F),z=Math.atan2(R*w,v-O*g),b=Math.atan2(y*w,v*g-O);e._distance=B,e._startHeading=z,e._endHeading=b,e._uSquared=P}function h(n,r,a,i){e.normalize(i.cartographicToCartesian(r,_),E),e.normalize(i.cartographicToCartesian(a,_),_);f(n,i.maximumRadius,i.minimumRadius,r.longitude,r.latitude,a.longitude,a.latitude),n._start=t.clone(r,n._start),n._end=t.clone(a,n._end),n._start.height=0,n._end.height=0,s(n)}function d(e,a,i){var u=n(i,o.WGS84);this._ellipsoid=u,this._start=new t,this._end=new t,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,r(e)&&r(a)&&h(this,e,a,u)}var E=new e,_=new e;return a(d.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}}}),d.prototype.setEndPoints=function(e,t){h(this,e,t,this._ellipsoid)},d.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)},d.prototype.interpolateUsingSurfaceDistance=function(e,n){var a=this._constants,i=a.distanceRatio+e/a.b,o=Math.cos(2*i),u=Math.cos(4*i),s=Math.cos(6*i),c=Math.sin(2*i),f=Math.sin(4*i),h=Math.sin(6*i),d=Math.sin(8*i),E=i*i,_=i*E,m=a.u8Over256,p=a.u2Over4,y=a.u6Over64,T=a.u4Over16,R=2*_*m*o/3+i*(1-p+7*T/4-15*y/4+579*m/64-(T-15*y/4+187*m/16)*o-(5*y/4-115*m/16)*u-29*m*s/16)+(p/2-T+71*y/32-85*m/16)*c+(5*T/16-5*y/4+383*m/96)*f-E*((y-11*m/2)*c+5*m*f/2)+(29*y/96-29*m/16)*h+539*m*d/1536,A=Math.asin(Math.sin(R)*a.cosineAlpha),S=Math.atan(a.a/a.b*Math.tan(A));R-=a.sigma;var v=Math.cos(2*a.sigma+R),N=Math.sin(R),O=Math.cos(R),M=a.cosineU*O,I=a.sineU*N,g=Math.atan2(N*a.sineHeading,M-I*a.cosineHeading),w=g-l(a.f,a.sineAlpha,a.cosineSquaredAlpha,R,N,O,v); +return r(n)?(n.longitude=this._start.longitude+w,n.latitude=S,n.height=0,n):new t(this._start.longitude+w,S,0)},d}),define("Core/isArray",["./defined"],function(e){"use strict";var t=Array.isArray;return e(t)||(t=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),t}),define("Core/PolylinePipeline",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidGeodesic","./IntersectionTests","./isArray","./Math","./Matrix4","./Plane"],function(e,t,n,r,a,i,o,u,s,c,l,f){"use strict";function h(e,t,n){var r=N;r.length=e;var a;if(t===n){for(a=0;a<e;a++)r[a]=t;return r}var i=n-t,o=i/e;for(a=0;a<e;a++){var u=t+a*o;r[a]=u}return r}function d(t,n,r,a,i,o,u,s){var c=a.scaleToGeodeticSurface(t,g),l=a.scaleToGeodeticSurface(n,w),f=E.numberOfPoints(t,n,r),d=a.cartesianToCartographic(c,O),_=a.cartesianToCartographic(l,M),m=h(f,i,o);x.setEndPoints(d,_);var p=x.surfaceDistance/f,y=s;d.height=i;var T=a.cartographicToCartesian(d,I);e.pack(T,u,y),y+=3;for(var R=1;R<f;R++){var A=x.interpolateUsingSurfaceDistance(R*p,M);A.height=m[R],T=a.cartographicToCartesian(A,I),e.pack(T,u,y),y+=3}return y}var E={};E.numberOfPoints=function(t,n,r){var a=e.distance(t,n);return Math.ceil(a/r)};var _=new t;E.extractHeights=function(e,t){for(var n=e.length,r=new Array(n),a=0;a<n;a++){var i=e[a];r[a]=t.cartesianToCartographic(i,_).height}return r};var m=new l,p=new e,y=new e,T=new f(e.UNIT_X,0),R=new e,A=new f(e.UNIT_X,0),S=new e,v=new e,N=[],O=new t,M=new t,I=new e,g=new e,w=new e,x=new o;return E.wrapLongitude=function(t,a){var i=[],o=[];if(r(t)&&t.length>0){a=n(a,l.IDENTITY);var s=l.inverseTransformation(a,m),c=l.multiplyByPoint(s,e.ZERO,p),h=e.normalize(l.multiplyByPointAsVector(s,e.UNIT_Y,y),y),d=f.fromPointNormal(c,h,T),E=e.normalize(l.multiplyByPointAsVector(s,e.UNIT_X,R),R),_=f.fromPointNormal(c,E,A),N=1;i.push(e.clone(t[0]));for(var O=i[0],M=t.length,I=1;I<M;++I){var g=t[I];if(f.getPointDistance(_,O)<0||f.getPointDistance(_,g)<0){var w=u.lineSegmentPlane(O,g,d,S);if(r(w)){var x=e.multiplyByScalar(h,5e-9,v);f.getPointDistance(d,O)<0&&e.negate(x,x),i.push(e.add(w,x,new e)),o.push(N+1),e.negate(x,x),i.push(e.add(w,x,new e)),N=1}}i.push(e.clone(t[I])),N++,O=g}o.push(N)}return{positions:i,lengths:o}},E.generateArc=function(t){r(t)||(t={});var a=t.positions,o=a.length,u=n(t.ellipsoid,i.WGS84),l=n(t.height,0),f=s(l);if(o<1)return[];if(1===o){var h=u.scaleToGeodeticSurface(a[0],g);if(l=f?l[0]:l,0!==l){var _=u.geodeticSurfaceNormal(h,I);e.multiplyByScalar(_,l,_),e.add(h,_,h)}return[h.x,h.y,h.z]}var m=t.minDistance;if(!r(m)){var p=n(t.granularity,c.RADIANS_PER_DEGREE);m=c.chordLength(p,u.maximumRadius)}var y,T=0;for(y=0;y<o-1;y++)T+=E.numberOfPoints(a[y],a[y+1],m);var R=3*(T+1),A=new Array(R),S=0;for(y=0;y<o-1;y++){var v=a[y],M=a[y+1],w=f?l[y]:l,x=f?l[y+1]:l;S=d(v,M,m,u,w,x,A,S)}N.length=0;var C=a[o-1],P=u.cartesianToCartographic(C,O);P.height=f?l[o-1]:l;var U=u.cartographicToCartesian(P,I);return e.pack(U,A,R-3),A},E.generateCartesianArc=function(t){for(var n=E.generateArc(t),r=n.length/3,a=new Array(r),i=0;i<r;i++)a[i]=e.unpack(n,3*i);return a},E}),define("Core/WallGeometryLibrary",["./Cartographic","./defined","./EllipsoidTangentPlane","./Math","./PolygonPipeline","./PolylinePipeline","./WindingOrder"],function(e,t,n,r,a,i,o){"use strict";function u(e,t){return r.equalsEpsilon(e.latitude,t.latitude,r.EPSILON14)&&r.equalsEpsilon(e.longitude,t.longitude,r.EPSILON14)}function s(n,r,a,i){var o=r.length;if(!(o<2)){var s=t(i),c=t(a),h=!0,d=new Array(o),E=new Array(o),_=new Array(o),m=r[0];d[0]=m;var p=n.cartesianToCartographic(m,l);c&&(p.height=a[0]),h=h&&p.height<=0,E[0]=p.height,s?_[0]=i[0]:_[0]=0;for(var y=1,T=1;T<o;++T){var R=r[T],A=n.cartesianToCartographic(R,f);c&&(A.height=a[T]),h=h&&A.height<=0,u(p,A)?p.height<A.height&&(E[y-1]=A.height):(d[y]=R,E[y]=A.height,s?_[y]=i[T]:_[y]=0,e.clone(A,p),++y)}if(!(h||y<2))return d.length=y,E.length=y,_.length=y,{positions:d,topHeights:E,bottomHeights:_}}}var c={},l=new e,f=new e,h=new Array(2),d=new Array(2),E={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};return c.computePositions=function(e,u,c,l,f,_){var m=s(e,u,c,l);if(t(m)){if(u=m.positions,c=m.topHeights,l=m.bottomHeights,u.length>=3){var p=n.fromPoints(u,e),y=p.projectPointsOntoPlane(u);a.computeWindingOrder2D(y)===o.CLOCKWISE&&(u.reverse(),c.reverse(),l.reverse())}var T,R,A=u.length,S=A-2,v=r.chordLength(f,e.maximumRadius),N=E;if(N.minDistance=v,N.ellipsoid=e,_){var O,M=0;for(O=0;O<A-1;O++)M+=i.numberOfPoints(u[O],u[O+1],v)+1;T=new Float64Array(3*M),R=new Float64Array(3*M);var I=h,g=d;N.positions=I,N.height=g;var w=0;for(O=0;O<A-1;O++){I[0]=u[O],I[1]=u[O+1],g[0]=c[O],g[1]=c[O+1];var x=i.generateArc(N);T.set(x,w),g[0]=l[O],g[1]=l[O+1],R.set(i.generateArc(N),w),w+=x.length}}else N.positions=u,N.height=c,T=new Float64Array(i.generateArc(N)),N.height=l,R=new Float64Array(i.generateArc(N));return{bottomPositions:R,topPositions:T,numCorners:S}}},c}),define("Core/WallOutlineGeometry",["./BoundingSphere","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./Geometry","./GeometryAttribute","./GeometryAttributes","./IndexDatatype","./Math","./PrimitiveType","./WallGeometryLibrary"],function(e,t,n,r,a,i,o,u,s,c,l,f,h,d){"use strict";function E(e){e=r(e,r.EMPTY_OBJECT);var n=e.positions,i=e.maximumHeights,u=e.minimumHeights,s=r(e.granularity,f.RADIANS_PER_DEGREE),c=r(e.ellipsoid,o.WGS84);this._positions=n,this._minimumHeights=u,this._maximumHeights=i,this._granularity=s,this._ellipsoid=o.clone(c),this._workerName="createWallOutlineGeometry";var l=1+n.length*t.packedLength+2;a(u)&&(l+=u.length),a(i)&&(l+=i.length),this.packedLength=l+o.packedLength+1}var _=new t,m=new t;E.pack=function(e,n,i){i=r(i,0);var u,s=e._positions,c=s.length;for(n[i++]=c,u=0;u<c;++u,i+=t.packedLength)t.pack(s[u],n,i);var l=e._minimumHeights;if(c=a(l)?l.length:0,n[i++]=c,a(l))for(u=0;u<c;++u)n[i++]=l[u];var f=e._maximumHeights;if(c=a(f)?f.length:0,n[i++]=c,a(f))for(u=0;u<c;++u)n[i++]=f[u];return o.pack(e._ellipsoid,n,i),i+=o.packedLength,n[i]=e._granularity,n};var p=o.clone(o.UNIT_SPHERE),y={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:p,granularity:void 0};return E.unpack=function(e,n,i){n=r(n,0);var u,s=e[n++],c=new Array(s);for(u=0;u<s;++u,n+=t.packedLength)c[u]=t.unpack(e,n);s=e[n++];var l;if(s>0)for(l=new Array(s),u=0;u<s;++u)l[u]=e[n++];s=e[n++];var f;if(s>0)for(f=new Array(s),u=0;u<s;++u)f[u]=e[n++];var h=o.unpack(e,n,p);n+=o.packedLength;var d=e[n];return a(i)?(i._positions=c,i._minimumHeights=l,i._maximumHeights=f,i._ellipsoid=o.clone(h,i._ellipsoid),i._granularity=d,i):(y.positions=c,y.minimumHeights=l,y.maximumHeights=f,y.granularity=d,new E(y))},E.fromConstantHeights=function(e){e=r(e,r.EMPTY_OBJECT);var t,n,i=e.positions,o=e.minimumHeight,u=e.maximumHeight,s=a(o),c=a(u);if(s||c){var l=i.length;t=s?new Array(l):void 0,n=c?new Array(l):void 0;for(var f=0;f<l;++f)s&&(t[f]=o),c&&(n[f]=u)}var h={positions:i,maximumHeights:n,minimumHeights:t,ellipsoid:e.ellipsoid};return new E(h)},E.createGeometry=function(r){var i=r._positions,o=r._minimumHeights,E=r._maximumHeights,p=r._granularity,y=r._ellipsoid,T=d.computePositions(y,i,E,o,p,!1);if(a(T)){var R=T.bottomPositions,A=T.topPositions,S=A.length,v=2*S,N=new Float64Array(v),O=0;S/=3;var M;for(M=0;M<S;++M){var I=3*M,g=t.fromArray(A,I,_),w=t.fromArray(R,I,m);N[O++]=w.x,N[O++]=w.y,N[O++]=w.z,N[O++]=g.x,N[O++]=g.y,N[O++]=g.z}var x=new c({position:new s({componentDatatype:n.DOUBLE,componentsPerAttribute:3,values:N})}),C=v/3;v=2*C-4+C;var P=l.createTypedArray(C,v),U=0;for(M=0;M<C-2;M+=2){var D=M,L=M+2,F=t.fromArray(N,3*D,_),B=t.fromArray(N,3*L,m);if(!t.equalsEpsilon(F,B,f.EPSILON10)){var z=M+1,b=M+3;P[U++]=z,P[U++]=D,P[U++]=z,P[U++]=b,P[U++]=D,P[U++]=L}}return P[U++]=C-2,P[U++]=C-1,new u({attributes:x,indices:P,primitiveType:h.LINES,boundingSphere:new e.fromVertices(N)})}},E}),define("Workers/createWallOutlineGeometry",["../Core/defined","../Core/Ellipsoid","../Core/WallOutlineGeometry"],function(e,t,n){"use strict";function r(r,a){return e(a)&&(r=n.unpack(r,a)),r._ellipsoid=t.clone(r._ellipsoid),n.createGeometry(r)}return r})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js b/engines/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js new file mode 100644 index 0000000..2b879cd --- /dev/null +++ b/engines/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js @@ -0,0 +1,23 @@ +/** + * Cesium - https://github.com/AnalyticalGraphicsInc/cesium + * + * Copyright 2011-2017 Cesium Contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Columbus View (Pat. Pend.) + * + * Portions licensed separately. + * See https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md for full licensing details. + */ +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function r(e){return e+" is required, actual value was undefined"}function n(e,t,r){return"Expected "+r+" to be typeof "+t+", actual typeof was "+e}var i={};return i.typeOf={},i.defined=function(n,i){if(!e(i))throw new t(r(n))},i.typeOf.func=function(e,r){if("function"!=typeof r)throw new t(n(typeof r,"function",e))},i.typeOf.string=function(e,r){if("string"!=typeof r)throw new t(n(typeof r,"string",e))},i.typeOf.number=function(e,r){if("number"!=typeof r)throw new t(n(typeof r,"number",e))},i.typeOf.number.lessThan=function(e,r,n){if(i.typeOf.number(e,r),r>=n)throw new t("Expected "+e+" to be less than "+n+", actual value was "+r)},i.typeOf.number.lessThanOrEquals=function(e,r,n){if(i.typeOf.number(e,r),r>n)throw new t("Expected "+e+" to be less than or equal to "+n+", actual value was "+r)},i.typeOf.number.greaterThan=function(e,r,n){if(i.typeOf.number(e,r),r<=n)throw new t("Expected "+e+" to be greater than "+n+", actual value was "+r)},i.typeOf.number.greaterThanOrEquals=function(e,r,n){if(i.typeOf.number(e,r),r<n)throw new t("Expected "+e+" to be greater than or equal to"+n+", actual value was "+r)},i.typeOf.object=function(e,r){if("object"!=typeof r)throw new t(n(typeof r,"object",e))},i.typeOf.bool=function(e,r){if("boolean"!=typeof r)throw new t(n(typeof r,"boolean",e))},i}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/decodeGoogleEarthEnterpriseData",["./Check","./defined","./RuntimeError"],function(e,t,r){"use strict";function n(e,t){if(n.passThroughDataForTesting)return t;var o=e.byteLength;if(0===o||o%4!==0)throw new r("The length of key must be greater than 0 and a multiple of 4.");var s=new DataView(t),f=s.getUint32(0,!0);if(f===i||f===a)return t;for(var u,c=new DataView(e),l=0,d=t.byteLength,h=d-d%8,w=o,b=8;l<h;)for(b=(b+8)%24,u=b;l<h&&u<w;)s.setUint32(l,s.getUint32(l,!0)^c.getUint32(u,!0),!0),s.setUint32(l+4,s.getUint32(l+4,!0)^c.getUint32(u+4,!0),!0),l+=8,u+=24;if(l<d)for(u>=w&&(b=(b+8)%24,u=b);l<d;)s.setUint8(l,s.getUint8(l)^c.getUint8(u)),l++,u++}var i=1953029805,a=2917034100;return n.passThroughDataForTesting=!1,n}),define("Core/isBitSet",[],function(){"use strict";function e(e,t){return 0!==(e&t)}return e}),define("Core/GoogleEarthEnterpriseTileInformation",["./defined","./isBitSet"],function(e,t){"use strict";function r(e,t,r,n,i,a){this._bits=e,this.cnodeVersion=t,this.imageryVersion=r,this.terrainVersion=n,this.imageryProvider=i,this.terrainProvider=a,this.ancestorHasTerrain=!1,this.terrainState=void 0}var n=[1,2,4,8],i=15,a=16,o=64,s=128;return r.clone=function(t,n){return e(n)?(n._bits=t._bits,n.cnodeVersion=t.cnodeVersion,n.imageryVersion=t.imageryVersion,n.terrainVersion=t.terrainVersion,n.imageryProvider=t.imageryProvider,n.terrainProvider=t.terrainProvider):n=new r(t._bits,t.cnodeVersion,t.imageryVersion,t.terrainVersion,t.imageryProvider,t.terrainProvider),n.ancestorHasTerrain=t.ancestorHasTerrain,n.terrainState=t.terrainState,n},r.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()},r.prototype.hasSubtree=function(){return t(this._bits,a)},r.prototype.hasImagery=function(){return t(this._bits,o)},r.prototype.hasTerrain=function(){return t(this._bits,s)},r.prototype.hasChildren=function(){return t(this._bits,i)},r.prototype.hasChild=function(e){return t(this._bits,n[e])},r.prototype.getChildBitmask=function(){return this._bits&i},r}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var r,n=t.name,i=t.message;r=e(n)&&e(i)?n+": "+i:t.toString();var a=t.stack;return e(a)&&(r+="\n"+a),r}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,r){"use strict";function n(n){var i,a=[],o={id:void 0,result:void 0,error:void 0};return function(s){var f=s.data;a.length=0,o.id=f.id,o.error=void 0,o.result=void 0;try{o.result=n(f.parameters,a)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(i)||(i=e(self.webkitPostMessage,self.postMessage)),f.canTransferArrayBuffer||(a.length=0);try{i(o,a)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+r(e)+"\n with responseMessage: "+JSON.stringify(o),i(o)}}}return n}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("ThirdParty/pako_inflate",[],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.pako=e()}}(function(){return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var f="function"==typeof require&&require;if(!s&&f)return f(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return i(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)return void e.set(t.subarray(r,r+n),i);for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){var t,r,n,i,a,o;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(o=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)a=e[t],o.set(a,i),i+=a.length;return o}},a={arraySet:function(e,t,r,n,i){for(var a=0;a<n;a++)e[i+a]=t[r+a]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,a))},r.setTyped(n)},{}],2:[function(e,t,r){"use strict";function n(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&a))return String.fromCharCode.apply(null,i.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}var i=e("./common"),a=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var s=new i.Buf8(256),f=0;f<256;f++)s[f]=f>=252?6:f>=248?5:f>=240?4:f>=224?3:f>=192?2:1;s[254]=s[254]=1,r.string2buf=function(e){var t,r,n,a,o,s=e.length,f=0;for(a=0;a<s;a++)r=e.charCodeAt(a),55296===(64512&r)&&a+1<s&&(n=e.charCodeAt(a+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),f+=r<128?1:r<2048?2:r<65536?3:4;for(t=new i.Buf8(f),o=0,a=0;o<f;a++)r=e.charCodeAt(a),55296===(64512&r)&&a+1<s&&(n=e.charCodeAt(a+1),56320===(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},r.buf2binstring=function(e){return n(e,e.length)},r.binstring2buf=function(e){for(var t=new i.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,i,a,o,f=t||e.length,u=new Array(2*f);for(i=0,r=0;r<f;)if(a=e[r++],a<128)u[i++]=a;else if(o=s[a],o>4)u[i++]=65533,r+=o-1;else{for(a&=2===o?31:3===o?15:7;o>1&&r<f;)a=a<<6|63&e[r++],o--;o>1?u[i++]=65533:a<65536?u[i++]=a:(a-=65536,u[i++]=55296|a>>10&1023,u[i++]=56320|1023&a)}return n(u,i)},r.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&128===(192&e[r]);)r--;return r<0?t:0===r?t:r+s[e[r]]>t?r:t}},{"./common":1}],3:[function(e,t,r){"use strict";function n(e,t,r,n){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;0!==r;){o=r>2e3?2e3:r,r-=o;do i=i+t[n++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}t.exports=n},{}],4:[function(e,t,r){"use strict";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,r){"use strict";function n(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}function i(e,t,r,n){var i=a,o=n+r;e^=-1;for(var s=n;s<o;s++)e=e>>>8^i[255&(e^t[s])];return e^-1}var a=n();t.exports=i},{}],6:[function(e,t,r){"use strict";function n(){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}t.exports=n},{}],7:[function(e,t,r){"use strict";var n=30,i=12;t.exports=function(e,t){var r,a,o,s,f,u,c,l,d,h,w,b,m,g,v,p,k,_,y,E,x,S,T,O,B;r=e.state,a=e.next_in,O=e.input,o=a+(e.avail_in-5),s=e.next_out,B=e.output,f=s-(t-e.avail_out),u=s+(e.avail_out-257),c=r.dmax,l=r.wsize,d=r.whave,h=r.wnext,w=r.window,b=r.hold,m=r.bits,g=r.lencode,v=r.distcode,p=(1<<r.lenbits)-1,k=(1<<r.distbits)-1;e:do{m<15&&(b+=O[a++]<<m,m+=8,b+=O[a++]<<m,m+=8),_=g[b&p];t:for(;;){if(y=_>>>24,b>>>=y,m-=y,y=_>>>16&255,0===y)B[s++]=65535&_;else{if(!(16&y)){if(0===(64&y)){_=g[(65535&_)+(b&(1<<y)-1)];continue t}if(32&y){r.mode=i;break e}e.msg="invalid literal/length code",r.mode=n;break e}E=65535&_,y&=15,y&&(m<y&&(b+=O[a++]<<m,m+=8),E+=b&(1<<y)-1,b>>>=y,m-=y),m<15&&(b+=O[a++]<<m,m+=8,b+=O[a++]<<m,m+=8),_=v[b&k];r:for(;;){if(y=_>>>24,b>>>=y,m-=y,y=_>>>16&255,!(16&y)){if(0===(64&y)){_=v[(65535&_)+(b&(1<<y)-1)];continue r}e.msg="invalid distance code",r.mode=n;break e}if(x=65535&_,y&=15,m<y&&(b+=O[a++]<<m,m+=8,m<y&&(b+=O[a++]<<m,m+=8)),x+=b&(1<<y)-1,x>c){e.msg="invalid distance too far back",r.mode=n;break e}if(b>>>=y,m-=y,y=s-f,x>y){if(y=x-y,y>d&&r.sane){e.msg="invalid distance too far back",r.mode=n;break e}if(S=0,T=w,0===h){if(S+=l-y,y<E){E-=y;do B[s++]=w[S++];while(--y);S=s-x,T=B}}else if(h<y){if(S+=l+h-y,y-=h,y<E){E-=y;do B[s++]=w[S++];while(--y);if(S=0,h<E){y=h,E-=y;do B[s++]=w[S++];while(--y);S=s-x,T=B}}}else if(S+=h-y,y<E){E-=y;do B[s++]=w[S++];while(--y);S=s-x,T=B}for(;E>2;)B[s++]=T[S++],B[s++]=T[S++],B[s++]=T[S++],E-=3;E&&(B[s++]=T[S++],E>1&&(B[s++]=T[S++]))}else{S=s-x;do B[s++]=B[S++],B[s++]=B[S++],B[s++]=B[S++],E-=3;while(E>2);E&&(B[s++]=B[S++],E>1&&(B[s++]=B[S++]))}break}}break}}while(a<o&&s<u);E=m>>3,a-=E,m-=E<<3,b&=(1<<m)-1,e.next_in=a,e.next_out=s,e.avail_in=a<o?5+(o-a):5-(a-o),e.avail_out=s<u?257+(u-s):257-(s-u),r.hold=b,r.bits=m}},{}],8:[function(e,t,r){"use strict";function n(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function i(){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 v.Buf16(320),this.work=new v.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function a(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=z,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new v.Buf32(be),t.distcode=t.distdyn=new v.Buf32(me),t.sane=1,t.back=-1,A):U}function o(e){var t;return e&&e.state?(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,a(e)):U}function s(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15)?U:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,o(e))):U}function f(e,t){var r,n;return e?(n=new i,e.state=n,n.window=null,r=s(e,t),r!==A&&(e.state=null),r):U}function u(e){return f(e,ve)}function c(e){if(pe){var t;for(m=new v.Buf32(512),g=new v.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(y(x,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;y(S,e.lens,0,32,g,0,e.work,{bits:5}),pe=!1}e.lencode=m,e.lenbits=9,e.distcode=g,e.distbits=5}function l(e,t,r,n){var i,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new v.Buf8(a.wsize)),n>=a.wsize?(v.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i=a.wsize-a.wnext,i>n&&(i=n),v.arraySet(a.window,t,r-n,i,a.wnext),n-=i,n?(v.arraySet(a.window,t,r-n,n,0),a.wnext=n,a.whave=a.wsize):(a.wnext+=i,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=i))),0}function d(e,t){var r,i,a,o,s,f,u,d,h,w,b,m,g,be,me,ge,ve,pe,ke,_e,ye,Ee,xe,Se,Te=0,Oe=new v.Buf8(4),Be=[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 U;r=e.state,r.mode===G&&(r.mode=W),s=e.next_out,a=e.output,u=e.avail_out,o=e.next_in,i=e.input,f=e.avail_in,d=r.hold,h=r.bits,w=f,b=u,Ee=A;e:for(;;)switch(r.mode){case z:if(0===r.wrap){r.mode=W;break}for(;h<16;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}if(2&r.wrap&&35615===d){r.check=0,Oe[0]=255&d,Oe[1]=d>>>8&255,r.check=k(r.check,Oe,2,0),d=0,h=0,r.mode=P;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&d)<<8)+(d>>8))%31){e.msg="incorrect header check",r.mode=de;break}if((15&d)!==N){e.msg="unknown compression method",r.mode=de;break}if(d>>>=4,h-=4,ye=(15&d)+8,0===r.wbits)r.wbits=ye;else if(ye>r.wbits){e.msg="invalid window size",r.mode=de;break}r.dmax=1<<ye,e.adler=r.check=1,r.mode=512&d?q:G,d=0,h=0;break;case P:for(;h<16;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}if(r.flags=d,(255&r.flags)!==N){e.msg="unknown compression method",r.mode=de;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=de;break}r.head&&(r.head.text=d>>8&1),512&r.flags&&(Oe[0]=255&d,Oe[1]=d>>>8&255,r.check=k(r.check,Oe,2,0)),d=0,h=0,r.mode=F;case F:for(;h<32;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}r.head&&(r.head.time=d),512&r.flags&&(Oe[0]=255&d,Oe[1]=d>>>8&255,Oe[2]=d>>>16&255,Oe[3]=d>>>24&255,r.check=k(r.check,Oe,4,0)),d=0,h=0,r.mode=L;case L:for(;h<16;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}r.head&&(r.head.xflags=255&d,r.head.os=d>>8),512&r.flags&&(Oe[0]=255&d,Oe[1]=d>>>8&255,r.check=k(r.check,Oe,2,0)),d=0,h=0,r.mode=M;case M:if(1024&r.flags){for(;h<16;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}r.length=d,r.head&&(r.head.extra_len=d),512&r.flags&&(Oe[0]=255&d,Oe[1]=d>>>8&255,r.check=k(r.check,Oe,2,0)),d=0,h=0}else r.head&&(r.head.extra=null);r.mode=H;case H:if(1024&r.flags&&(m=r.length,m>f&&(m=f),m&&(r.head&&(ye=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),v.arraySet(r.head.extra,i,o,m,ye)),512&r.flags&&(r.check=k(r.check,i,m,o)),f-=m,o+=m,r.length-=m),r.length))break e;r.length=0,r.mode=j;case j:if(2048&r.flags){if(0===f)break e;m=0;do ye=i[o+m++],r.head&&ye&&r.length<65536&&(r.head.name+=String.fromCharCode(ye));while(ye&&m<f);if(512&r.flags&&(r.check=k(r.check,i,m,o)),f-=m,o+=m,ye)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=V;case V:if(4096&r.flags){if(0===f)break e;m=0;do ye=i[o+m++],r.head&&ye&&r.length<65536&&(r.head.comment+=String.fromCharCode(ye));while(ye&&m<f);if(512&r.flags&&(r.check=k(r.check,i,m,o)),f-=m,o+=m,ye)break e}else r.head&&(r.head.comment=null);r.mode=K;case K:if(512&r.flags){for(;h<16;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}if(d!==(65535&r.check)){e.msg="header crc mismatch",r.mode=de;break}d=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=G;break;case q:for(;h<32;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}e.adler=r.check=n(d),d=0,h=0,r.mode=Y;case Y:if(0===r.havedict)return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=f,r.hold=d,r.bits=h,R;e.adler=r.check=1,r.mode=G;case G:if(t===O||t===B)break e;case W:if(r.last){d>>>=7&h,h-=7&h,r.mode=ue;break}for(;h<3;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}switch(r.last=1&d,d>>>=1,h-=1,3&d){case 0:r.mode=J;break;case 1:if(c(r),r.mode=re,t===B){d>>>=2,h-=2;break e}break;case 2:r.mode=$;break;case 3:e.msg="invalid block type",r.mode=de}d>>>=2,h-=2;break;case J:for(d>>>=7&h,h-=7&h;h<32;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}if((65535&d)!==(d>>>16^65535)){e.msg="invalid stored block lengths",r.mode=de;break}if(r.length=65535&d,d=0,h=0,r.mode=Q,t===B)break e;case Q:r.mode=X;case X:if(m=r.length){if(m>f&&(m=f),m>u&&(m=u),0===m)break e;v.arraySet(a,i,o,m,s),f-=m,o+=m,u-=m,s+=m,r.length-=m;break}r.mode=G;break;case $:for(;h<14;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}if(r.nlen=(31&d)+257,d>>>=5,h-=5,r.ndist=(31&d)+1,d>>>=5,h-=5,r.ncode=(15&d)+4,d>>>=4,h-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=de;break}r.have=0,r.mode=ee;case ee:for(;r.have<r.ncode;){for(;h<3;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}r.lens[Be[r.have++]]=7&d,d>>>=3,h-=3}for(;r.have<19;)r.lens[Be[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,xe={bits:r.lenbits},Ee=y(E,r.lens,0,19,r.lencode,0,r.work,xe),r.lenbits=xe.bits,Ee){e.msg="invalid code lengths set",r.mode=de;break}r.have=0,r.mode=te;case te:for(;r.have<r.nlen+r.ndist;){for(;Te=r.lencode[d&(1<<r.lenbits)-1],me=Te>>>24,ge=Te>>>16&255,ve=65535&Te,!(me<=h);){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}if(ve<16)d>>>=me,h-=me,r.lens[r.have++]=ve;else{if(16===ve){for(Se=me+2;h<Se;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}if(d>>>=me,h-=me,0===r.have){e.msg="invalid bit length repeat",r.mode=de;break}ye=r.lens[r.have-1],m=3+(3&d),d>>>=2,h-=2}else if(17===ve){for(Se=me+3;h<Se;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}d>>>=me,h-=me,ye=0,m=3+(7&d),d>>>=3,h-=3}else{for(Se=me+7;h<Se;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}d>>>=me,h-=me,ye=0,m=11+(127&d),d>>>=7,h-=7}if(r.have+m>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=de;break}for(;m--;)r.lens[r.have++]=ye}}if(r.mode===de)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=de;break}if(r.lenbits=9,xe={bits:r.lenbits},Ee=y(x,r.lens,0,r.nlen,r.lencode,0,r.work,xe),r.lenbits=xe.bits,Ee){e.msg="invalid literal/lengths set",r.mode=de;break}if(r.distbits=6,r.distcode=r.distdyn,xe={bits:r.distbits},Ee=y(S,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,xe),r.distbits=xe.bits,Ee){e.msg="invalid distances set",r.mode=de;break}if(r.mode=re,t===B)break e;case re:r.mode=ne;case ne:if(f>=6&&u>=258){e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=f,r.hold=d,r.bits=h,_(e,b),s=e.next_out,a=e.output,u=e.avail_out,o=e.next_in,i=e.input,f=e.avail_in,d=r.hold,h=r.bits,r.mode===G&&(r.back=-1);break}for(r.back=0;Te=r.lencode[d&(1<<r.lenbits)-1],me=Te>>>24,ge=Te>>>16&255,ve=65535&Te,!(me<=h);){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}if(ge&&0===(240&ge)){for(pe=me,ke=ge,_e=ve;Te=r.lencode[_e+((d&(1<<pe+ke)-1)>>pe)],me=Te>>>24,ge=Te>>>16&255,ve=65535&Te,!(pe+me<=h);){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}d>>>=pe,h-=pe,r.back+=pe}if(d>>>=me,h-=me,r.back+=me,r.length=ve,0===ge){r.mode=fe;break}if(32&ge){r.back=-1,r.mode=G;break}if(64&ge){e.msg="invalid literal/length code",r.mode=de;break}r.extra=15&ge,r.mode=ie;case ie:if(r.extra){for(Se=r.extra;h<Se;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}r.length+=d&(1<<r.extra)-1,d>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ae;case ae:for(;Te=r.distcode[d&(1<<r.distbits)-1],me=Te>>>24,ge=Te>>>16&255,ve=65535&Te,!(me<=h);){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}if(0===(240&ge)){for(pe=me,ke=ge,_e=ve;Te=r.distcode[_e+((d&(1<<pe+ke)-1)>>pe)],me=Te>>>24,ge=Te>>>16&255,ve=65535&Te,!(pe+me<=h);){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}d>>>=pe,h-=pe,r.back+=pe}if(d>>>=me,h-=me,r.back+=me,64&ge){e.msg="invalid distance code",r.mode=de;break}r.offset=ve,r.extra=15&ge,r.mode=oe;case oe:if(r.extra){for(Se=r.extra;h<Se;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}r.offset+=d&(1<<r.extra)-1,d>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=de;break}r.mode=se;case se:if(0===u)break e;if(m=b-u,r.offset>m){if(m=r.offset-m,m>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=de;break}m>r.wnext?(m-=r.wnext,g=r.wsize-m):g=r.wnext-m,m>r.length&&(m=r.length),be=r.window}else be=a,g=s-r.offset,m=r.length;m>u&&(m=u),u-=m,r.length-=m;do a[s++]=be[g++];while(--m);0===r.length&&(r.mode=ne);break;case fe:if(0===u)break e;a[s++]=r.length,u--,r.mode=ne;break;case ue:if(r.wrap){for(;h<32;){if(0===f)break e;f--,d|=i[o++]<<h,h+=8}if(b-=u,e.total_out+=b,r.total+=b,b&&(e.adler=r.check=r.flags?k(r.check,a,b,s-b):p(r.check,a,b,s-b)),b=u,(r.flags?d:n(d))!==r.check){e.msg="incorrect data check",r.mode=de;break}d=0,h=0}r.mode=ce;case ce:if(r.wrap&&r.flags){for(;h<32;){if(0===f)break e;f--,d+=i[o++]<<h,h+=8}if(d!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=de;break}d=0,h=0}r.mode=le;case le:Ee=C;break e;case de:Ee=I;break e;case he:return Z;case we:default:return U}return e.next_out=s,e.avail_out=u,e.next_in=o,e.avail_in=f,r.hold=d,r.bits=h,(r.wsize||b!==e.avail_out&&r.mode<de&&(r.mode<ue||t!==T))&&l(e,e.output,e.next_out,b-e.avail_out)?(r.mode=he,Z):(w-=e.avail_in,b-=e.avail_out,e.total_in+=w,e.total_out+=b,r.total+=b,r.wrap&&b&&(e.adler=r.check=r.flags?k(r.check,a,b,e.next_out-b):p(r.check,a,b,e.next_out-b)),e.data_type=r.bits+(r.last?64:0)+(r.mode===G?128:0)+(r.mode===re||r.mode===Q?256:0),(0===w&&0===b||t===T)&&Ee===A&&(Ee=D),Ee)}function h(e){if(!e||!e.state)return U;var t=e.state;return t.window&&(t.window=null),e.state=null,A}function w(e,t){var r;return e&&e.state?(r=e.state,0===(2&r.wrap)?U:(r.head=t,t.done=!1,A)):U}function b(e,t){var r,n,i,a=t.length;return e&&e.state?(r=e.state,0!==r.wrap&&r.mode!==Y?U:r.mode===Y&&(n=1,n=p(n,t,a,0),n!==r.check)?I:(i=l(e,t,a,a))?(r.mode=he,Z):(r.havedict=1,A)):U}var m,g,v=e("../utils/common"),p=e("./adler32"),k=e("./crc32"),_=e("./inffast"),y=e("./inftrees"),E=0,x=1,S=2,T=4,O=5,B=6,A=0,C=1,R=2,U=-2,I=-3,Z=-4,D=-5,N=8,z=1,P=2,F=3,L=4,M=5,H=6,j=7,V=8,K=9,q=10,Y=11,G=12,W=13,J=14,Q=15,X=16,$=17,ee=18,te=19,re=20,ne=21,ie=22,ae=23,oe=24,se=25,fe=26,ue=27,ce=28,le=29,de=30,he=31,we=32,be=852,me=592,ge=15,ve=ge,pe=!0;r.inflateReset=o,r.inflateReset2=s,r.inflateResetKeep=a,r.inflateInit=u,r.inflateInit2=f,r.inflate=d,r.inflateEnd=h,r.inflateGetHeader=w,r.inflateSetDictionary=b,r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(e,t,r){"use strict";var n=e("../utils/common"),i=15,a=852,o=592,s=0,f=1,u=2,c=[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],l=[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],d=[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],h=[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,r,w,b,m,g,v){var p,k,_,y,E,x,S,T,O,B=v.bits,A=0,C=0,R=0,U=0,I=0,Z=0,D=0,N=0,z=0,P=0,F=null,L=0,M=new n.Buf16(i+1),H=new n.Buf16(i+1),j=null,V=0;for(A=0;A<=i;A++)M[A]=0;for(C=0;C<w;C++)M[t[r+C]]++;for(I=B,U=i;U>=1&&0===M[U];U--);if(I>U&&(I=U),0===U)return b[m++]=20971520,b[m++]=20971520,v.bits=1,0;for(R=1;R<U&&0===M[R];R++);for(I<R&&(I=R),N=1,A=1;A<=i;A++)if(N<<=1,N-=M[A],N<0)return-1;if(N>0&&(e===s||1!==U))return-1;for(H[1]=0,A=1;A<i;A++)H[A+1]=H[A]+M[A];for(C=0;C<w;C++)0!==t[r+C]&&(g[H[t[r+C]]++]=C);if(e===s?(F=j=g,x=19):e===f?(F=c,L-=257,j=l,V-=257,x=256):(F=d,j=h,x=-1),P=0,C=0,A=R,E=m,Z=I,D=0,_=-1,z=1<<I,y=z-1,e===f&&z>a||e===u&&z>o)return 1;for(;;){S=A-D,g[C]<x?(T=0,O=g[C]):g[C]>x?(T=j[V+g[C]],O=F[L+g[C]]):(T=96,O=0),p=1<<A-D,k=1<<Z,R=k;do k-=p,b[E+(P>>D)+k]=S<<24|T<<16|O|0;while(0!==k);for(p=1<<A-1;P&p;)p>>=1;if(0!==p?(P&=p-1,P+=p):P=0,C++,0===--M[A]){if(A===U)break;A=t[r+g[C]]}if(A>I&&(P&y)!==_){for(0===D&&(D=I),E+=R,Z=A-D,N=1<<Z;Z+D<U&&(N-=M[Z+D],!(N<=0));)Z++,N<<=1;if(z+=1<<Z,e===f&&z>a||e===u&&z>o)return 1;_=P&y,b[_]=I<<24|Z<<16|E-m|0}}return 0!==P&&(b[E+P]=A-D<<24|64<<16|0),v.bits=I,0}},{"../utils/common":1}],10:[function(e,t,r){"use strict";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,r){"use strict";function n(){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}t.exports=n},{}],"/lib/inflate.js":[function(e,t,r){"use strict";function n(e){if(!(this instanceof n))return new n(e);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0===(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=o.inflateInit2(this.strm,t.windowBits);if(r!==u.Z_OK)throw new Error(c[r]);this.header=new d,o.inflateGetHeader(this.strm,this.header)}function i(e,t){var r=new n(t);if(r.push(e,!0),r.err)throw r.msg||c[r.err];return r.result}function a(e,t){return t=t||{},t.raw=!0,i(e,t)}var o=e("./zlib/inflate"),s=e("./utils/common"),f=e("./utils/strings"),u=e("./zlib/constants"),c=e("./zlib/messages"),l=e("./zlib/zstream"),d=e("./zlib/gzheader"),h=Object.prototype.toString;n.prototype.push=function(e,t){var r,n,i,a,c,l,d=this.strm,w=this.options.chunkSize,b=this.options.dictionary,m=!1;if(this.ended)return!1;n=t===~~t?t:t===!0?u.Z_FINISH:u.Z_NO_FLUSH,"string"==typeof e?d.input=f.binstring2buf(e):"[object ArrayBuffer]"===h.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new s.Buf8(w),d.next_out=0,d.avail_out=w),r=o.inflate(d,u.Z_NO_FLUSH),r===u.Z_NEED_DICT&&b&&(l="string"==typeof b?f.string2buf(b):"[object ArrayBuffer]"===h.call(b)?new Uint8Array(b):b,r=o.inflateSetDictionary(this.strm,l)),r===u.Z_BUF_ERROR&&m===!0&&(r=u.Z_OK,m=!1),r!==u.Z_STREAM_END&&r!==u.Z_OK)return this.onEnd(r),this.ended=!0,!1;d.next_out&&(0!==d.avail_out&&r!==u.Z_STREAM_END&&(0!==d.avail_in||n!==u.Z_FINISH&&n!==u.Z_SYNC_FLUSH)||("string"===this.options.to?(i=f.utf8border(d.output,d.next_out),a=d.next_out-i,c=f.buf2string(d.output,i),d.next_out=a,d.avail_out=w-a,a&&s.arraySet(d.output,d.output,i,a,0),this.onData(c)):this.onData(s.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(m=!0)}while((d.avail_in>0||0===d.avail_out)&&r!==u.Z_STREAM_END);return r===u.Z_STREAM_END&&(n=u.Z_FINISH),n===u.Z_FINISH?(r=o.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u.Z_OK):n!==u.Z_SYNC_FLUSH||(this.onEnd(u.Z_OK),d.avail_out=0,!0)},n.prototype.onData=function(e){this.chunks.push(e)},n.prototype.onEnd=function(e){e===u.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=n,r.inflate=i,r.inflateRaw=a,r.ungzip=i},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")}),define("Workers/decodeGoogleEarthEnterprisePacket",["../Core/decodeGoogleEarthEnterpriseData","../Core/RuntimeError","../Core/GoogleEarthEnterpriseTileInformation","./createTaskProcessorWorker","../ThirdParty/pako_inflate"],function(e,t,r,n,i){"use strict";function a(t,r){var n=d.fromString(t.type),i=t.buffer;e(t.key,i);var a=f(i);i=a.buffer;var u=a.length;switch(n){case d.METADATA:return o(i,u,t.quadKey);case d.TERRAIN:return s(i,u,r);case d.DBROOT:return r.push(i),{buffer:i}}}function o(e,n,i){function a(e,t,r){var n=!1;if(4===r){if(t.hasSubtree())return;n=!0}for(var i=0;i<4;++i){var o=e+i.toString();if(n)B[o]=null;else if(r<4)if(t.hasChild(i)){if(A===b)return void console.log("Incorrect number of instances");var s=k[A++];B[o]=s,a(o,s,r+1)}else B[o]=null}}var o=new DataView(e),s=0,f=o.getUint32(s,!0);if(s+=l,f!==h)throw new t("Invalid magic");var d=o.getUint32(s,!0);if(s+=l,1!==d)throw new t("Invalid data type. Must be 1 for QuadTreePacket");var w=o.getUint32(s,!0);if(s+=l,2!==w)throw new t("Invalid QuadTreePacket version. Only version 2 is supported.");var b=o.getInt32(s,!0);s+=c;var m=o.getInt32(s,!0);if(s+=c,32!==m)throw new t("Invalid instance size.");var g=o.getInt32(s,!0);s+=c;var v=o.getInt32(s,!0);s+=c;var p=o.getInt32(s,!0);if(s+=c,g!==b*m+s)throw new t("Invalid dataBufferOffset");if(g+v+p!==n)throw new t("Invalid packet offsets");for(var k=[],_=0;_<b;++_){var y=o.getUint8(s);++s,++s;var E=o.getUint16(s,!0);s+=u;var x=o.getUint16(s,!0);s+=u;var S=o.getUint16(s,!0);s+=u,s+=u,s+=u,s+=c,s+=c,s+=8;var T=o.getUint8(s++),O=o.getUint8(s++);s+=u,k.push(new r(y,E,x,S,T,O))}var B=[],A=0,C=0,R=k[A++];return""===i?++C:B[i]=R,a(i,R,C),B}function s(e,t,r){for(var n=new DataView(e),i=0,a=[];i<t;){for(var o=i,s=0;s<4;++s){var f=n.getUint32(i,!0);i+=l,i+=f}var u=e.slice(o,i);r.push(u),a.push(u)}return a}function f(e){var r=new DataView(e),n=0,a=r.getUint32(n,!0);if(n+=l,a!==w&&a!==b)throw new t("Invalid magic");var o=r.getUint32(n,a===w);n+=l;var s=new Uint8Array(e,n),f=i.inflate(s);if(f.length!==o)throw new t("Size of packet doesn't match header");return f}var u=Uint16Array.BYTES_PER_ELEMENT,c=Int32Array.BYTES_PER_ELEMENT,l=Uint32Array.BYTES_PER_ELEMENT,d={METADATA:0,TERRAIN:1,DBROOT:2};d.fromString=function(e){return"Metadata"===e?d.METADATA:"Terrain"===e?d.TERRAIN:"DbRoot"===e?d.DBROOT:void 0};var h=32301,w=1953029805,b=2917034100;return n(a)})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/transcodeCRNToDXT.js b/engines/Cesium/Workers/transcodeCRNToDXT.js index bbecd27..733798e 100644 --- a/engines/Cesium/Workers/transcodeCRNToDXT.js +++ b/engines/Cesium/Workers/transcodeCRNToDXT.js @@ -81,9 +81,9 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/defineProperties",["./defined"],function(e){"use strict";var r=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),i=Object.defineProperties;return r&&e(i)||(i=function(e){return e}),i}),define("Core/CompressedTextureBuffer",["./defined","./defineProperties"],function(e,r){"use strict";function i(e,r,i,n){this._format=e,this._width=r,this._height=i,this._buffer=n}return r(i.prototype,{internalFormat:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}}),i.clone=function(r){if(e(r))return new i(r._format,r._width,r._height,r._buffer)},i.prototype.clone=function(){return i.clone(this)},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var r=Object.freeze;return e(r)||(r=function(e){return e}),r}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var r={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,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};return e(r)}),define("Core/PixelFormat",["./freezeObject","./WebGLConstants"],function(e,r){"use strict";var i={DEPTH_COMPONENT:r.DEPTH_COMPONENT,DEPTH_STENCIL:r.DEPTH_STENCIL,ALPHA:r.ALPHA,RGB:r.RGB,RGBA:r.RGBA,LUMINANCE:r.LUMINANCE,LUMINANCE_ALPHA:r.LUMINANCE_ALPHA,RGB_DXT1:r.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:r.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:r.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:r.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGB_ETC1:r.COMPRESSED_RGB_ETC1_WEBGL,validate:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL||e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA||e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5||e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1||e===i.RGB_ETC1},isColorFormat:function(e){return e===i.ALPHA||e===i.RGB||e===i.RGBA||e===i.LUMINANCE||e===i.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===i.DEPTH_COMPONENT||e===i.DEPTH_STENCIL},isCompressedFormat:function(e){return e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5||e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1||e===i.RGB_ETC1},isDXTFormat:function(e){return e===i.RGB_DXT1||e===i.RGBA_DXT1||e===i.RGBA_DXT3||e===i.RGBA_DXT5},isPVRTCFormat:function(e){return e===i.RGB_PVRTC_4BPPV1||e===i.RGB_PVRTC_2BPPV1||e===i.RGBA_PVRTC_4BPPV1||e===i.RGBA_PVRTC_2BPPV1},isETC1Format:function(e){return e===i.RGB_ETC1},compressedTextureSize:function(e,r,n){switch(e){case i.RGB_DXT1:case i.RGBA_DXT1:case i.RGB_ETC1:return Math.floor((r+3)/4)*Math.floor((n+3)/4)*8;case i.RGBA_DXT3:case i.RGBA_DXT5:return Math.floor((r+3)/4)*Math.floor((n+3)/4)*16;case i.RGB_PVRTC_4BPPV1:case i.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(r,8)*Math.max(n,8)*4+7)/8);case i.RGB_PVRTC_2BPPV1:case i.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(r,16)*Math.max(n,8)*2+7)/8);default:return 0}}};return e(i)}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function r(e){this.name="RuntimeError",this.message=e;var r;try{throw new Error}catch(e){r=e.stack}this.stack=r}return e(Object.create)&&(r.prototype=Object.create(Error.prototype),r.prototype.constructor=r),r.prototype.toString=function(){var r=this.name+": "+this.message;return e(this.stack)&&(r+="\n"+this.stack.toString()),r},r}),define("ThirdParty/crunch",[],function(){function globalEval(e){eval.call(null,e)}function assert(e,r){e||abort("Assertion failed: "+r)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,r,i,n){switch(i=i||"i8","*"===i.charAt(i.length-1)&&(i="i32"),i){case"i1":HEAP8[e>>0]=r;break;case"i8":HEAP8[e>>0]=r;break;case"i16":HEAP16[e>>1]=r;break;case"i32":HEAP32[e>>2]=r;break;case"i64":tempI64=[r>>>0,(tempDouble=r,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=r;break;case"double":HEAPF64[e>>3]=r;break;default:abort("invalid type for setValue: "+i)}}function getValue(e,r,i){switch(r=r||"i8","*"===r.charAt(r.length-1)&&(r="i32"),r){case"i1":return HEAP8[e>>0];case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+r)}return null}function allocate(e,r,i,n){var t,o;"number"==typeof e?(t=!0,o=e):(t=!1,o=e.length);var a,u="string"==typeof r?r:null;if(a=i==ALLOC_NONE?n:[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===i?ALLOC_STATIC:i](Math.max(o,u?1:r.length)),t){var s,n=a;for(assert(0==(3&a)),s=a+(o&-4);n<s;n+=4)HEAP32[n>>2]=0;for(s=a+o;n<s;)HEAP8[n++>>0]=0;return a}if("i8"===u)return e.subarray||e.slice?HEAPU8.set(e,a):HEAPU8.set(new Uint8Array(e),a),a;for(var l,f,_,c=0;c<o;){var E=e[c];"function"==typeof E&&(E=Runtime.getFunctionIndex(E)),l=u||r[c],0!==l?("i64"==l&&(l="i32"),setValue(a+c,E,l),_!==l&&(f=Runtime.getNativeTypeSize(l),_=l),c+=f):c++}return a}function getMemory(e){return staticSealed?"undefined"!=typeof _sbrk&&!_sbrk.called||!runtimeInitialized?Runtime.dynamicAlloc(e):_malloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,r){if(0===r||!e)return"";for(var i,n=0,t=0;;){if(i=HEAPU8[e+t>>0],n|=i,0==i&&!r)break;if(t++,r&&t==r)break}r||(r=t);var o="";if(n<128){for(var a,u=1024;r>0;)a=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(r,u))),o=o?o+a:a,e+=u,r-=u;return o}return Module.UTF8ToString(e)}function AsciiToString(e){for(var r="";;){var i=HEAP8[e++>>0];if(!i)return r;r+=String.fromCharCode(i)}}function stringToAscii(e,r){return writeAsciiToMemory(e,r,!1)}function UTF8ArrayToString(e,r){for(var i,n,t,o,a,u,s="";;){if(i=e[r++],!i)return s;if(128&i)if(n=63&e[r++],192!=(224&i))if(t=63&e[r++],224==(240&i)?i=(15&i)<<12|n<<6|t:(o=63&e[r++],240==(248&i)?i=(7&i)<<18|n<<12|t<<6|o:(a=63&e[r++],248==(252&i)?i=(3&i)<<24|n<<18|t<<12|o<<6|a:(u=63&e[r++],i=(1&i)<<30|n<<24|t<<18|o<<12|a<<6|u))),i<65536)s+=String.fromCharCode(i);else{var l=i-65536;s+=String.fromCharCode(55296|l>>10,56320|1023&l)}else s+=String.fromCharCode((31&i)<<6|n);else s+=String.fromCharCode(i)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,r,i,n){if(!(n>0))return 0;for(var t=i,o=i+n-1,a=0;a<e.length;++a){var u=e.charCodeAt(a);if(u>=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&e.charCodeAt(++a)),u<=127){if(i>=o)break;r[i++]=u}else if(u<=2047){if(i+1>=o)break;r[i++]=192|u>>6,r[i++]=128|63&u}else if(u<=65535){if(i+2>=o)break;r[i++]=224|u>>12,r[i++]=128|u>>6&63,r[i++]=128|63&u}else if(u<=2097151){if(i+3>=o)break;r[i++]=240|u>>18,r[i++]=128|u>>12&63,r[i++]=128|u>>6&63,r[i++]=128|63&u}else if(u<=67108863){if(i+4>=o)break;r[i++]=248|u>>24,r[i++]=128|u>>18&63,r[i++]=128|u>>12&63,r[i++]=128|u>>6&63,r[i++]=128|63&u}else{if(i+5>=o)break;r[i++]=252|u>>30,r[i++]=128|u>>24&63,r[i++]=128|u>>18&63,r[i++]=128|u>>12&63,r[i++]=128|u>>6&63,r[i++]=128|63&u}}return r[i]=0,i-t}function stringToUTF8(e,r,i){return stringToUTF8Array(e,HEAPU8,r,i)}function lengthBytesUTF8(e){for(var r=0,i=0;i<e.length;++i){var n=e.charCodeAt(i);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++i)),n<=127?++r:r+=n<=2047?2:n<=65535?3:n<=2097151?4:n<=67108863?5:6}return r}function UTF16ToString(e){for(var r=0,i="";;){var n=HEAP16[e+2*r>>1];if(0==n)return i;++r,i+=String.fromCharCode(n)}}function stringToUTF16(e,r,i){if(void 0===i&&(i=2147483647),i<2)return 0;i-=2;for(var n=r,t=i<2*e.length?i/2:e.length,o=0;o<t;++o){var a=e.charCodeAt(o);HEAP16[r>>1]=a,r+=2}return HEAP16[r>>1]=0,r-n}function lengthBytesUTF16(e){return 2*e.length}function UTF32ToString(e){for(var r=0,i="";;){var n=HEAP32[e+4*r>>2];if(0==n)return i;if(++r,n>=65536){var t=n-65536;i+=String.fromCharCode(55296|t>>10,56320|1023&t)}else i+=String.fromCharCode(n)}}function stringToUTF32(e,r,i){if(void 0===i&&(i=2147483647),i<4)return 0;for(var n=r,t=n+i-4,o=0;o<e.length;++o){var a=e.charCodeAt(o);if(a>=55296&&a<=57343){var u=e.charCodeAt(++o);a=65536+((1023&a)<<10)|1023&u}if(HEAP32[r>>2]=a,r+=4,r+4>t)break}return HEAP32[r>>2]=0,r-n}function lengthBytesUTF32(e){for(var r=0,i=0;i<e.length;++i){var n=e.charCodeAt(i);n>=55296&&n<=57343&&++i,r+=4}return r}function demangle(e){function r(){u++,"K"===e[u]&&u++;for(var r=[];"E"!==e[u];)if("S"!==e[u])if("C"!==e[u]){var i=parseInt(e.substr(u)),n=i.toString().length;if(!i||!n){u--;break}var t=e.substr(u+n,i);r.push(t),l.push(t),u+=n+i}else r.push(r[r.length-1]),u+=2;else{u++;var o=e.indexOf("_",u),a=e.substring(u,o)||0;r.push(l[a]||"?"),u=o+1}return u++,r}function i(n,t,o){function a(){return"("+c.join(", ")+")"}t=t||1/0;var l,_="",c=[];if("N"===e[u]){if(l=r().join("::"),t--,0===t)return n?[l]:l}else{("K"===e[u]||f&&"L"===e[u])&&u++;var E=parseInt(e.substr(u));if(E){var d=E.toString().length;l=e.substr(u+d,E),u+=d+E}}if(f=!1,"I"===e[u]){u++;var A=i(!0),T=i(!0,1,!0);_+=T[0]+" "+l+"<"+A.join(", ")+">"}else _=l;e:for(;u<e.length&&t-- >0;){var R=e[u++];if(R in s)c.push(s[R]);else switch(R){case"P":c.push(i(!0,1,!0)[0]+"*");break;case"R":c.push(i(!0,1,!0)[0]+"&");break;case"L":u++;var M=e.indexOf("E",u),E=M-u;c.push(e.substr(u,E)),u+=E+2;break;case"A":var E=parseInt(e.substr(u));if(u+=E.toString().length,"_"!==e[u])throw"?";u++,c.push(i(!0,1,!0)[0]+" ["+E+"]");break;case"E":break e;default:_+="?"+R;break e}}return o||1!==c.length||"void"!==c[0]||(c=[]),n?(_&&c.push(_+"?"),c):_+a()}var n=!!Module.___cxa_demangle;if(n)try{var t=_malloc(e.length);writeStringToMemory(e.substr(1),t);var o=_malloc(4),a=Module.___cxa_demangle(t,0,0,o);if(0===getValue(o,"i32")&&a)return Pointer_stringify(a)}catch(e){}finally{t&&_free(t),o&&_free(o),a&&_free(a)}var u=3,s={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},l=[],f=!0,_=e;try{if("Object._main"==e||"_main"==e)return"main()";if("number"==typeof e&&(e=Pointer_stringify(e)),"_"!==e[0])return e;if("_"!==e[1])return e;if("Z"!==e[2])return e;switch(e[3]){case"n":return"operator new()";case"d":return"operator delete()"}_=i()}catch(e){_+="?"}return _.indexOf("?")>=0&&!n&&Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),_}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,function(e){var r=demangle(e);return e===r?e:e+" ["+r+"]"})}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(r){e=r}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){return demangleAll(jsStackTrace())}function alignMemoryPage(e){return e%4096>0&&(e+=4096-e%4096),e}function enlargeMemory(){var e=Math.pow(2,31);if(DYNAMICTOP>=e)return!1;for(;TOTAL_MEMORY<=DYNAMICTOP;)if(TOTAL_MEMORY<e/2)TOTAL_MEMORY=alignMemoryPage(2*TOTAL_MEMORY);else{var r=TOTAL_MEMORY;if(TOTAL_MEMORY=alignMemoryPage((3*TOTAL_MEMORY+e)/4),TOTAL_MEMORY<=r)return!1}if(TOTAL_MEMORY=Math.max(TOTAL_MEMORY,16777216),TOTAL_MEMORY>=e)return!1;try{if(ArrayBuffer.transfer)buffer=ArrayBuffer.transfer(buffer,TOTAL_MEMORY);else{var i=HEAP8;buffer=new ArrayBuffer(TOTAL_MEMORY)}}catch(e){return!1}var n=_emscripten_replace_memory(buffer);return!!n&&(Module.buffer=buffer,Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer),ArrayBuffer.transfer||HEAP8.set(i),!0)}function callRuntimeCallbacks(e){for(;e.length>0;){var r=e.shift();if("function"!=typeof r){var i=r.func;"number"==typeof i?void 0===r.arg?Runtime.dynCall("v",i):Runtime.dynCall("vi",i,[r.arg]):i(void 0===r.arg?null:r.arg)}else r()}}function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,r,i){var n=i>0?i:lengthBytesUTF8(e)+1,t=new Array(n),o=stringToUTF8Array(e,t,0,t.length);return r&&(t.length=o),t}function intArrayToString(e){for(var r=[],i=0;i<e.length;i++){var n=e[i];n>255&&(n&=255),r.push(String.fromCharCode(n))}return r.join("")}function writeStringToMemory(e,r,i){for(var n=intArrayFromString(e,i),t=0;t<n.length;){var o=n[t];HEAP8[r+t>>0]=o,t+=1}}function writeArrayToMemory(e,r){for(var i=0;i<e.length;i++)HEAP8[r++>>0]=e[i]}function writeAsciiToMemory(e,r,i){for(var n=0;n<e.length;++n)HEAP8[r++>>0]=e.charCodeAt(n);i||(HEAP8[r>>0]=0)}function unSign(e,r,i){return e>=0?e:r<=32?2*Math.abs(1<<r-1)+e:Math.pow(2,r)+e}function reSign(e,r,i){if(e<=0)return e;var n=r<=32?Math.abs(1<<r-1):Math.pow(2,r-1);return e>=n&&(r<=32||e>n)&&(e=-2*n+e),e}function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var r=dependenciesFulfilled;dependenciesFulfilled=null,r()}}function copyTempFloat(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3]}function copyTempDouble(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3],HEAP8[tempDoublePtr+4]=HEAP8[e+4],HEAP8[tempDoublePtr+5]=HEAP8[e+5],HEAP8[tempDoublePtr+6]=HEAP8[e+6],HEAP8[tempDoublePtr+7]=HEAP8[e+7]}function _pthread_cleanup_push(e,r){__ATEXIT__.push(function(){Runtime.dynCall("vi",e,[r])}),_pthread_cleanup_push.level=__ATEXIT__.length}function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!"),__ATEXIT__.pop(),_pthread_cleanup_push.level=__ATEXIT__.length}function _abort(){Module.abort()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}function ___cxa_begin_catch(e){return __ZSt18uncaught_exceptionv.uncaught_exception--,EXCEPTIONS.caught.push(e),EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(e)),e}function _pthread_once(e,r){_pthread_once.seen||(_pthread_once.seen={}),e in _pthread_once.seen||(Runtime.dynCall("v",r),_pthread_once.seen[e]=1)}function _emscripten_memcpy_big(e,r,i){return HEAPU8.set(HEAPU8.subarray(r,r+i),e),e}function ___syscall6(e,r){SYSCALLS.varargs=r;try{var i=SYSCALLS.getStreamFromFD();return FS.close(i),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function _pthread_getspecific(e){return PTHREAD_SPECIFIC[e]||0}function ___setErrNo(e){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=e),e}function _sysconf(e){switch(e){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator?navigator.hardwareConcurrency||1:1}return ___setErrNo(ERRNO_CODES.EINVAL),-1}function _sbrk(e){var r=_sbrk;r.called||(DYNAMICTOP=alignMemoryPage(DYNAMICTOP),r.called=!0,assert(Runtime.dynamicAlloc),r.alloc=Runtime.dynamicAlloc,Runtime.dynamicAlloc=function(){abort("cannot dynamically allocate, sbrk now has control")});var i=DYNAMICTOP;if(0!=e){var n=r.alloc(e);if(!n)return-1>>>0}return i}function _pthread_key_create(e,r){return 0==e?ERRNO_CODES.EINVAL:(HEAP32[e>>2]=PTHREAD_SPECIFIC_NEXT_KEY,PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0,PTHREAD_SPECIFIC_NEXT_KEY++,0)}function _emscripten_set_main_loop_timing(e,r){function i(e){e.source===window&&e.data===t&&(e.stopPropagation(),n.shift()())}if(Browser.mainLoop.timingMode=e,Browser.mainLoop.timingValue=r,!Browser.mainLoop.func)return 1;if(0==e)Browser.mainLoop.scheduler=function(){setTimeout(Browser.mainLoop.runner,r)},Browser.mainLoop.method="timeout";else if(1==e)Browser.mainLoop.scheduler=function(){ -Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(2==e){if(!window.setImmediate){var n=[],t="__emcc";window.addEventListener("message",i,!0),window.setImmediate=function(e){n.push(e),window.postMessage(t,"*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(e,r,i,n,t){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=e,Browser.mainLoop.arg=n;var o=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var r=Date.now(),i=Browser.mainLoop.queue.shift();if(i.func(i.arg),Browser.mainLoop.remainingBlockers){var t=Browser.mainLoop.remainingBlockers,a=t%1==0?t-1:Math.floor(t);i.counted?Browser.mainLoop.remainingBlockers=a:(a+=.5,Browser.mainLoop.remainingBlockers=(8*t+a)/9)}return console.log('main loop blocker "'+i.name+'" took '+(Date.now()-r)+" ms"),Browser.mainLoop.updateStatus(),void setTimeout(Browser.mainLoop.runner,0)}if(!(o<Browser.mainLoop.currentlyRunningMainloop)){if(Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0,1==Browser.mainLoop.timingMode&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0)return void Browser.mainLoop.scheduler();"timeout"===Browser.mainLoop.method&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(function(){"undefined"!=typeof n?Runtime.dynCall("vi",e,[n]):Runtime.dynCall("v",e)}),o<Browser.mainLoop.currentlyRunningMainloop||("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Browser.mainLoop.scheduler())}}},t||(r&&r>0?_emscripten_set_main_loop_timing(0,1e3/r):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),i)throw"SimulateInfiniteLoop"}function _pthread_setspecific(e,r){return e in PTHREAD_SPECIFIC?(PTHREAD_SPECIFIC[e]=r,0):ERRNO_CODES.EINVAL}function _time(e){var r=Date.now()/1e3|0;return e&&(HEAP32[e>>2]=r),r}function _pthread_self(){return 0}function ___syscall140(e,r){SYSCALLS.varargs=r;try{var i=SYSCALLS.getStreamFromFD(),n=SYSCALLS.get(),t=SYSCALLS.get(),o=SYSCALLS.get(),a=SYSCALLS.get(),u=t;return assert(0===n),FS.llseek(i,u,a),HEAP32[o>>2]=i.position,i.getdents&&0===u&&0===a&&(i.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,r){SYSCALLS.varargs=r;try{var i=(SYSCALLS.get(),SYSCALLS.get()),n=SYSCALLS.get(),t=0;___syscall146.buffer||(___syscall146.buffer=[]);for(var o=___syscall146.buffer,a=0;a<n;a++){for(var u=HEAP32[i+8*a>>2],s=HEAP32[i+(8*a+4)>>2],l=0;l<s;l++){var f=HEAPU8[u+l];0===f||10===f?(Module.print(UTF8ArrayToString(o,0)),o.length=0):o.push(f)}t+=s}return t}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,r){SYSCALLS.varargs=r;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function invoke_iiii(e,r,i,n){try{return Module.dynCall_iiii(e,r,i,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiiii(e,r,i,n,t,o){try{Module.dynCall_viiiii(e,r,i,n,t,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_vi(e,r){try{Module.dynCall_vi(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_ii(e,r){try{return Module.dynCall_ii(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viii(e,r,i,n){try{Module.dynCall_viii(e,r,i,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_v(e){try{Module.dynCall_v(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiiiii(e,r,i,n,t,o,a){try{Module.dynCall_viiiiii(e,r,i,n,t,o,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiii(e,r,i,n,t){try{Module.dynCall_viiii(e,r,i,n,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function run(e){function r(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),r()},1)):r()))}function exit(e,r){if(!r||!Module.noExitRuntime)throw Module.noExitRuntime||(ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE?(process.stdout.once("drain",function(){process.exit(e)}),console.log(" "),setTimeout(function(){process.exit(e)},500)):ENVIRONMENT_IS_SHELL&&"function"==typeof quit&&quit(e),new ExitStatus(e)}function abort(e){void 0!==e?(Module.print(e),Module.printErr(e),e=JSON.stringify(e)):e="",ABORT=!0,EXITSTATUS=1;var r="\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.",i="abort("+e+") at "+stackTrace()+r;throw abortDecorators&&abortDecorators.forEach(function(r){i=r(i,e)}),i}var Module;Module||(Module=("undefined"!=typeof Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"function"==typeof require&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=function(e){process.stdout.write(e+"\n")}),Module.printErr||(Module.printErr=function(e){process.stderr.write(e+"\n")});var nodeFS=require("fs"),nodePath=require("path");Module.read=function(e,r){e=nodePath.normalize(e);var i=nodeFS.readFileSync(e);return i||e==nodePath.resolve(e)||(e=path.join(__dirname,"..","src",e),i=nodeFS.readFileSync(e)),i&&!r&&(i=i.toString()),i},Module.readBinary=function(e){var r=Module.read(e,!0);return r.buffer||(r=new Uint8Array(r)),assert(r.buffer),r},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available (jsc?)"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var r=read(e,"binary");return assert("object"==typeof r),r},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:"undefined"!=typeof arguments&&(Module.arguments=arguments);else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},"undefined"!=typeof arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.log(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),"undefined"==typeof Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var Runtime={setTempRet0:function(e){tempRet0=e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var r=parseInt(e.substr(1));return assert(r%8===0),r/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,r){return"double"===r||"i64"===r?7&e&&(assert(4===(7&e)),e+=4):assert(0===(3&e)),e},getAlignSize:function(e,r,i){return i||"i64"!=e&&"double"!=e?e?Math.min(r||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(r,8):8},dynCall:function(e,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),Module["dynCall_"+e].apply(null,i)):Module["dynCall_"+e].call(null,r)},functionPointers:[],addFunction:function(e){for(var r=0;r<Runtime.functionPointers.length;r++)if(!Runtime.functionPointers[r])return Runtime.functionPointers[r]=e,2*(1+r);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(e,r){assert(r),Runtime.funcWrappers[r]||(Runtime.funcWrappers[r]={});var i=Runtime.funcWrappers[r];return i[e]||(i[e]=function(){return Runtime.dynCall(r,e,arguments)}),i[e]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var r=STACKTOP;return STACKTOP=STACKTOP+e|0,STACKTOP=STACKTOP+15&-16,r},staticAlloc:function(e){var r=STATICTOP;return STATICTOP=STATICTOP+e|0,STATICTOP=STATICTOP+15&-16,r},dynamicAlloc:function(e){var r=DYNAMICTOP;if(DYNAMICTOP=DYNAMICTOP+e|0,DYNAMICTOP=DYNAMICTOP+15&-16,DYNAMICTOP>=TOTAL_MEMORY){var i=enlargeMemory();if(!i)return DYNAMICTOP=r,0}return r},alignMemory:function(e,r){var i=e=Math.ceil(e/(r?r:16))*(r?r:16);return i},makeBigInt:function(e,r,i){var n=i?+(e>>>0)+4294967296*+(r>>>0):+(e>>>0)+4294967296*+(0|r);return n},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var __THREW__=0,ABORT=!1,EXITSTATUS=0,undef=0,tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat,tempI64,tempI64b,tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9,globalScope=this,cwrap,ccall;!function(){function parseJSFunc(e){var r=e.toString().match(sourceRegex).slice(1);return{arguments:r[0],body:r[1],returnValue:r[2]}}var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var r=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,r),r},stringToC:function(e){var r=0;return null!==e&&void 0!==e&&0!==e&&(r=Runtime.stackAlloc((e.length<<2)+1),writeStringToMemory(e,r)),r}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,r,i,n,t){var o=getCFunc(e),a=[],u=0;if(n)for(var s=0;s<n.length;s++){var l=toC[i[s]];l?(0===u&&(u=Runtime.stackSave()),a[s]=l(n[s])):a[s]=n[s]}var f=o.apply(null,a);if("string"===r&&(f=Pointer_stringify(f)),0!==u){if(t&&t.async)return void EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(u)});Runtime.stackRestore(u)}return f};var sourceRegex=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,JSsource={};for(var fun in JSfuncs)JSfuncs.hasOwnProperty(fun)&&(JSsource[fun]=parseJSFunc(JSfuncs[fun]));cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(e){return"number"===e}),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(e,r){return"$"+r}),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if("number"!==type){var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"="+convertCode.returnValue+";"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+="ret = "+strgfy+"(ret);"}return numericArgs||(funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii,Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.UTF16ToString=UTF16ToString,Module.stringToUTF16=stringToUTF16,Module.lengthBytesUTF16=lengthBytesUTF16,Module.UTF32ToString=UTF32ToString,Module.stringToUTF32=stringToUTF32,Module.lengthBytesUTF32=lengthBytesUTF32,Module.stackTrace=stackTrace;var PAGE_SIZE=4096,HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE=0,STATICTOP=0,staticSealed=!1,STACK_BASE=0,STACKTOP=0,STACK_MAX=0,DYNAMIC_BASE=0,DYNAMICTOP=0,byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(e){byteLength=function(e){return e.byteLength}}for(var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216,totalMemory=65536;totalMemory<TOTAL_MEMORY||totalMemory<2*TOTAL_STACK;)totalMemory<16777216?totalMemory*=2:totalMemory+=16777216;totalMemory=Math.max(totalMemory,16777216),totalMemory!==TOTAL_MEMORY&&(TOTAL_MEMORY=totalMemory),assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"JS engine does not provide full typed array support");var buffer;buffer=new ArrayBuffer(TOTAL_MEMORY),HEAP8=new Int8Array(buffer),HEAP16=new Int16Array(buffer),HEAP32=new Int32Array(buffer),HEAPU8=new Uint8Array(buffer),HEAPU16=new Uint16Array(buffer),HEAPU32=new Uint32Array(buffer),HEAPF32=new Float32Array(buffer),HEAPF64=new Float64Array(buffer),HEAP32[0]=255,assert(255===HEAPU8[0]&&0===HEAPU8[3],"Typed arrays 2 must be run on a little-endian system"),Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&Math.imul(4294967295,5)===-5||(Math.imul=function(e,r){var i=e>>>16,n=65535&e,t=r>>>16,o=65535&r;return n*o+(i*o+n*t<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var r=0;r<32;r++)if(e&1<<31-r)return r;return 32}),Math.clz32=Math.clz32;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_min=Math.min,Math_clz32=Math.clz32,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var memoryInitializer=null,ASM_CONSTS=[];STATIC_BASE=8,STATICTOP=STATIC_BASE+5888,__ATINIT__.push(),allocate([116,0,0,0,86,7,0,0,116,0,0,0,99,7,0,0,156,0,0,0,112,7,0,0,16,0,0,0,0,0,0,0,156,0,0,0,145,7,0,0,24,0,0,0,0,0,0,0,156,0,0,0,215,7,0,0,24,0,0,0,0,0,0,0,156,0,0,0,179,7,0,0,56,0,0,0,0,0,0,0,156,0,0,0,249,7,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,1,0,0,220,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,227,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,219,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,105,110,99,92,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE); -var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0);var _BDtoIHigh=!0;Module._i64Subtract=_i64Subtract,Module._i64Add=_i64Add,Module._memset=_memset;var _BDtoILow=!0;Module._bitshift64Lshr=_bitshift64Lshr,Module._bitshift64Shl=_bitshift64Shl;var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(e){if(!e||EXCEPTIONS.infos[e])return e;for(var r in EXCEPTIONS.infos){var i=EXCEPTIONS.infos[r];if(i.adjusted===e)return r}return e},addRef:function(e){if(e){var r=EXCEPTIONS.infos[e];r.refcount++}},decRef:function(e){if(e){var r=EXCEPTIONS.infos[e];assert(r.refcount>0),r.refcount--,0===r.refcount&&(r.destructor&&Runtime.dynCall("vi",r.destructor,[e]),delete EXCEPTIONS.infos[e],___cxa_free_exception(e))}},clearRef:function(e){if(e){var r=EXCEPTIONS.infos[e];r.refcount=0}}};Module._memcpy=_memcpy;var SYSCALLS={varargs:0,get:function(e){SYSCALLS.varargs+=4;var r=HEAP32[SYSCALLS.varargs-4>>2];return r},getStr:function(){var e=Pointer_stringify(SYSCALLS.get());return e},get64:function(){var e=SYSCALLS.get(),r=SYSCALLS.get();return assert(e>=0?0===r:r===-1),e},getZero:function(){assert(0===SYSCALLS.get())}},PTHREAD_SPECIFIC={},ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86},PTHREAD_SPECIFIC_NEXT_KEY=1,_BItoD=!0,PATH=void 0,Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var e=Browser.mainLoop.timingMode,r=Browser.mainLoop.timingValue,i=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(i,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(e,r),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",r=Browser.mainLoop.remainingBlockers,i=Browser.mainLoop.expectedBlockers;r?r<i?Module.setStatus(e+" ("+(i-r)+"/"+i+")"):Module.setStatus(e):Module.setStatus("")}},runIter:function(e){if(!ABORT){if(Module.preMainLoop){var r=Module.preMainLoop();if(r===!1)return}try{e()}catch(e){if(e instanceof ExitStatus)return;throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}Module.postMainLoop&&Module.postMainLoop()}}},isFullScreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){function e(){Browser.pointerLock=document.pointerLockElement===n||document.mozPointerLockElement===n||document.webkitPointerLockElement===n||document.msPointerLockElement===n}if(Module.preloadPlugins||(Module.preloadPlugins=[]),!Browser.initted){Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch(e){Browser.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Browser.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),Browser.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,Module.noImageDecoding||"undefined"!=typeof Browser.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),Module.noImageDecoding=!0);var r={};r.canHandle=function(e){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},r.handle=function(e,r,i,n){var t=null;if(Browser.hasBlobConstructor)try{t=new Blob([e],{type:Browser.getMimetype(r)}),t.size!==e.length&&(t=new Blob([new Uint8Array(e).buffer],{type:Browser.getMimetype(r)}))}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!t){var o=new Browser.BlobBuilder;o.append(new Uint8Array(e).buffer),t=o.getBlob()}var a=Browser.URLObject.createObjectURL(t),u=new Image;u.onload=function(){assert(u.complete,"Image "+r+" could not be decoded");var n=document.createElement("canvas");n.width=u.width,n.height=u.height;var t=n.getContext("2d");t.drawImage(u,0,0),Module.preloadedImages[r]=n,Browser.URLObject.revokeObjectURL(a),i&&i(e)},u.onerror=function(e){console.log("Image "+a+" could not be decoded"),n&&n()},u.src=a},Module.preloadPlugins.push(r);var i={};i.canHandle=function(e){return!Module.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},i.handle=function(e,r,i,n){function t(n){a||(a=!0,Module.preloadedAudios[r]=n,i&&i(e))}function o(){a||(a=!0,Module.preloadedAudios[r]=new Audio,n&&n())}var a=!1;if(!Browser.hasBlobConstructor)return o();try{var u=new Blob([e],{type:Browser.getMimetype(r)})}catch(e){return o()}var s=Browser.URLObject.createObjectURL(u),l=new Audio;l.addEventListener("canplaythrough",function(){t(l)},!1),l.onerror=function(i){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="=",n="",t=0,o=0,a=0;a<e.length;a++)for(t=t<<8|e[a],o+=8;o>=6;){var u=t>>o-6&63;o-=6,n+=r[u]}return 2==o?(n+=r[(3&t)<<4],n+=i+i):4==o&&(n+=r[(15&t)<<2],n+=i),n}a||(console.log("warning: browser could not fully decode audio "+r+", trying slower base64 approach"),l.src="data:audio/x-"+r.substr(-3)+";base64,"+n(e),t(l))},l.src=s,Browser.safeSetTimeout(function(){t(l)},1e4)},Module.preloadPlugins.push(i);var n=Module.canvas;n&&(n.requestPointerLock=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock||n.msRequestPointerLock||function(){},n.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},n.exitPointerLock=n.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),document.addEventListener("mspointerlockchange",e,!1),Module.elementPointerLock&&n.addEventListener("click",function(e){!Browser.pointerLock&&n.requestPointerLock&&(n.requestPointerLock(),e.preventDefault())},!1))}},createContext:function(e,r,i,n){if(r&&Module.ctx&&e==Module.canvas)return Module.ctx;var t,o;if(r){var a={antialias:!1,alpha:!1};if(n)for(var u in n)a[u]=n[u];o=GL.createContext(e,a),o&&(t=GL.getContext(o).GLctx),e.style.backgroundColor="black"}else t=e.getContext("2d");return t?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=t,r&&GL.makeContextCurrent(o),Module.useWebGL=r,Browser.moduleContextCreatedCallbacks.forEach(function(e){e()}),Browser.init()),t):null},destroyContext:function(e,r,i){},fullScreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullScreen:function(e,r,i){function n(){Browser.isFullScreen=!1;var e=t.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===e?(t.cancelFullScreen=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},t.cancelFullScreen=t.cancelFullScreen.bind(document),Browser.lockPointer&&t.requestPointerLock(),Browser.isFullScreen=!0,Browser.resizeCanvas&&Browser.setFullScreenCanvasSize()):(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullScreen),Browser.updateCanvasDimensions(t)}Browser.lockPointer=e,Browser.resizeCanvas=r,Browser.vrDevice=i,"undefined"==typeof Browser.lockPointer&&(Browser.lockPointer=!0),"undefined"==typeof Browser.resizeCanvas&&(Browser.resizeCanvas=!1),"undefined"==typeof Browser.vrDevice&&(Browser.vrDevice=null);var t=Module.canvas;Browser.fullScreenHandlersInstalled||(Browser.fullScreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var o=document.createElement("div");t.parentNode.insertBefore(o,t),o.appendChild(t),o.requestFullScreen=o.requestFullScreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullScreen?function(){o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?o.requestFullScreen({vrDisplay:i}):o.requestFullScreen()},nextRAF:0,fakeRequestAnimationFrame:function(e){var r=Date.now();if(0===Browser.nextRAF)Browser.nextRAF=r+1e3/60;else for(;r+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var i=Math.max(Browser.nextRAF-r,0);setTimeout(e,i)},requestAnimationFrame:function(e){"undefined"==typeof window?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(e){return function(){if(!ABORT)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var e=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],e.forEach(function(e){e()})}},safeRequestAnimationFrame:function(e){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))})},safeSetTimeout:function(e,r){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))},r)},safeSetInterval:function(e,r){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&e()},r)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var r=0;switch(e.type){case"DOMMouseScroll":r=e.detail;break;case"mousewheel":r=e.wheelDelta;break;case"wheel":r=e.deltaY;break;default:throw"unrecognized mouse wheel event: "+e.type}return r},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(Browser.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),"undefined"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var r=Module.canvas.getBoundingClientRect(),i=Module.canvas.width,n=Module.canvas.height,t="undefined"!=typeof window.scrollX?window.scrollX:window.pageXOffset,o="undefined"!=typeof window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var a=e.touch;if(void 0===a)return;var u=a.pageX-(t+r.left),s=a.pageY-(o+r.top);u*=i/r.width,s*=n/r.height;var l={x:u,y:s};if("touchstart"===e.type)Browser.lastTouches[a.identifier]=l,Browser.touches[a.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var f=Browser.touches[a.identifier];f||(f=l),Browser.lastTouches[a.identifier]=f,Browser.touches[a.identifier]=l}return}var _=e.pageX-(t+r.left),c=e.pageY-(o+r.top);_*=i/r.width,c*=n/r.height,Browser.mouseMovementX=_-Browser.mouseX,Browser.mouseMovementY=c-Browser.mouseY,Browser.mouseX=_,Browser.mouseY=c}},xhrLoad:function(e,r,i){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?r(n.response):i()},n.onerror=i,n.send(null)},asyncLoad:function(e,r,i,n){Browser.xhrLoad(e,function(i){assert(i,'Loading data file "'+e+'" failed (no arrayBuffer).'),r(new Uint8Array(i)),n||removeRunDependency("al "+e)},function(r){if(!i)throw'Loading data file "'+e+'" failed.';i()}),n||addRunDependency("al "+e)},resizeListeners:[],updateResizeListeners:function(){var e=Module.canvas;Browser.resizeListeners.forEach(function(r){r(e.width,e.height)})},setCanvasSize:function(e,r,i){var n=Module.canvas;Browser.updateCanvasDimensions(n,e,r),i||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},updateCanvasDimensions:function(e,r,i){r&&i?(e.widthNative=r,e.heightNative=i):(r=e.widthNative,i=e.heightNative);var n=r,t=i;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(n/t<Module.forcedAspectRatio?n=Math.round(t*Module.forcedAspectRatio):t=Math.round(n/Module.forcedAspectRatio)),(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var o=Math.min(screen.width/n,screen.height/t);n=Math.round(n*o),t=Math.round(t*o)}Browser.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=t&&(e.height=t),"undefined"!=typeof e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=r&&(e.width=r),e.height!=i&&(e.height=i),"undefined"!=typeof e.style&&(n!=r||t!=i?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",t+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var e=Browser.nextWgetRequestHandle;return Browser.nextWgetRequestHandle++,e}};Module.requestFullScreen=function(e,r,i){Browser.requestFullScreen(e,r,i)},Module.requestAnimationFrame=function(e){Browser.requestAnimationFrame(e)},Module.setCanvasSize=function(e,r,i){Browser.setCanvasSize(e,r,i)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},Module.createContext=function(e,r,i,n){return Browser.createContext(e,r,i,n)},STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),staticSealed=!0,STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX),assert(DYNAMIC_BASE<TOTAL_MEMORY,"TOTAL_MEMORY not big enough for stack");var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_DYNAMIC);Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0,byteLength:byteLength},Module.asmLibraryArg={abort:abort,assert:assert,invoke_iiii:invoke_iiii,invoke_viiiii:invoke_viiiii,invoke_vi:invoke_vi,invoke_ii:invoke_ii,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_viiiiii:invoke_viiiiii,invoke_viiii:invoke_viiii,_pthread_cleanup_pop:_pthread_cleanup_pop,_pthread_getspecific:_pthread_getspecific,_pthread_setspecific:_pthread_setspecific,__ZSt18uncaught_exceptionv:__ZSt18uncaught_exceptionv,_emscripten_set_main_loop:_emscripten_set_main_loop,_pthread_self:_pthread_self,_abort:_abort,_pthread_cleanup_push:_pthread_cleanup_push,___syscall6:___syscall6,_sbrk:_sbrk,_time:_time,_pthread_key_create:_pthread_key_create,___setErrNo:___setErrNo,_emscripten_memcpy_big:_emscripten_memcpy_big,___syscall54:___syscall54,___syscall140:___syscall140,_pthread_once:_pthread_once,_emscripten_set_main_loop_timing:_emscripten_set_main_loop_timing,_sysconf:_sysconf,___syscall146:___syscall146,___cxa_begin_catch:___cxa_begin_catch,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,tempDoublePtr:tempDoublePtr,ABORT:ABORT,cttz_i8:cttz_i8};var asm=function(e,r,i){"use asm";var n=e.Int8Array;var t=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var u=e.Uint16Array;var s=e.Uint32Array;var l=e.Float32Array;var f=e.Float64Array;var _=new n(i);var c=new t(i);var E=new o(i);var d=new a(i);var A=new u(i);var T=new s(i);var R=new l(i);var M=new f(i);var m=e.byteLength;var S=r.STACKTOP|0;var h=r.STACK_MAX|0;var N=r.tempDoublePtr|0;var C=r.ABORT|0;var p=r.cttz_i8|0;var w=0;var b=0;var I=0;var O=0;var P=e.NaN,v=e.Infinity;var L=0,B=0,k=0,F=0,g=0,U=0,y=0,D=0,H=0;var G=0;var X=0;var V=0;var Y=0;var x=0;var K=0;var W=0;var z=0;var q=0;var j=0;var Z=e.Math.floor;var J=e.Math.abs;var Q=e.Math.sqrt;var $=e.Math.pow;var ee=e.Math.cos;var re=e.Math.sin;var ie=e.Math.tan;var ne=e.Math.acos;var te=e.Math.asin;var oe=e.Math.atan;var ae=e.Math.atan2;var ue=e.Math.exp;var se=e.Math.log;var le=e.Math.ceil;var fe=e.Math.imul;var _e=e.Math.min;var ce=e.Math.clz32;var Ee=r.abort;var de=r.assert;var Ae=r.invoke_iiii;var Te=r.invoke_viiiii;var Re=r.invoke_vi;var Me=r.invoke_ii;var me=r.invoke_viii;var Se=r.invoke_v;var he=r.invoke_viiiiii;var Ne=r.invoke_viiii;var Ce=r._pthread_cleanup_pop;var pe=r._pthread_getspecific;var we=r._pthread_setspecific;var be=r.__ZSt18uncaught_exceptionv;var Ie=r._emscripten_set_main_loop;var Oe=r._pthread_self;var Pe=r._abort;var ve=r._pthread_cleanup_push;var Le=r.___syscall6;var Be=r._sbrk;var ke=r._time;var Fe=r._pthread_key_create;var ge=r.___setErrNo;var Ue=r._emscripten_memcpy_big;var ye=r.___syscall54;var De=r.___syscall140;var He=r._pthread_once;var Ge=r._emscripten_set_main_loop_timing;var Xe=r._sysconf;var Ve=r.___syscall146;var Ye=r.___cxa_begin_catch;var xe=0;function Ke(e){if(m(e)&16777215||m(e)<=16777215||m(e)>2147483648)return false;_=new n(e);c=new t(e);E=new o(e);d=new a(e);A=new u(e);T=new s(e);R=new l(e);M=new f(e);i=e;return true}function We(e){e=e|0;var r=0;r=S;S=S+e|0;S=S+15&-16;return r|0}function ze(){return S|0}function qe(e){e=e|0;S=e}function je(e,r){e=e|0;r=r|0;S=e;h=r}function Ze(e,r){e=e|0;r=r|0;if(!w){w=e;b=r}}function Je(e){e=e|0;_[N>>0]=_[e>>0];_[N+1>>0]=_[e+1>>0];_[N+2>>0]=_[e+2>>0];_[N+3>>0]=_[e+3>>0]}function Qe(e){e=e|0;_[N>>0]=_[e>>0];_[N+1>>0]=_[e+1>>0];_[N+2>>0]=_[e+2>>0];_[N+3>>0]=_[e+3>>0];_[N+4>>0]=_[e+4>>0];_[N+5>>0]=_[e+5>>0];_[N+6>>0]=_[e+6>>0];_[N+7>>0]=_[e+7>>0]}function $e(e){e=e|0;G=e}function er(){return G|0}function rr(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0;d=S;S=S+576|0;f=d+48|0;u=d+32|0;a=d+16|0;o=d;l=d+64|0;_=d+60|0;s=e+4|0;c=e+8|0;if((E[s>>2]|0)>>>0>(E[c>>2]|0)>>>0){E[o>>2]=1138;E[o+4>>2]=2119;E[o+8>>2]=1117;mi(l,1084,o)|0;Mi(l)|0}if((2147418112/(n>>>0)|0)>>>0<=r>>>0){E[a>>2]=1138;E[a+4>>2]=2120;E[a+8>>2]=1157;mi(l,1084,a)|0;Mi(l)|0}a=E[c>>2]|0;if(a>>>0>=r>>>0){c=1;S=d;return c|0}do if(i){if(r){o=r+-1|0;if(!(o&r)){o=11;break}else r=o}else r=-1;r=r>>>16|r;r=r>>>8|r;r=r>>>4|r;r=r>>>2|r;r=(r>>>1|r)+1|0;o=10}else o=10;while(0);if((o|0)==10)if(!r){r=0;o=12}else o=11;if((o|0)==11)if(r>>>0<=a>>>0)o=12;if((o|0)==12){E[u>>2]=1138;E[u+4>>2]=2129;E[u+8>>2]=1205;mi(l,1084,u)|0;Mi(l)|0}i=fe(r,n)|0;do if(!t){o=ir(E[e>>2]|0,i,_,1)|0;if(!o){c=0;S=d;return c|0}else{E[e>>2]=o;break}}else{a=nr(i,_)|0;if(!a){c=0;S=d;return c|0}On[t&0](a,E[e>>2]|0,E[s>>2]|0);o=E[e>>2]|0;do if(o)if(!(o&7)){or(o,0,0,1,0)|0;break}else{E[f>>2]=1138;E[f+4>>2]=2502;E[f+8>>2]=1504;mi(l,1084,f)|0;Mi(l)|0;break}while(0);E[e>>2]=a}while(0);o=E[_>>2]|0;if(o>>>0>i>>>0)r=(o>>>0)/(n>>>0)|0;E[c>>2]=r;c=1;S=d;return c|0}function ir(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0,u=0,s=0,l=0;l=S;S=S+560|0;s=l+32|0;o=l+16|0;t=l;u=l+48|0;a=l+44|0;if(e&7){E[t>>2]=1138;E[t+4>>2]=2502;E[t+8>>2]=1482;mi(u,1084,t)|0;Mi(u)|0;s=0;S=l;return s|0}if(r>>>0>2147418112){E[o>>2]=1138;E[o+4>>2]=2502;E[o+8>>2]=1375;mi(u,1084,o)|0;Mi(u)|0;s=0;S=l;return s|0}E[a>>2]=r;n=or(e,r,a,n,0)|0;if(i)E[i>>2]=E[a>>2];if(!(n&7)){s=n;S=l;return s|0}E[s>>2]=1138;E[s+4>>2]=2554;E[s+8>>2]=1428;mi(u,1084,s)|0;Mi(u)|0;s=n;S=l;return s|0}function nr(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0;s=S;S=S+560|0;u=s+32|0;a=s+16|0;i=s;o=s+48|0;t=s+44|0;n=e+3&-4;n=(n|0)!=0?n:4;if(n>>>0>2147418112){E[i>>2]=1138;E[i+4>>2]=2502;E[i+8>>2]=1375;mi(o,1084,i)|0;Mi(o)|0;u=0;S=s;return u|0}E[t>>2]=n;i=or(0,n,t,1,0)|0;e=E[t>>2]|0;if(r)E[r>>2]=e;if((i|0)==0|e>>>0<n>>>0){E[a>>2]=1138;E[a+4>>2]=2502;E[a+8>>2]=1401;mi(o,1084,a)|0;Mi(o)|0;u=0;S=s;return u|0}if(!(i&7)){u=i;S=s;return u|0}E[u>>2]=1138;E[u+4>>2]=2529;E[u+8>>2]=1428;mi(o,1084,u)|0;Mi(o)|0;u=i;S=s;return u|0}function tr(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0,u=0,s=0,l=0,f=0,T=0,R=0,M=0,m=0,h=0,N=0,C=0,p=0,w=0,b=0,I=0,O=0,P=0,v=0,L=0,B=0,k=0,F=0,g=0,U=0,y=0;y=S;S=S+880|0;F=y+144|0;k=y+128|0;B=y+112|0;L=y+96|0;O=y+80|0;N=y+64|0;m=y+48|0;h=y+32|0;T=y+16|0;f=y;v=y+360|0;g=y+296|0;U=y+224|0;M=y+156|0;if((r|0)==0|n>>>0>11){e=0;S=y;return e|0}E[e>>2]=r;t=U;o=t+68|0;do{E[t>>2]=0;t=t+4|0}while((t|0)<(o|0));o=0;do{t=_[i+o>>0]|0;if(t<<24>>24){P=U+((t&255)<<2)|0;E[P>>2]=(E[P>>2]|0)+1}o=o+1|0}while((o|0)!=(r|0));o=0;l=1;a=0;u=-1;s=0;while(1){t=E[U+(l<<2)>>2]|0;if(!t)E[e+28+(l+-1<<2)>>2]=0;else{P=l+-1|0;E[g+(P<<2)>>2]=o;o=t+o|0;I=16-l|0;E[e+28+(P<<2)>>2]=(o+-1<<I|(1<<I)+-1)+1;E[e+96+(P<<2)>>2]=s;E[M+(l<<2)>>2]=s;a=a>>>0>l>>>0?a:l;u=u>>>0<l>>>0?u:l;s=t+s|0}l=l+1|0;if((l|0)==17){P=a;break}else o=o<<1}E[e+4>>2]=s;o=e+172|0;do if(s>>>0>(E[o>>2]|0)>>>0){E[o>>2]=s;if(s){t=s+-1|0;if(t&s)R=14}else{t=-1;R=14}if((R|0)==14){I=t>>>16|t;I=I>>>8|I;I=I>>>4|I;I=I>>>2|I;I=(I>>>1|I)+1|0;E[o>>2]=I>>>0>r>>>0?r:I}a=e+176|0;t=E[a>>2]|0;do if(t){I=E[t+-4>>2]|0;t=t+-8|0;if(!((I|0)!=0?(I|0)==(~E[t>>2]|0):0)){E[f>>2]=1138;E[f+4>>2]=647;E[f+8>>2]=1851;mi(v,1084,f)|0;Mi(v)|0}if(!(t&7)){or(t,0,0,1,0)|0;break}else{E[T>>2]=1138;E[T+4>>2]=2502;E[T+8>>2]=1504;mi(v,1084,T)|0;Mi(v)|0;break}}while(0);o=E[o>>2]|0;o=(o|0)!=0?o:1;t=nr((o<<1)+8|0,0)|0;if(!t){E[a>>2]=0;t=0;break}else{E[t+4>>2]=o;E[t>>2]=~o;E[a>>2]=t+8;R=25;break}}else R=25;while(0);e:do if((R|0)==25){I=e+24|0;_[I>>0]=u;_[e+25>>0]=P;o=e+176|0;a=0;do{b=_[i+a>>0]|0;t=b&255;if(b<<24>>24){if(!(E[U+(t<<2)>>2]|0)){E[h>>2]=1138;E[h+4>>2]=2272;E[h+8>>2]=1249;mi(v,1084,h)|0;Mi(v)|0}b=M+(t<<2)|0;t=E[b>>2]|0;E[b>>2]=t+1;if(t>>>0>=s>>>0){E[m>>2]=1138;E[m+4>>2]=2276;E[m+8>>2]=1262;mi(v,1084,m)|0;Mi(v)|0}c[(E[o>>2]|0)+(t<<1)>>1]=a}a=a+1|0}while((a|0)!=(r|0));t=_[I>>0]|0;w=(t&255)>>>0<n>>>0?n:0;b=e+8|0;E[b>>2]=w;p=(w|0)!=0;if(p){C=1<<w;t=e+164|0;do if(C>>>0>(E[t>>2]|0)>>>0){E[t>>2]=C;a=e+168|0;t=E[a>>2]|0;do if(t){h=E[t+-4>>2]|0;t=t+-8|0;if(!((h|0)!=0?(h|0)==(~E[t>>2]|0):0)){E[N>>2]=1138;E[N+4>>2]=647;E[N+8>>2]=1851;mi(v,1084,N)|0;Mi(v)|0}if(!(t&7)){or(t,0,0,1,0)|0;break}else{E[O>>2]=1138;E[O+4>>2]=2502;E[O+8>>2]=1504;mi(v,1084,O)|0;Mi(v)|0;break}}while(0);t=C<<2;o=nr(t+8|0,0)|0;if(!o){E[a>>2]=0;t=0;break e}else{O=o+8|0;E[o+4>>2]=C;E[o>>2]=~C;E[a>>2]=O;o=O;break}}else{o=e+168|0;t=C<<2;a=o;o=E[o>>2]|0}while(0);qi(o|0,-1,t|0)|0;M=e+176|0;N=1;do{if(E[U+(N<<2)>>2]|0){m=w-N|0;h=1<<m;o=N+-1|0;u=E[g+(o<<2)>>2]|0;if(o>>>0>=16){E[L>>2]=1138;E[L+4>>2]=1956;E[L+8>>2]=1725;mi(v,1084,L)|0;Mi(v)|0}t=E[e+28+(o<<2)>>2]|0;if(!t)r=-1;else r=(t+-1|0)>>>(16-N|0);if(u>>>0<=r>>>0){T=(E[e+96+(o<<2)>>2]|0)-u|0;R=N<<16;do{t=A[(E[M>>2]|0)+(T+u<<1)>>1]|0;if((d[i+t>>0]|0|0)!=(N|0)){E[B>>2]=1138;E[B+4>>2]=2318;E[B+8>>2]=1291;mi(v,1084,B)|0;Mi(v)|0}f=u<<m;o=t|R;l=0;do{s=l+f|0;if(s>>>0>=C>>>0){E[k>>2]=1138;E[k+4>>2]=2324;E[k+8>>2]=1325;mi(v,1084,k)|0;Mi(v)|0}t=E[a>>2]|0;if((E[t+(s<<2)>>2]|0)!=-1){E[F>>2]=1138;E[F+4>>2]=2326;E[F+8>>2]=1348;mi(v,1084,F)|0;Mi(v)|0;t=E[a>>2]|0}E[t+(s<<2)>>2]=o;l=l+1|0}while(l>>>0<h>>>0);u=u+1|0}while(u>>>0<=r>>>0)}}N=N+1|0}while(w>>>0>=N>>>0);t=_[I>>0]|0}o=e+96|0;E[o>>2]=(E[o>>2]|0)-(E[g>>2]|0);o=e+100|0;E[o>>2]=(E[o>>2]|0)-(E[g+4>>2]|0);o=e+104|0;E[o>>2]=(E[o>>2]|0)-(E[g+8>>2]|0);o=e+108|0;E[o>>2]=(E[o>>2]|0)-(E[g+12>>2]|0);o=e+112|0;E[o>>2]=(E[o>>2]|0)-(E[g+16>>2]|0);o=e+116|0;E[o>>2]=(E[o>>2]|0)-(E[g+20>>2]|0);o=e+120|0;E[o>>2]=(E[o>>2]|0)-(E[g+24>>2]|0);o=e+124|0;E[o>>2]=(E[o>>2]|0)-(E[g+28>>2]|0);o=e+128|0;E[o>>2]=(E[o>>2]|0)-(E[g+32>>2]|0);o=e+132|0;E[o>>2]=(E[o>>2]|0)-(E[g+36>>2]|0);o=e+136|0;E[o>>2]=(E[o>>2]|0)-(E[g+40>>2]|0);o=e+140|0;E[o>>2]=(E[o>>2]|0)-(E[g+44>>2]|0);o=e+144|0;E[o>>2]=(E[o>>2]|0)-(E[g+48>>2]|0);o=e+148|0;E[o>>2]=(E[o>>2]|0)-(E[g+52>>2]|0);o=e+152|0;E[o>>2]=(E[o>>2]|0)-(E[g+56>>2]|0);o=e+156|0;E[o>>2]=(E[o>>2]|0)-(E[g+60>>2]|0);o=e+16|0;E[o>>2]=0;a=e+20|0;E[a>>2]=t&255;r:do if(p){while(1){if(!n)break r;t=n+-1|0;if(!(E[U+(n<<2)>>2]|0))n=t;else break}E[o>>2]=E[e+28+(t<<2)>>2];t=w+1|0;E[a>>2]=t;if(t>>>0<=P>>>0){while(1){if(E[U+(t<<2)>>2]|0)break;t=t+1|0;if(t>>>0>P>>>0)break r}E[a>>2]=t}}while(0);E[e+92>>2]=-1;E[e+160>>2]=1048575;E[e+12>>2]=32-(E[b>>2]|0);t=1}while(0);e=t;S=y;return e|0}function or(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;do if(!e){n=Hi(r)|0;if(i){if(!n)e=0;else e=Vi(n)|0;E[i>>2]=e}}else{if(!r){Gi(e);if(!i){n=0;break}E[i>>2]=0;n=0;break}if(n){n=Xi(e,r)|0;e=(n|0)==0?e:n}else n=0;if(i){r=Vi(e)|0;E[i>>2]=r}}while(0);return n|0}function ar(e,r,i){e=e|0;r=r|0;i=i|0;var n=0;if(!((e|0)!=0&r>>>0>73&(i|0)!=0)){i=0;return i|0}if((E[i>>2]|0)!=40|r>>>0<74){i=0;return i|0}if(((d[e>>0]|0)<<8|(d[e+1>>0]|0)|0)!=18552){i=0;return i|0}if(((d[e+2>>0]|0)<<8|(d[e+3>>0]|0))>>>0<74){i=0;return i|0}if(((d[e+7>>0]|0)<<16|(d[e+6>>0]|0)<<24|(d[e+8>>0]|0)<<8|(d[e+9>>0]|0))>>>0>r>>>0){i=0;return i|0}E[i+4>>2]=(d[e+12>>0]|0)<<8|(d[e+13>>0]|0);E[i+8>>2]=(d[e+14>>0]|0)<<8|(d[e+15>>0]|0);E[i+12>>2]=d[e+16>>0];E[i+16>>2]=d[e+17>>0];r=e+18|0;n=i+32|0;E[n>>2]=d[r>>0];E[n+4>>2]=0;r=_[r>>0]|0;E[i+20>>2]=r<<24>>24==0|r<<24>>24==9?8:16;E[i+24>>2]=(d[e+26>>0]|0)<<16|(d[e+25>>0]|0)<<24|(d[e+27>>0]|0)<<8|(d[e+28>>0]|0);E[i+28>>2]=(d[e+30>>0]|0)<<16|(d[e+29>>0]|0)<<24|(d[e+31>>0]|0)<<8|(d[e+32>>0]|0);i=1;return i|0}function ur(e){e=e|0;Ye(e|0)|0;Hr()}function sr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0;o=S;S=S+528|0;t=o;n=o+16|0;r=E[e+20>>2]|0;if(r)lr(r);r=e+4|0;i=E[r>>2]|0;if(!i){t=e+16|0;_[t>>0]=0;S=o;return}if(!(i&7))or(i,0,0,1,0)|0;else{E[t>>2]=1138;E[t+4>>2]=2502;E[t+8>>2]=1504;mi(n,1084,t)|0;Mi(n)|0}E[r>>2]=0;E[e+8>>2]=0;E[e+12>>2]=0;t=e+16|0;_[t>>0]=0;S=o;return}function lr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0;s=S;S=S+592|0;a=s+64|0;o=s+48|0;u=s+32|0;n=s+16|0;i=s;t=s+80|0;if(!e){S=s;return}r=E[e+168>>2]|0;do if(r){l=E[r+-4>>2]|0;r=r+-8|0;if(!((l|0)!=0?(l|0)==(~E[r>>2]|0):0)){E[i>>2]=1138;E[i+4>>2]=647;E[i+8>>2]=1851;mi(t,1084,i)|0;Mi(t)|0}if(!(r&7)){or(r,0,0,1,0)|0;break}else{E[n>>2]=1138;E[n+4>>2]=2502;E[n+8>>2]=1504;mi(t,1084,n)|0;Mi(t)|0;break}}while(0);r=E[e+176>>2]|0;do if(r){l=E[r+-4>>2]|0;r=r+-8|0;if(!((l|0)!=0?(l|0)==(~E[r>>2]|0):0)){E[u>>2]=1138;E[u+4>>2]=647;E[u+8>>2]=1851;mi(t,1084,u)|0;Mi(t)|0}if(!(r&7)){or(r,0,0,1,0)|0;break}else{E[o>>2]=1138;E[o+4>>2]=2502;E[o+8>>2]=1504;mi(t,1084,o)|0;Mi(t)|0;break}}while(0);if(!(e&7)){or(e,0,0,1,0)|0;S=s;return}else{E[a>>2]=1138;E[a+4>>2]=2502;E[a+8>>2]=1504;mi(t,1084,a)|0;Mi(t)|0;S=s;return}}function fr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0;s=S;S=S+544|0;a=s+16|0;r=s;o=s+32|0;t=e+8|0;i=E[t>>2]|0;if((i+-1|0)>>>0>=8192){E[r>>2]=1138;E[r+4>>2]=3002;E[r+8>>2]=1529;mi(o,1084,r)|0;Mi(o)|0}E[e>>2]=i;n=e+20|0;r=E[n>>2]|0;if(!r){r=nr(180,0)|0;if(!r)r=0;else{u=r+164|0;E[u>>2]=0;E[u+4>>2]=0;E[u+8>>2]=0;E[u+12>>2]=0}E[n>>2]=r;u=E[e>>2]|0}else u=i;if(!(E[t>>2]|0)){E[a>>2]=1138;E[a+4>>2]=906;E[a+8>>2]=1769;mi(o,1084,a)|0;Mi(o)|0;a=E[e>>2]|0}else a=u;o=E[e+4>>2]|0;if(a>>>0>16){n=a;i=0}else{e=0;e=tr(r,u,o,e)|0;S=s;return e|0}while(1){t=i+1|0;if(n>>>0>3){n=n>>>1;i=t}else{n=t;break}}e=i+2+((n|0)!=32&1<<n>>>0<a>>>0&1)|0;e=e>>>0<11?e&255:11;e=tr(r,u,o,e)|0;S=s;return e|0}function _r(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,c=0,A=0,T=0,R=0,M=0,m=0,h=0,N=0,C=0,p=0,w=0,b=0,I=0,O=0,P=0,v=0;v=S;S=S+720|0;w=v+160|0;p=v+144|0;C=v+128|0;N=v+112|0;h=v+96|0;m=v+80|0;M=v+64|0;R=v+48|0;f=v+32|0;u=v+16|0;t=v;O=v+200|0;P=v+176|0;b=cr(e,14)|0;if(!b){E[r>>2]=0;i=r+4|0;n=E[i>>2]|0;if(n){if(!(n&7))or(n,0,0,1,0)|0;else{E[t>>2]=1138;E[t+4>>2]=2502;E[t+8>>2]=1504;mi(O,1084,t)|0;Mi(O)|0}E[i>>2]=0;E[r+8>>2]=0;E[r+12>>2]=0}_[r+16>>0]=0;i=r+20|0;n=E[i>>2]|0;if(!n){r=1;S=v;return r|0}lr(n);E[i>>2]=0;r=1;S=v;return r|0}A=r+4|0;T=r+8|0;i=E[T>>2]|0;if((i|0)!=(b|0)){if(i>>>0<=b>>>0){do if((E[r+12>>2]|0)>>>0<b>>>0){if(rr(A,b,(i+1|0)==(b|0),1,0)|0){i=E[T>>2]|0;break}_[r+16>>0]=1;r=0;S=v;return r|0}while(0);qi((E[A>>2]|0)+i|0,0,b-i|0)|0}E[T>>2]=b}qi(E[A>>2]|0,0,b|0)|0;c=e+20|0;i=E[c>>2]|0;if((i|0)<5){o=e+4|0;a=e+8|0;t=e+16|0;do{n=E[o>>2]|0;if((n|0)==(E[a>>2]|0))n=0;else{E[o>>2]=n+1;n=d[n>>0]|0}i=i+8|0;E[c>>2]=i;if((i|0)>=33){E[u>>2]=1138;E[u+4>>2]=3204;E[u+8>>2]=1638;mi(O,1084,u)|0;Mi(O)|0;i=E[c>>2]|0}n=n<<32-i|E[t>>2];E[t>>2]=n}while((i|0)<5)}else{n=e+16|0;t=n;n=E[n>>2]|0}l=n>>>27;E[t>>2]=n<<5;E[c>>2]=i+-5;if((l+-1|0)>>>0>20){r=0;S=v;return r|0}E[P+20>>2]=0;E[P>>2]=0;E[P+4>>2]=0;E[P+8>>2]=0;E[P+12>>2]=0;_[P+16>>0]=0;i=P+4|0;n=P+8|0;e:do if(rr(i,21,0,1,0)|0){u=E[n>>2]|0;s=E[i>>2]|0;qi(s+u|0,0,21-u|0)|0;E[n>>2]=21;if(l){t=e+4|0;o=e+8|0;a=e+16|0;u=0;do{i=E[c>>2]|0;if((i|0)<3){do{n=E[t>>2]|0;if((n|0)==(E[o>>2]|0))n=0;else{E[t>>2]=n+1;n=d[n>>0]|0}i=i+8|0;E[c>>2]=i;if((i|0)>=33){E[f>>2]=1138;E[f+4>>2]=3204;E[f+8>>2]=1638;mi(O,1084,f)|0;Mi(O)|0;i=E[c>>2]|0}n=n<<32-i|E[a>>2];E[a>>2]=n}while((i|0)<3)}else n=E[a>>2]|0;E[a>>2]=n<<3;E[c>>2]=i+-3;_[s+(d[1599+u>>0]|0)>>0]=n>>>29;u=u+1|0}while((u|0)!=(l|0))}if(fr(P)|0){l=e+4|0;u=e+8|0;s=e+16|0;n=0;r:while(1){a=b-n|0;i=Er(e,P)|0;i:do if(i>>>0<17){if((E[T>>2]|0)>>>0<=n>>>0){E[R>>2]=1138;E[R+4>>2]=906;E[R+8>>2]=1769; -mi(O,1084,R)|0;Mi(O)|0}_[(E[A>>2]|0)+n>>0]=i;i=n+1|0}else switch(i|0){case 17:{i=E[c>>2]|0;if((i|0)<3){do{t=E[l>>2]|0;if((t|0)==(E[u>>2]|0))t=0;else{E[l>>2]=t+1;t=d[t>>0]|0}i=i+8|0;E[c>>2]=i;if((i|0)>=33){E[M>>2]=1138;E[M+4>>2]=3204;E[M+8>>2]=1638;mi(O,1084,M)|0;Mi(O)|0;i=E[c>>2]|0}t=t<<32-i|E[s>>2];E[s>>2]=t}while((i|0)<3)}else t=E[s>>2]|0;E[s>>2]=t<<3;E[c>>2]=i+-3;i=(t>>>29)+3|0;if(i>>>0>a>>>0){i=0;break e}i=i+n|0;break i}case 18:{i=E[c>>2]|0;if((i|0)<7){do{t=E[l>>2]|0;if((t|0)==(E[u>>2]|0))t=0;else{E[l>>2]=t+1;t=d[t>>0]|0}i=i+8|0;E[c>>2]=i;if((i|0)>=33){E[m>>2]=1138;E[m+4>>2]=3204;E[m+8>>2]=1638;mi(O,1084,m)|0;Mi(O)|0;i=E[c>>2]|0}t=t<<32-i|E[s>>2];E[s>>2]=t}while((i|0)<7)}else t=E[s>>2]|0;E[s>>2]=t<<7;E[c>>2]=i+-7;i=(t>>>25)+11|0;if(i>>>0>a>>>0){i=0;break e}i=i+n|0;break i}default:{if((i+-19|0)>>>0>=2){I=90;break r}o=E[c>>2]|0;if((i|0)==19){if((o|0)<2){t=o;while(1){i=E[l>>2]|0;if((i|0)==(E[u>>2]|0))o=0;else{E[l>>2]=i+1;o=d[i>>0]|0}i=t+8|0;E[c>>2]=i;if((i|0)>=33){E[h>>2]=1138;E[h+4>>2]=3204;E[h+8>>2]=1638;mi(O,1084,h)|0;Mi(O)|0;i=E[c>>2]|0}t=o<<32-i|E[s>>2];E[s>>2]=t;if((i|0)<2)t=i;else break}}else{t=E[s>>2]|0;i=o}E[s>>2]=t<<2;E[c>>2]=i+-2;o=(t>>>30)+3|0}else{if((o|0)<6){t=o;while(1){i=E[l>>2]|0;if((i|0)==(E[u>>2]|0))o=0;else{E[l>>2]=i+1;o=d[i>>0]|0}i=t+8|0;E[c>>2]=i;if((i|0)>=33){E[N>>2]=1138;E[N+4>>2]=3204;E[N+8>>2]=1638;mi(O,1084,N)|0;Mi(O)|0;i=E[c>>2]|0}t=o<<32-i|E[s>>2];E[s>>2]=t;if((i|0)<6)t=i;else break}}else{t=E[s>>2]|0;i=o}E[s>>2]=t<<6;E[c>>2]=i+-6;o=(t>>>26)+7|0}if((n|0)==0|o>>>0>a>>>0){i=0;break e}i=n+-1|0;if((E[T>>2]|0)>>>0<=i>>>0){E[C>>2]=1138;E[C+4>>2]=906;E[C+8>>2]=1769;mi(O,1084,C)|0;Mi(O)|0}t=_[(E[A>>2]|0)+i>>0]|0;if(!(t<<24>>24)){i=0;break e}i=o+n|0;if(n>>>0>=i>>>0){i=n;break i}do{if((E[T>>2]|0)>>>0<=n>>>0){E[p>>2]=1138;E[p+4>>2]=906;E[p+8>>2]=1769;mi(O,1084,p)|0;Mi(O)|0}_[(E[A>>2]|0)+n>>0]=t;n=n+1|0}while((n|0)!=(i|0))}}while(0);if(b>>>0>i>>>0)n=i;else break}if((I|0)==90){E[w>>2]=1138;E[w+4>>2]=3145;E[w+8>>2]=1620;mi(O,1084,w)|0;Mi(O)|0;i=0;break}if((b|0)==(i|0))i=fr(r)|0;else i=0}else i=0}else{_[P+16>>0]=1;i=0}while(0);sr(P);r=i;S=v;return r|0}function cr(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0;l=S;S=S+528|0;a=l;o=l+16|0;if(!r){s=0;S=l;return s|0}if(r>>>0<=16){s=dr(e,r)|0;S=l;return s|0}u=dr(e,r+-16|0)|0;s=e+20|0;r=E[s>>2]|0;if((r|0)<16){n=e+4|0;t=e+8|0;i=e+16|0;do{e=E[n>>2]|0;if((e|0)==(E[t>>2]|0))e=0;else{E[n>>2]=e+1;e=d[e>>0]|0}r=r+8|0;E[s>>2]=r;if((r|0)>=33){E[a>>2]=1138;E[a+4>>2]=3204;E[a+8>>2]=1638;mi(o,1084,a)|0;Mi(o)|0;r=E[s>>2]|0}e=e<<32-r|E[i>>2];E[i>>2]=e}while((r|0)<16)}else{e=e+16|0;i=e;e=E[e>>2]|0}E[i>>2]=e<<16;E[s>>2]=r+-16;s=e>>>16|u<<16;S=l;return s|0}function Er(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,T=0,R=0,M=0;M=S;S=S+576|0;_=M+48|0;f=M+32|0;l=M+16|0;s=M;T=M+64|0;c=E[r+20>>2]|0;R=e+20|0;u=E[R>>2]|0;do if((u|0)<24){a=e+4|0;n=E[a>>2]|0;t=E[e+8>>2]|0;i=n>>>0<t>>>0;if((u|0)>=16){if(i){E[a>>2]=n+1;i=d[n>>0]|0}else i=0;E[R>>2]=u+8;a=e+16|0;o=i<<24-u|E[a>>2];E[a>>2]=o;break}if(i){o=(d[n>>0]|0)<<8;i=n+1|0}else{o=0;i=n}if(i>>>0<t>>>0){n=d[i>>0]|0;i=i+1|0}else n=0;E[a>>2]=i;E[R>>2]=u+16;a=e+16|0;o=(n|o)<<16-u|E[a>>2];E[a>>2]=o}else{o=e+16|0;a=o;o=E[o>>2]|0}while(0);t=(o>>>16)+1|0;do if(t>>>0<=(E[c+16>>2]|0)>>>0){n=E[(E[c+168>>2]|0)+(o>>>(32-(E[c+8>>2]|0)|0)<<2)>>2]|0;if((n|0)==-1){E[s>>2]=1138;E[s+4>>2]=3249;E[s+8>>2]=1665;mi(T,1084,s)|0;Mi(T)|0}i=n&65535;n=n>>>16;if((E[r+8>>2]|0)>>>0<=i>>>0){E[l>>2]=1138;E[l+4>>2]=905;E[l+8>>2]=1769;mi(T,1084,l)|0;Mi(T)|0}if((d[(E[r+4>>2]|0)+i>>0]|0|0)!=(n|0)){E[f>>2]=1138;E[f+4>>2]=3253;E[f+8>>2]=1682;mi(T,1084,f)|0;Mi(T)|0}}else{n=E[c+20>>2]|0;while(1){i=n+-1|0;if(t>>>0>(E[c+28+(i<<2)>>2]|0)>>>0)n=n+1|0;else break}i=(o>>>(32-n|0))+(E[c+96+(i<<2)>>2]|0)|0;if(i>>>0<(E[r>>2]|0)>>>0){i=A[(E[c+176>>2]|0)+(i<<1)>>1]|0;break}E[_>>2]=1138;E[_+4>>2]=3271;E[_+8>>2]=1620;mi(T,1084,_)|0;Mi(T)|0;R=0;S=M;return R|0}while(0);E[a>>2]=E[a>>2]<<n;E[R>>2]=(E[R>>2]|0)-n;R=i;S=M;return R|0}function dr(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0;l=S;S=S+544|0;u=l+16|0;i=l;a=l+32|0;if(r>>>0>=33){E[i>>2]=1138;E[i+4>>2]=3195;E[i+8>>2]=1622;mi(a,1084,i)|0;Mi(a)|0}s=e+20|0;i=E[s>>2]|0;if((i|0)>=(r|0)){t=e+16|0;o=t;t=E[t>>2]|0;a=i;u=32-r|0;u=t>>>u;t=t<<r;E[o>>2]=t;r=a-r|0;E[s>>2]=r;S=l;return u|0}t=e+4|0;o=e+8|0;n=e+16|0;do{e=E[t>>2]|0;if((e|0)==(E[o>>2]|0))e=0;else{E[t>>2]=e+1;e=d[e>>0]|0}i=i+8|0;E[s>>2]=i;if((i|0)>=33){E[u>>2]=1138;E[u+4>>2]=3204;E[u+8>>2]=1638;mi(a,1084,u)|0;Mi(a)|0;i=E[s>>2]|0}e=e<<32-i|E[n>>2];E[n>>2]=e}while((i|0)<(r|0));u=32-r|0;u=e>>>u;a=e<<r;E[n>>2]=a;r=i-r|0;E[s>>2]=r;S=l;return u|0}function Ar(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,c=0,A=0,T=0,R=0,M=0;T=S;S=S+528|0;c=T;f=T+16|0;if((e|0)==0|r>>>0<62){A=0;S=T;return A|0}l=nr(300,0)|0;if(!l){A=0;S=T;return A|0}E[l>>2]=519686845;i=l+4|0;E[i>>2]=0;n=l+8|0;E[n>>2]=0;s=l+88|0;t=l+136|0;o=l+160|0;a=s;u=a+44|0;do{E[a>>2]=0;a=a+4|0}while((a|0)<(u|0));_[s+44>>0]=0;R=l+184|0;a=l+208|0;u=l+232|0;M=l+252|0;E[M>>2]=0;E[M+4>>2]=0;E[M+8>>2]=0;_[M+12>>0]=0;M=l+268|0;E[M>>2]=0;E[M+4>>2]=0;E[M+8>>2]=0;_[M+12>>0]=0;M=l+284|0;E[M>>2]=0;E[M+4>>2]=0;E[M+8>>2]=0;_[M+12>>0]=0;E[t>>2]=0;E[t+4>>2]=0;E[t+8>>2]=0;E[t+12>>2]=0;E[t+16>>2]=0;_[t+20>>0]=0;E[o>>2]=0;E[o+4>>2]=0;E[o+8>>2]=0;E[o+12>>2]=0;E[o+16>>2]=0;_[o+20>>0]=0;E[R>>2]=0;E[R+4>>2]=0;E[R+8>>2]=0;E[R+12>>2]=0;E[R+16>>2]=0;_[R+20>>0]=0;E[a>>2]=0;E[a+4>>2]=0;E[a+8>>2]=0;E[a+12>>2]=0;E[a+16>>2]=0;_[a+20>>0]=0;E[u>>2]=0;E[u+4>>2]=0;E[u+8>>2]=0;E[u+12>>2]=0;_[u+16>>0]=0;do if(((r>>>0>=74?((d[e>>0]|0)<<8|(d[e+1>>0]|0)|0)==18552:0)?((d[e+2>>0]|0)<<8|(d[e+3>>0]|0))>>>0>=74:0)?((d[e+7>>0]|0)<<16|(d[e+6>>0]|0)<<24|(d[e+8>>0]|0)<<8|(d[e+9>>0]|0))>>>0<=r>>>0:0){E[s>>2]=e;E[i>>2]=e;E[n>>2]=r;if(wr(l)|0){i=E[s>>2]|0;if((d[i+39>>0]|0)<<8|(d[i+40>>0]|0)){if(!(br(l)|0))break;if(!(Ir(l)|0))break;i=E[s>>2]|0}if(!((d[i+55>>0]|0)<<8|(d[i+56>>0]|0))){M=l;S=T;return M|0}if(Or(l)|0?Pr(l)|0:0){M=l;S=T;return M|0}}}else A=7;while(0);if((A|0)==7)E[s>>2]=0;Fr(l);if(!(l&7)){or(l,0,0,1,0)|0;M=0;S=T;return M|0}else{E[c>>2]=1138;E[c+4>>2]=2502;E[c+8>>2]=1504;mi(f,1084,c)|0;Mi(f)|0;M=0;S=T;return M|0}return 0}function Tr(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0,u=0,s=0,l=0,f=0;f=S;S=S+528|0;l=f;s=f+16|0;o=E[e+88>>2]|0;u=(d[o+70+(t<<2)+1>>0]|0)<<16|(d[o+70+(t<<2)>>0]|0)<<24|(d[o+70+(t<<2)+2>>0]|0)<<8|(d[o+70+(t<<2)+3>>0]|0);a=t+1|0;if(a>>>0<(d[o+16>>0]|0)>>>0)o=(d[o+70+(a<<2)+1>>0]|0)<<16|(d[o+70+(a<<2)>>0]|0)<<24|(d[o+70+(a<<2)+2>>0]|0)<<8|(d[o+70+(a<<2)+3>>0]|0);else o=E[e+8>>2]|0;if(o>>>0>u>>>0){s=e+4|0;s=E[s>>2]|0;s=s+u|0;l=o-u|0;l=Rr(e,s,l,r,i,n,t)|0;S=f;return l|0}E[l>>2]=1138;E[l+4>>2]=3690;E[l+8>>2]=1780;mi(s,1084,l)|0;Mi(s)|0;s=e+4|0;s=E[s>>2]|0;s=s+u|0;l=o-u|0;l=Rr(e,s,l,r,i,n,t)|0;S=f;return l|0}function Rr(e,r,i,n,t,o,a){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;a=a|0;var u=0,s=0,l=0,f=0;f=E[e+88>>2]|0;s=((d[f+12>>0]|0)<<8|(d[f+13>>0]|0))>>>a;l=((d[f+14>>0]|0)<<8|(d[f+15>>0]|0))>>>a;s=s>>>0>1?(s+3|0)>>>2:1;l=l>>>0>1?(l+3|0)>>>2:1;f=f+18|0;a=_[f>>0]|0;a=fe(a<<24>>24==0|a<<24>>24==9?8:16,s)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((fe(a,l)|0)>>>0>t>>>0){e=0;return e|0}o=(s+1|0)>>>1;u=(l+1|0)>>>1;if(!i){e=0;return e|0}E[e+92>>2]=r;E[e+96>>2]=r;E[e+104>>2]=i;E[e+100>>2]=r+i;E[e+108>>2]=0;E[e+112>>2]=0;switch(d[f>>0]|0|0){case 0:{vr(e,n,t,a,s,l,o,u)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Lr(e,n,t,a,s,l,o,u)|0;e=1;return e|0}case 9:{Br(e,n,t,a,s,l,o,u)|0;e=1;return e|0}case 8:case 7:{kr(e,n,t,a,s,l,o,u)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function Mr(e,r){e=e|0;r=r|0;var i=0,n=0;n=S;S=S+48|0;i=n;E[i>>2]=40;ar(e,r,i)|0;S=n;return E[i+4>>2]|0}function mr(e,r){e=e|0;r=r|0;var i=0,n=0;n=S;S=S+48|0;i=n;E[i>>2]=40;ar(e,r,i)|0;S=n;return E[i+8>>2]|0}function Sr(e,r){e=e|0;r=r|0;var i=0,n=0;n=S;S=S+48|0;i=n;E[i>>2]=40;ar(e,r,i)|0;S=n;return E[i+12>>2]|0}function hr(e,r){e=e|0;r=r|0;var i=0,n=0;n=S;S=S+48|0;i=n;E[i>>2]=40;ar(e,r,i)|0;S=n;return E[i+32>>2]|0}function Nr(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0;t=S;S=S+576|0;n=t+40|0;i=t+56|0;o=t;E[o>>2]=40;ar(e,r,o)|0;r=o+32|0;e=E[r+4>>2]|0;do switch(E[r>>2]|0){case 0:{if(!e){o=8;S=t;return o|0}else e=14;break}case 1:{if(!e)e=13;else e=14;break}case 2:{if(!e)e=13;else e=14;break}case 3:{if(!e)e=13;else e=14;break}case 4:{if(!e)e=13;else e=14;break}case 5:{if(!e)e=13;else e=14;break}case 6:{if(!e)e=13;else e=14;break}case 7:{if(!e)e=13;else e=14;break}case 8:{if(!e)e=13;else e=14;break}case 9:{if(!e){o=8;S=t;return o|0}else e=14;break}case 10:{if(!e){o=8;S=t;return o|0}else e=14;break}default:e=14}while(0);if((e|0)==13){o=16;S=t;return o|0}else if((e|0)==14){E[n>>2]=1138;E[n+4>>2]=2668;E[n+8>>2]=1523;mi(i,1084,n)|0;Mi(i)|0;o=0;S=t;return o|0}return 0}function Cr(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0,u=0,s=0;u=S;S=S+576|0;o=u+40|0;t=u+56|0;s=u;E[s>>2]=40;ar(e,r,s)|0;n=(((E[s+4>>2]|0)>>>i)+3|0)>>>2;r=(((E[s+8>>2]|0)>>>i)+3|0)>>>2;i=s+32|0;e=E[i+4>>2]|0;do switch(E[i>>2]|0){case 0:{if(!e)e=8;else a=14;break}case 1:{if(!e)a=13;else a=14;break}case 2:{if(!e)a=13;else a=14;break}case 3:{if(!e)a=13;else a=14;break}case 4:{if(!e)a=13;else a=14;break}case 5:{if(!e)a=13;else a=14;break}case 6:{if(!e)a=13;else a=14;break}case 7:{if(!e)a=13;else a=14;break}case 8:{if(!e)a=13;else a=14;break}case 9:{if(!e)e=8;else a=14;break}case 10:{if(!e)e=8;else a=14;break}default:a=14}while(0);if((a|0)==13)e=16;else if((a|0)==14){E[o>>2]=1138;E[o+4>>2]=2668;E[o+8>>2]=1523;mi(t,1084,o)|0;Mi(t)|0;e=0}s=fe(fe(r,n)|0,e)|0;S=u;return s|0}function pr(e,r,i,n,t,o){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;var a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,A=0,T=0;T=S;S=S+592|0;A=T+56|0;a=T+40|0;c=T+72|0;_=T;d=T+68|0;E[_>>2]=40;ar(e,r,_)|0;u=(E[_+4>>2]|0)>>>t;s=(E[_+8>>2]|0)>>>t;_=_+32|0;n=E[_+4>>2]|0;do switch(E[_>>2]|0){case 0:{if(!n)_=8;else l=14;break}case 1:{if(!n)l=13;else l=14;break}case 2:{if(!n)l=13;else l=14;break}case 3:{if(!n)l=13;else l=14;break}case 4:{if(!n)l=13;else l=14;break}case 5:{if(!n)l=13;else l=14;break}case 6:{if(!n)l=13;else l=14;break}case 7:{if(!n)l=13;else l=14;break}case 8:{if(!n)l=13;else l=14;break}case 9:{if(!n)_=8;else l=14;break}case 10:{if(!n)_=8;else l=14;break}default:l=14}while(0);if((l|0)==13)_=16;else if((l|0)==14){E[a>>2]=1138;E[a+4>>2]=2668;E[a+8>>2]=1523;mi(c,1084,a)|0;Mi(c)|0;_=0}E[d>>2]=i;f=Ar(e,r)|0;r=o+t|0;if(r>>>0>t>>>0){l=(f|0)==0;e=i;while(1){n=fe((u+3|0)>>>2,_)|0;a=fe(n,(s+3|0)>>>2)|0;if(!(t>>>0>15|(l|a>>>0<8))?(E[f>>2]|0)==519686845:0)Tr(f,d,a,n,t)|0;e=e+a|0;E[d>>2]=e;t=t+1|0;if((t|0)==(r|0))break;else{s=s>>>1;u=u>>>1}}}if(!f){S=T;return}if((E[f>>2]|0)!=519686845){S=T;return}Fr(f);if(!(f&7)){or(f,0,0,1,0)|0;S=T;return}else{E[A>>2]=1138;E[A+4>>2]=2502;E[A+8>>2]=1504;mi(c,1084,A)|0;Mi(c)|0;S=T;return}}function wr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0;a=e+92|0;n=E[e+4>>2]|0;o=e+88|0;t=E[o>>2]|0;r=(d[t+68>>0]|0)<<8|(d[t+67>>0]|0)<<16|(d[t+69>>0]|0);i=n+r|0;t=(d[t+65>>0]|0)<<8|(d[t+66>>0]|0);if(!t){e=0;return e|0}E[a>>2]=i;E[e+96>>2]=i;E[e+104>>2]=t;E[e+100>>2]=n+(t+r);E[e+108>>2]=0;E[e+112>>2]=0;if(!(_r(a,e+116|0)|0)){e=0;return e|0}r=E[o>>2]|0;do if(!((d[r+39>>0]|0)<<8|(d[r+40>>0]|0))){if(!((d[r+55>>0]|0)<<8|(d[r+56>>0]|0))){e=0;return e|0}}else{if(!(_r(a,e+140|0)|0)){e=0;return e|0}if(_r(a,e+188|0)|0){r=E[o>>2]|0;break}else{e=0;return e|0}}while(0);if((d[r+55>>0]|0)<<8|(d[r+56>>0]|0)){if(!(_r(a,e+164|0)|0)){e=0;return e|0}if(!(_r(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function br(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,c=0,A=0,T=0;T=S;S=S+576|0;u=T;a=T+64|0;A=T+16|0;n=e+88|0;r=E[n>>2]|0;c=(d[r+39>>0]|0)<<8|(d[r+40>>0]|0);l=e+236|0;o=e+240|0;i=E[o>>2]|0;if((i|0)!=(c|0)){if(i>>>0<=c>>>0){do if((E[e+244>>2]|0)>>>0<c>>>0){if(rr(l,c,(i+1|0)==(c|0),4,0)|0){r=E[o>>2]|0;break}_[e+248>>0]=1;A=0;S=T;return A|0}else r=i;while(0);qi((E[l>>2]|0)+(r<<2)|0,0,c-r<<2|0)|0;r=E[n>>2]|0}E[o>>2]=c}s=e+92|0;i=E[e+4>>2]|0;n=(d[r+34>>0]|0)<<8|(d[r+33>>0]|0)<<16|(d[r+35>>0]|0);t=i+n|0;r=(d[r+37>>0]|0)<<8|(d[r+36>>0]|0)<<16|(d[r+38>>0]|0);if(!r){A=0;S=T;return A|0}E[s>>2]=t;E[e+96>>2]=t;E[e+104>>2]=r;E[e+100>>2]=i+(r+n);E[e+108>>2]=0;E[e+112>>2]=0;E[A+20>>2]=0;E[A>>2]=0;E[A+4>>2]=0;E[A+8>>2]=0;E[A+12>>2]=0;_[A+16>>0]=0;e=A+24|0;E[A+44>>2]=0;E[e>>2]=0;E[e+4>>2]=0;E[e+8>>2]=0;E[e+12>>2]=0;_[e+16>>0]=0;if(_r(s,A)|0?(f=A+24|0,_r(s,f)|0):0){if(!(E[o>>2]|0)){E[u>>2]=1138;E[u+4>>2]=906;E[u+8>>2]=1769;mi(a,1084,u)|0;Mi(a)|0}if(!c)r=1;else{n=0;t=0;o=0;r=0;a=0;e=0;u=0;i=E[l>>2]|0;while(1){n=(Er(s,A)|0)+n&31;t=(Er(s,f)|0)+t&63;o=(Er(s,A)|0)+o&31;r=(Er(s,A)|0)+r|0;a=(Er(s,f)|0)+a&63;e=(Er(s,A)|0)+e&31;E[i>>2]=t<<5|n<<11|o|r<<27|a<<21|e<<16;u=u+1|0;if((u|0)==(c|0)){r=1;break}else{r=r&31;i=i+4|0}}}}else r=0;sr(A+24|0);sr(A);A=r;S=T;return A|0}function Ir(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,c=0,A=0,T=0,R=0,M=0,m=0,h=0,N=0,C=0,p=0,w=0,b=0,I=0,O=0,P=0,v=0,L=0;P=S;S=S+1008|0;a=P;o=P+496|0;O=P+472|0;b=P+276|0;I=P+80|0;w=P+16|0;t=E[e+88>>2]|0;p=(d[t+47>>0]|0)<<8|(d[t+48>>0]|0);C=e+92|0;r=E[e+4>>2]|0;i=(d[t+42>>0]|0)<<8|(d[t+41>>0]|0)<<16|(d[t+43>>0]|0);n=r+i|0;t=(d[t+45>>0]|0)<<8|(d[t+44>>0]|0)<<16|(d[t+46>>0]|0);if(!t){O=0;S=P;return O|0}E[C>>2]=n;E[e+96>>2]=n;E[e+104>>2]=t;E[e+100>>2]=r+(t+i);E[e+108>>2]=0;E[e+112>>2]=0;E[O+20>>2]=0;E[O>>2]=0;E[O+4>>2]=0;E[O+8>>2]=0;E[O+12>>2]=0;_[O+16>>0]=0;if(_r(C,O)|0){i=0;n=-3;t=-3;while(1){E[b+(i<<2)>>2]=n;E[I+(i<<2)>>2]=t;r=(n|0)>2;i=i+1|0;if((i|0)==49)break;else{n=r?-3:n+1|0;t=(r&1)+t|0}}r=w;i=r+64|0;do{E[r>>2]=0;r=r+4|0}while((r|0)<(i|0));N=e+252|0;i=e+256|0;r=E[i>>2]|0;e:do if((r|0)==(p|0))u=13;else{if(r>>>0<=p>>>0){do if((E[e+260>>2]|0)>>>0<p>>>0)if(rr(N,p,(r+1|0)==(p|0),4,0)|0){r=E[i>>2]|0;break}else{_[e+264>>0]=1;r=0;break e}while(0);qi((E[N>>2]|0)+(r<<2)|0,0,p-r<<2|0)|0}E[i>>2]=p;u=13}while(0);do if((u|0)==13){if(!p){E[a>>2]=1138;E[a+4>>2]=906;E[a+8>>2]=1769;mi(o,1084,a)|0;Mi(o)|0;r=1;break}n=w+4|0;t=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;u=w+24|0;s=w+28|0;l=w+32|0;f=w+36|0;c=w+40|0;A=w+44|0;T=w+48|0;R=w+52|0;M=w+56|0;m=w+60|0;h=0;i=E[N>>2]|0;while(1){r=0;do{v=Er(C,O)|0;N=r<<1;L=w+(N<<2)|0;E[L>>2]=(E[L>>2]|0)+(E[b+(v<<2)>>2]|0)&3;N=w+((N|1)<<2)|0;E[N>>2]=(E[N>>2]|0)+(E[I+(v<<2)>>2]|0)&3;r=r+1|0}while((r|0)!=8);E[i>>2]=(d[1713+(E[n>>2]|0)>>0]|0)<<2|(d[1713+(E[w>>2]|0)>>0]|0)|(d[1713+(E[t>>2]|0)>>0]|0)<<4|(d[1713+(E[e>>2]|0)>>0]|0)<<6|(d[1713+(E[o>>2]|0)>>0]|0)<<8|(d[1713+(E[a>>2]|0)>>0]|0)<<10|(d[1713+(E[u>>2]|0)>>0]|0)<<12|(d[1713+(E[s>>2]|0)>>0]|0)<<14|(d[1713+(E[l>>2]|0)>>0]|0)<<16|(d[1713+(E[f>>2]|0)>>0]|0)<<18|(d[1713+(E[c>>2]|0)>>0]|0)<<20|(d[1713+(E[A>>2]|0)>>0]|0)<<22|(d[1713+(E[T>>2]|0)>>0]|0)<<24|(d[1713+(E[R>>2]|0)>>0]|0)<<26|(d[1713+(E[M>>2]|0)>>0]|0)<<28|(d[1713+(E[m>>2]|0)>>0]|0)<<30;h=h+1|0;if((h|0)==(p|0)){r=1;break}else i=i+4|0}}while(0)}else r=0;sr(O);L=r;S=P;return L|0}function Or(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,A=0;A=S;S=S+560|0;u=A;a=A+40|0;f=A+16|0;t=E[e+88>>2]|0;l=(d[t+55>>0]|0)<<8|(d[t+56>>0]|0);s=e+92|0;r=E[e+4>>2]|0;i=(d[t+50>>0]|0)<<8|(d[t+49>>0]|0)<<16|(d[t+51>>0]|0);n=r+i|0;t=(d[t+53>>0]|0)<<8|(d[t+52>>0]|0)<<16|(d[t+54>>0]|0);if(!t){f=0;S=A;return f|0}E[s>>2]=n;E[e+96>>2]=n;E[e+104>>2]=t;E[e+100>>2]=r+(t+i);E[e+108>>2]=0;E[e+112>>2]=0;E[f+20>>2]=0;E[f>>2]=0;E[f+4>>2]=0;E[f+8>>2]=0;E[f+12>>2]=0;_[f+16>>0]=0;e:do if(_r(s,f)|0){o=e+268|0;i=e+272|0;r=E[i>>2]|0;if((r|0)!=(l|0)){if(r>>>0<=l>>>0){do if((E[e+276>>2]|0)>>>0<l>>>0)if(rr(o,l,(r+1|0)==(l|0),2,0)|0){r=E[i>>2]|0;break}else{_[e+280>>0]=1;r=0;break e}while(0);qi((E[o>>2]|0)+(r<<1)|0,0,l-r<<1|0)|0}E[i>>2]=l}if(!l){E[u>>2]=1138;E[u+4>>2]=906;E[u+8>>2]=1769;mi(a,1084,u)|0;Mi(a)|0;r=1;break}i=0;n=0;t=0;r=E[o>>2]|0;while(1){u=Er(s,f)|0;i=u+i&255;n=(Er(s,f)|0)+n&255;c[r>>1]=n<<8|i;t=t+1|0;if((t|0)==(l|0)){r=1;break}else r=r+2|0}}else r=0;while(0);sr(f);f=r;S=A;return f|0}function Pr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,A=0,T=0,R=0,M=0,m=0,h=0,N=0,C=0,p=0,w=0,b=0,I=0,O=0,P=0,v=0,L=0,B=0;v=S;S=S+2416|0;a=v;o=v+1904|0;P=v+1880|0;I=v+980|0;O=v+80|0;b=v+16|0;t=E[e+88>>2]|0;w=(d[t+63>>0]|0)<<8|(d[t+64>>0]|0);p=e+92|0;r=E[e+4>>2]|0;i=(d[t+58>>0]|0)<<8|(d[t+57>>0]|0)<<16|(d[t+59>>0]|0);n=r+i|0;t=(d[t+61>>0]|0)<<8|(d[t+60>>0]|0)<<16|(d[t+62>>0]|0);if(!t){P=0;S=v;return P|0}E[p>>2]=n;E[e+96>>2]=n;E[e+104>>2]=t;E[e+100>>2]=r+(t+i);E[e+108>>2]=0;E[e+112>>2]=0;E[P+20>>2]=0;E[P>>2]=0;E[P+4>>2]=0;E[P+8>>2]=0;E[P+12>>2]=0;_[P+16>>0]=0;if(_r(p,P)|0){i=0;n=-7;t=-7;while(1){E[I+(i<<2)>>2]=n;E[O+(i<<2)>>2]=t;r=(n|0)>6;i=i+1|0;if((i|0)==225)break;else{n=r?-7:n+1|0;t=(r&1)+t|0}}r=b;i=r+64|0;do{E[r>>2]=0;r=r+4|0}while((r|0)<(i|0));C=e+284|0;i=w*3|0;n=e+288|0;r=E[n>>2]|0;e:do if((r|0)==(i|0))u=13;else{if(r>>>0<=i>>>0){do if((E[e+292>>2]|0)>>>0<i>>>0)if(rr(C,i,(r+1|0)==(i|0),2,0)|0){r=E[n>>2]|0;break}else{_[e+296>>0]=1;r=0;break e}while(0);qi((E[C>>2]|0)+(r<<1)|0,0,i-r<<1|0)|0}E[n>>2]=i;u=13}while(0);do if((u|0)==13){if(!w){E[a>>2]=1138;E[a+4>>2]=906;E[a+8>>2]=1769;mi(o,1084,a)|0;Mi(o)|0;r=1;break}n=b+4|0;t=b+8|0;e=b+12|0;o=b+16|0;a=b+20|0;u=b+24|0;s=b+28|0;l=b+32|0;f=b+36|0;A=b+40|0;T=b+44|0;R=b+48|0;M=b+52|0;m=b+56|0;h=b+60|0;N=0;i=E[C>>2]|0;while(1){r=0;do{L=Er(p,P)|0;C=r<<1;B=b+(C<<2)|0;E[B>>2]=(E[B>>2]|0)+(E[I+(L<<2)>>2]|0)&7;C=b+((C|1)<<2)|0;E[C>>2]=(E[C>>2]|0)+(E[O+(L<<2)>>2]|0)&7;r=r+1|0}while((r|0)!=8);L=d[1717+(E[a>>2]|0)>>0]|0;c[i>>1]=(d[1717+(E[n>>2]|0)>>0]|0)<<3|(d[1717+(E[b>>2]|0)>>0]|0)|(d[1717+(E[t>>2]|0)>>0]|0)<<6|(d[1717+(E[e>>2]|0)>>0]|0)<<9|(d[1717+(E[o>>2]|0)>>0]|0)<<12|L<<15;B=d[1717+(E[A>>2]|0)>>0]|0;c[i+2>>1]=(d[1717+(E[u>>2]|0)>>0]|0)<<2|L>>>1|(d[1717+(E[s>>2]|0)>>0]|0)<<5|(d[1717+(E[l>>2]|0)>>0]|0)<<8|(d[1717+(E[f>>2]|0)>>0]|0)<<11|B<<14;c[i+4>>1]=(d[1717+(E[T>>2]|0)>>0]|0)<<1|B>>>2|(d[1717+(E[R>>2]|0)>>0]|0)<<4|(d[1717+(E[M>>2]|0)>>0]|0)<<7|(d[1717+(E[m>>2]|0)>>0]|0)<<10|(d[1717+(E[h>>2]|0)>>0]|0)<<13;N=N+1|0;if((N|0)==(w|0)){r=1;break}else i=i+6|0}}while(0)}else r=0;sr(P);B=r;S=v;return B|0}function vr(e,r,i,n,t,o,a,u){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;a=a|0;u=u|0;var s=0,l=0,f=0,c=0,A=0,T=0,R=0,M=0,m=0,h=0,N=0,C=0,p=0,w=0,b=0,I=0,O=0,P=0,v=0,L=0,B=0,k=0,F=0,g=0,U=0,y=0,D=0,H=0,G=0,X=0,V=0,Y=0,x=0,K=0,W=0,z=0,q=0,j=0,Z=0,J=0,Q=0,$=0,ee=0,re=0,ie=0,ne=0,te=0,oe=0,ae=0,ue=0,se=0;ae=S;S=S+656|0;te=ae+112|0;ie=ae+96|0;re=ae+80|0;ee=ae+64|0;$=ae+48|0;oe=ae+32|0;ne=ae+16|0;Q=ae;Z=ae+144|0;J=ae+128|0;Y=e+240|0;x=E[Y>>2]|0;z=e+256|0;q=E[z>>2]|0;i=_[(E[e+88>>2]|0)+17>>0]|0;j=n>>>2;if(!(i<<24>>24)){S=ae;return 1}K=(u|0)==0;W=u+-1|0;U=(o&1|0)!=0;y=n<<1;D=e+92|0;H=e+116|0;G=e+140|0;X=e+236|0;V=a+-1|0;g=(t&1|0)!=0;F=e+188|0;P=e+252|0;v=j+1|0;L=j+2|0;B=j+3|0;k=V<<4;I=i&255;i=0;o=0;t=1;O=0;do{if(!K){w=E[r+(O<<2)>>2]|0;b=0;while(1){N=b&1;s=(N|0)==0;h=(N<<5^32)+-16|0;N=(N<<1^2)+-1|0;p=s?a:-1;l=s?0:V;e=(b|0)==(W|0);C=U&e;if((l|0)!=(p|0)){m=U&e^1;M=s?w:w+k|0;while(1){if((t|0)==1)t=Er(D,H)|0|512;R=t&7;t=t>>>3;s=d[1811+R>>0]|0;e=0;do{A=(Er(D,G)|0)+o|0;T=A-x|0;o=T>>31;o=o&A|T&~o;if((E[Y>>2]|0)>>>0<=o>>>0){E[Q>>2]=1138;E[Q+4>>2]=906;E[Q+8>>2]=1769;mi(Z,1084,Q)|0;Mi(Z)|0}E[J+(e<<2)>>2]=E[(E[X>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0<s>>>0);T=g&(l|0)==(V|0);if(C|T){A=0;do{f=fe(A,n)|0;e=M+f|0;s=(A|0)==0|m;c=A<<1;se=(Er(D,F)|0)+i|0;ue=se-q|0;i=ue>>31;i=i&se|ue&~i;do if(T){if(!s){ue=(Er(D,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;break}E[e>>2]=E[J+((d[1819+(R<<2)+c>>0]|0)<<2)>>2];if((E[z>>2]|0)>>>0<=i>>>0){E[ie>>2]=1138;E[ie+4>>2]=906;E[ie+8>>2]=1769;mi(Z,1084,ie)|0;Mi(Z)|0}E[M+(f+4)>>2]=E[(E[P>>2]|0)+(i<<2)>>2];ue=(Er(D,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i}else{if(!s){ue=(Er(D,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;break}E[e>>2]=E[J+((d[1819+(R<<2)+c>>0]|0)<<2)>>2];if((E[z>>2]|0)>>>0<=i>>>0){E[re>>2]=1138;E[re+4>>2]=906;E[re+8>>2]=1769;mi(Z,1084,re)|0;Mi(Z)|0}E[M+(f+4)>>2]=E[(E[P>>2]|0)+(i<<2)>>2];ue=(Er(D,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;E[M+(f+8)>>2]=E[J+((d[(c|1)+(1819+(R<<2))>>0]|0)<<2)>>2];if((E[z>>2]|0)>>>0<=i>>>0){E[te>>2]=1138;E[te+4>>2]=906;E[te+8>>2]=1769;mi(Z,1084,te)|0;Mi(Z)|0}E[M+(f+12)>>2]=E[(E[P>>2]|0)+(i<<2)>>2]}while(0);A=A+1|0}while((A|0)!=2)}else{E[M>>2]=E[J+((d[1819+(R<<2)>>0]|0)<<2)>>2];ue=(Er(D,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;if((E[z>>2]|0)>>>0<=i>>>0){E[ne>>2]=1138;E[ne+4>>2]=906;E[ne+8>>2]=1769;mi(Z,1084,ne)|0;Mi(Z)|0}E[M+4>>2]=E[(E[P>>2]|0)+(i<<2)>>2];E[M+8>>2]=E[J+((d[1819+(R<<2)+1>>0]|0)<<2)>>2];ue=(Er(D,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;if((E[z>>2]|0)>>>0<=i>>>0){E[oe>>2]=1138;E[oe+4>>2]=906;E[oe+8>>2]=1769;mi(Z,1084,oe)|0;Mi(Z)|0}E[M+12>>2]=E[(E[P>>2]|0)+(i<<2)>>2];E[M+(j<<2)>>2]=E[J+((d[1819+(R<<2)+2>>0]|0)<<2)>>2];ue=(Er(D,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;if((E[z>>2]|0)>>>0<=i>>>0){E[$>>2]=1138;E[$+4>>2]=906;E[$+8>>2]=1769;mi(Z,1084,$)|0;Mi(Z)|0}E[M+(v<<2)>>2]=E[(E[P>>2]|0)+(i<<2)>>2];E[M+(L<<2)>>2]=E[J+((d[1819+(R<<2)+3>>0]|0)<<2)>>2];ue=(Er(D,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;if((E[z>>2]|0)>>>0<=i>>>0){E[ee>>2]=1138;E[ee+4>>2]=906;E[ee+8>>2]=1769;mi(Z,1084,ee)|0;Mi(Z)|0}E[M+(B<<2)>>2]=E[(E[P>>2]|0)+(i<<2)>>2]}l=l+N|0;if((l|0)==(p|0))break;else M=M+h|0}}b=b+1|0;if((b|0)==(u|0))break;else w=w+y|0}}O=O+1|0}while((O|0)!=(I|0));S=ae;return 1}function Lr(e,r,i,n,t,o,a,u){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;a=a|0;u=u|0;var s=0,l=0,f=0,c=0,T=0,R=0,M=0,m=0,h=0,N=0,C=0,p=0,w=0,b=0,I=0,O=0,P=0,v=0,L=0,B=0,k=0,F=0,g=0,U=0,y=0,D=0,H=0,G=0,X=0,V=0,Y=0,x=0,K=0,W=0,z=0,q=0,j=0,Z=0,J=0,Q=0,$=0,ee=0,re=0,ie=0,ne=0,te=0,oe=0,ae=0,ue=0,se=0,le=0,fe=0,_e=0,ce=0,Ee=0;ce=S;S=S+608|0;le=ce+48|0;_e=ce+32|0;fe=ce+16|0;se=ce;ae=ce+96|0;ue=ce+80|0;oe=ce+64|0;x=e+240|0;K=E[x>>2]|0;q=e+256|0;ie=E[q>>2]|0;ne=e+272|0;te=E[ne>>2]|0;i=E[e+88>>2]|0;W=(d[i+63>>0]|0)<<8|(d[i+64>>0]|0);i=_[i+17>>0]|0;if(!(i<<24>>24)){S=ce;return 1}z=(u|0)==0;j=u+-1|0;Z=n<<1;J=e+92|0;Q=e+116|0;$=a+-1|0;ee=e+212|0;re=e+188|0;Y=(t&1|0)==0;V=(o&1|0)==0;U=e+288|0;y=e+284|0;D=e+252|0;H=e+140|0;G=e+236|0;X=e+164|0;F=e+268|0;g=$<<5;B=i&255;i=0;t=0;o=0;e=0;s=1;k=0;do{if(!z){v=E[r+(k<<2)>>2]|0;L=0;while(1){O=L&1;l=(O|0)==0;I=(O<<6^64)+-32|0;O=(O<<1^2)+-1|0;P=l?a:-1;f=l?0:$;if((f|0)!=(P|0)){b=V|(L|0)!=(j|0);w=l?v:v+g|0;while(1){if((s|0)==1)s=Er(J,Q)|0|512;p=s&7;s=s>>>3;c=d[1811+p>>0]|0;l=0;do{N=(Er(J,X)|0)+t|0;C=N-te|0;t=C>>31;t=t&N|C&~t;if((E[ne>>2]|0)>>>0<=t>>>0){E[se>>2]=1138;E[se+4>>2]=906;E[se+8>>2]=1769;mi(ae,1084,se)|0;Mi(ae)|0}E[oe+(l<<2)>>2]=A[(E[F>>2]|0)+(t<<1)>>1];l=l+1|0}while(l>>>0<c>>>0);l=0;do{N=(Er(J,H)|0)+e|0;C=N-K|0;e=C>>31;e=e&N|C&~e;if((E[x>>2]|0)>>>0<=e>>>0){E[fe>>2]=1138;E[fe+4>>2]=906;E[fe+8>>2]=1769;mi(ae,1084,fe)|0;Mi(ae)|0}E[ue+(l<<2)>>2]=E[(E[G>>2]|0)+(e<<2)>>2];l=l+1|0}while(l>>>0<c>>>0);C=Y|(f|0)!=($|0);h=0;N=w;while(1){m=b|(h|0)==0;M=h<<1;T=0;R=N;while(1){c=(Er(J,ee)|0)+i|0;l=c-W|0;i=l>>31;i=i&c|l&~i;l=(Er(J,re)|0)+o|0;c=l-ie|0;o=c>>31;o=o&l|c&~o;if((C|(T|0)==0)&m){l=d[T+M+(1819+(p<<2))>>0]|0;c=i*3|0;if((E[U>>2]|0)>>>0<=c>>>0){E[_e>>2]=1138;E[_e+4>>2]=906;E[_e+8>>2]=1769;mi(ae,1084,_e)|0;Mi(ae)|0}Ee=E[y>>2]|0;E[R>>2]=(A[Ee+(c<<1)>>1]|0)<<16|E[oe+(l<<2)>>2];E[R+4>>2]=(A[Ee+(c+2<<1)>>1]|0)<<16|(A[Ee+(c+1<<1)>>1]|0);E[R+8>>2]=E[ue+(l<<2)>>2];if((E[q>>2]|0)>>>0<=o>>>0){E[le>>2]=1138;E[le+4>>2]=906;E[le+8>>2]=1769;mi(ae,1084,le)|0;Mi(ae)|0}E[R+12>>2]=E[(E[D>>2]|0)+(o<<2)>>2]}T=T+1|0;if((T|0)==2)break;else R=R+16|0}h=h+1|0;if((h|0)==2)break;else N=N+n|0}f=f+O|0;if((f|0)==(P|0))break;else w=w+I|0}}L=L+1|0;if((L|0)==(u|0))break;else v=v+Z|0}}k=k+1|0}while((k|0)!=(B|0));S=ce;return 1}function Br(e,r,i,n,t,o,a,u){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;a=a|0;u=u|0;var s=0,l=0,f=0,c=0,T=0,R=0,M=0,m=0,h=0,N=0,C=0,p=0,w=0,b=0,I=0,O=0,P=0,v=0,L=0,B=0,k=0,F=0,g=0,U=0,y=0,D=0,H=0,G=0,X=0,V=0,Y=0,x=0,K=0,W=0,z=0,q=0,j=0,Z=0,J=0,Q=0,$=0;$=S;S=S+576|0;Q=$+32|0;J=$+16|0;Z=$;j=$+64|0;q=$+48|0;D=e+272|0;H=E[D>>2]|0;i=E[e+88>>2]|0;G=(d[i+63>>0]|0)<<8|(d[i+64>>0]|0);i=_[i+17>>0]|0;if(!(i<<24>>24)){S=$;return 1}X=(u|0)==0;V=u+-1|0;Y=n<<1;x=e+92|0;K=e+116|0;W=a+-1|0;z=e+212|0;y=(o&1|0)==0;F=e+288|0;g=e+284|0;U=e+164|0;B=e+268|0;k=W<<4;L=i&255;v=(t&1|0)!=0;i=0;o=0;e=1;P=0;do{if(!X){I=E[r+(P<<2)>>2]|0;O=0;while(1){w=O&1;t=(w|0)==0;p=(w<<5^32)+-16|0;w=(w<<1^2)+-1|0;b=t?a:-1;s=t?0:W;if((s|0)!=(b|0)){C=y|(O|0)!=(V|0);N=t?I:I+k|0;while(1){if((e|0)==1)e=Er(x,K)|0|512;h=e&7;e=e>>>3;l=d[1811+h>>0]|0;t=0;do{M=(Er(x,U)|0)+o|0;m=M-H|0;o=m>>31;o=o&M|m&~o;if((E[D>>2]|0)>>>0<=o>>>0){E[Z>>2]=1138;E[Z+4>>2]=906;E[Z+8>>2]=1769;mi(j,1084,Z)|0;Mi(j)|0}E[q+(t<<2)>>2]=A[(E[B>>2]|0)+(o<<1)>>1];t=t+1|0}while(t>>>0<l>>>0);m=(s|0)==(W|0)&v;R=0;M=N;while(1){T=C|(R|0)==0;c=R<<1;t=(Er(x,z)|0)+i|0;f=t-G|0;l=f>>31;l=l&t|f&~l;if(T){i=d[1819+(h<<2)+c>>0]|0;t=l*3|0;if((E[F>>2]|0)>>>0<=t>>>0){E[J>>2]=1138;E[J+4>>2]=906;E[J+8>>2]=1769;mi(j,1084,J)|0;Mi(j)|0}f=E[g>>2]|0;E[M>>2]=(A[f+(t<<1)>>1]|0)<<16|E[q+(i<<2)>>2];E[M+4>>2]=(A[f+(t+2<<1)>>1]|0)<<16|(A[f+(t+1<<1)>>1]|0)}f=M+8|0;t=(Er(x,z)|0)+l|0;l=t-G|0;i=l>>31;i=i&t|l&~i;if(!(m|T^1)){t=d[(c|1)+(1819+(h<<2))>>0]|0;l=i*3|0;if((E[F>>2]|0)>>>0<=l>>>0){E[Q>>2]=1138;E[Q+4>>2]=906;E[Q+8>>2]=1769;mi(j,1084,Q)|0;Mi(j)|0}T=E[g>>2]|0;E[f>>2]=(A[T+(l<<1)>>1]|0)<<16|E[q+(t<<2)>>2];E[M+12>>2]=(A[T+(l+2<<1)>>1]|0)<<16|(A[T+(l+1<<1)>>1]|0)}R=R+1|0;if((R|0)==2)break;else M=M+n|0}s=s+w|0;if((s|0)==(b|0))break;else N=N+p|0}}O=O+1|0;if((O|0)==(u|0))break;else I=I+Y|0}}P=P+1|0}while((P|0)!=(L|0));S=$;return 1}function kr(e,r,i,n,t,o,a,u){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;a=a|0;u=u|0;var s=0,l=0,f=0,c=0,T=0,R=0,M=0,m=0,h=0,N=0,C=0,p=0,w=0,b=0,I=0,O=0,P=0,v=0,L=0,B=0,k=0,F=0,g=0,U=0,y=0,D=0,H=0,G=0,X=0,V=0,Y=0,x=0,K=0,W=0,z=0,q=0,j=0,Z=0,J=0,Q=0,$=0,ee=0,re=0,ie=0,ne=0,te=0,oe=0,ae=0,ue=0;ue=S;S=S+608|0;te=ue+48|0;ae=ue+32|0;oe=ue+16|0;ne=ue;ie=ue+96|0;ee=ue+80|0;re=ue+64|0;x=e+272|0;K=E[x>>2]|0;i=E[e+88>>2]|0;W=(d[i+63>>0]|0)<<8|(d[i+64>>0]|0);i=_[i+17>>0]|0;if(!(i<<24>>24)){S=ue;return 1}z=(u|0)==0;q=u+-1|0;j=n<<1;Z=e+92|0;J=e+116|0;Q=a+-1|0;$=e+212|0;Y=(t&1|0)==0;V=(o&1|0)==0;H=e+288|0;G=e+284|0;X=e+164|0;y=e+268|0;D=Q<<5;g=i&255;i=0;t=0;o=0;e=0;s=1;U=0;do{if(!z){k=E[r+(U<<2)>>2]|0;F=0;while(1){L=F&1;l=(L|0)==0;v=(L<<6^64)+-32|0;L=(L<<1^2)+-1|0;B=l?a:-1;f=l?0:Q;if((f|0)!=(B|0)){P=V|(F|0)!=(q|0);O=l?k:k+D|0;while(1){if((s|0)==1)s=Er(Z,J)|0|512;I=s&7;s=s>>>3;c=d[1811+I>>0]|0;l=0;do{w=(Er(Z,X)|0)+e|0;b=w-K|0;e=b>>31;e=e&w|b&~e;if((E[x>>2]|0)>>>0<=e>>>0){E[ne>>2]=1138;E[ne+4>>2]=906;E[ne+8>>2]=1769;mi(ie,1084,ne)|0;Mi(ie)|0}E[ee+(l<<2)>>2]=A[(E[y>>2]|0)+(e<<1)>>1];l=l+1|0}while(l>>>0<c>>>0);l=0;do{w=(Er(Z,X)|0)+t|0;b=w-K|0;t=b>>31;t=t&w|b&~t;if((E[x>>2]|0)>>>0<=t>>>0){E[oe>>2]=1138;E[oe+4>>2]=906;E[oe+8>>2]=1769;mi(ie,1084,oe)|0;Mi(ie)|0}E[re+(l<<2)>>2]=A[(E[y>>2]|0)+(t<<1)>>1];l=l+1|0}while(l>>>0<c>>>0);b=Y|(f|0)!=(Q|0);p=0;w=O;while(1){C=P|(p|0)==0;N=p<<1;m=0;h=w;while(1){M=(Er(Z,$)|0)+o|0;R=M-W|0;o=R>>31;o=o&M|R&~o;R=(Er(Z,$)|0)+i|0;M=R-W|0;i=M>>31;i=i&R|M&~i;if((b|(m|0)==0)&C){R=d[m+N+(1819+(I<<2))>>0]|0;M=o*3|0;l=E[H>>2]|0;if(l>>>0<=M>>>0){E[ae>>2]=1138;E[ae+4>>2]=906;E[ae+8>>2]=1769;mi(ie,1084,ae)|0;Mi(ie)|0;l=E[H>>2]|0}c=E[G>>2]|0;T=i*3|0;if(l>>>0>T>>>0)l=c;else{E[te>>2]=1138;E[te+4>>2]=906;E[te+8>>2]=1769;mi(ie,1084,te)|0;Mi(ie)|0;l=E[G>>2]|0}E[h>>2]=(A[c+(M<<1)>>1]|0)<<16|E[ee+(R<<2)>>2];E[h+4>>2]=(A[c+(M+2<<1)>>1]|0)<<16|(A[c+(M+1<<1)>>1]|0);E[h+8>>2]=(A[l+(T<<1)>>1]|0)<<16|E[re+(R<<2)>>2];E[h+12>>2]=(A[l+(T+2<<1)>>1]|0)<<16|(A[l+(T+1<<1)>>1]|0)}m=m+1|0;if((m|0)==2)break;else h=h+16|0}p=p+1|0;if((p|0)==2)break;else w=w+n|0}f=f+L|0;if((f|0)==(B|0))break;else O=O+v|0}}F=F+1|0;if((F|0)==(u|0))break;else k=k+j|0}}U=U+1|0}while((U|0)!=(g|0));S=ue;return 1}function Fr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0;s=S;S=S+576|0;u=s+48|0;o=s+32|0;t=s+16|0;n=s;a=s+64|0;E[e>>2]=0;r=e+284|0;i=E[r>>2]|0;if(i){if(!(i&7))or(i,0,0,1,0)|0;else{E[n>>2]=1138;E[n+4>>2]=2502;E[n+8>>2]=1504;mi(a,1084,n)|0;Mi(a)|0}E[r>>2]=0;E[e+288>>2]=0;E[e+292>>2]=0}_[e+296>>0]=0;i=e+268|0;r=E[i>>2]|0;if(r){if(!(r&7))or(r,0,0,1,0)|0;else{E[t>>2]=1138;E[t+4>>2]=2502;E[t+8>>2]=1504;mi(a,1084,t)|0;Mi(a)|0}E[i>>2]=0;E[e+272>>2]=0;E[e+276>>2]=0}_[e+280>>0]=0;r=e+252|0;i=E[r>>2]|0;if(i){if(!(i&7))or(i,0,0,1,0)|0;else{E[o>>2]=1138;E[o+4>>2]=2502;E[o+8>>2]=1504;mi(a,1084,o)|0;Mi(a)|0}E[r>>2]=0;E[e+256>>2]=0;E[e+260>>2]=0}_[e+264>>0]=0;r=e+236|0;i=E[r>>2]|0;if(!i){u=e+248|0;_[u>>0]=0;u=e+212|0;sr(u);u=e+188|0;sr(u);u=e+164|0;sr(u);u=e+140|0;sr(u);u=e+116|0;sr(u);S=s;return}if(!(i&7))or(i,0,0,1,0)|0;else{E[u>>2]=1138;E[u+4>>2]=2502;E[u+8>>2]=1504;mi(a,1084,u)|0;Mi(a)|0}E[r>>2]=0;E[e+240>>2]=0;E[e+244>>2]=0;u=e+248|0;_[u>>0]=0;u=e+212|0;sr(u);u=e+188|0;sr(u);u=e+164|0;sr(u);u=e+140|0;sr(u);u=e+116|0;sr(u);S=s;return}function gr(e,r){e=e|0;r=r|0;var i=0;i=S;S=S+16|0;E[i>>2]=r;r=E[60]|0;Si(r,e,i)|0;di(10,r)|0;Pe()}function Ur(){var e=0,r=0;e=S;S=S+16|0;if(!(He(192,2)|0)){r=pe(E[47]|0)|0;S=e;return r|0}else gr(2078,e);return 0}function yr(e){e=e|0;Gi(e);return}function Dr(e){e=e|0;var r=0;r=S;S=S+16|0;Pn[e&3]();gr(2127,r)}function Hr(){var e=0,r=0;e=Ur()|0;if(((e|0)!=0?(r=E[e>>2]|0,(r|0)!=0):0)?(e=r+48|0,(E[e>>2]&-256|0)==1126902528?(E[e+4>>2]|0)==1129074247:0):0)Dr(E[r+12>>2]|0);r=E[26]|0;E[26]=r+0;Dr(r)}function Gr(e){e=e|0;return}function Xr(e){e=e|0;return}function Vr(e){e=e|0;return}function Yr(e){e=e|0;return}function xr(e){e=e|0;yr(e);return}function Kr(e){e=e|0;yr(e);return}function Wr(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0;a=S;S=S+64|0;o=a;if((e|0)!=(r|0))if((r|0)!=0?(t=Zr(r,24,40,0)|0,(t|0)!=0):0){r=o;n=r+56|0;do{E[r>>2]=0;r=r+4|0}while((r|0)<(n|0));E[o>>2]=t;E[o+8>>2]=e;E[o+12>>2]=-1;E[o+48>>2]=1;Ln[E[(E[t>>2]|0)+28>>2]&3](t,o,E[i>>2]|0,1);if((E[o+24>>2]|0)==1){E[i>>2]=E[o+16>>2];r=1}else r=0}else r=0;else r=1;S=a;return r|0}function zr(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0;e=r+16|0;t=E[e>>2]|0;do if(t){if((t|0)!=(i|0)){n=r+36|0;E[n>>2]=(E[n>>2]|0)+1;E[r+24>>2]=2;_[r+54>>0]=1;break}e=r+24|0;if((E[e>>2]|0)==2)E[e>>2]=n}else{E[e>>2]=i;E[r+24>>2]=n;E[r+36>>2]=1}while(0);return}function qr(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;if((e|0)==(E[r+8>>2]|0))zr(0,r,i,n);return}function jr(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;if((e|0)==(E[r+8>>2]|0))zr(0,r,i,n);else{e=E[e+8>>2]|0;Ln[E[(E[e>>2]|0)+28>>2]&3](e,r,i,n)}return}function Zr(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0,u=0,s=0,l=0,f=0,d=0,A=0,T=0;T=S;S=S+64|0;A=T;d=E[e>>2]|0;f=e+(E[d+-8>>2]|0)|0;d=E[d+-4>>2]|0;E[A>>2]=i;E[A+4>>2]=e;E[A+8>>2]=r;E[A+12>>2]=n;n=A+16|0;e=A+20|0;r=A+24|0;t=A+28|0;o=A+32|0;a=A+40|0;u=(d|0)==(i|0);s=n;l=s+36|0;do{E[s>>2]=0;s=s+4|0}while((s|0)<(l|0));c[n+36>>1]=0;_[n+38>>0]=0;e:do if(u){E[A+48>>2]=1;vn[E[(E[i>>2]|0)+20>>2]&3](i,A,f,f,1,0);n=(E[r>>2]|0)==1?f:0}else{wn[E[(E[d>>2]|0)+24>>2]&3](d,A,f,1,0);switch(E[A+36>>2]|0){case 0:{n=(E[a>>2]|0)==1&(E[t>>2]|0)==1&(E[o>>2]|0)==1?E[e>>2]|0:0;break e}case 1:break;default:{n=0;break e}}if((E[r>>2]|0)!=1?!((E[a>>2]|0)==0&(E[t>>2]|0)==1&(E[o>>2]|0)==1):0){n=0;break}n=E[n>>2]|0}while(0);S=T;return n|0}function Jr(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;_[r+53>>0]=1;do if((E[r+4>>2]|0)==(n|0)){_[r+52>>0]=1;n=r+16|0;e=E[n>>2]|0;if(!e){E[n>>2]=i;E[r+24>>2]=t;E[r+36>>2]=1;if(!((t|0)==1?(E[r+48>>2]|0)==1:0))break;_[r+54>>0]=1;break}if((e|0)!=(i|0)){t=r+36|0;E[t>>2]=(E[t>>2]|0)+1;_[r+54>>0]=1;break}e=r+24|0;n=E[e>>2]|0;if((n|0)==2){E[e>>2]=t;n=t}if((n|0)==1?(E[r+48>>2]|0)==1:0)_[r+54>>0]=1}while(0);return}function Qr(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0,u=0,s=0;e:do if((e|0)==(E[r+8>>2]|0)){if((E[r+4>>2]|0)==(i|0)?(o=r+28|0,(E[o>>2]|0)!=1):0)E[o>>2]=n}else{if((e|0)!=(E[r>>2]|0)){u=E[e+8>>2]|0;wn[E[(E[u>>2]|0)+24>>2]&3](u,r,i,n,t);break}if((E[r+16>>2]|0)!=(i|0)?(a=r+20|0,(E[a>>2]|0)!=(i|0)):0){E[r+32>>2]=n;n=r+44|0;if((E[n>>2]|0)==4)break;o=r+52|0;_[o>>0]=0;s=r+53|0;_[s>>0]=0;e=E[e+8>>2]|0;vn[E[(E[e>>2]|0)+20>>2]&3](e,r,i,i,1,t);if(_[s>>0]|0){if(!(_[o>>0]|0)){o=1;u=13}}else{o=0;u=13}do if((u|0)==13){E[a>>2]=i;s=r+40|0;E[s>>2]=(E[s>>2]|0)+1;if((E[r+36>>2]|0)==1?(E[r+24>>2]|0)==2:0){_[r+54>>0]=1;if(o)break}else u=16;if((u|0)==16?o:0)break;E[n>>2]=4;break e}while(0);E[n>>2]=3;break}if((n|0)==1)E[r+32>>2]=1}while(0);return}function $r(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0;do if((e|0)==(E[r+8>>2]|0)){if((E[r+4>>2]|0)==(i|0)?(a=r+28|0,(E[a>>2]|0)!=1):0)E[a>>2]=n}else if((e|0)==(E[r>>2]|0)){if((E[r+16>>2]|0)!=(i|0)?(o=r+20|0,(E[o>>2]|0)!=(i|0)):0){E[r+32>>2]=n;E[o>>2]=i;t=r+40|0;E[t>>2]=(E[t>>2]|0)+1;if((E[r+36>>2]|0)==1?(E[r+24>>2]|0)==2:0)_[r+54>>0]=1;E[r+44>>2]=4;break; -}if((n|0)==1)E[r+32>>2]=1}while(0);return}function ei(e,r,i,n,t,o){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;if((e|0)==(E[r+8>>2]|0))Jr(0,r,i,n,t);else{e=E[e+8>>2]|0;vn[E[(E[e>>2]|0)+20>>2]&3](e,r,i,n,t,o)}return}function ri(e,r,i,n,t,o){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;if((e|0)==(E[r+8>>2]|0))Jr(0,r,i,n,t);return}function ii(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0;t=S;S=S+16|0;n=t;E[n>>2]=E[i>>2];e=pn[E[(E[e>>2]|0)+16>>2]&7](e,r,n)|0;if(e)E[i>>2]=E[n>>2];S=t;return e&1|0}function ni(e){e=e|0;if(!e)e=0;else e=(Zr(e,24,72,0)|0)!=0;return e&1|0}function ti(){var e=0,r=0,i=0,n=0,t=0,o=0,a=0,u=0;t=S;S=S+48|0;a=t+32|0;i=t+24|0;u=t+16|0;o=t;t=t+36|0;e=Ur()|0;if((e|0)!=0?(n=E[e>>2]|0,(n|0)!=0):0){e=n+48|0;r=E[e>>2]|0;e=E[e+4>>2]|0;if(!((r&-256|0)==1126902528&(e|0)==1129074247)){E[i>>2]=2406;gr(2356,i)}if((r|0)==1126902529&(e|0)==1129074247)e=E[n+44>>2]|0;else e=n+80|0;E[t>>2]=e;n=E[n>>2]|0;e=E[n+4>>2]|0;if(pn[E[(E[8>>2]|0)+16>>2]&7](8,n,t)|0){u=E[t>>2]|0;u=In[E[(E[u>>2]|0)+8>>2]&1](u)|0;E[o>>2]=2406;E[o+4>>2]=e;E[o+8>>2]=u;gr(2270,o)}else{E[u>>2]=2406;E[u+4>>2]=e;gr(2315,u)}}gr(2394,a)}function oi(){var e=0;e=S;S=S+16|0;if(!(Fe(188,6)|0)){S=e;return}else gr(2167,e)}function ai(e){e=e|0;var r=0;r=S;S=S+16|0;Gi(e);if(!(we(E[47]|0,0)|0)){S=r;return}else gr(2217,r)}function ui(e){e=e|0;var r=0,i=0;r=0;while(1){if((d[2415+r>>0]|0)==(e|0)){i=2;break}r=r+1|0;if((r|0)==87){r=87;e=2503;i=5;break}}if((i|0)==2)if(!r)e=2503;else{e=2503;i=5}if((i|0)==5)while(1){i=e;while(1){e=i+1|0;if(!(_[i>>0]|0))break;else i=e}r=r+-1|0;if(!r)break;else i=5}return e|0}function si(){var e=0;if(!0)e=248;else{e=(Oe()|0)+60|0;e=E[e>>2]|0}return e|0}function li(e){e=e|0;var r=0;if(e>>>0>4294963200){r=si()|0;E[r>>2]=0-e;e=-1}return e|0}function fi(e,r){e=+e;r=r|0;var i=0,n=0,t=0;M[N>>3]=e;i=E[N>>2]|0;n=E[N+4>>2]|0;t=ji(i|0,n|0,52)|0;t=t&2047;switch(t|0){case 0:{if(e!=0){e=+fi(e*0x10000000000000000,r);i=(E[r>>2]|0)+-64|0}else i=0;E[r>>2]=i;break}case 2047:break;default:{E[r>>2]=t+-1022;E[N>>2]=i;E[N+4>>2]=n&-2146435073|1071644672;e=+M[N>>3]}}return+e}function _i(e,r){e=+e;r=r|0;return+ +fi(e,r)}function ci(e,r,i){e=e|0;r=r|0;i=i|0;do if(e){if(r>>>0<128){_[e>>0]=r;e=1;break}if(r>>>0<2048){_[e>>0]=r>>>6|192;_[e+1>>0]=r&63|128;e=2;break}if(r>>>0<55296|(r&-8192|0)==57344){_[e>>0]=r>>>12|224;_[e+1>>0]=r>>>6&63|128;_[e+2>>0]=r&63|128;e=3;break}if((r+-65536|0)>>>0<1048576){_[e>>0]=r>>>18|240;_[e+1>>0]=r>>>12&63|128;_[e+2>>0]=r>>>6&63|128;_[e+3>>0]=r&63|128;e=4;break}else{e=si()|0;E[e>>2]=84;e=-1;break}}else e=1;while(0);return e|0}function Ei(e,r){e=e|0;r=r|0;if(!e)e=0;else e=ci(e,r,0)|0;return e|0}function di(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0;if((E[r+76>>2]|0)>=0?(Ci(r)|0)!=0:0){if((_[r+75>>0]|0)!=(e|0)?(n=r+20|0,t=E[n>>2]|0,t>>>0<(E[r+16>>2]|0)>>>0):0){E[n>>2]=t+1;_[t>>0]=e;i=e&255}else i=wi(r,e)|0;pi(r)}else a=3;do if((a|0)==3){if((_[r+75>>0]|0)!=(e|0)?(o=r+20|0,i=E[o>>2]|0,i>>>0<(E[r+16>>2]|0)>>>0):0){E[o>>2]=i+1;_[i>>0]=e;i=e&255;break}i=wi(r,e)|0}while(0);return i|0}function Ai(e,r){e=e|0;r=r|0;return(Ri(e,Bi(e)|0,1,r)|0)+-1|0}function Ti(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0;n=i+16|0;t=E[n>>2]|0;if(!t)if(!(vi(i)|0)){t=E[n>>2]|0;o=4}else n=0;else o=4;e:do if((o|0)==4){a=i+20|0;o=E[a>>2]|0;if((t-o|0)>>>0<r>>>0){n=pn[E[i+36>>2]&7](i,e,r)|0;break}r:do if((_[i+75>>0]|0)>-1){n=r;while(1){if(!n){t=o;n=0;break r}t=n+-1|0;if((_[e+t>>0]|0)==10)break;else n=t}if((pn[E[i+36>>2]&7](i,e,n)|0)>>>0<n>>>0)break e;r=r-n|0;e=e+n|0;t=E[a>>2]|0}else{t=o;n=0}while(0);Ji(t|0,e|0,r|0)|0;E[a>>2]=(E[a>>2]|0)+r;n=n+r|0}while(0);return n|0}function Ri(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0;t=fe(i,r)|0;if((E[n+76>>2]|0)>-1){o=(Ci(n)|0)==0;e=Ti(e,t,n)|0;if(!o)pi(n)}else e=Ti(e,t,n)|0;if((e|0)!=(t|0))i=(e>>>0)/(r>>>0)|0;return i|0}function Mi(e){e=e|0;var r=0,i=0,n=0,t=0;n=E[61]|0;if((E[n+76>>2]|0)>-1)t=Ci(n)|0;else t=0;do if((Ai(e,n)|0)<0)r=1;else{if((_[n+75>>0]|0)!=10?(r=n+20|0,i=E[r>>2]|0,i>>>0<(E[n+16>>2]|0)>>>0):0){E[r>>2]=i+1;_[i>>0]=10;r=0;break}r=(wi(n,10)|0)<0}while(0);if(t)pi(n);return r<<31>>31|0}function mi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0;n=S;S=S+16|0;t=n;E[t>>2]=i;i=Ni(e,r,t)|0;S=n;return i|0}function Si(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,c=0,d=0,A=0,T=0,R=0;R=S;S=S+224|0;c=R+120|0;T=R+80|0;A=R;d=R+136|0;n=T;t=n+40|0;do{E[n>>2]=0;n=n+4|0}while((n|0)<(t|0));E[c>>2]=E[i>>2];if((ki(0,r,c,A,T)|0)<0)i=-1;else{if((E[e+76>>2]|0)>-1)l=Ci(e)|0;else l=0;i=E[e>>2]|0;f=i&32;if((_[e+74>>0]|0)<1)E[e>>2]=i&-33;i=e+48|0;if(!(E[i>>2]|0)){t=e+44|0;o=E[t>>2]|0;E[t>>2]=d;a=e+28|0;E[a>>2]=d;u=e+20|0;E[u>>2]=d;E[i>>2]=80;s=e+16|0;E[s>>2]=d+80;n=ki(e,r,c,A,T)|0;if(o){pn[E[e+36>>2]&7](e,0,0)|0;n=(E[u>>2]|0)==0?-1:n;E[t>>2]=o;E[i>>2]=0;E[s>>2]=0;E[a>>2]=0;E[u>>2]=0}}else n=ki(e,r,c,A,T)|0;i=E[e>>2]|0;E[e>>2]=i|f;if(l)pi(e);i=(i&32|0)==0?n:-1}S=R;return i|0}function hi(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0,u=0,s=0,l=0,f=0;f=S;S=S+128|0;t=f+112|0;l=f;o=l;a=252;u=o+112|0;do{E[o>>2]=E[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(u|0));if((r+-1|0)>>>0>2147483646)if(!r){r=1;s=4}else{r=si()|0;E[r>>2]=75;r=-1}else{t=e;s=4}if((s|0)==4){s=-2-t|0;s=r>>>0>s>>>0?s:r;E[l+48>>2]=s;e=l+20|0;E[e>>2]=t;E[l+44>>2]=t;r=t+s|0;t=l+16|0;E[t>>2]=r;E[l+28>>2]=r;r=Si(l,i,n)|0;if(s){i=E[e>>2]|0;_[i+(((i|0)==(E[t>>2]|0))<<31>>31)>>0]=0}}S=f;return r|0}function Ni(e,r,i){e=e|0;r=r|0;i=i|0;return hi(e,2147483647,r,i)|0}function Ci(e){e=e|0;return 0}function pi(e){e=e|0;return}function wi(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0;s=S;S=S+16|0;u=s;a=r&255;_[u>>0]=a;n=e+16|0;t=E[n>>2]|0;if(!t)if(!(vi(e)|0)){t=E[n>>2]|0;o=4}else i=-1;else o=4;do if((o|0)==4){n=e+20|0;o=E[n>>2]|0;if(o>>>0<t>>>0?(i=r&255,(i|0)!=(_[e+75>>0]|0)):0){E[n>>2]=o+1;_[o>>0]=a;break}if((pn[E[e+36>>2]&7](e,u,1)|0)==1)i=d[u>>0]|0;else i=-1}while(0);S=s;return i|0}function bi(e){e=e|0;var r=0,i=0;r=S;S=S+16|0;i=r;E[i>>2]=E[e+60>>2];e=li(Le(6,i|0)|0)|0;S=r;return e|0}function Ii(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0;t=S;S=S+32|0;o=t;n=t+20|0;E[o>>2]=E[e+60>>2];E[o+4>>2]=0;E[o+8>>2]=r;E[o+12>>2]=n;E[o+16>>2]=i;if((li(De(140,o|0)|0)|0)<0){E[n>>2]=-1;e=-1}else e=E[n>>2]|0;S=t;return e|0}function Oi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,A=0;A=S;S=S+48|0;_=A+16|0;f=A;n=A+32|0;c=e+28|0;t=E[c>>2]|0;E[n>>2]=t;d=e+20|0;t=(E[d>>2]|0)-t|0;E[n+4>>2]=t;E[n+8>>2]=r;E[n+12>>2]=i;s=e+60|0;l=e+44|0;r=2;t=t+i|0;while(1){if(!(E[49]|0)){E[_>>2]=E[s>>2];E[_+4>>2]=n;E[_+8>>2]=r;a=li(Ve(146,_|0)|0)|0}else{ve(7,e|0);E[f>>2]=E[s>>2];E[f+4>>2]=n;E[f+8>>2]=r;a=li(Ve(146,f|0)|0)|0;Ce(0)}if((t|0)==(a|0)){t=6;break}if((a|0)<0){t=8;break}t=t-a|0;o=E[n+4>>2]|0;if(a>>>0<=o>>>0)if((r|0)==2){E[c>>2]=(E[c>>2]|0)+a;u=o;r=2}else u=o;else{u=E[l>>2]|0;E[c>>2]=u;E[d>>2]=u;u=E[n+12>>2]|0;a=a-o|0;n=n+8|0;r=r+-1|0}E[n>>2]=(E[n>>2]|0)+a;E[n+4>>2]=u-a}if((t|0)==6){_=E[l>>2]|0;E[e+16>>2]=_+(E[e+48>>2]|0);e=_;E[c>>2]=e;E[d>>2]=e}else if((t|0)==8){E[e+16>>2]=0;E[c>>2]=0;E[d>>2]=0;E[e>>2]=E[e>>2]|32;if((r|0)==2)i=0;else i=i-(E[n+4>>2]|0)|0}S=A;return i|0}function Pi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0;t=S;S=S+80|0;n=t;E[e+36>>2]=3;if((E[e>>2]&64|0)==0?(E[n>>2]=E[e+60>>2],E[n+4>>2]=21505,E[n+8>>2]=t+12,(ye(54,n|0)|0)!=0):0)_[e+75>>0]=-1;n=Oi(e,r,i)|0;S=t;return n|0}function vi(e){e=e|0;var r=0,i=0;r=e+74|0;i=_[r>>0]|0;_[r>>0]=i+255|i;r=E[e>>2]|0;if(!(r&8)){E[e+8>>2]=0;E[e+4>>2]=0;r=E[e+44>>2]|0;E[e+28>>2]=r;E[e+20>>2]=r;E[e+16>>2]=r+(E[e+48>>2]|0);r=0}else{E[e>>2]=r|32;r=-1}return r|0}function Li(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0;o=r&255;n=(i|0)!=0;e:do if(n&(e&3|0)!=0){t=r&255;while(1){if((_[e>>0]|0)==t<<24>>24){a=6;break e}e=e+1|0;i=i+-1|0;n=(i|0)!=0;if(!(n&(e&3|0)!=0)){a=5;break}}}else a=5;while(0);if((a|0)==5)if(n)a=6;else i=0;e:do if((a|0)==6){t=r&255;if((_[e>>0]|0)!=t<<24>>24){n=fe(o,16843009)|0;r:do if(i>>>0>3)while(1){o=E[e>>2]^n;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;i=i+-4|0;if(i>>>0<=3){a=11;break r}}else a=11;while(0);if((a|0)==11)if(!i){i=0;break}while(1){if((_[e>>0]|0)==t<<24>>24)break e;e=e+1|0;i=i+-1|0;if(!i){i=0;break}}}}while(0);return((i|0)!=0?e:0)|0}function Bi(e){e=e|0;var r=0,i=0,n=0;n=e;e:do if(!(n&3))i=4;else{r=e;e=n;while(1){if(!(_[r>>0]|0))break e;r=r+1|0;e=r;if(!(e&3)){e=r;i=4;break}}}while(0);if((i|0)==4){while(1){r=E[e>>2]|0;if(!((r&-2139062144^-2139062144)&r+-16843009))e=e+4|0;else break}if((r&255)<<24>>24)do e=e+1|0;while((_[e>>0]|0)!=0)}return e-n|0}function ki(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0,u=0,s=0,l=0,f=0,A=0,T=0,R=0,m=0,h=0,C=0,p=0,w=0,b=0,I=0,O=0,P=0,v=0,L=0,B=0,k=0,F=0,g=0,U=0,y=0,D=0,H=0,X=0,V=0,Y=0,x=0,K=0,W=0,z=0,q=0,j=0,Z=0,J=0,Q=0,$=0,ee=0,re=0,ie=0,ne=0,te=0,oe=0,ae=0;ae=S;S=S+624|0;re=ae+24|0;ne=ae+16|0;ie=ae+588|0;Z=ae+576|0;ee=ae;z=ae+536|0;oe=ae+8|0;te=ae+528|0;y=(e|0)!=0;D=z+40|0;W=D;z=z+39|0;q=oe+4|0;j=Z+12|0;Z=Z+11|0;J=ie;Q=j;$=Q-J|0;H=-2-J|0;X=Q+2|0;V=re+288|0;Y=ie+9|0;x=Y;K=ie+8|0;o=0;h=r;a=0;r=0;e:while(1){do if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=si()|0;E[o>>2]=75;o=-1;break}else{o=a+o|0;break}while(0);a=_[h>>0]|0;if(!(a<<24>>24)){U=245;break}else u=h;r:while(1){switch(a<<24>>24){case 37:{a=u;U=9;break r}case 0:{a=u;break r}default:{}}g=u+1|0;a=_[g>>0]|0;u=g}r:do if((U|0)==9)while(1){U=0;if((_[a+1>>0]|0)!=37)break r;u=u+1|0;a=a+2|0;if((_[a>>0]|0)==37)U=9;else break}while(0);p=u-h|0;if(y?(E[e>>2]&32|0)==0:0)Ti(h,p,e)|0;if((u|0)!=(h|0)){h=a;a=p;continue}f=a+1|0;u=_[f>>0]|0;s=(u<<24>>24)+-48|0;if(s>>>0<10){g=(_[a+2>>0]|0)==36;f=g?a+3|0:f;u=_[f>>0]|0;R=g?s:-1;r=g?1:r}else R=-1;a=u<<24>>24;r:do if((a&-32|0)==32){s=0;while(1){if(!(1<<a+-32&75913)){A=s;a=f;break r}s=1<<(u<<24>>24)+-32|s;f=f+1|0;u=_[f>>0]|0;a=u<<24>>24;if((a&-32|0)!=32){A=s;a=f;break}}}else{A=0;a=f}while(0);do if(u<<24>>24==42){s=a+1|0;u=(_[s>>0]|0)+-48|0;if(u>>>0<10?(_[a+2>>0]|0)==36:0){E[t+(u<<2)>>2]=10;r=1;a=a+3|0;u=E[n+((_[s>>0]|0)+-48<<3)>>2]|0}else{if(r){o=-1;break e}if(!y){C=A;a=s;r=0;g=0;break}r=(E[i>>2]|0)+(4-1)&~(4-1);u=E[r>>2]|0;E[i>>2]=r+4;r=0;a=s}if((u|0)<0){C=A|8192;g=0-u|0}else{C=A;g=u}}else{s=(u<<24>>24)+-48|0;if(s>>>0<10){u=0;do{u=(u*10|0)+s|0;a=a+1|0;s=(_[a>>0]|0)+-48|0}while(s>>>0<10);if((u|0)<0){o=-1;break e}else{C=A;g=u}}else{C=A;g=0}}while(0);r:do if((_[a>>0]|0)==46){s=a+1|0;u=_[s>>0]|0;if(u<<24>>24!=42){f=(u<<24>>24)+-48|0;if(f>>>0<10){a=s;u=0}else{a=s;f=0;break}while(1){u=(u*10|0)+f|0;a=a+1|0;f=(_[a>>0]|0)+-48|0;if(f>>>0>=10){f=u;break r}}}s=a+2|0;u=(_[s>>0]|0)+-48|0;if(u>>>0<10?(_[a+3>>0]|0)==36:0){E[t+(u<<2)>>2]=10;a=a+4|0;f=E[n+((_[s>>0]|0)+-48<<3)>>2]|0;break}if(r){o=-1;break e}if(y){a=(E[i>>2]|0)+(4-1)&~(4-1);f=E[a>>2]|0;E[i>>2]=a+4;a=s}else{a=s;f=0}}else f=-1;while(0);T=0;while(1){u=(_[a>>0]|0)+-65|0;if(u>>>0>57){o=-1;break e}s=a+1|0;u=_[5347+(T*58|0)+u>>0]|0;A=u&255;if((A+-1|0)>>>0<8){a=s;T=A}else{F=s;break}}if(!(u<<24>>24)){o=-1;break}s=(R|0)>-1;do if(u<<24>>24==19)if(s){o=-1;break e}else U=52;else{if(s){E[t+(R<<2)>>2]=A;B=n+(R<<3)|0;k=E[B+4>>2]|0;U=ee;E[U>>2]=E[B>>2];E[U+4>>2]=k;U=52;break}if(!y){o=0;break e}Ui(ee,A,i)}while(0);if((U|0)==52?(U=0,!y):0){h=F;a=p;continue}R=_[a>>0]|0;R=(T|0)!=0&(R&15|0)==3?R&-33:R;s=C&-65537;k=(C&8192|0)==0?C:s;r:do switch(R|0){case 110:switch(T|0){case 0:{E[E[ee>>2]>>2]=o;h=F;a=p;continue e}case 1:{E[E[ee>>2]>>2]=o;h=F;a=p;continue e}case 2:{h=E[ee>>2]|0;E[h>>2]=o;E[h+4>>2]=((o|0)<0)<<31>>31;h=F;a=p;continue e}case 3:{c[E[ee>>2]>>1]=o;h=F;a=p;continue e}case 4:{_[E[ee>>2]>>0]=o;h=F;a=p;continue e}case 6:{E[E[ee>>2]>>2]=o;h=F;a=p;continue e}case 7:{h=E[ee>>2]|0;E[h>>2]=o;E[h+4>>2]=((o|0)<0)<<31>>31;h=F;a=p;continue e}default:{h=F;a=p;continue e}}case 112:{T=k|8;f=f>>>0>8?f:8;R=120;U=64;break}case 88:case 120:{T=k;U=64;break}case 111:{s=ee;u=E[s>>2]|0;s=E[s+4>>2]|0;if((u|0)==0&(s|0)==0)a=D;else{a=D;do{a=a+-1|0;_[a>>0]=u&7|48;u=ji(u|0,s|0,3)|0;s=G}while(!((u|0)==0&(s|0)==0))}if(!(k&8)){u=k;T=0;A=5827;U=77}else{T=W-a+1|0;u=k;f=(f|0)<(T|0)?T:f;T=0;A=5827;U=77}break}case 105:case 100:{u=ee;a=E[u>>2]|0;u=E[u+4>>2]|0;if((u|0)<0){a=Wi(0,0,a|0,u|0)|0;u=G;s=ee;E[s>>2]=a;E[s+4>>2]=u;s=1;A=5827;U=76;break r}if(!(k&2048)){A=k&1;s=A;A=(A|0)==0?5827:5829;U=76}else{s=1;A=5828;U=76}break}case 117:{u=ee;a=E[u>>2]|0;u=E[u+4>>2]|0;s=0;A=5827;U=76;break}case 99:{_[z>>0]=E[ee>>2];h=z;u=1;T=0;R=5827;a=D;break}case 109:{a=si()|0;a=ui(E[a>>2]|0)|0;U=82;break}case 115:{a=E[ee>>2]|0;a=(a|0)!=0?a:5837;U=82;break}case 67:{E[oe>>2]=E[ee>>2];E[q>>2]=0;E[ee>>2]=oe;f=-1;U=86;break}case 83:{if(!f){Di(e,32,g,0,k);a=0;U=98}else U=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{l=+M[ee>>3];E[ne>>2]=0;M[N>>3]=l;if((E[N+4>>2]|0)>=0)if(!(k&2048)){B=k&1;L=B;B=(B|0)==0?5845:5850}else{L=1;B=5847}else{l=-l;L=1;B=5844}M[N>>3]=l;v=E[N+4>>2]&2146435072;do if(v>>>0<2146435072|(v|0)==2146435072&0<0){m=+_i(l,ne)*2;u=m!=0;if(u)E[ne>>2]=(E[ne>>2]|0)+-1;O=R|32;if((O|0)==97){h=R&32;p=(h|0)==0?B:B+9|0;C=L|2;a=12-f|0;do if(!(f>>>0>11|(a|0)==0)){l=8;do{a=a+-1|0;l=l*16}while((a|0)!=0);if((_[p>>0]|0)==45){l=-(l+(-m-l));break}else{l=m+l-l;break}}else l=m;while(0);u=E[ne>>2]|0;a=(u|0)<0?0-u|0:u;a=yi(a,((a|0)<0)<<31>>31,j)|0;if((a|0)==(j|0)){_[Z>>0]=48;a=Z}_[a+-1>>0]=(u>>31&2)+43;T=a+-2|0;_[T>>0]=R+15;A=(f|0)<1;s=(k&8|0)==0;u=ie;while(1){B=~~l;a=u+1|0;_[u>>0]=d[5811+B>>0]|h;l=(l-+(B|0))*16;do if((a-J|0)==1){if(s&(A&l==0))break;_[a>>0]=46;a=u+2|0}while(0);if(!(l!=0))break;else u=a}f=(f|0)!=0&(H+a|0)<(f|0)?X+f-T|0:$-T+a|0;s=f+C|0;Di(e,32,g,s,k);if(!(E[e>>2]&32))Ti(p,C,e)|0;Di(e,48,g,s,k^65536);a=a-J|0;if(!(E[e>>2]&32))Ti(ie,a,e)|0;u=Q-T|0;Di(e,48,f-(a+u)|0,0,0);if(!(E[e>>2]&32))Ti(T,u,e)|0;Di(e,32,g,s,k^8192);a=(s|0)<(g|0)?g:s;break}a=(f|0)<0?6:f;if(u){u=(E[ne>>2]|0)+-28|0;E[ne>>2]=u;l=m*268435456}else{l=m;u=E[ne>>2]|0}v=(u|0)<0?re:V;P=v;u=v;do{I=~~l>>>0;E[u>>2]=I;u=u+4|0;l=(l-+(I>>>0))*1e9}while(l!=0);s=u;u=E[ne>>2]|0;if((u|0)>0){A=v;while(1){T=(u|0)>29?29:u;f=s+-4|0;do if(f>>>0<A>>>0)f=A;else{u=0;do{I=Zi(E[f>>2]|0,0,T|0)|0;I=zi(I|0,G|0,u|0,0)|0;u=G;b=an(I|0,u|0,1e9,0)|0;E[f>>2]=b;u=on(I|0,u|0,1e9,0)|0;f=f+-4|0}while(f>>>0>=A>>>0);if(!u){f=A;break}f=A+-4|0;E[f>>2]=u}while(0);while(1){if(s>>>0<=f>>>0)break;u=s+-4|0;if(!(E[u>>2]|0))s=u;else break}u=(E[ne>>2]|0)-T|0;E[ne>>2]=u;if((u|0)>0)A=f;else break}}else f=v;if((u|0)<0){p=((a+25|0)/9|0)+1|0;w=(O|0)==102;h=f;while(1){C=0-u|0;C=(C|0)>9?9:C;do if(h>>>0<s>>>0){u=(1<<C)+-1|0;A=1e9>>>C;f=0;T=h;do{I=E[T>>2]|0;E[T>>2]=(I>>>C)+f;f=fe(I&u,A)|0;T=T+4|0}while(T>>>0<s>>>0);u=(E[h>>2]|0)==0?h+4|0:h;if(!f){f=u;break}E[s>>2]=f;f=u;s=s+4|0}else f=(E[h>>2]|0)==0?h+4|0:h;while(0);u=w?v:f;s=(s-u>>2|0)>(p|0)?u+(p<<2)|0:s;u=(E[ne>>2]|0)+C|0;E[ne>>2]=u;if((u|0)>=0){h=f;break}else h=f}}else h=f;do if(h>>>0<s>>>0){u=(P-h>>2)*9|0;A=E[h>>2]|0;if(A>>>0<10)break;else f=10;do{f=f*10|0;u=u+1|0}while(A>>>0>=f>>>0)}else u=0;while(0);b=(O|0)==103;I=(a|0)!=0;f=a-((O|0)!=102?u:0)+((I&b)<<31>>31)|0;if((f|0)<(((s-P>>2)*9|0)+-9|0)){T=f+9216|0;w=(T|0)/9|0;f=v+(w+-1023<<2)|0;T=((T|0)%9|0)+1|0;if((T|0)<9){A=10;do{A=A*10|0;T=T+1|0}while((T|0)!=9)}else A=10;C=E[f>>2]|0;p=(C>>>0)%(A>>>0)|0;if((p|0)==0?(v+(w+-1022<<2)|0)==(s|0):0)A=h;else U=163;do if((U|0)==163){U=0;m=(((C>>>0)/(A>>>0)|0)&1|0)==0?9007199254740992:9007199254740994;T=(A|0)/2|0;do if(p>>>0<T>>>0)l=.5;else{if((p|0)==(T|0)?(v+(w+-1022<<2)|0)==(s|0):0){l=1;break}l=1.5}while(0);do if(L){if((_[B>>0]|0)!=45)break;m=-m;l=-l}while(0);T=C-p|0;E[f>>2]=T;if(!(m+l!=m)){A=h;break}O=T+A|0;E[f>>2]=O;if(O>>>0>999999999){u=h;while(1){A=f+-4|0;E[f>>2]=0;if(A>>>0<u>>>0){u=u+-4|0;E[u>>2]=0}O=(E[A>>2]|0)+1|0;E[A>>2]=O;if(O>>>0>999999999)f=A;else{h=u;f=A;break}}}u=(P-h>>2)*9|0;T=E[h>>2]|0;if(T>>>0<10){A=h;break}else A=10;do{A=A*10|0;u=u+1|0}while(T>>>0>=A>>>0);A=h}while(0);O=f+4|0;h=A;s=s>>>0>O>>>0?O:s}p=0-u|0;while(1){if(s>>>0<=h>>>0){w=0;O=s;break}f=s+-4|0;if(!(E[f>>2]|0))s=f;else{w=1;O=s;break}}do if(b){a=(I&1^1)+a|0;if((a|0)>(u|0)&(u|0)>-5){R=R+-1|0;a=a+-1-u|0}else{R=R+-2|0;a=a+-1|0}s=k&8;if(s)break;do if(w){s=E[O+-4>>2]|0;if(!s){f=9;break}if(!((s>>>0)%10|0)){A=10;f=0}else{f=0;break}do{A=A*10|0;f=f+1|0}while(((s>>>0)%(A>>>0)|0|0)==0)}else f=9;while(0);s=((O-P>>2)*9|0)+-9|0;if((R|32|0)==102){s=s-f|0;s=(s|0)<0?0:s;a=(a|0)<(s|0)?a:s;s=0;break}else{s=s+u-f|0;s=(s|0)<0?0:s;a=(a|0)<(s|0)?a:s;s=0;break}}else s=k&8;while(0);C=a|s;A=(C|0)!=0&1;T=(R|32|0)==102;if(T){u=(u|0)>0?u:0;R=0}else{f=(u|0)<0?p:u;f=yi(f,((f|0)<0)<<31>>31,j)|0;if((Q-f|0)<2)do{f=f+-1|0;_[f>>0]=48}while((Q-f|0)<2);_[f+-1>>0]=(u>>31&2)+43;P=f+-2|0;_[P>>0]=R;u=Q-P|0;R=P}p=L+1+a+A+u|0;Di(e,32,g,p,k);if(!(E[e>>2]&32))Ti(B,L,e)|0;Di(e,48,g,p,k^65536);do if(T){f=h>>>0>v>>>0?v:h;u=f;do{s=yi(E[u>>2]|0,0,Y)|0;do if((u|0)==(f|0)){if((s|0)!=(Y|0))break;_[K>>0]=48;s=K}else{if(s>>>0<=ie>>>0)break;do{s=s+-1|0;_[s>>0]=48}while(s>>>0>ie>>>0)}while(0);if(!(E[e>>2]&32))Ti(s,x-s|0,e)|0;u=u+4|0}while(u>>>0<=v>>>0);do if(C){if(E[e>>2]&32)break;Ti(5879,1,e)|0}while(0);if((a|0)>0&u>>>0<O>>>0){s=u;while(1){u=yi(E[s>>2]|0,0,Y)|0;if(u>>>0>ie>>>0)do{u=u+-1|0;_[u>>0]=48}while(u>>>0>ie>>>0);if(!(E[e>>2]&32))Ti(u,(a|0)>9?9:a,e)|0;s=s+4|0;u=a+-9|0;if(!((a|0)>9&s>>>0<O>>>0)){a=u;break}else a=u}}Di(e,48,a+9|0,9,0)}else{T=w?O:h+4|0;if((a|0)>-1){A=(s|0)==0;f=h;do{u=yi(E[f>>2]|0,0,Y)|0;if((u|0)==(Y|0)){_[K>>0]=48;u=K}do if((f|0)==(h|0)){s=u+1|0;if(!(E[e>>2]&32))Ti(u,1,e)|0;if(A&(a|0)<1){u=s;break}if(E[e>>2]&32){u=s;break}Ti(5879,1,e)|0;u=s}else{if(u>>>0<=ie>>>0)break;do{u=u+-1|0;_[u>>0]=48}while(u>>>0>ie>>>0)}while(0);s=x-u|0;if(!(E[e>>2]&32))Ti(u,(a|0)>(s|0)?s:a,e)|0;a=a-s|0;f=f+4|0}while(f>>>0<T>>>0&(a|0)>-1)}Di(e,48,a+18|0,18,0);if(E[e>>2]&32)break;Ti(R,Q-R|0,e)|0}while(0);Di(e,32,g,p,k^8192);a=(p|0)<(g|0)?g:p}else{T=(R&32|0)!=0;A=l!=l|0!=0;u=A?0:L;f=u+3|0;Di(e,32,g,f,s);a=E[e>>2]|0;if(!(a&32)){Ti(B,u,e)|0;a=E[e>>2]|0}if(!(a&32))Ti(A?T?5871:5875:T?5863:5867,3,e)|0;Di(e,32,g,f,k^8192);a=(f|0)<(g|0)?g:f}while(0);h=F;continue e}default:{s=k;u=f;T=0;R=5827;a=D}}while(0);r:do if((U|0)==64){s=ee;u=E[s>>2]|0;s=E[s+4>>2]|0;A=R&32;if(!((u|0)==0&(s|0)==0)){a=D;do{a=a+-1|0;_[a>>0]=d[5811+(u&15)>>0]|A;u=ji(u|0,s|0,4)|0;s=G}while(!((u|0)==0&(s|0)==0));U=ee;if((T&8|0)==0|(E[U>>2]|0)==0&(E[U+4>>2]|0)==0){u=T;T=0;A=5827;U=77}else{u=T;T=2;A=5827+(R>>4)|0;U=77}}else{a=D;u=T;T=0;A=5827;U=77}}else if((U|0)==76){a=yi(a,u,D)|0;u=k;T=s;U=77}else if((U|0)==82){U=0;k=Li(a,0,f)|0;B=(k|0)==0;h=a;u=B?f:k-a|0;T=0;R=5827;a=B?a+f|0:k}else if((U|0)==86){U=0;u=0;a=0;A=E[ee>>2]|0;while(1){s=E[A>>2]|0;if(!s)break;a=Ei(te,s)|0;if((a|0)<0|a>>>0>(f-u|0)>>>0)break;u=a+u|0;if(f>>>0>u>>>0)A=A+4|0;else break}if((a|0)<0){o=-1;break e}Di(e,32,g,u,k);if(!u){a=0;U=98}else{s=0;f=E[ee>>2]|0;while(1){a=E[f>>2]|0;if(!a){a=u;U=98;break r}a=Ei(te,a)|0;s=a+s|0;if((s|0)>(u|0)){a=u;U=98;break r}if(!(E[e>>2]&32))Ti(te,a,e)|0;if(s>>>0>=u>>>0){a=u;U=98;break}else f=f+4|0}}}while(0);if((U|0)==98){U=0;Di(e,32,g,a,k^8192);h=F;a=(g|0)>(a|0)?g:a;continue}if((U|0)==77){U=0;s=(f|0)>-1?u&-65537:u;u=ee;u=(E[u>>2]|0)!=0|(E[u+4>>2]|0)!=0;if((f|0)!=0|u){u=(u&1^1)+(W-a)|0;h=a;u=(f|0)>(u|0)?f:u;R=A;a=D}else{h=D;u=0;R=A;a=D}}A=a-h|0;u=(u|0)<(A|0)?A:u;f=T+u|0;a=(g|0)<(f|0)?f:g;Di(e,32,a,f,s);if(!(E[e>>2]&32))Ti(R,T,e)|0;Di(e,48,a,f,s^65536);Di(e,48,u,A,0);if(!(E[e>>2]&32))Ti(h,A,e)|0;Di(e,32,a,f,s^8192);h=F}e:do if((U|0)==245)if(!e)if(r){o=1;while(1){r=E[t+(o<<2)>>2]|0;if(!r)break;Ui(n+(o<<3)|0,r,i);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(E[t+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0;while(0);S=ae;return o|0}function Fi(e){e=e|0;if(!(E[e+68>>2]|0))pi(e);return}function gi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0;n=e+20|0;t=E[n>>2]|0;e=(E[e+16>>2]|0)-t|0;e=e>>>0>i>>>0?i:e;Ji(t|0,r|0,e|0)|0;E[n>>2]=(E[n>>2]|0)+e;return i|0}function Ui(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0;e:do if(r>>>0<=20)do switch(r|0){case 9:{n=(E[i>>2]|0)+(4-1)&~(4-1);r=E[n>>2]|0;E[i>>2]=n+4;E[e>>2]=r;break e}case 10:{n=(E[i>>2]|0)+(4-1)&~(4-1);r=E[n>>2]|0;E[i>>2]=n+4;n=e;E[n>>2]=r;E[n+4>>2]=((r|0)<0)<<31>>31;break e}case 11:{n=(E[i>>2]|0)+(4-1)&~(4-1);r=E[n>>2]|0;E[i>>2]=n+4;n=e;E[n>>2]=r;E[n+4>>2]=0;break e}case 12:{n=(E[i>>2]|0)+(8-1)&~(8-1);r=n;t=E[r>>2]|0;r=E[r+4>>2]|0;E[i>>2]=n+8;n=e;E[n>>2]=t;E[n+4>>2]=r;break e}case 13:{t=(E[i>>2]|0)+(4-1)&~(4-1);n=E[t>>2]|0;E[i>>2]=t+4;n=(n&65535)<<16>>16;t=e;E[t>>2]=n;E[t+4>>2]=((n|0)<0)<<31>>31;break e}case 14:{t=(E[i>>2]|0)+(4-1)&~(4-1);n=E[t>>2]|0;E[i>>2]=t+4;t=e;E[t>>2]=n&65535;E[t+4>>2]=0;break e}case 15:{t=(E[i>>2]|0)+(4-1)&~(4-1);n=E[t>>2]|0;E[i>>2]=t+4;n=(n&255)<<24>>24;t=e;E[t>>2]=n;E[t+4>>2]=((n|0)<0)<<31>>31;break e}case 16:{t=(E[i>>2]|0)+(4-1)&~(4-1);n=E[t>>2]|0;E[i>>2]=t+4;t=e;E[t>>2]=n&255;E[t+4>>2]=0;break e}case 17:{t=(E[i>>2]|0)+(8-1)&~(8-1);o=+M[t>>3];E[i>>2]=t+8;M[e>>3]=o;break e}case 18:{t=(E[i>>2]|0)+(8-1)&~(8-1);o=+M[t>>3];E[i>>2]=t+8;M[e>>3]=o;break e}default:break e}while(0);while(0);return}function yi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0;if(r>>>0>0|(r|0)==0&e>>>0>4294967295)while(1){n=an(e|0,r|0,10,0)|0;i=i+-1|0;_[i>>0]=n|48;n=on(e|0,r|0,10,0)|0;if(r>>>0>9|(r|0)==9&e>>>0>4294967295){e=n;r=G}else{e=n;break}}if(e)while(1){i=i+-1|0;_[i>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return i|0}function Di(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0,u=0;u=S;S=S+256|0;a=u;do if((i|0)>(n|0)&(t&73728|0)==0){t=i-n|0;qi(a|0,r|0,(t>>>0>256?256:t)|0)|0;r=E[e>>2]|0;o=(r&32|0)==0;if(t>>>0>255){n=i-n|0;do{if(o){Ti(a,256,e)|0;r=E[e>>2]|0}t=t+-256|0;o=(r&32|0)==0}while(t>>>0>255);if(o)t=n&255;else break}else if(!o)break;Ti(a,t,e)|0}while(0);S=u;return}function Hi(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,A=0,T=0,R=0,M=0,m=0,S=0,h=0,N=0,C=0,p=0,w=0,b=0,I=0,O=0,P=0,v=0,L=0,B=0,k=0,F=0,g=0,U=0,y=0,D=0;do if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;u=E[147]|0;i=u>>>e;if(i&3){e=(i&1^1)+e|0;n=e<<1;i=628+(n<<2)|0;n=628+(n+2<<2)|0;t=E[n>>2]|0;o=t+8|0;a=E[o>>2]|0;do if((i|0)!=(a|0)){if(a>>>0<(E[151]|0)>>>0)Pe();r=a+12|0;if((E[r>>2]|0)==(t|0)){E[r>>2]=i;E[n>>2]=a;break}else Pe()}else E[147]=u&~(1<<e);while(0);D=e<<3;E[t+4>>2]=D|3;D=t+(D|4)|0;E[D>>2]=E[D>>2]|1;D=o;return D|0}a=E[149]|0;if(d>>>0>a>>>0){if(i){n=2<<e;n=i<<e&(n|0-n);n=(n&0-n)+-1|0;s=n>>>12&16;n=n>>>s;t=n>>>5&8;n=n>>>t;o=n>>>2&4;n=n>>>o;i=n>>>1&2;n=n>>>i;e=n>>>1&1;e=(t|s|o|i|e)+(n>>>e)|0;n=e<<1;i=628+(n<<2)|0;n=628+(n+2<<2)|0;o=E[n>>2]|0;s=o+8|0;t=E[s>>2]|0;do if((i|0)!=(t|0)){if(t>>>0<(E[151]|0)>>>0)Pe();r=t+12|0;if((E[r>>2]|0)==(o|0)){E[r>>2]=i;E[n>>2]=t;l=E[149]|0;break}else Pe()}else{E[147]=u&~(1<<e);l=a}while(0);D=e<<3;a=D-d|0;E[o+4>>2]=d|3;u=o+d|0;E[o+(d|4)>>2]=a|1;E[o+D>>2]=a;if(l){t=E[152]|0;i=l>>>3;r=i<<1;n=628+(r<<2)|0;e=E[147]|0;i=1<<i;if(e&i){e=628+(r+2<<2)|0;r=E[e>>2]|0;if(r>>>0<(E[151]|0)>>>0)Pe();else{f=e;_=r}}else{E[147]=e|i;f=628+(r+2<<2)|0;_=n}E[f>>2]=t;E[_+12>>2]=t;E[t+8>>2]=_;E[t+12>>2]=n}E[149]=a;E[152]=u;D=s;return D|0}e=E[148]|0;if(e){i=(e&0-e)+-1|0;y=i>>>12&16;i=i>>>y;U=i>>>5&8;i=i>>>U;D=i>>>2&4;i=i>>>D;e=i>>>1&2;i=i>>>e;n=i>>>1&1;n=E[892+((U|y|D|e|n)+(i>>>n)<<2)>>2]|0;i=(E[n+4>>2]&-8)-d|0;e=n;while(1){r=E[e+16>>2]|0;if(!r){r=E[e+20>>2]|0;if(!r){s=i;break}}e=(E[r+4>>2]&-8)-d|0;D=e>>>0<i>>>0;i=D?e:i;e=r;n=D?r:n}o=E[151]|0;if(n>>>0<o>>>0)Pe();u=n+d|0;if(n>>>0>=u>>>0)Pe();a=E[n+24>>2]|0;i=E[n+12>>2]|0;do if((i|0)==(n|0)){e=n+20|0;r=E[e>>2]|0;if(!r){e=n+16|0;r=E[e>>2]|0;if(!r){c=0;break}}while(1){i=r+20|0;t=E[i>>2]|0;if(t){r=t;e=i;continue}i=r+16|0;t=E[i>>2]|0;if(!t)break;else{r=t;e=i}}if(e>>>0<o>>>0)Pe();else{E[e>>2]=0;c=r;break}}else{t=E[n+8>>2]|0;if(t>>>0<o>>>0)Pe();r=t+12|0;if((E[r>>2]|0)!=(n|0))Pe();e=i+8|0;if((E[e>>2]|0)==(n|0)){E[r>>2]=i;E[e>>2]=t;c=i;break}else Pe()}while(0);do if(a){r=E[n+28>>2]|0;e=892+(r<<2)|0;if((n|0)==(E[e>>2]|0)){E[e>>2]=c;if(!c){E[148]=E[148]&~(1<<r);break}}else{if(a>>>0<(E[151]|0)>>>0)Pe();r=a+16|0;if((E[r>>2]|0)==(n|0))E[r>>2]=c;else E[a+20>>2]=c;if(!c)break}e=E[151]|0;if(c>>>0<e>>>0)Pe();E[c+24>>2]=a;r=E[n+16>>2]|0;do if(r)if(r>>>0<e>>>0)Pe();else{E[c+16>>2]=r;E[r+24>>2]=c;break}while(0);r=E[n+20>>2]|0;if(r)if(r>>>0<(E[151]|0)>>>0)Pe();else{E[c+20>>2]=r;E[r+24>>2]=c;break}}while(0);if(s>>>0<16){D=s+d|0;E[n+4>>2]=D|3;D=n+(D+4)|0;E[D>>2]=E[D>>2]|1}else{E[n+4>>2]=d|3;E[n+(d|4)>>2]=s|1;E[n+(s+d)>>2]=s;r=E[149]|0;if(r){o=E[152]|0;i=r>>>3;r=i<<1;t=628+(r<<2)|0;e=E[147]|0;i=1<<i;if(e&i){r=628+(r+2<<2)|0;e=E[r>>2]|0;if(e>>>0<(E[151]|0)>>>0)Pe();else{A=r;T=e}}else{E[147]=e|i;A=628+(r+2<<2)|0;T=t}E[A>>2]=o;E[T+12>>2]=o;E[o+8>>2]=T;E[o+12>>2]=t}E[149]=s;E[152]=u}D=n+8|0;return D|0}else T=d}else T=d}else if(e>>>0<=4294967231){e=e+11|0;_=e&-8;f=E[148]|0;if(f){i=0-_|0;e=e>>>8;if(e)if(_>>>0>16777215)l=31;else{T=(e+1048320|0)>>>16&8;h=e<<T;A=(h+520192|0)>>>16&4;h=h<<A;l=(h+245760|0)>>>16&2;l=14-(A|T|l)+(h<<l>>>15)|0;l=_>>>(l+7|0)&1|l<<1}else l=0;e=E[892+(l<<2)>>2]|0;e:do if(!e){t=0;e=0;h=86}else{a=i;t=0;u=_<<((l|0)==31?0:25-(l>>>1)|0);s=e;e=0;while(1){o=E[s+4>>2]&-8;i=o-_|0;if(i>>>0<a>>>0)if((o|0)==(_|0)){o=s;e=s;h=90;break e}else e=s;else i=a;h=E[s+20>>2]|0;s=E[s+16+(u>>>31<<2)>>2]|0;t=(h|0)==0|(h|0)==(s|0)?t:h;if(!s){h=86;break}else{a=i;u=u<<1}}}while(0);if((h|0)==86){if((t|0)==0&(e|0)==0){e=2<<l;e=f&(e|0-e);if(!e){T=_;break}e=(e&0-e)+-1|0;c=e>>>12&16;e=e>>>c;f=e>>>5&8;e=e>>>f;A=e>>>2&4;e=e>>>A;T=e>>>1&2;e=e>>>T;t=e>>>1&1;t=E[892+((f|c|A|T|t)+(e>>>t)<<2)>>2]|0;e=0}if(!t){u=i;s=e}else{o=t;h=90}}if((h|0)==90)while(1){h=0;T=(E[o+4>>2]&-8)-_|0;t=T>>>0<i>>>0;i=t?T:i;e=t?o:e;t=E[o+16>>2]|0;if(t){o=t;h=90;continue}o=E[o+20>>2]|0;if(!o){u=i;s=e;break}else h=90}if((s|0)!=0?u>>>0<((E[149]|0)-_|0)>>>0:0){t=E[151]|0;if(s>>>0<t>>>0)Pe();a=s+_|0;if(s>>>0>=a>>>0)Pe();o=E[s+24>>2]|0;i=E[s+12>>2]|0;do if((i|0)==(s|0)){e=s+20|0;r=E[e>>2]|0;if(!r){e=s+16|0;r=E[e>>2]|0;if(!r){d=0;break}}while(1){i=r+20|0;n=E[i>>2]|0;if(n){r=n;e=i;continue}i=r+16|0;n=E[i>>2]|0;if(!n)break;else{r=n;e=i}}if(e>>>0<t>>>0)Pe();else{E[e>>2]=0;d=r;break}}else{n=E[s+8>>2]|0;if(n>>>0<t>>>0)Pe();r=n+12|0;if((E[r>>2]|0)!=(s|0))Pe();e=i+8|0;if((E[e>>2]|0)==(s|0)){E[r>>2]=i;E[e>>2]=n;d=i;break}else Pe()}while(0);do if(o){r=E[s+28>>2]|0;e=892+(r<<2)|0;if((s|0)==(E[e>>2]|0)){E[e>>2]=d;if(!d){E[148]=E[148]&~(1<<r);break}}else{if(o>>>0<(E[151]|0)>>>0)Pe();r=o+16|0;if((E[r>>2]|0)==(s|0))E[r>>2]=d;else E[o+20>>2]=d;if(!d)break}e=E[151]|0;if(d>>>0<e>>>0)Pe();E[d+24>>2]=o;r=E[s+16>>2]|0;do if(r)if(r>>>0<e>>>0)Pe();else{E[d+16>>2]=r;E[r+24>>2]=d;break}while(0);r=E[s+20>>2]|0;if(r)if(r>>>0<(E[151]|0)>>>0)Pe();else{E[d+20>>2]=r;E[r+24>>2]=d;break}}while(0);e:do if(u>>>0>=16){E[s+4>>2]=_|3;E[s+(_|4)>>2]=u|1;E[s+(u+_)>>2]=u;r=u>>>3;if(u>>>0<256){e=r<<1;n=628+(e<<2)|0;i=E[147]|0;r=1<<r;if(i&r){r=628+(e+2<<2)|0;e=E[r>>2]|0;if(e>>>0<(E[151]|0)>>>0)Pe();else{M=r;m=e}}else{E[147]=i|r;M=628+(e+2<<2)|0;m=n}E[M>>2]=a;E[m+12>>2]=a;E[s+(_+8)>>2]=m;E[s+(_+12)>>2]=n;break}r=u>>>8;if(r)if(u>>>0>16777215)n=31;else{y=(r+1048320|0)>>>16&8;D=r<<y;U=(D+520192|0)>>>16&4;D=D<<U;n=(D+245760|0)>>>16&2;n=14-(U|y|n)+(D<<n>>>15)|0;n=u>>>(n+7|0)&1|n<<1}else n=0;r=892+(n<<2)|0;E[s+(_+28)>>2]=n;E[s+(_+20)>>2]=0;E[s+(_+16)>>2]=0;e=E[148]|0;i=1<<n;if(!(e&i)){E[148]=e|i;E[r>>2]=a;E[s+(_+24)>>2]=r;E[s+(_+12)>>2]=a;E[s+(_+8)>>2]=a;break}r=E[r>>2]|0;r:do if((E[r+4>>2]&-8|0)!=(u|0)){n=u<<((n|0)==31?0:25-(n>>>1)|0);while(1){e=r+16+(n>>>31<<2)|0;i=E[e>>2]|0;if(!i)break;if((E[i+4>>2]&-8|0)==(u|0)){p=i;break r}else{n=n<<1;r=i}}if(e>>>0<(E[151]|0)>>>0)Pe();else{E[e>>2]=a;E[s+(_+24)>>2]=r;E[s+(_+12)>>2]=a;E[s+(_+8)>>2]=a;break e}}else p=r;while(0);r=p+8|0;e=E[r>>2]|0;D=E[151]|0;if(e>>>0>=D>>>0&p>>>0>=D>>>0){E[e+12>>2]=a;E[r>>2]=a;E[s+(_+8)>>2]=e;E[s+(_+12)>>2]=p;E[s+(_+24)>>2]=0;break}else Pe()}else{D=u+_|0;E[s+4>>2]=D|3;D=s+(D+4)|0;E[D>>2]=E[D>>2]|1}while(0);D=s+8|0;return D|0}else T=_}else T=_}else T=-1;while(0);i=E[149]|0;if(i>>>0>=T>>>0){r=i-T|0;e=E[152]|0;if(r>>>0>15){E[152]=e+T;E[149]=r;E[e+(T+4)>>2]=r|1;E[e+i>>2]=r;E[e+4>>2]=T|3}else{E[149]=0;E[152]=0;E[e+4>>2]=i|3;D=e+(i+4)|0;E[D>>2]=E[D>>2]|1}D=e+8|0;return D|0}e=E[150]|0;if(e>>>0>T>>>0){y=e-T|0;E[150]=y;D=E[153]|0;E[153]=D+T;E[D+(T+4)>>2]=y|1;E[D+4>>2]=T|3;D=D+8|0;return D|0}do if(!(E[265]|0)){e=Xe(30)|0;if(!(e+-1&e)){E[267]=e;E[266]=e;E[268]=-1;E[269]=-1;E[270]=0;E[258]=0;p=(ke(0)|0)&-16^1431655768;E[265]=p;break}else Pe()}while(0);s=T+48|0;u=E[267]|0;l=T+47|0;a=u+l|0;u=0-u|0;f=a&u;if(f>>>0<=T>>>0){D=0;return D|0}e=E[257]|0;if((e|0)!=0?(m=E[255]|0,p=m+f|0,p>>>0<=m>>>0|p>>>0>e>>>0):0){D=0;return D|0}e:do if(!(E[258]&4)){e=E[153]|0;r:do if(e){t=1036;while(1){i=E[t>>2]|0;if(i>>>0<=e>>>0?(R=t+4|0,(i+(E[R>>2]|0)|0)>>>0>e>>>0):0){o=t;e=R;break}t=E[t+8>>2]|0;if(!t){h=174;break r}}i=a-(E[150]|0)&u;if(i>>>0<2147483647){t=Be(i|0)|0;p=(t|0)==((E[o>>2]|0)+(E[e>>2]|0)|0);e=p?i:0;if(p){if((t|0)!=(-1|0)){N=t;A=e;h=194;break e}}else h=184}else e=0}else h=174;while(0);do if((h|0)==174){o=Be(0)|0;if((o|0)!=(-1|0)){e=o;i=E[266]|0;t=i+-1|0;if(!(t&e))i=f;else i=f-e+(t+e&0-i)|0;e=E[255]|0;t=e+i|0;if(i>>>0>T>>>0&i>>>0<2147483647){p=E[257]|0;if((p|0)!=0?t>>>0<=e>>>0|t>>>0>p>>>0:0){e=0;break}t=Be(i|0)|0;p=(t|0)==(o|0);e=p?i:0;if(p){N=o;A=e;h=194;break e}else h=184}else e=0}else e=0}while(0);r:do if((h|0)==184){o=0-i|0;do if(s>>>0>i>>>0&(i>>>0<2147483647&(t|0)!=(-1|0))?(S=E[267]|0,S=l-i+S&0-S,S>>>0<2147483647):0)if((Be(S|0)|0)==(-1|0)){Be(o|0)|0;break r}else{i=S+i|0;break}while(0);if((t|0)!=(-1|0)){N=t;A=i;h=194;break e}}while(0);E[258]=E[258]|4;h=191}else{e=0;h=191}while(0);if((((h|0)==191?f>>>0<2147483647:0)?(N=Be(f|0)|0,C=Be(0)|0,N>>>0<C>>>0&((N|0)!=(-1|0)&(C|0)!=(-1|0))):0)?(w=C-N|0,b=w>>>0>(T+40|0)>>>0,b):0){A=b?w:e;h=194}if((h|0)==194){e=(E[255]|0)+A|0;E[255]=e;if(e>>>0>(E[256]|0)>>>0)E[256]=e;a=E[153]|0;e:do if(a){o=1036;do{e=E[o>>2]|0;i=o+4|0;t=E[i>>2]|0;if((N|0)==(e+t|0)){I=e;O=i;P=t;v=o;h=204;break}o=E[o+8>>2]|0}while((o|0)!=0);if(((h|0)==204?(E[v+12>>2]&8|0)==0:0)?a>>>0<N>>>0&a>>>0>=I>>>0:0){E[O>>2]=P+A;D=(E[150]|0)+A|0;y=a+8|0;y=(y&7|0)==0?0:0-y&7;U=D-y|0;E[153]=a+y;E[150]=U;E[a+(y+4)>>2]=U|1;E[a+(D+4)>>2]=40;E[154]=E[269];break}e=E[151]|0;if(N>>>0<e>>>0){E[151]=N;e=N}i=N+A|0;o=1036;while(1){if((E[o>>2]|0)==(i|0)){t=o;i=o;h=212;break}o=E[o+8>>2]|0;if(!o){i=1036;break}}if((h|0)==212)if(!(E[i+12>>2]&8)){E[t>>2]=N;c=i+4|0;E[c>>2]=(E[c>>2]|0)+A;c=N+8|0;c=(c&7|0)==0?0:0-c&7;l=N+(A+8)|0;l=(l&7|0)==0?0:0-l&7;r=N+(l+A)|0;_=c+T|0;d=N+_|0;f=r-(N+c)-T|0;E[N+(c+4)>>2]=T|3;r:do if((r|0)!=(a|0)){if((r|0)==(E[152]|0)){D=(E[149]|0)+f|0;E[149]=D;E[152]=d;E[N+(_+4)>>2]=D|1;E[N+(D+_)>>2]=D;break}u=A+4|0;i=E[N+(u+l)>>2]|0;if((i&3|0)==1){s=i&-8;o=i>>>3;i:do if(i>>>0>=256){a=E[N+((l|24)+A)>>2]|0;n=E[N+(A+12+l)>>2]|0;do if((n|0)==(r|0)){t=l|16;n=N+(u+t)|0;i=E[n>>2]|0;if(!i){n=N+(t+A)|0;i=E[n>>2]|0;if(!i){g=0;break}}while(1){t=i+20|0;o=E[t>>2]|0;if(o){i=o;n=t;continue}t=i+16|0;o=E[t>>2]|0;if(!o)break;else{i=o;n=t}}if(n>>>0<e>>>0)Pe();else{E[n>>2]=0;g=i;break}}else{t=E[N+((l|8)+A)>>2]|0;if(t>>>0<e>>>0)Pe();e=t+12|0;if((E[e>>2]|0)!=(r|0))Pe();i=n+8|0;if((E[i>>2]|0)==(r|0)){E[e>>2]=n;E[i>>2]=t;g=n;break}else Pe()}while(0);if(!a)break;e=E[N+(A+28+l)>>2]|0;i=892+(e<<2)|0;do if((r|0)!=(E[i>>2]|0)){if(a>>>0<(E[151]|0)>>>0)Pe();e=a+16|0;if((E[e>>2]|0)==(r|0))E[e>>2]=g;else E[a+20>>2]=g;if(!g)break i}else{E[i>>2]=g;if(g)break;E[148]=E[148]&~(1<<e);break i}while(0);i=E[151]|0;if(g>>>0<i>>>0)Pe();E[g+24>>2]=a;r=l|16;e=E[N+(r+A)>>2]|0;do if(e)if(e>>>0<i>>>0)Pe();else{E[g+16>>2]=e;E[e+24>>2]=g;break}while(0);r=E[N+(u+r)>>2]|0;if(!r)break;if(r>>>0<(E[151]|0)>>>0)Pe();else{E[g+20>>2]=r;E[r+24>>2]=g;break}}else{n=E[N+((l|8)+A)>>2]|0;t=E[N+(A+12+l)>>2]|0;i=628+(o<<1<<2)|0;do if((n|0)!=(i|0)){if(n>>>0<e>>>0)Pe();if((E[n+12>>2]|0)==(r|0))break;Pe()}while(0);if((t|0)==(n|0)){E[147]=E[147]&~(1<<o);break}do if((t|0)==(i|0))L=t+8|0;else{if(t>>>0<e>>>0)Pe();e=t+8|0;if((E[e>>2]|0)==(r|0)){L=e;break}Pe()}while(0);E[n+12>>2]=t;E[L>>2]=n}while(0);r=N+((s|l)+A)|0;t=s+f|0}else t=f;r=r+4|0;E[r>>2]=E[r>>2]&-2;E[N+(_+4)>>2]=t|1;E[N+(t+_)>>2]=t;r=t>>>3;if(t>>>0<256){e=r<<1;n=628+(e<<2)|0;i=E[147]|0;r=1<<r;do if(!(i&r)){E[147]=i|r;U=628+(e+2<<2)|0;y=n}else{r=628+(e+2<<2)|0;e=E[r>>2]|0;if(e>>>0>=(E[151]|0)>>>0){U=r;y=e;break}Pe()}while(0);E[U>>2]=d;E[y+12>>2]=d;E[N+(_+8)>>2]=y;E[N+(_+12)>>2]=n;break}r=t>>>8;do if(!r)n=0;else{if(t>>>0>16777215){n=31;break}U=(r+1048320|0)>>>16&8;y=r<<U;g=(y+520192|0)>>>16&4;y=y<<g;n=(y+245760|0)>>>16&2;n=14-(g|U|n)+(y<<n>>>15)|0;n=t>>>(n+7|0)&1|n<<1}while(0);r=892+(n<<2)|0;E[N+(_+28)>>2]=n;E[N+(_+20)>>2]=0;E[N+(_+16)>>2]=0;e=E[148]|0;i=1<<n;if(!(e&i)){E[148]=e|i;E[r>>2]=d; -E[N+(_+24)>>2]=r;E[N+(_+12)>>2]=d;E[N+(_+8)>>2]=d;break}r=E[r>>2]|0;i:do if((E[r+4>>2]&-8|0)!=(t|0)){n=t<<((n|0)==31?0:25-(n>>>1)|0);while(1){e=r+16+(n>>>31<<2)|0;i=E[e>>2]|0;if(!i)break;if((E[i+4>>2]&-8|0)==(t|0)){D=i;break i}else{n=n<<1;r=i}}if(e>>>0<(E[151]|0)>>>0)Pe();else{E[e>>2]=d;E[N+(_+24)>>2]=r;E[N+(_+12)>>2]=d;E[N+(_+8)>>2]=d;break r}}else D=r;while(0);r=D+8|0;e=E[r>>2]|0;y=E[151]|0;if(e>>>0>=y>>>0&D>>>0>=y>>>0){E[e+12>>2]=d;E[r>>2]=d;E[N+(_+8)>>2]=e;E[N+(_+12)>>2]=D;E[N+(_+24)>>2]=0;break}else Pe()}else{D=(E[150]|0)+f|0;E[150]=D;E[153]=d;E[N+(_+4)>>2]=D|1}while(0);D=N+(c|8)|0;return D|0}else i=1036;while(1){e=E[i>>2]|0;if(e>>>0<=a>>>0?(r=E[i+4>>2]|0,n=e+r|0,n>>>0>a>>>0):0)break;i=E[i+8>>2]|0}t=e+(r+-39)|0;e=e+(r+-47+((t&7|0)==0?0:0-t&7))|0;t=a+16|0;e=e>>>0<t>>>0?a:e;r=e+8|0;i=N+8|0;i=(i&7|0)==0?0:0-i&7;D=A+-40-i|0;E[153]=N+i;E[150]=D;E[N+(i+4)>>2]=D|1;E[N+(A+-36)>>2]=40;E[154]=E[269];i=e+4|0;E[i>>2]=27;E[r>>2]=E[259];E[r+4>>2]=E[260];E[r+8>>2]=E[261];E[r+12>>2]=E[262];E[259]=N;E[260]=A;E[262]=0;E[261]=r;r=e+28|0;E[r>>2]=7;if((e+32|0)>>>0<n>>>0)do{D=r;r=r+4|0;E[r>>2]=7}while((D+8|0)>>>0<n>>>0);if((e|0)!=(a|0)){o=e-a|0;E[i>>2]=E[i>>2]&-2;E[a+4>>2]=o|1;E[e>>2]=o;r=o>>>3;if(o>>>0<256){e=r<<1;n=628+(e<<2)|0;i=E[147]|0;r=1<<r;if(i&r){r=628+(e+2<<2)|0;e=E[r>>2]|0;if(e>>>0<(E[151]|0)>>>0)Pe();else{B=r;k=e}}else{E[147]=i|r;B=628+(e+2<<2)|0;k=n}E[B>>2]=a;E[k+12>>2]=a;E[a+8>>2]=k;E[a+12>>2]=n;break}r=o>>>8;if(r)if(o>>>0>16777215)n=31;else{y=(r+1048320|0)>>>16&8;D=r<<y;U=(D+520192|0)>>>16&4;D=D<<U;n=(D+245760|0)>>>16&2;n=14-(U|y|n)+(D<<n>>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;i=892+(n<<2)|0;E[a+28>>2]=n;E[a+20>>2]=0;E[t>>2]=0;r=E[148]|0;e=1<<n;if(!(r&e)){E[148]=r|e;E[i>>2]=a;E[a+24>>2]=i;E[a+12>>2]=a;E[a+8>>2]=a;break}r=E[i>>2]|0;r:do if((E[r+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){e=r+16+(n>>>31<<2)|0;i=E[e>>2]|0;if(!i)break;if((E[i+4>>2]&-8|0)==(o|0)){F=i;break r}else{n=n<<1;r=i}}if(e>>>0<(E[151]|0)>>>0)Pe();else{E[e>>2]=a;E[a+24>>2]=r;E[a+12>>2]=a;E[a+8>>2]=a;break e}}else F=r;while(0);r=F+8|0;e=E[r>>2]|0;D=E[151]|0;if(e>>>0>=D>>>0&F>>>0>=D>>>0){E[e+12>>2]=a;E[r>>2]=a;E[a+8>>2]=e;E[a+12>>2]=F;E[a+24>>2]=0;break}else Pe()}}else{D=E[151]|0;if((D|0)==0|N>>>0<D>>>0)E[151]=N;E[259]=N;E[260]=A;E[262]=0;E[156]=E[265];E[155]=-1;r=0;do{D=r<<1;y=628+(D<<2)|0;E[628+(D+3<<2)>>2]=y;E[628+(D+2<<2)>>2]=y;r=r+1|0}while((r|0)!=32);D=N+8|0;D=(D&7|0)==0?0:0-D&7;y=A+-40-D|0;E[153]=N+D;E[150]=y;E[N+(D+4)>>2]=y|1;E[N+(A+-36)>>2]=40;E[154]=E[269]}while(0);r=E[150]|0;if(r>>>0>T>>>0){y=r-T|0;E[150]=y;D=E[153]|0;E[153]=D+T;E[D+(T+4)>>2]=y|1;E[D+4>>2]=T|3;D=D+8|0;return D|0}}D=si()|0;E[D>>2]=12;D=0;return D|0}function Gi(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,A=0,T=0,R=0,M=0,m=0,S=0;if(!e)return;r=e+-8|0;u=E[151]|0;if(r>>>0<u>>>0)Pe();i=E[e+-4>>2]|0;n=i&3;if((n|0)==1)Pe();d=i&-8;T=e+(d+-8)|0;do if(!(i&1)){r=E[r>>2]|0;if(!n)return;s=-8-r|0;f=e+s|0;_=r+d|0;if(f>>>0<u>>>0)Pe();if((f|0)==(E[152]|0)){r=e+(d+-4)|0;i=E[r>>2]|0;if((i&3|0)!=3){S=f;o=_;break}E[149]=_;E[r>>2]=i&-2;E[e+(s+4)>>2]=_|1;E[T>>2]=_;return}t=r>>>3;if(r>>>0<256){n=E[e+(s+8)>>2]|0;i=E[e+(s+12)>>2]|0;r=628+(t<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<u>>>0)Pe();if((E[n+12>>2]|0)!=(f|0))Pe()}if((i|0)==(n|0)){E[147]=E[147]&~(1<<t);S=f;o=_;break}if((i|0)!=(r|0)){if(i>>>0<u>>>0)Pe();r=i+8|0;if((E[r>>2]|0)==(f|0))a=r;else Pe()}else a=i+8|0;E[n+12>>2]=i;E[a>>2]=n;S=f;o=_;break}a=E[e+(s+24)>>2]|0;n=E[e+(s+12)>>2]|0;do if((n|0)==(f|0)){i=e+(s+20)|0;r=E[i>>2]|0;if(!r){i=e+(s+16)|0;r=E[i>>2]|0;if(!r){l=0;break}}while(1){n=r+20|0;t=E[n>>2]|0;if(t){r=t;i=n;continue}n=r+16|0;t=E[n>>2]|0;if(!t)break;else{r=t;i=n}}if(i>>>0<u>>>0)Pe();else{E[i>>2]=0;l=r;break}}else{t=E[e+(s+8)>>2]|0;if(t>>>0<u>>>0)Pe();r=t+12|0;if((E[r>>2]|0)!=(f|0))Pe();i=n+8|0;if((E[i>>2]|0)==(f|0)){E[r>>2]=n;E[i>>2]=t;l=n;break}else Pe()}while(0);if(a){r=E[e+(s+28)>>2]|0;i=892+(r<<2)|0;if((f|0)==(E[i>>2]|0)){E[i>>2]=l;if(!l){E[148]=E[148]&~(1<<r);S=f;o=_;break}}else{if(a>>>0<(E[151]|0)>>>0)Pe();r=a+16|0;if((E[r>>2]|0)==(f|0))E[r>>2]=l;else E[a+20>>2]=l;if(!l){S=f;o=_;break}}i=E[151]|0;if(l>>>0<i>>>0)Pe();E[l+24>>2]=a;r=E[e+(s+16)>>2]|0;do if(r)if(r>>>0<i>>>0)Pe();else{E[l+16>>2]=r;E[r+24>>2]=l;break}while(0);r=E[e+(s+20)>>2]|0;if(r)if(r>>>0<(E[151]|0)>>>0)Pe();else{E[l+20>>2]=r;E[r+24>>2]=l;S=f;o=_;break}else{S=f;o=_}}else{S=f;o=_}}else{S=r;o=d}while(0);if(S>>>0>=T>>>0)Pe();r=e+(d+-4)|0;i=E[r>>2]|0;if(!(i&1))Pe();if(!(i&2)){if((T|0)==(E[153]|0)){m=(E[150]|0)+o|0;E[150]=m;E[153]=S;E[S+4>>2]=m|1;if((S|0)!=(E[152]|0))return;E[152]=0;E[149]=0;return}if((T|0)==(E[152]|0)){m=(E[149]|0)+o|0;E[149]=m;E[152]=S;E[S+4>>2]=m|1;E[S+m>>2]=m;return}o=(i&-8)+o|0;t=i>>>3;do if(i>>>0>=256){a=E[e+(d+16)>>2]|0;r=E[e+(d|4)>>2]|0;do if((r|0)==(T|0)){i=e+(d+12)|0;r=E[i>>2]|0;if(!r){i=e+(d+8)|0;r=E[i>>2]|0;if(!r){A=0;break}}while(1){n=r+20|0;t=E[n>>2]|0;if(t){r=t;i=n;continue}n=r+16|0;t=E[n>>2]|0;if(!t)break;else{r=t;i=n}}if(i>>>0<(E[151]|0)>>>0)Pe();else{E[i>>2]=0;A=r;break}}else{i=E[e+d>>2]|0;if(i>>>0<(E[151]|0)>>>0)Pe();n=i+12|0;if((E[n>>2]|0)!=(T|0))Pe();t=r+8|0;if((E[t>>2]|0)==(T|0)){E[n>>2]=r;E[t>>2]=i;A=r;break}else Pe()}while(0);if(a){r=E[e+(d+20)>>2]|0;i=892+(r<<2)|0;if((T|0)==(E[i>>2]|0)){E[i>>2]=A;if(!A){E[148]=E[148]&~(1<<r);break}}else{if(a>>>0<(E[151]|0)>>>0)Pe();r=a+16|0;if((E[r>>2]|0)==(T|0))E[r>>2]=A;else E[a+20>>2]=A;if(!A)break}i=E[151]|0;if(A>>>0<i>>>0)Pe();E[A+24>>2]=a;r=E[e+(d+8)>>2]|0;do if(r)if(r>>>0<i>>>0)Pe();else{E[A+16>>2]=r;E[r+24>>2]=A;break}while(0);r=E[e+(d+12)>>2]|0;if(r)if(r>>>0<(E[151]|0)>>>0)Pe();else{E[A+20>>2]=r;E[r+24>>2]=A;break}}}else{n=E[e+d>>2]|0;i=E[e+(d|4)>>2]|0;r=628+(t<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<(E[151]|0)>>>0)Pe();if((E[n+12>>2]|0)!=(T|0))Pe()}if((i|0)==(n|0)){E[147]=E[147]&~(1<<t);break}if((i|0)!=(r|0)){if(i>>>0<(E[151]|0)>>>0)Pe();r=i+8|0;if((E[r>>2]|0)==(T|0))c=r;else Pe()}else c=i+8|0;E[n+12>>2]=i;E[c>>2]=n}while(0);E[S+4>>2]=o|1;E[S+o>>2]=o;if((S|0)==(E[152]|0)){E[149]=o;return}}else{E[r>>2]=i&-2;E[S+4>>2]=o|1;E[S+o>>2]=o}r=o>>>3;if(o>>>0<256){i=r<<1;t=628+(i<<2)|0;n=E[147]|0;r=1<<r;if(n&r){r=628+(i+2<<2)|0;i=E[r>>2]|0;if(i>>>0<(E[151]|0)>>>0)Pe();else{R=r;M=i}}else{E[147]=n|r;R=628+(i+2<<2)|0;M=t}E[R>>2]=S;E[M+12>>2]=S;E[S+8>>2]=M;E[S+12>>2]=t;return}r=o>>>8;if(r)if(o>>>0>16777215)t=31;else{R=(r+1048320|0)>>>16&8;M=r<<R;T=(M+520192|0)>>>16&4;M=M<<T;t=(M+245760|0)>>>16&2;t=14-(T|R|t)+(M<<t>>>15)|0;t=o>>>(t+7|0)&1|t<<1}else t=0;r=892+(t<<2)|0;E[S+28>>2]=t;E[S+20>>2]=0;E[S+16>>2]=0;i=E[148]|0;n=1<<t;e:do if(i&n){r=E[r>>2]|0;r:do if((E[r+4>>2]&-8|0)!=(o|0)){t=o<<((t|0)==31?0:25-(t>>>1)|0);while(1){i=r+16+(t>>>31<<2)|0;n=E[i>>2]|0;if(!n)break;if((E[n+4>>2]&-8|0)==(o|0)){m=n;break r}else{t=t<<1;r=n}}if(i>>>0<(E[151]|0)>>>0)Pe();else{E[i>>2]=S;E[S+24>>2]=r;E[S+12>>2]=S;E[S+8>>2]=S;break e}}else m=r;while(0);r=m+8|0;i=E[r>>2]|0;M=E[151]|0;if(i>>>0>=M>>>0&m>>>0>=M>>>0){E[i+12>>2]=S;E[r>>2]=S;E[S+8>>2]=i;E[S+12>>2]=m;E[S+24>>2]=0;break}else Pe()}else{E[148]=i|n;E[r>>2]=S;E[S+24>>2]=r;E[S+12>>2]=S;E[S+8>>2]=S}while(0);S=(E[155]|0)+-1|0;E[155]=S;if(!S)r=1044;else return;while(1){r=E[r>>2]|0;if(!r)break;else r=r+8|0}E[155]=-1;return}function Xi(e,r){e=e|0;r=r|0;var i=0,n=0;if(!e){e=Hi(r)|0;return e|0}if(r>>>0>4294967231){e=si()|0;E[e>>2]=12;e=0;return e|0}i=Yi(e+-8|0,r>>>0<11?16:r+11&-8)|0;if(i){e=i+8|0;return e|0}i=Hi(r)|0;if(!i){e=0;return e|0}n=E[e+-4>>2]|0;n=(n&-8)-((n&3|0)==0?8:4)|0;Ji(i|0,e|0,(n>>>0<r>>>0?n:r)|0)|0;Gi(e);e=i;return e|0}function Vi(e){e=e|0;var r=0;if(!e){r=0;return r|0}e=E[e+-4>>2]|0;r=e&3;if((r|0)==1){r=0;return r|0}r=(e&-8)-((r|0)==0?8:4)|0;return r|0}function Yi(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,A=0;d=e+4|0;A=E[d>>2]|0;s=A&-8;f=e+s|0;u=E[151]|0;i=A&3;if(!((i|0)!=1&e>>>0>=u>>>0&e>>>0<f>>>0))Pe();n=e+(s|4)|0;t=E[n>>2]|0;if(!(t&1))Pe();if(!i){if(r>>>0<256){e=0;return e|0}if(s>>>0>=(r+4|0)>>>0?(s-r|0)>>>0<=E[267]<<1>>>0:0)return e|0;e=0;return e|0}if(s>>>0>=r>>>0){i=s-r|0;if(i>>>0<=15)return e|0;E[d>>2]=A&1|r|2;E[e+(r+4)>>2]=i|3;E[n>>2]=E[n>>2]|1;xi(e+r|0,i);return e|0}if((f|0)==(E[153]|0)){i=(E[150]|0)+s|0;if(i>>>0<=r>>>0){e=0;return e|0}c=i-r|0;E[d>>2]=A&1|r|2;E[e+(r+4)>>2]=c|1;E[153]=e+r;E[150]=c;return e|0}if((f|0)==(E[152]|0)){n=(E[149]|0)+s|0;if(n>>>0<r>>>0){e=0;return e|0}i=n-r|0;if(i>>>0>15){E[d>>2]=A&1|r|2;E[e+(r+4)>>2]=i|1;E[e+n>>2]=i;n=e+(n+4)|0;E[n>>2]=E[n>>2]&-2;n=e+r|0}else{E[d>>2]=A&1|n|2;n=e+(n+4)|0;E[n>>2]=E[n>>2]|1;n=0;i=0}E[149]=i;E[152]=n;return e|0}if(t&2){e=0;return e|0}_=(t&-8)+s|0;if(_>>>0<r>>>0){e=0;return e|0}c=_-r|0;o=t>>>3;do if(t>>>0>=256){a=E[e+(s+24)>>2]|0;o=E[e+(s+12)>>2]|0;do if((o|0)==(f|0)){n=e+(s+20)|0;i=E[n>>2]|0;if(!i){n=e+(s+16)|0;i=E[n>>2]|0;if(!i){l=0;break}}while(1){t=i+20|0;o=E[t>>2]|0;if(o){i=o;n=t;continue}t=i+16|0;o=E[t>>2]|0;if(!o)break;else{i=o;n=t}}if(n>>>0<u>>>0)Pe();else{E[n>>2]=0;l=i;break}}else{t=E[e+(s+8)>>2]|0;if(t>>>0<u>>>0)Pe();i=t+12|0;if((E[i>>2]|0)!=(f|0))Pe();n=o+8|0;if((E[n>>2]|0)==(f|0)){E[i>>2]=o;E[n>>2]=t;l=o;break}else Pe()}while(0);if(a){i=E[e+(s+28)>>2]|0;n=892+(i<<2)|0;if((f|0)==(E[n>>2]|0)){E[n>>2]=l;if(!l){E[148]=E[148]&~(1<<i);break}}else{if(a>>>0<(E[151]|0)>>>0)Pe();i=a+16|0;if((E[i>>2]|0)==(f|0))E[i>>2]=l;else E[a+20>>2]=l;if(!l)break}n=E[151]|0;if(l>>>0<n>>>0)Pe();E[l+24>>2]=a;i=E[e+(s+16)>>2]|0;do if(i)if(i>>>0<n>>>0)Pe();else{E[l+16>>2]=i;E[i+24>>2]=l;break}while(0);i=E[e+(s+20)>>2]|0;if(i)if(i>>>0<(E[151]|0)>>>0)Pe();else{E[l+20>>2]=i;E[i+24>>2]=l;break}}}else{t=E[e+(s+8)>>2]|0;n=E[e+(s+12)>>2]|0;i=628+(o<<1<<2)|0;if((t|0)!=(i|0)){if(t>>>0<u>>>0)Pe();if((E[t+12>>2]|0)!=(f|0))Pe()}if((n|0)==(t|0)){E[147]=E[147]&~(1<<o);break}if((n|0)!=(i|0)){if(n>>>0<u>>>0)Pe();i=n+8|0;if((E[i>>2]|0)==(f|0))a=i;else Pe()}else a=n+8|0;E[t+12>>2]=n;E[a>>2]=t}while(0);if(c>>>0<16){E[d>>2]=_|A&1|2;r=e+(_|4)|0;E[r>>2]=E[r>>2]|1;return e|0}else{E[d>>2]=A&1|r|2;E[e+(r+4)>>2]=c|3;A=e+(_|4)|0;E[A>>2]=E[A>>2]|1;xi(e+r|0,c);return e|0}return 0}function xi(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,A=0,T=0,R=0,M=0,m=0;T=e+r|0;i=E[e+4>>2]|0;do if(!(i&1)){l=E[e>>2]|0;if(!(i&3))return;c=e+(0-l)|0;_=l+r|0;s=E[151]|0;if(c>>>0<s>>>0)Pe();if((c|0)==(E[152]|0)){n=e+(r+4)|0;i=E[n>>2]|0;if((i&3|0)!=3){m=c;a=_;break}E[149]=_;E[n>>2]=i&-2;E[e+(4-l)>>2]=_|1;E[T>>2]=_;return}o=l>>>3;if(l>>>0<256){t=E[e+(8-l)>>2]|0;n=E[e+(12-l)>>2]|0;i=628+(o<<1<<2)|0;if((t|0)!=(i|0)){if(t>>>0<s>>>0)Pe();if((E[t+12>>2]|0)!=(c|0))Pe()}if((n|0)==(t|0)){E[147]=E[147]&~(1<<o);m=c;a=_;break}if((n|0)!=(i|0)){if(n>>>0<s>>>0)Pe();i=n+8|0;if((E[i>>2]|0)==(c|0))u=i;else Pe()}else u=n+8|0;E[t+12>>2]=n;E[u>>2]=t;m=c;a=_;break}u=E[e+(24-l)>>2]|0;t=E[e+(12-l)>>2]|0;do if((t|0)==(c|0)){t=16-l|0;n=e+(t+4)|0;i=E[n>>2]|0;if(!i){n=e+t|0;i=E[n>>2]|0;if(!i){f=0;break}}while(1){t=i+20|0;o=E[t>>2]|0;if(o){i=o;n=t;continue}t=i+16|0;o=E[t>>2]|0;if(!o)break;else{i=o;n=t}}if(n>>>0<s>>>0)Pe();else{E[n>>2]=0;f=i;break}}else{o=E[e+(8-l)>>2]|0;if(o>>>0<s>>>0)Pe();i=o+12|0;if((E[i>>2]|0)!=(c|0))Pe();n=t+8|0;if((E[n>>2]|0)==(c|0)){E[i>>2]=t;E[n>>2]=o;f=t;break}else Pe()}while(0);if(u){i=E[e+(28-l)>>2]|0;n=892+(i<<2)|0;if((c|0)==(E[n>>2]|0)){E[n>>2]=f;if(!f){E[148]=E[148]&~(1<<i);m=c;a=_;break}}else{if(u>>>0<(E[151]|0)>>>0)Pe();i=u+16|0;if((E[i>>2]|0)==(c|0))E[i>>2]=f;else E[u+20>>2]=f;if(!f){m=c;a=_;break}}t=E[151]|0;if(f>>>0<t>>>0)Pe();E[f+24>>2]=u;i=16-l|0;n=E[e+i>>2]|0;do if(n)if(n>>>0<t>>>0)Pe();else{E[f+16>>2]=n;E[n+24>>2]=f;break}while(0);i=E[e+(i+4)>>2]|0;if(i)if(i>>>0<(E[151]|0)>>>0)Pe();else{E[f+20>>2]=i;E[i+24>>2]=f;m=c;a=_;break}else{m=c;a=_}}else{m=c;a=_}}else{m=e;a=r}while(0);s=E[151]|0;if(T>>>0<s>>>0)Pe();i=e+(r+4)|0;n=E[i>>2]|0;if(!(n&2)){if((T|0)==(E[153]|0)){M=(E[150]|0)+a|0;E[150]=M;E[153]=m;E[m+4>>2]=M|1;if((m|0)!=(E[152]|0))return;E[152]=0;E[149]=0;return}if((T|0)==(E[152]|0)){M=(E[149]|0)+a|0;E[149]=M;E[152]=m;E[m+4>>2]=M|1;E[m+M>>2]=M;return}a=(n&-8)+a|0;o=n>>>3;do if(n>>>0>=256){u=E[e+(r+24)>>2]|0;t=E[e+(r+12)>>2]|0;do if((t|0)==(T|0)){n=e+(r+20)|0;i=E[n>>2]|0;if(!i){n=e+(r+16)|0;i=E[n>>2]|0;if(!i){A=0;break}}while(1){t=i+20|0;o=E[t>>2]|0;if(o){i=o;n=t;continue}t=i+16|0;o=E[t>>2]|0;if(!o)break;else{i=o;n=t}}if(n>>>0<s>>>0)Pe();else{E[n>>2]=0;A=i;break}}else{o=E[e+(r+8)>>2]|0;if(o>>>0<s>>>0)Pe();i=o+12|0;if((E[i>>2]|0)!=(T|0))Pe();n=t+8|0;if((E[n>>2]|0)==(T|0)){E[i>>2]=t;E[n>>2]=o;A=t;break}else Pe()}while(0);if(u){i=E[e+(r+28)>>2]|0;n=892+(i<<2)|0;if((T|0)==(E[n>>2]|0)){E[n>>2]=A;if(!A){E[148]=E[148]&~(1<<i);break}}else{if(u>>>0<(E[151]|0)>>>0)Pe();i=u+16|0;if((E[i>>2]|0)==(T|0))E[i>>2]=A;else E[u+20>>2]=A;if(!A)break}n=E[151]|0;if(A>>>0<n>>>0)Pe();E[A+24>>2]=u;i=E[e+(r+16)>>2]|0;do if(i)if(i>>>0<n>>>0)Pe();else{E[A+16>>2]=i;E[i+24>>2]=A;break}while(0);i=E[e+(r+20)>>2]|0;if(i)if(i>>>0<(E[151]|0)>>>0)Pe();else{E[A+20>>2]=i;E[i+24>>2]=A;break}}}else{t=E[e+(r+8)>>2]|0;n=E[e+(r+12)>>2]|0;i=628+(o<<1<<2)|0;if((t|0)!=(i|0)){if(t>>>0<s>>>0)Pe();if((E[t+12>>2]|0)!=(T|0))Pe()}if((n|0)==(t|0)){E[147]=E[147]&~(1<<o);break}if((n|0)!=(i|0)){if(n>>>0<s>>>0)Pe();i=n+8|0;if((E[i>>2]|0)==(T|0))d=i;else Pe()}else d=n+8|0;E[t+12>>2]=n;E[d>>2]=t}while(0);E[m+4>>2]=a|1;E[m+a>>2]=a;if((m|0)==(E[152]|0)){E[149]=a;return}}else{E[i>>2]=n&-2;E[m+4>>2]=a|1;E[m+a>>2]=a}i=a>>>3;if(a>>>0<256){n=i<<1;o=628+(n<<2)|0;t=E[147]|0;i=1<<i;if(t&i){i=628+(n+2<<2)|0;n=E[i>>2]|0;if(n>>>0<(E[151]|0)>>>0)Pe();else{R=i;M=n}}else{E[147]=t|i;R=628+(n+2<<2)|0;M=o}E[R>>2]=m;E[M+12>>2]=m;E[m+8>>2]=M;E[m+12>>2]=o;return}i=a>>>8;if(i)if(a>>>0>16777215)o=31;else{R=(i+1048320|0)>>>16&8;M=i<<R;T=(M+520192|0)>>>16&4;M=M<<T;o=(M+245760|0)>>>16&2;o=14-(T|R|o)+(M<<o>>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;i=892+(o<<2)|0;E[m+28>>2]=o;E[m+20>>2]=0;E[m+16>>2]=0;n=E[148]|0;t=1<<o;if(!(n&t)){E[148]=n|t;E[i>>2]=m;E[m+24>>2]=i;E[m+12>>2]=m;E[m+8>>2]=m;return}i=E[i>>2]|0;e:do if((E[i+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){n=i+16+(o>>>31<<2)|0;t=E[n>>2]|0;if(!t)break;if((E[t+4>>2]&-8|0)==(a|0)){i=t;break e}else{o=o<<1;i=t}}if(n>>>0<(E[151]|0)>>>0)Pe();E[n>>2]=m;E[m+24>>2]=i;E[m+12>>2]=m;E[m+8>>2]=m;return}while(0);n=i+8|0;t=E[n>>2]|0;M=E[151]|0;if(!(t>>>0>=M>>>0&i>>>0>=M>>>0))Pe();E[t+12>>2]=m;E[n>>2]=m;E[m+8>>2]=t;E[m+12>>2]=i;E[m+24>>2]=0;return}function Ki(){}function Wi(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;n=r-n-(i>>>0>e>>>0|0)>>>0;return(G=n,e-i>>>0|0)|0}function zi(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;i=e+i>>>0;return(G=r+n+(i>>>0<e>>>0|0)>>>0,i|0)|0}function qi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0;n=e+i|0;if((i|0)>=20){r=r&255;o=e&3;a=r|r<<8|r<<16|r<<24;t=n&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){_[e>>0]=r;e=e+1|0}}while((e|0)<(t|0)){E[e>>2]=a;e=e+4|0}}while((e|0)<(n|0)){_[e>>0]=r;e=e+1|0}return e-i|0}function ji(e,r,i){e=e|0;r=r|0;i=i|0;if((i|0)<32){G=r>>>i;return e>>>i|(r&(1<<i)-1)<<32-i}G=0;return r>>>i-32|0}function Zi(e,r,i){e=e|0;r=r|0;i=i|0;if((i|0)<32){G=r<<i|(e&(1<<i)-1<<32-i)>>>32-i;return e<<i}G=e<<i-32;return 0}function Ji(e,r,i){e=e|0;r=r|0;i=i|0;var n=0;if((i|0)>=4096)return Ue(e|0,r|0,i|0)|0;n=e|0;if((e&3)==(r&3)){while(e&3){if(!i)return n|0;_[e>>0]=_[r>>0]|0;e=e+1|0;r=r+1|0;i=i-1|0}while((i|0)>=4){E[e>>2]=E[r>>2];e=e+4|0;r=r+4|0;i=i-4|0}}while((i|0)>0){_[e>>0]=_[r>>0]|0;e=e+1|0;r=r+1|0;i=i-1|0}return n|0}function Qi(e,r,i){e=e|0;r=r|0;i=i|0;if((i|0)<32){G=r>>i;return e>>>i|(r&(1<<i)-1)<<32-i}G=(r|0)<0?-1:0;return r>>i-32|0}function $i(e){e=e|0;var r=0;r=_[p+(e&255)>>0]|0;if((r|0)<8)return r|0;r=_[p+(e>>8&255)>>0]|0;if((r|0)<8)return r+8|0;r=_[p+(e>>16&255)>>0]|0;if((r|0)<8)return r+16|0;return(_[p+(e>>>24)>>0]|0)+24|0}function en(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0;o=e&65535;t=r&65535;i=fe(t,o)|0;n=e>>>16;e=(i>>>16)+(fe(t,n)|0)|0;t=r>>>16;r=fe(t,o)|0;return(G=(e>>>16)+(fe(t,n)|0)+(((e&65535)+r|0)>>>16)|0,e+r<<16|i&65535|0)|0}function rn(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0,u=0,s=0,l=0;l=r>>31|((r|0)<0?-1:0)<<1;s=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1;o=n>>31|((n|0)<0?-1:0)<<1;t=((n|0)<0?-1:0)>>31|((n|0)<0?-1:0)<<1;u=Wi(l^e,s^r,l,s)|0;a=G;e=o^l;r=t^s;return Wi((un(u,a,Wi(o^i,t^n,o,t)|0,G,0)|0)^e,G^r,e,r)|0}function nn(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0,u=0,s=0,l=0;t=S;S=S+16|0;u=t|0;a=r>>31|((r|0)<0?-1:0)<<1;o=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1;l=n>>31|((n|0)<0?-1:0)<<1;s=((n|0)<0?-1:0)>>31|((n|0)<0?-1:0)<<1;e=Wi(a^e,o^r,a,o)|0;r=G;un(e,r,Wi(l^i,s^n,l,s)|0,G,u)|0;n=Wi(E[u>>2]^a,E[u+4>>2]^o,a,o)|0;i=G;S=t;return(G=i,n)|0}function tn(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0;t=e;o=i;i=en(t,o)|0;e=G;return(G=(fe(r,o)|0)+(fe(n,t)|0)+e|e&0,i|0|0)|0}function on(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;return un(e,r,i,n,0)|0}function an(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0;o=S;S=S+16|0;t=o|0;un(e,r,i,n,t)|0;S=o;return(G=E[t+4>>2]|0,E[t>>2]|0)|0}function un(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,A=0;f=e;s=r;l=s;a=i;c=n;u=c;if(!l){o=(t|0)!=0;if(!u){if(o){E[t>>2]=(f>>>0)%(a>>>0);E[t+4>>2]=0}c=0;t=(f>>>0)/(a>>>0)>>>0;return(G=c,t)|0}else{if(!o){c=0;t=0;return(G=c,t)|0}E[t>>2]=e|0;E[t+4>>2]=r&0;c=0;t=0;return(G=c,t)|0}}o=(u|0)==0;do if(a){if(!o){o=(ce(u|0)|0)-(ce(l|0)|0)|0;if(o>>>0<=31){_=o+1|0;u=31-o|0;r=o-31>>31;a=_;e=f>>>(_>>>0)&r|l<<u;r=l>>>(_>>>0)&r;o=0;u=f<<u;break}if(!t){c=0;t=0;return(G=c,t)|0}E[t>>2]=e|0;E[t+4>>2]=s|r&0;c=0;t=0;return(G=c,t)|0}o=a-1|0;if(o&a){u=(ce(a|0)|0)+33-(ce(l|0)|0)|0;A=64-u|0;_=32-u|0;s=_>>31;d=u-32|0;r=d>>31;a=u;e=_-1>>31&l>>>(d>>>0)|(l<<_|f>>>(u>>>0))&r;r=r&l>>>(u>>>0);o=f<<A&s;u=(l<<A|f>>>(d>>>0))&s|f<<_&u-33>>31;break}if(t){E[t>>2]=o&f;E[t+4>>2]=0}if((a|0)==1){d=s|r&0;A=e|0|0;return(G=d,A)|0}else{A=$i(a|0)|0;d=l>>>(A>>>0)|0;A=l<<32-A|f>>>(A>>>0)|0;return(G=d,A)|0}}else{if(o){if(t){E[t>>2]=(l>>>0)%(a>>>0);E[t+4>>2]=0}d=0;A=(l>>>0)/(a>>>0)>>>0;return(G=d,A)|0}if(!f){if(t){E[t>>2]=0;E[t+4>>2]=(l>>>0)%(u>>>0)}d=0;A=(l>>>0)/(u>>>0)>>>0;return(G=d,A)|0}o=u-1|0;if(!(o&u)){if(t){E[t>>2]=e|0;E[t+4>>2]=o&l|r&0}d=0;A=l>>>(($i(u|0)|0)>>>0);return(G=d,A)|0}o=(ce(u|0)|0)-(ce(l|0)|0)|0;if(o>>>0<=30){r=o+1|0;u=31-o|0;a=r;e=l<<u|f>>>(r>>>0);r=l>>>(r>>>0);o=0;u=f<<u;break}if(!t){d=0;A=0;return(G=d,A)|0}E[t>>2]=e|0;E[t+4>>2]=s|r&0;d=0;A=0;return(G=d,A)|0}while(0);if(!a){l=u;s=0;u=0}else{_=i|0|0;f=c|n&0;l=zi(_|0,f|0,-1,-1)|0;i=G;s=u;u=0;do{n=s;s=o>>>31|s<<1;o=u|o<<1;n=e<<1|n>>>31|0;c=e>>>31|r<<1|0;Wi(l,i,n,c)|0;A=G;d=A>>31|((A|0)<0?-1:0)<<1;u=d&1;e=Wi(n,c,d&_,(((A|0)<0?-1:0)>>31|((A|0)<0?-1:0)<<1)&f)|0;r=G;a=a-1|0}while((a|0)!=0);l=s;s=0}a=0;if(t){E[t>>2]=e;E[t+4>>2]=r}d=(o|0)>>>31|(l|a)<<1|(a<<1|o>>>31)&0|s;A=(o<<1|0>>>31)&-2|u;return(G=d,A)|0}function sn(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;return pn[e&7](r|0,i|0,n|0)|0}function ln(e,r,i,n,t,o){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;wn[e&3](r|0,i|0,n|0,t|0,o|0)}function fn(e,r){e=e|0;r=r|0;bn[e&7](r|0)}function _n(e,r){e=e|0;r=r|0;return In[e&1](r|0)|0}function cn(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;On[e&0](r|0,i|0,n|0)}function En(e){e=e|0;Pn[e&3]()}function dn(e,r,i,n,t,o,a){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;a=a|0;vn[e&3](r|0,i|0,n|0,t|0,o|0,a|0)}function An(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;Ln[e&3](r|0,i|0,n|0,t|0)}function Tn(e,r,i){e=e|0;r=r|0;i=i|0;Ee(0);return 0}function Rn(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;Ee(1)}function Mn(e){e=e|0;Ee(2)}function mn(e){e=e|0;Ee(3);return 0}function Sn(e,r,i){e=e|0;r=r|0;i=i|0;Ee(4)}function hn(){Ee(5)}function Nn(e,r,i,n,t,o){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;Ee(6)}function Cn(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;Ee(7)}var pn=[Tn,Wr,gi,Oi,Ii,Pi,Tn,Tn];var wn=[Rn,$r,Qr,Rn];var bn=[Mn,Xr,xr,Vr,Yr,Kr,ai,Fi];var In=[mn,bi];var On=[Sn];var Pn=[hn,ti,oi,hn];var vn=[Nn,ri,ei,Nn];var Ln=[Cn,qr,jr,Cn];return{___cxa_can_catch:ii,_crn_get_levels:Sr,_crn_get_uncompressed_size:Cr,_crn_decompress:pr,_i64Add:zi,_crn_get_width:Mr,___cxa_is_pointer_type:ni,_crn_get_bytes_per_block:Nr,_memset:qi,_malloc:Hi,_memcpy:Ji,_i64Subtract:Wi,_bitshift64Lshr:ji,_free:Gi,_bitshift64Shl:Zi,_crn_get_height:mr,_crn_get_dxt_format:hr,runPostSets:Ki,_emscripten_replace_memory:Ke,stackAlloc:We,stackSave:ze,stackRestore:qe,establishStackSpace:je,setThrew:Ze,setTempRet0:$e,getTempRet0:er,dynCall_iiii:sn,dynCall_viiiii:ln,dynCall_vi:fn,dynCall_ii:_n,dynCall_viii:cn,dynCall_v:En,dynCall_viiiiii:dn,dynCall_viiii:An}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),___cxa_can_catch=Module.___cxa_can_catch=asm.___cxa_can_catch,_crn_get_levels=Module._crn_get_levels=asm._crn_get_levels,runPostSets=Module.runPostSets=asm.runPostSets,_crn_get_uncompressed_size=Module._crn_get_uncompressed_size=asm._crn_get_uncompressed_size,_crn_decompress=Module._crn_decompress=asm._crn_decompress,_i64Add=Module._i64Add=asm._i64Add,_crn_get_height=Module._crn_get_height=asm._crn_get_height,___cxa_is_pointer_type=Module.___cxa_is_pointer_type=asm.___cxa_is_pointer_type,_crn_get_bytes_per_block=Module._crn_get_bytes_per_block=asm._crn_get_bytes_per_block,_memset=Module._memset=asm._memset,_malloc=Module._malloc=asm._malloc,_memcpy=Module._memcpy=asm._memcpy,_emscripten_replace_memory=Module._emscripten_replace_memory=asm._emscripten_replace_memory,_i64Subtract=Module._i64Subtract=asm._i64Subtract,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_free=Module._free=asm._free,_crn_get_dxt_format=Module._crn_get_dxt_format=asm._crn_get_dxt_format,_crn_get_width=Module._crn_get_width=asm._crn_get_width,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii;Runtime.stackAlloc=asm.stackAlloc,Runtime.stackSave=asm.stackSave,Runtime.stackRestore=asm.stackRestore,Runtime.establishStackSpace=asm.establishStackSpace,Runtime.setTempRet0=asm.setTempRet0,Runtime.getTempRet0=asm.getTempRet0,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop,preloadStartTime=null,calledMain=!1;dependenciesFulfilled=function e(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){function r(){for(var e=0;e<3;e++)n.push(0)}assert(0==runDependencies,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(0==__ATPRERUN__.length,"cannot call main when preRun functions remain to be called"),e=e||[],ensureInitRuntime();var i=e.length+1,n=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];r();for(var t=0;t<i-1;t+=1)n.push(allocate(intArrayFromString(e[t]),"i8",ALLOC_NORMAL)),r();n.push(0),n=allocate(n,"i32",ALLOC_NORMAL);try{var o=Module._main(i,n,0);exit(o,!0)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}finally{calledMain=!0}},Module.run=Module.run=run,Module.exit=Module.exit=exit;var abortDecorators=[];if(Module.abort=Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),Module.noExitRuntime=!0,run(),Module}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function r(e,r){return void 0!==e?e:r}return r.EMPTY_OBJECT=e({}),r}),define("Core/formatError",["./defined"],function(e){"use strict";function r(r){var i,n=r.name,t=r.message;i=e(n)&&e(t)?n+": "+t:r.toString();var o=r.stack;return e(o)&&(i+="\n"+o),i}return r}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,r,i){"use strict";function n(n){var t,o=[],a={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;o.length=0,a.id=s.id,a.error=void 0,a.result=void 0;try{a.result=n(s.parameters,o)}catch(e){e instanceof Error?a.error={name:e.name,message:e.message,stack:e.stack}:a.error=e}r(t)||(t=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(o.length=0);try{t(a,o)}catch(e){a.result=void 0,a.error="postMessage failed with error: "+i(e)+"\n with responseMessage: "+JSON.stringify(a),t(a)}}}return n}),define("Workers/transcodeCRNToDXT",["../Core/CompressedTextureBuffer","../Core/defined","../Core/PixelFormat","../Core/RuntimeError","../ThirdParty/crunch","./createTaskProcessorWorker"],function(e,r,i,n,t,o){"use strict";function a(e,r,i,n){var t,o=i/4,a=n%4,u=new Uint32Array(e.buffer,0,(n-a)/4),s=new Uint32Array(r.buffer);for(t=0;t<u.length;t++)s[o+t]=u[t];for(t=n-a;t<n;t++)r[i+t]=e[t]}function u(o,u){var s=o.byteLength,E=new Uint8Array(o),d=t._malloc(s);a(E,t.HEAPU8,d,s);var A=t._crn_get_dxt_format(d,s),T=l[A];if(!r(T))throw new n("Unsupported compressed format.");var R,M=t._crn_get_levels(d,s),m=t._crn_get_width(d,s),S=t._crn_get_height(d,s),h=0;for(R=0;R<M;++R)h+=i.compressedTextureSize(T,m>>R,S>>R);c<h&&(r(f)&&t._free(f),f=t._malloc(h),_=new Uint8Array(t.HEAPU8.buffer,f,h),c=h),t._crn_decompress(d,s,f,h,0,M),t._free(d);var N=_.slice(0,i.compressedTextureSize(T,m,S));return u.push(N.buffer),new e(T,m,S,N)}var s={cCRNFmtInvalid:-1,cCRNFmtDXT1:0,cCRNFmtDXT3:1,cCRNFmtDXT5:2},l={};l[s.cCRNFmtDXT1]=i.RGB_DXT1,l[s.cCRNFmtDXT3]=i.RGBA_DXT3,l[s.cCRNFmtDXT5]=i.RGBA_DXT5;var f,_,c=0;return o(u)})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/defineProperties",["./defined"],function(e){"use strict";var r=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),i=Object.defineProperties;return r&&e(i)||(i=function(e){return e}),i}),define("Core/CompressedTextureBuffer",["./defined","./defineProperties"],function(e,r){"use strict";function i(e,r,i,n){this._format=e,this._width=r,this._height=i,this._buffer=n}return r(i.prototype,{internalFormat:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}}),i.clone=function(r){if(e(r))return new i(r._format,r._width,r._height,r._buffer)},i.prototype.clone=function(){return i.clone(this)},i}),define("Core/freezeObject",["./defined"],function(e){"use strict";var r=Object.freeze;return e(r)||(r=function(e){return e}),r}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var r={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,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};return e(r)}),define("Renderer/PixelDatatype",["../Core/freezeObject","../Core/WebGLConstants"],function(e,r){"use strict";var i={UNSIGNED_BYTE:r.UNSIGNED_BYTE,UNSIGNED_SHORT:r.UNSIGNED_SHORT,UNSIGNED_INT:r.UNSIGNED_INT,FLOAT:r.FLOAT,UNSIGNED_INT_24_8:r.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:r.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:r.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:r.UNSIGNED_SHORT_5_6_5,isPacked:function(e){return e===i.UNSIGNED_INT_24_8||e===i.UNSIGNED_SHORT_4_4_4_4||e===i.UNSIGNED_SHORT_5_5_5_1||e===i.UNSIGNED_SHORT_5_6_5},sizeInBytes:function(e){switch(e){case i.UNSIGNED_BYTE:return 1;case i.UNSIGNED_SHORT:case i.UNSIGNED_SHORT_4_4_4_4:case i.UNSIGNED_SHORT_5_5_5_1:case i.UNSIGNED_SHORT_5_6_5:return 2;case i.UNSIGNED_INT:case i.FLOAT:case i.UNSIGNED_INT_24_8:return 4}},validate:function(e){return e===i.UNSIGNED_BYTE||e===i.UNSIGNED_SHORT||e===i.UNSIGNED_INT||e===i.FLOAT||e===i.UNSIGNED_INT_24_8||e===i.UNSIGNED_SHORT_4_4_4_4||e===i.UNSIGNED_SHORT_5_5_5_1||e===i.UNSIGNED_SHORT_5_6_5}};return e(i)}),define("Core/PixelFormat",["../Renderer/PixelDatatype","./freezeObject","./WebGLConstants"],function(e,r,i){"use strict";var n={DEPTH_COMPONENT:i.DEPTH_COMPONENT,DEPTH_STENCIL:i.DEPTH_STENCIL,ALPHA:i.ALPHA,RGB:i.RGB,RGBA:i.RGBA,LUMINANCE:i.LUMINANCE,LUMINANCE_ALPHA:i.LUMINANCE_ALPHA,RGB_DXT1:i.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:i.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:i.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:i.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGB_ETC1:i.COMPRESSED_RGB_ETC1_WEBGL,componentsLength:function(e){switch(e){case n.RGB:case n.RGBA:return 4;case n.LUMINANCE_ALPHA:return 2;case n.ALPHA:case n.LUMINANCE:return 1;default:return 1}},validate:function(e){return e===n.DEPTH_COMPONENT||e===n.DEPTH_STENCIL||e===n.ALPHA||e===n.RGB||e===n.RGBA||e===n.LUMINANCE||e===n.LUMINANCE_ALPHA||e===n.RGB_DXT1||e===n.RGBA_DXT1||e===n.RGBA_DXT3||e===n.RGBA_DXT5||e===n.RGB_PVRTC_4BPPV1||e===n.RGB_PVRTC_2BPPV1||e===n.RGBA_PVRTC_4BPPV1||e===n.RGBA_PVRTC_2BPPV1||e===n.RGB_ETC1},isColorFormat:function(e){return e===n.ALPHA||e===n.RGB||e===n.RGBA||e===n.LUMINANCE||e===n.LUMINANCE_ALPHA},isDepthFormat:function(e){return e===n.DEPTH_COMPONENT||e===n.DEPTH_STENCIL},isCompressedFormat:function(e){return e===n.RGB_DXT1||e===n.RGBA_DXT1||e===n.RGBA_DXT3||e===n.RGBA_DXT5||e===n.RGB_PVRTC_4BPPV1||e===n.RGB_PVRTC_2BPPV1||e===n.RGBA_PVRTC_4BPPV1||e===n.RGBA_PVRTC_2BPPV1||e===n.RGB_ETC1},isDXTFormat:function(e){return e===n.RGB_DXT1||e===n.RGBA_DXT1||e===n.RGBA_DXT3||e===n.RGBA_DXT5},isPVRTCFormat:function(e){return e===n.RGB_PVRTC_4BPPV1||e===n.RGB_PVRTC_2BPPV1||e===n.RGBA_PVRTC_4BPPV1||e===n.RGBA_PVRTC_2BPPV1},isETC1Format:function(e){return e===n.RGB_ETC1},compressedTextureSizeInBytes:function(e,r,i){switch(e){case n.RGB_DXT1:case n.RGBA_DXT1:case n.RGB_ETC1:return Math.floor((r+3)/4)*Math.floor((i+3)/4)*8;case n.RGBA_DXT3:case n.RGBA_DXT5:return Math.floor((r+3)/4)*Math.floor((i+3)/4)*16;case n.RGB_PVRTC_4BPPV1:case n.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(r,8)*Math.max(i,8)*4+7)/8);case n.RGB_PVRTC_2BPPV1:case n.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(r,16)*Math.max(i,8)*2+7)/8);default:return 0}},textureSizeInBytes:function(r,i,t,o){var a=n.componentsLength(r);return e.isPacked(i)&&(a=1),a*e.sizeInBytes(i)*t*o}};return r(n)}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function r(e){this.name="RuntimeError",this.message=e;var r;try{throw new Error}catch(e){r=e.stack}this.stack=r}return e(Object.create)&&(r.prototype=Object.create(Error.prototype),r.prototype.constructor=r),r.prototype.toString=function(){var r=this.name+": "+this.message;return e(this.stack)&&(r+="\n"+this.stack.toString()),r},r}),define("ThirdParty/crunch",[],function(){function globalEval(e){eval.call(null,e)}function assert(e,r){e||abort("Assertion failed: "+r)}function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,r,i,n){switch(i=i||"i8","*"===i.charAt(i.length-1)&&(i="i32"),i){case"i1":HEAP8[e>>0]=r;break;case"i8":HEAP8[e>>0]=r;break;case"i16":HEAP16[e>>1]=r;break;case"i32":HEAP32[e>>2]=r;break;case"i64":tempI64=[r>>>0,(tempDouble=r,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=r;break;case"double":HEAPF64[e>>3]=r;break;default:abort("invalid type for setValue: "+i)}}function getValue(e,r,i){switch(r=r||"i8","*"===r.charAt(r.length-1)&&(r="i32"),r){case"i1":return HEAP8[e>>0];case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":return HEAP32[e>>2];case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+r)}return null}function allocate(e,r,i,n){var t,o;"number"==typeof e?(t=!0,o=e):(t=!1,o=e.length);var a,u="string"==typeof r?r:null;if(a=i==ALLOC_NONE?n:[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===i?ALLOC_STATIC:i](Math.max(o,u?1:r.length)),t){var s,n=a;for(assert(0==(3&a)),s=a+(o&-4);n<s;n+=4)HEAP32[n>>2]=0;for(s=a+o;n<s;)HEAP8[n++>>0]=0;return a}if("i8"===u)return e.subarray||e.slice?HEAPU8.set(e,a):HEAPU8.set(new Uint8Array(e),a),a;for(var l,f,_,c=0;c<o;){var E=e[c];"function"==typeof E&&(E=Runtime.getFunctionIndex(E)),l=u||r[c],0!==l?("i64"==l&&(l="i32"),setValue(a+c,E,l),_!==l&&(f=Runtime.getNativeTypeSize(l),_=l),c+=f):c++}return a}function getMemory(e){return staticSealed?"undefined"!=typeof _sbrk&&!_sbrk.called||!runtimeInitialized?Runtime.dynamicAlloc(e):_malloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,r){if(0===r||!e)return"";for(var i,n=0,t=0;;){if(i=HEAPU8[e+t>>0],n|=i,0==i&&!r)break;if(t++,r&&t==r)break}r||(r=t);var o="";if(n<128){for(var a,u=1024;r>0;)a=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(r,u))),o=o?o+a:a,e+=u,r-=u;return o}return Module.UTF8ToString(e)}function AsciiToString(e){for(var r="";;){var i=HEAP8[e++>>0];if(!i)return r;r+=String.fromCharCode(i)}}function stringToAscii(e,r){return writeAsciiToMemory(e,r,!1)}function UTF8ArrayToString(e,r){for(var i,n,t,o,a,u,s="";;){if(i=e[r++],!i)return s;if(128&i)if(n=63&e[r++],192!=(224&i))if(t=63&e[r++],224==(240&i)?i=(15&i)<<12|n<<6|t:(o=63&e[r++],240==(248&i)?i=(7&i)<<18|n<<12|t<<6|o:(a=63&e[r++],248==(252&i)?i=(3&i)<<24|n<<18|t<<12|o<<6|a:(u=63&e[r++],i=(1&i)<<30|n<<24|t<<18|o<<12|a<<6|u))),i<65536)s+=String.fromCharCode(i);else{var l=i-65536;s+=String.fromCharCode(55296|l>>10,56320|1023&l)}else s+=String.fromCharCode((31&i)<<6|n);else s+=String.fromCharCode(i)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,r,i,n){if(!(n>0))return 0;for(var t=i,o=i+n-1,a=0;a<e.length;++a){var u=e.charCodeAt(a);if(u>=55296&&u<=57343&&(u=65536+((1023&u)<<10)|1023&e.charCodeAt(++a)),u<=127){if(i>=o)break;r[i++]=u}else if(u<=2047){if(i+1>=o)break;r[i++]=192|u>>6,r[i++]=128|63&u}else if(u<=65535){if(i+2>=o)break;r[i++]=224|u>>12,r[i++]=128|u>>6&63,r[i++]=128|63&u}else if(u<=2097151){if(i+3>=o)break;r[i++]=240|u>>18,r[i++]=128|u>>12&63,r[i++]=128|u>>6&63,r[i++]=128|63&u}else if(u<=67108863){if(i+4>=o)break;r[i++]=248|u>>24,r[i++]=128|u>>18&63,r[i++]=128|u>>12&63,r[i++]=128|u>>6&63,r[i++]=128|63&u}else{if(i+5>=o)break;r[i++]=252|u>>30,r[i++]=128|u>>24&63,r[i++]=128|u>>18&63,r[i++]=128|u>>12&63,r[i++]=128|u>>6&63,r[i++]=128|63&u}}return r[i]=0,i-t}function stringToUTF8(e,r,i){return stringToUTF8Array(e,HEAPU8,r,i)}function lengthBytesUTF8(e){for(var r=0,i=0;i<e.length;++i){var n=e.charCodeAt(i);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++i)),n<=127?++r:r+=n<=2047?2:n<=65535?3:n<=2097151?4:n<=67108863?5:6}return r}function UTF16ToString(e){for(var r=0,i="";;){var n=HEAP16[e+2*r>>1];if(0==n)return i;++r,i+=String.fromCharCode(n)}}function stringToUTF16(e,r,i){if(void 0===i&&(i=2147483647),i<2)return 0;i-=2;for(var n=r,t=i<2*e.length?i/2:e.length,o=0;o<t;++o){var a=e.charCodeAt(o);HEAP16[r>>1]=a,r+=2}return HEAP16[r>>1]=0,r-n}function lengthBytesUTF16(e){return 2*e.length}function UTF32ToString(e){for(var r=0,i="";;){var n=HEAP32[e+4*r>>2];if(0==n)return i;if(++r,n>=65536){var t=n-65536;i+=String.fromCharCode(55296|t>>10,56320|1023&t)}else i+=String.fromCharCode(n)}}function stringToUTF32(e,r,i){if(void 0===i&&(i=2147483647),i<4)return 0;for(var n=r,t=n+i-4,o=0;o<e.length;++o){var a=e.charCodeAt(o);if(a>=55296&&a<=57343){var u=e.charCodeAt(++o);a=65536+((1023&a)<<10)|1023&u}if(HEAP32[r>>2]=a,r+=4,r+4>t)break}return HEAP32[r>>2]=0,r-n}function lengthBytesUTF32(e){for(var r=0,i=0;i<e.length;++i){var n=e.charCodeAt(i);n>=55296&&n<=57343&&++i,r+=4}return r}function demangle(e){function r(){u++,"K"===e[u]&&u++;for(var r=[];"E"!==e[u];)if("S"!==e[u])if("C"!==e[u]){var i=parseInt(e.substr(u)),n=i.toString().length;if(!i||!n){u--;break}var t=e.substr(u+n,i);r.push(t),l.push(t),u+=n+i}else r.push(r[r.length-1]),u+=2;else{u++;var o=e.indexOf("_",u),a=e.substring(u,o)||0;r.push(l[a]||"?"),u=o+1}return u++,r}function i(n,t,o){function a(){return"("+c.join(", ")+")"}t=t||1/0;var l,_="",c=[];if("N"===e[u]){if(l=r().join("::"),t--,0===t)return n?[l]:l}else{("K"===e[u]||f&&"L"===e[u])&&u++;var E=parseInt(e.substr(u));if(E){var d=E.toString().length;l=e.substr(u+d,E),u+=d+E}}if(f=!1,"I"===e[u]){u++;var T=i(!0),A=i(!0,1,!0);_+=A[0]+" "+l+"<"+T.join(", ")+">"}else _=l;e:for(;u<e.length&&t-- >0;){var R=e[u++];if(R in s)c.push(s[R]);else switch(R){case"P":c.push(i(!0,1,!0)[0]+"*");break;case"R":c.push(i(!0,1,!0)[0]+"&");break;case"L":u++;var M=e.indexOf("E",u),E=M-u;c.push(e.substr(u,E)),u+=E+2;break;case"A":var E=parseInt(e.substr(u));if(u+=E.toString().length,"_"!==e[u])throw"?";u++,c.push(i(!0,1,!0)[0]+" ["+E+"]");break;case"E":break e;default:_+="?"+R;break e}}return o||1!==c.length||"void"!==c[0]||(c=[]),n?(_&&c.push(_+"?"),c):_+a()}var n=!!Module.___cxa_demangle;if(n)try{var t=_malloc(e.length);writeStringToMemory(e.substr(1),t);var o=_malloc(4),a=Module.___cxa_demangle(t,0,0,o);if(0===getValue(o,"i32")&&a)return Pointer_stringify(a)}catch(e){}finally{t&&_free(t),o&&_free(o),a&&_free(a)}var u=3,s={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},l=[],f=!0,_=e;try{if("Object._main"==e||"_main"==e)return"main()";if("number"==typeof e&&(e=Pointer_stringify(e)),"_"!==e[0])return e;if("_"!==e[1])return e;if("Z"!==e[2])return e;switch(e[3]){case"n":return"operator new()";case"d":return"operator delete()"}_=i()}catch(e){_+="?"}return _.indexOf("?")>=0&&!n&&Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),_}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,function(e){var r=demangle(e);return e===r?e:e+" ["+r+"]"})}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(r){e=r}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){return demangleAll(jsStackTrace())}function alignMemoryPage(e){return e%4096>0&&(e+=4096-e%4096),e}function enlargeMemory(){var e=Math.pow(2,31);if(DYNAMICTOP>=e)return!1;for(;TOTAL_MEMORY<=DYNAMICTOP;)if(TOTAL_MEMORY<e/2)TOTAL_MEMORY=alignMemoryPage(2*TOTAL_MEMORY);else{var r=TOTAL_MEMORY;if(TOTAL_MEMORY=alignMemoryPage((3*TOTAL_MEMORY+e)/4),TOTAL_MEMORY<=r)return!1}if(TOTAL_MEMORY=Math.max(TOTAL_MEMORY,16777216),TOTAL_MEMORY>=e)return!1;try{if(ArrayBuffer.transfer)buffer=ArrayBuffer.transfer(buffer,TOTAL_MEMORY);else{var i=HEAP8;buffer=new ArrayBuffer(TOTAL_MEMORY)}}catch(e){return!1}var n=_emscripten_replace_memory(buffer);return!!n&&(Module.buffer=buffer,Module.HEAP8=HEAP8=new Int8Array(buffer),Module.HEAP16=HEAP16=new Int16Array(buffer),Module.HEAP32=HEAP32=new Int32Array(buffer),Module.HEAPU8=HEAPU8=new Uint8Array(buffer),Module.HEAPU16=HEAPU16=new Uint16Array(buffer),Module.HEAPU32=HEAPU32=new Uint32Array(buffer),Module.HEAPF32=HEAPF32=new Float32Array(buffer),Module.HEAPF64=HEAPF64=new Float64Array(buffer),ArrayBuffer.transfer||HEAP8.set(i),!0)}function callRuntimeCallbacks(e){for(;e.length>0;){var r=e.shift();if("function"!=typeof r){var i=r.func;"number"==typeof i?void 0===r.arg?Runtime.dynCall("v",i):Runtime.dynCall("vi",i,[r.arg]):i(void 0===r.arg?null:r.arg)}else r()}}function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,r,i){var n=i>0?i:lengthBytesUTF8(e)+1,t=new Array(n),o=stringToUTF8Array(e,t,0,t.length);return r&&(t.length=o),t}function intArrayToString(e){for(var r=[],i=0;i<e.length;i++){var n=e[i];n>255&&(n&=255),r.push(String.fromCharCode(n))}return r.join("")}function writeStringToMemory(e,r,i){for(var n=intArrayFromString(e,i),t=0;t<n.length;){var o=n[t];HEAP8[r+t>>0]=o,t+=1}}function writeArrayToMemory(e,r){for(var i=0;i<e.length;i++)HEAP8[r++>>0]=e[i]}function writeAsciiToMemory(e,r,i){for(var n=0;n<e.length;++n)HEAP8[r++>>0]=e.charCodeAt(n);i||(HEAP8[r>>0]=0)}function unSign(e,r,i){return e>=0?e:r<=32?2*Math.abs(1<<r-1)+e:Math.pow(2,r)+e}function reSign(e,r,i){if(e<=0)return e;var n=r<=32?Math.abs(1<<r-1):Math.pow(2,r-1);return e>=n&&(r<=32||e>n)&&(e=-2*n+e),e}function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var r=dependenciesFulfilled;dependenciesFulfilled=null,r()}}function copyTempFloat(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3]}function copyTempDouble(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3],HEAP8[tempDoublePtr+4]=HEAP8[e+4],HEAP8[tempDoublePtr+5]=HEAP8[e+5],HEAP8[tempDoublePtr+6]=HEAP8[e+6],HEAP8[tempDoublePtr+7]=HEAP8[e+7]}function _pthread_cleanup_push(e,r){__ATEXIT__.push(function(){Runtime.dynCall("vi",e,[r])}),_pthread_cleanup_push.level=__ATEXIT__.length}function _pthread_cleanup_pop(){assert(_pthread_cleanup_push.level==__ATEXIT__.length,"cannot pop if something else added meanwhile!"),__ATEXIT__.pop(),_pthread_cleanup_push.level=__ATEXIT__.length}function _abort(){Module.abort()}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}function ___cxa_begin_catch(e){return __ZSt18uncaught_exceptionv.uncaught_exception--,EXCEPTIONS.caught.push(e),EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(e)),e}function _pthread_once(e,r){_pthread_once.seen||(_pthread_once.seen={}),e in _pthread_once.seen||(Runtime.dynCall("v",r),_pthread_once.seen[e]=1)}function _emscripten_memcpy_big(e,r,i){return HEAPU8.set(HEAPU8.subarray(r,r+i),e),e}function ___syscall6(e,r){SYSCALLS.varargs=r;try{var i=SYSCALLS.getStreamFromFD();return FS.close(i),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function _pthread_getspecific(e){return PTHREAD_SPECIFIC[e]||0}function ___setErrNo(e){return Module.___errno_location&&(HEAP32[Module.___errno_location()>>2]=e),e}function _sysconf(e){switch(e){case 30:return PAGE_SIZE;case 85:return totalMemory/PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34: +case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator?navigator.hardwareConcurrency||1:1}return ___setErrNo(ERRNO_CODES.EINVAL),-1}function _sbrk(e){var r=_sbrk;r.called||(DYNAMICTOP=alignMemoryPage(DYNAMICTOP),r.called=!0,assert(Runtime.dynamicAlloc),r.alloc=Runtime.dynamicAlloc,Runtime.dynamicAlloc=function(){abort("cannot dynamically allocate, sbrk now has control")});var i=DYNAMICTOP;if(0!=e){var n=r.alloc(e);if(!n)return-1>>>0}return i}function _pthread_key_create(e,r){return 0==e?ERRNO_CODES.EINVAL:(HEAP32[e>>2]=PTHREAD_SPECIFIC_NEXT_KEY,PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0,PTHREAD_SPECIFIC_NEXT_KEY++,0)}function _emscripten_set_main_loop_timing(e,r){function i(e){e.source===window&&e.data===t&&(e.stopPropagation(),n.shift()())}if(Browser.mainLoop.timingMode=e,Browser.mainLoop.timingValue=r,!Browser.mainLoop.func)return 1;if(0==e)Browser.mainLoop.scheduler=function(){setTimeout(Browser.mainLoop.runner,r)},Browser.mainLoop.method="timeout";else if(1==e)Browser.mainLoop.scheduler=function(){Browser.requestAnimationFrame(Browser.mainLoop.runner)},Browser.mainLoop.method="rAF";else if(2==e){if(!window.setImmediate){var n=[],t="__emcc";window.addEventListener("message",i,!0),window.setImmediate=function(e){n.push(e),window.postMessage(t,"*")}}Browser.mainLoop.scheduler=function(){window.setImmediate(Browser.mainLoop.runner)},Browser.mainLoop.method="immediate"}return 0}function _emscripten_set_main_loop(e,r,i,n,t){Module.noExitRuntime=!0,assert(!Browser.mainLoop.func,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Browser.mainLoop.func=e,Browser.mainLoop.arg=n;var o=Browser.mainLoop.currentlyRunningMainloop;if(Browser.mainLoop.runner=function(){if(!ABORT){if(Browser.mainLoop.queue.length>0){var r=Date.now(),i=Browser.mainLoop.queue.shift();if(i.func(i.arg),Browser.mainLoop.remainingBlockers){var t=Browser.mainLoop.remainingBlockers,a=t%1==0?t-1:Math.floor(t);i.counted?Browser.mainLoop.remainingBlockers=a:(a+=.5,Browser.mainLoop.remainingBlockers=(8*t+a)/9)}return console.log('main loop blocker "'+i.name+'" took '+(Date.now()-r)+" ms"),Browser.mainLoop.updateStatus(),void setTimeout(Browser.mainLoop.runner,0)}if(!(o<Browser.mainLoop.currentlyRunningMainloop)){if(Browser.mainLoop.currentFrameNumber=Browser.mainLoop.currentFrameNumber+1|0,1==Browser.mainLoop.timingMode&&Browser.mainLoop.timingValue>1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0)return void Browser.mainLoop.scheduler();"timeout"===Browser.mainLoop.method&&Module.ctx&&(Module.printErr("Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!"),Browser.mainLoop.method=""),Browser.mainLoop.runIter(function(){"undefined"!=typeof n?Runtime.dynCall("vi",e,[n]):Runtime.dynCall("v",e)}),o<Browser.mainLoop.currentlyRunningMainloop||("object"==typeof SDL&&SDL.audio&&SDL.audio.queueNewAudioData&&SDL.audio.queueNewAudioData(),Browser.mainLoop.scheduler())}}},t||(r&&r>0?_emscripten_set_main_loop_timing(0,1e3/r):_emscripten_set_main_loop_timing(1,1),Browser.mainLoop.scheduler()),i)throw"SimulateInfiniteLoop"}function _pthread_setspecific(e,r){return e in PTHREAD_SPECIFIC?(PTHREAD_SPECIFIC[e]=r,0):ERRNO_CODES.EINVAL}function _time(e){var r=Date.now()/1e3|0;return e&&(HEAP32[e>>2]=r),r}function _pthread_self(){return 0}function ___syscall140(e,r){SYSCALLS.varargs=r;try{var i=SYSCALLS.getStreamFromFD(),n=SYSCALLS.get(),t=SYSCALLS.get(),o=SYSCALLS.get(),a=SYSCALLS.get(),u=t;return assert(0===n),FS.llseek(i,u,a),HEAP32[o>>2]=i.position,i.getdents&&0===u&&0===a&&(i.getdents=null),0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall146(e,r){SYSCALLS.varargs=r;try{var i=(SYSCALLS.get(),SYSCALLS.get()),n=SYSCALLS.get(),t=0;___syscall146.buffer||(___syscall146.buffer=[]);for(var o=___syscall146.buffer,a=0;a<n;a++){for(var u=HEAP32[i+8*a>>2],s=HEAP32[i+(8*a+4)>>2],l=0;l<s;l++){var f=HEAPU8[u+l];0===f||10===f?(Module.print(UTF8ArrayToString(o,0)),o.length=0):o.push(f)}t+=s}return t}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function ___syscall54(e,r){SYSCALLS.varargs=r;try{return 0}catch(e){return"undefined"!=typeof FS&&e instanceof FS.ErrnoError||abort(e),-e.errno}}function invoke_iiii(e,r,i,n){try{return Module.dynCall_iiii(e,r,i,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiiii(e,r,i,n,t,o){try{Module.dynCall_viiiii(e,r,i,n,t,o)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_vi(e,r){try{Module.dynCall_vi(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_ii(e,r){try{return Module.dynCall_ii(e,r)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viii(e,r,i,n){try{Module.dynCall_viii(e,r,i,n)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_v(e){try{Module.dynCall_v(e)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiiiii(e,r,i,n,t,o,a){try{Module.dynCall_viiiiii(e,r,i,n,t,o,a)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function invoke_viiii(e,r,i,n,t){try{Module.dynCall_viiii(e,r,i,n,t)}catch(e){if("number"!=typeof e&&"longjmp"!==e)throw e;asm.setThrew(1,0)}}function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}function run(e){function r(){Module.calledRun||(Module.calledRun=!0,ABORT||(ensureInitRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),Module._main&&shouldRunNow&&Module.callMain(e),postRun()))}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0||(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("")},1),r()},1)):r()))}function exit(e,r){if(!r||!Module.noExitRuntime)throw Module.noExitRuntime||(ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),Module.onExit&&Module.onExit(e)),ENVIRONMENT_IS_NODE?(process.stdout.once("drain",function(){process.exit(e)}),console.log(" "),setTimeout(function(){process.exit(e)},500)):ENVIRONMENT_IS_SHELL&&"function"==typeof quit&&quit(e),new ExitStatus(e)}function abort(e){void 0!==e?(Module.print(e),Module.printErr(e),e=JSON.stringify(e)):e="",ABORT=!0,EXITSTATUS=1;var r="\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.",i="abort("+e+") at "+stackTrace()+r;throw abortDecorators&&abortDecorators.forEach(function(r){i=r(i,e)}),i}var Module;Module||(Module=("undefined"!=typeof Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_NODE="object"==typeof process&&"function"==typeof require&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=function(e){process.stdout.write(e+"\n")}),Module.printErr||(Module.printErr=function(e){process.stderr.write(e+"\n")});var nodeFS=require("fs"),nodePath=require("path");Module.read=function(e,r){e=nodePath.normalize(e);var i=nodeFS.readFileSync(e);return i||e==nodePath.resolve(e)||(e=path.join(__dirname,"..","src",e),i=nodeFS.readFileSync(e)),i&&!r&&(i=i.toString()),i},Module.readBinary=function(e){var r=Module.read(e,!0);return r.buffer||(r=new Uint8Array(r)),assert(r.buffer),r},Module.load=function(e){globalEval(read(e))},Module.thisProgram||(process.argv.length>1?Module.thisProgram=process.argv[1].replace(/\\/g,"/"):Module.thisProgram="unknown-program"),Module.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),Module.inspect=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available (jsc?)"},Module.readBinary=function(e){if("function"==typeof readbuffer)return new Uint8Array(readbuffer(e));var r=read(e,"binary");return assert("object"==typeof r),r},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:"undefined"!=typeof arguments&&(Module.arguments=arguments);else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText},"undefined"!=typeof arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.log(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),"undefined"==typeof Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e})}!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[];for(var key in moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var Runtime={setTempRet0:function(e){tempRet0=e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var r=parseInt(e.substr(1));return assert(r%8===0),r/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,r){return"double"===r||"i64"===r?7&e&&(assert(4===(7&e)),e+=4):assert(0===(3&e)),e},getAlignSize:function(e,r,i){return i||"i64"!=e&&"double"!=e?e?Math.min(r||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(r,8):8},dynCall:function(e,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),Module["dynCall_"+e].apply(null,i)):Module["dynCall_"+e].call(null,r)},functionPointers:[],addFunction:function(e){for(var r=0;r<Runtime.functionPointers.length;r++)if(!Runtime.functionPointers[r])return Runtime.functionPointers[r]=e,2*(1+r);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(e,r){assert(r),Runtime.funcWrappers[r]||(Runtime.funcWrappers[r]={});var i=Runtime.funcWrappers[r];return i[e]||(i[e]=function(){return Runtime.dynCall(r,e,arguments)}),i[e]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var r=STACKTOP;return STACKTOP=STACKTOP+e|0,STACKTOP=STACKTOP+15&-16,r},staticAlloc:function(e){var r=STATICTOP;return STATICTOP=STATICTOP+e|0,STATICTOP=STATICTOP+15&-16,r},dynamicAlloc:function(e){var r=DYNAMICTOP;if(DYNAMICTOP=DYNAMICTOP+e|0,DYNAMICTOP=DYNAMICTOP+15&-16,DYNAMICTOP>=TOTAL_MEMORY){var i=enlargeMemory();if(!i)return DYNAMICTOP=r,0}return r},alignMemory:function(e,r){var i=e=Math.ceil(e/(r?r:16))*(r?r:16);return i},makeBigInt:function(e,r,i){var n=i?+(e>>>0)+4294967296*+(r>>>0):+(e>>>0)+4294967296*+(0|r);return n},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var __THREW__=0,ABORT=!1,EXITSTATUS=0,undef=0,tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat,tempI64,tempI64b,tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9,globalScope=this,cwrap,ccall;!function(){function parseJSFunc(e){var r=e.toString().match(sourceRegex).slice(1);return{arguments:r[0],body:r[1],returnValue:r[2]}}var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var r=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,r),r},stringToC:function(e){var r=0;return null!==e&&void 0!==e&&0!==e&&(r=Runtime.stackAlloc((e.length<<2)+1),writeStringToMemory(e,r)),r}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,r,i,n,t){var o=getCFunc(e),a=[],u=0;if(n)for(var s=0;s<n.length;s++){var l=toC[i[s]];l?(0===u&&(u=Runtime.stackSave()),a[s]=l(n[s])):a[s]=n[s]}var f=o.apply(null,a);if("string"===r&&(f=Pointer_stringify(f)),0!==u){if(t&&t.async)return void EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(u)});Runtime.stackRestore(u)}return f};var sourceRegex=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/,JSsource={};for(var fun in JSfuncs)JSfuncs.hasOwnProperty(fun)&&(JSsource[fun]=parseJSFunc(JSfuncs[fun]));cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(e){return"number"===e}),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(e,r){return"$"+r}),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if("number"!==type){var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"="+convertCode.returnValue+";"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+="ret = "+strgfy+"(ret);"}return numericArgs||(funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii,Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.UTF16ToString=UTF16ToString,Module.stringToUTF16=stringToUTF16,Module.lengthBytesUTF16=lengthBytesUTF16,Module.UTF32ToString=UTF32ToString,Module.stringToUTF32=stringToUTF32,Module.lengthBytesUTF32=lengthBytesUTF32,Module.stackTrace=stackTrace;var PAGE_SIZE=4096,HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,STATIC_BASE=0,STATICTOP=0,staticSealed=!1,STACK_BASE=0,STACKTOP=0,STACK_MAX=0,DYNAMIC_BASE=0,DYNAMICTOP=0,byteLength;try{byteLength=Function.prototype.call.bind(Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get),byteLength(new ArrayBuffer(4))}catch(e){byteLength=function(e){return e.byteLength}}for(var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216,totalMemory=65536;totalMemory<TOTAL_MEMORY||totalMemory<2*TOTAL_STACK;)totalMemory<16777216?totalMemory*=2:totalMemory+=16777216;totalMemory=Math.max(totalMemory,16777216),totalMemory!==TOTAL_MEMORY&&(TOTAL_MEMORY=totalMemory),assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"JS engine does not provide full typed array support");var buffer;buffer=new ArrayBuffer(TOTAL_MEMORY),HEAP8=new Int8Array(buffer),HEAP16=new Int16Array(buffer),HEAP32=new Int32Array(buffer),HEAPU8=new Uint8Array(buffer),HEAPU16=new Uint16Array(buffer),HEAPU32=new Uint32Array(buffer),HEAPF32=new Float32Array(buffer),HEAPF64=new Float64Array(buffer),HEAP32[0]=255,assert(255===HEAPU8[0]&&0===HEAPU8[3],"Typed arrays 2 must be run on a little-endian system"),Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&Math.imul(4294967295,5)===-5||(Math.imul=function(e,r){var i=e>>>16,n=65535&e,t=r>>>16,o=65535&r;return n*o+(i*o+n*t<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var r=0;r<32;r++)if(e&1<<31-r)return r;return 32}),Math.clz32=Math.clz32;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_min=Math.min,Math_clz32=Math.clz32,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var memoryInitializer=null,ASM_CONSTS=[];STATIC_BASE=8,STATICTOP=STATIC_BASE+5888,__ATINIT__.push(),allocate([116,0,0,0,86,7,0,0,116,0,0,0,99,7,0,0,156,0,0,0,112,7,0,0,16,0,0,0,0,0,0,0,156,0,0,0,145,7,0,0,24,0,0,0,0,0,0,0,156,0,0,0,215,7,0,0,24,0,0,0,0,0,0,0,156,0,0,0,179,7,0,0,56,0,0,0,0,0,0,0,156,0,0,0,249,7,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,108,1,0,0,220,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,227,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,219,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,105,110,99,92,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE); +var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);assert(tempDoublePtr%8==0);var _BDtoIHigh=!0;Module._i64Subtract=_i64Subtract,Module._i64Add=_i64Add,Module._memset=_memset;var _BDtoILow=!0;Module._bitshift64Lshr=_bitshift64Lshr,Module._bitshift64Shl=_bitshift64Shl;var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:function(e){if(!e||EXCEPTIONS.infos[e])return e;for(var r in EXCEPTIONS.infos){var i=EXCEPTIONS.infos[r];if(i.adjusted===e)return r}return e},addRef:function(e){if(e){var r=EXCEPTIONS.infos[e];r.refcount++}},decRef:function(e){if(e){var r=EXCEPTIONS.infos[e];assert(r.refcount>0),r.refcount--,0===r.refcount&&(r.destructor&&Runtime.dynCall("vi",r.destructor,[e]),delete EXCEPTIONS.infos[e],___cxa_free_exception(e))}},clearRef:function(e){if(e){var r=EXCEPTIONS.infos[e];r.refcount=0}}};Module._memcpy=_memcpy;var SYSCALLS={varargs:0,get:function(e){SYSCALLS.varargs+=4;var r=HEAP32[SYSCALLS.varargs-4>>2];return r},getStr:function(){var e=Pointer_stringify(SYSCALLS.get());return e},get64:function(){var e=SYSCALLS.get(),r=SYSCALLS.get();return assert(e>=0?0===r:r===-1),e},getZero:function(){assert(0===SYSCALLS.get())}},PTHREAD_SPECIFIC={},ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86},PTHREAD_SPECIFIC_NEXT_KEY=1,_BItoD=!0,PATH=void 0,Browser={mainLoop:{scheduler:null,method:"",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null,Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var e=Browser.mainLoop.timingMode,r=Browser.mainLoop.timingValue,i=Browser.mainLoop.func;Browser.mainLoop.func=null,_emscripten_set_main_loop(i,0,!1,Browser.mainLoop.arg,!0),_emscripten_set_main_loop_timing(e,r),Browser.mainLoop.scheduler()},updateStatus:function(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",r=Browser.mainLoop.remainingBlockers,i=Browser.mainLoop.expectedBlockers;r?r<i?Module.setStatus(e+" ("+(i-r)+"/"+i+")"):Module.setStatus(e):Module.setStatus("")}},runIter:function(e){if(!ABORT){if(Module.preMainLoop){var r=Module.preMainLoop();if(r===!1)return}try{e()}catch(e){if(e instanceof ExitStatus)return;throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}Module.postMainLoop&&Module.postMainLoop()}}},isFullScreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){function e(){Browser.pointerLock=document.pointerLockElement===n||document.mozPointerLockElement===n||document.webkitPointerLockElement===n||document.msPointerLockElement===n}if(Module.preloadPlugins||(Module.preloadPlugins=[]),!Browser.initted){Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch(e){Browser.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Browser.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),Browser.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,Module.noImageDecoding||"undefined"!=typeof Browser.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),Module.noImageDecoding=!0);var r={};r.canHandle=function(e){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},r.handle=function(e,r,i,n){var t=null;if(Browser.hasBlobConstructor)try{t=new Blob([e],{type:Browser.getMimetype(r)}),t.size!==e.length&&(t=new Blob([new Uint8Array(e).buffer],{type:Browser.getMimetype(r)}))}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!t){var o=new Browser.BlobBuilder;o.append(new Uint8Array(e).buffer),t=o.getBlob()}var a=Browser.URLObject.createObjectURL(t),u=new Image;u.onload=function(){assert(u.complete,"Image "+r+" could not be decoded");var n=document.createElement("canvas");n.width=u.width,n.height=u.height;var t=n.getContext("2d");t.drawImage(u,0,0),Module.preloadedImages[r]=n,Browser.URLObject.revokeObjectURL(a),i&&i(e)},u.onerror=function(e){console.log("Image "+a+" could not be decoded"),n&&n()},u.src=a},Module.preloadPlugins.push(r);var i={};i.canHandle=function(e){return!Module.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},i.handle=function(e,r,i,n){function t(n){a||(a=!0,Module.preloadedAudios[r]=n,i&&i(e))}function o(){a||(a=!0,Module.preloadedAudios[r]=new Audio,n&&n())}var a=!1;if(!Browser.hasBlobConstructor)return o();try{var u=new Blob([e],{type:Browser.getMimetype(r)})}catch(e){return o()}var s=Browser.URLObject.createObjectURL(u),l=new Audio;l.addEventListener("canplaythrough",function(){t(l)},!1),l.onerror=function(i){function n(e){for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="=",n="",t=0,o=0,a=0;a<e.length;a++)for(t=t<<8|e[a],o+=8;o>=6;){var u=t>>o-6&63;o-=6,n+=r[u]}return 2==o?(n+=r[(3&t)<<4],n+=i+i):4==o&&(n+=r[(15&t)<<2],n+=i),n}a||(console.log("warning: browser could not fully decode audio "+r+", trying slower base64 approach"),l.src="data:audio/x-"+r.substr(-3)+";base64,"+n(e),t(l))},l.src=s,Browser.safeSetTimeout(function(){t(l)},1e4)},Module.preloadPlugins.push(i);var n=Module.canvas;n&&(n.requestPointerLock=n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock||n.msRequestPointerLock||function(){},n.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},n.exitPointerLock=n.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",e,!1),document.addEventListener("mozpointerlockchange",e,!1),document.addEventListener("webkitpointerlockchange",e,!1),document.addEventListener("mspointerlockchange",e,!1),Module.elementPointerLock&&n.addEventListener("click",function(e){!Browser.pointerLock&&n.requestPointerLock&&(n.requestPointerLock(),e.preventDefault())},!1))}},createContext:function(e,r,i,n){if(r&&Module.ctx&&e==Module.canvas)return Module.ctx;var t,o;if(r){var a={antialias:!1,alpha:!1};if(n)for(var u in n)a[u]=n[u];o=GL.createContext(e,a),o&&(t=GL.getContext(o).GLctx),e.style.backgroundColor="black"}else t=e.getContext("2d");return t?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),Module.ctx=t,r&&GL.makeContextCurrent(o),Module.useWebGL=r,Browser.moduleContextCreatedCallbacks.forEach(function(e){e()}),Browser.init()),t):null},destroyContext:function(e,r,i){},fullScreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullScreen:function(e,r,i){function n(){Browser.isFullScreen=!1;var e=t.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===e?(t.cancelFullScreen=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},t.cancelFullScreen=t.cancelFullScreen.bind(document),Browser.lockPointer&&t.requestPointerLock(),Browser.isFullScreen=!0,Browser.resizeCanvas&&Browser.setFullScreenCanvasSize()):(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e),Browser.resizeCanvas&&Browser.setWindowedCanvasSize()),Module.onFullScreen&&Module.onFullScreen(Browser.isFullScreen),Browser.updateCanvasDimensions(t)}Browser.lockPointer=e,Browser.resizeCanvas=r,Browser.vrDevice=i,"undefined"==typeof Browser.lockPointer&&(Browser.lockPointer=!0),"undefined"==typeof Browser.resizeCanvas&&(Browser.resizeCanvas=!1),"undefined"==typeof Browser.vrDevice&&(Browser.vrDevice=null);var t=Module.canvas;Browser.fullScreenHandlersInstalled||(Browser.fullScreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var o=document.createElement("div");t.parentNode.insertBefore(o,t),o.appendChild(t),o.requestFullScreen=o.requestFullScreen||o.mozRequestFullScreen||o.msRequestFullscreen||(o.webkitRequestFullScreen?function(){o.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?o.requestFullScreen({vrDisplay:i}):o.requestFullScreen()},nextRAF:0,fakeRequestAnimationFrame:function(e){var r=Date.now();if(0===Browser.nextRAF)Browser.nextRAF=r+1e3/60;else for(;r+2>=Browser.nextRAF;)Browser.nextRAF+=1e3/60;var i=Math.max(Browser.nextRAF-r,0);setTimeout(e,i)},requestAnimationFrame:function(e){"undefined"==typeof window?Browser.fakeRequestAnimationFrame(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||Browser.fakeRequestAnimationFrame),window.requestAnimationFrame(e))},safeCallback:function(e){return function(){if(!ABORT)return e.apply(null,arguments)}},allowAsyncCallbacks:!0,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=!1},resumeAsyncCallbacks:function(){if(Browser.allowAsyncCallbacks=!0,Browser.queuedAsyncCallbacks.length>0){var e=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[],e.forEach(function(e){e()})}},safeRequestAnimationFrame:function(e){return Browser.requestAnimationFrame(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))})},safeSetTimeout:function(e,r){return Module.noExitRuntime=!0,setTimeout(function(){ABORT||(Browser.allowAsyncCallbacks?e():Browser.queuedAsyncCallbacks.push(e))},r)},safeSetInterval:function(e,r){return Module.noExitRuntime=!0,setInterval(function(){ABORT||Browser.allowAsyncCallbacks&&e()},r)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},getMouseWheelDelta:function(e){var r=0;switch(e.type){case"DOMMouseScroll":r=e.detail;break;case"mousewheel":r=e.wheelDelta;break;case"wheel":r=e.deltaY;break;default:throw"unrecognized mouse wheel event: "+e.type}return r},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(e){if(Browser.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),"undefined"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var r=Module.canvas.getBoundingClientRect(),i=Module.canvas.width,n=Module.canvas.height,t="undefined"!=typeof window.scrollX?window.scrollX:window.pageXOffset,o="undefined"!=typeof window.scrollY?window.scrollY:window.pageYOffset;if("touchstart"===e.type||"touchend"===e.type||"touchmove"===e.type){var a=e.touch;if(void 0===a)return;var u=a.pageX-(t+r.left),s=a.pageY-(o+r.top);u*=i/r.width,s*=n/r.height;var l={x:u,y:s};if("touchstart"===e.type)Browser.lastTouches[a.identifier]=l,Browser.touches[a.identifier]=l;else if("touchend"===e.type||"touchmove"===e.type){var f=Browser.touches[a.identifier];f||(f=l),Browser.lastTouches[a.identifier]=f,Browser.touches[a.identifier]=l}return}var _=e.pageX-(t+r.left),c=e.pageY-(o+r.top);_*=i/r.width,c*=n/r.height,Browser.mouseMovementX=_-Browser.mouseX,Browser.mouseMovementY=c-Browser.mouseY,Browser.mouseX=_,Browser.mouseY=c}},xhrLoad:function(e,r,i){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?r(n.response):i()},n.onerror=i,n.send(null)},asyncLoad:function(e,r,i,n){Browser.xhrLoad(e,function(i){assert(i,'Loading data file "'+e+'" failed (no arrayBuffer).'),r(new Uint8Array(i)),n||removeRunDependency("al "+e)},function(r){if(!i)throw'Loading data file "'+e+'" failed.';i()}),n||addRunDependency("al "+e)},resizeListeners:[],updateResizeListeners:function(){var e=Module.canvas;Browser.resizeListeners.forEach(function(r){r(e.width,e.height)})},setCanvasSize:function(e,r,i){var n=Module.canvas;Browser.updateCanvasDimensions(n,e,r),i||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if("undefined"!=typeof SDL){var e=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];e&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=e}Browser.updateResizeListeners()},updateCanvasDimensions:function(e,r,i){r&&i?(e.widthNative=r,e.heightNative=i):(r=e.widthNative,i=e.heightNative);var n=r,t=i;if(Module.forcedAspectRatio&&Module.forcedAspectRatio>0&&(n/t<Module.forcedAspectRatio?n=Math.round(t*Module.forcedAspectRatio):t=Math.round(n/Module.forcedAspectRatio)),(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===e.parentNode&&"undefined"!=typeof screen){var o=Math.min(screen.width/n,screen.height/t);n=Math.round(n*o),t=Math.round(t*o)}Browser.resizeCanvas?(e.width!=n&&(e.width=n),e.height!=t&&(e.height=t),"undefined"!=typeof e.style&&(e.style.removeProperty("width"),e.style.removeProperty("height"))):(e.width!=r&&(e.width=r),e.height!=i&&(e.height=i),"undefined"!=typeof e.style&&(n!=r||t!=i?(e.style.setProperty("width",n+"px","important"),e.style.setProperty("height",t+"px","important")):(e.style.removeProperty("width"),e.style.removeProperty("height"))))},wgetRequests:{},nextWgetRequestHandle:0,getNextWgetRequestHandle:function(){var e=Browser.nextWgetRequestHandle;return Browser.nextWgetRequestHandle++,e}};Module.requestFullScreen=function(e,r,i){Browser.requestFullScreen(e,r,i)},Module.requestAnimationFrame=function(e){Browser.requestAnimationFrame(e)},Module.setCanvasSize=function(e,r,i){Browser.setCanvasSize(e,r,i)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},Module.createContext=function(e,r,i,n){return Browser.createContext(e,r,i,n)},STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),staticSealed=!0,STACK_MAX=STACK_BASE+TOTAL_STACK,DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX),assert(DYNAMIC_BASE<TOTAL_MEMORY,"TOTAL_MEMORY not big enough for stack");var cttz_i8=allocate([8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0],"i8",ALLOC_DYNAMIC);Module.asmGlobalArg={Math:Math,Int8Array:Int8Array,Int16Array:Int16Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Uint16Array:Uint16Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array,NaN:NaN,Infinity:1/0,byteLength:byteLength},Module.asmLibraryArg={abort:abort,assert:assert,invoke_iiii:invoke_iiii,invoke_viiiii:invoke_viiiii,invoke_vi:invoke_vi,invoke_ii:invoke_ii,invoke_viii:invoke_viii,invoke_v:invoke_v,invoke_viiiiii:invoke_viiiiii,invoke_viiii:invoke_viiii,_pthread_cleanup_pop:_pthread_cleanup_pop,_pthread_getspecific:_pthread_getspecific,_pthread_setspecific:_pthread_setspecific,__ZSt18uncaught_exceptionv:__ZSt18uncaught_exceptionv,_emscripten_set_main_loop:_emscripten_set_main_loop,_pthread_self:_pthread_self,_abort:_abort,_pthread_cleanup_push:_pthread_cleanup_push,___syscall6:___syscall6,_sbrk:_sbrk,_time:_time,_pthread_key_create:_pthread_key_create,___setErrNo:___setErrNo,_emscripten_memcpy_big:_emscripten_memcpy_big,___syscall54:___syscall54,___syscall140:___syscall140,_pthread_once:_pthread_once,_emscripten_set_main_loop_timing:_emscripten_set_main_loop_timing,_sysconf:_sysconf,___syscall146:___syscall146,___cxa_begin_catch:___cxa_begin_catch,STACKTOP:STACKTOP,STACK_MAX:STACK_MAX,tempDoublePtr:tempDoublePtr,ABORT:ABORT,cttz_i8:cttz_i8};var asm=function(e,r,i){"use asm";var n=e.Int8Array;var t=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var u=e.Uint16Array;var s=e.Uint32Array;var l=e.Float32Array;var f=e.Float64Array;var _=new n(i);var c=new t(i);var E=new o(i);var d=new a(i);var T=new u(i);var A=new s(i);var R=new l(i);var M=new f(i);var S=e.byteLength;var m=r.STACKTOP|0;var h=r.STACK_MAX|0;var N=r.tempDoublePtr|0;var C=r.ABORT|0;var I=r.cttz_i8|0;var p=0;var w=0;var b=0;var O=0;var P=e.NaN,v=e.Infinity;var B=0,L=0,k=0,F=0,g=0,U=0,D=0,y=0,G=0;var H=0;var X=0;var V=0;var Y=0;var x=0;var K=0;var W=0;var z=0;var q=0;var j=0;var Z=e.Math.floor;var J=e.Math.abs;var Q=e.Math.sqrt;var $=e.Math.pow;var ee=e.Math.cos;var re=e.Math.sin;var ie=e.Math.tan;var ne=e.Math.acos;var te=e.Math.asin;var oe=e.Math.atan;var ae=e.Math.atan2;var ue=e.Math.exp;var se=e.Math.log;var le=e.Math.ceil;var fe=e.Math.imul;var _e=e.Math.min;var ce=e.Math.clz32;var Ee=r.abort;var de=r.assert;var Te=r.invoke_iiii;var Ae=r.invoke_viiiii;var Re=r.invoke_vi;var Me=r.invoke_ii;var Se=r.invoke_viii;var me=r.invoke_v;var he=r.invoke_viiiiii;var Ne=r.invoke_viiii;var Ce=r._pthread_cleanup_pop;var Ie=r._pthread_getspecific;var pe=r._pthread_setspecific;var we=r.__ZSt18uncaught_exceptionv;var be=r._emscripten_set_main_loop;var Oe=r._pthread_self;var Pe=r._abort;var ve=r._pthread_cleanup_push;var Be=r.___syscall6;var Le=r._sbrk;var ke=r._time;var Fe=r._pthread_key_create;var ge=r.___setErrNo;var Ue=r._emscripten_memcpy_big;var De=r.___syscall54;var ye=r.___syscall140;var Ge=r._pthread_once;var He=r._emscripten_set_main_loop_timing;var Xe=r._sysconf;var Ve=r.___syscall146;var Ye=r.___cxa_begin_catch;var xe=0;function Ke(e){if(S(e)&16777215||S(e)<=16777215||S(e)>2147483648)return false;_=new n(e);c=new t(e);E=new o(e);d=new a(e);T=new u(e);A=new s(e);R=new l(e);M=new f(e);i=e;return true}function We(e){e=e|0;var r=0;r=m;m=m+e|0;m=m+15&-16;return r|0}function ze(){return m|0}function qe(e){e=e|0;m=e}function je(e,r){e=e|0;r=r|0;m=e;h=r}function Ze(e,r){e=e|0;r=r|0;if(!p){p=e;w=r}}function Je(e){e=e|0;_[N>>0]=_[e>>0];_[N+1>>0]=_[e+1>>0];_[N+2>>0]=_[e+2>>0];_[N+3>>0]=_[e+3>>0]}function Qe(e){e=e|0;_[N>>0]=_[e>>0];_[N+1>>0]=_[e+1>>0];_[N+2>>0]=_[e+2>>0];_[N+3>>0]=_[e+3>>0];_[N+4>>0]=_[e+4>>0];_[N+5>>0]=_[e+5>>0];_[N+6>>0]=_[e+6>>0];_[N+7>>0]=_[e+7>>0]}function $e(e){e=e|0;H=e}function er(){return H|0}function rr(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0;d=m;m=m+576|0;f=d+48|0;u=d+32|0;a=d+16|0;o=d;l=d+64|0;_=d+60|0;s=e+4|0;c=e+8|0;if((E[s>>2]|0)>>>0>(E[c>>2]|0)>>>0){E[o>>2]=1138;E[o+4>>2]=2119;E[o+8>>2]=1117;Si(l,1084,o)|0;Mi(l)|0}if((2147418112/(n>>>0)|0)>>>0<=r>>>0){E[a>>2]=1138;E[a+4>>2]=2120;E[a+8>>2]=1157;Si(l,1084,a)|0;Mi(l)|0}a=E[c>>2]|0;if(a>>>0>=r>>>0){c=1;m=d;return c|0}do if(i){if(r){o=r+-1|0;if(!(o&r)){o=11;break}else r=o}else r=-1;r=r>>>16|r;r=r>>>8|r;r=r>>>4|r;r=r>>>2|r;r=(r>>>1|r)+1|0;o=10}else o=10;while(0);if((o|0)==10)if(!r){r=0;o=12}else o=11;if((o|0)==11)if(r>>>0<=a>>>0)o=12;if((o|0)==12){E[u>>2]=1138;E[u+4>>2]=2129;E[u+8>>2]=1205;Si(l,1084,u)|0;Mi(l)|0}i=fe(r,n)|0;do if(!t){o=ir(E[e>>2]|0,i,_,1)|0;if(!o){c=0;m=d;return c|0}else{E[e>>2]=o;break}}else{a=nr(i,_)|0;if(!a){c=0;m=d;return c|0}On[t&0](a,E[e>>2]|0,E[s>>2]|0);o=E[e>>2]|0;do if(o)if(!(o&7)){or(o,0,0,1,0)|0;break}else{E[f>>2]=1138;E[f+4>>2]=2502;E[f+8>>2]=1504;Si(l,1084,f)|0;Mi(l)|0;break}while(0);E[e>>2]=a}while(0);o=E[_>>2]|0;if(o>>>0>i>>>0)r=(o>>>0)/(n>>>0)|0;E[c>>2]=r;c=1;m=d;return c|0}function ir(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0,u=0,s=0,l=0;l=m;m=m+560|0;s=l+32|0;o=l+16|0;t=l;u=l+48|0;a=l+44|0;if(e&7){E[t>>2]=1138;E[t+4>>2]=2502;E[t+8>>2]=1482;Si(u,1084,t)|0;Mi(u)|0;s=0;m=l;return s|0}if(r>>>0>2147418112){E[o>>2]=1138;E[o+4>>2]=2502;E[o+8>>2]=1375;Si(u,1084,o)|0;Mi(u)|0;s=0;m=l;return s|0}E[a>>2]=r;n=or(e,r,a,n,0)|0;if(i)E[i>>2]=E[a>>2];if(!(n&7)){s=n;m=l;return s|0}E[s>>2]=1138;E[s+4>>2]=2554;E[s+8>>2]=1428;Si(u,1084,s)|0;Mi(u)|0;s=n;m=l;return s|0}function nr(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0;s=m;m=m+560|0;u=s+32|0;a=s+16|0;i=s;o=s+48|0;t=s+44|0;n=e+3&-4;n=(n|0)!=0?n:4;if(n>>>0>2147418112){E[i>>2]=1138;E[i+4>>2]=2502;E[i+8>>2]=1375;Si(o,1084,i)|0;Mi(o)|0;u=0;m=s;return u|0}E[t>>2]=n;i=or(0,n,t,1,0)|0;e=E[t>>2]|0;if(r)E[r>>2]=e;if((i|0)==0|e>>>0<n>>>0){E[a>>2]=1138;E[a+4>>2]=2502;E[a+8>>2]=1401;Si(o,1084,a)|0;Mi(o)|0;u=0;m=s;return u|0}if(!(i&7)){u=i;m=s;return u|0}E[u>>2]=1138;E[u+4>>2]=2529;E[u+8>>2]=1428;Si(o,1084,u)|0;Mi(o)|0;u=i;m=s;return u|0}function tr(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0,u=0,s=0,l=0,f=0,A=0,R=0,M=0,S=0,h=0,N=0,C=0,I=0,p=0,w=0,b=0,O=0,P=0,v=0,B=0,L=0,k=0,F=0,g=0,U=0,D=0;D=m;m=m+880|0;F=D+144|0;k=D+128|0;L=D+112|0;B=D+96|0;O=D+80|0;N=D+64|0;S=D+48|0;h=D+32|0;A=D+16|0;f=D;v=D+360|0;g=D+296|0;U=D+224|0;M=D+156|0;if((r|0)==0|n>>>0>11){e=0;m=D;return e|0}E[e>>2]=r;t=U;o=t+68|0;do{E[t>>2]=0;t=t+4|0}while((t|0)<(o|0));o=0;do{t=_[i+o>>0]|0;if(t<<24>>24){P=U+((t&255)<<2)|0;E[P>>2]=(E[P>>2]|0)+1}o=o+1|0}while((o|0)!=(r|0));o=0;l=1;a=0;u=-1;s=0;while(1){t=E[U+(l<<2)>>2]|0;if(!t)E[e+28+(l+-1<<2)>>2]=0;else{P=l+-1|0;E[g+(P<<2)>>2]=o;o=t+o|0;b=16-l|0;E[e+28+(P<<2)>>2]=(o+-1<<b|(1<<b)+-1)+1;E[e+96+(P<<2)>>2]=s;E[M+(l<<2)>>2]=s;a=a>>>0>l>>>0?a:l;u=u>>>0<l>>>0?u:l;s=t+s|0}l=l+1|0;if((l|0)==17){P=a;break}else o=o<<1}E[e+4>>2]=s;o=e+172|0;do if(s>>>0>(E[o>>2]|0)>>>0){E[o>>2]=s;if(s){t=s+-1|0;if(t&s)R=14}else{t=-1;R=14}if((R|0)==14){b=t>>>16|t;b=b>>>8|b;b=b>>>4|b;b=b>>>2|b;b=(b>>>1|b)+1|0;E[o>>2]=b>>>0>r>>>0?r:b}a=e+176|0;t=E[a>>2]|0;do if(t){b=E[t+-4>>2]|0;t=t+-8|0;if(!((b|0)!=0?(b|0)==(~E[t>>2]|0):0)){E[f>>2]=1138;E[f+4>>2]=647;E[f+8>>2]=1851;Si(v,1084,f)|0;Mi(v)|0}if(!(t&7)){or(t,0,0,1,0)|0;break}else{E[A>>2]=1138;E[A+4>>2]=2502;E[A+8>>2]=1504;Si(v,1084,A)|0;Mi(v)|0;break}}while(0);o=E[o>>2]|0;o=(o|0)!=0?o:1;t=nr((o<<1)+8|0,0)|0;if(!t){E[a>>2]=0;t=0;break}else{E[t+4>>2]=o;E[t>>2]=~o;E[a>>2]=t+8;R=25;break}}else R=25;while(0);e:do if((R|0)==25){b=e+24|0;_[b>>0]=u;_[e+25>>0]=P;o=e+176|0;a=0;do{w=_[i+a>>0]|0;t=w&255;if(w<<24>>24){if(!(E[U+(t<<2)>>2]|0)){E[h>>2]=1138;E[h+4>>2]=2272;E[h+8>>2]=1249;Si(v,1084,h)|0;Mi(v)|0}w=M+(t<<2)|0;t=E[w>>2]|0;E[w>>2]=t+1;if(t>>>0>=s>>>0){E[S>>2]=1138;E[S+4>>2]=2276;E[S+8>>2]=1262;Si(v,1084,S)|0;Mi(v)|0}c[(E[o>>2]|0)+(t<<1)>>1]=a}a=a+1|0}while((a|0)!=(r|0));t=_[b>>0]|0;p=(t&255)>>>0<n>>>0?n:0;w=e+8|0;E[w>>2]=p;I=(p|0)!=0;if(I){C=1<<p;t=e+164|0;do if(C>>>0>(E[t>>2]|0)>>>0){E[t>>2]=C;a=e+168|0;t=E[a>>2]|0;do if(t){h=E[t+-4>>2]|0;t=t+-8|0;if(!((h|0)!=0?(h|0)==(~E[t>>2]|0):0)){E[N>>2]=1138;E[N+4>>2]=647;E[N+8>>2]=1851;Si(v,1084,N)|0;Mi(v)|0}if(!(t&7)){or(t,0,0,1,0)|0;break}else{E[O>>2]=1138;E[O+4>>2]=2502;E[O+8>>2]=1504;Si(v,1084,O)|0;Mi(v)|0;break}}while(0);t=C<<2;o=nr(t+8|0,0)|0;if(!o){E[a>>2]=0;t=0;break e}else{O=o+8|0;E[o+4>>2]=C;E[o>>2]=~C;E[a>>2]=O;o=O;break}}else{o=e+168|0;t=C<<2;a=o;o=E[o>>2]|0}while(0);qi(o|0,-1,t|0)|0;M=e+176|0;N=1;do{if(E[U+(N<<2)>>2]|0){S=p-N|0;h=1<<S;o=N+-1|0;u=E[g+(o<<2)>>2]|0;if(o>>>0>=16){E[B>>2]=1138;E[B+4>>2]=1956;E[B+8>>2]=1725;Si(v,1084,B)|0;Mi(v)|0}t=E[e+28+(o<<2)>>2]|0;if(!t)r=-1;else r=(t+-1|0)>>>(16-N|0);if(u>>>0<=r>>>0){A=(E[e+96+(o<<2)>>2]|0)-u|0;R=N<<16;do{t=T[(E[M>>2]|0)+(A+u<<1)>>1]|0;if((d[i+t>>0]|0|0)!=(N|0)){E[L>>2]=1138;E[L+4>>2]=2318;E[L+8>>2]=1291;Si(v,1084,L)|0;Mi(v)|0}f=u<<S;o=t|R;l=0;do{s=l+f|0;if(s>>>0>=C>>>0){E[k>>2]=1138;E[k+4>>2]=2324;E[k+8>>2]=1325;Si(v,1084,k)|0;Mi(v)|0}t=E[a>>2]|0;if((E[t+(s<<2)>>2]|0)!=-1){E[F>>2]=1138;E[F+4>>2]=2326;E[F+8>>2]=1348;Si(v,1084,F)|0;Mi(v)|0;t=E[a>>2]|0}E[t+(s<<2)>>2]=o;l=l+1|0}while(l>>>0<h>>>0);u=u+1|0}while(u>>>0<=r>>>0)}}N=N+1|0}while(p>>>0>=N>>>0);t=_[b>>0]|0}o=e+96|0;E[o>>2]=(E[o>>2]|0)-(E[g>>2]|0);o=e+100|0;E[o>>2]=(E[o>>2]|0)-(E[g+4>>2]|0);o=e+104|0;E[o>>2]=(E[o>>2]|0)-(E[g+8>>2]|0);o=e+108|0;E[o>>2]=(E[o>>2]|0)-(E[g+12>>2]|0);o=e+112|0;E[o>>2]=(E[o>>2]|0)-(E[g+16>>2]|0);o=e+116|0;E[o>>2]=(E[o>>2]|0)-(E[g+20>>2]|0);o=e+120|0;E[o>>2]=(E[o>>2]|0)-(E[g+24>>2]|0);o=e+124|0;E[o>>2]=(E[o>>2]|0)-(E[g+28>>2]|0);o=e+128|0;E[o>>2]=(E[o>>2]|0)-(E[g+32>>2]|0);o=e+132|0;E[o>>2]=(E[o>>2]|0)-(E[g+36>>2]|0);o=e+136|0;E[o>>2]=(E[o>>2]|0)-(E[g+40>>2]|0);o=e+140|0;E[o>>2]=(E[o>>2]|0)-(E[g+44>>2]|0);o=e+144|0;E[o>>2]=(E[o>>2]|0)-(E[g+48>>2]|0);o=e+148|0;E[o>>2]=(E[o>>2]|0)-(E[g+52>>2]|0);o=e+152|0;E[o>>2]=(E[o>>2]|0)-(E[g+56>>2]|0);o=e+156|0;E[o>>2]=(E[o>>2]|0)-(E[g+60>>2]|0);o=e+16|0;E[o>>2]=0;a=e+20|0;E[a>>2]=t&255;r:do if(I){while(1){if(!n)break r;t=n+-1|0;if(!(E[U+(n<<2)>>2]|0))n=t;else break}E[o>>2]=E[e+28+(t<<2)>>2];t=p+1|0;E[a>>2]=t;if(t>>>0<=P>>>0){while(1){if(E[U+(t<<2)>>2]|0)break;t=t+1|0;if(t>>>0>P>>>0)break r}E[a>>2]=t}}while(0);E[e+92>>2]=-1;E[e+160>>2]=1048575;E[e+12>>2]=32-(E[w>>2]|0);t=1}while(0);e=t;m=D;return e|0}function or(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;do if(!e){n=Gi(r)|0;if(i){if(!n)e=0;else e=Vi(n)|0;E[i>>2]=e}}else{if(!r){Hi(e);if(!i){n=0;break}E[i>>2]=0;n=0;break}if(n){n=Xi(e,r)|0;e=(n|0)==0?e:n}else n=0;if(i){r=Vi(e)|0;E[i>>2]=r}}while(0);return n|0}function ar(e,r,i){e=e|0;r=r|0;i=i|0;var n=0;if(!((e|0)!=0&r>>>0>73&(i|0)!=0)){i=0;return i|0}if((E[i>>2]|0)!=40|r>>>0<74){i=0;return i|0}if(((d[e>>0]|0)<<8|(d[e+1>>0]|0)|0)!=18552){i=0;return i|0}if(((d[e+2>>0]|0)<<8|(d[e+3>>0]|0))>>>0<74){i=0;return i|0}if(((d[e+7>>0]|0)<<16|(d[e+6>>0]|0)<<24|(d[e+8>>0]|0)<<8|(d[e+9>>0]|0))>>>0>r>>>0){i=0;return i|0}E[i+4>>2]=(d[e+12>>0]|0)<<8|(d[e+13>>0]|0);E[i+8>>2]=(d[e+14>>0]|0)<<8|(d[e+15>>0]|0);E[i+12>>2]=d[e+16>>0];E[i+16>>2]=d[e+17>>0];r=e+18|0;n=i+32|0;E[n>>2]=d[r>>0];E[n+4>>2]=0;r=_[r>>0]|0;E[i+20>>2]=r<<24>>24==0|r<<24>>24==9?8:16;E[i+24>>2]=(d[e+26>>0]|0)<<16|(d[e+25>>0]|0)<<24|(d[e+27>>0]|0)<<8|(d[e+28>>0]|0);E[i+28>>2]=(d[e+30>>0]|0)<<16|(d[e+29>>0]|0)<<24|(d[e+31>>0]|0)<<8|(d[e+32>>0]|0);i=1;return i|0}function ur(e){e=e|0;Ye(e|0)|0;Gr()}function sr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0;o=m;m=m+528|0;t=o;n=o+16|0;r=E[e+20>>2]|0;if(r)lr(r);r=e+4|0;i=E[r>>2]|0;if(!i){t=e+16|0;_[t>>0]=0;m=o;return}if(!(i&7))or(i,0,0,1,0)|0;else{E[t>>2]=1138;E[t+4>>2]=2502;E[t+8>>2]=1504;Si(n,1084,t)|0;Mi(n)|0}E[r>>2]=0;E[e+8>>2]=0;E[e+12>>2]=0;t=e+16|0;_[t>>0]=0;m=o;return}function lr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0;s=m;m=m+592|0;a=s+64|0;o=s+48|0;u=s+32|0;n=s+16|0;i=s;t=s+80|0;if(!e){m=s;return}r=E[e+168>>2]|0;do if(r){l=E[r+-4>>2]|0;r=r+-8|0;if(!((l|0)!=0?(l|0)==(~E[r>>2]|0):0)){E[i>>2]=1138;E[i+4>>2]=647;E[i+8>>2]=1851;Si(t,1084,i)|0;Mi(t)|0}if(!(r&7)){or(r,0,0,1,0)|0;break}else{E[n>>2]=1138;E[n+4>>2]=2502;E[n+8>>2]=1504;Si(t,1084,n)|0;Mi(t)|0;break}}while(0);r=E[e+176>>2]|0;do if(r){l=E[r+-4>>2]|0;r=r+-8|0;if(!((l|0)!=0?(l|0)==(~E[r>>2]|0):0)){E[u>>2]=1138;E[u+4>>2]=647;E[u+8>>2]=1851;Si(t,1084,u)|0;Mi(t)|0}if(!(r&7)){or(r,0,0,1,0)|0;break}else{E[o>>2]=1138;E[o+4>>2]=2502;E[o+8>>2]=1504;Si(t,1084,o)|0;Mi(t)|0;break}}while(0);if(!(e&7)){or(e,0,0,1,0)|0;m=s;return}else{E[a>>2]=1138;E[a+4>>2]=2502;E[a+8>>2]=1504;Si(t,1084,a)|0;Mi(t)|0;m=s;return}}function fr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0;s=m;m=m+544|0;a=s+16|0;r=s;o=s+32|0;t=e+8|0;i=E[t>>2]|0;if((i+-1|0)>>>0>=8192){E[r>>2]=1138;E[r+4>>2]=3002;E[r+8>>2]=1529;Si(o,1084,r)|0;Mi(o)|0}E[e>>2]=i;n=e+20|0;r=E[n>>2]|0;if(!r){r=nr(180,0)|0;if(!r)r=0;else{u=r+164|0;E[u>>2]=0;E[u+4>>2]=0;E[u+8>>2]=0;E[u+12>>2]=0}E[n>>2]=r;u=E[e>>2]|0}else u=i;if(!(E[t>>2]|0)){E[a>>2]=1138;E[a+4>>2]=906;E[a+8>>2]=1769;Si(o,1084,a)|0;Mi(o)|0;a=E[e>>2]|0}else a=u;o=E[e+4>>2]|0;if(a>>>0>16){n=a;i=0}else{e=0;e=tr(r,u,o,e)|0;m=s;return e|0}while(1){t=i+1|0;if(n>>>0>3){n=n>>>1;i=t}else{n=t;break}}e=i+2+((n|0)!=32&1<<n>>>0<a>>>0&1)|0;e=e>>>0<11?e&255:11;e=tr(r,u,o,e)|0;m=s;return e|0}function _r(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,c=0,T=0,A=0,R=0,M=0,S=0,h=0,N=0,C=0,I=0,p=0,w=0,b=0,O=0,P=0,v=0;v=m;m=m+720|0;p=v+160|0;I=v+144|0;C=v+128|0;N=v+112|0;h=v+96|0;S=v+80|0;M=v+64|0;R=v+48|0;f=v+32|0;u=v+16|0;t=v;O=v+200|0;P=v+176|0;w=cr(e,14)|0;if(!w){E[r>>2]=0;i=r+4|0;n=E[i>>2]|0;if(n){if(!(n&7))or(n,0,0,1,0)|0;else{E[t>>2]=1138;E[t+4>>2]=2502;E[t+8>>2]=1504;Si(O,1084,t)|0;Mi(O)|0}E[i>>2]=0;E[r+8>>2]=0;E[r+12>>2]=0}_[r+16>>0]=0;i=r+20|0;n=E[i>>2]|0;if(!n){r=1;m=v;return r|0}lr(n);E[i>>2]=0;r=1;m=v;return r|0}T=r+4|0;A=r+8|0;i=E[A>>2]|0;if((i|0)!=(w|0)){if(i>>>0<=w>>>0){do if((E[r+12>>2]|0)>>>0<w>>>0){if(rr(T,w,(i+1|0)==(w|0),1,0)|0){i=E[A>>2]|0;break}_[r+16>>0]=1;r=0;m=v;return r|0}while(0);qi((E[T>>2]|0)+i|0,0,w-i|0)|0}E[A>>2]=w}qi(E[T>>2]|0,0,w|0)|0;c=e+20|0;i=E[c>>2]|0;if((i|0)<5){o=e+4|0;a=e+8|0;t=e+16|0;do{n=E[o>>2]|0;if((n|0)==(E[a>>2]|0))n=0;else{E[o>>2]=n+1;n=d[n>>0]|0}i=i+8|0;E[c>>2]=i;if((i|0)>=33){E[u>>2]=1138;E[u+4>>2]=3204;E[u+8>>2]=1638;Si(O,1084,u)|0;Mi(O)|0;i=E[c>>2]|0}n=n<<32-i|E[t>>2];E[t>>2]=n}while((i|0)<5)}else{n=e+16|0;t=n;n=E[n>>2]|0}l=n>>>27;E[t>>2]=n<<5;E[c>>2]=i+-5;if((l+-1|0)>>>0>20){r=0;m=v;return r|0}E[P+20>>2]=0;E[P>>2]=0;E[P+4>>2]=0;E[P+8>>2]=0;E[P+12>>2]=0;_[P+16>>0]=0;i=P+4|0;n=P+8|0;e:do if(rr(i,21,0,1,0)|0){u=E[n>>2]|0;s=E[i>>2]|0;qi(s+u|0,0,21-u|0)|0;E[n>>2]=21;if(l){t=e+4|0;o=e+8|0;a=e+16|0;u=0;do{i=E[c>>2]|0;if((i|0)<3){do{n=E[t>>2]|0;if((n|0)==(E[o>>2]|0))n=0;else{E[t>>2]=n+1;n=d[n>>0]|0}i=i+8|0;E[c>>2]=i;if((i|0)>=33){E[f>>2]=1138;E[f+4>>2]=3204;E[f+8>>2]=1638;Si(O,1084,f)|0;Mi(O)|0;i=E[c>>2]|0}n=n<<32-i|E[a>>2];E[a>>2]=n}while((i|0)<3)}else n=E[a>>2]|0;E[a>>2]=n<<3;E[c>>2]=i+-3;_[s+(d[1599+u>>0]|0)>>0]=n>>>29;u=u+1|0}while((u|0)!=(l|0))}if(fr(P)|0){l=e+4|0;u=e+8|0;s=e+16|0;n=0;r:while(1){a=w-n|0;i=Er(e,P)|0;i:do if(i>>>0<17){if((E[A>>2]|0)>>>0<=n>>>0){E[R>>2]=1138;E[R+4>>2]=906;E[R+8>>2]=1769; +Si(O,1084,R)|0;Mi(O)|0}_[(E[T>>2]|0)+n>>0]=i;i=n+1|0}else switch(i|0){case 17:{i=E[c>>2]|0;if((i|0)<3){do{t=E[l>>2]|0;if((t|0)==(E[u>>2]|0))t=0;else{E[l>>2]=t+1;t=d[t>>0]|0}i=i+8|0;E[c>>2]=i;if((i|0)>=33){E[M>>2]=1138;E[M+4>>2]=3204;E[M+8>>2]=1638;Si(O,1084,M)|0;Mi(O)|0;i=E[c>>2]|0}t=t<<32-i|E[s>>2];E[s>>2]=t}while((i|0)<3)}else t=E[s>>2]|0;E[s>>2]=t<<3;E[c>>2]=i+-3;i=(t>>>29)+3|0;if(i>>>0>a>>>0){i=0;break e}i=i+n|0;break i}case 18:{i=E[c>>2]|0;if((i|0)<7){do{t=E[l>>2]|0;if((t|0)==(E[u>>2]|0))t=0;else{E[l>>2]=t+1;t=d[t>>0]|0}i=i+8|0;E[c>>2]=i;if((i|0)>=33){E[S>>2]=1138;E[S+4>>2]=3204;E[S+8>>2]=1638;Si(O,1084,S)|0;Mi(O)|0;i=E[c>>2]|0}t=t<<32-i|E[s>>2];E[s>>2]=t}while((i|0)<7)}else t=E[s>>2]|0;E[s>>2]=t<<7;E[c>>2]=i+-7;i=(t>>>25)+11|0;if(i>>>0>a>>>0){i=0;break e}i=i+n|0;break i}default:{if((i+-19|0)>>>0>=2){b=90;break r}o=E[c>>2]|0;if((i|0)==19){if((o|0)<2){t=o;while(1){i=E[l>>2]|0;if((i|0)==(E[u>>2]|0))o=0;else{E[l>>2]=i+1;o=d[i>>0]|0}i=t+8|0;E[c>>2]=i;if((i|0)>=33){E[h>>2]=1138;E[h+4>>2]=3204;E[h+8>>2]=1638;Si(O,1084,h)|0;Mi(O)|0;i=E[c>>2]|0}t=o<<32-i|E[s>>2];E[s>>2]=t;if((i|0)<2)t=i;else break}}else{t=E[s>>2]|0;i=o}E[s>>2]=t<<2;E[c>>2]=i+-2;o=(t>>>30)+3|0}else{if((o|0)<6){t=o;while(1){i=E[l>>2]|0;if((i|0)==(E[u>>2]|0))o=0;else{E[l>>2]=i+1;o=d[i>>0]|0}i=t+8|0;E[c>>2]=i;if((i|0)>=33){E[N>>2]=1138;E[N+4>>2]=3204;E[N+8>>2]=1638;Si(O,1084,N)|0;Mi(O)|0;i=E[c>>2]|0}t=o<<32-i|E[s>>2];E[s>>2]=t;if((i|0)<6)t=i;else break}}else{t=E[s>>2]|0;i=o}E[s>>2]=t<<6;E[c>>2]=i+-6;o=(t>>>26)+7|0}if((n|0)==0|o>>>0>a>>>0){i=0;break e}i=n+-1|0;if((E[A>>2]|0)>>>0<=i>>>0){E[C>>2]=1138;E[C+4>>2]=906;E[C+8>>2]=1769;Si(O,1084,C)|0;Mi(O)|0}t=_[(E[T>>2]|0)+i>>0]|0;if(!(t<<24>>24)){i=0;break e}i=o+n|0;if(n>>>0>=i>>>0){i=n;break i}do{if((E[A>>2]|0)>>>0<=n>>>0){E[I>>2]=1138;E[I+4>>2]=906;E[I+8>>2]=1769;Si(O,1084,I)|0;Mi(O)|0}_[(E[T>>2]|0)+n>>0]=t;n=n+1|0}while((n|0)!=(i|0))}}while(0);if(w>>>0>i>>>0)n=i;else break}if((b|0)==90){E[p>>2]=1138;E[p+4>>2]=3145;E[p+8>>2]=1620;Si(O,1084,p)|0;Mi(O)|0;i=0;break}if((w|0)==(i|0))i=fr(r)|0;else i=0}else i=0}else{_[P+16>>0]=1;i=0}while(0);sr(P);r=i;m=v;return r|0}function cr(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0;l=m;m=m+528|0;a=l;o=l+16|0;if(!r){s=0;m=l;return s|0}if(r>>>0<=16){s=dr(e,r)|0;m=l;return s|0}u=dr(e,r+-16|0)|0;s=e+20|0;r=E[s>>2]|0;if((r|0)<16){n=e+4|0;t=e+8|0;i=e+16|0;do{e=E[n>>2]|0;if((e|0)==(E[t>>2]|0))e=0;else{E[n>>2]=e+1;e=d[e>>0]|0}r=r+8|0;E[s>>2]=r;if((r|0)>=33){E[a>>2]=1138;E[a+4>>2]=3204;E[a+8>>2]=1638;Si(o,1084,a)|0;Mi(o)|0;r=E[s>>2]|0}e=e<<32-r|E[i>>2];E[i>>2]=e}while((r|0)<16)}else{e=e+16|0;i=e;e=E[e>>2]|0}E[i>>2]=e<<16;E[s>>2]=r+-16;s=e>>>16|u<<16;m=l;return s|0}function Er(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,A=0,R=0,M=0;M=m;m=m+576|0;_=M+48|0;f=M+32|0;l=M+16|0;s=M;A=M+64|0;c=E[r+20>>2]|0;R=e+20|0;u=E[R>>2]|0;do if((u|0)<24){a=e+4|0;n=E[a>>2]|0;t=E[e+8>>2]|0;i=n>>>0<t>>>0;if((u|0)>=16){if(i){E[a>>2]=n+1;i=d[n>>0]|0}else i=0;E[R>>2]=u+8;a=e+16|0;o=i<<24-u|E[a>>2];E[a>>2]=o;break}if(i){o=(d[n>>0]|0)<<8;i=n+1|0}else{o=0;i=n}if(i>>>0<t>>>0){n=d[i>>0]|0;i=i+1|0}else n=0;E[a>>2]=i;E[R>>2]=u+16;a=e+16|0;o=(n|o)<<16-u|E[a>>2];E[a>>2]=o}else{o=e+16|0;a=o;o=E[o>>2]|0}while(0);t=(o>>>16)+1|0;do if(t>>>0<=(E[c+16>>2]|0)>>>0){n=E[(E[c+168>>2]|0)+(o>>>(32-(E[c+8>>2]|0)|0)<<2)>>2]|0;if((n|0)==-1){E[s>>2]=1138;E[s+4>>2]=3249;E[s+8>>2]=1665;Si(A,1084,s)|0;Mi(A)|0}i=n&65535;n=n>>>16;if((E[r+8>>2]|0)>>>0<=i>>>0){E[l>>2]=1138;E[l+4>>2]=905;E[l+8>>2]=1769;Si(A,1084,l)|0;Mi(A)|0}if((d[(E[r+4>>2]|0)+i>>0]|0|0)!=(n|0)){E[f>>2]=1138;E[f+4>>2]=3253;E[f+8>>2]=1682;Si(A,1084,f)|0;Mi(A)|0}}else{n=E[c+20>>2]|0;while(1){i=n+-1|0;if(t>>>0>(E[c+28+(i<<2)>>2]|0)>>>0)n=n+1|0;else break}i=(o>>>(32-n|0))+(E[c+96+(i<<2)>>2]|0)|0;if(i>>>0<(E[r>>2]|0)>>>0){i=T[(E[c+176>>2]|0)+(i<<1)>>1]|0;break}E[_>>2]=1138;E[_+4>>2]=3271;E[_+8>>2]=1620;Si(A,1084,_)|0;Mi(A)|0;R=0;m=M;return R|0}while(0);E[a>>2]=E[a>>2]<<n;E[R>>2]=(E[R>>2]|0)-n;R=i;m=M;return R|0}function dr(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0;l=m;m=m+544|0;u=l+16|0;i=l;a=l+32|0;if(r>>>0>=33){E[i>>2]=1138;E[i+4>>2]=3195;E[i+8>>2]=1622;Si(a,1084,i)|0;Mi(a)|0}s=e+20|0;i=E[s>>2]|0;if((i|0)>=(r|0)){t=e+16|0;o=t;t=E[t>>2]|0;a=i;u=32-r|0;u=t>>>u;t=t<<r;E[o>>2]=t;r=a-r|0;E[s>>2]=r;m=l;return u|0}t=e+4|0;o=e+8|0;n=e+16|0;do{e=E[t>>2]|0;if((e|0)==(E[o>>2]|0))e=0;else{E[t>>2]=e+1;e=d[e>>0]|0}i=i+8|0;E[s>>2]=i;if((i|0)>=33){E[u>>2]=1138;E[u+4>>2]=3204;E[u+8>>2]=1638;Si(a,1084,u)|0;Mi(a)|0;i=E[s>>2]|0}e=e<<32-i|E[n>>2];E[n>>2]=e}while((i|0)<(r|0));u=32-r|0;u=e>>>u;a=e<<r;E[n>>2]=a;r=i-r|0;E[s>>2]=r;m=l;return u|0}function Tr(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,c=0,T=0,A=0,R=0,M=0;A=m;m=m+528|0;c=A;f=A+16|0;if((e|0)==0|r>>>0<62){T=0;m=A;return T|0}l=nr(300,0)|0;if(!l){T=0;m=A;return T|0}E[l>>2]=519686845;i=l+4|0;E[i>>2]=0;n=l+8|0;E[n>>2]=0;s=l+88|0;t=l+136|0;o=l+160|0;a=s;u=a+44|0;do{E[a>>2]=0;a=a+4|0}while((a|0)<(u|0));_[s+44>>0]=0;R=l+184|0;a=l+208|0;u=l+232|0;M=l+252|0;E[M>>2]=0;E[M+4>>2]=0;E[M+8>>2]=0;_[M+12>>0]=0;M=l+268|0;E[M>>2]=0;E[M+4>>2]=0;E[M+8>>2]=0;_[M+12>>0]=0;M=l+284|0;E[M>>2]=0;E[M+4>>2]=0;E[M+8>>2]=0;_[M+12>>0]=0;E[t>>2]=0;E[t+4>>2]=0;E[t+8>>2]=0;E[t+12>>2]=0;E[t+16>>2]=0;_[t+20>>0]=0;E[o>>2]=0;E[o+4>>2]=0;E[o+8>>2]=0;E[o+12>>2]=0;E[o+16>>2]=0;_[o+20>>0]=0;E[R>>2]=0;E[R+4>>2]=0;E[R+8>>2]=0;E[R+12>>2]=0;E[R+16>>2]=0;_[R+20>>0]=0;E[a>>2]=0;E[a+4>>2]=0;E[a+8>>2]=0;E[a+12>>2]=0;E[a+16>>2]=0;_[a+20>>0]=0;E[u>>2]=0;E[u+4>>2]=0;E[u+8>>2]=0;E[u+12>>2]=0;_[u+16>>0]=0;do if(((r>>>0>=74?((d[e>>0]|0)<<8|(d[e+1>>0]|0)|0)==18552:0)?((d[e+2>>0]|0)<<8|(d[e+3>>0]|0))>>>0>=74:0)?((d[e+7>>0]|0)<<16|(d[e+6>>0]|0)<<24|(d[e+8>>0]|0)<<8|(d[e+9>>0]|0))>>>0<=r>>>0:0){E[s>>2]=e;E[i>>2]=e;E[n>>2]=r;if(pr(l)|0){i=E[s>>2]|0;if((d[i+39>>0]|0)<<8|(d[i+40>>0]|0)){if(!(wr(l)|0))break;if(!(br(l)|0))break;i=E[s>>2]|0}if(!((d[i+55>>0]|0)<<8|(d[i+56>>0]|0))){M=l;m=A;return M|0}if(Or(l)|0?Pr(l)|0:0){M=l;m=A;return M|0}}}else T=7;while(0);if((T|0)==7)E[s>>2]=0;Fr(l);if(!(l&7)){or(l,0,0,1,0)|0;M=0;m=A;return M|0}else{E[c>>2]=1138;E[c+4>>2]=2502;E[c+8>>2]=1504;Si(f,1084,c)|0;Mi(f)|0;M=0;m=A;return M|0}return 0}function Ar(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0,u=0,s=0,l=0,f=0;f=m;m=m+528|0;l=f;s=f+16|0;o=E[e+88>>2]|0;u=(d[o+70+(t<<2)+1>>0]|0)<<16|(d[o+70+(t<<2)>>0]|0)<<24|(d[o+70+(t<<2)+2>>0]|0)<<8|(d[o+70+(t<<2)+3>>0]|0);a=t+1|0;if(a>>>0<(d[o+16>>0]|0)>>>0)o=(d[o+70+(a<<2)+1>>0]|0)<<16|(d[o+70+(a<<2)>>0]|0)<<24|(d[o+70+(a<<2)+2>>0]|0)<<8|(d[o+70+(a<<2)+3>>0]|0);else o=E[e+8>>2]|0;if(o>>>0>u>>>0){s=e+4|0;s=E[s>>2]|0;s=s+u|0;l=o-u|0;l=Rr(e,s,l,r,i,n,t)|0;m=f;return l|0}E[l>>2]=1138;E[l+4>>2]=3690;E[l+8>>2]=1780;Si(s,1084,l)|0;Mi(s)|0;s=e+4|0;s=E[s>>2]|0;s=s+u|0;l=o-u|0;l=Rr(e,s,l,r,i,n,t)|0;m=f;return l|0}function Rr(e,r,i,n,t,o,a){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;a=a|0;var u=0,s=0,l=0,f=0;f=E[e+88>>2]|0;s=((d[f+12>>0]|0)<<8|(d[f+13>>0]|0))>>>a;l=((d[f+14>>0]|0)<<8|(d[f+15>>0]|0))>>>a;s=s>>>0>1?(s+3|0)>>>2:1;l=l>>>0>1?(l+3|0)>>>2:1;f=f+18|0;a=_[f>>0]|0;a=fe(a<<24>>24==0|a<<24>>24==9?8:16,s)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((fe(a,l)|0)>>>0>t>>>0){e=0;return e|0}o=(s+1|0)>>>1;u=(l+1|0)>>>1;if(!i){e=0;return e|0}E[e+92>>2]=r;E[e+96>>2]=r;E[e+104>>2]=i;E[e+100>>2]=r+i;E[e+108>>2]=0;E[e+112>>2]=0;switch(d[f>>0]|0|0){case 0:{vr(e,n,t,a,s,l,o,u)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Br(e,n,t,a,s,l,o,u)|0;e=1;return e|0}case 9:{Lr(e,n,t,a,s,l,o,u)|0;e=1;return e|0}case 8:case 7:{kr(e,n,t,a,s,l,o,u)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function Mr(e,r){e=e|0;r=r|0;var i=0,n=0;n=m;m=m+48|0;i=n;E[i>>2]=40;ar(e,r,i)|0;m=n;return E[i+4>>2]|0}function Sr(e,r){e=e|0;r=r|0;var i=0,n=0;n=m;m=m+48|0;i=n;E[i>>2]=40;ar(e,r,i)|0;m=n;return E[i+8>>2]|0}function mr(e,r){e=e|0;r=r|0;var i=0,n=0;n=m;m=m+48|0;i=n;E[i>>2]=40;ar(e,r,i)|0;m=n;return E[i+12>>2]|0}function hr(e,r){e=e|0;r=r|0;var i=0,n=0;n=m;m=m+48|0;i=n;E[i>>2]=40;ar(e,r,i)|0;m=n;return E[i+32>>2]|0}function Nr(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0;t=m;m=m+576|0;n=t+40|0;i=t+56|0;o=t;E[o>>2]=40;ar(e,r,o)|0;r=o+32|0;e=E[r+4>>2]|0;do switch(E[r>>2]|0){case 0:{if(!e){o=8;m=t;return o|0}else e=14;break}case 1:{if(!e)e=13;else e=14;break}case 2:{if(!e)e=13;else e=14;break}case 3:{if(!e)e=13;else e=14;break}case 4:{if(!e)e=13;else e=14;break}case 5:{if(!e)e=13;else e=14;break}case 6:{if(!e)e=13;else e=14;break}case 7:{if(!e)e=13;else e=14;break}case 8:{if(!e)e=13;else e=14;break}case 9:{if(!e){o=8;m=t;return o|0}else e=14;break}case 10:{if(!e){o=8;m=t;return o|0}else e=14;break}default:e=14}while(0);if((e|0)==13){o=16;m=t;return o|0}else if((e|0)==14){E[n>>2]=1138;E[n+4>>2]=2668;E[n+8>>2]=1523;Si(i,1084,n)|0;Mi(i)|0;o=0;m=t;return o|0}return 0}function Cr(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0,u=0,s=0;u=m;m=m+576|0;o=u+40|0;t=u+56|0;s=u;E[s>>2]=40;ar(e,r,s)|0;n=(((E[s+4>>2]|0)>>>i)+3|0)>>>2;r=(((E[s+8>>2]|0)>>>i)+3|0)>>>2;i=s+32|0;e=E[i+4>>2]|0;do switch(E[i>>2]|0){case 0:{if(!e)e=8;else a=14;break}case 1:{if(!e)a=13;else a=14;break}case 2:{if(!e)a=13;else a=14;break}case 3:{if(!e)a=13;else a=14;break}case 4:{if(!e)a=13;else a=14;break}case 5:{if(!e)a=13;else a=14;break}case 6:{if(!e)a=13;else a=14;break}case 7:{if(!e)a=13;else a=14;break}case 8:{if(!e)a=13;else a=14;break}case 9:{if(!e)e=8;else a=14;break}case 10:{if(!e)e=8;else a=14;break}default:a=14}while(0);if((a|0)==13)e=16;else if((a|0)==14){E[o>>2]=1138;E[o+4>>2]=2668;E[o+8>>2]=1523;Si(t,1084,o)|0;Mi(t)|0;e=0}s=fe(fe(r,n)|0,e)|0;m=u;return s|0}function Ir(e,r,i,n,t,o){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;var a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,T=0,A=0;A=m;m=m+592|0;T=A+56|0;a=A+40|0;c=A+72|0;_=A;d=A+68|0;E[_>>2]=40;ar(e,r,_)|0;u=(E[_+4>>2]|0)>>>t;s=(E[_+8>>2]|0)>>>t;_=_+32|0;n=E[_+4>>2]|0;do switch(E[_>>2]|0){case 0:{if(!n)_=8;else l=14;break}case 1:{if(!n)l=13;else l=14;break}case 2:{if(!n)l=13;else l=14;break}case 3:{if(!n)l=13;else l=14;break}case 4:{if(!n)l=13;else l=14;break}case 5:{if(!n)l=13;else l=14;break}case 6:{if(!n)l=13;else l=14;break}case 7:{if(!n)l=13;else l=14;break}case 8:{if(!n)l=13;else l=14;break}case 9:{if(!n)_=8;else l=14;break}case 10:{if(!n)_=8;else l=14;break}default:l=14}while(0);if((l|0)==13)_=16;else if((l|0)==14){E[a>>2]=1138;E[a+4>>2]=2668;E[a+8>>2]=1523;Si(c,1084,a)|0;Mi(c)|0;_=0}E[d>>2]=i;f=Tr(e,r)|0;r=o+t|0;if(r>>>0>t>>>0){l=(f|0)==0;e=i;while(1){n=fe((u+3|0)>>>2,_)|0;a=fe(n,(s+3|0)>>>2)|0;if(!(t>>>0>15|(l|a>>>0<8))?(E[f>>2]|0)==519686845:0)Ar(f,d,a,n,t)|0;e=e+a|0;E[d>>2]=e;t=t+1|0;if((t|0)==(r|0))break;else{s=s>>>1;u=u>>>1}}}if(!f){m=A;return}if((E[f>>2]|0)!=519686845){m=A;return}Fr(f);if(!(f&7)){or(f,0,0,1,0)|0;m=A;return}else{E[T>>2]=1138;E[T+4>>2]=2502;E[T+8>>2]=1504;Si(c,1084,T)|0;Mi(c)|0;m=A;return}}function pr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0;a=e+92|0;n=E[e+4>>2]|0;o=e+88|0;t=E[o>>2]|0;r=(d[t+68>>0]|0)<<8|(d[t+67>>0]|0)<<16|(d[t+69>>0]|0);i=n+r|0;t=(d[t+65>>0]|0)<<8|(d[t+66>>0]|0);if(!t){e=0;return e|0}E[a>>2]=i;E[e+96>>2]=i;E[e+104>>2]=t;E[e+100>>2]=n+(t+r);E[e+108>>2]=0;E[e+112>>2]=0;if(!(_r(a,e+116|0)|0)){e=0;return e|0}r=E[o>>2]|0;do if(!((d[r+39>>0]|0)<<8|(d[r+40>>0]|0))){if(!((d[r+55>>0]|0)<<8|(d[r+56>>0]|0))){e=0;return e|0}}else{if(!(_r(a,e+140|0)|0)){e=0;return e|0}if(_r(a,e+188|0)|0){r=E[o>>2]|0;break}else{e=0;return e|0}}while(0);if((d[r+55>>0]|0)<<8|(d[r+56>>0]|0)){if(!(_r(a,e+164|0)|0)){e=0;return e|0}if(!(_r(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function wr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,c=0,T=0,A=0;A=m;m=m+576|0;u=A;a=A+64|0;T=A+16|0;n=e+88|0;r=E[n>>2]|0;c=(d[r+39>>0]|0)<<8|(d[r+40>>0]|0);l=e+236|0;o=e+240|0;i=E[o>>2]|0;if((i|0)!=(c|0)){if(i>>>0<=c>>>0){do if((E[e+244>>2]|0)>>>0<c>>>0){if(rr(l,c,(i+1|0)==(c|0),4,0)|0){r=E[o>>2]|0;break}_[e+248>>0]=1;T=0;m=A;return T|0}else r=i;while(0);qi((E[l>>2]|0)+(r<<2)|0,0,c-r<<2|0)|0;r=E[n>>2]|0}E[o>>2]=c}s=e+92|0;i=E[e+4>>2]|0;n=(d[r+34>>0]|0)<<8|(d[r+33>>0]|0)<<16|(d[r+35>>0]|0);t=i+n|0;r=(d[r+37>>0]|0)<<8|(d[r+36>>0]|0)<<16|(d[r+38>>0]|0);if(!r){T=0;m=A;return T|0}E[s>>2]=t;E[e+96>>2]=t;E[e+104>>2]=r;E[e+100>>2]=i+(r+n);E[e+108>>2]=0;E[e+112>>2]=0;E[T+20>>2]=0;E[T>>2]=0;E[T+4>>2]=0;E[T+8>>2]=0;E[T+12>>2]=0;_[T+16>>0]=0;e=T+24|0;E[T+44>>2]=0;E[e>>2]=0;E[e+4>>2]=0;E[e+8>>2]=0;E[e+12>>2]=0;_[e+16>>0]=0;if(_r(s,T)|0?(f=T+24|0,_r(s,f)|0):0){if(!(E[o>>2]|0)){E[u>>2]=1138;E[u+4>>2]=906;E[u+8>>2]=1769;Si(a,1084,u)|0;Mi(a)|0}if(!c)r=1;else{n=0;t=0;o=0;r=0;a=0;e=0;u=0;i=E[l>>2]|0;while(1){n=(Er(s,T)|0)+n&31;t=(Er(s,f)|0)+t&63;o=(Er(s,T)|0)+o&31;r=(Er(s,T)|0)+r|0;a=(Er(s,f)|0)+a&63;e=(Er(s,T)|0)+e&31;E[i>>2]=t<<5|n<<11|o|r<<27|a<<21|e<<16;u=u+1|0;if((u|0)==(c|0)){r=1;break}else{r=r&31;i=i+4|0}}}}else r=0;sr(T+24|0);sr(T);T=r;m=A;return T|0}function br(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,c=0,T=0,A=0,R=0,M=0,S=0,h=0,N=0,C=0,I=0,p=0,w=0,b=0,O=0,P=0,v=0,B=0;P=m;m=m+1008|0;a=P;o=P+496|0;O=P+472|0;w=P+276|0;b=P+80|0;p=P+16|0;t=E[e+88>>2]|0;I=(d[t+47>>0]|0)<<8|(d[t+48>>0]|0);C=e+92|0;r=E[e+4>>2]|0;i=(d[t+42>>0]|0)<<8|(d[t+41>>0]|0)<<16|(d[t+43>>0]|0);n=r+i|0;t=(d[t+45>>0]|0)<<8|(d[t+44>>0]|0)<<16|(d[t+46>>0]|0);if(!t){O=0;m=P;return O|0}E[C>>2]=n;E[e+96>>2]=n;E[e+104>>2]=t;E[e+100>>2]=r+(t+i);E[e+108>>2]=0;E[e+112>>2]=0;E[O+20>>2]=0;E[O>>2]=0;E[O+4>>2]=0;E[O+8>>2]=0;E[O+12>>2]=0;_[O+16>>0]=0;if(_r(C,O)|0){i=0;n=-3;t=-3;while(1){E[w+(i<<2)>>2]=n;E[b+(i<<2)>>2]=t;r=(n|0)>2;i=i+1|0;if((i|0)==49)break;else{n=r?-3:n+1|0;t=(r&1)+t|0}}r=p;i=r+64|0;do{E[r>>2]=0;r=r+4|0}while((r|0)<(i|0));N=e+252|0;i=e+256|0;r=E[i>>2]|0;e:do if((r|0)==(I|0))u=13;else{if(r>>>0<=I>>>0){do if((E[e+260>>2]|0)>>>0<I>>>0)if(rr(N,I,(r+1|0)==(I|0),4,0)|0){r=E[i>>2]|0;break}else{_[e+264>>0]=1;r=0;break e}while(0);qi((E[N>>2]|0)+(r<<2)|0,0,I-r<<2|0)|0}E[i>>2]=I;u=13}while(0);do if((u|0)==13){if(!I){E[a>>2]=1138;E[a+4>>2]=906;E[a+8>>2]=1769;Si(o,1084,a)|0;Mi(o)|0;r=1;break}n=p+4|0;t=p+8|0;e=p+12|0;o=p+16|0;a=p+20|0;u=p+24|0;s=p+28|0;l=p+32|0;f=p+36|0;c=p+40|0;T=p+44|0;A=p+48|0;R=p+52|0;M=p+56|0;S=p+60|0;h=0;i=E[N>>2]|0;while(1){r=0;do{v=Er(C,O)|0;N=r<<1;B=p+(N<<2)|0;E[B>>2]=(E[B>>2]|0)+(E[w+(v<<2)>>2]|0)&3;N=p+((N|1)<<2)|0;E[N>>2]=(E[N>>2]|0)+(E[b+(v<<2)>>2]|0)&3;r=r+1|0}while((r|0)!=8);E[i>>2]=(d[1713+(E[n>>2]|0)>>0]|0)<<2|(d[1713+(E[p>>2]|0)>>0]|0)|(d[1713+(E[t>>2]|0)>>0]|0)<<4|(d[1713+(E[e>>2]|0)>>0]|0)<<6|(d[1713+(E[o>>2]|0)>>0]|0)<<8|(d[1713+(E[a>>2]|0)>>0]|0)<<10|(d[1713+(E[u>>2]|0)>>0]|0)<<12|(d[1713+(E[s>>2]|0)>>0]|0)<<14|(d[1713+(E[l>>2]|0)>>0]|0)<<16|(d[1713+(E[f>>2]|0)>>0]|0)<<18|(d[1713+(E[c>>2]|0)>>0]|0)<<20|(d[1713+(E[T>>2]|0)>>0]|0)<<22|(d[1713+(E[A>>2]|0)>>0]|0)<<24|(d[1713+(E[R>>2]|0)>>0]|0)<<26|(d[1713+(E[M>>2]|0)>>0]|0)<<28|(d[1713+(E[S>>2]|0)>>0]|0)<<30;h=h+1|0;if((h|0)==(I|0)){r=1;break}else i=i+4|0}}while(0)}else r=0;sr(O);B=r;m=P;return B|0}function Or(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,T=0;T=m;m=m+560|0;u=T;a=T+40|0;f=T+16|0;t=E[e+88>>2]|0;l=(d[t+55>>0]|0)<<8|(d[t+56>>0]|0);s=e+92|0;r=E[e+4>>2]|0;i=(d[t+50>>0]|0)<<8|(d[t+49>>0]|0)<<16|(d[t+51>>0]|0);n=r+i|0;t=(d[t+53>>0]|0)<<8|(d[t+52>>0]|0)<<16|(d[t+54>>0]|0);if(!t){f=0;m=T;return f|0}E[s>>2]=n;E[e+96>>2]=n;E[e+104>>2]=t;E[e+100>>2]=r+(t+i);E[e+108>>2]=0;E[e+112>>2]=0;E[f+20>>2]=0;E[f>>2]=0;E[f+4>>2]=0;E[f+8>>2]=0;E[f+12>>2]=0;_[f+16>>0]=0;e:do if(_r(s,f)|0){o=e+268|0;i=e+272|0;r=E[i>>2]|0;if((r|0)!=(l|0)){if(r>>>0<=l>>>0){do if((E[e+276>>2]|0)>>>0<l>>>0)if(rr(o,l,(r+1|0)==(l|0),2,0)|0){r=E[i>>2]|0;break}else{_[e+280>>0]=1;r=0;break e}while(0);qi((E[o>>2]|0)+(r<<1)|0,0,l-r<<1|0)|0}E[i>>2]=l}if(!l){E[u>>2]=1138;E[u+4>>2]=906;E[u+8>>2]=1769;Si(a,1084,u)|0;Mi(a)|0;r=1;break}i=0;n=0;t=0;r=E[o>>2]|0;while(1){u=Er(s,f)|0;i=u+i&255;n=(Er(s,f)|0)+n&255;c[r>>1]=n<<8|i;t=t+1|0;if((t|0)==(l|0)){r=1;break}else r=r+2|0}}else r=0;while(0);sr(f);f=r;m=T;return f|0}function Pr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,T=0,A=0,R=0,M=0,S=0,h=0,N=0,C=0,I=0,p=0,w=0,b=0,O=0,P=0,v=0,B=0,L=0;v=m;m=m+2416|0;a=v;o=v+1904|0;P=v+1880|0;b=v+980|0;O=v+80|0;w=v+16|0;t=E[e+88>>2]|0;p=(d[t+63>>0]|0)<<8|(d[t+64>>0]|0);I=e+92|0;r=E[e+4>>2]|0;i=(d[t+58>>0]|0)<<8|(d[t+57>>0]|0)<<16|(d[t+59>>0]|0);n=r+i|0;t=(d[t+61>>0]|0)<<8|(d[t+60>>0]|0)<<16|(d[t+62>>0]|0);if(!t){P=0;m=v;return P|0}E[I>>2]=n;E[e+96>>2]=n;E[e+104>>2]=t;E[e+100>>2]=r+(t+i);E[e+108>>2]=0;E[e+112>>2]=0;E[P+20>>2]=0;E[P>>2]=0;E[P+4>>2]=0;E[P+8>>2]=0;E[P+12>>2]=0;_[P+16>>0]=0;if(_r(I,P)|0){i=0;n=-7;t=-7;while(1){E[b+(i<<2)>>2]=n;E[O+(i<<2)>>2]=t;r=(n|0)>6;i=i+1|0;if((i|0)==225)break;else{n=r?-7:n+1|0;t=(r&1)+t|0}}r=w;i=r+64|0;do{E[r>>2]=0;r=r+4|0}while((r|0)<(i|0));C=e+284|0;i=p*3|0;n=e+288|0;r=E[n>>2]|0;e:do if((r|0)==(i|0))u=13;else{if(r>>>0<=i>>>0){do if((E[e+292>>2]|0)>>>0<i>>>0)if(rr(C,i,(r+1|0)==(i|0),2,0)|0){r=E[n>>2]|0;break}else{_[e+296>>0]=1;r=0;break e}while(0);qi((E[C>>2]|0)+(r<<1)|0,0,i-r<<1|0)|0}E[n>>2]=i;u=13}while(0);do if((u|0)==13){if(!p){E[a>>2]=1138;E[a+4>>2]=906;E[a+8>>2]=1769;Si(o,1084,a)|0;Mi(o)|0;r=1;break}n=w+4|0;t=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;u=w+24|0;s=w+28|0;l=w+32|0;f=w+36|0;T=w+40|0;A=w+44|0;R=w+48|0;M=w+52|0;S=w+56|0;h=w+60|0;N=0;i=E[C>>2]|0;while(1){r=0;do{B=Er(I,P)|0;C=r<<1;L=w+(C<<2)|0;E[L>>2]=(E[L>>2]|0)+(E[b+(B<<2)>>2]|0)&7;C=w+((C|1)<<2)|0;E[C>>2]=(E[C>>2]|0)+(E[O+(B<<2)>>2]|0)&7;r=r+1|0}while((r|0)!=8);B=d[1717+(E[a>>2]|0)>>0]|0;c[i>>1]=(d[1717+(E[n>>2]|0)>>0]|0)<<3|(d[1717+(E[w>>2]|0)>>0]|0)|(d[1717+(E[t>>2]|0)>>0]|0)<<6|(d[1717+(E[e>>2]|0)>>0]|0)<<9|(d[1717+(E[o>>2]|0)>>0]|0)<<12|B<<15;L=d[1717+(E[T>>2]|0)>>0]|0;c[i+2>>1]=(d[1717+(E[u>>2]|0)>>0]|0)<<2|B>>>1|(d[1717+(E[s>>2]|0)>>0]|0)<<5|(d[1717+(E[l>>2]|0)>>0]|0)<<8|(d[1717+(E[f>>2]|0)>>0]|0)<<11|L<<14;c[i+4>>1]=(d[1717+(E[A>>2]|0)>>0]|0)<<1|L>>>2|(d[1717+(E[R>>2]|0)>>0]|0)<<4|(d[1717+(E[M>>2]|0)>>0]|0)<<7|(d[1717+(E[S>>2]|0)>>0]|0)<<10|(d[1717+(E[h>>2]|0)>>0]|0)<<13;N=N+1|0;if((N|0)==(p|0)){r=1;break}else i=i+6|0}}while(0)}else r=0;sr(P);L=r;m=v;return L|0}function vr(e,r,i,n,t,o,a,u){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;a=a|0;u=u|0;var s=0,l=0,f=0,c=0,T=0,A=0,R=0,M=0,S=0,h=0,N=0,C=0,I=0,p=0,w=0,b=0,O=0,P=0,v=0,B=0,L=0,k=0,F=0,g=0,U=0,D=0,y=0,G=0,H=0,X=0,V=0,Y=0,x=0,K=0,W=0,z=0,q=0,j=0,Z=0,J=0,Q=0,$=0,ee=0,re=0,ie=0,ne=0,te=0,oe=0,ae=0,ue=0,se=0;ae=m;m=m+656|0;te=ae+112|0;ie=ae+96|0;re=ae+80|0;ee=ae+64|0;$=ae+48|0;oe=ae+32|0;ne=ae+16|0;Q=ae;Z=ae+144|0;J=ae+128|0;Y=e+240|0;x=E[Y>>2]|0;z=e+256|0;q=E[z>>2]|0;i=_[(E[e+88>>2]|0)+17>>0]|0;j=n>>>2;if(!(i<<24>>24)){m=ae;return 1}K=(u|0)==0;W=u+-1|0;U=(o&1|0)!=0;D=n<<1;y=e+92|0;G=e+116|0;H=e+140|0;X=e+236|0;V=a+-1|0;g=(t&1|0)!=0;F=e+188|0;P=e+252|0;v=j+1|0;B=j+2|0;L=j+3|0;k=V<<4;b=i&255;i=0;o=0;t=1;O=0;do{if(!K){p=E[r+(O<<2)>>2]|0;w=0;while(1){N=w&1;s=(N|0)==0;h=(N<<5^32)+-16|0;N=(N<<1^2)+-1|0;I=s?a:-1;l=s?0:V;e=(w|0)==(W|0);C=U&e;if((l|0)!=(I|0)){S=U&e^1;M=s?p:p+k|0;while(1){if((t|0)==1)t=Er(y,G)|0|512;R=t&7;t=t>>>3;s=d[1811+R>>0]|0;e=0;do{T=(Er(y,H)|0)+o|0;A=T-x|0;o=A>>31;o=o&T|A&~o;if((E[Y>>2]|0)>>>0<=o>>>0){E[Q>>2]=1138;E[Q+4>>2]=906;E[Q+8>>2]=1769;Si(Z,1084,Q)|0;Mi(Z)|0}E[J+(e<<2)>>2]=E[(E[X>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0<s>>>0);A=g&(l|0)==(V|0);if(C|A){T=0;do{f=fe(T,n)|0;e=M+f|0;s=(T|0)==0|S;c=T<<1;se=(Er(y,F)|0)+i|0;ue=se-q|0;i=ue>>31;i=i&se|ue&~i;do if(A){if(!s){ue=(Er(y,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;break}E[e>>2]=E[J+((d[1819+(R<<2)+c>>0]|0)<<2)>>2];if((E[z>>2]|0)>>>0<=i>>>0){E[ie>>2]=1138;E[ie+4>>2]=906;E[ie+8>>2]=1769;Si(Z,1084,ie)|0;Mi(Z)|0}E[M+(f+4)>>2]=E[(E[P>>2]|0)+(i<<2)>>2];ue=(Er(y,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i}else{if(!s){ue=(Er(y,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;break}E[e>>2]=E[J+((d[1819+(R<<2)+c>>0]|0)<<2)>>2];if((E[z>>2]|0)>>>0<=i>>>0){E[re>>2]=1138;E[re+4>>2]=906;E[re+8>>2]=1769;Si(Z,1084,re)|0;Mi(Z)|0}E[M+(f+4)>>2]=E[(E[P>>2]|0)+(i<<2)>>2];ue=(Er(y,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;E[M+(f+8)>>2]=E[J+((d[(c|1)+(1819+(R<<2))>>0]|0)<<2)>>2];if((E[z>>2]|0)>>>0<=i>>>0){E[te>>2]=1138;E[te+4>>2]=906;E[te+8>>2]=1769;Si(Z,1084,te)|0;Mi(Z)|0}E[M+(f+12)>>2]=E[(E[P>>2]|0)+(i<<2)>>2]}while(0);T=T+1|0}while((T|0)!=2)}else{E[M>>2]=E[J+((d[1819+(R<<2)>>0]|0)<<2)>>2];ue=(Er(y,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;if((E[z>>2]|0)>>>0<=i>>>0){E[ne>>2]=1138;E[ne+4>>2]=906;E[ne+8>>2]=1769;Si(Z,1084,ne)|0;Mi(Z)|0}E[M+4>>2]=E[(E[P>>2]|0)+(i<<2)>>2];E[M+8>>2]=E[J+((d[1819+(R<<2)+1>>0]|0)<<2)>>2];ue=(Er(y,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;if((E[z>>2]|0)>>>0<=i>>>0){E[oe>>2]=1138;E[oe+4>>2]=906;E[oe+8>>2]=1769;Si(Z,1084,oe)|0;Mi(Z)|0}E[M+12>>2]=E[(E[P>>2]|0)+(i<<2)>>2];E[M+(j<<2)>>2]=E[J+((d[1819+(R<<2)+2>>0]|0)<<2)>>2];ue=(Er(y,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;if((E[z>>2]|0)>>>0<=i>>>0){E[$>>2]=1138;E[$+4>>2]=906;E[$+8>>2]=1769;Si(Z,1084,$)|0;Mi(Z)|0}E[M+(v<<2)>>2]=E[(E[P>>2]|0)+(i<<2)>>2];E[M+(B<<2)>>2]=E[J+((d[1819+(R<<2)+3>>0]|0)<<2)>>2];ue=(Er(y,F)|0)+i|0;se=ue-q|0;i=se>>31;i=i&ue|se&~i;if((E[z>>2]|0)>>>0<=i>>>0){E[ee>>2]=1138;E[ee+4>>2]=906;E[ee+8>>2]=1769;Si(Z,1084,ee)|0;Mi(Z)|0}E[M+(L<<2)>>2]=E[(E[P>>2]|0)+(i<<2)>>2]}l=l+N|0;if((l|0)==(I|0))break;else M=M+h|0}}w=w+1|0;if((w|0)==(u|0))break;else p=p+D|0}}O=O+1|0}while((O|0)!=(b|0));m=ae;return 1}function Br(e,r,i,n,t,o,a,u){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;a=a|0;u=u|0;var s=0,l=0,f=0,c=0,A=0,R=0,M=0,S=0,h=0,N=0,C=0,I=0,p=0,w=0,b=0,O=0,P=0,v=0,B=0,L=0,k=0,F=0,g=0,U=0,D=0,y=0,G=0,H=0,X=0,V=0,Y=0,x=0,K=0,W=0,z=0,q=0,j=0,Z=0,J=0,Q=0,$=0,ee=0,re=0,ie=0,ne=0,te=0,oe=0,ae=0,ue=0,se=0,le=0,fe=0,_e=0,ce=0,Ee=0;ce=m;m=m+608|0;le=ce+48|0;_e=ce+32|0;fe=ce+16|0;se=ce;ae=ce+96|0;ue=ce+80|0;oe=ce+64|0;x=e+240|0;K=E[x>>2]|0;q=e+256|0;ie=E[q>>2]|0;ne=e+272|0;te=E[ne>>2]|0;i=E[e+88>>2]|0;W=(d[i+63>>0]|0)<<8|(d[i+64>>0]|0);i=_[i+17>>0]|0;if(!(i<<24>>24)){m=ce;return 1}z=(u|0)==0;j=u+-1|0;Z=n<<1;J=e+92|0;Q=e+116|0;$=a+-1|0;ee=e+212|0;re=e+188|0;Y=(t&1|0)==0;V=(o&1|0)==0;U=e+288|0;D=e+284|0;y=e+252|0;G=e+140|0;H=e+236|0;X=e+164|0;F=e+268|0;g=$<<5;L=i&255;i=0;t=0;o=0;e=0;s=1;k=0;do{if(!z){v=E[r+(k<<2)>>2]|0;B=0;while(1){O=B&1;l=(O|0)==0;b=(O<<6^64)+-32|0;O=(O<<1^2)+-1|0;P=l?a:-1;f=l?0:$;if((f|0)!=(P|0)){w=V|(B|0)!=(j|0);p=l?v:v+g|0;while(1){if((s|0)==1)s=Er(J,Q)|0|512;I=s&7;s=s>>>3;c=d[1811+I>>0]|0;l=0;do{N=(Er(J,X)|0)+t|0;C=N-te|0;t=C>>31;t=t&N|C&~t;if((E[ne>>2]|0)>>>0<=t>>>0){E[se>>2]=1138;E[se+4>>2]=906;E[se+8>>2]=1769;Si(ae,1084,se)|0;Mi(ae)|0}E[oe+(l<<2)>>2]=T[(E[F>>2]|0)+(t<<1)>>1];l=l+1|0}while(l>>>0<c>>>0);l=0;do{N=(Er(J,G)|0)+e|0;C=N-K|0;e=C>>31;e=e&N|C&~e;if((E[x>>2]|0)>>>0<=e>>>0){E[fe>>2]=1138;E[fe+4>>2]=906;E[fe+8>>2]=1769;Si(ae,1084,fe)|0;Mi(ae)|0}E[ue+(l<<2)>>2]=E[(E[H>>2]|0)+(e<<2)>>2];l=l+1|0}while(l>>>0<c>>>0);C=Y|(f|0)!=($|0);h=0;N=p;while(1){S=w|(h|0)==0;M=h<<1;A=0;R=N;while(1){c=(Er(J,ee)|0)+i|0;l=c-W|0;i=l>>31;i=i&c|l&~i;l=(Er(J,re)|0)+o|0;c=l-ie|0;o=c>>31;o=o&l|c&~o;if((C|(A|0)==0)&S){l=d[A+M+(1819+(I<<2))>>0]|0;c=i*3|0;if((E[U>>2]|0)>>>0<=c>>>0){E[_e>>2]=1138;E[_e+4>>2]=906;E[_e+8>>2]=1769;Si(ae,1084,_e)|0;Mi(ae)|0}Ee=E[D>>2]|0;E[R>>2]=(T[Ee+(c<<1)>>1]|0)<<16|E[oe+(l<<2)>>2];E[R+4>>2]=(T[Ee+(c+2<<1)>>1]|0)<<16|(T[Ee+(c+1<<1)>>1]|0);E[R+8>>2]=E[ue+(l<<2)>>2];if((E[q>>2]|0)>>>0<=o>>>0){E[le>>2]=1138;E[le+4>>2]=906;E[le+8>>2]=1769;Si(ae,1084,le)|0;Mi(ae)|0}E[R+12>>2]=E[(E[y>>2]|0)+(o<<2)>>2]}A=A+1|0;if((A|0)==2)break;else R=R+16|0}h=h+1|0;if((h|0)==2)break;else N=N+n|0}f=f+O|0;if((f|0)==(P|0))break;else p=p+b|0}}B=B+1|0;if((B|0)==(u|0))break;else v=v+Z|0}}k=k+1|0}while((k|0)!=(L|0));m=ce;return 1}function Lr(e,r,i,n,t,o,a,u){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;a=a|0;u=u|0;var s=0,l=0,f=0,c=0,A=0,R=0,M=0,S=0,h=0,N=0,C=0,I=0,p=0,w=0,b=0,O=0,P=0,v=0,B=0,L=0,k=0,F=0,g=0,U=0,D=0,y=0,G=0,H=0,X=0,V=0,Y=0,x=0,K=0,W=0,z=0,q=0,j=0,Z=0,J=0,Q=0,$=0;$=m;m=m+576|0;Q=$+32|0;J=$+16|0;Z=$;j=$+64|0;q=$+48|0;y=e+272|0;G=E[y>>2]|0;i=E[e+88>>2]|0;H=(d[i+63>>0]|0)<<8|(d[i+64>>0]|0);i=_[i+17>>0]|0;if(!(i<<24>>24)){m=$;return 1}X=(u|0)==0;V=u+-1|0;Y=n<<1;x=e+92|0;K=e+116|0;W=a+-1|0;z=e+212|0;D=(o&1|0)==0;F=e+288|0;g=e+284|0;U=e+164|0;L=e+268|0;k=W<<4;B=i&255;v=(t&1|0)!=0;i=0;o=0;e=1;P=0;do{if(!X){b=E[r+(P<<2)>>2]|0;O=0;while(1){p=O&1;t=(p|0)==0;I=(p<<5^32)+-16|0;p=(p<<1^2)+-1|0;w=t?a:-1;s=t?0:W;if((s|0)!=(w|0)){C=D|(O|0)!=(V|0);N=t?b:b+k|0;while(1){if((e|0)==1)e=Er(x,K)|0|512;h=e&7;e=e>>>3;l=d[1811+h>>0]|0;t=0;do{M=(Er(x,U)|0)+o|0;S=M-G|0;o=S>>31;o=o&M|S&~o;if((E[y>>2]|0)>>>0<=o>>>0){E[Z>>2]=1138;E[Z+4>>2]=906;E[Z+8>>2]=1769;Si(j,1084,Z)|0;Mi(j)|0}E[q+(t<<2)>>2]=T[(E[L>>2]|0)+(o<<1)>>1];t=t+1|0}while(t>>>0<l>>>0);S=(s|0)==(W|0)&v;R=0;M=N;while(1){A=C|(R|0)==0;c=R<<1;t=(Er(x,z)|0)+i|0;f=t-H|0;l=f>>31;l=l&t|f&~l;if(A){i=d[1819+(h<<2)+c>>0]|0;t=l*3|0;if((E[F>>2]|0)>>>0<=t>>>0){E[J>>2]=1138;E[J+4>>2]=906;E[J+8>>2]=1769;Si(j,1084,J)|0;Mi(j)|0}f=E[g>>2]|0;E[M>>2]=(T[f+(t<<1)>>1]|0)<<16|E[q+(i<<2)>>2];E[M+4>>2]=(T[f+(t+2<<1)>>1]|0)<<16|(T[f+(t+1<<1)>>1]|0)}f=M+8|0;t=(Er(x,z)|0)+l|0;l=t-H|0;i=l>>31;i=i&t|l&~i;if(!(S|A^1)){t=d[(c|1)+(1819+(h<<2))>>0]|0;l=i*3|0;if((E[F>>2]|0)>>>0<=l>>>0){E[Q>>2]=1138;E[Q+4>>2]=906;E[Q+8>>2]=1769;Si(j,1084,Q)|0;Mi(j)|0}A=E[g>>2]|0;E[f>>2]=(T[A+(l<<1)>>1]|0)<<16|E[q+(t<<2)>>2];E[M+12>>2]=(T[A+(l+2<<1)>>1]|0)<<16|(T[A+(l+1<<1)>>1]|0)}R=R+1|0;if((R|0)==2)break;else M=M+n|0}s=s+p|0;if((s|0)==(w|0))break;else N=N+I|0}}O=O+1|0;if((O|0)==(u|0))break;else b=b+Y|0}}P=P+1|0}while((P|0)!=(B|0));m=$;return 1}function kr(e,r,i,n,t,o,a,u){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;a=a|0;u=u|0;var s=0,l=0,f=0,c=0,A=0,R=0,M=0,S=0,h=0,N=0,C=0,I=0,p=0,w=0,b=0,O=0,P=0,v=0,B=0,L=0,k=0,F=0,g=0,U=0,D=0,y=0,G=0,H=0,X=0,V=0,Y=0,x=0,K=0,W=0,z=0,q=0,j=0,Z=0,J=0,Q=0,$=0,ee=0,re=0,ie=0,ne=0,te=0,oe=0,ae=0,ue=0;ue=m;m=m+608|0;te=ue+48|0;ae=ue+32|0;oe=ue+16|0;ne=ue;ie=ue+96|0;ee=ue+80|0;re=ue+64|0;x=e+272|0;K=E[x>>2]|0;i=E[e+88>>2]|0;W=(d[i+63>>0]|0)<<8|(d[i+64>>0]|0);i=_[i+17>>0]|0;if(!(i<<24>>24)){m=ue;return 1}z=(u|0)==0;q=u+-1|0;j=n<<1;Z=e+92|0;J=e+116|0;Q=a+-1|0;$=e+212|0;Y=(t&1|0)==0;V=(o&1|0)==0;G=e+288|0;H=e+284|0;X=e+164|0;D=e+268|0;y=Q<<5;g=i&255;i=0;t=0;o=0;e=0;s=1;U=0;do{if(!z){k=E[r+(U<<2)>>2]|0;F=0;while(1){B=F&1;l=(B|0)==0;v=(B<<6^64)+-32|0;B=(B<<1^2)+-1|0;L=l?a:-1;f=l?0:Q;if((f|0)!=(L|0)){P=V|(F|0)!=(q|0);O=l?k:k+y|0;while(1){if((s|0)==1)s=Er(Z,J)|0|512;b=s&7;s=s>>>3;c=d[1811+b>>0]|0;l=0;do{p=(Er(Z,X)|0)+e|0;w=p-K|0;e=w>>31;e=e&p|w&~e;if((E[x>>2]|0)>>>0<=e>>>0){E[ne>>2]=1138;E[ne+4>>2]=906;E[ne+8>>2]=1769;Si(ie,1084,ne)|0;Mi(ie)|0}E[ee+(l<<2)>>2]=T[(E[D>>2]|0)+(e<<1)>>1];l=l+1|0}while(l>>>0<c>>>0);l=0;do{p=(Er(Z,X)|0)+t|0;w=p-K|0;t=w>>31;t=t&p|w&~t;if((E[x>>2]|0)>>>0<=t>>>0){E[oe>>2]=1138;E[oe+4>>2]=906;E[oe+8>>2]=1769;Si(ie,1084,oe)|0;Mi(ie)|0}E[re+(l<<2)>>2]=T[(E[D>>2]|0)+(t<<1)>>1];l=l+1|0}while(l>>>0<c>>>0);w=Y|(f|0)!=(Q|0);I=0;p=O;while(1){C=P|(I|0)==0;N=I<<1;S=0;h=p;while(1){M=(Er(Z,$)|0)+o|0;R=M-W|0;o=R>>31;o=o&M|R&~o;R=(Er(Z,$)|0)+i|0;M=R-W|0;i=M>>31;i=i&R|M&~i;if((w|(S|0)==0)&C){R=d[S+N+(1819+(b<<2))>>0]|0;M=o*3|0;l=E[G>>2]|0;if(l>>>0<=M>>>0){E[ae>>2]=1138;E[ae+4>>2]=906;E[ae+8>>2]=1769;Si(ie,1084,ae)|0;Mi(ie)|0;l=E[G>>2]|0}c=E[H>>2]|0;A=i*3|0;if(l>>>0>A>>>0)l=c;else{E[te>>2]=1138;E[te+4>>2]=906;E[te+8>>2]=1769;Si(ie,1084,te)|0;Mi(ie)|0;l=E[H>>2]|0}E[h>>2]=(T[c+(M<<1)>>1]|0)<<16|E[ee+(R<<2)>>2];E[h+4>>2]=(T[c+(M+2<<1)>>1]|0)<<16|(T[c+(M+1<<1)>>1]|0);E[h+8>>2]=(T[l+(A<<1)>>1]|0)<<16|E[re+(R<<2)>>2];E[h+12>>2]=(T[l+(A+2<<1)>>1]|0)<<16|(T[l+(A+1<<1)>>1]|0)}S=S+1|0;if((S|0)==2)break;else h=h+16|0}I=I+1|0;if((I|0)==2)break;else p=p+n|0}f=f+B|0;if((f|0)==(L|0))break;else O=O+v|0}}F=F+1|0;if((F|0)==(u|0))break;else k=k+j|0}}U=U+1|0}while((U|0)!=(g|0));m=ue;return 1}function Fr(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0;s=m;m=m+576|0;u=s+48|0;o=s+32|0;t=s+16|0;n=s;a=s+64|0;E[e>>2]=0;r=e+284|0;i=E[r>>2]|0;if(i){if(!(i&7))or(i,0,0,1,0)|0;else{E[n>>2]=1138;E[n+4>>2]=2502;E[n+8>>2]=1504;Si(a,1084,n)|0;Mi(a)|0}E[r>>2]=0;E[e+288>>2]=0;E[e+292>>2]=0}_[e+296>>0]=0;i=e+268|0;r=E[i>>2]|0;if(r){if(!(r&7))or(r,0,0,1,0)|0;else{E[t>>2]=1138;E[t+4>>2]=2502;E[t+8>>2]=1504;Si(a,1084,t)|0;Mi(a)|0}E[i>>2]=0;E[e+272>>2]=0;E[e+276>>2]=0}_[e+280>>0]=0;r=e+252|0;i=E[r>>2]|0;if(i){if(!(i&7))or(i,0,0,1,0)|0;else{E[o>>2]=1138;E[o+4>>2]=2502;E[o+8>>2]=1504;Si(a,1084,o)|0;Mi(a)|0}E[r>>2]=0;E[e+256>>2]=0;E[e+260>>2]=0}_[e+264>>0]=0;r=e+236|0;i=E[r>>2]|0;if(!i){u=e+248|0;_[u>>0]=0;u=e+212|0;sr(u);u=e+188|0;sr(u);u=e+164|0;sr(u);u=e+140|0;sr(u);u=e+116|0;sr(u);m=s;return}if(!(i&7))or(i,0,0,1,0)|0;else{E[u>>2]=1138;E[u+4>>2]=2502;E[u+8>>2]=1504;Si(a,1084,u)|0;Mi(a)|0}E[r>>2]=0;E[e+240>>2]=0;E[e+244>>2]=0;u=e+248|0;_[u>>0]=0;u=e+212|0;sr(u);u=e+188|0;sr(u);u=e+164|0;sr(u);u=e+140|0;sr(u);u=e+116|0;sr(u);m=s;return}function gr(e,r){e=e|0;r=r|0;var i=0;i=m;m=m+16|0;E[i>>2]=r;r=E[60]|0;mi(r,e,i)|0;di(10,r)|0;Pe()}function Ur(){var e=0,r=0;e=m;m=m+16|0;if(!(Ge(192,2)|0)){r=Ie(E[47]|0)|0;m=e;return r|0}else gr(2078,e);return 0}function Dr(e){e=e|0;Hi(e);return}function yr(e){e=e|0;var r=0;r=m;m=m+16|0;Pn[e&3]();gr(2127,r)}function Gr(){var e=0,r=0;e=Ur()|0;if(((e|0)!=0?(r=E[e>>2]|0,(r|0)!=0):0)?(e=r+48|0,(E[e>>2]&-256|0)==1126902528?(E[e+4>>2]|0)==1129074247:0):0)yr(E[r+12>>2]|0);r=E[26]|0;E[26]=r+0;yr(r)}function Hr(e){e=e|0;return}function Xr(e){e=e|0;return}function Vr(e){e=e|0;return}function Yr(e){e=e|0;return}function xr(e){e=e|0;Dr(e);return}function Kr(e){e=e|0;Dr(e);return}function Wr(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0;a=m;m=m+64|0;o=a;if((e|0)!=(r|0))if((r|0)!=0?(t=Zr(r,24,40,0)|0,(t|0)!=0):0){r=o;n=r+56|0;do{E[r>>2]=0;r=r+4|0}while((r|0)<(n|0));E[o>>2]=t;E[o+8>>2]=e;E[o+12>>2]=-1;E[o+48>>2]=1;Bn[E[(E[t>>2]|0)+28>>2]&3](t,o,E[i>>2]|0,1);if((E[o+24>>2]|0)==1){E[i>>2]=E[o+16>>2];r=1}else r=0}else r=0;else r=1;m=a;return r|0}function zr(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0;e=r+16|0;t=E[e>>2]|0;do if(t){if((t|0)!=(i|0)){n=r+36|0;E[n>>2]=(E[n>>2]|0)+1;E[r+24>>2]=2;_[r+54>>0]=1;break}e=r+24|0;if((E[e>>2]|0)==2)E[e>>2]=n}else{E[e>>2]=i;E[r+24>>2]=n;E[r+36>>2]=1}while(0);return}function qr(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;if((e|0)==(E[r+8>>2]|0))zr(0,r,i,n);return}function jr(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;if((e|0)==(E[r+8>>2]|0))zr(0,r,i,n);else{e=E[e+8>>2]|0;Bn[E[(E[e>>2]|0)+28>>2]&3](e,r,i,n)}return}function Zr(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0,u=0,s=0,l=0,f=0,d=0,T=0,A=0;A=m;m=m+64|0;T=A;d=E[e>>2]|0;f=e+(E[d+-8>>2]|0)|0;d=E[d+-4>>2]|0;E[T>>2]=i;E[T+4>>2]=e;E[T+8>>2]=r;E[T+12>>2]=n;n=T+16|0;e=T+20|0;r=T+24|0;t=T+28|0;o=T+32|0;a=T+40|0;u=(d|0)==(i|0);s=n;l=s+36|0;do{E[s>>2]=0;s=s+4|0}while((s|0)<(l|0));c[n+36>>1]=0;_[n+38>>0]=0;e:do if(u){E[T+48>>2]=1;vn[E[(E[i>>2]|0)+20>>2]&3](i,T,f,f,1,0);n=(E[r>>2]|0)==1?f:0}else{pn[E[(E[d>>2]|0)+24>>2]&3](d,T,f,1,0);switch(E[T+36>>2]|0){case 0:{n=(E[a>>2]|0)==1&(E[t>>2]|0)==1&(E[o>>2]|0)==1?E[e>>2]|0:0;break e}case 1:break;default:{n=0;break e}}if((E[r>>2]|0)!=1?!((E[a>>2]|0)==0&(E[t>>2]|0)==1&(E[o>>2]|0)==1):0){n=0;break}n=E[n>>2]|0}while(0);m=A;return n|0}function Jr(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;_[r+53>>0]=1;do if((E[r+4>>2]|0)==(n|0)){_[r+52>>0]=1;n=r+16|0;e=E[n>>2]|0;if(!e){E[n>>2]=i;E[r+24>>2]=t;E[r+36>>2]=1;if(!((t|0)==1?(E[r+48>>2]|0)==1:0))break;_[r+54>>0]=1;break}if((e|0)!=(i|0)){t=r+36|0;E[t>>2]=(E[t>>2]|0)+1;_[r+54>>0]=1;break}e=r+24|0;n=E[e>>2]|0;if((n|0)==2){E[e>>2]=t;n=t}if((n|0)==1?(E[r+48>>2]|0)==1:0)_[r+54>>0]=1}while(0);return}function Qr(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0,u=0,s=0;e:do if((e|0)==(E[r+8>>2]|0)){if((E[r+4>>2]|0)==(i|0)?(o=r+28|0,(E[o>>2]|0)!=1):0)E[o>>2]=n}else{if((e|0)!=(E[r>>2]|0)){u=E[e+8>>2]|0;pn[E[(E[u>>2]|0)+24>>2]&3](u,r,i,n,t);break}if((E[r+16>>2]|0)!=(i|0)?(a=r+20|0,(E[a>>2]|0)!=(i|0)):0){E[r+32>>2]=n;n=r+44|0;if((E[n>>2]|0)==4)break;o=r+52|0;_[o>>0]=0;s=r+53|0;_[s>>0]=0;e=E[e+8>>2]|0;vn[E[(E[e>>2]|0)+20>>2]&3](e,r,i,i,1,t);if(_[s>>0]|0){if(!(_[o>>0]|0)){o=1;u=13}}else{o=0;u=13}do if((u|0)==13){E[a>>2]=i;s=r+40|0;E[s>>2]=(E[s>>2]|0)+1;if((E[r+36>>2]|0)==1?(E[r+24>>2]|0)==2:0){_[r+54>>0]=1;if(o)break}else u=16;if((u|0)==16?o:0)break;E[n>>2]=4;break e}while(0);E[n>>2]=3;break}if((n|0)==1)E[r+32>>2]=1}while(0);return}function $r(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0;do if((e|0)==(E[r+8>>2]|0)){if((E[r+4>>2]|0)==(i|0)?(a=r+28|0,(E[a>>2]|0)!=1):0)E[a>>2]=n}else if((e|0)==(E[r>>2]|0)){if((E[r+16>>2]|0)!=(i|0)?(o=r+20|0,(E[o>>2]|0)!=(i|0)):0){E[r+32>>2]=n;E[o>>2]=i;t=r+40|0;E[t>>2]=(E[t>>2]|0)+1;if((E[r+36>>2]|0)==1?(E[r+24>>2]|0)==2:0)_[r+54>>0]=1;E[r+44>>2]=4;break; +}if((n|0)==1)E[r+32>>2]=1}while(0);return}function ei(e,r,i,n,t,o){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;if((e|0)==(E[r+8>>2]|0))Jr(0,r,i,n,t);else{e=E[e+8>>2]|0;vn[E[(E[e>>2]|0)+20>>2]&3](e,r,i,n,t,o)}return}function ri(e,r,i,n,t,o){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;if((e|0)==(E[r+8>>2]|0))Jr(0,r,i,n,t);return}function ii(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0;t=m;m=m+16|0;n=t;E[n>>2]=E[i>>2];e=In[E[(E[e>>2]|0)+16>>2]&7](e,r,n)|0;if(e)E[i>>2]=E[n>>2];m=t;return e&1|0}function ni(e){e=e|0;if(!e)e=0;else e=(Zr(e,24,72,0)|0)!=0;return e&1|0}function ti(){var e=0,r=0,i=0,n=0,t=0,o=0,a=0,u=0;t=m;m=m+48|0;a=t+32|0;i=t+24|0;u=t+16|0;o=t;t=t+36|0;e=Ur()|0;if((e|0)!=0?(n=E[e>>2]|0,(n|0)!=0):0){e=n+48|0;r=E[e>>2]|0;e=E[e+4>>2]|0;if(!((r&-256|0)==1126902528&(e|0)==1129074247)){E[i>>2]=2406;gr(2356,i)}if((r|0)==1126902529&(e|0)==1129074247)e=E[n+44>>2]|0;else e=n+80|0;E[t>>2]=e;n=E[n>>2]|0;e=E[n+4>>2]|0;if(In[E[(E[8>>2]|0)+16>>2]&7](8,n,t)|0){u=E[t>>2]|0;u=bn[E[(E[u>>2]|0)+8>>2]&1](u)|0;E[o>>2]=2406;E[o+4>>2]=e;E[o+8>>2]=u;gr(2270,o)}else{E[u>>2]=2406;E[u+4>>2]=e;gr(2315,u)}}gr(2394,a)}function oi(){var e=0;e=m;m=m+16|0;if(!(Fe(188,6)|0)){m=e;return}else gr(2167,e)}function ai(e){e=e|0;var r=0;r=m;m=m+16|0;Hi(e);if(!(pe(E[47]|0,0)|0)){m=r;return}else gr(2217,r)}function ui(e){e=e|0;var r=0,i=0;r=0;while(1){if((d[2415+r>>0]|0)==(e|0)){i=2;break}r=r+1|0;if((r|0)==87){r=87;e=2503;i=5;break}}if((i|0)==2)if(!r)e=2503;else{e=2503;i=5}if((i|0)==5)while(1){i=e;while(1){e=i+1|0;if(!(_[i>>0]|0))break;else i=e}r=r+-1|0;if(!r)break;else i=5}return e|0}function si(){var e=0;if(!0)e=248;else{e=(Oe()|0)+60|0;e=E[e>>2]|0}return e|0}function li(e){e=e|0;var r=0;if(e>>>0>4294963200){r=si()|0;E[r>>2]=0-e;e=-1}return e|0}function fi(e,r){e=+e;r=r|0;var i=0,n=0,t=0;M[N>>3]=e;i=E[N>>2]|0;n=E[N+4>>2]|0;t=ji(i|0,n|0,52)|0;t=t&2047;switch(t|0){case 0:{if(e!=0){e=+fi(e*0x10000000000000000,r);i=(E[r>>2]|0)+-64|0}else i=0;E[r>>2]=i;break}case 2047:break;default:{E[r>>2]=t+-1022;E[N>>2]=i;E[N+4>>2]=n&-2146435073|1071644672;e=+M[N>>3]}}return+e}function _i(e,r){e=+e;r=r|0;return+ +fi(e,r)}function ci(e,r,i){e=e|0;r=r|0;i=i|0;do if(e){if(r>>>0<128){_[e>>0]=r;e=1;break}if(r>>>0<2048){_[e>>0]=r>>>6|192;_[e+1>>0]=r&63|128;e=2;break}if(r>>>0<55296|(r&-8192|0)==57344){_[e>>0]=r>>>12|224;_[e+1>>0]=r>>>6&63|128;_[e+2>>0]=r&63|128;e=3;break}if((r+-65536|0)>>>0<1048576){_[e>>0]=r>>>18|240;_[e+1>>0]=r>>>12&63|128;_[e+2>>0]=r>>>6&63|128;_[e+3>>0]=r&63|128;e=4;break}else{e=si()|0;E[e>>2]=84;e=-1;break}}else e=1;while(0);return e|0}function Ei(e,r){e=e|0;r=r|0;if(!e)e=0;else e=ci(e,r,0)|0;return e|0}function di(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0;if((E[r+76>>2]|0)>=0?(Ci(r)|0)!=0:0){if((_[r+75>>0]|0)!=(e|0)?(n=r+20|0,t=E[n>>2]|0,t>>>0<(E[r+16>>2]|0)>>>0):0){E[n>>2]=t+1;_[t>>0]=e;i=e&255}else i=pi(r,e)|0;Ii(r)}else a=3;do if((a|0)==3){if((_[r+75>>0]|0)!=(e|0)?(o=r+20|0,i=E[o>>2]|0,i>>>0<(E[r+16>>2]|0)>>>0):0){E[o>>2]=i+1;_[i>>0]=e;i=e&255;break}i=pi(r,e)|0}while(0);return i|0}function Ti(e,r){e=e|0;r=r|0;return(Ri(e,Li(e)|0,1,r)|0)+-1|0}function Ai(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0;n=i+16|0;t=E[n>>2]|0;if(!t)if(!(vi(i)|0)){t=E[n>>2]|0;o=4}else n=0;else o=4;e:do if((o|0)==4){a=i+20|0;o=E[a>>2]|0;if((t-o|0)>>>0<r>>>0){n=In[E[i+36>>2]&7](i,e,r)|0;break}r:do if((_[i+75>>0]|0)>-1){n=r;while(1){if(!n){t=o;n=0;break r}t=n+-1|0;if((_[e+t>>0]|0)==10)break;else n=t}if((In[E[i+36>>2]&7](i,e,n)|0)>>>0<n>>>0)break e;r=r-n|0;e=e+n|0;t=E[a>>2]|0}else{t=o;n=0}while(0);Ji(t|0,e|0,r|0)|0;E[a>>2]=(E[a>>2]|0)+r;n=n+r|0}while(0);return n|0}function Ri(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0;t=fe(i,r)|0;if((E[n+76>>2]|0)>-1){o=(Ci(n)|0)==0;e=Ai(e,t,n)|0;if(!o)Ii(n)}else e=Ai(e,t,n)|0;if((e|0)!=(t|0))i=(e>>>0)/(r>>>0)|0;return i|0}function Mi(e){e=e|0;var r=0,i=0,n=0,t=0;n=E[61]|0;if((E[n+76>>2]|0)>-1)t=Ci(n)|0;else t=0;do if((Ti(e,n)|0)<0)r=1;else{if((_[n+75>>0]|0)!=10?(r=n+20|0,i=E[r>>2]|0,i>>>0<(E[n+16>>2]|0)>>>0):0){E[r>>2]=i+1;_[i>>0]=10;r=0;break}r=(pi(n,10)|0)<0}while(0);if(t)Ii(n);return r<<31>>31|0}function Si(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0;n=m;m=m+16|0;t=n;E[t>>2]=i;i=Ni(e,r,t)|0;m=n;return i|0}function mi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,c=0,d=0,T=0,A=0,R=0;R=m;m=m+224|0;c=R+120|0;A=R+80|0;T=R;d=R+136|0;n=A;t=n+40|0;do{E[n>>2]=0;n=n+4|0}while((n|0)<(t|0));E[c>>2]=E[i>>2];if((ki(0,r,c,T,A)|0)<0)i=-1;else{if((E[e+76>>2]|0)>-1)l=Ci(e)|0;else l=0;i=E[e>>2]|0;f=i&32;if((_[e+74>>0]|0)<1)E[e>>2]=i&-33;i=e+48|0;if(!(E[i>>2]|0)){t=e+44|0;o=E[t>>2]|0;E[t>>2]=d;a=e+28|0;E[a>>2]=d;u=e+20|0;E[u>>2]=d;E[i>>2]=80;s=e+16|0;E[s>>2]=d+80;n=ki(e,r,c,T,A)|0;if(o){In[E[e+36>>2]&7](e,0,0)|0;n=(E[u>>2]|0)==0?-1:n;E[t>>2]=o;E[i>>2]=0;E[s>>2]=0;E[a>>2]=0;E[u>>2]=0}}else n=ki(e,r,c,T,A)|0;i=E[e>>2]|0;E[e>>2]=i|f;if(l)Ii(e);i=(i&32|0)==0?n:-1}m=R;return i|0}function hi(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0,u=0,s=0,l=0,f=0;f=m;m=m+128|0;t=f+112|0;l=f;o=l;a=252;u=o+112|0;do{E[o>>2]=E[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(u|0));if((r+-1|0)>>>0>2147483646)if(!r){r=1;s=4}else{r=si()|0;E[r>>2]=75;r=-1}else{t=e;s=4}if((s|0)==4){s=-2-t|0;s=r>>>0>s>>>0?s:r;E[l+48>>2]=s;e=l+20|0;E[e>>2]=t;E[l+44>>2]=t;r=t+s|0;t=l+16|0;E[t>>2]=r;E[l+28>>2]=r;r=mi(l,i,n)|0;if(s){i=E[e>>2]|0;_[i+(((i|0)==(E[t>>2]|0))<<31>>31)>>0]=0}}m=f;return r|0}function Ni(e,r,i){e=e|0;r=r|0;i=i|0;return hi(e,2147483647,r,i)|0}function Ci(e){e=e|0;return 0}function Ii(e){e=e|0;return}function pi(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0;s=m;m=m+16|0;u=s;a=r&255;_[u>>0]=a;n=e+16|0;t=E[n>>2]|0;if(!t)if(!(vi(e)|0)){t=E[n>>2]|0;o=4}else i=-1;else o=4;do if((o|0)==4){n=e+20|0;o=E[n>>2]|0;if(o>>>0<t>>>0?(i=r&255,(i|0)!=(_[e+75>>0]|0)):0){E[n>>2]=o+1;_[o>>0]=a;break}if((In[E[e+36>>2]&7](e,u,1)|0)==1)i=d[u>>0]|0;else i=-1}while(0);m=s;return i|0}function wi(e){e=e|0;var r=0,i=0;r=m;m=m+16|0;i=r;E[i>>2]=E[e+60>>2];e=li(Be(6,i|0)|0)|0;m=r;return e|0}function bi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0;t=m;m=m+32|0;o=t;n=t+20|0;E[o>>2]=E[e+60>>2];E[o+4>>2]=0;E[o+8>>2]=r;E[o+12>>2]=n;E[o+16>>2]=i;if((li(ye(140,o|0)|0)|0)<0){E[n>>2]=-1;e=-1}else e=E[n>>2]|0;m=t;return e|0}function Oi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,T=0;T=m;m=m+48|0;_=T+16|0;f=T;n=T+32|0;c=e+28|0;t=E[c>>2]|0;E[n>>2]=t;d=e+20|0;t=(E[d>>2]|0)-t|0;E[n+4>>2]=t;E[n+8>>2]=r;E[n+12>>2]=i;s=e+60|0;l=e+44|0;r=2;t=t+i|0;while(1){if(!(E[49]|0)){E[_>>2]=E[s>>2];E[_+4>>2]=n;E[_+8>>2]=r;a=li(Ve(146,_|0)|0)|0}else{ve(7,e|0);E[f>>2]=E[s>>2];E[f+4>>2]=n;E[f+8>>2]=r;a=li(Ve(146,f|0)|0)|0;Ce(0)}if((t|0)==(a|0)){t=6;break}if((a|0)<0){t=8;break}t=t-a|0;o=E[n+4>>2]|0;if(a>>>0<=o>>>0)if((r|0)==2){E[c>>2]=(E[c>>2]|0)+a;u=o;r=2}else u=o;else{u=E[l>>2]|0;E[c>>2]=u;E[d>>2]=u;u=E[n+12>>2]|0;a=a-o|0;n=n+8|0;r=r+-1|0}E[n>>2]=(E[n>>2]|0)+a;E[n+4>>2]=u-a}if((t|0)==6){_=E[l>>2]|0;E[e+16>>2]=_+(E[e+48>>2]|0);e=_;E[c>>2]=e;E[d>>2]=e}else if((t|0)==8){E[e+16>>2]=0;E[c>>2]=0;E[d>>2]=0;E[e>>2]=E[e>>2]|32;if((r|0)==2)i=0;else i=i-(E[n+4>>2]|0)|0}m=T;return i|0}function Pi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0;t=m;m=m+80|0;n=t;E[e+36>>2]=3;if((E[e>>2]&64|0)==0?(E[n>>2]=E[e+60>>2],E[n+4>>2]=21505,E[n+8>>2]=t+12,(De(54,n|0)|0)!=0):0)_[e+75>>0]=-1;n=Oi(e,r,i)|0;m=t;return n|0}function vi(e){e=e|0;var r=0,i=0;r=e+74|0;i=_[r>>0]|0;_[r>>0]=i+255|i;r=E[e>>2]|0;if(!(r&8)){E[e+8>>2]=0;E[e+4>>2]=0;r=E[e+44>>2]|0;E[e+28>>2]=r;E[e+20>>2]=r;E[e+16>>2]=r+(E[e+48>>2]|0);r=0}else{E[e>>2]=r|32;r=-1}return r|0}function Bi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0;o=r&255;n=(i|0)!=0;e:do if(n&(e&3|0)!=0){t=r&255;while(1){if((_[e>>0]|0)==t<<24>>24){a=6;break e}e=e+1|0;i=i+-1|0;n=(i|0)!=0;if(!(n&(e&3|0)!=0)){a=5;break}}}else a=5;while(0);if((a|0)==5)if(n)a=6;else i=0;e:do if((a|0)==6){t=r&255;if((_[e>>0]|0)!=t<<24>>24){n=fe(o,16843009)|0;r:do if(i>>>0>3)while(1){o=E[e>>2]^n;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;i=i+-4|0;if(i>>>0<=3){a=11;break r}}else a=11;while(0);if((a|0)==11)if(!i){i=0;break}while(1){if((_[e>>0]|0)==t<<24>>24)break e;e=e+1|0;i=i+-1|0;if(!i){i=0;break}}}}while(0);return((i|0)!=0?e:0)|0}function Li(e){e=e|0;var r=0,i=0,n=0;n=e;e:do if(!(n&3))i=4;else{r=e;e=n;while(1){if(!(_[r>>0]|0))break e;r=r+1|0;e=r;if(!(e&3)){e=r;i=4;break}}}while(0);if((i|0)==4){while(1){r=E[e>>2]|0;if(!((r&-2139062144^-2139062144)&r+-16843009))e=e+4|0;else break}if((r&255)<<24>>24)do e=e+1|0;while((_[e>>0]|0)!=0)}return e-n|0}function ki(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0,u=0,s=0,l=0,f=0,T=0,A=0,R=0,S=0,h=0,C=0,I=0,p=0,w=0,b=0,O=0,P=0,v=0,B=0,L=0,k=0,F=0,g=0,U=0,D=0,y=0,G=0,X=0,V=0,Y=0,x=0,K=0,W=0,z=0,q=0,j=0,Z=0,J=0,Q=0,$=0,ee=0,re=0,ie=0,ne=0,te=0,oe=0,ae=0;ae=m;m=m+624|0;re=ae+24|0;ne=ae+16|0;ie=ae+588|0;Z=ae+576|0;ee=ae;z=ae+536|0;oe=ae+8|0;te=ae+528|0;D=(e|0)!=0;y=z+40|0;W=y;z=z+39|0;q=oe+4|0;j=Z+12|0;Z=Z+11|0;J=ie;Q=j;$=Q-J|0;G=-2-J|0;X=Q+2|0;V=re+288|0;Y=ie+9|0;x=Y;K=ie+8|0;o=0;h=r;a=0;r=0;e:while(1){do if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=si()|0;E[o>>2]=75;o=-1;break}else{o=a+o|0;break}while(0);a=_[h>>0]|0;if(!(a<<24>>24)){U=245;break}else u=h;r:while(1){switch(a<<24>>24){case 37:{a=u;U=9;break r}case 0:{a=u;break r}default:{}}g=u+1|0;a=_[g>>0]|0;u=g}r:do if((U|0)==9)while(1){U=0;if((_[a+1>>0]|0)!=37)break r;u=u+1|0;a=a+2|0;if((_[a>>0]|0)==37)U=9;else break}while(0);I=u-h|0;if(D?(E[e>>2]&32|0)==0:0)Ai(h,I,e)|0;if((u|0)!=(h|0)){h=a;a=I;continue}f=a+1|0;u=_[f>>0]|0;s=(u<<24>>24)+-48|0;if(s>>>0<10){g=(_[a+2>>0]|0)==36;f=g?a+3|0:f;u=_[f>>0]|0;R=g?s:-1;r=g?1:r}else R=-1;a=u<<24>>24;r:do if((a&-32|0)==32){s=0;while(1){if(!(1<<a+-32&75913)){T=s;a=f;break r}s=1<<(u<<24>>24)+-32|s;f=f+1|0;u=_[f>>0]|0;a=u<<24>>24;if((a&-32|0)!=32){T=s;a=f;break}}}else{T=0;a=f}while(0);do if(u<<24>>24==42){s=a+1|0;u=(_[s>>0]|0)+-48|0;if(u>>>0<10?(_[a+2>>0]|0)==36:0){E[t+(u<<2)>>2]=10;r=1;a=a+3|0;u=E[n+((_[s>>0]|0)+-48<<3)>>2]|0}else{if(r){o=-1;break e}if(!D){C=T;a=s;r=0;g=0;break}r=(E[i>>2]|0)+(4-1)&~(4-1);u=E[r>>2]|0;E[i>>2]=r+4;r=0;a=s}if((u|0)<0){C=T|8192;g=0-u|0}else{C=T;g=u}}else{s=(u<<24>>24)+-48|0;if(s>>>0<10){u=0;do{u=(u*10|0)+s|0;a=a+1|0;s=(_[a>>0]|0)+-48|0}while(s>>>0<10);if((u|0)<0){o=-1;break e}else{C=T;g=u}}else{C=T;g=0}}while(0);r:do if((_[a>>0]|0)==46){s=a+1|0;u=_[s>>0]|0;if(u<<24>>24!=42){f=(u<<24>>24)+-48|0;if(f>>>0<10){a=s;u=0}else{a=s;f=0;break}while(1){u=(u*10|0)+f|0;a=a+1|0;f=(_[a>>0]|0)+-48|0;if(f>>>0>=10){f=u;break r}}}s=a+2|0;u=(_[s>>0]|0)+-48|0;if(u>>>0<10?(_[a+3>>0]|0)==36:0){E[t+(u<<2)>>2]=10;a=a+4|0;f=E[n+((_[s>>0]|0)+-48<<3)>>2]|0;break}if(r){o=-1;break e}if(D){a=(E[i>>2]|0)+(4-1)&~(4-1);f=E[a>>2]|0;E[i>>2]=a+4;a=s}else{a=s;f=0}}else f=-1;while(0);A=0;while(1){u=(_[a>>0]|0)+-65|0;if(u>>>0>57){o=-1;break e}s=a+1|0;u=_[5347+(A*58|0)+u>>0]|0;T=u&255;if((T+-1|0)>>>0<8){a=s;A=T}else{F=s;break}}if(!(u<<24>>24)){o=-1;break}s=(R|0)>-1;do if(u<<24>>24==19)if(s){o=-1;break e}else U=52;else{if(s){E[t+(R<<2)>>2]=T;L=n+(R<<3)|0;k=E[L+4>>2]|0;U=ee;E[U>>2]=E[L>>2];E[U+4>>2]=k;U=52;break}if(!D){o=0;break e}Ui(ee,T,i)}while(0);if((U|0)==52?(U=0,!D):0){h=F;a=I;continue}R=_[a>>0]|0;R=(A|0)!=0&(R&15|0)==3?R&-33:R;s=C&-65537;k=(C&8192|0)==0?C:s;r:do switch(R|0){case 110:switch(A|0){case 0:{E[E[ee>>2]>>2]=o;h=F;a=I;continue e}case 1:{E[E[ee>>2]>>2]=o;h=F;a=I;continue e}case 2:{h=E[ee>>2]|0;E[h>>2]=o;E[h+4>>2]=((o|0)<0)<<31>>31;h=F;a=I;continue e}case 3:{c[E[ee>>2]>>1]=o;h=F;a=I;continue e}case 4:{_[E[ee>>2]>>0]=o;h=F;a=I;continue e}case 6:{E[E[ee>>2]>>2]=o;h=F;a=I;continue e}case 7:{h=E[ee>>2]|0;E[h>>2]=o;E[h+4>>2]=((o|0)<0)<<31>>31;h=F;a=I;continue e}default:{h=F;a=I;continue e}}case 112:{A=k|8;f=f>>>0>8?f:8;R=120;U=64;break}case 88:case 120:{A=k;U=64;break}case 111:{s=ee;u=E[s>>2]|0;s=E[s+4>>2]|0;if((u|0)==0&(s|0)==0)a=y;else{a=y;do{a=a+-1|0;_[a>>0]=u&7|48;u=ji(u|0,s|0,3)|0;s=H}while(!((u|0)==0&(s|0)==0))}if(!(k&8)){u=k;A=0;T=5827;U=77}else{A=W-a+1|0;u=k;f=(f|0)<(A|0)?A:f;A=0;T=5827;U=77}break}case 105:case 100:{u=ee;a=E[u>>2]|0;u=E[u+4>>2]|0;if((u|0)<0){a=Wi(0,0,a|0,u|0)|0;u=H;s=ee;E[s>>2]=a;E[s+4>>2]=u;s=1;T=5827;U=76;break r}if(!(k&2048)){T=k&1;s=T;T=(T|0)==0?5827:5829;U=76}else{s=1;T=5828;U=76}break}case 117:{u=ee;a=E[u>>2]|0;u=E[u+4>>2]|0;s=0;T=5827;U=76;break}case 99:{_[z>>0]=E[ee>>2];h=z;u=1;A=0;R=5827;a=y;break}case 109:{a=si()|0;a=ui(E[a>>2]|0)|0;U=82;break}case 115:{a=E[ee>>2]|0;a=(a|0)!=0?a:5837;U=82;break}case 67:{E[oe>>2]=E[ee>>2];E[q>>2]=0;E[ee>>2]=oe;f=-1;U=86;break}case 83:{if(!f){yi(e,32,g,0,k);a=0;U=98}else U=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{l=+M[ee>>3];E[ne>>2]=0;M[N>>3]=l;if((E[N+4>>2]|0)>=0)if(!(k&2048)){L=k&1;B=L;L=(L|0)==0?5845:5850}else{B=1;L=5847}else{l=-l;B=1;L=5844}M[N>>3]=l;v=E[N+4>>2]&2146435072;do if(v>>>0<2146435072|(v|0)==2146435072&0<0){S=+_i(l,ne)*2;u=S!=0;if(u)E[ne>>2]=(E[ne>>2]|0)+-1;O=R|32;if((O|0)==97){h=R&32;I=(h|0)==0?L:L+9|0;C=B|2;a=12-f|0;do if(!(f>>>0>11|(a|0)==0)){l=8;do{a=a+-1|0;l=l*16}while((a|0)!=0);if((_[I>>0]|0)==45){l=-(l+(-S-l));break}else{l=S+l-l;break}}else l=S;while(0);u=E[ne>>2]|0;a=(u|0)<0?0-u|0:u;a=Di(a,((a|0)<0)<<31>>31,j)|0;if((a|0)==(j|0)){_[Z>>0]=48;a=Z}_[a+-1>>0]=(u>>31&2)+43;A=a+-2|0;_[A>>0]=R+15;T=(f|0)<1;s=(k&8|0)==0;u=ie;while(1){L=~~l;a=u+1|0;_[u>>0]=d[5811+L>>0]|h;l=(l-+(L|0))*16;do if((a-J|0)==1){if(s&(T&l==0))break;_[a>>0]=46;a=u+2|0}while(0);if(!(l!=0))break;else u=a}f=(f|0)!=0&(G+a|0)<(f|0)?X+f-A|0:$-A+a|0;s=f+C|0;yi(e,32,g,s,k);if(!(E[e>>2]&32))Ai(I,C,e)|0;yi(e,48,g,s,k^65536);a=a-J|0;if(!(E[e>>2]&32))Ai(ie,a,e)|0;u=Q-A|0;yi(e,48,f-(a+u)|0,0,0);if(!(E[e>>2]&32))Ai(A,u,e)|0;yi(e,32,g,s,k^8192);a=(s|0)<(g|0)?g:s;break}a=(f|0)<0?6:f;if(u){u=(E[ne>>2]|0)+-28|0;E[ne>>2]=u;l=S*268435456}else{l=S;u=E[ne>>2]|0}v=(u|0)<0?re:V;P=v;u=v;do{b=~~l>>>0;E[u>>2]=b;u=u+4|0;l=(l-+(b>>>0))*1e9}while(l!=0);s=u;u=E[ne>>2]|0;if((u|0)>0){T=v;while(1){A=(u|0)>29?29:u;f=s+-4|0;do if(f>>>0<T>>>0)f=T;else{u=0;do{b=Zi(E[f>>2]|0,0,A|0)|0;b=zi(b|0,H|0,u|0,0)|0;u=H;w=an(b|0,u|0,1e9,0)|0;E[f>>2]=w;u=on(b|0,u|0,1e9,0)|0;f=f+-4|0}while(f>>>0>=T>>>0);if(!u){f=T;break}f=T+-4|0;E[f>>2]=u}while(0);while(1){if(s>>>0<=f>>>0)break;u=s+-4|0;if(!(E[u>>2]|0))s=u;else break}u=(E[ne>>2]|0)-A|0;E[ne>>2]=u;if((u|0)>0)T=f;else break}}else f=v;if((u|0)<0){I=((a+25|0)/9|0)+1|0;p=(O|0)==102;h=f;while(1){C=0-u|0;C=(C|0)>9?9:C;do if(h>>>0<s>>>0){u=(1<<C)+-1|0;T=1e9>>>C;f=0;A=h;do{b=E[A>>2]|0;E[A>>2]=(b>>>C)+f;f=fe(b&u,T)|0;A=A+4|0}while(A>>>0<s>>>0);u=(E[h>>2]|0)==0?h+4|0:h;if(!f){f=u;break}E[s>>2]=f;f=u;s=s+4|0}else f=(E[h>>2]|0)==0?h+4|0:h;while(0);u=p?v:f;s=(s-u>>2|0)>(I|0)?u+(I<<2)|0:s;u=(E[ne>>2]|0)+C|0;E[ne>>2]=u;if((u|0)>=0){h=f;break}else h=f}}else h=f;do if(h>>>0<s>>>0){u=(P-h>>2)*9|0;T=E[h>>2]|0;if(T>>>0<10)break;else f=10;do{f=f*10|0;u=u+1|0}while(T>>>0>=f>>>0)}else u=0;while(0);w=(O|0)==103;b=(a|0)!=0;f=a-((O|0)!=102?u:0)+((b&w)<<31>>31)|0;if((f|0)<(((s-P>>2)*9|0)+-9|0)){A=f+9216|0;p=(A|0)/9|0;f=v+(p+-1023<<2)|0;A=((A|0)%9|0)+1|0;if((A|0)<9){T=10;do{T=T*10|0;A=A+1|0}while((A|0)!=9)}else T=10;C=E[f>>2]|0;I=(C>>>0)%(T>>>0)|0;if((I|0)==0?(v+(p+-1022<<2)|0)==(s|0):0)T=h;else U=163;do if((U|0)==163){U=0;S=(((C>>>0)/(T>>>0)|0)&1|0)==0?9007199254740992:9007199254740994;A=(T|0)/2|0;do if(I>>>0<A>>>0)l=.5;else{if((I|0)==(A|0)?(v+(p+-1022<<2)|0)==(s|0):0){l=1;break}l=1.5}while(0);do if(B){if((_[L>>0]|0)!=45)break;S=-S;l=-l}while(0);A=C-I|0;E[f>>2]=A;if(!(S+l!=S)){T=h;break}O=A+T|0;E[f>>2]=O;if(O>>>0>999999999){u=h;while(1){T=f+-4|0;E[f>>2]=0;if(T>>>0<u>>>0){u=u+-4|0;E[u>>2]=0}O=(E[T>>2]|0)+1|0;E[T>>2]=O;if(O>>>0>999999999)f=T;else{h=u;f=T;break}}}u=(P-h>>2)*9|0;A=E[h>>2]|0;if(A>>>0<10){T=h;break}else T=10;do{T=T*10|0;u=u+1|0}while(A>>>0>=T>>>0);T=h}while(0);O=f+4|0;h=T;s=s>>>0>O>>>0?O:s}I=0-u|0;while(1){if(s>>>0<=h>>>0){p=0;O=s;break}f=s+-4|0;if(!(E[f>>2]|0))s=f;else{p=1;O=s;break}}do if(w){a=(b&1^1)+a|0;if((a|0)>(u|0)&(u|0)>-5){R=R+-1|0;a=a+-1-u|0}else{R=R+-2|0;a=a+-1|0}s=k&8;if(s)break;do if(p){s=E[O+-4>>2]|0;if(!s){f=9;break}if(!((s>>>0)%10|0)){T=10;f=0}else{f=0;break}do{T=T*10|0;f=f+1|0}while(((s>>>0)%(T>>>0)|0|0)==0)}else f=9;while(0);s=((O-P>>2)*9|0)+-9|0;if((R|32|0)==102){s=s-f|0;s=(s|0)<0?0:s;a=(a|0)<(s|0)?a:s;s=0;break}else{s=s+u-f|0;s=(s|0)<0?0:s;a=(a|0)<(s|0)?a:s;s=0;break}}else s=k&8;while(0);C=a|s;T=(C|0)!=0&1;A=(R|32|0)==102;if(A){u=(u|0)>0?u:0;R=0}else{f=(u|0)<0?I:u;f=Di(f,((f|0)<0)<<31>>31,j)|0;if((Q-f|0)<2)do{f=f+-1|0;_[f>>0]=48}while((Q-f|0)<2);_[f+-1>>0]=(u>>31&2)+43;P=f+-2|0;_[P>>0]=R;u=Q-P|0;R=P}I=B+1+a+T+u|0;yi(e,32,g,I,k);if(!(E[e>>2]&32))Ai(L,B,e)|0;yi(e,48,g,I,k^65536);do if(A){f=h>>>0>v>>>0?v:h;u=f;do{s=Di(E[u>>2]|0,0,Y)|0;do if((u|0)==(f|0)){if((s|0)!=(Y|0))break;_[K>>0]=48;s=K}else{if(s>>>0<=ie>>>0)break;do{s=s+-1|0;_[s>>0]=48}while(s>>>0>ie>>>0)}while(0);if(!(E[e>>2]&32))Ai(s,x-s|0,e)|0;u=u+4|0}while(u>>>0<=v>>>0);do if(C){if(E[e>>2]&32)break;Ai(5879,1,e)|0}while(0);if((a|0)>0&u>>>0<O>>>0){s=u;while(1){u=Di(E[s>>2]|0,0,Y)|0;if(u>>>0>ie>>>0)do{u=u+-1|0;_[u>>0]=48}while(u>>>0>ie>>>0);if(!(E[e>>2]&32))Ai(u,(a|0)>9?9:a,e)|0;s=s+4|0;u=a+-9|0;if(!((a|0)>9&s>>>0<O>>>0)){a=u;break}else a=u}}yi(e,48,a+9|0,9,0)}else{A=p?O:h+4|0;if((a|0)>-1){T=(s|0)==0;f=h;do{u=Di(E[f>>2]|0,0,Y)|0;if((u|0)==(Y|0)){_[K>>0]=48;u=K}do if((f|0)==(h|0)){s=u+1|0;if(!(E[e>>2]&32))Ai(u,1,e)|0;if(T&(a|0)<1){u=s;break}if(E[e>>2]&32){u=s;break}Ai(5879,1,e)|0;u=s}else{if(u>>>0<=ie>>>0)break;do{u=u+-1|0;_[u>>0]=48}while(u>>>0>ie>>>0)}while(0);s=x-u|0;if(!(E[e>>2]&32))Ai(u,(a|0)>(s|0)?s:a,e)|0;a=a-s|0;f=f+4|0}while(f>>>0<A>>>0&(a|0)>-1)}yi(e,48,a+18|0,18,0);if(E[e>>2]&32)break;Ai(R,Q-R|0,e)|0}while(0);yi(e,32,g,I,k^8192);a=(I|0)<(g|0)?g:I}else{A=(R&32|0)!=0;T=l!=l|0!=0;u=T?0:B;f=u+3|0;yi(e,32,g,f,s);a=E[e>>2]|0;if(!(a&32)){Ai(L,u,e)|0;a=E[e>>2]|0}if(!(a&32))Ai(T?A?5871:5875:A?5863:5867,3,e)|0;yi(e,32,g,f,k^8192);a=(f|0)<(g|0)?g:f}while(0);h=F;continue e}default:{s=k;u=f;A=0;R=5827;a=y}}while(0);r:do if((U|0)==64){s=ee;u=E[s>>2]|0;s=E[s+4>>2]|0;T=R&32;if(!((u|0)==0&(s|0)==0)){a=y;do{a=a+-1|0;_[a>>0]=d[5811+(u&15)>>0]|T;u=ji(u|0,s|0,4)|0;s=H}while(!((u|0)==0&(s|0)==0));U=ee;if((A&8|0)==0|(E[U>>2]|0)==0&(E[U+4>>2]|0)==0){u=A;A=0;T=5827;U=77}else{u=A;A=2;T=5827+(R>>4)|0;U=77}}else{a=y;u=A;A=0;T=5827;U=77}}else if((U|0)==76){a=Di(a,u,y)|0;u=k;A=s;U=77}else if((U|0)==82){U=0;k=Bi(a,0,f)|0;L=(k|0)==0;h=a;u=L?f:k-a|0;A=0;R=5827;a=L?a+f|0:k}else if((U|0)==86){U=0;u=0;a=0;T=E[ee>>2]|0;while(1){s=E[T>>2]|0;if(!s)break;a=Ei(te,s)|0;if((a|0)<0|a>>>0>(f-u|0)>>>0)break;u=a+u|0;if(f>>>0>u>>>0)T=T+4|0;else break}if((a|0)<0){o=-1;break e}yi(e,32,g,u,k);if(!u){a=0;U=98}else{s=0;f=E[ee>>2]|0;while(1){a=E[f>>2]|0;if(!a){a=u;U=98;break r}a=Ei(te,a)|0;s=a+s|0;if((s|0)>(u|0)){a=u;U=98;break r}if(!(E[e>>2]&32))Ai(te,a,e)|0;if(s>>>0>=u>>>0){a=u;U=98;break}else f=f+4|0}}}while(0);if((U|0)==98){U=0;yi(e,32,g,a,k^8192);h=F;a=(g|0)>(a|0)?g:a;continue}if((U|0)==77){U=0;s=(f|0)>-1?u&-65537:u;u=ee;u=(E[u>>2]|0)!=0|(E[u+4>>2]|0)!=0;if((f|0)!=0|u){u=(u&1^1)+(W-a)|0;h=a;u=(f|0)>(u|0)?f:u;R=T;a=y}else{h=y;u=0;R=T;a=y}}T=a-h|0;u=(u|0)<(T|0)?T:u;f=A+u|0;a=(g|0)<(f|0)?f:g;yi(e,32,a,f,s);if(!(E[e>>2]&32))Ai(R,A,e)|0;yi(e,48,a,f,s^65536);yi(e,48,u,T,0);if(!(E[e>>2]&32))Ai(h,T,e)|0;yi(e,32,a,f,s^8192);h=F}e:do if((U|0)==245)if(!e)if(r){o=1;while(1){r=E[t+(o<<2)>>2]|0;if(!r)break;Ui(n+(o<<3)|0,r,i);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(E[t+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0;while(0);m=ae;return o|0}function Fi(e){e=e|0;if(!(E[e+68>>2]|0))Ii(e);return}function gi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0;n=e+20|0;t=E[n>>2]|0;e=(E[e+16>>2]|0)-t|0;e=e>>>0>i>>>0?i:e;Ji(t|0,r|0,e|0)|0;E[n>>2]=(E[n>>2]|0)+e;return i|0}function Ui(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0;e:do if(r>>>0<=20)do switch(r|0){case 9:{n=(E[i>>2]|0)+(4-1)&~(4-1);r=E[n>>2]|0;E[i>>2]=n+4;E[e>>2]=r;break e}case 10:{n=(E[i>>2]|0)+(4-1)&~(4-1);r=E[n>>2]|0;E[i>>2]=n+4;n=e;E[n>>2]=r;E[n+4>>2]=((r|0)<0)<<31>>31;break e}case 11:{n=(E[i>>2]|0)+(4-1)&~(4-1);r=E[n>>2]|0;E[i>>2]=n+4;n=e;E[n>>2]=r;E[n+4>>2]=0;break e}case 12:{n=(E[i>>2]|0)+(8-1)&~(8-1);r=n;t=E[r>>2]|0;r=E[r+4>>2]|0;E[i>>2]=n+8;n=e;E[n>>2]=t;E[n+4>>2]=r;break e}case 13:{t=(E[i>>2]|0)+(4-1)&~(4-1);n=E[t>>2]|0;E[i>>2]=t+4;n=(n&65535)<<16>>16;t=e;E[t>>2]=n;E[t+4>>2]=((n|0)<0)<<31>>31;break e}case 14:{t=(E[i>>2]|0)+(4-1)&~(4-1);n=E[t>>2]|0;E[i>>2]=t+4;t=e;E[t>>2]=n&65535;E[t+4>>2]=0;break e}case 15:{t=(E[i>>2]|0)+(4-1)&~(4-1);n=E[t>>2]|0;E[i>>2]=t+4;n=(n&255)<<24>>24;t=e;E[t>>2]=n;E[t+4>>2]=((n|0)<0)<<31>>31;break e}case 16:{t=(E[i>>2]|0)+(4-1)&~(4-1);n=E[t>>2]|0;E[i>>2]=t+4;t=e;E[t>>2]=n&255;E[t+4>>2]=0;break e}case 17:{t=(E[i>>2]|0)+(8-1)&~(8-1);o=+M[t>>3];E[i>>2]=t+8;M[e>>3]=o;break e}case 18:{t=(E[i>>2]|0)+(8-1)&~(8-1);o=+M[t>>3];E[i>>2]=t+8;M[e>>3]=o;break e}default:break e}while(0);while(0);return}function Di(e,r,i){e=e|0;r=r|0;i=i|0;var n=0;if(r>>>0>0|(r|0)==0&e>>>0>4294967295)while(1){n=an(e|0,r|0,10,0)|0;i=i+-1|0;_[i>>0]=n|48;n=on(e|0,r|0,10,0)|0;if(r>>>0>9|(r|0)==9&e>>>0>4294967295){e=n;r=H}else{e=n;break}}if(e)while(1){i=i+-1|0;_[i>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return i|0}function yi(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0,u=0;u=m;m=m+256|0;a=u;do if((i|0)>(n|0)&(t&73728|0)==0){t=i-n|0;qi(a|0,r|0,(t>>>0>256?256:t)|0)|0;r=E[e>>2]|0;o=(r&32|0)==0;if(t>>>0>255){n=i-n|0;do{if(o){Ai(a,256,e)|0;r=E[e>>2]|0}t=t+-256|0;o=(r&32|0)==0}while(t>>>0>255);if(o)t=n&255;else break}else if(!o)break;Ai(a,t,e)|0}while(0);m=u;return}function Gi(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,T=0,A=0,R=0,M=0,S=0,m=0,h=0,N=0,C=0,I=0,p=0,w=0,b=0,O=0,P=0,v=0,B=0,L=0,k=0,F=0,g=0,U=0,D=0,y=0;do if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;u=E[147]|0;i=u>>>e;if(i&3){e=(i&1^1)+e|0;n=e<<1;i=628+(n<<2)|0;n=628+(n+2<<2)|0;t=E[n>>2]|0;o=t+8|0;a=E[o>>2]|0;do if((i|0)!=(a|0)){if(a>>>0<(E[151]|0)>>>0)Pe();r=a+12|0;if((E[r>>2]|0)==(t|0)){E[r>>2]=i;E[n>>2]=a;break}else Pe()}else E[147]=u&~(1<<e);while(0);y=e<<3;E[t+4>>2]=y|3;y=t+(y|4)|0;E[y>>2]=E[y>>2]|1;y=o;return y|0}a=E[149]|0;if(d>>>0>a>>>0){if(i){n=2<<e;n=i<<e&(n|0-n);n=(n&0-n)+-1|0;s=n>>>12&16;n=n>>>s;t=n>>>5&8;n=n>>>t;o=n>>>2&4;n=n>>>o;i=n>>>1&2;n=n>>>i;e=n>>>1&1;e=(t|s|o|i|e)+(n>>>e)|0;n=e<<1;i=628+(n<<2)|0;n=628+(n+2<<2)|0;o=E[n>>2]|0;s=o+8|0;t=E[s>>2]|0;do if((i|0)!=(t|0)){if(t>>>0<(E[151]|0)>>>0)Pe();r=t+12|0;if((E[r>>2]|0)==(o|0)){E[r>>2]=i;E[n>>2]=t;l=E[149]|0;break}else Pe()}else{E[147]=u&~(1<<e);l=a}while(0);y=e<<3;a=y-d|0;E[o+4>>2]=d|3;u=o+d|0;E[o+(d|4)>>2]=a|1;E[o+y>>2]=a;if(l){t=E[152]|0;i=l>>>3;r=i<<1;n=628+(r<<2)|0;e=E[147]|0;i=1<<i;if(e&i){e=628+(r+2<<2)|0;r=E[e>>2]|0;if(r>>>0<(E[151]|0)>>>0)Pe();else{f=e;_=r}}else{E[147]=e|i;f=628+(r+2<<2)|0;_=n}E[f>>2]=t;E[_+12>>2]=t;E[t+8>>2]=_;E[t+12>>2]=n}E[149]=a;E[152]=u;y=s;return y|0}e=E[148]|0;if(e){i=(e&0-e)+-1|0;D=i>>>12&16;i=i>>>D;U=i>>>5&8;i=i>>>U;y=i>>>2&4;i=i>>>y;e=i>>>1&2;i=i>>>e;n=i>>>1&1;n=E[892+((U|D|y|e|n)+(i>>>n)<<2)>>2]|0;i=(E[n+4>>2]&-8)-d|0;e=n;while(1){r=E[e+16>>2]|0;if(!r){r=E[e+20>>2]|0;if(!r){s=i;break}}e=(E[r+4>>2]&-8)-d|0;y=e>>>0<i>>>0;i=y?e:i;e=r;n=y?r:n}o=E[151]|0;if(n>>>0<o>>>0)Pe();u=n+d|0;if(n>>>0>=u>>>0)Pe();a=E[n+24>>2]|0;i=E[n+12>>2]|0;do if((i|0)==(n|0)){e=n+20|0;r=E[e>>2]|0;if(!r){e=n+16|0;r=E[e>>2]|0;if(!r){c=0;break}}while(1){i=r+20|0;t=E[i>>2]|0;if(t){r=t;e=i;continue}i=r+16|0;t=E[i>>2]|0;if(!t)break;else{r=t;e=i}}if(e>>>0<o>>>0)Pe();else{E[e>>2]=0;c=r;break}}else{t=E[n+8>>2]|0;if(t>>>0<o>>>0)Pe();r=t+12|0;if((E[r>>2]|0)!=(n|0))Pe();e=i+8|0;if((E[e>>2]|0)==(n|0)){E[r>>2]=i;E[e>>2]=t;c=i;break}else Pe()}while(0);do if(a){r=E[n+28>>2]|0;e=892+(r<<2)|0;if((n|0)==(E[e>>2]|0)){E[e>>2]=c;if(!c){E[148]=E[148]&~(1<<r);break}}else{if(a>>>0<(E[151]|0)>>>0)Pe();r=a+16|0;if((E[r>>2]|0)==(n|0))E[r>>2]=c;else E[a+20>>2]=c;if(!c)break}e=E[151]|0;if(c>>>0<e>>>0)Pe();E[c+24>>2]=a;r=E[n+16>>2]|0;do if(r)if(r>>>0<e>>>0)Pe();else{E[c+16>>2]=r;E[r+24>>2]=c;break}while(0);r=E[n+20>>2]|0;if(r)if(r>>>0<(E[151]|0)>>>0)Pe();else{E[c+20>>2]=r;E[r+24>>2]=c;break}}while(0);if(s>>>0<16){y=s+d|0;E[n+4>>2]=y|3;y=n+(y+4)|0;E[y>>2]=E[y>>2]|1}else{E[n+4>>2]=d|3;E[n+(d|4)>>2]=s|1;E[n+(s+d)>>2]=s;r=E[149]|0;if(r){o=E[152]|0;i=r>>>3;r=i<<1;t=628+(r<<2)|0;e=E[147]|0;i=1<<i;if(e&i){r=628+(r+2<<2)|0;e=E[r>>2]|0;if(e>>>0<(E[151]|0)>>>0)Pe();else{T=r;A=e}}else{E[147]=e|i;T=628+(r+2<<2)|0;A=t}E[T>>2]=o;E[A+12>>2]=o;E[o+8>>2]=A;E[o+12>>2]=t}E[149]=s;E[152]=u}y=n+8|0;return y|0}else A=d}else A=d}else if(e>>>0<=4294967231){e=e+11|0;_=e&-8;f=E[148]|0;if(f){i=0-_|0;e=e>>>8;if(e)if(_>>>0>16777215)l=31;else{A=(e+1048320|0)>>>16&8;h=e<<A;T=(h+520192|0)>>>16&4;h=h<<T;l=(h+245760|0)>>>16&2;l=14-(T|A|l)+(h<<l>>>15)|0;l=_>>>(l+7|0)&1|l<<1}else l=0;e=E[892+(l<<2)>>2]|0;e:do if(!e){t=0;e=0;h=86}else{a=i;t=0;u=_<<((l|0)==31?0:25-(l>>>1)|0);s=e;e=0;while(1){o=E[s+4>>2]&-8;i=o-_|0;if(i>>>0<a>>>0)if((o|0)==(_|0)){o=s;e=s;h=90;break e}else e=s;else i=a;h=E[s+20>>2]|0;s=E[s+16+(u>>>31<<2)>>2]|0;t=(h|0)==0|(h|0)==(s|0)?t:h;if(!s){h=86;break}else{a=i;u=u<<1}}}while(0);if((h|0)==86){if((t|0)==0&(e|0)==0){e=2<<l;e=f&(e|0-e);if(!e){A=_;break}e=(e&0-e)+-1|0;c=e>>>12&16;e=e>>>c;f=e>>>5&8;e=e>>>f;T=e>>>2&4;e=e>>>T;A=e>>>1&2;e=e>>>A;t=e>>>1&1;t=E[892+((f|c|T|A|t)+(e>>>t)<<2)>>2]|0;e=0}if(!t){u=i;s=e}else{o=t;h=90}}if((h|0)==90)while(1){h=0;A=(E[o+4>>2]&-8)-_|0;t=A>>>0<i>>>0;i=t?A:i;e=t?o:e;t=E[o+16>>2]|0;if(t){o=t;h=90;continue}o=E[o+20>>2]|0;if(!o){u=i;s=e;break}else h=90}if((s|0)!=0?u>>>0<((E[149]|0)-_|0)>>>0:0){t=E[151]|0;if(s>>>0<t>>>0)Pe();a=s+_|0;if(s>>>0>=a>>>0)Pe();o=E[s+24>>2]|0;i=E[s+12>>2]|0;do if((i|0)==(s|0)){e=s+20|0;r=E[e>>2]|0;if(!r){e=s+16|0;r=E[e>>2]|0;if(!r){d=0;break}}while(1){i=r+20|0;n=E[i>>2]|0;if(n){r=n;e=i;continue}i=r+16|0;n=E[i>>2]|0;if(!n)break;else{r=n;e=i}}if(e>>>0<t>>>0)Pe();else{E[e>>2]=0;d=r;break}}else{n=E[s+8>>2]|0;if(n>>>0<t>>>0)Pe();r=n+12|0;if((E[r>>2]|0)!=(s|0))Pe();e=i+8|0;if((E[e>>2]|0)==(s|0)){E[r>>2]=i;E[e>>2]=n;d=i;break}else Pe()}while(0);do if(o){r=E[s+28>>2]|0;e=892+(r<<2)|0;if((s|0)==(E[e>>2]|0)){E[e>>2]=d;if(!d){E[148]=E[148]&~(1<<r);break}}else{if(o>>>0<(E[151]|0)>>>0)Pe();r=o+16|0;if((E[r>>2]|0)==(s|0))E[r>>2]=d;else E[o+20>>2]=d;if(!d)break}e=E[151]|0;if(d>>>0<e>>>0)Pe();E[d+24>>2]=o;r=E[s+16>>2]|0;do if(r)if(r>>>0<e>>>0)Pe();else{E[d+16>>2]=r;E[r+24>>2]=d;break}while(0);r=E[s+20>>2]|0;if(r)if(r>>>0<(E[151]|0)>>>0)Pe();else{E[d+20>>2]=r;E[r+24>>2]=d;break}}while(0);e:do if(u>>>0>=16){E[s+4>>2]=_|3;E[s+(_|4)>>2]=u|1;E[s+(u+_)>>2]=u;r=u>>>3;if(u>>>0<256){e=r<<1;n=628+(e<<2)|0;i=E[147]|0;r=1<<r;if(i&r){r=628+(e+2<<2)|0;e=E[r>>2]|0;if(e>>>0<(E[151]|0)>>>0)Pe();else{M=r;S=e}}else{E[147]=i|r;M=628+(e+2<<2)|0;S=n}E[M>>2]=a;E[S+12>>2]=a;E[s+(_+8)>>2]=S;E[s+(_+12)>>2]=n;break}r=u>>>8;if(r)if(u>>>0>16777215)n=31;else{D=(r+1048320|0)>>>16&8;y=r<<D;U=(y+520192|0)>>>16&4;y=y<<U;n=(y+245760|0)>>>16&2;n=14-(U|D|n)+(y<<n>>>15)|0;n=u>>>(n+7|0)&1|n<<1}else n=0;r=892+(n<<2)|0;E[s+(_+28)>>2]=n;E[s+(_+20)>>2]=0;E[s+(_+16)>>2]=0;e=E[148]|0;i=1<<n;if(!(e&i)){E[148]=e|i;E[r>>2]=a;E[s+(_+24)>>2]=r;E[s+(_+12)>>2]=a;E[s+(_+8)>>2]=a;break}r=E[r>>2]|0;r:do if((E[r+4>>2]&-8|0)!=(u|0)){n=u<<((n|0)==31?0:25-(n>>>1)|0);while(1){e=r+16+(n>>>31<<2)|0;i=E[e>>2]|0;if(!i)break;if((E[i+4>>2]&-8|0)==(u|0)){I=i;break r}else{n=n<<1;r=i}}if(e>>>0<(E[151]|0)>>>0)Pe();else{E[e>>2]=a;E[s+(_+24)>>2]=r;E[s+(_+12)>>2]=a;E[s+(_+8)>>2]=a;break e}}else I=r;while(0);r=I+8|0;e=E[r>>2]|0;y=E[151]|0;if(e>>>0>=y>>>0&I>>>0>=y>>>0){E[e+12>>2]=a;E[r>>2]=a;E[s+(_+8)>>2]=e;E[s+(_+12)>>2]=I;E[s+(_+24)>>2]=0;break}else Pe()}else{y=u+_|0;E[s+4>>2]=y|3;y=s+(y+4)|0;E[y>>2]=E[y>>2]|1}while(0);y=s+8|0;return y|0}else A=_}else A=_}else A=-1;while(0);i=E[149]|0;if(i>>>0>=A>>>0){r=i-A|0;e=E[152]|0;if(r>>>0>15){E[152]=e+A;E[149]=r;E[e+(A+4)>>2]=r|1;E[e+i>>2]=r;E[e+4>>2]=A|3}else{E[149]=0;E[152]=0;E[e+4>>2]=i|3;y=e+(i+4)|0;E[y>>2]=E[y>>2]|1}y=e+8|0;return y|0}e=E[150]|0;if(e>>>0>A>>>0){D=e-A|0;E[150]=D;y=E[153]|0;E[153]=y+A;E[y+(A+4)>>2]=D|1;E[y+4>>2]=A|3;y=y+8|0;return y|0}do if(!(E[265]|0)){e=Xe(30)|0;if(!(e+-1&e)){E[267]=e;E[266]=e;E[268]=-1;E[269]=-1;E[270]=0;E[258]=0;I=(ke(0)|0)&-16^1431655768;E[265]=I;break}else Pe()}while(0);s=A+48|0;u=E[267]|0;l=A+47|0;a=u+l|0;u=0-u|0;f=a&u;if(f>>>0<=A>>>0){y=0;return y|0}e=E[257]|0;if((e|0)!=0?(S=E[255]|0,I=S+f|0,I>>>0<=S>>>0|I>>>0>e>>>0):0){y=0;return y|0}e:do if(!(E[258]&4)){e=E[153]|0;r:do if(e){t=1036;while(1){i=E[t>>2]|0;if(i>>>0<=e>>>0?(R=t+4|0,(i+(E[R>>2]|0)|0)>>>0>e>>>0):0){o=t;e=R;break}t=E[t+8>>2]|0;if(!t){h=174;break r}}i=a-(E[150]|0)&u;if(i>>>0<2147483647){t=Le(i|0)|0;I=(t|0)==((E[o>>2]|0)+(E[e>>2]|0)|0);e=I?i:0;if(I){if((t|0)!=(-1|0)){N=t;T=e;h=194;break e}}else h=184}else e=0}else h=174;while(0);do if((h|0)==174){o=Le(0)|0;if((o|0)!=(-1|0)){e=o;i=E[266]|0;t=i+-1|0;if(!(t&e))i=f;else i=f-e+(t+e&0-i)|0;e=E[255]|0;t=e+i|0;if(i>>>0>A>>>0&i>>>0<2147483647){I=E[257]|0;if((I|0)!=0?t>>>0<=e>>>0|t>>>0>I>>>0:0){e=0;break}t=Le(i|0)|0;I=(t|0)==(o|0);e=I?i:0;if(I){N=o;T=e;h=194;break e}else h=184}else e=0}else e=0}while(0);r:do if((h|0)==184){o=0-i|0;do if(s>>>0>i>>>0&(i>>>0<2147483647&(t|0)!=(-1|0))?(m=E[267]|0,m=l-i+m&0-m,m>>>0<2147483647):0)if((Le(m|0)|0)==(-1|0)){Le(o|0)|0;break r}else{i=m+i|0;break}while(0);if((t|0)!=(-1|0)){N=t;T=i;h=194;break e}}while(0);E[258]=E[258]|4;h=191}else{e=0;h=191}while(0);if((((h|0)==191?f>>>0<2147483647:0)?(N=Le(f|0)|0,C=Le(0)|0,N>>>0<C>>>0&((N|0)!=(-1|0)&(C|0)!=(-1|0))):0)?(p=C-N|0,w=p>>>0>(A+40|0)>>>0,w):0){T=w?p:e;h=194}if((h|0)==194){e=(E[255]|0)+T|0;E[255]=e;if(e>>>0>(E[256]|0)>>>0)E[256]=e;a=E[153]|0;e:do if(a){o=1036;do{e=E[o>>2]|0;i=o+4|0;t=E[i>>2]|0;if((N|0)==(e+t|0)){b=e;O=i;P=t;v=o;h=204;break}o=E[o+8>>2]|0}while((o|0)!=0);if(((h|0)==204?(E[v+12>>2]&8|0)==0:0)?a>>>0<N>>>0&a>>>0>=b>>>0:0){E[O>>2]=P+T;y=(E[150]|0)+T|0;D=a+8|0;D=(D&7|0)==0?0:0-D&7;U=y-D|0;E[153]=a+D;E[150]=U;E[a+(D+4)>>2]=U|1;E[a+(y+4)>>2]=40;E[154]=E[269];break}e=E[151]|0;if(N>>>0<e>>>0){E[151]=N;e=N}i=N+T|0;o=1036;while(1){if((E[o>>2]|0)==(i|0)){t=o;i=o;h=212;break}o=E[o+8>>2]|0;if(!o){i=1036;break}}if((h|0)==212)if(!(E[i+12>>2]&8)){E[t>>2]=N;c=i+4|0;E[c>>2]=(E[c>>2]|0)+T;c=N+8|0;c=(c&7|0)==0?0:0-c&7;l=N+(T+8)|0;l=(l&7|0)==0?0:0-l&7;r=N+(l+T)|0;_=c+A|0;d=N+_|0;f=r-(N+c)-A|0;E[N+(c+4)>>2]=A|3;r:do if((r|0)!=(a|0)){if((r|0)==(E[152]|0)){y=(E[149]|0)+f|0;E[149]=y;E[152]=d;E[N+(_+4)>>2]=y|1;E[N+(y+_)>>2]=y;break}u=T+4|0;i=E[N+(u+l)>>2]|0;if((i&3|0)==1){s=i&-8;o=i>>>3;i:do if(i>>>0>=256){a=E[N+((l|24)+T)>>2]|0;n=E[N+(T+12+l)>>2]|0;do if((n|0)==(r|0)){t=l|16;n=N+(u+t)|0;i=E[n>>2]|0;if(!i){n=N+(t+T)|0;i=E[n>>2]|0;if(!i){g=0;break}}while(1){t=i+20|0;o=E[t>>2]|0;if(o){i=o;n=t;continue}t=i+16|0;o=E[t>>2]|0;if(!o)break;else{i=o;n=t}}if(n>>>0<e>>>0)Pe();else{E[n>>2]=0;g=i;break}}else{t=E[N+((l|8)+T)>>2]|0;if(t>>>0<e>>>0)Pe();e=t+12|0;if((E[e>>2]|0)!=(r|0))Pe();i=n+8|0;if((E[i>>2]|0)==(r|0)){E[e>>2]=n;E[i>>2]=t;g=n;break}else Pe()}while(0);if(!a)break;e=E[N+(T+28+l)>>2]|0;i=892+(e<<2)|0;do if((r|0)!=(E[i>>2]|0)){if(a>>>0<(E[151]|0)>>>0)Pe();e=a+16|0;if((E[e>>2]|0)==(r|0))E[e>>2]=g;else E[a+20>>2]=g;if(!g)break i}else{E[i>>2]=g;if(g)break;E[148]=E[148]&~(1<<e);break i}while(0);i=E[151]|0;if(g>>>0<i>>>0)Pe();E[g+24>>2]=a;r=l|16;e=E[N+(r+T)>>2]|0;do if(e)if(e>>>0<i>>>0)Pe();else{E[g+16>>2]=e;E[e+24>>2]=g;break}while(0);r=E[N+(u+r)>>2]|0;if(!r)break;if(r>>>0<(E[151]|0)>>>0)Pe();else{E[g+20>>2]=r;E[r+24>>2]=g;break}}else{n=E[N+((l|8)+T)>>2]|0;t=E[N+(T+12+l)>>2]|0;i=628+(o<<1<<2)|0;do if((n|0)!=(i|0)){if(n>>>0<e>>>0)Pe();if((E[n+12>>2]|0)==(r|0))break;Pe()}while(0);if((t|0)==(n|0)){E[147]=E[147]&~(1<<o);break}do if((t|0)==(i|0))B=t+8|0;else{if(t>>>0<e>>>0)Pe();e=t+8|0;if((E[e>>2]|0)==(r|0)){B=e;break}Pe()}while(0);E[n+12>>2]=t;E[B>>2]=n}while(0);r=N+((s|l)+T)|0;t=s+f|0}else t=f;r=r+4|0;E[r>>2]=E[r>>2]&-2;E[N+(_+4)>>2]=t|1;E[N+(t+_)>>2]=t;r=t>>>3;if(t>>>0<256){e=r<<1;n=628+(e<<2)|0;i=E[147]|0;r=1<<r;do if(!(i&r)){E[147]=i|r;U=628+(e+2<<2)|0;D=n}else{r=628+(e+2<<2)|0;e=E[r>>2]|0;if(e>>>0>=(E[151]|0)>>>0){U=r;D=e;break}Pe()}while(0);E[U>>2]=d;E[D+12>>2]=d;E[N+(_+8)>>2]=D;E[N+(_+12)>>2]=n;break}r=t>>>8;do if(!r)n=0;else{if(t>>>0>16777215){n=31;break}U=(r+1048320|0)>>>16&8;D=r<<U;g=(D+520192|0)>>>16&4;D=D<<g;n=(D+245760|0)>>>16&2;n=14-(g|U|n)+(D<<n>>>15)|0;n=t>>>(n+7|0)&1|n<<1}while(0);r=892+(n<<2)|0;E[N+(_+28)>>2]=n;E[N+(_+20)>>2]=0;E[N+(_+16)>>2]=0;e=E[148]|0;i=1<<n;if(!(e&i)){E[148]=e|i;E[r>>2]=d; +E[N+(_+24)>>2]=r;E[N+(_+12)>>2]=d;E[N+(_+8)>>2]=d;break}r=E[r>>2]|0;i:do if((E[r+4>>2]&-8|0)!=(t|0)){n=t<<((n|0)==31?0:25-(n>>>1)|0);while(1){e=r+16+(n>>>31<<2)|0;i=E[e>>2]|0;if(!i)break;if((E[i+4>>2]&-8|0)==(t|0)){y=i;break i}else{n=n<<1;r=i}}if(e>>>0<(E[151]|0)>>>0)Pe();else{E[e>>2]=d;E[N+(_+24)>>2]=r;E[N+(_+12)>>2]=d;E[N+(_+8)>>2]=d;break r}}else y=r;while(0);r=y+8|0;e=E[r>>2]|0;D=E[151]|0;if(e>>>0>=D>>>0&y>>>0>=D>>>0){E[e+12>>2]=d;E[r>>2]=d;E[N+(_+8)>>2]=e;E[N+(_+12)>>2]=y;E[N+(_+24)>>2]=0;break}else Pe()}else{y=(E[150]|0)+f|0;E[150]=y;E[153]=d;E[N+(_+4)>>2]=y|1}while(0);y=N+(c|8)|0;return y|0}else i=1036;while(1){e=E[i>>2]|0;if(e>>>0<=a>>>0?(r=E[i+4>>2]|0,n=e+r|0,n>>>0>a>>>0):0)break;i=E[i+8>>2]|0}t=e+(r+-39)|0;e=e+(r+-47+((t&7|0)==0?0:0-t&7))|0;t=a+16|0;e=e>>>0<t>>>0?a:e;r=e+8|0;i=N+8|0;i=(i&7|0)==0?0:0-i&7;y=T+-40-i|0;E[153]=N+i;E[150]=y;E[N+(i+4)>>2]=y|1;E[N+(T+-36)>>2]=40;E[154]=E[269];i=e+4|0;E[i>>2]=27;E[r>>2]=E[259];E[r+4>>2]=E[260];E[r+8>>2]=E[261];E[r+12>>2]=E[262];E[259]=N;E[260]=T;E[262]=0;E[261]=r;r=e+28|0;E[r>>2]=7;if((e+32|0)>>>0<n>>>0)do{y=r;r=r+4|0;E[r>>2]=7}while((y+8|0)>>>0<n>>>0);if((e|0)!=(a|0)){o=e-a|0;E[i>>2]=E[i>>2]&-2;E[a+4>>2]=o|1;E[e>>2]=o;r=o>>>3;if(o>>>0<256){e=r<<1;n=628+(e<<2)|0;i=E[147]|0;r=1<<r;if(i&r){r=628+(e+2<<2)|0;e=E[r>>2]|0;if(e>>>0<(E[151]|0)>>>0)Pe();else{L=r;k=e}}else{E[147]=i|r;L=628+(e+2<<2)|0;k=n}E[L>>2]=a;E[k+12>>2]=a;E[a+8>>2]=k;E[a+12>>2]=n;break}r=o>>>8;if(r)if(o>>>0>16777215)n=31;else{D=(r+1048320|0)>>>16&8;y=r<<D;U=(y+520192|0)>>>16&4;y=y<<U;n=(y+245760|0)>>>16&2;n=14-(U|D|n)+(y<<n>>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;i=892+(n<<2)|0;E[a+28>>2]=n;E[a+20>>2]=0;E[t>>2]=0;r=E[148]|0;e=1<<n;if(!(r&e)){E[148]=r|e;E[i>>2]=a;E[a+24>>2]=i;E[a+12>>2]=a;E[a+8>>2]=a;break}r=E[i>>2]|0;r:do if((E[r+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){e=r+16+(n>>>31<<2)|0;i=E[e>>2]|0;if(!i)break;if((E[i+4>>2]&-8|0)==(o|0)){F=i;break r}else{n=n<<1;r=i}}if(e>>>0<(E[151]|0)>>>0)Pe();else{E[e>>2]=a;E[a+24>>2]=r;E[a+12>>2]=a;E[a+8>>2]=a;break e}}else F=r;while(0);r=F+8|0;e=E[r>>2]|0;y=E[151]|0;if(e>>>0>=y>>>0&F>>>0>=y>>>0){E[e+12>>2]=a;E[r>>2]=a;E[a+8>>2]=e;E[a+12>>2]=F;E[a+24>>2]=0;break}else Pe()}}else{y=E[151]|0;if((y|0)==0|N>>>0<y>>>0)E[151]=N;E[259]=N;E[260]=T;E[262]=0;E[156]=E[265];E[155]=-1;r=0;do{y=r<<1;D=628+(y<<2)|0;E[628+(y+3<<2)>>2]=D;E[628+(y+2<<2)>>2]=D;r=r+1|0}while((r|0)!=32);y=N+8|0;y=(y&7|0)==0?0:0-y&7;D=T+-40-y|0;E[153]=N+y;E[150]=D;E[N+(y+4)>>2]=D|1;E[N+(T+-36)>>2]=40;E[154]=E[269]}while(0);r=E[150]|0;if(r>>>0>A>>>0){D=r-A|0;E[150]=D;y=E[153]|0;E[153]=y+A;E[y+(A+4)>>2]=D|1;E[y+4>>2]=A|3;y=y+8|0;return y|0}}y=si()|0;E[y>>2]=12;y=0;return y|0}function Hi(e){e=e|0;var r=0,i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,T=0,A=0,R=0,M=0,S=0,m=0;if(!e)return;r=e+-8|0;u=E[151]|0;if(r>>>0<u>>>0)Pe();i=E[e+-4>>2]|0;n=i&3;if((n|0)==1)Pe();d=i&-8;A=e+(d+-8)|0;do if(!(i&1)){r=E[r>>2]|0;if(!n)return;s=-8-r|0;f=e+s|0;_=r+d|0;if(f>>>0<u>>>0)Pe();if((f|0)==(E[152]|0)){r=e+(d+-4)|0;i=E[r>>2]|0;if((i&3|0)!=3){m=f;o=_;break}E[149]=_;E[r>>2]=i&-2;E[e+(s+4)>>2]=_|1;E[A>>2]=_;return}t=r>>>3;if(r>>>0<256){n=E[e+(s+8)>>2]|0;i=E[e+(s+12)>>2]|0;r=628+(t<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<u>>>0)Pe();if((E[n+12>>2]|0)!=(f|0))Pe()}if((i|0)==(n|0)){E[147]=E[147]&~(1<<t);m=f;o=_;break}if((i|0)!=(r|0)){if(i>>>0<u>>>0)Pe();r=i+8|0;if((E[r>>2]|0)==(f|0))a=r;else Pe()}else a=i+8|0;E[n+12>>2]=i;E[a>>2]=n;m=f;o=_;break}a=E[e+(s+24)>>2]|0;n=E[e+(s+12)>>2]|0;do if((n|0)==(f|0)){i=e+(s+20)|0;r=E[i>>2]|0;if(!r){i=e+(s+16)|0;r=E[i>>2]|0;if(!r){l=0;break}}while(1){n=r+20|0;t=E[n>>2]|0;if(t){r=t;i=n;continue}n=r+16|0;t=E[n>>2]|0;if(!t)break;else{r=t;i=n}}if(i>>>0<u>>>0)Pe();else{E[i>>2]=0;l=r;break}}else{t=E[e+(s+8)>>2]|0;if(t>>>0<u>>>0)Pe();r=t+12|0;if((E[r>>2]|0)!=(f|0))Pe();i=n+8|0;if((E[i>>2]|0)==(f|0)){E[r>>2]=n;E[i>>2]=t;l=n;break}else Pe()}while(0);if(a){r=E[e+(s+28)>>2]|0;i=892+(r<<2)|0;if((f|0)==(E[i>>2]|0)){E[i>>2]=l;if(!l){E[148]=E[148]&~(1<<r);m=f;o=_;break}}else{if(a>>>0<(E[151]|0)>>>0)Pe();r=a+16|0;if((E[r>>2]|0)==(f|0))E[r>>2]=l;else E[a+20>>2]=l;if(!l){m=f;o=_;break}}i=E[151]|0;if(l>>>0<i>>>0)Pe();E[l+24>>2]=a;r=E[e+(s+16)>>2]|0;do if(r)if(r>>>0<i>>>0)Pe();else{E[l+16>>2]=r;E[r+24>>2]=l;break}while(0);r=E[e+(s+20)>>2]|0;if(r)if(r>>>0<(E[151]|0)>>>0)Pe();else{E[l+20>>2]=r;E[r+24>>2]=l;m=f;o=_;break}else{m=f;o=_}}else{m=f;o=_}}else{m=r;o=d}while(0);if(m>>>0>=A>>>0)Pe();r=e+(d+-4)|0;i=E[r>>2]|0;if(!(i&1))Pe();if(!(i&2)){if((A|0)==(E[153]|0)){S=(E[150]|0)+o|0;E[150]=S;E[153]=m;E[m+4>>2]=S|1;if((m|0)!=(E[152]|0))return;E[152]=0;E[149]=0;return}if((A|0)==(E[152]|0)){S=(E[149]|0)+o|0;E[149]=S;E[152]=m;E[m+4>>2]=S|1;E[m+S>>2]=S;return}o=(i&-8)+o|0;t=i>>>3;do if(i>>>0>=256){a=E[e+(d+16)>>2]|0;r=E[e+(d|4)>>2]|0;do if((r|0)==(A|0)){i=e+(d+12)|0;r=E[i>>2]|0;if(!r){i=e+(d+8)|0;r=E[i>>2]|0;if(!r){T=0;break}}while(1){n=r+20|0;t=E[n>>2]|0;if(t){r=t;i=n;continue}n=r+16|0;t=E[n>>2]|0;if(!t)break;else{r=t;i=n}}if(i>>>0<(E[151]|0)>>>0)Pe();else{E[i>>2]=0;T=r;break}}else{i=E[e+d>>2]|0;if(i>>>0<(E[151]|0)>>>0)Pe();n=i+12|0;if((E[n>>2]|0)!=(A|0))Pe();t=r+8|0;if((E[t>>2]|0)==(A|0)){E[n>>2]=r;E[t>>2]=i;T=r;break}else Pe()}while(0);if(a){r=E[e+(d+20)>>2]|0;i=892+(r<<2)|0;if((A|0)==(E[i>>2]|0)){E[i>>2]=T;if(!T){E[148]=E[148]&~(1<<r);break}}else{if(a>>>0<(E[151]|0)>>>0)Pe();r=a+16|0;if((E[r>>2]|0)==(A|0))E[r>>2]=T;else E[a+20>>2]=T;if(!T)break}i=E[151]|0;if(T>>>0<i>>>0)Pe();E[T+24>>2]=a;r=E[e+(d+8)>>2]|0;do if(r)if(r>>>0<i>>>0)Pe();else{E[T+16>>2]=r;E[r+24>>2]=T;break}while(0);r=E[e+(d+12)>>2]|0;if(r)if(r>>>0<(E[151]|0)>>>0)Pe();else{E[T+20>>2]=r;E[r+24>>2]=T;break}}}else{n=E[e+d>>2]|0;i=E[e+(d|4)>>2]|0;r=628+(t<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0<(E[151]|0)>>>0)Pe();if((E[n+12>>2]|0)!=(A|0))Pe()}if((i|0)==(n|0)){E[147]=E[147]&~(1<<t);break}if((i|0)!=(r|0)){if(i>>>0<(E[151]|0)>>>0)Pe();r=i+8|0;if((E[r>>2]|0)==(A|0))c=r;else Pe()}else c=i+8|0;E[n+12>>2]=i;E[c>>2]=n}while(0);E[m+4>>2]=o|1;E[m+o>>2]=o;if((m|0)==(E[152]|0)){E[149]=o;return}}else{E[r>>2]=i&-2;E[m+4>>2]=o|1;E[m+o>>2]=o}r=o>>>3;if(o>>>0<256){i=r<<1;t=628+(i<<2)|0;n=E[147]|0;r=1<<r;if(n&r){r=628+(i+2<<2)|0;i=E[r>>2]|0;if(i>>>0<(E[151]|0)>>>0)Pe();else{R=r;M=i}}else{E[147]=n|r;R=628+(i+2<<2)|0;M=t}E[R>>2]=m;E[M+12>>2]=m;E[m+8>>2]=M;E[m+12>>2]=t;return}r=o>>>8;if(r)if(o>>>0>16777215)t=31;else{R=(r+1048320|0)>>>16&8;M=r<<R;A=(M+520192|0)>>>16&4;M=M<<A;t=(M+245760|0)>>>16&2;t=14-(A|R|t)+(M<<t>>>15)|0;t=o>>>(t+7|0)&1|t<<1}else t=0;r=892+(t<<2)|0;E[m+28>>2]=t;E[m+20>>2]=0;E[m+16>>2]=0;i=E[148]|0;n=1<<t;e:do if(i&n){r=E[r>>2]|0;r:do if((E[r+4>>2]&-8|0)!=(o|0)){t=o<<((t|0)==31?0:25-(t>>>1)|0);while(1){i=r+16+(t>>>31<<2)|0;n=E[i>>2]|0;if(!n)break;if((E[n+4>>2]&-8|0)==(o|0)){S=n;break r}else{t=t<<1;r=n}}if(i>>>0<(E[151]|0)>>>0)Pe();else{E[i>>2]=m;E[m+24>>2]=r;E[m+12>>2]=m;E[m+8>>2]=m;break e}}else S=r;while(0);r=S+8|0;i=E[r>>2]|0;M=E[151]|0;if(i>>>0>=M>>>0&S>>>0>=M>>>0){E[i+12>>2]=m;E[r>>2]=m;E[m+8>>2]=i;E[m+12>>2]=S;E[m+24>>2]=0;break}else Pe()}else{E[148]=i|n;E[r>>2]=m;E[m+24>>2]=r;E[m+12>>2]=m;E[m+8>>2]=m}while(0);m=(E[155]|0)+-1|0;E[155]=m;if(!m)r=1044;else return;while(1){r=E[r>>2]|0;if(!r)break;else r=r+8|0}E[155]=-1;return}function Xi(e,r){e=e|0;r=r|0;var i=0,n=0;if(!e){e=Gi(r)|0;return e|0}if(r>>>0>4294967231){e=si()|0;E[e>>2]=12;e=0;return e|0}i=Yi(e+-8|0,r>>>0<11?16:r+11&-8)|0;if(i){e=i+8|0;return e|0}i=Gi(r)|0;if(!i){e=0;return e|0}n=E[e+-4>>2]|0;n=(n&-8)-((n&3|0)==0?8:4)|0;Ji(i|0,e|0,(n>>>0<r>>>0?n:r)|0)|0;Hi(e);e=i;return e|0}function Vi(e){e=e|0;var r=0;if(!e){r=0;return r|0}e=E[e+-4>>2]|0;r=e&3;if((r|0)==1){r=0;return r|0}r=(e&-8)-((r|0)==0?8:4)|0;return r|0}function Yi(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,T=0;d=e+4|0;T=E[d>>2]|0;s=T&-8;f=e+s|0;u=E[151]|0;i=T&3;if(!((i|0)!=1&e>>>0>=u>>>0&e>>>0<f>>>0))Pe();n=e+(s|4)|0;t=E[n>>2]|0;if(!(t&1))Pe();if(!i){if(r>>>0<256){e=0;return e|0}if(s>>>0>=(r+4|0)>>>0?(s-r|0)>>>0<=E[267]<<1>>>0:0)return e|0;e=0;return e|0}if(s>>>0>=r>>>0){i=s-r|0;if(i>>>0<=15)return e|0;E[d>>2]=T&1|r|2;E[e+(r+4)>>2]=i|3;E[n>>2]=E[n>>2]|1;xi(e+r|0,i);return e|0}if((f|0)==(E[153]|0)){i=(E[150]|0)+s|0;if(i>>>0<=r>>>0){e=0;return e|0}c=i-r|0;E[d>>2]=T&1|r|2;E[e+(r+4)>>2]=c|1;E[153]=e+r;E[150]=c;return e|0}if((f|0)==(E[152]|0)){n=(E[149]|0)+s|0;if(n>>>0<r>>>0){e=0;return e|0}i=n-r|0;if(i>>>0>15){E[d>>2]=T&1|r|2;E[e+(r+4)>>2]=i|1;E[e+n>>2]=i;n=e+(n+4)|0;E[n>>2]=E[n>>2]&-2;n=e+r|0}else{E[d>>2]=T&1|n|2;n=e+(n+4)|0;E[n>>2]=E[n>>2]|1;n=0;i=0}E[149]=i;E[152]=n;return e|0}if(t&2){e=0;return e|0}_=(t&-8)+s|0;if(_>>>0<r>>>0){e=0;return e|0}c=_-r|0;o=t>>>3;do if(t>>>0>=256){a=E[e+(s+24)>>2]|0;o=E[e+(s+12)>>2]|0;do if((o|0)==(f|0)){n=e+(s+20)|0;i=E[n>>2]|0;if(!i){n=e+(s+16)|0;i=E[n>>2]|0;if(!i){l=0;break}}while(1){t=i+20|0;o=E[t>>2]|0;if(o){i=o;n=t;continue}t=i+16|0;o=E[t>>2]|0;if(!o)break;else{i=o;n=t}}if(n>>>0<u>>>0)Pe();else{E[n>>2]=0;l=i;break}}else{t=E[e+(s+8)>>2]|0;if(t>>>0<u>>>0)Pe();i=t+12|0;if((E[i>>2]|0)!=(f|0))Pe();n=o+8|0;if((E[n>>2]|0)==(f|0)){E[i>>2]=o;E[n>>2]=t;l=o;break}else Pe()}while(0);if(a){i=E[e+(s+28)>>2]|0;n=892+(i<<2)|0;if((f|0)==(E[n>>2]|0)){E[n>>2]=l;if(!l){E[148]=E[148]&~(1<<i);break}}else{if(a>>>0<(E[151]|0)>>>0)Pe();i=a+16|0;if((E[i>>2]|0)==(f|0))E[i>>2]=l;else E[a+20>>2]=l;if(!l)break}n=E[151]|0;if(l>>>0<n>>>0)Pe();E[l+24>>2]=a;i=E[e+(s+16)>>2]|0;do if(i)if(i>>>0<n>>>0)Pe();else{E[l+16>>2]=i;E[i+24>>2]=l;break}while(0);i=E[e+(s+20)>>2]|0;if(i)if(i>>>0<(E[151]|0)>>>0)Pe();else{E[l+20>>2]=i;E[i+24>>2]=l;break}}}else{t=E[e+(s+8)>>2]|0;n=E[e+(s+12)>>2]|0;i=628+(o<<1<<2)|0;if((t|0)!=(i|0)){if(t>>>0<u>>>0)Pe();if((E[t+12>>2]|0)!=(f|0))Pe()}if((n|0)==(t|0)){E[147]=E[147]&~(1<<o);break}if((n|0)!=(i|0)){if(n>>>0<u>>>0)Pe();i=n+8|0;if((E[i>>2]|0)==(f|0))a=i;else Pe()}else a=n+8|0;E[t+12>>2]=n;E[a>>2]=t}while(0);if(c>>>0<16){E[d>>2]=_|T&1|2;r=e+(_|4)|0;E[r>>2]=E[r>>2]|1;return e|0}else{E[d>>2]=T&1|r|2;E[e+(r+4)>>2]=c|3;T=e+(_|4)|0;E[T>>2]=E[T>>2]|1;xi(e+r|0,c);return e|0}return 0}function xi(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,T=0,A=0,R=0,M=0,S=0;A=e+r|0;i=E[e+4>>2]|0;do if(!(i&1)){l=E[e>>2]|0;if(!(i&3))return;c=e+(0-l)|0;_=l+r|0;s=E[151]|0;if(c>>>0<s>>>0)Pe();if((c|0)==(E[152]|0)){n=e+(r+4)|0;i=E[n>>2]|0;if((i&3|0)!=3){S=c;a=_;break}E[149]=_;E[n>>2]=i&-2;E[e+(4-l)>>2]=_|1;E[A>>2]=_;return}o=l>>>3;if(l>>>0<256){t=E[e+(8-l)>>2]|0;n=E[e+(12-l)>>2]|0;i=628+(o<<1<<2)|0;if((t|0)!=(i|0)){if(t>>>0<s>>>0)Pe();if((E[t+12>>2]|0)!=(c|0))Pe()}if((n|0)==(t|0)){E[147]=E[147]&~(1<<o);S=c;a=_;break}if((n|0)!=(i|0)){if(n>>>0<s>>>0)Pe();i=n+8|0;if((E[i>>2]|0)==(c|0))u=i;else Pe()}else u=n+8|0;E[t+12>>2]=n;E[u>>2]=t;S=c;a=_;break}u=E[e+(24-l)>>2]|0;t=E[e+(12-l)>>2]|0;do if((t|0)==(c|0)){t=16-l|0;n=e+(t+4)|0;i=E[n>>2]|0;if(!i){n=e+t|0;i=E[n>>2]|0;if(!i){f=0;break}}while(1){t=i+20|0;o=E[t>>2]|0;if(o){i=o;n=t;continue}t=i+16|0;o=E[t>>2]|0;if(!o)break;else{i=o;n=t}}if(n>>>0<s>>>0)Pe();else{E[n>>2]=0;f=i;break}}else{o=E[e+(8-l)>>2]|0;if(o>>>0<s>>>0)Pe();i=o+12|0;if((E[i>>2]|0)!=(c|0))Pe();n=t+8|0;if((E[n>>2]|0)==(c|0)){E[i>>2]=t;E[n>>2]=o;f=t;break}else Pe()}while(0);if(u){i=E[e+(28-l)>>2]|0;n=892+(i<<2)|0;if((c|0)==(E[n>>2]|0)){E[n>>2]=f;if(!f){E[148]=E[148]&~(1<<i);S=c;a=_;break}}else{if(u>>>0<(E[151]|0)>>>0)Pe();i=u+16|0;if((E[i>>2]|0)==(c|0))E[i>>2]=f;else E[u+20>>2]=f;if(!f){S=c;a=_;break}}t=E[151]|0;if(f>>>0<t>>>0)Pe();E[f+24>>2]=u;i=16-l|0;n=E[e+i>>2]|0;do if(n)if(n>>>0<t>>>0)Pe();else{E[f+16>>2]=n;E[n+24>>2]=f;break}while(0);i=E[e+(i+4)>>2]|0;if(i)if(i>>>0<(E[151]|0)>>>0)Pe();else{E[f+20>>2]=i;E[i+24>>2]=f;S=c;a=_;break}else{S=c;a=_}}else{S=c;a=_}}else{S=e;a=r}while(0);s=E[151]|0;if(A>>>0<s>>>0)Pe();i=e+(r+4)|0;n=E[i>>2]|0;if(!(n&2)){if((A|0)==(E[153]|0)){M=(E[150]|0)+a|0;E[150]=M;E[153]=S;E[S+4>>2]=M|1;if((S|0)!=(E[152]|0))return;E[152]=0;E[149]=0;return}if((A|0)==(E[152]|0)){M=(E[149]|0)+a|0;E[149]=M;E[152]=S;E[S+4>>2]=M|1;E[S+M>>2]=M;return}a=(n&-8)+a|0;o=n>>>3;do if(n>>>0>=256){u=E[e+(r+24)>>2]|0;t=E[e+(r+12)>>2]|0;do if((t|0)==(A|0)){n=e+(r+20)|0;i=E[n>>2]|0;if(!i){n=e+(r+16)|0;i=E[n>>2]|0;if(!i){T=0;break}}while(1){t=i+20|0;o=E[t>>2]|0;if(o){i=o;n=t;continue}t=i+16|0;o=E[t>>2]|0;if(!o)break;else{i=o;n=t}}if(n>>>0<s>>>0)Pe();else{E[n>>2]=0;T=i;break}}else{o=E[e+(r+8)>>2]|0;if(o>>>0<s>>>0)Pe();i=o+12|0;if((E[i>>2]|0)!=(A|0))Pe();n=t+8|0;if((E[n>>2]|0)==(A|0)){E[i>>2]=t;E[n>>2]=o;T=t;break}else Pe()}while(0);if(u){i=E[e+(r+28)>>2]|0;n=892+(i<<2)|0;if((A|0)==(E[n>>2]|0)){E[n>>2]=T;if(!T){E[148]=E[148]&~(1<<i);break}}else{if(u>>>0<(E[151]|0)>>>0)Pe();i=u+16|0;if((E[i>>2]|0)==(A|0))E[i>>2]=T;else E[u+20>>2]=T;if(!T)break}n=E[151]|0;if(T>>>0<n>>>0)Pe();E[T+24>>2]=u;i=E[e+(r+16)>>2]|0;do if(i)if(i>>>0<n>>>0)Pe();else{E[T+16>>2]=i;E[i+24>>2]=T;break}while(0);i=E[e+(r+20)>>2]|0;if(i)if(i>>>0<(E[151]|0)>>>0)Pe();else{E[T+20>>2]=i;E[i+24>>2]=T;break}}}else{t=E[e+(r+8)>>2]|0;n=E[e+(r+12)>>2]|0;i=628+(o<<1<<2)|0;if((t|0)!=(i|0)){if(t>>>0<s>>>0)Pe();if((E[t+12>>2]|0)!=(A|0))Pe()}if((n|0)==(t|0)){E[147]=E[147]&~(1<<o);break}if((n|0)!=(i|0)){if(n>>>0<s>>>0)Pe();i=n+8|0;if((E[i>>2]|0)==(A|0))d=i;else Pe()}else d=n+8|0;E[t+12>>2]=n;E[d>>2]=t}while(0);E[S+4>>2]=a|1;E[S+a>>2]=a;if((S|0)==(E[152]|0)){E[149]=a;return}}else{E[i>>2]=n&-2;E[S+4>>2]=a|1;E[S+a>>2]=a}i=a>>>3;if(a>>>0<256){n=i<<1;o=628+(n<<2)|0;t=E[147]|0;i=1<<i;if(t&i){i=628+(n+2<<2)|0;n=E[i>>2]|0;if(n>>>0<(E[151]|0)>>>0)Pe();else{R=i;M=n}}else{E[147]=t|i;R=628+(n+2<<2)|0;M=o}E[R>>2]=S;E[M+12>>2]=S;E[S+8>>2]=M;E[S+12>>2]=o;return}i=a>>>8;if(i)if(a>>>0>16777215)o=31;else{R=(i+1048320|0)>>>16&8;M=i<<R;A=(M+520192|0)>>>16&4;M=M<<A;o=(M+245760|0)>>>16&2;o=14-(A|R|o)+(M<<o>>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;i=892+(o<<2)|0;E[S+28>>2]=o;E[S+20>>2]=0;E[S+16>>2]=0;n=E[148]|0;t=1<<o;if(!(n&t)){E[148]=n|t;E[i>>2]=S;E[S+24>>2]=i;E[S+12>>2]=S;E[S+8>>2]=S;return}i=E[i>>2]|0;e:do if((E[i+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){n=i+16+(o>>>31<<2)|0;t=E[n>>2]|0;if(!t)break;if((E[t+4>>2]&-8|0)==(a|0)){i=t;break e}else{o=o<<1;i=t}}if(n>>>0<(E[151]|0)>>>0)Pe();E[n>>2]=S;E[S+24>>2]=i;E[S+12>>2]=S;E[S+8>>2]=S;return}while(0);n=i+8|0;t=E[n>>2]|0;M=E[151]|0;if(!(t>>>0>=M>>>0&i>>>0>=M>>>0))Pe();E[t+12>>2]=S;E[n>>2]=S;E[S+8>>2]=t;E[S+12>>2]=i;E[S+24>>2]=0;return}function Ki(){}function Wi(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;n=r-n-(i>>>0>e>>>0|0)>>>0;return(H=n,e-i>>>0|0)|0}function zi(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;i=e+i>>>0;return(H=r+n+(i>>>0<e>>>0|0)>>>0,i|0)|0}function qi(e,r,i){e=e|0;r=r|0;i=i|0;var n=0,t=0,o=0,a=0;n=e+i|0;if((i|0)>=20){r=r&255;o=e&3;a=r|r<<8|r<<16|r<<24;t=n&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){_[e>>0]=r;e=e+1|0}}while((e|0)<(t|0)){E[e>>2]=a;e=e+4|0}}while((e|0)<(n|0)){_[e>>0]=r;e=e+1|0}return e-i|0}function ji(e,r,i){e=e|0;r=r|0;i=i|0;if((i|0)<32){H=r>>>i;return e>>>i|(r&(1<<i)-1)<<32-i}H=0;return r>>>i-32|0}function Zi(e,r,i){e=e|0;r=r|0;i=i|0;if((i|0)<32){H=r<<i|(e&(1<<i)-1<<32-i)>>>32-i;return e<<i}H=e<<i-32;return 0}function Ji(e,r,i){e=e|0;r=r|0;i=i|0;var n=0;if((i|0)>=4096)return Ue(e|0,r|0,i|0)|0;n=e|0;if((e&3)==(r&3)){while(e&3){if(!i)return n|0;_[e>>0]=_[r>>0]|0;e=e+1|0;r=r+1|0;i=i-1|0}while((i|0)>=4){E[e>>2]=E[r>>2];e=e+4|0;r=r+4|0;i=i-4|0}}while((i|0)>0){_[e>>0]=_[r>>0]|0;e=e+1|0;r=r+1|0;i=i-1|0}return n|0}function Qi(e,r,i){e=e|0;r=r|0;i=i|0;if((i|0)<32){H=r>>i;return e>>>i|(r&(1<<i)-1)<<32-i}H=(r|0)<0?-1:0;return r>>i-32|0}function $i(e){e=e|0;var r=0;r=_[I+(e&255)>>0]|0;if((r|0)<8)return r|0;r=_[I+(e>>8&255)>>0]|0;if((r|0)<8)return r+8|0;r=_[I+(e>>16&255)>>0]|0;if((r|0)<8)return r+16|0;return(_[I+(e>>>24)>>0]|0)+24|0}function en(e,r){e=e|0;r=r|0;var i=0,n=0,t=0,o=0;o=e&65535;t=r&65535;i=fe(t,o)|0;n=e>>>16;e=(i>>>16)+(fe(t,n)|0)|0;t=r>>>16;r=fe(t,o)|0;return(H=(e>>>16)+(fe(t,n)|0)+(((e&65535)+r|0)>>>16)|0,e+r<<16|i&65535|0)|0}function rn(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0,u=0,s=0,l=0;l=r>>31|((r|0)<0?-1:0)<<1;s=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1;o=n>>31|((n|0)<0?-1:0)<<1;t=((n|0)<0?-1:0)>>31|((n|0)<0?-1:0)<<1;u=Wi(l^e,s^r,l,s)|0;a=H;e=o^l;r=t^s;return Wi((un(u,a,Wi(o^i,t^n,o,t)|0,H,0)|0)^e,H^r,e,r)|0}function nn(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0,a=0,u=0,s=0,l=0;t=m;m=m+16|0;u=t|0;a=r>>31|((r|0)<0?-1:0)<<1;o=((r|0)<0?-1:0)>>31|((r|0)<0?-1:0)<<1;l=n>>31|((n|0)<0?-1:0)<<1;s=((n|0)<0?-1:0)>>31|((n|0)<0?-1:0)<<1;e=Wi(a^e,o^r,a,o)|0;r=H;un(e,r,Wi(l^i,s^n,l,s)|0,H,u)|0;n=Wi(E[u>>2]^a,E[u+4>>2]^o,a,o)|0;i=H;m=t;return(H=i,n)|0}function tn(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0;t=e;o=i;i=en(t,o)|0;e=H;return(H=(fe(r,o)|0)+(fe(n,t)|0)+e|e&0,i|0|0)|0}function on(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;return un(e,r,i,n,0)|0}function an(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;var t=0,o=0;o=m;m=m+16|0;t=o|0;un(e,r,i,n,t)|0;m=o;return(H=E[t+4>>2]|0,E[t>>2]|0)|0}function un(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;var o=0,a=0,u=0,s=0,l=0,f=0,_=0,c=0,d=0,T=0;f=e;s=r;l=s;a=i;c=n;u=c;if(!l){o=(t|0)!=0;if(!u){if(o){E[t>>2]=(f>>>0)%(a>>>0);E[t+4>>2]=0}c=0;t=(f>>>0)/(a>>>0)>>>0;return(H=c,t)|0}else{if(!o){c=0;t=0;return(H=c,t)|0}E[t>>2]=e|0;E[t+4>>2]=r&0;c=0;t=0;return(H=c,t)|0}}o=(u|0)==0;do if(a){if(!o){o=(ce(u|0)|0)-(ce(l|0)|0)|0;if(o>>>0<=31){_=o+1|0;u=31-o|0;r=o-31>>31;a=_;e=f>>>(_>>>0)&r|l<<u;r=l>>>(_>>>0)&r;o=0;u=f<<u;break}if(!t){c=0;t=0;return(H=c,t)|0}E[t>>2]=e|0;E[t+4>>2]=s|r&0;c=0;t=0;return(H=c,t)|0}o=a-1|0;if(o&a){u=(ce(a|0)|0)+33-(ce(l|0)|0)|0;T=64-u|0;_=32-u|0;s=_>>31;d=u-32|0;r=d>>31;a=u;e=_-1>>31&l>>>(d>>>0)|(l<<_|f>>>(u>>>0))&r;r=r&l>>>(u>>>0);o=f<<T&s;u=(l<<T|f>>>(d>>>0))&s|f<<_&u-33>>31;break}if(t){E[t>>2]=o&f;E[t+4>>2]=0}if((a|0)==1){d=s|r&0;T=e|0|0;return(H=d,T)|0}else{T=$i(a|0)|0;d=l>>>(T>>>0)|0;T=l<<32-T|f>>>(T>>>0)|0;return(H=d,T)|0}}else{if(o){if(t){E[t>>2]=(l>>>0)%(a>>>0);E[t+4>>2]=0}d=0;T=(l>>>0)/(a>>>0)>>>0;return(H=d,T)|0}if(!f){if(t){E[t>>2]=0;E[t+4>>2]=(l>>>0)%(u>>>0)}d=0;T=(l>>>0)/(u>>>0)>>>0;return(H=d,T)|0}o=u-1|0;if(!(o&u)){if(t){E[t>>2]=e|0;E[t+4>>2]=o&l|r&0}d=0;T=l>>>(($i(u|0)|0)>>>0);return(H=d,T)|0}o=(ce(u|0)|0)-(ce(l|0)|0)|0;if(o>>>0<=30){r=o+1|0;u=31-o|0;a=r;e=l<<u|f>>>(r>>>0);r=l>>>(r>>>0);o=0;u=f<<u;break}if(!t){d=0;T=0;return(H=d,T)|0}E[t>>2]=e|0;E[t+4>>2]=s|r&0;d=0;T=0;return(H=d,T)|0}while(0);if(!a){l=u;s=0;u=0}else{_=i|0|0;f=c|n&0;l=zi(_|0,f|0,-1,-1)|0;i=H;s=u;u=0;do{n=s;s=o>>>31|s<<1;o=u|o<<1;n=e<<1|n>>>31|0;c=e>>>31|r<<1|0;Wi(l,i,n,c)|0;T=H;d=T>>31|((T|0)<0?-1:0)<<1;u=d&1;e=Wi(n,c,d&_,(((T|0)<0?-1:0)>>31|((T|0)<0?-1:0)<<1)&f)|0;r=H;a=a-1|0}while((a|0)!=0);l=s;s=0}a=0;if(t){E[t>>2]=e;E[t+4>>2]=r}d=(o|0)>>>31|(l|a)<<1|(a<<1|o>>>31)&0|s;T=(o<<1|0>>>31)&-2|u;return(H=d,T)|0}function sn(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;return In[e&7](r|0,i|0,n|0)|0}function ln(e,r,i,n,t,o){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;pn[e&3](r|0,i|0,n|0,t|0,o|0)}function fn(e,r){e=e|0;r=r|0;wn[e&7](r|0)}function _n(e,r){e=e|0;r=r|0;return bn[e&1](r|0)|0}function cn(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;On[e&0](r|0,i|0,n|0)}function En(e){e=e|0;Pn[e&3]()}function dn(e,r,i,n,t,o,a){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;a=a|0;vn[e&3](r|0,i|0,n|0,t|0,o|0,a|0)}function Tn(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;Bn[e&3](r|0,i|0,n|0,t|0)}function An(e,r,i){e=e|0;r=r|0;i=i|0;Ee(0);return 0}function Rn(e,r,i,n,t){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;Ee(1)}function Mn(e){e=e|0;Ee(2)}function Sn(e){e=e|0;Ee(3);return 0}function mn(e,r,i){e=e|0;r=r|0;i=i|0;Ee(4)}function hn(){Ee(5)}function Nn(e,r,i,n,t,o){e=e|0;r=r|0;i=i|0;n=n|0;t=t|0;o=o|0;Ee(6)}function Cn(e,r,i,n){e=e|0;r=r|0;i=i|0;n=n|0;Ee(7)}var In=[An,Wr,gi,Oi,bi,Pi,An,An];var pn=[Rn,$r,Qr,Rn];var wn=[Mn,Xr,xr,Vr,Yr,Kr,ai,Fi];var bn=[Sn,wi];var On=[mn];var Pn=[hn,ti,oi,hn];var vn=[Nn,ri,ei,Nn];var Bn=[Cn,qr,jr,Cn];return{___cxa_can_catch:ii,_crn_get_levels:mr,_crn_get_uncompressed_size:Cr,_crn_decompress:Ir,_i64Add:zi,_crn_get_width:Mr,___cxa_is_pointer_type:ni,_crn_get_bytes_per_block:Nr,_memset:qi,_malloc:Gi,_memcpy:Ji,_i64Subtract:Wi,_bitshift64Lshr:ji,_free:Hi,_bitshift64Shl:Zi,_crn_get_height:Sr,_crn_get_dxt_format:hr,runPostSets:Ki,_emscripten_replace_memory:Ke,stackAlloc:We,stackSave:ze,stackRestore:qe,establishStackSpace:je,setThrew:Ze,setTempRet0:$e,getTempRet0:er,dynCall_iiii:sn,dynCall_viiiii:ln,dynCall_vi:fn,dynCall_ii:_n,dynCall_viii:cn,dynCall_v:En,dynCall_viiiiii:dn,dynCall_viiii:Tn}}(Module.asmGlobalArg,Module.asmLibraryArg,buffer),___cxa_can_catch=Module.___cxa_can_catch=asm.___cxa_can_catch,_crn_get_levels=Module._crn_get_levels=asm._crn_get_levels,runPostSets=Module.runPostSets=asm.runPostSets,_crn_get_uncompressed_size=Module._crn_get_uncompressed_size=asm._crn_get_uncompressed_size,_crn_decompress=Module._crn_decompress=asm._crn_decompress,_i64Add=Module._i64Add=asm._i64Add,_crn_get_height=Module._crn_get_height=asm._crn_get_height,___cxa_is_pointer_type=Module.___cxa_is_pointer_type=asm.___cxa_is_pointer_type,_crn_get_bytes_per_block=Module._crn_get_bytes_per_block=asm._crn_get_bytes_per_block,_memset=Module._memset=asm._memset,_malloc=Module._malloc=asm._malloc,_memcpy=Module._memcpy=asm._memcpy,_emscripten_replace_memory=Module._emscripten_replace_memory=asm._emscripten_replace_memory,_i64Subtract=Module._i64Subtract=asm._i64Subtract,_bitshift64Lshr=Module._bitshift64Lshr=asm._bitshift64Lshr,_free=Module._free=asm._free,_crn_get_dxt_format=Module._crn_get_dxt_format=asm._crn_get_dxt_format,_crn_get_width=Module._crn_get_width=asm._crn_get_width,_bitshift64Shl=Module._bitshift64Shl=asm._bitshift64Shl,dynCall_iiii=Module.dynCall_iiii=asm.dynCall_iiii,dynCall_viiiii=Module.dynCall_viiiii=asm.dynCall_viiiii,dynCall_vi=Module.dynCall_vi=asm.dynCall_vi,dynCall_ii=Module.dynCall_ii=asm.dynCall_ii,dynCall_viii=Module.dynCall_viii=asm.dynCall_viii,dynCall_v=Module.dynCall_v=asm.dynCall_v,dynCall_viiiiii=Module.dynCall_viiiiii=asm.dynCall_viiiiii,dynCall_viiii=Module.dynCall_viiii=asm.dynCall_viiii;Runtime.stackAlloc=asm.stackAlloc,Runtime.stackSave=asm.stackSave,Runtime.stackRestore=asm.stackRestore,Runtime.establishStackSpace=asm.establishStackSpace,Runtime.setTempRet0=asm.setTempRet0,Runtime.getTempRet0=asm.getTempRet0,ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var initialStackTop,preloadStartTime=null,calledMain=!1;dependenciesFulfilled=function e(){Module.calledRun||run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){function r(){for(var e=0;e<3;e++)n.push(0)}assert(0==runDependencies,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(0==__ATPRERUN__.length,"cannot call main when preRun functions remain to be called"),e=e||[],ensureInitRuntime();var i=e.length+1,n=[allocate(intArrayFromString(Module.thisProgram),"i8",ALLOC_NORMAL)];r();for(var t=0;t<i-1;t+=1)n.push(allocate(intArrayFromString(e[t]),"i8",ALLOC_NORMAL)),r();n.push(0),n=allocate(n,"i32",ALLOC_NORMAL);try{var o=Module._main(i,n,0);exit(o,!0)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);throw e&&"object"==typeof e&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}finally{calledMain=!0}},Module.run=Module.run=run,Module.exit=Module.exit=exit;var abortDecorators=[];if(Module.abort=Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;return Module.noInitialRun&&(shouldRunNow=!1),Module.noExitRuntime=!0,run(),Module}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function r(e,r){return void 0!==e?e:r}return r.EMPTY_OBJECT=e({}),r}),define("Core/formatError",["./defined"],function(e){"use strict";function r(r){var i,n=r.name,t=r.message;i=e(n)&&e(t)?n+": "+t:r.toString();var o=r.stack;return e(o)&&(i+="\n"+o),i}return r}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,r,i){"use strict";function n(n){var t,o=[],a={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;o.length=0,a.id=s.id,a.error=void 0,a.result=void 0;try{a.result=n(s.parameters,o)}catch(e){e instanceof Error?a.error={name:e.name,message:e.message,stack:e.stack}:a.error=e}r(t)||(t=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(o.length=0);try{t(a,o)}catch(e){a.result=void 0,a.error="postMessage failed with error: "+i(e)+"\n with responseMessage: "+JSON.stringify(a),t(a)}}}return n}),define("Workers/transcodeCRNToDXT",["../Core/CompressedTextureBuffer","../Core/defined","../Core/PixelFormat","../Core/RuntimeError","../ThirdParty/crunch","./createTaskProcessorWorker"],function(e,r,i,n,t,o){"use strict";function a(e,r,i,n){var t,o=i/4,a=n%4,u=new Uint32Array(e.buffer,0,(n-a)/4),s=new Uint32Array(r.buffer);for(t=0;t<u.length;t++)s[o+t]=u[t];for(t=n-a;t<n;t++)r[i+t]=e[t]}function u(o,u){var s=o.byteLength,E=new Uint8Array(o),d=t._malloc(s);a(E,t.HEAPU8,d,s);var T=t._crn_get_dxt_format(d,s),A=l[T];if(!r(A))throw new n("Unsupported compressed format.");var R,M=t._crn_get_levels(d,s),S=t._crn_get_width(d,s),m=t._crn_get_height(d,s),h=0;for(R=0;R<M;++R)h+=i.compressedTextureSizeInBytes(A,S>>R,m>>R);c<h&&(r(f)&&t._free(f),f=t._malloc(h),_=new Uint8Array(t.HEAPU8.buffer,f,h),c=h),t._crn_decompress(d,s,f,h,0,M),t._free(d);var N=i.compressedTextureSizeInBytes(A,S,m),C=new Uint8Array(N);return C.set(_,0),u.push(C.buffer),new e(A,S,m,C)}var s={cCRNFmtInvalid:-1,cCRNFmtDXT1:0,cCRNFmtDXT3:1,cCRNFmtDXT5:2},l={};l[s.cCRNFmtDXT1]=i.RGB_DXT1,l[s.cCRNFmtDXT3]=i.RGBA_DXT3,l[s.cCRNFmtDXT5]=i.RGBA_DXT5;var f,_,c=0;return o(u)})}(); \ No newline at end of file diff --git a/engines/Cesium/Workers/upsampleQuantizedTerrainMesh.js b/engines/Cesium/Workers/upsampleQuantizedTerrainMesh.js index ef399d2..0923193 100644 --- a/engines/Cesium/Workers/upsampleQuantizedTerrainMesh.js +++ b/engines/Cesium/Workers/upsampleQuantizedTerrainMesh.js @@ -222,9 +222,9 @@ OTHER DEALINGS IN THE SOFTWARE. * */ -!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var h=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,h);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var h=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,h);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,h=r*u-a*o;return n.x=c,n.y=l,n.z=h,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var f=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(r),f=o.normalize(f,f),o.multiplyComponents(s,f,d);var l=Math.sqrt(o.dot(f,d));return d=o.divideByScalar(d,l,d),f=o.multiplyByScalar(f,a,f),n(u)||(u=new o),o.add(d,f,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r,a){"use strict";var i={};i.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,i=n.y;n.x=(1-Math.abs(i))*a.signNotZero(r),n.y=(1-Math.abs(r))*a.signNotZero(i)}return n.x=a.toSNorm(n.x,t),n.y=a.toSNorm(n.y,t),n},i.octEncode=function(e,t){return i.octEncodeInRange(e,255,t)},i.octDecodeInRange=function(e,n,r,i){if(i.x=a.fromSNorm(e,r),i.y=a.fromSNorm(n,r),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){var o=i.x;i.x=(1-Math.abs(i.y))*a.signNotZero(o),i.y=(1-Math.abs(o))*a.signNotZero(i.y)}return t.normalize(i,i)},i.octDecode=function(e,t,n){return i.octDecodeInRange(e,t,255,n)},i.octPackFloat=function(e){return 256*e.x+e.y};var o=new e;return i.octEncodeFloat=function(e){return i.octEncode(e,o),i.octPackFloat(o)},i.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return i.octDecode(r,a,t)},i.octPack=function(e,t,n,r){var a=i.octEncodeFloat(e),u=i.octEncodeFloat(t),s=i.octEncode(n,o);return r.x=65536*s.x+a,r.y=65536*s.y+u,r},i.octUnpack=function(e,t,n,r){var a=e.x/65536,o=Math.floor(a),u=65536*(a-o);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);i.octDecodeFloat(u,t),i.octDecodeFloat(c,n),i.octDecode(o,s,r)},i.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},i.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},i}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,h=n.y,f=n.z,d=a.x,E=a.y,m=a.z,p=l*l*d*d,_=h*h*E*E,T=f*f*m*m,y=p+_+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(n,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,N=u.y,M=u.z,I=o;I.x=A.x*S*2,I.y=A.y*N*2,I.z=A.z*M*2;var g,v,O,w,x,C,P,U,D,F,L,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(I)),z=0;do{B-=z,O=1/(1+B*S),w=1/(1+B*N),x=1/(1+B*M),C=O*O,P=w*w,U=x*x,D=C*O,F=P*w,L=U*x,g=p*C+_*P+T*U-1,v=p*D*S+_*F*N+T*L*M;var b=-2*v;z=g/b}while(Math.abs(g)>r.EPSILON12);return t(c)?(c.x=l*O,c.y=h*w,c.z=f*x,c):new e(l*O,h*w,f*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,n,r){this.longitude=t(e,0),this.latitude=t(n,0),this.height=t(r,0)}u.fromRadians=function(e,r,a,i){return a=t(a,0),n(i)?(i.longitude=e,i.latitude=r,i.height=a,i):new u(e,r,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,h=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,r,a){var E=n(r)?r.oneOverRadii:h,m=n(r)?r.oneOverRadiiSquared:f,p=n(r)?r._centerToleranceSquared:d,_=o(t,E,m,p,c);if(n(_)){var T=e.multiplyComponents(_,m,s);T=e.normalize(T,T);var y=e.subtract(t,_,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),S=i.sign(e.dot(y,t))*e.magnitude(y);return n(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(n(e))return n(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||n(e)&&n(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,r){return e===t||n(e)&&n(t)&&Math.abs(e.longitude-t.longitude)<=r&&Math.abs(e.latitude-t.latitude)<=r&&Math.abs(e.height-t.height)<=r},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var h=new e,f=new e;l.prototype.cartographicToCartesian=function(t,n){var a=h,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),h=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=h,a):new t(c,l,h)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function h(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,h=E[a],f=m[a];if(Math.abs(e[s.getElementIndex(f,h)])>n){var d,p=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(h,h)],T=e[s.getElementIndex(f,h)],y=(p-_)/2/T;d=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(h,h)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,h)]=l,t[s.getElementIndex(h,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,h=e.z*e.z,f=e.z*e.w,d=e.w*e.w,E=n-u-h+d,m=2*(a-f),p=2*(i+l),_=2*(a+f),T=-n+u-h+d,y=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+h+d;return r(t)?(t[0]=E,t[1]=_,t[2]=R,t[3]=m,t[4]=T,t[5]=A,t[6]=p,t[7]=y,t[8]=S,t):new s(E,m,p,_,T,y,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,h=-i*u+c*o*a,f=c*u+i*o*a,d=n*u,E=i*a+c*o*u,m=-o*i+i*o*u,p=-o,_=c*n,T=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=p,t[3]=h,t[4]=E,t[5]=_,t[6]=f,t[7]=m,t[8]=T,t):new s(l,h,f,d,E,m,p,_,T)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=h,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],p=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)h(d,p),s.transpose(p,_),s.multiply(d,p,d),s.multiply(_,d,d),s.multiply(f,p,f),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=s.determinant(e);t[0]=o*h-l*u,t[1]=l*a-r*h,t[2]=r*u-o*a,t[3]=c*u-i*h,t[4]=n*h-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/f;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]}, -s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,h,f,d,E,m,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(h,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(p,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,h=t.x*t.z,f=t.x*t.w,d=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,_=t.z*t.w,T=t.w*t.w,y=s-d-p+T,R=2*(c-_),A=2*(h+m),S=2*(c+_),N=-s+d-p+T,M=2*(E-f),I=2*(h-m),g=2*(E+f),v=-s-d+p+T;return r[0]=y*i,r[1]=S*i,r[2]=I*i,r[3]=0,r[4]=R*o,r[5]=N*o,r[6]=g*o,r[7]=0,r[8]=A*u,r[9]=M*u,r[10]=v*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var h=new e,f=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,h),e.normalize(e.cross(h,o,f),f),e.normalize(e.cross(f,h,d),d);var u=f.x,s=f.y,c=f.z,E=h.x,m=h.y,p=h.z,_=d.x,T=d.y,y=d.z,R=r.x,A=r.y,S=r.z,N=u*-R+s*-A+c*-S,M=_*-R+T*-A+y*-S,I=E*R+m*A+p*S;return a(n)?(n[0]=u,n[1]=_,n[2]=-E,n[3]=0,n[4]=s,n[5]=T,n[6]=-m,n[7]=0,n[8]=c,n[9]=y,n[10]=-p,n[11]=0,n[12]=N,n[13]=M,n[14]=I,n[15]=1,n):new l(u,s,c,N,_,T,y,M,-E,-m,-p,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,h=-(r+n)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=h,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),h=-(i+a)/(i-a),f=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=h,o[11]=f,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,h=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=h,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,h=.5*(n-t),f=c,d=l,E=h,m=i+c,p=o+l,_=t+h,T=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=p,a[14]=_,a[15]=T,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],E=e[11],m=e[12],p=e[13],_=e[14],T=e[15],y=t[0],R=t[1],A=t[2],S=t[3],N=t[4],M=t[5],I=t[6],g=t[7],v=t[8],O=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],F=r*y+u*R+h*A+m*S,L=a*y+s*R+f*A+p*S,B=i*y+c*R+d*A+_*S,z=o*y+l*R+E*A+T*S,b=r*N+u*M+h*I+m*g,q=a*N+s*M+f*I+p*g,G=i*N+c*M+d*I+_*g,W=o*N+l*M+E*I+T*g,X=r*v+u*O+h*w+m*x,V=a*v+s*O+f*w+p*x,H=i*v+c*O+d*w+_*x,Y=o*v+l*O+E*w+T*x,k=r*C+u*P+h*U+m*D,Z=a*C+s*P+f*U+p*D,j=i*C+c*P+d*U+_*D,K=o*C+l*P+E*U+T*D;return n[0]=F,n[1]=L,n[2]=B,n[3]=z,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],h=e[10],f=e[12],d=e[13],E=e[14],m=t[0],p=t[1],_=t[2],T=t[4],y=t[5],R=t[6],A=t[8],S=t[9],N=t[10],M=t[12],I=t[13],g=t[14],v=r*m+o*p+c*_,O=a*m+u*p+l*_,w=i*m+s*p+h*_,x=r*T+o*y+c*R,C=a*T+u*y+l*R,P=i*T+s*y+h*R,U=r*A+o*S+c*N,D=a*A+u*S+l*N,F=i*A+s*S+h*N,L=r*M+o*I+c*g+f,B=a*M+u*I+l*g+d,z=i*M+s*I+h*g+E;return n[0]=v,n[1]=O,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=F,n[11]=0,n[12]=L,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],h=e[10],f=t[0],d=t[1],E=t[2],m=t[3],p=t[4],_=t[5],T=t[6],y=t[7],R=t[8],A=r*f+o*d+c*E,S=a*f+u*d+l*E,N=i*f+s*d+h*E,M=r*m+o*p+c*_,I=a*m+u*p+l*_,g=i*m+s*p+h*_,v=r*T+o*y+c*R,O=a*T+u*y+l*R,w=i*T+s*y+h*R;return n[0]=A,n[1]=S,n[2]=N,n[3]=0,n[4]=M,n[5]=I,n[6]=g,n[7]=0,n[8]=v,n[9]=O,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var p=new e;l.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var _=new s,T=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,_),T,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],h=e[1],f=e[5],d=e[9],E=e[13],m=e[2],p=e[6],A=e[10],S=e[14],N=e[3],M=e[7],I=e[11],g=e[15],v=A*g,O=S*I,w=p*g,x=S*M,C=p*I,P=A*M,U=m*g,D=S*N,F=m*I,L=A*N,B=m*M,z=p*N,b=v*f+x*d+C*E-(O*f+w*d+P*E),q=O*h+U*d+L*E-(v*h+D*d+F*E),G=w*h+D*f+B*E-(x*h+U*f+z*E),W=P*h+F*f+z*d-(C*h+L*f+B*d),X=O*a+w*i+P*o-(v*a+x*i+C*o),V=v*r+D*i+F*o-(O*r+U*i+L*o),H=x*r+U*a+z*o-(w*r+D*a+B*o),Y=C*r+L*a+B*i-(P*r+F*a+z*i);v=i*E,O=o*d,w=a*E,x=o*f,C=a*d,P=i*f,U=r*E,D=o*h,F=r*d,L=i*h,B=r*f,z=a*h;var k=v*M+x*I+C*g-(O*M+w*I+P*g),Z=O*N+U*I+L*g-(v*N+D*I+F*g),j=w*N+D*M+B*g-(x*N+U*M+z*g),K=P*N+F*M+z*I-(C*N+L*M+B*I),Q=w*A+P*S+O*p-(C*S+v*p+x*A),J=F*S+v*m+D*A-(U*A+L*S+O*m),$=U*p+z*S+x*m-(B*S+w*m+D*p),ee=B*A+C*m+L*p-(F*p+z*A+P*m),te=r*b+a*q+i*G+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],h=e[12],f=e[13],d=e[14],E=-n*h-r*f-a*d,m=-i*h-o*f-u*d,p=-s*h-c*f-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,h=0,f=e.length;h<f;h++){var d=e[h];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,h=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var E=t.cartesianToCartographic(e[f]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),h=Math.max(h,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=h,n):new s(a,l,i,h)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),h=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&h<=l)){var f=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(f>=d))return r(n)?(n.west=l,n.south=f,n.east=h,n.north=d,n):new s(l,f,h,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),h=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=h,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,h=e.north,f=e.south,d=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,h<0?m.latitude=h:f>0?m.latitude=f:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,h){"use strict";function f(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,m=new e,p=new e,_=new e,T=new e,y=new e,R=new e,A=new e,S=new e,N=new e,M=new e;f.fromPoints=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],y),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,p),c=e.clone(r,_),l=e.clone(r,T),h=t.length,I=1;I<h;I++){e.clone(t[I],r);var g=r.x,v=r.y,O=r.z;g<i.x&&e.clone(r,i),g>s.x&&e.clone(r,s),v<o.y&&e.clone(r,o),v>c.y&&e.clone(r,c),O<u.z&&e.clone(r,u),O>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var F=A;F.x=.5*(P.x+U.x),F.y=.5*(P.y+U.y),F.z=.5*(P.z+U.z);var L=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(L),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(z,b,R),.5,M),G=0;for(I=0;I<h;I++){e.clone(t[I],r);var W=e.magnitude(e.subtract(r,q,R));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(r,F,R));if(X>L){var V=Math.sqrt(X);B=.5*(B+V),L=B*B;var H=V-B;F.x=(B*F.x+H*r.x)/V,F.y=(B*F.y+H*r.y)/V,F.z=(B*F.z+H*r.z)/V}}return B<G?(e.clone(F,n.center),n.radius=B):(e.clone(q,n.center),n.radius=G),n};var I=new o,g=new e,v=new e,O=new t,w=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,I),h.southwest(t,O),O.height=i,h.northeast(t,w),w.height=o;var s=n.project(O,g),c=n.project(w,v),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*d,m.z=s.z+.5*E,u};var x=[];f.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=h.subsample(e,t,n,x)),f.fromPoints(u,o)},f.fromVertices=function(t,n,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=y;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,m),h=e.clone(u,p),I=e.clone(u,_),g=e.clone(u,T),v=t.length,O=0;O<v;O+=i){var w=t[O]+n.x,x=t[O+1]+n.y,C=t[O+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>h.x&&e.clone(u,h),x<c.y&&e.clone(u,c),x>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>g.z&&e.clone(u,g)}var P=e.magnitudeSquared(e.subtract(h,s,R)),U=e.magnitudeSquared(e.subtract(I,c,R)),D=e.magnitudeSquared(e.subtract(g,l,R)),F=s,L=h,B=P;U>B&&(B=U,F=c,L=I),D>B&&(B=D,F=l,L=g);var z=A;z.x=.5*(F.x+L.x),z.y=.5*(F.y+L.y),z.z=.5*(F.z+L.z);var b=e.magnitudeSquared(e.subtract(L,z,R)),q=Math.sqrt(b),G=S;G.x=s.x,G.y=c.y,G.z=l.z;var W=N;W.x=h.x,W.y=I.y,W.z=g.z;var X=e.multiplyByScalar(e.add(G,W,R),.5,M),V=0;for(O=0;O<v;O+=i){u.x=t[O]+n.x,u.y=t[O+1]+n.y,u.z=t[O+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var Z=k-q;z.x=(q*z.x+Z*u.x)/k,z.y=(q*z.y+Z*u.y)/k,z.z=(q*z.z+Z*u.z)/k}}return q<V?(e.clone(z,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},f.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new f),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=y;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,_),h=e.clone(i,T),I=t.length,g=0;g<I;g+=3){var v=t[g]+n[g],O=t[g+1]+n[g+1],w=t[g+2]+n[g+2];i.x=v,i.y=O,i.z=w,v<o.x&&e.clone(i,o),v>c.x&&e.clone(i,c),O<u.y&&e.clone(i,u),O>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>h.z&&e.clone(i,h)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(h,s,R)),U=o,D=c,F=x;C>F&&(F=C,U=u,D=l),P>F&&(F=P,U=s,D=h);var L=A;L.x=.5*(U.x+D.x),L.y=.5*(U.y+D.y),L.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,L,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var q=N;q.x=c.x,q.y=l.y,q.z=h.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,M),W=0;for(g=0;g<I;g+=3){i.x=t[g]+n[g],i.y=t[g+1]+n[g+1],i.z=t[g+2]+n[g+2];var X=e.magnitude(e.subtract(i,G,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,L,R));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;L.x=(z*L.x+Y*i.x)/H,L.y=(z*L.y+Y*i.y)/H,L.z=(z*L.z+Y*i.z)/H}}return z<W?(e.clone(L,r.center),r.radius=z):(e.clone(G,r.center),r.radius=W),r},f.fromCornerPoints=function(t,n,r){a(r)||(r=new f);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},f.fromEllipsoid=function(t,n){return a(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;f.fromBoundingSpheres=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return f.clone(t[0],n);if(2===r)return f.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=f.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;f.fromOrientedBoundingBox=function(t,n){a(n)||(n=new f);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D),s=e.magnitude(i),l=e.magnitude(o),h=e.magnitude(u);return n.center=e.clone(t.center,n.center),n.radius=Math.max(s,l,h),n},f.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},f.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new f);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var F=new e,L=new e;f.union=function(t,n,r){a(r)||(r=new f);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,F),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var h=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+h)/l,L);return e.add(d,i,d),e.clone(d,r.center),r.radius=h,r};var B=new e;f.expand=function(t,n,r){r=f.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},f.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;f.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},f.transformWithoutScale=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;f.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,G=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return f.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G); -e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var h=e.negate(l,V),d=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,d,m),m=E[2],e.add(s,h,m),e.add(m,d,m),m=E[3],e.add(s,h,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,d,m),m=E[6],e.add(s,h,m),e.add(m,d,m),m=E[7],e.add(s,h,m),e.add(m,c,m);for(var p=E.length,_=0;_<p;++_){var T=E[_];e.add(o,T,T);var y=i.cartesianToCartographic(T,H);n.project(y,T)}a=f.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,n){return f.computePlaneDistances(this,e,t,n)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,n,r,a,i,o){"use strict";function u(e,n){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(n)&&(this.cameraPosition=n)}function s(e,n,r){var a=e.transformPositionToScaledSpace(n,E),i=t.magnitudeSquared(a),o=Math.sqrt(i),u=t.divideByScalar(a,o,m);i=Math.max(1,i),o=Math.max(1,o);var s=t.dot(u,r),c=t.magnitude(t.cross(u,r,u)),l=1/o,h=Math.sqrt(i-1)*l;return 1/(s*l-c*h)}function c(e,n,r){if(!(n<=0||n===1/0||n!==n))return t.multiplyByScalar(e,n,r)}function l(e,n){return t.equals(n,t.ZERO)?n:(e.transformPositionToScaledSpace(n,p),t.normalize(p,p))}a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var n=this._ellipsoid,r=n.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),a=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=a}}});var h=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,n=t.transformPositionToScaledSpace(e,h);return this.isScaledSpacePointVisible(n)},u.prototype.isScaledSpacePointVisible=function(e){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,a=t.subtract(e,n,h),i=-t.dot(a,n),o=r<0?i>0:i>r&&i*i/t.magnitudeSquared(a)>r;return!o},u.prototype.computeHorizonCullingPoint=function(e,n,a){r(a)||(a=new t);for(var i=this._ellipsoid,o=l(i,e),u=0,h=0,f=n.length;h<f;++h){var d=n[h],E=s(i,d,o);u=Math.max(u,E)}return c(o,u,a)};var f=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,a,i,o,u){r(u)||(u=new t),o=n(o,t.ZERO);for(var h=this._ellipsoid,d=l(h,e),E=0,m=0,p=a.length;m<p;m+=i){f.x=a[m]+o.x,f.y=a[m+1]+o.y,f.z=a[m+2]+o.z;var _=s(h,f,d);E=Math.max(E,_)}return c(d,E,u)};var d=[];u.prototype.computeHorizonCullingPointFromRectangle=function(n,r,a){var i=o.subsample(n,r,0,d),u=e.fromPoints(i);if(!(t.magnitude(u.center)<.1*r.minimumRadius))return this.computeHorizonCullingPoint(u.center,i,a)};var E=new t,m=new t,p=new t;return u}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,n,r,a,i,o){t(o)?o.length=0:o=[];var u,s,c;n?(u=r<e,s=a<e,c=i<e):(u=r>e,s=a>e,c=i>e);var l,h,f,d,E,m,p=u+s+c;return 1===p?u?(l=(e-r)/(a-r),h=(e-r)/(i-r),o.push(1),o.push(2),1!==h&&(o.push(-1),o.push(0),o.push(2),o.push(h)),1!==l&&(o.push(-1),o.push(0),o.push(1),o.push(l))):s?(f=(e-a)/(i-a),d=(e-a)/(r-a),o.push(2),o.push(0),1!==d&&(o.push(-1),o.push(1),o.push(0),o.push(d)),1!==f&&(o.push(-1),o.push(1),o.push(2),o.push(f))):c&&(E=(e-i)/(r-i),m=(e-i)/(a-i),o.push(0),o.push(1),1!==m&&(o.push(-1),o.push(2),o.push(1),o.push(m)),1!==E&&(o.push(-1),o.push(2),o.push(0),o.push(E))):2===p?u||r===e?s||a===e?c||i===e||(h=(e-r)/(i-r),f=(e-a)/(i-a),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(h),o.push(-1),o.push(1),o.push(2),o.push(f)):(m=(e-i)/(a-i),l=(e-r)/(a-r),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(m),o.push(-1),o.push(0),o.push(1),o.push(l)):(d=(e-a)/(r-a),E=(e-i)/(r-i),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(d),o.push(-1),o.push(2),o.push(0),o.push(E)):3!==p&&(o.push(0),o.push(1),o.push(2)),o},r.computeBarycentricCoordinates=function(n,r,a,i,o,u,s,c,l){var h=a-s,f=s-o,d=u-c,E=i-c,m=1/(d*h+f*E),p=r-c,_=n-s,T=(d*_+f*p)*m,y=(-E*_+h*p)*m,R=1-T-y;return t(l)?(l.x=T,l.y=y,l.z=R,l):new e(T,y,R)},r}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./defaultValue","./defined","./DeveloperError","./Intersect"],function(e,t,n,r,a){"use strict";function i(r,a,i){this.minimum=e.clone(t(r,e.ZERO)),this.maximum=e.clone(t(a,e.ZERO)),n(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,r){if(n(r)||(r=new i),!n(t)||0===t.length)return r.minimum=e.clone(e.ZERO,r.minimum),r.maximum=e.clone(e.ZERO,r.maximum),r.center=e.clone(e.ZERO,r.center),r;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,h=t.length,f=1;f<h;f++){var d=t[f],E=d.x,m=d.y,p=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(p,u),l=Math.max(p,l)}var _=r.minimum;_.x=a,_.y=o,_.z=u;var T=r.maximum;T.x=s,T.y=c,T.z=l;var y=e.add(_,T,r.center);return e.multiplyByScalar(y,.5,y),r},i.clone=function(t,r){if(n(t))return n(r)?(r.minimum=e.clone(t.minimum,r.minimum),r.maximum=e.clone(t.maximum,r.maximum),r.center=e.clone(t.center,r.center),r):new i(t.minimum,t.maximum)},i.equals=function(t,r){return t===r||n(t)&&n(r)&&e.equals(t.center,r.center)&&e.equals(t.minimum,r.minimum)&&e.equals(t.maximum,r.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,h=n(c,-l,t.EPSILON14);if(h<0)return[];var f=-.5*n(r,t.sign(r)*Math.sqrt(h),t.EPSILON14);return r>0?[f/e,a/f]:[a/f,f/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,h=u*c,f=u*u,d=s*s,E=o*s-f,m=o*c-u*s,p=u*c-d,_=4*E*p-m*m;if(_<0){var T,y,R;f*h>=l*d?(T=o,y=E,R=-2*u*E+o*m):(T=c,y=p,R=-c*m+2*s*p);var A=R<0?-1:1,S=-A*Math.abs(T)*Math.sqrt(-_);i=-R+S;var N=i/2,M=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===S?-M:-y/M;return a=y<=0?M+I:-R/(M*M+I*I+y),f*h>=l*d?[(a-u)/o]:[-c/(a+s)]}var g=E,v=-2*u*E+o*m,O=p,w=-c*m+2*s*p,x=Math.sqrt(_),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-v)/3);a=2*Math.sqrt(-g);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),F=i+D>2*u?i-u:D-u,L=o,B=F/L;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-O),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=i+D<2*s?i+s:D+s,q=z/b,G=L*b,W=-F*b-L*z,X=F*z,V=(s*W-u*X)/(-u*W+s*G);return B<=V?B<=q?V<=q?[B,V,q]:[B,q,V]:[q,B,V]:B<=q?[V,B,q]:V<=q?[V,q,B]:[q,V,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,h=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(h.length>0){var f=-t/4,d=h[h.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],_=E[1];if(p>=0&&_>=0){var T=Math.sqrt(p),y=Math.sqrt(_);return[f-y,f-T,f+T,f+y]}if(p>=0&&_<0)return m=Math.sqrt(p),[f-m,f+m];if(p<0&&_>=0)return m=Math.sqrt(_),[f-m,f+m]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,N=r.computeRealRoots(1,R,A),M=r.computeRealRoots(1,-R,S);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==M.length?(M[0]+=f,M[1]+=f,N[1]<=M[0]?[N[0],N[1],M[0],M[1]]:M[1]<=N[0]?[M[0],M[1],N[0],N[1]]:N[0]>=M[0]&&N[1]<=M[1]?[M[0],N[0],N[1],M[1]]:M[0]>=N[0]&&M[1]<=N[1]?[N[0],M[0],M[1],N[1]]:N[0]>M[0]&&N[0]<M[1]?[M[0],N[0],M[1],N[1]]:[N[0],M[0],N[1],M[1]]):N):0!==M.length?(M[0]+=f,M[1]+=f,M):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,h=i*t+s-4*o,f=c*o-i*a*t+u,d=e.computeRealRoots(1,l,h,f);if(d.length>0){var E,m,p=d[0],_=a-p,T=_*_,y=t/2,R=_/2,A=T-4*o,S=T+4*Math.abs(o),N=c-4*p,M=c+4*Math.abs(p);if(p<0||A*M<N*S){var I=Math.sqrt(N);E=I/2,m=0===I?0:(t*R-i)/I}else{var g=Math.sqrt(A);E=0===g?0:(t*R-i)/g,m=g/2}var v,O;0===y&&0===E?(v=0,O=0):n.sign(y)===n.sign(E)?(v=y+E,O=p/v):(O=y-E,v=p/O);var w,x;0===R&&0===m?(w=0,x=0):n.sign(R)===n.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var C=r.computeRealRoots(1,v,w),P=r.computeRealRoots(1,O,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,h=r*r,f=h*r,d=a*a,E=d*a,m=u*c*h-4*s*f-4*e*l*h+18*e*t*n*f-27*i*h*h+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*h+144*i*n*h)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,h=u/t,f=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=h<0?d+1:d,d+=f<0?d+1:d){case 0:return a(c,l,h,f);case 1:return i(c,l,h,f);case 2:return i(c,l,h,f);case 3:return a(c,l,h,f);case 4:return a(c,l,h,f);case 5:return i(c,l,h,f);case 6:return a(c,l,h,f);case 7:return a(c,l,h,f);case 8:return i(c,l,h,f);case 9:return a(c,l,h,f);case 10:return a(c,l,h,f);case 11:return i(c,l,h,f);case 12:return a(c,l,h,f);case 13:return a(c,l,h,f);case 14:return a(c,l,h,f);case 15:return a(c,l,h,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function h(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,T),f=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=h(f,d,E,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,h=a*a,f=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,m=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),p=t[u.COLUMN0ROW0]*h+t[u.COLUMN2ROW2]*f+a*n.x+r,_=f*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),T=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),y=[];if(0===T&&0===_){if(l=s.computeRealRoots(E,m,p),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],N=Math.sqrt(Math.max(1-S*S,0));y.push(new e(a,i*S,i*-N)),y.push(new e(a,i*S,i*N))}return y}var M=T*T,I=_*_,g=E*E,v=T*_,O=g+I,w=2*(m*E+v),x=2*p*E+m*m-I+M,C=2*(p*m-v),P=p*p-M;if(0===O&&0===w&&0===x&&0===C)return y;l=c.computeRealRoots(O,w,x,C,P);var U=l.length;if(0===U)return y;for(var D=0;D<U;++D){var F,L=l[D],B=L*L,z=Math.max(1-B,0),b=Math.sqrt(z);F=o.sign(E)===o.sign(p)?d(E*B+p,m*L,o.EPSILON12):o.sign(p)===o.sign(m*L)?d(E*B,m*L+p,o.EPSILON12):d(E*B+m*L,p,o.EPSILON12);var q=d(_*L,T,o.EPSILON15),G=F*q;G<0?y.push(new e(a,i*L,i*b)):G>0?y.push(new e(a,i*L,i*-b)):0!==b?(y.push(new e(a,i*L,i*-b)),y.push(new e(a,i*L,i*b)),++D):y.push(new e(a,i*L,i*b))}return y}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,_=new e,T=new e,y=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,h,f,d=t.origin,E=t.direction,m=e.subtract(a,r,p),A=e.subtract(i,r,_),S=e.cross(E,A,T),N=e.dot(m,S);if(u){if(N<o.EPSILON6)return;if(s=e.subtract(d,r,y),l=e.dot(s,S),l<0||l>N)return;if(c=e.cross(s,m,R),h=e.dot(E,c),h<0||l+h>N)return;f=e.dot(A,c)/N}else{if(Math.abs(N)<o.EPSILON6)return;var M=1/N;if(s=e.subtract(d,r,y),l=e.dot(s,S)*M,l<0||l>1)return;if(c=e.cross(s,m,R),h=e.dot(E,c)*M,h<0||l+h>1)return;f=e.dot(A,c)*M}return f},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var N=new l;m.lineSegmentSphere=function(t,n,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var M=new e,I=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,M),h=e.multiplyComponents(c,t.direction,I),f=e.magnitudeSquared(l),d=e.dot(l,h);if(f>1){if(d>=0)return;var E=d*d;if(r=f-1,a=e.magnitudeSquared(h),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var m=s/a,p=r/s;return m<p?new i(m,p):{start:p,stop:m}}var _=Math.sqrt(r/a);return new i(_,_)}return f<1?(r=f-1,a=e.magnitudeSquared(h),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(h),new i(0,-d/a)):void 0};var g=new e,v=new e,O=new e,w=new e,x=new e,C=new u,P=new u,U=new u,D=new u,F=new u,L=new u,B=new u,z=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,g);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,g),h=e.normalize(l,l),f=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(f,h,v),v),m=e.normalize(e.cross(h,d,O),O),p=C;p[0]=h.x,p[1]=h.y,p[2]=h.z,p[3]=d.x,p[4]=d.y,p[5]=d.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var _=u.transpose(p,P),T=u.fromScale(n.radii,U),y=u.fromScale(n.oneOverRadii,D),R=F;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,N=u.multiply(u.multiply(_,y,L),R,L),M=u.multiply(u.multiply(N,T,B),p,B),I=u.multiplyByVector(N,a,x),G=E(M,e.negate(I,g),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(T,u.multiplyByVector(p,G[H],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,q);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-V*V),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var G=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),h=-(a.distance+l)/c;if(!(h<0||h>1))return e.multiplyByScalar(u,h,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var h,f;if(1!==l&&2!==l||(h=new e,f=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,h),m.lineSegmentPlane(t,r,a,f),{positions:[t,n,r,h,f],indices:[0,3,4,1,2,4,1,4,3] -};if(s)return m.lineSegmentPlane(n,r,a,h),m.lineSegmentPlane(n,t,a,f),{positions:[t,n,r,h,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,h),m.lineSegmentPlane(r,n,a,f),{positions:[t,n,r,h,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,h),m.lineSegmentPlane(r,t,a,f),{positions:[t,n,r,h,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,h),m.lineSegmentPlane(t,n,a,f),{positions:[t,n,r,h,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,h),m.lineSegmentPlane(n,r,a,f),{positions:[t,n,r,h,f],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./freezeObject"],function(e,t,n,r){"use strict";function a(t,n){this.normal=e.clone(t),this.distance=n}a.fromPointNormal=function(n,r,i){var o=-e.dot(r,n);return t(i)?(e.clone(r,i.normal),i.distance=o,i):new a(r,o)};var i=new e;return a.fromCartesian4=function(n,r){var o=e.fromCartesian4(n,i),u=n.w;return t(r)?(e.clone(o,r.normal),r.distance=u,r):new a(o,u)},a.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},a.ORIGIN_XY_PLANE=r(new a(e.UNIT_Z,0)),a.ORIGIN_YZ_PLANE=r(new a(e.UNIT_X,0)),a.ORIGIN_ZX_PLANE=r(new a(e.UNIT_Y,0)),a}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return f(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,h,f,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],h=[],f=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),h.push(a),r.promise},d=function(e){return m(h,e),e},E=function(e){return e=t(e),f=e.then,E=t,d=_,m(l,e),h=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,h,f,d,E,m,p,T,y;if(T=t.length>>>0,c=Math.max(0,Math.min(n,T)),h=[],l=T-c+1,f=[],d=o(),c)for(p=d.progress,m=function(e){f.push(e),--l||(E=m=_,d.reject(f))},E=function(e){h.push(e),--c||(E=m=_,d.resolve(h))},y=0;y<T;++y)y in t&&e(t[y],s,u,p);else d.resolve(h);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return p(1,arguments),f(e,T).then(t,n,r)}function h(){return f(arguments,T)}function f(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},y.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function p(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function _(){}function T(e){return e}var y,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=h,e.all=l,e.map=f,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,y=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,h,f){var d,E,m,p,_;if("%%"==e)return"%";for(var T=!1,y="",R=!1,A=!1,S=" ",N=s.length,M=0;s&&M<N;M++)switch(s.charAt(M)){case" ":y=" ";break;case"+":y="+";break;case"-":T=!0;break;case"'":S=s.charAt(M+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,T=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[n++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(f)>-1?6:"d"==f?0:void 0,_=r?t[r.slice(0,-1)]:t[n++],f){case"s":return u(String(_),T,c,h,R,S);case"c":return u(String.fromCharCode(+_),T,c,h,R);case"b":return o(_,2,A,T,c,h,R);case"o":return o(_,8,A,T,c,h,R);case"x":return o(_,16,A,T,c,h,R);case"X":return o(_,16,A,T,c,h,R).toUpperCase();case"u":return o(_,10,A,T,c,h,R);case"i":case"d":return d=+_||0,d=Math.round(d-d%1),E=d<0?"-":y,_=E+a(String(Math.abs(d)),h,"0",!1),i(_,E,T,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+_,E=d<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(f.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(f)%2],_=E+Math.abs(d)[m](h),i(_,E,T,c,R)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function h(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function f(e,n){y.julianDate=e;var r=m.leapSeconds,a=t(r,y,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var h=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return h>=43200&&(l-=1),[l,h]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&h(this)}var p=new i,_=[31,28,31,30,31,30,31,31,30,31,30,31],T=29,y=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,N=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,g=/^(\d{2})(\.\d+)?/.source+I.source,v=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,O=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),h(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,f=0,p=0,y=0,I=0,w=u[0],x=u[1];if(u=w.match(M),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(N),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var F;if(r(x)){u=x.match(O),null!==u?(f=+u[1],p=+u[2],y=+u[3],I=1e3*+(u[4]||0),F=5):(u=x.match(v),null!==u?(f=+u[1],p=+u[2],y=60*+(u[3]||0),F=4):(u=x.match(g),null!==u&&(f=+u[1],p=60*+(u[2]||0),F=3)));var L=u[F],B=+u[F+1],z=+(u[F+2]||0);switch(L){case"+":f-=B,p-=z;break;case"-":f+=B,p+=z;break;case"Z":break;default:p+=new Date(Date.UTC(n,s-1,l,f,p)).getTimezoneOffset()}}else p+=new Date(n,s-1,l).getTimezoneOffset();var b=60===y;for(b&&y--;p>=60;)p-=60,f++;for(;f>=24;)f-=24,l++;for(a=i&&2===s?T:_[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?T:_[s-1];for(;p<0;)p+=60,f--;for(;f<0;)f+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?T:_[s-1],l+=a;var q=E(n,s,l,f,p,y,I);return r(t)?(d(q[0],q[1],t),h(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=f(e,w);r(a)||(m.addSeconds(e,-1,w),a=f(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var h=4e3*(c+1)/1461001|0;c=c-(1461*h/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var p=d+2-12*c|0,_=100*(l-49)+h+c|0,T=u/s.SECONDS_PER_HOUR|0,y=u-T*s.SECONDS_PER_HOUR,R=y/s.SECONDS_PER_MINUTE|0;y-=R*s.SECONDS_PER_MINUTE;var A=0|y,S=(y-A)/s.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(A+=1),r(t)?(t.year=_,t.month=p,t.day=E,t.hour=T,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(_,p,E,T,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,p),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var h=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,f){var d=h.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(f)&&n(E.overrideMimeType)&&E.overrideMimeType(f),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,h){"use strict";function f(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),f=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||f<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=n.samples,_=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=f,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var T,y=e._addNewLeapSeconds,R=0,A=p.length;R<A;R+=e._columnCount){var S=p[R+a],N=p[R+m],M=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(M,N,h.TAI);if(_.push(I),y){if(N!==T&&r(T)){var g=o.leapSeconds,v=t(g,I,d);if(v<0){var O=new u(I,N);g.splice(~v,0,O)}}T=N}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,n){return t+e*(n-t)}function _(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var h=o.secondsDifference(r,c)/o.secondsDifference(l,c),f=a*s,d=i*s,E=n[f+e._ut1MinusUtcSecondsColumn],_=n[d+e._ut1MinusUtcSecondsColumn],T=_-E;if(T>.5||T<-.5){var y=n[f+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];y!==R&&(l.equals(r)?E=_:_-=R-y)}return u.xPoleWander=p(h,n[f+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(h,n[f+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(h,n[f+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(h,n[f+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(h,E,_),u}return f.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),f.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},f.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var h=i[u],f=i[u+1],d=o.lessThanOrEquals(h,e),E=!r(f),m=E||o.greaterThanOrEquals(f,e);if(d&&m)return s=u,!E&&f.equals(e)&&++s,l=s+1,_(this,i,this._samples,e,s,l,n),n}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,_(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},f}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(h))return h;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),h=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(f)||(f=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=f(e);return d.href=n,d.href=d.href,d.href}var h,f,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){h=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=h;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var h=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var h=u/this._samplesPerXysFile|0,f=s/this._samplesPerXysFile|0,d=[],E=h;E<=f;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var h=s+u;h>=this._totalSamples&&(h=this._totalSamples-1,s=h-u,s<0&&(s=0));var f=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),f=!0),r(d[3*h])||(l(this,h/this._samplesPerXysFile|0),f=!0),!f){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,p=i-s*this._stepSizeDays,_=this._work,T=this._denominators,y=this._coef,R=this._xTable;for(E=0;E<=u;++E)_[E]=p-R[E];for(E=0;E<=u;++E){for(y[E]=1,m=0;m<=u;++m)m!==E&&(y[E]*=_[m]);y[E]*=T[E];var A=3*(s+E);n.x+=y[E]*d[A++],n.y+=y[E]*d[A++],n.s+=y[E]*d[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){ -if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(N)&&(N=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,M=r(e[1]))}return N}function u(){return o()&&M}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,g=r(e[1]),g.isNightly=!!e[2])}return I}function c(){return s()&&g}function l(){if(!t(v)){v=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(v=!0,O=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(v=!0,O=r(e[1])))}return v}function h(){return l()&&O}function f(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function d(){return f()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function p(){return E()&&P}function _(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function T(){if(!t(L)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;L=t(n)&&""!==n,L&&(F=n)}return L}function y(){return T()?F:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,N,M,I,g,v,O,w,x,C,P,U,D,F,L,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:h,isEdge:f,edgeVersion:d,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:T,imageRenderingValue:y};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var h=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);h=e.normalize(t,h);var u=h.x*o,s=h.y*o,c=h.z*o,f=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=f,a):new l(u,s,c,f)};var f=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],h=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+h+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var p=f,_=0;h>s&&(_=1),E>s&&E>h&&(_=2);var T=p[_],y=p[T];n=Math.sqrt(e[c.getElementIndex(_,_)]-e[c.getElementIndex(T,T)]-e[c.getElementIndex(y,y)]+1);var R=d;R[_]=.5*n,n=.5/n,u=(e[c.getElementIndex(y,T)]-e[c.getElementIndex(T,y)])*n,R[T]=(e[c.getElementIndex(T,_)]+e[c.getElementIndex(_,T)])*n,R[y]=(e[c.getElementIndex(y,_)]+e[c.getElementIndex(_,y)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,p=new l,_=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),_=l.fromAxisAngle(e.UNIT_X,o.roll,E),p=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(p,_,p),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var T=new e,y=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,T);var u=l.computeAngle(R);r[o]=T.x*u,r[o+1]=T.y*u,r[o+2]=T.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,y);var u=e.magnitude(y);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(y,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,h=o*u+r*l+a*c-i*s,f=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=h,n.y=f,n.z=d,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var N=new l;l.lerp=function(e,t,n,r){return N=l.multiplyByScalar(t,n,N),r=l.multiplyByScalar(e,1-n,r),l.add(N,r,r)};var M=new l,I=new l,g=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=M=l.negate(t,M)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return I=l.multiplyByScalar(e,Math.sin((1-n)*o),I),g=l.multiplyByScalar(i,Math.sin(n*o),g),r=l.add(I,g,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var v=new e,O=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,v);l.multiply(i,t,x);var u=l.log(x,O);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],D=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;U[B]=1/(z*b),D[B]=z/b}return U[7]=P/136,D[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,h=7;h>=0;--h)F[h]=(U[h]*s-D[h])*o,L[h]=(U[h]*c-D[h])*o;var f=a*n*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),d=u*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),E=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,f,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,h,f,d,E,m,p,_,T,y,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},N={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},M={},I={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},g=new n,v=new n,O=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(M[i])?r=M[i]:(r=function(r,i,s){if(u(s)||(s=new T),p.equalsEpsilon(r.x,0,p.EPSILON14)&&p.equalsEpsilon(r.y,0,p.EPSILON14)){var c=p.sign(r.z);n.unpack(N[e],0,g),"east"!==e&&"west"!==e&&n.multiplyByScalar(g,c,g),n.unpack(N[t],0,v),"east"!==t&&"west"!==t&&n.multiplyByScalar(v,c,v),n.unpack(N[a],0,O),"east"!==a&&"west"!==a&&n.multiplyByScalar(O,c,O)}else{i=o(i,f.WGS84),i.geodeticSurfaceNormal(r,I.up);var l=I.up,h=I.east;h.x=-r.y,h.y=r.x,h.z=0,n.normalize(h,I.east),n.cross(l,h,I.north),n.multiplyByScalar(I.up,-1,I.down),n.multiplyByScalar(I.east,-1,I.west),n.multiplyByScalar(I.north,-1,I.south),g=I[e],v=I[t],O=I[a]}return s[0]=g.x,s[1]=g.y,s[2]=g.z,s[3]=0,s[4]=v.x,s[5]=v.y,s[6]=v.z,s[7]=0,s[8]=O.x,s[9]=O.y,s[10]=O.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},M[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new y,x=new n(1,1,1),C=new T;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof T&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=y.fromHeadingPitchRoll(t,w),c=T.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),T.multiply(i,c,i)};var P=new T,U=new _;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof y&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=T.getRotation(i,U);return y.fromRotationMatrix(o,a)};var D=24110.54841,F=8640184.812866,L=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,q=p.TWO_PI/86400,G=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(F+n*(L+n*B)),s=o*q%p.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,h=s+c*l,f=Math.cos(h),d=Math.sin(h);return u(t)?(t[0]=f,t[1]=-d,t[2]=0,t[3]=d,t[4]=f,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new _(f,d,0,-d,f,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new _);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return _.transpose(n,t)};var V=new E(0,0,0),H=new h(0,0,0,0,0,0),Y=new _,k=new _;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new _);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var h=_.fromRotationZ(-i.s,k),f=_.multiply(l,h,Y),d=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=d-2451545,y=E/R.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(T+y);S=S%1*p.TWO_PI;var N=_.fromRotationZ(S,k),M=_.multiply(f,N,Y),I=Math.cos(n.xPoleWander),g=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),O=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*p.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=k;return U[0]=I*C,U[1]=I*P,U[2]=v,U[3]=-g*P+O*v*C,U[4]=g*C+O*v*P,U[5]=-O*I,U[6]=-O*P-g*v*C,U[7]=O*C-g*v*P,U[8]=g*I,_.multiply(M,U,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return T.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),T.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,Q=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,p.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,Q);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new _),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new a,$=new n,ee=new n,te=new r,ne=new r,re=new r,ae=new r,ie=new r,oe=new T,ue=new T;A.basisTo2D=function(e,t,a){var i=e.ellipsoid,o=T.getColumn(t,3,te),u=i.cartesianToCartographic(o,J),s=A.eastNorthUpToFixedFrame(o,i,oe),c=T.inverseTransformation(s,ue),l=e.project(u,$),h=ne;h.x=l.z,h.y=l.x,h.z=l.y,h.w=1;var f=T.getColumn(t,0,ee),d=n.magnitude(f),E=T.multiplyByVector(c,f,re);r.fromElements(E.z,E.x,E.y,0,E);var m=T.getColumn(t,1,ee),p=n.magnitude(m),_=T.multiplyByVector(c,m,ae);r.fromElements(_.z,_.x,_.y,0,_);var y=T.getColumn(t,2,ee),R=n.magnitude(y),S=ie;return n.cross(E,_,S),n.normalize(S,S),n.cross(_,S,E),n.normalize(E,E),n.cross(S,E,_),n.normalize(_,_),n.multiplyByScalar(E,d,E),n.multiplyByScalar(_,p,_),n.multiplyByScalar(S,R,S),T.setColumn(a,0,E,a),T.setColumn(a,1,_,a),T.setColumn(a,2,S,a),T.setColumn(a,3,h,a),a};var se=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);return A.wgs84To2DModelMatrix=function(e,t,n){var r=e.ellipsoid,a=A.eastNorthUpToFixedFrame(t,r,oe),i=T.inverseTransformation(a,ue),o=r.cartesianToCartographic(t,J),u=e.project(o,$),s=ne;s.x=u.z,s.y=u.x,s.z=u.y,s.w=1;var c=T.fromTranslation(s,oe);return T.multiply(se,i,n),T.multiply(c,n,n),n},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,h,f,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=h.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var p=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new E(r.center,n)};var _=new f,T=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=_;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,T);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=_;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,T);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var y=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=y,l=0;l<r;++l){var h=e[l];n.multiplyByScalar(u,h.x,c),i(t[l])||(t[l]=new n);var f=n.add(o,c,t[l]);n.multiplyByScalar(s,h.y,c),n.add(f,c,f),a.scaleToGeocentricSurface(f,f)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,h,f,d,E){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=f.clone(a(t,f.ZERO))}function p(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;f.setColumn(l,0,e.xAxis,l),f.setColumn(l,1,e.yAxis,l),f.setColumn(l,2,e.zAxis,l);var h=I;h.x=(t+r)/2,h.y=(a+o)/2,h.z=(u+s)/2;var d=g;d.x=(r-t)/2,d.y=(o-a)/2,d.z=(s-u)/2;var E=c.center;return h=f.multiplyByVector(l,h,h),n.add(e.origin,h,E),f.multiplyByScale(l,d,l),c}var _=new n,T=new n,y=new n,R=new n,A=new n,S=new n,N=new f,M={unitary:new f,diagonal:new f};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=f.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],_);for(r=1;r<a;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,h=0,d=0,E=0,p=0;for(r=0;r<a;r++)s=n.subtract(e[r],o,T),c+=s.x*s.x,l+=s.x*s.y,h+=s.x*s.z,d+=s.y*s.y,E+=s.y*s.z,p+=s.z*s.z;c*=u,l*=u,h*=u,d*=u,E*=u,p*=u;var I=N;I[0]=c,I[1]=l,I[2]=h,I[3]=l,I[4]=d,I[5]=E,I[6]=h,I[7]=E,I[8]=p;var g=f.computeEigenDecomposition(I,M),v=f.clone(g.unitary,t.halfAxes),O=f.getColumn(v,0,R),w=f.getColumn(v,1,A),x=f.getColumn(v,2,S),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,F=Number.MAX_VALUE,L=Number.MAX_VALUE;for(r=0;r<a;r++)s=e[r],C=Math.max(n.dot(O,s),C),P=Math.max(n.dot(w,s),P),U=Math.max(n.dot(x,s),U),D=Math.min(n.dot(O,s),D),F=Math.min(n.dot(w,s),F),L=Math.min(n.dot(x,s),L);O=n.multiplyByScalar(O,.5*(D+C),O),w=n.multiplyByScalar(w,.5*(F+P),w),x=n.multiplyByScalar(x,.5*(L+U),x);var B=n.add(O,w,t.center);B=n.add(B,x,B);var z=y;return z.x=C-D,z.y=P-F,z.z=U-L,n.multiplyByScalar(z,.5,z),f.multiplyByScale(t.halfAxes,z,t.halfAxes),t};var I=new n,g=new n,v=new r,O=new n,w=[new r,new r,new r,new r,new r,new r,new r,new r],x=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,i){t=a(t,0),n=a(n,0),r=a(r,u.WGS84);var o=E.center(e,v),c=r.cartographicToCartesian(o,O),l=new s(c,r),h=l.plane,f=w[0],m=w[1],_=w[2],T=w[3],y=w[4],R=w[5],A=w[6],S=w[7],N=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=y.latitude=e.south,S.latitude=T.latitude=M,f.latitude=m.latitude=_.latitude=e.north,A.longitude=S.longitude=f.longitude=e.west,R.longitude=m.longitude=N,y.longitude=T.longitude=_.longitude=e.east,_.height=m.height=f.height=S.height=A.height=R.height=y.height=T.height=n,r.cartographicArrayToCartesianArray(w,x),l.projectPointsToNearestOnPlane(x,C);var I=Math.min(C[6].x,C[7].x,C[0].x),g=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);_.height=f.height=y.height=A.height=t,r.cartographicArrayToCartesianArray(w,x);var D=Math.min(d.getPointDistance(h,x[0]),d.getPointDistance(h,x[2]),d.getPointDistance(h,x[4]),d.getPointDistance(h,x[6])),F=n;return p(l,I,g,P,U,D,F,i)},m.clone=function(e,t){if(i(e))return i(t)?(n.clone(e.center,t.center),f.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,a=t.normal,i=e.halfAxes,o=a.x,u=a.y,s=a.z,l=Math.abs(o*i[f.COLUMN0ROW0]+u*i[f.COLUMN0ROW1]+s*i[f.COLUMN0ROW2])+Math.abs(o*i[f.COLUMN1ROW0]+u*i[f.COLUMN1ROW1]+s*i[f.COLUMN1ROW2])+Math.abs(o*i[f.COLUMN2ROW0]+u*i[f.COLUMN2ROW1]+s*i[f.COLUMN2ROW2]),h=n.dot(a,r)+t.distance;return h<=-l?c.OUTSIDE:h>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,F=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,I),a=e.halfAxes,i=f.getColumn(a,0,P),o=f.getColumn(a,1,U),u=f.getColumn(a,2,D),s=n.magnitude(i),c=n.magnitude(o),l=n.magnitude(u);n.normalize(i,i),n.normalize(o,o),n.normalize(u,u);var h=F;h.x=n.dot(r,i),h.y=n.dot(r,o),h.z=n.dot(r,u);var d,E=0;return h.x<-s?(d=h.x+s,E+=d*d):h.x>s&&(d=h.x-s,E+=d*d),h.y<-c?(d=h.y+c,E+=d*d):h.y>c&&(d=h.y-c,E+=d*d),h.z<-l?(d=h.z+l,E+=d*d):h.z>l&&(d=h.z-l,E+=d*d),E};var L=new n,B=new n;m.computePlaneDistances=function(e,t,r,a){i(a)||(a=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,h=f.getColumn(c,0,P),d=f.getColumn(c,1,U),E=f.getColumn(c,2,D),m=n.add(h,d,L);n.add(m,E,m),n.add(m,s,m);var p=n.subtract(m,t,B),_=n.dot(r,p);return o=Math.min(_,o),u=Math.max(_,u),n.add(s,h,m),n.add(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.add(s,h,m),n.subtract(m,d,m),n.add(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.add(s,h,m),n.subtract(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,h,m),n.add(m,d,m),n.add(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,h,m),n.add(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,h,m),n.subtract(m,d,m),n.add(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,h,m),n.subtract(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),a.start=o,a.stop=u,a};var z=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,z);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||i(e)&&i(t)&&n.equals(e.center,t.center)&&f.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,o,c,f){var p,_,T,y;if(i(e)&&i(t)&&i(r)&&i(o)){var R=e.minimum,A=e.maximum,S=n.subtract(A,R,h),N=r-t,M=Math.max(n.maximumComponent(S),N);p=M<m-1?s.BITS12:s.NONE,_=e.center,T=u.inverseTransformation(o,new u);var I=n.negate(R,l);u.multiply(u.fromTranslation(I,d),T,T);var g=l;g.x=1/S.x,g.y=1/S.y,g.z=1/S.z,u.multiply(u.fromScale(g,d),T,T),y=u.clone(o),u.setTranslation(y,n.ZERO,y),o=u.clone(o,new u);var v=u.fromTranslation(R,d),O=u.fromScale(S,E),w=u.multiply(v,O,d);u.multiply(o,w,o),u.multiply(y,w,y)}this.quantization=p,this.minimumHeight=t,this.maximumHeight=r,this.center=_,this.toScaledENU=T,this.fromScaledENU=o,this.matrix=y,this.hasVertexNormals=c,this.hasWebMercatorT=a(f,!1)}var l=new n,h=new n,f=new t,d=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,i,c,h,d,E){var m=c.x,p=c.y;if(this.quantization===s.BITS12){i=u.multiplyByPoint(this.toScaledENU,i,l),i.x=o.clamp(i.x,0,1),i.y=o.clamp(i.y,0,1),i.z=o.clamp(i.z,0,1);var _=this.maximumHeight-this.minimumHeight,T=o.clamp((h-this.minimumHeight)/_,0,1);t.fromElements(i.x,i.y,f);var y=e.compressTextureCoordinates(f);t.fromElements(i.z,T,f);var R=e.compressTextureCoordinates(f);t.fromElements(m,p,f);var A=e.compressTextureCoordinates(f);if(r[a++]=y,r[a++]=R,r[a++]=A,this.hasWebMercatorT){t.fromElements(E,0,f);var S=e.compressTextureCoordinates(f);r[a++]=S}}else n.subtract(i,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=h,r[a++]=m,r[a++]=p,this.hasWebMercatorT&&(r[a++]=E);return this.hasVertexNormals&&(r[a++]=e.octPackFloat(d)),a},c.prototype.decodePosition=function(t,r,a){if(i(a)||(a=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],f);a.x=o.x,a.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],f);return a.z=c.x, -u.multiplyByPoint(this.fromScaledENU,a,a)}return a.x=t[r],a.y=t[r+1],a.z=t[r+2],n.add(a,this.center,a)},c.prototype.decodeTextureCoordinates=function(n,r,a){return i(a)||(a=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],a):t.fromElements(n[r+4],n[r+5],a)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){var r=e.decompressTextureCoordinates(t[n+1],f);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var a=this.getStride();n=(n+1)*a-1;var i=e[n]/256,o=Math.floor(i),u=256*(i-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var p={position3DAndHeight:0,textureCoordAndEncodedNormals:1},_={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,n=r.FLOAT,a=r.getSizeInBytes(n);if(this.quantization===s.NONE){var i=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(i+o)*a,[{index:p.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:t},{index:p.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:i*a,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*a,[{index:_.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:_.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*a,strideInBytes:t}]):[{index:_.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?p:_},c.clone=function(e,t){return i(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,a=t.message;n=e(r)&&e(a)?r+": "+a:t.toString();var i=t.stack;return e(i)&&(n+="\n"+i),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){"use strict";function r(r){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return r}),define("Workers/upsampleQuantizedTerrainMesh",["../Core/AttributeCompression","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/Ellipsoid","../Core/EllipsoidalOccluder","../Core/IndexDatatype","../Core/Intersections2D","../Core/Math","../Core/OrientedBoundingBox","../Core/TerrainEncoding","./createTaskProcessorWorker"],function(e,t,n,r,a,i,o,u,s,c,l,h,f,d){"use strict";function E(e,n){var a=e.isEastChild,i=e.isNorthChild,d=a?y:0,E=a?T:y,p=i?y:0,F=i?T:y,L=I,B=g,z=v,b=w;L.length=0,B.length=0,z.length=0,b.length=0;var q=O;q.length=0;var G={},W=e.vertices,X=e.indices;X=X.subarray(0,e.skirtIndex);var V,H,Y,k=f.clone(e.encoding),Z=k.hasVertexNormals,j=e.exaggeration,K=0,Q=e.vertexCountWithoutSkirts,J=e.minimumHeight,$=e.maximumHeight,ee=new Array(Q),te=new Array(Q),ne=new Array(Q),re=Z?new Array(2*Q):void 0,ae=20;for(H=0,Y=0;H<Q;++H,Y+=2){var ie=k.decodeTextureCoordinates(W,H,U);if(V=k.decodeHeight(W,H)/j,ee[H]=l.clamp(ie.x*T|0,0,T),te[H]=l.clamp(ie.y*T|0,0,T),ne[H]=l.clamp((V-J)/($-J)*T|0,0,T),ee[H]<ae&&(ee[H]=0),te[H]<ae&&(te[H]=0),T-ee[H]<ae&&(ee[H]=T),T-te[H]<ae&&(te[H]=T),Z){var oe=k.getOctEncodedNormal(W,H,D);re[Y]=oe.x,re[Y+1]=oe.y}}var ue,se;for(H=0,Y=0;H<Q;++H,Y+=2)ue=ee[H],se=te[H],(a&&ue>=y||!a&&ue<=y)&&(i&&se>=y||!i&&se<=y)&&(G[H]=K,L.push(ue),B.push(se),z.push(ne[H]),Z&&(b.push(re[Y]),b.push(re[Y+1])),++K);var ce=[];ce.push(new m),ce.push(new m),ce.push(new m);var le=[];le.push(new m),le.push(new m),le.push(new m);var he,fe;for(H=0;H<X.length;H+=3){var de=X[H],Ee=X[H+1],me=X[H+2],pe=ee[de],_e=ee[Ee],Te=ee[me];ce[0].initializeIndexed(ee,te,ne,re,de),ce[1].initializeIndexed(ee,te,ne,re,Ee),ce[2].initializeIndexed(ee,te,ne,re,me);var ye=c.clipTriangleAtAxisAlignedThreshold(y,a,pe,_e,Te,R);he=0,he>=ye.length||(he=le[0].initializeFromClipResult(ye,he,ce),he>=ye.length||(he=le[1].initializeFromClipResult(ye,he,ce),he>=ye.length||(he=le[2].initializeFromClipResult(ye,he,ce),fe=c.clipTriangleAtAxisAlignedThreshold(y,i,le[0].getV(),le[1].getV(),le[2].getV(),A),_(L,B,z,b,q,G,fe,le,Z),he<ye.length&&(le[2].clone(le[1]),le[2].initializeFromClipResult(ye,he,ce),fe=c.clipTriangleAtAxisAlignedThreshold(y,i,le[0].getV(),le[1].getV(),le[2].getV(),A),_(L,B,z,b,q,G,fe,le,Z)))))}var Re=a?-T:0,Ae=i?-T:0,Se=[],Ne=[],Me=[],Ie=[],ge=Number.MAX_VALUE,ve=-ge,Oe=S;Oe.length=0;var we=o.clone(e.ellipsoid),xe=e.childRectangle,Ce=xe.north,Pe=xe.south,Ue=xe.east,De=xe.west;for(Ue<De&&(Ue+=l.TWO_PI),H=0;H<L.length;++H)ue=Math.round(L[H]),ue<=d?(Se.push(H),ue=0):ue>=E?(Me.push(H),ue=T):ue=2*ue+Re,L[H]=ue,se=Math.round(B[H]),se<=p?(Ne.push(H),se=0):se>=F?(Ie.push(H),se=T):se=2*se+Ae,B[H]=se,V=l.lerp(J,$,z[H]/T),V<ge&&(ge=V),V>ve&&(ve=V),z[H]=V,N.longitude=l.lerp(De,Ue,ue/T),N.latitude=l.lerp(Pe,Ce,se/T),N.height=V,we.cartographicToCartesian(N,M),Oe.push(M.x),Oe.push(M.y),Oe.push(M.z);var Fe=t.fromVertices(Oe,r.ZERO,3,C),Le=h.fromRectangle(xe,ge,ve,we,P),Be=new u(we),ze=Be.computeHorizonCullingPointFromVertices(Fe.center,Oe,3,Fe.center,x),be=ve-ge,qe=new Uint16Array(L.length+B.length+z.length);for(H=0;H<L.length;++H)qe[H]=L[H];var Ge=L.length;for(H=0;H<B.length;++H)qe[Ge+H]=B[H];for(Ge+=B.length,H=0;H<z.length;++H)qe[Ge+H]=T*(z[H]-ge)/be;var We,Xe=s.createTypedArray(L.length,q);if(Z){var Ve=new Uint8Array(b);n.push(qe.buffer,Xe.buffer,Ve.buffer),We=Ve.buffer}else n.push(qe.buffer,Xe.buffer);return{vertices:qe.buffer,encodedNormals:We,indices:Xe.buffer,minimumHeight:ge,maximumHeight:ve,westIndices:Se,southIndices:Ne,eastIndices:Me,northIndices:Ie,boundingSphere:Fe,orientedBoundingBox:Le,horizonOcclusionPoint:ze}}function m(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}function p(t,n){++L;var a=B[L],i=z[L];return a=e.octDecode(t.first.getNormalX(),t.first.getNormalY(),a),i=e.octDecode(t.second.getNormalX(),t.second.getNormalY(),i),M=r.lerp(a,i,t.ratio,M),r.normalize(M,M),e.octEncode(M,n),--L,n}function _(e,t,n,r,a,o,u,s,c){if(0!==u.length){for(var l=0,h=0;h<u.length;)h=b[l++].initializeFromClipResult(u,h,s);for(var f=0;f<l;++f){var d=b[f];if(d.isIndexed())d.newIndex=o[d.index],d.uBuffer=e,d.vBuffer=t,d.heightBuffer=n,c&&(d.normalBuffer=r);else{var E=d.getKey();if(i(o[E]))d.newIndex=o[E];else{var m=e.length;e.push(d.getU()),t.push(d.getV()),n.push(d.getH()),c&&(r.push(d.getNormalX()),r.push(d.getNormalY())),d.newIndex=m,o[E]=m}}}3===l?(a.push(b[0].newIndex),a.push(b[1].newIndex),a.push(b[2].newIndex)):4===l&&(a.push(b[0].newIndex),a.push(b[1].newIndex),a.push(b[2].newIndex),a.push(b[0].newIndex),a.push(b[2].newIndex),a.push(b[3].newIndex))}}var T=32767,y=T/2|0,R=[],A=[],S=[],N=new a,M=new r,I=[],g=[],v=[],O=[],w=[],x=new r,C=new t,P=new h,U=new n,D=new r;m.prototype.clone=function(e){return i(e)||(e=new m),e.uBuffer=this.uBuffer,e.vBuffer=this.vBuffer,e.heightBuffer=this.heightBuffer,e.normalBuffer=this.normalBuffer,e.index=this.index,e.first=this.first,e.second=this.second,e.ratio=this.ratio,e},m.prototype.initializeIndexed=function(e,t,n,r,a){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=n,this.normalBuffer=r,this.index=a,this.first=void 0,this.second=void 0,this.ratio=void 0},m.prototype.initializeFromClipResult=function(e,t,n){var r=t+1;return e[t]!==-1?n[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=n[e[r]],++r,this.second=n[e[r]],++r,this.ratio=e[r],++r),r},m.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},m.prototype.isIndexed=function(){return i(this.index)},m.prototype.getH=function(){return i(this.index)?this.heightBuffer[this.index]:l.lerp(this.first.getH(),this.second.getH(),this.ratio)},m.prototype.getU=function(){return i(this.index)?this.uBuffer[this.index]:l.lerp(this.first.getU(),this.second.getU(),this.ratio)},m.prototype.getV=function(){return i(this.index)?this.vBuffer[this.index]:l.lerp(this.first.getV(),this.second.getV(),this.ratio)};var F=new n,L=-1,B=[new r,new r],z=[new r,new r];m.prototype.getNormalX=function(){return i(this.index)?this.normalBuffer[2*this.index]:(F=p(this,F),F.x)},m.prototype.getNormalY=function(){return i(this.index)?this.normalBuffer[2*this.index+1]:(F=p(this,F),F.y)};var b=[];return b.push(new m),b.push(new m),b.push(new m),b.push(new m),d(E)})}(); \ No newline at end of file +!function(){define("Core/defined",[],function(){"use strict";function e(e){return void 0!==e&&null!==e}return e}),define("Core/DeveloperError",["./defined"],function(e){"use strict";function t(e){this.name="DeveloperError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t.throwInstantiationError=function(){throw new t("This function defines an interface and should not be called directly.")},t}),define("Core/Check",["./defined","./DeveloperError"],function(e,t){"use strict";function n(e){return e+" is required, actual value was undefined"}function r(e,t,n){return"Expected "+n+" to be typeof "+t+", actual typeof was "+e}var a={};return a.typeOf={},a.defined=function(r,a){if(!e(a))throw new t(n(r))},a.typeOf.func=function(e,n){if("function"!=typeof n)throw new t(r(typeof n,"function",e))},a.typeOf.string=function(e,n){if("string"!=typeof n)throw new t(r(typeof n,"string",e))},a.typeOf.number=function(e,n){if("number"!=typeof n)throw new t(r(typeof n,"number",e))},a.typeOf.number.lessThan=function(e,n,r){if(a.typeOf.number(e,n),n>=r)throw new t("Expected "+e+" to be less than "+r+", actual value was "+n)},a.typeOf.number.lessThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n>r)throw new t("Expected "+e+" to be less than or equal to "+r+", actual value was "+n)},a.typeOf.number.greaterThan=function(e,n,r){if(a.typeOf.number(e,n),n<=r)throw new t("Expected "+e+" to be greater than "+r+", actual value was "+n)},a.typeOf.number.greaterThanOrEquals=function(e,n,r){if(a.typeOf.number(e,n),n<r)throw new t("Expected "+e+" to be greater than or equal to"+r+", actual value was "+n)},a.typeOf.object=function(e,n){if("object"!=typeof n)throw new t(r(typeof n,"object",e))},a.typeOf.bool=function(e,n){if("boolean"!=typeof n)throw new t(r(typeof n,"boolean",e))},a}),define("Core/freezeObject",["./defined"],function(e){"use strict";var t=Object.freeze;return e(t)||(t=function(e){return e}),t}),define("Core/defaultValue",["./freezeObject"],function(e){"use strict";function t(e,t){return void 0!==e?e:t}return t.EMPTY_OBJECT=e({}),t}),define("ThirdParty/mersenne-twister",[],function(){var e=function(e){void 0==e&&(e=(new Date).getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,this.init_genrand(e)};return e.prototype.init_genrand=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(1812433253*((4294901760&e)>>>16)<<16)+1812433253*(65535&e)+this.mti,this.mt[this.mti]>>>=0}},e.prototype.genrand_int32=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_genrand(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[1&e];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>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,e>>>0},e.prototype.random=function(){return this.genrand_int32()*(1/4294967296)},e}),define("Core/Math",["../ThirdParty/mersenne-twister","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";var a={};a.EPSILON1=.1,a.EPSILON2=.01,a.EPSILON3=.001,a.EPSILON4=1e-4,a.EPSILON5=1e-5,a.EPSILON6=1e-6,a.EPSILON7=1e-7,a.EPSILON8=1e-8,a.EPSILON9=1e-9,a.EPSILON10=1e-10,a.EPSILON11=1e-11,a.EPSILON12=1e-12,a.EPSILON13=1e-13,a.EPSILON14=1e-14,a.EPSILON15=1e-15,a.EPSILON16=1e-16,a.EPSILON17=1e-17,a.EPSILON18=1e-18,a.EPSILON19=1e-19,a.EPSILON20=1e-20,a.GRAVITATIONALPARAMETER=3986004418e5,a.SOLAR_RADIUS=6955e5,a.LUNAR_RADIUS=1737400,a.SIXTY_FOUR_KILOBYTES=65536,a.sign=function(e){return e>0?1:e<0?-1:0},a.signNotZero=function(e){return e<0?-1:1},a.toSNorm=function(e,n){return n=t(n,255),Math.round((.5*a.clamp(e,-1,1)+.5)*n)},a.fromSNorm=function(e,n){return n=t(n,255),a.clamp(e,0,n)/n*2-1},a.sinh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t-n)},a.cosh=function(e){var t=Math.pow(Math.E,e),n=Math.pow(Math.E,-1*e);return.5*(t+n)},a.lerp=function(e,t,n){return(1-n)*e+n*t},a.PI=Math.PI,a.ONE_OVER_PI=1/Math.PI,a.PI_OVER_TWO=.5*Math.PI,a.PI_OVER_THREE=Math.PI/3,a.PI_OVER_FOUR=Math.PI/4,a.PI_OVER_SIX=Math.PI/6,a.THREE_PI_OVER_TWO=3*Math.PI*.5,a.TWO_PI=2*Math.PI,a.ONE_OVER_TWO_PI=1/(2*Math.PI),a.RADIANS_PER_DEGREE=Math.PI/180,a.DEGREES_PER_RADIAN=180/Math.PI,a.RADIANS_PER_ARCSECOND=a.RADIANS_PER_DEGREE/3600,a.toRadians=function(e){return e*a.RADIANS_PER_DEGREE},a.toDegrees=function(e){return e*a.DEGREES_PER_RADIAN},a.convertLongitudeRange=function(e){var t=a.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n},a.clampToLatitudeRange=function(e){return a.clamp(e,-1*a.PI_OVER_TWO,a.PI_OVER_TWO)},a.negativePiToPi=function(e){return a.zeroToTwoPi(e+a.PI)-a.PI},a.zeroToTwoPi=function(e){var t=a.mod(e,a.TWO_PI);return Math.abs(t)<a.EPSILON14&&Math.abs(e)>a.EPSILON14?a.TWO_PI:t},a.mod=function(e,t){return(e%t+t)%t},a.equalsEpsilon=function(e,n,r,a){a=t(a,r);var i=Math.abs(e-n);return i<=a||i<=r*Math.max(Math.abs(e),Math.abs(n))};var i=[1];a.factorial=function(e){var t=i.length;if(e>=t)for(var n=i[t-1],r=t;r<=e;r++)i.push(n*r);return i[e]},a.incrementWrap=function(e,n,r){return r=t(r,0),++e,e>n&&(e=r),e},a.isPowerOfTwo=function(e){return 0!==e&&0===(e&e-1)},a.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e},a.clamp=function(e,t,n){return e<t?t:e>n?n:e};var o=new e;return a.setRandomNumberSeed=function(t){o=new e(t)},a.nextRandomNumber=function(){return o.random()},a.acosClamped=function(e){return Math.acos(a.clamp(e,-1,1))},a.asinClamped=function(e){return Math.asin(a.clamp(e,-1,1))},a.chordLength=function(e,t){return 2*t*Math.sin(.5*e)},a.logBase=function(e,t){return Math.log(e)/Math.log(t)},a.fog=function(e,t){var n=e*t;return 1-Math.exp(-(n*n))},a}),define("Core/Cartesian2",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n){this.x=t(e,0),this.y=t(n,0)}o.fromElements=function(e,t,r){return n(r)?(r.x=e,r.y=t,r):new o(e,t)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t):new o(e.x,e.y)},o.fromCartesian3=o.clone,o.fromCartesian4=o.clone,o.packedLength=2,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r]=e.y,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=2*r:t=new Array(2*r);for(var a=0;a<r;++a)o.pack(e[a],t,2*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/2:t=new Array(r/2);for(var a=0;a<r;a+=2){var i=a/2;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y)},o.minimumComponent=function(e){return Math.min(e.x,e.y)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){return o.normalize(e,c),o.normalize(t,l),i.acosClamped(o.dot(c,l))};var h=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,h);return o.abs(n,n),t=n.x<=n.y?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Y,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)},o.ZERO=a(new o(0,0)),o.UNIT_X=a(new o(1,0)),o.UNIT_Y=a(new o(0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+")"},o}),define("Core/Cartesian3",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0)}o.fromSpherical=function(e,r){n(r)||(r=new o);var a=e.clock,i=e.cone,u=t(e.magnitude,1),s=u*Math.sin(i);return r.x=s*Math.cos(a),r.y=s*Math.sin(a),r.z=u*Math.cos(i),r},o.fromElements=function(e,t,r,a){return n(a)?(a.x=e,a.y=t,a.z=r,a):new o(e,t,r)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new o(e.x,e.y,e.z)},o.fromCartesian4=o.clone,o.packedLength=3,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r]=e.z,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=3*r:t=new Array(3*r);for(var a=0;a<r;++a)o.pack(e[a],t,3*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/3:t=new Array(r/3);for(var a=0;a<r;a+=3){var i=a/3;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o,l=new o;o.angleBetween=function(e,t){o.normalize(e,c),o.normalize(t,l);var n=o.dot(c,l),r=o.magnitude(o.cross(c,l,c));return Math.atan2(r,n)};var h=new o;o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,h);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?o.clone(o.UNIT_X,t):o.clone(o.UNIT_Z,t):n.y<=n.z?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_Z,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)},o.cross=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=t.x,u=t.y,s=t.z,c=a*s-i*u,l=i*o-r*s,h=r*u-a*o;return n.x=c,n.y=l,n.z=h,n},o.fromDegrees=function(e,t,n,r,a){return e=i.toRadians(e),t=i.toRadians(t),o.fromRadians(e,t,n,r,a)};var f=new o,d=new o,E=new o(40680631590769,40680631590769,40408299984661.445);return o.fromRadians=function(e,r,a,i,u){a=t(a,0);var s=n(i)?i.radiiSquared:E,c=Math.cos(r);f.x=c*Math.cos(e),f.y=c*Math.sin(e),f.z=Math.sin(r),f=o.normalize(f,f),o.multiplyComponents(s,f,d);var l=Math.sqrt(o.dot(f,d));return d=o.divideByScalar(d,l,d),f=o.multiplyByScalar(f,a,f),n(u)||(u=new o),o.add(d,f,u)},o.fromDegreesArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromDegrees(u,s,0,t,r[c])}return r},o.fromRadiansArray=function(e,t,r){var a=e.length;n(r)?r.length=a/2:r=new Array(a/2);for(var i=0;i<a;i+=2){var u=e[i],s=e[i+1],c=i/2;r[c]=o.fromRadians(u,s,0,t,r[c])}return r},o.fromDegreesArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromDegrees(u,s,c,t,r[l])}return r},o.fromRadiansArrayHeights=function(e,t,r){var a=e.length;n(r)?r.length=a/3:r=new Array(a/3);for(var i=0;i<a;i+=3){var u=e[i],s=e[i+1],c=e[i+2],l=i/3;r[l]=o.fromRadians(u,s,c,t,r[l])}return r},o.ZERO=a(new o(0,0,0)),o.UNIT_X=a(new o(1,0,0)),o.UNIT_Y=a(new o(0,1,0)),o.UNIT_Z=a(new o(0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},o}),define("Core/AttributeCompression",["./Cartesian2","./Cartesian3","./Check","./defined","./DeveloperError","./Math"],function(e,t,n,r,a,i){"use strict";var o={};o.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){var r=n.x,a=n.y;n.x=(1-Math.abs(a))*i.signNotZero(r),n.y=(1-Math.abs(r))*i.signNotZero(a)}return n.x=i.toSNorm(n.x,t),n.y=i.toSNorm(n.y,t),n},o.octEncode=function(e,t){return o.octEncodeInRange(e,255,t)},o.octDecodeInRange=function(e,n,r,a){if(a.x=i.fromSNorm(e,r),a.y=i.fromSNorm(n,r),a.z=1-(Math.abs(a.x)+Math.abs(a.y)),a.z<0){var o=a.x;a.x=(1-Math.abs(a.y))*i.signNotZero(o),a.y=(1-Math.abs(o))*i.signNotZero(a.y)}return t.normalize(a,a)},o.octDecode=function(e,t,n){return o.octDecodeInRange(e,t,255,n)},o.octPackFloat=function(e){return 256*e.x+e.y};var u=new e;return o.octEncodeFloat=function(e){return o.octEncode(e,u),o.octPackFloat(u)},o.octDecodeFloat=function(e,t){var n=e/256,r=Math.floor(n),a=256*(n-r);return o.octDecode(r,a,t)},o.octPack=function(e,t,n,r){var a=o.octEncodeFloat(e),i=o.octEncodeFloat(t),s=o.octEncode(n,u);return r.x=65536*s.x+a,r.y=65536*s.y+i,r},o.octUnpack=function(e,t,n,r){var a=e.x/65536,i=Math.floor(a),u=65536*(a-i);a=e.y/65536;var s=Math.floor(a),c=65536*(a-s);o.octDecodeFloat(u,t),o.octDecodeFloat(c,n),o.octDecode(i,s,r)},o.compressTextureCoordinates=function(e){var t=4095*e.x|0,n=4095*e.y|0;return 4096*t+n},o.decompressTextureCoordinates=function(e,t){var n=e/4096,r=Math.floor(n);return t.x=r/4095,t.y=(e-4096*r)/4095,t},o}),define("Core/scaleToGeodeticSurface",["./Cartesian3","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(n,a,u,s,c){var l=n.x,h=n.y,f=n.z,d=a.x,E=a.y,m=a.z,p=l*l*d*d,_=h*h*E*E,T=f*f*m*m,y=p+_+T,R=Math.sqrt(1/y),A=e.multiplyByScalar(n,R,i);if(y<s)return isFinite(R)?e.clone(A,c):void 0;var S=u.x,N=u.y,M=u.z,I=o;I.x=A.x*S*2,I.y=A.y*N*2,I.z=A.z*M*2;var g,O,v,w,x,C,P,U,D,F,L,B=(1-R)*e.magnitude(n)/(.5*e.magnitude(I)),z=0;do{B-=z,v=1/(1+B*S),w=1/(1+B*N),x=1/(1+B*M),C=v*v,P=w*w,U=x*x,D=C*v,F=P*w,L=U*x,g=p*C+_*P+T*U-1,O=p*D*S+_*F*N+T*L*M;var b=-2*O;z=g/b}while(Math.abs(g)>r.EPSILON12);return t(c)?(c.x=l*v,c.y=h*w,c.z=f*x,c):new e(l*v,h*w,f*x)}var i=new e,o=new e;return a}),define("Core/Cartographic",["./Cartesian3","./Check","./defaultValue","./defined","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o){"use strict";function u(e,t,r){this.longitude=n(e,0),this.latitude=n(t,0),this.height=n(r,0)}u.fromRadians=function(e,t,a,i){return a=n(a,0),r(i)?(i.longitude=e,i.latitude=t,i.height=a,i):new u(e,t,a)},u.fromDegrees=function(e,t,n,r){return e=i.toRadians(e),t=i.toRadians(t),u.fromRadians(e,t,n,r)};var s=new e,c=new e,l=new e,h=new e(1/6378137,1/6378137,1/6356752.314245179),f=new e(1/40680631590769,1/40680631590769,1/40408299984661.445),d=i.EPSILON1;return u.fromCartesian=function(t,n,a){var E=r(n)?n.oneOverRadii:h,m=r(n)?n.oneOverRadiiSquared:f,p=r(n)?n._centerToleranceSquared:d,_=o(t,E,m,p,c);if(r(_)){var T=e.multiplyComponents(_,m,s);T=e.normalize(T,T);var y=e.subtract(t,_,l),R=Math.atan2(T.y,T.x),A=Math.asin(T.z),S=i.sign(e.dot(y,t))*e.magnitude(y);return r(a)?(a.longitude=R,a.latitude=A,a.height=S,a):new u(R,A,S)}},u.clone=function(e,t){if(r(e))return r(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new u(e.longitude,e.latitude,e.height)},u.equals=function(e,t){return e===t||r(e)&&r(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height},u.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n},u.ZERO=a(new u(0,0,0)),u.prototype.clone=function(e){return u.clone(this,e)},u.prototype.equals=function(e){return u.equals(this,e)},u.prototype.equalsEpsilon=function(e,t){return u.equalsEpsilon(this,e,t)},u.prototype.toString=function(){return"("+this.longitude+", "+this.latitude+", "+this.height+")"},u}),define("Core/defineProperties",["./defined"],function(e){"use strict";var t=function(){try{return"x"in Object.defineProperty({},"x",{})}catch(e){return!1}}(),n=Object.defineProperties;return t&&e(n)||(n=function(e){return e}),n}),define("Core/Ellipsoid",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math","./scaleToGeodeticSurface"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(t,r,a,i){r=n(r,0),a=n(a,0),i=n(i,0),t._radii=new e(r,a,i),t._radiiSquared=new e(r*r,a*a,i*i),t._radiiToTheFourth=new e(r*r*r*r,a*a*a*a,i*i*i*i),t._oneOverRadii=new e(0===r?0:1/r,0===a?0:1/a,0===i?0:1/i),t._oneOverRadiiSquared=new e(0===r?0:1/(r*r),0===a?0:1/(a*a),0===i?0:1/(i*i)),t._minimumRadius=Math.min(r,a,i),t._maximumRadius=Math.max(r,a,i),t._centerToleranceSquared=u.EPSILON1,0!==t._radiiSquared.z&&(t._sqauredXOverSquaredZ=t._radiiSquared.x/t._radiiSquared.z)}function l(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._sqauredXOverSquaredZ=void 0,c(this,e,t,n)}a(l.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}}}),l.clone=function(t,n){if(r(t)){var a=t._radii;return r(n)?(e.clone(a,n._radii),e.clone(t._radiiSquared,n._radiiSquared),e.clone(t._radiiToTheFourth,n._radiiToTheFourth),e.clone(t._oneOverRadii,n._oneOverRadii),e.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new l(a.x,a.y,a.z)}},l.fromCartesian3=function(e,t){return r(t)||(t=new l),r(e)?(c(t,e.x,e.y,e.z),t):t},l.WGS84=o(new l(6378137,6378137,6356752.314245179)),l.UNIT_SPHERE=o(new l(1,1,1)),l.MOON=o(new l(u.LUNAR_RADIUS,u.LUNAR_RADIUS,u.LUNAR_RADIUS)),l.prototype.clone=function(e){return l.clone(this,e)},l.packedLength=e.packedLength,l.pack=function(t,r,a){return a=n(a,0),e.pack(t._radii,r,a),r},l.unpack=function(t,r,a){r=n(r,0);var i=e.unpack(t,r);return l.fromCartesian3(i,a)},l.prototype.geocentricSurfaceNormal=e.normalize,l.prototype.geodeticSurfaceNormalCartographic=function(t,n){var a=t.longitude,i=t.latitude,o=Math.cos(i),u=o*Math.cos(a),s=o*Math.sin(a),c=Math.sin(i);return r(n)||(n=new e),n.x=u,n.y=s,n.z=c,e.normalize(n,n)},l.prototype.geodeticSurfaceNormal=function(t,n){return r(n)||(n=new e),n=e.multiplyComponents(t,this._oneOverRadiiSquared,n),e.normalize(n,n)};var h=new e,f=new e;l.prototype.cartographicToCartesian=function(t,n){var a=h,i=f;this.geodeticSurfaceNormalCartographic(t,a),e.multiplyComponents(this._radiiSquared,a,i);var o=Math.sqrt(e.dot(a,i));return e.divideByScalar(i,o,i),e.multiplyByScalar(a,t.height,a),r(n)||(n=new e),e.add(i,a,n)},l.prototype.cartographicArrayToCartesianArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;a++)t[a]=this.cartographicToCartesian(e[a],t[a]);return t};var d=new e,E=new e,m=new e;return l.prototype.cartesianToCartographic=function(n,a){var i=this.scaleToGeodeticSurface(n,E);if(r(i)){var o=this.geodeticSurfaceNormal(i,d),s=e.subtract(n,i,m),c=Math.atan2(o.y,o.x),l=Math.asin(o.z),h=u.sign(e.dot(s,n))*e.magnitude(s);return r(a)?(a.longitude=c,a.latitude=l,a.height=h,a):new t(c,l,h)}},l.prototype.cartesianArrayToCartographicArray=function(e,t){var n=e.length;r(t)?t.length=n:t=new Array(n);for(var a=0;a<n;++a)t[a]=this.cartesianToCartographic(e[a],t[a]);return t},l.prototype.scaleToGeodeticSurface=function(e,t){return s(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)},l.prototype.scaleToGeocentricSurface=function(t,n){r(n)||(n=new e);var a=t.x,i=t.y,o=t.z,u=this._oneOverRadiiSquared,s=1/Math.sqrt(a*a*u.x+i*i*u.y+o*o*u.z);return e.multiplyByScalar(t,s,n)},l.prototype.transformPositionToScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._oneOverRadii,n)},l.prototype.transformPositionFromScaledSpace=function(t,n){return r(n)||(n=new e),e.multiplyComponents(t,this._radii,n)},l.prototype.equals=function(t){return this===t||r(t)&&e.equals(this._radii,t._radii)},l.prototype.toString=function(){return this._radii.toString()},l.prototype.getSurfaceNormalIntersectionWithZAxis=function(t,a,i){a=n(a,0);var o=this._sqauredXOverSquaredZ;if(r(i)||(i=new e),i.x=0,i.y=0,i.z=t.z*(1-o),!(Math.abs(i.z)>=this._radii.z-a))return i},l}),define("Core/GeographicProjection",["./Cartesian3","./Cartographic","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid"],function(e,t,n,r,a,i,o){"use strict";function u(e){this._ellipsoid=n(e,o.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}return a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),u.prototype.project=function(t,n){var a=this._semimajorAxis,i=t.longitude*a,o=t.latitude*a,u=t.height;return r(n)?(n.x=i,n.y=o,n.z=u,n):new e(i,o,u)},u.prototype.unproject=function(e,n){var a=this._oneOverSemimajorAxis,i=e.x*a,o=e.y*a,u=e.z;return r(n)?(n.longitude=i,n.latitude=o,n.height=u,n):new t(i,o,u)},u}),define("Core/Intersect",["./freezeObject"],function(e){"use strict";var t={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};return e(t)}),define("Core/Interval",["./defaultValue"],function(e){"use strict";function t(t,n){this.start=e(t,0),this.stop=e(n,0)}return t}),define("Core/Matrix3",["./Cartesian3","./Check","./defaultValue","./defined","./defineProperties","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a,i,o,u,s,c){this[0]=n(e,0),this[1]=n(a,0),this[2]=n(u,0),this[3]=n(t,0),this[4]=n(i,0),this[5]=n(s,0),this[6]=n(r,0),this[7]=n(o,0),this[8]=n(c,0)}function c(e){for(var t=0,n=0;n<9;++n){var r=e[n];t+=r*r}return Math.sqrt(t)}function l(e){for(var t=0,n=0;n<3;++n){var r=e[s.getElementIndex(m[n],E[n])];t+=2*r*r}return Math.sqrt(t)}function h(e,t){for(var n=u.EPSILON15,r=0,a=1,i=0;i<3;++i){var o=Math.abs(e[s.getElementIndex(m[i],E[i])]);o>r&&(a=i,r=o)}var c=1,l=0,h=E[a],f=m[a];if(Math.abs(e[s.getElementIndex(f,h)])>n){var d,p=e[s.getElementIndex(f,f)],_=e[s.getElementIndex(h,h)],T=e[s.getElementIndex(f,h)],y=(p-_)/2/T;d=y<0?-1/(-y+Math.sqrt(1+y*y)):1/(y+Math.sqrt(1+y*y)),c=1/Math.sqrt(1+d*d),l=d*c}return t=s.clone(s.IDENTITY,t),t[s.getElementIndex(h,h)]=t[s.getElementIndex(f,f)]=c,t[s.getElementIndex(f,h)]=l,t[s.getElementIndex(h,f)]=-l,t}s.packedLength=9,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e[0],t[r++]=e[1],t[r++]=e[2],t[r++]=e[3],t[r++]=e[4],t[r++]=e[5],t[r++]=e[6],t[r++]=e[7],t[r++]=e[8],t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t++],a[1]=e[t++],a[2]=e[t++],a[3]=e[t++],a[4]=e[t++],a[5]=e[t++],a[6]=e[t++],a[7]=e[t++],a[8]=e[t++],a},s.clone=function(e,t){if(r(e))return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new s(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])},s.fromArray=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],a[8]=e[t+8],a},s.fromColumnMajorArray=function(e,t){return s.clone(e,t)},s.fromRowMajorArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new s(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},s.fromQuaternion=function(e,t){var n=e.x*e.x,a=e.x*e.y,i=e.x*e.z,o=e.x*e.w,u=e.y*e.y,c=e.y*e.z,l=e.y*e.w,h=e.z*e.z,f=e.z*e.w,d=e.w*e.w,E=n-u-h+d,m=2*(a-f),p=2*(i+l),_=2*(a+f),T=-n+u-h+d,y=2*(c-o),R=2*(i-l),A=2*(c+o),S=-n-u+h+d;return r(t)?(t[0]=E,t[1]=_,t[2]=R,t[3]=m,t[4]=T,t[5]=A,t[6]=p,t[7]=y,t[8]=S,t):new s(E,m,p,_,T,y,R,A,S)},s.fromHeadingPitchRoll=function(e,t){var n=Math.cos(-e.pitch),a=Math.cos(-e.heading),i=Math.cos(e.roll),o=Math.sin(-e.pitch),u=Math.sin(-e.heading),c=Math.sin(e.roll),l=n*a,h=-i*u+c*o*a,f=c*u+i*o*a,d=n*u,E=i*a+c*o*u,m=-c*a+i*o*u,p=-o,_=c*n,T=i*n;return r(t)?(t[0]=l,t[1]=d,t[2]=p,t[3]=h,t[4]=E,t[5]=_,t[6]=f,t[7]=m,t[8]=T,t):new s(l,h,f,d,E,m,p,_,T)},s.fromScale=function(e,t){return r(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new s(e.x,0,0,0,e.y,0,0,0,e.z)},s.fromUniformScale=function(e,t){return r(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new s(e,0,0,0,e,0,0,0,e)},s.fromCrossProduct=function(e,t){return r(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new s(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)},s.fromRotationX=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=a,t[6]=0,t[7]=-a,t[8]=n,t):new s(1,0,0,0,n,-a,0,a,n)},s.fromRotationY=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=0,t[2]=-a,t[3]=0,t[4]=1,t[5]=0,t[6]=a,t[7]=0,t[8]=n,t):new s(n,0,a,0,1,0,-a,0,n)},s.fromRotationZ=function(e,t){var n=Math.cos(e),a=Math.sin(e);return r(t)?(t[0]=n,t[1]=a,t[2]=0,t[3]=-a,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new s(n,-a,0,a,n,0,0,0,1)},s.toArray=function(e,t){return r(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]},s.getElementIndex=function(e,t){return 3*e+t},s.getColumn=function(e,t,n){var r=3*t,a=e[r],i=e[r+1],o=e[r+2];return n.x=a,n.y=i,n.z=o,n},s.setColumn=function(e,t,n,r){r=s.clone(e,r);var a=3*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r},s.getRow=function(e,t,n){var r=e[t],a=e[t+3],i=e[t+6];return n.x=r,n.y=a,n.z=i,n},s.setRow=function(e,t,n,r){return r=s.clone(e,r),r[t]=n.x,r[t+3]=n.y,r[t+6]=n.z,r};var f=new e;s.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],f)),n.y=e.magnitude(e.fromElements(t[3],t[4],t[5],f)),n.z=e.magnitude(e.fromElements(t[6],t[7],t[8],f)),n};var d=new e;s.getMaximumScale=function(t){return s.getScale(t,d),e.maximumComponent(d)},s.multiply=function(e,t,n){var r=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],a=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],i=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],o=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],u=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],s=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],c=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],l=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=r,n[1]=a,n[2]=i,n[3]=o,n[4]=u,n[5]=s,n[6]=c,n[7]=l,n[8]=h,n},s.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n},s.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n},s.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[3]*a+e[6]*i,u=e[1]*r+e[4]*a+e[7]*i,s=e[2]*r+e[5]*a+e[8]*i;return n.x=o,n.y=u,n.z=s,n},s.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n},s.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n},s.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t},s.transpose=function(e,t){var n=e[0],r=e[3],a=e[6],i=e[1],o=e[4],u=e[7],s=e[2],c=e[5],l=e[8];return t[0]=n,t[1]=r,t[2]=a,t[3]=i,t[4]=o,t[5]=u,t[6]=s,t[7]=c,t[8]=l,t};var E=[1,0,0],m=[2,2,1],p=new s,_=new s;return s.computeEigenDecomposition=function(e,t){var n=u.EPSILON20,a=10,i=0,o=0;r(t)||(t={});for(var f=t.unitary=s.clone(s.IDENTITY,t.unitary),d=t.diagonal=s.clone(e,t.diagonal),E=n*c(d);o<a&&l(d)>E;)h(d,p),s.transpose(p,_),s.multiply(d,p,d),s.multiply(_,d,d),s.multiply(f,p,f),++i>2&&(++o,i=0);return t},s.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},s.determinant=function(e){var t=e[0],n=e[3],r=e[6],a=e[1],i=e[4],o=e[7],u=e[2],s=e[5],c=e[8];return t*(i*c-s*o)+a*(s*r-n*c)+u*(n*o-i*r)},s.inverse=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[3],o=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=s.determinant(e);t[0]=o*h-l*u,t[1]=l*a-r*h,t[2]=r*u-o*a,t[3]=c*u-i*h,t[4]=n*h-c*a,t[5]=i*a-n*u,t[6]=i*l-c*o,t[7]=c*r-n*l,t[8]=n*o-i*r;var d=1/f;return s.multiplyByScalar(t,d,t)},s.equals=function(e,t){return e===t||r(e)&&r(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]},s.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n},s.IDENTITY=o(new s(1,0,0,0,1,0,0,0,1)),s.ZERO=o(new s(0,0,0,0,0,0,0,0,0)),s.COLUMN0ROW0=0,s.COLUMN0ROW1=1,s.COLUMN0ROW2=2,s.COLUMN1ROW0=3,s.COLUMN1ROW1=4,s.COLUMN1ROW2=5,s.COLUMN2ROW0=6,s.COLUMN2ROW1=7,s.COLUMN2ROW2=8,a(s.prototype,{length:{get:function(){return s.packedLength}}}),s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]; +},s.prototype.equalsEpsilon=function(e,t){return s.equalsEpsilon(this,e,t)},s.prototype.toString=function(){return"("+this[0]+", "+this[3]+", "+this[6]+")\n("+this[1]+", "+this[4]+", "+this[7]+")\n("+this[2]+", "+this[5]+", "+this[8]+")"},s}),define("Core/Cartesian4",["./Check","./defaultValue","./defined","./DeveloperError","./freezeObject","./Math"],function(e,t,n,r,a,i){"use strict";function o(e,n,r,a){this.x=t(e,0),this.y=t(n,0),this.z=t(r,0),this.w=t(a,0)}o.fromElements=function(e,t,r,a,i){return n(i)?(i.x=e,i.y=t,i.z=r,i.w=a,i):new o(e,t,r,a)},o.fromColor=function(e,t){return n(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new o(e.red,e.green,e.blue,e.alpha)},o.clone=function(e,t){if(n(e))return n(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new o(e.x,e.y,e.z,e.w)},o.packedLength=4,o.pack=function(e,n,r){return r=t(r,0),n[r++]=e.x,n[r++]=e.y,n[r++]=e.z,n[r]=e.w,n},o.unpack=function(e,r,a){return r=t(r,0),n(a)||(a=new o),a.x=e[r++],a.y=e[r++],a.z=e[r++],a.w=e[r],a},o.packArray=function(e,t){var r=e.length;n(t)?t.length=4*r:t=new Array(4*r);for(var a=0;a<r;++a)o.pack(e[a],t,4*a);return t},o.unpackArray=function(e,t){var r=e.length;n(t)?t.length=r/4:t=new Array(r/4);for(var a=0;a<r;a+=4){var i=a/4;t[i]=o.unpack(e,a,t[i])}return t},o.fromArray=o.unpack,o.maximumComponent=function(e){return Math.max(e.x,e.y,e.z,e.w)},o.minimumComponent=function(e){return Math.min(e.x,e.y,e.z,e.w)},o.minimumByComponent=function(e,t,n){return n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n},o.maximumByComponent=function(e,t,n){return n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n},o.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},o.magnitude=function(e){return Math.sqrt(o.magnitudeSquared(e))};var u=new o;o.distance=function(e,t){return o.subtract(e,t,u),o.magnitude(u)},o.distanceSquared=function(e,t){return o.subtract(e,t,u),o.magnitudeSquared(u)},o.normalize=function(e,t){var n=o.magnitude(e);return t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,t},o.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},o.multiplyComponents=function(e,t,n){return n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n},o.divideComponents=function(e,t,n){return n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n},o.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},o.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},o.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},o.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},o.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},o.abs=function(e,t){return t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var s=new o;o.lerp=function(e,t,n,r){return o.multiplyByScalar(t,n,s),r=o.multiplyByScalar(e,1-n,r),o.add(s,r,r)};var c=new o;return o.mostOrthogonalAxis=function(e,t){var n=o.normalize(e,c);return o.abs(n,n),t=n.x<=n.y?n.x<=n.z?n.x<=n.w?o.clone(o.UNIT_X,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t):n.y<=n.z?n.y<=n.w?o.clone(o.UNIT_Y,t):o.clone(o.UNIT_W,t):n.z<=n.w?o.clone(o.UNIT_Z,t):o.clone(o.UNIT_W,t)},o.equals=function(e,t){return e===t||n(e)&&n(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},o.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]},o.equalsEpsilon=function(e,t,r,a){return e===t||n(e)&&n(t)&&i.equalsEpsilon(e.x,t.x,r,a)&&i.equalsEpsilon(e.y,t.y,r,a)&&i.equalsEpsilon(e.z,t.z,r,a)&&i.equalsEpsilon(e.w,t.w,r,a)},o.ZERO=a(new o(0,0,0,0)),o.UNIT_X=a(new o(1,0,0,0)),o.UNIT_Y=a(new o(0,1,0,0)),o.UNIT_Z=a(new o(0,0,1,0)),o.UNIT_W=a(new o(0,0,0,1)),o.prototype.clone=function(e){return o.clone(this,e)},o.prototype.equals=function(e){return o.equals(this,e)},o.prototype.equalsEpsilon=function(e,t,n){return o.equalsEpsilon(this,e,t,n)},o.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},o}),define("Core/RuntimeError",["./defined"],function(e){"use strict";function t(e){this.name="RuntimeError",this.message=e;var t;try{throw new Error}catch(e){t=e.stack}this.stack=t}return e(Object.create)&&(t.prototype=Object.create(Error.prototype),t.prototype.constructor=t),t.prototype.toString=function(){var t=this.name+": "+this.message;return e(this.stack)&&(t+="\n"+this.stack.toString()),t},t}),define("Core/Matrix4",["./Cartesian3","./Cartesian4","./Check","./defaultValue","./defined","./defineProperties","./freezeObject","./Math","./Matrix3","./RuntimeError"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,n,a,i,o,u,s,c,l,h,f,d,E,m,p){this[0]=r(e,0),this[1]=r(i,0),this[2]=r(c,0),this[3]=r(d,0),this[4]=r(t,0),this[5]=r(o,0),this[6]=r(l,0),this[7]=r(E,0),this[8]=r(n,0),this[9]=r(u,0),this[10]=r(h,0),this[11]=r(m,0),this[12]=r(a,0),this[13]=r(s,0),this[14]=r(f,0),this[15]=r(p,0)}l.packedLength=16,l.pack=function(e,t,n){return n=r(n,0),t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t},l.unpack=function(e,t,n){return t=r(t,0),a(n)||(n=new l),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n},l.clone=function(e,t){if(a(e))return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new l(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])},l.fromArray=l.unpack,l.fromColumnMajorArray=function(e,t){return l.clone(e,t)},l.fromRowMajorArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new l(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},l.fromRotationTranslation=function(t,n,i){return n=r(n,e.ZERO),a(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new l(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)},l.fromTranslationQuaternionRotationScale=function(e,t,n,r){a(r)||(r=new l);var i=n.x,o=n.y,u=n.z,s=t.x*t.x,c=t.x*t.y,h=t.x*t.z,f=t.x*t.w,d=t.y*t.y,E=t.y*t.z,m=t.y*t.w,p=t.z*t.z,_=t.z*t.w,T=t.w*t.w,y=s-d-p+T,R=2*(c-_),A=2*(h+m),S=2*(c+_),N=-s+d-p+T,M=2*(E-f),I=2*(h-m),g=2*(E+f),O=-s-d+p+T;return r[0]=y*i,r[1]=S*i,r[2]=I*i,r[3]=0,r[4]=R*o,r[5]=N*o,r[6]=g*o,r[7]=0,r[8]=A*u,r[9]=M*u,r[10]=O*u,r[11]=0,r[12]=e.x,r[13]=e.y,r[14]=e.z,r[15]=1,r},l.fromTranslationRotationScale=function(e,t){return l.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)},l.fromTranslation=function(e,t){return l.fromRotationTranslation(s.IDENTITY,e,t)},l.fromScale=function(e,t){return a(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)},l.fromUniformScale=function(e,t){return a(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new l(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};var h=new e,f=new e,d=new e;l.fromCamera=function(t,n){var r=t.position,i=t.direction,o=t.up;e.normalize(i,h),e.normalize(e.cross(h,o,f),f),e.normalize(e.cross(f,h,d),d);var u=f.x,s=f.y,c=f.z,E=h.x,m=h.y,p=h.z,_=d.x,T=d.y,y=d.z,R=r.x,A=r.y,S=r.z,N=u*-R+s*-A+c*-S,M=_*-R+T*-A+y*-S,I=E*R+m*A+p*S;return a(n)?(n[0]=u,n[1]=_,n[2]=-E,n[3]=0,n[4]=s,n[5]=T,n[6]=-m,n[7]=0,n[8]=c,n[9]=y,n[10]=-p,n[11]=0,n[12]=N,n[13]=M,n[14]=I,n[15]=1,n):new l(u,s,c,N,_,T,y,M,-E,-m,-p,I,0,0,0,1)},l.computePerspectiveFieldOfView=function(e,t,n,r,a){var i=Math.tan(.5*e),o=1/i,u=o/t,s=(r+n)/(n-r),c=2*r*n/(n-r);return a[0]=u,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=o,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=s,a[11]=-1,a[12]=0,a[13]=0,a[14]=c,a[15]=0,a},l.computeOrthographicOffCenter=function(e,t,n,r,a,i,o){var u=1/(t-e),s=1/(r-n),c=1/(i-a),l=-(t+e)*u,h=-(r+n)*s,f=-(i+a)*c;return u*=2,s*=2,c*=-2,o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=0,o[12]=l,o[13]=h,o[14]=f,o[15]=1,o},l.computePerspectiveOffCenter=function(e,t,n,r,a,i,o){var u=2*a/(t-e),s=2*a/(r-n),c=(t+e)/(t-e),l=(r+n)/(r-n),h=-(i+a)/(i-a),f=-1,d=-2*i*a/(i-a);return o[0]=u,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=c,o[9]=l,o[10]=h,o[11]=f,o[12]=0,o[13]=0,o[14]=d,o[15]=0,o},l.computeInfinitePerspectiveOffCenter=function(e,t,n,r,a,i){var o=2*a/(t-e),u=2*a/(r-n),s=(t+e)/(t-e),c=(r+n)/(r-n),l=-1,h=-1,f=-2*a;return i[0]=o,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=u,i[6]=0,i[7]=0,i[8]=s,i[9]=c,i[10]=l,i[11]=h,i[12]=0,i[13]=0,i[14]=f,i[15]=0,i},l.computeViewportTransformation=function(e,t,n,a){e=r(e,r.EMPTY_OBJECT);var i=r(e.x,0),o=r(e.y,0),u=r(e.width,0),s=r(e.height,0);t=r(t,0),n=r(n,1);var c=.5*u,l=.5*s,h=.5*(n-t),f=c,d=l,E=h,m=i+c,p=o+l,_=t+h,T=1;return a[0]=f,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=d,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=E,a[11]=0,a[12]=m,a[13]=p,a[14]=_,a[15]=T,a},l.computeView=function(t,n,r,a,i){return i[0]=a.x,i[1]=r.x,i[2]=-n.x,i[3]=0,i[4]=a.y,i[5]=r.y,i[6]=-n.y,i[7]=0,i[8]=a.z,i[9]=r.z,i[10]=-n.z,i[11]=0,i[12]=-e.dot(a,t),i[13]=-e.dot(r,t),i[14]=e.dot(n,t),i[15]=1,i},l.toArray=function(e,t){return a(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]},l.getElementIndex=function(e,t){return 4*e+t},l.getColumn=function(e,t,n){var r=4*t,a=e[r],i=e[r+1],o=e[r+2],u=e[r+3];return n.x=a,n.y=i,n.z=o,n.w=u,n},l.setColumn=function(e,t,n,r){r=l.clone(e,r);var a=4*t;return r[a]=n.x,r[a+1]=n.y,r[a+2]=n.z,r[a+3]=n.w,r},l.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n},l.getRow=function(e,t,n){var r=e[t],a=e[t+4],i=e[t+8],o=e[t+12];return n.x=r,n.y=a,n.z=i,n.w=o,n},l.setRow=function(e,t,n,r){return r=l.clone(e,r),r[t]=n.x,r[t+4]=n.y,r[t+8]=n.z,r[t+12]=n.w,r};var E=new e;l.getScale=function(t,n){return n.x=e.magnitude(e.fromElements(t[0],t[1],t[2],E)),n.y=e.magnitude(e.fromElements(t[4],t[5],t[6],E)),n.z=e.magnitude(e.fromElements(t[8],t[9],t[10],E)),n};var m=new e;l.getMaximumScale=function(t){return l.getScale(t,m),e.maximumComponent(m)},l.multiply=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[3],u=e[4],s=e[5],c=e[6],l=e[7],h=e[8],f=e[9],d=e[10],E=e[11],m=e[12],p=e[13],_=e[14],T=e[15],y=t[0],R=t[1],A=t[2],S=t[3],N=t[4],M=t[5],I=t[6],g=t[7],O=t[8],v=t[9],w=t[10],x=t[11],C=t[12],P=t[13],U=t[14],D=t[15],F=r*y+u*R+h*A+m*S,L=a*y+s*R+f*A+p*S,B=i*y+c*R+d*A+_*S,z=o*y+l*R+E*A+T*S,b=r*N+u*M+h*I+m*g,q=a*N+s*M+f*I+p*g,G=i*N+c*M+d*I+_*g,W=o*N+l*M+E*I+T*g,X=r*O+u*v+h*w+m*x,V=a*O+s*v+f*w+p*x,H=i*O+c*v+d*w+_*x,Y=o*O+l*v+E*w+T*x,k=r*C+u*P+h*U+m*D,Z=a*C+s*P+f*U+p*D,j=i*C+c*P+d*U+_*D,K=o*C+l*P+E*U+T*D;return n[0]=F,n[1]=L,n[2]=B,n[3]=z,n[4]=b,n[5]=q,n[6]=G,n[7]=W,n[8]=X,n[9]=V,n[10]=H,n[11]=Y,n[12]=k,n[13]=Z,n[14]=j,n[15]=K,n},l.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n},l.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n},l.multiplyTransformation=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],h=e[10],f=e[12],d=e[13],E=e[14],m=t[0],p=t[1],_=t[2],T=t[4],y=t[5],R=t[6],A=t[8],S=t[9],N=t[10],M=t[12],I=t[13],g=t[14],O=r*m+o*p+c*_,v=a*m+u*p+l*_,w=i*m+s*p+h*_,x=r*T+o*y+c*R,C=a*T+u*y+l*R,P=i*T+s*y+h*R,U=r*A+o*S+c*N,D=a*A+u*S+l*N,F=i*A+s*S+h*N,L=r*M+o*I+c*g+f,B=a*M+u*I+l*g+d,z=i*M+s*I+h*g+E;return n[0]=O,n[1]=v,n[2]=w,n[3]=0,n[4]=x,n[5]=C,n[6]=P,n[7]=0,n[8]=U,n[9]=D,n[10]=F,n[11]=0,n[12]=L,n[13]=B,n[14]=z,n[15]=1,n},l.multiplyByMatrix3=function(e,t,n){var r=e[0],a=e[1],i=e[2],o=e[4],u=e[5],s=e[6],c=e[8],l=e[9],h=e[10],f=t[0],d=t[1],E=t[2],m=t[3],p=t[4],_=t[5],T=t[6],y=t[7],R=t[8],A=r*f+o*d+c*E,S=a*f+u*d+l*E,N=i*f+s*d+h*E,M=r*m+o*p+c*_,I=a*m+u*p+l*_,g=i*m+s*p+h*_,O=r*T+o*y+c*R,v=a*T+u*y+l*R,w=i*T+s*y+h*R;return n[0]=A,n[1]=S,n[2]=N,n[3]=0,n[4]=M,n[5]=I,n[6]=g,n[7]=0,n[8]=O,n[9]=v,n[10]=w,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n},l.multiplyByTranslation=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=r*e[0]+a*e[4]+i*e[8]+e[12],u=r*e[1]+a*e[5]+i*e[9]+e[13],s=r*e[2]+a*e[6]+i*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=o,n[13]=u,n[14]=s,n[15]=e[15],n};var p=new e;l.multiplyByUniformScale=function(e,t,n){return p.x=t,p.y=t,p.z=t,l.multiplyByScale(e,p,n)},l.multiplyByScale=function(e,t,n){var r=t.x,a=t.y,i=t.z;return 1===r&&1===a&&1===i?l.clone(e,n):(n[0]=r*e[0],n[1]=r*e[1],n[2]=r*e[2],n[3]=0,n[4]=a*e[4],n[5]=a*e[5],n[6]=a*e[6],n[7]=0,n[8]=i*e[8],n[9]=i*e[9],n[10]=i*e[10],n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=1,n)},l.multiplyByVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=t.w,u=e[0]*r+e[4]*a+e[8]*i+e[12]*o,s=e[1]*r+e[5]*a+e[9]*i+e[13]*o,c=e[2]*r+e[6]*a+e[10]*i+e[14]*o,l=e[3]*r+e[7]*a+e[11]*i+e[15]*o;return n.x=u,n.y=s,n.z=c,n.w=l,n},l.multiplyByPointAsVector=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i,u=e[1]*r+e[5]*a+e[9]*i,s=e[2]*r+e[6]*a+e[10]*i;return n.x=o,n.y=u,n.z=s,n},l.multiplyByPoint=function(e,t,n){var r=t.x,a=t.y,i=t.z,o=e[0]*r+e[4]*a+e[8]*i+e[12],u=e[1]*r+e[5]*a+e[9]*i+e[13],s=e[2]*r+e[6]*a+e[10]*i+e[14];return n.x=o,n.y=u,n.z=s,n},l.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n},l.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t},l.transpose=function(e,t){var n=e[1],r=e[2],a=e[3],i=e[6],o=e[7],u=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=i,t[10]=e[10],t[11]=e[14],t[12]=a,t[13]=o,t[14]=u,t[15]=e[15],t},l.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t},l.equals=function(e,t){return e===t||a(e)&&a(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]},l.equalsEpsilon=function(e,t,n){return e===t||a(e)&&a(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n},l.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t},l.getRotation=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var _=new s,T=new s,y=new t,R=new t(0,0,0,1);return l.inverse=function(e,n){if(s.equalsEpsilon(l.getRotation(e,_),T,u.EPSILON7)&&t.equals(l.getRow(e,3,y),R))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-e[12],n[13]=-e[13],n[14]=-e[14],n[15]=1,n;var r=e[0],a=e[4],i=e[8],o=e[12],h=e[1],f=e[5],d=e[9],E=e[13],m=e[2],p=e[6],A=e[10],S=e[14],N=e[3],M=e[7],I=e[11],g=e[15],O=A*g,v=S*I,w=p*g,x=S*M,C=p*I,P=A*M,U=m*g,D=S*N,F=m*I,L=A*N,B=m*M,z=p*N,b=O*f+x*d+C*E-(v*f+w*d+P*E),q=v*h+U*d+L*E-(O*h+D*d+F*E),G=w*h+D*f+B*E-(x*h+U*f+z*E),W=P*h+F*f+z*d-(C*h+L*f+B*d),X=v*a+w*i+P*o-(O*a+x*i+C*o),V=O*r+D*i+F*o-(v*r+U*i+L*o),H=x*r+U*a+z*o-(w*r+D*a+B*o),Y=C*r+L*a+B*i-(P*r+F*a+z*i);O=i*E,v=o*d,w=a*E,x=o*f,C=a*d,P=i*f,U=r*E,D=o*h,F=r*d,L=i*h,B=r*f,z=a*h;var k=O*M+x*I+C*g-(v*M+w*I+P*g),Z=v*N+U*I+L*g-(O*N+D*I+F*g),j=w*N+D*M+B*g-(x*N+U*M+z*g),K=P*N+F*M+z*I-(C*N+L*M+B*I),Q=w*A+P*S+v*p-(C*S+O*p+x*A),J=F*S+O*m+D*A-(U*A+L*S+v*m),$=U*p+z*S+x*m-(B*S+w*m+D*p),ee=B*A+C*m+L*p-(F*p+z*A+P*m),te=r*b+a*q+i*G+o*W;if(Math.abs(te)<u.EPSILON20)throw new c("matrix is not invertible because its determinate is zero.");return te=1/te,n[0]=b*te,n[1]=q*te,n[2]=G*te,n[3]=W*te,n[4]=X*te,n[5]=V*te,n[6]=H*te,n[7]=Y*te,n[8]=k*te,n[9]=Z*te,n[10]=j*te,n[11]=K*te,n[12]=Q*te,n[13]=J*te,n[14]=$*te,n[15]=ee*te,n},l.inverseTransformation=function(e,t){var n=e[0],r=e[1],a=e[2],i=e[4],o=e[5],u=e[6],s=e[8],c=e[9],l=e[10],h=e[12],f=e[13],d=e[14],E=-n*h-r*f-a*d,m=-i*h-o*f-u*d,p=-s*h-c*f-l*d;return t[0]=n,t[1]=i,t[2]=s,t[3]=0,t[4]=r,t[5]=o,t[6]=c,t[7]=0,t[8]=a,t[9]=u,t[10]=l,t[11]=0,t[12]=E,t[13]=m,t[14]=p,t[15]=1,t},l.IDENTITY=o(new l(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)),l.ZERO=o(new l(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)),l.COLUMN0ROW0=0,l.COLUMN0ROW1=1,l.COLUMN0ROW2=2,l.COLUMN0ROW3=3,l.COLUMN1ROW0=4,l.COLUMN1ROW1=5,l.COLUMN1ROW2=6,l.COLUMN1ROW3=7,l.COLUMN2ROW0=8,l.COLUMN2ROW1=9,l.COLUMN2ROW2=10,l.COLUMN2ROW3=11,l.COLUMN3ROW0=12,l.COLUMN3ROW1=13,l.COLUMN3ROW2=14,l.COLUMN3ROW3=15,i(l.prototype,{length:{get:function(){return l.packedLength}}}),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this[0]+", "+this[4]+", "+this[8]+", "+this[12]+")\n("+this[1]+", "+this[5]+", "+this[9]+", "+this[13]+")\n("+this[2]+", "+this[6]+", "+this[10]+", "+this[14]+")\n("+this[3]+", "+this[7]+", "+this[11]+", "+this[15]+")"},l}),define("Core/Rectangle",["./Cartographic","./Check","./defaultValue","./defined","./defineProperties","./Ellipsoid","./freezeObject","./Math"],function(e,t,n,r,a,i,o,u){"use strict";function s(e,t,r,a){this.west=n(e,0),this.south=n(t,0),this.east=n(r,0),this.north=n(a,0)}a(s.prototype,{width:{get:function(){return s.computeWidth(this)}},height:{get:function(){return s.computeHeight(this)}}}),s.packedLength=4,s.pack=function(e,t,r){return r=n(r,0),t[r++]=e.west,t[r++]=e.south,t[r++]=e.east,t[r]=e.north,t},s.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new s),a.west=e[t++],a.south=e[t++],a.east=e[t++],a.north=e[t],a},s.computeWidth=function(e){var t=e.east,n=e.west;return t<n&&(t+=u.TWO_PI),t-n},s.computeHeight=function(e){return e.north-e.south},s.fromDegrees=function(e,t,a,i,o){return e=u.toRadians(n(e,0)),t=u.toRadians(n(t,0)),a=u.toRadians(n(a,0)),i=u.toRadians(n(i,0)),r(o)?(o.west=e,o.south=t,o.east=a,o.north=i,o):new s(e,t,a,i)},s.fromRadians=function(e,t,a,i,o){return r(o)?(o.west=n(e,0),o.south=n(t,0),o.east=n(a,0),o.north=n(i,0),o):new s(e,t,a,i)},s.fromCartographicArray=function(e,t){for(var n=Number.MAX_VALUE,a=-Number.MAX_VALUE,i=Number.MAX_VALUE,o=-Number.MAX_VALUE,c=Number.MAX_VALUE,l=-Number.MAX_VALUE,h=0,f=e.length;h<f;h++){var d=e[h];n=Math.min(n,d.longitude),a=Math.max(a,d.longitude),c=Math.min(c,d.latitude),l=Math.max(l,d.latitude);var E=d.longitude>=0?d.longitude:d.longitude+u.TWO_PI;i=Math.min(i,E),o=Math.max(o,E)}return a-n>o-i&&(n=i,a=o,a>u.PI&&(a-=u.TWO_PI),n>u.PI&&(n-=u.TWO_PI)),r(t)?(t.west=n,t.south=c,t.east=a,t.north=l,t):new s(n,c,a,l)},s.fromCartesianArray=function(e,t,n){for(var a=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,c=-Number.MAX_VALUE,l=Number.MAX_VALUE,h=-Number.MAX_VALUE,f=0,d=e.length;f<d;f++){var E=t.cartesianToCartographic(e[f]);a=Math.min(a,E.longitude),i=Math.max(i,E.longitude),l=Math.min(l,E.latitude),h=Math.max(h,E.latitude);var m=E.longitude>=0?E.longitude:E.longitude+u.TWO_PI;o=Math.min(o,m),c=Math.max(c,m)}return i-a>c-o&&(a=o,i=c,i>u.PI&&(i-=u.TWO_PI),a>u.PI&&(a-=u.TWO_PI)),r(n)?(n.west=a,n.south=l,n.east=i,n.north=h,n):new s(a,l,i,h)},s.clone=function(e,t){if(r(e))return r(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new s(e.west,e.south,e.east,e.north)},s.prototype.clone=function(e){return s.clone(this,e)},s.prototype.equals=function(e){return s.equals(this,e)},s.equals=function(e,t){return e===t||r(e)&&r(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north},s.prototype.equalsEpsilon=function(e,t){return r(e)&&Math.abs(this.west-e.west)<=t&&Math.abs(this.south-e.south)<=t&&Math.abs(this.east-e.east)<=t&&Math.abs(this.north-e.north)<=t},s.validate=function(e){},s.southwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new e(t.west,t.south)},s.northwest=function(t,n){return r(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new e(t.west,t.north)},s.northeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new e(t.east,t.north)},s.southeast=function(t,n){return r(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new e(t.east,t.south)},s.center=function(t,n){var a=t.east,i=t.west;a<i&&(a+=u.TWO_PI);var o=u.negativePiToPi(.5*(i+a)),s=.5*(t.south+t.north);return r(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new e(o,s)},s.intersection=function(e,t,n){var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.negativePiToPi(Math.max(i,c)),h=u.negativePiToPi(Math.min(a,o));if(!((e.west<e.east||t.west<t.east)&&h<=l)){var f=Math.max(e.south,t.south),d=Math.min(e.north,t.north);if(!(f>=d))return r(n)?(n.west=l,n.south=f,n.east=h,n.north=d,n):new s(l,f,h,d)}},s.simpleIntersection=function(e,t,n){var a=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),u=Math.min(e.north,t.north);if(!(i>=u||a>=o))return r(n)?(n.west=a,n.south=i,n.east=o,n.north=u,n):new s(a,i,o,u)},s.union=function(e,t,n){r(n)||(n=new s);var a=e.east,i=e.west,o=t.east,c=t.west;a<i&&o>0?a+=u.TWO_PI:o<c&&a>0&&(o+=u.TWO_PI),a<i&&c<0?c+=u.TWO_PI:o<c&&i<0&&(i+=u.TWO_PI);var l=u.convertLongitudeRange(Math.min(i,c)),h=u.convertLongitudeRange(Math.max(a,o));return n.west=l,n.south=Math.min(e.south,t.south),n.east=h,n.north=Math.max(e.north,t.north),n},s.expand=function(e,t,n){return r(n)||(n=new s),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n},s.contains=function(e,t){var n=t.longitude,r=t.latitude,a=e.west,i=e.east;return i<a&&(i+=u.TWO_PI,n<0&&(n+=u.TWO_PI)),(n>a||u.equalsEpsilon(n,a,u.EPSILON14))&&(n<i||u.equalsEpsilon(n,i,u.EPSILON14))&&r>=e.south&&r<=e.north};var c=new e;return s.subsample=function(e,t,a,o){t=n(t,i.WGS84),a=n(a,0),r(o)||(o=[]);var l=0,h=e.north,f=e.south,d=e.east,E=e.west,m=c;m.height=a,m.longitude=E,m.latitude=h,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.latitude=f,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,h<0?m.latitude=h:f>0?m.latitude=f:m.latitude=0;for(var p=1;p<8;++p)m.longitude=-Math.PI+p*u.PI_OVER_TWO,s.contains(e,m)&&(o[l]=t.cartographicToCartesian(m,o[l]),l++);return 0===m.latitude&&(m.longitude=E,o[l]=t.cartographicToCartesian(m,o[l]),l++,m.longitude=d,o[l]=t.cartographicToCartesian(m,o[l]),l++),o.length=l,o},s.MAX_VALUE=o(new s(-Math.PI,-u.PI_OVER_TWO,Math.PI,u.PI_OVER_TWO)),s}),define("Core/BoundingSphere",["./Cartesian3","./Cartographic","./Check","./defaultValue","./defined","./Ellipsoid","./GeographicProjection","./Intersect","./Interval","./Matrix3","./Matrix4","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,h){"use strict";function f(t,n){this.center=e.clone(r(t,e.ZERO)),this.radius=r(n,0)}var d=new e,E=new e,m=new e,p=new e,_=new e,T=new e,y=new e,R=new e,A=new e,S=new e,N=new e,M=new e;f.fromPoints=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;for(var r=e.clone(t[0],y),i=e.clone(r,d),o=e.clone(r,E),u=e.clone(r,m),s=e.clone(r,p),c=e.clone(r,_),l=e.clone(r,T),h=t.length,I=1;I<h;I++){e.clone(t[I],r);var g=r.x,O=r.y,v=r.z;g<i.x&&e.clone(r,i),g>s.x&&e.clone(r,s),O<o.y&&e.clone(r,o),O>c.y&&e.clone(r,c),v<u.z&&e.clone(r,u),v>l.z&&e.clone(r,l)}var w=e.magnitudeSquared(e.subtract(s,i,R)),x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=i,U=s,D=w;x>D&&(D=x,P=o,U=c),C>D&&(D=C,P=u,U=l);var F=A;F.x=.5*(P.x+U.x),F.y=.5*(P.y+U.y),F.z=.5*(P.z+U.z);var L=e.magnitudeSquared(e.subtract(U,F,R)),B=Math.sqrt(L),z=S;z.x=i.x,z.y=o.y,z.z=u.z;var b=N;b.x=s.x,b.y=c.y,b.z=l.z;var q=e.multiplyByScalar(e.add(z,b,R),.5,M),G=0;for(I=0;I<h;I++){e.clone(t[I],r);var W=e.magnitude(e.subtract(r,q,R));W>G&&(G=W);var X=e.magnitudeSquared(e.subtract(r,F,R));if(X>L){var V=Math.sqrt(X);B=.5*(B+V),L=B*B;var H=V-B;F.x=(B*F.x+H*r.x)/V,F.y=(B*F.y+H*r.y)/V,F.z=(B*F.z+H*r.z)/V}}return B<G?(e.clone(F,n.center),n.radius=B):(e.clone(q,n.center),n.radius=G),n};var I=new o,g=new e,O=new e,v=new t,w=new t;f.fromRectangle2D=function(e,t,n){return f.fromRectangleWithHeights2D(e,t,0,0,n)},f.fromRectangleWithHeights2D=function(t,n,i,o,u){if(a(u)||(u=new f),!a(t))return u.center=e.clone(e.ZERO,u.center),u.radius=0,u;n=r(n,I),h.southwest(t,v),v.height=i,h.northeast(t,w),w.height=o;var s=n.project(v,g),c=n.project(w,O),l=c.x-s.x,d=c.y-s.y,E=c.z-s.z;u.radius=.5*Math.sqrt(l*l+d*d+E*E);var m=u.center;return m.x=s.x+.5*l,m.y=s.y+.5*d,m.z=s.z+.5*E,u};var x=[];f.fromRectangle3D=function(e,t,n,o){t=r(t,i.WGS84),n=r(n,0);var u;return a(e)&&(u=h.subsample(e,t,n,x)),f.fromPoints(u,o)},f.fromVertices=function(t,n,i,o){if(a(o)||(o=new f),!a(t)||0===t.length)return o.center=e.clone(e.ZERO,o.center),o.radius=0,o;n=r(n,e.ZERO),i=r(i,3);var u=y;u.x=t[0]+n.x,u.y=t[1]+n.y,u.z=t[2]+n.z;for(var s=e.clone(u,d),c=e.clone(u,E),l=e.clone(u,m),h=e.clone(u,p),I=e.clone(u,_),g=e.clone(u,T),O=t.length,v=0;v<O;v+=i){var w=t[v]+n.x,x=t[v+1]+n.y,C=t[v+2]+n.z;u.x=w,u.y=x,u.z=C,w<s.x&&e.clone(u,s),w>h.x&&e.clone(u,h),x<c.y&&e.clone(u,c),x>I.y&&e.clone(u,I),C<l.z&&e.clone(u,l),C>g.z&&e.clone(u,g)}var P=e.magnitudeSquared(e.subtract(h,s,R)),U=e.magnitudeSquared(e.subtract(I,c,R)),D=e.magnitudeSquared(e.subtract(g,l,R)),F=s,L=h,B=P;U>B&&(B=U,F=c,L=I),D>B&&(B=D,F=l,L=g);var z=A;z.x=.5*(F.x+L.x),z.y=.5*(F.y+L.y),z.z=.5*(F.z+L.z);var b=e.magnitudeSquared(e.subtract(L,z,R)),q=Math.sqrt(b),G=S;G.x=s.x,G.y=c.y,G.z=l.z;var W=N;W.x=h.x,W.y=I.y,W.z=g.z;var X=e.multiplyByScalar(e.add(G,W,R),.5,M),V=0;for(v=0;v<O;v+=i){u.x=t[v]+n.x,u.y=t[v+1]+n.y,u.z=t[v+2]+n.z;var H=e.magnitude(e.subtract(u,X,R));H>V&&(V=H);var Y=e.magnitudeSquared(e.subtract(u,z,R));if(Y>b){var k=Math.sqrt(Y);q=.5*(q+k),b=q*q;var Z=k-q;z.x=(q*z.x+Z*u.x)/k,z.y=(q*z.y+Z*u.y)/k,z.z=(q*z.z+Z*u.z)/k}}return q<V?(e.clone(z,o.center),o.radius=q):(e.clone(X,o.center),o.radius=V),o},f.fromEncodedCartesianVertices=function(t,n,r){if(a(r)||(r=new f),!a(t)||!a(n)||t.length!==n.length||0===t.length)return r.center=e.clone(e.ZERO,r.center),r.radius=0,r;var i=y;i.x=t[0]+n[0],i.y=t[1]+n[1],i.z=t[2]+n[2];for(var o=e.clone(i,d),u=e.clone(i,E),s=e.clone(i,m),c=e.clone(i,p),l=e.clone(i,_),h=e.clone(i,T),I=t.length,g=0;g<I;g+=3){var O=t[g]+n[g],v=t[g+1]+n[g+1],w=t[g+2]+n[g+2];i.x=O,i.y=v,i.z=w,O<o.x&&e.clone(i,o),O>c.x&&e.clone(i,c),v<u.y&&e.clone(i,u),v>l.y&&e.clone(i,l),w<s.z&&e.clone(i,s),w>h.z&&e.clone(i,h)}var x=e.magnitudeSquared(e.subtract(c,o,R)),C=e.magnitudeSquared(e.subtract(l,u,R)),P=e.magnitudeSquared(e.subtract(h,s,R)),U=o,D=c,F=x;C>F&&(F=C,U=u,D=l),P>F&&(F=P,U=s,D=h);var L=A;L.x=.5*(U.x+D.x),L.y=.5*(U.y+D.y),L.z=.5*(U.z+D.z);var B=e.magnitudeSquared(e.subtract(D,L,R)),z=Math.sqrt(B),b=S;b.x=o.x,b.y=u.y,b.z=s.z;var q=N;q.x=c.x,q.y=l.y,q.z=h.z;var G=e.multiplyByScalar(e.add(b,q,R),.5,M),W=0;for(g=0;g<I;g+=3){i.x=t[g]+n[g],i.y=t[g+1]+n[g+1],i.z=t[g+2]+n[g+2];var X=e.magnitude(e.subtract(i,G,R));X>W&&(W=X);var V=e.magnitudeSquared(e.subtract(i,L,R));if(V>B){var H=Math.sqrt(V);z=.5*(z+H),B=z*z;var Y=H-z;L.x=(z*L.x+Y*i.x)/H,L.y=(z*L.y+Y*i.y)/H,L.z=(z*L.z+Y*i.z)/H}}return z<W?(e.clone(L,r.center),r.radius=z):(e.clone(G,r.center),r.radius=W),r},f.fromCornerPoints=function(t,n,r){a(r)||(r=new f);var i=r.center;return e.add(t,n,i),e.multiplyByScalar(i,.5,i),r.radius=e.distance(i,n),r},f.fromEllipsoid=function(t,n){return a(n)||(n=new f),e.clone(e.ZERO,n.center),n.radius=t.maximumRadius,n};var C=new e;f.fromBoundingSpheres=function(t,n){if(a(n)||(n=new f),!a(t)||0===t.length)return n.center=e.clone(e.ZERO,n.center),n.radius=0,n;var r=t.length;if(1===r)return f.clone(t[0],n);if(2===r)return f.union(t[0],t[1],n);for(var i=[],o=0;o<r;o++)i.push(t[o].center);n=f.fromPoints(i,n);var u=n.center,s=n.radius;for(o=0;o<r;o++){var c=t[o];s=Math.max(s,e.distance(u,c.center,C)+c.radius)}return n.radius=s,n};var P=new e,U=new e,D=new e;f.fromOrientedBoundingBox=function(t,n){a(n)||(n=new f);var r=t.halfAxes,i=c.getColumn(r,0,P),o=c.getColumn(r,1,U),u=c.getColumn(r,2,D);return e.add(i,o,i),e.add(i,u,i),n.center=e.clone(t.center,n.center),n.radius=e.magnitude(i),n},f.clone=function(t,n){if(a(t))return a(n)?(n.center=e.clone(t.center,n.center),n.radius=t.radius,n):new f(t.center,t.radius)},f.packedLength=4,f.pack=function(e,t,n){n=r(n,0);var a=e.center;return t[n++]=a.x,t[n++]=a.y,t[n++]=a.z,t[n]=e.radius,t},f.unpack=function(e,t,n){t=r(t,0),a(n)||(n=new f);var i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var F=new e,L=new e;f.union=function(t,n,r){a(r)||(r=new f);var i=t.center,o=t.radius,u=n.center,s=n.radius,c=e.subtract(u,i,F),l=e.magnitude(c);if(o>=l+s)return t.clone(r),r;if(s>=l+o)return n.clone(r),r;var h=.5*(o+l+s),d=e.multiplyByScalar(c,(-o+h)/l,L);return e.add(d,i,d),e.clone(d,r.center),r.radius=h,r};var B=new e;f.expand=function(t,n,r){r=f.clone(t,r);var a=e.magnitude(e.subtract(n,r.center,B));return a>r.radius&&(r.radius=a),r},f.intersectPlane=function(t,n){var r=t.center,a=t.radius,i=n.normal,o=e.dot(i,r)+n.distance;return o<-a?u.OUTSIDE:o<a?u.INTERSECTING:u.INSIDE},f.transform=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=l.getMaximumScale(t)*e.radius,n};var z=new e;f.distanceSquaredTo=function(t,n){var r=e.subtract(t.center,n,z);return e.magnitudeSquared(r)-t.radius*t.radius},f.transformWithoutScale=function(e,t,n){return a(n)||(n=new f),n.center=l.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var b=new e;f.computePlaneDistances=function(t,n,r,i){a(i)||(i=new s);var o=e.subtract(t.center,n,b),u=e.dot(r,o);return i.start=u-t.radius,i.stop=u+t.radius,i};for(var q=new e,G=new e,W=new e,X=new e,V=new e,H=new t,Y=new Array(8),k=0;k<8;++k)Y[k]=new e;var Z=new o;return f.projectTo2D=function(t,n,a){n=r(n,Z);var i=n.ellipsoid,o=t.center,u=t.radius,s=i.geodeticSurfaceNormal(o,q),c=e.cross(e.UNIT_Z,s,G); +e.normalize(c,c);var l=e.cross(s,c,W);e.normalize(l,l),e.multiplyByScalar(s,u,s),e.multiplyByScalar(l,u,l),e.multiplyByScalar(c,u,c);var h=e.negate(l,V),d=e.negate(c,X),E=Y,m=E[0];e.add(s,l,m),e.add(m,c,m),m=E[1],e.add(s,l,m),e.add(m,d,m),m=E[2],e.add(s,h,m),e.add(m,d,m),m=E[3],e.add(s,h,m),e.add(m,c,m),e.negate(s,s),m=E[4],e.add(s,l,m),e.add(m,c,m),m=E[5],e.add(s,l,m),e.add(m,d,m),m=E[6],e.add(s,h,m),e.add(m,d,m),m=E[7],e.add(s,h,m),e.add(m,c,m);for(var p=E.length,_=0;_<p;++_){var T=E[_];e.add(o,T,T);var y=i.cartesianToCartographic(T,H);n.project(y,T)}a=f.fromPoints(E,a),o=a.center;var R=o.x,A=o.y,S=o.z;return o.x=S,o.y=R,o.z=A,a},f.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)},f.equals=function(t,n){return t===n||a(t)&&a(n)&&e.equals(t.center,n.center)&&t.radius===n.radius},f.prototype.intersectPlane=function(e){return f.intersectPlane(this,e)},f.prototype.distanceSquaredTo=function(e){return f.distanceSquaredTo(this,e)},f.prototype.computePlaneDistances=function(e,t,n){return f.computePlaneDistances(this,e,t,n)},f.prototype.isOccluded=function(e){return f.isOccluded(this,e)},f.prototype.equals=function(e){return f.equals(this,e)},f.prototype.clone=function(e){return f.clone(this,e)},f}),define("Core/EllipsoidalOccluder",["./BoundingSphere","./Cartesian3","./defaultValue","./defined","./defineProperties","./DeveloperError","./Rectangle"],function(e,t,n,r,a,i,o){"use strict";function u(e,n){this._ellipsoid=e,this._cameraPosition=new t,this._cameraPositionInScaledSpace=new t,this._distanceToLimbInScaledSpaceSquared=0,r(n)&&(this.cameraPosition=n)}function s(e,n,r){var a=e.transformPositionToScaledSpace(n,E),i=t.magnitudeSquared(a),o=Math.sqrt(i),u=t.divideByScalar(a,o,m);i=Math.max(1,i),o=Math.max(1,o);var s=t.dot(u,r),c=t.magnitude(t.cross(u,r,u)),l=1/o,h=Math.sqrt(i-1)*l;return 1/(s*l-c*h)}function c(e,n,r){if(!(n<=0||n===1/0||n!==n))return t.multiplyByScalar(e,n,r)}function l(e,n){return t.equals(n,t.ZERO)?n:(e.transformPositionToScaledSpace(n,p),t.normalize(p,p))}a(u.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){var n=this._ellipsoid,r=n.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),a=t.magnitudeSquared(r)-1;t.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=r,this._distanceToLimbInScaledSpaceSquared=a}}});var h=new t;u.prototype.isPointVisible=function(e){var t=this._ellipsoid,n=t.transformPositionToScaledSpace(e,h);return this.isScaledSpacePointVisible(n)},u.prototype.isScaledSpacePointVisible=function(e){var n=this._cameraPositionInScaledSpace,r=this._distanceToLimbInScaledSpaceSquared,a=t.subtract(e,n,h),i=-t.dot(a,n),o=r<0?i>0:i>r&&i*i/t.magnitudeSquared(a)>r;return!o},u.prototype.computeHorizonCullingPoint=function(e,n,a){r(a)||(a=new t);for(var i=this._ellipsoid,o=l(i,e),u=0,h=0,f=n.length;h<f;++h){var d=n[h],E=s(i,d,o);u=Math.max(u,E)}return c(o,u,a)};var f=new t;u.prototype.computeHorizonCullingPointFromVertices=function(e,a,i,o,u){r(u)||(u=new t),o=n(o,t.ZERO);for(var h=this._ellipsoid,d=l(h,e),E=0,m=0,p=a.length;m<p;m+=i){f.x=a[m]+o.x,f.y=a[m+1]+o.y,f.z=a[m+2]+o.z;var _=s(h,f,d);E=Math.max(E,_)}return c(d,E,u)};var d=[];u.prototype.computeHorizonCullingPointFromRectangle=function(n,r,a){var i=o.subsample(n,r,0,d),u=e.fromPoints(i);if(!(t.magnitude(u.center)<.1*r.minimumRadius))return this.computeHorizonCullingPoint(u.center,i,a)};var E=new t,m=new t,p=new t;return u}),define("Core/WebGLConstants",["./freezeObject"],function(e){"use strict";var t={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,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};return e(t)}),define("Core/IndexDatatype",["./defined","./DeveloperError","./freezeObject","./Math","./WebGLConstants"],function(e,t,n,r,a){"use strict";var i={UNSIGNED_BYTE:a.UNSIGNED_BYTE,UNSIGNED_SHORT:a.UNSIGNED_SHORT,UNSIGNED_INT:a.UNSIGNED_INT};return i.getSizeInBytes=function(e){switch(e){case i.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case i.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case i.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}},i.validate=function(t){return e(t)&&(t===i.UNSIGNED_BYTE||t===i.UNSIGNED_SHORT||t===i.UNSIGNED_INT)},i.createTypedArray=function(e,t){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)},i.createTypedArrayFromArrayBuffer=function(e,t,n,a){return e>=r.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,a):new Uint16Array(t,n,a)},n(i)}),define("Core/Intersections2D",["./Cartesian3","./defined","./DeveloperError"],function(e,t,n){"use strict";var r={};return r.clipTriangleAtAxisAlignedThreshold=function(e,n,r,a,i,o){t(o)?o.length=0:o=[];var u,s,c;n?(u=r<e,s=a<e,c=i<e):(u=r>e,s=a>e,c=i>e);var l,h,f,d,E,m,p=u+s+c;return 1===p?u?(l=(e-r)/(a-r),h=(e-r)/(i-r),o.push(1),o.push(2),1!==h&&(o.push(-1),o.push(0),o.push(2),o.push(h)),1!==l&&(o.push(-1),o.push(0),o.push(1),o.push(l))):s?(f=(e-a)/(i-a),d=(e-a)/(r-a),o.push(2),o.push(0),1!==d&&(o.push(-1),o.push(1),o.push(0),o.push(d)),1!==f&&(o.push(-1),o.push(1),o.push(2),o.push(f))):c&&(E=(e-i)/(r-i),m=(e-i)/(a-i),o.push(0),o.push(1),1!==m&&(o.push(-1),o.push(2),o.push(1),o.push(m)),1!==E&&(o.push(-1),o.push(2),o.push(0),o.push(E))):2===p?u||r===e?s||a===e?c||i===e||(h=(e-r)/(i-r),f=(e-a)/(i-a),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(h),o.push(-1),o.push(1),o.push(2),o.push(f)):(m=(e-i)/(a-i),l=(e-r)/(a-r),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(m),o.push(-1),o.push(0),o.push(1),o.push(l)):(d=(e-a)/(r-a),E=(e-i)/(r-i),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(d),o.push(-1),o.push(2),o.push(0),o.push(E)):3!==p&&(o.push(0),o.push(1),o.push(2)),o},r.computeBarycentricCoordinates=function(n,r,a,i,o,u,s,c,l){var h=a-s,f=s-o,d=u-c,E=i-c,m=1/(d*h+f*E),p=r-c,_=n-s,T=(d*_+f*p)*m,y=(-E*_+h*p)*m,R=1-T-y;return t(l)?(l.x=T,l.y=y,l.z=R,l):new e(T,y,R)},r}),define("Core/AxisAlignedBoundingBox",["./Cartesian3","./Check","./defaultValue","./defined","./Intersect"],function(e,t,n,r,a){"use strict";function i(t,a,i){this.minimum=e.clone(n(t,e.ZERO)),this.maximum=e.clone(n(a,e.ZERO)),r(i)?i=e.clone(i):(i=e.add(this.minimum,this.maximum,new e),e.multiplyByScalar(i,.5,i)),this.center=i}i.fromPoints=function(t,n){if(r(n)||(n=new i),!r(t)||0===t.length)return n.minimum=e.clone(e.ZERO,n.minimum),n.maximum=e.clone(e.ZERO,n.maximum),n.center=e.clone(e.ZERO,n.center),n;for(var a=t[0].x,o=t[0].y,u=t[0].z,s=t[0].x,c=t[0].y,l=t[0].z,h=t.length,f=1;f<h;f++){var d=t[f],E=d.x,m=d.y,p=d.z;a=Math.min(E,a),s=Math.max(E,s),o=Math.min(m,o),c=Math.max(m,c),u=Math.min(p,u),l=Math.max(p,l)}var _=n.minimum;_.x=a,_.y=o,_.z=u;var T=n.maximum;T.x=s,T.y=c,T.z=l;var y=e.add(_,T,n.center);return e.multiplyByScalar(y,.5,y),n},i.clone=function(t,n){if(r(t))return r(n)?(n.minimum=e.clone(t.minimum,n.minimum),n.maximum=e.clone(t.maximum,n.maximum),n.center=e.clone(t.center,n.center),n):new i(t.minimum,t.maximum)},i.equals=function(t,n){return t===n||r(t)&&r(n)&&e.equals(t.center,n.center)&&e.equals(t.minimum,n.minimum)&&e.equals(t.maximum,n.maximum)};var o=new e;return i.intersectPlane=function(t,n){o=e.subtract(t.maximum,t.minimum,o);var r=e.multiplyByScalar(o,.5,o),i=n.normal,u=r.x*Math.abs(i.x)+r.y*Math.abs(i.y)+r.z*Math.abs(i.z),s=e.dot(t.center,i)+n.distance;return s-u>0?a.INSIDE:s+u<0?a.OUTSIDE:a.INTERSECTING},i.prototype.clone=function(e){return i.clone(this,e)},i.prototype.intersectPlane=function(e){return i.intersectPlane(this,e)},i.prototype.equals=function(e){return i.equals(this,e)},i}),define("Core/QuadraticRealPolynomial",["./DeveloperError","./Math"],function(e,t){"use strict";function n(e,n,r){var a=e+n;return t.sign(e)!==t.sign(n)&&Math.abs(a/Math.max(Math.abs(e),Math.abs(n)))<r?0:a}var r={};return r.computeDiscriminant=function(e,t,n){var r=t*t-4*e*n;return r},r.computeRealRoots=function(e,r,a){var i;if(0===e)return 0===r?[]:[-a/r];if(0===r){if(0===a)return[0,0];var o=Math.abs(a),u=Math.abs(e);if(o<u&&o/u<t.EPSILON14)return[0,0];if(o>u&&u/o<t.EPSILON14)return[];if(i=-a/e,i<0)return[];var s=Math.sqrt(i);return[-s,s]}if(0===a)return i=-r/e,i<0?[i,0]:[0,i];var c=r*r,l=4*e*a,h=n(c,-l,t.EPSILON14);if(h<0)return[];var f=-.5*n(r,t.sign(r)*Math.sqrt(h),t.EPSILON14);return r>0?[f/e,a/f]:[a/f,f/e]},r}),define("Core/CubicRealPolynomial",["./DeveloperError","./QuadraticRealPolynomial"],function(e,t){"use strict";function n(e,t,n,r){var a,i,o=e,u=t/3,s=n/3,c=r,l=o*s,h=u*c,f=u*u,d=s*s,E=o*s-f,m=o*c-u*s,p=u*c-d,_=4*E*p-m*m;if(_<0){var T,y,R;f*h>=l*d?(T=o,y=E,R=-2*u*E+o*m):(T=c,y=p,R=-c*m+2*s*p);var A=R<0?-1:1,S=-A*Math.abs(T)*Math.sqrt(-_);i=-R+S;var N=i/2,M=N<0?-Math.pow(-N,1/3):Math.pow(N,1/3),I=i===S?-M:-y/M;return a=y<=0?M+I:-R/(M*M+I*I+y),f*h>=l*d?[(a-u)/o]:[-c/(a+s)]}var g=E,O=-2*u*E+o*m,v=p,w=-c*m+2*s*p,x=Math.sqrt(_),C=Math.sqrt(3)/2,P=Math.abs(Math.atan2(o*x,-O)/3);a=2*Math.sqrt(-g);var U=Math.cos(P);i=a*U;var D=a*(-U/2-C*Math.sin(P)),F=i+D>2*u?i-u:D-u,L=o,B=F/L;P=Math.abs(Math.atan2(c*x,-w)/3),a=2*Math.sqrt(-v),U=Math.cos(P),i=a*U,D=a*(-U/2-C*Math.sin(P));var z=-c,b=i+D<2*s?i+s:D+s,q=z/b,G=L*b,W=-F*b-L*z,X=F*z,V=(s*W-u*X)/(-u*W+s*G);return B<=V?B<=q?V<=q?[B,V,q]:[B,q,V]:[q,B,V]:B<=q?[V,B,q]:V<=q?[V,q,B]:[q,V,B]}var r={};return r.computeDiscriminant=function(e,t,n,r){var a=e*e,i=t*t,o=n*n,u=r*r,s=18*e*t*n*r+i*o-27*a*u-4*(e*o*n+i*t*r);return s},r.computeRealRoots=function(e,r,a,i){var o,u;if(0===e)return t.computeRealRoots(r,a,i);if(0===r){if(0===a){if(0===i)return[0,0,0];u=-i/e;var s=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);return[s,s,s]}return 0===i?(o=t.computeRealRoots(e,0,a),0===o.Length?[0]:[o[0],0,o[1]]):n(e,0,a,i)}return 0===a?0===i?(u=-r/e,u<0?[u,0,0]:[0,0,u]):n(e,r,0,i):0===i?(o=t.computeRealRoots(e,r,a),0===o.length?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]):n(e,r,a,i)},r}),define("Core/QuarticRealPolynomial",["./CubicRealPolynomial","./DeveloperError","./Math","./QuadraticRealPolynomial"],function(e,t,n,r){"use strict";function a(t,a,i,o){var u=t*t,s=a-3*u/8,c=i-a*t/2+u*t/8,l=o-i*t/4+a*u/16-3*u*u/256,h=e.computeRealRoots(1,2*s,s*s-4*l,-c*c);if(h.length>0){var f=-t/4,d=h[h.length-1];if(Math.abs(d)<n.EPSILON14){var E=r.computeRealRoots(1,s,l);if(2===E.length){var m,p=E[0],_=E[1];if(p>=0&&_>=0){var T=Math.sqrt(p),y=Math.sqrt(_);return[f-y,f-T,f+T,f+y]}if(p>=0&&_<0)return m=Math.sqrt(p),[f-m,f+m];if(p<0&&_>=0)return m=Math.sqrt(_),[f-m,f+m]}return[]}if(d>0){var R=Math.sqrt(d),A=(s+d-c/R)/2,S=(s+d+c/R)/2,N=r.computeRealRoots(1,R,A),M=r.computeRealRoots(1,-R,S);return 0!==N.length?(N[0]+=f,N[1]+=f,0!==M.length?(M[0]+=f,M[1]+=f,N[1]<=M[0]?[N[0],N[1],M[0],M[1]]:M[1]<=N[0]?[M[0],M[1],N[0],N[1]]:N[0]>=M[0]&&N[1]<=M[1]?[M[0],N[0],N[1],M[1]]:M[0]>=N[0]&&M[1]<=N[1]?[N[0],M[0],M[1],N[1]]:N[0]>M[0]&&N[0]<M[1]?[M[0],N[0],M[1],N[1]]:[N[0],M[0],N[1],M[1]]):N):0!==M.length?(M[0]+=f,M[1]+=f,M):[]}}return[]}function i(t,a,i,o){var u=i*i,s=a*a,c=t*t,l=-2*a,h=i*t+s-4*o,f=c*o-i*a*t+u,d=e.computeRealRoots(1,l,h,f);if(d.length>0){var E,m,p=d[0],_=a-p,T=_*_,y=t/2,R=_/2,A=T-4*o,S=T+4*Math.abs(o),N=c-4*p,M=c+4*Math.abs(p);if(p<0||A*M<N*S){var I=Math.sqrt(N);E=I/2,m=0===I?0:(t*R-i)/I}else{var g=Math.sqrt(A);E=0===g?0:(t*R-i)/g,m=g/2}var O,v;0===y&&0===E?(O=0,v=0):n.sign(y)===n.sign(E)?(O=y+E,v=p/O):(v=y-E,O=p/v);var w,x;0===R&&0===m?(w=0,x=0):n.sign(R)===n.sign(m)?(w=R+m,x=o/w):(x=R-m,w=o/x);var C=r.computeRealRoots(1,O,w),P=r.computeRealRoots(1,v,x);if(0!==C.length)return 0!==P.length?C[1]<=P[0]?[C[0],C[1],P[0],P[1]]:P[1]<=C[0]?[P[0],P[1],C[0],C[1]]:C[0]>=P[0]&&C[1]<=P[1]?[P[0],C[0],C[1],P[1]]:P[0]>=C[0]&&P[1]<=C[1]?[C[0],P[0],P[1],C[1]]:C[0]>P[0]&&C[0]<P[1]?[P[0],C[0],P[1],C[1]]:[C[0],P[0],C[1],P[1]]:C;if(0!==P.length)return P}return[]}var o={};return o.computeDiscriminant=function(e,t,n,r,a){var i=e*e,o=i*e,u=t*t,s=u*t,c=n*n,l=c*n,h=r*r,f=h*r,d=a*a,E=d*a,m=u*c*h-4*s*f-4*e*l*h+18*e*t*n*f-27*i*h*h+256*o*E+a*(18*s*n*r-4*u*l+16*e*c*c-80*e*t*c*r-6*e*u*h+144*i*n*h)+d*(144*e*u*n-27*u*u-128*i*c-192*i*t*r);return m},o.computeRealRoots=function(t,r,o,u,s){if(Math.abs(t)<n.EPSILON15)return e.computeRealRoots(r,o,u,s);var c=r/t,l=o/t,h=u/t,f=s/t,d=c<0?1:0;switch(d+=l<0?d+1:d,d+=h<0?d+1:d,d+=f<0?d+1:d){case 0:return a(c,l,h,f);case 1:return i(c,l,h,f);case 2:return i(c,l,h,f);case 3:return a(c,l,h,f);case 4:return a(c,l,h,f);case 5:return i(c,l,h,f);case 6:return a(c,l,h,f);case 7:return a(c,l,h,f);case 8:return i(c,l,h,f);case 9:return a(c,l,h,f);case 10:return a(c,l,h,f);case 11:return i(c,l,h,f);case 12:return a(c,l,h,f);case 13:return a(c,l,h,f);case 14:return a(c,l,h,f);case 15:return a(c,l,h,f);default:return}},o}),define("Core/Ray",["./Cartesian3","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=e.clone(t(r,e.ZERO)),e.equals(r,e.ZERO)||e.normalize(r,r),this.origin=e.clone(t(n,e.ZERO)),this.direction=r}return a.getPoint=function(t,r,a){return n(a)||(a=new e),a=e.multiplyByScalar(t.direction,r,a),e.add(t.origin,a,a)},a}),define("Core/IntersectionTests",["./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Interval","./Math","./Matrix3","./QuadraticRealPolynomial","./QuarticRealPolynomial","./Ray"],function(e,t,n,r,a,i,o,u,s,c,l){"use strict";function h(e,t,n,r){var a=t*t-4*e*n;if(!(a<0)){if(a>0){var i=1/(2*e),o=Math.sqrt(a),u=(-t+o)*i,s=(-t-o)*i;return u<s?(r.root0=u,r.root1=s):(r.root0=s,r.root1=u),r}var c=-t/(2*e);if(0!==c)return r.root0=r.root1=c,r}}function f(t,n,a){r(a)||(a=new i);var o=t.origin,u=t.direction,s=n.center,c=n.radius*n.radius,l=e.subtract(o,s,T),f=e.dot(u,u),d=2*e.dot(u,l),E=e.magnitudeSquared(l)-c,m=h(f,d,E,S);if(r(m))return a.start=m.root0,a.stop=m.root1,a}function d(e,t,n){var r=e+t;return o.sign(e)!==o.sign(t)&&Math.abs(r/Math.max(Math.abs(e),Math.abs(t)))<n?0:r}function E(t,n,r,a,i){var l,h=a*a,f=i*i,E=(t[u.COLUMN1ROW1]-t[u.COLUMN2ROW2])*f,m=i*(a*d(t[u.COLUMN1ROW0],t[u.COLUMN0ROW1],o.EPSILON15)+n.y),p=t[u.COLUMN0ROW0]*h+t[u.COLUMN2ROW2]*f+a*n.x+r,_=f*d(t[u.COLUMN2ROW1],t[u.COLUMN1ROW2],o.EPSILON15),T=i*(a*d(t[u.COLUMN2ROW0],t[u.COLUMN0ROW2])+n.z),y=[];if(0===T&&0===_){if(l=s.computeRealRoots(E,m,p),0===l.length)return y;var R=l[0],A=Math.sqrt(Math.max(1-R*R,0));if(y.push(new e(a,i*R,i*-A)),y.push(new e(a,i*R,i*A)),2===l.length){var S=l[1],N=Math.sqrt(Math.max(1-S*S,0));y.push(new e(a,i*S,i*-N)),y.push(new e(a,i*S,i*N))}return y}var M=T*T,I=_*_,g=E*E,O=T*_,v=g+I,w=2*(m*E+O),x=2*p*E+m*m-I+M,C=2*(p*m-O),P=p*p-M;if(0===v&&0===w&&0===x&&0===C)return y;l=c.computeRealRoots(v,w,x,C,P);var U=l.length;if(0===U)return y;for(var D=0;D<U;++D){var F,L=l[D],B=L*L,z=Math.max(1-B,0),b=Math.sqrt(z);F=o.sign(E)===o.sign(p)?d(E*B+p,m*L,o.EPSILON12):o.sign(p)===o.sign(m*L)?d(E*B,m*L+p,o.EPSILON12):d(E*B+m*L,p,o.EPSILON12);var q=d(_*L,T,o.EPSILON15),G=F*q;G<0?y.push(new e(a,i*L,i*b)):G>0?y.push(new e(a,i*L,i*-b)):0!==b?(y.push(new e(a,i*L,i*-b)),y.push(new e(a,i*L,i*b)),++D):y.push(new e(a,i*L,i*b))}return y}var m={};m.rayPlane=function(t,n,a){r(a)||(a=new e);var i=t.origin,u=t.direction,s=n.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON15)){var l=(-n.distance-e.dot(s,i))/c;if(!(l<0))return a=e.multiplyByScalar(u,l,a),e.add(i,a,a)}};var p=new e,_=new e,T=new e,y=new e,R=new e;m.rayTriangleParametric=function(t,r,a,i,u){u=n(u,!1);var s,c,l,h,f,d=t.origin,E=t.direction,m=e.subtract(a,r,p),A=e.subtract(i,r,_),S=e.cross(E,A,T),N=e.dot(m,S);if(u){if(N<o.EPSILON6)return;if(s=e.subtract(d,r,y),l=e.dot(s,S),l<0||l>N)return;if(c=e.cross(s,m,R),h=e.dot(E,c),h<0||l+h>N)return;f=e.dot(A,c)/N}else{if(Math.abs(N)<o.EPSILON6)return;var M=1/N;if(s=e.subtract(d,r,y),l=e.dot(s,S)*M,l<0||l>1)return;if(c=e.cross(s,m,R),h=e.dot(E,c)*M,h<0||l+h>1)return;f=e.dot(A,c)*M}return f},m.rayTriangle=function(t,n,a,i,o,u){var s=m.rayTriangleParametric(t,n,a,i,o);if(r(s)&&!(s<0))return r(u)||(u=new e),e.multiplyByScalar(t.direction,s,u),e.add(t.origin,u,u)};var A=new l;m.lineSegmentTriangle=function(t,n,a,i,o,u,s){var c=A;e.clone(t,c.origin),e.subtract(n,t,c.direction),e.normalize(c.direction,c.direction);var l=m.rayTriangleParametric(c,a,i,o,u);if(!(!r(l)||l<0||l>e.distance(t,n)))return r(s)||(s=new e),e.multiplyByScalar(c.direction,l,s),e.add(c.origin,s,s)};var S={root0:0,root1:0};m.raySphere=function(e,t,n){if(n=f(e,t,n),r(n)&&!(n.stop<0))return n.start=Math.max(n.start,0),n};var N=new l;m.lineSegmentSphere=function(t,n,a,i){var o=N;e.clone(t,o.origin);var u=e.subtract(n,t,o.direction),s=e.magnitude(u);if(e.normalize(u,u),i=f(o,a,i),!(!r(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var M=new e,I=new e;m.rayEllipsoid=function(t,n){var r,a,o,u,s,c=n.oneOverRadii,l=e.multiplyComponents(c,t.origin,M),h=e.multiplyComponents(c,t.direction,I),f=e.magnitudeSquared(l),d=e.dot(l,h);if(f>1){if(d>=0)return;var E=d*d;if(r=f-1,a=e.magnitudeSquared(h),o=a*r,E<o)return;if(E>o){u=d*d-o,s=-d+Math.sqrt(u);var m=s/a,p=r/s;return m<p?new i(m,p):{start:p,stop:m}}var _=Math.sqrt(r/a);return new i(_,_)}return f<1?(r=f-1,a=e.magnitudeSquared(h),o=a*r,u=d*d-o,s=-d+Math.sqrt(u),new i(0,s/a)):d<0?(a=e.magnitudeSquared(h),new i(0,-d/a)):void 0};var g=new e,O=new e,v=new e,w=new e,x=new e,C=new u,P=new u,U=new u,D=new u,F=new u,L=new u,B=new u,z=new e,b=new e,q=new t;m.grazingAltitudeLocation=function(t,n){var a=t.origin,i=t.direction;if(!e.equals(a,e.ZERO)){var s=n.geodeticSurfaceNormal(a,g);if(e.dot(i,s)>=0)return a}var c=r(this.rayEllipsoid(t,n)),l=n.transformPositionToScaledSpace(i,g),h=e.normalize(l,l),f=e.mostOrthogonalAxis(l,w),d=e.normalize(e.cross(f,h,O),O),m=e.normalize(e.cross(h,d,v),v),p=C;p[0]=h.x,p[1]=h.y,p[2]=h.z,p[3]=d.x,p[4]=d.y,p[5]=d.z,p[6]=m.x,p[7]=m.y,p[8]=m.z;var _=u.transpose(p,P),T=u.fromScale(n.radii,U),y=u.fromScale(n.oneOverRadii,D),R=F;R[0]=0,R[1]=-i.z,R[2]=i.y,R[3]=i.z,R[4]=0,R[5]=-i.x,R[6]=-i.y,R[7]=i.x,R[8]=0;var A,S,N=u.multiply(u.multiply(_,y,L),R,L),M=u.multiply(u.multiply(N,T,B),p,B),I=u.multiplyByVector(N,a,x),G=E(M,e.negate(I,g),0,0,1),W=G.length;if(W>0){for(var X=e.clone(e.ZERO,b),V=Number.NEGATIVE_INFINITY,H=0;H<W;++H){A=u.multiplyByVector(T,u.multiplyByVector(p,G[H],z),z);var Y=e.normalize(e.subtract(A,a,w),w),k=e.dot(Y,i);k>V&&(V=k,X=e.clone(A,X))}var Z=n.cartesianToCartographic(X,q);return V=o.clamp(V,0,1),S=e.magnitude(e.subtract(X,a,w))*Math.sqrt(1-V*V),S=c?-S:S,Z.height=S,n.cartographicToCartesian(Z,new e)}};var G=new e;return m.lineSegmentPlane=function(t,n,a,i){r(i)||(i=new e);var u=e.subtract(n,t,G),s=a.normal,c=e.dot(s,u);if(!(Math.abs(c)<o.EPSILON6)){var l=e.dot(s,t),h=-(a.distance+l)/c;if(!(h<0||h>1))return e.multiplyByScalar(u,h,i),e.add(t,i,i),i}},m.trianglePlaneIntersection=function(t,n,r,a){var i=a.normal,o=a.distance,u=e.dot(i,t)+o<0,s=e.dot(i,n)+o<0,c=e.dot(i,r)+o<0,l=0;l+=u?1:0,l+=s?1:0,l+=c?1:0;var h,f;if(1!==l&&2!==l||(h=new e,f=new e),1===l){if(u)return m.lineSegmentPlane(t,n,a,h),m.lineSegmentPlane(t,r,a,f),{positions:[t,n,r,h,f],indices:[0,3,4,1,2,4,1,4,3] +};if(s)return m.lineSegmentPlane(n,r,a,h),m.lineSegmentPlane(n,t,a,f),{positions:[t,n,r,h,f],indices:[1,3,4,2,0,4,2,4,3]};if(c)return m.lineSegmentPlane(r,t,a,h),m.lineSegmentPlane(r,n,a,f),{positions:[t,n,r,h,f],indices:[2,3,4,0,1,4,0,4,3]}}else if(2===l){if(!u)return m.lineSegmentPlane(n,t,a,h),m.lineSegmentPlane(r,t,a,f),{positions:[t,n,r,h,f],indices:[1,2,4,1,4,3,0,3,4]};if(!s)return m.lineSegmentPlane(r,n,a,h),m.lineSegmentPlane(t,n,a,f),{positions:[t,n,r,h,f],indices:[2,0,4,2,4,3,1,3,4]};if(!c)return m.lineSegmentPlane(t,r,a,h),m.lineSegmentPlane(n,r,a,f),{positions:[t,n,r,h,f],indices:[0,1,4,0,4,3,2,3,4]}}},m}),define("Core/Plane",["./Cartesian3","./defined","./DeveloperError","./Math","./freezeObject"],function(e,t,n,r,a){"use strict";function i(t,n){this.normal=e.clone(t),this.distance=n}i.fromPointNormal=function(n,r,a){var o=-e.dot(r,n);return t(a)?(e.clone(r,a.normal),a.distance=o,a):new i(r,o)};var o=new e;return i.fromCartesian4=function(n,r){var a=e.fromCartesian4(n,o),u=n.w;return t(r)?(e.clone(a,r.normal),r.distance=u,r):new i(a,u)},i.getPointDistance=function(t,n){return e.dot(t.normal,n)+t.distance},i.ORIGIN_XY_PLANE=a(new i(e.UNIT_Z,0)),i.ORIGIN_YZ_PLANE=a(new i(e.UNIT_X,0)),i.ORIGIN_ZX_PLANE=a(new i(e.UNIT_Y,0)),i}),function(e){"use strict";e("ThirdParty/when",[],function(){function e(e,n,r,a){return t(e).then(n,r,a)}function t(e){var t,n;return e instanceof r?t=e:u(e)?(n=o(),e.then(function(e){n.resolve(e)},function(e){n.reject(e)},function(e){n.progress(e)}),t=n.promise):t=a(e),t}function n(t){return e(t,i)}function r(e){this.then=e}function a(e){var n=new r(function(n){try{return t(n?n(e):e)}catch(e){return i(e)}});return n}function i(e){var n=new r(function(n,r){try{return r?t(r(e)):i(e)}catch(e){return i(e)}});return n}function o(){function e(e,t,n){return f(e,t,n)}function n(e){return E(e)}function a(e){return E(i(e))}function u(e){return d(e)}var s,c,l,h,f,d,E;return c=new r(e),s={then:e,resolve:n,reject:a,progress:u,promise:c,resolver:{resolve:n,reject:a,progress:u}},l=[],h=[],f=function(e,t,n){var r,a;return r=o(),a="function"==typeof n?function(e){try{r.progress(n(e))}catch(e){r.progress(e)}}:function(e){r.progress(e)},l.push(function(n){n.then(e,t).then(r.resolve,r.reject,a)}),h.push(a),r.promise},d=function(e){return m(h,e),e},E=function(e){return e=t(e),f=e.then,E=t,d=_,m(l,e),h=l=A,e},s}function u(e){return e&&"function"==typeof e.then}function s(t,n,r,a,i){return p(2,arguments),e(t,function(t){function u(e){m(e)}function s(e){E(e)}var c,l,h,f,d,E,m,p,T,y;if(T=t.length>>>0,c=Math.max(0,Math.min(n,T)),h=[],l=T-c+1,f=[],d=o(),c)for(p=d.progress,m=function(e){f.push(e),--l||(E=m=_,d.reject(f))},E=function(e){h.push(e),--c||(E=m=_,d.resolve(h))},y=0;y<T;++y)y in t&&e(t[y],s,u,p);else d.resolve(h);return d.then(r,a,i)})}function c(e,t,n,r){function a(e){return t?t(e[0]):e[0]}return s(e,1,a,n,r)}function l(e,t,n,r){return p(1,arguments),f(e,T).then(t,n,r)}function h(){return f(arguments,T)}function f(t,n){return e(t,function(t){var r,a,i,u,s,c;if(i=a=t.length>>>0,r=[],c=o(),i)for(u=function(t,a){e(t,n).then(function(e){r[a]=e,--i||c.resolve(r)},c.reject)},s=0;s<a;s++)s in t?u(t[s],s):--i;else c.resolve(r);return c.promise})}function d(t,n){var r=R.call(arguments,1);return e(t,function(t){var a;return a=t.length,r[0]=function(t,r,i){return e(t,function(t){return e(r,function(e){return n(t,e,i,a)})})},y.apply(t,r)})}function E(t,n,r){var a=arguments.length>2;return e(t,function(e){return e=a?r:e,n.resolve(e),e},function(e){return n.reject(e),i(e)},n.progress)}function m(e,t){for(var n,r=0;n=e[r++];)n(t)}function p(e,t){for(var n,r=t.length;r>e;)if(n=t[--r],null!=n&&"function"!=typeof n)throw new Error("arg "+r+" must be a function")}function _(){}function T(e){return e}var y,R,A;return e.defer=o,e.resolve=t,e.reject=n,e.join=h,e.all=l,e.map=f,e.reduce=d,e.any=c,e.some=s,e.chain=E,e.isPromise=u,r.prototype={always:function(e,t){return this.then(e,e,t)},otherwise:function(e){return this.then(A,e)},yield:function(e){return this.then(function(){return e})},spread:function(e){return this.then(function(t){return l(t,function(t){return e.apply(A,t)})})}},R=[].slice,y=[].reduce||function(e){var t,n,r,a,i;if(i=0,t=Object(this),a=t.length>>>0,n=arguments,n.length<=1)for(;;){if(i in t){r=t[i++];break}if(++i>=a)throw new TypeError}else r=n[1];for(;i<a;++i)i in t&&(r=e(r,t[i],i,t));return r},e})}("function"==typeof define&&define.amd?define:function(e){"object"==typeof exports?module.exports=e():this.when=e()}),define("Core/oneTimeWarning",["./defaultValue","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n,r){t(a[n])||(a[n]=!0,console.warn(e(r,n)))}var a={};return r.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.",r}),define("Core/deprecationWarning",["./defined","./DeveloperError","./oneTimeWarning"],function(e,t,n){"use strict";function r(e,t){n(e,t)}return r}),define("Core/binarySearch",["./Check","./defined"],function(e,t){"use strict";function n(e,t,n){for(var r,a,i=0,o=e.length-1;i<=o;)if(r=~~((i+o)/2),a=n(e[r],t),a<0)i=r+1;else{if(!(a>0))return r;o=r-1}return~(o+1)}return n}),define("Core/EarthOrientationParametersSample",[],function(){"use strict";function e(e,t,n,r,a){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=r,this.ut1MinusUtc=a}return e}),define("ThirdParty/sprintf",[],function(){function e(){var e=/%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,t=arguments,n=0,r=t[n++],a=function(e,t,n,r){n||(n=" ");var a=e.length>=t?"":Array(1+t-e.length>>>0).join(n);return r?e+a:a+e},i=function(e,t,n,r,i,o){var u=r-e.length;return u>0&&(e=n||!i?a(e,r,o,n):e.slice(0,t.length)+a("",u,"0",!0)+e.slice(t.length)),e},o=function(e,t,n,r,o,u,s){var c=e>>>0;return n=n&&c&&{2:"0b",8:"0",16:"0x"}[t]||"",e=n+a(c.toString(t),u||0,"0",!1),i(e,n,r,o,s)},u=function(e,t,n,r,a,o){return null!=r&&(e=e.slice(0,r)),i(e,"",t,n,a,o)},s=function(e,r,s,c,l,h,f){var d,E,m,p,_;if("%%"==e)return"%";for(var T=!1,y="",R=!1,A=!1,S=" ",N=s.length,M=0;s&&M<N;M++)switch(s.charAt(M)){case" ":y=" ";break;case"+":y="+";break;case"-":T=!0;break;case"'":S=s.charAt(M+1);break;case"0":R=!0;break;case"#":A=!0}if(c=c?"*"==c?+t[n++]:"*"==c.charAt(0)?+t[c.slice(1,-1)]:+c:0,c<0&&(c=-c,T=!0),!isFinite(c))throw new Error("sprintf: (minimum-)width must be finite");switch(h=h?"*"==h?+t[n++]:"*"==h.charAt(0)?+t[h.slice(1,-1)]:+h:"fFeE".indexOf(f)>-1?6:"d"==f?0:void 0,_=r?t[r.slice(0,-1)]:t[n++],f){case"s":return u(String(_),T,c,h,R,S);case"c":return u(String.fromCharCode(+_),T,c,h,R);case"b":return o(_,2,A,T,c,h,R);case"o":return o(_,8,A,T,c,h,R);case"x":return o(_,16,A,T,c,h,R);case"X":return o(_,16,A,T,c,h,R).toUpperCase();case"u":return o(_,10,A,T,c,h,R);case"i":case"d":return d=+_||0,d=Math.round(d-d%1),E=d<0?"-":y,_=E+a(String(Math.abs(d)),h,"0",!1),i(_,E,T,c,R);case"e":case"E":case"f":case"F":case"g":case"G":return d=+_,E=d<0?"-":y,m=["toExponential","toFixed","toPrecision"]["efg".indexOf(f.toLowerCase())],p=["toString","toUpperCase"]["eEfFgG".indexOf(f)%2],_=E+Math.abs(d)[m](h),i(_,E,T,c,R)[p]();default:return e}};return r.replace(e,s)}return e}),define("Core/GregorianDate",[],function(){"use strict";function e(e,t,n,r,a,i,o,u){this.year=e,this.month=t,this.day=n,this.hour=r,this.minute=a,this.second=i,this.millisecond=o,this.isLeapSecond=u}return e}),define("Core/isLeapYear",["./DeveloperError"],function(e){"use strict";function t(e){return e%4===0&&e%100!==0||e%400===0}return t}),define("Core/LeapSecond",[],function(){"use strict";function e(e,t){this.julianDate=e,this.offset=t}return e}),define("Core/TimeConstants",["./freezeObject"],function(e){"use strict";var t={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:2400000.5};return e(t)}),define("Core/TimeStandard",["./freezeObject"],function(e){"use strict";var t={UTC:0,TAI:1};return e(t)}),define("Core/JulianDate",["../ThirdParty/sprintf","./binarySearch","./defaultValue","./defined","./DeveloperError","./GregorianDate","./isLeapYear","./LeapSecond","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t){return m.compare(e.julianDate,t.julianDate)}function h(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);r<0&&(r=~r),r>=n.length&&(r=n.length-1);var a=n[r].offset;if(r>0){var i=m.secondsDifference(n[r].julianDate,e);i>a&&(r--,a=n[r].offset)}m.addSeconds(e,a,e)}function f(e,n){y.julianDate=e;var r=m.leapSeconds,a=t(r,y,l);if(a<0&&(a=~a),0===a)return m.addSeconds(e,-r[0].offset,n);if(a>=r.length)return m.addSeconds(e,-r[a-1].offset,n);var i=m.secondsDifference(r[a].julianDate,e);return 0===i?m.addSeconds(e,-r[a].offset,n):i<=1?void 0:m.addSeconds(e,-r[--a].offset,n)}function d(e,t,n){var r=t/s.SECONDS_PER_DAY|0;return e+=r,t-=s.SECONDS_PER_DAY*r,t<0&&(e--,t+=s.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function E(e,t,n,r,a,i,o){var u=(t-14)/12|0,c=e+4800+u,l=(1461*c/4|0)+(367*(t-2-12*u)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;r-=12,r<0&&(r+=24);var h=i+(r*s.SECONDS_PER_HOUR+a*s.SECONDS_PER_MINUTE+o*s.SECONDS_PER_MILLISECOND);return h>=43200&&(l-=1),[l,h]}function m(e,t,r){this.dayNumber=void 0,this.secondsOfDay=void 0,e=n(e,0),t=n(t,0),r=n(r,c.UTC);var a=0|e;t+=(e-a)*s.SECONDS_PER_DAY,d(a,t,this),r===c.UTC&&h(this)}var p=new i,_=[31,28,31,30,31,30,31,31,30,31,30,31],T=29,y=new u,R=/^(\d{4})$/,A=/^(\d{4})-(\d{2})$/,S=/^(\d{4})-?(\d{3})$/,N=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,M=/^(\d{4})-?(\d{2})-?(\d{2})$/,I=/([Z+\-])?(\d{2})?:?(\d{2})?$/,g=/^(\d{2})(\.\d+)?/.source+I.source,O=/^(\d{2}):?(\d{2})(\.\d+)?/.source+I.source,v=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+I.source;m.fromDate=function(e,t){var n=E(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return r(t)?(d(n[0],n[1],t),h(t),t):new m(n[0],n[1],c.UTC)},m.fromIso8601=function(e,t){e=e.replace(",",".");var n,a,i,u=e.split("T"),s=1,l=1,f=0,p=0,y=0,I=0,w=u[0],x=u[1];if(u=w.match(M),null!==u)n=+u[1],s=+u[2],l=+u[3];else if(u=w.match(A),null!==u)n=+u[1],s=+u[2];else if(u=w.match(R),null!==u)n=+u[1];else{var C;if(u=w.match(S),null!==u)n=+u[1],C=+u[2],i=o(n);else if(u=w.match(N),null!==u){n=+u[1];var P=+u[2],U=+u[3]||0,D=new Date(Date.UTC(n,0,4));C=7*P+U-D.getUTCDay()-3}a=new Date(Date.UTC(n,0,1)),a.setUTCDate(C),s=a.getUTCMonth()+1,l=a.getUTCDate()}i=o(n);var F;if(r(x)){u=x.match(v),null!==u?(f=+u[1],p=+u[2],y=+u[3],I=1e3*+(u[4]||0),F=5):(u=x.match(O),null!==u?(f=+u[1],p=+u[2],y=60*+(u[3]||0),F=4):(u=x.match(g),null!==u&&(f=+u[1],p=60*+(u[2]||0),F=3)));var L=u[F],B=+u[F+1],z=+(u[F+2]||0);switch(L){case"+":f-=B,p-=z;break;case"-":f+=B,p+=z;break;case"Z":break;default:p+=new Date(Date.UTC(n,s-1,l,f,p)).getTimezoneOffset()}}else p+=new Date(n,s-1,l).getTimezoneOffset();var b=60===y;for(b&&y--;p>=60;)p-=60,f++;for(;f>=24;)f-=24,l++;for(a=i&&2===s?T:_[s-1];l>a;)l-=a,s++,s>12&&(s-=12,n++),a=i&&2===s?T:_[s-1];for(;p<0;)p+=60,f--;for(;f<0;)f+=24,l--;for(;l<1;)s--,s<1&&(s+=12,n--),a=i&&2===s?T:_[s-1],l+=a;var q=E(n,s,l,f,p,y,I);return r(t)?(d(q[0],q[1],t),h(t)):t=new m(q[0],q[1],c.UTC),b&&m.addSeconds(t,1,t),t},m.now=function(e){return m.fromDate(new Date,e)};var w=new m(0,0,c.TAI);return m.toGregorianDate=function(e,t){var n=!1,a=f(e,w);r(a)||(m.addSeconds(e,-1,w),a=f(w,w),n=!0);var o=a.dayNumber,u=a.secondsOfDay;u>=43200&&(o+=1);var c=o+68569|0,l=4*c/146097|0;c=c-((146097*l+3)/4|0)|0;var h=4e3*(c+1)/1461001|0;c=c-(1461*h/4|0)+31|0;var d=80*c/2447|0,E=c-(2447*d/80|0)|0;c=d/11|0;var p=d+2-12*c|0,_=100*(l-49)+h+c|0,T=u/s.SECONDS_PER_HOUR|0,y=u-T*s.SECONDS_PER_HOUR,R=y/s.SECONDS_PER_MINUTE|0;y-=R*s.SECONDS_PER_MINUTE;var A=0|y,S=(y-A)/s.SECONDS_PER_MILLISECOND;return T+=12,T>23&&(T-=24),n&&(A+=1),r(t)?(t.year=_,t.month=p,t.day=E,t.hour=T,t.minute=R,t.second=A,t.millisecond=S,t.isLeapSecond=n,t):new i(_,p,E,T,R,A,S,n)},m.toDate=function(e){var t=m.toGregorianDate(e,p),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))},m.toIso8601=function(t,n){var a,i=m.toGregorianDate(t,i);return r(n)||0===i.millisecond?r(n)&&0!==n?(a=(.01*i.millisecond).toFixed(n).replace(".","").slice(0,n),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a)):e("%04d-%02d-%02dT%02d:%02d:%02dZ",i.year,i.month,i.day,i.hour,i.minute,i.second):(a=(.01*i.millisecond).toString().replace(".",""),e("%04d-%02d-%02dT%02d:%02d:%02d.%sZ",i.year,i.month,i.day,i.hour,i.minute,i.second,a))},m.clone=function(e,t){if(r(e))return r(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new m(e.dayNumber,e.secondsOfDay,c.TAI)},m.compare=function(e,t){var n=e.dayNumber-t.dayNumber;return 0!==n?n:e.secondsOfDay-t.secondsOfDay},m.equals=function(e,t){return e===t||r(e)&&r(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay},m.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(m.secondsDifference(e,t))<=n},m.totalDays=function(e){return e.dayNumber+e.secondsOfDay/s.SECONDS_PER_DAY},m.secondsDifference=function(e,t){var n=(e.dayNumber-t.dayNumber)*s.SECONDS_PER_DAY;return n+(e.secondsOfDay-t.secondsOfDay)},m.daysDifference=function(e,t){var n=e.dayNumber-t.dayNumber,r=(e.secondsOfDay-t.secondsOfDay)/s.SECONDS_PER_DAY;return n+r},m.computeTaiMinusUtc=function(e){y.julianDate=e;var n=m.leapSeconds,r=t(n,y,l);return r<0&&(r=~r,--r,r<0&&(r=0)),n[r].offset},m.addSeconds=function(e,t,n){return d(e.dayNumber,e.secondsOfDay+t,n)},m.addMinutes=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_MINUTE;return d(e.dayNumber,r,n)},m.addHours=function(e,t,n){var r=e.secondsOfDay+t*s.SECONDS_PER_HOUR;return d(e.dayNumber,r,n)},m.addDays=function(e,t,n){var r=e.dayNumber+t;return d(r,e.secondsOfDay,n)},m.lessThan=function(e,t){return m.compare(e,t)<0},m.lessThanOrEquals=function(e,t){return m.compare(e,t)<=0},m.greaterThan=function(e,t){return m.compare(e,t)>0},m.greaterThanOrEquals=function(e,t){return m.compare(e,t)>=0},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m.prototype.equalsEpsilon=function(e,t){return m.equalsEpsilon(this,e,t)},m.prototype.toString=function(){return m.toIso8601(this)},m.leapSeconds=[new u(new m(2441317,43210,c.TAI),10),new u(new m(2441499,43211,c.TAI),11),new u(new m(2441683,43212,c.TAI),12),new u(new m(2442048,43213,c.TAI),13),new u(new m(2442413,43214,c.TAI),14),new u(new m(2442778,43215,c.TAI),15),new u(new m(2443144,43216,c.TAI),16),new u(new m(2443509,43217,c.TAI),17),new u(new m(2443874,43218,c.TAI),18),new u(new m(2444239,43219,c.TAI),19),new u(new m(2444786,43220,c.TAI),20),new u(new m(2445151,43221,c.TAI),21),new u(new m(2445516,43222,c.TAI),22),new u(new m(2446247,43223,c.TAI),23),new u(new m(2447161,43224,c.TAI),24),new u(new m(2447892,43225,c.TAI),25),new u(new m(2448257,43226,c.TAI),26),new u(new m(2448804,43227,c.TAI),27),new u(new m(2449169,43228,c.TAI),28),new u(new m(2449534,43229,c.TAI),29),new u(new m(2450083,43230,c.TAI),30),new u(new m(2450630,43231,c.TAI),31),new u(new m(2451179,43232,c.TAI),32),new u(new m(2453736,43233,c.TAI),33),new u(new m(2454832,43234,c.TAI),34),new u(new m(2456109,43235,c.TAI),35),new u(new m(2457204,43236,c.TAI),36),new u(new m(2457754,43237,c.TAI),37)],m}),define("Core/clone",["./defaultValue"],function(e){"use strict";function t(n,r){if(null===n||"object"!=typeof n)return n;r=e(r,!1);var a=new n.constructor;for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];r&&(o=t(o,r)),a[i]=o}return a}return t}),define("Core/parseResponseHeaders",[],function(){"use strict";function e(e){var t={};if(!e)return t;for(var n=e.split("\r\n"),r=0;r<n.length;++r){var a=n[r],i=a.indexOf(": ");if(i>0){var o=a.substring(0,i),u=a.substring(i+2);t[o]=u}}return t}return e}),define("Core/RequestErrorEvent",["./defined","./parseResponseHeaders"],function(e,t){"use strict";function n(e,n,r){this.statusCode=e,this.response=n,this.responseHeaders=r,"string"==typeof this.responseHeaders&&(this.responseHeaders=t(this.responseHeaders))}return n.prototype.toString=function(){var t="Request has failed.";return e(this.statusCode)&&(t+=" Status Code: "+this.statusCode),t},n}),define("ThirdParty/Uri",[],function(){function e(t){if(t instanceof e)this.scheme=t.scheme,this.authority=t.authority,this.path=t.path,this.query=t.query,this.fragment=t.fragment;else if(t){var n=r.exec(t);this.scheme=n[1],this.authority=n[2],this.path=n[3],this.query=n[4],this.fragment=n[5]}}function t(e){var t=unescape(e);return i.test(t)?t:e.toUpperCase()}function n(e,t,n,r){return(t||"")+n.toLowerCase()+(r||"")}e.prototype.scheme=null,e.prototype.authority=null,e.prototype.path="",e.prototype.query=null,e.prototype.fragment=null;var r=new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");e.prototype.getScheme=function(){return this.scheme},e.prototype.getAuthority=function(){return this.authority},e.prototype.getPath=function(){return this.path},e.prototype.getQuery=function(){return this.query},e.prototype.getFragment=function(){return this.fragment},e.prototype.isAbsolute=function(){return!!this.scheme&&!this.fragment},e.prototype.isSameDocumentAs=function(e){return e.scheme==this.scheme&&e.authority==this.authority&&e.path==this.path&&e.query==this.query},e.prototype.equals=function(e){return this.isSameDocumentAs(e)&&e.fragment==this.fragment},e.prototype.normalize=function(){this.removeDotSegments(),this.scheme&&(this.scheme=this.scheme.toLowerCase()),this.authority&&(this.authority=this.authority.replace(o,n).replace(a,t)),this.path&&(this.path=this.path.replace(a,t)),this.query&&(this.query=this.query.replace(a,t)),this.fragment&&(this.fragment=this.fragment.replace(a,t))};var a=/%[0-9a-z]{2}/gi,i=/[a-zA-Z0-9\-\._~]/,o=/(.*@)?([^@:]*)(:.*)?/;return e.prototype.resolve=function(t){var n=new e;return this.scheme?(n.scheme=this.scheme,n.authority=this.authority,n.path=this.path,n.query=this.query):(n.scheme=t.scheme,this.authority?(n.authority=this.authority,n.path=this.path,n.query=this.query):(n.authority=t.authority,""==this.path?(n.path=t.path,n.query=this.query||t.query):("/"==this.path.charAt(0)?(n.path=this.path,n.removeDotSegments()):(t.authority&&""==t.path?n.path="/"+this.path:n.path=t.path.substring(0,t.path.lastIndexOf("/")+1)+this.path,n.removeDotSegments()),n.query=this.query))),n.fragment=this.fragment,n},e.prototype.removeDotSegments=function(){var e,t=this.path.split("/"),n=[],r=""==t[0];r&&t.shift();for(""==t[0]?t.shift():null;t.length;)e=t.shift(),".."==e?n.pop():"."!=e&&n.push(e);"."!=e&&".."!=e||n.push(""),r&&n.unshift(""),this.path=n.join("/")},e.prototype.toString=function(){var e="";return this.scheme&&(e+=this.scheme+":"),this.authority&&(e+="//"+this.authority),e+=this.path,this.query&&(e+="?"+this.query),this.fragment&&(e+="#"+this.fragment),e},e}),define("Core/TrustedServers",["../ThirdParty/Uri","./defined","./DeveloperError"],function(e,t,n){"use strict";function r(n){var r=new e(n);r.normalize();var a=r.getAuthority();if(t(a)){if(a.indexOf("@")!==-1){var i=a.split("@");a=i[1]}if(a.indexOf(":")===-1){var o=r.getScheme();if(t(o)||(o=window.location.protocol,o=o.substring(0,o.length-1)),"http"===o)a+=":80";else{if("https"!==o)return;a+=":443"}}return a}}var a={},i={};return a.add=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])||(i[r]=!0)},a.remove=function(e,n){var r=e.toLowerCase()+":"+n;t(i[r])&&delete i[r]},a.contains=function(e){var n=r(e);return!(!t(n)||!t(i[n]))},a.clear=function(){i={}},a}),define("Core/loadWithXhr",["../ThirdParty/when","./defaultValue","./defined","./DeveloperError","./RequestErrorEvent","./RuntimeError","./TrustedServers"],function(e,t,n,r,a,i,o){"use strict";function u(n){n=t(n,t.EMPTY_OBJECT);var r=n.responseType,a=t(n.method,"GET"),i=n.data,o=n.headers,s=n.overrideMimeType;return e(n.url,function(t){var n=e.defer();return u.load(t,r,a,i,o,n,s),n.promise})}function s(e,t){var n=decodeURIComponent(t);return e?atob(n):n}function c(e,t){for(var n=s(e,t),r=new ArrayBuffer(n.length),a=new Uint8Array(r),i=0;i<n.length;i++)a[i]=n.charCodeAt(i);return r}function l(e,n){n=t(n,"");var r=e[1],a=!!e[2],i=e[3];switch(n){case"":case"text":return s(a,i);case"arraybuffer":return c(a,i);case"blob":var o=c(a,i);return new Blob([o],{type:r});case"document":var u=new DOMParser;return u.parseFromString(s(a,i),r);case"json":return JSON.parse(s(a,i))}}var h=/^data:(.*?)(;base64)?,(.*)$/;return u.load=function(e,t,r,u,s,c,f){var d=h.exec(e);if(null!==d)return void c.resolve(l(d,t));var E=new XMLHttpRequest;if(o.contains(e)&&(E.withCredentials=!0),n(f)&&n(E.overrideMimeType)&&E.overrideMimeType(f),E.open(r,e,!0),n(s))for(var m in s)s.hasOwnProperty(m)&&E.setRequestHeader(m,s[m]);n(t)&&(E.responseType=t),E.onload=function(){if(E.status<200||E.status>=300)return void c.reject(new a(E.status,E.response,E.getAllResponseHeaders()));var e=E.response,r=E.responseType;if(!n(e)||n(t)&&r!==t)if("json"===t&&"string"==typeof e)try{c.resolve(JSON.parse(e))}catch(e){c.reject(e)}else(""===r||"document"===r)&&n(E.responseXML)&&E.responseXML.hasChildNodes()?c.resolve(E.responseXML):""!==r&&"text"!==r||!n(E.responseText)?c.reject(new i("Invalid XMLHttpRequest response type.")):c.resolve(E.responseText);else c.resolve(e)},E.onerror=function(e){c.reject(new a)},E.send(u)},u.defaultLoad=u.load,u}),define("Core/loadText",["./loadWithXhr"],function(e){"use strict";function t(t,n){return e({url:t,headers:n})}return t}),define("Core/loadJson",["./clone","./defined","./DeveloperError","./loadText"],function(e,t,n,r){"use strict";function a(n,a){return t(a)?t(a.Accept)||(a=e(a),a.Accept=i.Accept):a=i,r(n,a).then(function(e){return JSON.parse(e)})}var i={Accept:"application/json,*/*;q=0.01"};return a}),define("Core/EarthOrientationParameters",["../ThirdParty/when","./binarySearch","./defaultValue","./defined","./EarthOrientationParametersSample","./freezeObject","./JulianDate","./LeapSecond","./loadJson","./RuntimeError","./TimeConstants","./TimeStandard"],function(e,t,n,r,a,i,o,u,s,c,l,h){"use strict";function f(t){if(t=n(t,n.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._downloadPromise=void 0,this._dataError=void 0,this._addNewLeapSeconds=n(t.addNewLeapSeconds,!0),r(t.data))E(this,t.data);else if(r(t.url)){var a=this;this._downloadPromise=e(s(t.url),function(e){E(a,e)},function(){a._dataError="An error occurred while retrieving the EOP data from the URL "+t.url+"."})}else E(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}function d(e,t){return o.compare(e.julianDate,t)}function E(e,n){if(!r(n.columnNames))return void(e._dataError="Error in loaded EOP data: The columnNames property is required.");if(!r(n.samples))return void(e._dataError="Error in loaded EOP data: The samples property is required.");var a=n.columnNames.indexOf("modifiedJulianDateUtc"),i=n.columnNames.indexOf("xPoleWanderRadians"),s=n.columnNames.indexOf("yPoleWanderRadians"),c=n.columnNames.indexOf("ut1MinusUtcSeconds"),f=n.columnNames.indexOf("xCelestialPoleOffsetRadians"),E=n.columnNames.indexOf("yCelestialPoleOffsetRadians"),m=n.columnNames.indexOf("taiMinusUtcSeconds");if(a<0||i<0||s<0||c<0||f<0||E<0||m<0)return void(e._dataError="Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");var p=e._samples=n.samples,_=e._dates=[];e._dateColumn=a,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=s,e._ut1MinusUtcSecondsColumn=c,e._xCelestialPoleOffsetRadiansColumn=f,e._yCelestialPoleOffsetRadiansColumn=E,e._taiMinusUtcSecondsColumn=m,e._columnCount=n.columnNames.length,e._lastIndex=void 0;for(var T,y=e._addNewLeapSeconds,R=0,A=p.length;R<A;R+=e._columnCount){var S=p[R+a],N=p[R+m],M=S+l.MODIFIED_JULIAN_DATE_DIFFERENCE,I=new o(M,N,h.TAI);if(_.push(I),y){if(N!==T&&r(T)){var g=o.leapSeconds,O=t(g,I,d);if(O<0){var v=new u(I,N);g.splice(~O,0,v)}}T=N}}}function m(e,t,n,r,a){var i=n*r;a.xPoleWander=t[i+e._xPoleWanderRadiansColumn],a.yPoleWander=t[i+e._yPoleWanderRadiansColumn],a.xPoleOffset=t[i+e._xCelestialPoleOffsetRadiansColumn],a.yPoleOffset=t[i+e._yCelestialPoleOffsetRadiansColumn],a.ut1MinusUtc=t[i+e._ut1MinusUtcSecondsColumn]}function p(e,t,n){return t+e*(n-t)}function _(e,t,n,r,a,i,u){var s=e._columnCount;if(i>t.length-1)return u.xPoleWander=0,u.yPoleWander=0,u.xPoleOffset=0,u.yPoleOffset=0,u.ut1MinusUtc=0,u;var c=t[a],l=t[i];if(c.equals(l)||r.equals(c))return m(e,n,a,s,u),u;if(r.equals(l))return m(e,n,i,s,u),u;var h=o.secondsDifference(r,c)/o.secondsDifference(l,c),f=a*s,d=i*s,E=n[f+e._ut1MinusUtcSecondsColumn],_=n[d+e._ut1MinusUtcSecondsColumn],T=_-E;if(T>.5||T<-.5){var y=n[f+e._taiMinusUtcSecondsColumn],R=n[d+e._taiMinusUtcSecondsColumn];y!==R&&(l.equals(r)?E=_:_-=R-y)}return u.xPoleWander=p(h,n[f+e._xPoleWanderRadiansColumn],n[d+e._xPoleWanderRadiansColumn]),u.yPoleWander=p(h,n[f+e._yPoleWanderRadiansColumn],n[d+e._yPoleWanderRadiansColumn]),u.xPoleOffset=p(h,n[f+e._xCelestialPoleOffsetRadiansColumn],n[d+e._xCelestialPoleOffsetRadiansColumn]),u.yPoleOffset=p(h,n[f+e._yCelestialPoleOffsetRadiansColumn],n[d+e._yCelestialPoleOffsetRadiansColumn]),u.ut1MinusUtc=p(h,E,_),u}return f.NONE=i({getPromiseToLoad:function(){return e()},compute:function(e,t){return r(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new a(0,0,0,0,0),t}}),f.prototype.getPromiseToLoad=function(){return e(this._downloadPromise)},f.prototype.compute=function(e,n){if(r(this._samples)){if(r(n)||(n=new a(0,0,0,0,0)),0===this._samples.length)return n.xPoleWander=0,n.yPoleWander=0,n.xPoleOffset=0,n.yPoleOffset=0,n.ut1MinusUtc=0,n;var i=this._dates,u=this._lastIndex,s=0,l=0;if(r(u)){var h=i[u],f=i[u+1],d=o.lessThanOrEquals(h,e),E=!r(f),m=E||o.greaterThanOrEquals(f,e);if(d&&m)return s=u,!E&&f.equals(e)&&++s,l=s+1,_(this,i,this._samples,e,s,l,n),n}var p=t(i,e,o.compare,this._dateColumn);return p>=0?(p<i.length-1&&i[p+1].equals(e)&&++p,s=p,l=p):(l=~p,s=l-1,s<0&&(s=0)),this._lastIndex=s,_(this,i,this._samples,e,s,l,n),n}if(r(this._dataError))throw new c(this._dataError)},f}),define("Core/getAbsoluteUri",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(n,r){r=t(r,document.location.href);var a=new e(r),i=new e(n);return i.resolve(a).toString()}return a}),define("Core/joinUrls",["../ThirdParty/Uri","./defaultValue","./defined","./DeveloperError"],function(e,t,n,r){"use strict";function a(r,a,i){if(i=t(i,!0),r instanceof e||(r=new e(r)),a instanceof e||(a=new e(a)),"data"===r.scheme)return r.toString();if("data"===a.scheme)return a.toString();n(a.authority)&&!n(a.scheme)&&("undefined"!=typeof document&&n(document.location)&&n(document.location.href)?a.scheme=new e(document.location.href).scheme:a.scheme=r.scheme);var o=r;a.isAbsolute()&&(o=a);var u="";n(o.scheme)&&(u+=o.scheme+":"),n(o.authority)&&(u+="//"+o.authority,""!==o.path&&"/"!==o.path&&(u=u.replace(/\/?$/,"/"),o.path=o.path.replace(/^\/?/g,""))),u+=o===r?i?r.path.replace(/\/?$/,"/")+a.path.replace(/^\/?/g,""):r.path+a.path:a.path;var s=n(r.query),c=n(a.query);s&&c?u+="?"+r.query+"&"+a.query:s&&!c?u+="?"+r.query:!s&&c&&(u+="?"+a.query);var l=n(a.fragment);return n(r.fragment)&&!l?u+="#"+r.fragment:l&&(u+="#"+a.fragment),u}return a}),define("Core/buildModuleUrl",["../ThirdParty/Uri","./defined","./DeveloperError","./getAbsoluteUri","./joinUrls","require"],function(e,t,n,r,a,i){"use strict";function o(){for(var e=document.getElementsByTagName("script"),t=0,n=e.length;t<n;++t){var r=e[t].getAttribute("src"),a=E.exec(r);if(null!==a)return a[1]}}function u(){if(t(h))return h;var n;return n="undefined"!=typeof CESIUM_BASE_URL?CESIUM_BASE_URL:o(),h=new e(r(n))}function s(e){return i.toUrl("../"+e)}function c(e){return a(u(),e)}function l(e){t(f)||(f=t(i.toUrl)?s:c),t(d)||(d=document.createElement("a"));var n=f(e);return d.href=n,d.href=d.href,d.href}var h,f,d,E=/((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i;return l._cesiumScriptRegex=E,l.setBaseUrl=function(t){h=new e(t).resolve(new e(document.location.href))},l}),define("Core/Iau2006XysSample",[],function(){"use strict";function e(e,t,n){this.x=e,this.y=t,this.s=n}return e}),define("Core/Iau2006XysData",["../ThirdParty/when","./buildModuleUrl","./defaultValue","./defined","./Iau2006XysSample","./JulianDate","./loadJson","./TimeStandard"],function(e,t,n,r,a,i,o,u){"use strict";function s(e){e=n(e,n.EMPTY_OBJECT),this._xysFileUrlTemplate=e.xysFileUrlTemplate,this._interpolationOrder=n(e.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=n(e.sampleZeroJulianEphemerisDate,2442396.5),this._sampleZeroDateTT=new i(this._sampleZeroJulianEphemerisDate,0,u.TAI),this._stepSizeDays=n(e.stepSizeDays,1),this._samplesPerXysFile=n(e.samplesPerXysFile,1e3),this._totalSamples=n(e.totalSamples,27426),this._samples=new Array(3*this._totalSamples),this._chunkDownloadsInProgress=[];for(var t=this._interpolationOrder,r=this._denominators=new Array(t+1),a=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t),s=0;s<=t;++s){r[s]=o,a[s]=s*this._stepSizeDays;for(var c=0;c<=t;++c)c!==s&&(r[s]*=s-c);r[s]=1/r[s]}this._work=new Array(t+1),this._coef=new Array(t+1)}function c(e,t,n){var r=h;return r.dayNumber=t,r.secondsOfDay=n,i.daysDifference(r,e._sampleZeroDateTT)}function l(n,a){if(n._chunkDownloadsInProgress[a])return n._chunkDownloadsInProgress[a];var i=e.defer();n._chunkDownloadsInProgress[a]=i;var u,s=n._xysFileUrlTemplate;return u=r(s)?s.replace("{0}",a):t("Assets/IAU2006_XYS/IAU2006_XYS_"+a+".json"),e(o(u),function(e){n._chunkDownloadsInProgress[a]=!1;for(var t=n._samples,r=e.samples,o=a*n._samplesPerXysFile*3,u=0,s=r.length;u<s;++u)t[o+u]=r[u];i.resolve()}),i.promise}var h=new i(0,0,u.TAI);return s.prototype.preload=function(t,n,r,a){var i=c(this,t,n),o=c(this,r,a),u=i/this._stepSizeDays-this._interpolationOrder/2|0;u<0&&(u=0);var s=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);for(var h=u/this._samplesPerXysFile|0,f=s/this._samplesPerXysFile|0,d=[],E=h;E<=f;++E)d.push(l(this,E));return e.all(d)},s.prototype.computeXysRadians=function(e,t,n){var i=c(this,e,t);if(!(i<0)){var o=i/this._stepSizeDays|0;if(!(o>=this._totalSamples)){var u=this._interpolationOrder,s=o-(u/2|0);s<0&&(s=0);var h=s+u;h>=this._totalSamples&&(h=this._totalSamples-1,s=h-u,s<0&&(s=0));var f=!1,d=this._samples;if(r(d[3*s])||(l(this,s/this._samplesPerXysFile|0),f=!0),r(d[3*h])||(l(this,h/this._samplesPerXysFile|0),f=!0),!f){r(n)?(n.x=0,n.y=0,n.s=0):n=new a(0,0,0);var E,m,p=i-s*this._stepSizeDays,_=this._work,T=this._denominators,y=this._coef,R=this._xTable;for(E=0;E<=u;++E)_[E]=p-R[E];for(E=0;E<=u;++E){for(y[E]=1,m=0;m<=u;++m)m!==E&&(y[E]*=_[m]);y[E]*=T[E];var A=3*(s+E);n.x+=y[E]*d[A++],n.y+=y[E]*d[A++],n.s+=y[E]*d[A]}return n}}}},s}),define("Core/Fullscreen",["./defined","./defineProperties"],function(e,t){"use strict";var n,r={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},a={};return t(a,{element:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenElement]}},changeEventName:{get:function(){ +if(a.supportsFullscreen())return r.fullscreenchange}},errorEventName:{get:function(){if(a.supportsFullscreen())return r.fullscreenerror}},enabled:{get:function(){if(a.supportsFullscreen())return document[r.fullscreenEnabled]}},fullscreen:{get:function(){if(a.supportsFullscreen())return null!==a.element}}}),a.supportsFullscreen=function(){if(e(n))return n;n=!1;var t=document.body;if("function"==typeof t.requestFullscreen)return r.requestFullscreen="requestFullscreen",r.exitFullscreen="exitFullscreen",r.fullscreenEnabled="fullscreenEnabled",r.fullscreenElement="fullscreenElement",r.fullscreenchange="fullscreenchange",r.fullscreenerror="fullscreenerror",n=!0;for(var a,i=["webkit","moz","o","ms","khtml"],o=0,u=i.length;o<u;++o){var s=i[o];a=s+"RequestFullscreen","function"==typeof t[a]?(r.requestFullscreen=a,n=!0):(a=s+"RequestFullScreen","function"==typeof t[a]&&(r.requestFullscreen=a,n=!0)),a=s+"ExitFullscreen","function"==typeof document[a]?r.exitFullscreen=a:(a=s+"CancelFullScreen","function"==typeof document[a]&&(r.exitFullscreen=a)),a=s+"FullscreenEnabled",void 0!==document[a]?r.fullscreenEnabled=a:(a=s+"FullScreenEnabled",void 0!==document[a]&&(r.fullscreenEnabled=a)),a=s+"FullscreenElement",void 0!==document[a]?r.fullscreenElement=a:(a=s+"FullScreenElement",void 0!==document[a]&&(r.fullscreenElement=a)),a=s+"fullscreenchange",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenChange"),r.fullscreenchange=a),a=s+"fullscreenerror",void 0!==document["on"+a]&&("ms"===s&&(a="MSFullscreenError"),r.fullscreenerror=a)}return n},a.requestFullscreen=function(e,t){a.supportsFullscreen()&&e[r.requestFullscreen]({vrDisplay:t})},a.exitFullscreen=function(){a.supportsFullscreen()&&document[r.exitFullscreen]()},a}),define("Core/FeatureDetection",["./defaultValue","./defined","./Fullscreen"],function(e,t,n){"use strict";function r(e){for(var t=e.split("."),n=0,r=t.length;n<r;++n)t[n]=parseInt(t[n],10);return t}function a(){if(!t(A)&&(A=!1,!f())){var e=/ Chrome\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(A=!0,S=r(e[1]))}return A}function i(){return a()&&S}function o(){if(!t(N)&&(N=!1,!a()&&!f()&&/ Safari\/[\.0-9]+/.test(R.userAgent))){var e=/ Version\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(N=!0,M=r(e[1]))}return N}function u(){return o()&&M}function s(){if(!t(I)){I=!1;var e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(R.userAgent);null!==e&&(I=!0,g=r(e[1]),g.isNightly=!!e[2])}return I}function c(){return s()&&g}function l(){if(!t(O)){O=!1;var e;"Microsoft Internet Explorer"===R.appName?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,v=r(e[1]))):"Netscape"===R.appName&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(R.userAgent),null!==e&&(O=!0,v=r(e[1])))}return O}function h(){return l()&&v}function f(){if(!t(w)){w=!1;var e=/ Edge\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(w=!0,x=r(e[1]))}return w}function d(){return f()&&x}function E(){if(!t(C)){C=!1;var e=/Firefox\/([\.0-9]+)/.exec(R.userAgent);null!==e&&(C=!0,P=r(e[1]))}return C}function m(){return t(U)||(U=/Windows/i.test(R.appVersion)),U}function p(){return E()&&P}function _(){return t(D)||(D="undefined"!=typeof PointerEvent&&(!t(R.pointerEnabled)||R.pointerEnabled)),D}function T(){if(!t(L)){var e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");var n=e.style.imageRendering;L=t(n)&&""!==n,L&&(F=n)}return L}function y(){return T()?F:void 0}var R;R="undefined"!=typeof navigator?navigator:{};var A,S,N,M,I,g,O,v,w,x,C,P,U,D,F,L,B={isChrome:a,chromeVersion:i,isSafari:o,safariVersion:u,isWebkit:s,webkitVersion:c,isInternetExplorer:l,internetExplorerVersion:h,isEdge:f,edgeVersion:d,isFirefox:E,firefoxVersion:p,isWindows:m,hardwareConcurrency:e(R.hardwareConcurrency,3),supportsPointerEvents:_,supportsImageRenderingPixelated:T,imageRenderingValue:y};return B.supportsFullscreen=function(){return n.supportsFullscreen()},B.supportsTypedArrays=function(){return"undefined"!=typeof ArrayBuffer},B.supportsWebWorkers=function(){return"undefined"!=typeof Worker},B}),define("Core/HeadingPitchRoll",["./defaultValue","./defined","./DeveloperError","./Math"],function(e,t,n,r){"use strict";function a(t,n,r){this.heading=e(t,0),this.pitch=e(n,0),this.roll=e(r,0)}return a.fromQuaternion=function(e,n){t(n)||(n=new a);var r=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),u=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return n.heading=-Math.atan2(s,u),n.roll=Math.atan2(o,i),n.pitch=-Math.asin(r),n},a.fromDegrees=function(e,n,i,o){return t(o)||(o=new a),o.heading=e*r.RADIANS_PER_DEGREE,o.pitch=n*r.RADIANS_PER_DEGREE,o.roll=i*r.RADIANS_PER_DEGREE,o},a.clone=function(e,n){if(t(e))return t(n)?(n.heading=e.heading,n.pitch=e.pitch,n.roll=e.roll,n):new a(e.heading,e.pitch,e.roll)},a.equals=function(e,n){return e===n||t(e)&&t(n)&&e.heading===n.heading&&e.pitch===n.pitch&&e.roll===n.roll},a.equalsEpsilon=function(e,n,a,i){return e===n||t(e)&&t(n)&&r.equalsEpsilon(e.heading,n.heading,a,i)&&r.equalsEpsilon(e.pitch,n.pitch,a,i)&&r.equalsEpsilon(e.roll,n.roll,a,i)},a.prototype.clone=function(e){return a.clone(this,e)},a.prototype.equals=function(e){return a.equals(this,e)},a.prototype.equalsEpsilon=function(e,t,n){return a.equalsEpsilon(this,e,t,n)},a.prototype.toString=function(){return"("+this.heading+", "+this.pitch+", "+this.roll+")"},a}),define("Core/Quaternion",["./Cartesian3","./Check","./defaultValue","./defined","./deprecationWarning","./FeatureDetection","./freezeObject","./HeadingPitchRoll","./Math","./Matrix3"],function(e,t,n,r,a,i,o,u,s,c){"use strict";function l(e,t,r,a){this.x=n(e,0),this.y=n(t,0),this.z=n(r,0),this.w=n(a,0)}var h=new e;l.fromAxisAngle=function(t,n,a){var i=n/2,o=Math.sin(i);h=e.normalize(t,h);var u=h.x*o,s=h.y*o,c=h.z*o,f=Math.cos(i);return r(a)?(a.x=u,a.y=s,a.z=c,a.w=f,a):new l(u,s,c,f)};var f=[1,2,0],d=new Array(3);l.fromRotationMatrix=function(e,t){var n,a,i,o,u,s=e[c.COLUMN0ROW0],h=e[c.COLUMN1ROW1],E=e[c.COLUMN2ROW2],m=s+h+E;if(m>0)n=Math.sqrt(m+1),u=.5*n,n=.5/n,a=(e[c.COLUMN1ROW2]-e[c.COLUMN2ROW1])*n,i=(e[c.COLUMN2ROW0]-e[c.COLUMN0ROW2])*n,o=(e[c.COLUMN0ROW1]-e[c.COLUMN1ROW0])*n;else{var p=f,_=0;h>s&&(_=1),E>s&&E>h&&(_=2);var T=p[_],y=p[T];n=Math.sqrt(e[c.getElementIndex(_,_)]-e[c.getElementIndex(T,T)]-e[c.getElementIndex(y,y)]+1);var R=d;R[_]=.5*n,n=.5/n,u=(e[c.getElementIndex(y,T)]-e[c.getElementIndex(T,y)])*n,R[T]=(e[c.getElementIndex(T,_)]+e[c.getElementIndex(_,T)])*n,R[y]=(e[c.getElementIndex(y,_)]+e[c.getElementIndex(_,y)])*n,a=-R[0],i=-R[1],o=-R[2]}return r(t)?(t.x=a,t.y=i,t.z=o,t.w=u,t):new l(a,i,o,u)};var E=new l,m=new l,p=new l,_=new l;l.fromHeadingPitchRoll=function(t,n,r,i){var o;return t instanceof u?(o=t,i=n):(a("Quaternion.fromHeadingPitchRoll(heading, pitch, roll,result)","The method was deprecated in Cesium 1.32 and will be removed in version 1.33. Use Quaternion.fromHeadingPitchRoll(hpr,result) where hpr is a HeadingPitchRoll"),o=new u(t,n,r)),_=l.fromAxisAngle(e.UNIT_X,o.roll,E),p=l.fromAxisAngle(e.UNIT_Y,-o.pitch,i),i=l.multiply(p,_,p),m=l.fromAxisAngle(e.UNIT_Z,-o.heading,E),l.multiply(m,i,i)};var T=new e,y=new e,R=new l,A=new l,S=new l;l.packedLength=4,l.pack=function(e,t,r){return r=n(r,0),t[r++]=e.x,t[r++]=e.y,t[r++]=e.z,t[r]=e.w,t},l.unpack=function(e,t,a){return t=n(t,0),r(a)||(a=new l),a.x=e[t],a.y=e[t+1],a.z=e[t+2],a.w=e[t+3],a},l.packedInterpolationLength=3,l.convertPackedArrayForInterpolation=function(e,t,n,r){l.unpack(e,4*n,S),l.conjugate(S,S);for(var a=0,i=n-t+1;a<i;a++){var o=3*a;l.unpack(e,4*(t+a),R),l.multiply(R,S,R),R.w<0&&l.negate(R,R),l.computeAxis(R,T);var u=l.computeAngle(R);r[o]=T.x*u,r[o+1]=T.y*u,r[o+2]=T.z*u}},l.unpackInterpolationResult=function(t,n,a,i,o){r(o)||(o=new l),e.fromArray(t,0,y);var u=e.magnitude(y);return l.unpack(n,4*i,A),0===u?l.clone(l.IDENTITY,R):l.fromAxisAngle(y,u,R),l.multiply(R,A,o)},l.clone=function(e,t){if(r(e))return r(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new l(e.x,e.y,e.z,e.w)},l.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t},l.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w},l.magnitude=function(e){return Math.sqrt(l.magnitudeSquared(e))},l.normalize=function(e,t){var n=1/l.magnitude(e),r=e.x*n,a=e.y*n,i=e.z*n,o=e.w*n;return t.x=r,t.y=a,t.z=i,t.w=o,t},l.inverse=function(e,t){var n=l.magnitudeSquared(e);return t=l.conjugate(e,t),l.multiplyByScalar(t,1/n,t)},l.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n},l.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n},l.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t},l.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w},l.multiply=function(e,t,n){var r=e.x,a=e.y,i=e.z,o=e.w,u=t.x,s=t.y,c=t.z,l=t.w,h=o*u+r*l+a*c-i*s,f=o*s-r*c+a*l+i*u,d=o*c+r*s-a*u+i*l,E=o*l-r*u-a*s-i*c;return n.x=h,n.y=f,n.z=d,n.w=E,n},l.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n},l.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n},l.computeAxis=function(e,t){var n=e.w;if(Math.abs(n-1)<s.EPSILON6)return t.x=t.y=t.z=0,t;var r=1/Math.sqrt(1-n*n);return t.x=e.x*r,t.y=e.y*r,t.z=e.z*r,t},l.computeAngle=function(e){return Math.abs(e.w-1)<s.EPSILON6?0:2*Math.acos(e.w)};var N=new l;l.lerp=function(e,t,n,r){return N=l.multiplyByScalar(t,n,N),r=l.multiplyByScalar(e,1-n,r),l.add(N,r,r)};var M=new l,I=new l,g=new l;l.slerp=function(e,t,n,r){var a=l.dot(e,t),i=t;if(a<0&&(a=-a,i=M=l.negate(t,M)),1-a<s.EPSILON6)return l.lerp(e,i,n,r);var o=Math.acos(a);return I=l.multiplyByScalar(e,Math.sin((1-n)*o),I),g=l.multiplyByScalar(i,Math.sin(n*o),g),r=l.add(I,g,r),l.multiplyByScalar(r,1/Math.sin(o),r)},l.log=function(t,n){var r=s.acosClamped(t.w),a=0;return 0!==r&&(a=r/Math.sin(r)),e.multiplyByScalar(t,a,n)},l.exp=function(t,n){var r=e.magnitude(t),a=0;return 0!==r&&(a=Math.sin(r)/r),n.x=t.x*a,n.y=t.y*a,n.z=t.z*a,n.w=Math.cos(r),n};var O=new e,v=new e,w=new l,x=new l;l.computeInnerQuadrangle=function(t,n,r,a){var i=l.conjugate(n,w);l.multiply(i,r,x);var o=l.log(x,O);l.multiply(i,t,x);var u=l.log(x,v);return e.add(o,u,o),e.multiplyByScalar(o,.25,o),e.negate(o,o),l.exp(o,w),l.multiply(n,w,a)},l.squad=function(e,t,n,r,a,i){var o=l.slerp(e,t,a,w),u=l.slerp(n,r,a,x);return l.slerp(o,u,2*a*(1-a),i)};for(var C=new l,P=1.9011074535173003,U=i.supportsTypedArrays()?new Float32Array(8):[],D=i.supportsTypedArrays()?new Float32Array(8):[],F=i.supportsTypedArrays()?new Float32Array(8):[],L=i.supportsTypedArrays()?new Float32Array(8):[],B=0;B<7;++B){var z=B+1,b=2*z+1;U[B]=1/(z*b),D[B]=z/b}return U[7]=P/136,D[7]=8*P/17,l.fastSlerp=function(e,t,n,r){var a,i=l.dot(e,t);i>=0?a=1:(a=-1,i=-i);for(var o=i-1,u=1-n,s=n*n,c=u*u,h=7;h>=0;--h)F[h]=(U[h]*s-D[h])*o,L[h]=(U[h]*c-D[h])*o;var f=a*n*(1+F[0]*(1+F[1]*(1+F[2]*(1+F[3]*(1+F[4]*(1+F[5]*(1+F[6]*(1+F[7])))))))),d=u*(1+L[0]*(1+L[1]*(1+L[2]*(1+L[3]*(1+L[4]*(1+L[5]*(1+L[6]*(1+L[7])))))))),E=l.multiplyByScalar(e,d,C);return l.multiplyByScalar(t,f,r),l.add(E,r,r)},l.fastSquad=function(e,t,n,r,a,i){var o=l.fastSlerp(e,t,a,w),u=l.fastSlerp(n,r,a,x);return l.fastSlerp(o,u,2*a*(1-a),i)},l.equals=function(e,t){return e===t||r(e)&&r(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w},l.equalsEpsilon=function(e,t,n){return e===t||r(e)&&r(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n},l.ZERO=o(new l(0,0,0,0)),l.IDENTITY=o(new l(0,0,0,1)),l.prototype.clone=function(e){return l.clone(this,e)},l.prototype.equals=function(e){return l.equals(this,e)},l.prototype.equalsEpsilon=function(e,t){return l.equalsEpsilon(this,e,t)},l.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+", "+this.w+")"},l}),define("Core/Transforms",["../ThirdParty/when","./Cartesian2","./Cartesian3","./Cartesian4","./Cartographic","./Check","./defaultValue","./defined","./deprecationWarning","./DeveloperError","./EarthOrientationParameters","./EarthOrientationParametersSample","./Ellipsoid","./Iau2006XysData","./Iau2006XysSample","./JulianDate","./Math","./Matrix3","./Matrix4","./Quaternion","./TimeConstants"],function(e,t,n,r,a,i,o,u,s,c,l,h,f,d,E,m,p,_,T,y,R){"use strict";var A={},S={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},N={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},M={},I={east:new n,north:new n,up:new n,west:new n,south:new n,down:new n},g=new n,O=new n,v=new n;A.localFrameToFixedFrameGenerator=function(e,t){if(!S.hasOwnProperty(e)||!S[e].hasOwnProperty(t))throw new c("firstAxis and secondAxis must be east, north, up, west, south or down.");var r,a=S[e][t],i=e+t;return u(M[i])?r=M[i]:(r=function(r,i,s){if(u(s)||(s=new T),p.equalsEpsilon(r.x,0,p.EPSILON14)&&p.equalsEpsilon(r.y,0,p.EPSILON14)){var c=p.sign(r.z);n.unpack(N[e],0,g),"east"!==e&&"west"!==e&&n.multiplyByScalar(g,c,g),n.unpack(N[t],0,O),"east"!==t&&"west"!==t&&n.multiplyByScalar(O,c,O),n.unpack(N[a],0,v),"east"!==a&&"west"!==a&&n.multiplyByScalar(v,c,v)}else{i=o(i,f.WGS84),i.geodeticSurfaceNormal(r,I.up);var l=I.up,h=I.east;h.x=-r.y,h.y=r.x,h.z=0,n.normalize(h,I.east),n.cross(l,h,I.north),n.multiplyByScalar(I.up,-1,I.down),n.multiplyByScalar(I.east,-1,I.west),n.multiplyByScalar(I.north,-1,I.south),g=I[e],O=I[t],v=I[a]}return s[0]=g.x,s[1]=g.y,s[2]=g.z,s[3]=0,s[4]=O.x,s[5]=O.y,s[6]=O.z,s[7]=0,s[8]=v.x,s[9]=v.y,s[10]=v.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},M[i]=r),r},A.eastNorthUpToFixedFrame=A.localFrameToFixedFrameGenerator("east","north"),A.northEastDownToFixedFrame=A.localFrameToFixedFrameGenerator("north","east"),A.northUpEastToFixedFrame=A.localFrameToFixedFrameGenerator("north","up"),A.northWestUpToFixedFrame=A.localFrameToFixedFrameGenerator("north","west");var w=new y,x=new n(1,1,1),C=new T;A.headingPitchRollToFixedFrame=function(e,t,r,a,i){a instanceof T&&(i=a,a=void 0,s("Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollToFixedFrame(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)")),a=o(a,A.eastNorthUpToFixedFrame);var u=y.fromHeadingPitchRoll(t,w),c=T.fromTranslationQuaternionRotationScale(n.ZERO,u,x,C);return i=a(e,r,i),T.multiply(i,c,i)};var P=new T,U=new _;A.headingPitchRollQuaternion=function(e,t,n,r,a){r instanceof y&&(a=r,r=void 0,s("Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, result)","The method was deprecated in Cesium 1.31 and will be removed in version 1.33. Transforms.headingPitchRollQuaternion(origin, headingPitchRoll, ellipsoid, fixedFrameTransform, result) where fixedFrameTransform is a a 4x4 transformation matrix (see Transforms.localFrameToFixedFrameGenerator)"));var i=A.headingPitchRollToFixedFrame(e,t,n,r,P),o=T.getRotation(i,U);return y.fromRotationMatrix(o,a)};var D=24110.54841,F=8640184.812866,L=.093104,B=-62e-7,z=1.1772758384668e-19,b=72921158553e-15,q=p.TWO_PI/86400,G=new m;A.computeTemeToPseudoFixedMatrix=function(e,t){G=m.addSeconds(e,-m.computeTaiMinusUtc(e),G);var n,r=G.dayNumber,a=G.secondsOfDay,i=r-2451545;n=a>=43200?(i+.5)/R.DAYS_PER_JULIAN_CENTURY:(i-.5)/R.DAYS_PER_JULIAN_CENTURY;var o=D+n*(F+n*(L+n*B)),s=o*q%p.TWO_PI,c=b+z*(r-2451545.5),l=(a+.5*R.SECONDS_PER_DAY)%R.SECONDS_PER_DAY,h=s+c*l,f=Math.cos(h),d=Math.sin(h);return u(t)?(t[0]=f,t[1]=-d,t[2]=0,t[3]=d,t[4]=f,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new _(f,d,0,-d,f,0,0,0,1)},A.iau2006XysData=new d,A.earthOrientationParameters=l.NONE;var W=32.184,X=2451545;A.preloadIcrfFixed=function(t){var n=t.start.dayNumber,r=t.start.secondsOfDay+W,a=t.stop.dayNumber,i=t.stop.secondsOfDay+W,o=A.iau2006XysData.preload(n,r,a,i),u=A.earthOrientationParameters.getPromiseToLoad();return e.all([o,u])},A.computeIcrfToFixedMatrix=function(e,t){u(t)||(t=new _);var n=A.computeFixedToIcrfMatrix(e,t);if(u(n))return _.transpose(n,t)};var V=new E(0,0,0),H=new h(0,0,0,0,0,0),Y=new _,k=new _;A.computeFixedToIcrfMatrix=function(e,t){u(t)||(t=new _);var n=A.earthOrientationParameters.compute(e,H);if(u(n)){var r=e.dayNumber,a=e.secondsOfDay+W,i=A.iau2006XysData.computeXysRadians(r,a,V);if(u(i)){var o=i.x+n.xPoleOffset,s=i.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-o*o-s*s)),l=Y;l[0]=1-c*o*o,l[3]=-c*o*s,l[6]=o,l[1]=-c*o*s,l[4]=1-c*s*s,l[7]=s,l[2]=-o,l[5]=-s,l[8]=1-c*(o*o+s*s);var h=_.fromRotationZ(-i.s,k),f=_.multiply(l,h,Y),d=e.dayNumber,E=e.secondsOfDay-m.computeTaiMinusUtc(e)+n.ut1MinusUtc,T=d-2451545,y=E/R.SECONDS_PER_DAY,S=.779057273264+y+.00273781191135448*(T+y);S=S%1*p.TWO_PI;var N=_.fromRotationZ(S,k),M=_.multiply(f,N,Y),I=Math.cos(n.xPoleWander),g=Math.cos(n.yPoleWander),O=Math.sin(n.xPoleWander),v=Math.sin(n.yPoleWander),w=r-X+a/R.SECONDS_PER_DAY;w/=36525;var x=-47e-6*w*p.RADIANS_PER_DEGREE/3600,C=Math.cos(x),P=Math.sin(x),U=k;return U[0]=I*C,U[1]=I*P,U[2]=O,U[3]=-g*P+v*O*C,U[4]=g*C+v*O*P,U[5]=-v*I,U[6]=-v*P-g*O*C,U[7]=v*C-g*O*P,U[8]=g*I,_.multiply(M,U,t)}}};var Z=new r;A.pointToWindowCoordinates=function(e,t,n,r){return r=A.pointToGLWindowCoordinates(e,t,n,r),r.y=2*t[5]-r.y,r},A.pointToGLWindowCoordinates=function(e,n,a,i){u(i)||(i=new t);var o=Z;return T.multiplyByVector(e,r.fromElements(a.x,a.y,a.z,1,o),o),r.multiplyByScalar(o,1/o.w,o),T.multiplyByVector(n,o,o),t.fromCartesian4(o,i)};var j=new n,K=new n,Q=new n;A.rotationMatrixFromPositionVelocity=function(e,t,r,a){var i=o(r,f.WGS84).geodeticSurfaceNormal(e,j),s=n.cross(t,i,K);n.equalsEpsilon(s,n.ZERO,p.EPSILON6)&&(s=n.clone(n.UNIT_X,s));var c=n.cross(s,t,Q);return n.cross(t,c,s),n.negate(s,s),u(a)||(a=new _),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=s.x,a[4]=s.y,a[5]=s.z,a[6]=c.x,a[7]=c.y,a[8]=c.z,a};var J=new T(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$=new a,ee=new n,te=new n,ne=new _,re=new T,ae=new T;return A.basisTo2D=function(e,t,r){var a=T.getTranslation(t,te),i=e.ellipsoid,o=i.cartesianToCartographic(a,$),u=e.project(o,ee);n.fromElements(u.z,u.x,u.y,u);var s=A.eastNorthUpToFixedFrame(a,i,re),c=T.inverseTransformation(s,ae),l=T.getRotation(t,ne),h=T.multiplyByMatrix3(c,l,r);return T.multiply(J,h,r),T.setTranslation(r,u,r),r},A.wgs84To2DModelMatrix=function(e,t,r){var a=e.ellipsoid,i=A.eastNorthUpToFixedFrame(t,a,re),o=T.inverseTransformation(i,ae),u=a.cartesianToCartographic(t,$),s=e.project(u,ee);n.fromElements(s.z,s.x,s.y,s);var c=T.fromTranslation(s,re);return T.multiply(J,o,r),T.multiply(c,r,r),r},A}),define("Core/EllipsoidTangentPlane",["./AxisAlignedBoundingBox","./Cartesian2","./Cartesian3","./Cartesian4","./defaultValue","./defined","./defineProperties","./DeveloperError","./Ellipsoid","./IntersectionTests","./Matrix4","./Plane","./Ray","./Transforms"],function(e,t,n,r,a,i,o,u,s,c,l,h,f,d){"use strict";function E(e,t){t=a(t,s.WGS84),e=t.scaleToGeodeticSurface(e);var r=d.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=n.fromCartesian4(l.getColumn(r,0,m)),this._yAxis=n.fromCartesian4(l.getColumn(r,1,m));var i=n.fromCartesian4(l.getColumn(r,2,m));this._plane=h.fromPointNormal(e,i)}var m=new r;o(E.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var p=new e;E.fromPoints=function(t,n){var r=e.fromPoints(t,p);return new E(r.center,n)};var _=new f,T=new n;E.prototype.projectPointOntoPlane=function(e,r){var a=_;a.origin=e,n.normalize(e,a.direction);var o=c.rayPlane(a,this._plane,T);if(i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T)),i(o)){var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return i(r)?(r.x=s,r.y=l,r):new t(s,l)}},E.prototype.projectPointsOntoPlane=function(e,t){i(t)||(t=[]);for(var n=0,r=e.length,a=0;a<r;a++){var o=this.projectPointOntoPlane(e[a],t[n]);i(o)&&(t[n]=o,n++)}return t.length=n,t},E.prototype.projectPointToNearestOnPlane=function(e,r){i(r)||(r=new t);var a=_;a.origin=e,n.clone(this._plane.normal,a.direction);var o=c.rayPlane(a,this._plane,T);i(o)||(n.negate(a.direction,a.direction),o=c.rayPlane(a,this._plane,T));var u=n.subtract(o,this._origin,o),s=n.dot(this._xAxis,u),l=n.dot(this._yAxis,u);return r.x=s,r.y=l,r},E.prototype.projectPointsToNearestOnPlane=function(e,t){i(t)||(t=[]);var n=e.length;t.length=n;for(var r=0;r<n;r++)t[r]=this.projectPointToNearestOnPlane(e[r],t[r]);return t};var y=new n;return E.prototype.projectPointsOntoEllipsoid=function(e,t){var r=e.length;i(t)?t.length=r:t=new Array(r);for(var a=this._ellipsoid,o=this._origin,u=this._xAxis,s=this._yAxis,c=y,l=0;l<r;++l){var h=e[l];n.multiplyByScalar(u,h.x,c),i(t[l])||(t[l]=new n);var f=n.add(o,c,t[l]);n.multiplyByScalar(s,h.y,c),n.add(f,c,f),a.scaleToGeocentricSurface(f,f)}return t},E}),define("Core/OrientedBoundingBox",["./BoundingSphere","./Cartesian2","./Cartesian3","./Cartographic","./defaultValue","./defined","./DeveloperError","./Ellipsoid","./EllipsoidTangentPlane","./Intersect","./Interval","./Math","./Matrix3","./Plane","./Rectangle"],function(e,t,n,r,a,i,o,u,s,c,l,h,f,d,E){"use strict";function m(e,t){this.center=n.clone(a(e,n.ZERO)),this.halfAxes=f.clone(a(t,f.ZERO))}function p(e,t,r,a,o,u,s,c){i(c)||(c=new m);var l=c.halfAxes;f.setColumn(l,0,e.xAxis,l),f.setColumn(l,1,e.yAxis,l),f.setColumn(l,2,e.zAxis,l);var h=I;h.x=(t+r)/2,h.y=(a+o)/2,h.z=(u+s)/2;var d=g;d.x=(r-t)/2,d.y=(o-a)/2,d.z=(s-u)/2;var E=c.center;return h=f.multiplyByVector(l,h,h),n.add(e.origin,h,E),f.multiplyByScale(l,d,l),c}var _=new n,T=new n,y=new n,R=new n,A=new n,S=new n,N=new f,M={unitary:new f,diagonal:new f};m.fromPoints=function(e,t){if(i(t)||(t=new m),!i(e)||0===e.length)return t.halfAxes=f.ZERO,t.center=n.ZERO,t;var r,a=e.length,o=n.clone(e[0],_);for(r=1;r<a;r++)n.add(o,e[r],o);var u=1/a;n.multiplyByScalar(o,u,o);var s,c=0,l=0,h=0,d=0,E=0,p=0;for(r=0;r<a;r++)s=n.subtract(e[r],o,T),c+=s.x*s.x,l+=s.x*s.y,h+=s.x*s.z,d+=s.y*s.y,E+=s.y*s.z,p+=s.z*s.z;c*=u,l*=u,h*=u,d*=u,E*=u,p*=u;var I=N;I[0]=c,I[1]=l,I[2]=h,I[3]=l,I[4]=d,I[5]=E,I[6]=h,I[7]=E,I[8]=p;var g=f.computeEigenDecomposition(I,M),O=f.clone(g.unitary,t.halfAxes),v=f.getColumn(O,0,R),w=f.getColumn(O,1,A),x=f.getColumn(O,2,S),C=-Number.MAX_VALUE,P=-Number.MAX_VALUE,U=-Number.MAX_VALUE,D=Number.MAX_VALUE,F=Number.MAX_VALUE,L=Number.MAX_VALUE;for(r=0;r<a;r++)s=e[r],C=Math.max(n.dot(v,s),C),P=Math.max(n.dot(w,s),P),U=Math.max(n.dot(x,s),U),D=Math.min(n.dot(v,s),D),F=Math.min(n.dot(w,s),F),L=Math.min(n.dot(x,s),L);v=n.multiplyByScalar(v,.5*(D+C),v),w=n.multiplyByScalar(w,.5*(F+P),w),x=n.multiplyByScalar(x,.5*(L+U),x);var B=n.add(v,w,t.center);n.add(B,x,B);var z=y;return z.x=C-D,z.y=P-F,z.z=U-L,n.multiplyByScalar(z,.5,z),f.multiplyByScale(t.halfAxes,z,t.halfAxes),t};var I=new n,g=new n,O=new r,v=new n,w=[new r,new r,new r,new r,new r,new r,new r,new r],x=[new n,new n,new n,new n,new n,new n,new n,new n],C=[new t,new t,new t,new t,new t,new t,new t,new t];m.fromRectangle=function(e,t,n,r,i){t=a(t,0),n=a(n,0),r=a(r,u.WGS84);var o=E.center(e,O),c=r.cartographicToCartesian(o,v),l=new s(c,r),h=l.plane,f=w[0],m=w[1],_=w[2],T=w[3],y=w[4],R=w[5],A=w[6],S=w[7],N=o.longitude,M=e.south<0&&e.north>0?0:o.latitude;A.latitude=R.latitude=y.latitude=e.south,S.latitude=T.latitude=M,f.latitude=m.latitude=_.latitude=e.north,A.longitude=S.longitude=f.longitude=e.west,R.longitude=m.longitude=N,y.longitude=T.longitude=_.longitude=e.east,_.height=m.height=f.height=S.height=A.height=R.height=y.height=T.height=n,r.cartographicArrayToCartesianArray(w,x),l.projectPointsToNearestOnPlane(x,C);var I=Math.min(C[6].x,C[7].x,C[0].x),g=Math.max(C[2].x,C[3].x,C[4].x),P=Math.min(C[4].y,C[5].y,C[6].y),U=Math.max(C[0].y,C[1].y,C[2].y);_.height=f.height=y.height=A.height=t,r.cartographicArrayToCartesianArray(w,x);var D=Math.min(d.getPointDistance(h,x[0]),d.getPointDistance(h,x[2]),d.getPointDistance(h,x[4]),d.getPointDistance(h,x[6])),F=n;return p(l,I,g,P,U,D,F,i)},m.clone=function(e,t){if(i(e))return i(t)?(n.clone(e.center,t.center),f.clone(e.halfAxes,t.halfAxes),t):new m(e.center,e.halfAxes)},m.intersectPlane=function(e,t){var r=e.center,a=t.normal,i=e.halfAxes,o=a.x,u=a.y,s=a.z,l=Math.abs(o*i[f.COLUMN0ROW0]+u*i[f.COLUMN0ROW1]+s*i[f.COLUMN0ROW2])+Math.abs(o*i[f.COLUMN1ROW0]+u*i[f.COLUMN1ROW1]+s*i[f.COLUMN1ROW2])+Math.abs(o*i[f.COLUMN2ROW0]+u*i[f.COLUMN2ROW1]+s*i[f.COLUMN2ROW2]),h=n.dot(a,r)+t.distance;return h<=-l?c.OUTSIDE:h>=l?c.INSIDE:c.INTERSECTING};var P=new n,U=new n,D=new n,F=new n;m.distanceSquaredTo=function(e,t){var r=n.subtract(t,e.center,I),a=e.halfAxes,i=f.getColumn(a,0,P),o=f.getColumn(a,1,U),u=f.getColumn(a,2,D),s=n.magnitude(i),c=n.magnitude(o),l=n.magnitude(u);n.normalize(i,i),n.normalize(o,o),n.normalize(u,u);var h=F;h.x=n.dot(r,i),h.y=n.dot(r,o),h.z=n.dot(r,u);var d,E=0;return h.x<-s?(d=h.x+s,E+=d*d):h.x>s&&(d=h.x-s,E+=d*d),h.y<-c?(d=h.y+c,E+=d*d):h.y>c&&(d=h.y-c,E+=d*d),h.z<-l?(d=h.z+l,E+=d*d):h.z>l&&(d=h.z-l,E+=d*d),E};var L=new n,B=new n;m.computePlaneDistances=function(e,t,r,a){i(a)||(a=new l);var o=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,s=e.center,c=e.halfAxes,h=f.getColumn(c,0,P),d=f.getColumn(c,1,U),E=f.getColumn(c,2,D),m=n.add(h,d,L);n.add(m,E,m),n.add(m,s,m);var p=n.subtract(m,t,B),_=n.dot(r,p);return o=Math.min(_,o),u=Math.max(_,u),n.add(s,h,m),n.add(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.add(s,h,m),n.subtract(m,d,m),n.add(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.add(s,h,m),n.subtract(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,h,m),n.add(m,d,m),n.add(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,h,m),n.add(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,h,m),n.subtract(m,d,m),n.add(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),n.subtract(s,h,m),n.subtract(m,d,m),n.subtract(m,E,m),n.subtract(m,t,p),_=n.dot(r,p),o=Math.min(_,o),u=Math.max(_,u),a.start=o,a.stop=u,a};var z=new e;return m.isOccluded=function(t,n){var r=e.fromOrientedBoundingBox(t,z);return!n.isBoundingSphereVisible(r)},m.prototype.intersectPlane=function(e){return m.intersectPlane(this,e)},m.prototype.distanceSquaredTo=function(e){return m.distanceSquaredTo(this,e)},m.prototype.computePlaneDistances=function(e,t,n){return m.computePlaneDistances(this,e,t,n)},m.prototype.isOccluded=function(e){return m.isOccluded(this,e)},m.equals=function(e,t){return e===t||i(e)&&i(t)&&n.equals(e.center,t.center)&&f.equals(e.halfAxes,t.halfAxes)},m.prototype.clone=function(e){return m.clone(this,e)},m.prototype.equals=function(e){return m.equals(this,e)},m}),define("Core/ComponentDatatype",["./defaultValue","./defined","./DeveloperError","./FeatureDetection","./freezeObject","./WebGLConstants"],function(e,t,n,r,a,i){"use strict";if(!r.supportsTypedArrays())return{};var o={BYTE:i.BYTE,UNSIGNED_BYTE:i.UNSIGNED_BYTE,SHORT:i.SHORT,UNSIGNED_SHORT:i.UNSIGNED_SHORT,INT:i.INT,UNSIGNED_INT:i.UNSIGNED_INT,FLOAT:i.FLOAT,DOUBLE:i.DOUBLE};return o.getSizeInBytes=function(e){switch(e){case o.BYTE:return Int8Array.BYTES_PER_ELEMENT;case o.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case o.SHORT:return Int16Array.BYTES_PER_ELEMENT;case o.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case o.INT:return Int32Array.BYTES_PER_ELEMENT;case o.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case o.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case o.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}},o.fromTypedArray=function(e){return e instanceof Int8Array?o.BYTE:e instanceof Uint8Array?o.UNSIGNED_BYTE:e instanceof Int16Array?o.SHORT:e instanceof Uint16Array?o.UNSIGNED_SHORT:e instanceof Int32Array?o.INT:e instanceof Uint32Array?o.UNSIGNED_INT:e instanceof Float32Array?o.FLOAT:e instanceof Float64Array?o.DOUBLE:void 0},o.validate=function(e){return t(e)&&(e===o.BYTE||e===o.UNSIGNED_BYTE||e===o.SHORT||e===o.UNSIGNED_SHORT||e===o.INT||e===o.UNSIGNED_INT||e===o.FLOAT||e===o.DOUBLE)},o.createTypedArray=function(e,t){switch(e){case o.BYTE:return new Int8Array(t);case o.UNSIGNED_BYTE:return new Uint8Array(t);case o.SHORT:return new Int16Array(t);case o.UNSIGNED_SHORT:return new Uint16Array(t);case o.INT:return new Int32Array(t);case o.UNSIGNED_INT:return new Uint32Array(t);case o.FLOAT:return new Float32Array(t);case o.DOUBLE:return new Float64Array(t)}},o.createArrayBufferView=function(t,n,r,a){switch(r=e(r,0),a=e(a,(n.byteLength-r)/o.getSizeInBytes(t)),t){case o.BYTE:return new Int8Array(n,r,a);case o.UNSIGNED_BYTE:return new Uint8Array(n,r,a);case o.SHORT:return new Int16Array(n,r,a);case o.UNSIGNED_SHORT:return new Uint16Array(n,r,a);case o.INT:return new Int32Array(n,r,a);case o.UNSIGNED_INT:return new Uint32Array(n,r,a);case o.FLOAT:return new Float32Array(n,r,a);case o.DOUBLE:return new Float64Array(n,r,a)}},o.fromName=function(e){switch(e){case"BYTE":return o.BYTE;case"UNSIGNED_BYTE":return o.UNSIGNED_BYTE;case"SHORT":return o.SHORT;case"UNSIGNED_SHORT":return o.UNSIGNED_SHORT;case"INT":return o.INT;case"UNSIGNED_INT":return o.UNSIGNED_INT;case"FLOAT":return o.FLOAT;case"DOUBLE":return o.DOUBLE}},a(o)}),define("Core/TerrainQuantization",["./freezeObject"],function(e){"use strict";var t={NONE:0,BITS12:1};return e(t)}),define("Core/TerrainEncoding",["./AttributeCompression","./Cartesian2","./Cartesian3","./ComponentDatatype","./defaultValue","./defined","./Math","./Matrix4","./TerrainQuantization"],function(e,t,n,r,a,i,o,u,s){"use strict";function c(e,t,r,o,c,f){var p,_,T,y;if(i(e)&&i(t)&&i(r)&&i(o)){var R=e.minimum,A=e.maximum,S=n.subtract(A,R,h),N=r-t,M=Math.max(n.maximumComponent(S),N);p=M<m-1?s.BITS12:s.NONE,_=e.center,T=u.inverseTransformation(o,new u);var I=n.negate(R,l);u.multiply(u.fromTranslation(I,d),T,T);var g=l;g.x=1/S.x,g.y=1/S.y,g.z=1/S.z,u.multiply(u.fromScale(g,d),T,T),y=u.clone(o),u.setTranslation(y,n.ZERO,y),o=u.clone(o,new u);var O=u.fromTranslation(R,d),v=u.fromScale(S,E),w=u.multiply(O,v,d);u.multiply(o,w,o),u.multiply(y,w,y)}this.quantization=p,this.minimumHeight=t,this.maximumHeight=r,this.center=_,this.toScaledENU=T,this.fromScaledENU=o,this.matrix=y,this.hasVertexNormals=c,this.hasWebMercatorT=a(f,!1)}var l=new n,h=new n,f=new t,d=new u,E=new u,m=Math.pow(2,12);c.prototype.encode=function(r,a,i,c,h,d,E){var m=c.x,p=c.y;if(this.quantization===s.BITS12){i=u.multiplyByPoint(this.toScaledENU,i,l),i.x=o.clamp(i.x,0,1),i.y=o.clamp(i.y,0,1),i.z=o.clamp(i.z,0,1);var _=this.maximumHeight-this.minimumHeight,T=o.clamp((h-this.minimumHeight)/_,0,1);t.fromElements(i.x,i.y,f);var y=e.compressTextureCoordinates(f);t.fromElements(i.z,T,f);var R=e.compressTextureCoordinates(f);t.fromElements(m,p,f);var A=e.compressTextureCoordinates(f);if(r[a++]=y,r[a++]=R,r[a++]=A,this.hasWebMercatorT){t.fromElements(E,0,f);var S=e.compressTextureCoordinates(f);r[a++]=S}}else n.subtract(i,this.center,l),r[a++]=l.x,r[a++]=l.y,r[a++]=l.z,r[a++]=h,r[a++]=m,r[a++]=p,this.hasWebMercatorT&&(r[a++]=E);return this.hasVertexNormals&&(r[a++]=e.octPackFloat(d)),a},c.prototype.decodePosition=function(t,r,a){if(i(a)||(a=new n),r*=this.getStride(),this.quantization===s.BITS12){var o=e.decompressTextureCoordinates(t[r],f);a.x=o.x,a.y=o.y;var c=e.decompressTextureCoordinates(t[r+1],f);return a.z=c.x,u.multiplyByPoint(this.fromScaledENU,a,a)}return a.x=t[r],a.y=t[r+1],a.z=t[r+2],n.add(a,this.center,a)},c.prototype.decodeTextureCoordinates=function(n,r,a){return i(a)||(a=new t),r*=this.getStride(),this.quantization===s.BITS12?e.decompressTextureCoordinates(n[r+2],a):t.fromElements(n[r+4],n[r+5],a)},c.prototype.decodeHeight=function(t,n){if(n*=this.getStride(),this.quantization===s.BITS12){ +var r=e.decompressTextureCoordinates(t[n+1],f);return r.y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight}return t[n+3]},c.prototype.getOctEncodedNormal=function(e,n,r){var a=this.getStride();n=(n+1)*a-1;var i=e[n]/256,o=Math.floor(i),u=256*(i-o);return t.fromElements(o,u,r)},c.prototype.getStride=function(){var e;switch(this.quantization){case s.BITS12:e=3;break;default:e=6}return this.hasWebMercatorT&&++e,this.hasVertexNormals&&++e,e};var p={position3DAndHeight:0,textureCoordAndEncodedNormals:1},_={compressed0:0,compressed1:1};return c.prototype.getAttributes=function(e){var t,n=r.FLOAT,a=r.getSizeInBytes(n);if(this.quantization===s.NONE){var i=4,o=2;return this.hasWebMercatorT&&++o,this.hasVertexNormals&&++o,t=(i+o)*a,[{index:p.position3DAndHeight,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:i,offsetInBytes:0,strideInBytes:t},{index:p.textureCoordAndEncodedNormals,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:o,offsetInBytes:i*a,strideInBytes:t}]}var u=3,c=0;return(this.hasWebMercatorT||this.hasVertexNormals)&&++u,this.hasWebMercatorT&&this.hasVertexNormals?(++c,t=(u+c)*a,[{index:_.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u,offsetInBytes:0,strideInBytes:t},{index:_.compressed1,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:c,offsetInBytes:u*a,strideInBytes:t}]):[{index:_.compressed0,vertexBuffer:e,componentDatatype:n,componentsPerAttribute:u}]},c.prototype.getAttributeLocations=function(){return this.quantization===s.NONE?p:_},c.clone=function(e,t){return i(t)||(t=new c),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=n.clone(e.center),t.toScaledENU=u.clone(e.toScaledENU),t.fromScaledENU=u.clone(e.fromScaledENU),t.matrix=u.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t},c}),define("Core/formatError",["./defined"],function(e){"use strict";function t(t){var n,r=t.name,a=t.message;n=e(r)&&e(a)?r+": "+a:t.toString();var i=t.stack;return e(i)&&(n+="\n"+i),n}return t}),define("Workers/createTaskProcessorWorker",["../Core/defaultValue","../Core/defined","../Core/formatError"],function(e,t,n){"use strict";function r(r){var a,i=[],o={id:void 0,result:void 0,error:void 0};return function(u){var s=u.data;i.length=0,o.id=s.id,o.error=void 0,o.result=void 0;try{o.result=r(s.parameters,i)}catch(e){e instanceof Error?o.error={name:e.name,message:e.message,stack:e.stack}:o.error=e}t(a)||(a=e(self.webkitPostMessage,self.postMessage)),s.canTransferArrayBuffer||(i.length=0);try{a(o,i)}catch(e){o.result=void 0,o.error="postMessage failed with error: "+n(e)+"\n with responseMessage: "+JSON.stringify(o),a(o)}}}return r}),define("Workers/upsampleQuantizedTerrainMesh",["../Core/AttributeCompression","../Core/BoundingSphere","../Core/Cartesian2","../Core/Cartesian3","../Core/Cartographic","../Core/defined","../Core/Ellipsoid","../Core/EllipsoidalOccluder","../Core/IndexDatatype","../Core/Intersections2D","../Core/Math","../Core/OrientedBoundingBox","../Core/TerrainEncoding","./createTaskProcessorWorker"],function(e,t,n,r,a,i,o,u,s,c,l,h,f,d){"use strict";function E(e,n){var a=e.isEastChild,i=e.isNorthChild,d=a?y:0,E=a?T:y,p=i?y:0,F=i?T:y,L=I,B=g,z=O,b=w;L.length=0,B.length=0,z.length=0,b.length=0;var q=v;q.length=0;var G={},W=e.vertices,X=e.indices;X=X.subarray(0,e.skirtIndex);var V,H,Y,k=f.clone(e.encoding),Z=k.hasVertexNormals,j=e.exaggeration,K=0,Q=e.vertexCountWithoutSkirts,J=e.minimumHeight,$=e.maximumHeight,ee=new Array(Q),te=new Array(Q),ne=new Array(Q),re=Z?new Array(2*Q):void 0,ae=20;for(H=0,Y=0;H<Q;++H,Y+=2){var ie=k.decodeTextureCoordinates(W,H,U);if(V=k.decodeHeight(W,H)/j,ee[H]=l.clamp(ie.x*T|0,0,T),te[H]=l.clamp(ie.y*T|0,0,T),ne[H]=l.clamp((V-J)/($-J)*T|0,0,T),ee[H]<ae&&(ee[H]=0),te[H]<ae&&(te[H]=0),T-ee[H]<ae&&(ee[H]=T),T-te[H]<ae&&(te[H]=T),Z){var oe=k.getOctEncodedNormal(W,H,D);re[Y]=oe.x,re[Y+1]=oe.y}}var ue,se;for(H=0,Y=0;H<Q;++H,Y+=2)ue=ee[H],se=te[H],(a&&ue>=y||!a&&ue<=y)&&(i&&se>=y||!i&&se<=y)&&(G[H]=K,L.push(ue),B.push(se),z.push(ne[H]),Z&&(b.push(re[Y]),b.push(re[Y+1])),++K);var ce=[];ce.push(new m),ce.push(new m),ce.push(new m);var le=[];le.push(new m),le.push(new m),le.push(new m);var he,fe;for(H=0;H<X.length;H+=3){var de=X[H],Ee=X[H+1],me=X[H+2],pe=ee[de],_e=ee[Ee],Te=ee[me];ce[0].initializeIndexed(ee,te,ne,re,de),ce[1].initializeIndexed(ee,te,ne,re,Ee),ce[2].initializeIndexed(ee,te,ne,re,me);var ye=c.clipTriangleAtAxisAlignedThreshold(y,a,pe,_e,Te,R);he=0,he>=ye.length||(he=le[0].initializeFromClipResult(ye,he,ce),he>=ye.length||(he=le[1].initializeFromClipResult(ye,he,ce),he>=ye.length||(he=le[2].initializeFromClipResult(ye,he,ce),fe=c.clipTriangleAtAxisAlignedThreshold(y,i,le[0].getV(),le[1].getV(),le[2].getV(),A),_(L,B,z,b,q,G,fe,le,Z),he<ye.length&&(le[2].clone(le[1]),le[2].initializeFromClipResult(ye,he,ce),fe=c.clipTriangleAtAxisAlignedThreshold(y,i,le[0].getV(),le[1].getV(),le[2].getV(),A),_(L,B,z,b,q,G,fe,le,Z)))))}var Re=a?-T:0,Ae=i?-T:0,Se=[],Ne=[],Me=[],Ie=[],ge=Number.MAX_VALUE,Oe=-ge,ve=S;ve.length=0;var we=o.clone(e.ellipsoid),xe=e.childRectangle,Ce=xe.north,Pe=xe.south,Ue=xe.east,De=xe.west;for(Ue<De&&(Ue+=l.TWO_PI),H=0;H<L.length;++H)ue=Math.round(L[H]),ue<=d?(Se.push(H),ue=0):ue>=E?(Me.push(H),ue=T):ue=2*ue+Re,L[H]=ue,se=Math.round(B[H]),se<=p?(Ne.push(H),se=0):se>=F?(Ie.push(H),se=T):se=2*se+Ae,B[H]=se,V=l.lerp(J,$,z[H]/T),V<ge&&(ge=V),V>Oe&&(Oe=V),z[H]=V,N.longitude=l.lerp(De,Ue,ue/T),N.latitude=l.lerp(Pe,Ce,se/T),N.height=V,we.cartographicToCartesian(N,M),ve.push(M.x),ve.push(M.y),ve.push(M.z);var Fe=t.fromVertices(ve,r.ZERO,3,C),Le=h.fromRectangle(xe,ge,Oe,we,P),Be=new u(we),ze=Be.computeHorizonCullingPointFromVertices(Fe.center,ve,3,Fe.center,x),be=Oe-ge,qe=new Uint16Array(L.length+B.length+z.length);for(H=0;H<L.length;++H)qe[H]=L[H];var Ge=L.length;for(H=0;H<B.length;++H)qe[Ge+H]=B[H];for(Ge+=B.length,H=0;H<z.length;++H)qe[Ge+H]=T*(z[H]-ge)/be;var We,Xe=s.createTypedArray(L.length,q);if(Z){var Ve=new Uint8Array(b);n.push(qe.buffer,Xe.buffer,Ve.buffer),We=Ve.buffer}else n.push(qe.buffer,Xe.buffer);return{vertices:qe.buffer,encodedNormals:We,indices:Xe.buffer,minimumHeight:ge,maximumHeight:Oe,westIndices:Se,southIndices:Ne,eastIndices:Me,northIndices:Ie,boundingSphere:Fe,orientedBoundingBox:Le,horizonOcclusionPoint:ze}}function m(){this.vertexBuffer=void 0,this.index=void 0,this.first=void 0,this.second=void 0,this.ratio=void 0}function p(t,n){++L;var a=B[L],i=z[L];return a=e.octDecode(t.first.getNormalX(),t.first.getNormalY(),a),i=e.octDecode(t.second.getNormalX(),t.second.getNormalY(),i),M=r.lerp(a,i,t.ratio,M),r.normalize(M,M),e.octEncode(M,n),--L,n}function _(e,t,n,r,a,o,u,s,c){if(0!==u.length){for(var l=0,h=0;h<u.length;)h=b[l++].initializeFromClipResult(u,h,s);for(var f=0;f<l;++f){var d=b[f];if(d.isIndexed())d.newIndex=o[d.index],d.uBuffer=e,d.vBuffer=t,d.heightBuffer=n,c&&(d.normalBuffer=r);else{var E=d.getKey();if(i(o[E]))d.newIndex=o[E];else{var m=e.length;e.push(d.getU()),t.push(d.getV()),n.push(d.getH()),c&&(r.push(d.getNormalX()),r.push(d.getNormalY())),d.newIndex=m,o[E]=m}}}3===l?(a.push(b[0].newIndex),a.push(b[1].newIndex),a.push(b[2].newIndex)):4===l&&(a.push(b[0].newIndex),a.push(b[1].newIndex),a.push(b[2].newIndex),a.push(b[0].newIndex),a.push(b[2].newIndex),a.push(b[3].newIndex))}}var T=32767,y=T/2|0,R=[],A=[],S=[],N=new a,M=new r,I=[],g=[],O=[],v=[],w=[],x=new r,C=new t,P=new h,U=new n,D=new r;m.prototype.clone=function(e){return i(e)||(e=new m),e.uBuffer=this.uBuffer,e.vBuffer=this.vBuffer,e.heightBuffer=this.heightBuffer,e.normalBuffer=this.normalBuffer,e.index=this.index,e.first=this.first,e.second=this.second,e.ratio=this.ratio,e},m.prototype.initializeIndexed=function(e,t,n,r,a){this.uBuffer=e,this.vBuffer=t,this.heightBuffer=n,this.normalBuffer=r,this.index=a,this.first=void 0,this.second=void 0,this.ratio=void 0},m.prototype.initializeFromClipResult=function(e,t,n){var r=t+1;return e[t]!==-1?n[e[t]].clone(this):(this.vertexBuffer=void 0,this.index=void 0,this.first=n[e[r]],++r,this.second=n[e[r]],++r,this.ratio=e[r],++r),r},m.prototype.getKey=function(){return this.isIndexed()?this.index:JSON.stringify({first:this.first.getKey(),second:this.second.getKey(),ratio:this.ratio})},m.prototype.isIndexed=function(){return i(this.index)},m.prototype.getH=function(){return i(this.index)?this.heightBuffer[this.index]:l.lerp(this.first.getH(),this.second.getH(),this.ratio)},m.prototype.getU=function(){return i(this.index)?this.uBuffer[this.index]:l.lerp(this.first.getU(),this.second.getU(),this.ratio)},m.prototype.getV=function(){return i(this.index)?this.vBuffer[this.index]:l.lerp(this.first.getV(),this.second.getV(),this.ratio)};var F=new n,L=-1,B=[new r,new r],z=[new r,new r];m.prototype.getNormalX=function(){return i(this.index)?this.normalBuffer[2*this.index]:(F=p(this,F),F.x)},m.prototype.getNormalY=function(){return i(this.index)?this.normalBuffer[2*this.index+1]:(F=p(this,F),F.y)};var b=[];return b.push(new m),b.push(new m),b.push(new m),b.push(new m),d(E)})}(); \ No newline at end of file diff --git a/pages/babylon.js b/pages/babylon.js index db0edfa..4dde115 100644 --- a/pages/babylon.js +++ b/pages/babylon.js @@ -45,10 +45,11 @@ var BabylonPreview = function() { engine.enableOfflineSupport = false; var rootPath = document.getElementById("gltfRootPath").textContent; - var fileName = document.getElementById("gltfFileName").textContent; + var gltfContent = document.getElementById('gltf').textContent; + var data = JSON.stringify(JSON.parse(gltfContent)); BABYLON.GLTFFileLoader.IncrementalLoading = false; - BABYLON.SceneLoader.Load(rootPath, fileName, engine, function(newScene) { + BABYLON.SceneLoader.Load(rootPath, 'data:' + data, engine, function(newScene) { scene = newScene; scene.createDefaultCameraOrLight(true); scene.activeCamera.attachControl(canvas); diff --git a/pages/cesium.js b/pages/cesium.js index c89dba3..ae7b79c 100644 --- a/pages/cesium.js +++ b/pages/cesium.js @@ -64,15 +64,7 @@ var CesiumPreview = function() { var model = scene.primitives.add(new Cesium.Model({ gltf: gltfContent, - - // In theory, by specifying basePath, we should be able to have relative paths - // within the glTFContent. In practice, specifying basePath makes no difference. - // This is likely a bug in Cesium (tracked by https://github.com/AnalyticalGraphicsInc/cesium/issues/5319). - // For now, we'll continue with specifying the basePath here, but we'll also - // make sure that all paths in glTFContent are absolute to work around the bug. - // That logic happens at the time when the content gets written to the script - // tag in the HTML. - basePath: gltfRootPath.replace(/\\/g, "\\\\") + "\\" + basePath: gltfRootPath })); loadModel(model, resetCamera); @@ -82,12 +74,8 @@ var CesiumPreview = function() { scene.primitives.removeAll(); var model = scene.primitives.add(Cesium.Model.fromGltf({ - url: gltfRootPath.replace(/\\/g, "\\\\") + "\\" + gltfFileName, - - // Unfortunately, Cesium does not currently allow a basePath to be specified - // when loading a glTF file...that means it only works with glTF files that - // use absolute paths internally. This Cesium feature request is tracked by - // https://github.com/AnalyticalGraphicsInc/cesium/issues/5320. + url: gltfRootPath + gltfFileName, + basePath: gltfRootPath })); loadModel(model, resetCamera); @@ -142,7 +130,7 @@ var CesiumPreview = function() { resize(); var gltfFileName = document.getElementById('gltfFileName').textContent; - var gltfRootPath = document.getElementById('gltfRootPath').textContent; + var gltfRootPath = "file://" + document.getElementById('gltfRootPath').textContent; try { clearWarning();